diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 2adc1c9e..ad9c1da0 --- a/README.md +++ b/README.md @@ -1 +1,97 @@ -# FinalProject \ No newline at end of file +# [Music Visualizer](https://youtu.be/ePKxjf9t\_z8) + +# Design Document + + + +# Introduction +My Music Visualizer is a procedurally generated speaker that shows interesting graphics tuned to a music track. With different camera views, varied colors and shape grammar iterations, the visualizer makes music more dynamic. + +# Goal +My goal is to produce a demo choreographed to a music track to show various visual elements I have added to make the visualizer appealing. + +# Inspiration / Reference +I was inspired by the JBL Pulse 2, a portable speaker that visualizes the sound it plays with interactive lights. It has a cylindrical body and lights all around the surface that light up in different colors to while playing music. + + + +I wanted my visualizer to have a similar feel, but at the same time, achieve a look that is hard to replicate in real life. So, I wanted to use shape grammar to produce interesting shapes that will be laid out in place of the lights and iterate them based on music. + +# Specification +The main features of my project are as follows – + +- Shape Grammar (randomly colored and sized shapes laid on top of one another in interesting placements) +- Music-dependent changes (changing colors, bulging speaker, iterating shapes) +- Camera movement (rotation, zoom) + +# Techniques +The main technical tools I use are as follows – + +- Shape Grammar / L-Systems +- Sound Analysis +- Noise Shader + +# Design +Here is a diagram of how I planned to design my visualizer. + + + +# Timeline +**Week 1** +- Design shape grammar +- Design speaker +- Layout shape grammar onto the speaker + +**Milestone** +Submit working shape grammar laid out on speaker. + +**Week 2** +- Allow for live iterations in shape grammar +- Write shader +- Add sound based features – color changes, iterations +- Add camera movement + +**Final Milestone** +Submit fully working visualizer. + +# Results +**Shape Grammar** + +I designed shape grammar such that it starts with a "level" (can be either box of dimensions greater than half of or equal to given radius or cylinder of bottom radius greater than half of or equal to given radius and top radius greater than half of or equal to bottom radius, of random color) and a variable that changes in next iteration to either place the next level in the center on top of the last one, choose between placing two, three, four or eight smaller subdivisions in random positions on the last level, or both. I then also saved my objects so that iteration changes don't change the shape, color and size. + + + + +**Music dependent features** + +The music dependent features on my visualizer include a shader that changes the color of the cylinders laid out on the speaker based on perlin noise using a color palette, background that changes using a cosine based palette, an increase or decrease in the camera fov to give a bulging effect and iterations in the shape grammar. All of these take in the average frequency at current time of the music file. + + + + +**Camera Animation** + +The camera movement is hard-coded to showcase all the features of my visualizer. These movements include rotation along the xz plane in different radii and and zoomed in rotation to show the shape grammar develop. + + +# Evaluation +My speaker turned out to be mostly what I expected. I was able to achieve the look and feel that I wanted from the visualizer. + +However, there were some changes I had to make along the way. +- Shaders – I had first planned to write shaders for the background and the bulging as well, but just modifying the colors and camera fov worked perfectly fine and saved a lot of time. +- Camera movement – Camera movement was an addition I hadn't initially thought of making, but realized that it looks a lot better with it than without. +- Iterations – At first my iterations looked very different because I wasn't storing my geometries. Every time the frequency changed, my shapes looked entirely different, defeating the purpose of making them music-dependent. So, I ended up storing the geometries during initialization and adding or removing them from the scene when the number of iterations was changed. + +Unfortunately, I wasn't able to make gifs along the way for these changes. + +# Future work +Given more time, I would like to write more shaders to modify the background and the general look of my speaker. I would also like too allow for an option to play your own song. Moreover, I would try to animate the the increase and decrease in iterations in some way. + +# Acknowledgements +My project was in large part suggested by Rachel. She suggested that I lay out my shape grammar on a cylinder and choreograph the iterations based on music. +I used noise functions from the class lecture slides for my shader. +For the current track, I used music from [DVBBS & CMC$ - Not Going Home (Mesto Remix)](https://www.youtube.com/watch?v=t75oPQubFI4&index=1&list=PL3lkWEnhkNuYlklz1XVhctuHs7050dSNT). +I also used [Inigo Quilez' color palette function](http://iquilezles.org/www/articles/palettes/palettes.htm) to change background color based on frequency. + +# Demo +You can watch a demo of my project on YouTube - [https://youtu.be/ePKxjf9t\_z8](https://youtu.be/ePKxjf9t_z8). \ No newline at end of file diff --git a/backgroundColor.gif b/backgroundColor.gif new file mode 100644 index 00000000..2fdb99b5 Binary files /dev/null and b/backgroundColor.gif differ diff --git a/bundle.js b/bundle.js new file mode 100644 index 00000000..e3d4a66c --- /dev/null +++ b/bundle.js @@ -0,0 +1,48414 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var _framework = __webpack_require__(1); + + var _framework2 = _interopRequireDefault(_framework); + + var _houseParser = __webpack_require__(8); + + var _houseParser2 = _interopRequireDefault(_houseParser); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var THREE = __webpack_require__(6); + + + var input = { + layout: false, + shapeGrammar: true + }; + + function onLoad(framework) { + var scene = framework.scene, + camera = framework.camera, + renderer = framework.renderer, + gui = framework.gui, + stats = framework.stats; + + + lightsCamera(scene, camera); + showShapeGrammar(scene, camera); + showLayout(scene, camera); + + gui.add(camera, 'fov', 0, 180).onChange(function (newVal) { + camera.updateProjectionMatrix(); + }); + + gui.add(input, "shapeGrammar").onChange(function (newVal) { + clearScene(scene, camera); + showShapeGrammar(scene, camera); + showLayout(scene, camera); + }); + + gui.add(input, "layout").onChange(function (newVal) { + clearScene(scene, camera); + showShapeGrammar(scene, camera); + showLayout(scene, camera); + }); + } + + function clearScene(scene, camera) { + while (scene.children.length > 0) { + scene.remove(scene.children[0]); + } + + lightsCamera(scene, camera); + } + + function lightsCamera(scene, camera) { + camera.position.set(1, 100, 200); + camera.lookAt(new THREE.Vector3(0, 0, 0)); + + var light = new THREE.AmbientLight(0x404040); // soft white light + scene.add(light); + + var directionalLight = new THREE.DirectionalLight(0xffffff, 1.0); + directionalLight.position.set(75, 100, 0); + scene.add(directionalLight); + } + + function showShapeGrammar(scene, camera) { + if (input.shapeGrammar && !input.layout) { + camera.position.set(1, 10, 10); + camera.lookAt(new THREE.Vector3(0, 0, 0)); + + var position = new THREE.Vector3(0, 0, 0); + var direction = new THREE.Vector3(0, 1, 0); + var parser = new _houseParser2.default(position, direction, scene, 4, 10); + parser.render(); + } + } + + function showLayout(scene, camera) { + if (input.layout) { + camera.position.set(1, 100, 200); + camera.lookAt(new THREE.Vector3(0, 0, 0)); + + var height = 100; + var radius = 50; + + //speaker mid + var spkMG = new THREE.CylinderGeometry(radius, radius, height, 32); + var spkMM = new THREE.MeshLambertMaterial({ color: 0xa9a9a9 }); + var spkM = new THREE.Mesh(spkMG, spkMM); + scene.add(spkM); + + //speaker top + var spkTG = new THREE.CylinderGeometry(2 * radius / 3, radius, height / 4, 32); + var spkTM = new THREE.MeshLambertMaterial({ color: 0xa9a9a9 }); + var spkT = new THREE.Mesh(spkTG, spkTM); + spkT.position.set(0, 10 * height / 16, 0); + scene.add(spkT); + + //speaker base + var spkBG = new THREE.CylinderGeometry(radius, 2 * radius / 3, height / 4, 32); + var spkBM = new THREE.MeshLambertMaterial({ color: 0xa9a9a9 }); + var spkB = new THREE.Mesh(spkBG, spkBM); + spkB.position.set(0, -5 * height / 8, 0); + scene.add(spkB); + + for (var y = -(height / 2) + 5; y < height / 2; y += 5) { + for (var x = 5 - radius; x < radius; x += 5) { + var z = Math.sqrt(radius * radius - x * x); + var dir = new THREE.Vector3(-x, y, -z); + var dirO = new THREE.Vector3(-x, y, z); + + var cg = new THREE.CylinderGeometry(2.5, 2.5, 2, 16); + var m = new THREE.MeshLambertMaterial({ color: 0xffff00 }); + var cyl = new THREE.Mesh(cg, m); + + cyl.position.set(x, y, z); + cyl.lookAt(dir); + cyl.rotateX(Math.PI / 2); + scene.add(cyl); + + var cg2 = new THREE.CylinderGeometry(2.5, 2.5, 2, 16); + var cyl2 = new THREE.Mesh(cg2, m); + + cyl2.position.set(x, y, -z); + cyl2.lookAt(dirO); + cyl2.rotateX(Math.PI / 2); + scene.add(cyl2); + + if (input.shapeGrammar) { + var position = new THREE.Vector3(x, y, -z); + var direction = dir.normalize(); + var parser = new _houseParser2.default(position, direction, scene, 4, 2.5); + + var position2 = new THREE.Vector3(x, y, z); + var direction2 = dirO.normalize(); + var parser2 = new _houseParser2.default(position2, direction2, scene, 4, 2.5); + + parser.render(); + parser2.render(); + } + } + } + } + } + + function onUpdate(framework) {} + + _framework2.default.init(onLoad, onUpdate); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.e = exports.PI = undefined; + + var _statsJs = __webpack_require__(2); + + var _statsJs2 = _interopRequireDefault(_statsJs); + + var _datGui = __webpack_require__(3); + + var _datGui2 = _interopRequireDefault(_datGui); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var THREE = __webpack_require__(6); + var OrbitControls = __webpack_require__(7)(THREE); + + + // when the scene is done initializing, the function passed as `callback` will be executed + // then, every frame, the function passed as `update` will be executed + function init(callback, update) { + var stats = new _statsJs2.default(); + stats.setMode(1); + stats.domElement.style.position = 'absolute'; + stats.domElement.style.left = '0px'; + stats.domElement.style.top = '0px'; + document.body.appendChild(stats.domElement); + + var gui = new _datGui2.default.GUI(); + + var framework = { + gui: gui, + stats: stats + }; + + // run this function after the window loads + window.addEventListener('load', function () { + + var scene = new THREE.Scene(); + var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); + var renderer = new THREE.WebGLRenderer({ antialias: true }); + renderer.setPixelRatio(window.devicePixelRatio); + renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setClearColor(0xeeeeee, 1); + + var controls = new OrbitControls(camera, renderer.domElement); + controls.enableDamping = true; + controls.enableZoom = true; + controls.target.set(0, 0, 0); + controls.rotateSpeed = 0.3; + controls.zoomSpeed = 1.0; + controls.panSpeed = 2.0; + + document.body.appendChild(renderer.domElement); + + // resize the canvas when the window changes + window.addEventListener('resize', function () { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + renderer.setSize(window.innerWidth, window.innerHeight); + }); + + // assign THREE.js objects to the object we will return + framework.scene = scene; + framework.camera = camera; + framework.renderer = renderer; + + // begin the animation loop + (function tick() { + stats.begin(); + update(framework); // perform any requested updates + renderer.render(scene, camera); // render the scene + stats.end(); + requestAnimationFrame(tick); // register to call this again when the browser renders a new frame + })(); + + // we will pass the scene, gui, renderer, camera, etc... to the callback function + return callback(framework); + }); + } + + exports.default = { + init: init + }; + var PI = exports.PI = 3.14159265; + var e = exports.e = 2.7181718; + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + + // stats.js - http://github.com/mrdoob/stats.js + var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; + i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); + k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= + "block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= + a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(4) + module.exports.color = __webpack_require__(5) + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + + /** @namespace */ + var dat = module.exports = dat || {}; + + /** @namespace */ + dat.gui = dat.gui || {}; + + /** @namespace */ + dat.utils = dat.utils || {}; + + /** @namespace */ + dat.controllers = dat.controllers || {}; + + /** @namespace */ + dat.dom = dat.dom || {}; + + /** @namespace */ + dat.color = dat.color || {}; + + dat.utils.css = (function () { + return { + load: function (url, doc) { + doc = doc || document; + var link = doc.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; + link.href = url; + doc.getElementsByTagName('head')[0].appendChild(link); + }, + inject: function(css, doc) { + doc = doc || document; + var injected = document.createElement('style'); + injected.type = 'text/css'; + injected.innerHTML = css; + doc.getElementsByTagName('head')[0].appendChild(injected); + } + } + })(); + + + dat.utils.common = (function () { + + var ARR_EACH = Array.prototype.forEach; + var ARR_SLICE = Array.prototype.slice; + + /** + * Band-aid methods for things that should be a lot easier in JavaScript. + * Implementation and structure inspired by underscore.js + * http://documentcloud.github.com/underscore/ + */ + + return { + + BREAK: {}, + + extend: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (!this.isUndefined(obj[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + defaults: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (this.isUndefined(target[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + compose: function() { + var toCall = ARR_SLICE.call(arguments); + return function() { + var args = ARR_SLICE.call(arguments); + for (var i = toCall.length -1; i >= 0; i--) { + args = [toCall[i].apply(this, args)]; + } + return args[0]; + } + }, + + each: function(obj, itr, scope) { + + + if (ARR_EACH && obj.forEach === ARR_EACH) { + + obj.forEach(itr, scope); + + } else if (obj.length === obj.length + 0) { // Is number but not NaN + + for (var key = 0, l = obj.length; key < l; key++) + if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) + return; + + } else { + + for (var key in obj) + if (itr.call(scope, obj[key], key) === this.BREAK) + return; + + } + + }, + + defer: function(fnc) { + setTimeout(fnc, 0); + }, + + toArray: function(obj) { + if (obj.toArray) return obj.toArray(); + return ARR_SLICE.call(obj); + }, + + isUndefined: function(obj) { + return obj === undefined; + }, + + isNull: function(obj) { + return obj === null; + }, + + isNaN: function(obj) { + return obj !== obj; + }, + + isArray: Array.isArray || function(obj) { + return obj.constructor === Array; + }, + + isObject: function(obj) { + return obj === Object(obj); + }, + + isNumber: function(obj) { + return obj === obj+0; + }, + + isString: function(obj) { + return obj === obj+''; + }, + + isBoolean: function(obj) { + return obj === false || obj === true; + }, + + isFunction: function(obj) { + return Object.prototype.toString.call(obj) === '[object Function]'; + } + + }; + + })(); + + + dat.controllers.Controller = (function (common) { + + /** + * @class An "abstract" class that represents a given property of an object. + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var Controller = function(object, property) { + + this.initialValue = object[property]; + + /** + * Those who extend this class will put their DOM elements in here. + * @type {DOMElement} + */ + this.domElement = document.createElement('div'); + + /** + * The object to manipulate + * @type {Object} + */ + this.object = object; + + /** + * The name of the property to manipulate + * @type {String} + */ + this.property = property; + + /** + * The function to be called on change. + * @type {Function} + * @ignore + */ + this.__onChange = undefined; + + /** + * The function to be called on finishing change. + * @type {Function} + * @ignore + */ + this.__onFinishChange = undefined; + + }; + + common.extend( + + Controller.prototype, + + /** @lends dat.controllers.Controller.prototype */ + { + + /** + * Specify that a function fire every time someone changes the value with + * this Controller. + * + * @param {Function} fnc This function will be called whenever the value + * is modified via this Controller. + * @returns {dat.controllers.Controller} this + */ + onChange: function(fnc) { + this.__onChange = fnc; + return this; + }, + + /** + * Specify that a function fire every time someone "finishes" changing + * the value wih this Controller. Useful for values that change + * incrementally like numbers or strings. + * + * @param {Function} fnc This function will be called whenever + * someone "finishes" changing the value via this Controller. + * @returns {dat.controllers.Controller} this + */ + onFinishChange: function(fnc) { + this.__onFinishChange = fnc; + return this; + }, + + /** + * Change the value of object[property] + * + * @param {Object} newValue The new value of object[property] + */ + setValue: function(newValue) { + this.object[this.property] = newValue; + if (this.__onChange) { + this.__onChange.call(this, newValue); + } + this.updateDisplay(); + return this; + }, + + /** + * Gets the value of object[property] + * + * @returns {Object} The current value of object[property] + */ + getValue: function() { + return this.object[this.property]; + }, + + /** + * Refreshes the visual display of a Controller in order to keep sync + * with the object's current value. + * @returns {dat.controllers.Controller} this + */ + updateDisplay: function() { + return this; + }, + + /** + * @returns {Boolean} true if the value has deviated from initialValue + */ + isModified: function() { + return this.initialValue !== this.getValue() + } + + } + + ); + + return Controller; + + + })(dat.utils.common); + + + dat.dom.dom = (function (common) { + + var EVENT_MAP = { + 'HTMLEvents': ['change'], + 'MouseEvents': ['click','mousemove','mousedown','mouseup', 'mouseover'], + 'KeyboardEvents': ['keydown'] + }; + + var EVENT_MAP_INV = {}; + common.each(EVENT_MAP, function(v, k) { + common.each(v, function(e) { + EVENT_MAP_INV[e] = k; + }); + }); + + var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/; + + function cssValueToPixels(val) { + + if (val === '0' || common.isUndefined(val)) return 0; + + var match = val.match(CSS_VALUE_PIXELS); + + if (!common.isNull(match)) { + return parseFloat(match[1]); + } + + // TODO ...ems? %? + + return 0; + + } + + /** + * @namespace + * @member dat.dom + */ + var dom = { + + /** + * + * @param elem + * @param selectable + */ + makeSelectable: function(elem, selectable) { + + if (elem === undefined || elem.style === undefined) return; + + elem.onselectstart = selectable ? function() { + return false; + } : function() { + }; + + elem.style.MozUserSelect = selectable ? 'auto' : 'none'; + elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none'; + elem.unselectable = selectable ? 'on' : 'off'; + + }, + + /** + * + * @param elem + * @param horizontal + * @param vertical + */ + makeFullscreen: function(elem, horizontal, vertical) { + + if (common.isUndefined(horizontal)) horizontal = true; + if (common.isUndefined(vertical)) vertical = true; + + elem.style.position = 'absolute'; + + if (horizontal) { + elem.style.left = 0; + elem.style.right = 0; + } + if (vertical) { + elem.style.top = 0; + elem.style.bottom = 0; + } + + }, + + /** + * + * @param elem + * @param eventType + * @param params + */ + fakeEvent: function(elem, eventType, params, aux) { + params = params || {}; + var className = EVENT_MAP_INV[eventType]; + if (!className) { + throw new Error('Event type ' + eventType + ' not supported.'); + } + var evt = document.createEvent(className); + switch (className) { + case 'MouseEvents': + var clientX = params.x || params.clientX || 0; + var clientY = params.y || params.clientY || 0; + evt.initMouseEvent(eventType, params.bubbles || false, + params.cancelable || true, window, params.clickCount || 1, + 0, //screen X + 0, //screen Y + clientX, //client X + clientY, //client Y + false, false, false, false, 0, null); + break; + case 'KeyboardEvents': + var init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz + common.defaults(params, { + cancelable: true, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: undefined, + charCode: undefined + }); + init(eventType, params.bubbles || false, + params.cancelable, window, + params.ctrlKey, params.altKey, + params.shiftKey, params.metaKey, + params.keyCode, params.charCode); + break; + default: + evt.initEvent(eventType, params.bubbles || false, + params.cancelable || true); + break; + } + common.defaults(evt, aux); + elem.dispatchEvent(evt); + }, + + /** + * + * @param elem + * @param event + * @param func + * @param bool + */ + bind: function(elem, event, func, bool) { + bool = bool || false; + if (elem.addEventListener) + elem.addEventListener(event, func, bool); + else if (elem.attachEvent) + elem.attachEvent('on' + event, func); + return dom; + }, + + /** + * + * @param elem + * @param event + * @param func + * @param bool + */ + unbind: function(elem, event, func, bool) { + bool = bool || false; + if (elem.removeEventListener) + elem.removeEventListener(event, func, bool); + else if (elem.detachEvent) + elem.detachEvent('on' + event, func); + return dom; + }, + + /** + * + * @param elem + * @param className + */ + addClass: function(elem, className) { + if (elem.className === undefined) { + elem.className = className; + } else if (elem.className !== className) { + var classes = elem.className.split(/ +/); + if (classes.indexOf(className) == -1) { + classes.push(className); + elem.className = classes.join(' ').replace(/^\s+/, '').replace(/\s+$/, ''); + } + } + return dom; + }, + + /** + * + * @param elem + * @param className + */ + removeClass: function(elem, className) { + if (className) { + if (elem.className === undefined) { + // elem.className = className; + } else if (elem.className === className) { + elem.removeAttribute('class'); + } else { + var classes = elem.className.split(/ +/); + var index = classes.indexOf(className); + if (index != -1) { + classes.splice(index, 1); + elem.className = classes.join(' '); + } + } + } else { + elem.className = undefined; + } + return dom; + }, + + hasClass: function(elem, className) { + return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(elem.className) || false; + }, + + /** + * + * @param elem + */ + getWidth: function(elem) { + + var style = getComputedStyle(elem); + + return cssValueToPixels(style['border-left-width']) + + cssValueToPixels(style['border-right-width']) + + cssValueToPixels(style['padding-left']) + + cssValueToPixels(style['padding-right']) + + cssValueToPixels(style['width']); + }, + + /** + * + * @param elem + */ + getHeight: function(elem) { + + var style = getComputedStyle(elem); + + return cssValueToPixels(style['border-top-width']) + + cssValueToPixels(style['border-bottom-width']) + + cssValueToPixels(style['padding-top']) + + cssValueToPixels(style['padding-bottom']) + + cssValueToPixels(style['height']); + }, + + /** + * + * @param elem + */ + getOffset: function(elem) { + var offset = {left: 0, top:0}; + if (elem.offsetParent) { + do { + offset.left += elem.offsetLeft; + offset.top += elem.offsetTop; + } while (elem = elem.offsetParent); + } + return offset; + }, + + // http://stackoverflow.com/posts/2684561/revisions + /** + * + * @param elem + */ + isActive: function(elem) { + return elem === document.activeElement && ( elem.type || elem.href ); + } + + }; + + return dom; + + })(dat.utils.common); + + + dat.controllers.OptionController = (function (Controller, dom, common) { + + /** + * @class Provides a select input to alter the property of an object, using a + * list of accepted values. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Object|string[]} options A map of labels to acceptable values, or + * a list of acceptable string values. + * + * @member dat.controllers + */ + var OptionController = function(object, property, options) { + + OptionController.superclass.call(this, object, property); + + var _this = this; + + /** + * The drop down menu + * @ignore + */ + this.__select = document.createElement('select'); + + if (common.isArray(options)) { + var map = {}; + common.each(options, function(element) { + map[element] = element; + }); + options = map; + } + + common.each(options, function(value, key) { + + var opt = document.createElement('option'); + opt.innerHTML = key; + opt.setAttribute('value', value); + _this.__select.appendChild(opt); + + }); + + // Acknowledge original value + this.updateDisplay(); + + dom.bind(this.__select, 'change', function() { + var desiredValue = this.options[this.selectedIndex].value; + _this.setValue(desiredValue); + }); + + this.domElement.appendChild(this.__select); + + }; + + OptionController.superclass = Controller; + + common.extend( + + OptionController.prototype, + Controller.prototype, + + { + + setValue: function(v) { + var toReturn = OptionController.superclass.prototype.setValue.call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + return toReturn; + }, + + updateDisplay: function() { + this.__select.value = this.getValue(); + return OptionController.superclass.prototype.updateDisplay.call(this); + } + + } + + ); + + return OptionController; + + })(dat.controllers.Controller, + dat.dom.dom, + dat.utils.common); + + + dat.controllers.NumberController = (function (Controller, common) { + + /** + * @class Represents a given property of an object that is a number. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Object} [params] Optional parameters + * @param {Number} [params.min] Minimum allowed value + * @param {Number} [params.max] Maximum allowed value + * @param {Number} [params.step] Increment by which to change value + * + * @member dat.controllers + */ + var NumberController = function(object, property, params) { + + NumberController.superclass.call(this, object, property); + + params = params || {}; + + this.__min = params.min; + this.__max = params.max; + this.__step = params.step; + + if (common.isUndefined(this.__step)) { + + if (this.initialValue == 0) { + this.__impliedStep = 1; // What are we, psychics? + } else { + // Hey Doug, check this out. + this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue)/Math.LN10))/10; + } + + } else { + + this.__impliedStep = this.__step; + + } + + this.__precision = numDecimals(this.__impliedStep); + + + }; + + NumberController.superclass = Controller; + + common.extend( + + NumberController.prototype, + Controller.prototype, + + /** @lends dat.controllers.NumberController.prototype */ + { + + setValue: function(v) { + + if (this.__min !== undefined && v < this.__min) { + v = this.__min; + } else if (this.__max !== undefined && v > this.__max) { + v = this.__max; + } + + if (this.__step !== undefined && v % this.__step != 0) { + v = Math.round(v / this.__step) * this.__step; + } + + return NumberController.superclass.prototype.setValue.call(this, v); + + }, + + /** + * Specify a minimum value for object[property]. + * + * @param {Number} minValue The minimum value for + * object[property] + * @returns {dat.controllers.NumberController} this + */ + min: function(v) { + this.__min = v; + return this; + }, + + /** + * Specify a maximum value for object[property]. + * + * @param {Number} maxValue The maximum value for + * object[property] + * @returns {dat.controllers.NumberController} this + */ + max: function(v) { + this.__max = v; + return this; + }, + + /** + * Specify a step value that dat.controllers.NumberController + * increments by. + * + * @param {Number} stepValue The step value for + * dat.controllers.NumberController + * @default if minimum and maximum specified increment is 1% of the + * difference otherwise stepValue is 1 + * @returns {dat.controllers.NumberController} this + */ + step: function(v) { + this.__step = v; + return this; + } + + } + + ); + + function numDecimals(x) { + x = x.toString(); + if (x.indexOf('.') > -1) { + return x.length - x.indexOf('.') - 1; + } else { + return 0; + } + } + + return NumberController; + + })(dat.controllers.Controller, + dat.utils.common); + + + dat.controllers.NumberControllerBox = (function (NumberController, dom, common) { + + /** + * @class Represents a given property of an object that is a number and + * provides an input element with which to manipulate it. + * + * @extends dat.controllers.Controller + * @extends dat.controllers.NumberController + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Object} [params] Optional parameters + * @param {Number} [params.min] Minimum allowed value + * @param {Number} [params.max] Maximum allowed value + * @param {Number} [params.step] Increment by which to change value + * + * @member dat.controllers + */ + var NumberControllerBox = function(object, property, params) { + + this.__truncationSuspended = false; + + NumberControllerBox.superclass.call(this, object, property, params); + + var _this = this; + + /** + * {Number} Previous mouse y position + * @ignore + */ + var prev_y; + + this.__input = document.createElement('input'); + this.__input.setAttribute('type', 'text'); + + // Makes it so manually specified values are not truncated. + + dom.bind(this.__input, 'change', onChange); + dom.bind(this.__input, 'blur', onBlur); + dom.bind(this.__input, 'mousedown', onMouseDown); + dom.bind(this.__input, 'keydown', function(e) { + + // When pressing entire, you can be as precise as you want. + if (e.keyCode === 13) { + _this.__truncationSuspended = true; + this.blur(); + _this.__truncationSuspended = false; + } + + }); + + function onChange() { + var attempted = parseFloat(_this.__input.value); + if (!common.isNaN(attempted)) _this.setValue(attempted); + } + + function onBlur() { + onChange(); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + function onMouseDown(e) { + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + prev_y = e.clientY; + } + + function onMouseDrag(e) { + + var diff = prev_y - e.clientY; + _this.setValue(_this.getValue() + diff * _this.__impliedStep); + + prev_y = e.clientY; + + } + + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + } + + this.updateDisplay(); + + this.domElement.appendChild(this.__input); + + }; + + NumberControllerBox.superclass = NumberController; + + common.extend( + + NumberControllerBox.prototype, + NumberController.prototype, + + { + + updateDisplay: function() { + + this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); + return NumberControllerBox.superclass.prototype.updateDisplay.call(this); + } + + } + + ); + + function roundToDecimal(value, decimals) { + var tenTo = Math.pow(10, decimals); + return Math.round(value * tenTo) / tenTo; + } + + return NumberControllerBox; + + })(dat.controllers.NumberController, + dat.dom.dom, + dat.utils.common); + + + dat.controllers.NumberControllerSlider = (function (NumberController, dom, css, common, styleSheet) { + + /** + * @class Represents a given property of an object that is a number, contains + * a minimum and maximum, and provides a slider element with which to + * manipulate it. It should be noted that the slider element is made up of + * <div> tags, not the html5 + * <slider> element. + * + * @extends dat.controllers.Controller + * @extends dat.controllers.NumberController + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Number} minValue Minimum allowed value + * @param {Number} maxValue Maximum allowed value + * @param {Number} stepValue Increment by which to change value + * + * @member dat.controllers + */ + var NumberControllerSlider = function(object, property, min, max, step) { + + NumberControllerSlider.superclass.call(this, object, property, { min: min, max: max, step: step }); + + var _this = this; + + this.__background = document.createElement('div'); + this.__foreground = document.createElement('div'); + + + + dom.bind(this.__background, 'mousedown', onMouseDown); + + dom.addClass(this.__background, 'slider'); + dom.addClass(this.__foreground, 'slider-fg'); + + function onMouseDown(e) { + + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + + onMouseDrag(e); + } + + function onMouseDrag(e) { + + e.preventDefault(); + + var offset = dom.getOffset(_this.__background); + var width = dom.getWidth(_this.__background); + + _this.setValue( + map(e.clientX, offset.left, offset.left + width, _this.__min, _this.__max) + ); + + return false; + + } + + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + this.updateDisplay(); + + this.__background.appendChild(this.__foreground); + this.domElement.appendChild(this.__background); + + }; + + NumberControllerSlider.superclass = NumberController; + + /** + * Injects default stylesheet for slider elements. + */ + NumberControllerSlider.useDefaultStyles = function() { + css.inject(styleSheet); + }; + + common.extend( + + NumberControllerSlider.prototype, + NumberController.prototype, + + { + + updateDisplay: function() { + var pct = (this.getValue() - this.__min)/(this.__max - this.__min); + this.__foreground.style.width = pct*100+'%'; + return NumberControllerSlider.superclass.prototype.updateDisplay.call(this); + } + + } + + + + ); + + function map(v, i1, i2, o1, o2) { + return o1 + (o2 - o1) * ((v - i1) / (i2 - i1)); + } + + return NumberControllerSlider; + + })(dat.controllers.NumberController, + dat.dom.dom, + dat.utils.css, + dat.utils.common, + ".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); + + + dat.controllers.FunctionController = (function (Controller, dom, common) { + + /** + * @class Provides a GUI interface to fire a specified method, a property of an object. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var FunctionController = function(object, property, text) { + + FunctionController.superclass.call(this, object, property); + + var _this = this; + + this.__button = document.createElement('div'); + this.__button.innerHTML = text === undefined ? 'Fire' : text; + dom.bind(this.__button, 'click', function(e) { + e.preventDefault(); + _this.fire(); + return false; + }); + + dom.addClass(this.__button, 'button'); + + this.domElement.appendChild(this.__button); + + + }; + + FunctionController.superclass = Controller; + + common.extend( + + FunctionController.prototype, + Controller.prototype, + { + + fire: function() { + if (this.__onChange) { + this.__onChange.call(this); + } + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + this.getValue().call(this.object); + } + } + + ); + + return FunctionController; + + })(dat.controllers.Controller, + dat.dom.dom, + dat.utils.common); + + + dat.controllers.BooleanController = (function (Controller, dom, common) { + + /** + * @class Provides a checkbox input to alter the boolean property of an object. + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var BooleanController = function(object, property) { + + BooleanController.superclass.call(this, object, property); + + var _this = this; + this.__prev = this.getValue(); + + this.__checkbox = document.createElement('input'); + this.__checkbox.setAttribute('type', 'checkbox'); + + + dom.bind(this.__checkbox, 'change', onChange, false); + + this.domElement.appendChild(this.__checkbox); + + // Match original value + this.updateDisplay(); + + function onChange() { + _this.setValue(!_this.__prev); + } + + }; + + BooleanController.superclass = Controller; + + common.extend( + + BooleanController.prototype, + Controller.prototype, + + { + + setValue: function(v) { + var toReturn = BooleanController.superclass.prototype.setValue.call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + this.__prev = this.getValue(); + return toReturn; + }, + + updateDisplay: function() { + + if (this.getValue() === true) { + this.__checkbox.setAttribute('checked', 'checked'); + this.__checkbox.checked = true; + } else { + this.__checkbox.checked = false; + } + + return BooleanController.superclass.prototype.updateDisplay.call(this); + + } + + + } + + ); + + return BooleanController; + + })(dat.controllers.Controller, + dat.dom.dom, + dat.utils.common); + + + dat.color.toString = (function (common) { + + return function(color) { + + if (color.a == 1 || common.isUndefined(color.a)) { + + var s = color.hex.toString(16); + while (s.length < 6) { + s = '0' + s; + } + + return '#' + s; + + } else { + + return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')'; + + } + + } + + })(dat.utils.common); + + + dat.color.interpret = (function (toString, common) { + + var result, toReturn; + + var interpret = function() { + + toReturn = false; + + var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0]; + + common.each(INTERPRETATIONS, function(family) { + + if (family.litmus(original)) { + + common.each(family.conversions, function(conversion, conversionName) { + + result = conversion.read(original); + + if (toReturn === false && result !== false) { + toReturn = result; + result.conversionName = conversionName; + result.conversion = conversion; + return common.BREAK; + + } + + }); + + return common.BREAK; + + } + + }); + + return toReturn; + + }; + + var INTERPRETATIONS = [ + + // Strings + { + + litmus: common.isString, + + conversions: { + + THREE_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt( + '0x' + + test[1].toString() + test[1].toString() + + test[2].toString() + test[2].toString() + + test[3].toString() + test[3].toString()) + }; + + }, + + write: toString + + }, + + SIX_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9]{6})$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString()) + }; + + }, + + write: toString + + }, + + CSS_RGB: { + + read: function(original) { + + var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]) + }; + + }, + + write: toString + + }, + + CSS_RGBA: { + + read: function(original) { + + var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]), + a: parseFloat(test[4]) + }; + + }, + + write: toString + + } + + } + + }, + + // Numbers + { + + litmus: common.isNumber, + + conversions: { + + HEX: { + read: function(original) { + return { + space: 'HEX', + hex: original, + conversionName: 'HEX' + } + }, + + write: function(color) { + return color.hex; + } + } + + } + + }, + + // Arrays + { + + litmus: common.isArray, + + conversions: { + + RGB_ARRAY: { + read: function(original) { + if (original.length != 3) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b]; + } + + }, + + RGBA_ARRAY: { + read: function(original) { + if (original.length != 4) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2], + a: original[3] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b, color.a]; + } + + } + + } + + }, + + // Objects + { + + litmus: common.isObject, + + conversions: { + + RGBA_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b) && + common.isNumber(original.a)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b, + a: color.a + } + } + }, + + RGB_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b + } + } + }, + + HSVA_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v) && + common.isNumber(original.a)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v, + a: color.a + } + } + }, + + HSV_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v + } + } + + } + + } + + } + + + ]; + + return interpret; + + + })(dat.color.toString, + dat.utils.common); + + + dat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, controllerFactory, Controller, BooleanController, FunctionController, NumberControllerBox, NumberControllerSlider, OptionController, ColorController, requestAnimationFrame, CenteredDiv, dom, common) { + + css.inject(styleSheet); + + /** Outer-most className for GUI's */ + var CSS_NAMESPACE = 'dg'; + + var HIDE_KEY_CODE = 72; + + /** The only value shared between the JS and SCSS. Use caution. */ + var CLOSE_BUTTON_HEIGHT = 20; + + var DEFAULT_DEFAULT_PRESET_NAME = 'Default'; + + var SUPPORTS_LOCAL_STORAGE = (function() { + try { + return 'localStorage' in window && window['localStorage'] !== null; + } catch (e) { + return false; + } + })(); + + var SAVE_DIALOGUE; + + /** Have we yet to create an autoPlace GUI? */ + var auto_place_virgin = true; + + /** Fixed position div that auto place GUI's go inside */ + var auto_place_container; + + /** Are we hiding the GUI's ? */ + var hide = false; + + /** GUI's which should be hidden */ + var hideable_guis = []; + + /** + * A lightweight controller library for JavaScript. It allows you to easily + * manipulate variables and fire functions on the fly. + * @class + * + * @member dat.gui + * + * @param {Object} [params] + * @param {String} [params.name] The name of this GUI. + * @param {Object} [params.load] JSON object representing the saved state of + * this GUI. + * @param {Boolean} [params.auto=true] + * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in. + * @param {Boolean} [params.closed] If true, starts closed + */ + var GUI = function(params) { + + var _this = this; + + /** + * Outermost DOM Element + * @type DOMElement + */ + this.domElement = document.createElement('div'); + this.__ul = document.createElement('ul'); + this.domElement.appendChild(this.__ul); + + dom.addClass(this.domElement, CSS_NAMESPACE); + + /** + * Nested GUI's by name + * @ignore + */ + this.__folders = {}; + + this.__controllers = []; + + /** + * List of objects I'm remembering for save, only used in top level GUI + * @ignore + */ + this.__rememberedObjects = []; + + /** + * Maps the index of remembered objects to a map of controllers, only used + * in top level GUI. + * + * @private + * @ignore + * + * @example + * [ + * { + * propertyName: Controller, + * anotherPropertyName: Controller + * }, + * { + * propertyName: Controller + * } + * ] + */ + this.__rememberedObjectIndecesToControllers = []; + + this.__listening = []; + + params = params || {}; + + // Default parameters + params = common.defaults(params, { + autoPlace: true, + width: GUI.DEFAULT_WIDTH + }); + + params = common.defaults(params, { + resizable: params.autoPlace, + hideable: params.autoPlace + }); + + + if (!common.isUndefined(params.load)) { + + // Explicit preset + if (params.preset) params.load.preset = params.preset; + + } else { + + params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME }; + + } + + if (common.isUndefined(params.parent) && params.hideable) { + hideable_guis.push(this); + } + + // Only root level GUI's are resizable. + params.resizable = common.isUndefined(params.parent) && params.resizable; + + + if (params.autoPlace && common.isUndefined(params.scrollable)) { + params.scrollable = true; + } + // params.scrollable = common.isUndefined(params.parent) && params.scrollable === true; + + // Not part of params because I don't want people passing this in via + // constructor. Should be a 'remembered' value. + var use_local_storage = + SUPPORTS_LOCAL_STORAGE && + localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true'; + + Object.defineProperties(this, + + /** @lends dat.gui.GUI.prototype */ + { + + /** + * The parent GUI + * @type dat.gui.GUI + */ + parent: { + get: function() { + return params.parent; + } + }, + + scrollable: { + get: function() { + return params.scrollable; + } + }, + + /** + * Handles GUI's element placement for you + * @type Boolean + */ + autoPlace: { + get: function() { + return params.autoPlace; + } + }, + + /** + * The identifier for a set of saved values + * @type String + */ + preset: { + + get: function() { + if (_this.parent) { + return _this.getRoot().preset; + } else { + return params.load.preset; + } + }, + + set: function(v) { + if (_this.parent) { + _this.getRoot().preset = v; + } else { + params.load.preset = v; + } + setPresetSelectIndex(this); + _this.revert(); + } + + }, + + /** + * The width of GUI element + * @type Number + */ + width: { + get: function() { + return params.width; + }, + set: function(v) { + params.width = v; + setWidth(_this, v); + } + }, + + /** + * The name of GUI. Used for folders. i.e + * a folder's name + * @type String + */ + name: { + get: function() { + return params.name; + }, + set: function(v) { + // TODO Check for collisions among sibling folders + params.name = v; + if (title_row_name) { + title_row_name.innerHTML = params.name; + } + } + }, + + /** + * Whether the GUI is collapsed or not + * @type Boolean + */ + closed: { + get: function() { + return params.closed; + }, + set: function(v) { + params.closed = v; + if (params.closed) { + dom.addClass(_this.__ul, GUI.CLASS_CLOSED); + } else { + dom.removeClass(_this.__ul, GUI.CLASS_CLOSED); + } + // For browsers that aren't going to respect the CSS transition, + // Lets just check our height against the window height right off + // the bat. + this.onResize(); + + if (_this.__closeButton) { + _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED; + } + } + }, + + /** + * Contains all presets + * @type Object + */ + load: { + get: function() { + return params.load; + } + }, + + /** + * Determines whether or not to use localStorage as the means for + * remembering + * @type Boolean + */ + useLocalStorage: { + + get: function() { + return use_local_storage; + }, + set: function(bool) { + if (SUPPORTS_LOCAL_STORAGE) { + use_local_storage = bool; + if (bool) { + dom.bind(window, 'unload', saveToLocalStorage); + } else { + dom.unbind(window, 'unload', saveToLocalStorage); + } + localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool); + } + } + + } + + }); + + // Are we a root level GUI? + if (common.isUndefined(params.parent)) { + + params.closed = false; + + dom.addClass(this.domElement, GUI.CLASS_MAIN); + dom.makeSelectable(this.domElement, false); + + // Are we supposed to be loading locally? + if (SUPPORTS_LOCAL_STORAGE) { + + if (use_local_storage) { + + _this.useLocalStorage = true; + + var saved_gui = localStorage.getItem(getLocalStorageHash(this, 'gui')); + + if (saved_gui) { + params.load = JSON.parse(saved_gui); + } + + } + + } + + this.__closeButton = document.createElement('div'); + this.__closeButton.innerHTML = GUI.TEXT_CLOSED; + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON); + this.domElement.appendChild(this.__closeButton); + + dom.bind(this.__closeButton, 'click', function() { + + _this.closed = !_this.closed; + + + }); + + + // Oh, you're a nested GUI! + } else { + + if (params.closed === undefined) { + params.closed = true; + } + + var title_row_name = document.createTextNode(params.name); + dom.addClass(title_row_name, 'controller-name'); + + var title_row = addRow(_this, title_row_name); + + var on_click_title = function(e) { + e.preventDefault(); + _this.closed = !_this.closed; + return false; + }; + + dom.addClass(this.__ul, GUI.CLASS_CLOSED); + + dom.addClass(title_row, 'title'); + dom.bind(title_row, 'click', on_click_title); + + if (!params.closed) { + this.closed = false; + } + + } + + if (params.autoPlace) { + + if (common.isUndefined(params.parent)) { + + if (auto_place_virgin) { + auto_place_container = document.createElement('div'); + dom.addClass(auto_place_container, CSS_NAMESPACE); + dom.addClass(auto_place_container, GUI.CLASS_AUTO_PLACE_CONTAINER); + document.body.appendChild(auto_place_container); + auto_place_virgin = false; + } + + // Put it in the dom for you. + auto_place_container.appendChild(this.domElement); + + // Apply the auto styles + dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE); + + } + + + // Make it not elastic. + if (!this.parent) setWidth(_this, params.width); + + } + + dom.bind(window, 'resize', function() { _this.onResize() }); + dom.bind(this.__ul, 'webkitTransitionEnd', function() { _this.onResize(); }); + dom.bind(this.__ul, 'transitionend', function() { _this.onResize() }); + dom.bind(this.__ul, 'oTransitionEnd', function() { _this.onResize() }); + this.onResize(); + + + if (params.resizable) { + addResizeHandle(this); + } + + function saveToLocalStorage() { + localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject())); + } + + var root = _this.getRoot(); + function resetWidth() { + var root = _this.getRoot(); + root.width += 1; + common.defer(function() { + root.width -= 1; + }); + } + + if (!params.parent) { + resetWidth(); + } + + }; + + GUI.toggleHide = function() { + + hide = !hide; + common.each(hideable_guis, function(gui) { + gui.domElement.style.zIndex = hide ? -999 : 999; + gui.domElement.style.opacity = hide ? 0 : 1; + }); + }; + + GUI.CLASS_AUTO_PLACE = 'a'; + GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac'; + GUI.CLASS_MAIN = 'main'; + GUI.CLASS_CONTROLLER_ROW = 'cr'; + GUI.CLASS_TOO_TALL = 'taller-than-window'; + GUI.CLASS_CLOSED = 'closed'; + GUI.CLASS_CLOSE_BUTTON = 'close-button'; + GUI.CLASS_DRAG = 'drag'; + + GUI.DEFAULT_WIDTH = 245; + GUI.TEXT_CLOSED = 'Close Controls'; + GUI.TEXT_OPEN = 'Open Controls'; + + dom.bind(window, 'keydown', function(e) { + + if (document.activeElement.type !== 'text' && + (e.which === HIDE_KEY_CODE || e.keyCode == HIDE_KEY_CODE)) { + GUI.toggleHide(); + } + + }, false); + + common.extend( + + GUI.prototype, + + /** @lends dat.gui.GUI */ + { + + /** + * @param object + * @param property + * @returns {dat.controllers.Controller} The new controller that was added. + * @instance + */ + add: function(object, property) { + + return add( + this, + object, + property, + { + factoryArgs: Array.prototype.slice.call(arguments, 2) + } + ); + + }, + + /** + * @param object + * @param property + * @returns {dat.controllers.ColorController} The new controller that was added. + * @instance + */ + addColor: function(object, property) { + + return add( + this, + object, + property, + { + color: true + } + ); + + }, + + /** + * @param controller + * @instance + */ + remove: function(controller) { + + // TODO listening? + this.__ul.removeChild(controller.__li); + this.__controllers.slice(this.__controllers.indexOf(controller), 1); + var _this = this; + common.defer(function() { + _this.onResize(); + }); + + }, + + destroy: function() { + + if (this.autoPlace) { + auto_place_container.removeChild(this.domElement); + } + + }, + + /** + * @param name + * @returns {dat.gui.GUI} The new folder. + * @throws {Error} if this GUI already has a folder by the specified + * name + * @instance + */ + addFolder: function(name) { + + // We have to prevent collisions on names in order to have a key + // by which to remember saved values + if (this.__folders[name] !== undefined) { + throw new Error('You already have a folder in this GUI by the' + + ' name "' + name + '"'); + } + + var new_gui_params = { name: name, parent: this }; + + // We need to pass down the autoPlace trait so that we can + // attach event listeners to open/close folder actions to + // ensure that a scrollbar appears if the window is too short. + new_gui_params.autoPlace = this.autoPlace; + + // Do we have saved appearance data for this folder? + + if (this.load && // Anything loaded? + this.load.folders && // Was my parent a dead-end? + this.load.folders[name]) { // Did daddy remember me? + + // Start me closed if I was closed + new_gui_params.closed = this.load.folders[name].closed; + + // Pass down the loaded data + new_gui_params.load = this.load.folders[name]; + + } + + var gui = new GUI(new_gui_params); + this.__folders[name] = gui; + + var li = addRow(this, gui.domElement); + dom.addClass(li, 'folder'); + return gui; + + }, + + open: function() { + this.closed = false; + }, + + close: function() { + this.closed = true; + }, + + onResize: function() { + + var root = this.getRoot(); + + if (root.scrollable) { + + var top = dom.getOffset(root.__ul).top; + var h = 0; + + common.each(root.__ul.childNodes, function(node) { + if (! (root.autoPlace && node === root.__save_row)) + h += dom.getHeight(node); + }); + + if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) { + dom.addClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px'; + } else { + dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = 'auto'; + } + + } + + if (root.__resize_handle) { + common.defer(function() { + root.__resize_handle.style.height = root.__ul.offsetHeight + 'px'; + }); + } + + if (root.__closeButton) { + root.__closeButton.style.width = root.width + 'px'; + } + + }, + + /** + * Mark objects for saving. The order of these objects cannot change as + * the GUI grows. When remembering new objects, append them to the end + * of the list. + * + * @param {Object...} objects + * @throws {Error} if not called on a top level GUI. + * @instance + */ + remember: function() { + + if (common.isUndefined(SAVE_DIALOGUE)) { + SAVE_DIALOGUE = new CenteredDiv(); + SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents; + } + + if (this.parent) { + throw new Error("You can only call remember on a top level GUI."); + } + + var _this = this; + + common.each(Array.prototype.slice.call(arguments), function(object) { + if (_this.__rememberedObjects.length == 0) { + addSaveMenu(_this); + } + if (_this.__rememberedObjects.indexOf(object) == -1) { + _this.__rememberedObjects.push(object); + } + }); + + if (this.autoPlace) { + // Set save row width + setWidth(this, this.width); + } + + }, + + /** + * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI. + * @instance + */ + getRoot: function() { + var gui = this; + while (gui.parent) { + gui = gui.parent; + } + return gui; + }, + + /** + * @returns {Object} a JSON object representing the current state of + * this GUI as well as its remembered properties. + * @instance + */ + getSaveObject: function() { + + var toReturn = this.load; + + toReturn.closed = this.closed; + + // Am I remembering any values? + if (this.__rememberedObjects.length > 0) { + + toReturn.preset = this.preset; + + if (!toReturn.remembered) { + toReturn.remembered = {}; + } + + toReturn.remembered[this.preset] = getCurrentPreset(this); + + } + + toReturn.folders = {}; + common.each(this.__folders, function(element, key) { + toReturn.folders[key] = element.getSaveObject(); + }); + + return toReturn; + + }, + + save: function() { + + if (!this.load.remembered) { + this.load.remembered = {}; + } + + this.load.remembered[this.preset] = getCurrentPreset(this); + markPresetModified(this, false); + + }, + + saveAs: function(presetName) { + + if (!this.load.remembered) { + + // Retain default values upon first save + this.load.remembered = {}; + this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true); + + } + + this.load.remembered[presetName] = getCurrentPreset(this); + this.preset = presetName; + addPresetOption(this, presetName, true); + + }, + + revert: function(gui) { + + common.each(this.__controllers, function(controller) { + // Make revert work on Default. + if (!this.getRoot().load.remembered) { + controller.setValue(controller.initialValue); + } else { + recallSavedValue(gui || this.getRoot(), controller); + } + }, this); + + common.each(this.__folders, function(folder) { + folder.revert(folder); + }); + + if (!gui) { + markPresetModified(this.getRoot(), false); + } + + + }, + + listen: function(controller) { + + var init = this.__listening.length == 0; + this.__listening.push(controller); + if (init) updateDisplays(this.__listening); + + } + + } + + ); + + function add(gui, object, property, params) { + + if (object[property] === undefined) { + throw new Error("Object " + object + " has no property \"" + property + "\""); + } + + var controller; + + if (params.color) { + + controller = new ColorController(object, property); + + } else { + + var factoryArgs = [object,property].concat(params.factoryArgs); + controller = controllerFactory.apply(gui, factoryArgs); + + } + + if (params.before instanceof Controller) { + params.before = params.before.__li; + } + + recallSavedValue(gui, controller); + + dom.addClass(controller.domElement, 'c'); + + var name = document.createElement('span'); + dom.addClass(name, 'property-name'); + name.innerHTML = controller.property; + + var container = document.createElement('div'); + container.appendChild(name); + container.appendChild(controller.domElement); + + var li = addRow(gui, container, params.before); + + dom.addClass(li, GUI.CLASS_CONTROLLER_ROW); + dom.addClass(li, typeof controller.getValue()); + + augmentController(gui, li, controller); + + gui.__controllers.push(controller); + + return controller; + + } + + /** + * Add a row to the end of the GUI or before another row. + * + * @param gui + * @param [dom] If specified, inserts the dom content in the new row + * @param [liBefore] If specified, places the new row before another row + */ + function addRow(gui, dom, liBefore) { + var li = document.createElement('li'); + if (dom) li.appendChild(dom); + if (liBefore) { + gui.__ul.insertBefore(li, params.before); + } else { + gui.__ul.appendChild(li); + } + gui.onResize(); + return li; + } + + function augmentController(gui, li, controller) { + + controller.__li = li; + controller.__gui = gui; + + common.extend(controller, { + + options: function(options) { + + if (arguments.length > 1) { + controller.remove(); + + return add( + gui, + controller.object, + controller.property, + { + before: controller.__li.nextElementSibling, + factoryArgs: [common.toArray(arguments)] + } + ); + + } + + if (common.isArray(options) || common.isObject(options)) { + controller.remove(); + + return add( + gui, + controller.object, + controller.property, + { + before: controller.__li.nextElementSibling, + factoryArgs: [options] + } + ); + + } + + }, + + name: function(v) { + controller.__li.firstElementChild.firstElementChild.innerHTML = v; + return controller; + }, + + listen: function() { + controller.__gui.listen(controller); + return controller; + }, + + remove: function() { + controller.__gui.remove(controller); + return controller; + } + + }); + + // All sliders should be accompanied by a box. + if (controller instanceof NumberControllerSlider) { + + var box = new NumberControllerBox(controller.object, controller.property, + { min: controller.__min, max: controller.__max, step: controller.__step }); + + common.each(['updateDisplay', 'onChange', 'onFinishChange'], function(method) { + var pc = controller[method]; + var pb = box[method]; + controller[method] = box[method] = function() { + var args = Array.prototype.slice.call(arguments); + pc.apply(controller, args); + return pb.apply(box, args); + } + }); + + dom.addClass(li, 'has-slider'); + controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild); + + } + else if (controller instanceof NumberControllerBox) { + + var r = function(returned) { + + // Have we defined both boundaries? + if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) { + + // Well, then lets just replace this with a slider. + controller.remove(); + return add( + gui, + controller.object, + controller.property, + { + before: controller.__li.nextElementSibling, + factoryArgs: [controller.__min, controller.__max, controller.__step] + }); + + } + + return returned; + + }; + + controller.min = common.compose(r, controller.min); + controller.max = common.compose(r, controller.max); + + } + else if (controller instanceof BooleanController) { + + dom.bind(li, 'click', function() { + dom.fakeEvent(controller.__checkbox, 'click'); + }); + + dom.bind(controller.__checkbox, 'click', function(e) { + e.stopPropagation(); // Prevents double-toggle + }) + + } + else if (controller instanceof FunctionController) { + + dom.bind(li, 'click', function() { + dom.fakeEvent(controller.__button, 'click'); + }); + + dom.bind(li, 'mouseover', function() { + dom.addClass(controller.__button, 'hover'); + }); + + dom.bind(li, 'mouseout', function() { + dom.removeClass(controller.__button, 'hover'); + }); + + } + else if (controller instanceof ColorController) { + + dom.addClass(li, 'color'); + controller.updateDisplay = common.compose(function(r) { + li.style.borderLeftColor = controller.__color.toString(); + return r; + }, controller.updateDisplay); + + controller.updateDisplay(); + + } + + controller.setValue = common.compose(function(r) { + if (gui.getRoot().__preset_select && controller.isModified()) { + markPresetModified(gui.getRoot(), true); + } + return r; + }, controller.setValue); + + } + + function recallSavedValue(gui, controller) { + + // Find the topmost GUI, that's where remembered objects live. + var root = gui.getRoot(); + + // Does the object we're controlling match anything we've been told to + // remember? + var matched_index = root.__rememberedObjects.indexOf(controller.object); + + // Why yes, it does! + if (matched_index != -1) { + + // Let me fetch a map of controllers for thcommon.isObject. + var controller_map = + root.__rememberedObjectIndecesToControllers[matched_index]; + + // Ohp, I believe this is the first controller we've created for this + // object. Lets make the map fresh. + if (controller_map === undefined) { + controller_map = {}; + root.__rememberedObjectIndecesToControllers[matched_index] = + controller_map; + } + + // Keep track of this controller + controller_map[controller.property] = controller; + + // Okay, now have we saved any values for this controller? + if (root.load && root.load.remembered) { + + var preset_map = root.load.remembered; + + // Which preset are we trying to load? + var preset; + + if (preset_map[gui.preset]) { + + preset = preset_map[gui.preset]; + + } else if (preset_map[DEFAULT_DEFAULT_PRESET_NAME]) { + + // Uhh, you can have the default instead? + preset = preset_map[DEFAULT_DEFAULT_PRESET_NAME]; + + } else { + + // Nada. + + return; + + } + + + // Did the loaded object remember thcommon.isObject? + if (preset[matched_index] && + + // Did we remember this particular property? + preset[matched_index][controller.property] !== undefined) { + + // We did remember something for this guy ... + var value = preset[matched_index][controller.property]; + + // And that's what it is. + controller.initialValue = value; + controller.setValue(value); + + } + + } + + } + + } + + function getLocalStorageHash(gui, key) { + // TODO how does this deal with multiple GUI's? + return document.location.href + '.' + key; + + } + + function addSaveMenu(gui) { + + var div = gui.__save_row = document.createElement('li'); + + dom.addClass(gui.domElement, 'has-save'); + + gui.__ul.insertBefore(div, gui.__ul.firstChild); + + dom.addClass(div, 'save-row'); + + var gears = document.createElement('span'); + gears.innerHTML = ' '; + dom.addClass(gears, 'button gears'); + + // TODO replace with FunctionController + var button = document.createElement('span'); + button.innerHTML = 'Save'; + dom.addClass(button, 'button'); + dom.addClass(button, 'save'); + + var button2 = document.createElement('span'); + button2.innerHTML = 'New'; + dom.addClass(button2, 'button'); + dom.addClass(button2, 'save-as'); + + var button3 = document.createElement('span'); + button3.innerHTML = 'Revert'; + dom.addClass(button3, 'button'); + dom.addClass(button3, 'revert'); + + var select = gui.__preset_select = document.createElement('select'); + + if (gui.load && gui.load.remembered) { + + common.each(gui.load.remembered, function(value, key) { + addPresetOption(gui, key, key == gui.preset); + }); + + } else { + addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false); + } + + dom.bind(select, 'change', function() { + + + for (var index = 0; index < gui.__preset_select.length; index++) { + gui.__preset_select[index].innerHTML = gui.__preset_select[index].value; + } + + gui.preset = this.value; + + }); + + div.appendChild(select); + div.appendChild(gears); + div.appendChild(button); + div.appendChild(button2); + div.appendChild(button3); + + if (SUPPORTS_LOCAL_STORAGE) { + + var saveLocally = document.getElementById('dg-save-locally'); + var explain = document.getElementById('dg-local-explain'); + + saveLocally.style.display = 'block'; + + var localStorageCheckBox = document.getElementById('dg-local-storage'); + + if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') { + localStorageCheckBox.setAttribute('checked', 'checked'); + } + + function showHideExplain() { + explain.style.display = gui.useLocalStorage ? 'block' : 'none'; + } + + showHideExplain(); + + // TODO: Use a boolean controller, fool! + dom.bind(localStorageCheckBox, 'change', function() { + gui.useLocalStorage = !gui.useLocalStorage; + showHideExplain(); + }); + + } + + var newConstructorTextArea = document.getElementById('dg-new-constructor'); + + dom.bind(newConstructorTextArea, 'keydown', function(e) { + if (e.metaKey && (e.which === 67 || e.keyCode == 67)) { + SAVE_DIALOGUE.hide(); + } + }); + + dom.bind(gears, 'click', function() { + newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2); + SAVE_DIALOGUE.show(); + newConstructorTextArea.focus(); + newConstructorTextArea.select(); + }); + + dom.bind(button, 'click', function() { + gui.save(); + }); + + dom.bind(button2, 'click', function() { + var presetName = prompt('Enter a new preset name.'); + if (presetName) gui.saveAs(presetName); + }); + + dom.bind(button3, 'click', function() { + gui.revert(); + }); + + // div.appendChild(button2); + + } + + function addResizeHandle(gui) { + + gui.__resize_handle = document.createElement('div'); + + common.extend(gui.__resize_handle.style, { + + width: '6px', + marginLeft: '-3px', + height: '200px', + cursor: 'ew-resize', + position: 'absolute' + // border: '1px solid blue' + + }); + + var pmouseX; + + dom.bind(gui.__resize_handle, 'mousedown', dragStart); + dom.bind(gui.__closeButton, 'mousedown', dragStart); + + gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild); + + function dragStart(e) { + + e.preventDefault(); + + pmouseX = e.clientX; + + dom.addClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.bind(window, 'mousemove', drag); + dom.bind(window, 'mouseup', dragStop); + + return false; + + } + + function drag(e) { + + e.preventDefault(); + + gui.width += pmouseX - e.clientX; + gui.onResize(); + pmouseX = e.clientX; + + return false; + + } + + function dragStop() { + + dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.unbind(window, 'mousemove', drag); + dom.unbind(window, 'mouseup', dragStop); + + } + + } + + function setWidth(gui, w) { + gui.domElement.style.width = w + 'px'; + // Auto placed save-rows are position fixed, so we have to + // set the width manually if we want it to bleed to the edge + if (gui.__save_row && gui.autoPlace) { + gui.__save_row.style.width = w + 'px'; + }if (gui.__closeButton) { + gui.__closeButton.style.width = w + 'px'; + } + } + + function getCurrentPreset(gui, useInitialValues) { + + var toReturn = {}; + + // For each object I'm remembering + common.each(gui.__rememberedObjects, function(val, index) { + + var saved_values = {}; + + // The controllers I've made for thcommon.isObject by property + var controller_map = + gui.__rememberedObjectIndecesToControllers[index]; + + // Remember each value for each property + common.each(controller_map, function(controller, property) { + saved_values[property] = useInitialValues ? controller.initialValue : controller.getValue(); + }); + + // Save the values for thcommon.isObject + toReturn[index] = saved_values; + + }); + + return toReturn; + + } + + function addPresetOption(gui, name, setSelected) { + var opt = document.createElement('option'); + opt.innerHTML = name; + opt.value = name; + gui.__preset_select.appendChild(opt); + if (setSelected) { + gui.__preset_select.selectedIndex = gui.__preset_select.length - 1; + } + } + + function setPresetSelectIndex(gui) { + for (var index = 0; index < gui.__preset_select.length; index++) { + if (gui.__preset_select[index].value == gui.preset) { + gui.__preset_select.selectedIndex = index; + } + } + } + + function markPresetModified(gui, modified) { + var opt = gui.__preset_select[gui.__preset_select.selectedIndex]; + // console.log('mark', modified, opt); + if (modified) { + opt.innerHTML = opt.value + "*"; + } else { + opt.innerHTML = opt.value; + } + } + + function updateDisplays(controllerArray) { + + + if (controllerArray.length != 0) { + + requestAnimationFrame(function() { + updateDisplays(controllerArray); + }); + + } + + common.each(controllerArray, function(c) { + c.updateDisplay(); + }); + + } + + return GUI; + + })(dat.utils.css, + "
\n\n Here's the new load parameter for your GUI's constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI's constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
\n \n
\n\n
", + ".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", + dat.controllers.factory = (function (OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, common) { + + return function(object, property) { + + var initialValue = object[property]; + + // Providing options? + if (common.isArray(arguments[2]) || common.isObject(arguments[2])) { + return new OptionController(object, property, arguments[2]); + } + + // Providing a map? + + if (common.isNumber(initialValue)) { + + if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) { + + // Has min and max. + return new NumberControllerSlider(object, property, arguments[2], arguments[3]); + + } else { + + return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] }); + + } + + } + + if (common.isString(initialValue)) { + return new StringController(object, property); + } + + if (common.isFunction(initialValue)) { + return new FunctionController(object, property, ''); + } + + if (common.isBoolean(initialValue)) { + return new BooleanController(object, property); + } + + } + + })(dat.controllers.OptionController, + dat.controllers.NumberControllerBox, + dat.controllers.NumberControllerSlider, + dat.controllers.StringController = (function (Controller, dom, common) { + + /** + * @class Provides a text input to alter the string property of an object. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var StringController = function(object, property) { + + StringController.superclass.call(this, object, property); + + var _this = this; + + this.__input = document.createElement('input'); + this.__input.setAttribute('type', 'text'); + + dom.bind(this.__input, 'keyup', onChange); + dom.bind(this.__input, 'change', onChange); + dom.bind(this.__input, 'blur', onBlur); + dom.bind(this.__input, 'keydown', function(e) { + if (e.keyCode === 13) { + this.blur(); + } + }); + + + function onChange() { + _this.setValue(_this.__input.value); + } + + function onBlur() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + this.updateDisplay(); + + this.domElement.appendChild(this.__input); + + }; + + StringController.superclass = Controller; + + common.extend( + + StringController.prototype, + Controller.prototype, + + { + + updateDisplay: function() { + // Stops the caret from moving on account of: + // keyup -> setValue -> updateDisplay + if (!dom.isActive(this.__input)) { + this.__input.value = this.getValue(); + } + return StringController.superclass.prototype.updateDisplay.call(this); + } + + } + + ); + + return StringController; + + })(dat.controllers.Controller, + dat.dom.dom, + dat.utils.common), + dat.controllers.FunctionController, + dat.controllers.BooleanController, + dat.utils.common), + dat.controllers.Controller, + dat.controllers.BooleanController, + dat.controllers.FunctionController, + dat.controllers.NumberControllerBox, + dat.controllers.NumberControllerSlider, + dat.controllers.OptionController, + dat.controllers.ColorController = (function (Controller, dom, Color, interpret, common) { + + var ColorController = function(object, property) { + + ColorController.superclass.call(this, object, property); + + this.__color = new Color(this.getValue()); + this.__temp = new Color(0); + + var _this = this; + + this.domElement = document.createElement('div'); + + dom.makeSelectable(this.domElement, false); + + this.__selector = document.createElement('div'); + this.__selector.className = 'selector'; + + this.__saturation_field = document.createElement('div'); + this.__saturation_field.className = 'saturation-field'; + + this.__field_knob = document.createElement('div'); + this.__field_knob.className = 'field-knob'; + this.__field_knob_border = '2px solid '; + + this.__hue_knob = document.createElement('div'); + this.__hue_knob.className = 'hue-knob'; + + this.__hue_field = document.createElement('div'); + this.__hue_field.className = 'hue-field'; + + this.__input = document.createElement('input'); + this.__input.type = 'text'; + this.__input_textShadow = '0 1px 1px '; + + dom.bind(this.__input, 'keydown', function(e) { + if (e.keyCode === 13) { // on enter + onBlur.call(this); + } + }); + + dom.bind(this.__input, 'blur', onBlur); + + dom.bind(this.__selector, 'mousedown', function(e) { + + dom + .addClass(this, 'drag') + .bind(window, 'mouseup', function(e) { + dom.removeClass(_this.__selector, 'drag'); + }); + + }); + + var value_field = document.createElement('div'); + + common.extend(this.__selector.style, { + width: '122px', + height: '102px', + padding: '3px', + backgroundColor: '#222', + boxShadow: '0px 1px 3px rgba(0,0,0,0.3)' + }); + + common.extend(this.__field_knob.style, { + position: 'absolute', + width: '12px', + height: '12px', + border: this.__field_knob_border + (this.__color.v < .5 ? '#fff' : '#000'), + boxShadow: '0px 1px 3px rgba(0,0,0,0.5)', + borderRadius: '12px', + zIndex: 1 + }); + + common.extend(this.__hue_knob.style, { + position: 'absolute', + width: '15px', + height: '2px', + borderRight: '4px solid #fff', + zIndex: 1 + }); + + common.extend(this.__saturation_field.style, { + width: '100px', + height: '100px', + border: '1px solid #555', + marginRight: '3px', + display: 'inline-block', + cursor: 'pointer' + }); + + common.extend(value_field.style, { + width: '100%', + height: '100%', + background: 'none' + }); + + linearGradient(value_field, 'top', 'rgba(0,0,0,0)', '#000'); + + common.extend(this.__hue_field.style, { + width: '15px', + height: '100px', + display: 'inline-block', + border: '1px solid #555', + cursor: 'ns-resize' + }); + + hueGradient(this.__hue_field); + + common.extend(this.__input.style, { + outline: 'none', + // width: '120px', + textAlign: 'center', + // padding: '4px', + // marginBottom: '6px', + color: '#fff', + border: 0, + fontWeight: 'bold', + textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)' + }); + + dom.bind(this.__saturation_field, 'mousedown', fieldDown); + dom.bind(this.__field_knob, 'mousedown', fieldDown); + + dom.bind(this.__hue_field, 'mousedown', function(e) { + setH(e); + dom.bind(window, 'mousemove', setH); + dom.bind(window, 'mouseup', unbindH); + }); + + function fieldDown(e) { + setSV(e); + // document.body.style.cursor = 'none'; + dom.bind(window, 'mousemove', setSV); + dom.bind(window, 'mouseup', unbindSV); + } + + function unbindSV() { + dom.unbind(window, 'mousemove', setSV); + dom.unbind(window, 'mouseup', unbindSV); + // document.body.style.cursor = 'default'; + } + + function onBlur() { + var i = interpret(this.value); + if (i !== false) { + _this.__color.__state = i; + _this.setValue(_this.__color.toOriginal()); + } else { + this.value = _this.__color.toString(); + } + } + + function unbindH() { + dom.unbind(window, 'mousemove', setH); + dom.unbind(window, 'mouseup', unbindH); + } + + this.__saturation_field.appendChild(value_field); + this.__selector.appendChild(this.__field_knob); + this.__selector.appendChild(this.__saturation_field); + this.__selector.appendChild(this.__hue_field); + this.__hue_field.appendChild(this.__hue_knob); + + this.domElement.appendChild(this.__input); + this.domElement.appendChild(this.__selector); + + this.updateDisplay(); + + function setSV(e) { + + e.preventDefault(); + + var w = dom.getWidth(_this.__saturation_field); + var o = dom.getOffset(_this.__saturation_field); + var s = (e.clientX - o.left + document.body.scrollLeft) / w; + var v = 1 - (e.clientY - o.top + document.body.scrollTop) / w; + + if (v > 1) v = 1; + else if (v < 0) v = 0; + + if (s > 1) s = 1; + else if (s < 0) s = 0; + + _this.__color.v = v; + _this.__color.s = s; + + _this.setValue(_this.__color.toOriginal()); + + + return false; + + } + + function setH(e) { + + e.preventDefault(); + + var s = dom.getHeight(_this.__hue_field); + var o = dom.getOffset(_this.__hue_field); + var h = 1 - (e.clientY - o.top + document.body.scrollTop) / s; + + if (h > 1) h = 1; + else if (h < 0) h = 0; + + _this.__color.h = h * 360; + + _this.setValue(_this.__color.toOriginal()); + + return false; + + } + + }; + + ColorController.superclass = Controller; + + common.extend( + + ColorController.prototype, + Controller.prototype, + + { + + updateDisplay: function() { + + var i = interpret(this.getValue()); + + if (i !== false) { + + var mismatch = false; + + // Check for mismatch on the interpreted value. + + common.each(Color.COMPONENTS, function(component) { + if (!common.isUndefined(i[component]) && + !common.isUndefined(this.__color.__state[component]) && + i[component] !== this.__color.__state[component]) { + mismatch = true; + return {}; // break + } + }, this); + + // If nothing diverges, we keep our previous values + // for statefulness, otherwise we recalculate fresh + if (mismatch) { + common.extend(this.__color.__state, i); + } + + } + + common.extend(this.__temp.__state, this.__color.__state); + + this.__temp.a = 1; + + var flip = (this.__color.v < .5 || this.__color.s > .5) ? 255 : 0; + var _flip = 255 - flip; + + common.extend(this.__field_knob.style, { + marginLeft: 100 * this.__color.s - 7 + 'px', + marginTop: 100 * (1 - this.__color.v) - 7 + 'px', + backgroundColor: this.__temp.toString(), + border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip +')' + }); + + this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px' + + this.__temp.s = 1; + this.__temp.v = 1; + + linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toString()); + + common.extend(this.__input.style, { + backgroundColor: this.__input.value = this.__color.toString(), + color: 'rgb(' + flip + ',' + flip + ',' + flip +')', + textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip +',.7)' + }); + + } + + } + + ); + + var vendors = ['-moz-','-o-','-webkit-','-ms-','']; + + function linearGradient(elem, x, a, b) { + elem.style.background = ''; + common.each(vendors, function(vendor) { + elem.style.cssText += 'background: ' + vendor + 'linear-gradient('+x+', '+a+' 0%, ' + b + ' 100%); '; + }); + } + + function hueGradient(elem) { + elem.style.background = ''; + elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);' + elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + } + + + return ColorController; + + })(dat.controllers.Controller, + dat.dom.dom, + dat.color.Color = (function (interpret, math, toString, common) { + + var Color = function() { + + this.__state = interpret.apply(this, arguments); + + if (this.__state === false) { + throw 'Failed to interpret color arguments'; + } + + this.__state.a = this.__state.a || 1; + + + }; + + Color.COMPONENTS = ['r','g','b','h','s','v','hex','a']; + + common.extend(Color.prototype, { + + toString: function() { + return toString(this); + }, + + toOriginal: function() { + return this.__state.conversion.write(this); + } + + }); + + defineRGBComponent(Color.prototype, 'r', 2); + defineRGBComponent(Color.prototype, 'g', 1); + defineRGBComponent(Color.prototype, 'b', 0); + + defineHSVComponent(Color.prototype, 'h'); + defineHSVComponent(Color.prototype, 's'); + defineHSVComponent(Color.prototype, 'v'); + + Object.defineProperty(Color.prototype, 'a', { + + get: function() { + return this.__state.a; + }, + + set: function(v) { + this.__state.a = v; + } + + }); + + Object.defineProperty(Color.prototype, 'hex', { + + get: function() { + + if (!this.__state.space !== 'HEX') { + this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b); + } + + return this.__state.hex; + + }, + + set: function(v) { + + this.__state.space = 'HEX'; + this.__state.hex = v; + + } + + }); + + function defineRGBComponent(target, component, componentHexIndex) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'RGB') { + return this.__state[component]; + } + + recalculateRGB(this, component, componentHexIndex); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'RGB') { + recalculateRGB(this, component, componentHexIndex); + this.__state.space = 'RGB'; + } + + this.__state[component] = v; + + } + + }); + + } + + function defineHSVComponent(target, component) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'HSV') + return this.__state[component]; + + recalculateHSV(this); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'HSV') { + recalculateHSV(this); + this.__state.space = 'HSV'; + } + + this.__state[component] = v; + + } + + }); + + } + + function recalculateRGB(color, component, componentHexIndex) { + + if (color.__state.space === 'HEX') { + + color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex); + + } else if (color.__state.space === 'HSV') { + + common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); + + } else { + + throw 'Corrupted color state'; + + } + + } + + function recalculateHSV(color) { + + var result = math.rgb_to_hsv(color.r, color.g, color.b); + + common.extend(color.__state, + { + s: result.s, + v: result.v + } + ); + + if (!common.isNaN(result.h)) { + color.__state.h = result.h; + } else if (common.isUndefined(color.__state.h)) { + color.__state.h = 0; + } + + } + + return Color; + + })(dat.color.interpret, + dat.color.math = (function () { + + var tmpComponent; + + return { + + hsv_to_rgb: function(h, s, v) { + + var hi = Math.floor(h / 60) % 6; + + var f = h / 60 - Math.floor(h / 60); + var p = v * (1.0 - s); + var q = v * (1.0 - (f * s)); + var t = v * (1.0 - ((1.0 - f) * s)); + var c = [ + [v, t, p], + [q, v, p], + [p, v, t], + [p, q, v], + [t, p, v], + [v, p, q] + ][hi]; + + return { + r: c[0] * 255, + g: c[1] * 255, + b: c[2] * 255 + }; + + }, + + rgb_to_hsv: function(r, g, b) { + + var min = Math.min(r, g, b), + max = Math.max(r, g, b), + delta = max - min, + h, s; + + if (max != 0) { + s = delta / max; + } else { + return { + h: NaN, + s: 0, + v: 0 + }; + } + + if (r == max) { + h = (g - b) / delta; + } else if (g == max) { + h = 2 + (b - r) / delta; + } else { + h = 4 + (r - g) / delta; + } + h /= 6; + if (h < 0) { + h += 1; + } + + return { + h: h * 360, + s: s, + v: max / 255 + }; + }, + + rgb_to_hex: function(r, g, b) { + var hex = this.hex_with_component(0, 2, r); + hex = this.hex_with_component(hex, 1, g); + hex = this.hex_with_component(hex, 0, b); + return hex; + }, + + component_from_hex: function(hex, componentIndex) { + return (hex >> (componentIndex * 8)) & 0xFF; + }, + + hex_with_component: function(hex, componentIndex, value) { + return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent)); + } + + } + + })(), + dat.color.toString, + dat.utils.common), + dat.color.interpret, + dat.utils.common), + dat.utils.requestAnimationFrame = (function () { + + /** + * requirejs version of Paul Irish's RequestAnimationFrame + * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + */ + + return window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(callback, element) { + + window.setTimeout(callback, 1000 / 60); + + }; + })(), + dat.dom.CenteredDiv = (function (dom, common) { + + + var CenteredDiv = function() { + + this.backgroundElement = document.createElement('div'); + common.extend(this.backgroundElement.style, { + backgroundColor: 'rgba(0,0,0,0.8)', + top: 0, + left: 0, + display: 'none', + zIndex: '1000', + opacity: 0, + WebkitTransition: 'opacity 0.2s linear' + }); + + dom.makeFullscreen(this.backgroundElement); + this.backgroundElement.style.position = 'fixed'; + + this.domElement = document.createElement('div'); + common.extend(this.domElement.style, { + position: 'fixed', + display: 'none', + zIndex: '1001', + opacity: 0, + WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear' + }); + + + document.body.appendChild(this.backgroundElement); + document.body.appendChild(this.domElement); + + var _this = this; + dom.bind(this.backgroundElement, 'click', function() { + _this.hide(); + }); + + + }; + + CenteredDiv.prototype.show = function() { + + var _this = this; + + + + this.backgroundElement.style.display = 'block'; + + this.domElement.style.display = 'block'; + this.domElement.style.opacity = 0; + // this.domElement.style.top = '52%'; + this.domElement.style.webkitTransform = 'scale(1.1)'; + + this.layout(); + + common.defer(function() { + _this.backgroundElement.style.opacity = 1; + _this.domElement.style.opacity = 1; + _this.domElement.style.webkitTransform = 'scale(1)'; + }); + + }; + + CenteredDiv.prototype.hide = function() { + + var _this = this; + + var hide = function() { + + _this.domElement.style.display = 'none'; + _this.backgroundElement.style.display = 'none'; + + dom.unbind(_this.domElement, 'webkitTransitionEnd', hide); + dom.unbind(_this.domElement, 'transitionend', hide); + dom.unbind(_this.domElement, 'oTransitionEnd', hide); + + }; + + dom.bind(this.domElement, 'webkitTransitionEnd', hide); + dom.bind(this.domElement, 'transitionend', hide); + dom.bind(this.domElement, 'oTransitionEnd', hide); + + this.backgroundElement.style.opacity = 0; + // this.domElement.style.top = '48%'; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + + }; + + CenteredDiv.prototype.layout = function() { + this.domElement.style.left = window.innerWidth/2 - dom.getWidth(this.domElement) / 2 + 'px'; + this.domElement.style.top = window.innerHeight/2 - dom.getHeight(this.domElement) / 2 + 'px'; + }; + + function lockScroll(e) { + console.log(e); + } + + return CenteredDiv; + + })(dat.dom.dom, + dat.utils.common), + dat.dom.dom, + dat.utils.common); + +/***/ }), +/* 5 */ +/***/ (function(module, exports) { + + /** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + + /** @namespace */ + var dat = module.exports = dat || {}; + + /** @namespace */ + dat.color = dat.color || {}; + + /** @namespace */ + dat.utils = dat.utils || {}; + + dat.utils.common = (function () { + + var ARR_EACH = Array.prototype.forEach; + var ARR_SLICE = Array.prototype.slice; + + /** + * Band-aid methods for things that should be a lot easier in JavaScript. + * Implementation and structure inspired by underscore.js + * http://documentcloud.github.com/underscore/ + */ + + return { + + BREAK: {}, + + extend: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (!this.isUndefined(obj[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + defaults: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (this.isUndefined(target[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + compose: function() { + var toCall = ARR_SLICE.call(arguments); + return function() { + var args = ARR_SLICE.call(arguments); + for (var i = toCall.length -1; i >= 0; i--) { + args = [toCall[i].apply(this, args)]; + } + return args[0]; + } + }, + + each: function(obj, itr, scope) { + + + if (ARR_EACH && obj.forEach === ARR_EACH) { + + obj.forEach(itr, scope); + + } else if (obj.length === obj.length + 0) { // Is number but not NaN + + for (var key = 0, l = obj.length; key < l; key++) + if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) + return; + + } else { + + for (var key in obj) + if (itr.call(scope, obj[key], key) === this.BREAK) + return; + + } + + }, + + defer: function(fnc) { + setTimeout(fnc, 0); + }, + + toArray: function(obj) { + if (obj.toArray) return obj.toArray(); + return ARR_SLICE.call(obj); + }, + + isUndefined: function(obj) { + return obj === undefined; + }, + + isNull: function(obj) { + return obj === null; + }, + + isNaN: function(obj) { + return obj !== obj; + }, + + isArray: Array.isArray || function(obj) { + return obj.constructor === Array; + }, + + isObject: function(obj) { + return obj === Object(obj); + }, + + isNumber: function(obj) { + return obj === obj+0; + }, + + isString: function(obj) { + return obj === obj+''; + }, + + isBoolean: function(obj) { + return obj === false || obj === true; + }, + + isFunction: function(obj) { + return Object.prototype.toString.call(obj) === '[object Function]'; + } + + }; + + })(); + + + dat.color.toString = (function (common) { + + return function(color) { + + if (color.a == 1 || common.isUndefined(color.a)) { + + var s = color.hex.toString(16); + while (s.length < 6) { + s = '0' + s; + } + + return '#' + s; + + } else { + + return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')'; + + } + + } + + })(dat.utils.common); + + + dat.Color = dat.color.Color = (function (interpret, math, toString, common) { + + var Color = function() { + + this.__state = interpret.apply(this, arguments); + + if (this.__state === false) { + throw 'Failed to interpret color arguments'; + } + + this.__state.a = this.__state.a || 1; + + + }; + + Color.COMPONENTS = ['r','g','b','h','s','v','hex','a']; + + common.extend(Color.prototype, { + + toString: function() { + return toString(this); + }, + + toOriginal: function() { + return this.__state.conversion.write(this); + } + + }); + + defineRGBComponent(Color.prototype, 'r', 2); + defineRGBComponent(Color.prototype, 'g', 1); + defineRGBComponent(Color.prototype, 'b', 0); + + defineHSVComponent(Color.prototype, 'h'); + defineHSVComponent(Color.prototype, 's'); + defineHSVComponent(Color.prototype, 'v'); + + Object.defineProperty(Color.prototype, 'a', { + + get: function() { + return this.__state.a; + }, + + set: function(v) { + this.__state.a = v; + } + + }); + + Object.defineProperty(Color.prototype, 'hex', { + + get: function() { + + if (!this.__state.space !== 'HEX') { + this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b); + } + + return this.__state.hex; + + }, + + set: function(v) { + + this.__state.space = 'HEX'; + this.__state.hex = v; + + } + + }); + + function defineRGBComponent(target, component, componentHexIndex) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'RGB') { + return this.__state[component]; + } + + recalculateRGB(this, component, componentHexIndex); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'RGB') { + recalculateRGB(this, component, componentHexIndex); + this.__state.space = 'RGB'; + } + + this.__state[component] = v; + + } + + }); + + } + + function defineHSVComponent(target, component) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'HSV') + return this.__state[component]; + + recalculateHSV(this); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'HSV') { + recalculateHSV(this); + this.__state.space = 'HSV'; + } + + this.__state[component] = v; + + } + + }); + + } + + function recalculateRGB(color, component, componentHexIndex) { + + if (color.__state.space === 'HEX') { + + color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex); + + } else if (color.__state.space === 'HSV') { + + common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); + + } else { + + throw 'Corrupted color state'; + + } + + } + + function recalculateHSV(color) { + + var result = math.rgb_to_hsv(color.r, color.g, color.b); + + common.extend(color.__state, + { + s: result.s, + v: result.v + } + ); + + if (!common.isNaN(result.h)) { + color.__state.h = result.h; + } else if (common.isUndefined(color.__state.h)) { + color.__state.h = 0; + } + + } + + return Color; + + })(dat.color.interpret = (function (toString, common) { + + var result, toReturn; + + var interpret = function() { + + toReturn = false; + + var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0]; + + common.each(INTERPRETATIONS, function(family) { + + if (family.litmus(original)) { + + common.each(family.conversions, function(conversion, conversionName) { + + result = conversion.read(original); + + if (toReturn === false && result !== false) { + toReturn = result; + result.conversionName = conversionName; + result.conversion = conversion; + return common.BREAK; + + } + + }); + + return common.BREAK; + + } + + }); + + return toReturn; + + }; + + var INTERPRETATIONS = [ + + // Strings + { + + litmus: common.isString, + + conversions: { + + THREE_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt( + '0x' + + test[1].toString() + test[1].toString() + + test[2].toString() + test[2].toString() + + test[3].toString() + test[3].toString()) + }; + + }, + + write: toString + + }, + + SIX_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9]{6})$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString()) + }; + + }, + + write: toString + + }, + + CSS_RGB: { + + read: function(original) { + + var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]) + }; + + }, + + write: toString + + }, + + CSS_RGBA: { + + read: function(original) { + + var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]), + a: parseFloat(test[4]) + }; + + }, + + write: toString + + } + + } + + }, + + // Numbers + { + + litmus: common.isNumber, + + conversions: { + + HEX: { + read: function(original) { + return { + space: 'HEX', + hex: original, + conversionName: 'HEX' + } + }, + + write: function(color) { + return color.hex; + } + } + + } + + }, + + // Arrays + { + + litmus: common.isArray, + + conversions: { + + RGB_ARRAY: { + read: function(original) { + if (original.length != 3) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b]; + } + + }, + + RGBA_ARRAY: { + read: function(original) { + if (original.length != 4) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2], + a: original[3] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b, color.a]; + } + + } + + } + + }, + + // Objects + { + + litmus: common.isObject, + + conversions: { + + RGBA_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b) && + common.isNumber(original.a)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b, + a: color.a + } + } + }, + + RGB_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b + } + } + }, + + HSVA_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v) && + common.isNumber(original.a)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v, + a: color.a + } + } + }, + + HSV_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v + } + } + + } + + } + + } + + + ]; + + return interpret; + + + })(dat.color.toString, + dat.utils.common), + dat.color.math = (function () { + + var tmpComponent; + + return { + + hsv_to_rgb: function(h, s, v) { + + var hi = Math.floor(h / 60) % 6; + + var f = h / 60 - Math.floor(h / 60); + var p = v * (1.0 - s); + var q = v * (1.0 - (f * s)); + var t = v * (1.0 - ((1.0 - f) * s)); + var c = [ + [v, t, p], + [q, v, p], + [p, v, t], + [p, q, v], + [t, p, v], + [v, p, q] + ][hi]; + + return { + r: c[0] * 255, + g: c[1] * 255, + b: c[2] * 255 + }; + + }, + + rgb_to_hsv: function(r, g, b) { + + var min = Math.min(r, g, b), + max = Math.max(r, g, b), + delta = max - min, + h, s; + + if (max != 0) { + s = delta / max; + } else { + return { + h: NaN, + s: 0, + v: 0 + }; + } + + if (r == max) { + h = (g - b) / delta; + } else if (g == max) { + h = 2 + (b - r) / delta; + } else { + h = 4 + (r - g) / delta; + } + h /= 6; + if (h < 0) { + h += 1; + } + + return { + h: h * 360, + s: s, + v: max / 255 + }; + }, + + rgb_to_hex: function(r, g, b) { + var hex = this.hex_with_component(0, 2, r); + hex = this.hex_with_component(hex, 1, g); + hex = this.hex_with_component(hex, 0, b); + return hex; + }, + + component_from_hex: function(hex, componentIndex) { + return (hex >> (componentIndex * 8)) & 0xFF; + }, + + hex_with_component: function(hex, componentIndex, value) { + return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent)); + } + + } + + })(), + dat.color.toString, + dat.utils.common); + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + (function (global, factory) { + true ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.THREE = global.THREE || {}))); + }(this, (function (exports) { 'use strict'; + + // Polyfills + + if ( Number.EPSILON === undefined ) { + + Number.EPSILON = Math.pow( 2, - 52 ); + + } + + // + + if ( Math.sign === undefined ) { + + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign + + Math.sign = function ( x ) { + + return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x; + + }; + + } + + if ( Function.prototype.name === undefined ) { + + // Missing in IE9-11. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name + + Object.defineProperty( Function.prototype, 'name', { + + get: function () { + + return this.toString().match( /^\s*function\s*(\S*)\s*\(/ )[ 1 ]; + + } + + } ); + + } + + if ( Object.assign === undefined ) { + + // Missing in IE. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign + + ( function () { + + Object.assign = function ( target ) { + + 'use strict'; + + if ( target === undefined || target === null ) { + + throw new TypeError( 'Cannot convert undefined or null to object' ); + + } + + var output = Object( target ); + + for ( var index = 1; index < arguments.length; index ++ ) { + + var source = arguments[ index ]; + + if ( source !== undefined && source !== null ) { + + for ( var nextKey in source ) { + + if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) { + + output[ nextKey ] = source[ nextKey ]; + + } + + } + + } + + } + + return output; + + }; + + } )(); + + } + + /** + * https://github.com/mrdoob/eventdispatcher.js/ + */ + + function EventDispatcher() {} + + Object.assign( EventDispatcher.prototype, { + + addEventListener: function ( type, listener ) { + + if ( this._listeners === undefined ) this._listeners = {}; + + var listeners = this._listeners; + + if ( listeners[ type ] === undefined ) { + + listeners[ type ] = []; + + } + + if ( listeners[ type ].indexOf( listener ) === - 1 ) { + + listeners[ type ].push( listener ); + + } + + }, + + hasEventListener: function ( type, listener ) { + + if ( this._listeners === undefined ) return false; + + var listeners = this._listeners; + + if ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) { + + return true; + + } + + return false; + + }, + + removeEventListener: function ( type, listener ) { + + if ( this._listeners === undefined ) return; + + var listeners = this._listeners; + var listenerArray = listeners[ type ]; + + if ( listenerArray !== undefined ) { + + var index = listenerArray.indexOf( listener ); + + if ( index !== - 1 ) { + + listenerArray.splice( index, 1 ); + + } + + } + + }, + + dispatchEvent: function ( event ) { + + if ( this._listeners === undefined ) return; + + var listeners = this._listeners; + var listenerArray = listeners[ event.type ]; + + if ( listenerArray !== undefined ) { + + event.target = this; + + var array = [], i = 0; + var length = listenerArray.length; + + for ( i = 0; i < length; i ++ ) { + + array[ i ] = listenerArray[ i ]; + + } + + for ( i = 0; i < length; i ++ ) { + + array[ i ].call( this, event ); + + } + + } + + } + + } ); + + var REVISION = '82'; + var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 }; + var CullFaceNone = 0; + var CullFaceBack = 1; + var CullFaceFront = 2; + var CullFaceFrontBack = 3; + var FrontFaceDirectionCW = 0; + var FrontFaceDirectionCCW = 1; + var BasicShadowMap = 0; + var PCFShadowMap = 1; + var PCFSoftShadowMap = 2; + var FrontSide = 0; + var BackSide = 1; + var DoubleSide = 2; + var FlatShading = 1; + var SmoothShading = 2; + var NoColors = 0; + var FaceColors = 1; + var VertexColors = 2; + var NoBlending = 0; + var NormalBlending = 1; + var AdditiveBlending = 2; + var SubtractiveBlending = 3; + var MultiplyBlending = 4; + var CustomBlending = 5; + var BlendingMode = { + NoBlending: NoBlending, + NormalBlending: NormalBlending, + AdditiveBlending: AdditiveBlending, + SubtractiveBlending: SubtractiveBlending, + MultiplyBlending: MultiplyBlending, + CustomBlending: CustomBlending + }; + var AddEquation = 100; + var SubtractEquation = 101; + var ReverseSubtractEquation = 102; + var MinEquation = 103; + var MaxEquation = 104; + var ZeroFactor = 200; + var OneFactor = 201; + var SrcColorFactor = 202; + var OneMinusSrcColorFactor = 203; + var SrcAlphaFactor = 204; + var OneMinusSrcAlphaFactor = 205; + var DstAlphaFactor = 206; + var OneMinusDstAlphaFactor = 207; + var DstColorFactor = 208; + var OneMinusDstColorFactor = 209; + var SrcAlphaSaturateFactor = 210; + var NeverDepth = 0; + var AlwaysDepth = 1; + var LessDepth = 2; + var LessEqualDepth = 3; + var EqualDepth = 4; + var GreaterEqualDepth = 5; + var GreaterDepth = 6; + var NotEqualDepth = 7; + var MultiplyOperation = 0; + var MixOperation = 1; + var AddOperation = 2; + var NoToneMapping = 0; + var LinearToneMapping = 1; + var ReinhardToneMapping = 2; + var Uncharted2ToneMapping = 3; + var CineonToneMapping = 4; + var UVMapping = 300; + var CubeReflectionMapping = 301; + var CubeRefractionMapping = 302; + var EquirectangularReflectionMapping = 303; + var EquirectangularRefractionMapping = 304; + var SphericalReflectionMapping = 305; + var CubeUVReflectionMapping = 306; + var CubeUVRefractionMapping = 307; + var TextureMapping = { + UVMapping: UVMapping, + CubeReflectionMapping: CubeReflectionMapping, + CubeRefractionMapping: CubeRefractionMapping, + EquirectangularReflectionMapping: EquirectangularReflectionMapping, + EquirectangularRefractionMapping: EquirectangularRefractionMapping, + SphericalReflectionMapping: SphericalReflectionMapping, + CubeUVReflectionMapping: CubeUVReflectionMapping, + CubeUVRefractionMapping: CubeUVRefractionMapping + }; + var RepeatWrapping = 1000; + var ClampToEdgeWrapping = 1001; + var MirroredRepeatWrapping = 1002; + var TextureWrapping = { + RepeatWrapping: RepeatWrapping, + ClampToEdgeWrapping: ClampToEdgeWrapping, + MirroredRepeatWrapping: MirroredRepeatWrapping + }; + var NearestFilter = 1003; + var NearestMipMapNearestFilter = 1004; + var NearestMipMapLinearFilter = 1005; + var LinearFilter = 1006; + var LinearMipMapNearestFilter = 1007; + var LinearMipMapLinearFilter = 1008; + var TextureFilter = { + NearestFilter: NearestFilter, + NearestMipMapNearestFilter: NearestMipMapNearestFilter, + NearestMipMapLinearFilter: NearestMipMapLinearFilter, + LinearFilter: LinearFilter, + LinearMipMapNearestFilter: LinearMipMapNearestFilter, + LinearMipMapLinearFilter: LinearMipMapLinearFilter + }; + var UnsignedByteType = 1009; + var ByteType = 1010; + var ShortType = 1011; + var UnsignedShortType = 1012; + var IntType = 1013; + var UnsignedIntType = 1014; + var FloatType = 1015; + var HalfFloatType = 1016; + var UnsignedShort4444Type = 1017; + var UnsignedShort5551Type = 1018; + var UnsignedShort565Type = 1019; + var UnsignedInt248Type = 1020; + var AlphaFormat = 1021; + var RGBFormat = 1022; + var RGBAFormat = 1023; + var LuminanceFormat = 1024; + var LuminanceAlphaFormat = 1025; + var RGBEFormat = RGBAFormat; + var DepthFormat = 1026; + var DepthStencilFormat = 1027; + var RGB_S3TC_DXT1_Format = 2001; + var RGBA_S3TC_DXT1_Format = 2002; + var RGBA_S3TC_DXT3_Format = 2003; + var RGBA_S3TC_DXT5_Format = 2004; + var RGB_PVRTC_4BPPV1_Format = 2100; + var RGB_PVRTC_2BPPV1_Format = 2101; + var RGBA_PVRTC_4BPPV1_Format = 2102; + var RGBA_PVRTC_2BPPV1_Format = 2103; + var RGB_ETC1_Format = 2151; + var LoopOnce = 2200; + var LoopRepeat = 2201; + var LoopPingPong = 2202; + var InterpolateDiscrete = 2300; + var InterpolateLinear = 2301; + var InterpolateSmooth = 2302; + var ZeroCurvatureEnding = 2400; + var ZeroSlopeEnding = 2401; + var WrapAroundEnding = 2402; + var TrianglesDrawMode = 0; + var TriangleStripDrawMode = 1; + var TriangleFanDrawMode = 2; + var LinearEncoding = 3000; + var sRGBEncoding = 3001; + var GammaEncoding = 3007; + var RGBEEncoding = 3002; + var LogLuvEncoding = 3003; + var RGBM7Encoding = 3004; + var RGBM16Encoding = 3005; + var RGBDEncoding = 3006; + var BasicDepthPacking = 3200; + var RGBADepthPacking = 3201; + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + */ + + var _Math = { + + DEG2RAD: Math.PI / 180, + RAD2DEG: 180 / Math.PI, + + generateUUID: function () { + + // http://www.broofa.com/Tools/Math.uuid.htm + + var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split( '' ); + var uuid = new Array( 36 ); + var rnd = 0, r; + + return function generateUUID() { + + for ( var i = 0; i < 36; i ++ ) { + + if ( i === 8 || i === 13 || i === 18 || i === 23 ) { + + uuid[ i ] = '-'; + + } else if ( i === 14 ) { + + uuid[ i ] = '4'; + + } else { + + if ( rnd <= 0x02 ) rnd = 0x2000000 + ( Math.random() * 0x1000000 ) | 0; + r = rnd & 0xf; + rnd = rnd >> 4; + uuid[ i ] = chars[ ( i === 19 ) ? ( r & 0x3 ) | 0x8 : r ]; + + } + + } + + return uuid.join( '' ); + + }; + + }(), + + clamp: function ( value, min, max ) { + + return Math.max( min, Math.min( max, value ) ); + + }, + + // compute euclidian modulo of m % n + // https://en.wikipedia.org/wiki/Modulo_operation + + euclideanModulo: function ( n, m ) { + + return ( ( n % m ) + m ) % m; + + }, + + // Linear mapping from range to range + + mapLinear: function ( x, a1, a2, b1, b2 ) { + + return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); + + }, + + // https://en.wikipedia.org/wiki/Linear_interpolation + + lerp: function ( x, y, t ) { + + return ( 1 - t ) * x + t * y; + + }, + + // http://en.wikipedia.org/wiki/Smoothstep + + smoothstep: function ( x, min, max ) { + + if ( x <= min ) return 0; + if ( x >= max ) return 1; + + x = ( x - min ) / ( max - min ); + + return x * x * ( 3 - 2 * x ); + + }, + + smootherstep: function ( x, min, max ) { + + if ( x <= min ) return 0; + if ( x >= max ) return 1; + + x = ( x - min ) / ( max - min ); + + return x * x * x * ( x * ( x * 6 - 15 ) + 10 ); + + }, + + random16: function () { + + console.warn( 'THREE.Math.random16() has been deprecated. Use Math.random() instead.' ); + return Math.random(); + + }, + + // Random integer from interval + + randInt: function ( low, high ) { + + return low + Math.floor( Math.random() * ( high - low + 1 ) ); + + }, + + // Random float from interval + + randFloat: function ( low, high ) { + + return low + Math.random() * ( high - low ); + + }, + + // Random float from <-range/2, range/2> interval + + randFloatSpread: function ( range ) { + + return range * ( 0.5 - Math.random() ); + + }, + + degToRad: function ( degrees ) { + + return degrees * _Math.DEG2RAD; + + }, + + radToDeg: function ( radians ) { + + return radians * _Math.RAD2DEG; + + }, + + isPowerOfTwo: function ( value ) { + + return ( value & ( value - 1 ) ) === 0 && value !== 0; + + }, + + nearestPowerOfTwo: function ( value ) { + + return Math.pow( 2, Math.round( Math.log( value ) / Math.LN2 ) ); + + }, + + nextPowerOfTwo: function ( value ) { + + value --; + value |= value >> 1; + value |= value >> 2; + value |= value >> 4; + value |= value >> 8; + value |= value >> 16; + value ++; + + return value; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author philogb / http://blog.thejit.org/ + * @author egraether / http://egraether.com/ + * @author zz85 / http://www.lab4games.net/zz85/blog + */ + + function Vector2( x, y ) { + + this.x = x || 0; + this.y = y || 0; + + } + + Vector2.prototype = { + + constructor: Vector2, + + isVector2: true, + + get width() { + + return this.x; + + }, + + set width( value ) { + + this.x = value; + + }, + + get height() { + + return this.y; + + }, + + set height( value ) { + + this.y = value; + + }, + + // + + set: function ( x, y ) { + + this.x = x; + this.y = y; + + return this; + + }, + + setScalar: function ( scalar ) { + + this.x = scalar; + this.y = scalar; + + return this; + + }, + + setX: function ( x ) { + + this.x = x; + + return this; + + }, + + setY: function ( y ) { + + this.y = y; + + return this; + + }, + + setComponent: function ( index, value ) { + + switch ( index ) { + + case 0: this.x = value; break; + case 1: this.y = value; break; + default: throw new Error( 'index is out of range: ' + index ); + + } + + return this; + + }, + + getComponent: function ( index ) { + + switch ( index ) { + + case 0: return this.x; + case 1: return this.y; + default: throw new Error( 'index is out of range: ' + index ); + + } + + }, + + clone: function () { + + return new this.constructor( this.x, this.y ); + + }, + + copy: function ( v ) { + + this.x = v.x; + this.y = v.y; + + return this; + + }, + + add: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); + + } + + this.x += v.x; + this.y += v.y; + + return this; + + }, + + addScalar: function ( s ) { + + this.x += s; + this.y += s; + + return this; + + }, + + addVectors: function ( a, b ) { + + this.x = a.x + b.x; + this.y = a.y + b.y; + + return this; + + }, + + addScaledVector: function ( v, s ) { + + this.x += v.x * s; + this.y += v.y * s; + + return this; + + }, + + sub: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); + + } + + this.x -= v.x; + this.y -= v.y; + + return this; + + }, + + subScalar: function ( s ) { + + this.x -= s; + this.y -= s; + + return this; + + }, + + subVectors: function ( a, b ) { + + this.x = a.x - b.x; + this.y = a.y - b.y; + + return this; + + }, + + multiply: function ( v ) { + + this.x *= v.x; + this.y *= v.y; + + return this; + + }, + + multiplyScalar: function ( scalar ) { + + if ( isFinite( scalar ) ) { + + this.x *= scalar; + this.y *= scalar; + + } else { + + this.x = 0; + this.y = 0; + + } + + return this; + + }, + + divide: function ( v ) { + + this.x /= v.x; + this.y /= v.y; + + return this; + + }, + + divideScalar: function ( scalar ) { + + return this.multiplyScalar( 1 / scalar ); + + }, + + min: function ( v ) { + + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + + return this; + + }, + + max: function ( v ) { + + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + + return this; + + }, + + clamp: function ( min, max ) { + + // This function assumes min < max, if this assumption isn't true it will not operate correctly + + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + + return this; + + }, + + clampScalar: function () { + + var min, max; + + return function clampScalar( minVal, maxVal ) { + + if ( min === undefined ) { + + min = new Vector2(); + max = new Vector2(); + + } + + min.set( minVal, minVal ); + max.set( maxVal, maxVal ); + + return this.clamp( min, max ); + + }; + + }(), + + clampLength: function ( min, max ) { + + var length = this.length(); + + return this.multiplyScalar( Math.max( min, Math.min( max, length ) ) / length ); + + }, + + floor: function () { + + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + + return this; + + }, + + ceil: function () { + + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + + return this; + + }, + + round: function () { + + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + + return this; + + }, + + roundToZero: function () { + + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + + return this; + + }, + + negate: function () { + + this.x = - this.x; + this.y = - this.y; + + return this; + + }, + + dot: function ( v ) { + + return this.x * v.x + this.y * v.y; + + }, + + lengthSq: function () { + + return this.x * this.x + this.y * this.y; + + }, + + length: function () { + + return Math.sqrt( this.x * this.x + this.y * this.y ); + + }, + + lengthManhattan: function() { + + return Math.abs( this.x ) + Math.abs( this.y ); + + }, + + normalize: function () { + + return this.divideScalar( this.length() ); + + }, + + angle: function () { + + // computes the angle in radians with respect to the positive x-axis + + var angle = Math.atan2( this.y, this.x ); + + if ( angle < 0 ) angle += 2 * Math.PI; + + return angle; + + }, + + distanceTo: function ( v ) { + + return Math.sqrt( this.distanceToSquared( v ) ); + + }, + + distanceToSquared: function ( v ) { + + var dx = this.x - v.x, dy = this.y - v.y; + return dx * dx + dy * dy; + + }, + + distanceToManhattan: function ( v ) { + + return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ); + + }, + + setLength: function ( length ) { + + return this.multiplyScalar( length / this.length() ); + + }, + + lerp: function ( v, alpha ) { + + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + + return this; + + }, + + lerpVectors: function ( v1, v2, alpha ) { + + return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); + + }, + + equals: function ( v ) { + + return ( ( v.x === this.x ) && ( v.y === this.y ) ); + + }, + + fromArray: function ( array, offset ) { + + if ( offset === undefined ) offset = 0; + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + + return array; + + }, + + fromAttribute: function ( attribute, index, offset ) { + + if ( offset === undefined ) offset = 0; + + index = index * attribute.itemSize + offset; + + this.x = attribute.array[ index ]; + this.y = attribute.array[ index + 1 ]; + + return this; + + }, + + rotateAround: function ( center, angle ) { + + var c = Math.cos( angle ), s = Math.sin( angle ); + + var x = this.x - center.x; + var y = this.y - center.y; + + this.x = x * c - y * s + center.x; + this.y = x * s + y * c + center.y; + + return this; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * @author szimek / https://github.com/szimek/ + */ + + function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) { + + Object.defineProperty( this, 'id', { value: TextureIdCount() } ); + + this.uuid = _Math.generateUUID(); + + this.name = ''; + this.sourceFile = ''; + + this.image = image !== undefined ? image : Texture.DEFAULT_IMAGE; + this.mipmaps = []; + + this.mapping = mapping !== undefined ? mapping : Texture.DEFAULT_MAPPING; + + this.wrapS = wrapS !== undefined ? wrapS : ClampToEdgeWrapping; + this.wrapT = wrapT !== undefined ? wrapT : ClampToEdgeWrapping; + + this.magFilter = magFilter !== undefined ? magFilter : LinearFilter; + this.minFilter = minFilter !== undefined ? minFilter : LinearMipMapLinearFilter; + + this.anisotropy = anisotropy !== undefined ? anisotropy : 1; + + this.format = format !== undefined ? format : RGBAFormat; + this.type = type !== undefined ? type : UnsignedByteType; + + this.offset = new Vector2( 0, 0 ); + this.repeat = new Vector2( 1, 1 ); + + this.generateMipmaps = true; + this.premultiplyAlpha = false; + this.flipY = true; + this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml) + + + // Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap. + // + // Also changing the encoding after already used by a Material will not automatically make the Material + // update. You need to explicitly call Material.needsUpdate to trigger it to recompile. + this.encoding = encoding !== undefined ? encoding : LinearEncoding; + + this.version = 0; + this.onUpdate = null; + + } + + Texture.DEFAULT_IMAGE = undefined; + Texture.DEFAULT_MAPPING = UVMapping; + + Texture.prototype = { + + constructor: Texture, + + isTexture: true, + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( source ) { + + this.image = source.image; + this.mipmaps = source.mipmaps.slice( 0 ); + + this.mapping = source.mapping; + + this.wrapS = source.wrapS; + this.wrapT = source.wrapT; + + this.magFilter = source.magFilter; + this.minFilter = source.minFilter; + + this.anisotropy = source.anisotropy; + + this.format = source.format; + this.type = source.type; + + this.offset.copy( source.offset ); + this.repeat.copy( source.repeat ); + + this.generateMipmaps = source.generateMipmaps; + this.premultiplyAlpha = source.premultiplyAlpha; + this.flipY = source.flipY; + this.unpackAlignment = source.unpackAlignment; + this.encoding = source.encoding; + + return this; + + }, + + toJSON: function ( meta ) { + + if ( meta.textures[ this.uuid ] !== undefined ) { + + return meta.textures[ this.uuid ]; + + } + + function getDataURL( image ) { + + var canvas; + + if ( image.toDataURL !== undefined ) { + + canvas = image; + + } else { + + canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); + canvas.width = image.width; + canvas.height = image.height; + + canvas.getContext( '2d' ).drawImage( image, 0, 0, image.width, image.height ); + + } + + if ( canvas.width > 2048 || canvas.height > 2048 ) { + + return canvas.toDataURL( 'image/jpeg', 0.6 ); + + } else { + + return canvas.toDataURL( 'image/png' ); + + } + + } + + var output = { + metadata: { + version: 4.4, + type: 'Texture', + generator: 'Texture.toJSON' + }, + + uuid: this.uuid, + name: this.name, + + mapping: this.mapping, + + repeat: [ this.repeat.x, this.repeat.y ], + offset: [ this.offset.x, this.offset.y ], + wrap: [ this.wrapS, this.wrapT ], + + minFilter: this.minFilter, + magFilter: this.magFilter, + anisotropy: this.anisotropy, + + flipY: this.flipY + }; + + if ( this.image !== undefined ) { + + // TODO: Move to THREE.Image + + var image = this.image; + + if ( image.uuid === undefined ) { + + image.uuid = _Math.generateUUID(); // UGH + + } + + if ( meta.images[ image.uuid ] === undefined ) { + + meta.images[ image.uuid ] = { + uuid: image.uuid, + url: getDataURL( image ) + }; + + } + + output.image = image.uuid; + + } + + meta.textures[ this.uuid ] = output; + + return output; + + }, + + dispose: function () { + + this.dispatchEvent( { type: 'dispose' } ); + + }, + + transformUv: function ( uv ) { + + if ( this.mapping !== UVMapping ) return; + + uv.multiply( this.repeat ); + uv.add( this.offset ); + + if ( uv.x < 0 || uv.x > 1 ) { + + switch ( this.wrapS ) { + + case RepeatWrapping: + + uv.x = uv.x - Math.floor( uv.x ); + break; + + case ClampToEdgeWrapping: + + uv.x = uv.x < 0 ? 0 : 1; + break; + + case MirroredRepeatWrapping: + + if ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) { + + uv.x = Math.ceil( uv.x ) - uv.x; + + } else { + + uv.x = uv.x - Math.floor( uv.x ); + + } + break; + + } + + } + + if ( uv.y < 0 || uv.y > 1 ) { + + switch ( this.wrapT ) { + + case RepeatWrapping: + + uv.y = uv.y - Math.floor( uv.y ); + break; + + case ClampToEdgeWrapping: + + uv.y = uv.y < 0 ? 0 : 1; + break; + + case MirroredRepeatWrapping: + + if ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) { + + uv.y = Math.ceil( uv.y ) - uv.y; + + } else { + + uv.y = uv.y - Math.floor( uv.y ); + + } + break; + + } + + } + + if ( this.flipY ) { + + uv.y = 1 - uv.y; + + } + + } + + }; + + Object.assign( Texture.prototype, EventDispatcher.prototype ); + + var count = 0; + function TextureIdCount() { return count++; } + + /** + * @author supereggbert / http://www.paulbrunt.co.uk/ + * @author philogb / http://blog.thejit.org/ + * @author mikael emtinger / http://gomo.se/ + * @author egraether / http://egraether.com/ + * @author WestLangley / http://github.com/WestLangley + */ + + function Vector4( x, y, z, w ) { + + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = ( w !== undefined ) ? w : 1; + + } + + Vector4.prototype = { + + constructor: Vector4, + + isVector4: true, + + set: function ( x, y, z, w ) { + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + + }, + + setScalar: function ( scalar ) { + + this.x = scalar; + this.y = scalar; + this.z = scalar; + this.w = scalar; + + return this; + + }, + + setX: function ( x ) { + + this.x = x; + + return this; + + }, + + setY: function ( y ) { + + this.y = y; + + return this; + + }, + + setZ: function ( z ) { + + this.z = z; + + return this; + + }, + + setW: function ( w ) { + + this.w = w; + + return this; + + }, + + setComponent: function ( index, value ) { + + switch ( index ) { + + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + case 3: this.w = value; break; + default: throw new Error( 'index is out of range: ' + index ); + + } + + return this; + + }, + + getComponent: function ( index ) { + + switch ( index ) { + + case 0: return this.x; + case 1: return this.y; + case 2: return this.z; + case 3: return this.w; + default: throw new Error( 'index is out of range: ' + index ); + + } + + }, + + clone: function () { + + return new this.constructor( this.x, this.y, this.z, this.w ); + + }, + + copy: function ( v ) { + + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = ( v.w !== undefined ) ? v.w : 1; + + return this; + + }, + + add: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); + + } + + this.x += v.x; + this.y += v.y; + this.z += v.z; + this.w += v.w; + + return this; + + }, + + addScalar: function ( s ) { + + this.x += s; + this.y += s; + this.z += s; + this.w += s; + + return this; + + }, + + addVectors: function ( a, b ) { + + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + this.w = a.w + b.w; + + return this; + + }, + + addScaledVector: function ( v, s ) { + + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + this.w += v.w * s; + + return this; + + }, + + sub: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); + + } + + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + this.w -= v.w; + + return this; + + }, + + subScalar: function ( s ) { + + this.x -= s; + this.y -= s; + this.z -= s; + this.w -= s; + + return this; + + }, + + subVectors: function ( a, b ) { + + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; + this.w = a.w - b.w; + + return this; + + }, + + multiplyScalar: function ( scalar ) { + + if ( isFinite( scalar ) ) { + + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + this.w *= scalar; + + } else { + + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; + + } + + return this; + + }, + + applyMatrix4: function ( m ) { + + var x = this.x, y = this.y, z = this.z, w = this.w; + var e = m.elements; + + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w; + this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w; + + return this; + + }, + + divideScalar: function ( scalar ) { + + return this.multiplyScalar( 1 / scalar ); + + }, + + setAxisAngleFromQuaternion: function ( q ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm + + // q is assumed to be normalized + + this.w = 2 * Math.acos( q.w ); + + var s = Math.sqrt( 1 - q.w * q.w ); + + if ( s < 0.0001 ) { + + this.x = 1; + this.y = 0; + this.z = 0; + + } else { + + this.x = q.x / s; + this.y = q.y / s; + this.z = q.z / s; + + } + + return this; + + }, + + setAxisAngleFromRotationMatrix: function ( m ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + var angle, x, y, z, // variables for result + epsilon = 0.01, // margin to allow for rounding errors + epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees + + te = m.elements, + + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + + if ( ( Math.abs( m12 - m21 ) < epsilon ) && + ( Math.abs( m13 - m31 ) < epsilon ) && + ( Math.abs( m23 - m32 ) < epsilon ) ) { + + // singularity found + // first check for identity matrix which must have +1 for all terms + // in leading diagonal and zero in other terms + + if ( ( Math.abs( m12 + m21 ) < epsilon2 ) && + ( Math.abs( m13 + m31 ) < epsilon2 ) && + ( Math.abs( m23 + m32 ) < epsilon2 ) && + ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) { + + // this singularity is identity matrix so angle = 0 + + this.set( 1, 0, 0, 0 ); + + return this; // zero angle, arbitrary axis + + } + + // otherwise this singularity is angle = 180 + + angle = Math.PI; + + var xx = ( m11 + 1 ) / 2; + var yy = ( m22 + 1 ) / 2; + var zz = ( m33 + 1 ) / 2; + var xy = ( m12 + m21 ) / 4; + var xz = ( m13 + m31 ) / 4; + var yz = ( m23 + m32 ) / 4; + + if ( ( xx > yy ) && ( xx > zz ) ) { + + // m11 is the largest diagonal term + + if ( xx < epsilon ) { + + x = 0; + y = 0.707106781; + z = 0.707106781; + + } else { + + x = Math.sqrt( xx ); + y = xy / x; + z = xz / x; + + } + + } else if ( yy > zz ) { + + // m22 is the largest diagonal term + + if ( yy < epsilon ) { + + x = 0.707106781; + y = 0; + z = 0.707106781; + + } else { + + y = Math.sqrt( yy ); + x = xy / y; + z = yz / y; + + } + + } else { + + // m33 is the largest diagonal term so base result on this + + if ( zz < epsilon ) { + + x = 0.707106781; + y = 0.707106781; + z = 0; + + } else { + + z = Math.sqrt( zz ); + x = xz / z; + y = yz / z; + + } + + } + + this.set( x, y, z, angle ); + + return this; // return 180 deg rotation + + } + + // as we have reached here there are no singularities so we can handle normally + + var s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) + + ( m13 - m31 ) * ( m13 - m31 ) + + ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize + + if ( Math.abs( s ) < 0.001 ) s = 1; + + // prevent divide by zero, should not happen if matrix is orthogonal and should be + // caught by singularity test above, but I've left it in just in case + + this.x = ( m32 - m23 ) / s; + this.y = ( m13 - m31 ) / s; + this.z = ( m21 - m12 ) / s; + this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 ); + + return this; + + }, + + min: function ( v ) { + + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); + this.w = Math.min( this.w, v.w ); + + return this; + + }, + + max: function ( v ) { + + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); + this.w = Math.max( this.w, v.w ); + + return this; + + }, + + clamp: function ( min, max ) { + + // This function assumes min < max, if this assumption isn't true it will not operate correctly + + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + this.w = Math.max( min.w, Math.min( max.w, this.w ) ); + + return this; + + }, + + clampScalar: function () { + + var min, max; + + return function clampScalar( minVal, maxVal ) { + + if ( min === undefined ) { + + min = new Vector4(); + max = new Vector4(); + + } + + min.set( minVal, minVal, minVal, minVal ); + max.set( maxVal, maxVal, maxVal, maxVal ); + + return this.clamp( min, max ); + + }; + + }(), + + floor: function () { + + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); + this.w = Math.floor( this.w ); + + return this; + + }, + + ceil: function () { + + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); + this.w = Math.ceil( this.w ); + + return this; + + }, + + round: function () { + + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); + this.w = Math.round( this.w ); + + return this; + + }, + + roundToZero: function () { + + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); + + return this; + + }, + + negate: function () { + + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; + this.w = - this.w; + + return this; + + }, + + dot: function ( v ) { + + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + + }, + + lengthSq: function () { + + return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; + + }, + + length: function () { + + return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); + + }, + + lengthManhattan: function () { + + return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w ); + + }, + + normalize: function () { + + return this.divideScalar( this.length() ); + + }, + + setLength: function ( length ) { + + return this.multiplyScalar( length / this.length() ); + + }, + + lerp: function ( v, alpha ) { + + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; + this.w += ( v.w - this.w ) * alpha; + + return this; + + }, + + lerpVectors: function ( v1, v2, alpha ) { + + return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); + + }, + + equals: function ( v ) { + + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); + + }, + + fromArray: function ( array, offset ) { + + if ( offset === undefined ) offset = 0; + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; + this.w = array[ offset + 3 ]; + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + array[ offset + 3 ] = this.w; + + return array; + + }, + + fromAttribute: function ( attribute, index, offset ) { + + if ( offset === undefined ) offset = 0; + + index = index * attribute.itemSize + offset; + + this.x = attribute.array[ index ]; + this.y = attribute.array[ index + 1 ]; + this.z = attribute.array[ index + 2 ]; + this.w = attribute.array[ index + 3 ]; + + return this; + + } + + }; + + /** + * @author szimek / https://github.com/szimek/ + * @author alteredq / http://alteredqualia.com/ + * @author Marius Kintel / https://github.com/kintel + */ + + /* + In options, we can specify: + * Texture parameters for an auto-generated target texture + * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers + */ + function WebGLRenderTarget( width, height, options ) { + + this.uuid = _Math.generateUUID(); + + this.width = width; + this.height = height; + + this.scissor = new Vector4( 0, 0, width, height ); + this.scissorTest = false; + + this.viewport = new Vector4( 0, 0, width, height ); + + options = options || {}; + + if ( options.minFilter === undefined ) options.minFilter = LinearFilter; + + this.texture = new Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding ); + + this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; + this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; + this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; + + } + + Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, { + + isWebGLRenderTarget: true, + + setSize: function ( width, height ) { + + if ( this.width !== width || this.height !== height ) { + + this.width = width; + this.height = height; + + this.dispose(); + + } + + this.viewport.set( 0, 0, width, height ); + this.scissor.set( 0, 0, width, height ); + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( source ) { + + this.width = source.width; + this.height = source.height; + + this.viewport.copy( source.viewport ); + + this.texture = source.texture.clone(); + + this.depthBuffer = source.depthBuffer; + this.stencilBuffer = source.stencilBuffer; + this.depthTexture = source.depthTexture; + + return this; + + }, + + dispose: function () { + + this.dispatchEvent( { type: 'dispose' } ); + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com + */ + + function WebGLRenderTargetCube( width, height, options ) { + + WebGLRenderTarget.call( this, width, height, options ); + + this.activeCubeFace = 0; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5 + this.activeMipMapLevel = 0; + + } + + WebGLRenderTargetCube.prototype = Object.create( WebGLRenderTarget.prototype ); + WebGLRenderTargetCube.prototype.constructor = WebGLRenderTargetCube; + + WebGLRenderTargetCube.prototype.isWebGLRenderTargetCube = true; + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + * @author WestLangley / http://github.com/WestLangley + * @author bhouston / http://clara.io + */ + + function Quaternion( x, y, z, w ) { + + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = ( w !== undefined ) ? w : 1; + + } + + Quaternion.prototype = { + + constructor: Quaternion, + + get x () { + + return this._x; + + }, + + set x ( value ) { + + this._x = value; + this.onChangeCallback(); + + }, + + get y () { + + return this._y; + + }, + + set y ( value ) { + + this._y = value; + this.onChangeCallback(); + + }, + + get z () { + + return this._z; + + }, + + set z ( value ) { + + this._z = value; + this.onChangeCallback(); + + }, + + get w () { + + return this._w; + + }, + + set w ( value ) { + + this._w = value; + this.onChangeCallback(); + + }, + + set: function ( x, y, z, w ) { + + this._x = x; + this._y = y; + this._z = z; + this._w = w; + + this.onChangeCallback(); + + return this; + + }, + + clone: function () { + + return new this.constructor( this._x, this._y, this._z, this._w ); + + }, + + copy: function ( quaternion ) { + + this._x = quaternion.x; + this._y = quaternion.y; + this._z = quaternion.z; + this._w = quaternion.w; + + this.onChangeCallback(); + + return this; + + }, + + setFromEuler: function ( euler, update ) { + + if ( (euler && euler.isEuler) === false ) { + + throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + + } + + // http://www.mathworks.com/matlabcentral/fileexchange/ + // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ + // content/SpinCalc.m + + var c1 = Math.cos( euler._x / 2 ); + var c2 = Math.cos( euler._y / 2 ); + var c3 = Math.cos( euler._z / 2 ); + var s1 = Math.sin( euler._x / 2 ); + var s2 = Math.sin( euler._y / 2 ); + var s3 = Math.sin( euler._z / 2 ); + + var order = euler.order; + + if ( order === 'XYZ' ) { + + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + + } else if ( order === 'YXZ' ) { + + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + + } else if ( order === 'ZXY' ) { + + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + + } else if ( order === 'ZYX' ) { + + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + + } else if ( order === 'YZX' ) { + + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + + } else if ( order === 'XZY' ) { + + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + + } + + if ( update !== false ) this.onChangeCallback(); + + return this; + + }, + + setFromAxisAngle: function ( axis, angle ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm + + // assumes axis is normalized + + var halfAngle = angle / 2, s = Math.sin( halfAngle ); + + this._x = axis.x * s; + this._y = axis.y * s; + this._z = axis.z * s; + this._w = Math.cos( halfAngle ); + + this.onChangeCallback(); + + return this; + + }, + + setFromRotationMatrix: function ( m ) { + + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + var te = m.elements, + + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ], + + trace = m11 + m22 + m33, + s; + + if ( trace > 0 ) { + + s = 0.5 / Math.sqrt( trace + 1.0 ); + + this._w = 0.25 / s; + this._x = ( m32 - m23 ) * s; + this._y = ( m13 - m31 ) * s; + this._z = ( m21 - m12 ) * s; + + } else if ( m11 > m22 && m11 > m33 ) { + + s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 ); + + this._w = ( m32 - m23 ) / s; + this._x = 0.25 * s; + this._y = ( m12 + m21 ) / s; + this._z = ( m13 + m31 ) / s; + + } else if ( m22 > m33 ) { + + s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 ); + + this._w = ( m13 - m31 ) / s; + this._x = ( m12 + m21 ) / s; + this._y = 0.25 * s; + this._z = ( m23 + m32 ) / s; + + } else { + + s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 ); + + this._w = ( m21 - m12 ) / s; + this._x = ( m13 + m31 ) / s; + this._y = ( m23 + m32 ) / s; + this._z = 0.25 * s; + + } + + this.onChangeCallback(); + + return this; + + }, + + setFromUnitVectors: function () { + + // http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final + + // assumes direction vectors vFrom and vTo are normalized + + var v1, r; + + var EPS = 0.000001; + + return function setFromUnitVectors( vFrom, vTo ) { + + if ( v1 === undefined ) v1 = new Vector3(); + + r = vFrom.dot( vTo ) + 1; + + if ( r < EPS ) { + + r = 0; + + if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) { + + v1.set( - vFrom.y, vFrom.x, 0 ); + + } else { + + v1.set( 0, - vFrom.z, vFrom.y ); + + } + + } else { + + v1.crossVectors( vFrom, vTo ); + + } + + this._x = v1.x; + this._y = v1.y; + this._z = v1.z; + this._w = r; + + return this.normalize(); + + }; + + }(), + + inverse: function () { + + return this.conjugate().normalize(); + + }, + + conjugate: function () { + + this._x *= - 1; + this._y *= - 1; + this._z *= - 1; + + this.onChangeCallback(); + + return this; + + }, + + dot: function ( v ) { + + return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; + + }, + + lengthSq: function () { + + return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; + + }, + + length: function () { + + return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ); + + }, + + normalize: function () { + + var l = this.length(); + + if ( l === 0 ) { + + this._x = 0; + this._y = 0; + this._z = 0; + this._w = 1; + + } else { + + l = 1 / l; + + this._x = this._x * l; + this._y = this._y * l; + this._z = this._z * l; + this._w = this._w * l; + + } + + this.onChangeCallback(); + + return this; + + }, + + multiply: function ( q, p ) { + + if ( p !== undefined ) { + + console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' ); + return this.multiplyQuaternions( q, p ); + + } + + return this.multiplyQuaternions( this, q ); + + }, + + premultiply: function ( q ) { + + return this.multiplyQuaternions( q, this ); + + }, + + multiplyQuaternions: function ( a, b ) { + + // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm + + var qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; + var qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; + + this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; + this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; + this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; + this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; + + this.onChangeCallback(); + + return this; + + }, + + slerp: function ( qb, t ) { + + if ( t === 0 ) return this; + if ( t === 1 ) return this.copy( qb ); + + var x = this._x, y = this._y, z = this._z, w = this._w; + + // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ + + var cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; + + if ( cosHalfTheta < 0 ) { + + this._w = - qb._w; + this._x = - qb._x; + this._y = - qb._y; + this._z = - qb._z; + + cosHalfTheta = - cosHalfTheta; + + } else { + + this.copy( qb ); + + } + + if ( cosHalfTheta >= 1.0 ) { + + this._w = w; + this._x = x; + this._y = y; + this._z = z; + + return this; + + } + + var sinHalfTheta = Math.sqrt( 1.0 - cosHalfTheta * cosHalfTheta ); + + if ( Math.abs( sinHalfTheta ) < 0.001 ) { + + this._w = 0.5 * ( w + this._w ); + this._x = 0.5 * ( x + this._x ); + this._y = 0.5 * ( y + this._y ); + this._z = 0.5 * ( z + this._z ); + + return this; + + } + + var halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); + var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, + ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; + + this._w = ( w * ratioA + this._w * ratioB ); + this._x = ( x * ratioA + this._x * ratioB ); + this._y = ( y * ratioA + this._y * ratioB ); + this._z = ( z * ratioA + this._z * ratioB ); + + this.onChangeCallback(); + + return this; + + }, + + equals: function ( quaternion ) { + + return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); + + }, + + fromArray: function ( array, offset ) { + + if ( offset === undefined ) offset = 0; + + this._x = array[ offset ]; + this._y = array[ offset + 1 ]; + this._z = array[ offset + 2 ]; + this._w = array[ offset + 3 ]; + + this.onChangeCallback(); + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._w; + + return array; + + }, + + onChange: function ( callback ) { + + this.onChangeCallback = callback; + + return this; + + }, + + onChangeCallback: function () {} + + }; + + Object.assign( Quaternion, { + + slerp: function( qa, qb, qm, t ) { + + return qm.copy( qa ).slerp( qb, t ); + + }, + + slerpFlat: function( + dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { + + // fuzz-free, array-based Quaternion SLERP operation + + var x0 = src0[ srcOffset0 + 0 ], + y0 = src0[ srcOffset0 + 1 ], + z0 = src0[ srcOffset0 + 2 ], + w0 = src0[ srcOffset0 + 3 ], + + x1 = src1[ srcOffset1 + 0 ], + y1 = src1[ srcOffset1 + 1 ], + z1 = src1[ srcOffset1 + 2 ], + w1 = src1[ srcOffset1 + 3 ]; + + if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) { + + var s = 1 - t, + + cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, + + dir = ( cos >= 0 ? 1 : - 1 ), + sqrSin = 1 - cos * cos; + + // Skip the Slerp for tiny steps to avoid numeric problems: + if ( sqrSin > Number.EPSILON ) { + + var sin = Math.sqrt( sqrSin ), + len = Math.atan2( sin, cos * dir ); + + s = Math.sin( s * len ) / sin; + t = Math.sin( t * len ) / sin; + + } + + var tDir = t * dir; + + x0 = x0 * s + x1 * tDir; + y0 = y0 * s + y1 * tDir; + z0 = z0 * s + z1 * tDir; + w0 = w0 * s + w1 * tDir; + + // Normalize in case we just did a lerp: + if ( s === 1 - t ) { + + var f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 ); + + x0 *= f; + y0 *= f; + z0 *= f; + w0 *= f; + + } + + } + + dst[ dstOffset ] = x0; + dst[ dstOffset + 1 ] = y0; + dst[ dstOffset + 2 ] = z0; + dst[ dstOffset + 3 ] = w0; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + * @author *kile / http://kile.stravaganza.org/ + * @author philogb / http://blog.thejit.org/ + * @author mikael emtinger / http://gomo.se/ + * @author egraether / http://egraether.com/ + * @author WestLangley / http://github.com/WestLangley + */ + + function Vector3( x, y, z ) { + + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + + } + + Vector3.prototype = { + + constructor: Vector3, + + isVector3: true, + + set: function ( x, y, z ) { + + this.x = x; + this.y = y; + this.z = z; + + return this; + + }, + + setScalar: function ( scalar ) { + + this.x = scalar; + this.y = scalar; + this.z = scalar; + + return this; + + }, + + setX: function ( x ) { + + this.x = x; + + return this; + + }, + + setY: function ( y ) { + + this.y = y; + + return this; + + }, + + setZ: function ( z ) { + + this.z = z; + + return this; + + }, + + setComponent: function ( index, value ) { + + switch ( index ) { + + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + default: throw new Error( 'index is out of range: ' + index ); + + } + + return this; + + }, + + getComponent: function ( index ) { + + switch ( index ) { + + case 0: return this.x; + case 1: return this.y; + case 2: return this.z; + default: throw new Error( 'index is out of range: ' + index ); + + } + + }, + + clone: function () { + + return new this.constructor( this.x, this.y, this.z ); + + }, + + copy: function ( v ) { + + this.x = v.x; + this.y = v.y; + this.z = v.z; + + return this; + + }, + + add: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); + + } + + this.x += v.x; + this.y += v.y; + this.z += v.z; + + return this; + + }, + + addScalar: function ( s ) { + + this.x += s; + this.y += s; + this.z += s; + + return this; + + }, + + addVectors: function ( a, b ) { + + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + + }, + + addScaledVector: function ( v, s ) { + + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + + return this; + + }, + + sub: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); + + } + + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + + return this; + + }, + + subScalar: function ( s ) { + + this.x -= s; + this.y -= s; + this.z -= s; + + return this; + + }, + + subVectors: function ( a, b ) { + + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; + + return this; + + }, + + multiply: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' ); + return this.multiplyVectors( v, w ); + + } + + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; + + return this; + + }, + + multiplyScalar: function ( scalar ) { + + if ( isFinite( scalar ) ) { + + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + + } else { + + this.x = 0; + this.y = 0; + this.z = 0; + + } + + return this; + + }, + + multiplyVectors: function ( a, b ) { + + this.x = a.x * b.x; + this.y = a.y * b.y; + this.z = a.z * b.z; + + return this; + + }, + + applyEuler: function () { + + var quaternion; + + return function applyEuler( euler ) { + + if ( (euler && euler.isEuler) === false ) { + + console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + + } + + if ( quaternion === undefined ) quaternion = new Quaternion(); + + return this.applyQuaternion( quaternion.setFromEuler( euler ) ); + + }; + + }(), + + applyAxisAngle: function () { + + var quaternion; + + return function applyAxisAngle( axis, angle ) { + + if ( quaternion === undefined ) quaternion = new Quaternion(); + + return this.applyQuaternion( quaternion.setFromAxisAngle( axis, angle ) ); + + }; + + }(), + + applyMatrix3: function ( m ) { + + var x = this.x, y = this.y, z = this.z; + var e = m.elements; + + this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z; + this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z; + this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z; + + return this; + + }, + + applyMatrix4: function ( m ) { + + // input: THREE.Matrix4 affine matrix + + var x = this.x, y = this.y, z = this.z; + var e = m.elements; + + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ]; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ]; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ]; + + return this; + + }, + + applyProjection: function ( m ) { + + // input: THREE.Matrix4 projection matrix + + var x = this.x, y = this.y, z = this.z; + var e = m.elements; + var d = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); // perspective divide + + this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * d; + this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * d; + this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * d; + + return this; + + }, + + applyQuaternion: function ( q ) { + + var x = this.x, y = this.y, z = this.z; + var qx = q.x, qy = q.y, qz = q.z, qw = q.w; + + // calculate quat * vector + + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = - qx * x - qy * y - qz * z; + + // calculate result * inverse quat + + this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy; + this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz; + this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx; + + return this; + + }, + + project: function () { + + var matrix; + + return function project( camera ) { + + if ( matrix === undefined ) matrix = new Matrix4(); + + matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) ); + return this.applyProjection( matrix ); + + }; + + }(), + + unproject: function () { + + var matrix; + + return function unproject( camera ) { + + if ( matrix === undefined ) matrix = new Matrix4(); + + matrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) ); + return this.applyProjection( matrix ); + + }; + + }(), + + transformDirection: function ( m ) { + + // input: THREE.Matrix4 affine matrix + // vector interpreted as a direction + + var x = this.x, y = this.y, z = this.z; + var e = m.elements; + + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z; + + return this.normalize(); + + }, + + divide: function ( v ) { + + this.x /= v.x; + this.y /= v.y; + this.z /= v.z; + + return this; + + }, + + divideScalar: function ( scalar ) { + + return this.multiplyScalar( 1 / scalar ); + + }, + + min: function ( v ) { + + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); + + return this; + + }, + + max: function ( v ) { + + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); + + return this; + + }, + + clamp: function ( min, max ) { + + // This function assumes min < max, if this assumption isn't true it will not operate correctly + + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + + return this; + + }, + + clampScalar: function () { + + var min, max; + + return function clampScalar( minVal, maxVal ) { + + if ( min === undefined ) { + + min = new Vector3(); + max = new Vector3(); + + } + + min.set( minVal, minVal, minVal ); + max.set( maxVal, maxVal, maxVal ); + + return this.clamp( min, max ); + + }; + + }(), + + clampLength: function ( min, max ) { + + var length = this.length(); + + return this.multiplyScalar( Math.max( min, Math.min( max, length ) ) / length ); + + }, + + floor: function () { + + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); + + return this; + + }, + + ceil: function () { + + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); + + return this; + + }, + + round: function () { + + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); + + return this; + + }, + + roundToZero: function () { + + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + + return this; + + }, + + negate: function () { + + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; + + return this; + + }, + + dot: function ( v ) { + + return this.x * v.x + this.y * v.y + this.z * v.z; + + }, + + lengthSq: function () { + + return this.x * this.x + this.y * this.y + this.z * this.z; + + }, + + length: function () { + + return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z ); + + }, + + lengthManhattan: function () { + + return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); + + }, + + normalize: function () { + + return this.divideScalar( this.length() ); + + }, + + setLength: function ( length ) { + + return this.multiplyScalar( length / this.length() ); + + }, + + lerp: function ( v, alpha ) { + + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; + + return this; + + }, + + lerpVectors: function ( v1, v2, alpha ) { + + return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); + + }, + + cross: function ( v, w ) { + + if ( w !== undefined ) { + + console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' ); + return this.crossVectors( v, w ); + + } + + var x = this.x, y = this.y, z = this.z; + + this.x = y * v.z - z * v.y; + this.y = z * v.x - x * v.z; + this.z = x * v.y - y * v.x; + + return this; + + }, + + crossVectors: function ( a, b ) { + + var ax = a.x, ay = a.y, az = a.z; + var bx = b.x, by = b.y, bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + + }, + + projectOnVector: function ( vector ) { + + var scalar = vector.dot( this ) / vector.lengthSq(); + + return this.copy( vector ).multiplyScalar( scalar ); + + }, + + projectOnPlane: function () { + + var v1; + + return function projectOnPlane( planeNormal ) { + + if ( v1 === undefined ) v1 = new Vector3(); + + v1.copy( this ).projectOnVector( planeNormal ); + + return this.sub( v1 ); + + }; + + }(), + + reflect: function () { + + // reflect incident vector off plane orthogonal to normal + // normal is assumed to have unit length + + var v1; + + return function reflect( normal ) { + + if ( v1 === undefined ) v1 = new Vector3(); + + return this.sub( v1.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); + + }; + + }(), + + angleTo: function ( v ) { + + var theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) ); + + // clamp, to handle numerical problems + + return Math.acos( _Math.clamp( theta, - 1, 1 ) ); + + }, + + distanceTo: function ( v ) { + + return Math.sqrt( this.distanceToSquared( v ) ); + + }, + + distanceToSquared: function ( v ) { + + var dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; + + return dx * dx + dy * dy + dz * dz; + + }, + + distanceToManhattan: function ( v ) { + + return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); + + }, + + setFromSpherical: function( s ) { + + var sinPhiRadius = Math.sin( s.phi ) * s.radius; + + this.x = sinPhiRadius * Math.sin( s.theta ); + this.y = Math.cos( s.phi ) * s.radius; + this.z = sinPhiRadius * Math.cos( s.theta ); + + return this; + + }, + + setFromMatrixPosition: function ( m ) { + + return this.setFromMatrixColumn( m, 3 ); + + }, + + setFromMatrixScale: function ( m ) { + + var sx = this.setFromMatrixColumn( m, 0 ).length(); + var sy = this.setFromMatrixColumn( m, 1 ).length(); + var sz = this.setFromMatrixColumn( m, 2 ).length(); + + this.x = sx; + this.y = sy; + this.z = sz; + + return this; + + }, + + setFromMatrixColumn: function ( m, index ) { + + if ( typeof m === 'number' ) { + + console.warn( 'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).' ); + var temp = m; + m = index; + index = temp; + + } + + return this.fromArray( m.elements, index * 4 ); + + }, + + equals: function ( v ) { + + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); + + }, + + fromArray: function ( array, offset ) { + + if ( offset === undefined ) offset = 0; + + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + + return array; + + }, + + fromAttribute: function ( attribute, index, offset ) { + + if ( offset === undefined ) offset = 0; + + index = index * attribute.itemSize + offset; + + this.x = attribute.array[ index ]; + this.y = attribute.array[ index + 1 ]; + this.z = attribute.array[ index + 2 ]; + + return this; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author supereggbert / http://www.paulbrunt.co.uk/ + * @author philogb / http://blog.thejit.org/ + * @author jordi_ros / http://plattsoft.com + * @author D1plo1d / http://github.com/D1plo1d + * @author alteredq / http://alteredqualia.com/ + * @author mikael emtinger / http://gomo.se/ + * @author timknip / http://www.floorplanner.com/ + * @author bhouston / http://clara.io + * @author WestLangley / http://github.com/WestLangley + */ + + function Matrix4() { + + this.elements = new Float32Array( [ + + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + + ] ); + + if ( arguments.length > 0 ) { + + console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); + + } + + } + + Matrix4.prototype = { + + constructor: Matrix4, + + isMatrix4: true, + + set: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { + + var te = this.elements; + + te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; + te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; + te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; + te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; + + return this; + + }, + + identity: function () { + + this.set( + + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + + ); + + return this; + + }, + + clone: function () { + + return new Matrix4().fromArray( this.elements ); + + }, + + copy: function ( m ) { + + this.elements.set( m.elements ); + + return this; + + }, + + copyPosition: function ( m ) { + + var te = this.elements; + var me = m.elements; + + te[ 12 ] = me[ 12 ]; + te[ 13 ] = me[ 13 ]; + te[ 14 ] = me[ 14 ]; + + return this; + + }, + + extractBasis: function ( xAxis, yAxis, zAxis ) { + + xAxis.setFromMatrixColumn( this, 0 ); + yAxis.setFromMatrixColumn( this, 1 ); + zAxis.setFromMatrixColumn( this, 2 ); + + return this; + + }, + + makeBasis: function ( xAxis, yAxis, zAxis ) { + + this.set( + xAxis.x, yAxis.x, zAxis.x, 0, + xAxis.y, yAxis.y, zAxis.y, 0, + xAxis.z, yAxis.z, zAxis.z, 0, + 0, 0, 0, 1 + ); + + return this; + + }, + + extractRotation: function () { + + var v1; + + return function extractRotation( m ) { + + if ( v1 === undefined ) v1 = new Vector3(); + + var te = this.elements; + var me = m.elements; + + var scaleX = 1 / v1.setFromMatrixColumn( m, 0 ).length(); + var scaleY = 1 / v1.setFromMatrixColumn( m, 1 ).length(); + var scaleZ = 1 / v1.setFromMatrixColumn( m, 2 ).length(); + + te[ 0 ] = me[ 0 ] * scaleX; + te[ 1 ] = me[ 1 ] * scaleX; + te[ 2 ] = me[ 2 ] * scaleX; + + te[ 4 ] = me[ 4 ] * scaleY; + te[ 5 ] = me[ 5 ] * scaleY; + te[ 6 ] = me[ 6 ] * scaleY; + + te[ 8 ] = me[ 8 ] * scaleZ; + te[ 9 ] = me[ 9 ] * scaleZ; + te[ 10 ] = me[ 10 ] * scaleZ; + + return this; + + }; + + }(), + + makeRotationFromEuler: function ( euler ) { + + if ( (euler && euler.isEuler) === false ) { + + console.error( 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); + + } + + var te = this.elements; + + var x = euler.x, y = euler.y, z = euler.z; + var a = Math.cos( x ), b = Math.sin( x ); + var c = Math.cos( y ), d = Math.sin( y ); + var e = Math.cos( z ), f = Math.sin( z ); + + if ( euler.order === 'XYZ' ) { + + var ae = a * e, af = a * f, be = b * e, bf = b * f; + + te[ 0 ] = c * e; + te[ 4 ] = - c * f; + te[ 8 ] = d; + + te[ 1 ] = af + be * d; + te[ 5 ] = ae - bf * d; + te[ 9 ] = - b * c; + + te[ 2 ] = bf - ae * d; + te[ 6 ] = be + af * d; + te[ 10 ] = a * c; + + } else if ( euler.order === 'YXZ' ) { + + var ce = c * e, cf = c * f, de = d * e, df = d * f; + + te[ 0 ] = ce + df * b; + te[ 4 ] = de * b - cf; + te[ 8 ] = a * d; + + te[ 1 ] = a * f; + te[ 5 ] = a * e; + te[ 9 ] = - b; + + te[ 2 ] = cf * b - de; + te[ 6 ] = df + ce * b; + te[ 10 ] = a * c; + + } else if ( euler.order === 'ZXY' ) { + + var ce = c * e, cf = c * f, de = d * e, df = d * f; + + te[ 0 ] = ce - df * b; + te[ 4 ] = - a * f; + te[ 8 ] = de + cf * b; + + te[ 1 ] = cf + de * b; + te[ 5 ] = a * e; + te[ 9 ] = df - ce * b; + + te[ 2 ] = - a * d; + te[ 6 ] = b; + te[ 10 ] = a * c; + + } else if ( euler.order === 'ZYX' ) { + + var ae = a * e, af = a * f, be = b * e, bf = b * f; + + te[ 0 ] = c * e; + te[ 4 ] = be * d - af; + te[ 8 ] = ae * d + bf; + + te[ 1 ] = c * f; + te[ 5 ] = bf * d + ae; + te[ 9 ] = af * d - be; + + te[ 2 ] = - d; + te[ 6 ] = b * c; + te[ 10 ] = a * c; + + } else if ( euler.order === 'YZX' ) { + + var ac = a * c, ad = a * d, bc = b * c, bd = b * d; + + te[ 0 ] = c * e; + te[ 4 ] = bd - ac * f; + te[ 8 ] = bc * f + ad; + + te[ 1 ] = f; + te[ 5 ] = a * e; + te[ 9 ] = - b * e; + + te[ 2 ] = - d * e; + te[ 6 ] = ad * f + bc; + te[ 10 ] = ac - bd * f; + + } else if ( euler.order === 'XZY' ) { + + var ac = a * c, ad = a * d, bc = b * c, bd = b * d; + + te[ 0 ] = c * e; + te[ 4 ] = - f; + te[ 8 ] = d * e; + + te[ 1 ] = ac * f + bd; + te[ 5 ] = a * e; + te[ 9 ] = ad * f - bc; + + te[ 2 ] = bc * f - ad; + te[ 6 ] = b * e; + te[ 10 ] = bd * f + ac; + + } + + // last column + te[ 3 ] = 0; + te[ 7 ] = 0; + te[ 11 ] = 0; + + // bottom row + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; + + return this; + + }, + + makeRotationFromQuaternion: function ( q ) { + + var te = this.elements; + + var x = q.x, y = q.y, z = q.z, w = q.w; + var x2 = x + x, y2 = y + y, z2 = z + z; + var xx = x * x2, xy = x * y2, xz = x * z2; + var yy = y * y2, yz = y * z2, zz = z * z2; + var wx = w * x2, wy = w * y2, wz = w * z2; + + te[ 0 ] = 1 - ( yy + zz ); + te[ 4 ] = xy - wz; + te[ 8 ] = xz + wy; + + te[ 1 ] = xy + wz; + te[ 5 ] = 1 - ( xx + zz ); + te[ 9 ] = yz - wx; + + te[ 2 ] = xz - wy; + te[ 6 ] = yz + wx; + te[ 10 ] = 1 - ( xx + yy ); + + // last column + te[ 3 ] = 0; + te[ 7 ] = 0; + te[ 11 ] = 0; + + // bottom row + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; + + return this; + + }, + + lookAt: function () { + + var x, y, z; + + return function lookAt( eye, target, up ) { + + if ( x === undefined ) { + + x = new Vector3(); + y = new Vector3(); + z = new Vector3(); + + } + + var te = this.elements; + + z.subVectors( eye, target ).normalize(); + + if ( z.lengthSq() === 0 ) { + + z.z = 1; + + } + + x.crossVectors( up, z ).normalize(); + + if ( x.lengthSq() === 0 ) { + + z.z += 0.0001; + x.crossVectors( up, z ).normalize(); + + } + + y.crossVectors( z, x ); + + + te[ 0 ] = x.x; te[ 4 ] = y.x; te[ 8 ] = z.x; + te[ 1 ] = x.y; te[ 5 ] = y.y; te[ 9 ] = z.y; + te[ 2 ] = x.z; te[ 6 ] = y.z; te[ 10 ] = z.z; + + return this; + + }; + + }(), + + multiply: function ( m, n ) { + + if ( n !== undefined ) { + + console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); + return this.multiplyMatrices( m, n ); + + } + + return this.multiplyMatrices( this, m ); + + }, + + premultiply: function ( m ) { + + return this.multiplyMatrices( m, this ); + + }, + + multiplyMatrices: function ( a, b ) { + + var ae = a.elements; + var be = b.elements; + var te = this.elements; + + var a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; + var a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; + var a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; + var a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; + + var b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; + var b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; + var b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; + var b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; + + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + + te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + + return this; + + }, + + multiplyToArray: function ( a, b, r ) { + + var te = this.elements; + + this.multiplyMatrices( a, b ); + + r[ 0 ] = te[ 0 ]; r[ 1 ] = te[ 1 ]; r[ 2 ] = te[ 2 ]; r[ 3 ] = te[ 3 ]; + r[ 4 ] = te[ 4 ]; r[ 5 ] = te[ 5 ]; r[ 6 ] = te[ 6 ]; r[ 7 ] = te[ 7 ]; + r[ 8 ] = te[ 8 ]; r[ 9 ] = te[ 9 ]; r[ 10 ] = te[ 10 ]; r[ 11 ] = te[ 11 ]; + r[ 12 ] = te[ 12 ]; r[ 13 ] = te[ 13 ]; r[ 14 ] = te[ 14 ]; r[ 15 ] = te[ 15 ]; + + return this; + + }, + + multiplyScalar: function ( s ) { + + var te = this.elements; + + te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; + te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; + te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; + te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; + + return this; + + }, + + applyToVector3Array: function () { + + var v1; + + return function applyToVector3Array( array, offset, length ) { + + if ( v1 === undefined ) v1 = new Vector3(); + if ( offset === undefined ) offset = 0; + if ( length === undefined ) length = array.length; + + for ( var i = 0, j = offset; i < length; i += 3, j += 3 ) { + + v1.fromArray( array, j ); + v1.applyMatrix4( this ); + v1.toArray( array, j ); + + } + + return array; + + }; + + }(), + + applyToBuffer: function () { + + var v1; + + return function applyToBuffer( buffer, offset, length ) { + + if ( v1 === undefined ) v1 = new Vector3(); + if ( offset === undefined ) offset = 0; + if ( length === undefined ) length = buffer.length / buffer.itemSize; + + for ( var i = 0, j = offset; i < length; i ++, j ++ ) { + + v1.x = buffer.getX( j ); + v1.y = buffer.getY( j ); + v1.z = buffer.getZ( j ); + + v1.applyMatrix4( this ); + + buffer.setXYZ( j, v1.x, v1.y, v1.z ); + + } + + return buffer; + + }; + + }(), + + determinant: function () { + + var te = this.elements; + + var n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; + var n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; + var n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; + var n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; + + //TODO: make this more efficient + //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) + + return ( + n41 * ( + + n14 * n23 * n32 + - n13 * n24 * n32 + - n14 * n22 * n33 + + n12 * n24 * n33 + + n13 * n22 * n34 + - n12 * n23 * n34 + ) + + n42 * ( + + n11 * n23 * n34 + - n11 * n24 * n33 + + n14 * n21 * n33 + - n13 * n21 * n34 + + n13 * n24 * n31 + - n14 * n23 * n31 + ) + + n43 * ( + + n11 * n24 * n32 + - n11 * n22 * n34 + - n14 * n21 * n32 + + n12 * n21 * n34 + + n14 * n22 * n31 + - n12 * n24 * n31 + ) + + n44 * ( + - n13 * n22 * n31 + - n11 * n23 * n32 + + n11 * n22 * n33 + + n13 * n21 * n32 + - n12 * n21 * n33 + + n12 * n23 * n31 + ) + + ); + + }, + + transpose: function () { + + var te = this.elements; + var tmp; + + tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; + tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; + tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; + + tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; + tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; + tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; + + return this; + + }, + + flattenToArrayOffset: function ( array, offset ) { + + console.warn( "THREE.Matrix3: .flattenToArrayOffset is deprecated " + + "- just use .toArray instead." ); + + return this.toArray( array, offset ); + + }, + + getPosition: function () { + + var v1; + + return function getPosition() { + + if ( v1 === undefined ) v1 = new Vector3(); + console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); + + return v1.setFromMatrixColumn( this, 3 ); + + }; + + }(), + + setPosition: function ( v ) { + + var te = this.elements; + + te[ 12 ] = v.x; + te[ 13 ] = v.y; + te[ 14 ] = v.z; + + return this; + + }, + + getInverse: function ( m, throwOnDegenerate ) { + + // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm + var te = this.elements, + me = m.elements, + + n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ], + n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ], + n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ], + n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ], + + t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, + t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, + t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, + t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + + var det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; + + if ( det === 0 ) { + + var msg = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"; + + if ( throwOnDegenerate === true ) { + + throw new Error( msg ); + + } else { + + console.warn( msg ); + + } + + return this.identity(); + + } + + var detInv = 1 / det; + + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; + te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; + te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; + + te[ 4 ] = t12 * detInv; + te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; + te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; + te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; + + te[ 8 ] = t13 * detInv; + te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; + te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; + te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; + + te[ 12 ] = t14 * detInv; + te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; + te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; + te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; + + return this; + + }, + + scale: function ( v ) { + + var te = this.elements; + var x = v.x, y = v.y, z = v.z; + + te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; + te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; + te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; + te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; + + return this; + + }, + + getMaxScaleOnAxis: function () { + + var te = this.elements; + + var scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; + var scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; + var scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; + + return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); + + }, + + makeTranslation: function ( x, y, z ) { + + this.set( + + 1, 0, 0, x, + 0, 1, 0, y, + 0, 0, 1, z, + 0, 0, 0, 1 + + ); + + return this; + + }, + + makeRotationX: function ( theta ) { + + var c = Math.cos( theta ), s = Math.sin( theta ); + + this.set( + + 1, 0, 0, 0, + 0, c, - s, 0, + 0, s, c, 0, + 0, 0, 0, 1 + + ); + + return this; + + }, + + makeRotationY: function ( theta ) { + + var c = Math.cos( theta ), s = Math.sin( theta ); + + this.set( + + c, 0, s, 0, + 0, 1, 0, 0, + - s, 0, c, 0, + 0, 0, 0, 1 + + ); + + return this; + + }, + + makeRotationZ: function ( theta ) { + + var c = Math.cos( theta ), s = Math.sin( theta ); + + this.set( + + c, - s, 0, 0, + s, c, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + + ); + + return this; + + }, + + makeRotationAxis: function ( axis, angle ) { + + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos( angle ); + var s = Math.sin( angle ); + var t = 1 - c; + var x = axis.x, y = axis.y, z = axis.z; + var tx = t * x, ty = t * y; + + this.set( + + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + + ); + + return this; + + }, + + makeScale: function ( x, y, z ) { + + this.set( + + x, 0, 0, 0, + 0, y, 0, 0, + 0, 0, z, 0, + 0, 0, 0, 1 + + ); + + return this; + + }, + + compose: function ( position, quaternion, scale ) { + + this.makeRotationFromQuaternion( quaternion ); + this.scale( scale ); + this.setPosition( position ); + + return this; + + }, + + decompose: function () { + + var vector, matrix; + + return function decompose( position, quaternion, scale ) { + + if ( vector === undefined ) { + + vector = new Vector3(); + matrix = new Matrix4(); + + } + + var te = this.elements; + + var sx = vector.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); + var sy = vector.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); + var sz = vector.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); + + // if determine is negative, we need to invert one scale + var det = this.determinant(); + if ( det < 0 ) { + + sx = - sx; + + } + + position.x = te[ 12 ]; + position.y = te[ 13 ]; + position.z = te[ 14 ]; + + // scale the rotation part + + matrix.elements.set( this.elements ); // at this point matrix is incomplete so we can't use .copy() + + var invSX = 1 / sx; + var invSY = 1 / sy; + var invSZ = 1 / sz; + + matrix.elements[ 0 ] *= invSX; + matrix.elements[ 1 ] *= invSX; + matrix.elements[ 2 ] *= invSX; + + matrix.elements[ 4 ] *= invSY; + matrix.elements[ 5 ] *= invSY; + matrix.elements[ 6 ] *= invSY; + + matrix.elements[ 8 ] *= invSZ; + matrix.elements[ 9 ] *= invSZ; + matrix.elements[ 10 ] *= invSZ; + + quaternion.setFromRotationMatrix( matrix ); + + scale.x = sx; + scale.y = sy; + scale.z = sz; + + return this; + + }; + + }(), + + makeFrustum: function ( left, right, bottom, top, near, far ) { + + var te = this.elements; + var x = 2 * near / ( right - left ); + var y = 2 * near / ( top - bottom ); + + var a = ( right + left ) / ( right - left ); + var b = ( top + bottom ) / ( top - bottom ); + var c = - ( far + near ) / ( far - near ); + var d = - 2 * far * near / ( far - near ); + + te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; + te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; + + return this; + + }, + + makePerspective: function ( fov, aspect, near, far ) { + + var ymax = near * Math.tan( _Math.DEG2RAD * fov * 0.5 ); + var ymin = - ymax; + var xmin = ymin * aspect; + var xmax = ymax * aspect; + + return this.makeFrustum( xmin, xmax, ymin, ymax, near, far ); + + }, + + makeOrthographic: function ( left, right, top, bottom, near, far ) { + + var te = this.elements; + var w = 1.0 / ( right - left ); + var h = 1.0 / ( top - bottom ); + var p = 1.0 / ( far - near ); + + var x = ( right + left ) * w; + var y = ( top + bottom ) * h; + var z = ( far + near ) * p; + + te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; + te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; + + return this; + + }, + + equals: function ( matrix ) { + + var te = this.elements; + var me = matrix.elements; + + for ( var i = 0; i < 16; i ++ ) { + + if ( te[ i ] !== me[ i ] ) return false; + + } + + return true; + + }, + + fromArray: function ( array, offset ) { + + if ( offset === undefined ) offset = 0; + + for( var i = 0; i < 16; i ++ ) { + + this.elements[ i ] = array[ i + offset ]; + + } + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + var te = this.elements; + + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; + array[ offset + 3 ] = te[ 3 ]; + + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; + + array[ offset + 8 ] = te[ 8 ]; + array[ offset + 9 ] = te[ 9 ]; + array[ offset + 10 ] = te[ 10 ]; + array[ offset + 11 ] = te[ 11 ]; + + array[ offset + 12 ] = te[ 12 ]; + array[ offset + 13 ] = te[ 13 ]; + array[ offset + 14 ] = te[ 14 ]; + array[ offset + 15 ] = te[ 15 ]; + + return array; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) { + + images = images !== undefined ? images : []; + mapping = mapping !== undefined ? mapping : CubeReflectionMapping; + + Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + + this.flipY = false; + + } + + CubeTexture.prototype = Object.create( Texture.prototype ); + CubeTexture.prototype.constructor = CubeTexture; + + CubeTexture.prototype.isCubeTexture = true; + + Object.defineProperty( CubeTexture.prototype, 'images', { + + get: function () { + + return this.image; + + }, + + set: function ( value ) { + + this.image = value; + + } + + } ); + + /** + * @author tschw + * + * Uniforms of a program. + * Those form a tree structure with a special top-level container for the root, + * which you get by calling 'new WebGLUniforms( gl, program, renderer )'. + * + * + * Properties of inner nodes including the top-level container: + * + * .seq - array of nested uniforms + * .map - nested uniforms by name + * + * + * Methods of all nodes except the top-level container: + * + * .setValue( gl, value, [renderer] ) + * + * uploads a uniform value(s) + * the 'renderer' parameter is needed for sampler uniforms + * + * + * Static methods of the top-level container (renderer factorizations): + * + * .upload( gl, seq, values, renderer ) + * + * sets uniforms in 'seq' to 'values[id].value' + * + * .seqWithValue( seq, values ) : filteredSeq + * + * filters 'seq' entries with corresponding entry in values + * + * + * Methods of the top-level container (renderer factorizations): + * + * .setValue( gl, name, value ) + * + * sets uniform with name 'name' to 'value' + * + * .set( gl, obj, prop ) + * + * sets uniform from object and property with same name than uniform + * + * .setOptional( gl, obj, prop ) + * + * like .set for an optional property of the object + * + */ + + var emptyTexture = new Texture(); + var emptyCubeTexture = new CubeTexture(); + + // --- Base for inner nodes (including the root) --- + + function UniformContainer() { + + this.seq = []; + this.map = {}; + + } + + // --- Utilities --- + + // Array Caches (provide typed arrays for temporary by size) + + var arrayCacheF32 = []; + var arrayCacheI32 = []; + + // Flattening for arrays of vectors and matrices + + function flatten( array, nBlocks, blockSize ) { + + var firstElem = array[ 0 ]; + + if ( firstElem <= 0 || firstElem > 0 ) return array; + // unoptimized: ! isNaN( firstElem ) + // see http://jacksondunstan.com/articles/983 + + var n = nBlocks * blockSize, + r = arrayCacheF32[ n ]; + + if ( r === undefined ) { + + r = new Float32Array( n ); + arrayCacheF32[ n ] = r; + + } + + if ( nBlocks !== 0 ) { + + firstElem.toArray( r, 0 ); + + for ( var i = 1, offset = 0; i !== nBlocks; ++ i ) { + + offset += blockSize; + array[ i ].toArray( r, offset ); + + } + + } + + return r; + + } + + // Texture unit allocation + + function allocTexUnits( renderer, n ) { + + var r = arrayCacheI32[ n ]; + + if ( r === undefined ) { + + r = new Int32Array( n ); + arrayCacheI32[ n ] = r; + + } + + for ( var i = 0; i !== n; ++ i ) + r[ i ] = renderer.allocTextureUnit(); + + return r; + + } + + // --- Setters --- + + // Note: Defining these methods externally, because they come in a bunch + // and this way their names minify. + + // Single scalar + + function setValue1f( gl, v ) { gl.uniform1f( this.addr, v ); } + function setValue1i( gl, v ) { gl.uniform1i( this.addr, v ); } + + // Single float vector (from flat array or THREE.VectorN) + + function setValue2fv( gl, v ) { + + if ( v.x === undefined ) gl.uniform2fv( this.addr, v ); + else gl.uniform2f( this.addr, v.x, v.y ); + + } + + function setValue3fv( gl, v ) { + + if ( v.x !== undefined ) + gl.uniform3f( this.addr, v.x, v.y, v.z ); + else if ( v.r !== undefined ) + gl.uniform3f( this.addr, v.r, v.g, v.b ); + else + gl.uniform3fv( this.addr, v ); + + } + + function setValue4fv( gl, v ) { + + if ( v.x === undefined ) gl.uniform4fv( this.addr, v ); + else gl.uniform4f( this.addr, v.x, v.y, v.z, v.w ); + + } + + // Single matrix (from flat array or MatrixN) + + function setValue2fm( gl, v ) { + + gl.uniformMatrix2fv( this.addr, false, v.elements || v ); + + } + + function setValue3fm( gl, v ) { + + gl.uniformMatrix3fv( this.addr, false, v.elements || v ); + + } + + function setValue4fm( gl, v ) { + + gl.uniformMatrix4fv( this.addr, false, v.elements || v ); + + } + + // Single texture (2D / Cube) + + function setValueT1( gl, v, renderer ) { + + var unit = renderer.allocTextureUnit(); + gl.uniform1i( this.addr, unit ); + renderer.setTexture2D( v || emptyTexture, unit ); + + } + + function setValueT6( gl, v, renderer ) { + + var unit = renderer.allocTextureUnit(); + gl.uniform1i( this.addr, unit ); + renderer.setTextureCube( v || emptyCubeTexture, unit ); + + } + + // Integer / Boolean vectors or arrays thereof (always flat arrays) + + function setValue2iv( gl, v ) { gl.uniform2iv( this.addr, v ); } + function setValue3iv( gl, v ) { gl.uniform3iv( this.addr, v ); } + function setValue4iv( gl, v ) { gl.uniform4iv( this.addr, v ); } + + // Helper to pick the right setter for the singular case + + function getSingularSetter( type ) { + + switch ( type ) { + + case 0x1406: return setValue1f; // FLOAT + case 0x8b50: return setValue2fv; // _VEC2 + case 0x8b51: return setValue3fv; // _VEC3 + case 0x8b52: return setValue4fv; // _VEC4 + + case 0x8b5a: return setValue2fm; // _MAT2 + case 0x8b5b: return setValue3fm; // _MAT3 + case 0x8b5c: return setValue4fm; // _MAT4 + + case 0x8b5e: return setValueT1; // SAMPLER_2D + case 0x8b60: return setValueT6; // SAMPLER_CUBE + + case 0x1404: case 0x8b56: return setValue1i; // INT, BOOL + case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2 + case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3 + case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4 + + } + + } + + // Array of scalars + + function setValue1fv( gl, v ) { gl.uniform1fv( this.addr, v ); } + function setValue1iv( gl, v ) { gl.uniform1iv( this.addr, v ); } + + // Array of vectors (flat or from THREE classes) + + function setValueV2a( gl, v ) { + + gl.uniform2fv( this.addr, flatten( v, this.size, 2 ) ); + + } + + function setValueV3a( gl, v ) { + + gl.uniform3fv( this.addr, flatten( v, this.size, 3 ) ); + + } + + function setValueV4a( gl, v ) { + + gl.uniform4fv( this.addr, flatten( v, this.size, 4 ) ); + + } + + // Array of matrices (flat or from THREE clases) + + function setValueM2a( gl, v ) { + + gl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) ); + + } + + function setValueM3a( gl, v ) { + + gl.uniformMatrix3fv( this.addr, false, flatten( v, this.size, 9 ) ); + + } + + function setValueM4a( gl, v ) { + + gl.uniformMatrix4fv( this.addr, false, flatten( v, this.size, 16 ) ); + + } + + // Array of textures (2D / Cube) + + function setValueT1a( gl, v, renderer ) { + + var n = v.length, + units = allocTexUnits( renderer, n ); + + gl.uniform1iv( this.addr, units ); + + for ( var i = 0; i !== n; ++ i ) { + + renderer.setTexture2D( v[ i ] || emptyTexture, units[ i ] ); + + } + + } + + function setValueT6a( gl, v, renderer ) { + + var n = v.length, + units = allocTexUnits( renderer, n ); + + gl.uniform1iv( this.addr, units ); + + for ( var i = 0; i !== n; ++ i ) { + + renderer.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] ); + + } + + } + + // Helper to pick the right setter for a pure (bottom-level) array + + function getPureArraySetter( type ) { + + switch ( type ) { + + case 0x1406: return setValue1fv; // FLOAT + case 0x8b50: return setValueV2a; // _VEC2 + case 0x8b51: return setValueV3a; // _VEC3 + case 0x8b52: return setValueV4a; // _VEC4 + + case 0x8b5a: return setValueM2a; // _MAT2 + case 0x8b5b: return setValueM3a; // _MAT3 + case 0x8b5c: return setValueM4a; // _MAT4 + + case 0x8b5e: return setValueT1a; // SAMPLER_2D + case 0x8b60: return setValueT6a; // SAMPLER_CUBE + + case 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL + case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2 + case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3 + case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4 + + } + + } + + // --- Uniform Classes --- + + function SingleUniform( id, activeInfo, addr ) { + + this.id = id; + this.addr = addr; + this.setValue = getSingularSetter( activeInfo.type ); + + // this.path = activeInfo.name; // DEBUG + + } + + function PureArrayUniform( id, activeInfo, addr ) { + + this.id = id; + this.addr = addr; + this.size = activeInfo.size; + this.setValue = getPureArraySetter( activeInfo.type ); + + // this.path = activeInfo.name; // DEBUG + + } + + function StructuredUniform( id ) { + + this.id = id; + + UniformContainer.call( this ); // mix-in + + } + + StructuredUniform.prototype.setValue = function( gl, value ) { + + // Note: Don't need an extra 'renderer' parameter, since samplers + // are not allowed in structured uniforms. + + var seq = this.seq; + + for ( var i = 0, n = seq.length; i !== n; ++ i ) { + + var u = seq[ i ]; + u.setValue( gl, value[ u.id ] ); + + } + + }; + + // --- Top-level --- + + // Parser - builds up the property tree from the path strings + + var RePathPart = /([\w\d_]+)(\])?(\[|\.)?/g; + + // extracts + // - the identifier (member name or array index) + // - followed by an optional right bracket (found when array index) + // - followed by an optional left bracket or dot (type of subscript) + // + // Note: These portions can be read in a non-overlapping fashion and + // allow straightforward parsing of the hierarchy that WebGL encodes + // in the uniform names. + + function addUniform( container, uniformObject ) { + + container.seq.push( uniformObject ); + container.map[ uniformObject.id ] = uniformObject; + + } + + function parseUniform( activeInfo, addr, container ) { + + var path = activeInfo.name, + pathLength = path.length; + + // reset RegExp object, because of the early exit of a previous run + RePathPart.lastIndex = 0; + + for (; ;) { + + var match = RePathPart.exec( path ), + matchEnd = RePathPart.lastIndex, + + id = match[ 1 ], + idIsIndex = match[ 2 ] === ']', + subscript = match[ 3 ]; + + if ( idIsIndex ) id = id | 0; // convert to integer + + if ( subscript === undefined || + subscript === '[' && matchEnd + 2 === pathLength ) { + // bare name or "pure" bottom-level array "[0]" suffix + + addUniform( container, subscript === undefined ? + new SingleUniform( id, activeInfo, addr ) : + new PureArrayUniform( id, activeInfo, addr ) ); + + break; + + } else { + // step into inner node / create it in case it doesn't exist + + var map = container.map, + next = map[ id ]; + + if ( next === undefined ) { + + next = new StructuredUniform( id ); + addUniform( container, next ); + + } + + container = next; + + } + + } + + } + + // Root Container + + function WebGLUniforms( gl, program, renderer ) { + + UniformContainer.call( this ); + + this.renderer = renderer; + + var n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS ); + + for ( var i = 0; i !== n; ++ i ) { + + var info = gl.getActiveUniform( program, i ), + path = info.name, + addr = gl.getUniformLocation( program, path ); + + parseUniform( info, addr, this ); + + } + + } + + WebGLUniforms.prototype.setValue = function( gl, name, value ) { + + var u = this.map[ name ]; + + if ( u !== undefined ) u.setValue( gl, value, this.renderer ); + + }; + + WebGLUniforms.prototype.set = function( gl, object, name ) { + + var u = this.map[ name ]; + + if ( u !== undefined ) u.setValue( gl, object[ name ], this.renderer ); + + }; + + WebGLUniforms.prototype.setOptional = function( gl, object, name ) { + + var v = object[ name ]; + + if ( v !== undefined ) this.setValue( gl, name, v ); + + }; + + + // Static interface + + WebGLUniforms.upload = function( gl, seq, values, renderer ) { + + for ( var i = 0, n = seq.length; i !== n; ++ i ) { + + var u = seq[ i ], + v = values[ u.id ]; + + if ( v.needsUpdate !== false ) { + // note: always updating when .needsUpdate is undefined + + u.setValue( gl, v.value, renderer ); + + } + + } + + }; + + WebGLUniforms.seqWithValue = function( seq, values ) { + + var r = []; + + for ( var i = 0, n = seq.length; i !== n; ++ i ) { + + var u = seq[ i ]; + if ( u.id in values ) r.push( u ); + + } + + return r; + + }; + + /** + * Uniform Utilities + */ + + var UniformsUtils = { + + merge: function ( uniforms ) { + + var merged = {}; + + for ( var u = 0; u < uniforms.length; u ++ ) { + + var tmp = this.clone( uniforms[ u ] ); + + for ( var p in tmp ) { + + merged[ p ] = tmp[ p ]; + + } + + } + + return merged; + + }, + + clone: function ( uniforms_src ) { + + var uniforms_dst = {}; + + for ( var u in uniforms_src ) { + + uniforms_dst[ u ] = {}; + + for ( var p in uniforms_src[ u ] ) { + + var parameter_src = uniforms_src[ u ][ p ]; + + if ( parameter_src && ( parameter_src.isColor || + parameter_src.isMatrix3 || parameter_src.isMatrix4 || + parameter_src.isVector2 || parameter_src.isVector3 || parameter_src.isVector4 || + parameter_src.isTexture ) ) { + + uniforms_dst[ u ][ p ] = parameter_src.clone(); + + } else if ( Array.isArray( parameter_src ) ) { + + uniforms_dst[ u ][ p ] = parameter_src.slice(); + + } else { + + uniforms_dst[ u ][ p ] = parameter_src; + + } + + } + + } + + return uniforms_dst; + + } + + }; + + var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n"; + + var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n"; + + var alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n"; + + var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n"; + + var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif"; + + var begin_vertex = "\nvec3 transformed = vec3( position );\n"; + + var beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n"; + + var bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n"; + + var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n"; + + var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n"; + + var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n"; + + var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n"; + + var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n"; + + var color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif"; + + var color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n"; + + var color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif"; + + var color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif"; + + var common = "#define PI 3.14159265359\n#define PI2 6.28318530718\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n"; + + var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n"; + + var defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n"; + + var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n"; + + var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n"; + + var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n"; + + var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n"; + + var encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n"; + + var encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n"; + + var envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n"; + + var envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n"; + + var envmap_pars_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n"; + + var envmap_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n"; + + var fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n"; + + var fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif"; + + var lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n"; + + var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif"; + + var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n"; + + var lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#include \n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#include \n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n"; + + var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n"; + + var lights_phong_pars_fragment = "varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n"; + + var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n"; + + var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n"; + + var lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\t\t\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n"; + + var logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif"; + + var logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n"; + + var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif"; + + var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n"; + + var map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n"; + + var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n"; + + var map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n"; + + var map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n"; + + var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n"; + + var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif"; + + var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n"; + + var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif"; + + var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n"; + + var normal_flip = "#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n"; + + var normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n"; + + var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n"; + + var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n"; + + var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n"; + + var project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n"; + + var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n"; + + var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif"; + + var shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n"; + + var shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n"; + + var shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n"; + + var shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n"; + + var skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif"; + + var skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n"; + + var skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n"; + + var skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n"; + + var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif"; + + var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif"; + + var tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n"; + + var tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n"; + + var uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif"; + + var uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n"; + + var uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif"; + + var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif"; + + var uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif"; + + var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif"; + + var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n"; + + var cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n"; + + var cube_vert = "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n"; + + var depth_frag = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n"; + + var depth_vert = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include \n#include \n#include \nvoid main () {\n\t#include \n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n"; + + var distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition;\n}\n"; + + var equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n"; + + var equirect_vert = "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n"; + + var linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n}\n"; + + var meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include \n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var meshbasic_vert = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}\n"; + + var meshphysical_frag = "#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var meshphysical_vert = "#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n}\n"; + + var normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\n\t#include \n}\n"; + + var normal_vert = "varying vec3 vNormal;\n#include \n#include \n#include \n#include \nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var points_vert = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var shadow_frag = "uniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n"; + + var shadow_vert = "#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"; + + var ShaderChunk = { + alphamap_fragment: alphamap_fragment, + alphamap_pars_fragment: alphamap_pars_fragment, + alphatest_fragment: alphatest_fragment, + aomap_fragment: aomap_fragment, + aomap_pars_fragment: aomap_pars_fragment, + begin_vertex: begin_vertex, + beginnormal_vertex: beginnormal_vertex, + bsdfs: bsdfs, + bumpmap_pars_fragment: bumpmap_pars_fragment, + clipping_planes_fragment: clipping_planes_fragment, + clipping_planes_pars_fragment: clipping_planes_pars_fragment, + clipping_planes_pars_vertex: clipping_planes_pars_vertex, + clipping_planes_vertex: clipping_planes_vertex, + color_fragment: color_fragment, + color_pars_fragment: color_pars_fragment, + color_pars_vertex: color_pars_vertex, + color_vertex: color_vertex, + common: common, + cube_uv_reflection_fragment: cube_uv_reflection_fragment, + defaultnormal_vertex: defaultnormal_vertex, + displacementmap_pars_vertex: displacementmap_pars_vertex, + displacementmap_vertex: displacementmap_vertex, + emissivemap_fragment: emissivemap_fragment, + emissivemap_pars_fragment: emissivemap_pars_fragment, + encodings_fragment: encodings_fragment, + encodings_pars_fragment: encodings_pars_fragment, + envmap_fragment: envmap_fragment, + envmap_pars_fragment: envmap_pars_fragment, + envmap_pars_vertex: envmap_pars_vertex, + envmap_vertex: envmap_vertex, + fog_fragment: fog_fragment, + fog_pars_fragment: fog_pars_fragment, + lightmap_fragment: lightmap_fragment, + lightmap_pars_fragment: lightmap_pars_fragment, + lights_lambert_vertex: lights_lambert_vertex, + lights_pars: lights_pars, + lights_phong_fragment: lights_phong_fragment, + lights_phong_pars_fragment: lights_phong_pars_fragment, + lights_physical_fragment: lights_physical_fragment, + lights_physical_pars_fragment: lights_physical_pars_fragment, + lights_template: lights_template, + logdepthbuf_fragment: logdepthbuf_fragment, + logdepthbuf_pars_fragment: logdepthbuf_pars_fragment, + logdepthbuf_pars_vertex: logdepthbuf_pars_vertex, + logdepthbuf_vertex: logdepthbuf_vertex, + map_fragment: map_fragment, + map_pars_fragment: map_pars_fragment, + map_particle_fragment: map_particle_fragment, + map_particle_pars_fragment: map_particle_pars_fragment, + metalnessmap_fragment: metalnessmap_fragment, + metalnessmap_pars_fragment: metalnessmap_pars_fragment, + morphnormal_vertex: morphnormal_vertex, + morphtarget_pars_vertex: morphtarget_pars_vertex, + morphtarget_vertex: morphtarget_vertex, + normal_flip: normal_flip, + normal_fragment: normal_fragment, + normalmap_pars_fragment: normalmap_pars_fragment, + packing: packing, + premultiplied_alpha_fragment: premultiplied_alpha_fragment, + project_vertex: project_vertex, + roughnessmap_fragment: roughnessmap_fragment, + roughnessmap_pars_fragment: roughnessmap_pars_fragment, + shadowmap_pars_fragment: shadowmap_pars_fragment, + shadowmap_pars_vertex: shadowmap_pars_vertex, + shadowmap_vertex: shadowmap_vertex, + shadowmask_pars_fragment: shadowmask_pars_fragment, + skinbase_vertex: skinbase_vertex, + skinning_pars_vertex: skinning_pars_vertex, + skinning_vertex: skinning_vertex, + skinnormal_vertex: skinnormal_vertex, + specularmap_fragment: specularmap_fragment, + specularmap_pars_fragment: specularmap_pars_fragment, + tonemapping_fragment: tonemapping_fragment, + tonemapping_pars_fragment: tonemapping_pars_fragment, + uv_pars_fragment: uv_pars_fragment, + uv_pars_vertex: uv_pars_vertex, + uv_vertex: uv_vertex, + uv2_pars_fragment: uv2_pars_fragment, + uv2_pars_vertex: uv2_pars_vertex, + uv2_vertex: uv2_vertex, + worldpos_vertex: worldpos_vertex, + + cube_frag: cube_frag, + cube_vert: cube_vert, + depth_frag: depth_frag, + depth_vert: depth_vert, + distanceRGBA_frag: distanceRGBA_frag, + distanceRGBA_vert: distanceRGBA_vert, + equirect_frag: equirect_frag, + equirect_vert: equirect_vert, + linedashed_frag: linedashed_frag, + linedashed_vert: linedashed_vert, + meshbasic_frag: meshbasic_frag, + meshbasic_vert: meshbasic_vert, + meshlambert_frag: meshlambert_frag, + meshlambert_vert: meshlambert_vert, + meshphong_frag: meshphong_frag, + meshphong_vert: meshphong_vert, + meshphysical_frag: meshphysical_frag, + meshphysical_vert: meshphysical_vert, + normal_frag: normal_frag, + normal_vert: normal_vert, + points_frag: points_frag, + points_vert: points_vert, + shadow_frag: shadow_frag, + shadow_vert: shadow_vert + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function Color( r, g, b ) { + + if ( g === undefined && b === undefined ) { + + // r is THREE.Color, hex or string + return this.set( r ); + + } + + return this.setRGB( r, g, b ); + + } + + Color.prototype = { + + constructor: Color, + + isColor: true, + + r: 1, g: 1, b: 1, + + set: function ( value ) { + + if ( (value && value.isColor) ) { + + this.copy( value ); + + } else if ( typeof value === 'number' ) { + + this.setHex( value ); + + } else if ( typeof value === 'string' ) { + + this.setStyle( value ); + + } + + return this; + + }, + + setScalar: function ( scalar ) { + + this.r = scalar; + this.g = scalar; + this.b = scalar; + + return this; + + }, + + setHex: function ( hex ) { + + hex = Math.floor( hex ); + + this.r = ( hex >> 16 & 255 ) / 255; + this.g = ( hex >> 8 & 255 ) / 255; + this.b = ( hex & 255 ) / 255; + + return this; + + }, + + setRGB: function ( r, g, b ) { + + this.r = r; + this.g = g; + this.b = b; + + return this; + + }, + + setHSL: function () { + + function hue2rgb( p, q, t ) { + + if ( t < 0 ) t += 1; + if ( t > 1 ) t -= 1; + if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t; + if ( t < 1 / 2 ) return q; + if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t ); + return p; + + } + + return function setHSL( h, s, l ) { + + // h,s,l ranges are in 0.0 - 1.0 + h = _Math.euclideanModulo( h, 1 ); + s = _Math.clamp( s, 0, 1 ); + l = _Math.clamp( l, 0, 1 ); + + if ( s === 0 ) { + + this.r = this.g = this.b = l; + + } else { + + var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s ); + var q = ( 2 * l ) - p; + + this.r = hue2rgb( q, p, h + 1 / 3 ); + this.g = hue2rgb( q, p, h ); + this.b = hue2rgb( q, p, h - 1 / 3 ); + + } + + return this; + + }; + + }(), + + setStyle: function ( style ) { + + function handleAlpha( string ) { + + if ( string === undefined ) return; + + if ( parseFloat( string ) < 1 ) { + + console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' ); + + } + + } + + + var m; + + if ( m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec( style ) ) { + + // rgb / hsl + + var color; + var name = m[ 1 ]; + var components = m[ 2 ]; + + switch ( name ) { + + case 'rgb': + case 'rgba': + + if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + + // rgb(255,0,0) rgba(255,0,0,0.5) + this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255; + this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255; + this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255; + + handleAlpha( color[ 5 ] ); + + return this; + + } + + if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + + // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) + this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100; + this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100; + this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100; + + handleAlpha( color[ 5 ] ); + + return this; + + } + + break; + + case 'hsl': + case 'hsla': + + if ( color = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + + // hsl(120,50%,50%) hsla(120,50%,50%,0.5) + var h = parseFloat( color[ 1 ] ) / 360; + var s = parseInt( color[ 2 ], 10 ) / 100; + var l = parseInt( color[ 3 ], 10 ) / 100; + + handleAlpha( color[ 5 ] ); + + return this.setHSL( h, s, l ); + + } + + break; + + } + + } else if ( m = /^\#([A-Fa-f0-9]+)$/.exec( style ) ) { + + // hex color + + var hex = m[ 1 ]; + var size = hex.length; + + if ( size === 3 ) { + + // #ff0 + this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255; + this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255; + this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255; + + return this; + + } else if ( size === 6 ) { + + // #ff0000 + this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255; + this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255; + this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255; + + return this; + + } + + } + + if ( style && style.length > 0 ) { + + // color keywords + var hex = ColorKeywords[ style ]; + + if ( hex !== undefined ) { + + // red + this.setHex( hex ); + + } else { + + // unknown color + console.warn( 'THREE.Color: Unknown color ' + style ); + + } + + } + + return this; + + }, + + clone: function () { + + return new this.constructor( this.r, this.g, this.b ); + + }, + + copy: function ( color ) { + + this.r = color.r; + this.g = color.g; + this.b = color.b; + + return this; + + }, + + copyGammaToLinear: function ( color, gammaFactor ) { + + if ( gammaFactor === undefined ) gammaFactor = 2.0; + + this.r = Math.pow( color.r, gammaFactor ); + this.g = Math.pow( color.g, gammaFactor ); + this.b = Math.pow( color.b, gammaFactor ); + + return this; + + }, + + copyLinearToGamma: function ( color, gammaFactor ) { + + if ( gammaFactor === undefined ) gammaFactor = 2.0; + + var safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0; + + this.r = Math.pow( color.r, safeInverse ); + this.g = Math.pow( color.g, safeInverse ); + this.b = Math.pow( color.b, safeInverse ); + + return this; + + }, + + convertGammaToLinear: function () { + + var r = this.r, g = this.g, b = this.b; + + this.r = r * r; + this.g = g * g; + this.b = b * b; + + return this; + + }, + + convertLinearToGamma: function () { + + this.r = Math.sqrt( this.r ); + this.g = Math.sqrt( this.g ); + this.b = Math.sqrt( this.b ); + + return this; + + }, + + getHex: function () { + + return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0; + + }, + + getHexString: function () { + + return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 ); + + }, + + getHSL: function ( optionalTarget ) { + + // h,s,l ranges are in 0.0 - 1.0 + + var hsl = optionalTarget || { h: 0, s: 0, l: 0 }; + + var r = this.r, g = this.g, b = this.b; + + var max = Math.max( r, g, b ); + var min = Math.min( r, g, b ); + + var hue, saturation; + var lightness = ( min + max ) / 2.0; + + if ( min === max ) { + + hue = 0; + saturation = 0; + + } else { + + var delta = max - min; + + saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min ); + + switch ( max ) { + + case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break; + case g: hue = ( b - r ) / delta + 2; break; + case b: hue = ( r - g ) / delta + 4; break; + + } + + hue /= 6; + + } + + hsl.h = hue; + hsl.s = saturation; + hsl.l = lightness; + + return hsl; + + }, + + getStyle: function () { + + return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')'; + + }, + + offsetHSL: function ( h, s, l ) { + + var hsl = this.getHSL(); + + hsl.h += h; hsl.s += s; hsl.l += l; + + this.setHSL( hsl.h, hsl.s, hsl.l ); + + return this; + + }, + + add: function ( color ) { + + this.r += color.r; + this.g += color.g; + this.b += color.b; + + return this; + + }, + + addColors: function ( color1, color2 ) { + + this.r = color1.r + color2.r; + this.g = color1.g + color2.g; + this.b = color1.b + color2.b; + + return this; + + }, + + addScalar: function ( s ) { + + this.r += s; + this.g += s; + this.b += s; + + return this; + + }, + + sub: function( color ) { + + this.r = Math.max( 0, this.r - color.r ); + this.g = Math.max( 0, this.g - color.g ); + this.b = Math.max( 0, this.b - color.b ); + + return this; + + }, + + multiply: function ( color ) { + + this.r *= color.r; + this.g *= color.g; + this.b *= color.b; + + return this; + + }, + + multiplyScalar: function ( s ) { + + this.r *= s; + this.g *= s; + this.b *= s; + + return this; + + }, + + lerp: function ( color, alpha ) { + + this.r += ( color.r - this.r ) * alpha; + this.g += ( color.g - this.g ) * alpha; + this.b += ( color.b - this.b ) * alpha; + + return this; + + }, + + equals: function ( c ) { + + return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); + + }, + + fromArray: function ( array, offset ) { + + if ( offset === undefined ) offset = 0; + + this.r = array[ offset ]; + this.g = array[ offset + 1 ]; + this.b = array[ offset + 2 ]; + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this.r; + array[ offset + 1 ] = this.g; + array[ offset + 2 ] = this.b; + + return array; + + }, + + toJSON: function () { + + return this.getHex(); + + } + + }; + + var ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF, + 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2, + 'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50, + 'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B, + 'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B, + 'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F, + 'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3, + 'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222, + 'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700, + 'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4, + 'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00, + 'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3, + 'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA, + 'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32, + 'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3, + 'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC, + 'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD, + 'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6, + 'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9, + 'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F, + 'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE, + 'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA, + 'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0, + 'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 }; + + /** + * Uniforms library for shared webgl shaders + */ + + var UniformsLib = { + + common: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + + map: { value: null }, + offsetRepeat: { value: new Vector4( 0, 0, 1, 1 ) }, + + specularMap: { value: null }, + alphaMap: { value: null }, + + envMap: { value: null }, + flipEnvMap: { value: - 1 }, + reflectivity: { value: 1.0 }, + refractionRatio: { value: 0.98 } + + }, + + aomap: { + + aoMap: { value: null }, + aoMapIntensity: { value: 1 } + + }, + + lightmap: { + + lightMap: { value: null }, + lightMapIntensity: { value: 1 } + + }, + + emissivemap: { + + emissiveMap: { value: null } + + }, + + bumpmap: { + + bumpMap: { value: null }, + bumpScale: { value: 1 } + + }, + + normalmap: { + + normalMap: { value: null }, + normalScale: { value: new Vector2( 1, 1 ) } + + }, + + displacementmap: { + + displacementMap: { value: null }, + displacementScale: { value: 1 }, + displacementBias: { value: 0 } + + }, + + roughnessmap: { + + roughnessMap: { value: null } + + }, + + metalnessmap: { + + metalnessMap: { value: null } + + }, + + fog: { + + fogDensity: { value: 0.00025 }, + fogNear: { value: 1 }, + fogFar: { value: 2000 }, + fogColor: { value: new Color( 0xffffff ) } + + }, + + lights: { + + ambientLightColor: { value: [] }, + + directionalLights: { value: [], properties: { + direction: {}, + color: {}, + + shadow: {}, + shadowBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + directionalShadowMap: { value: [] }, + directionalShadowMatrix: { value: [] }, + + spotLights: { value: [], properties: { + color: {}, + position: {}, + direction: {}, + distance: {}, + coneCos: {}, + penumbraCos: {}, + decay: {}, + + shadow: {}, + shadowBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + spotShadowMap: { value: [] }, + spotShadowMatrix: { value: [] }, + + pointLights: { value: [], properties: { + color: {}, + position: {}, + decay: {}, + distance: {}, + + shadow: {}, + shadowBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + pointShadowMap: { value: [] }, + pointShadowMatrix: { value: [] }, + + hemisphereLights: { value: [], properties: { + direction: {}, + skyColor: {}, + groundColor: {} + } } + + }, + + points: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + size: { value: 1.0 }, + scale: { value: 1.0 }, + map: { value: null }, + offsetRepeat: { value: new Vector4( 0, 0, 1, 1 ) } + + } + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + * @author mikael emtinger / http://gomo.se/ + */ + + var ShaderLib = { + + basic: { + + uniforms: UniformsUtils.merge( [ + + UniformsLib.common, + UniformsLib.aomap, + UniformsLib.fog + + ] ), + + vertexShader: ShaderChunk.meshbasic_vert, + fragmentShader: ShaderChunk.meshbasic_frag + + }, + + lambert: { + + uniforms: UniformsUtils.merge( [ + + UniformsLib.common, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.fog, + UniformsLib.lights, + + { + emissive : { value: new Color( 0x000000 ) } + } + + ] ), + + vertexShader: ShaderChunk.meshlambert_vert, + fragmentShader: ShaderChunk.meshlambert_frag + + }, + + phong: { + + uniforms: UniformsUtils.merge( [ + + UniformsLib.common, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.fog, + UniformsLib.lights, + + { + emissive : { value: new Color( 0x000000 ) }, + specular : { value: new Color( 0x111111 ) }, + shininess: { value: 30 } + } + + ] ), + + vertexShader: ShaderChunk.meshphong_vert, + fragmentShader: ShaderChunk.meshphong_frag + + }, + + standard: { + + uniforms: UniformsUtils.merge( [ + + UniformsLib.common, + UniformsLib.aomap, + UniformsLib.lightmap, + UniformsLib.emissivemap, + UniformsLib.bumpmap, + UniformsLib.normalmap, + UniformsLib.displacementmap, + UniformsLib.roughnessmap, + UniformsLib.metalnessmap, + UniformsLib.fog, + UniformsLib.lights, + + { + emissive : { value: new Color( 0x000000 ) }, + roughness: { value: 0.5 }, + metalness: { value: 0 }, + envMapIntensity : { value: 1 }, // temporary + } + + ] ), + + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag + + }, + + points: { + + uniforms: UniformsUtils.merge( [ + + UniformsLib.points, + UniformsLib.fog + + ] ), + + vertexShader: ShaderChunk.points_vert, + fragmentShader: ShaderChunk.points_frag + + }, + + dashed: { + + uniforms: UniformsUtils.merge( [ + + UniformsLib.common, + UniformsLib.fog, + + { + scale : { value: 1 }, + dashSize : { value: 1 }, + totalSize: { value: 2 } + } + + ] ), + + vertexShader: ShaderChunk.linedashed_vert, + fragmentShader: ShaderChunk.linedashed_frag + + }, + + depth: { + + uniforms: UniformsUtils.merge( [ + + UniformsLib.common, + UniformsLib.displacementmap + + ] ), + + vertexShader: ShaderChunk.depth_vert, + fragmentShader: ShaderChunk.depth_frag + + }, + + normal: { + + uniforms: { + + opacity : { value: 1.0 } + + }, + + vertexShader: ShaderChunk.normal_vert, + fragmentShader: ShaderChunk.normal_frag + + }, + + /* ------------------------------------------------------------------------- + // Cube map shader + ------------------------------------------------------------------------- */ + + cube: { + + uniforms: { + tCube: { value: null }, + tFlip: { value: - 1 }, + opacity: { value: 1.0 } + }, + + vertexShader: ShaderChunk.cube_vert, + fragmentShader: ShaderChunk.cube_frag + + }, + + /* ------------------------------------------------------------------------- + // Cube map shader + ------------------------------------------------------------------------- */ + + equirect: { + + uniforms: { + tEquirect: { value: null }, + tFlip: { value: - 1 } + }, + + vertexShader: ShaderChunk.equirect_vert, + fragmentShader: ShaderChunk.equirect_frag + + }, + + distanceRGBA: { + + uniforms: { + + lightPos: { value: new Vector3() } + + }, + + vertexShader: ShaderChunk.distanceRGBA_vert, + fragmentShader: ShaderChunk.distanceRGBA_frag + + } + + }; + + ShaderLib.physical = { + + uniforms: UniformsUtils.merge( [ + + ShaderLib.standard.uniforms, + + { + clearCoat: { value: 0 }, + clearCoatRoughness: { value: 0 } + } + + ] ), + + vertexShader: ShaderChunk.meshphysical_vert, + fragmentShader: ShaderChunk.meshphysical_frag + + }; + + /** + * @author bhouston / http://clara.io + */ + + function Box2( min, max ) { + + this.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity ); + this.max = ( max !== undefined ) ? max : new Vector2( - Infinity, - Infinity ); + + } + + Box2.prototype = { + + constructor: Box2, + + set: function ( min, max ) { + + this.min.copy( min ); + this.max.copy( max ); + + return this; + + }, + + setFromPoints: function ( points ) { + + this.makeEmpty(); + + for ( var i = 0, il = points.length; i < il; i ++ ) { + + this.expandByPoint( points[ i ] ); + + } + + return this; + + }, + + setFromCenterAndSize: function () { + + var v1 = new Vector2(); + + return function setFromCenterAndSize( center, size ) { + + var halfSize = v1.copy( size ).multiplyScalar( 0.5 ); + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); + + return this; + + }; + + }(), + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( box ) { + + this.min.copy( box.min ); + this.max.copy( box.max ); + + return this; + + }, + + makeEmpty: function () { + + this.min.x = this.min.y = + Infinity; + this.max.x = this.max.y = - Infinity; + + return this; + + }, + + isEmpty: function () { + + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); + + }, + + getCenter: function ( optionalTarget ) { + + var result = optionalTarget || new Vector2(); + return this.isEmpty() ? result.set( 0, 0 ) : result.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + + }, + + getSize: function ( optionalTarget ) { + + var result = optionalTarget || new Vector2(); + return this.isEmpty() ? result.set( 0, 0 ) : result.subVectors( this.max, this.min ); + + }, + + expandByPoint: function ( point ) { + + this.min.min( point ); + this.max.max( point ); + + return this; + + }, + + expandByVector: function ( vector ) { + + this.min.sub( vector ); + this.max.add( vector ); + + return this; + + }, + + expandByScalar: function ( scalar ) { + + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); + + return this; + + }, + + containsPoint: function ( point ) { + + if ( point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y ) { + + return false; + + } + + return true; + + }, + + containsBox: function ( box ) { + + if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) && + ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) ) { + + return true; + + } + + return false; + + }, + + getParameter: function ( point, optionalTarget ) { + + // This can potentially have a divide by zero if the box + // has a size dimension of 0. + + var result = optionalTarget || new Vector2(); + + return result.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ) + ); + + }, + + intersectsBox: function ( box ) { + + // using 6 splitting planes to rule out intersections. + + if ( box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y ) { + + return false; + + } + + return true; + + }, + + clampPoint: function ( point, optionalTarget ) { + + var result = optionalTarget || new Vector2(); + return result.copy( point ).clamp( this.min, this.max ); + + }, + + distanceToPoint: function () { + + var v1 = new Vector2(); + + return function distanceToPoint( point ) { + + var clampedPoint = v1.copy( point ).clamp( this.min, this.max ); + return clampedPoint.sub( point ).length(); + + }; + + }(), + + intersect: function ( box ) { + + this.min.max( box.min ); + this.max.min( box.max ); + + return this; + + }, + + union: function ( box ) { + + this.min.min( box.min ); + this.max.max( box.max ); + + return this; + + }, + + translate: function ( offset ) { + + this.min.add( offset ); + this.max.add( offset ); + + return this; + + }, + + equals: function ( box ) { + + return box.min.equals( this.min ) && box.max.equals( this.max ); + + } + + }; + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + */ + + function LensFlarePlugin( renderer, flares ) { + + var gl = renderer.context; + var state = renderer.state; + + var vertexBuffer, elementBuffer; + var shader, program, attributes, uniforms; + + var tempTexture, occlusionTexture; + + function init() { + + var vertices = new Float32Array( [ + - 1, - 1, 0, 0, + 1, - 1, 1, 0, + 1, 1, 1, 1, + - 1, 1, 0, 1 + ] ); + + var faces = new Uint16Array( [ + 0, 1, 2, + 0, 2, 3 + ] ); + + // buffers + + vertexBuffer = gl.createBuffer(); + elementBuffer = gl.createBuffer(); + + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW ); + + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW ); + + // textures + + tempTexture = gl.createTexture(); + occlusionTexture = gl.createTexture(); + + state.bindTexture( gl.TEXTURE_2D, tempTexture ); + gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + + state.bindTexture( gl.TEXTURE_2D, occlusionTexture ); + gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); + gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + + shader = { + + vertexShader: [ + + "uniform lowp int renderType;", + + "uniform vec3 screenPosition;", + "uniform vec2 scale;", + "uniform float rotation;", + + "uniform sampler2D occlusionMap;", + + "attribute vec2 position;", + "attribute vec2 uv;", + + "varying vec2 vUV;", + "varying float vVisibility;", + + "void main() {", + + "vUV = uv;", + + "vec2 pos = position;", + + "if ( renderType == 2 ) {", + + "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", + "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", + + "vVisibility = visibility.r / 9.0;", + "vVisibility *= 1.0 - visibility.g / 9.0;", + "vVisibility *= visibility.b / 9.0;", + "vVisibility *= 1.0 - visibility.a / 9.0;", + + "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", + "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", + + "}", + + "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", + + "}" + + ].join( "\n" ), + + fragmentShader: [ + + "uniform lowp int renderType;", + + "uniform sampler2D map;", + "uniform float opacity;", + "uniform vec3 color;", + + "varying vec2 vUV;", + "varying float vVisibility;", + + "void main() {", + + // pink square + + "if ( renderType == 0 ) {", + + "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", + + // restore + + "} else if ( renderType == 1 ) {", + + "gl_FragColor = texture2D( map, vUV );", + + // flare + + "} else {", + + "vec4 texture = texture2D( map, vUV );", + "texture.a *= opacity * vVisibility;", + "gl_FragColor = texture;", + "gl_FragColor.rgb *= color;", + + "}", + + "}" + + ].join( "\n" ) + + }; + + program = createProgram( shader ); + + attributes = { + vertex: gl.getAttribLocation ( program, "position" ), + uv: gl.getAttribLocation ( program, "uv" ) + }; + + uniforms = { + renderType: gl.getUniformLocation( program, "renderType" ), + map: gl.getUniformLocation( program, "map" ), + occlusionMap: gl.getUniformLocation( program, "occlusionMap" ), + opacity: gl.getUniformLocation( program, "opacity" ), + color: gl.getUniformLocation( program, "color" ), + scale: gl.getUniformLocation( program, "scale" ), + rotation: gl.getUniformLocation( program, "rotation" ), + screenPosition: gl.getUniformLocation( program, "screenPosition" ) + }; + + } + + /* + * Render lens flares + * Method: renders 16x16 0xff00ff-colored points scattered over the light source area, + * reads these back and calculates occlusion. + */ + + this.render = function ( scene, camera, viewport ) { + + if ( flares.length === 0 ) return; + + var tempPosition = new Vector3(); + + var invAspect = viewport.w / viewport.z, + halfViewportWidth = viewport.z * 0.5, + halfViewportHeight = viewport.w * 0.5; + + var size = 16 / viewport.w, + scale = new Vector2( size * invAspect, size ); + + var screenPosition = new Vector3( 1, 1, 0 ), + screenPositionPixels = new Vector2( 1, 1 ); + + var validArea = new Box2(); + + validArea.min.set( viewport.x, viewport.y ); + validArea.max.set( viewport.x + ( viewport.z - 16 ), viewport.y + ( viewport.w - 16 ) ); + + if ( program === undefined ) { + + init(); + + } + + gl.useProgram( program ); + + state.initAttributes(); + state.enableAttribute( attributes.vertex ); + state.enableAttribute( attributes.uv ); + state.disableUnusedAttributes(); + + // loop through all lens flares to update their occlusion and positions + // setup gl and common used attribs/uniforms + + gl.uniform1i( uniforms.occlusionMap, 0 ); + gl.uniform1i( uniforms.map, 1 ); + + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.vertexAttribPointer( attributes.vertex, 2, gl.FLOAT, false, 2 * 8, 0 ); + gl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 ); + + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + + state.disable( gl.CULL_FACE ); + state.setDepthWrite( false ); + + for ( var i = 0, l = flares.length; i < l; i ++ ) { + + size = 16 / viewport.w; + scale.set( size * invAspect, size ); + + // calc object screen position + + var flare = flares[ i ]; + + tempPosition.set( flare.matrixWorld.elements[ 12 ], flare.matrixWorld.elements[ 13 ], flare.matrixWorld.elements[ 14 ] ); + + tempPosition.applyMatrix4( camera.matrixWorldInverse ); + tempPosition.applyProjection( camera.projectionMatrix ); + + // setup arrays for gl programs + + screenPosition.copy( tempPosition ); + + // horizontal and vertical coordinate of the lower left corner of the pixels to copy + + screenPositionPixels.x = viewport.x + ( screenPosition.x * halfViewportWidth ) + halfViewportWidth - 8; + screenPositionPixels.y = viewport.y + ( screenPosition.y * halfViewportHeight ) + halfViewportHeight - 8; + + // screen cull + + if ( validArea.containsPoint( screenPositionPixels ) === true ) { + + // save current RGB to temp texture + + state.activeTexture( gl.TEXTURE0 ); + state.bindTexture( gl.TEXTURE_2D, null ); + state.activeTexture( gl.TEXTURE1 ); + state.bindTexture( gl.TEXTURE_2D, tempTexture ); + gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, screenPositionPixels.x, screenPositionPixels.y, 16, 16, 0 ); + + + // render pink quad + + gl.uniform1i( uniforms.renderType, 0 ); + gl.uniform2f( uniforms.scale, scale.x, scale.y ); + gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); + + state.disable( gl.BLEND ); + state.enable( gl.DEPTH_TEST ); + + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + + // copy result to occlusionMap + + state.activeTexture( gl.TEXTURE0 ); + state.bindTexture( gl.TEXTURE_2D, occlusionTexture ); + gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA, screenPositionPixels.x, screenPositionPixels.y, 16, 16, 0 ); + + + // restore graphics + + gl.uniform1i( uniforms.renderType, 1 ); + state.disable( gl.DEPTH_TEST ); + + state.activeTexture( gl.TEXTURE1 ); + state.bindTexture( gl.TEXTURE_2D, tempTexture ); + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + + // update object positions + + flare.positionScreen.copy( screenPosition ); + + if ( flare.customUpdateCallback ) { + + flare.customUpdateCallback( flare ); + + } else { + + flare.updateLensFlares(); + + } + + // render flares + + gl.uniform1i( uniforms.renderType, 2 ); + state.enable( gl.BLEND ); + + for ( var j = 0, jl = flare.lensFlares.length; j < jl; j ++ ) { + + var sprite = flare.lensFlares[ j ]; + + if ( sprite.opacity > 0.001 && sprite.scale > 0.001 ) { + + screenPosition.x = sprite.x; + screenPosition.y = sprite.y; + screenPosition.z = sprite.z; + + size = sprite.size * sprite.scale / viewport.w; + + scale.x = size * invAspect; + scale.y = size; + + gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); + gl.uniform2f( uniforms.scale, scale.x, scale.y ); + gl.uniform1f( uniforms.rotation, sprite.rotation ); + + gl.uniform1f( uniforms.opacity, sprite.opacity ); + gl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b ); + + state.setBlending( sprite.blending, sprite.blendEquation, sprite.blendSrc, sprite.blendDst ); + renderer.setTexture2D( sprite.texture, 1 ); + + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + } + + } + + } + + } + + // restore gl + + state.enable( gl.CULL_FACE ); + state.enable( gl.DEPTH_TEST ); + state.setDepthWrite( true ); + + renderer.resetGLState(); + + }; + + function createProgram( shader ) { + + var program = gl.createProgram(); + + var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER ); + var vertexShader = gl.createShader( gl.VERTEX_SHADER ); + + var prefix = "precision " + renderer.getPrecision() + " float;\n"; + + gl.shaderSource( fragmentShader, prefix + shader.fragmentShader ); + gl.shaderSource( vertexShader, prefix + shader.vertexShader ); + + gl.compileShader( fragmentShader ); + gl.compileShader( vertexShader ); + + gl.attachShader( program, fragmentShader ); + gl.attachShader( program, vertexShader ); + + gl.linkProgram( program ); + + return program; + + } + + } + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + */ + + function SpritePlugin( renderer, sprites ) { + + var gl = renderer.context; + var state = renderer.state; + + var vertexBuffer, elementBuffer; + var program, attributes, uniforms; + + var texture; + + // decompose matrixWorld + + var spritePosition = new Vector3(); + var spriteRotation = new Quaternion(); + var spriteScale = new Vector3(); + + function init() { + + var vertices = new Float32Array( [ + - 0.5, - 0.5, 0, 0, + 0.5, - 0.5, 1, 0, + 0.5, 0.5, 1, 1, + - 0.5, 0.5, 0, 1 + ] ); + + var faces = new Uint16Array( [ + 0, 1, 2, + 0, 2, 3 + ] ); + + vertexBuffer = gl.createBuffer(); + elementBuffer = gl.createBuffer(); + + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW ); + + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW ); + + program = createProgram(); + + attributes = { + position: gl.getAttribLocation ( program, 'position' ), + uv: gl.getAttribLocation ( program, 'uv' ) + }; + + uniforms = { + uvOffset: gl.getUniformLocation( program, 'uvOffset' ), + uvScale: gl.getUniformLocation( program, 'uvScale' ), + + rotation: gl.getUniformLocation( program, 'rotation' ), + scale: gl.getUniformLocation( program, 'scale' ), + + color: gl.getUniformLocation( program, 'color' ), + map: gl.getUniformLocation( program, 'map' ), + opacity: gl.getUniformLocation( program, 'opacity' ), + + modelViewMatrix: gl.getUniformLocation( program, 'modelViewMatrix' ), + projectionMatrix: gl.getUniformLocation( program, 'projectionMatrix' ), + + fogType: gl.getUniformLocation( program, 'fogType' ), + fogDensity: gl.getUniformLocation( program, 'fogDensity' ), + fogNear: gl.getUniformLocation( program, 'fogNear' ), + fogFar: gl.getUniformLocation( program, 'fogFar' ), + fogColor: gl.getUniformLocation( program, 'fogColor' ), + + alphaTest: gl.getUniformLocation( program, 'alphaTest' ) + }; + + var canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); + canvas.width = 8; + canvas.height = 8; + + var context = canvas.getContext( '2d' ); + context.fillStyle = 'white'; + context.fillRect( 0, 0, 8, 8 ); + + texture = new Texture( canvas ); + texture.needsUpdate = true; + + } + + this.render = function ( scene, camera ) { + + if ( sprites.length === 0 ) return; + + // setup gl + + if ( program === undefined ) { + + init(); + + } + + gl.useProgram( program ); + + state.initAttributes(); + state.enableAttribute( attributes.position ); + state.enableAttribute( attributes.uv ); + state.disableUnusedAttributes(); + + state.disable( gl.CULL_FACE ); + state.enable( gl.BLEND ); + + gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer ); + gl.vertexAttribPointer( attributes.position, 2, gl.FLOAT, false, 2 * 8, 0 ); + gl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 ); + + gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer ); + + gl.uniformMatrix4fv( uniforms.projectionMatrix, false, camera.projectionMatrix.elements ); + + state.activeTexture( gl.TEXTURE0 ); + gl.uniform1i( uniforms.map, 0 ); + + var oldFogType = 0; + var sceneFogType = 0; + var fog = scene.fog; + + if ( fog ) { + + gl.uniform3f( uniforms.fogColor, fog.color.r, fog.color.g, fog.color.b ); + + if ( (fog && fog.isFog) ) { + + gl.uniform1f( uniforms.fogNear, fog.near ); + gl.uniform1f( uniforms.fogFar, fog.far ); + + gl.uniform1i( uniforms.fogType, 1 ); + oldFogType = 1; + sceneFogType = 1; + + } else if ( (fog && fog.isFogExp2) ) { + + gl.uniform1f( uniforms.fogDensity, fog.density ); + + gl.uniform1i( uniforms.fogType, 2 ); + oldFogType = 2; + sceneFogType = 2; + + } + + } else { + + gl.uniform1i( uniforms.fogType, 0 ); + oldFogType = 0; + sceneFogType = 0; + + } + + + // update positions and sort + + for ( var i = 0, l = sprites.length; i < l; i ++ ) { + + var sprite = sprites[ i ]; + + sprite.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld ); + sprite.z = - sprite.modelViewMatrix.elements[ 14 ]; + + } + + sprites.sort( painterSortStable ); + + // render all sprites + + var scale = []; + + for ( var i = 0, l = sprites.length; i < l; i ++ ) { + + var sprite = sprites[ i ]; + var material = sprite.material; + + if ( material.visible === false ) continue; + + gl.uniform1f( uniforms.alphaTest, material.alphaTest ); + gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite.modelViewMatrix.elements ); + + sprite.matrixWorld.decompose( spritePosition, spriteRotation, spriteScale ); + + scale[ 0 ] = spriteScale.x; + scale[ 1 ] = spriteScale.y; + + var fogType = 0; + + if ( scene.fog && material.fog ) { + + fogType = sceneFogType; + + } + + if ( oldFogType !== fogType ) { + + gl.uniform1i( uniforms.fogType, fogType ); + oldFogType = fogType; + + } + + if ( material.map !== null ) { + + gl.uniform2f( uniforms.uvOffset, material.map.offset.x, material.map.offset.y ); + gl.uniform2f( uniforms.uvScale, material.map.repeat.x, material.map.repeat.y ); + + } else { + + gl.uniform2f( uniforms.uvOffset, 0, 0 ); + gl.uniform2f( uniforms.uvScale, 1, 1 ); + + } + + gl.uniform1f( uniforms.opacity, material.opacity ); + gl.uniform3f( uniforms.color, material.color.r, material.color.g, material.color.b ); + + gl.uniform1f( uniforms.rotation, material.rotation ); + gl.uniform2fv( uniforms.scale, scale ); + + state.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst ); + state.setDepthTest( material.depthTest ); + state.setDepthWrite( material.depthWrite ); + + if ( material.map ) { + + renderer.setTexture2D( material.map, 0 ); + + } else { + + renderer.setTexture2D( texture, 0 ); + + } + + gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + + } + + // restore gl + + state.enable( gl.CULL_FACE ); + + renderer.resetGLState(); + + }; + + function createProgram() { + + var program = gl.createProgram(); + + var vertexShader = gl.createShader( gl.VERTEX_SHADER ); + var fragmentShader = gl.createShader( gl.FRAGMENT_SHADER ); + + gl.shaderSource( vertexShader, [ + + 'precision ' + renderer.getPrecision() + ' float;', + + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform float rotation;', + 'uniform vec2 scale;', + 'uniform vec2 uvOffset;', + 'uniform vec2 uvScale;', + + 'attribute vec2 position;', + 'attribute vec2 uv;', + + 'varying vec2 vUV;', + + 'void main() {', + + 'vUV = uvOffset + uv * uvScale;', + + 'vec2 alignedPosition = position * scale;', + + 'vec2 rotatedPosition;', + 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;', + 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;', + + 'vec4 finalPosition;', + + 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );', + 'finalPosition.xy += rotatedPosition;', + 'finalPosition = projectionMatrix * finalPosition;', + + 'gl_Position = finalPosition;', + + '}' + + ].join( '\n' ) ); + + gl.shaderSource( fragmentShader, [ + + 'precision ' + renderer.getPrecision() + ' float;', + + 'uniform vec3 color;', + 'uniform sampler2D map;', + 'uniform float opacity;', + + 'uniform int fogType;', + 'uniform vec3 fogColor;', + 'uniform float fogDensity;', + 'uniform float fogNear;', + 'uniform float fogFar;', + 'uniform float alphaTest;', + + 'varying vec2 vUV;', + + 'void main() {', + + 'vec4 texture = texture2D( map, vUV );', + + 'if ( texture.a < alphaTest ) discard;', + + 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );', + + 'if ( fogType > 0 ) {', + + 'float depth = gl_FragCoord.z / gl_FragCoord.w;', + 'float fogFactor = 0.0;', + + 'if ( fogType == 1 ) {', + + 'fogFactor = smoothstep( fogNear, fogFar, depth );', + + '} else {', + + 'const float LOG2 = 1.442695;', + 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );', + 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );', + + '}', + + 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );', + + '}', + + '}' + + ].join( '\n' ) ); + + gl.compileShader( vertexShader ); + gl.compileShader( fragmentShader ); + + gl.attachShader( program, vertexShader ); + gl.attachShader( program, fragmentShader ); + + gl.linkProgram( program ); + + return program; + + } + + function painterSortStable( a, b ) { + + if ( a.renderOrder !== b.renderOrder ) { + + return a.renderOrder - b.renderOrder; + + } else if ( a.z !== b.z ) { + + return b.z - a.z; + + } else { + + return b.id - a.id; + + } + + } + + } + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function Material() { + + Object.defineProperty( this, 'id', { value: MaterialIdCount() } ); + + this.uuid = _Math.generateUUID(); + + this.name = ''; + this.type = 'Material'; + + this.fog = true; + this.lights = true; + + this.blending = NormalBlending; + this.side = FrontSide; + this.shading = SmoothShading; // THREE.FlatShading, THREE.SmoothShading + this.vertexColors = NoColors; // THREE.NoColors, THREE.VertexColors, THREE.FaceColors + + this.opacity = 1; + this.transparent = false; + + this.blendSrc = SrcAlphaFactor; + this.blendDst = OneMinusSrcAlphaFactor; + this.blendEquation = AddEquation; + this.blendSrcAlpha = null; + this.blendDstAlpha = null; + this.blendEquationAlpha = null; + + this.depthFunc = LessEqualDepth; + this.depthTest = true; + this.depthWrite = true; + + this.clippingPlanes = null; + this.clipIntersection = false; + this.clipShadows = false; + + this.colorWrite = true; + + this.precision = null; // override the renderer's default precision for this material + + this.polygonOffset = false; + this.polygonOffsetFactor = 0; + this.polygonOffsetUnits = 0; + + this.alphaTest = 0; + this.premultipliedAlpha = false; + + this.overdraw = 0; // Overdrawn pixels (typically between 0 and 1) for fixing antialiasing gaps in CanvasRenderer + + this.visible = true; + + this._needsUpdate = true; + + } + + Material.prototype = { + + constructor: Material, + + isMaterial: true, + + get needsUpdate() { + + return this._needsUpdate; + + }, + + set needsUpdate( value ) { + + if ( value === true ) this.update(); + this._needsUpdate = value; + + }, + + setValues: function ( values ) { + + if ( values === undefined ) return; + + for ( var key in values ) { + + var newValue = values[ key ]; + + if ( newValue === undefined ) { + + console.warn( "THREE.Material: '" + key + "' parameter is undefined." ); + continue; + + } + + var currentValue = this[ key ]; + + if ( currentValue === undefined ) { + + console.warn( "THREE." + this.type + ": '" + key + "' is not a property of this material." ); + continue; + + } + + if ( (currentValue && currentValue.isColor) ) { + + currentValue.set( newValue ); + + } else if ( (currentValue && currentValue.isVector3) && (newValue && newValue.isVector3) ) { + + currentValue.copy( newValue ); + + } else if ( key === 'overdraw' ) { + + // ensure overdraw is backwards-compatible with legacy boolean type + this[ key ] = Number( newValue ); + + } else { + + this[ key ] = newValue; + + } + + } + + }, + + toJSON: function ( meta ) { + + var isRoot = meta === undefined; + + if ( isRoot ) { + + meta = { + textures: {}, + images: {} + }; + + } + + var data = { + metadata: { + version: 4.4, + type: 'Material', + generator: 'Material.toJSON' + } + }; + + // standard Material serialization + data.uuid = this.uuid; + data.type = this.type; + + if ( this.name !== '' ) data.name = this.name; + + if ( (this.color && this.color.isColor) ) data.color = this.color.getHex(); + + if ( this.roughness !== undefined ) data.roughness = this.roughness; + if ( this.metalness !== undefined ) data.metalness = this.metalness; + + if ( (this.emissive && this.emissive.isColor) ) data.emissive = this.emissive.getHex(); + if ( (this.specular && this.specular.isColor) ) data.specular = this.specular.getHex(); + if ( this.shininess !== undefined ) data.shininess = this.shininess; + + if ( (this.map && this.map.isTexture) ) data.map = this.map.toJSON( meta ).uuid; + if ( (this.alphaMap && this.alphaMap.isTexture) ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid; + if ( (this.lightMap && this.lightMap.isTexture) ) data.lightMap = this.lightMap.toJSON( meta ).uuid; + if ( (this.bumpMap && this.bumpMap.isTexture) ) { + + data.bumpMap = this.bumpMap.toJSON( meta ).uuid; + data.bumpScale = this.bumpScale; + + } + if ( (this.normalMap && this.normalMap.isTexture) ) { + + data.normalMap = this.normalMap.toJSON( meta ).uuid; + data.normalScale = this.normalScale.toArray(); + + } + if ( (this.displacementMap && this.displacementMap.isTexture) ) { + + data.displacementMap = this.displacementMap.toJSON( meta ).uuid; + data.displacementScale = this.displacementScale; + data.displacementBias = this.displacementBias; + + } + if ( (this.roughnessMap && this.roughnessMap.isTexture) ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid; + if ( (this.metalnessMap && this.metalnessMap.isTexture) ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid; + + if ( (this.emissiveMap && this.emissiveMap.isTexture) ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid; + if ( (this.specularMap && this.specularMap.isTexture) ) data.specularMap = this.specularMap.toJSON( meta ).uuid; + + if ( (this.envMap && this.envMap.isTexture) ) { + + data.envMap = this.envMap.toJSON( meta ).uuid; + data.reflectivity = this.reflectivity; // Scale behind envMap + + } + + if ( this.size !== undefined ) data.size = this.size; + if ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation; + + if ( this.blending !== NormalBlending ) data.blending = this.blending; + if ( this.shading !== SmoothShading ) data.shading = this.shading; + if ( this.side !== FrontSide ) data.side = this.side; + if ( this.vertexColors !== NoColors ) data.vertexColors = this.vertexColors; + + if ( this.opacity < 1 ) data.opacity = this.opacity; + if ( this.transparent === true ) data.transparent = this.transparent; + + data.depthFunc = this.depthFunc; + data.depthTest = this.depthTest; + data.depthWrite = this.depthWrite; + + if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest; + if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; + if ( this.wireframe === true ) data.wireframe = this.wireframe; + if ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth; + if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap; + if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin; + + data.skinning = this.skinning; + data.morphTargets = this.morphTargets; + + // TODO: Copied from Object3D.toJSON + + function extractFromCache( cache ) { + + var values = []; + + for ( var key in cache ) { + + var data = cache[ key ]; + delete data.metadata; + values.push( data ); + + } + + return values; + + } + + if ( isRoot ) { + + var textures = extractFromCache( meta.textures ); + var images = extractFromCache( meta.images ); + + if ( textures.length > 0 ) data.textures = textures; + if ( images.length > 0 ) data.images = images; + + } + + return data; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( source ) { + + this.name = source.name; + + this.fog = source.fog; + this.lights = source.lights; + + this.blending = source.blending; + this.side = source.side; + this.shading = source.shading; + this.vertexColors = source.vertexColors; + + this.opacity = source.opacity; + this.transparent = source.transparent; + + this.blendSrc = source.blendSrc; + this.blendDst = source.blendDst; + this.blendEquation = source.blendEquation; + this.blendSrcAlpha = source.blendSrcAlpha; + this.blendDstAlpha = source.blendDstAlpha; + this.blendEquationAlpha = source.blendEquationAlpha; + + this.depthFunc = source.depthFunc; + this.depthTest = source.depthTest; + this.depthWrite = source.depthWrite; + + this.colorWrite = source.colorWrite; + + this.precision = source.precision; + + this.polygonOffset = source.polygonOffset; + this.polygonOffsetFactor = source.polygonOffsetFactor; + this.polygonOffsetUnits = source.polygonOffsetUnits; + + this.alphaTest = source.alphaTest; + + this.premultipliedAlpha = source.premultipliedAlpha; + + this.overdraw = source.overdraw; + + this.visible = source.visible; + this.clipShadows = source.clipShadows; + this.clipIntersection = source.clipIntersection; + + var srcPlanes = source.clippingPlanes, + dstPlanes = null; + + if ( srcPlanes !== null ) { + + var n = srcPlanes.length; + dstPlanes = new Array( n ); + + for ( var i = 0; i !== n; ++ i ) + dstPlanes[ i ] = srcPlanes[ i ].clone(); + + } + + this.clippingPlanes = dstPlanes; + + return this; + + }, + + update: function () { + + this.dispatchEvent( { type: 'update' } ); + + }, + + dispose: function () { + + this.dispatchEvent( { type: 'dispose' } ); + + } + + }; + + Object.assign( Material.prototype, EventDispatcher.prototype ); + + var count$1 = 0; + function MaterialIdCount() { return count$1++; } + + /** + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * defines: { "label" : "value" }, + * uniforms: { "parameter1": { value: 1.0 }, "parameter2": { value2: 2 } }, + * + * fragmentShader: , + * vertexShader: , + * + * wireframe: , + * wireframeLinewidth: , + * + * lights: , + * + * skinning: , + * morphTargets: , + * morphNormals: + * } + */ + + function ShaderMaterial( parameters ) { + + Material.call( this ); + + this.type = 'ShaderMaterial'; + + this.defines = {}; + this.uniforms = {}; + + this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'; + this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'; + + this.linewidth = 1; + + this.wireframe = false; + this.wireframeLinewidth = 1; + + this.fog = false; // set to use scene fog + this.lights = false; // set to use scene lights + this.clipping = false; // set to use user-defined clipping planes + + this.skinning = false; // set to use skinning attribute streams + this.morphTargets = false; // set to use morph targets + this.morphNormals = false; // set to use morph normals + + this.extensions = { + derivatives: false, // set to use derivatives + fragDepth: false, // set to use fragment depth values + drawBuffers: false, // set to use draw buffers + shaderTextureLOD: false // set to use shader texture LOD + }; + + // When rendered geometry doesn't include these attributes but the material does, + // use these default values in WebGL. This avoids errors when buffer data is missing. + this.defaultAttributeValues = { + 'color': [ 1, 1, 1 ], + 'uv': [ 0, 0 ], + 'uv2': [ 0, 0 ] + }; + + this.index0AttributeName = undefined; + + if ( parameters !== undefined ) { + + if ( parameters.attributes !== undefined ) { + + console.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' ); + + } + + this.setValues( parameters ); + + } + + } + + ShaderMaterial.prototype = Object.create( Material.prototype ); + ShaderMaterial.prototype.constructor = ShaderMaterial; + + ShaderMaterial.prototype.isShaderMaterial = true; + + ShaderMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.fragmentShader = source.fragmentShader; + this.vertexShader = source.vertexShader; + + this.uniforms = UniformsUtils.clone( source.uniforms ); + + this.defines = source.defines; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + + this.lights = source.lights; + this.clipping = source.clipping; + + this.skinning = source.skinning; + + this.morphTargets = source.morphTargets; + this.morphNormals = source.morphNormals; + + this.extensions = source.extensions; + + return this; + + }; + + ShaderMaterial.prototype.toJSON = function ( meta ) { + + var data = Material.prototype.toJSON.call( this, meta ); + + data.uniforms = this.uniforms; + data.vertexShader = this.vertexShader; + data.fragmentShader = this.fragmentShader; + + return data; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * @author bhouston / https://clara.io + * @author WestLangley / http://github.com/WestLangley + * + * parameters = { + * + * opacity: , + * + * map: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * wireframe: , + * wireframeLinewidth: + * } + */ + + function MeshDepthMaterial( parameters ) { + + Material.call( this ); + + this.type = 'MeshDepthMaterial'; + + this.depthPacking = BasicDepthPacking; + + this.skinning = false; + this.morphTargets = false; + + this.map = null; + + this.alphaMap = null; + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.wireframe = false; + this.wireframeLinewidth = 1; + + this.fog = false; + this.lights = false; + + this.setValues( parameters ); + + } + + MeshDepthMaterial.prototype = Object.create( Material.prototype ); + MeshDepthMaterial.prototype.constructor = MeshDepthMaterial; + + MeshDepthMaterial.prototype.isMeshDepthMaterial = true; + + MeshDepthMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.depthPacking = source.depthPacking; + + this.skinning = source.skinning; + this.morphTargets = source.morphTargets; + + this.map = source.map; + + this.alphaMap = source.alphaMap; + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + + return this; + + }; + + /** + * @author bhouston / http://clara.io + * @author WestLangley / http://github.com/WestLangley + */ + + function Box3( min, max ) { + + this.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity ); + this.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity ); + + } + + Box3.prototype = { + + constructor: Box3, + + isBox3: true, + + set: function ( min, max ) { + + this.min.copy( min ); + this.max.copy( max ); + + return this; + + }, + + setFromArray: function ( array ) { + + var minX = + Infinity; + var minY = + Infinity; + var minZ = + Infinity; + + var maxX = - Infinity; + var maxY = - Infinity; + var maxZ = - Infinity; + + for ( var i = 0, l = array.length; i < l; i += 3 ) { + + var x = array[ i ]; + var y = array[ i + 1 ]; + var z = array[ i + 2 ]; + + if ( x < minX ) minX = x; + if ( y < minY ) minY = y; + if ( z < minZ ) minZ = z; + + if ( x > maxX ) maxX = x; + if ( y > maxY ) maxY = y; + if ( z > maxZ ) maxZ = z; + + } + + this.min.set( minX, minY, minZ ); + this.max.set( maxX, maxY, maxZ ); + + }, + + setFromPoints: function ( points ) { + + this.makeEmpty(); + + for ( var i = 0, il = points.length; i < il; i ++ ) { + + this.expandByPoint( points[ i ] ); + + } + + return this; + + }, + + setFromCenterAndSize: function () { + + var v1 = new Vector3(); + + return function setFromCenterAndSize( center, size ) { + + var halfSize = v1.copy( size ).multiplyScalar( 0.5 ); + + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); + + return this; + + }; + + }(), + + setFromObject: function () { + + // Computes the world-axis-aligned bounding box of an object (including its children), + // accounting for both the object's, and children's, world transforms + + var v1 = new Vector3(); + + return function setFromObject( object ) { + + var scope = this; + + object.updateMatrixWorld( true ); + + this.makeEmpty(); + + object.traverse( function ( node ) { + + var geometry = node.geometry; + + if ( geometry !== undefined ) { + + if ( (geometry && geometry.isGeometry) ) { + + var vertices = geometry.vertices; + + for ( var i = 0, il = vertices.length; i < il; i ++ ) { + + v1.copy( vertices[ i ] ); + v1.applyMatrix4( node.matrixWorld ); + + scope.expandByPoint( v1 ); + + } + + } else if ( (geometry && geometry.isBufferGeometry) ) { + + var attribute = geometry.attributes.position; + + if ( attribute !== undefined ) { + + var array, offset, stride; + + if ( (attribute && attribute.isInterleavedBufferAttribute) ) { + + array = attribute.data.array; + offset = attribute.offset; + stride = attribute.data.stride; + + } else { + + array = attribute.array; + offset = 0; + stride = 3; + + } + + for ( var i = offset, il = array.length; i < il; i += stride ) { + + v1.fromArray( array, i ); + v1.applyMatrix4( node.matrixWorld ); + + scope.expandByPoint( v1 ); + + } + + } + + } + + } + + } ); + + return this; + + }; + + }(), + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( box ) { + + this.min.copy( box.min ); + this.max.copy( box.max ); + + return this; + + }, + + makeEmpty: function () { + + this.min.x = this.min.y = this.min.z = + Infinity; + this.max.x = this.max.y = this.max.z = - Infinity; + + return this; + + }, + + isEmpty: function () { + + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); + + }, + + getCenter: function ( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + return this.isEmpty() ? result.set( 0, 0, 0 ) : result.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + + }, + + getSize: function ( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + return this.isEmpty() ? result.set( 0, 0, 0 ) : result.subVectors( this.max, this.min ); + + }, + + expandByPoint: function ( point ) { + + this.min.min( point ); + this.max.max( point ); + + return this; + + }, + + expandByVector: function ( vector ) { + + this.min.sub( vector ); + this.max.add( vector ); + + return this; + + }, + + expandByScalar: function ( scalar ) { + + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); + + return this; + + }, + + containsPoint: function ( point ) { + + if ( point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y || + point.z < this.min.z || point.z > this.max.z ) { + + return false; + + } + + return true; + + }, + + containsBox: function ( box ) { + + if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) && + ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) && + ( this.min.z <= box.min.z ) && ( box.max.z <= this.max.z ) ) { + + return true; + + } + + return false; + + }, + + getParameter: function ( point, optionalTarget ) { + + // This can potentially have a divide by zero if the box + // has a size dimension of 0. + + var result = optionalTarget || new Vector3(); + + return result.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ), + ( point.z - this.min.z ) / ( this.max.z - this.min.z ) + ); + + }, + + intersectsBox: function ( box ) { + + // using 6 splitting planes to rule out intersections. + + if ( box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y || + box.max.z < this.min.z || box.min.z > this.max.z ) { + + return false; + + } + + return true; + + }, + + intersectsSphere: ( function () { + + var closestPoint; + + return function intersectsSphere( sphere ) { + + if ( closestPoint === undefined ) closestPoint = new Vector3(); + + // Find the point on the AABB closest to the sphere center. + this.clampPoint( sphere.center, closestPoint ); + + // If that point is inside the sphere, the AABB and sphere intersect. + return closestPoint.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); + + }; + + } )(), + + intersectsPlane: function ( plane ) { + + // We compute the minimum and maximum dot product values. If those values + // are on the same side (back or front) of the plane, then there is no intersection. + + var min, max; + + if ( plane.normal.x > 0 ) { + + min = plane.normal.x * this.min.x; + max = plane.normal.x * this.max.x; + + } else { + + min = plane.normal.x * this.max.x; + max = plane.normal.x * this.min.x; + + } + + if ( plane.normal.y > 0 ) { + + min += plane.normal.y * this.min.y; + max += plane.normal.y * this.max.y; + + } else { + + min += plane.normal.y * this.max.y; + max += plane.normal.y * this.min.y; + + } + + if ( plane.normal.z > 0 ) { + + min += plane.normal.z * this.min.z; + max += plane.normal.z * this.max.z; + + } else { + + min += plane.normal.z * this.max.z; + max += plane.normal.z * this.min.z; + + } + + return ( min <= plane.constant && max >= plane.constant ); + + }, + + clampPoint: function ( point, optionalTarget ) { + + var result = optionalTarget || new Vector3(); + return result.copy( point ).clamp( this.min, this.max ); + + }, + + distanceToPoint: function () { + + var v1 = new Vector3(); + + return function distanceToPoint( point ) { + + var clampedPoint = v1.copy( point ).clamp( this.min, this.max ); + return clampedPoint.sub( point ).length(); + + }; + + }(), + + getBoundingSphere: function () { + + var v1 = new Vector3(); + + return function getBoundingSphere( optionalTarget ) { + + var result = optionalTarget || new Sphere(); + + this.getCenter( result.center ); + + result.radius = this.getSize( v1 ).length() * 0.5; + + return result; + + }; + + }(), + + intersect: function ( box ) { + + this.min.max( box.min ); + this.max.min( box.max ); + + // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. + if( this.isEmpty() ) this.makeEmpty(); + + return this; + + }, + + union: function ( box ) { + + this.min.min( box.min ); + this.max.max( box.max ); + + return this; + + }, + + applyMatrix4: function () { + + var points = [ + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3() + ]; + + return function applyMatrix4( matrix ) { + + // transform of empty box is an empty box. + if( this.isEmpty() ) return this; + + // NOTE: I am using a binary pattern to specify all 2^3 combinations below + points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 + points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 + points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 + points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 + points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 + points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 + points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 + points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 + + this.setFromPoints( points ); + + return this; + + }; + + }(), + + translate: function ( offset ) { + + this.min.add( offset ); + this.max.add( offset ); + + return this; + + }, + + equals: function ( box ) { + + return box.min.equals( this.min ) && box.max.equals( this.max ); + + } + + }; + + /** + * @author bhouston / http://clara.io + * @author mrdoob / http://mrdoob.com/ + */ + + function Sphere( center, radius ) { + + this.center = ( center !== undefined ) ? center : new Vector3(); + this.radius = ( radius !== undefined ) ? radius : 0; + + } + + Sphere.prototype = { + + constructor: Sphere, + + set: function ( center, radius ) { + + this.center.copy( center ); + this.radius = radius; + + return this; + + }, + + setFromPoints: function () { + + var box = new Box3(); + + return function setFromPoints( points, optionalCenter ) { + + var center = this.center; + + if ( optionalCenter !== undefined ) { + + center.copy( optionalCenter ); + + } else { + + box.setFromPoints( points ).getCenter( center ); + + } + + var maxRadiusSq = 0; + + for ( var i = 0, il = points.length; i < il; i ++ ) { + + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); + + } + + this.radius = Math.sqrt( maxRadiusSq ); + + return this; + + }; + + }(), + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( sphere ) { + + this.center.copy( sphere.center ); + this.radius = sphere.radius; + + return this; + + }, + + empty: function () { + + return ( this.radius <= 0 ); + + }, + + containsPoint: function ( point ) { + + return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); + + }, + + distanceToPoint: function ( point ) { + + return ( point.distanceTo( this.center ) - this.radius ); + + }, + + intersectsSphere: function ( sphere ) { + + var radiusSum = this.radius + sphere.radius; + + return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); + + }, + + intersectsBox: function ( box ) { + + return box.intersectsSphere( this ); + + }, + + intersectsPlane: function ( plane ) { + + // We use the following equation to compute the signed distance from + // the center of the sphere to the plane. + // + // distance = q * n - d + // + // If this distance is greater than the radius of the sphere, + // then there is no intersection. + + return Math.abs( this.center.dot( plane.normal ) - plane.constant ) <= this.radius; + + }, + + clampPoint: function ( point, optionalTarget ) { + + var deltaLengthSq = this.center.distanceToSquared( point ); + + var result = optionalTarget || new Vector3(); + + result.copy( point ); + + if ( deltaLengthSq > ( this.radius * this.radius ) ) { + + result.sub( this.center ).normalize(); + result.multiplyScalar( this.radius ).add( this.center ); + + } + + return result; + + }, + + getBoundingBox: function ( optionalTarget ) { + + var box = optionalTarget || new Box3(); + + box.set( this.center, this.center ); + box.expandByScalar( this.radius ); + + return box; + + }, + + applyMatrix4: function ( matrix ) { + + this.center.applyMatrix4( matrix ); + this.radius = this.radius * matrix.getMaxScaleOnAxis(); + + return this; + + }, + + translate: function ( offset ) { + + this.center.add( offset ); + + return this; + + }, + + equals: function ( sphere ) { + + return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); + + } + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + * @author WestLangley / http://github.com/WestLangley + * @author bhouston / http://clara.io + * @author tschw + */ + + function Matrix3() { + + this.elements = new Float32Array( [ + + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + + ] ); + + if ( arguments.length > 0 ) { + + console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); + + } + + } + + Matrix3.prototype = { + + constructor: Matrix3, + + isMatrix3: true, + + set: function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { + + var te = this.elements; + + te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31; + te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32; + te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33; + + return this; + + }, + + identity: function () { + + this.set( + + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + + ); + + return this; + + }, + + clone: function () { + + return new this.constructor().fromArray( this.elements ); + + }, + + copy: function ( m ) { + + var me = m.elements; + + this.set( + + me[ 0 ], me[ 3 ], me[ 6 ], + me[ 1 ], me[ 4 ], me[ 7 ], + me[ 2 ], me[ 5 ], me[ 8 ] + + ); + + return this; + + }, + + setFromMatrix4: function( m ) { + + var me = m.elements; + + this.set( + + me[ 0 ], me[ 4 ], me[ 8 ], + me[ 1 ], me[ 5 ], me[ 9 ], + me[ 2 ], me[ 6 ], me[ 10 ] + + ); + + return this; + + }, + + applyToVector3Array: function () { + + var v1; + + return function applyToVector3Array( array, offset, length ) { + + if ( v1 === undefined ) v1 = new Vector3(); + if ( offset === undefined ) offset = 0; + if ( length === undefined ) length = array.length; + + for ( var i = 0, j = offset; i < length; i += 3, j += 3 ) { + + v1.fromArray( array, j ); + v1.applyMatrix3( this ); + v1.toArray( array, j ); + + } + + return array; + + }; + + }(), + + applyToBuffer: function () { + + var v1; + + return function applyToBuffer( buffer, offset, length ) { + + if ( v1 === undefined ) v1 = new Vector3(); + if ( offset === undefined ) offset = 0; + if ( length === undefined ) length = buffer.length / buffer.itemSize; + + for ( var i = 0, j = offset; i < length; i ++, j ++ ) { + + v1.x = buffer.getX( j ); + v1.y = buffer.getY( j ); + v1.z = buffer.getZ( j ); + + v1.applyMatrix3( this ); + + buffer.setXYZ( j, v1.x, v1.y, v1.z ); + + } + + return buffer; + + }; + + }(), + + multiplyScalar: function ( s ) { + + var te = this.elements; + + te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s; + te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s; + te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s; + + return this; + + }, + + determinant: function () { + + var te = this.elements; + + var a = te[ 0 ], b = te[ 1 ], c = te[ 2 ], + d = te[ 3 ], e = te[ 4 ], f = te[ 5 ], + g = te[ 6 ], h = te[ 7 ], i = te[ 8 ]; + + return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; + + }, + + getInverse: function ( matrix, throwOnDegenerate ) { + + if ( (matrix && matrix.isMatrix4) ) { + + console.error( "THREE.Matrix3.getInverse no longer takes a Matrix4 argument." ); + + } + + var me = matrix.elements, + te = this.elements, + + n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], + n12 = me[ 3 ], n22 = me[ 4 ], n32 = me[ 5 ], + n13 = me[ 6 ], n23 = me[ 7 ], n33 = me[ 8 ], + + t11 = n33 * n22 - n32 * n23, + t12 = n32 * n13 - n33 * n12, + t13 = n23 * n12 - n22 * n13, + + det = n11 * t11 + n21 * t12 + n31 * t13; + + if ( det === 0 ) { + + var msg = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"; + + if ( throwOnDegenerate === true ) { + + throw new Error( msg ); + + } else { + + console.warn( msg ); + + } + + return this.identity(); + } + + var detInv = 1 / det; + + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv; + te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv; + + te[ 3 ] = t12 * detInv; + te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv; + te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv; + + te[ 6 ] = t13 * detInv; + te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv; + te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv; + + return this; + + }, + + transpose: function () { + + var tmp, m = this.elements; + + tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp; + tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp; + tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp; + + return this; + + }, + + flattenToArrayOffset: function ( array, offset ) { + + console.warn( "THREE.Matrix3: .flattenToArrayOffset is deprecated " + + "- just use .toArray instead." ); + + return this.toArray( array, offset ); + + }, + + getNormalMatrix: function ( matrix4 ) { + + return this.setFromMatrix4( matrix4 ).getInverse( this ).transpose(); + + }, + + transposeIntoArray: function ( r ) { + + var m = this.elements; + + r[ 0 ] = m[ 0 ]; + r[ 1 ] = m[ 3 ]; + r[ 2 ] = m[ 6 ]; + r[ 3 ] = m[ 1 ]; + r[ 4 ] = m[ 4 ]; + r[ 5 ] = m[ 7 ]; + r[ 6 ] = m[ 2 ]; + r[ 7 ] = m[ 5 ]; + r[ 8 ] = m[ 8 ]; + + return this; + + }, + + fromArray: function ( array, offset ) { + + if ( offset === undefined ) offset = 0; + + for( var i = 0; i < 9; i ++ ) { + + this.elements[ i ] = array[ i + offset ]; + + } + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + var te = this.elements; + + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; + + array[ offset + 3 ] = te[ 3 ]; + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; + + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; + array[ offset + 8 ] = te[ 8 ]; + + return array; + + } + + }; + + /** + * @author bhouston / http://clara.io + */ + + function Plane( normal, constant ) { + + this.normal = ( normal !== undefined ) ? normal : new Vector3( 1, 0, 0 ); + this.constant = ( constant !== undefined ) ? constant : 0; + + } + + Plane.prototype = { + + constructor: Plane, + + set: function ( normal, constant ) { + + this.normal.copy( normal ); + this.constant = constant; + + return this; + + }, + + setComponents: function ( x, y, z, w ) { + + this.normal.set( x, y, z ); + this.constant = w; + + return this; + + }, + + setFromNormalAndCoplanarPoint: function ( normal, point ) { + + this.normal.copy( normal ); + this.constant = - point.dot( this.normal ); // must be this.normal, not normal, as this.normal is normalized + + return this; + + }, + + setFromCoplanarPoints: function () { + + var v1 = new Vector3(); + var v2 = new Vector3(); + + return function setFromCoplanarPoints( a, b, c ) { + + var normal = v1.subVectors( c, b ).cross( v2.subVectors( a, b ) ).normalize(); + + // Q: should an error be thrown if normal is zero (e.g. degenerate plane)? + + this.setFromNormalAndCoplanarPoint( normal, a ); + + return this; + + }; + + }(), + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( plane ) { + + this.normal.copy( plane.normal ); + this.constant = plane.constant; + + return this; + + }, + + normalize: function () { + + // Note: will lead to a divide by zero if the plane is invalid. + + var inverseNormalLength = 1.0 / this.normal.length(); + this.normal.multiplyScalar( inverseNormalLength ); + this.constant *= inverseNormalLength; + + return this; + + }, + + negate: function () { + + this.constant *= - 1; + this.normal.negate(); + + return this; + + }, + + distanceToPoint: function ( point ) { + + return this.normal.dot( point ) + this.constant; + + }, + + distanceToSphere: function ( sphere ) { + + return this.distanceToPoint( sphere.center ) - sphere.radius; + + }, + + projectPoint: function ( point, optionalTarget ) { + + return this.orthoPoint( point, optionalTarget ).sub( point ).negate(); + + }, + + orthoPoint: function ( point, optionalTarget ) { + + var perpendicularMagnitude = this.distanceToPoint( point ); + + var result = optionalTarget || new Vector3(); + return result.copy( this.normal ).multiplyScalar( perpendicularMagnitude ); + + }, + + intersectLine: function () { + + var v1 = new Vector3(); + + return function intersectLine( line, optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + var direction = line.delta( v1 ); + + var denominator = this.normal.dot( direction ); + + if ( denominator === 0 ) { + + // line is coplanar, return origin + if ( this.distanceToPoint( line.start ) === 0 ) { + + return result.copy( line.start ); + + } + + // Unsure if this is the correct method to handle this case. + return undefined; + + } + + var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator; + + if ( t < 0 || t > 1 ) { + + return undefined; + + } + + return result.copy( direction ).multiplyScalar( t ).add( line.start ); + + }; + + }(), + + intersectsLine: function ( line ) { + + // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. + + var startSign = this.distanceToPoint( line.start ); + var endSign = this.distanceToPoint( line.end ); + + return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); + + }, + + intersectsBox: function ( box ) { + + return box.intersectsPlane( this ); + + }, + + intersectsSphere: function ( sphere ) { + + return sphere.intersectsPlane( this ); + + }, + + coplanarPoint: function ( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + return result.copy( this.normal ).multiplyScalar( - this.constant ); + + }, + + applyMatrix4: function () { + + var v1 = new Vector3(); + var m1 = new Matrix3(); + + return function applyMatrix4( matrix, optionalNormalMatrix ) { + + var referencePoint = this.coplanarPoint( v1 ).applyMatrix4( matrix ); + + // transform normal based on theory here: + // http://www.songho.ca/opengl/gl_normaltransform.html + var normalMatrix = optionalNormalMatrix || m1.getNormalMatrix( matrix ); + var normal = this.normal.applyMatrix3( normalMatrix ).normalize(); + + // recalculate constant (like in setFromNormalAndCoplanarPoint) + this.constant = - referencePoint.dot( normal ); + + return this; + + }; + + }(), + + translate: function ( offset ) { + + this.constant = this.constant - offset.dot( this.normal ); + + return this; + + }, + + equals: function ( plane ) { + + return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * @author bhouston / http://clara.io + */ + + function Frustum( p0, p1, p2, p3, p4, p5 ) { + + this.planes = [ + + ( p0 !== undefined ) ? p0 : new Plane(), + ( p1 !== undefined ) ? p1 : new Plane(), + ( p2 !== undefined ) ? p2 : new Plane(), + ( p3 !== undefined ) ? p3 : new Plane(), + ( p4 !== undefined ) ? p4 : new Plane(), + ( p5 !== undefined ) ? p5 : new Plane() + + ]; + + } + + Frustum.prototype = { + + constructor: Frustum, + + set: function ( p0, p1, p2, p3, p4, p5 ) { + + var planes = this.planes; + + planes[ 0 ].copy( p0 ); + planes[ 1 ].copy( p1 ); + planes[ 2 ].copy( p2 ); + planes[ 3 ].copy( p3 ); + planes[ 4 ].copy( p4 ); + planes[ 5 ].copy( p5 ); + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( frustum ) { + + var planes = this.planes; + + for ( var i = 0; i < 6; i ++ ) { + + planes[ i ].copy( frustum.planes[ i ] ); + + } + + return this; + + }, + + setFromMatrix: function ( m ) { + + var planes = this.planes; + var me = m.elements; + var me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ]; + var me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ]; + var me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ]; + var me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ]; + + planes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize(); + planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize(); + planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); + planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); + planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); + planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + + return this; + + }, + + intersectsObject: function () { + + var sphere = new Sphere(); + + return function intersectsObject( object ) { + + var geometry = object.geometry; + + if ( geometry.boundingSphere === null ) + geometry.computeBoundingSphere(); + + sphere.copy( geometry.boundingSphere ) + .applyMatrix4( object.matrixWorld ); + + return this.intersectsSphere( sphere ); + + }; + + }(), + + intersectsSprite: function () { + + var sphere = new Sphere(); + + return function intersectsSprite( sprite ) { + + sphere.center.set( 0, 0, 0 ); + sphere.radius = 0.7071067811865476; + sphere.applyMatrix4( sprite.matrixWorld ); + + return this.intersectsSphere( sphere ); + + }; + + }(), + + intersectsSphere: function ( sphere ) { + + var planes = this.planes; + var center = sphere.center; + var negRadius = - sphere.radius; + + for ( var i = 0; i < 6; i ++ ) { + + var distance = planes[ i ].distanceToPoint( center ); + + if ( distance < negRadius ) { + + return false; + + } + + } + + return true; + + }, + + intersectsBox: function () { + + var p1 = new Vector3(), + p2 = new Vector3(); + + return function intersectsBox( box ) { + + var planes = this.planes; + + for ( var i = 0; i < 6 ; i ++ ) { + + var plane = planes[ i ]; + + p1.x = plane.normal.x > 0 ? box.min.x : box.max.x; + p2.x = plane.normal.x > 0 ? box.max.x : box.min.x; + p1.y = plane.normal.y > 0 ? box.min.y : box.max.y; + p2.y = plane.normal.y > 0 ? box.max.y : box.min.y; + p1.z = plane.normal.z > 0 ? box.min.z : box.max.z; + p2.z = plane.normal.z > 0 ? box.max.z : box.min.z; + + var d1 = plane.distanceToPoint( p1 ); + var d2 = plane.distanceToPoint( p2 ); + + // if both outside plane, no intersection + + if ( d1 < 0 && d2 < 0 ) { + + return false; + + } + + } + + return true; + + }; + + }(), + + + containsPoint: function ( point ) { + + var planes = this.planes; + + for ( var i = 0; i < 6; i ++ ) { + + if ( planes[ i ].distanceToPoint( point ) < 0 ) { + + return false; + + } + + } + + return true; + + } + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) { + + var _gl = _renderer.context, + _state = _renderer.state, + _frustum = new Frustum(), + _projScreenMatrix = new Matrix4(), + + _lightShadows = _lights.shadows, + + _shadowMapSize = new Vector2(), + _maxShadowMapSize = new Vector2( capabilities.maxTextureSize, capabilities.maxTextureSize ), + + _lookTarget = new Vector3(), + _lightPositionWorld = new Vector3(), + + _renderList = [], + + _MorphingFlag = 1, + _SkinningFlag = 2, + + _NumberOfMaterialVariants = ( _MorphingFlag | _SkinningFlag ) + 1, + + _depthMaterials = new Array( _NumberOfMaterialVariants ), + _distanceMaterials = new Array( _NumberOfMaterialVariants ), + + _materialCache = {}; + + var cubeDirections = [ + new Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ), + new Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 ) + ]; + + var cubeUps = [ + new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), + new Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ), new Vector3( 0, 0, - 1 ) + ]; + + var cube2DViewPorts = [ + new Vector4(), new Vector4(), new Vector4(), + new Vector4(), new Vector4(), new Vector4() + ]; + + // init + + var depthMaterialTemplate = new MeshDepthMaterial(); + depthMaterialTemplate.depthPacking = RGBADepthPacking; + depthMaterialTemplate.clipping = true; + + var distanceShader = ShaderLib[ "distanceRGBA" ]; + var distanceUniforms = UniformsUtils.clone( distanceShader.uniforms ); + + for ( var i = 0; i !== _NumberOfMaterialVariants; ++ i ) { + + var useMorphing = ( i & _MorphingFlag ) !== 0; + var useSkinning = ( i & _SkinningFlag ) !== 0; + + var depthMaterial = depthMaterialTemplate.clone(); + depthMaterial.morphTargets = useMorphing; + depthMaterial.skinning = useSkinning; + + _depthMaterials[ i ] = depthMaterial; + + var distanceMaterial = new ShaderMaterial( { + defines: { + 'USE_SHADOWMAP': '' + }, + uniforms: distanceUniforms, + vertexShader: distanceShader.vertexShader, + fragmentShader: distanceShader.fragmentShader, + morphTargets: useMorphing, + skinning: useSkinning, + clipping: true + } ); + + _distanceMaterials[ i ] = distanceMaterial; + + } + + // + + var scope = this; + + this.enabled = false; + + this.autoUpdate = true; + this.needsUpdate = false; + + this.type = PCFShadowMap; + + this.renderReverseSided = true; + this.renderSingleSided = true; + + this.render = function ( scene, camera ) { + + if ( scope.enabled === false ) return; + if ( scope.autoUpdate === false && scope.needsUpdate === false ) return; + + if ( _lightShadows.length === 0 ) return; + + // Set GL state for depth map. + _state.clearColor( 1, 1, 1, 1 ); + _state.disable( _gl.BLEND ); + _state.setDepthTest( true ); + _state.setScissorTest( false ); + + // render depth map + + var faceCount, isPointLight; + + for ( var i = 0, il = _lightShadows.length; i < il; i ++ ) { + + var light = _lightShadows[ i ]; + var shadow = light.shadow; + + if ( shadow === undefined ) { + + console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' ); + continue; + + } + + var shadowCamera = shadow.camera; + + _shadowMapSize.copy( shadow.mapSize ); + _shadowMapSize.min( _maxShadowMapSize ); + + if ( (light && light.isPointLight) ) { + + faceCount = 6; + isPointLight = true; + + var vpWidth = _shadowMapSize.x; + var vpHeight = _shadowMapSize.y; + + // These viewports map a cube-map onto a 2D texture with the + // following orientation: + // + // xzXZ + // y Y + // + // X - Positive x direction + // x - Negative x direction + // Y - Positive y direction + // y - Negative y direction + // Z - Positive z direction + // z - Negative z direction + + // positive X + cube2DViewPorts[ 0 ].set( vpWidth * 2, vpHeight, vpWidth, vpHeight ); + // negative X + cube2DViewPorts[ 1 ].set( 0, vpHeight, vpWidth, vpHeight ); + // positive Z + cube2DViewPorts[ 2 ].set( vpWidth * 3, vpHeight, vpWidth, vpHeight ); + // negative Z + cube2DViewPorts[ 3 ].set( vpWidth, vpHeight, vpWidth, vpHeight ); + // positive Y + cube2DViewPorts[ 4 ].set( vpWidth * 3, 0, vpWidth, vpHeight ); + // negative Y + cube2DViewPorts[ 5 ].set( vpWidth, 0, vpWidth, vpHeight ); + + _shadowMapSize.x *= 4.0; + _shadowMapSize.y *= 2.0; + + } else { + + faceCount = 1; + isPointLight = false; + + } + + if ( shadow.map === null ) { + + var pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat }; + + shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); + + shadowCamera.updateProjectionMatrix(); + + } + + if ( (shadow && shadow.isSpotLightShadow) ) { + + shadow.update( light ); + + } + + var shadowMap = shadow.map; + var shadowMatrix = shadow.matrix; + + _lightPositionWorld.setFromMatrixPosition( light.matrixWorld ); + shadowCamera.position.copy( _lightPositionWorld ); + + _renderer.setRenderTarget( shadowMap ); + _renderer.clear(); + + // render shadow map for each cube face (if omni-directional) or + // run a single pass if not + + for ( var face = 0; face < faceCount; face ++ ) { + + if ( isPointLight ) { + + _lookTarget.copy( shadowCamera.position ); + _lookTarget.add( cubeDirections[ face ] ); + shadowCamera.up.copy( cubeUps[ face ] ); + shadowCamera.lookAt( _lookTarget ); + + var vpDimensions = cube2DViewPorts[ face ]; + _state.viewport( vpDimensions ); + + } else { + + _lookTarget.setFromMatrixPosition( light.target.matrixWorld ); + shadowCamera.lookAt( _lookTarget ); + + } + + shadowCamera.updateMatrixWorld(); + shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld ); + + // compute shadow matrix + + shadowMatrix.set( + 0.5, 0.0, 0.0, 0.5, + 0.0, 0.5, 0.0, 0.5, + 0.0, 0.0, 0.5, 0.5, + 0.0, 0.0, 0.0, 1.0 + ); + + shadowMatrix.multiply( shadowCamera.projectionMatrix ); + shadowMatrix.multiply( shadowCamera.matrixWorldInverse ); + + // update camera matrices and frustum + + _projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); + _frustum.setFromMatrix( _projScreenMatrix ); + + // set object matrices & frustum culling + + _renderList.length = 0; + + projectObject( scene, camera, shadowCamera ); + + // render shadow map + // render regular objects + + for ( var j = 0, jl = _renderList.length; j < jl; j ++ ) { + + var object = _renderList[ j ]; + var geometry = _objects.update( object ); + var material = object.material; + + if ( (material && material.isMultiMaterial) ) { + + var groups = geometry.groups; + var materials = material.materials; + + for ( var k = 0, kl = groups.length; k < kl; k ++ ) { + + var group = groups[ k ]; + var groupMaterial = materials[ group.materialIndex ]; + + if ( groupMaterial.visible === true ) { + + var depthMaterial = getDepthMaterial( object, groupMaterial, isPointLight, _lightPositionWorld ); + _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group ); + + } + + } + + } else { + + var depthMaterial = getDepthMaterial( object, material, isPointLight, _lightPositionWorld ); + _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null ); + + } + + } + + } + + } + + // Restore GL state. + var clearColor = _renderer.getClearColor(), + clearAlpha = _renderer.getClearAlpha(); + _renderer.setClearColor( clearColor, clearAlpha ); + + scope.needsUpdate = false; + + }; + + function getDepthMaterial( object, material, isPointLight, lightPositionWorld ) { + + var geometry = object.geometry; + + var result = null; + + var materialVariants = _depthMaterials; + var customMaterial = object.customDepthMaterial; + + if ( isPointLight ) { + + materialVariants = _distanceMaterials; + customMaterial = object.customDistanceMaterial; + + } + + if ( ! customMaterial ) { + + var useMorphing = false; + + if ( material.morphTargets ) { + + if ( (geometry && geometry.isBufferGeometry) ) { + + useMorphing = geometry.morphAttributes && geometry.morphAttributes.position && geometry.morphAttributes.position.length > 0; + + } else if ( (geometry && geometry.isGeometry) ) { + + useMorphing = geometry.morphTargets && geometry.morphTargets.length > 0; + + } + + } + + var useSkinning = object.isSkinnedMesh && material.skinning; + + var variantIndex = 0; + + if ( useMorphing ) variantIndex |= _MorphingFlag; + if ( useSkinning ) variantIndex |= _SkinningFlag; + + result = materialVariants[ variantIndex ]; + + } else { + + result = customMaterial; + + } + + if ( _renderer.localClippingEnabled && + material.clipShadows === true && + material.clippingPlanes.length !== 0 ) { + + // in this case we need a unique material instance reflecting the + // appropriate state + + var keyA = result.uuid, keyB = material.uuid; + + var materialsForVariant = _materialCache[ keyA ]; + + if ( materialsForVariant === undefined ) { + + materialsForVariant = {}; + _materialCache[ keyA ] = materialsForVariant; + + } + + var cachedMaterial = materialsForVariant[ keyB ]; + + if ( cachedMaterial === undefined ) { + + cachedMaterial = result.clone(); + materialsForVariant[ keyB ] = cachedMaterial; + + } + + result = cachedMaterial; + + } + + result.visible = material.visible; + result.wireframe = material.wireframe; + + var side = material.side; + + if ( scope.renderSingleSided && side == DoubleSide ) { + + side = FrontSide; + + } + + if ( scope.renderReverseSided ) { + + if ( side === FrontSide ) side = BackSide; + else if ( side === BackSide ) side = FrontSide; + + } + + result.side = side; + + result.clipShadows = material.clipShadows; + result.clippingPlanes = material.clippingPlanes; + + result.wireframeLinewidth = material.wireframeLinewidth; + result.linewidth = material.linewidth; + + if ( isPointLight && result.uniforms.lightPos !== undefined ) { + + result.uniforms.lightPos.value.copy( lightPositionWorld ); + + } + + return result; + + } + + function projectObject( object, camera, shadowCamera ) { + + if ( object.visible === false ) return; + + var visible = ( object.layers.mask & camera.layers.mask ) !== 0; + + if ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) { + + if ( object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) { + + var material = object.material; + + if ( material.visible === true ) { + + object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); + _renderList.push( object ); + + } + + } + + } + + var children = object.children; + + for ( var i = 0, l = children.length; i < l; i ++ ) { + + projectObject( children[ i ], camera, shadowCamera ); + + } + + } + + } + + /** + * @author bhouston / http://clara.io + */ + + function Ray( origin, direction ) { + + this.origin = ( origin !== undefined ) ? origin : new Vector3(); + this.direction = ( direction !== undefined ) ? direction : new Vector3(); + + } + + Ray.prototype = { + + constructor: Ray, + + set: function ( origin, direction ) { + + this.origin.copy( origin ); + this.direction.copy( direction ); + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( ray ) { + + this.origin.copy( ray.origin ); + this.direction.copy( ray.direction ); + + return this; + + }, + + at: function ( t, optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + return result.copy( this.direction ).multiplyScalar( t ).add( this.origin ); + + }, + + lookAt: function ( v ) { + + this.direction.copy( v ).sub( this.origin ).normalize(); + + return this; + + }, + + recast: function () { + + var v1 = new Vector3(); + + return function recast( t ) { + + this.origin.copy( this.at( t, v1 ) ); + + return this; + + }; + + }(), + + closestPointToPoint: function ( point, optionalTarget ) { + + var result = optionalTarget || new Vector3(); + result.subVectors( point, this.origin ); + var directionDistance = result.dot( this.direction ); + + if ( directionDistance < 0 ) { + + return result.copy( this.origin ); + + } + + return result.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + + }, + + distanceToPoint: function ( point ) { + + return Math.sqrt( this.distanceSqToPoint( point ) ); + + }, + + distanceSqToPoint: function () { + + var v1 = new Vector3(); + + return function distanceSqToPoint( point ) { + + var directionDistance = v1.subVectors( point, this.origin ).dot( this.direction ); + + // point behind the ray + + if ( directionDistance < 0 ) { + + return this.origin.distanceToSquared( point ); + + } + + v1.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + + return v1.distanceToSquared( point ); + + }; + + }(), + + distanceSqToSegment: function () { + + var segCenter = new Vector3(); + var segDir = new Vector3(); + var diff = new Vector3(); + + return function distanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { + + // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h + // It returns the min distance between the ray and the segment + // defined by v0 and v1 + // It can also set two optional targets : + // - The closest point on the ray + // - The closest point on the segment + + segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); + segDir.copy( v1 ).sub( v0 ).normalize(); + diff.copy( this.origin ).sub( segCenter ); + + var segExtent = v0.distanceTo( v1 ) * 0.5; + var a01 = - this.direction.dot( segDir ); + var b0 = diff.dot( this.direction ); + var b1 = - diff.dot( segDir ); + var c = diff.lengthSq(); + var det = Math.abs( 1 - a01 * a01 ); + var s0, s1, sqrDist, extDet; + + if ( det > 0 ) { + + // The ray and segment are not parallel. + + s0 = a01 * b1 - b0; + s1 = a01 * b0 - b1; + extDet = segExtent * det; + + if ( s0 >= 0 ) { + + if ( s1 >= - extDet ) { + + if ( s1 <= extDet ) { + + // region 0 + // Minimum at interior points of ray and segment. + + var invDet = 1 / det; + s0 *= invDet; + s1 *= invDet; + sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; + + } else { + + // region 1 + + s1 = segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } else { + + // region 5 + + s1 = - segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } else { + + if ( s1 <= - extDet ) { + + // region 4 + + s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } else if ( s1 <= extDet ) { + + // region 3 + + s0 = 0; + s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = s1 * ( s1 + 2 * b1 ) + c; + + } else { + + // region 2 + + s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + } + + } else { + + // Ray and segment are parallel. + + s1 = ( a01 > 0 ) ? - segExtent : segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + + } + + if ( optionalPointOnRay ) { + + optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); + + } + + if ( optionalPointOnSegment ) { + + optionalPointOnSegment.copy( segDir ).multiplyScalar( s1 ).add( segCenter ); + + } + + return sqrDist; + + }; + + }(), + + intersectSphere: function () { + + var v1 = new Vector3(); + + return function intersectSphere( sphere, optionalTarget ) { + + v1.subVectors( sphere.center, this.origin ); + var tca = v1.dot( this.direction ); + var d2 = v1.dot( v1 ) - tca * tca; + var radius2 = sphere.radius * sphere.radius; + + if ( d2 > radius2 ) return null; + + var thc = Math.sqrt( radius2 - d2 ); + + // t0 = first intersect point - entrance on front of sphere + var t0 = tca - thc; + + // t1 = second intersect point - exit point on back of sphere + var t1 = tca + thc; + + // test to see if both t0 and t1 are behind the ray - if so, return null + if ( t0 < 0 && t1 < 0 ) return null; + + // test to see if t0 is behind the ray: + // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, + // in order to always return an intersect point that is in front of the ray. + if ( t0 < 0 ) return this.at( t1, optionalTarget ); + + // else t0 is in front of the ray, so return the first collision point scaled by t0 + return this.at( t0, optionalTarget ); + + }; + + }(), + + intersectsSphere: function ( sphere ) { + + return this.distanceToPoint( sphere.center ) <= sphere.radius; + + }, + + distanceToPlane: function ( plane ) { + + var denominator = plane.normal.dot( this.direction ); + + if ( denominator === 0 ) { + + // line is coplanar, return origin + if ( plane.distanceToPoint( this.origin ) === 0 ) { + + return 0; + + } + + // Null is preferable to undefined since undefined means.... it is undefined + + return null; + + } + + var t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; + + // Return if the ray never intersects the plane + + return t >= 0 ? t : null; + + }, + + intersectPlane: function ( plane, optionalTarget ) { + + var t = this.distanceToPlane( plane ); + + if ( t === null ) { + + return null; + + } + + return this.at( t, optionalTarget ); + + }, + + + + intersectsPlane: function ( plane ) { + + // check if the ray lies on the plane first + + var distToPoint = plane.distanceToPoint( this.origin ); + + if ( distToPoint === 0 ) { + + return true; + + } + + var denominator = plane.normal.dot( this.direction ); + + if ( denominator * distToPoint < 0 ) { + + return true; + + } + + // ray origin is behind the plane (and is pointing behind it) + + return false; + + }, + + intersectBox: function ( box, optionalTarget ) { + + var tmin, tmax, tymin, tymax, tzmin, tzmax; + + var invdirx = 1 / this.direction.x, + invdiry = 1 / this.direction.y, + invdirz = 1 / this.direction.z; + + var origin = this.origin; + + if ( invdirx >= 0 ) { + + tmin = ( box.min.x - origin.x ) * invdirx; + tmax = ( box.max.x - origin.x ) * invdirx; + + } else { + + tmin = ( box.max.x - origin.x ) * invdirx; + tmax = ( box.min.x - origin.x ) * invdirx; + + } + + if ( invdiry >= 0 ) { + + tymin = ( box.min.y - origin.y ) * invdiry; + tymax = ( box.max.y - origin.y ) * invdiry; + + } else { + + tymin = ( box.max.y - origin.y ) * invdiry; + tymax = ( box.min.y - origin.y ) * invdiry; + + } + + if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null; + + // These lines also handle the case where tmin or tmax is NaN + // (result of 0 * Infinity). x !== x returns true if x is NaN + + if ( tymin > tmin || tmin !== tmin ) tmin = tymin; + + if ( tymax < tmax || tmax !== tmax ) tmax = tymax; + + if ( invdirz >= 0 ) { + + tzmin = ( box.min.z - origin.z ) * invdirz; + tzmax = ( box.max.z - origin.z ) * invdirz; + + } else { + + tzmin = ( box.max.z - origin.z ) * invdirz; + tzmax = ( box.min.z - origin.z ) * invdirz; + + } + + if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null; + + if ( tzmin > tmin || tmin !== tmin ) tmin = tzmin; + + if ( tzmax < tmax || tmax !== tmax ) tmax = tzmax; + + //return point closest to the ray (positive side) + + if ( tmax < 0 ) return null; + + return this.at( tmin >= 0 ? tmin : tmax, optionalTarget ); + + }, + + intersectsBox: ( function () { + + var v = new Vector3(); + + return function intersectsBox( box ) { + + return this.intersectBox( box, v ) !== null; + + }; + + } )(), + + intersectTriangle: function () { + + // Compute the offset origin, edges, and normal. + var diff = new Vector3(); + var edge1 = new Vector3(); + var edge2 = new Vector3(); + var normal = new Vector3(); + + return function intersectTriangle( a, b, c, backfaceCulling, optionalTarget ) { + + // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h + + edge1.subVectors( b, a ); + edge2.subVectors( c, a ); + normal.crossVectors( edge1, edge2 ); + + // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, + // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by + // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) + // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) + // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) + var DdN = this.direction.dot( normal ); + var sign; + + if ( DdN > 0 ) { + + if ( backfaceCulling ) return null; + sign = 1; + + } else if ( DdN < 0 ) { + + sign = - 1; + DdN = - DdN; + + } else { + + return null; + + } + + diff.subVectors( this.origin, a ); + var DdQxE2 = sign * this.direction.dot( edge2.crossVectors( diff, edge2 ) ); + + // b1 < 0, no intersection + if ( DdQxE2 < 0 ) { + + return null; + + } + + var DdE1xQ = sign * this.direction.dot( edge1.cross( diff ) ); + + // b2 < 0, no intersection + if ( DdE1xQ < 0 ) { + + return null; + + } + + // b1+b2 > 1, no intersection + if ( DdQxE2 + DdE1xQ > DdN ) { + + return null; + + } + + // Line intersects triangle, check if ray does. + var QdN = - sign * diff.dot( normal ); + + // t < 0, no intersection + if ( QdN < 0 ) { + + return null; + + } + + // Ray intersects triangle. + return this.at( QdN / DdN, optionalTarget ); + + }; + + }(), + + applyMatrix4: function ( matrix4 ) { + + this.direction.add( this.origin ).applyMatrix4( matrix4 ); + this.origin.applyMatrix4( matrix4 ); + this.direction.sub( this.origin ); + this.direction.normalize(); + + return this; + + }, + + equals: function ( ray ) { + + return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author WestLangley / http://github.com/WestLangley + * @author bhouston / http://clara.io + */ + + function Euler( x, y, z, order ) { + + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._order = order || Euler.DefaultOrder; + + } + + Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; + + Euler.DefaultOrder = 'XYZ'; + + Euler.prototype = { + + constructor: Euler, + + isEuler: true, + + get x () { + + return this._x; + + }, + + set x ( value ) { + + this._x = value; + this.onChangeCallback(); + + }, + + get y () { + + return this._y; + + }, + + set y ( value ) { + + this._y = value; + this.onChangeCallback(); + + }, + + get z () { + + return this._z; + + }, + + set z ( value ) { + + this._z = value; + this.onChangeCallback(); + + }, + + get order () { + + return this._order; + + }, + + set order ( value ) { + + this._order = value; + this.onChangeCallback(); + + }, + + set: function ( x, y, z, order ) { + + this._x = x; + this._y = y; + this._z = z; + this._order = order || this._order; + + this.onChangeCallback(); + + return this; + + }, + + clone: function () { + + return new this.constructor( this._x, this._y, this._z, this._order ); + + }, + + copy: function ( euler ) { + + this._x = euler._x; + this._y = euler._y; + this._z = euler._z; + this._order = euler._order; + + this.onChangeCallback(); + + return this; + + }, + + setFromRotationMatrix: function ( m, order, update ) { + + var clamp = _Math.clamp; + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + var te = m.elements; + var m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; + var m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; + var m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + + order = order || this._order; + + if ( order === 'XYZ' ) { + + this._y = Math.asin( clamp( m13, - 1, 1 ) ); + + if ( Math.abs( m13 ) < 0.99999 ) { + + this._x = Math.atan2( - m23, m33 ); + this._z = Math.atan2( - m12, m11 ); + + } else { + + this._x = Math.atan2( m32, m22 ); + this._z = 0; + + } + + } else if ( order === 'YXZ' ) { + + this._x = Math.asin( - clamp( m23, - 1, 1 ) ); + + if ( Math.abs( m23 ) < 0.99999 ) { + + this._y = Math.atan2( m13, m33 ); + this._z = Math.atan2( m21, m22 ); + + } else { + + this._y = Math.atan2( - m31, m11 ); + this._z = 0; + + } + + } else if ( order === 'ZXY' ) { + + this._x = Math.asin( clamp( m32, - 1, 1 ) ); + + if ( Math.abs( m32 ) < 0.99999 ) { + + this._y = Math.atan2( - m31, m33 ); + this._z = Math.atan2( - m12, m22 ); + + } else { + + this._y = 0; + this._z = Math.atan2( m21, m11 ); + + } + + } else if ( order === 'ZYX' ) { + + this._y = Math.asin( - clamp( m31, - 1, 1 ) ); + + if ( Math.abs( m31 ) < 0.99999 ) { + + this._x = Math.atan2( m32, m33 ); + this._z = Math.atan2( m21, m11 ); + + } else { + + this._x = 0; + this._z = Math.atan2( - m12, m22 ); + + } + + } else if ( order === 'YZX' ) { + + this._z = Math.asin( clamp( m21, - 1, 1 ) ); + + if ( Math.abs( m21 ) < 0.99999 ) { + + this._x = Math.atan2( - m23, m22 ); + this._y = Math.atan2( - m31, m11 ); + + } else { + + this._x = 0; + this._y = Math.atan2( m13, m33 ); + + } + + } else if ( order === 'XZY' ) { + + this._z = Math.asin( - clamp( m12, - 1, 1 ) ); + + if ( Math.abs( m12 ) < 0.99999 ) { + + this._x = Math.atan2( m32, m22 ); + this._y = Math.atan2( m13, m11 ); + + } else { + + this._x = Math.atan2( - m23, m33 ); + this._y = 0; + + } + + } else { + + console.warn( 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + order ); + + } + + this._order = order; + + if ( update !== false ) this.onChangeCallback(); + + return this; + + }, + + setFromQuaternion: function () { + + var matrix; + + return function setFromQuaternion( q, order, update ) { + + if ( matrix === undefined ) matrix = new Matrix4(); + + matrix.makeRotationFromQuaternion( q ); + + return this.setFromRotationMatrix( matrix, order, update ); + + }; + + }(), + + setFromVector3: function ( v, order ) { + + return this.set( v.x, v.y, v.z, order || this._order ); + + }, + + reorder: function () { + + // WARNING: this discards revolution information -bhouston + + var q = new Quaternion(); + + return function reorder( newOrder ) { + + q.setFromEuler( this ); + + return this.setFromQuaternion( q, newOrder ); + + }; + + }(), + + equals: function ( euler ) { + + return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); + + }, + + fromArray: function ( array ) { + + this._x = array[ 0 ]; + this._y = array[ 1 ]; + this._z = array[ 2 ]; + if ( array[ 3 ] !== undefined ) this._order = array[ 3 ]; + + this.onChangeCallback(); + + return this; + + }, + + toArray: function ( array, offset ) { + + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; + + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._order; + + return array; + + }, + + toVector3: function ( optionalResult ) { + + if ( optionalResult ) { + + return optionalResult.set( this._x, this._y, this._z ); + + } else { + + return new Vector3( this._x, this._y, this._z ); + + } + + }, + + onChange: function ( callback ) { + + this.onChangeCallback = callback; + + return this; + + }, + + onChangeCallback: function () {} + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function Layers() { + + this.mask = 1; + + } + + Layers.prototype = { + + constructor: Layers, + + set: function ( channel ) { + + this.mask = 1 << channel; + + }, + + enable: function ( channel ) { + + this.mask |= 1 << channel; + + }, + + toggle: function ( channel ) { + + this.mask ^= 1 << channel; + + }, + + disable: function ( channel ) { + + this.mask &= ~ ( 1 << channel ); + + }, + + test: function ( layers ) { + + return ( this.mask & layers.mask ) !== 0; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + * @author WestLangley / http://github.com/WestLangley + * @author elephantatwork / www.elephantatwork.ch + */ + + function Object3D() { + + Object.defineProperty( this, 'id', { value: Object3DIdCount() } ); + + this.uuid = _Math.generateUUID(); + + this.name = ''; + this.type = 'Object3D'; + + this.parent = null; + this.children = []; + + this.up = Object3D.DefaultUp.clone(); + + var position = new Vector3(); + var rotation = new Euler(); + var quaternion = new Quaternion(); + var scale = new Vector3( 1, 1, 1 ); + + function onRotationChange() { + + quaternion.setFromEuler( rotation, false ); + + } + + function onQuaternionChange() { + + rotation.setFromQuaternion( quaternion, undefined, false ); + + } + + rotation.onChange( onRotationChange ); + quaternion.onChange( onQuaternionChange ); + + Object.defineProperties( this, { + position: { + enumerable: true, + value: position + }, + rotation: { + enumerable: true, + value: rotation + }, + quaternion: { + enumerable: true, + value: quaternion + }, + scale: { + enumerable: true, + value: scale + }, + modelViewMatrix: { + value: new Matrix4() + }, + normalMatrix: { + value: new Matrix3() + } + } ); + + this.matrix = new Matrix4(); + this.matrixWorld = new Matrix4(); + + this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; + this.matrixWorldNeedsUpdate = false; + + this.layers = new Layers(); + this.visible = true; + + this.castShadow = false; + this.receiveShadow = false; + + this.frustumCulled = true; + this.renderOrder = 0; + + this.userData = {}; + + this.onBeforeRender = function(){}; + this.onAfterRender = function(){}; + + } + + Object3D.DefaultUp = new Vector3( 0, 1, 0 ); + Object3D.DefaultMatrixAutoUpdate = true; + + Object.assign( Object3D.prototype, EventDispatcher.prototype, { + + isObject3D: true, + + applyMatrix: function ( matrix ) { + + this.matrix.multiplyMatrices( matrix, this.matrix ); + + this.matrix.decompose( this.position, this.quaternion, this.scale ); + + }, + + setRotationFromAxisAngle: function ( axis, angle ) { + + // assumes axis is normalized + + this.quaternion.setFromAxisAngle( axis, angle ); + + }, + + setRotationFromEuler: function ( euler ) { + + this.quaternion.setFromEuler( euler, true ); + + }, + + setRotationFromMatrix: function ( m ) { + + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + + this.quaternion.setFromRotationMatrix( m ); + + }, + + setRotationFromQuaternion: function ( q ) { + + // assumes q is normalized + + this.quaternion.copy( q ); + + }, + + rotateOnAxis: function () { + + // rotate object on axis in object space + // axis is assumed to be normalized + + var q1 = new Quaternion(); + + return function rotateOnAxis( axis, angle ) { + + q1.setFromAxisAngle( axis, angle ); + + this.quaternion.multiply( q1 ); + + return this; + + }; + + }(), + + rotateX: function () { + + var v1 = new Vector3( 1, 0, 0 ); + + return function rotateX( angle ) { + + return this.rotateOnAxis( v1, angle ); + + }; + + }(), + + rotateY: function () { + + var v1 = new Vector3( 0, 1, 0 ); + + return function rotateY( angle ) { + + return this.rotateOnAxis( v1, angle ); + + }; + + }(), + + rotateZ: function () { + + var v1 = new Vector3( 0, 0, 1 ); + + return function rotateZ( angle ) { + + return this.rotateOnAxis( v1, angle ); + + }; + + }(), + + translateOnAxis: function () { + + // translate object by distance along axis in object space + // axis is assumed to be normalized + + var v1 = new Vector3(); + + return function translateOnAxis( axis, distance ) { + + v1.copy( axis ).applyQuaternion( this.quaternion ); + + this.position.add( v1.multiplyScalar( distance ) ); + + return this; + + }; + + }(), + + translateX: function () { + + var v1 = new Vector3( 1, 0, 0 ); + + return function translateX( distance ) { + + return this.translateOnAxis( v1, distance ); + + }; + + }(), + + translateY: function () { + + var v1 = new Vector3( 0, 1, 0 ); + + return function translateY( distance ) { + + return this.translateOnAxis( v1, distance ); + + }; + + }(), + + translateZ: function () { + + var v1 = new Vector3( 0, 0, 1 ); + + return function translateZ( distance ) { + + return this.translateOnAxis( v1, distance ); + + }; + + }(), + + localToWorld: function ( vector ) { + + return vector.applyMatrix4( this.matrixWorld ); + + }, + + worldToLocal: function () { + + var m1 = new Matrix4(); + + return function worldToLocal( vector ) { + + return vector.applyMatrix4( m1.getInverse( this.matrixWorld ) ); + + }; + + }(), + + lookAt: function () { + + // This routine does not support objects with rotated and/or translated parent(s) + + var m1 = new Matrix4(); + + return function lookAt( vector ) { + + m1.lookAt( vector, this.position, this.up ); + + this.quaternion.setFromRotationMatrix( m1 ); + + }; + + }(), + + add: function ( object ) { + + if ( arguments.length > 1 ) { + + for ( var i = 0; i < arguments.length; i ++ ) { + + this.add( arguments[ i ] ); + + } + + return this; + + } + + if ( object === this ) { + + console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); + return this; + + } + + if ( (object && object.isObject3D) ) { + + if ( object.parent !== null ) { + + object.parent.remove( object ); + + } + + object.parent = this; + object.dispatchEvent( { type: 'added' } ); + + this.children.push( object ); + + } else { + + console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); + + } + + return this; + + }, + + remove: function ( object ) { + + if ( arguments.length > 1 ) { + + for ( var i = 0; i < arguments.length; i ++ ) { + + this.remove( arguments[ i ] ); + + } + + } + + var index = this.children.indexOf( object ); + + if ( index !== - 1 ) { + + object.parent = null; + + object.dispatchEvent( { type: 'removed' } ); + + this.children.splice( index, 1 ); + + } + + }, + + getObjectById: function ( id ) { + + return this.getObjectByProperty( 'id', id ); + + }, + + getObjectByName: function ( name ) { + + return this.getObjectByProperty( 'name', name ); + + }, + + getObjectByProperty: function ( name, value ) { + + if ( this[ name ] === value ) return this; + + for ( var i = 0, l = this.children.length; i < l; i ++ ) { + + var child = this.children[ i ]; + var object = child.getObjectByProperty( name, value ); + + if ( object !== undefined ) { + + return object; + + } + + } + + return undefined; + + }, + + getWorldPosition: function ( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + this.updateMatrixWorld( true ); + + return result.setFromMatrixPosition( this.matrixWorld ); + + }, + + getWorldQuaternion: function () { + + var position = new Vector3(); + var scale = new Vector3(); + + return function getWorldQuaternion( optionalTarget ) { + + var result = optionalTarget || new Quaternion(); + + this.updateMatrixWorld( true ); + + this.matrixWorld.decompose( position, result, scale ); + + return result; + + }; + + }(), + + getWorldRotation: function () { + + var quaternion = new Quaternion(); + + return function getWorldRotation( optionalTarget ) { + + var result = optionalTarget || new Euler(); + + this.getWorldQuaternion( quaternion ); + + return result.setFromQuaternion( quaternion, this.rotation.order, false ); + + }; + + }(), + + getWorldScale: function () { + + var position = new Vector3(); + var quaternion = new Quaternion(); + + return function getWorldScale( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + this.updateMatrixWorld( true ); + + this.matrixWorld.decompose( position, quaternion, result ); + + return result; + + }; + + }(), + + getWorldDirection: function () { + + var quaternion = new Quaternion(); + + return function getWorldDirection( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + this.getWorldQuaternion( quaternion ); + + return result.set( 0, 0, 1 ).applyQuaternion( quaternion ); + + }; + + }(), + + raycast: function () {}, + + traverse: function ( callback ) { + + callback( this ); + + var children = this.children; + + for ( var i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].traverse( callback ); + + } + + }, + + traverseVisible: function ( callback ) { + + if ( this.visible === false ) return; + + callback( this ); + + var children = this.children; + + for ( var i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].traverseVisible( callback ); + + } + + }, + + traverseAncestors: function ( callback ) { + + var parent = this.parent; + + if ( parent !== null ) { + + callback( parent ); + + parent.traverseAncestors( callback ); + + } + + }, + + updateMatrix: function () { + + this.matrix.compose( this.position, this.quaternion, this.scale ); + + this.matrixWorldNeedsUpdate = true; + + }, + + updateMatrixWorld: function ( force ) { + + if ( this.matrixAutoUpdate === true ) this.updateMatrix(); + + if ( this.matrixWorldNeedsUpdate === true || force === true ) { + + if ( this.parent === null ) { + + this.matrixWorld.copy( this.matrix ); + + } else { + + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + + } + + this.matrixWorldNeedsUpdate = false; + + force = true; + + } + + // update children + + var children = this.children; + + for ( var i = 0, l = children.length; i < l; i ++ ) { + + children[ i ].updateMatrixWorld( force ); + + } + + }, + + toJSON: function ( meta ) { + + // meta is '' when called from JSON.stringify + var isRootObject = ( meta === undefined || meta === '' ); + + var output = {}; + + // meta is a hash used to collect geometries, materials. + // not providing it implies that this is the root object + // being serialized. + if ( isRootObject ) { + + // initialize meta obj + meta = { + geometries: {}, + materials: {}, + textures: {}, + images: {} + }; + + output.metadata = { + version: 4.4, + type: 'Object', + generator: 'Object3D.toJSON' + }; + + } + + // standard Object3D serialization + + var object = {}; + + object.uuid = this.uuid; + object.type = this.type; + + if ( this.name !== '' ) object.name = this.name; + if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData; + if ( this.castShadow === true ) object.castShadow = true; + if ( this.receiveShadow === true ) object.receiveShadow = true; + if ( this.visible === false ) object.visible = false; + + object.matrix = this.matrix.toArray(); + + // + + if ( this.geometry !== undefined ) { + + if ( meta.geometries[ this.geometry.uuid ] === undefined ) { + + meta.geometries[ this.geometry.uuid ] = this.geometry.toJSON( meta ); + + } + + object.geometry = this.geometry.uuid; + + } + + if ( this.material !== undefined ) { + + if ( meta.materials[ this.material.uuid ] === undefined ) { + + meta.materials[ this.material.uuid ] = this.material.toJSON( meta ); + + } + + object.material = this.material.uuid; + + } + + // + + if ( this.children.length > 0 ) { + + object.children = []; + + for ( var i = 0; i < this.children.length; i ++ ) { + + object.children.push( this.children[ i ].toJSON( meta ).object ); + + } + + } + + if ( isRootObject ) { + + var geometries = extractFromCache( meta.geometries ); + var materials = extractFromCache( meta.materials ); + var textures = extractFromCache( meta.textures ); + var images = extractFromCache( meta.images ); + + if ( geometries.length > 0 ) output.geometries = geometries; + if ( materials.length > 0 ) output.materials = materials; + if ( textures.length > 0 ) output.textures = textures; + if ( images.length > 0 ) output.images = images; + + } + + output.object = object; + + return output; + + // extract data from the cache hash + // remove metadata on each item + // and return as array + function extractFromCache( cache ) { + + var values = []; + for ( var key in cache ) { + + var data = cache[ key ]; + delete data.metadata; + values.push( data ); + + } + return values; + + } + + }, + + clone: function ( recursive ) { + + return new this.constructor().copy( this, recursive ); + + }, + + copy: function ( source, recursive ) { + + if ( recursive === undefined ) recursive = true; + + this.name = source.name; + + this.up.copy( source.up ); + + this.position.copy( source.position ); + this.quaternion.copy( source.quaternion ); + this.scale.copy( source.scale ); + + this.matrix.copy( source.matrix ); + this.matrixWorld.copy( source.matrixWorld ); + + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; + + this.visible = source.visible; + + this.castShadow = source.castShadow; + this.receiveShadow = source.receiveShadow; + + this.frustumCulled = source.frustumCulled; + this.renderOrder = source.renderOrder; + + this.userData = JSON.parse( JSON.stringify( source.userData ) ); + + if ( recursive === true ) { + + for ( var i = 0; i < source.children.length; i ++ ) { + + var child = source.children[ i ]; + this.add( child.clone() ); + + } + + } + + return this; + + } + + } ); + + var count$2 = 0; + function Object3DIdCount() { return count$2++; } + + /** + * @author bhouston / http://clara.io + */ + + function Line3( start, end ) { + + this.start = ( start !== undefined ) ? start : new Vector3(); + this.end = ( end !== undefined ) ? end : new Vector3(); + + } + + Line3.prototype = { + + constructor: Line3, + + set: function ( start, end ) { + + this.start.copy( start ); + this.end.copy( end ); + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( line ) { + + this.start.copy( line.start ); + this.end.copy( line.end ); + + return this; + + }, + + getCenter: function ( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + return result.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); + + }, + + delta: function ( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + return result.subVectors( this.end, this.start ); + + }, + + distanceSq: function () { + + return this.start.distanceToSquared( this.end ); + + }, + + distance: function () { + + return this.start.distanceTo( this.end ); + + }, + + at: function ( t, optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + return this.delta( result ).multiplyScalar( t ).add( this.start ); + + }, + + closestPointToPointParameter: function () { + + var startP = new Vector3(); + var startEnd = new Vector3(); + + return function closestPointToPointParameter( point, clampToLine ) { + + startP.subVectors( point, this.start ); + startEnd.subVectors( this.end, this.start ); + + var startEnd2 = startEnd.dot( startEnd ); + var startEnd_startP = startEnd.dot( startP ); + + var t = startEnd_startP / startEnd2; + + if ( clampToLine ) { + + t = _Math.clamp( t, 0, 1 ); + + } + + return t; + + }; + + }(), + + closestPointToPoint: function ( point, clampToLine, optionalTarget ) { + + var t = this.closestPointToPointParameter( point, clampToLine ); + + var result = optionalTarget || new Vector3(); + + return this.delta( result ).multiplyScalar( t ).add( this.start ); + + }, + + applyMatrix4: function ( matrix ) { + + this.start.applyMatrix4( matrix ); + this.end.applyMatrix4( matrix ); + + return this; + + }, + + equals: function ( line ) { + + return line.start.equals( this.start ) && line.end.equals( this.end ); + + } + + }; + + /** + * @author bhouston / http://clara.io + * @author mrdoob / http://mrdoob.com/ + */ + + function Triangle( a, b, c ) { + + this.a = ( a !== undefined ) ? a : new Vector3(); + this.b = ( b !== undefined ) ? b : new Vector3(); + this.c = ( c !== undefined ) ? c : new Vector3(); + + } + + Triangle.normal = function () { + + var v0 = new Vector3(); + + return function normal( a, b, c, optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + result.subVectors( c, b ); + v0.subVectors( a, b ); + result.cross( v0 ); + + var resultLengthSq = result.lengthSq(); + if ( resultLengthSq > 0 ) { + + return result.multiplyScalar( 1 / Math.sqrt( resultLengthSq ) ); + + } + + return result.set( 0, 0, 0 ); + + }; + + }(); + + // static/instance method to calculate barycentric coordinates + // based on: http://www.blackpawn.com/texts/pointinpoly/default.html + Triangle.barycoordFromPoint = function () { + + var v0 = new Vector3(); + var v1 = new Vector3(); + var v2 = new Vector3(); + + return function barycoordFromPoint( point, a, b, c, optionalTarget ) { + + v0.subVectors( c, a ); + v1.subVectors( b, a ); + v2.subVectors( point, a ); + + var dot00 = v0.dot( v0 ); + var dot01 = v0.dot( v1 ); + var dot02 = v0.dot( v2 ); + var dot11 = v1.dot( v1 ); + var dot12 = v1.dot( v2 ); + + var denom = ( dot00 * dot11 - dot01 * dot01 ); + + var result = optionalTarget || new Vector3(); + + // collinear or singular triangle + if ( denom === 0 ) { + + // arbitrary location outside of triangle? + // not sure if this is the best idea, maybe should be returning undefined + return result.set( - 2, - 1, - 1 ); + + } + + var invDenom = 1 / denom; + var u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; + var v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; + + // barycentric coordinates must always sum to 1 + return result.set( 1 - u - v, v, u ); + + }; + + }(); + + Triangle.containsPoint = function () { + + var v1 = new Vector3(); + + return function containsPoint( point, a, b, c ) { + + var result = Triangle.barycoordFromPoint( point, a, b, c, v1 ); + + return ( result.x >= 0 ) && ( result.y >= 0 ) && ( ( result.x + result.y ) <= 1 ); + + }; + + }(); + + Triangle.prototype = { + + constructor: Triangle, + + set: function ( a, b, c ) { + + this.a.copy( a ); + this.b.copy( b ); + this.c.copy( c ); + + return this; + + }, + + setFromPointsAndIndices: function ( points, i0, i1, i2 ) { + + this.a.copy( points[ i0 ] ); + this.b.copy( points[ i1 ] ); + this.c.copy( points[ i2 ] ); + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( triangle ) { + + this.a.copy( triangle.a ); + this.b.copy( triangle.b ); + this.c.copy( triangle.c ); + + return this; + + }, + + area: function () { + + var v0 = new Vector3(); + var v1 = new Vector3(); + + return function area() { + + v0.subVectors( this.c, this.b ); + v1.subVectors( this.a, this.b ); + + return v0.cross( v1 ).length() * 0.5; + + }; + + }(), + + midpoint: function ( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + return result.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); + + }, + + normal: function ( optionalTarget ) { + + return Triangle.normal( this.a, this.b, this.c, optionalTarget ); + + }, + + plane: function ( optionalTarget ) { + + var result = optionalTarget || new Plane(); + + return result.setFromCoplanarPoints( this.a, this.b, this.c ); + + }, + + barycoordFromPoint: function ( point, optionalTarget ) { + + return Triangle.barycoordFromPoint( point, this.a, this.b, this.c, optionalTarget ); + + }, + + containsPoint: function ( point ) { + + return Triangle.containsPoint( point, this.a, this.b, this.c ); + + }, + + closestPointToPoint: function () { + + var plane, edgeList, projectedPoint, closestPoint; + + return function closestPointToPoint( point, optionalTarget ) { + + if ( plane === undefined ) { + + plane = new Plane(); + edgeList = [ new Line3(), new Line3(), new Line3() ]; + projectedPoint = new Vector3(); + closestPoint = new Vector3(); + + } + + var result = optionalTarget || new Vector3(); + var minDistance = Infinity; + + // project the point onto the plane of the triangle + + plane.setFromCoplanarPoints( this.a, this.b, this.c ); + plane.projectPoint( point, projectedPoint ); + + // check if the projection lies within the triangle + + if( this.containsPoint( projectedPoint ) === true ) { + + // if so, this is the closest point + + result.copy( projectedPoint ); + + } else { + + // if not, the point falls outside the triangle. the result is the closest point to the triangle's edges or vertices + + edgeList[ 0 ].set( this.a, this.b ); + edgeList[ 1 ].set( this.b, this.c ); + edgeList[ 2 ].set( this.c, this.a ); + + for( var i = 0; i < edgeList.length; i ++ ) { + + edgeList[ i ].closestPointToPoint( projectedPoint, true, closestPoint ); + + var distance = projectedPoint.distanceToSquared( closestPoint ); + + if( distance < minDistance ) { + + minDistance = distance; + + result.copy( closestPoint ); + + } + + } + + } + + return result; + + }; + + }(), + + equals: function ( triangle ) { + + return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function Face3( a, b, c, normal, color, materialIndex ) { + + this.a = a; + this.b = b; + this.c = c; + + this.normal = (normal && normal.isVector3) ? normal : new Vector3(); + this.vertexNormals = Array.isArray( normal ) ? normal : []; + + this.color = (color && color.isColor) ? color : new Color(); + this.vertexColors = Array.isArray( color ) ? color : []; + + this.materialIndex = materialIndex !== undefined ? materialIndex : 0; + + } + + Face3.prototype = { + + constructor: Face3, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( source ) { + + this.a = source.a; + this.b = source.b; + this.c = source.c; + + this.normal.copy( source.normal ); + this.color.copy( source.color ); + + this.materialIndex = source.materialIndex; + + for ( var i = 0, il = source.vertexNormals.length; i < il; i ++ ) { + + this.vertexNormals[ i ] = source.vertexNormals[ i ].clone(); + + } + + for ( var i = 0, il = source.vertexColors.length; i < il; i ++ ) { + + this.vertexColors[ i ] = source.vertexColors[ i ].clone(); + + } + + return this; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * color: , + * opacity: , + * map: new THREE.Texture( ), + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * specularMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), + * combine: THREE.Multiply, + * reflectivity: , + * refractionRatio: , + * + * shading: THREE.SmoothShading, + * depthTest: , + * depthWrite: , + * + * wireframe: , + * wireframeLinewidth: , + * + * skinning: , + * morphTargets: + * } + */ + + function MeshBasicMaterial( parameters ) { + + Material.call( this ); + + this.type = 'MeshBasicMaterial'; + + this.color = new Color( 0xffffff ); // emissive + + this.map = null; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.specularMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.skinning = false; + this.morphTargets = false; + + this.lights = false; + + this.setValues( parameters ); + + } + + MeshBasicMaterial.prototype = Object.create( Material.prototype ); + MeshBasicMaterial.prototype.constructor = MeshBasicMaterial; + + MeshBasicMaterial.prototype.isMeshBasicMaterial = true; + + MeshBasicMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + + this.map = source.map; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.specularMap = source.specularMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + this.skinning = source.skinning; + this.morphTargets = source.morphTargets; + + return this; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function BufferAttribute( array, itemSize, normalized ) { + + if ( Array.isArray( array ) ) { + + throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); + + } + + this.uuid = _Math.generateUUID(); + + this.array = array; + this.itemSize = itemSize; + this.count = array !== undefined ? array.length / itemSize : 0; + this.normalized = normalized === true; + + this.dynamic = false; + this.updateRange = { offset: 0, count: - 1 }; + + this.version = 0; + + } + + BufferAttribute.prototype = { + + constructor: BufferAttribute, + + isBufferAttribute: true, + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + }, + + setArray: function ( array ) { + + if ( Array.isArray( array ) ) { + + throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); + + } + + this.count = array !== undefined ? array.length / this.itemSize : 0; + this.array = array; + + }, + + setDynamic: function ( value ) { + + this.dynamic = value; + + return this; + + }, + + copy: function ( source ) { + + this.array = new source.array.constructor( source.array ); + this.itemSize = source.itemSize; + this.count = source.count; + this.normalized = source.normalized; + + this.dynamic = source.dynamic; + + return this; + + }, + + copyAt: function ( index1, attribute, index2 ) { + + index1 *= this.itemSize; + index2 *= attribute.itemSize; + + for ( var i = 0, l = this.itemSize; i < l; i ++ ) { + + this.array[ index1 + i ] = attribute.array[ index2 + i ]; + + } + + return this; + + }, + + copyArray: function ( array ) { + + this.array.set( array ); + + return this; + + }, + + copyColorsArray: function ( colors ) { + + var array = this.array, offset = 0; + + for ( var i = 0, l = colors.length; i < l; i ++ ) { + + var color = colors[ i ]; + + if ( color === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', i ); + color = new Color(); + + } + + array[ offset ++ ] = color.r; + array[ offset ++ ] = color.g; + array[ offset ++ ] = color.b; + + } + + return this; + + }, + + copyIndicesArray: function ( indices ) { + + var array = this.array, offset = 0; + + for ( var i = 0, l = indices.length; i < l; i ++ ) { + + var index = indices[ i ]; + + array[ offset ++ ] = index.a; + array[ offset ++ ] = index.b; + array[ offset ++ ] = index.c; + + } + + return this; + + }, + + copyVector2sArray: function ( vectors ) { + + var array = this.array, offset = 0; + + for ( var i = 0, l = vectors.length; i < l; i ++ ) { + + var vector = vectors[ i ]; + + if ( vector === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i ); + vector = new Vector2(); + + } + + array[ offset ++ ] = vector.x; + array[ offset ++ ] = vector.y; + + } + + return this; + + }, + + copyVector3sArray: function ( vectors ) { + + var array = this.array, offset = 0; + + for ( var i = 0, l = vectors.length; i < l; i ++ ) { + + var vector = vectors[ i ]; + + if ( vector === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i ); + vector = new Vector3(); + + } + + array[ offset ++ ] = vector.x; + array[ offset ++ ] = vector.y; + array[ offset ++ ] = vector.z; + + } + + return this; + + }, + + copyVector4sArray: function ( vectors ) { + + var array = this.array, offset = 0; + + for ( var i = 0, l = vectors.length; i < l; i ++ ) { + + var vector = vectors[ i ]; + + if ( vector === undefined ) { + + console.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i ); + vector = new Vector4(); + + } + + array[ offset ++ ] = vector.x; + array[ offset ++ ] = vector.y; + array[ offset ++ ] = vector.z; + array[ offset ++ ] = vector.w; + + } + + return this; + + }, + + set: function ( value, offset ) { + + if ( offset === undefined ) offset = 0; + + this.array.set( value, offset ); + + return this; + + }, + + getX: function ( index ) { + + return this.array[ index * this.itemSize ]; + + }, + + setX: function ( index, x ) { + + this.array[ index * this.itemSize ] = x; + + return this; + + }, + + getY: function ( index ) { + + return this.array[ index * this.itemSize + 1 ]; + + }, + + setY: function ( index, y ) { + + this.array[ index * this.itemSize + 1 ] = y; + + return this; + + }, + + getZ: function ( index ) { + + return this.array[ index * this.itemSize + 2 ]; + + }, + + setZ: function ( index, z ) { + + this.array[ index * this.itemSize + 2 ] = z; + + return this; + + }, + + getW: function ( index ) { + + return this.array[ index * this.itemSize + 3 ]; + + }, + + setW: function ( index, w ) { + + this.array[ index * this.itemSize + 3 ] = w; + + return this; + + }, + + setXY: function ( index, x, y ) { + + index *= this.itemSize; + + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + + return this; + + }, + + setXYZ: function ( index, x, y, z ) { + + index *= this.itemSize; + + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + this.array[ index + 2 ] = z; + + return this; + + }, + + setXYZW: function ( index, x, y, z, w ) { + + index *= this.itemSize; + + this.array[ index + 0 ] = x; + this.array[ index + 1 ] = y; + this.array[ index + 2 ] = z; + this.array[ index + 3 ] = w; + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + } + + }; + + // + + function Int8Attribute( array, itemSize ) { + + return new BufferAttribute( new Int8Array( array ), itemSize ); + + } + + function Uint8Attribute( array, itemSize ) { + + return new BufferAttribute( new Uint8Array( array ), itemSize ); + + } + + function Uint8ClampedAttribute( array, itemSize ) { + + return new BufferAttribute( new Uint8ClampedArray( array ), itemSize ); + + } + + function Int16Attribute( array, itemSize ) { + + return new BufferAttribute( new Int16Array( array ), itemSize ); + + } + + function Uint16Attribute( array, itemSize ) { + + return new BufferAttribute( new Uint16Array( array ), itemSize ); + + } + + function Int32Attribute( array, itemSize ) { + + return new BufferAttribute( new Int32Array( array ), itemSize ); + + } + + function Uint32Attribute( array, itemSize ) { + + return new BufferAttribute( new Uint32Array( array ), itemSize ); + + } + + function Float32Attribute( array, itemSize ) { + + return new BufferAttribute( new Float32Array( array ), itemSize ); + + } + + function Float64Attribute( array, itemSize ) { + + return new BufferAttribute( new Float64Array( array ), itemSize ); + + } + + // Deprecated + + function DynamicBufferAttribute( array, itemSize ) { + + console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.' ); + return new BufferAttribute( array, itemSize ).setDynamic( true ); + + } + + /** + * @author mrdoob / http://mrdoob.com/ + * @author kile / http://kile.stravaganza.org/ + * @author alteredq / http://alteredqualia.com/ + * @author mikael emtinger / http://gomo.se/ + * @author zz85 / http://www.lab4games.net/zz85/blog + * @author bhouston / http://clara.io + */ + + function Geometry() { + + Object.defineProperty( this, 'id', { value: GeometryIdCount() } ); + + this.uuid = _Math.generateUUID(); + + this.name = ''; + this.type = 'Geometry'; + + this.vertices = []; + this.colors = []; + this.faces = []; + this.faceVertexUvs = [ [] ]; + + this.morphTargets = []; + this.morphNormals = []; + + this.skinWeights = []; + this.skinIndices = []; + + this.lineDistances = []; + + this.boundingBox = null; + this.boundingSphere = null; + + // update flags + + this.elementsNeedUpdate = false; + this.verticesNeedUpdate = false; + this.uvsNeedUpdate = false; + this.normalsNeedUpdate = false; + this.colorsNeedUpdate = false; + this.lineDistancesNeedUpdate = false; + this.groupsNeedUpdate = false; + + } + + Object.assign( Geometry.prototype, EventDispatcher.prototype, { + + isGeometry: true, + + applyMatrix: function ( matrix ) { + + var normalMatrix = new Matrix3().getNormalMatrix( matrix ); + + for ( var i = 0, il = this.vertices.length; i < il; i ++ ) { + + var vertex = this.vertices[ i ]; + vertex.applyMatrix4( matrix ); + + } + + for ( var i = 0, il = this.faces.length; i < il; i ++ ) { + + var face = this.faces[ i ]; + face.normal.applyMatrix3( normalMatrix ).normalize(); + + for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) { + + face.vertexNormals[ j ].applyMatrix3( normalMatrix ).normalize(); + + } + + } + + if ( this.boundingBox !== null ) { + + this.computeBoundingBox(); + + } + + if ( this.boundingSphere !== null ) { + + this.computeBoundingSphere(); + + } + + this.verticesNeedUpdate = true; + this.normalsNeedUpdate = true; + + return this; + + }, + + rotateX: function () { + + // rotate geometry around world x-axis + + var m1; + + return function rotateX( angle ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeRotationX( angle ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + rotateY: function () { + + // rotate geometry around world y-axis + + var m1; + + return function rotateY( angle ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeRotationY( angle ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + rotateZ: function () { + + // rotate geometry around world z-axis + + var m1; + + return function rotateZ( angle ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeRotationZ( angle ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + translate: function () { + + // translate geometry + + var m1; + + return function translate( x, y, z ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeTranslation( x, y, z ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + scale: function () { + + // scale geometry + + var m1; + + return function scale( x, y, z ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeScale( x, y, z ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + lookAt: function () { + + var obj; + + return function lookAt( vector ) { + + if ( obj === undefined ) obj = new Object3D(); + + obj.lookAt( vector ); + + obj.updateMatrix(); + + this.applyMatrix( obj.matrix ); + + }; + + }(), + + fromBufferGeometry: function ( geometry ) { + + var scope = this; + + var indices = geometry.index !== null ? geometry.index.array : undefined; + var attributes = geometry.attributes; + + var positions = attributes.position.array; + var normals = attributes.normal !== undefined ? attributes.normal.array : undefined; + var colors = attributes.color !== undefined ? attributes.color.array : undefined; + var uvs = attributes.uv !== undefined ? attributes.uv.array : undefined; + var uvs2 = attributes.uv2 !== undefined ? attributes.uv2.array : undefined; + + if ( uvs2 !== undefined ) this.faceVertexUvs[ 1 ] = []; + + var tempNormals = []; + var tempUVs = []; + var tempUVs2 = []; + + for ( var i = 0, j = 0; i < positions.length; i += 3, j += 2 ) { + + scope.vertices.push( new Vector3( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ) ); + + if ( normals !== undefined ) { + + tempNormals.push( new Vector3( normals[ i ], normals[ i + 1 ], normals[ i + 2 ] ) ); + + } + + if ( colors !== undefined ) { + + scope.colors.push( new Color( colors[ i ], colors[ i + 1 ], colors[ i + 2 ] ) ); + + } + + if ( uvs !== undefined ) { + + tempUVs.push( new Vector2( uvs[ j ], uvs[ j + 1 ] ) ); + + } + + if ( uvs2 !== undefined ) { + + tempUVs2.push( new Vector2( uvs2[ j ], uvs2[ j + 1 ] ) ); + + } + + } + + function addFace( a, b, c, materialIndex ) { + + var vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : []; + var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : []; + + var face = new Face3( a, b, c, vertexNormals, vertexColors, materialIndex ); + + scope.faces.push( face ); + + if ( uvs !== undefined ) { + + scope.faceVertexUvs[ 0 ].push( [ tempUVs[ a ].clone(), tempUVs[ b ].clone(), tempUVs[ c ].clone() ] ); + + } + + if ( uvs2 !== undefined ) { + + scope.faceVertexUvs[ 1 ].push( [ tempUVs2[ a ].clone(), tempUVs2[ b ].clone(), tempUVs2[ c ].clone() ] ); + + } + + } + + if ( indices !== undefined ) { + + var groups = geometry.groups; + + if ( groups.length > 0 ) { + + for ( var i = 0; i < groups.length; i ++ ) { + + var group = groups[ i ]; + + var start = group.start; + var count = group.count; + + for ( var j = start, jl = start + count; j < jl; j += 3 ) { + + addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex ); + + } + + } + + } else { + + for ( var i = 0; i < indices.length; i += 3 ) { + + addFace( indices[ i ], indices[ i + 1 ], indices[ i + 2 ] ); + + } + + } + + } else { + + for ( var i = 0; i < positions.length / 3; i += 3 ) { + + addFace( i, i + 1, i + 2 ); + + } + + } + + this.computeFaceNormals(); + + if ( geometry.boundingBox !== null ) { + + this.boundingBox = geometry.boundingBox.clone(); + + } + + if ( geometry.boundingSphere !== null ) { + + this.boundingSphere = geometry.boundingSphere.clone(); + + } + + return this; + + }, + + center: function () { + + this.computeBoundingBox(); + + var offset = this.boundingBox.getCenter().negate(); + + this.translate( offset.x, offset.y, offset.z ); + + return offset; + + }, + + normalize: function () { + + this.computeBoundingSphere(); + + var center = this.boundingSphere.center; + var radius = this.boundingSphere.radius; + + var s = radius === 0 ? 1 : 1.0 / radius; + + var matrix = new Matrix4(); + matrix.set( + s, 0, 0, - s * center.x, + 0, s, 0, - s * center.y, + 0, 0, s, - s * center.z, + 0, 0, 0, 1 + ); + + this.applyMatrix( matrix ); + + return this; + + }, + + computeFaceNormals: function () { + + var cb = new Vector3(), ab = new Vector3(); + + for ( var f = 0, fl = this.faces.length; f < fl; f ++ ) { + + var face = this.faces[ f ]; + + var vA = this.vertices[ face.a ]; + var vB = this.vertices[ face.b ]; + var vC = this.vertices[ face.c ]; + + cb.subVectors( vC, vB ); + ab.subVectors( vA, vB ); + cb.cross( ab ); + + cb.normalize(); + + face.normal.copy( cb ); + + } + + }, + + computeVertexNormals: function ( areaWeighted ) { + + if ( areaWeighted === undefined ) areaWeighted = true; + + var v, vl, f, fl, face, vertices; + + vertices = new Array( this.vertices.length ); + + for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { + + vertices[ v ] = new Vector3(); + + } + + if ( areaWeighted ) { + + // vertex normals weighted by triangle areas + // http://www.iquilezles.org/www/articles/normals/normals.htm + + var vA, vB, vC; + var cb = new Vector3(), ab = new Vector3(); + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + face = this.faces[ f ]; + + vA = this.vertices[ face.a ]; + vB = this.vertices[ face.b ]; + vC = this.vertices[ face.c ]; + + cb.subVectors( vC, vB ); + ab.subVectors( vA, vB ); + cb.cross( ab ); + + vertices[ face.a ].add( cb ); + vertices[ face.b ].add( cb ); + vertices[ face.c ].add( cb ); + + } + + } else { + + this.computeFaceNormals(); + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + face = this.faces[ f ]; + + vertices[ face.a ].add( face.normal ); + vertices[ face.b ].add( face.normal ); + vertices[ face.c ].add( face.normal ); + + } + + } + + for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { + + vertices[ v ].normalize(); + + } + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + face = this.faces[ f ]; + + var vertexNormals = face.vertexNormals; + + if ( vertexNormals.length === 3 ) { + + vertexNormals[ 0 ].copy( vertices[ face.a ] ); + vertexNormals[ 1 ].copy( vertices[ face.b ] ); + vertexNormals[ 2 ].copy( vertices[ face.c ] ); + + } else { + + vertexNormals[ 0 ] = vertices[ face.a ].clone(); + vertexNormals[ 1 ] = vertices[ face.b ].clone(); + vertexNormals[ 2 ] = vertices[ face.c ].clone(); + + } + + } + + if ( this.faces.length > 0 ) { + + this.normalsNeedUpdate = true; + + } + + }, + + computeFlatVertexNormals: function () { + + var f, fl, face; + + this.computeFaceNormals(); + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + face = this.faces[ f ]; + + var vertexNormals = face.vertexNormals; + + if ( vertexNormals.length === 3 ) { + + vertexNormals[ 0 ].copy( face.normal ); + vertexNormals[ 1 ].copy( face.normal ); + vertexNormals[ 2 ].copy( face.normal ); + + } else { + + vertexNormals[ 0 ] = face.normal.clone(); + vertexNormals[ 1 ] = face.normal.clone(); + vertexNormals[ 2 ] = face.normal.clone(); + + } + + } + + if ( this.faces.length > 0 ) { + + this.normalsNeedUpdate = true; + + } + + }, + + computeMorphNormals: function () { + + var i, il, f, fl, face; + + // save original normals + // - create temp variables on first access + // otherwise just copy (for faster repeated calls) + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + face = this.faces[ f ]; + + if ( ! face.__originalFaceNormal ) { + + face.__originalFaceNormal = face.normal.clone(); + + } else { + + face.__originalFaceNormal.copy( face.normal ); + + } + + if ( ! face.__originalVertexNormals ) face.__originalVertexNormals = []; + + for ( i = 0, il = face.vertexNormals.length; i < il; i ++ ) { + + if ( ! face.__originalVertexNormals[ i ] ) { + + face.__originalVertexNormals[ i ] = face.vertexNormals[ i ].clone(); + + } else { + + face.__originalVertexNormals[ i ].copy( face.vertexNormals[ i ] ); + + } + + } + + } + + // use temp geometry to compute face and vertex normals for each morph + + var tmpGeo = new Geometry(); + tmpGeo.faces = this.faces; + + for ( i = 0, il = this.morphTargets.length; i < il; i ++ ) { + + // create on first access + + if ( ! this.morphNormals[ i ] ) { + + this.morphNormals[ i ] = {}; + this.morphNormals[ i ].faceNormals = []; + this.morphNormals[ i ].vertexNormals = []; + + var dstNormalsFace = this.morphNormals[ i ].faceNormals; + var dstNormalsVertex = this.morphNormals[ i ].vertexNormals; + + var faceNormal, vertexNormals; + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + faceNormal = new Vector3(); + vertexNormals = { a: new Vector3(), b: new Vector3(), c: new Vector3() }; + + dstNormalsFace.push( faceNormal ); + dstNormalsVertex.push( vertexNormals ); + + } + + } + + var morphNormals = this.morphNormals[ i ]; + + // set vertices to morph target + + tmpGeo.vertices = this.morphTargets[ i ].vertices; + + // compute morph normals + + tmpGeo.computeFaceNormals(); + tmpGeo.computeVertexNormals(); + + // store morph normals + + var faceNormal, vertexNormals; + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + face = this.faces[ f ]; + + faceNormal = morphNormals.faceNormals[ f ]; + vertexNormals = morphNormals.vertexNormals[ f ]; + + faceNormal.copy( face.normal ); + + vertexNormals.a.copy( face.vertexNormals[ 0 ] ); + vertexNormals.b.copy( face.vertexNormals[ 1 ] ); + vertexNormals.c.copy( face.vertexNormals[ 2 ] ); + + } + + } + + // restore original normals + + for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { + + face = this.faces[ f ]; + + face.normal = face.__originalFaceNormal; + face.vertexNormals = face.__originalVertexNormals; + + } + + }, + + computeTangents: function () { + + console.warn( 'THREE.Geometry: .computeTangents() has been removed.' ); + + }, + + computeLineDistances: function () { + + var d = 0; + var vertices = this.vertices; + + for ( var i = 0, il = vertices.length; i < il; i ++ ) { + + if ( i > 0 ) { + + d += vertices[ i ].distanceTo( vertices[ i - 1 ] ); + + } + + this.lineDistances[ i ] = d; + + } + + }, + + computeBoundingBox: function () { + + if ( this.boundingBox === null ) { + + this.boundingBox = new Box3(); + + } + + this.boundingBox.setFromPoints( this.vertices ); + + }, + + computeBoundingSphere: function () { + + if ( this.boundingSphere === null ) { + + this.boundingSphere = new Sphere(); + + } + + this.boundingSphere.setFromPoints( this.vertices ); + + }, + + merge: function ( geometry, matrix, materialIndexOffset ) { + + if ( (geometry && geometry.isGeometry) === false ) { + + console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry ); + return; + + } + + var normalMatrix, + vertexOffset = this.vertices.length, + vertices1 = this.vertices, + vertices2 = geometry.vertices, + faces1 = this.faces, + faces2 = geometry.faces, + uvs1 = this.faceVertexUvs[ 0 ], + uvs2 = geometry.faceVertexUvs[ 0 ], + colors1 = this.colors, + colors2 = geometry.colors; + + if ( materialIndexOffset === undefined ) materialIndexOffset = 0; + + if ( matrix !== undefined ) { + + normalMatrix = new Matrix3().getNormalMatrix( matrix ); + + } + + // vertices + + for ( var i = 0, il = vertices2.length; i < il; i ++ ) { + + var vertex = vertices2[ i ]; + + var vertexCopy = vertex.clone(); + + if ( matrix !== undefined ) vertexCopy.applyMatrix4( matrix ); + + vertices1.push( vertexCopy ); + + } + + // colors + + for ( var i = 0, il = colors2.length; i < il; i ++ ) { + + colors1.push( colors2[ i ].clone() ); + + } + + // faces + + for ( i = 0, il = faces2.length; i < il; i ++ ) { + + var face = faces2[ i ], faceCopy, normal, color, + faceVertexNormals = face.vertexNormals, + faceVertexColors = face.vertexColors; + + faceCopy = new Face3( face.a + vertexOffset, face.b + vertexOffset, face.c + vertexOffset ); + faceCopy.normal.copy( face.normal ); + + if ( normalMatrix !== undefined ) { + + faceCopy.normal.applyMatrix3( normalMatrix ).normalize(); + + } + + for ( var j = 0, jl = faceVertexNormals.length; j < jl; j ++ ) { + + normal = faceVertexNormals[ j ].clone(); + + if ( normalMatrix !== undefined ) { + + normal.applyMatrix3( normalMatrix ).normalize(); + + } + + faceCopy.vertexNormals.push( normal ); + + } + + faceCopy.color.copy( face.color ); + + for ( var j = 0, jl = faceVertexColors.length; j < jl; j ++ ) { + + color = faceVertexColors[ j ]; + faceCopy.vertexColors.push( color.clone() ); + + } + + faceCopy.materialIndex = face.materialIndex + materialIndexOffset; + + faces1.push( faceCopy ); + + } + + // uvs + + for ( i = 0, il = uvs2.length; i < il; i ++ ) { + + var uv = uvs2[ i ], uvCopy = []; + + if ( uv === undefined ) { + + continue; + + } + + for ( var j = 0, jl = uv.length; j < jl; j ++ ) { + + uvCopy.push( uv[ j ].clone() ); + + } + + uvs1.push( uvCopy ); + + } + + }, + + mergeMesh: function ( mesh ) { + + if ( (mesh && mesh.isMesh) === false ) { + + console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh ); + return; + + } + + mesh.matrixAutoUpdate && mesh.updateMatrix(); + + this.merge( mesh.geometry, mesh.matrix ); + + }, + + /* + * Checks for duplicate vertices with hashmap. + * Duplicated vertices are removed + * and faces' vertices are updated. + */ + + mergeVertices: function () { + + var verticesMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique) + var unique = [], changes = []; + + var v, key; + var precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001 + var precision = Math.pow( 10, precisionPoints ); + var i, il, face; + var indices, j, jl; + + for ( i = 0, il = this.vertices.length; i < il; i ++ ) { + + v = this.vertices[ i ]; + key = Math.round( v.x * precision ) + '_' + Math.round( v.y * precision ) + '_' + Math.round( v.z * precision ); + + if ( verticesMap[ key ] === undefined ) { + + verticesMap[ key ] = i; + unique.push( this.vertices[ i ] ); + changes[ i ] = unique.length - 1; + + } else { + + //console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]); + changes[ i ] = changes[ verticesMap[ key ] ]; + + } + + } + + + // if faces are completely degenerate after merging vertices, we + // have to remove them from the geometry. + var faceIndicesToRemove = []; + + for ( i = 0, il = this.faces.length; i < il; i ++ ) { + + face = this.faces[ i ]; + + face.a = changes[ face.a ]; + face.b = changes[ face.b ]; + face.c = changes[ face.c ]; + + indices = [ face.a, face.b, face.c ]; + + var dupIndex = - 1; + + // if any duplicate vertices are found in a Face3 + // we have to remove the face as nothing can be saved + for ( var n = 0; n < 3; n ++ ) { + + if ( indices[ n ] === indices[ ( n + 1 ) % 3 ] ) { + + dupIndex = n; + faceIndicesToRemove.push( i ); + break; + + } + + } + + } + + for ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) { + + var idx = faceIndicesToRemove[ i ]; + + this.faces.splice( idx, 1 ); + + for ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) { + + this.faceVertexUvs[ j ].splice( idx, 1 ); + + } + + } + + // Use unique set of vertices + + var diff = this.vertices.length - unique.length; + this.vertices = unique; + return diff; + + }, + + sortFacesByMaterialIndex: function () { + + var faces = this.faces; + var length = faces.length; + + // tag faces + + for ( var i = 0; i < length; i ++ ) { + + faces[ i ]._id = i; + + } + + // sort faces + + function materialIndexSort( a, b ) { + + return a.materialIndex - b.materialIndex; + + } + + faces.sort( materialIndexSort ); + + // sort uvs + + var uvs1 = this.faceVertexUvs[ 0 ]; + var uvs2 = this.faceVertexUvs[ 1 ]; + + var newUvs1, newUvs2; + + if ( uvs1 && uvs1.length === length ) newUvs1 = []; + if ( uvs2 && uvs2.length === length ) newUvs2 = []; + + for ( var i = 0; i < length; i ++ ) { + + var id = faces[ i ]._id; + + if ( newUvs1 ) newUvs1.push( uvs1[ id ] ); + if ( newUvs2 ) newUvs2.push( uvs2[ id ] ); + + } + + if ( newUvs1 ) this.faceVertexUvs[ 0 ] = newUvs1; + if ( newUvs2 ) this.faceVertexUvs[ 1 ] = newUvs2; + + }, + + toJSON: function () { + + var data = { + metadata: { + version: 4.4, + type: 'Geometry', + generator: 'Geometry.toJSON' + } + }; + + // standard Geometry serialization + + data.uuid = this.uuid; + data.type = this.type; + if ( this.name !== '' ) data.name = this.name; + + if ( this.parameters !== undefined ) { + + var parameters = this.parameters; + + for ( var key in parameters ) { + + if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; + + } + + return data; + + } + + var vertices = []; + + for ( var i = 0; i < this.vertices.length; i ++ ) { + + var vertex = this.vertices[ i ]; + vertices.push( vertex.x, vertex.y, vertex.z ); + + } + + var faces = []; + var normals = []; + var normalsHash = {}; + var colors = []; + var colorsHash = {}; + var uvs = []; + var uvsHash = {}; + + for ( var i = 0; i < this.faces.length; i ++ ) { + + var face = this.faces[ i ]; + + var hasMaterial = true; + var hasFaceUv = false; // deprecated + var hasFaceVertexUv = this.faceVertexUvs[ 0 ][ i ] !== undefined; + var hasFaceNormal = face.normal.length() > 0; + var hasFaceVertexNormal = face.vertexNormals.length > 0; + var hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1; + var hasFaceVertexColor = face.vertexColors.length > 0; + + var faceType = 0; + + faceType = setBit( faceType, 0, 0 ); // isQuad + faceType = setBit( faceType, 1, hasMaterial ); + faceType = setBit( faceType, 2, hasFaceUv ); + faceType = setBit( faceType, 3, hasFaceVertexUv ); + faceType = setBit( faceType, 4, hasFaceNormal ); + faceType = setBit( faceType, 5, hasFaceVertexNormal ); + faceType = setBit( faceType, 6, hasFaceColor ); + faceType = setBit( faceType, 7, hasFaceVertexColor ); + + faces.push( faceType ); + faces.push( face.a, face.b, face.c ); + faces.push( face.materialIndex ); + + if ( hasFaceVertexUv ) { + + var faceVertexUvs = this.faceVertexUvs[ 0 ][ i ]; + + faces.push( + getUvIndex( faceVertexUvs[ 0 ] ), + getUvIndex( faceVertexUvs[ 1 ] ), + getUvIndex( faceVertexUvs[ 2 ] ) + ); + + } + + if ( hasFaceNormal ) { + + faces.push( getNormalIndex( face.normal ) ); + + } + + if ( hasFaceVertexNormal ) { + + var vertexNormals = face.vertexNormals; + + faces.push( + getNormalIndex( vertexNormals[ 0 ] ), + getNormalIndex( vertexNormals[ 1 ] ), + getNormalIndex( vertexNormals[ 2 ] ) + ); + + } + + if ( hasFaceColor ) { + + faces.push( getColorIndex( face.color ) ); + + } + + if ( hasFaceVertexColor ) { + + var vertexColors = face.vertexColors; + + faces.push( + getColorIndex( vertexColors[ 0 ] ), + getColorIndex( vertexColors[ 1 ] ), + getColorIndex( vertexColors[ 2 ] ) + ); + + } + + } + + function setBit( value, position, enabled ) { + + return enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position ) ); + + } + + function getNormalIndex( normal ) { + + var hash = normal.x.toString() + normal.y.toString() + normal.z.toString(); + + if ( normalsHash[ hash ] !== undefined ) { + + return normalsHash[ hash ]; + + } + + normalsHash[ hash ] = normals.length / 3; + normals.push( normal.x, normal.y, normal.z ); + + return normalsHash[ hash ]; + + } + + function getColorIndex( color ) { + + var hash = color.r.toString() + color.g.toString() + color.b.toString(); + + if ( colorsHash[ hash ] !== undefined ) { + + return colorsHash[ hash ]; + + } + + colorsHash[ hash ] = colors.length; + colors.push( color.getHex() ); + + return colorsHash[ hash ]; + + } + + function getUvIndex( uv ) { + + var hash = uv.x.toString() + uv.y.toString(); + + if ( uvsHash[ hash ] !== undefined ) { + + return uvsHash[ hash ]; + + } + + uvsHash[ hash ] = uvs.length / 2; + uvs.push( uv.x, uv.y ); + + return uvsHash[ hash ]; + + } + + data.data = {}; + + data.data.vertices = vertices; + data.data.normals = normals; + if ( colors.length > 0 ) data.data.colors = colors; + if ( uvs.length > 0 ) data.data.uvs = [ uvs ]; // temporal backward compatibility + data.data.faces = faces; + + return data; + + }, + + clone: function () { + + /* + // Handle primitives + + var parameters = this.parameters; + + if ( parameters !== undefined ) { + + var values = []; + + for ( var key in parameters ) { + + values.push( parameters[ key ] ); + + } + + var geometry = Object.create( this.constructor.prototype ); + this.constructor.apply( geometry, values ); + return geometry; + + } + + return new this.constructor().copy( this ); + */ + + return new Geometry().copy( this ); + + }, + + copy: function ( source ) { + + this.vertices = []; + this.faces = []; + this.faceVertexUvs = [ [] ]; + this.colors = []; + + var vertices = source.vertices; + + for ( var i = 0, il = vertices.length; i < il; i ++ ) { + + this.vertices.push( vertices[ i ].clone() ); + + } + + var colors = source.colors; + + for ( var i = 0, il = colors.length; i < il; i ++ ) { + + this.colors.push( colors[ i ].clone() ); + + } + + var faces = source.faces; + + for ( var i = 0, il = faces.length; i < il; i ++ ) { + + this.faces.push( faces[ i ].clone() ); + + } + + for ( var i = 0, il = source.faceVertexUvs.length; i < il; i ++ ) { + + var faceVertexUvs = source.faceVertexUvs[ i ]; + + if ( this.faceVertexUvs[ i ] === undefined ) { + + this.faceVertexUvs[ i ] = []; + + } + + for ( var j = 0, jl = faceVertexUvs.length; j < jl; j ++ ) { + + var uvs = faceVertexUvs[ j ], uvsCopy = []; + + for ( var k = 0, kl = uvs.length; k < kl; k ++ ) { + + var uv = uvs[ k ]; + + uvsCopy.push( uv.clone() ); + + } + + this.faceVertexUvs[ i ].push( uvsCopy ); + + } + + } + + return this; + + }, + + dispose: function () { + + this.dispatchEvent( { type: 'dispose' } ); + + } + + } ); + + var count$3 = 0; + function GeometryIdCount() { return count$3++; } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function DirectGeometry() { + + Object.defineProperty( this, 'id', { value: GeometryIdCount() } ); + + this.uuid = _Math.generateUUID(); + + this.name = ''; + this.type = 'DirectGeometry'; + + this.indices = []; + this.vertices = []; + this.normals = []; + this.colors = []; + this.uvs = []; + this.uvs2 = []; + + this.groups = []; + + this.morphTargets = {}; + + this.skinWeights = []; + this.skinIndices = []; + + // this.lineDistances = []; + + this.boundingBox = null; + this.boundingSphere = null; + + // update flags + + this.verticesNeedUpdate = false; + this.normalsNeedUpdate = false; + this.colorsNeedUpdate = false; + this.uvsNeedUpdate = false; + this.groupsNeedUpdate = false; + + } + + Object.assign( DirectGeometry.prototype, EventDispatcher.prototype, { + + computeBoundingBox: Geometry.prototype.computeBoundingBox, + computeBoundingSphere: Geometry.prototype.computeBoundingSphere, + + computeFaceNormals: function () { + + console.warn( 'THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.' ); + + }, + + computeVertexNormals: function () { + + console.warn( 'THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.' ); + + }, + + computeGroups: function ( geometry ) { + + var group; + var groups = []; + var materialIndex; + + var faces = geometry.faces; + + for ( var i = 0; i < faces.length; i ++ ) { + + var face = faces[ i ]; + + // materials + + if ( face.materialIndex !== materialIndex ) { + + materialIndex = face.materialIndex; + + if ( group !== undefined ) { + + group.count = ( i * 3 ) - group.start; + groups.push( group ); + + } + + group = { + start: i * 3, + materialIndex: materialIndex + }; + + } + + } + + if ( group !== undefined ) { + + group.count = ( i * 3 ) - group.start; + groups.push( group ); + + } + + this.groups = groups; + + }, + + fromGeometry: function ( geometry ) { + + var faces = geometry.faces; + var vertices = geometry.vertices; + var faceVertexUvs = geometry.faceVertexUvs; + + var hasFaceVertexUv = faceVertexUvs[ 0 ] && faceVertexUvs[ 0 ].length > 0; + var hasFaceVertexUv2 = faceVertexUvs[ 1 ] && faceVertexUvs[ 1 ].length > 0; + + // morphs + + var morphTargets = geometry.morphTargets; + var morphTargetsLength = morphTargets.length; + + var morphTargetsPosition; + + if ( morphTargetsLength > 0 ) { + + morphTargetsPosition = []; + + for ( var i = 0; i < morphTargetsLength; i ++ ) { + + morphTargetsPosition[ i ] = []; + + } + + this.morphTargets.position = morphTargetsPosition; + + } + + var morphNormals = geometry.morphNormals; + var morphNormalsLength = morphNormals.length; + + var morphTargetsNormal; + + if ( morphNormalsLength > 0 ) { + + morphTargetsNormal = []; + + for ( var i = 0; i < morphNormalsLength; i ++ ) { + + morphTargetsNormal[ i ] = []; + + } + + this.morphTargets.normal = morphTargetsNormal; + + } + + // skins + + var skinIndices = geometry.skinIndices; + var skinWeights = geometry.skinWeights; + + var hasSkinIndices = skinIndices.length === vertices.length; + var hasSkinWeights = skinWeights.length === vertices.length; + + // + + for ( var i = 0; i < faces.length; i ++ ) { + + var face = faces[ i ]; + + this.vertices.push( vertices[ face.a ], vertices[ face.b ], vertices[ face.c ] ); + + var vertexNormals = face.vertexNormals; + + if ( vertexNormals.length === 3 ) { + + this.normals.push( vertexNormals[ 0 ], vertexNormals[ 1 ], vertexNormals[ 2 ] ); + + } else { + + var normal = face.normal; + + this.normals.push( normal, normal, normal ); + + } + + var vertexColors = face.vertexColors; + + if ( vertexColors.length === 3 ) { + + this.colors.push( vertexColors[ 0 ], vertexColors[ 1 ], vertexColors[ 2 ] ); + + } else { + + var color = face.color; + + this.colors.push( color, color, color ); + + } + + if ( hasFaceVertexUv === true ) { + + var vertexUvs = faceVertexUvs[ 0 ][ i ]; + + if ( vertexUvs !== undefined ) { + + this.uvs.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] ); + + } else { + + console.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', i ); + + this.uvs.push( new Vector2(), new Vector2(), new Vector2() ); + + } + + } + + if ( hasFaceVertexUv2 === true ) { + + var vertexUvs = faceVertexUvs[ 1 ][ i ]; + + if ( vertexUvs !== undefined ) { + + this.uvs2.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] ); + + } else { + + console.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', i ); + + this.uvs2.push( new Vector2(), new Vector2(), new Vector2() ); + + } + + } + + // morphs + + for ( var j = 0; j < morphTargetsLength; j ++ ) { + + var morphTarget = morphTargets[ j ].vertices; + + morphTargetsPosition[ j ].push( morphTarget[ face.a ], morphTarget[ face.b ], morphTarget[ face.c ] ); + + } + + for ( var j = 0; j < morphNormalsLength; j ++ ) { + + var morphNormal = morphNormals[ j ].vertexNormals[ i ]; + + morphTargetsNormal[ j ].push( morphNormal.a, morphNormal.b, morphNormal.c ); + + } + + // skins + + if ( hasSkinIndices ) { + + this.skinIndices.push( skinIndices[ face.a ], skinIndices[ face.b ], skinIndices[ face.c ] ); + + } + + if ( hasSkinWeights ) { + + this.skinWeights.push( skinWeights[ face.a ], skinWeights[ face.b ], skinWeights[ face.c ] ); + + } + + } + + this.computeGroups( geometry ); + + this.verticesNeedUpdate = geometry.verticesNeedUpdate; + this.normalsNeedUpdate = geometry.normalsNeedUpdate; + this.colorsNeedUpdate = geometry.colorsNeedUpdate; + this.uvsNeedUpdate = geometry.uvsNeedUpdate; + this.groupsNeedUpdate = geometry.groupsNeedUpdate; + + return this; + + }, + + dispose: function () { + + this.dispatchEvent( { type: 'dispose' } ); + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + */ + + function BufferGeometry() { + + Object.defineProperty( this, 'id', { value: GeometryIdCount() } ); + + this.uuid = _Math.generateUUID(); + + this.name = ''; + this.type = 'BufferGeometry'; + + this.index = null; + this.attributes = {}; + + this.morphAttributes = {}; + + this.groups = []; + + this.boundingBox = null; + this.boundingSphere = null; + + this.drawRange = { start: 0, count: Infinity }; + + } + + Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, { + + isBufferGeometry: true, + + getIndex: function () { + + return this.index; + + }, + + setIndex: function ( index ) { + + this.index = index; + + }, + + addAttribute: function ( name, attribute ) { + + if ( (attribute && attribute.isBufferAttribute) === false && (attribute && attribute.isInterleavedBufferAttribute) === false ) { + + console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' ); + + this.addAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) ); + + return; + + } + + if ( name === 'index' ) { + + console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' ); + this.setIndex( attribute ); + + return; + + } + + this.attributes[ name ] = attribute; + + return this; + + }, + + getAttribute: function ( name ) { + + return this.attributes[ name ]; + + }, + + removeAttribute: function ( name ) { + + delete this.attributes[ name ]; + + return this; + + }, + + addGroup: function ( start, count, materialIndex ) { + + this.groups.push( { + + start: start, + count: count, + materialIndex: materialIndex !== undefined ? materialIndex : 0 + + } ); + + }, + + clearGroups: function () { + + this.groups = []; + + }, + + setDrawRange: function ( start, count ) { + + this.drawRange.start = start; + this.drawRange.count = count; + + }, + + applyMatrix: function ( matrix ) { + + var position = this.attributes.position; + + if ( position !== undefined ) { + + matrix.applyToVector3Array( position.array ); + position.needsUpdate = true; + + } + + var normal = this.attributes.normal; + + if ( normal !== undefined ) { + + var normalMatrix = new Matrix3().getNormalMatrix( matrix ); + + normalMatrix.applyToVector3Array( normal.array ); + normal.needsUpdate = true; + + } + + if ( this.boundingBox !== null ) { + + this.computeBoundingBox(); + + } + + if ( this.boundingSphere !== null ) { + + this.computeBoundingSphere(); + + } + + return this; + + }, + + rotateX: function () { + + // rotate geometry around world x-axis + + var m1; + + return function rotateX( angle ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeRotationX( angle ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + rotateY: function () { + + // rotate geometry around world y-axis + + var m1; + + return function rotateY( angle ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeRotationY( angle ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + rotateZ: function () { + + // rotate geometry around world z-axis + + var m1; + + return function rotateZ( angle ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeRotationZ( angle ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + translate: function () { + + // translate geometry + + var m1; + + return function translate( x, y, z ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeTranslation( x, y, z ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + scale: function () { + + // scale geometry + + var m1; + + return function scale( x, y, z ) { + + if ( m1 === undefined ) m1 = new Matrix4(); + + m1.makeScale( x, y, z ); + + this.applyMatrix( m1 ); + + return this; + + }; + + }(), + + lookAt: function () { + + var obj; + + return function lookAt( vector ) { + + if ( obj === undefined ) obj = new Object3D(); + + obj.lookAt( vector ); + + obj.updateMatrix(); + + this.applyMatrix( obj.matrix ); + + }; + + }(), + + center: function () { + + this.computeBoundingBox(); + + var offset = this.boundingBox.getCenter().negate(); + + this.translate( offset.x, offset.y, offset.z ); + + return offset; + + }, + + setFromObject: function ( object ) { + + // console.log( 'THREE.BufferGeometry.setFromObject(). Converting', object, this ); + + var geometry = object.geometry; + + if ( (object && object.isPoints) || (object && object.isLine) ) { + + var positions = new Float32Attribute( geometry.vertices.length * 3, 3 ); + var colors = new Float32Attribute( geometry.colors.length * 3, 3 ); + + this.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) ); + this.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) ); + + if ( geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length ) { + + var lineDistances = new Float32Attribute( geometry.lineDistances.length, 1 ); + + this.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) ); + + } + + if ( geometry.boundingSphere !== null ) { + + this.boundingSphere = geometry.boundingSphere.clone(); + + } + + if ( geometry.boundingBox !== null ) { + + this.boundingBox = geometry.boundingBox.clone(); + + } + + } else if ( (object && object.isMesh) ) { + + if ( (geometry && geometry.isGeometry) ) { + + this.fromGeometry( geometry ); + + } + + } + + return this; + + }, + + updateFromObject: function ( object ) { + + var geometry = object.geometry; + + if ( (object && object.isMesh) ) { + + var direct = geometry.__directGeometry; + + if ( geometry.elementsNeedUpdate === true ) { + + direct = undefined; + geometry.elementsNeedUpdate = false; + + } + + if ( direct === undefined ) { + + return this.fromGeometry( geometry ); + + } + + direct.verticesNeedUpdate = geometry.verticesNeedUpdate; + direct.normalsNeedUpdate = geometry.normalsNeedUpdate; + direct.colorsNeedUpdate = geometry.colorsNeedUpdate; + direct.uvsNeedUpdate = geometry.uvsNeedUpdate; + direct.groupsNeedUpdate = geometry.groupsNeedUpdate; + + geometry.verticesNeedUpdate = false; + geometry.normalsNeedUpdate = false; + geometry.colorsNeedUpdate = false; + geometry.uvsNeedUpdate = false; + geometry.groupsNeedUpdate = false; + + geometry = direct; + + } + + var attribute; + + if ( geometry.verticesNeedUpdate === true ) { + + attribute = this.attributes.position; + + if ( attribute !== undefined ) { + + attribute.copyVector3sArray( geometry.vertices ); + attribute.needsUpdate = true; + + } + + geometry.verticesNeedUpdate = false; + + } + + if ( geometry.normalsNeedUpdate === true ) { + + attribute = this.attributes.normal; + + if ( attribute !== undefined ) { + + attribute.copyVector3sArray( geometry.normals ); + attribute.needsUpdate = true; + + } + + geometry.normalsNeedUpdate = false; + + } + + if ( geometry.colorsNeedUpdate === true ) { + + attribute = this.attributes.color; + + if ( attribute !== undefined ) { + + attribute.copyColorsArray( geometry.colors ); + attribute.needsUpdate = true; + + } + + geometry.colorsNeedUpdate = false; + + } + + if ( geometry.uvsNeedUpdate ) { + + attribute = this.attributes.uv; + + if ( attribute !== undefined ) { + + attribute.copyVector2sArray( geometry.uvs ); + attribute.needsUpdate = true; + + } + + geometry.uvsNeedUpdate = false; + + } + + if ( geometry.lineDistancesNeedUpdate ) { + + attribute = this.attributes.lineDistance; + + if ( attribute !== undefined ) { + + attribute.copyArray( geometry.lineDistances ); + attribute.needsUpdate = true; + + } + + geometry.lineDistancesNeedUpdate = false; + + } + + if ( geometry.groupsNeedUpdate ) { + + geometry.computeGroups( object.geometry ); + this.groups = geometry.groups; + + geometry.groupsNeedUpdate = false; + + } + + return this; + + }, + + fromGeometry: function ( geometry ) { + + geometry.__directGeometry = new DirectGeometry().fromGeometry( geometry ); + + return this.fromDirectGeometry( geometry.__directGeometry ); + + }, + + fromDirectGeometry: function ( geometry ) { + + var positions = new Float32Array( geometry.vertices.length * 3 ); + this.addAttribute( 'position', new BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices ) ); + + if ( geometry.normals.length > 0 ) { + + var normals = new Float32Array( geometry.normals.length * 3 ); + this.addAttribute( 'normal', new BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) ); + + } + + if ( geometry.colors.length > 0 ) { + + var colors = new Float32Array( geometry.colors.length * 3 ); + this.addAttribute( 'color', new BufferAttribute( colors, 3 ).copyColorsArray( geometry.colors ) ); + + } + + if ( geometry.uvs.length > 0 ) { + + var uvs = new Float32Array( geometry.uvs.length * 2 ); + this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) ); + + } + + if ( geometry.uvs2.length > 0 ) { + + var uvs2 = new Float32Array( geometry.uvs2.length * 2 ); + this.addAttribute( 'uv2', new BufferAttribute( uvs2, 2 ).copyVector2sArray( geometry.uvs2 ) ); + + } + + if ( geometry.indices.length > 0 ) { + + var TypeArray = geometry.vertices.length > 65535 ? Uint32Array : Uint16Array; + var indices = new TypeArray( geometry.indices.length * 3 ); + this.setIndex( new BufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices ) ); + + } + + // groups + + this.groups = geometry.groups; + + // morphs + + for ( var name in geometry.morphTargets ) { + + var array = []; + var morphTargets = geometry.morphTargets[ name ]; + + for ( var i = 0, l = morphTargets.length; i < l; i ++ ) { + + var morphTarget = morphTargets[ i ]; + + var attribute = new Float32Attribute( morphTarget.length * 3, 3 ); + + array.push( attribute.copyVector3sArray( morphTarget ) ); + + } + + this.morphAttributes[ name ] = array; + + } + + // skinning + + if ( geometry.skinIndices.length > 0 ) { + + var skinIndices = new Float32Attribute( geometry.skinIndices.length * 4, 4 ); + this.addAttribute( 'skinIndex', skinIndices.copyVector4sArray( geometry.skinIndices ) ); + + } + + if ( geometry.skinWeights.length > 0 ) { + + var skinWeights = new Float32Attribute( geometry.skinWeights.length * 4, 4 ); + this.addAttribute( 'skinWeight', skinWeights.copyVector4sArray( geometry.skinWeights ) ); + + } + + // + + if ( geometry.boundingSphere !== null ) { + + this.boundingSphere = geometry.boundingSphere.clone(); + + } + + if ( geometry.boundingBox !== null ) { + + this.boundingBox = geometry.boundingBox.clone(); + + } + + return this; + + }, + + computeBoundingBox: function () { + + if ( this.boundingBox === null ) { + + this.boundingBox = new Box3(); + + } + + var positions = this.attributes.position.array; + + if ( positions !== undefined ) { + + this.boundingBox.setFromArray( positions ); + + } else { + + this.boundingBox.makeEmpty(); + + } + + if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { + + console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); + + } + + }, + + computeBoundingSphere: function () { + + var box = new Box3(); + var vector = new Vector3(); + + return function computeBoundingSphere() { + + if ( this.boundingSphere === null ) { + + this.boundingSphere = new Sphere(); + + } + + var positions = this.attributes.position; + + if ( positions ) { + + var array = positions.array; + var center = this.boundingSphere.center; + + box.setFromArray( array ); + box.getCenter( center ); + + // hoping to find a boundingSphere with a radius smaller than the + // boundingSphere of the boundingBox: sqrt(3) smaller in the best case + + var maxRadiusSq = 0; + + for ( var i = 0, il = array.length; i < il; i += 3 ) { + + vector.fromArray( array, i ); + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) ); + + } + + this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); + + if ( isNaN( this.boundingSphere.radius ) ) { + + console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this ); + + } + + } + + }; + + }(), + + computeFaceNormals: function () { + + // backwards compatibility + + }, + + computeVertexNormals: function () { + + var index = this.index; + var attributes = this.attributes; + var groups = this.groups; + + if ( attributes.position ) { + + var positions = attributes.position.array; + + if ( attributes.normal === undefined ) { + + this.addAttribute( 'normal', new BufferAttribute( new Float32Array( positions.length ), 3 ) ); + + } else { + + // reset existing normals to zero + + var array = attributes.normal.array; + + for ( var i = 0, il = array.length; i < il; i ++ ) { + + array[ i ] = 0; + + } + + } + + var normals = attributes.normal.array; + + var vA, vB, vC, + + pA = new Vector3(), + pB = new Vector3(), + pC = new Vector3(), + + cb = new Vector3(), + ab = new Vector3(); + + // indexed elements + + if ( index ) { + + var indices = index.array; + + if ( groups.length === 0 ) { + + this.addGroup( 0, indices.length ); + + } + + for ( var j = 0, jl = groups.length; j < jl; ++ j ) { + + var group = groups[ j ]; + + var start = group.start; + var count = group.count; + + for ( var i = start, il = start + count; i < il; i += 3 ) { + + vA = indices[ i + 0 ] * 3; + vB = indices[ i + 1 ] * 3; + vC = indices[ i + 2 ] * 3; + + pA.fromArray( positions, vA ); + pB.fromArray( positions, vB ); + pC.fromArray( positions, vC ); + + cb.subVectors( pC, pB ); + ab.subVectors( pA, pB ); + cb.cross( ab ); + + normals[ vA ] += cb.x; + normals[ vA + 1 ] += cb.y; + normals[ vA + 2 ] += cb.z; + + normals[ vB ] += cb.x; + normals[ vB + 1 ] += cb.y; + normals[ vB + 2 ] += cb.z; + + normals[ vC ] += cb.x; + normals[ vC + 1 ] += cb.y; + normals[ vC + 2 ] += cb.z; + + } + + } + + } else { + + // non-indexed elements (unconnected triangle soup) + + for ( var i = 0, il = positions.length; i < il; i += 9 ) { + + pA.fromArray( positions, i ); + pB.fromArray( positions, i + 3 ); + pC.fromArray( positions, i + 6 ); + + cb.subVectors( pC, pB ); + ab.subVectors( pA, pB ); + cb.cross( ab ); + + normals[ i ] = cb.x; + normals[ i + 1 ] = cb.y; + normals[ i + 2 ] = cb.z; + + normals[ i + 3 ] = cb.x; + normals[ i + 4 ] = cb.y; + normals[ i + 5 ] = cb.z; + + normals[ i + 6 ] = cb.x; + normals[ i + 7 ] = cb.y; + normals[ i + 8 ] = cb.z; + + } + + } + + this.normalizeNormals(); + + attributes.normal.needsUpdate = true; + + } + + }, + + merge: function ( geometry, offset ) { + + if ( (geometry && geometry.isBufferGeometry) === false ) { + + console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry ); + return; + + } + + if ( offset === undefined ) offset = 0; + + var attributes = this.attributes; + + for ( var key in attributes ) { + + if ( geometry.attributes[ key ] === undefined ) continue; + + var attribute1 = attributes[ key ]; + var attributeArray1 = attribute1.array; + + var attribute2 = geometry.attributes[ key ]; + var attributeArray2 = attribute2.array; + + var attributeSize = attribute2.itemSize; + + for ( var i = 0, j = attributeSize * offset; i < attributeArray2.length; i ++, j ++ ) { + + attributeArray1[ j ] = attributeArray2[ i ]; + + } + + } + + return this; + + }, + + normalizeNormals: function () { + + var normals = this.attributes.normal.array; + + var x, y, z, n; + + for ( var i = 0, il = normals.length; i < il; i += 3 ) { + + x = normals[ i ]; + y = normals[ i + 1 ]; + z = normals[ i + 2 ]; + + n = 1.0 / Math.sqrt( x * x + y * y + z * z ); + + normals[ i ] *= n; + normals[ i + 1 ] *= n; + normals[ i + 2 ] *= n; + + } + + }, + + toNonIndexed: function () { + + if ( this.index === null ) { + + console.warn( 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.' ); + return this; + + } + + var geometry2 = new BufferGeometry(); + + var indices = this.index.array; + var attributes = this.attributes; + + for ( var name in attributes ) { + + var attribute = attributes[ name ]; + + var array = attribute.array; + var itemSize = attribute.itemSize; + + var array2 = new array.constructor( indices.length * itemSize ); + + var index = 0, index2 = 0; + + for ( var i = 0, l = indices.length; i < l; i ++ ) { + + index = indices[ i ] * itemSize; + + for ( var j = 0; j < itemSize; j ++ ) { + + array2[ index2 ++ ] = array[ index ++ ]; + + } + + } + + geometry2.addAttribute( name, new BufferAttribute( array2, itemSize ) ); + + } + + return geometry2; + + }, + + toJSON: function () { + + var data = { + metadata: { + version: 4.4, + type: 'BufferGeometry', + generator: 'BufferGeometry.toJSON' + } + }; + + // standard BufferGeometry serialization + + data.uuid = this.uuid; + data.type = this.type; + if ( this.name !== '' ) data.name = this.name; + + if ( this.parameters !== undefined ) { + + var parameters = this.parameters; + + for ( var key in parameters ) { + + if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; + + } + + return data; + + } + + data.data = { attributes: {} }; + + var index = this.index; + + if ( index !== null ) { + + var array = Array.prototype.slice.call( index.array ); + + data.data.index = { + type: index.array.constructor.name, + array: array + }; + + } + + var attributes = this.attributes; + + for ( var key in attributes ) { + + var attribute = attributes[ key ]; + + var array = Array.prototype.slice.call( attribute.array ); + + data.data.attributes[ key ] = { + itemSize: attribute.itemSize, + type: attribute.array.constructor.name, + array: array, + normalized: attribute.normalized + }; + + } + + var groups = this.groups; + + if ( groups.length > 0 ) { + + data.data.groups = JSON.parse( JSON.stringify( groups ) ); + + } + + var boundingSphere = this.boundingSphere; + + if ( boundingSphere !== null ) { + + data.data.boundingSphere = { + center: boundingSphere.center.toArray(), + radius: boundingSphere.radius + }; + + } + + return data; + + }, + + clone: function () { + + /* + // Handle primitives + + var parameters = this.parameters; + + if ( parameters !== undefined ) { + + var values = []; + + for ( var key in parameters ) { + + values.push( parameters[ key ] ); + + } + + var geometry = Object.create( this.constructor.prototype ); + this.constructor.apply( geometry, values ); + return geometry; + + } + + return new this.constructor().copy( this ); + */ + + return new BufferGeometry().copy( this ); + + }, + + copy: function ( source ) { + + var index = source.index; + + if ( index !== null ) { + + this.setIndex( index.clone() ); + + } + + var attributes = source.attributes; + + for ( var name in attributes ) { + + var attribute = attributes[ name ]; + this.addAttribute( name, attribute.clone() ); + + } + + var groups = source.groups; + + for ( var i = 0, l = groups.length; i < l; i ++ ) { + + var group = groups[ i ]; + this.addGroup( group.start, group.count, group.materialIndex ); + + } + + return this; + + }, + + dispose: function () { + + this.dispatchEvent( { type: 'dispose' } ); + + } + + } ); + + BufferGeometry.MaxIndex = 65535; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * @author mikael emtinger / http://gomo.se/ + * @author jonobr1 / http://jonobr1.com/ + */ + + function Mesh( geometry, material ) { + + Object3D.call( this ); + + this.type = 'Mesh'; + + this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); + this.material = material !== undefined ? material : new MeshBasicMaterial( { color: Math.random() * 0xffffff } ); + + this.drawMode = TrianglesDrawMode; + + this.updateMorphTargets(); + + } + + Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Mesh, + + isMesh: true, + + setDrawMode: function ( value ) { + + this.drawMode = value; + + }, + + copy: function ( source ) { + + Object3D.prototype.copy.call( this, source ); + + this.drawMode = source.drawMode; + + return this; + + }, + + updateMorphTargets: function () { + + var morphTargets = this.geometry.morphTargets; + + if ( morphTargets !== undefined && morphTargets.length > 0 ) { + + this.morphTargetInfluences = []; + this.morphTargetDictionary = {}; + + for ( var m = 0, ml = morphTargets.length; m < ml; m ++ ) { + + this.morphTargetInfluences.push( 0 ); + this.morphTargetDictionary[ morphTargets[ m ].name ] = m; + + } + + } + + }, + + raycast: ( function () { + + var inverseMatrix = new Matrix4(); + var ray = new Ray(); + var sphere = new Sphere(); + + var vA = new Vector3(); + var vB = new Vector3(); + var vC = new Vector3(); + + var tempA = new Vector3(); + var tempB = new Vector3(); + var tempC = new Vector3(); + + var uvA = new Vector2(); + var uvB = new Vector2(); + var uvC = new Vector2(); + + var barycoord = new Vector3(); + + var intersectionPoint = new Vector3(); + var intersectionPointWorld = new Vector3(); + + function uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) { + + Triangle.barycoordFromPoint( point, p1, p2, p3, barycoord ); + + uv1.multiplyScalar( barycoord.x ); + uv2.multiplyScalar( barycoord.y ); + uv3.multiplyScalar( barycoord.z ); + + uv1.add( uv2 ).add( uv3 ); + + return uv1.clone(); + + } + + function checkIntersection( object, raycaster, ray, pA, pB, pC, point ) { + + var intersect; + var material = object.material; + + if ( material.side === BackSide ) { + + intersect = ray.intersectTriangle( pC, pB, pA, true, point ); + + } else { + + intersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point ); + + } + + if ( intersect === null ) return null; + + intersectionPointWorld.copy( point ); + intersectionPointWorld.applyMatrix4( object.matrixWorld ); + + var distance = raycaster.ray.origin.distanceTo( intersectionPointWorld ); + + if ( distance < raycaster.near || distance > raycaster.far ) return null; + + return { + distance: distance, + point: intersectionPointWorld.clone(), + object: object + }; + + } + + function checkBufferGeometryIntersection( object, raycaster, ray, positions, uvs, a, b, c ) { + + vA.fromArray( positions, a * 3 ); + vB.fromArray( positions, b * 3 ); + vC.fromArray( positions, c * 3 ); + + var intersection = checkIntersection( object, raycaster, ray, vA, vB, vC, intersectionPoint ); + + if ( intersection ) { + + if ( uvs ) { + + uvA.fromArray( uvs, a * 2 ); + uvB.fromArray( uvs, b * 2 ); + uvC.fromArray( uvs, c * 2 ); + + intersection.uv = uvIntersection( intersectionPoint, vA, vB, vC, uvA, uvB, uvC ); + + } + + intersection.face = new Face3( a, b, c, Triangle.normal( vA, vB, vC ) ); + intersection.faceIndex = a; + + } + + return intersection; + + } + + return function raycast( raycaster, intersects ) { + + var geometry = this.geometry; + var material = this.material; + var matrixWorld = this.matrixWorld; + + if ( material === undefined ) return; + + // Checking boundingSphere distance to ray + + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + + sphere.copy( geometry.boundingSphere ); + sphere.applyMatrix4( matrixWorld ); + + if ( raycaster.ray.intersectsSphere( sphere ) === false ) return; + + // + + inverseMatrix.getInverse( matrixWorld ); + ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix ); + + // Check boundingBox before continuing + + if ( geometry.boundingBox !== null ) { + + if ( ray.intersectsBox( geometry.boundingBox ) === false ) return; + + } + + var uvs, intersection; + + if ( (geometry && geometry.isBufferGeometry) ) { + + var a, b, c; + var index = geometry.index; + var attributes = geometry.attributes; + var positions = attributes.position.array; + + if ( attributes.uv !== undefined ) { + + uvs = attributes.uv.array; + + } + + if ( index !== null ) { + + var indices = index.array; + + for ( var i = 0, l = indices.length; i < l; i += 3 ) { + + a = indices[ i ]; + b = indices[ i + 1 ]; + c = indices[ i + 2 ]; + + intersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c ); + + if ( intersection ) { + + intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indices buffer semantics + intersects.push( intersection ); + + } + + } + + } else { + + + for ( var i = 0, l = positions.length; i < l; i += 9 ) { + + a = i / 3; + b = a + 1; + c = a + 2; + + intersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c ); + + if ( intersection ) { + + intersection.index = a; // triangle number in positions buffer semantics + intersects.push( intersection ); + + } + + } + + } + + } else if ( (geometry && geometry.isGeometry) ) { + + var fvA, fvB, fvC; + var isFaceMaterial = (material && material.isMultiMaterial); + var materials = isFaceMaterial === true ? material.materials : null; + + var vertices = geometry.vertices; + var faces = geometry.faces; + var faceVertexUvs = geometry.faceVertexUvs[ 0 ]; + if ( faceVertexUvs.length > 0 ) uvs = faceVertexUvs; + + for ( var f = 0, fl = faces.length; f < fl; f ++ ) { + + var face = faces[ f ]; + var faceMaterial = isFaceMaterial === true ? materials[ face.materialIndex ] : material; + + if ( faceMaterial === undefined ) continue; + + fvA = vertices[ face.a ]; + fvB = vertices[ face.b ]; + fvC = vertices[ face.c ]; + + if ( faceMaterial.morphTargets === true ) { + + var morphTargets = geometry.morphTargets; + var morphInfluences = this.morphTargetInfluences; + + vA.set( 0, 0, 0 ); + vB.set( 0, 0, 0 ); + vC.set( 0, 0, 0 ); + + for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) { + + var influence = morphInfluences[ t ]; + + if ( influence === 0 ) continue; + + var targets = morphTargets[ t ].vertices; + + vA.addScaledVector( tempA.subVectors( targets[ face.a ], fvA ), influence ); + vB.addScaledVector( tempB.subVectors( targets[ face.b ], fvB ), influence ); + vC.addScaledVector( tempC.subVectors( targets[ face.c ], fvC ), influence ); + + } + + vA.add( fvA ); + vB.add( fvB ); + vC.add( fvC ); + + fvA = vA; + fvB = vB; + fvC = vC; + + } + + intersection = checkIntersection( this, raycaster, ray, fvA, fvB, fvC, intersectionPoint ); + + if ( intersection ) { + + if ( uvs ) { + + var uvs_f = uvs[ f ]; + uvA.copy( uvs_f[ 0 ] ); + uvB.copy( uvs_f[ 1 ] ); + uvC.copy( uvs_f[ 2 ] ); + + intersection.uv = uvIntersection( intersectionPoint, fvA, fvB, fvC, uvA, uvB, uvC ); + + } + + intersection.face = face; + intersection.faceIndex = f; + intersects.push( intersection ); + + } + + } + + } + + }; + + }() ), + + clone: function () { + + return new this.constructor( this.geometry, this.material ).copy( this ); + + } + + } ); + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { + + BufferGeometry.call( this ); + + this.type = 'BoxBufferGeometry'; + + this.parameters = { + width: width, + height: height, + depth: depth, + widthSegments: widthSegments, + heightSegments: heightSegments, + depthSegments: depthSegments + }; + + var scope = this; + + // segments + widthSegments = Math.floor( widthSegments ) || 1; + heightSegments = Math.floor( heightSegments ) || 1; + depthSegments = Math.floor( depthSegments ) || 1; + + // these are used to calculate buffer length + var vertexCount = calculateVertexCount( widthSegments, heightSegments, depthSegments ); + var indexCount = calculateIndexCount( widthSegments, heightSegments, depthSegments ); + + // buffers + var indices = new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ); + var vertices = new Float32Array( vertexCount * 3 ); + var normals = new Float32Array( vertexCount * 3 ); + var uvs = new Float32Array( vertexCount * 2 ); + + // offset variables + var vertexBufferOffset = 0; + var uvBufferOffset = 0; + var indexBufferOffset = 0; + var numberOfVertices = 0; + + // group variables + var groupStart = 0; + + // build each side of the box geometry + buildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px + buildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx + buildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py + buildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny + buildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz + buildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz + + // build geometry + this.setIndex( new BufferAttribute( indices, 1 ) ); + this.addAttribute( 'position', new BufferAttribute( vertices, 3 ) ); + this.addAttribute( 'normal', new BufferAttribute( normals, 3 ) ); + this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) ); + + // helper functions + + function calculateVertexCount( w, h, d ) { + + var vertices = 0; + + // calculate the amount of vertices for each side (plane) + vertices += (w + 1) * (h + 1) * 2; // xy + vertices += (w + 1) * (d + 1) * 2; // xz + vertices += (d + 1) * (h + 1) * 2; // zy + + return vertices; + + } + + function calculateIndexCount( w, h, d ) { + + var index = 0; + + // calculate the amount of squares for each side + index += w * h * 2; // xy + index += w * d * 2; // xz + index += d * h * 2; // zy + + return index * 6; // two triangles per square => six vertices per square + + } + + function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) { + + var segmentWidth = width / gridX; + var segmentHeight = height / gridY; + + var widthHalf = width / 2; + var heightHalf = height / 2; + var depthHalf = depth / 2; + + var gridX1 = gridX + 1; + var gridY1 = gridY + 1; + + var vertexCounter = 0; + var groupCount = 0; + + var vector = new Vector3(); + + // generate vertices, normals and uvs + + for ( var iy = 0; iy < gridY1; iy ++ ) { + + var y = iy * segmentHeight - heightHalf; + + for ( var ix = 0; ix < gridX1; ix ++ ) { + + var x = ix * segmentWidth - widthHalf; + + // set values to correct vector component + vector[ u ] = x * udir; + vector[ v ] = y * vdir; + vector[ w ] = depthHalf; + + // now apply vector to vertex buffer + vertices[ vertexBufferOffset ] = vector.x; + vertices[ vertexBufferOffset + 1 ] = vector.y; + vertices[ vertexBufferOffset + 2 ] = vector.z; + + // set values to correct vector component + vector[ u ] = 0; + vector[ v ] = 0; + vector[ w ] = depth > 0 ? 1 : - 1; + + // now apply vector to normal buffer + normals[ vertexBufferOffset ] = vector.x; + normals[ vertexBufferOffset + 1 ] = vector.y; + normals[ vertexBufferOffset + 2 ] = vector.z; + + // uvs + uvs[ uvBufferOffset ] = ix / gridX; + uvs[ uvBufferOffset + 1 ] = 1 - ( iy / gridY ); + + // update offsets and counters + vertexBufferOffset += 3; + uvBufferOffset += 2; + vertexCounter += 1; + + } + + } + + // 1. you need three indices to draw a single face + // 2. a single segment consists of two faces + // 3. so we need to generate six (2*3) indices per segment + + for ( iy = 0; iy < gridY; iy ++ ) { + + for ( ix = 0; ix < gridX; ix ++ ) { + + // indices + var a = numberOfVertices + ix + gridX1 * iy; + var b = numberOfVertices + ix + gridX1 * ( iy + 1 ); + var c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 ); + var d = numberOfVertices + ( ix + 1 ) + gridX1 * iy; + + // face one + indices[ indexBufferOffset ] = a; + indices[ indexBufferOffset + 1 ] = b; + indices[ indexBufferOffset + 2 ] = d; + + // face two + indices[ indexBufferOffset + 3 ] = b; + indices[ indexBufferOffset + 4 ] = c; + indices[ indexBufferOffset + 5 ] = d; + + // update offsets and counters + indexBufferOffset += 6; + groupCount += 6; + + } + + } + + // add a group to the geometry. this will ensure multi material support + scope.addGroup( groupStart, groupCount, materialIndex ); + + // calculate new start value for groups + groupStart += groupCount; + + // update total number of vertices + numberOfVertices += vertexCounter; + + } + + } + + BoxBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + BoxBufferGeometry.prototype.constructor = BoxBufferGeometry; + + /** + * @author mrdoob / http://mrdoob.com/ + * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as + */ + + function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) { + + BufferGeometry.call( this ); + + this.type = 'PlaneBufferGeometry'; + + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; + + var width_half = width / 2; + var height_half = height / 2; + + var gridX = Math.floor( widthSegments ) || 1; + var gridY = Math.floor( heightSegments ) || 1; + + var gridX1 = gridX + 1; + var gridY1 = gridY + 1; + + var segment_width = width / gridX; + var segment_height = height / gridY; + + var vertices = new Float32Array( gridX1 * gridY1 * 3 ); + var normals = new Float32Array( gridX1 * gridY1 * 3 ); + var uvs = new Float32Array( gridX1 * gridY1 * 2 ); + + var offset = 0; + var offset2 = 0; + + for ( var iy = 0; iy < gridY1; iy ++ ) { + + var y = iy * segment_height - height_half; + + for ( var ix = 0; ix < gridX1; ix ++ ) { + + var x = ix * segment_width - width_half; + + vertices[ offset ] = x; + vertices[ offset + 1 ] = - y; + + normals[ offset + 2 ] = 1; + + uvs[ offset2 ] = ix / gridX; + uvs[ offset2 + 1 ] = 1 - ( iy / gridY ); + + offset += 3; + offset2 += 2; + + } + + } + + offset = 0; + + var indices = new ( ( vertices.length / 3 ) > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 ); + + for ( var iy = 0; iy < gridY; iy ++ ) { + + for ( var ix = 0; ix < gridX; ix ++ ) { + + var a = ix + gridX1 * iy; + var b = ix + gridX1 * ( iy + 1 ); + var c = ( ix + 1 ) + gridX1 * ( iy + 1 ); + var d = ( ix + 1 ) + gridX1 * iy; + + indices[ offset ] = a; + indices[ offset + 1 ] = b; + indices[ offset + 2 ] = d; + + indices[ offset + 3 ] = b; + indices[ offset + 4 ] = c; + indices[ offset + 5 ] = d; + + offset += 6; + + } + + } + + this.setIndex( new BufferAttribute( indices, 1 ) ); + this.addAttribute( 'position', new BufferAttribute( vertices, 3 ) ); + this.addAttribute( 'normal', new BufferAttribute( normals, 3 ) ); + this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) ); + + } + + PlaneBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + PlaneBufferGeometry.prototype.constructor = PlaneBufferGeometry; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author mikael emtinger / http://gomo.se/ + * @author WestLangley / http://github.com/WestLangley + */ + + function Camera() { + + Object3D.call( this ); + + this.type = 'Camera'; + + this.matrixWorldInverse = new Matrix4(); + this.projectionMatrix = new Matrix4(); + + } + + Camera.prototype = Object.create( Object3D.prototype ); + Camera.prototype.constructor = Camera; + + Camera.prototype.isCamera = true; + + Camera.prototype.getWorldDirection = function () { + + var quaternion = new Quaternion(); + + return function getWorldDirection( optionalTarget ) { + + var result = optionalTarget || new Vector3(); + + this.getWorldQuaternion( quaternion ); + + return result.set( 0, 0, - 1 ).applyQuaternion( quaternion ); + + }; + + }(); + + Camera.prototype.lookAt = function () { + + // This routine does not support cameras with rotated and/or translated parent(s) + + var m1 = new Matrix4(); + + return function lookAt( vector ) { + + m1.lookAt( this.position, vector, this.up ); + + this.quaternion.setFromRotationMatrix( m1 ); + + }; + + }(); + + Camera.prototype.clone = function () { + + return new this.constructor().copy( this ); + + }; + + Camera.prototype.copy = function ( source ) { + + Object3D.prototype.copy.call( this, source ); + + this.matrixWorldInverse.copy( source.matrixWorldInverse ); + this.projectionMatrix.copy( source.projectionMatrix ); + + return this; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author greggman / http://games.greggman.com/ + * @author zz85 / http://www.lab4games.net/zz85/blog + * @author tschw + */ + + function PerspectiveCamera( fov, aspect, near, far ) { + + Camera.call( this ); + + this.type = 'PerspectiveCamera'; + + this.fov = fov !== undefined ? fov : 50; + this.zoom = 1; + + this.near = near !== undefined ? near : 0.1; + this.far = far !== undefined ? far : 2000; + this.focus = 10; + + this.aspect = aspect !== undefined ? aspect : 1; + this.view = null; + + this.filmGauge = 35; // width of the film (default in millimeters) + this.filmOffset = 0; // horizontal film offset (same unit as gauge) + + this.updateProjectionMatrix(); + + } + + PerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ), { + + constructor: PerspectiveCamera, + + isPerspectiveCamera: true, + + copy: function ( source ) { + + Camera.prototype.copy.call( this, source ); + + this.fov = source.fov; + this.zoom = source.zoom; + + this.near = source.near; + this.far = source.far; + this.focus = source.focus; + + this.aspect = source.aspect; + this.view = source.view === null ? null : Object.assign( {}, source.view ); + + this.filmGauge = source.filmGauge; + this.filmOffset = source.filmOffset; + + return this; + + }, + + /** + * Sets the FOV by focal length in respect to the current .filmGauge. + * + * The default film gauge is 35, so that the focal length can be specified for + * a 35mm (full frame) camera. + * + * Values for focal length and film gauge must have the same unit. + */ + setFocalLength: function ( focalLength ) { + + // see http://www.bobatkins.com/photography/technical/field_of_view.html + var vExtentSlope = 0.5 * this.getFilmHeight() / focalLength; + + this.fov = _Math.RAD2DEG * 2 * Math.atan( vExtentSlope ); + this.updateProjectionMatrix(); + + }, + + /** + * Calculates the focal length from the current .fov and .filmGauge. + */ + getFocalLength: function () { + + var vExtentSlope = Math.tan( _Math.DEG2RAD * 0.5 * this.fov ); + + return 0.5 * this.getFilmHeight() / vExtentSlope; + + }, + + getEffectiveFOV: function () { + + return _Math.RAD2DEG * 2 * Math.atan( + Math.tan( _Math.DEG2RAD * 0.5 * this.fov ) / this.zoom ); + + }, + + getFilmWidth: function () { + + // film not completely covered in portrait format (aspect < 1) + return this.filmGauge * Math.min( this.aspect, 1 ); + + }, + + getFilmHeight: function () { + + // film not completely covered in landscape format (aspect > 1) + return this.filmGauge / Math.max( this.aspect, 1 ); + + }, + + /** + * Sets an offset in a larger frustum. This is useful for multi-window or + * multi-monitor/multi-machine setups. + * + * For example, if you have 3x2 monitors and each monitor is 1920x1080 and + * the monitors are in grid like this + * + * +---+---+---+ + * | A | B | C | + * +---+---+---+ + * | D | E | F | + * +---+---+---+ + * + * then for each monitor you would call it like this + * + * var w = 1920; + * var h = 1080; + * var fullWidth = w * 3; + * var fullHeight = h * 2; + * + * --A-- + * camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); + * --B-- + * camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); + * --C-- + * camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); + * --D-- + * camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); + * --E-- + * camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); + * --F-- + * camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); + * + * Note there is no reason monitors have to be the same size or in a grid. + */ + setViewOffset: function ( fullWidth, fullHeight, x, y, width, height ) { + + this.aspect = fullWidth / fullHeight; + + this.view = { + fullWidth: fullWidth, + fullHeight: fullHeight, + offsetX: x, + offsetY: y, + width: width, + height: height + }; + + this.updateProjectionMatrix(); + + }, + + clearViewOffset: function() { + + this.view = null; + this.updateProjectionMatrix(); + + }, + + updateProjectionMatrix: function () { + + var near = this.near, + top = near * Math.tan( + _Math.DEG2RAD * 0.5 * this.fov ) / this.zoom, + height = 2 * top, + width = this.aspect * height, + left = - 0.5 * width, + view = this.view; + + if ( view !== null ) { + + var fullWidth = view.fullWidth, + fullHeight = view.fullHeight; + + left += view.offsetX * width / fullWidth; + top -= view.offsetY * height / fullHeight; + width *= view.width / fullWidth; + height *= view.height / fullHeight; + + } + + var skew = this.filmOffset; + if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); + + this.projectionMatrix.makeFrustum( + left, left + width, top - height, top, near, this.far ); + + }, + + toJSON: function ( meta ) { + + var data = Object3D.prototype.toJSON.call( this, meta ); + + data.object.fov = this.fov; + data.object.zoom = this.zoom; + + data.object.near = this.near; + data.object.far = this.far; + data.object.focus = this.focus; + + data.object.aspect = this.aspect; + + if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); + + data.object.filmGauge = this.filmGauge; + data.object.filmOffset = this.filmOffset; + + return data; + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com/ + * @author arose / http://github.com/arose + */ + + function OrthographicCamera( left, right, top, bottom, near, far ) { + + Camera.call( this ); + + this.type = 'OrthographicCamera'; + + this.zoom = 1; + this.view = null; + + this.left = left; + this.right = right; + this.top = top; + this.bottom = bottom; + + this.near = ( near !== undefined ) ? near : 0.1; + this.far = ( far !== undefined ) ? far : 2000; + + this.updateProjectionMatrix(); + + } + + OrthographicCamera.prototype = Object.assign( Object.create( Camera.prototype ), { + + constructor: OrthographicCamera, + + isOrthographicCamera: true, + + copy: function ( source ) { + + Camera.prototype.copy.call( this, source ); + + this.left = source.left; + this.right = source.right; + this.top = source.top; + this.bottom = source.bottom; + this.near = source.near; + this.far = source.far; + + this.zoom = source.zoom; + this.view = source.view === null ? null : Object.assign( {}, source.view ); + + return this; + + }, + + setViewOffset: function( fullWidth, fullHeight, x, y, width, height ) { + + this.view = { + fullWidth: fullWidth, + fullHeight: fullHeight, + offsetX: x, + offsetY: y, + width: width, + height: height + }; + + this.updateProjectionMatrix(); + + }, + + clearViewOffset: function() { + + this.view = null; + this.updateProjectionMatrix(); + + }, + + updateProjectionMatrix: function () { + + var dx = ( this.right - this.left ) / ( 2 * this.zoom ); + var dy = ( this.top - this.bottom ) / ( 2 * this.zoom ); + var cx = ( this.right + this.left ) / 2; + var cy = ( this.top + this.bottom ) / 2; + + var left = cx - dx; + var right = cx + dx; + var top = cy + dy; + var bottom = cy - dy; + + if ( this.view !== null ) { + + var zoomW = this.zoom / ( this.view.width / this.view.fullWidth ); + var zoomH = this.zoom / ( this.view.height / this.view.fullHeight ); + var scaleW = ( this.right - this.left ) / this.view.width; + var scaleH = ( this.top - this.bottom ) / this.view.height; + + left += scaleW * ( this.view.offsetX / zoomW ); + right = left + scaleW * ( this.view.width / zoomW ); + top -= scaleH * ( this.view.offsetY / zoomH ); + bottom = top - scaleH * ( this.view.height / zoomH ); + + } + + this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far ); + + }, + + toJSON: function ( meta ) { + + var data = Object3D.prototype.toJSON.call( this, meta ); + + data.object.zoom = this.zoom; + data.object.left = this.left; + data.object.right = this.right; + data.object.top = this.top; + data.object.bottom = this.bottom; + data.object.near = this.near; + data.object.far = this.far; + + if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); + + return data; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLIndexedBufferRenderer( gl, extensions, infoRender ) { + + var mode; + + function setMode( value ) { + + mode = value; + + } + + var type, size; + + function setIndex( index ) { + + if ( index.array instanceof Uint32Array && extensions.get( 'OES_element_index_uint' ) ) { + + type = gl.UNSIGNED_INT; + size = 4; + + } else { + + type = gl.UNSIGNED_SHORT; + size = 2; + + } + + } + + function render( start, count ) { + + gl.drawElements( mode, count, type, start * size ); + + infoRender.calls ++; + infoRender.vertices += count; + + if ( mode === gl.TRIANGLES ) infoRender.faces += count / 3; + + } + + function renderInstances( geometry, start, count ) { + + var extension = extensions.get( 'ANGLE_instanced_arrays' ); + + if ( extension === null ) { + + console.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); + return; + + } + + extension.drawElementsInstancedANGLE( mode, count, type, start * size, geometry.maxInstancedCount ); + + infoRender.calls ++; + infoRender.vertices += count * geometry.maxInstancedCount; + + if ( mode === gl.TRIANGLES ) infoRender.faces += geometry.maxInstancedCount * count / 3; + + } + + return { + + setMode: setMode, + setIndex: setIndex, + render: render, + renderInstances: renderInstances + + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLBufferRenderer( gl, extensions, infoRender ) { + + var mode; + + function setMode( value ) { + + mode = value; + + } + + function render( start, count ) { + + gl.drawArrays( mode, start, count ); + + infoRender.calls ++; + infoRender.vertices += count; + + if ( mode === gl.TRIANGLES ) infoRender.faces += count / 3; + + } + + function renderInstances( geometry ) { + + var extension = extensions.get( 'ANGLE_instanced_arrays' ); + + if ( extension === null ) { + + console.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); + return; + + } + + var position = geometry.attributes.position; + + var count = 0; + + if ( (position && position.isInterleavedBufferAttribute) ) { + + count = position.data.count; + + extension.drawArraysInstancedANGLE( mode, 0, count, geometry.maxInstancedCount ); + + } else { + + count = position.count; + + extension.drawArraysInstancedANGLE( mode, 0, count, geometry.maxInstancedCount ); + + } + + infoRender.calls ++; + infoRender.vertices += count * geometry.maxInstancedCount; + + if ( mode === gl.TRIANGLES ) infoRender.faces += geometry.maxInstancedCount * count / 3; + + } + + return { + setMode: setMode, + render: render, + renderInstances: renderInstances + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLLights() { + + var lights = {}; + + return { + + get: function ( light ) { + + if ( lights[ light.id ] !== undefined ) { + + return lights[ light.id ]; + + } + + var uniforms; + + switch ( light.type ) { + + case 'DirectionalLight': + uniforms = { + direction: new Vector3(), + color: new Color(), + + shadow: false, + shadowBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; + + case 'SpotLight': + uniforms = { + position: new Vector3(), + direction: new Vector3(), + color: new Color(), + distance: 0, + coneCos: 0, + penumbraCos: 0, + decay: 0, + + shadow: false, + shadowBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; + + case 'PointLight': + uniforms = { + position: new Vector3(), + color: new Color(), + distance: 0, + decay: 0, + + shadow: false, + shadowBias: 0, + shadowRadius: 1, + shadowMapSize: new Vector2() + }; + break; + + case 'HemisphereLight': + uniforms = { + direction: new Vector3(), + skyColor: new Color(), + groundColor: new Color() + }; + break; + + } + + lights[ light.id ] = uniforms; + + return uniforms; + + } + + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function addLineNumbers( string ) { + + var lines = string.split( '\n' ); + + for ( var i = 0; i < lines.length; i ++ ) { + + lines[ i ] = ( i + 1 ) + ': ' + lines[ i ]; + + } + + return lines.join( '\n' ); + + } + + function WebGLShader( gl, type, string ) { + + var shader = gl.createShader( type ); + + gl.shaderSource( shader, string ); + gl.compileShader( shader ); + + if ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === false ) { + + console.error( 'THREE.WebGLShader: Shader couldn\'t compile.' ); + + } + + if ( gl.getShaderInfoLog( shader ) !== '' ) { + + console.warn( 'THREE.WebGLShader: gl.getShaderInfoLog()', type === gl.VERTEX_SHADER ? 'vertex' : 'fragment', gl.getShaderInfoLog( shader ), addLineNumbers( string ) ); + + } + + // --enable-privileged-webgl-extension + // console.log( type, gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) ); + + return shader; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + var programIdCount = 0; + + function getEncodingComponents( encoding ) { + + switch ( encoding ) { + + case LinearEncoding: + return [ 'Linear','( value )' ]; + case sRGBEncoding: + return [ 'sRGB','( value )' ]; + case RGBEEncoding: + return [ 'RGBE','( value )' ]; + case RGBM7Encoding: + return [ 'RGBM','( value, 7.0 )' ]; + case RGBM16Encoding: + return [ 'RGBM','( value, 16.0 )' ]; + case RGBDEncoding: + return [ 'RGBD','( value, 256.0 )' ]; + case GammaEncoding: + return [ 'Gamma','( value, float( GAMMA_FACTOR ) )' ]; + default: + throw new Error( 'unsupported encoding: ' + encoding ); + + } + + } + + function getTexelDecodingFunction( functionName, encoding ) { + + var components = getEncodingComponents( encoding ); + return "vec4 " + functionName + "( vec4 value ) { return " + components[ 0 ] + "ToLinear" + components[ 1 ] + "; }"; + + } + + function getTexelEncodingFunction( functionName, encoding ) { + + var components = getEncodingComponents( encoding ); + return "vec4 " + functionName + "( vec4 value ) { return LinearTo" + components[ 0 ] + components[ 1 ] + "; }"; + + } + + function getToneMappingFunction( functionName, toneMapping ) { + + var toneMappingName; + + switch ( toneMapping ) { + + case LinearToneMapping: + toneMappingName = "Linear"; + break; + + case ReinhardToneMapping: + toneMappingName = "Reinhard"; + break; + + case Uncharted2ToneMapping: + toneMappingName = "Uncharted2"; + break; + + case CineonToneMapping: + toneMappingName = "OptimizedCineon"; + break; + + default: + throw new Error( 'unsupported toneMapping: ' + toneMapping ); + + } + + return "vec3 " + functionName + "( vec3 color ) { return " + toneMappingName + "ToneMapping( color ); }"; + + } + + function generateExtensions( extensions, parameters, rendererExtensions ) { + + extensions = extensions || {}; + + var chunks = [ + ( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.normalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '', + ( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ? '#extension GL_EXT_frag_depth : enable' : '', + ( extensions.drawBuffers ) && rendererExtensions.get( 'WEBGL_draw_buffers' ) ? '#extension GL_EXT_draw_buffers : require' : '', + ( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ? '#extension GL_EXT_shader_texture_lod : enable' : '', + ]; + + return chunks.filter( filterEmptyLine ).join( '\n' ); + + } + + function generateDefines( defines ) { + + var chunks = []; + + for ( var name in defines ) { + + var value = defines[ name ]; + + if ( value === false ) continue; + + chunks.push( '#define ' + name + ' ' + value ); + + } + + return chunks.join( '\n' ); + + } + + function fetchAttributeLocations( gl, program, identifiers ) { + + var attributes = {}; + + var n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES ); + + for ( var i = 0; i < n; i ++ ) { + + var info = gl.getActiveAttrib( program, i ); + var name = info.name; + + // console.log("THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:", name, i ); + + attributes[ name ] = gl.getAttribLocation( program, name ); + + } + + return attributes; + + } + + function filterEmptyLine( string ) { + + return string !== ''; + + } + + function replaceLightNums( string, parameters ) { + + return string + .replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights ) + .replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights ) + .replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights ) + .replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights ); + + } + + function parseIncludes( string ) { + + var pattern = /#include +<([\w\d.]+)>/g; + + function replace( match, include ) { + + var replace = ShaderChunk[ include ]; + + if ( replace === undefined ) { + + throw new Error( 'Can not resolve #include <' + include + '>' ); + + } + + return parseIncludes( replace ); + + } + + return string.replace( pattern, replace ); + + } + + function unrollLoops( string ) { + + var pattern = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; + + function replace( match, start, end, snippet ) { + + var unroll = ''; + + for ( var i = parseInt( start ); i < parseInt( end ); i ++ ) { + + unroll += snippet.replace( /\[ i \]/g, '[ ' + i + ' ]' ); + + } + + return unroll; + + } + + return string.replace( pattern, replace ); + + } + + function WebGLProgram( renderer, code, material, parameters ) { + + var gl = renderer.context; + + var extensions = material.extensions; + var defines = material.defines; + + var vertexShader = material.__webglShader.vertexShader; + var fragmentShader = material.__webglShader.fragmentShader; + + var shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC'; + + if ( parameters.shadowMapType === PCFShadowMap ) { + + shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF'; + + } else if ( parameters.shadowMapType === PCFSoftShadowMap ) { + + shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT'; + + } + + var envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; + var envMapModeDefine = 'ENVMAP_MODE_REFLECTION'; + var envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; + + if ( parameters.envMap ) { + + switch ( material.envMap.mapping ) { + + case CubeReflectionMapping: + case CubeRefractionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; + break; + + case CubeUVReflectionMapping: + case CubeUVRefractionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV'; + break; + + case EquirectangularReflectionMapping: + case EquirectangularRefractionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_EQUIREC'; + break; + + case SphericalReflectionMapping: + envMapTypeDefine = 'ENVMAP_TYPE_SPHERE'; + break; + + } + + switch ( material.envMap.mapping ) { + + case CubeRefractionMapping: + case EquirectangularRefractionMapping: + envMapModeDefine = 'ENVMAP_MODE_REFRACTION'; + break; + + } + + switch ( material.combine ) { + + case MultiplyOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; + break; + + case MixOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_MIX'; + break; + + case AddOperation: + envMapBlendingDefine = 'ENVMAP_BLENDING_ADD'; + break; + + } + + } + + var gammaFactorDefine = ( renderer.gammaFactor > 0 ) ? renderer.gammaFactor : 1.0; + + // console.log( 'building new program ' ); + + // + + var customExtensions = generateExtensions( extensions, parameters, renderer.extensions ); + + var customDefines = generateDefines( defines ); + + // + + var program = gl.createProgram(); + + var prefixVertex, prefixFragment; + + if ( material.isRawShaderMaterial ) { + + prefixVertex = [ + + customDefines, + + '\n' + + ].filter( filterEmptyLine ).join( '\n' ); + + prefixFragment = [ + + customExtensions, + customDefines, + + '\n' + + ].filter( filterEmptyLine ).join( '\n' ); + + } else { + + prefixVertex = [ + + 'precision ' + parameters.precision + ' float;', + 'precision ' + parameters.precision + ' int;', + + '#define SHADER_NAME ' + material.__webglShader.name, + + customDefines, + + parameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '', + + '#define GAMMA_FACTOR ' + gammaFactorDefine, + + '#define MAX_BONES ' + parameters.maxBones, + + parameters.map ? '#define USE_MAP' : '', + parameters.envMap ? '#define USE_ENVMAP' : '', + parameters.envMap ? '#define ' + envMapModeDefine : '', + parameters.lightMap ? '#define USE_LIGHTMAP' : '', + parameters.aoMap ? '#define USE_AOMAP' : '', + parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', + parameters.bumpMap ? '#define USE_BUMPMAP' : '', + parameters.normalMap ? '#define USE_NORMALMAP' : '', + parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '', + parameters.specularMap ? '#define USE_SPECULARMAP' : '', + parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', + parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', + parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + parameters.vertexColors ? '#define USE_COLOR' : '', + + parameters.flatShading ? '#define FLAT_SHADED' : '', + + parameters.skinning ? '#define USE_SKINNING' : '', + parameters.useVertexTexture ? '#define BONE_TEXTURE' : '', + + parameters.morphTargets ? '#define USE_MORPHTARGETS' : '', + parameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '', + parameters.doubleSided ? '#define DOUBLE_SIDED' : '', + parameters.flipSided ? '#define FLIP_SIDED' : '', + + '#define NUM_CLIPPING_PLANES ' + parameters.numClippingPlanes, + + parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', + parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', + + parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', + + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', + parameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '', + + 'uniform mat4 modelMatrix;', + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform mat4 viewMatrix;', + 'uniform mat3 normalMatrix;', + 'uniform vec3 cameraPosition;', + + 'attribute vec3 position;', + 'attribute vec3 normal;', + 'attribute vec2 uv;', + + '#ifdef USE_COLOR', + + ' attribute vec3 color;', + + '#endif', + + '#ifdef USE_MORPHTARGETS', + + ' attribute vec3 morphTarget0;', + ' attribute vec3 morphTarget1;', + ' attribute vec3 morphTarget2;', + ' attribute vec3 morphTarget3;', + + ' #ifdef USE_MORPHNORMALS', + + ' attribute vec3 morphNormal0;', + ' attribute vec3 morphNormal1;', + ' attribute vec3 morphNormal2;', + ' attribute vec3 morphNormal3;', + + ' #else', + + ' attribute vec3 morphTarget4;', + ' attribute vec3 morphTarget5;', + ' attribute vec3 morphTarget6;', + ' attribute vec3 morphTarget7;', + + ' #endif', + + '#endif', + + '#ifdef USE_SKINNING', + + ' attribute vec4 skinIndex;', + ' attribute vec4 skinWeight;', + + '#endif', + + '\n' + + ].filter( filterEmptyLine ).join( '\n' ); + + prefixFragment = [ + + customExtensions, + + 'precision ' + parameters.precision + ' float;', + 'precision ' + parameters.precision + ' int;', + + '#define SHADER_NAME ' + material.__webglShader.name, + + customDefines, + + parameters.alphaTest ? '#define ALPHATEST ' + parameters.alphaTest : '', + + '#define GAMMA_FACTOR ' + gammaFactorDefine, + + ( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '', + ( parameters.useFog && parameters.fogExp ) ? '#define FOG_EXP2' : '', + + parameters.map ? '#define USE_MAP' : '', + parameters.envMap ? '#define USE_ENVMAP' : '', + parameters.envMap ? '#define ' + envMapTypeDefine : '', + parameters.envMap ? '#define ' + envMapModeDefine : '', + parameters.envMap ? '#define ' + envMapBlendingDefine : '', + parameters.lightMap ? '#define USE_LIGHTMAP' : '', + parameters.aoMap ? '#define USE_AOMAP' : '', + parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', + parameters.bumpMap ? '#define USE_BUMPMAP' : '', + parameters.normalMap ? '#define USE_NORMALMAP' : '', + parameters.specularMap ? '#define USE_SPECULARMAP' : '', + parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', + parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', + parameters.alphaMap ? '#define USE_ALPHAMAP' : '', + parameters.vertexColors ? '#define USE_COLOR' : '', + + parameters.flatShading ? '#define FLAT_SHADED' : '', + + parameters.doubleSided ? '#define DOUBLE_SIDED' : '', + parameters.flipSided ? '#define FLIP_SIDED' : '', + + '#define NUM_CLIPPING_PLANES ' + parameters.numClippingPlanes, + '#define UNION_CLIPPING_PLANES ' + (parameters.numClippingPlanes - parameters.numClipIntersection), + + parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', + parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', + + parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : '', + + parameters.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : '', + + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', + parameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '', + + parameters.envMap && renderer.extensions.get( 'EXT_shader_texture_lod' ) ? '#define TEXTURE_LOD_EXT' : '', + + 'uniform mat4 viewMatrix;', + 'uniform vec3 cameraPosition;', + + ( parameters.toneMapping !== NoToneMapping ) ? "#define TONE_MAPPING" : '', + ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below + ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( "toneMapping", parameters.toneMapping ) : '', + + ( parameters.outputEncoding || parameters.mapEncoding || parameters.envMapEncoding || parameters.emissiveMapEncoding ) ? ShaderChunk[ 'encodings_pars_fragment' ] : '', // this code is required here because it is used by the various encoding/decoding function defined below + parameters.mapEncoding ? getTexelDecodingFunction( 'mapTexelToLinear', parameters.mapEncoding ) : '', + parameters.envMapEncoding ? getTexelDecodingFunction( 'envMapTexelToLinear', parameters.envMapEncoding ) : '', + parameters.emissiveMapEncoding ? getTexelDecodingFunction( 'emissiveMapTexelToLinear', parameters.emissiveMapEncoding ) : '', + parameters.outputEncoding ? getTexelEncodingFunction( "linearToOutputTexel", parameters.outputEncoding ) : '', + + parameters.depthPacking ? "#define DEPTH_PACKING " + material.depthPacking : '', + + '\n' + + ].filter( filterEmptyLine ).join( '\n' ); + + } + + vertexShader = parseIncludes( vertexShader, parameters ); + vertexShader = replaceLightNums( vertexShader, parameters ); + + fragmentShader = parseIncludes( fragmentShader, parameters ); + fragmentShader = replaceLightNums( fragmentShader, parameters ); + + if ( ! material.isShaderMaterial ) { + + vertexShader = unrollLoops( vertexShader ); + fragmentShader = unrollLoops( fragmentShader ); + + } + + var vertexGlsl = prefixVertex + vertexShader; + var fragmentGlsl = prefixFragment + fragmentShader; + + // console.log( '*VERTEX*', vertexGlsl ); + // console.log( '*FRAGMENT*', fragmentGlsl ); + + var glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl ); + var glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl ); + + gl.attachShader( program, glVertexShader ); + gl.attachShader( program, glFragmentShader ); + + // Force a particular attribute to index 0. + + if ( material.index0AttributeName !== undefined ) { + + gl.bindAttribLocation( program, 0, material.index0AttributeName ); + + } else if ( parameters.morphTargets === true ) { + + // programs with morphTargets displace position out of attribute 0 + gl.bindAttribLocation( program, 0, 'position' ); + + } + + gl.linkProgram( program ); + + var programLog = gl.getProgramInfoLog( program ); + var vertexLog = gl.getShaderInfoLog( glVertexShader ); + var fragmentLog = gl.getShaderInfoLog( glFragmentShader ); + + var runnable = true; + var haveDiagnostics = true; + + // console.log( '**VERTEX**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) ); + // console.log( '**FRAGMENT**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) ); + + if ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) { + + runnable = false; + + console.error( 'THREE.WebGLProgram: shader error: ', gl.getError(), 'gl.VALIDATE_STATUS', gl.getProgramParameter( program, gl.VALIDATE_STATUS ), 'gl.getProgramInfoLog', programLog, vertexLog, fragmentLog ); + + } else if ( programLog !== '' ) { + + console.warn( 'THREE.WebGLProgram: gl.getProgramInfoLog()', programLog ); + + } else if ( vertexLog === '' || fragmentLog === '' ) { + + haveDiagnostics = false; + + } + + if ( haveDiagnostics ) { + + this.diagnostics = { + + runnable: runnable, + material: material, + + programLog: programLog, + + vertexShader: { + + log: vertexLog, + prefix: prefixVertex + + }, + + fragmentShader: { + + log: fragmentLog, + prefix: prefixFragment + + } + + }; + + } + + // clean up + + gl.deleteShader( glVertexShader ); + gl.deleteShader( glFragmentShader ); + + // set up caching for uniform locations + + var cachedUniforms; + + this.getUniforms = function() { + + if ( cachedUniforms === undefined ) { + + cachedUniforms = + new WebGLUniforms( gl, program, renderer ); + + } + + return cachedUniforms; + + }; + + // set up caching for attribute locations + + var cachedAttributes; + + this.getAttributes = function() { + + if ( cachedAttributes === undefined ) { + + cachedAttributes = fetchAttributeLocations( gl, program ); + + } + + return cachedAttributes; + + }; + + // free resource + + this.destroy = function() { + + gl.deleteProgram( program ); + this.program = undefined; + + }; + + // DEPRECATED + + Object.defineProperties( this, { + + uniforms: { + get: function() { + + console.warn( 'THREE.WebGLProgram: .uniforms is now .getUniforms().' ); + return this.getUniforms(); + + } + }, + + attributes: { + get: function() { + + console.warn( 'THREE.WebGLProgram: .attributes is now .getAttributes().' ); + return this.getAttributes(); + + } + } + + } ); + + + // + + this.id = programIdCount ++; + this.code = code; + this.usedTimes = 1; + this.program = program; + this.vertexShader = glVertexShader; + this.fragmentShader = glFragmentShader; + + return this; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLPrograms( renderer, capabilities ) { + + var programs = []; + + var shaderIDs = { + MeshDepthMaterial: 'depth', + MeshNormalMaterial: 'normal', + MeshBasicMaterial: 'basic', + MeshLambertMaterial: 'lambert', + MeshPhongMaterial: 'phong', + MeshStandardMaterial: 'physical', + MeshPhysicalMaterial: 'physical', + LineBasicMaterial: 'basic', + LineDashedMaterial: 'dashed', + PointsMaterial: 'points' + }; + + var parameterNames = [ + "precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", + "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", + "roughnessMap", "metalnessMap", + "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", + "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", + "maxBones", "useVertexTexture", "morphTargets", "morphNormals", + "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", + "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", + "shadowMapEnabled", "shadowMapType", "toneMapping", 'physicallyCorrectLights', + "alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking" + ]; + + + function allocateBones( object ) { + + if ( capabilities.floatVertexTextures && object && object.skeleton && object.skeleton.useVertexTexture ) { + + return 1024; + + } else { + + // default for when object is not specified + // ( for example when prebuilding shader to be used with multiple objects ) + // + // - leave some extra space for other uniforms + // - limit here is ANGLE's 254 max uniform vectors + // (up to 54 should be safe) + + var nVertexUniforms = capabilities.maxVertexUniforms; + var nVertexMatrices = Math.floor( ( nVertexUniforms - 20 ) / 4 ); + + var maxBones = nVertexMatrices; + + if ( object !== undefined && (object && object.isSkinnedMesh) ) { + + maxBones = Math.min( object.skeleton.bones.length, maxBones ); + + if ( maxBones < object.skeleton.bones.length ) { + + console.warn( 'WebGLRenderer: too many bones - ' + object.skeleton.bones.length + ', this GPU supports just ' + maxBones + ' (try OpenGL instead of ANGLE)' ); + + } + + } + + return maxBones; + + } + + } + + function getTextureEncodingFromMap( map, gammaOverrideLinear ) { + + var encoding; + + if ( ! map ) { + + encoding = LinearEncoding; + + } else if ( (map && map.isTexture) ) { + + encoding = map.encoding; + + } else if ( (map && map.isWebGLRenderTarget) ) { + + console.warn( "THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead." ); + encoding = map.texture.encoding; + + } + + // add backwards compatibility for WebGLRenderer.gammaInput/gammaOutput parameter, should probably be removed at some point. + if ( encoding === LinearEncoding && gammaOverrideLinear ) { + + encoding = GammaEncoding; + + } + + return encoding; + + } + + this.getParameters = function ( material, lights, fog, nClipPlanes, nClipIntersection, object ) { + + var shaderID = shaderIDs[ material.type ]; + + // heuristics to create shader parameters according to lights in the scene + // (not to blow over maxLights budget) + + var maxBones = allocateBones( object ); + var precision = renderer.getPrecision(); + + if ( material.precision !== null ) { + + precision = capabilities.getMaxPrecision( material.precision ); + + if ( precision !== material.precision ) { + + console.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' ); + + } + + } + + var currentRenderTarget = renderer.getCurrentRenderTarget(); + + var parameters = { + + shaderID: shaderID, + + precision: precision, + supportsVertexTextures: capabilities.vertexTextures, + outputEncoding: getTextureEncodingFromMap( ( ! currentRenderTarget ) ? null : currentRenderTarget.texture, renderer.gammaOutput ), + map: !! material.map, + mapEncoding: getTextureEncodingFromMap( material.map, renderer.gammaInput ), + envMap: !! material.envMap, + envMapMode: material.envMap && material.envMap.mapping, + envMapEncoding: getTextureEncodingFromMap( material.envMap, renderer.gammaInput ), + envMapCubeUV: ( !! material.envMap ) && ( ( material.envMap.mapping === CubeUVReflectionMapping ) || ( material.envMap.mapping === CubeUVRefractionMapping ) ), + lightMap: !! material.lightMap, + aoMap: !! material.aoMap, + emissiveMap: !! material.emissiveMap, + emissiveMapEncoding: getTextureEncodingFromMap( material.emissiveMap, renderer.gammaInput ), + bumpMap: !! material.bumpMap, + normalMap: !! material.normalMap, + displacementMap: !! material.displacementMap, + roughnessMap: !! material.roughnessMap, + metalnessMap: !! material.metalnessMap, + specularMap: !! material.specularMap, + alphaMap: !! material.alphaMap, + + combine: material.combine, + + vertexColors: material.vertexColors, + + fog: !! fog, + useFog: material.fog, + fogExp: (fog && fog.isFogExp2), + + flatShading: material.shading === FlatShading, + + sizeAttenuation: material.sizeAttenuation, + logarithmicDepthBuffer: capabilities.logarithmicDepthBuffer, + + skinning: material.skinning, + maxBones: maxBones, + useVertexTexture: capabilities.floatVertexTextures && object && object.skeleton && object.skeleton.useVertexTexture, + + morphTargets: material.morphTargets, + morphNormals: material.morphNormals, + maxMorphTargets: renderer.maxMorphTargets, + maxMorphNormals: renderer.maxMorphNormals, + + numDirLights: lights.directional.length, + numPointLights: lights.point.length, + numSpotLights: lights.spot.length, + numHemiLights: lights.hemi.length, + + numClippingPlanes: nClipPlanes, + numClipIntersection: nClipIntersection, + + shadowMapEnabled: renderer.shadowMap.enabled && object.receiveShadow && lights.shadows.length > 0, + shadowMapType: renderer.shadowMap.type, + + toneMapping: renderer.toneMapping, + physicallyCorrectLights: renderer.physicallyCorrectLights, + + premultipliedAlpha: material.premultipliedAlpha, + + alphaTest: material.alphaTest, + doubleSided: material.side === DoubleSide, + flipSided: material.side === BackSide, + + depthPacking: ( material.depthPacking !== undefined ) ? material.depthPacking : false + + }; + + return parameters; + + }; + + this.getProgramCode = function ( material, parameters ) { + + var array = []; + + if ( parameters.shaderID ) { + + array.push( parameters.shaderID ); + + } else { + + array.push( material.fragmentShader ); + array.push( material.vertexShader ); + + } + + if ( material.defines !== undefined ) { + + for ( var name in material.defines ) { + + array.push( name ); + array.push( material.defines[ name ] ); + + } + + } + + for ( var i = 0; i < parameterNames.length; i ++ ) { + + array.push( parameters[ parameterNames[ i ] ] ); + + } + + return array.join(); + + }; + + this.acquireProgram = function ( material, parameters, code ) { + + var program; + + // Check if code has been already compiled + for ( var p = 0, pl = programs.length; p < pl; p ++ ) { + + var programInfo = programs[ p ]; + + if ( programInfo.code === code ) { + + program = programInfo; + ++ program.usedTimes; + + break; + + } + + } + + if ( program === undefined ) { + + program = new WebGLProgram( renderer, code, material, parameters ); + programs.push( program ); + + } + + return program; + + }; + + this.releaseProgram = function( program ) { + + if ( -- program.usedTimes === 0 ) { + + // Remove from unordered set + var i = programs.indexOf( program ); + programs[ i ] = programs[ programs.length - 1 ]; + programs.pop(); + + // Free WebGL resources + program.destroy(); + + } + + }; + + // Exposed for resource monitoring & error feedback via renderer.info: + this.programs = programs; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLGeometries( gl, properties, info ) { + + var geometries = {}; + + function onGeometryDispose( event ) { + + var geometry = event.target; + var buffergeometry = geometries[ geometry.id ]; + + if ( buffergeometry.index !== null ) { + + deleteAttribute( buffergeometry.index ); + + } + + deleteAttributes( buffergeometry.attributes ); + + geometry.removeEventListener( 'dispose', onGeometryDispose ); + + delete geometries[ geometry.id ]; + + // TODO + + var property = properties.get( geometry ); + + if ( property.wireframe ) { + + deleteAttribute( property.wireframe ); + + } + + properties.delete( geometry ); + + var bufferproperty = properties.get( buffergeometry ); + + if ( bufferproperty.wireframe ) { + + deleteAttribute( bufferproperty.wireframe ); + + } + + properties.delete( buffergeometry ); + + // + + info.memory.geometries --; + + } + + function getAttributeBuffer( attribute ) { + + if ( attribute.isInterleavedBufferAttribute ) { + + return properties.get( attribute.data ).__webglBuffer; + + } + + return properties.get( attribute ).__webglBuffer; + + } + + function deleteAttribute( attribute ) { + + var buffer = getAttributeBuffer( attribute ); + + if ( buffer !== undefined ) { + + gl.deleteBuffer( buffer ); + removeAttributeBuffer( attribute ); + + } + + } + + function deleteAttributes( attributes ) { + + for ( var name in attributes ) { + + deleteAttribute( attributes[ name ] ); + + } + + } + + function removeAttributeBuffer( attribute ) { + + if ( attribute.isInterleavedBufferAttribute ) { + + properties.delete( attribute.data ); + + } else { + + properties.delete( attribute ); + + } + + } + + return { + + get: function ( object ) { + + var geometry = object.geometry; + + if ( geometries[ geometry.id ] !== undefined ) { + + return geometries[ geometry.id ]; + + } + + geometry.addEventListener( 'dispose', onGeometryDispose ); + + var buffergeometry; + + if ( geometry.isBufferGeometry ) { + + buffergeometry = geometry; + + } else if ( geometry.isGeometry ) { + + if ( geometry._bufferGeometry === undefined ) { + + geometry._bufferGeometry = new BufferGeometry().setFromObject( object ); + + } + + buffergeometry = geometry._bufferGeometry; + + } + + geometries[ geometry.id ] = buffergeometry; + + info.memory.geometries ++; + + return buffergeometry; + + } + + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLObjects( gl, properties, info ) { + + var geometries = new WebGLGeometries( gl, properties, info ); + + // + + function update( object ) { + + // TODO: Avoid updating twice (when using shadowMap). Maybe add frame counter. + + var geometry = geometries.get( object ); + + if ( object.geometry.isGeometry ) { + + geometry.updateFromObject( object ); + + } + + var index = geometry.index; + var attributes = geometry.attributes; + + if ( index !== null ) { + + updateAttribute( index, gl.ELEMENT_ARRAY_BUFFER ); + + } + + for ( var name in attributes ) { + + updateAttribute( attributes[ name ], gl.ARRAY_BUFFER ); + + } + + // morph targets + + var morphAttributes = geometry.morphAttributes; + + for ( var name in morphAttributes ) { + + var array = morphAttributes[ name ]; + + for ( var i = 0, l = array.length; i < l; i ++ ) { + + updateAttribute( array[ i ], gl.ARRAY_BUFFER ); + + } + + } + + return geometry; + + } + + function updateAttribute( attribute, bufferType ) { + + var data = ( attribute.isInterleavedBufferAttribute ) ? attribute.data : attribute; + + var attributeProperties = properties.get( data ); + + if ( attributeProperties.__webglBuffer === undefined ) { + + createBuffer( attributeProperties, data, bufferType ); + + } else if ( attributeProperties.version !== data.version ) { + + updateBuffer( attributeProperties, data, bufferType ); + + } + + } + + function createBuffer( attributeProperties, data, bufferType ) { + + attributeProperties.__webglBuffer = gl.createBuffer(); + gl.bindBuffer( bufferType, attributeProperties.__webglBuffer ); + + var usage = data.dynamic ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW; + + gl.bufferData( bufferType, data.array, usage ); + + attributeProperties.version = data.version; + + } + + function updateBuffer( attributeProperties, data, bufferType ) { + + gl.bindBuffer( bufferType, attributeProperties.__webglBuffer ); + + if ( data.dynamic === false ) { + + gl.bufferData( bufferType, data.array, gl.STATIC_DRAW ); + + } else if ( data.updateRange.count === - 1 ) { + + // Not using update ranges + + gl.bufferSubData( bufferType, 0, data.array ); + + } else if ( data.updateRange.count === 0 ) { + + console.error( 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.' ); + + } else { + + gl.bufferSubData( bufferType, data.updateRange.offset * data.array.BYTES_PER_ELEMENT, + data.array.subarray( data.updateRange.offset, data.updateRange.offset + data.updateRange.count ) ); + + data.updateRange.count = 0; // reset range + + } + + attributeProperties.version = data.version; + + } + + function getAttributeBuffer( attribute ) { + + if ( attribute.isInterleavedBufferAttribute ) { + + return properties.get( attribute.data ).__webglBuffer; + + } + + return properties.get( attribute ).__webglBuffer; + + } + + function getWireframeAttribute( geometry ) { + + var property = properties.get( geometry ); + + if ( property.wireframe !== undefined ) { + + return property.wireframe; + + } + + var indices = []; + + var index = geometry.index; + var attributes = geometry.attributes; + var position = attributes.position; + + // console.time( 'wireframe' ); + + if ( index !== null ) { + + var edges = {}; + var array = index.array; + + for ( var i = 0, l = array.length; i < l; i += 3 ) { + + var a = array[ i + 0 ]; + var b = array[ i + 1 ]; + var c = array[ i + 2 ]; + + indices.push( a, b, b, c, c, a ); + + } + + } else { + + var array = attributes.position.array; + + for ( var i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) { + + var a = i + 0; + var b = i + 1; + var c = i + 2; + + indices.push( a, b, b, c, c, a ); + + } + + } + + // console.timeEnd( 'wireframe' ); + + var TypeArray = position.count > 65535 ? Uint32Array : Uint16Array; + var attribute = new BufferAttribute( new TypeArray( indices ), 1 ); + + updateAttribute( attribute, gl.ELEMENT_ARRAY_BUFFER ); + + property.wireframe = attribute; + + return attribute; + + } + + return { + + getAttributeBuffer: getAttributeBuffer, + getWireframeAttribute: getWireframeAttribute, + + update: update + + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLTextures( _gl, extensions, state, properties, capabilities, paramThreeToGL, info ) { + + var _infoMemory = info.memory; + var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext ); + + // + + function clampToMaxSize( image, maxSize ) { + + if ( image.width > maxSize || image.height > maxSize ) { + + // Warning: Scaling through the canvas will only work with images that use + // premultiplied alpha. + + var scale = maxSize / Math.max( image.width, image.height ); + + var canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); + canvas.width = Math.floor( image.width * scale ); + canvas.height = Math.floor( image.height * scale ); + + var context = canvas.getContext( '2d' ); + context.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height ); + + console.warn( 'THREE.WebGLRenderer: image is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height, image ); + + return canvas; + + } + + return image; + + } + + function isPowerOfTwo( image ) { + + return _Math.isPowerOfTwo( image.width ) && _Math.isPowerOfTwo( image.height ); + + } + + function makePowerOfTwo( image ) { + + if ( image instanceof HTMLImageElement || image instanceof HTMLCanvasElement ) { + + var canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); + canvas.width = _Math.nearestPowerOfTwo( image.width ); + canvas.height = _Math.nearestPowerOfTwo( image.height ); + + var context = canvas.getContext( '2d' ); + context.drawImage( image, 0, 0, canvas.width, canvas.height ); + + console.warn( 'THREE.WebGLRenderer: image is not power of two (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height, image ); + + return canvas; + + } + + return image; + + } + + function textureNeedsPowerOfTwo( texture ) { + + if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) return true; + if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) return true; + + return false; + + } + + // Fallback filters for non-power-of-2 textures + + function filterFallback( f ) { + + if ( f === NearestFilter || f === NearestMipMapNearestFilter || f === NearestMipMapLinearFilter ) { + + return _gl.NEAREST; + + } + + return _gl.LINEAR; + + } + + // + + function onTextureDispose( event ) { + + var texture = event.target; + + texture.removeEventListener( 'dispose', onTextureDispose ); + + deallocateTexture( texture ); + + _infoMemory.textures --; + + + } + + function onRenderTargetDispose( event ) { + + var renderTarget = event.target; + + renderTarget.removeEventListener( 'dispose', onRenderTargetDispose ); + + deallocateRenderTarget( renderTarget ); + + _infoMemory.textures --; + + } + + // + + function deallocateTexture( texture ) { + + var textureProperties = properties.get( texture ); + + if ( texture.image && textureProperties.__image__webglTextureCube ) { + + // cube texture + + _gl.deleteTexture( textureProperties.__image__webglTextureCube ); + + } else { + + // 2D texture + + if ( textureProperties.__webglInit === undefined ) return; + + _gl.deleteTexture( textureProperties.__webglTexture ); + + } + + // remove all webgl properties + properties.delete( texture ); + + } + + function deallocateRenderTarget( renderTarget ) { + + var renderTargetProperties = properties.get( renderTarget ); + var textureProperties = properties.get( renderTarget.texture ); + + if ( ! renderTarget ) return; + + if ( textureProperties.__webglTexture !== undefined ) { + + _gl.deleteTexture( textureProperties.__webglTexture ); + + } + + if ( renderTarget.depthTexture ) { + + renderTarget.depthTexture.dispose(); + + } + + if ( (renderTarget && renderTarget.isWebGLRenderTargetCube) ) { + + for ( var i = 0; i < 6; i ++ ) { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); + + } + + } else { + + _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); + if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); + + } + + properties.delete( renderTarget.texture ); + properties.delete( renderTarget ); + + } + + // + + + + function setTexture2D( texture, slot ) { + + var textureProperties = properties.get( texture ); + + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + + var image = texture.image; + + if ( image === undefined ) { + + console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined', texture ); + + } else if ( image.complete === false ) { + + console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete', texture ); + + } else { + + uploadTexture( textureProperties, texture, slot ); + return; + + } + + } + + state.activeTexture( _gl.TEXTURE0 + slot ); + state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); + + } + + function setTextureCube( texture, slot ) { + + var textureProperties = properties.get( texture ); + + if ( texture.image.length === 6 ) { + + if ( texture.version > 0 && textureProperties.__version !== texture.version ) { + + if ( ! textureProperties.__image__webglTextureCube ) { + + texture.addEventListener( 'dispose', onTextureDispose ); + + textureProperties.__image__webglTextureCube = _gl.createTexture(); + + _infoMemory.textures ++; + + } + + state.activeTexture( _gl.TEXTURE0 + slot ); + state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__image__webglTextureCube ); + + _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); + + var isCompressed = (texture && texture.isCompressedTexture); + var isDataTexture = (texture.image[ 0 ] && texture.image[ 0 ].isDataTexture); + + var cubeImage = []; + + for ( var i = 0; i < 6; i ++ ) { + + if ( ! isCompressed && ! isDataTexture ) { + + cubeImage[ i ] = clampToMaxSize( texture.image[ i ], capabilities.maxCubemapSize ); + + } else { + + cubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ]; + + } + + } + + var image = cubeImage[ 0 ], + isPowerOfTwoImage = isPowerOfTwo( image ), + glFormat = paramThreeToGL( texture.format ), + glType = paramThreeToGL( texture.type ); + + setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, isPowerOfTwoImage ); + + for ( var i = 0; i < 6; i ++ ) { + + if ( ! isCompressed ) { + + if ( isDataTexture ) { + + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); + + } else { + + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] ); + + } + + } else { + + var mipmap, mipmaps = cubeImage[ i ].mipmaps; + + for ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) { + + mipmap = mipmaps[ j ]; + + if ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) { + + if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { + + state.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + + } else { + + console.warn( "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()" ); + + } + + } else { + + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + + } + + } + + } + + } + + if ( texture.generateMipmaps && isPowerOfTwoImage ) { + + _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); + + } + + textureProperties.__version = texture.version; + + if ( texture.onUpdate ) texture.onUpdate( texture ); + + } else { + + state.activeTexture( _gl.TEXTURE0 + slot ); + state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__image__webglTextureCube ); + + } + + } + + } + + function setTextureCubeDynamic( texture, slot ) { + + state.activeTexture( _gl.TEXTURE0 + slot ); + state.bindTexture( _gl.TEXTURE_CUBE_MAP, properties.get( texture ).__webglTexture ); + + } + + function setTextureParameters( textureType, texture, isPowerOfTwoImage ) { + + var extension; + + if ( isPowerOfTwoImage ) { + + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, paramThreeToGL( texture.wrapS ) ); + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, paramThreeToGL( texture.wrapT ) ); + + _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, paramThreeToGL( texture.magFilter ) ); + _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, paramThreeToGL( texture.minFilter ) ); + + } else { + + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); + _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); + + if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) { + + console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', texture ); + + } + + _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterFallback( texture.magFilter ) ); + _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterFallback( texture.minFilter ) ); + + if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) { + + console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', texture ); + + } + + } + + extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + + if ( extension ) { + + if ( texture.type === FloatType && extensions.get( 'OES_texture_float_linear' ) === null ) return; + if ( texture.type === HalfFloatType && extensions.get( 'OES_texture_half_float_linear' ) === null ) return; + + if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) { + + _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) ); + properties.get( texture ).__currentAnisotropy = texture.anisotropy; + + } + + } + + } + + function uploadTexture( textureProperties, texture, slot ) { + + if ( textureProperties.__webglInit === undefined ) { + + textureProperties.__webglInit = true; + + texture.addEventListener( 'dispose', onTextureDispose ); + + textureProperties.__webglTexture = _gl.createTexture(); + + _infoMemory.textures ++; + + } + + state.activeTexture( _gl.TEXTURE0 + slot ); + state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); + + _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); + _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ); + _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment ); + + var image = clampToMaxSize( texture.image, capabilities.maxTextureSize ); + + if ( textureNeedsPowerOfTwo( texture ) && isPowerOfTwo( image ) === false ) { + + image = makePowerOfTwo( image ); + + } + + var isPowerOfTwoImage = isPowerOfTwo( image ), + glFormat = paramThreeToGL( texture.format ), + glType = paramThreeToGL( texture.type ); + + setTextureParameters( _gl.TEXTURE_2D, texture, isPowerOfTwoImage ); + + var mipmap, mipmaps = texture.mipmaps; + + if ( (texture && texture.isDepthTexture) ) { + + // populate depth texture with dummy data + + var internalFormat = _gl.DEPTH_COMPONENT; + + if ( texture.type === FloatType ) { + + if ( !_isWebGL2 ) throw new Error('Float Depth Texture only supported in WebGL2.0'); + internalFormat = _gl.DEPTH_COMPONENT32F; + + } else if ( _isWebGL2 ) { + + // WebGL 2.0 requires signed internalformat for glTexImage2D + internalFormat = _gl.DEPTH_COMPONENT16; + + } + + // Depth stencil textures need the DEPTH_STENCIL internal format + // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) + if ( texture.format === DepthStencilFormat ) { + + internalFormat = _gl.DEPTH_STENCIL; + + } + + state.texImage2D( _gl.TEXTURE_2D, 0, internalFormat, image.width, image.height, 0, glFormat, glType, null ); + + } else if ( (texture && texture.isDataTexture) ) { + + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels + + if ( mipmaps.length > 0 && isPowerOfTwoImage ) { + + for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + state.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + + } + + texture.generateMipmaps = false; + + } else { + + state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data ); + + } + + } else if ( (texture && texture.isCompressedTexture) ) { + + for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + + if ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) { + + if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { + + state.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + + } else { + + console.warn( "THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()" ); + + } + + } else { + + state.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + + } + + } + + } else { + + // regular Texture (image, video, canvas) + + // use manually created mipmaps if available + // if there are no manual mipmaps + // set 0 level mipmap and then use GL to generate other mipmap levels + + if ( mipmaps.length > 0 && isPowerOfTwoImage ) { + + for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { + + mipmap = mipmaps[ i ]; + state.texImage2D( _gl.TEXTURE_2D, i, glFormat, glFormat, glType, mipmap ); + + } + + texture.generateMipmaps = false; + + } else { + + state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, image ); + + } + + } + + if ( texture.generateMipmaps && isPowerOfTwoImage ) _gl.generateMipmap( _gl.TEXTURE_2D ); + + textureProperties.__version = texture.version; + + if ( texture.onUpdate ) texture.onUpdate( texture ); + + } + + // Render targets + + // Setup storage for target texture and bind it to correct framebuffer + function setupFrameBufferTexture( framebuffer, renderTarget, attachment, textureTarget ) { + + var glFormat = paramThreeToGL( renderTarget.texture.format ); + var glType = paramThreeToGL( renderTarget.texture.type ); + state.texImage2D( textureTarget, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); + _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 ); + _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); + + } + + // Setup storage for internal depth/stencil buffers and bind to correct framebuffer + function setupRenderBufferStorage( renderbuffer, renderTarget ) { + + _gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer ); + + if ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) { + + _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height ); + _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); + + } else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) { + + _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height ); + _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); + + } else { + + // FIXME: We don't support !depth !stencil + _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height ); + + } + + _gl.bindRenderbuffer( _gl.RENDERBUFFER, null ); + + } + + // Setup resources for a Depth Texture for a FBO (needs an extension) + function setupDepthTexture( framebuffer, renderTarget ) { + + var isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) ); + if ( isCube ) throw new Error('Depth Texture with cube render targets is not supported!'); + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); + + if ( !( (renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture) ) ) { + + throw new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture'); + + } + + // upload an empty depth texture with framebuffer size + if ( !properties.get( renderTarget.depthTexture ).__webglTexture || + renderTarget.depthTexture.image.width !== renderTarget.width || + renderTarget.depthTexture.image.height !== renderTarget.height ) { + renderTarget.depthTexture.image.width = renderTarget.width; + renderTarget.depthTexture.image.height = renderTarget.height; + renderTarget.depthTexture.needsUpdate = true; + } + + setTexture2D( renderTarget.depthTexture, 0 ); + + var webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture; + + if ( renderTarget.depthTexture.format === DepthFormat ) { + + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); + + } else if ( renderTarget.depthTexture.format === DepthStencilFormat ) { + + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); + + } else { + + throw new Error('Unknown depthTexture format') + + } + + } + + // Setup GL resources for a non-texture depth buffer + function setupDepthRenderbuffer( renderTarget ) { + + var renderTargetProperties = properties.get( renderTarget ); + + var isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) ); + + if ( renderTarget.depthTexture ) { + + if ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets'); + + setupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget ); + + } else { + + if ( isCube ) { + + renderTargetProperties.__webglDepthbuffer = []; + + for ( var i = 0; i < 6; i ++ ) { + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] ); + renderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget ); + + } + + } else { + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); + renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer(); + setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget ); + + } + + } + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); + + } + + // Set up GL resources for the render target + function setupRenderTarget( renderTarget ) { + + var renderTargetProperties = properties.get( renderTarget ); + var textureProperties = properties.get( renderTarget.texture ); + + renderTarget.addEventListener( 'dispose', onRenderTargetDispose ); + + textureProperties.__webglTexture = _gl.createTexture(); + + _infoMemory.textures ++; + + var isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) ); + var isTargetPowerOfTwo = isPowerOfTwo( renderTarget ); + + // Setup framebuffer + + if ( isCube ) { + + renderTargetProperties.__webglFramebuffer = []; + + for ( var i = 0; i < 6; i ++ ) { + + renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); + + } + + } else { + + renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); + + } + + // Setup color buffer + + if ( isCube ) { + + state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture ); + setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo ); + + for ( var i = 0; i < 6; i ++ ) { + + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); + + } + + if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); + state.bindTexture( _gl.TEXTURE_CUBE_MAP, null ); + + } else { + + state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); + setTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo ); + setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D ); + + if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D ); + state.bindTexture( _gl.TEXTURE_2D, null ); + + } + + // Setup depth and stencil buffers + + if ( renderTarget.depthBuffer ) { + + setupDepthRenderbuffer( renderTarget ); + + } + + } + + function updateRenderTargetMipmap( renderTarget ) { + + var texture = renderTarget.texture; + + if ( texture.generateMipmaps && isPowerOfTwo( renderTarget ) && + texture.minFilter !== NearestFilter && + texture.minFilter !== LinearFilter ) { + + var target = (renderTarget && renderTarget.isWebGLRenderTargetCube) ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D; + var webglTexture = properties.get( texture ).__webglTexture; + + state.bindTexture( target, webglTexture ); + _gl.generateMipmap( target ); + state.bindTexture( target, null ); + + } + + } + + this.setTexture2D = setTexture2D; + this.setTextureCube = setTextureCube; + this.setTextureCubeDynamic = setTextureCubeDynamic; + this.setupRenderTarget = setupRenderTarget; + this.updateRenderTargetMipmap = updateRenderTargetMipmap; + + } + + /** + * @author fordacious / fordacious.github.io + */ + + function WebGLProperties() { + + var properties = {}; + + return { + + get: function ( object ) { + + var uuid = object.uuid; + var map = properties[ uuid ]; + + if ( map === undefined ) { + + map = {}; + properties[ uuid ] = map; + + } + + return map; + + }, + + delete: function ( object ) { + + delete properties[ object.uuid ]; + + }, + + clear: function () { + + properties = {}; + + } + + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLState( gl, extensions, paramThreeToGL ) { + + function ColorBuffer() { + + var locked = false; + + var color = new Vector4(); + var currentColorMask = null; + var currentColorClear = new Vector4(); + + return { + + setMask: function ( colorMask ) { + + if ( currentColorMask !== colorMask && ! locked ) { + + gl.colorMask( colorMask, colorMask, colorMask, colorMask ); + currentColorMask = colorMask; + + } + + }, + + setLocked: function ( lock ) { + + locked = lock; + + }, + + setClear: function ( r, g, b, a ) { + + color.set( r, g, b, a ); + + if ( currentColorClear.equals( color ) === false ) { + + gl.clearColor( r, g, b, a ); + currentColorClear.copy( color ); + + } + + }, + + reset: function () { + + locked = false; + + currentColorMask = null; + currentColorClear.set( 0, 0, 0, 1 ); + + } + + }; + + } + + function DepthBuffer() { + + var locked = false; + + var currentDepthMask = null; + var currentDepthFunc = null; + var currentDepthClear = null; + + return { + + setTest: function ( depthTest ) { + + if ( depthTest ) { + + enable( gl.DEPTH_TEST ); + + } else { + + disable( gl.DEPTH_TEST ); + + } + + }, + + setMask: function ( depthMask ) { + + if ( currentDepthMask !== depthMask && ! locked ) { + + gl.depthMask( depthMask ); + currentDepthMask = depthMask; + + } + + }, + + setFunc: function ( depthFunc ) { + + if ( currentDepthFunc !== depthFunc ) { + + if ( depthFunc ) { + + switch ( depthFunc ) { + + case NeverDepth: + + gl.depthFunc( gl.NEVER ); + break; + + case AlwaysDepth: + + gl.depthFunc( gl.ALWAYS ); + break; + + case LessDepth: + + gl.depthFunc( gl.LESS ); + break; + + case LessEqualDepth: + + gl.depthFunc( gl.LEQUAL ); + break; + + case EqualDepth: + + gl.depthFunc( gl.EQUAL ); + break; + + case GreaterEqualDepth: + + gl.depthFunc( gl.GEQUAL ); + break; + + case GreaterDepth: + + gl.depthFunc( gl.GREATER ); + break; + + case NotEqualDepth: + + gl.depthFunc( gl.NOTEQUAL ); + break; + + default: + + gl.depthFunc( gl.LEQUAL ); + + } + + } else { + + gl.depthFunc( gl.LEQUAL ); + + } + + currentDepthFunc = depthFunc; + + } + + }, + + setLocked: function ( lock ) { + + locked = lock; + + }, + + setClear: function ( depth ) { + + if ( currentDepthClear !== depth ) { + + gl.clearDepth( depth ); + currentDepthClear = depth; + + } + + }, + + reset: function () { + + locked = false; + + currentDepthMask = null; + currentDepthFunc = null; + currentDepthClear = null; + + } + + }; + + } + + function StencilBuffer() { + + var locked = false; + + var currentStencilMask = null; + var currentStencilFunc = null; + var currentStencilRef = null; + var currentStencilFuncMask = null; + var currentStencilFail = null; + var currentStencilZFail = null; + var currentStencilZPass = null; + var currentStencilClear = null; + + return { + + setTest: function ( stencilTest ) { + + if ( stencilTest ) { + + enable( gl.STENCIL_TEST ); + + } else { + + disable( gl.STENCIL_TEST ); + + } + + }, + + setMask: function ( stencilMask ) { + + if ( currentStencilMask !== stencilMask && ! locked ) { + + gl.stencilMask( stencilMask ); + currentStencilMask = stencilMask; + + } + + }, + + setFunc: function ( stencilFunc, stencilRef, stencilMask ) { + + if ( currentStencilFunc !== stencilFunc || + currentStencilRef !== stencilRef || + currentStencilFuncMask !== stencilMask ) { + + gl.stencilFunc( stencilFunc, stencilRef, stencilMask ); + + currentStencilFunc = stencilFunc; + currentStencilRef = stencilRef; + currentStencilFuncMask = stencilMask; + + } + + }, + + setOp: function ( stencilFail, stencilZFail, stencilZPass ) { + + if ( currentStencilFail !== stencilFail || + currentStencilZFail !== stencilZFail || + currentStencilZPass !== stencilZPass ) { + + gl.stencilOp( stencilFail, stencilZFail, stencilZPass ); + + currentStencilFail = stencilFail; + currentStencilZFail = stencilZFail; + currentStencilZPass = stencilZPass; + + } + + }, + + setLocked: function ( lock ) { + + locked = lock; + + }, + + setClear: function ( stencil ) { + + if ( currentStencilClear !== stencil ) { + + gl.clearStencil( stencil ); + currentStencilClear = stencil; + + } + + }, + + reset: function () { + + locked = false; + + currentStencilMask = null; + currentStencilFunc = null; + currentStencilRef = null; + currentStencilFuncMask = null; + currentStencilFail = null; + currentStencilZFail = null; + currentStencilZPass = null; + currentStencilClear = null; + + } + + }; + + } + + // + + var colorBuffer = new ColorBuffer(); + var depthBuffer = new DepthBuffer(); + var stencilBuffer = new StencilBuffer(); + + var maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); + var newAttributes = new Uint8Array( maxVertexAttributes ); + var enabledAttributes = new Uint8Array( maxVertexAttributes ); + var attributeDivisors = new Uint8Array( maxVertexAttributes ); + + var capabilities = {}; + + var compressedTextureFormats = null; + + var currentBlending = null; + var currentBlendEquation = null; + var currentBlendSrc = null; + var currentBlendDst = null; + var currentBlendEquationAlpha = null; + var currentBlendSrcAlpha = null; + var currentBlendDstAlpha = null; + var currentPremultipledAlpha = false; + + var currentFlipSided = null; + var currentCullFace = null; + + var currentLineWidth = null; + + var currentPolygonOffsetFactor = null; + var currentPolygonOffsetUnits = null; + + var currentScissorTest = null; + + var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ); + + var currentTextureSlot = null; + var currentBoundTextures = {}; + + var currentScissor = new Vector4(); + var currentViewport = new Vector4(); + + function createTexture( type, target, count ) { + + var data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4. + var texture = gl.createTexture(); + + gl.bindTexture( type, texture ); + gl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); + gl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); + + for ( var i = 0; i < count; i ++ ) { + + gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data ); + + } + + return texture; + + } + + var emptyTextures = {}; + emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 ); + emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 ); + + // + + function init() { + + clearColor( 0, 0, 0, 1 ); + clearDepth( 1 ); + clearStencil( 0 ); + + enable( gl.DEPTH_TEST ); + setDepthFunc( LessEqualDepth ); + + setFlipSided( false ); + setCullFace( CullFaceBack ); + enable( gl.CULL_FACE ); + + enable( gl.BLEND ); + setBlending( NormalBlending ); + + } + + function initAttributes() { + + for ( var i = 0, l = newAttributes.length; i < l; i ++ ) { + + newAttributes[ i ] = 0; + + } + + } + + function enableAttribute( attribute ) { + + newAttributes[ attribute ] = 1; + + if ( enabledAttributes[ attribute ] === 0 ) { + + gl.enableVertexAttribArray( attribute ); + enabledAttributes[ attribute ] = 1; + + } + + if ( attributeDivisors[ attribute ] !== 0 ) { + + var extension = extensions.get( 'ANGLE_instanced_arrays' ); + + extension.vertexAttribDivisorANGLE( attribute, 0 ); + attributeDivisors[ attribute ] = 0; + + } + + } + + function enableAttributeAndDivisor( attribute, meshPerAttribute, extension ) { + + newAttributes[ attribute ] = 1; + + if ( enabledAttributes[ attribute ] === 0 ) { + + gl.enableVertexAttribArray( attribute ); + enabledAttributes[ attribute ] = 1; + + } + + if ( attributeDivisors[ attribute ] !== meshPerAttribute ) { + + extension.vertexAttribDivisorANGLE( attribute, meshPerAttribute ); + attributeDivisors[ attribute ] = meshPerAttribute; + + } + + } + + function disableUnusedAttributes() { + + for ( var i = 0, l = enabledAttributes.length; i !== l; ++ i ) { + + if ( enabledAttributes[ i ] !== newAttributes[ i ] ) { + + gl.disableVertexAttribArray( i ); + enabledAttributes[ i ] = 0; + + } + + } + + } + + function enable( id ) { + + if ( capabilities[ id ] !== true ) { + + gl.enable( id ); + capabilities[ id ] = true; + + } + + } + + function disable( id ) { + + if ( capabilities[ id ] !== false ) { + + gl.disable( id ); + capabilities[ id ] = false; + + } + + } + + function getCompressedTextureFormats() { + + if ( compressedTextureFormats === null ) { + + compressedTextureFormats = []; + + if ( extensions.get( 'WEBGL_compressed_texture_pvrtc' ) || + extensions.get( 'WEBGL_compressed_texture_s3tc' ) || + extensions.get( 'WEBGL_compressed_texture_etc1' ) ) { + + var formats = gl.getParameter( gl.COMPRESSED_TEXTURE_FORMATS ); + + for ( var i = 0; i < formats.length; i ++ ) { + + compressedTextureFormats.push( formats[ i ] ); + + } + + } + + } + + return compressedTextureFormats; + + } + + function setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) { + + if ( blending !== NoBlending ) { + + enable( gl.BLEND ); + + } else { + + disable( gl.BLEND ); + + } + + if ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) { + + if ( blending === AdditiveBlending ) { + + if ( premultipliedAlpha ) { + + gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); + gl.blendFuncSeparate( gl.ONE, gl.ONE, gl.ONE, gl.ONE ); + + } else { + + gl.blendEquation( gl.FUNC_ADD ); + gl.blendFunc( gl.SRC_ALPHA, gl.ONE ); + + } + + } else if ( blending === SubtractiveBlending ) { + + if ( premultipliedAlpha ) { + + gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); + gl.blendFuncSeparate( gl.ZERO, gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ONE_MINUS_SRC_ALPHA ); + + } else { + + gl.blendEquation( gl.FUNC_ADD ); + gl.blendFunc( gl.ZERO, gl.ONE_MINUS_SRC_COLOR ); + + } + + } else if ( blending === MultiplyBlending ) { + + if ( premultipliedAlpha ) { + + gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); + gl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA ); + + } else { + + gl.blendEquation( gl.FUNC_ADD ); + gl.blendFunc( gl.ZERO, gl.SRC_COLOR ); + + } + + } else { + + if ( premultipliedAlpha ) { + + gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); + gl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); + + } else { + + gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD ); + gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); + + } + + } + + currentBlending = blending; + currentPremultipledAlpha = premultipliedAlpha; + + } + + if ( blending === CustomBlending ) { + + blendEquationAlpha = blendEquationAlpha || blendEquation; + blendSrcAlpha = blendSrcAlpha || blendSrc; + blendDstAlpha = blendDstAlpha || blendDst; + + if ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) { + + gl.blendEquationSeparate( paramThreeToGL( blendEquation ), paramThreeToGL( blendEquationAlpha ) ); + + currentBlendEquation = blendEquation; + currentBlendEquationAlpha = blendEquationAlpha; + + } + + if ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) { + + gl.blendFuncSeparate( paramThreeToGL( blendSrc ), paramThreeToGL( blendDst ), paramThreeToGL( blendSrcAlpha ), paramThreeToGL( blendDstAlpha ) ); + + currentBlendSrc = blendSrc; + currentBlendDst = blendDst; + currentBlendSrcAlpha = blendSrcAlpha; + currentBlendDstAlpha = blendDstAlpha; + + } + + } else { + + currentBlendEquation = null; + currentBlendSrc = null; + currentBlendDst = null; + currentBlendEquationAlpha = null; + currentBlendSrcAlpha = null; + currentBlendDstAlpha = null; + + } + + } + + // TODO Deprecate + + function setColorWrite( colorWrite ) { + + colorBuffer.setMask( colorWrite ); + + } + + function setDepthTest( depthTest ) { + + depthBuffer.setTest( depthTest ); + + } + + function setDepthWrite( depthWrite ) { + + depthBuffer.setMask( depthWrite ); + + } + + function setDepthFunc( depthFunc ) { + + depthBuffer.setFunc( depthFunc ); + + } + + function setStencilTest( stencilTest ) { + + stencilBuffer.setTest( stencilTest ); + + } + + function setStencilWrite( stencilWrite ) { + + stencilBuffer.setMask( stencilWrite ); + + } + + function setStencilFunc( stencilFunc, stencilRef, stencilMask ) { + + stencilBuffer.setFunc( stencilFunc, stencilRef, stencilMask ); + + } + + function setStencilOp( stencilFail, stencilZFail, stencilZPass ) { + + stencilBuffer.setOp( stencilFail, stencilZFail, stencilZPass ); + + } + + // + + function setFlipSided( flipSided ) { + + if ( currentFlipSided !== flipSided ) { + + if ( flipSided ) { + + gl.frontFace( gl.CW ); + + } else { + + gl.frontFace( gl.CCW ); + + } + + currentFlipSided = flipSided; + + } + + } + + function setCullFace( cullFace ) { + + if ( cullFace !== CullFaceNone ) { + + enable( gl.CULL_FACE ); + + if ( cullFace !== currentCullFace ) { + + if ( cullFace === CullFaceBack ) { + + gl.cullFace( gl.BACK ); + + } else if ( cullFace === CullFaceFront ) { + + gl.cullFace( gl.FRONT ); + + } else { + + gl.cullFace( gl.FRONT_AND_BACK ); + + } + + } + + } else { + + disable( gl.CULL_FACE ); + + } + + currentCullFace = cullFace; + + } + + function setLineWidth( width ) { + + if ( width !== currentLineWidth ) { + + gl.lineWidth( width ); + + currentLineWidth = width; + + } + + } + + function setPolygonOffset( polygonOffset, factor, units ) { + + if ( polygonOffset ) { + + enable( gl.POLYGON_OFFSET_FILL ); + + if ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) { + + gl.polygonOffset( factor, units ); + + currentPolygonOffsetFactor = factor; + currentPolygonOffsetUnits = units; + + } + + } else { + + disable( gl.POLYGON_OFFSET_FILL ); + + } + + } + + function getScissorTest() { + + return currentScissorTest; + + } + + function setScissorTest( scissorTest ) { + + currentScissorTest = scissorTest; + + if ( scissorTest ) { + + enable( gl.SCISSOR_TEST ); + + } else { + + disable( gl.SCISSOR_TEST ); + + } + + } + + // texture + + function activeTexture( webglSlot ) { + + if ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1; + + if ( currentTextureSlot !== webglSlot ) { + + gl.activeTexture( webglSlot ); + currentTextureSlot = webglSlot; + + } + + } + + function bindTexture( webglType, webglTexture ) { + + if ( currentTextureSlot === null ) { + + activeTexture(); + + } + + var boundTexture = currentBoundTextures[ currentTextureSlot ]; + + if ( boundTexture === undefined ) { + + boundTexture = { type: undefined, texture: undefined }; + currentBoundTextures[ currentTextureSlot ] = boundTexture; + + } + + if ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) { + + gl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] ); + + boundTexture.type = webglType; + boundTexture.texture = webglTexture; + + } + + } + + function compressedTexImage2D() { + + try { + + gl.compressedTexImage2D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( error ); + + } + + } + + function texImage2D() { + + try { + + gl.texImage2D.apply( gl, arguments ); + + } catch ( error ) { + + console.error( error ); + + } + + } + + // TODO Deprecate + + function clearColor( r, g, b, a ) { + + colorBuffer.setClear( r, g, b, a ); + + } + + function clearDepth( depth ) { + + depthBuffer.setClear( depth ); + + } + + function clearStencil( stencil ) { + + stencilBuffer.setClear( stencil ); + + } + + // + + function scissor( scissor ) { + + if ( currentScissor.equals( scissor ) === false ) { + + gl.scissor( scissor.x, scissor.y, scissor.z, scissor.w ); + currentScissor.copy( scissor ); + + } + + } + + function viewport( viewport ) { + + if ( currentViewport.equals( viewport ) === false ) { + + gl.viewport( viewport.x, viewport.y, viewport.z, viewport.w ); + currentViewport.copy( viewport ); + + } + + } + + // + + function reset() { + + for ( var i = 0; i < enabledAttributes.length; i ++ ) { + + if ( enabledAttributes[ i ] === 1 ) { + + gl.disableVertexAttribArray( i ); + enabledAttributes[ i ] = 0; + + } + + } + + capabilities = {}; + + compressedTextureFormats = null; + + currentTextureSlot = null; + currentBoundTextures = {}; + + currentBlending = null; + + currentFlipSided = null; + currentCullFace = null; + + colorBuffer.reset(); + depthBuffer.reset(); + stencilBuffer.reset(); + + } + + return { + + buffers: { + color: colorBuffer, + depth: depthBuffer, + stencil: stencilBuffer + }, + + init: init, + initAttributes: initAttributes, + enableAttribute: enableAttribute, + enableAttributeAndDivisor: enableAttributeAndDivisor, + disableUnusedAttributes: disableUnusedAttributes, + enable: enable, + disable: disable, + getCompressedTextureFormats: getCompressedTextureFormats, + + setBlending: setBlending, + + setColorWrite: setColorWrite, + setDepthTest: setDepthTest, + setDepthWrite: setDepthWrite, + setDepthFunc: setDepthFunc, + setStencilTest: setStencilTest, + setStencilWrite: setStencilWrite, + setStencilFunc: setStencilFunc, + setStencilOp: setStencilOp, + + setFlipSided: setFlipSided, + setCullFace: setCullFace, + + setLineWidth: setLineWidth, + setPolygonOffset: setPolygonOffset, + + getScissorTest: getScissorTest, + setScissorTest: setScissorTest, + + activeTexture: activeTexture, + bindTexture: bindTexture, + compressedTexImage2D: compressedTexImage2D, + texImage2D: texImage2D, + + clearColor: clearColor, + clearDepth: clearDepth, + clearStencil: clearStencil, + + scissor: scissor, + viewport: viewport, + + reset: reset + + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLCapabilities( gl, extensions, parameters ) { + + var maxAnisotropy; + + function getMaxAnisotropy() { + + if ( maxAnisotropy !== undefined ) return maxAnisotropy; + + var extension = extensions.get( 'EXT_texture_filter_anisotropic' ); + + if ( extension !== null ) { + + maxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT ); + + } else { + + maxAnisotropy = 0; + + } + + return maxAnisotropy; + + } + + function getMaxPrecision( precision ) { + + if ( precision === 'highp' ) { + + if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 && + gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) { + + return 'highp'; + + } + + precision = 'mediump'; + + } + + if ( precision === 'mediump' ) { + + if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 && + gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) { + + return 'mediump'; + + } + + } + + return 'lowp'; + + } + + var precision = parameters.precision !== undefined ? parameters.precision : 'highp'; + var maxPrecision = getMaxPrecision( precision ); + + if ( maxPrecision !== precision ) { + + console.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' ); + precision = maxPrecision; + + } + + var logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true && !! extensions.get( 'EXT_frag_depth' ); + + var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ); + var maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ); + var maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE ); + var maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE ); + + var maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); + var maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS ); + var maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS ); + var maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS ); + + var vertexTextures = maxVertexTextures > 0; + var floatFragmentTextures = !! extensions.get( 'OES_texture_float' ); + var floatVertexTextures = vertexTextures && floatFragmentTextures; + + return { + + getMaxAnisotropy: getMaxAnisotropy, + getMaxPrecision: getMaxPrecision, + + precision: precision, + logarithmicDepthBuffer: logarithmicDepthBuffer, + + maxTextures: maxTextures, + maxVertexTextures: maxVertexTextures, + maxTextureSize: maxTextureSize, + maxCubemapSize: maxCubemapSize, + + maxAttributes: maxAttributes, + maxVertexUniforms: maxVertexUniforms, + maxVaryings: maxVaryings, + maxFragmentUniforms: maxFragmentUniforms, + + vertexTextures: vertexTextures, + floatFragmentTextures: floatFragmentTextures, + floatVertexTextures: floatVertexTextures + + }; + + } + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WebGLExtensions( gl ) { + + var extensions = {}; + + return { + + get: function ( name ) { + + if ( extensions[ name ] !== undefined ) { + + return extensions[ name ]; + + } + + var extension; + + switch ( name ) { + + case 'WEBGL_depth_texture': + extension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' ); + break; + + case 'EXT_texture_filter_anisotropic': + extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); + break; + + case 'WEBGL_compressed_texture_s3tc': + extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' ); + break; + + case 'WEBGL_compressed_texture_pvrtc': + extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' ); + break; + + case 'WEBGL_compressed_texture_etc1': + extension = gl.getExtension( 'WEBGL_compressed_texture_etc1' ); + break; + + default: + extension = gl.getExtension( name ); + + } + + if ( extension === null ) { + + console.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' ); + + } + + extensions[ name ] = extension; + + return extension; + + } + + }; + + } + + /** + * @author tschw + */ + + function WebGLClipping() { + + var scope = this, + + globalState = null, + numGlobalPlanes = 0, + localClippingEnabled = false, + renderingShadows = false, + + plane = new Plane(), + viewNormalMatrix = new Matrix3(), + + uniform = { value: null, needsUpdate: false }; + + this.uniform = uniform; + this.numPlanes = 0; + this.numIntersection = 0; + + this.init = function( planes, enableLocalClipping, camera ) { + + var enabled = + planes.length !== 0 || + enableLocalClipping || + // enable state of previous frame - the clipping code has to + // run another frame in order to reset the state: + numGlobalPlanes !== 0 || + localClippingEnabled; + + localClippingEnabled = enableLocalClipping; + + globalState = projectPlanes( planes, camera, 0 ); + numGlobalPlanes = planes.length; + + return enabled; + + }; + + this.beginShadows = function() { + + renderingShadows = true; + projectPlanes( null ); + + }; + + this.endShadows = function() { + + renderingShadows = false; + resetGlobalState(); + + }; + + this.setState = function( planes, clipIntersection, clipShadows, camera, cache, fromCache ) { + + if ( ! localClippingEnabled || + planes === null || planes.length === 0 || + renderingShadows && ! clipShadows ) { + // there's no local clipping + + if ( renderingShadows ) { + // there's no global clipping + + projectPlanes( null ); + + } else { + + resetGlobalState(); + } + + } else { + + var nGlobal = renderingShadows ? 0 : numGlobalPlanes, + lGlobal = nGlobal * 4, + + dstArray = cache.clippingState || null; + + uniform.value = dstArray; // ensure unique state + + dstArray = projectPlanes( planes, camera, lGlobal, fromCache ); + + for ( var i = 0; i !== lGlobal; ++ i ) { + + dstArray[ i ] = globalState[ i ]; + + } + + cache.clippingState = dstArray; + this.numIntersection = clipIntersection ? this.numPlanes : 0; + this.numPlanes += nGlobal; + + } + + + }; + + function resetGlobalState() { + + if ( uniform.value !== globalState ) { + + uniform.value = globalState; + uniform.needsUpdate = numGlobalPlanes > 0; + + } + + scope.numPlanes = numGlobalPlanes; + scope.numIntersection = 0; + + } + + function projectPlanes( planes, camera, dstOffset, skipTransform ) { + + var nPlanes = planes !== null ? planes.length : 0, + dstArray = null; + + if ( nPlanes !== 0 ) { + + dstArray = uniform.value; + + if ( skipTransform !== true || dstArray === null ) { + + var flatSize = dstOffset + nPlanes * 4, + viewMatrix = camera.matrixWorldInverse; + + viewNormalMatrix.getNormalMatrix( viewMatrix ); + + if ( dstArray === null || dstArray.length < flatSize ) { + + dstArray = new Float32Array( flatSize ); + + } + + for ( var i = 0, i4 = dstOffset; + i !== nPlanes; ++ i, i4 += 4 ) { + + plane.copy( planes[ i ] ). + applyMatrix4( viewMatrix, viewNormalMatrix ); + + plane.normal.toArray( dstArray, i4 ); + dstArray[ i4 + 3 ] = plane.constant; + + } + + } + + uniform.value = dstArray; + uniform.needsUpdate = true; + + } + + scope.numPlanes = nPlanes; + + return dstArray; + + } + + } + + /** + * @author supereggbert / http://www.paulbrunt.co.uk/ + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * @author szimek / https://github.com/szimek/ + * @author tschw + */ + + function WebGLRenderer( parameters ) { + + console.log( 'THREE.WebGLRenderer', REVISION ); + + parameters = parameters || {}; + + var _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ), + _context = parameters.context !== undefined ? parameters.context : null, + + _alpha = parameters.alpha !== undefined ? parameters.alpha : false, + _depth = parameters.depth !== undefined ? parameters.depth : true, + _stencil = parameters.stencil !== undefined ? parameters.stencil : true, + _antialias = parameters.antialias !== undefined ? parameters.antialias : false, + _premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true, + _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false; + + var lights = []; + + var opaqueObjects = []; + var opaqueObjectsLastIndex = - 1; + var transparentObjects = []; + var transparentObjectsLastIndex = - 1; + + var morphInfluences = new Float32Array( 8 ); + + var sprites = []; + var lensFlares = []; + + // public properties + + this.domElement = _canvas; + this.context = null; + + // clearing + + this.autoClear = true; + this.autoClearColor = true; + this.autoClearDepth = true; + this.autoClearStencil = true; + + // scene graph + + this.sortObjects = true; + + // user-defined clipping + + this.clippingPlanes = []; + this.localClippingEnabled = false; + + // physically based shading + + this.gammaFactor = 2.0; // for backwards compatibility + this.gammaInput = false; + this.gammaOutput = false; + + // physical lights + + this.physicallyCorrectLights = false; + + // tone mapping + + this.toneMapping = LinearToneMapping; + this.toneMappingExposure = 1.0; + this.toneMappingWhitePoint = 1.0; + + // morphs + + this.maxMorphTargets = 8; + this.maxMorphNormals = 4; + + // internal properties + + var _this = this, + + // internal state cache + + _currentProgram = null, + _currentRenderTarget = null, + _currentFramebuffer = null, + _currentMaterialId = - 1, + _currentGeometryProgram = '', + _currentCamera = null, + + _currentScissor = new Vector4(), + _currentScissorTest = null, + + _currentViewport = new Vector4(), + + // + + _usedTextureUnits = 0, + + // + + _clearColor = new Color( 0x000000 ), + _clearAlpha = 0, + + _width = _canvas.width, + _height = _canvas.height, + + _pixelRatio = 1, + + _scissor = new Vector4( 0, 0, _width, _height ), + _scissorTest = false, + + _viewport = new Vector4( 0, 0, _width, _height ), + + // frustum + + _frustum = new Frustum(), + + // clipping + + _clipping = new WebGLClipping(), + _clippingEnabled = false, + _localClippingEnabled = false, + + _sphere = new Sphere(), + + // camera matrices cache + + _projScreenMatrix = new Matrix4(), + + _vector3 = new Vector3(), + + // light arrays cache + + _lights = { + + hash: '', + + ambient: [ 0, 0, 0 ], + directional: [], + directionalShadowMap: [], + directionalShadowMatrix: [], + spot: [], + spotShadowMap: [], + spotShadowMatrix: [], + point: [], + pointShadowMap: [], + pointShadowMatrix: [], + hemi: [], + + shadows: [] + + }, + + // info + + _infoRender = { + + calls: 0, + vertices: 0, + faces: 0, + points: 0 + + }; + + this.info = { + + render: _infoRender, + memory: { + + geometries: 0, + textures: 0 + + }, + programs: null + + }; + + + // initialize + + var _gl; + + try { + + var attributes = { + alpha: _alpha, + depth: _depth, + stencil: _stencil, + antialias: _antialias, + premultipliedAlpha: _premultipliedAlpha, + preserveDrawingBuffer: _preserveDrawingBuffer + }; + + _gl = _context || _canvas.getContext( 'webgl', attributes ) || _canvas.getContext( 'experimental-webgl', attributes ); + + if ( _gl === null ) { + + if ( _canvas.getContext( 'webgl' ) !== null ) { + + throw 'Error creating WebGL context with your selected attributes.'; + + } else { + + throw 'Error creating WebGL context.'; + + } + + } + + // Some experimental-webgl implementations do not have getShaderPrecisionFormat + + if ( _gl.getShaderPrecisionFormat === undefined ) { + + _gl.getShaderPrecisionFormat = function () { + + return { 'rangeMin': 1, 'rangeMax': 1, 'precision': 1 }; + + }; + + } + + _canvas.addEventListener( 'webglcontextlost', onContextLost, false ); + + } catch ( error ) { + + console.error( 'THREE.WebGLRenderer: ' + error ); + + } + + var extensions = new WebGLExtensions( _gl ); + + extensions.get( 'WEBGL_depth_texture' ); + extensions.get( 'OES_texture_float' ); + extensions.get( 'OES_texture_float_linear' ); + extensions.get( 'OES_texture_half_float' ); + extensions.get( 'OES_texture_half_float_linear' ); + extensions.get( 'OES_standard_derivatives' ); + extensions.get( 'ANGLE_instanced_arrays' ); + + if ( extensions.get( 'OES_element_index_uint' ) ) { + + BufferGeometry.MaxIndex = 4294967296; + + } + + var capabilities = new WebGLCapabilities( _gl, extensions, parameters ); + + var state = new WebGLState( _gl, extensions, paramThreeToGL ); + var properties = new WebGLProperties(); + var textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, paramThreeToGL, this.info ); + var objects = new WebGLObjects( _gl, properties, this.info ); + var programCache = new WebGLPrograms( this, capabilities ); + var lightCache = new WebGLLights(); + + this.info.programs = programCache.programs; + + var bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender ); + var indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender ); + + // + + var backgroundCamera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 ); + var backgroundCamera2 = new PerspectiveCamera(); + var backgroundPlaneMesh = new Mesh( + new PlaneBufferGeometry( 2, 2 ), + new MeshBasicMaterial( { depthTest: false, depthWrite: false, fog: false } ) + ); + var backgroundBoxShader = ShaderLib[ 'cube' ]; + var backgroundBoxMesh = new Mesh( + new BoxBufferGeometry( 5, 5, 5 ), + new ShaderMaterial( { + uniforms: backgroundBoxShader.uniforms, + vertexShader: backgroundBoxShader.vertexShader, + fragmentShader: backgroundBoxShader.fragmentShader, + side: BackSide, + depthTest: false, + depthWrite: false, + fog: false + } ) + ); + + // + + function getTargetPixelRatio() { + + return _currentRenderTarget === null ? _pixelRatio : 1; + + } + + function glClearColor( r, g, b, a ) { + + if ( _premultipliedAlpha === true ) { + + r *= a; g *= a; b *= a; + + } + + state.clearColor( r, g, b, a ); + + } + + function setDefaultGLState() { + + state.init(); + + state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) ); + state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) ); + + glClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); + + } + + function resetGLState() { + + _currentProgram = null; + _currentCamera = null; + + _currentGeometryProgram = ''; + _currentMaterialId = - 1; + + state.reset(); + + } + + setDefaultGLState(); + + this.context = _gl; + this.capabilities = capabilities; + this.extensions = extensions; + this.properties = properties; + this.state = state; + + // shadow map + + var shadowMap = new WebGLShadowMap( this, _lights, objects, capabilities ); + + this.shadowMap = shadowMap; + + + // Plugins + + var spritePlugin = new SpritePlugin( this, sprites ); + var lensFlarePlugin = new LensFlarePlugin( this, lensFlares ); + + // API + + this.getContext = function () { + + return _gl; + + }; + + this.getContextAttributes = function () { + + return _gl.getContextAttributes(); + + }; + + this.forceContextLoss = function () { + + extensions.get( 'WEBGL_lose_context' ).loseContext(); + + }; + + this.getMaxAnisotropy = function () { + + return capabilities.getMaxAnisotropy(); + + }; + + this.getPrecision = function () { + + return capabilities.precision; + + }; + + this.getPixelRatio = function () { + + return _pixelRatio; + + }; + + this.setPixelRatio = function ( value ) { + + if ( value === undefined ) return; + + _pixelRatio = value; + + this.setSize( _viewport.z, _viewport.w, false ); + + }; + + this.getSize = function () { + + return { + width: _width, + height: _height + }; + + }; + + this.setSize = function ( width, height, updateStyle ) { + + _width = width; + _height = height; + + _canvas.width = width * _pixelRatio; + _canvas.height = height * _pixelRatio; + + if ( updateStyle !== false ) { + + _canvas.style.width = width + 'px'; + _canvas.style.height = height + 'px'; + + } + + this.setViewport( 0, 0, width, height ); + + }; + + this.setViewport = function ( x, y, width, height ) { + + state.viewport( _viewport.set( x, y, width, height ) ); + + }; + + this.setScissor = function ( x, y, width, height ) { + + state.scissor( _scissor.set( x, y, width, height ) ); + + }; + + this.setScissorTest = function ( boolean ) { + + state.setScissorTest( _scissorTest = boolean ); + + }; + + // Clearing + + this.getClearColor = function () { + + return _clearColor; + + }; + + this.setClearColor = function ( color, alpha ) { + + _clearColor.set( color ); + + _clearAlpha = alpha !== undefined ? alpha : 1; + + glClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); + + }; + + this.getClearAlpha = function () { + + return _clearAlpha; + + }; + + this.setClearAlpha = function ( alpha ) { + + _clearAlpha = alpha; + + glClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); + + }; + + this.clear = function ( color, depth, stencil ) { + + var bits = 0; + + if ( color === undefined || color ) bits |= _gl.COLOR_BUFFER_BIT; + if ( depth === undefined || depth ) bits |= _gl.DEPTH_BUFFER_BIT; + if ( stencil === undefined || stencil ) bits |= _gl.STENCIL_BUFFER_BIT; + + _gl.clear( bits ); + + }; + + this.clearColor = function () { + + this.clear( true, false, false ); + + }; + + this.clearDepth = function () { + + this.clear( false, true, false ); + + }; + + this.clearStencil = function () { + + this.clear( false, false, true ); + + }; + + this.clearTarget = function ( renderTarget, color, depth, stencil ) { + + this.setRenderTarget( renderTarget ); + this.clear( color, depth, stencil ); + + }; + + // Reset + + this.resetGLState = resetGLState; + + this.dispose = function() { + + transparentObjects = []; + transparentObjectsLastIndex = -1; + opaqueObjects = []; + opaqueObjectsLastIndex = -1; + + _canvas.removeEventListener( 'webglcontextlost', onContextLost, false ); + + }; + + // Events + + function onContextLost( event ) { + + event.preventDefault(); + + resetGLState(); + setDefaultGLState(); + + properties.clear(); + + } + + function onMaterialDispose( event ) { + + var material = event.target; + + material.removeEventListener( 'dispose', onMaterialDispose ); + + deallocateMaterial( material ); + + } + + // Buffer deallocation + + function deallocateMaterial( material ) { + + releaseMaterialProgramReference( material ); + + properties.delete( material ); + + } + + + function releaseMaterialProgramReference( material ) { + + var programInfo = properties.get( material ).program; + + material.program = undefined; + + if ( programInfo !== undefined ) { + + programCache.releaseProgram( programInfo ); + + } + + } + + // Buffer rendering + + this.renderBufferImmediate = function ( object, program, material ) { + + state.initAttributes(); + + var buffers = properties.get( object ); + + if ( object.hasPositions && ! buffers.position ) buffers.position = _gl.createBuffer(); + if ( object.hasNormals && ! buffers.normal ) buffers.normal = _gl.createBuffer(); + if ( object.hasUvs && ! buffers.uv ) buffers.uv = _gl.createBuffer(); + if ( object.hasColors && ! buffers.color ) buffers.color = _gl.createBuffer(); + + var attributes = program.getAttributes(); + + if ( object.hasPositions ) { + + _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.position ); + _gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW ); + + state.enableAttribute( attributes.position ); + _gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 ); + + } + + if ( object.hasNormals ) { + + _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal ); + + if ( ! material.isMeshPhongMaterial && + ! material.isMeshStandardMaterial && + material.shading === FlatShading ) { + + for ( var i = 0, l = object.count * 3; i < l; i += 9 ) { + + var array = object.normalArray; + + var nx = ( array[ i + 0 ] + array[ i + 3 ] + array[ i + 6 ] ) / 3; + var ny = ( array[ i + 1 ] + array[ i + 4 ] + array[ i + 7 ] ) / 3; + var nz = ( array[ i + 2 ] + array[ i + 5 ] + array[ i + 8 ] ) / 3; + + array[ i + 0 ] = nx; + array[ i + 1 ] = ny; + array[ i + 2 ] = nz; + + array[ i + 3 ] = nx; + array[ i + 4 ] = ny; + array[ i + 5 ] = nz; + + array[ i + 6 ] = nx; + array[ i + 7 ] = ny; + array[ i + 8 ] = nz; + + } + + } + + _gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW ); + + state.enableAttribute( attributes.normal ); + + _gl.vertexAttribPointer( attributes.normal, 3, _gl.FLOAT, false, 0, 0 ); + + } + + if ( object.hasUvs && material.map ) { + + _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.uv ); + _gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW ); + + state.enableAttribute( attributes.uv ); + + _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 ); + + } + + if ( object.hasColors && material.vertexColors !== NoColors ) { + + _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.color ); + _gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW ); + + state.enableAttribute( attributes.color ); + + _gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 ); + + } + + state.disableUnusedAttributes(); + + _gl.drawArrays( _gl.TRIANGLES, 0, object.count ); + + object.count = 0; + + }; + + this.renderBufferDirect = function ( camera, fog, geometry, material, object, group ) { + + setMaterial( material ); + + var program = setProgram( camera, fog, material, object ); + + var updateBuffers = false; + var geometryProgram = geometry.id + '_' + program.id + '_' + material.wireframe; + + if ( geometryProgram !== _currentGeometryProgram ) { + + _currentGeometryProgram = geometryProgram; + updateBuffers = true; + + } + + // morph targets + + var morphTargetInfluences = object.morphTargetInfluences; + + if ( morphTargetInfluences !== undefined ) { + + var activeInfluences = []; + + for ( var i = 0, l = morphTargetInfluences.length; i < l; i ++ ) { + + var influence = morphTargetInfluences[ i ]; + activeInfluences.push( [ influence, i ] ); + + } + + activeInfluences.sort( absNumericalSort ); + + if ( activeInfluences.length > 8 ) { + + activeInfluences.length = 8; + + } + + var morphAttributes = geometry.morphAttributes; + + for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) { + + var influence = activeInfluences[ i ]; + morphInfluences[ i ] = influence[ 0 ]; + + if ( influence[ 0 ] !== 0 ) { + + var index = influence[ 1 ]; + + if ( material.morphTargets === true && morphAttributes.position ) geometry.addAttribute( 'morphTarget' + i, morphAttributes.position[ index ] ); + if ( material.morphNormals === true && morphAttributes.normal ) geometry.addAttribute( 'morphNormal' + i, morphAttributes.normal[ index ] ); + + } else { + + if ( material.morphTargets === true ) geometry.removeAttribute( 'morphTarget' + i ); + if ( material.morphNormals === true ) geometry.removeAttribute( 'morphNormal' + i ); + + } + + } + + for ( var i = activeInfluences.length, il = morphInfluences.length; i < il; i ++ ) { + + morphInfluences[ i ] = 0.0; + + } + + program.getUniforms().setValue( + _gl, 'morphTargetInfluences', morphInfluences ); + + updateBuffers = true; + + } + + // + + var index = geometry.index; + var position = geometry.attributes.position; + var rangeFactor = 1; + + if ( material.wireframe === true ) { + + index = objects.getWireframeAttribute( geometry ); + rangeFactor = 2; + + } + + var renderer; + + if ( index !== null ) { + + renderer = indexedBufferRenderer; + renderer.setIndex( index ); + + } else { + + renderer = bufferRenderer; + + } + + if ( updateBuffers ) { + + setupVertexAttributes( material, program, geometry ); + + if ( index !== null ) { + + _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, objects.getAttributeBuffer( index ) ); + + } + + } + + // + + var dataCount = 0; + + if ( index !== null ) { + + dataCount = index.count; + + } else if ( position !== undefined ) { + + dataCount = position.count; + + } + + var rangeStart = geometry.drawRange.start * rangeFactor; + var rangeCount = geometry.drawRange.count * rangeFactor; + + var groupStart = group !== null ? group.start * rangeFactor : 0; + var groupCount = group !== null ? group.count * rangeFactor : Infinity; + + var drawStart = Math.max( rangeStart, groupStart ); + var drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1; + + var drawCount = Math.max( 0, drawEnd - drawStart + 1 ); + + if ( drawCount === 0 ) return; + + // + + if ( object.isMesh ) { + + if ( material.wireframe === true ) { + + state.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() ); + renderer.setMode( _gl.LINES ); + + } else { + + switch ( object.drawMode ) { + + case TrianglesDrawMode: + renderer.setMode( _gl.TRIANGLES ); + break; + + case TriangleStripDrawMode: + renderer.setMode( _gl.TRIANGLE_STRIP ); + break; + + case TriangleFanDrawMode: + renderer.setMode( _gl.TRIANGLE_FAN ); + break; + + } + + } + + + } else if ( object.isLine ) { + + var lineWidth = material.linewidth; + + if ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material + + state.setLineWidth( lineWidth * getTargetPixelRatio() ); + + if ( object.isLineSegments ) { + + renderer.setMode( _gl.LINES ); + + } else { + + renderer.setMode( _gl.LINE_STRIP ); + + } + + } else if ( object.isPoints ) { + + renderer.setMode( _gl.POINTS ); + + } + + if ( geometry && geometry.isInstancedBufferGeometry ) { + + if ( geometry.maxInstancedCount > 0 ) { + + renderer.renderInstances( geometry, drawStart, drawCount ); + + } + + } else { + + renderer.render( drawStart, drawCount ); + + } + + }; + + function setupVertexAttributes( material, program, geometry, startIndex ) { + + var extension; + + if ( geometry && geometry.isInstancedBufferGeometry ) { + + extension = extensions.get( 'ANGLE_instanced_arrays' ); + + if ( extension === null ) { + + console.error( 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); + return; + + } + + } + + if ( startIndex === undefined ) startIndex = 0; + + state.initAttributes(); + + var geometryAttributes = geometry.attributes; + + var programAttributes = program.getAttributes(); + + var materialDefaultAttributeValues = material.defaultAttributeValues; + + for ( var name in programAttributes ) { + + var programAttribute = programAttributes[ name ]; + + if ( programAttribute >= 0 ) { + + var geometryAttribute = geometryAttributes[ name ]; + + if ( geometryAttribute !== undefined ) { + + var type = _gl.FLOAT; + var array = geometryAttribute.array; + var normalized = geometryAttribute.normalized; + + if ( array instanceof Float32Array ) { + + type = _gl.FLOAT; + + } else if ( array instanceof Float64Array ) { + + console.warn( "Unsupported data buffer format: Float64Array" ); + + } else if ( array instanceof Uint16Array ) { + + type = _gl.UNSIGNED_SHORT; + + } else if ( array instanceof Int16Array ) { + + type = _gl.SHORT; + + } else if ( array instanceof Uint32Array ) { + + type = _gl.UNSIGNED_INT; + + } else if ( array instanceof Int32Array ) { + + type = _gl.INT; + + } else if ( array instanceof Int8Array ) { + + type = _gl.BYTE; + + } else if ( array instanceof Uint8Array ) { + + type = _gl.UNSIGNED_BYTE; + + } + + var size = geometryAttribute.itemSize; + var buffer = objects.getAttributeBuffer( geometryAttribute ); + + if ( geometryAttribute.isInterleavedBufferAttribute ) { + + var data = geometryAttribute.data; + var stride = data.stride; + var offset = geometryAttribute.offset; + + if ( data && data.isInstancedInterleavedBuffer ) { + + state.enableAttributeAndDivisor( programAttribute, data.meshPerAttribute, extension ); + + if ( geometry.maxInstancedCount === undefined ) { + + geometry.maxInstancedCount = data.meshPerAttribute * data.count; + + } + + } else { + + state.enableAttribute( programAttribute ); + + } + + _gl.bindBuffer( _gl.ARRAY_BUFFER, buffer ); + _gl.vertexAttribPointer( programAttribute, size, type, normalized, stride * data.array.BYTES_PER_ELEMENT, ( startIndex * stride + offset ) * data.array.BYTES_PER_ELEMENT ); + + } else { + + if ( geometryAttribute.isInstancedBufferAttribute ) { + + state.enableAttributeAndDivisor( programAttribute, geometryAttribute.meshPerAttribute, extension ); + + if ( geometry.maxInstancedCount === undefined ) { + + geometry.maxInstancedCount = geometryAttribute.meshPerAttribute * geometryAttribute.count; + + } + + } else { + + state.enableAttribute( programAttribute ); + + } + + _gl.bindBuffer( _gl.ARRAY_BUFFER, buffer ); + _gl.vertexAttribPointer( programAttribute, size, type, normalized, 0, startIndex * size * geometryAttribute.array.BYTES_PER_ELEMENT ); + + } + + } else if ( materialDefaultAttributeValues !== undefined ) { + + var value = materialDefaultAttributeValues[ name ]; + + if ( value !== undefined ) { + + switch ( value.length ) { + + case 2: + _gl.vertexAttrib2fv( programAttribute, value ); + break; + + case 3: + _gl.vertexAttrib3fv( programAttribute, value ); + break; + + case 4: + _gl.vertexAttrib4fv( programAttribute, value ); + break; + + default: + _gl.vertexAttrib1fv( programAttribute, value ); + + } + + } + + } + + } + + } + + state.disableUnusedAttributes(); + + } + + // Sorting + + function absNumericalSort( a, b ) { + + return Math.abs( b[ 0 ] ) - Math.abs( a[ 0 ] ); + + } + + function painterSortStable( a, b ) { + + if ( a.object.renderOrder !== b.object.renderOrder ) { + + return a.object.renderOrder - b.object.renderOrder; + + } else if ( a.material.program && b.material.program && a.material.program !== b.material.program ) { + + return a.material.program.id - b.material.program.id; + + } else if ( a.material.id !== b.material.id ) { + + return a.material.id - b.material.id; + + } else if ( a.z !== b.z ) { + + return a.z - b.z; + + } else { + + return a.id - b.id; + + } + + } + + function reversePainterSortStable( a, b ) { + + if ( a.object.renderOrder !== b.object.renderOrder ) { + + return a.object.renderOrder - b.object.renderOrder; + + } if ( a.z !== b.z ) { + + return b.z - a.z; + + } else { + + return a.id - b.id; + + } + + } + + // Rendering + + this.render = function ( scene, camera, renderTarget, forceClear ) { + + if ( camera !== undefined && camera.isCamera !== true ) { + + console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' ); + return; + + } + + // reset caching for this frame + + _currentGeometryProgram = ''; + _currentMaterialId = - 1; + _currentCamera = null; + + // update scene graph + + if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); + + // update camera matrices and frustum + + if ( camera.parent === null ) camera.updateMatrixWorld(); + + camera.matrixWorldInverse.getInverse( camera.matrixWorld ); + + _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); + _frustum.setFromMatrix( _projScreenMatrix ); + + lights.length = 0; + + opaqueObjectsLastIndex = - 1; + transparentObjectsLastIndex = - 1; + + sprites.length = 0; + lensFlares.length = 0; + + _localClippingEnabled = this.localClippingEnabled; + _clippingEnabled = _clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); + + projectObject( scene, camera ); + + opaqueObjects.length = opaqueObjectsLastIndex + 1; + transparentObjects.length = transparentObjectsLastIndex + 1; + + if ( _this.sortObjects === true ) { + + opaqueObjects.sort( painterSortStable ); + transparentObjects.sort( reversePainterSortStable ); + + } + + // + + if ( _clippingEnabled ) _clipping.beginShadows(); + + setupShadows( lights ); + + shadowMap.render( scene, camera ); + + setupLights( lights, camera ); + + if ( _clippingEnabled ) _clipping.endShadows(); + + // + + _infoRender.calls = 0; + _infoRender.vertices = 0; + _infoRender.faces = 0; + _infoRender.points = 0; + + if ( renderTarget === undefined ) { + + renderTarget = null; + + } + + this.setRenderTarget( renderTarget ); + + // + + var background = scene.background; + + if ( background === null ) { + + glClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); + + } else if ( background && background.isColor ) { + + glClearColor( background.r, background.g, background.b, 1 ); + forceClear = true; + + } + + if ( this.autoClear || forceClear ) { + + this.clear( this.autoClearColor, this.autoClearDepth, this.autoClearStencil ); + + } + + if ( background && background.isCubeTexture ) { + + backgroundCamera2.projectionMatrix.copy( camera.projectionMatrix ); + + backgroundCamera2.matrixWorld.extractRotation( camera.matrixWorld ); + backgroundCamera2.matrixWorldInverse.getInverse( backgroundCamera2.matrixWorld ); + + backgroundBoxMesh.material.uniforms[ "tCube" ].value = background; + backgroundBoxMesh.modelViewMatrix.multiplyMatrices( backgroundCamera2.matrixWorldInverse, backgroundBoxMesh.matrixWorld ); + + objects.update( backgroundBoxMesh ); + + _this.renderBufferDirect( backgroundCamera2, null, backgroundBoxMesh.geometry, backgroundBoxMesh.material, backgroundBoxMesh, null ); + + } else if ( background && background.isTexture ) { + + backgroundPlaneMesh.material.map = background; + + objects.update( backgroundPlaneMesh ); + + _this.renderBufferDirect( backgroundCamera, null, backgroundPlaneMesh.geometry, backgroundPlaneMesh.material, backgroundPlaneMesh, null ); + + } + + // + + if ( scene.overrideMaterial ) { + + var overrideMaterial = scene.overrideMaterial; + + renderObjects( opaqueObjects, scene, camera, overrideMaterial ); + renderObjects( transparentObjects, scene, camera, overrideMaterial ); + + } else { + + // opaque pass (front-to-back order) + + state.setBlending( NoBlending ); + renderObjects( opaqueObjects, scene, camera ); + + // transparent pass (back-to-front order) + + renderObjects( transparentObjects, scene, camera ); + + } + + // custom render plugins (post pass) + + spritePlugin.render( scene, camera ); + lensFlarePlugin.render( scene, camera, _currentViewport ); + + // Generate mipmap if we're using any kind of mipmap filtering + + if ( renderTarget ) { + + textures.updateRenderTargetMipmap( renderTarget ); + + } + + // Ensure depth buffer writing is enabled so it can be cleared on next render + + state.setDepthTest( true ); + state.setDepthWrite( true ); + state.setColorWrite( true ); + + // _gl.finish(); + + }; + + function pushRenderItem( object, geometry, material, z, group ) { + + var array, index; + + // allocate the next position in the appropriate array + + if ( material.transparent ) { + + array = transparentObjects; + index = ++ transparentObjectsLastIndex; + + } else { + + array = opaqueObjects; + index = ++ opaqueObjectsLastIndex; + + } + + // recycle existing render item or grow the array + + var renderItem = array[ index ]; + + if ( renderItem !== undefined ) { + + renderItem.id = object.id; + renderItem.object = object; + renderItem.geometry = geometry; + renderItem.material = material; + renderItem.z = _vector3.z; + renderItem.group = group; + + } else { + + renderItem = { + id: object.id, + object: object, + geometry: geometry, + material: material, + z: _vector3.z, + group: group + }; + + // assert( index === array.length ); + array.push( renderItem ); + + } + + } + + // TODO Duplicated code (Frustum) + + function isObjectViewable( object ) { + + var geometry = object.geometry; + + if ( geometry.boundingSphere === null ) + geometry.computeBoundingSphere(); + + _sphere.copy( geometry.boundingSphere ). + applyMatrix4( object.matrixWorld ); + + return isSphereViewable( _sphere ); + + } + + function isSpriteViewable( sprite ) { + + _sphere.center.set( 0, 0, 0 ); + _sphere.radius = 0.7071067811865476; + _sphere.applyMatrix4( sprite.matrixWorld ); + + return isSphereViewable( _sphere ); + + } + + function isSphereViewable( sphere ) { + + if ( ! _frustum.intersectsSphere( sphere ) ) return false; + + var numPlanes = _clipping.numPlanes; + + if ( numPlanes === 0 ) return true; + + var planes = _this.clippingPlanes, + + center = sphere.center, + negRad = - sphere.radius, + i = 0; + + do { + + // out when deeper than radius in the negative halfspace + if ( planes[ i ].distanceToPoint( center ) < negRad ) return false; + + } while ( ++ i !== numPlanes ); + + return true; + + } + + function projectObject( object, camera ) { + + if ( object.visible === false ) return; + + var visible = ( object.layers.mask & camera.layers.mask ) !== 0; + + if ( visible ) { + + if ( object.isLight ) { + + lights.push( object ); + + } else if ( object.isSprite ) { + + if ( object.frustumCulled === false || isSpriteViewable( object ) === true ) { + + sprites.push( object ); + + } + + } else if ( object.isLensFlare ) { + + lensFlares.push( object ); + + } else if ( object.isImmediateRenderObject ) { + + if ( _this.sortObjects === true ) { + + _vector3.setFromMatrixPosition( object.matrixWorld ); + _vector3.applyProjection( _projScreenMatrix ); + + } + + pushRenderItem( object, null, object.material, _vector3.z, null ); + + } else if ( object.isMesh || object.isLine || object.isPoints ) { + + if ( object.isSkinnedMesh ) { + + object.skeleton.update(); + + } + + if ( object.frustumCulled === false || isObjectViewable( object ) === true ) { + + var material = object.material; + + if ( material.visible === true ) { + + if ( _this.sortObjects === true ) { + + _vector3.setFromMatrixPosition( object.matrixWorld ); + _vector3.applyProjection( _projScreenMatrix ); + + } + + var geometry = objects.update( object ); + + if ( material.isMultiMaterial ) { + + var groups = geometry.groups; + var materials = material.materials; + + for ( var i = 0, l = groups.length; i < l; i ++ ) { + + var group = groups[ i ]; + var groupMaterial = materials[ group.materialIndex ]; + + if ( groupMaterial.visible === true ) { + + pushRenderItem( object, geometry, groupMaterial, _vector3.z, group ); + + } + + } + + } else { + + pushRenderItem( object, geometry, material, _vector3.z, null ); + + } + + } + + } + + } + + } + + var children = object.children; + + for ( var i = 0, l = children.length; i < l; i ++ ) { + + projectObject( children[ i ], camera ); + + } + + } + + function renderObjects( renderList, scene, camera, overrideMaterial ) { + + for ( var i = 0, l = renderList.length; i < l; i ++ ) { + + var renderItem = renderList[ i ]; + + var object = renderItem.object; + var geometry = renderItem.geometry; + var material = overrideMaterial === undefined ? renderItem.material : overrideMaterial; + var group = renderItem.group; + + object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); + object.normalMatrix.getNormalMatrix( object.modelViewMatrix ); + + object.onBeforeRender( _this, scene, camera, geometry, material, group ); + + if ( object.isImmediateRenderObject ) { + + setMaterial( material ); + + var program = setProgram( camera, scene.fog, material, object ); + + _currentGeometryProgram = ''; + + object.render( function ( object ) { + + _this.renderBufferImmediate( object, program, material ); + + } ); + + } else { + + _this.renderBufferDirect( camera, scene.fog, geometry, material, object, group ); + + } + + object.onAfterRender( _this, scene, camera, geometry, material, group ); + + + } + + } + + function initMaterial( material, fog, object ) { + + var materialProperties = properties.get( material ); + + var parameters = programCache.getParameters( + material, _lights, fog, _clipping.numPlanes, _clipping.numIntersection, object ); + + var code = programCache.getProgramCode( material, parameters ); + + var program = materialProperties.program; + var programChange = true; + + if ( program === undefined ) { + + // new material + material.addEventListener( 'dispose', onMaterialDispose ); + + } else if ( program.code !== code ) { + + // changed glsl or parameters + releaseMaterialProgramReference( material ); + + } else if ( parameters.shaderID !== undefined ) { + + // same glsl and uniform list + return; + + } else { + + // only rebuild uniform list + programChange = false; + + } + + if ( programChange ) { + + if ( parameters.shaderID ) { + + var shader = ShaderLib[ parameters.shaderID ]; + + materialProperties.__webglShader = { + name: material.type, + uniforms: UniformsUtils.clone( shader.uniforms ), + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader + }; + + } else { + + materialProperties.__webglShader = { + name: material.type, + uniforms: material.uniforms, + vertexShader: material.vertexShader, + fragmentShader: material.fragmentShader + }; + + } + + material.__webglShader = materialProperties.__webglShader; + + program = programCache.acquireProgram( material, parameters, code ); + + materialProperties.program = program; + material.program = program; + + } + + var attributes = program.getAttributes(); + + if ( material.morphTargets ) { + + material.numSupportedMorphTargets = 0; + + for ( var i = 0; i < _this.maxMorphTargets; i ++ ) { + + if ( attributes[ 'morphTarget' + i ] >= 0 ) { + + material.numSupportedMorphTargets ++; + + } + + } + + } + + if ( material.morphNormals ) { + + material.numSupportedMorphNormals = 0; + + for ( var i = 0; i < _this.maxMorphNormals; i ++ ) { + + if ( attributes[ 'morphNormal' + i ] >= 0 ) { + + material.numSupportedMorphNormals ++; + + } + + } + + } + + var uniforms = materialProperties.__webglShader.uniforms; + + if ( ! material.isShaderMaterial && + ! material.isRawShaderMaterial || + material.clipping === true ) { + + materialProperties.numClippingPlanes = _clipping.numPlanes; + materialProperties.numIntersection = _clipping.numIntersection; + uniforms.clippingPlanes = _clipping.uniform; + + } + + materialProperties.fog = fog; + + // store the light setup it was created for + + materialProperties.lightsHash = _lights.hash; + + if ( material.lights ) { + + // wire up the material to this renderer's lighting state + + uniforms.ambientLightColor.value = _lights.ambient; + uniforms.directionalLights.value = _lights.directional; + uniforms.spotLights.value = _lights.spot; + uniforms.pointLights.value = _lights.point; + uniforms.hemisphereLights.value = _lights.hemi; + + uniforms.directionalShadowMap.value = _lights.directionalShadowMap; + uniforms.directionalShadowMatrix.value = _lights.directionalShadowMatrix; + uniforms.spotShadowMap.value = _lights.spotShadowMap; + uniforms.spotShadowMatrix.value = _lights.spotShadowMatrix; + uniforms.pointShadowMap.value = _lights.pointShadowMap; + uniforms.pointShadowMatrix.value = _lights.pointShadowMatrix; + + } + + var progUniforms = materialProperties.program.getUniforms(), + uniformsList = + WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); + + materialProperties.uniformsList = uniformsList; + + } + + function setMaterial( material ) { + + material.side === DoubleSide + ? state.disable( _gl.CULL_FACE ) + : state.enable( _gl.CULL_FACE ); + + state.setFlipSided( material.side === BackSide ); + + material.transparent === true + ? state.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha ) + : state.setBlending( NoBlending ); + + state.setDepthFunc( material.depthFunc ); + state.setDepthTest( material.depthTest ); + state.setDepthWrite( material.depthWrite ); + state.setColorWrite( material.colorWrite ); + state.setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); + + } + + function setProgram( camera, fog, material, object ) { + + _usedTextureUnits = 0; + + var materialProperties = properties.get( material ); + + if ( _clippingEnabled ) { + + if ( _localClippingEnabled || camera !== _currentCamera ) { + + var useCache = + camera === _currentCamera && + material.id === _currentMaterialId; + + // we might want to call this function with some ClippingGroup + // object instead of the material, once it becomes feasible + // (#8465, #8379) + _clipping.setState( + material.clippingPlanes, material.clipIntersection, material.clipShadows, + camera, materialProperties, useCache ); + + } + + } + + if ( material.needsUpdate === false ) { + + if ( materialProperties.program === undefined ) { + + material.needsUpdate = true; + + } else if ( material.fog && materialProperties.fog !== fog ) { + + material.needsUpdate = true; + + } else if ( material.lights && materialProperties.lightsHash !== _lights.hash ) { + + material.needsUpdate = true; + + } else if ( materialProperties.numClippingPlanes !== undefined && + ( materialProperties.numClippingPlanes !== _clipping.numPlanes || + materialProperties.numIntersection !== _clipping.numIntersection ) ) { + + material.needsUpdate = true; + + } + + } + + if ( material.needsUpdate ) { + + initMaterial( material, fog, object ); + material.needsUpdate = false; + + } + + var refreshProgram = false; + var refreshMaterial = false; + var refreshLights = false; + + var program = materialProperties.program, + p_uniforms = program.getUniforms(), + m_uniforms = materialProperties.__webglShader.uniforms; + + if ( program.id !== _currentProgram ) { + + _gl.useProgram( program.program ); + _currentProgram = program.id; + + refreshProgram = true; + refreshMaterial = true; + refreshLights = true; + + } + + if ( material.id !== _currentMaterialId ) { + + _currentMaterialId = material.id; + + refreshMaterial = true; + + } + + if ( refreshProgram || camera !== _currentCamera ) { + + p_uniforms.set( _gl, camera, 'projectionMatrix' ); + + if ( capabilities.logarithmicDepthBuffer ) { + + p_uniforms.setValue( _gl, 'logDepthBufFC', + 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); + + } + + + if ( camera !== _currentCamera ) { + + _currentCamera = camera; + + // lighting uniforms depend on the camera so enforce an update + // now, in case this material supports lights - or later, when + // the next material that does gets activated: + + refreshMaterial = true; // set to true on material change + refreshLights = true; // remains set until update done + + } + + // load material specific uniforms + // (shader material also gets them for the sake of genericity) + + if ( material.isShaderMaterial || + material.isMeshPhongMaterial || + material.isMeshStandardMaterial || + material.envMap ) { + + var uCamPos = p_uniforms.map.cameraPosition; + + if ( uCamPos !== undefined ) { + + uCamPos.setValue( _gl, + _vector3.setFromMatrixPosition( camera.matrixWorld ) ); + + } + + } + + if ( material.isMeshPhongMaterial || + material.isMeshLambertMaterial || + material.isMeshBasicMaterial || + material.isMeshStandardMaterial || + material.isShaderMaterial || + material.skinning ) { + + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + + } + + p_uniforms.set( _gl, _this, 'toneMappingExposure' ); + p_uniforms.set( _gl, _this, 'toneMappingWhitePoint' ); + + } + + // skinning uniforms must be set even if material didn't change + // auto-setting of texture unit for bone texture must go before other textures + // not sure why, but otherwise weird things happen + + if ( material.skinning ) { + + p_uniforms.setOptional( _gl, object, 'bindMatrix' ); + p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' ); + + var skeleton = object.skeleton; + + if ( skeleton ) { + + if ( capabilities.floatVertexTextures && skeleton.useVertexTexture ) { + + p_uniforms.set( _gl, skeleton, 'boneTexture' ); + p_uniforms.set( _gl, skeleton, 'boneTextureWidth' ); + p_uniforms.set( _gl, skeleton, 'boneTextureHeight' ); + + } else { + + p_uniforms.setOptional( _gl, skeleton, 'boneMatrices' ); + + } + + } + + } + + if ( refreshMaterial ) { + + if ( material.lights ) { + + // the current material requires lighting info + + // note: all lighting uniforms are always set correctly + // they simply reference the renderer's state for their + // values + // + // use the current material's .needsUpdate flags to set + // the GL state when required + + markUniformsLightsNeedsUpdate( m_uniforms, refreshLights ); + + } + + // refresh uniforms common to several materials + + if ( fog && material.fog ) { + + refreshUniformsFog( m_uniforms, fog ); + + } + + if ( material.isMeshBasicMaterial || + material.isMeshLambertMaterial || + material.isMeshPhongMaterial || + material.isMeshStandardMaterial || + material.isMeshDepthMaterial ) { + + refreshUniformsCommon( m_uniforms, material ); + + } + + // refresh single material specific uniforms + + if ( material.isLineBasicMaterial ) { + + refreshUniformsLine( m_uniforms, material ); + + } else if ( material.isLineDashedMaterial ) { + + refreshUniformsLine( m_uniforms, material ); + refreshUniformsDash( m_uniforms, material ); + + } else if ( material.isPointsMaterial ) { + + refreshUniformsPoints( m_uniforms, material ); + + } else if ( material.isMeshLambertMaterial ) { + + refreshUniformsLambert( m_uniforms, material ); + + } else if ( material.isMeshPhongMaterial ) { + + refreshUniformsPhong( m_uniforms, material ); + + } else if ( material.isMeshPhysicalMaterial ) { + + refreshUniformsPhysical( m_uniforms, material ); + + } else if ( material.isMeshStandardMaterial ) { + + refreshUniformsStandard( m_uniforms, material ); + + } else if ( material.isMeshDepthMaterial ) { + + if ( material.displacementMap ) { + + m_uniforms.displacementMap.value = material.displacementMap; + m_uniforms.displacementScale.value = material.displacementScale; + m_uniforms.displacementBias.value = material.displacementBias; + + } + + } else if ( material.isMeshNormalMaterial ) { + + m_uniforms.opacity.value = material.opacity; + + } + + WebGLUniforms.upload( + _gl, materialProperties.uniformsList, m_uniforms, _this ); + + } + + + // common matrices + + p_uniforms.set( _gl, object, 'modelViewMatrix' ); + p_uniforms.set( _gl, object, 'normalMatrix' ); + p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); + + return program; + + } + + // Uniforms (refresh uniforms objects) + + function refreshUniformsCommon( uniforms, material ) { + + uniforms.opacity.value = material.opacity; + + uniforms.diffuse.value = material.color; + + if ( material.emissive ) { + + uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity ); + + } + + uniforms.map.value = material.map; + uniforms.specularMap.value = material.specularMap; + uniforms.alphaMap.value = material.alphaMap; + + if ( material.aoMap ) { + + uniforms.aoMap.value = material.aoMap; + uniforms.aoMapIntensity.value = material.aoMapIntensity; + + } + + // uv repeat and offset setting priorities + // 1. color map + // 2. specular map + // 3. normal map + // 4. bump map + // 5. alpha map + // 6. emissive map + + var uvScaleMap; + + if ( material.map ) { + + uvScaleMap = material.map; + + } else if ( material.specularMap ) { + + uvScaleMap = material.specularMap; + + } else if ( material.displacementMap ) { + + uvScaleMap = material.displacementMap; + + } else if ( material.normalMap ) { + + uvScaleMap = material.normalMap; + + } else if ( material.bumpMap ) { + + uvScaleMap = material.bumpMap; + + } else if ( material.roughnessMap ) { + + uvScaleMap = material.roughnessMap; + + } else if ( material.metalnessMap ) { + + uvScaleMap = material.metalnessMap; + + } else if ( material.alphaMap ) { + + uvScaleMap = material.alphaMap; + + } else if ( material.emissiveMap ) { + + uvScaleMap = material.emissiveMap; + + } + + if ( uvScaleMap !== undefined ) { + + // backwards compatibility + if ( uvScaleMap.isWebGLRenderTarget ) { + + uvScaleMap = uvScaleMap.texture; + + } + + var offset = uvScaleMap.offset; + var repeat = uvScaleMap.repeat; + + uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y ); + + } + + uniforms.envMap.value = material.envMap; + + // don't flip CubeTexture envMaps, flip everything else: + // WebGLRenderTargetCube will be flipped for backwards compatibility + // WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture + // this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future + uniforms.flipEnvMap.value = ( ! ( material.envMap && material.envMap.isCubeTexture ) ) ? 1 : - 1; + + uniforms.reflectivity.value = material.reflectivity; + uniforms.refractionRatio.value = material.refractionRatio; + + } + + function refreshUniformsLine( uniforms, material ) { + + uniforms.diffuse.value = material.color; + uniforms.opacity.value = material.opacity; + + } + + function refreshUniformsDash( uniforms, material ) { + + uniforms.dashSize.value = material.dashSize; + uniforms.totalSize.value = material.dashSize + material.gapSize; + uniforms.scale.value = material.scale; + + } + + function refreshUniformsPoints( uniforms, material ) { + + uniforms.diffuse.value = material.color; + uniforms.opacity.value = material.opacity; + uniforms.size.value = material.size * _pixelRatio; + uniforms.scale.value = _height * 0.5; + + uniforms.map.value = material.map; + + if ( material.map !== null ) { + + var offset = material.map.offset; + var repeat = material.map.repeat; + + uniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y ); + + } + + } + + function refreshUniformsFog( uniforms, fog ) { + + uniforms.fogColor.value = fog.color; + + if ( fog.isFog ) { + + uniforms.fogNear.value = fog.near; + uniforms.fogFar.value = fog.far; + + } else if ( fog.isFogExp2 ) { + + uniforms.fogDensity.value = fog.density; + + } + + } + + function refreshUniformsLambert( uniforms, material ) { + + if ( material.lightMap ) { + + uniforms.lightMap.value = material.lightMap; + uniforms.lightMapIntensity.value = material.lightMapIntensity; + + } + + if ( material.emissiveMap ) { + + uniforms.emissiveMap.value = material.emissiveMap; + + } + + } + + function refreshUniformsPhong( uniforms, material ) { + + uniforms.specular.value = material.specular; + uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 ) + + if ( material.lightMap ) { + + uniforms.lightMap.value = material.lightMap; + uniforms.lightMapIntensity.value = material.lightMapIntensity; + + } + + if ( material.emissiveMap ) { + + uniforms.emissiveMap.value = material.emissiveMap; + + } + + if ( material.bumpMap ) { + + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + + } + + if ( material.normalMap ) { + + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy( material.normalScale ); + + } + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + } + + function refreshUniformsStandard( uniforms, material ) { + + uniforms.roughness.value = material.roughness; + uniforms.metalness.value = material.metalness; + + if ( material.roughnessMap ) { + + uniforms.roughnessMap.value = material.roughnessMap; + + } + + if ( material.metalnessMap ) { + + uniforms.metalnessMap.value = material.metalnessMap; + + } + + if ( material.lightMap ) { + + uniforms.lightMap.value = material.lightMap; + uniforms.lightMapIntensity.value = material.lightMapIntensity; + + } + + if ( material.emissiveMap ) { + + uniforms.emissiveMap.value = material.emissiveMap; + + } + + if ( material.bumpMap ) { + + uniforms.bumpMap.value = material.bumpMap; + uniforms.bumpScale.value = material.bumpScale; + + } + + if ( material.normalMap ) { + + uniforms.normalMap.value = material.normalMap; + uniforms.normalScale.value.copy( material.normalScale ); + + } + + if ( material.displacementMap ) { + + uniforms.displacementMap.value = material.displacementMap; + uniforms.displacementScale.value = material.displacementScale; + uniforms.displacementBias.value = material.displacementBias; + + } + + if ( material.envMap ) { + + //uniforms.envMap.value = material.envMap; // part of uniforms common + uniforms.envMapIntensity.value = material.envMapIntensity; + + } + + } + + function refreshUniformsPhysical( uniforms, material ) { + + uniforms.clearCoat.value = material.clearCoat; + uniforms.clearCoatRoughness.value = material.clearCoatRoughness; + + refreshUniformsStandard( uniforms, material ); + + } + + // If uniforms are marked as clean, they don't need to be loaded to the GPU. + + function markUniformsLightsNeedsUpdate( uniforms, value ) { + + uniforms.ambientLightColor.needsUpdate = value; + + uniforms.directionalLights.needsUpdate = value; + uniforms.pointLights.needsUpdate = value; + uniforms.spotLights.needsUpdate = value; + uniforms.hemisphereLights.needsUpdate = value; + + } + + // Lighting + + function setupShadows( lights ) { + + var lightShadowsLength = 0; + + for ( var i = 0, l = lights.length; i < l; i ++ ) { + + var light = lights[ i ]; + + if ( light.castShadow ) { + + _lights.shadows[ lightShadowsLength ++ ] = light; + + } + + } + + _lights.shadows.length = lightShadowsLength; + + } + + function setupLights( lights, camera ) { + + var l, ll, light, + r = 0, g = 0, b = 0, + color, + intensity, + distance, + shadowMap, + + viewMatrix = camera.matrixWorldInverse, + + directionalLength = 0, + pointLength = 0, + spotLength = 0, + hemiLength = 0; + + for ( l = 0, ll = lights.length; l < ll; l ++ ) { + + light = lights[ l ]; + + color = light.color; + intensity = light.intensity; + distance = light.distance; + + shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null; + + if ( light.isAmbientLight ) { + + r += color.r * intensity; + g += color.g * intensity; + b += color.b * intensity; + + } else if ( light.isDirectionalLight ) { + + var uniforms = lightCache.get( light ); + + uniforms.color.copy( light.color ).multiplyScalar( light.intensity ); + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + _vector3.setFromMatrixPosition( light.target.matrixWorld ); + uniforms.direction.sub( _vector3 ); + uniforms.direction.transformDirection( viewMatrix ); + + uniforms.shadow = light.castShadow; + + if ( light.castShadow ) { + + uniforms.shadowBias = light.shadow.bias; + uniforms.shadowRadius = light.shadow.radius; + uniforms.shadowMapSize = light.shadow.mapSize; + + } + + _lights.directionalShadowMap[ directionalLength ] = shadowMap; + _lights.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix; + _lights.directional[ directionalLength ++ ] = uniforms; + + } else if ( light.isSpotLight ) { + + var uniforms = lightCache.get( light ); + + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); + + uniforms.color.copy( color ).multiplyScalar( intensity ); + uniforms.distance = distance; + + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + _vector3.setFromMatrixPosition( light.target.matrixWorld ); + uniforms.direction.sub( _vector3 ); + uniforms.direction.transformDirection( viewMatrix ); + + uniforms.coneCos = Math.cos( light.angle ); + uniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) ); + uniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay; + + uniforms.shadow = light.castShadow; + + if ( light.castShadow ) { + + uniforms.shadowBias = light.shadow.bias; + uniforms.shadowRadius = light.shadow.radius; + uniforms.shadowMapSize = light.shadow.mapSize; + + } + + _lights.spotShadowMap[ spotLength ] = shadowMap; + _lights.spotShadowMatrix[ spotLength ] = light.shadow.matrix; + _lights.spot[ spotLength ++ ] = uniforms; + + } else if ( light.isPointLight ) { + + var uniforms = lightCache.get( light ); + + uniforms.position.setFromMatrixPosition( light.matrixWorld ); + uniforms.position.applyMatrix4( viewMatrix ); + + uniforms.color.copy( light.color ).multiplyScalar( light.intensity ); + uniforms.distance = light.distance; + uniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay; + + uniforms.shadow = light.castShadow; + + if ( light.castShadow ) { + + uniforms.shadowBias = light.shadow.bias; + uniforms.shadowRadius = light.shadow.radius; + uniforms.shadowMapSize = light.shadow.mapSize; + + } + + _lights.pointShadowMap[ pointLength ] = shadowMap; + + if ( _lights.pointShadowMatrix[ pointLength ] === undefined ) { + + _lights.pointShadowMatrix[ pointLength ] = new Matrix4(); + + } + + // for point lights we set the shadow matrix to be a translation-only matrix + // equal to inverse of the light's position + _vector3.setFromMatrixPosition( light.matrixWorld ).negate(); + _lights.pointShadowMatrix[ pointLength ].identity().setPosition( _vector3 ); + + _lights.point[ pointLength ++ ] = uniforms; + + } else if ( light.isHemisphereLight ) { + + var uniforms = lightCache.get( light ); + + uniforms.direction.setFromMatrixPosition( light.matrixWorld ); + uniforms.direction.transformDirection( viewMatrix ); + uniforms.direction.normalize(); + + uniforms.skyColor.copy( light.color ).multiplyScalar( intensity ); + uniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity ); + + _lights.hemi[ hemiLength ++ ] = uniforms; + + } + + } + + _lights.ambient[ 0 ] = r; + _lights.ambient[ 1 ] = g; + _lights.ambient[ 2 ] = b; + + _lights.directional.length = directionalLength; + _lights.spot.length = spotLength; + _lights.point.length = pointLength; + _lights.hemi.length = hemiLength; + + _lights.hash = directionalLength + ',' + pointLength + ',' + spotLength + ',' + hemiLength + ',' + _lights.shadows.length; + + } + + // GL state setting + + this.setFaceCulling = function ( cullFace, frontFaceDirection ) { + + state.setCullFace( cullFace ); + state.setFlipSided( frontFaceDirection === FrontFaceDirectionCW ); + + }; + + // Textures + + function allocTextureUnit() { + + var textureUnit = _usedTextureUnits; + + if ( textureUnit >= capabilities.maxTextures ) { + + console.warn( 'WebGLRenderer: trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures ); + + } + + _usedTextureUnits += 1; + + return textureUnit; + + } + + this.allocTextureUnit = allocTextureUnit; + + // this.setTexture2D = setTexture2D; + this.setTexture2D = ( function() { + + var warned = false; + + // backwards compatibility: peel texture.texture + return function setTexture2D( texture, slot ) { + + if ( texture && texture.isWebGLRenderTarget ) { + + if ( ! warned ) { + + console.warn( "THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead." ); + warned = true; + + } + + texture = texture.texture; + + } + + textures.setTexture2D( texture, slot ); + + }; + + }() ); + + this.setTexture = ( function() { + + var warned = false; + + return function setTexture( texture, slot ) { + + if ( ! warned ) { + + console.warn( "THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead." ); + warned = true; + + } + + textures.setTexture2D( texture, slot ); + + }; + + }() ); + + this.setTextureCube = ( function() { + + var warned = false; + + return function setTextureCube( texture, slot ) { + + // backwards compatibility: peel texture.texture + if ( texture && texture.isWebGLRenderTargetCube ) { + + if ( ! warned ) { + + console.warn( "THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead." ); + warned = true; + + } + + texture = texture.texture; + + } + + // currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture + // TODO: unify these code paths + if ( ( texture && texture.isCubeTexture ) || + ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) { + + // CompressedTexture can have Array in image :/ + + // this function alone should take care of cube textures + textures.setTextureCube( texture, slot ); + + } else { + + // assumed: texture property of THREE.WebGLRenderTargetCube + + textures.setTextureCubeDynamic( texture, slot ); + + } + + }; + + }() ); + + this.getCurrentRenderTarget = function() { + + return _currentRenderTarget; + + }; + + this.setRenderTarget = function ( renderTarget ) { + + _currentRenderTarget = renderTarget; + + if ( renderTarget && properties.get( renderTarget ).__webglFramebuffer === undefined ) { + + textures.setupRenderTarget( renderTarget ); + + } + + var isCube = ( renderTarget && renderTarget.isWebGLRenderTargetCube ); + var framebuffer; + + if ( renderTarget ) { + + var renderTargetProperties = properties.get( renderTarget ); + + if ( isCube ) { + + framebuffer = renderTargetProperties.__webglFramebuffer[ renderTarget.activeCubeFace ]; + + } else { + + framebuffer = renderTargetProperties.__webglFramebuffer; + + } + + _currentScissor.copy( renderTarget.scissor ); + _currentScissorTest = renderTarget.scissorTest; + + _currentViewport.copy( renderTarget.viewport ); + + } else { + + framebuffer = null; + + _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ); + _currentScissorTest = _scissorTest; + + _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ); + + } + + if ( _currentFramebuffer !== framebuffer ) { + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); + _currentFramebuffer = framebuffer; + + } + + state.scissor( _currentScissor ); + state.setScissorTest( _currentScissorTest ); + + state.viewport( _currentViewport ); + + if ( isCube ) { + + var textureProperties = properties.get( renderTarget.texture ); + _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, textureProperties.__webglTexture, renderTarget.activeMipMapLevel ); + + } + + }; + + this.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer ) { + + if ( ( renderTarget && renderTarget.isWebGLRenderTarget ) === false ) { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' ); + return; + + } + + var framebuffer = properties.get( renderTarget ).__webglFramebuffer; + + if ( framebuffer ) { + + var restore = false; + + if ( framebuffer !== _currentFramebuffer ) { + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); + + restore = true; + + } + + try { + + var texture = renderTarget.texture; + var textureFormat = texture.format; + var textureType = texture.type; + + if ( textureFormat !== RGBAFormat && paramThreeToGL( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' ); + return; + + } + + if ( textureType !== UnsignedByteType && paramThreeToGL( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513) + ! ( textureType === FloatType && ( extensions.get( 'OES_texture_float' ) || extensions.get( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox + ! ( textureType === HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' ); + return; + + } + + if ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) { + + // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604) + + if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) { + + _gl.readPixels( x, y, width, height, paramThreeToGL( textureFormat ), paramThreeToGL( textureType ), buffer ); + + } + + } else { + + console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' ); + + } + + } finally { + + if ( restore ) { + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, _currentFramebuffer ); + + } + + } + + } + + }; + + // Map three.js constants to WebGL constants + + function paramThreeToGL( p ) { + + var extension; + + if ( p === RepeatWrapping ) return _gl.REPEAT; + if ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE; + if ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT; + + if ( p === NearestFilter ) return _gl.NEAREST; + if ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST; + if ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR; + + if ( p === LinearFilter ) return _gl.LINEAR; + if ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST; + if ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR; + + if ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE; + if ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4; + if ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1; + if ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5; + + if ( p === ByteType ) return _gl.BYTE; + if ( p === ShortType ) return _gl.SHORT; + if ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT; + if ( p === IntType ) return _gl.INT; + if ( p === UnsignedIntType ) return _gl.UNSIGNED_INT; + if ( p === FloatType ) return _gl.FLOAT; + + if ( p === HalfFloatType ) { + + extension = extensions.get( 'OES_texture_half_float' ); + + if ( extension !== null ) return extension.HALF_FLOAT_OES; + + } + + if ( p === AlphaFormat ) return _gl.ALPHA; + if ( p === RGBFormat ) return _gl.RGB; + if ( p === RGBAFormat ) return _gl.RGBA; + if ( p === LuminanceFormat ) return _gl.LUMINANCE; + if ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA; + if ( p === DepthFormat ) return _gl.DEPTH_COMPONENT; + if ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL; + + if ( p === AddEquation ) return _gl.FUNC_ADD; + if ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT; + if ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT; + + if ( p === ZeroFactor ) return _gl.ZERO; + if ( p === OneFactor ) return _gl.ONE; + if ( p === SrcColorFactor ) return _gl.SRC_COLOR; + if ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR; + if ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA; + if ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA; + if ( p === DstAlphaFactor ) return _gl.DST_ALPHA; + if ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA; + + if ( p === DstColorFactor ) return _gl.DST_COLOR; + if ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR; + if ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE; + + if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || + p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_s3tc' ); + + if ( extension !== null ) { + + if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; + if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; + if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; + + } + + } + + if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || + p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' ); + + if ( extension !== null ) { + + if ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + if ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + + } + + } + + if ( p === RGB_ETC1_Format ) { + + extension = extensions.get( 'WEBGL_compressed_texture_etc1' ); + + if ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL; + + } + + if ( p === MinEquation || p === MaxEquation ) { + + extension = extensions.get( 'EXT_blend_minmax' ); + + if ( extension !== null ) { + + if ( p === MinEquation ) return extension.MIN_EXT; + if ( p === MaxEquation ) return extension.MAX_EXT; + + } + + } + + if ( p === UnsignedInt248Type ) { + + extension = extensions.get( 'WEBGL_depth_texture' ); + + if ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL; + + } + + return 0; + + } + + } + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function FogExp2 ( color, density ) { + + this.name = ''; + + this.color = new Color( color ); + this.density = ( density !== undefined ) ? density : 0.00025; + + } + + FogExp2.prototype.isFogExp2 = true; + + FogExp2.prototype.clone = function () { + + return new FogExp2( this.color.getHex(), this.density ); + + }; + + FogExp2.prototype.toJSON = function ( meta ) { + + return { + type: 'FogExp2', + color: this.color.getHex(), + density: this.density + }; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function Fog ( color, near, far ) { + + this.name = ''; + + this.color = new Color( color ); + + this.near = ( near !== undefined ) ? near : 1; + this.far = ( far !== undefined ) ? far : 1000; + + } + + Fog.prototype.isFog = true; + + Fog.prototype.clone = function () { + + return new Fog( this.color.getHex(), this.near, this.far ); + + }; + + Fog.prototype.toJSON = function ( meta ) { + + return { + type: 'Fog', + color: this.color.getHex(), + near: this.near, + far: this.far + }; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function Scene () { + + Object3D.call( this ); + + this.type = 'Scene'; + + this.background = null; + this.fog = null; + this.overrideMaterial = null; + + this.autoUpdate = true; // checked by the renderer + + } + + Scene.prototype = Object.create( Object3D.prototype ); + + Scene.prototype.constructor = Scene; + + Scene.prototype.copy = function ( source, recursive ) { + + Object3D.prototype.copy.call( this, source, recursive ); + + if ( source.background !== null ) this.background = source.background.clone(); + if ( source.fog !== null ) this.fog = source.fog.clone(); + if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone(); + + this.autoUpdate = source.autoUpdate; + this.matrixAutoUpdate = source.matrixAutoUpdate; + + return this; + + }; + + Scene.prototype.toJSON = function ( meta ) { + + var data = Object3D.prototype.toJSON.call( this, meta ); + + if ( this.background !== null ) data.object.background = this.background.toJSON( meta ); + if ( this.fog !== null ) data.object.fog = this.fog.toJSON(); + + return data; + + }; + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + */ + + function LensFlare( texture, size, distance, blending, color ) { + + Object3D.call( this ); + + this.lensFlares = []; + + this.positionScreen = new Vector3(); + this.customUpdateCallback = undefined; + + if ( texture !== undefined ) { + + this.add( texture, size, distance, blending, color ); + + } + + } + + LensFlare.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: LensFlare, + + isLensFlare: true, + + copy: function ( source ) { + + Object3D.prototype.copy.call( this, source ); + + this.positionScreen.copy( source.positionScreen ); + this.customUpdateCallback = source.customUpdateCallback; + + for ( var i = 0, l = source.lensFlares.length; i < l; i ++ ) { + + this.lensFlares.push( source.lensFlares[ i ] ); + + } + + return this; + + }, + + add: function ( texture, size, distance, blending, color, opacity ) { + + if ( size === undefined ) size = - 1; + if ( distance === undefined ) distance = 0; + if ( opacity === undefined ) opacity = 1; + if ( color === undefined ) color = new Color( 0xffffff ); + if ( blending === undefined ) blending = NormalBlending; + + distance = Math.min( distance, Math.max( 0, distance ) ); + + this.lensFlares.push( { + texture: texture, // THREE.Texture + size: size, // size in pixels (-1 = use texture.width) + distance: distance, // distance (0-1) from light source (0=at light source) + x: 0, y: 0, z: 0, // screen position (-1 => 1) z = 0 is in front z = 1 is back + scale: 1, // scale + rotation: 0, // rotation + opacity: opacity, // opacity + color: color, // color + blending: blending // blending + } ); + + }, + + /* + * Update lens flares update positions on all flares based on the screen position + * Set myLensFlare.customUpdateCallback to alter the flares in your project specific way. + */ + + updateLensFlares: function () { + + var f, fl = this.lensFlares.length; + var flare; + var vecX = - this.positionScreen.x * 2; + var vecY = - this.positionScreen.y * 2; + + for ( f = 0; f < fl; f ++ ) { + + flare = this.lensFlares[ f ]; + + flare.x = this.positionScreen.x + vecX * flare.distance; + flare.y = this.positionScreen.y + vecY * flare.distance; + + flare.wantedRotation = flare.x * Math.PI * 0.25; + flare.rotation += ( flare.wantedRotation - flare.rotation ) * 0.25; + + } + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * color: , + * opacity: , + * map: new THREE.Texture( ), + * + * uvOffset: new THREE.Vector2(), + * uvScale: new THREE.Vector2() + * } + */ + + function SpriteMaterial( parameters ) { + + Material.call( this ); + + this.type = 'SpriteMaterial'; + + this.color = new Color( 0xffffff ); + this.map = null; + + this.rotation = 0; + + this.fog = false; + this.lights = false; + + this.setValues( parameters ); + + } + + SpriteMaterial.prototype = Object.create( Material.prototype ); + SpriteMaterial.prototype.constructor = SpriteMaterial; + + SpriteMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + this.map = source.map; + + this.rotation = source.rotation; + + return this; + + }; + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + */ + + function Sprite( material ) { + + Object3D.call( this ); + + this.type = 'Sprite'; + + this.material = ( material !== undefined ) ? material : new SpriteMaterial(); + + } + + Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Sprite, + + isSprite: true, + + raycast: ( function () { + + var matrixPosition = new Vector3(); + + return function raycast( raycaster, intersects ) { + + matrixPosition.setFromMatrixPosition( this.matrixWorld ); + + var distanceSq = raycaster.ray.distanceSqToPoint( matrixPosition ); + var guessSizeSq = this.scale.x * this.scale.y / 4; + + if ( distanceSq > guessSizeSq ) { + + return; + + } + + intersects.push( { + + distance: Math.sqrt( distanceSq ), + point: this.position, + face: null, + object: this + + } ); + + }; + + }() ), + + clone: function () { + + return new this.constructor( this.material ).copy( this ); + + } + + } ); + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + */ + + function LOD() { + + Object3D.call( this ); + + this.type = 'LOD'; + + Object.defineProperties( this, { + levels: { + enumerable: true, + value: [] + } + } ); + + } + + + LOD.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: LOD, + + copy: function ( source ) { + + Object3D.prototype.copy.call( this, source, false ); + + var levels = source.levels; + + for ( var i = 0, l = levels.length; i < l; i ++ ) { + + var level = levels[ i ]; + + this.addLevel( level.object.clone(), level.distance ); + + } + + return this; + + }, + + addLevel: function ( object, distance ) { + + if ( distance === undefined ) distance = 0; + + distance = Math.abs( distance ); + + var levels = this.levels; + + for ( var l = 0; l < levels.length; l ++ ) { + + if ( distance < levels[ l ].distance ) { + + break; + + } + + } + + levels.splice( l, 0, { distance: distance, object: object } ); + + this.add( object ); + + }, + + getObjectForDistance: function ( distance ) { + + var levels = this.levels; + + for ( var i = 1, l = levels.length; i < l; i ++ ) { + + if ( distance < levels[ i ].distance ) { + + break; + + } + + } + + return levels[ i - 1 ].object; + + }, + + raycast: ( function () { + + var matrixPosition = new Vector3(); + + return function raycast( raycaster, intersects ) { + + matrixPosition.setFromMatrixPosition( this.matrixWorld ); + + var distance = raycaster.ray.origin.distanceTo( matrixPosition ); + + this.getObjectForDistance( distance ).raycast( raycaster, intersects ); + + }; + + }() ), + + update: function () { + + var v1 = new Vector3(); + var v2 = new Vector3(); + + return function update( camera ) { + + var levels = this.levels; + + if ( levels.length > 1 ) { + + v1.setFromMatrixPosition( camera.matrixWorld ); + v2.setFromMatrixPosition( this.matrixWorld ); + + var distance = v1.distanceTo( v2 ); + + levels[ 0 ].object.visible = true; + + for ( var i = 1, l = levels.length; i < l; i ++ ) { + + if ( distance >= levels[ i ].distance ) { + + levels[ i - 1 ].object.visible = false; + levels[ i ].object.visible = true; + + } else { + + break; + + } + + } + + for ( ; i < l; i ++ ) { + + levels[ i ].object.visible = false; + + } + + } + + }; + + }(), + + toJSON: function ( meta ) { + + var data = Object3D.prototype.toJSON.call( this, meta ); + + data.object.levels = []; + + var levels = this.levels; + + for ( var i = 0, l = levels.length; i < l; i ++ ) { + + var level = levels[ i ]; + + data.object.levels.push( { + object: level.object.uuid, + distance: level.distance + } ); + + } + + return data; + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) { + + Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + + this.image = { data: data, width: width, height: height }; + + this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; + this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; + + this.generateMipmaps = false; + this.flipY = false; + this.unpackAlignment = 1; + + } + + DataTexture.prototype = Object.create( Texture.prototype ); + DataTexture.prototype.constructor = DataTexture; + + DataTexture.prototype.isDataTexture = true; + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + * @author michael guerrero / http://realitymeltdown.com + * @author ikerr / http://verold.com + */ + + function Skeleton( bones, boneInverses, useVertexTexture ) { + + this.useVertexTexture = useVertexTexture !== undefined ? useVertexTexture : true; + + this.identityMatrix = new Matrix4(); + + // copy the bone array + + bones = bones || []; + + this.bones = bones.slice( 0 ); + + // create a bone texture or an array of floats + + if ( this.useVertexTexture ) { + + // layout (1 matrix = 4 pixels) + // RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4) + // with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8) + // 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16) + // 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32) + // 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64) + + + var size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix + size = _Math.nextPowerOfTwo( Math.ceil( size ) ); + size = Math.max( size, 4 ); + + this.boneTextureWidth = size; + this.boneTextureHeight = size; + + this.boneMatrices = new Float32Array( this.boneTextureWidth * this.boneTextureHeight * 4 ); // 4 floats per RGBA pixel + this.boneTexture = new DataTexture( this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, RGBAFormat, FloatType ); + + } else { + + this.boneMatrices = new Float32Array( 16 * this.bones.length ); + + } + + // use the supplied bone inverses or calculate the inverses + + if ( boneInverses === undefined ) { + + this.calculateInverses(); + + } else { + + if ( this.bones.length === boneInverses.length ) { + + this.boneInverses = boneInverses.slice( 0 ); + + } else { + + console.warn( 'THREE.Skeleton bonInverses is the wrong length.' ); + + this.boneInverses = []; + + for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) { + + this.boneInverses.push( new Matrix4() ); + + } + + } + + } + + } + + Object.assign( Skeleton.prototype, { + + calculateInverses: function () { + + this.boneInverses = []; + + for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) { + + var inverse = new Matrix4(); + + if ( this.bones[ b ] ) { + + inverse.getInverse( this.bones[ b ].matrixWorld ); + + } + + this.boneInverses.push( inverse ); + + } + + }, + + pose: function () { + + var bone; + + // recover the bind-time world matrices + + for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) { + + bone = this.bones[ b ]; + + if ( bone ) { + + bone.matrixWorld.getInverse( this.boneInverses[ b ] ); + + } + + } + + // compute the local matrices, positions, rotations and scales + + for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) { + + bone = this.bones[ b ]; + + if ( bone ) { + + if ( (bone.parent && bone.parent.isBone) ) { + + bone.matrix.getInverse( bone.parent.matrixWorld ); + bone.matrix.multiply( bone.matrixWorld ); + + } else { + + bone.matrix.copy( bone.matrixWorld ); + + } + + bone.matrix.decompose( bone.position, bone.quaternion, bone.scale ); + + } + + } + + }, + + update: ( function () { + + var offsetMatrix = new Matrix4(); + + return function update() { + + // flatten bone matrices to array + + for ( var b = 0, bl = this.bones.length; b < bl; b ++ ) { + + // compute the offset between the current and the original transform + + var matrix = this.bones[ b ] ? this.bones[ b ].matrixWorld : this.identityMatrix; + + offsetMatrix.multiplyMatrices( matrix, this.boneInverses[ b ] ); + offsetMatrix.toArray( this.boneMatrices, b * 16 ); + + } + + if ( this.useVertexTexture ) { + + this.boneTexture.needsUpdate = true; + + } + + }; + + } )(), + + clone: function () { + + return new Skeleton( this.bones, this.boneInverses, this.useVertexTexture ); + + } + + } ); + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + * @author ikerr / http://verold.com + */ + + function Bone( skin ) { + + Object3D.call( this ); + + this.type = 'Bone'; + + this.skin = skin; + + } + + Bone.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Bone, + + isBone: true, + + copy: function ( source ) { + + Object3D.prototype.copy.call( this, source ); + + this.skin = source.skin; + + return this; + + } + + } ); + + /** + * @author mikael emtinger / http://gomo.se/ + * @author alteredq / http://alteredqualia.com/ + * @author ikerr / http://verold.com + */ + + function SkinnedMesh( geometry, material, useVertexTexture ) { + + Mesh.call( this, geometry, material ); + + this.type = 'SkinnedMesh'; + + this.bindMode = "attached"; + this.bindMatrix = new Matrix4(); + this.bindMatrixInverse = new Matrix4(); + + // init bones + + // TODO: remove bone creation as there is no reason (other than + // convenience) for THREE.SkinnedMesh to do this. + + var bones = []; + + if ( this.geometry && this.geometry.bones !== undefined ) { + + var bone, gbone; + + for ( var b = 0, bl = this.geometry.bones.length; b < bl; ++ b ) { + + gbone = this.geometry.bones[ b ]; + + bone = new Bone( this ); + bones.push( bone ); + + bone.name = gbone.name; + bone.position.fromArray( gbone.pos ); + bone.quaternion.fromArray( gbone.rotq ); + if ( gbone.scl !== undefined ) bone.scale.fromArray( gbone.scl ); + + } + + for ( var b = 0, bl = this.geometry.bones.length; b < bl; ++ b ) { + + gbone = this.geometry.bones[ b ]; + + if ( gbone.parent !== - 1 && gbone.parent !== null && + bones[ gbone.parent ] !== undefined ) { + + bones[ gbone.parent ].add( bones[ b ] ); + + } else { + + this.add( bones[ b ] ); + + } + + } + + } + + this.normalizeSkinWeights(); + + this.updateMatrixWorld( true ); + this.bind( new Skeleton( bones, undefined, useVertexTexture ), this.matrixWorld ); + + } + + + SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), { + + constructor: SkinnedMesh, + + isSkinnedMesh: true, + + bind: function( skeleton, bindMatrix ) { + + this.skeleton = skeleton; + + if ( bindMatrix === undefined ) { + + this.updateMatrixWorld( true ); + + this.skeleton.calculateInverses(); + + bindMatrix = this.matrixWorld; + + } + + this.bindMatrix.copy( bindMatrix ); + this.bindMatrixInverse.getInverse( bindMatrix ); + + }, + + pose: function () { + + this.skeleton.pose(); + + }, + + normalizeSkinWeights: function () { + + if ( (this.geometry && this.geometry.isGeometry) ) { + + for ( var i = 0; i < this.geometry.skinWeights.length; i ++ ) { + + var sw = this.geometry.skinWeights[ i ]; + + var scale = 1.0 / sw.lengthManhattan(); + + if ( scale !== Infinity ) { + + sw.multiplyScalar( scale ); + + } else { + + sw.set( 1, 0, 0, 0 ); // do something reasonable + + } + + } + + } else if ( (this.geometry && this.geometry.isBufferGeometry) ) { + + var vec = new Vector4(); + + var skinWeight = this.geometry.attributes.skinWeight; + + for ( var i = 0; i < skinWeight.count; i ++ ) { + + vec.x = skinWeight.getX( i ); + vec.y = skinWeight.getY( i ); + vec.z = skinWeight.getZ( i ); + vec.w = skinWeight.getW( i ); + + var scale = 1.0 / vec.lengthManhattan(); + + if ( scale !== Infinity ) { + + vec.multiplyScalar( scale ); + + } else { + + vec.set( 1, 0, 0, 0 ); // do something reasonable + + } + + skinWeight.setXYZW( i, vec.x, vec.y, vec.z, vec.w ); + + } + + } + + }, + + updateMatrixWorld: function( force ) { + + Mesh.prototype.updateMatrixWorld.call( this, true ); + + if ( this.bindMode === "attached" ) { + + this.bindMatrixInverse.getInverse( this.matrixWorld ); + + } else if ( this.bindMode === "detached" ) { + + this.bindMatrixInverse.getInverse( this.bindMatrix ); + + } else { + + console.warn( 'THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode ); + + } + + }, + + clone: function() { + + return new this.constructor( this.geometry, this.material, this.skeleton.useVertexTexture ).copy( this ); + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * color: , + * opacity: , + * + * linewidth: , + * linecap: "round", + * linejoin: "round" + * } + */ + + function LineBasicMaterial( parameters ) { + + Material.call( this ); + + this.type = 'LineBasicMaterial'; + + this.color = new Color( 0xffffff ); + + this.linewidth = 1; + this.linecap = 'round'; + this.linejoin = 'round'; + + this.lights = false; + + this.setValues( parameters ); + + } + + LineBasicMaterial.prototype = Object.create( Material.prototype ); + LineBasicMaterial.prototype.constructor = LineBasicMaterial; + + LineBasicMaterial.prototype.isLineBasicMaterial = true; + + LineBasicMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + + this.linewidth = source.linewidth; + this.linecap = source.linecap; + this.linejoin = source.linejoin; + + return this; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function Line( geometry, material, mode ) { + + if ( mode === 1 ) { + + console.warn( 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.' ); + return new LineSegments( geometry, material ); + + } + + Object3D.call( this ); + + this.type = 'Line'; + + this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); + this.material = material !== undefined ? material : new LineBasicMaterial( { color: Math.random() * 0xffffff } ); + + } + + Line.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Line, + + isLine: true, + + raycast: ( function () { + + var inverseMatrix = new Matrix4(); + var ray = new Ray(); + var sphere = new Sphere(); + + return function raycast( raycaster, intersects ) { + + var precision = raycaster.linePrecision; + var precisionSq = precision * precision; + + var geometry = this.geometry; + var matrixWorld = this.matrixWorld; + + // Checking boundingSphere distance to ray + + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + + sphere.copy( geometry.boundingSphere ); + sphere.applyMatrix4( matrixWorld ); + + if ( raycaster.ray.intersectsSphere( sphere ) === false ) return; + + // + + inverseMatrix.getInverse( matrixWorld ); + ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix ); + + var vStart = new Vector3(); + var vEnd = new Vector3(); + var interSegment = new Vector3(); + var interRay = new Vector3(); + var step = (this && this.isLineSegments) ? 2 : 1; + + if ( (geometry && geometry.isBufferGeometry) ) { + + var index = geometry.index; + var attributes = geometry.attributes; + var positions = attributes.position.array; + + if ( index !== null ) { + + var indices = index.array; + + for ( var i = 0, l = indices.length - 1; i < l; i += step ) { + + var a = indices[ i ]; + var b = indices[ i + 1 ]; + + vStart.fromArray( positions, a * 3 ); + vEnd.fromArray( positions, b * 3 ); + + var distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); + + if ( distSq > precisionSq ) continue; + + interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + + var distance = raycaster.ray.origin.distanceTo( interRay ); + + if ( distance < raycaster.near || distance > raycaster.far ) continue; + + intersects.push( { + + distance: distance, + // What do we want? intersection point on the ray or on the segment?? + // point: raycaster.ray.at( distance ), + point: interSegment.clone().applyMatrix4( this.matrixWorld ), + index: i, + face: null, + faceIndex: null, + object: this + + } ); + + } + + } else { + + for ( var i = 0, l = positions.length / 3 - 1; i < l; i += step ) { + + vStart.fromArray( positions, 3 * i ); + vEnd.fromArray( positions, 3 * i + 3 ); + + var distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); + + if ( distSq > precisionSq ) continue; + + interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + + var distance = raycaster.ray.origin.distanceTo( interRay ); + + if ( distance < raycaster.near || distance > raycaster.far ) continue; + + intersects.push( { + + distance: distance, + // What do we want? intersection point on the ray or on the segment?? + // point: raycaster.ray.at( distance ), + point: interSegment.clone().applyMatrix4( this.matrixWorld ), + index: i, + face: null, + faceIndex: null, + object: this + + } ); + + } + + } + + } else if ( (geometry && geometry.isGeometry) ) { + + var vertices = geometry.vertices; + var nbVertices = vertices.length; + + for ( var i = 0; i < nbVertices - 1; i += step ) { + + var distSq = ray.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment ); + + if ( distSq > precisionSq ) continue; + + interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation + + var distance = raycaster.ray.origin.distanceTo( interRay ); + + if ( distance < raycaster.near || distance > raycaster.far ) continue; + + intersects.push( { + + distance: distance, + // What do we want? intersection point on the ray or on the segment?? + // point: raycaster.ray.at( distance ), + point: interSegment.clone().applyMatrix4( this.matrixWorld ), + index: i, + face: null, + faceIndex: null, + object: this + + } ); + + } + + } + + }; + + }() ), + + clone: function () { + + return new this.constructor( this.geometry, this.material ).copy( this ); + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function LineSegments( geometry, material ) { + + Line.call( this, geometry, material ); + + this.type = 'LineSegments'; + + } + + LineSegments.prototype = Object.assign( Object.create( Line.prototype ), { + + constructor: LineSegments, + + isLineSegments: true + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * color: , + * opacity: , + * map: new THREE.Texture( ), + * + * size: , + * sizeAttenuation: + * } + */ + + function PointsMaterial( parameters ) { + + Material.call( this ); + + this.type = 'PointsMaterial'; + + this.color = new Color( 0xffffff ); + + this.map = null; + + this.size = 1; + this.sizeAttenuation = true; + + this.lights = false; + + this.setValues( parameters ); + + } + + PointsMaterial.prototype = Object.create( Material.prototype ); + PointsMaterial.prototype.constructor = PointsMaterial; + + PointsMaterial.prototype.isPointsMaterial = true; + + PointsMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + + this.map = source.map; + + this.size = source.size; + this.sizeAttenuation = source.sizeAttenuation; + + return this; + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function Points( geometry, material ) { + + Object3D.call( this ); + + this.type = 'Points'; + + this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); + this.material = material !== undefined ? material : new PointsMaterial( { color: Math.random() * 0xffffff } ); + + } + + Points.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Points, + + isPoints: true, + + raycast: ( function () { + + var inverseMatrix = new Matrix4(); + var ray = new Ray(); + var sphere = new Sphere(); + + return function raycast( raycaster, intersects ) { + + var object = this; + var geometry = this.geometry; + var matrixWorld = this.matrixWorld; + var threshold = raycaster.params.Points.threshold; + + // Checking boundingSphere distance to ray + + if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); + + sphere.copy( geometry.boundingSphere ); + sphere.applyMatrix4( matrixWorld ); + + if ( raycaster.ray.intersectsSphere( sphere ) === false ) return; + + // + + inverseMatrix.getInverse( matrixWorld ); + ray.copy( raycaster.ray ).applyMatrix4( inverseMatrix ); + + var localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); + var localThresholdSq = localThreshold * localThreshold; + var position = new Vector3(); + + function testPoint( point, index ) { + + var rayPointDistanceSq = ray.distanceSqToPoint( point ); + + if ( rayPointDistanceSq < localThresholdSq ) { + + var intersectPoint = ray.closestPointToPoint( point ); + intersectPoint.applyMatrix4( matrixWorld ); + + var distance = raycaster.ray.origin.distanceTo( intersectPoint ); + + if ( distance < raycaster.near || distance > raycaster.far ) return; + + intersects.push( { + + distance: distance, + distanceToRay: Math.sqrt( rayPointDistanceSq ), + point: intersectPoint.clone(), + index: index, + face: null, + object: object + + } ); + + } + + } + + if ( (geometry && geometry.isBufferGeometry) ) { + + var index = geometry.index; + var attributes = geometry.attributes; + var positions = attributes.position.array; + + if ( index !== null ) { + + var indices = index.array; + + for ( var i = 0, il = indices.length; i < il; i ++ ) { + + var a = indices[ i ]; + + position.fromArray( positions, a * 3 ); + + testPoint( position, a ); + + } + + } else { + + for ( var i = 0, l = positions.length / 3; i < l; i ++ ) { + + position.fromArray( positions, i * 3 ); + + testPoint( position, i ); + + } + + } + + } else { + + var vertices = geometry.vertices; + + for ( var i = 0, l = vertices.length; i < l; i ++ ) { + + testPoint( vertices[ i ], i ); + + } + + } + + }; + + }() ), + + clone: function () { + + return new this.constructor( this.geometry, this.material ).copy( this ); + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function Group() { + + Object3D.call( this ); + + this.type = 'Group'; + + } + + Group.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Group + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { + + Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + + this.generateMipmaps = false; + + var scope = this; + + function update() { + + requestAnimationFrame( update ); + + if ( video.readyState >= video.HAVE_CURRENT_DATA ) { + + scope.needsUpdate = true; + + } + + } + + update(); + + } + + VideoTexture.prototype = Object.create( Texture.prototype ); + VideoTexture.prototype.constructor = VideoTexture; + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function CompressedTexture( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) { + + Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); + + this.image = { width: width, height: height }; + this.mipmaps = mipmaps; + + // no flipping for cube textures + // (also flipping doesn't work for compressed textures ) + + this.flipY = false; + + // can't generate mipmaps for compressed textures + // mips must be embedded in DDS files + + this.generateMipmaps = false; + + } + + CompressedTexture.prototype = Object.create( Texture.prototype ); + CompressedTexture.prototype.constructor = CompressedTexture; + + CompressedTexture.prototype.isCompressedTexture = true; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function CanvasTexture( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { + + Texture.call( this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + + this.needsUpdate = true; + + } + + CanvasTexture.prototype = Object.create( Texture.prototype ); + CanvasTexture.prototype.constructor = CanvasTexture; + + /** + * @author Matt DesLauriers / @mattdesl + * @author atix / arthursilber.de + */ + + function DepthTexture( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) { + + format = format !== undefined ? format : DepthFormat; + + if ( format !== DepthFormat && format !== DepthStencilFormat ) { + + throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' ) + + } + + Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); + + this.image = { width: width, height: height }; + + this.type = type !== undefined ? type : UnsignedShortType; + + this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; + this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; + + this.flipY = false; + this.generateMipmaps = false; + + } + + DepthTexture.prototype = Object.create( Texture.prototype ); + DepthTexture.prototype.constructor = DepthTexture; + DepthTexture.prototype.isDepthTexture = true; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function WireframeGeometry( geometry ) { + + BufferGeometry.call( this ); + + var edge = [ 0, 0 ], hash = {}; + + function sortFunction( a, b ) { + + return a - b; + + } + + var keys = [ 'a', 'b', 'c' ]; + + if ( (geometry && geometry.isGeometry) ) { + + var vertices = geometry.vertices; + var faces = geometry.faces; + var numEdges = 0; + + // allocate maximal size + var edges = new Uint32Array( 6 * faces.length ); + + for ( var i = 0, l = faces.length; i < l; i ++ ) { + + var face = faces[ i ]; + + for ( var j = 0; j < 3; j ++ ) { + + edge[ 0 ] = face[ keys[ j ] ]; + edge[ 1 ] = face[ keys[ ( j + 1 ) % 3 ] ]; + edge.sort( sortFunction ); + + var key = edge.toString(); + + if ( hash[ key ] === undefined ) { + + edges[ 2 * numEdges ] = edge[ 0 ]; + edges[ 2 * numEdges + 1 ] = edge[ 1 ]; + hash[ key ] = true; + numEdges ++; + + } + + } + + } + + var coords = new Float32Array( numEdges * 2 * 3 ); + + for ( var i = 0, l = numEdges; i < l; i ++ ) { + + for ( var j = 0; j < 2; j ++ ) { + + var vertex = vertices[ edges [ 2 * i + j ] ]; + + var index = 6 * i + 3 * j; + coords[ index + 0 ] = vertex.x; + coords[ index + 1 ] = vertex.y; + coords[ index + 2 ] = vertex.z; + + } + + } + + this.addAttribute( 'position', new BufferAttribute( coords, 3 ) ); + + } else if ( (geometry && geometry.isBufferGeometry) ) { + + if ( geometry.index !== null ) { + + // Indexed BufferGeometry + + var indices = geometry.index.array; + var vertices = geometry.attributes.position; + var groups = geometry.groups; + var numEdges = 0; + + if ( groups.length === 0 ) { + + geometry.addGroup( 0, indices.length ); + + } + + // allocate maximal size + var edges = new Uint32Array( 2 * indices.length ); + + for ( var o = 0, ol = groups.length; o < ol; ++ o ) { + + var group = groups[ o ]; + + var start = group.start; + var count = group.count; + + for ( var i = start, il = start + count; i < il; i += 3 ) { + + for ( var j = 0; j < 3; j ++ ) { + + edge[ 0 ] = indices[ i + j ]; + edge[ 1 ] = indices[ i + ( j + 1 ) % 3 ]; + edge.sort( sortFunction ); + + var key = edge.toString(); + + if ( hash[ key ] === undefined ) { + + edges[ 2 * numEdges ] = edge[ 0 ]; + edges[ 2 * numEdges + 1 ] = edge[ 1 ]; + hash[ key ] = true; + numEdges ++; + + } + + } + + } + + } + + var coords = new Float32Array( numEdges * 2 * 3 ); + + for ( var i = 0, l = numEdges; i < l; i ++ ) { + + for ( var j = 0; j < 2; j ++ ) { + + var index = 6 * i + 3 * j; + var index2 = edges[ 2 * i + j ]; + + coords[ index + 0 ] = vertices.getX( index2 ); + coords[ index + 1 ] = vertices.getY( index2 ); + coords[ index + 2 ] = vertices.getZ( index2 ); + + } + + } + + this.addAttribute( 'position', new BufferAttribute( coords, 3 ) ); + + } else { + + // non-indexed BufferGeometry + + var vertices = geometry.attributes.position.array; + var numEdges = vertices.length / 3; + var numTris = numEdges / 3; + + var coords = new Float32Array( numEdges * 2 * 3 ); + + for ( var i = 0, l = numTris; i < l; i ++ ) { + + for ( var j = 0; j < 3; j ++ ) { + + var index = 18 * i + 6 * j; + + var index1 = 9 * i + 3 * j; + coords[ index + 0 ] = vertices[ index1 ]; + coords[ index + 1 ] = vertices[ index1 + 1 ]; + coords[ index + 2 ] = vertices[ index1 + 2 ]; + + var index2 = 9 * i + 3 * ( ( j + 1 ) % 3 ); + coords[ index + 3 ] = vertices[ index2 ]; + coords[ index + 4 ] = vertices[ index2 + 1 ]; + coords[ index + 5 ] = vertices[ index2 + 2 ]; + + } + + } + + this.addAttribute( 'position', new BufferAttribute( coords, 3 ) ); + + } + + } + + } + + WireframeGeometry.prototype = Object.create( BufferGeometry.prototype ); + WireframeGeometry.prototype.constructor = WireframeGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + * + * Parametric Surfaces Geometry + * based on the brilliant article by @prideout http://prideout.net/blog/?p=44 + */ + + function ParametricBufferGeometry( func, slices, stacks ) { + + BufferGeometry.call( this ); + + this.type = 'ParametricBufferGeometry'; + + this.parameters = { + func: func, + slices: slices, + stacks: stacks + }; + + // generate vertices and uvs + + var vertices = []; + var uvs = []; + + var i, j, p; + var u, v; + + var sliceCount = slices + 1; + + for ( i = 0; i <= stacks; i ++ ) { + + v = i / stacks; + + for ( j = 0; j <= slices; j ++ ) { + + u = j / slices; + + p = func( u, v ); + vertices.push( p.x, p.y, p.z ); + + uvs.push( u, v ); + + } + + } + + // generate indices + + var indices = []; + var a, b, c, d; + + for ( i = 0; i < stacks; i ++ ) { + + for ( j = 0; j < slices; j ++ ) { + + a = i * sliceCount + j; + b = i * sliceCount + j + 1; + c = ( i + 1 ) * sliceCount + j + 1; + d = ( i + 1 ) * sliceCount + j; + + // faces one and two + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } + + } + + // build geometry + + this.setIndex( ( indices.length > 65535 ? Uint32Attribute : Uint16Attribute )( indices, 1 ) ); + this.addAttribute( 'position', Float32Attribute( vertices, 3 ) ); + this.addAttribute( 'uv', Float32Attribute( uvs, 2 ) ); + + // generate normals + + this.computeVertexNormals(); + + } + + ParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + ParametricBufferGeometry.prototype.constructor = ParametricBufferGeometry; + + /** + * @author zz85 / https://github.com/zz85 + * + * Parametric Surfaces Geometry + * based on the brilliant article by @prideout http://prideout.net/blog/?p=44 + */ + + function ParametricGeometry( func, slices, stacks ) { + + Geometry.call( this ); + + this.type = 'ParametricGeometry'; + + this.parameters = { + func: func, + slices: slices, + stacks: stacks + }; + + this.fromBufferGeometry( new ParametricBufferGeometry( func, slices, stacks ) ); + this.mergeVertices(); + + } + + ParametricGeometry.prototype = Object.create( Geometry.prototype ); + ParametricGeometry.prototype.constructor = ParametricGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function PolyhedronBufferGeometry( vertices, indices, radius, detail ) { + + BufferGeometry.call( this ); + + this.type = 'PolyhedronBufferGeometry'; + + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; + + radius = radius || 1; + detail = detail || 0; + + // default buffer data + + var vertexBuffer = []; + var uvBuffer = []; + + // the subdivision creates the vertex buffer data + + subdivide( detail ); + + // all vertices should lie on a conceptual sphere with a given radius + + appplyRadius( radius ); + + // finally, create the uv data + + generateUVs(); + + // build non-indexed geometry + + this.addAttribute( 'position', Float32Attribute( vertexBuffer, 3 ) ); + this.addAttribute( 'normal', Float32Attribute( vertexBuffer.slice(), 3 ) ); + this.addAttribute( 'uv', Float32Attribute( uvBuffer, 2 ) ); + this.normalizeNormals(); + + this.boundingSphere = new Sphere( new Vector3(), radius ); + + // helper functions + + function subdivide( detail ) { + + var a = new Vector3(); + var b = new Vector3(); + var c = new Vector3(); + + // iterate over all faces and apply a subdivison with the given detail value + + for ( var i = 0; i < indices.length; i += 3 ) { + + // get the vertices of the face + + getVertexByIndex( indices[ i + 0 ], a ); + getVertexByIndex( indices[ i + 1 ], b ); + getVertexByIndex( indices[ i + 2 ], c ); + + // perform subdivision + + subdivideFace( a, b, c, detail ); + + } + + } + + function subdivideFace( a, b, c, detail ) { + + var cols = Math.pow( 2, detail ); + + // we use this multidimensional array as a data structure for creating the subdivision + + var v = []; + + var i, j; + + // construct all of the vertices for this subdivision + + for ( i = 0 ; i <= cols; i ++ ) { + + v[ i ] = []; + + var aj = a.clone().lerp( c, i / cols ); + var bj = b.clone().lerp( c, i / cols ); + + var rows = cols - i; + + for ( j = 0; j <= rows; j ++ ) { + + if ( j === 0 && i === cols ) { + + v[ i ][ j ] = aj; + + } else { + + v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); + + } + + } + + } + + // construct all of the faces + + for ( i = 0; i < cols ; i ++ ) { + + for ( j = 0; j < 2 * ( cols - i ) - 1; j ++ ) { + + var k = Math.floor( j / 2 ); + + if ( j % 2 === 0 ) { + + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); + pushVertex( v[ i ][ k ] ); + + } else { + + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); + + } + + } + + } + + } + + function appplyRadius( radius ) { + + var vertex = new Vector3(); + + // iterate over the entire buffer and apply the radius to each vertex + + for ( var i = 0; i < vertexBuffer.length; i += 3 ) { + + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; + + vertex.normalize().multiplyScalar( radius ); + + vertexBuffer[ i + 0 ] = vertex.x; + vertexBuffer[ i + 1 ] = vertex.y; + vertexBuffer[ i + 2 ] = vertex.z; + + } + + } + + function generateUVs() { + + var vertex = new Vector3(); + + for ( var i = 0; i < vertexBuffer.length; i += 3 ) { + + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; + + var u = azimuth( vertex ) / 2 / Math.PI + 0.5; + var v = inclination( vertex ) / Math.PI + 0.5; + uvBuffer.push( u, 1 - v ); + + } + + correctUVs(); + + correctSeam(); + + } + + function correctSeam() { + + // handle case when face straddles the seam, see #3269 + + for ( var i = 0; i < uvBuffer.length; i += 6 ) { + + // uv data of a single face + + var x0 = uvBuffer[ i + 0 ]; + var x1 = uvBuffer[ i + 2 ]; + var x2 = uvBuffer[ i + 4 ]; + + var max = Math.max( x0, x1, x2 ); + var min = Math.min( x0, x1, x2 ); + + // 0.9 is somewhat arbitrary + + if ( max > 0.9 && min < 0.1 ) { + + if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1; + if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1; + if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1; + + } + + } + + } + + function pushVertex( vertex ) { + + vertexBuffer.push( vertex.x, vertex.y, vertex.z ); + + } + + function getVertexByIndex( index, vertex ) { + + var stride = index * 3; + + vertex.x = vertices[ stride + 0 ]; + vertex.y = vertices[ stride + 1 ]; + vertex.z = vertices[ stride + 2 ]; + + } + + function correctUVs() { + + var a = new Vector3(); + var b = new Vector3(); + var c = new Vector3(); + + var centroid = new Vector3(); + + var uvA = new Vector2(); + var uvB = new Vector2(); + var uvC = new Vector2(); + + for ( var i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { + + a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); + b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); + c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); + + uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); + uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); + uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); + + centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); + + var azi = azimuth( centroid ); + + correctUV( uvA, j + 0, a, azi ); + correctUV( uvB, j + 2, b, azi ); + correctUV( uvC, j + 4, c, azi ); + + } + + } + + function correctUV( uv, stride, vector, azimuth ) { + + if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { + + uvBuffer[ stride ] = uv.x - 1; + + } + + if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { + + uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; + + } + + } + + // Angle around the Y axis, counter-clockwise when looking from above. + + function azimuth( vector ) { + + return Math.atan2( vector.z, - vector.x ); + + } + + + // Angle above the XZ plane. + + function inclination( vector ) { + + return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); + + } + + } + + PolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + PolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function TetrahedronBufferGeometry( radius, detail ) { + + var vertices = [ + 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 + ]; + + var indices = [ + 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 + ]; + + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + + this.type = 'TetrahedronBufferGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry; + + /** + * @author timothypratley / https://github.com/timothypratley + */ + + function TetrahedronGeometry( radius, detail ) { + + Geometry.call( this ); + + this.type = 'TetrahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); + + } + + TetrahedronGeometry.prototype = Object.create( Geometry.prototype ); + TetrahedronGeometry.prototype.constructor = TetrahedronGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function OctahedronBufferGeometry( radius,detail ) { + + var vertices = [ + 1, 0, 0, - 1, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, 0, - 1 + ]; + + var indices = [ + 0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2 + ]; + + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + + this.type = 'OctahedronBufferGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + OctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + OctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry; + + /** + * @author timothypratley / https://github.com/timothypratley + */ + + function OctahedronGeometry( radius, detail ) { + + Geometry.call( this ); + + this.type = 'OctahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + this.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); + + } + + OctahedronGeometry.prototype = Object.create( Geometry.prototype ); + OctahedronGeometry.prototype.constructor = OctahedronGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function IcosahedronBufferGeometry( radius, detail ) { + + var t = ( 1 + Math.sqrt( 5 ) ) / 2; + + var vertices = [ + - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, + 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, + t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 + ]; + + var indices = [ + 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, + 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, + 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, + 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 + ]; + + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + + this.type = 'IcosahedronBufferGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + IcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + IcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry; + + /** + * @author timothypratley / https://github.com/timothypratley + */ + + function IcosahedronGeometry( radius, detail ) { + + Geometry.call( this ); + + this.type = 'IcosahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + this.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); + + } + + IcosahedronGeometry.prototype = Object.create( Geometry.prototype ); + IcosahedronGeometry.prototype.constructor = IcosahedronGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function DodecahedronBufferGeometry( radius, detail ) { + + var t = ( 1 + Math.sqrt( 5 ) ) / 2; + var r = 1 / t; + + var vertices = [ + + // (±1, ±1, ±1) + - 1, - 1, - 1, - 1, - 1, 1, + - 1, 1, - 1, - 1, 1, 1, + 1, - 1, - 1, 1, - 1, 1, + 1, 1, - 1, 1, 1, 1, + + // (0, ±1/φ, ±φ) + 0, - r, - t, 0, - r, t, + 0, r, - t, 0, r, t, + + // (±1/φ, ±φ, 0) + - r, - t, 0, - r, t, 0, + r, - t, 0, r, t, 0, + + // (±φ, 0, ±1/φ) + - t, 0, - r, t, 0, - r, + - t, 0, r, t, 0, r + ]; + + var indices = [ + 3, 11, 7, 3, 7, 15, 3, 15, 13, + 7, 19, 17, 7, 17, 6, 7, 6, 15, + 17, 4, 8, 17, 8, 10, 17, 10, 6, + 8, 0, 16, 8, 16, 2, 8, 2, 10, + 0, 12, 1, 0, 1, 18, 0, 18, 16, + 6, 10, 2, 6, 2, 13, 6, 13, 15, + 2, 16, 18, 2, 18, 3, 2, 3, 13, + 18, 1, 9, 18, 9, 11, 18, 11, 3, + 4, 14, 12, 4, 12, 0, 4, 0, 8, + 11, 9, 5, 11, 5, 19, 11, 19, 7, + 19, 5, 14, 19, 14, 4, 19, 4, 17, + 1, 12, 14, 1, 14, 5, 1, 5, 9 + ]; + + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + + this.type = 'DodecahedronBufferGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + } + + DodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + DodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry; + + /** + * @author Abe Pazos / https://hamoid.com + */ + + function DodecahedronGeometry( radius, detail ) { + + Geometry.call( this ); + + this.type = 'DodecahedronGeometry'; + + this.parameters = { + radius: radius, + detail: detail + }; + + this.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); + + } + + DodecahedronGeometry.prototype = Object.create( Geometry.prototype ); + DodecahedronGeometry.prototype.constructor = DodecahedronGeometry; + + /** + * @author clockworkgeek / https://github.com/clockworkgeek + * @author timothypratley / https://github.com/timothypratley + * @author WestLangley / http://github.com/WestLangley + */ + + function PolyhedronGeometry( vertices, indices, radius, detail ) { + + Geometry.call( this ); + + this.type = 'PolyhedronGeometry'; + + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; + + this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) ); + this.mergeVertices(); + + } + + PolyhedronGeometry.prototype = Object.create( Geometry.prototype ); + PolyhedronGeometry.prototype.constructor = PolyhedronGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + * + * Creates a tube which extrudes along a 3d spline. + * + */ + + function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ) { + + BufferGeometry.call( this ); + + this.type = 'TubeBufferGeometry'; + + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; + + tubularSegments = tubularSegments || 64; + radius = radius || 1; + radialSegments = radialSegments || 8; + closed = closed || false; + + var frames = path.computeFrenetFrames( tubularSegments, closed ); + + // expose internals + + this.tangents = frames.tangents; + this.normals = frames.normals; + this.binormals = frames.binormals; + + // helper variables + + var vertex = new Vector3(); + var normal = new Vector3(); + var uv = new Vector2(); + + var i, j; + + // buffer + + var vertices = []; + var normals = []; + var uvs = []; + var indices = []; + + // create buffer data + + generateBufferData(); + + // build geometry + + this.setIndex( ( indices.length > 65535 ? Uint32Attribute : Uint16Attribute )( indices, 1 ) ); + this.addAttribute( 'position', Float32Attribute( vertices, 3 ) ); + this.addAttribute( 'normal', Float32Attribute( normals, 3 ) ); + this.addAttribute( 'uv', Float32Attribute( uvs, 2 ) ); + + // functions + + function generateBufferData() { + + for ( i = 0; i < tubularSegments; i ++ ) { + + generateSegment( i ); + + } + + // if the geometry is not closed, generate the last row of vertices and normals + // at the regular position on the given path + // + // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) + + generateSegment( ( closed === false ) ? tubularSegments : 0 ); + + // uvs are generated in a separate function. + // this makes it easy compute correct values for closed geometries + + generateUVs(); + + // finally create faces + + generateIndices(); + + } + + function generateSegment( i ) { + + // we use getPointAt to sample evenly distributed points from the given path + + var P = path.getPointAt( i / tubularSegments ); + + // retrieve corresponding normal and binormal + + var N = frames.normals[ i ]; + var B = frames.binormals[ i ]; + + // generate normals and vertices for the current segment + + for ( j = 0; j <= radialSegments; j ++ ) { + + var v = j / radialSegments * Math.PI * 2; + + var sin = Math.sin( v ); + var cos = - Math.cos( v ); + + // normal + + normal.x = ( cos * N.x + sin * B.x ); + normal.y = ( cos * N.y + sin * B.y ); + normal.z = ( cos * N.z + sin * B.z ); + normal.normalize(); + + normals.push( normal.x, normal.y, normal.z ); + + // vertex + + vertex.x = P.x + radius * normal.x; + vertex.y = P.y + radius * normal.y; + vertex.z = P.z + radius * normal.z; + + vertices.push( vertex.x, vertex.y, vertex.z ); + + } + + } + + function generateIndices() { + + for ( j = 1; j <= tubularSegments; j ++ ) { + + for ( i = 1; i <= radialSegments; i ++ ) { + + var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + var b = ( radialSegments + 1 ) * j + ( i - 1 ); + var c = ( radialSegments + 1 ) * j + i; + var d = ( radialSegments + 1 ) * ( j - 1 ) + i; + + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } + + } + + } + + function generateUVs() { + + for ( i = 0; i <= tubularSegments; i ++ ) { + + for ( j = 0; j <= radialSegments; j ++ ) { + + uv.x = i / tubularSegments; + uv.y = j / radialSegments; + + uvs.push( uv.x, uv.y ); + + } + + } + + } + + } + + TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + TubeBufferGeometry.prototype.constructor = TubeBufferGeometry; + + /** + * @author oosmoxiecode / https://github.com/oosmoxiecode + * @author WestLangley / https://github.com/WestLangley + * @author zz85 / https://github.com/zz85 + * @author miningold / https://github.com/miningold + * @author jonobr1 / https://github.com/jonobr1 + * + * Creates a tube which extrudes along a 3d spline. + */ + + function TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) { + + Geometry.call( this ); + + this.type = 'TubeGeometry'; + + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; + + if ( taper !== undefined ) console.warn( 'THREE.TubeGeometry: taper has been removed.' ); + + var bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ); + + // expose internals + + this.tangents = bufferGeometry.tangents; + this.normals = bufferGeometry.normals; + this.binormals = bufferGeometry.binormals; + + // create geometry + + this.fromBufferGeometry( bufferGeometry ); + this.mergeVertices(); + + } + + TubeGeometry.prototype = Object.create( Geometry.prototype ); + TubeGeometry.prototype.constructor = TubeGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + * + * see: http://www.blackpawn.com/texts/pqtorus/ + */ + function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) { + + BufferGeometry.call( this ); + + this.type = 'TorusKnotBufferGeometry'; + + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; + + radius = radius || 100; + tube = tube || 40; + tubularSegments = Math.floor( tubularSegments ) || 64; + radialSegments = Math.floor( radialSegments ) || 8; + p = p || 2; + q = q || 3; + + // used to calculate buffer length + var vertexCount = ( ( radialSegments + 1 ) * ( tubularSegments + 1 ) ); + var indexCount = radialSegments * tubularSegments * 2 * 3; + + // buffers + var indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ) , 1 ); + var vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 ); + + // helper variables + var i, j, index = 0, indexOffset = 0; + + var vertex = new Vector3(); + var normal = new Vector3(); + var uv = new Vector2(); + + var P1 = new Vector3(); + var P2 = new Vector3(); + + var B = new Vector3(); + var T = new Vector3(); + var N = new Vector3(); + + // generate vertices, normals and uvs + + for ( i = 0; i <= tubularSegments; ++ i ) { + + // the radian "u" is used to calculate the position on the torus curve of the current tubular segement + + var u = i / tubularSegments * p * Math.PI * 2; + + // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. + // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions + + calculatePositionOnCurve( u, p, q, radius, P1 ); + calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); + + // calculate orthonormal basis + + T.subVectors( P2, P1 ); + N.addVectors( P2, P1 ); + B.crossVectors( T, N ); + N.crossVectors( B, T ); + + // normalize B, N. T can be ignored, we don't use it + + B.normalize(); + N.normalize(); + + for ( j = 0; j <= radialSegments; ++ j ) { + + // now calculate the vertices. they are nothing more than an extrusion of the torus curve. + // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. + + var v = j / radialSegments * Math.PI * 2; + var cx = - tube * Math.cos( v ); + var cy = tube * Math.sin( v ); + + // now calculate the final vertex position. + // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve + + vertex.x = P1.x + ( cx * N.x + cy * B.x ); + vertex.y = P1.y + ( cx * N.y + cy * B.y ); + vertex.z = P1.z + ( cx * N.z + cy * B.z ); + + // vertex + vertices.setXYZ( index, vertex.x, vertex.y, vertex.z ); + + // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) + normal.subVectors( vertex, P1 ).normalize(); + normals.setXYZ( index, normal.x, normal.y, normal.z ); + + // uv + uv.x = i / tubularSegments; + uv.y = j / radialSegments; + uvs.setXY( index, uv.x, uv.y ); + + // increase index + index ++; + + } + + } + + // generate indices + + for ( j = 1; j <= tubularSegments; j ++ ) { + + for ( i = 1; i <= radialSegments; i ++ ) { + + // indices + var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + var b = ( radialSegments + 1 ) * j + ( i - 1 ); + var c = ( radialSegments + 1 ) * j + i; + var d = ( radialSegments + 1 ) * ( j - 1 ) + i; + + // face one + indices.setX( indexOffset, a ); indexOffset++; + indices.setX( indexOffset, b ); indexOffset++; + indices.setX( indexOffset, d ); indexOffset++; + + // face two + indices.setX( indexOffset, b ); indexOffset++; + indices.setX( indexOffset, c ); indexOffset++; + indices.setX( indexOffset, d ); indexOffset++; + + } + + } + + // build geometry + + this.setIndex( indices ); + this.addAttribute( 'position', vertices ); + this.addAttribute( 'normal', normals ); + this.addAttribute( 'uv', uvs ); + + // this function calculates the current position on the torus curve + + function calculatePositionOnCurve( u, p, q, radius, position ) { + + var cu = Math.cos( u ); + var su = Math.sin( u ); + var quOverP = q / p * u; + var cs = Math.cos( quOverP ); + + position.x = radius * ( 2 + cs ) * 0.5 * cu; + position.y = radius * ( 2 + cs ) * su * 0.5; + position.z = radius * Math.sin( quOverP ) * 0.5; + + } + + } + + TorusKnotBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry; + + /** + * @author oosmoxiecode + */ + + function TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) { + + Geometry.call( this ); + + this.type = 'TorusKnotGeometry'; + + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; + + if( heightScale !== undefined ) console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' ); + + this.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) ); + this.mergeVertices(); + + } + + TorusKnotGeometry.prototype = Object.create( Geometry.prototype ); + TorusKnotGeometry.prototype.constructor = TorusKnotGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) { + + BufferGeometry.call( this ); + + this.type = 'TorusBufferGeometry'; + + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; + + radius = radius || 100; + tube = tube || 40; + radialSegments = Math.floor( radialSegments ) || 8; + tubularSegments = Math.floor( tubularSegments ) || 6; + arc = arc || Math.PI * 2; + + // used to calculate buffer length + var vertexCount = ( ( radialSegments + 1 ) * ( tubularSegments + 1 ) ); + var indexCount = radialSegments * tubularSegments * 2 * 3; + + // buffers + var indices = new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ); + var vertices = new Float32Array( vertexCount * 3 ); + var normals = new Float32Array( vertexCount * 3 ); + var uvs = new Float32Array( vertexCount * 2 ); + + // offset variables + var vertexBufferOffset = 0; + var uvBufferOffset = 0; + var indexBufferOffset = 0; + + // helper variables + var center = new Vector3(); + var vertex = new Vector3(); + var normal = new Vector3(); + + var j, i; + + // generate vertices, normals and uvs + + for ( j = 0; j <= radialSegments; j ++ ) { + + for ( i = 0; i <= tubularSegments; i ++ ) { + + var u = i / tubularSegments * arc; + var v = j / radialSegments * Math.PI * 2; + + // vertex + vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); + vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); + vertex.z = tube * Math.sin( v ); + + vertices[ vertexBufferOffset ] = vertex.x; + vertices[ vertexBufferOffset + 1 ] = vertex.y; + vertices[ vertexBufferOffset + 2 ] = vertex.z; + + // this vector is used to calculate the normal + center.x = radius * Math.cos( u ); + center.y = radius * Math.sin( u ); + + // normal + normal.subVectors( vertex, center ).normalize(); + + normals[ vertexBufferOffset ] = normal.x; + normals[ vertexBufferOffset + 1 ] = normal.y; + normals[ vertexBufferOffset + 2 ] = normal.z; + + // uv + uvs[ uvBufferOffset ] = i / tubularSegments; + uvs[ uvBufferOffset + 1 ] = j / radialSegments; + + // update offsets + vertexBufferOffset += 3; + uvBufferOffset += 2; + + } + + } + + // generate indices + + for ( j = 1; j <= radialSegments; j ++ ) { + + for ( i = 1; i <= tubularSegments; i ++ ) { + + // indices + var a = ( tubularSegments + 1 ) * j + i - 1; + var b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; + var c = ( tubularSegments + 1 ) * ( j - 1 ) + i; + var d = ( tubularSegments + 1 ) * j + i; + + // face one + indices[ indexBufferOffset ] = a; + indices[ indexBufferOffset + 1 ] = b; + indices[ indexBufferOffset + 2 ] = d; + + // face two + indices[ indexBufferOffset + 3 ] = b; + indices[ indexBufferOffset + 4 ] = c; + indices[ indexBufferOffset + 5 ] = d; + + // update offset + indexBufferOffset += 6; + + } + + } + + // build geometry + this.setIndex( new BufferAttribute( indices, 1 ) ); + this.addAttribute( 'position', new BufferAttribute( vertices, 3 ) ); + this.addAttribute( 'normal', new BufferAttribute( normals, 3 ) ); + this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) ); + + } + + TorusBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + TorusBufferGeometry.prototype.constructor = TorusBufferGeometry; + + /** + * @author oosmoxiecode + * @author mrdoob / http://mrdoob.com/ + * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888 + */ + + function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { + + Geometry.call( this ); + + this.type = 'TorusGeometry'; + + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; + + this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) ); + + } + + TorusGeometry.prototype = Object.create( Geometry.prototype ); + TorusGeometry.prototype.constructor = TorusGeometry; + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + */ + + var ShapeUtils = { + + // calculate area of the contour polygon + + area: function ( contour ) { + + var n = contour.length; + var a = 0.0; + + for ( var p = n - 1, q = 0; q < n; p = q ++ ) { + + a += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y; + + } + + return a * 0.5; + + }, + + triangulate: ( function () { + + /** + * This code is a quick port of code written in C++ which was submitted to + * flipcode.com by John W. Ratcliff // July 22, 2000 + * See original code and more information here: + * http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml + * + * ported to actionscript by Zevan Rosser + * www.actionsnippet.com + * + * ported to javascript by Joshua Koo + * http://www.lab4games.net/zz85/blog + * + */ + + function snip( contour, u, v, w, n, verts ) { + + var p; + var ax, ay, bx, by; + var cx, cy, px, py; + + ax = contour[ verts[ u ] ].x; + ay = contour[ verts[ u ] ].y; + + bx = contour[ verts[ v ] ].x; + by = contour[ verts[ v ] ].y; + + cx = contour[ verts[ w ] ].x; + cy = contour[ verts[ w ] ].y; + + if ( ( bx - ax ) * ( cy - ay ) - ( by - ay ) * ( cx - ax ) <= 0 ) return false; + + var aX, aY, bX, bY, cX, cY; + var apx, apy, bpx, bpy, cpx, cpy; + var cCROSSap, bCROSScp, aCROSSbp; + + aX = cx - bx; aY = cy - by; + bX = ax - cx; bY = ay - cy; + cX = bx - ax; cY = by - ay; + + for ( p = 0; p < n; p ++ ) { + + px = contour[ verts[ p ] ].x; + py = contour[ verts[ p ] ].y; + + if ( ( ( px === ax ) && ( py === ay ) ) || + ( ( px === bx ) && ( py === by ) ) || + ( ( px === cx ) && ( py === cy ) ) ) continue; + + apx = px - ax; apy = py - ay; + bpx = px - bx; bpy = py - by; + cpx = px - cx; cpy = py - cy; + + // see if p is inside triangle abc + + aCROSSbp = aX * bpy - aY * bpx; + cCROSSap = cX * apy - cY * apx; + bCROSScp = bX * cpy - bY * cpx; + + if ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false; + + } + + return true; + + } + + // takes in an contour array and returns + + return function triangulate( contour, indices ) { + + var n = contour.length; + + if ( n < 3 ) return null; + + var result = [], + verts = [], + vertIndices = []; + + /* we want a counter-clockwise polygon in verts */ + + var u, v, w; + + if ( ShapeUtils.area( contour ) > 0.0 ) { + + for ( v = 0; v < n; v ++ ) verts[ v ] = v; + + } else { + + for ( v = 0; v < n; v ++ ) verts[ v ] = ( n - 1 ) - v; + + } + + var nv = n; + + /* remove nv - 2 vertices, creating 1 triangle every time */ + + var count = 2 * nv; /* error detection */ + + for ( v = nv - 1; nv > 2; ) { + + /* if we loop, it is probably a non-simple polygon */ + + if ( ( count -- ) <= 0 ) { + + //** Triangulate: ERROR - probable bad polygon! + + //throw ( "Warning, unable to triangulate polygon!" ); + //return null; + // Sometimes warning is fine, especially polygons are triangulated in reverse. + console.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' ); + + if ( indices ) return vertIndices; + return result; + + } + + /* three consecutive vertices in current polygon, */ + + u = v; if ( nv <= u ) u = 0; /* previous */ + v = u + 1; if ( nv <= v ) v = 0; /* new v */ + w = v + 1; if ( nv <= w ) w = 0; /* next */ + + if ( snip( contour, u, v, w, nv, verts ) ) { + + var a, b, c, s, t; + + /* true names of the vertices */ + + a = verts[ u ]; + b = verts[ v ]; + c = verts[ w ]; + + /* output Triangle */ + + result.push( [ contour[ a ], + contour[ b ], + contour[ c ] ] ); + + + vertIndices.push( [ verts[ u ], verts[ v ], verts[ w ] ] ); + + /* remove v from the remaining polygon */ + + for ( s = v, t = v + 1; t < nv; s ++, t ++ ) { + + verts[ s ] = verts[ t ]; + + } + + nv --; + + /* reset error detection counter */ + + count = 2 * nv; + + } + + } + + if ( indices ) return vertIndices; + return result; + + } + + } )(), + + triangulateShape: function ( contour, holes ) { + + function removeDupEndPts(points) { + + var l = points.length; + + if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) { + + points.pop(); + + } + + } + + removeDupEndPts( contour ); + holes.forEach( removeDupEndPts ); + + function point_in_segment_2D_colin( inSegPt1, inSegPt2, inOtherPt ) { + + // inOtherPt needs to be collinear to the inSegment + if ( inSegPt1.x !== inSegPt2.x ) { + + if ( inSegPt1.x < inSegPt2.x ) { + + return ( ( inSegPt1.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt2.x ) ); + + } else { + + return ( ( inSegPt2.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt1.x ) ); + + } + + } else { + + if ( inSegPt1.y < inSegPt2.y ) { + + return ( ( inSegPt1.y <= inOtherPt.y ) && ( inOtherPt.y <= inSegPt2.y ) ); + + } else { + + return ( ( inSegPt2.y <= inOtherPt.y ) && ( inOtherPt.y <= inSegPt1.y ) ); + + } + + } + + } + + function intersect_segments_2D( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1, inSeg2Pt2, inExcludeAdjacentSegs ) { + + var seg1dx = inSeg1Pt2.x - inSeg1Pt1.x, seg1dy = inSeg1Pt2.y - inSeg1Pt1.y; + var seg2dx = inSeg2Pt2.x - inSeg2Pt1.x, seg2dy = inSeg2Pt2.y - inSeg2Pt1.y; + + var seg1seg2dx = inSeg1Pt1.x - inSeg2Pt1.x; + var seg1seg2dy = inSeg1Pt1.y - inSeg2Pt1.y; + + var limit = seg1dy * seg2dx - seg1dx * seg2dy; + var perpSeg1 = seg1dy * seg1seg2dx - seg1dx * seg1seg2dy; + + if ( Math.abs( limit ) > Number.EPSILON ) { + + // not parallel + + var perpSeg2; + if ( limit > 0 ) { + + if ( ( perpSeg1 < 0 ) || ( perpSeg1 > limit ) ) return []; + perpSeg2 = seg2dy * seg1seg2dx - seg2dx * seg1seg2dy; + if ( ( perpSeg2 < 0 ) || ( perpSeg2 > limit ) ) return []; + + } else { + + if ( ( perpSeg1 > 0 ) || ( perpSeg1 < limit ) ) return []; + perpSeg2 = seg2dy * seg1seg2dx - seg2dx * seg1seg2dy; + if ( ( perpSeg2 > 0 ) || ( perpSeg2 < limit ) ) return []; + + } + + // i.e. to reduce rounding errors + // intersection at endpoint of segment#1? + if ( perpSeg2 === 0 ) { + + if ( ( inExcludeAdjacentSegs ) && + ( ( perpSeg1 === 0 ) || ( perpSeg1 === limit ) ) ) return []; + return [ inSeg1Pt1 ]; + + } + if ( perpSeg2 === limit ) { + + if ( ( inExcludeAdjacentSegs ) && + ( ( perpSeg1 === 0 ) || ( perpSeg1 === limit ) ) ) return []; + return [ inSeg1Pt2 ]; + + } + // intersection at endpoint of segment#2? + if ( perpSeg1 === 0 ) return [ inSeg2Pt1 ]; + if ( perpSeg1 === limit ) return [ inSeg2Pt2 ]; + + // return real intersection point + var factorSeg1 = perpSeg2 / limit; + return [ { x: inSeg1Pt1.x + factorSeg1 * seg1dx, + y: inSeg1Pt1.y + factorSeg1 * seg1dy } ]; + + } else { + + // parallel or collinear + if ( ( perpSeg1 !== 0 ) || + ( seg2dy * seg1seg2dx !== seg2dx * seg1seg2dy ) ) return []; + + // they are collinear or degenerate + var seg1Pt = ( ( seg1dx === 0 ) && ( seg1dy === 0 ) ); // segment1 is just a point? + var seg2Pt = ( ( seg2dx === 0 ) && ( seg2dy === 0 ) ); // segment2 is just a point? + // both segments are points + if ( seg1Pt && seg2Pt ) { + + if ( ( inSeg1Pt1.x !== inSeg2Pt1.x ) || + ( inSeg1Pt1.y !== inSeg2Pt1.y ) ) return []; // they are distinct points + return [ inSeg1Pt1 ]; // they are the same point + + } + // segment#1 is a single point + if ( seg1Pt ) { + + if ( ! point_in_segment_2D_colin( inSeg2Pt1, inSeg2Pt2, inSeg1Pt1 ) ) return []; // but not in segment#2 + return [ inSeg1Pt1 ]; + + } + // segment#2 is a single point + if ( seg2Pt ) { + + if ( ! point_in_segment_2D_colin( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1 ) ) return []; // but not in segment#1 + return [ inSeg2Pt1 ]; + + } + + // they are collinear segments, which might overlap + var seg1min, seg1max, seg1minVal, seg1maxVal; + var seg2min, seg2max, seg2minVal, seg2maxVal; + if ( seg1dx !== 0 ) { + + // the segments are NOT on a vertical line + if ( inSeg1Pt1.x < inSeg1Pt2.x ) { + + seg1min = inSeg1Pt1; seg1minVal = inSeg1Pt1.x; + seg1max = inSeg1Pt2; seg1maxVal = inSeg1Pt2.x; + + } else { + + seg1min = inSeg1Pt2; seg1minVal = inSeg1Pt2.x; + seg1max = inSeg1Pt1; seg1maxVal = inSeg1Pt1.x; + + } + if ( inSeg2Pt1.x < inSeg2Pt2.x ) { + + seg2min = inSeg2Pt1; seg2minVal = inSeg2Pt1.x; + seg2max = inSeg2Pt2; seg2maxVal = inSeg2Pt2.x; + + } else { + + seg2min = inSeg2Pt2; seg2minVal = inSeg2Pt2.x; + seg2max = inSeg2Pt1; seg2maxVal = inSeg2Pt1.x; + + } + + } else { + + // the segments are on a vertical line + if ( inSeg1Pt1.y < inSeg1Pt2.y ) { + + seg1min = inSeg1Pt1; seg1minVal = inSeg1Pt1.y; + seg1max = inSeg1Pt2; seg1maxVal = inSeg1Pt2.y; + + } else { + + seg1min = inSeg1Pt2; seg1minVal = inSeg1Pt2.y; + seg1max = inSeg1Pt1; seg1maxVal = inSeg1Pt1.y; + + } + if ( inSeg2Pt1.y < inSeg2Pt2.y ) { + + seg2min = inSeg2Pt1; seg2minVal = inSeg2Pt1.y; + seg2max = inSeg2Pt2; seg2maxVal = inSeg2Pt2.y; + + } else { + + seg2min = inSeg2Pt2; seg2minVal = inSeg2Pt2.y; + seg2max = inSeg2Pt1; seg2maxVal = inSeg2Pt1.y; + + } + + } + if ( seg1minVal <= seg2minVal ) { + + if ( seg1maxVal < seg2minVal ) return []; + if ( seg1maxVal === seg2minVal ) { + + if ( inExcludeAdjacentSegs ) return []; + return [ seg2min ]; + + } + if ( seg1maxVal <= seg2maxVal ) return [ seg2min, seg1max ]; + return [ seg2min, seg2max ]; + + } else { + + if ( seg1minVal > seg2maxVal ) return []; + if ( seg1minVal === seg2maxVal ) { + + if ( inExcludeAdjacentSegs ) return []; + return [ seg1min ]; + + } + if ( seg1maxVal <= seg2maxVal ) return [ seg1min, seg1max ]; + return [ seg1min, seg2max ]; + + } + + } + + } + + function isPointInsideAngle( inVertex, inLegFromPt, inLegToPt, inOtherPt ) { + + // The order of legs is important + + // translation of all points, so that Vertex is at (0,0) + var legFromPtX = inLegFromPt.x - inVertex.x, legFromPtY = inLegFromPt.y - inVertex.y; + var legToPtX = inLegToPt.x - inVertex.x, legToPtY = inLegToPt.y - inVertex.y; + var otherPtX = inOtherPt.x - inVertex.x, otherPtY = inOtherPt.y - inVertex.y; + + // main angle >0: < 180 deg.; 0: 180 deg.; <0: > 180 deg. + var from2toAngle = legFromPtX * legToPtY - legFromPtY * legToPtX; + var from2otherAngle = legFromPtX * otherPtY - legFromPtY * otherPtX; + + if ( Math.abs( from2toAngle ) > Number.EPSILON ) { + + // angle != 180 deg. + + var other2toAngle = otherPtX * legToPtY - otherPtY * legToPtX; + // console.log( "from2to: " + from2toAngle + ", from2other: " + from2otherAngle + ", other2to: " + other2toAngle ); + + if ( from2toAngle > 0 ) { + + // main angle < 180 deg. + return ( ( from2otherAngle >= 0 ) && ( other2toAngle >= 0 ) ); + + } else { + + // main angle > 180 deg. + return ( ( from2otherAngle >= 0 ) || ( other2toAngle >= 0 ) ); + + } + + } else { + + // angle == 180 deg. + // console.log( "from2to: 180 deg., from2other: " + from2otherAngle ); + return ( from2otherAngle > 0 ); + + } + + } + + + function removeHoles( contour, holes ) { + + var shape = contour.concat(); // work on this shape + var hole; + + function isCutLineInsideAngles( inShapeIdx, inHoleIdx ) { + + // Check if hole point lies within angle around shape point + var lastShapeIdx = shape.length - 1; + + var prevShapeIdx = inShapeIdx - 1; + if ( prevShapeIdx < 0 ) prevShapeIdx = lastShapeIdx; + + var nextShapeIdx = inShapeIdx + 1; + if ( nextShapeIdx > lastShapeIdx ) nextShapeIdx = 0; + + var insideAngle = isPointInsideAngle( shape[ inShapeIdx ], shape[ prevShapeIdx ], shape[ nextShapeIdx ], hole[ inHoleIdx ] ); + if ( ! insideAngle ) { + + // console.log( "Vertex (Shape): " + inShapeIdx + ", Point: " + hole[inHoleIdx].x + "/" + hole[inHoleIdx].y ); + return false; + + } + + // Check if shape point lies within angle around hole point + var lastHoleIdx = hole.length - 1; + + var prevHoleIdx = inHoleIdx - 1; + if ( prevHoleIdx < 0 ) prevHoleIdx = lastHoleIdx; + + var nextHoleIdx = inHoleIdx + 1; + if ( nextHoleIdx > lastHoleIdx ) nextHoleIdx = 0; + + insideAngle = isPointInsideAngle( hole[ inHoleIdx ], hole[ prevHoleIdx ], hole[ nextHoleIdx ], shape[ inShapeIdx ] ); + if ( ! insideAngle ) { + + // console.log( "Vertex (Hole): " + inHoleIdx + ", Point: " + shape[inShapeIdx].x + "/" + shape[inShapeIdx].y ); + return false; + + } + + return true; + + } + + function intersectsShapeEdge( inShapePt, inHolePt ) { + + // checks for intersections with shape edges + var sIdx, nextIdx, intersection; + for ( sIdx = 0; sIdx < shape.length; sIdx ++ ) { + + nextIdx = sIdx + 1; nextIdx %= shape.length; + intersection = intersect_segments_2D( inShapePt, inHolePt, shape[ sIdx ], shape[ nextIdx ], true ); + if ( intersection.length > 0 ) return true; + + } + + return false; + + } + + var indepHoles = []; + + function intersectsHoleEdge( inShapePt, inHolePt ) { + + // checks for intersections with hole edges + var ihIdx, chkHole, + hIdx, nextIdx, intersection; + for ( ihIdx = 0; ihIdx < indepHoles.length; ihIdx ++ ) { + + chkHole = holes[ indepHoles[ ihIdx ]]; + for ( hIdx = 0; hIdx < chkHole.length; hIdx ++ ) { + + nextIdx = hIdx + 1; nextIdx %= chkHole.length; + intersection = intersect_segments_2D( inShapePt, inHolePt, chkHole[ hIdx ], chkHole[ nextIdx ], true ); + if ( intersection.length > 0 ) return true; + + } + + } + return false; + + } + + var holeIndex, shapeIndex, + shapePt, holePt, + holeIdx, cutKey, failedCuts = [], + tmpShape1, tmpShape2, + tmpHole1, tmpHole2; + + for ( var h = 0, hl = holes.length; h < hl; h ++ ) { + + indepHoles.push( h ); + + } + + var minShapeIndex = 0; + var counter = indepHoles.length * 2; + while ( indepHoles.length > 0 ) { + + counter --; + if ( counter < 0 ) { + + console.log( "Infinite Loop! Holes left:" + indepHoles.length + ", Probably Hole outside Shape!" ); + break; + + } + + // search for shape-vertex and hole-vertex, + // which can be connected without intersections + for ( shapeIndex = minShapeIndex; shapeIndex < shape.length; shapeIndex ++ ) { + + shapePt = shape[ shapeIndex ]; + holeIndex = - 1; + + // search for hole which can be reached without intersections + for ( var h = 0; h < indepHoles.length; h ++ ) { + + holeIdx = indepHoles[ h ]; + + // prevent multiple checks + cutKey = shapePt.x + ":" + shapePt.y + ":" + holeIdx; + if ( failedCuts[ cutKey ] !== undefined ) continue; + + hole = holes[ holeIdx ]; + for ( var h2 = 0; h2 < hole.length; h2 ++ ) { + + holePt = hole[ h2 ]; + if ( ! isCutLineInsideAngles( shapeIndex, h2 ) ) continue; + if ( intersectsShapeEdge( shapePt, holePt ) ) continue; + if ( intersectsHoleEdge( shapePt, holePt ) ) continue; + + holeIndex = h2; + indepHoles.splice( h, 1 ); + + tmpShape1 = shape.slice( 0, shapeIndex + 1 ); + tmpShape2 = shape.slice( shapeIndex ); + tmpHole1 = hole.slice( holeIndex ); + tmpHole2 = hole.slice( 0, holeIndex + 1 ); + + shape = tmpShape1.concat( tmpHole1 ).concat( tmpHole2 ).concat( tmpShape2 ); + + minShapeIndex = shapeIndex; + + // Debug only, to show the selected cuts + // glob_CutLines.push( [ shapePt, holePt ] ); + + break; + + } + if ( holeIndex >= 0 ) break; // hole-vertex found + + failedCuts[ cutKey ] = true; // remember failure + + } + if ( holeIndex >= 0 ) break; // hole-vertex found + + } + + } + + return shape; /* shape with no holes */ + + } + + + var i, il, f, face, + key, index, + allPointsMap = {}; + + // To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first. + + var allpoints = contour.concat(); + + for ( var h = 0, hl = holes.length; h < hl; h ++ ) { + + Array.prototype.push.apply( allpoints, holes[ h ] ); + + } + + //console.log( "allpoints",allpoints, allpoints.length ); + + // prepare all points map + + for ( i = 0, il = allpoints.length; i < il; i ++ ) { + + key = allpoints[ i ].x + ":" + allpoints[ i ].y; + + if ( allPointsMap[ key ] !== undefined ) { + + console.warn( "THREE.ShapeUtils: Duplicate point", key, i ); + + } + + allPointsMap[ key ] = i; + + } + + // remove holes by cutting paths to holes and adding them to the shape + var shapeWithoutHoles = removeHoles( contour, holes ); + + var triangles = ShapeUtils.triangulate( shapeWithoutHoles, false ); // True returns indices for points of spooled shape + //console.log( "triangles",triangles, triangles.length ); + + // check all face vertices against all points map + + for ( i = 0, il = triangles.length; i < il; i ++ ) { + + face = triangles[ i ]; + + for ( f = 0; f < 3; f ++ ) { + + key = face[ f ].x + ":" + face[ f ].y; + + index = allPointsMap[ key ]; + + if ( index !== undefined ) { + + face[ f ] = index; + + } + + } + + } + + return triangles.concat(); + + }, + + isClockWise: function ( pts ) { + + return ShapeUtils.area( pts ) < 0; + + }, + + // Bezier Curves formulas obtained from + // http://en.wikipedia.org/wiki/B%C3%A9zier_curve + + // Quad Bezier Functions + + b2: ( function () { + + function b2p0( t, p ) { + + var k = 1 - t; + return k * k * p; + + } + + function b2p1( t, p ) { + + return 2 * ( 1 - t ) * t * p; + + } + + function b2p2( t, p ) { + + return t * t * p; + + } + + return function b2( t, p0, p1, p2 ) { + + return b2p0( t, p0 ) + b2p1( t, p1 ) + b2p2( t, p2 ); + + }; + + } )(), + + // Cubic Bezier Functions + + b3: ( function () { + + function b3p0( t, p ) { + + var k = 1 - t; + return k * k * k * p; + + } + + function b3p1( t, p ) { + + var k = 1 - t; + return 3 * k * k * t * p; + + } + + function b3p2( t, p ) { + + var k = 1 - t; + return 3 * k * t * t * p; + + } + + function b3p3( t, p ) { + + return t * t * t * p; + + } + + return function b3( t, p0, p1, p2, p3 ) { + + return b3p0( t, p0 ) + b3p1( t, p1 ) + b3p2( t, p2 ) + b3p3( t, p3 ); + + }; + + } )() + + }; + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + * + * Creates extruded geometry from a path shape. + * + * parameters = { + * + * curveSegments: , // number of points on the curves + * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too + * amount: , // Depth to extrude the shape + * + * bevelEnabled: , // turn on bevel + * bevelThickness: , // how deep into the original shape bevel goes + * bevelSize: , // how far from shape outline is bevel + * bevelSegments: , // number of bevel layers + * + * extrudePath: // 3d spline path to extrude shape along. (creates Frames if .frames aren't defined) + * frames: // containing arrays of tangents, normals, binormals + * + * uvGenerator: // object that provides UV generator functions + * + * } + **/ + + function ExtrudeGeometry( shapes, options ) { + + if ( typeof( shapes ) === "undefined" ) { + + shapes = []; + return; + + } + + Geometry.call( this ); + + this.type = 'ExtrudeGeometry'; + + shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; + + this.addShapeList( shapes, options ); + + this.computeFaceNormals(); + + // can't really use automatic vertex normals + // as then front and back sides get smoothed too + // should do separate smoothing just for sides + + //this.computeVertexNormals(); + + //console.log( "took", ( Date.now() - startTime ) ); + + } + + ExtrudeGeometry.prototype = Object.create( Geometry.prototype ); + ExtrudeGeometry.prototype.constructor = ExtrudeGeometry; + + ExtrudeGeometry.prototype.addShapeList = function ( shapes, options ) { + + var sl = shapes.length; + + for ( var s = 0; s < sl; s ++ ) { + + var shape = shapes[ s ]; + this.addShape( shape, options ); + + } + + }; + + ExtrudeGeometry.prototype.addShape = function ( shape, options ) { + + var amount = options.amount !== undefined ? options.amount : 100; + + var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; // 10 + var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; // 8 + var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; + + var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; // false + + var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; + + var steps = options.steps !== undefined ? options.steps : 1; + + var extrudePath = options.extrudePath; + var extrudePts, extrudeByPath = false; + + // Use default WorldUVGenerator if no UV generators are specified. + var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : ExtrudeGeometry.WorldUVGenerator; + + var splineTube, binormal, normal, position2; + if ( extrudePath ) { + + extrudePts = extrudePath.getSpacedPoints( steps ); + + extrudeByPath = true; + bevelEnabled = false; // bevels not supported for path extrusion + + // SETUP TNB variables + + // TODO1 - have a .isClosed in spline? + + splineTube = options.frames !== undefined ? options.frames : extrudePath.computeFrenetFrames( steps, false ); + + // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); + + binormal = new Vector3(); + normal = new Vector3(); + position2 = new Vector3(); + + } + + // Safeguards if bevels are not enabled + + if ( ! bevelEnabled ) { + + bevelSegments = 0; + bevelThickness = 0; + bevelSize = 0; + + } + + // Variables initialization + + var ahole, h, hl; // looping of holes + var scope = this; + + var shapesOffset = this.vertices.length; + + var shapePoints = shape.extractPoints( curveSegments ); + + var vertices = shapePoints.shape; + var holes = shapePoints.holes; + + var reverse = ! ShapeUtils.isClockWise( vertices ); + + if ( reverse ) { + + vertices = vertices.reverse(); + + // Maybe we should also check if holes are in the opposite direction, just to be safe ... + + for ( h = 0, hl = holes.length; h < hl; h ++ ) { + + ahole = holes[ h ]; + + if ( ShapeUtils.isClockWise( ahole ) ) { + + holes[ h ] = ahole.reverse(); + + } + + } + + reverse = false; // If vertices are in order now, we shouldn't need to worry about them again (hopefully)! + + } + + + var faces = ShapeUtils.triangulateShape( vertices, holes ); + + /* Vertices */ + + var contour = vertices; // vertices has all points but contour has only points of circumference + + for ( h = 0, hl = holes.length; h < hl; h ++ ) { + + ahole = holes[ h ]; + + vertices = vertices.concat( ahole ); + + } + + + function scalePt2( pt, vec, size ) { + + if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" ); + + return vec.clone().multiplyScalar( size ).add( pt ); + + } + + var b, bs, t, z, + vert, vlen = vertices.length, + face, flen = faces.length; + + + // Find directions for point movement + + + function getBevelVec( inPt, inPrev, inNext ) { + + // computes for inPt the corresponding point inPt' on a new contour + // shifted by 1 unit (length of normalized vector) to the left + // if we walk along contour clockwise, this new contour is outside the old one + // + // inPt' is the intersection of the two lines parallel to the two + // adjacent edges of inPt at a distance of 1 unit on the left side. + + var v_trans_x, v_trans_y, shrink_by = 1; // resulting translation vector for inPt + + // good reading for geometry algorithms (here: line-line intersection) + // http://geomalgorithms.com/a05-_intersect-1.html + + var v_prev_x = inPt.x - inPrev.x, v_prev_y = inPt.y - inPrev.y; + var v_next_x = inNext.x - inPt.x, v_next_y = inNext.y - inPt.y; + + var v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); + + // check for collinear edges + var collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + + if ( Math.abs( collinear0 ) > Number.EPSILON ) { + + // not collinear + + // length of vectors for normalizing + + var v_prev_len = Math.sqrt( v_prev_lensq ); + var v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); + + // shift adjacent points by unit vectors to the left + + var ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); + var ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); + + var ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); + var ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); + + // scaling factor for v_prev to intersection point + + var sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - + ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / + ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + + // vector from inPt to intersection point + + v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); + v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); + + // Don't normalize!, otherwise sharp corners become ugly + // but prevent crazy spikes + var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); + if ( v_trans_lensq <= 2 ) { + + return new Vector2( v_trans_x, v_trans_y ); + + } else { + + shrink_by = Math.sqrt( v_trans_lensq / 2 ); + + } + + } else { + + // handle special case of collinear edges + + var direction_eq = false; // assumes: opposite + if ( v_prev_x > Number.EPSILON ) { + + if ( v_next_x > Number.EPSILON ) { + + direction_eq = true; + + } + + } else { + + if ( v_prev_x < - Number.EPSILON ) { + + if ( v_next_x < - Number.EPSILON ) { + + direction_eq = true; + + } + + } else { + + if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { + + direction_eq = true; + + } + + } + + } + + if ( direction_eq ) { + + // console.log("Warning: lines are a straight sequence"); + v_trans_x = - v_prev_y; + v_trans_y = v_prev_x; + shrink_by = Math.sqrt( v_prev_lensq ); + + } else { + + // console.log("Warning: lines are a straight spike"); + v_trans_x = v_prev_x; + v_trans_y = v_prev_y; + shrink_by = Math.sqrt( v_prev_lensq / 2 ); + + } + + } + + return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); + + } + + + var contourMovements = []; + + for ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + + if ( j === il ) j = 0; + if ( k === il ) k = 0; + + // (j)---(i)---(k) + // console.log('i,j,k', i, j , k) + + contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); + + } + + var holesMovements = [], oneHoleMovements, verticesMovements = contourMovements.concat(); + + for ( h = 0, hl = holes.length; h < hl; h ++ ) { + + ahole = holes[ h ]; + + oneHoleMovements = []; + + for ( i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + + if ( j === il ) j = 0; + if ( k === il ) k = 0; + + // (j)---(i)---(k) + oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); + + } + + holesMovements.push( oneHoleMovements ); + verticesMovements = verticesMovements.concat( oneHoleMovements ); + + } + + + // Loop bevelSegments, 1 for the front, 1 for the back + + for ( b = 0; b < bevelSegments; b ++ ) { + + //for ( b = bevelSegments; b > 0; b -- ) { + + t = b / bevelSegments; + z = bevelThickness * Math.cos( t * Math.PI / 2 ); + bs = bevelSize * Math.sin( t * Math.PI / 2 ); + + // contract shape + + for ( i = 0, il = contour.length; i < il; i ++ ) { + + vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + + v( vert.x, vert.y, - z ); + + } + + // expand holes + + for ( h = 0, hl = holes.length; h < hl; h ++ ) { + + ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; + + for ( i = 0, il = ahole.length; i < il; i ++ ) { + + vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); + + v( vert.x, vert.y, - z ); + + } + + } + + } + + bs = bevelSize; + + // Back facing vertices + + for ( i = 0; i < vlen; i ++ ) { + + vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + + if ( ! extrudeByPath ) { + + v( vert.x, vert.y, 0 ); + + } else { + + // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); + + normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y ); + + position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); + + v( position2.x, position2.y, position2.z ); + + } + + } + + // Add stepped vertices... + // Including front facing vertices + + var s; + + for ( s = 1; s <= steps; s ++ ) { + + for ( i = 0; i < vlen; i ++ ) { + + vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + + if ( ! extrudeByPath ) { + + v( vert.x, vert.y, amount / steps * s ); + + } else { + + // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); + + normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y ); + + position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); + + v( position2.x, position2.y, position2.z ); + + } + + } + + } + + + // Add bevel segments planes + + //for ( b = 1; b <= bevelSegments; b ++ ) { + for ( b = bevelSegments - 1; b >= 0; b -- ) { + + t = b / bevelSegments; + z = bevelThickness * Math.cos ( t * Math.PI / 2 ); + bs = bevelSize * Math.sin( t * Math.PI / 2 ); + + // contract shape + + for ( i = 0, il = contour.length; i < il; i ++ ) { + + vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + v( vert.x, vert.y, amount + z ); + + } + + // expand holes + + for ( h = 0, hl = holes.length; h < hl; h ++ ) { + + ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; + + for ( i = 0, il = ahole.length; i < il; i ++ ) { + + vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); + + if ( ! extrudeByPath ) { + + v( vert.x, vert.y, amount + z ); + + } else { + + v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); + + } + + } + + } + + } + + /* Faces */ + + // Top and bottom faces + + buildLidFaces(); + + // Sides faces + + buildSideFaces(); + + + ///// Internal functions + + function buildLidFaces() { + + if ( bevelEnabled ) { + + var layer = 0; // steps + 1 + var offset = vlen * layer; + + // Bottom faces + + for ( i = 0; i < flen; i ++ ) { + + face = faces[ i ]; + f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); + + } + + layer = steps + bevelSegments * 2; + offset = vlen * layer; + + // Top faces + + for ( i = 0; i < flen; i ++ ) { + + face = faces[ i ]; + f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); + + } + + } else { + + // Bottom faces + + for ( i = 0; i < flen; i ++ ) { + + face = faces[ i ]; + f3( face[ 2 ], face[ 1 ], face[ 0 ] ); + + } + + // Top faces + + for ( i = 0; i < flen; i ++ ) { + + face = faces[ i ]; + f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); + + } + + } + + } + + // Create faces for the z-sides of the shape + + function buildSideFaces() { + + var layeroffset = 0; + sidewalls( contour, layeroffset ); + layeroffset += contour.length; + + for ( h = 0, hl = holes.length; h < hl; h ++ ) { + + ahole = holes[ h ]; + sidewalls( ahole, layeroffset ); + + //, true + layeroffset += ahole.length; + + } + + } + + function sidewalls( contour, layeroffset ) { + + var j, k; + i = contour.length; + + while ( -- i >= 0 ) { + + j = i; + k = i - 1; + if ( k < 0 ) k = contour.length - 1; + + //console.log('b', i,j, i-1, k,vertices.length); + + var s = 0, sl = steps + bevelSegments * 2; + + for ( s = 0; s < sl; s ++ ) { + + var slen1 = vlen * s; + var slen2 = vlen * ( s + 1 ); + + var a = layeroffset + j + slen1, + b = layeroffset + k + slen1, + c = layeroffset + k + slen2, + d = layeroffset + j + slen2; + + f4( a, b, c, d, contour, s, sl, j, k ); + + } + + } + + } + + + function v( x, y, z ) { + + scope.vertices.push( new Vector3( x, y, z ) ); + + } + + function f3( a, b, c ) { + + a += shapesOffset; + b += shapesOffset; + c += shapesOffset; + + scope.faces.push( new Face3( a, b, c, null, null, 0 ) ); + + var uvs = uvgen.generateTopUV( scope, a, b, c ); + + scope.faceVertexUvs[ 0 ].push( uvs ); + + } + + function f4( a, b, c, d, wallContour, stepIndex, stepsLength, contourIndex1, contourIndex2 ) { + + a += shapesOffset; + b += shapesOffset; + c += shapesOffset; + d += shapesOffset; + + scope.faces.push( new Face3( a, b, d, null, null, 1 ) ); + scope.faces.push( new Face3( b, c, d, null, null, 1 ) ); + + var uvs = uvgen.generateSideWallUV( scope, a, b, c, d ); + + scope.faceVertexUvs[ 0 ].push( [ uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] ] ); + scope.faceVertexUvs[ 0 ].push( [ uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] ] ); + + } + + }; + + ExtrudeGeometry.WorldUVGenerator = { + + generateTopUV: function ( geometry, indexA, indexB, indexC ) { + + var vertices = geometry.vertices; + + var a = vertices[ indexA ]; + var b = vertices[ indexB ]; + var c = vertices[ indexC ]; + + return [ + new Vector2( a.x, a.y ), + new Vector2( b.x, b.y ), + new Vector2( c.x, c.y ) + ]; + + }, + + generateSideWallUV: function ( geometry, indexA, indexB, indexC, indexD ) { + + var vertices = geometry.vertices; + + var a = vertices[ indexA ]; + var b = vertices[ indexB ]; + var c = vertices[ indexC ]; + var d = vertices[ indexD ]; + + if ( Math.abs( a.y - b.y ) < 0.01 ) { + + return [ + new Vector2( a.x, 1 - a.z ), + new Vector2( b.x, 1 - b.z ), + new Vector2( c.x, 1 - c.z ), + new Vector2( d.x, 1 - d.z ) + ]; + + } else { + + return [ + new Vector2( a.y, 1 - a.z ), + new Vector2( b.y, 1 - b.z ), + new Vector2( c.y, 1 - c.z ), + new Vector2( d.y, 1 - d.z ) + ]; + + } + + } + }; + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + * @author alteredq / http://alteredqualia.com/ + * + * Text = 3D Text + * + * parameters = { + * font: , // font + * + * size: , // size of the text + * height: , // thickness to extrude text + * curveSegments: , // number of points on the curves + * + * bevelEnabled: , // turn on bevel + * bevelThickness: , // how deep into text bevel goes + * bevelSize: // how far from text outline is bevel + * } + */ + + function TextGeometry( text, parameters ) { + + parameters = parameters || {}; + + var font = parameters.font; + + if ( (font && font.isFont) === false ) { + + console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' ); + return new Geometry(); + + } + + var shapes = font.generateShapes( text, parameters.size, parameters.curveSegments ); + + // translate parameters to ExtrudeGeometry API + + parameters.amount = parameters.height !== undefined ? parameters.height : 50; + + // defaults + + if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10; + if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8; + if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false; + + ExtrudeGeometry.call( this, shapes, parameters ); + + this.type = 'TextGeometry'; + + } + + TextGeometry.prototype = Object.create( ExtrudeGeometry.prototype ); + TextGeometry.prototype.constructor = TextGeometry; + + /** + * @author benaadams / https://twitter.com/ben_a_adams + * based on THREE.SphereGeometry + */ + + function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { + + BufferGeometry.call( this ); + + this.type = 'SphereBufferGeometry'; + + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + radius = radius || 50; + + widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); + heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); + + phiStart = phiStart !== undefined ? phiStart : 0; + phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; + + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; + + var thetaEnd = thetaStart + thetaLength; + + var vertexCount = ( ( widthSegments + 1 ) * ( heightSegments + 1 ) ); + + var positions = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 ); + + var index = 0, vertices = [], normal = new Vector3(); + + for ( var y = 0; y <= heightSegments; y ++ ) { + + var verticesRow = []; + + var v = y / heightSegments; + + for ( var x = 0; x <= widthSegments; x ++ ) { + + var u = x / widthSegments; + + var px = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + var py = radius * Math.cos( thetaStart + v * thetaLength ); + var pz = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + + normal.set( px, py, pz ).normalize(); + + positions.setXYZ( index, px, py, pz ); + normals.setXYZ( index, normal.x, normal.y, normal.z ); + uvs.setXY( index, u, 1 - v ); + + verticesRow.push( index ); + + index ++; + + } + + vertices.push( verticesRow ); + + } + + var indices = []; + + for ( var y = 0; y < heightSegments; y ++ ) { + + for ( var x = 0; x < widthSegments; x ++ ) { + + var v1 = vertices[ y ][ x + 1 ]; + var v2 = vertices[ y ][ x ]; + var v3 = vertices[ y + 1 ][ x ]; + var v4 = vertices[ y + 1 ][ x + 1 ]; + + if ( y !== 0 || thetaStart > 0 ) indices.push( v1, v2, v4 ); + if ( y !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( v2, v3, v4 ); + + } + + } + + this.setIndex( new ( positions.count > 65535 ? Uint32Attribute : Uint16Attribute )( indices, 1 ) ); + this.addAttribute( 'position', positions ); + this.addAttribute( 'normal', normals ); + this.addAttribute( 'uv', uvs ); + + this.boundingSphere = new Sphere( new Vector3(), radius ); + + } + + SphereBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + SphereBufferGeometry.prototype.constructor = SphereBufferGeometry; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { + + Geometry.call( this ); + + this.type = 'SphereGeometry'; + + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) ); + + } + + SphereGeometry.prototype = Object.create( Geometry.prototype ); + SphereGeometry.prototype.constructor = SphereGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { + + BufferGeometry.call( this ); + + this.type = 'RingBufferGeometry'; + + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + innerRadius = innerRadius || 20; + outerRadius = outerRadius || 50; + + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + + thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8; + phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1; + + // these are used to calculate buffer length + var vertexCount = ( thetaSegments + 1 ) * ( phiSegments + 1 ); + var indexCount = thetaSegments * phiSegments * 2 * 3; + + // buffers + var indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ) , 1 ); + var vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 ); + + // some helper variables + var index = 0, indexOffset = 0, segment; + var radius = innerRadius; + var radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); + var vertex = new Vector3(); + var uv = new Vector2(); + var j, i; + + // generate vertices, normals and uvs + + // values are generate from the inside of the ring to the outside + + for ( j = 0; j <= phiSegments; j ++ ) { + + for ( i = 0; i <= thetaSegments; i ++ ) { + + segment = thetaStart + i / thetaSegments * thetaLength; + + // vertex + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); + vertices.setXYZ( index, vertex.x, vertex.y, vertex.z ); + + // normal + normals.setXYZ( index, 0, 0, 1 ); + + // uv + uv.x = ( vertex.x / outerRadius + 1 ) / 2; + uv.y = ( vertex.y / outerRadius + 1 ) / 2; + uvs.setXY( index, uv.x, uv.y ); + + // increase index + index++; + + } + + // increase the radius for next row of vertices + radius += radiusStep; + + } + + // generate indices + + for ( j = 0; j < phiSegments; j ++ ) { + + var thetaSegmentLevel = j * ( thetaSegments + 1 ); + + for ( i = 0; i < thetaSegments; i ++ ) { + + segment = i + thetaSegmentLevel; + + // indices + var a = segment; + var b = segment + thetaSegments + 1; + var c = segment + thetaSegments + 2; + var d = segment + 1; + + // face one + indices.setX( indexOffset, a ); indexOffset++; + indices.setX( indexOffset, b ); indexOffset++; + indices.setX( indexOffset, c ); indexOffset++; + + // face two + indices.setX( indexOffset, a ); indexOffset++; + indices.setX( indexOffset, c ); indexOffset++; + indices.setX( indexOffset, d ); indexOffset++; + + } + + } + + // build geometry + + this.setIndex( indices ); + this.addAttribute( 'position', vertices ); + this.addAttribute( 'normal', normals ); + this.addAttribute( 'uv', uvs ); + + } + + RingBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + RingBufferGeometry.prototype.constructor = RingBufferGeometry; + + /** + * @author Kaleb Murphy + */ + + function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { + + Geometry.call( this ); + + this.type = 'RingGeometry'; + + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) ); + + } + + RingGeometry.prototype = Object.create( Geometry.prototype ); + RingGeometry.prototype.constructor = RingGeometry; + + /** + * @author mrdoob / http://mrdoob.com/ + * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as + */ + + function PlaneGeometry( width, height, widthSegments, heightSegments ) { + + Geometry.call( this ); + + this.type = 'PlaneGeometry'; + + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; + + this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); + + } + + PlaneGeometry.prototype = Object.create( Geometry.prototype ); + PlaneGeometry.prototype.constructor = PlaneGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + // points - to create a closed torus, one must use a set of points + // like so: [ a, b, c, d, a ], see first is the same as last. + // segments - the number of circumference segments to create + // phiStart - the starting radian + // phiLength - the radian (0 to 2PI) range of the lathed section + // 2PI is a closed lathe, less than 2PI is a portion. + + function LatheBufferGeometry( points, segments, phiStart, phiLength ) { + + BufferGeometry.call( this ); + + this.type = 'LatheBufferGeometry'; + + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; + + segments = Math.floor( segments ) || 12; + phiStart = phiStart || 0; + phiLength = phiLength || Math.PI * 2; + + // clamp phiLength so it's in range of [ 0, 2PI ] + phiLength = _Math.clamp( phiLength, 0, Math.PI * 2 ); + + // these are used to calculate buffer length + var vertexCount = ( segments + 1 ) * points.length; + var indexCount = segments * points.length * 2 * 3; + + // buffers + var indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ) , 1 ); + var vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 ); + + // helper variables + var index = 0, indexOffset = 0, base; + var inverseSegments = 1.0 / segments; + var vertex = new Vector3(); + var uv = new Vector2(); + var i, j; + + // generate vertices and uvs + + for ( i = 0; i <= segments; i ++ ) { + + var phi = phiStart + i * inverseSegments * phiLength; + + var sin = Math.sin( phi ); + var cos = Math.cos( phi ); + + for ( j = 0; j <= ( points.length - 1 ); j ++ ) { + + // vertex + vertex.x = points[ j ].x * sin; + vertex.y = points[ j ].y; + vertex.z = points[ j ].x * cos; + vertices.setXYZ( index, vertex.x, vertex.y, vertex.z ); + + // uv + uv.x = i / segments; + uv.y = j / ( points.length - 1 ); + uvs.setXY( index, uv.x, uv.y ); + + // increase index + index ++; + + } + + } + + // generate indices + + for ( i = 0; i < segments; i ++ ) { + + for ( j = 0; j < ( points.length - 1 ); j ++ ) { + + base = j + i * points.length; + + // indices + var a = base; + var b = base + points.length; + var c = base + points.length + 1; + var d = base + 1; + + // face one + indices.setX( indexOffset, a ); indexOffset++; + indices.setX( indexOffset, b ); indexOffset++; + indices.setX( indexOffset, d ); indexOffset++; + + // face two + indices.setX( indexOffset, b ); indexOffset++; + indices.setX( indexOffset, c ); indexOffset++; + indices.setX( indexOffset, d ); indexOffset++; + + } + + } + + // build geometry + + this.setIndex( indices ); + this.addAttribute( 'position', vertices ); + this.addAttribute( 'uv', uvs ); + + // generate normals + + this.computeVertexNormals(); + + // if the geometry is closed, we need to average the normals along the seam. + // because the corresponding vertices are identical (but still have different UVs). + + if( phiLength === Math.PI * 2 ) { + + var normals = this.attributes.normal.array; + var n1 = new Vector3(); + var n2 = new Vector3(); + var n = new Vector3(); + + // this is the buffer offset for the last line of vertices + base = segments * points.length * 3; + + for( i = 0, j = 0; i < points.length; i ++, j += 3 ) { + + // select the normal of the vertex in the first line + n1.x = normals[ j + 0 ]; + n1.y = normals[ j + 1 ]; + n1.z = normals[ j + 2 ]; + + // select the normal of the vertex in the last line + n2.x = normals[ base + j + 0 ]; + n2.y = normals[ base + j + 1 ]; + n2.z = normals[ base + j + 2 ]; + + // average normals + n.addVectors( n1, n2 ).normalize(); + + // assign the new values to both normals + normals[ j + 0 ] = normals[ base + j + 0 ] = n.x; + normals[ j + 1 ] = normals[ base + j + 1 ] = n.y; + normals[ j + 2 ] = normals[ base + j + 2 ] = n.z; + + } // next row + + } + + } + + LatheBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + LatheBufferGeometry.prototype.constructor = LatheBufferGeometry; + + /** + * @author astrodud / http://astrodud.isgreat.org/ + * @author zz85 / https://github.com/zz85 + * @author bhouston / http://clara.io + */ + + // points - to create a closed torus, one must use a set of points + // like so: [ a, b, c, d, a ], see first is the same as last. + // segments - the number of circumference segments to create + // phiStart - the starting radian + // phiLength - the radian (0 to 2PI) range of the lathed section + // 2PI is a closed lathe, less than 2PI is a portion. + + function LatheGeometry( points, segments, phiStart, phiLength ) { + + Geometry.call( this ); + + this.type = 'LatheGeometry'; + + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; + + this.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) ); + this.mergeVertices(); + + } + + LatheGeometry.prototype = Object.create( Geometry.prototype ); + LatheGeometry.prototype.constructor = LatheGeometry; + + /** + * @author jonobr1 / http://jonobr1.com + * + * Creates a one-sided polygonal geometry from a path shape. Similar to + * ExtrudeGeometry. + * + * parameters = { + * + * curveSegments: , // number of points on the curves. NOT USED AT THE MOMENT. + * + * material: // material index for front and back faces + * uvGenerator: // object that provides UV generator functions + * + * } + **/ + + function ShapeGeometry( shapes, options ) { + + Geometry.call( this ); + + this.type = 'ShapeGeometry'; + + if ( Array.isArray( shapes ) === false ) shapes = [ shapes ]; + + this.addShapeList( shapes, options ); + + this.computeFaceNormals(); + + } + + ShapeGeometry.prototype = Object.create( Geometry.prototype ); + ShapeGeometry.prototype.constructor = ShapeGeometry; + + /** + * Add an array of shapes to THREE.ShapeGeometry. + */ + ShapeGeometry.prototype.addShapeList = function ( shapes, options ) { + + for ( var i = 0, l = shapes.length; i < l; i ++ ) { + + this.addShape( shapes[ i ], options ); + + } + + return this; + + }; + + /** + * Adds a shape to THREE.ShapeGeometry, based on THREE.ExtrudeGeometry. + */ + ShapeGeometry.prototype.addShape = function ( shape, options ) { + + if ( options === undefined ) options = {}; + var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; + + var material = options.material; + var uvgen = options.UVGenerator === undefined ? ExtrudeGeometry.WorldUVGenerator : options.UVGenerator; + + // + + var i, l, hole; + + var shapesOffset = this.vertices.length; + var shapePoints = shape.extractPoints( curveSegments ); + + var vertices = shapePoints.shape; + var holes = shapePoints.holes; + + var reverse = ! ShapeUtils.isClockWise( vertices ); + + if ( reverse ) { + + vertices = vertices.reverse(); + + // Maybe we should also check if holes are in the opposite direction, just to be safe... + + for ( i = 0, l = holes.length; i < l; i ++ ) { + + hole = holes[ i ]; + + if ( ShapeUtils.isClockWise( hole ) ) { + + holes[ i ] = hole.reverse(); + + } + + } + + reverse = false; + + } + + var faces = ShapeUtils.triangulateShape( vertices, holes ); + + // Vertices + + for ( i = 0, l = holes.length; i < l; i ++ ) { + + hole = holes[ i ]; + vertices = vertices.concat( hole ); + + } + + // + + var vert, vlen = vertices.length; + var face, flen = faces.length; + + for ( i = 0; i < vlen; i ++ ) { + + vert = vertices[ i ]; + + this.vertices.push( new Vector3( vert.x, vert.y, 0 ) ); + + } + + for ( i = 0; i < flen; i ++ ) { + + face = faces[ i ]; + + var a = face[ 0 ] + shapesOffset; + var b = face[ 1 ] + shapesOffset; + var c = face[ 2 ] + shapesOffset; + + this.faces.push( new Face3( a, b, c, null, null, material ) ); + this.faceVertexUvs[ 0 ].push( uvgen.generateTopUV( this, a, b, c ) ); + + } + + }; + + /** + * @author WestLangley / http://github.com/WestLangley + */ + + function EdgesGeometry( geometry, thresholdAngle ) { + + BufferGeometry.call( this ); + + thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1; + + var thresholdDot = Math.cos( _Math.DEG2RAD * thresholdAngle ); + + var edge = [ 0, 0 ], hash = {}; + + function sortFunction( a, b ) { + + return a - b; + + } + + var keys = [ 'a', 'b', 'c' ]; + + var geometry2; + + if ( (geometry && geometry.isBufferGeometry) ) { + + geometry2 = new Geometry(); + geometry2.fromBufferGeometry( geometry ); + + } else { + + geometry2 = geometry.clone(); + + } + + geometry2.mergeVertices(); + geometry2.computeFaceNormals(); + + var vertices = geometry2.vertices; + var faces = geometry2.faces; + + for ( var i = 0, l = faces.length; i < l; i ++ ) { + + var face = faces[ i ]; + + for ( var j = 0; j < 3; j ++ ) { + + edge[ 0 ] = face[ keys[ j ] ]; + edge[ 1 ] = face[ keys[ ( j + 1 ) % 3 ] ]; + edge.sort( sortFunction ); + + var key = edge.toString(); + + if ( hash[ key ] === undefined ) { + + hash[ key ] = { vert1: edge[ 0 ], vert2: edge[ 1 ], face1: i, face2: undefined }; + + } else { + + hash[ key ].face2 = i; + + } + + } + + } + + var coords = []; + + for ( var key in hash ) { + + var h = hash[ key ]; + + if ( h.face2 === undefined || faces[ h.face1 ].normal.dot( faces[ h.face2 ].normal ) <= thresholdDot ) { + + var vertex = vertices[ h.vert1 ]; + coords.push( vertex.x ); + coords.push( vertex.y ); + coords.push( vertex.z ); + + vertex = vertices[ h.vert2 ]; + coords.push( vertex.x ); + coords.push( vertex.y ); + coords.push( vertex.z ); + + } + + } + + this.addAttribute( 'position', new BufferAttribute( new Float32Array( coords ), 3 ) ); + + } + + EdgesGeometry.prototype = Object.create( BufferGeometry.prototype ); + EdgesGeometry.prototype.constructor = EdgesGeometry; + + /** + * @author Mugen87 / https://github.com/Mugen87 + */ + + function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + + BufferGeometry.call( this ); + + this.type = 'CylinderBufferGeometry'; + + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + var scope = this; + + radiusTop = radiusTop !== undefined ? radiusTop : 20; + radiusBottom = radiusBottom !== undefined ? radiusBottom : 20; + height = height !== undefined ? height : 100; + + radialSegments = Math.floor( radialSegments ) || 8; + heightSegments = Math.floor( heightSegments ) || 1; + + openEnded = openEnded !== undefined ? openEnded : false; + thetaStart = thetaStart !== undefined ? thetaStart : 0.0; + thetaLength = thetaLength !== undefined ? thetaLength : 2.0 * Math.PI; + + // used to calculate buffer length + + var nbCap = 0; + + if ( openEnded === false ) { + + if ( radiusTop > 0 ) nbCap ++; + if ( radiusBottom > 0 ) nbCap ++; + + } + + var vertexCount = calculateVertexCount(); + var indexCount = calculateIndexCount(); + + // buffers + + var indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ), 1 ); + var vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 ); + var uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 ); + + // helper variables + + var index = 0, + indexOffset = 0, + indexArray = [], + halfHeight = height / 2; + + // group variables + var groupStart = 0; + + // generate geometry + + generateTorso(); + + if ( openEnded === false ) { + + if ( radiusTop > 0 ) generateCap( true ); + if ( radiusBottom > 0 ) generateCap( false ); + + } + + // build geometry + + this.setIndex( indices ); + this.addAttribute( 'position', vertices ); + this.addAttribute( 'normal', normals ); + this.addAttribute( 'uv', uvs ); + + // helper functions + + function calculateVertexCount() { + + var count = ( radialSegments + 1 ) * ( heightSegments + 1 ); + + if ( openEnded === false ) { + + count += ( ( radialSegments + 1 ) * nbCap ) + ( radialSegments * nbCap ); + + } + + return count; + + } + + function calculateIndexCount() { + + var count = radialSegments * heightSegments * 2 * 3; + + if ( openEnded === false ) { + + count += radialSegments * nbCap * 3; + + } + + return count; + + } + + function generateTorso() { + + var x, y; + var normal = new Vector3(); + var vertex = new Vector3(); + + var groupCount = 0; + + // this will be used to calculate the normal + var slope = ( radiusBottom - radiusTop ) / height; + + // generate vertices, normals and uvs + + for ( y = 0; y <= heightSegments; y ++ ) { + + var indexRow = []; + + var v = y / heightSegments; + + // calculate the radius of the current row + var radius = v * ( radiusBottom - radiusTop ) + radiusTop; + + for ( x = 0; x <= radialSegments; x ++ ) { + + var u = x / radialSegments; + + var theta = u * thetaLength + thetaStart; + + var sinTheta = Math.sin( theta ); + var cosTheta = Math.cos( theta ); + + // vertex + vertex.x = radius * sinTheta; + vertex.y = - v * height + halfHeight; + vertex.z = radius * cosTheta; + vertices.setXYZ( index, vertex.x, vertex.y, vertex.z ); + + // normal + normal.set( sinTheta, slope, cosTheta ).normalize(); + normals.setXYZ( index, normal.x, normal.y, normal.z ); + + // uv + uvs.setXY( index, u, 1 - v ); + + // save index of vertex in respective row + indexRow.push( index ); + + // increase index + index ++; + + } + + // now save vertices of the row in our index array + indexArray.push( indexRow ); + + } + + // generate indices + + for ( x = 0; x < radialSegments; x ++ ) { + + for ( y = 0; y < heightSegments; y ++ ) { + + // we use the index array to access the correct indices + var i1 = indexArray[ y ][ x ]; + var i2 = indexArray[ y + 1 ][ x ]; + var i3 = indexArray[ y + 1 ][ x + 1 ]; + var i4 = indexArray[ y ][ x + 1 ]; + + // face one + indices.setX( indexOffset, i1 ); indexOffset ++; + indices.setX( indexOffset, i2 ); indexOffset ++; + indices.setX( indexOffset, i4 ); indexOffset ++; + + // face two + indices.setX( indexOffset, i2 ); indexOffset ++; + indices.setX( indexOffset, i3 ); indexOffset ++; + indices.setX( indexOffset, i4 ); indexOffset ++; + + // update counters + groupCount += 6; + + } + + } + + // add a group to the geometry. this will ensure multi material support + scope.addGroup( groupStart, groupCount, 0 ); + + // calculate new start value for groups + groupStart += groupCount; + + } + + function generateCap( top ) { + + var x, centerIndexStart, centerIndexEnd; + + var uv = new Vector2(); + var vertex = new Vector3(); + + var groupCount = 0; + + var radius = ( top === true ) ? radiusTop : radiusBottom; + var sign = ( top === true ) ? 1 : - 1; + + // save the index of the first center vertex + centerIndexStart = index; + + // first we generate the center vertex data of the cap. + // because the geometry needs one set of uvs per face, + // we must generate a center vertex per face/segment + + for ( x = 1; x <= radialSegments; x ++ ) { + + // vertex + vertices.setXYZ( index, 0, halfHeight * sign, 0 ); + + // normal + normals.setXYZ( index, 0, sign, 0 ); + + // uv + uv.x = 0.5; + uv.y = 0.5; + + uvs.setXY( index, uv.x, uv.y ); + + // increase index + index ++; + + } + + // save the index of the last center vertex + centerIndexEnd = index; + + // now we generate the surrounding vertices, normals and uvs + + for ( x = 0; x <= radialSegments; x ++ ) { + + var u = x / radialSegments; + var theta = u * thetaLength + thetaStart; + + var cosTheta = Math.cos( theta ); + var sinTheta = Math.sin( theta ); + + // vertex + vertex.x = radius * sinTheta; + vertex.y = halfHeight * sign; + vertex.z = radius * cosTheta; + vertices.setXYZ( index, vertex.x, vertex.y, vertex.z ); + + // normal + normals.setXYZ( index, 0, sign, 0 ); + + // uv + uv.x = ( cosTheta * 0.5 ) + 0.5; + uv.y = ( sinTheta * 0.5 * sign ) + 0.5; + uvs.setXY( index, uv.x, uv.y ); + + // increase index + index ++; + + } + + // generate indices + + for ( x = 0; x < radialSegments; x ++ ) { + + var c = centerIndexStart + x; + var i = centerIndexEnd + x; + + if ( top === true ) { + + // face top + indices.setX( indexOffset, i ); indexOffset ++; + indices.setX( indexOffset, i + 1 ); indexOffset ++; + indices.setX( indexOffset, c ); indexOffset ++; + + } else { + + // face bottom + indices.setX( indexOffset, i + 1 ); indexOffset ++; + indices.setX( indexOffset, i ); indexOffset ++; + indices.setX( indexOffset, c ); indexOffset ++; + + } + + // update counters + groupCount += 3; + + } + + // add a group to the geometry. this will ensure multi material support + scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); + + // calculate new start value for groups + groupStart += groupCount; + + } + + } + + CylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + CylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + + Geometry.call( this ); + + this.type = 'CylinderGeometry'; + + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) ); + this.mergeVertices(); + + } + + CylinderGeometry.prototype = Object.create( Geometry.prototype ); + CylinderGeometry.prototype.constructor = CylinderGeometry; + + /** + * @author abelnation / http://github.com/abelnation + */ + + function ConeGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + + CylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + + this.type = 'ConeGeometry'; + + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + } + + ConeGeometry.prototype = Object.create( CylinderGeometry.prototype ); + ConeGeometry.prototype.constructor = ConeGeometry; + + /** + * @author: abelnation / http://github.com/abelnation + */ + + function ConeBufferGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + + CylinderBufferGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + + this.type = 'ConeBufferGeometry'; + + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + } + + ConeBufferGeometry.prototype = Object.create( CylinderBufferGeometry.prototype ); + ConeBufferGeometry.prototype.constructor = ConeBufferGeometry; + + /** + * @author benaadams / https://twitter.com/ben_a_adams + */ + + function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) { + + BufferGeometry.call( this ); + + this.type = 'CircleBufferGeometry'; + + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + radius = radius || 50; + segments = segments !== undefined ? Math.max( 3, segments ) : 8; + + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + + var vertices = segments + 2; + + var positions = new Float32Array( vertices * 3 ); + var normals = new Float32Array( vertices * 3 ); + var uvs = new Float32Array( vertices * 2 ); + + // center data is already zero, but need to set a few extras + normals[ 2 ] = 1.0; + uvs[ 0 ] = 0.5; + uvs[ 1 ] = 0.5; + + for ( var s = 0, i = 3, ii = 2 ; s <= segments; s ++, i += 3, ii += 2 ) { + + var segment = thetaStart + s / segments * thetaLength; + + positions[ i ] = radius * Math.cos( segment ); + positions[ i + 1 ] = radius * Math.sin( segment ); + + normals[ i + 2 ] = 1; // normal z + + uvs[ ii ] = ( positions[ i ] / radius + 1 ) / 2; + uvs[ ii + 1 ] = ( positions[ i + 1 ] / radius + 1 ) / 2; + + } + + var indices = []; + + for ( var i = 1; i <= segments; i ++ ) { + + indices.push( i, i + 1, 0 ); + + } + + this.setIndex( new BufferAttribute( new Uint16Array( indices ), 1 ) ); + this.addAttribute( 'position', new BufferAttribute( positions, 3 ) ); + this.addAttribute( 'normal', new BufferAttribute( normals, 3 ) ); + this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) ); + + this.boundingSphere = new Sphere( new Vector3(), radius ); + + } + + CircleBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + CircleBufferGeometry.prototype.constructor = CircleBufferGeometry; + + /** + * @author hughes + */ + + function CircleGeometry( radius, segments, thetaStart, thetaLength ) { + + Geometry.call( this ); + + this.type = 'CircleGeometry'; + + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; + + this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) ); + + } + + CircleGeometry.prototype = Object.create( Geometry.prototype ); + CircleGeometry.prototype.constructor = CircleGeometry; + + /** + * @author mrdoob / http://mrdoob.com/ + * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as + */ + + function BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { + + Geometry.call( this ); + + this.type = 'BoxGeometry'; + + this.parameters = { + width: width, + height: height, + depth: depth, + widthSegments: widthSegments, + heightSegments: heightSegments, + depthSegments: depthSegments + }; + + this.fromBufferGeometry( new BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) ); + this.mergeVertices(); + + } + + BoxGeometry.prototype = Object.create( Geometry.prototype ); + BoxGeometry.prototype.constructor = BoxGeometry; + + + + var Geometries = Object.freeze({ + WireframeGeometry: WireframeGeometry, + ParametricGeometry: ParametricGeometry, + ParametricBufferGeometry: ParametricBufferGeometry, + TetrahedronGeometry: TetrahedronGeometry, + TetrahedronBufferGeometry: TetrahedronBufferGeometry, + OctahedronGeometry: OctahedronGeometry, + OctahedronBufferGeometry: OctahedronBufferGeometry, + IcosahedronGeometry: IcosahedronGeometry, + IcosahedronBufferGeometry: IcosahedronBufferGeometry, + DodecahedronGeometry: DodecahedronGeometry, + DodecahedronBufferGeometry: DodecahedronBufferGeometry, + PolyhedronGeometry: PolyhedronGeometry, + PolyhedronBufferGeometry: PolyhedronBufferGeometry, + TubeGeometry: TubeGeometry, + TubeBufferGeometry: TubeBufferGeometry, + TorusKnotGeometry: TorusKnotGeometry, + TorusKnotBufferGeometry: TorusKnotBufferGeometry, + TorusGeometry: TorusGeometry, + TorusBufferGeometry: TorusBufferGeometry, + TextGeometry: TextGeometry, + SphereBufferGeometry: SphereBufferGeometry, + SphereGeometry: SphereGeometry, + RingGeometry: RingGeometry, + RingBufferGeometry: RingBufferGeometry, + PlaneBufferGeometry: PlaneBufferGeometry, + PlaneGeometry: PlaneGeometry, + LatheGeometry: LatheGeometry, + LatheBufferGeometry: LatheBufferGeometry, + ShapeGeometry: ShapeGeometry, + ExtrudeGeometry: ExtrudeGeometry, + EdgesGeometry: EdgesGeometry, + ConeGeometry: ConeGeometry, + ConeBufferGeometry: ConeBufferGeometry, + CylinderGeometry: CylinderGeometry, + CylinderBufferGeometry: CylinderBufferGeometry, + CircleBufferGeometry: CircleBufferGeometry, + CircleGeometry: CircleGeometry, + BoxBufferGeometry: BoxBufferGeometry, + BoxGeometry: BoxGeometry + }); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function ShadowMaterial() { + + ShaderMaterial.call( this, { + uniforms: UniformsUtils.merge( [ + UniformsLib[ "lights" ], + { + opacity: { value: 1.0 } + } + ] ), + vertexShader: ShaderChunk[ 'shadow_vert' ], + fragmentShader: ShaderChunk[ 'shadow_frag' ] + } ); + + this.lights = true; + this.transparent = true; + + Object.defineProperties( this, { + opacity: { + enumerable: true, + get: function () { + return this.uniforms.opacity.value; + }, + set: function ( value ) { + this.uniforms.opacity.value = value; + } + } + } ); + + } + + ShadowMaterial.prototype = Object.create( ShaderMaterial.prototype ); + ShadowMaterial.prototype.constructor = ShadowMaterial; + + ShadowMaterial.prototype.isShadowMaterial = true; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function RawShaderMaterial( parameters ) { + + ShaderMaterial.call( this, parameters ); + + this.type = 'RawShaderMaterial'; + + } + + RawShaderMaterial.prototype = Object.create( ShaderMaterial.prototype ); + RawShaderMaterial.prototype.constructor = RawShaderMaterial; + + RawShaderMaterial.prototype.isRawShaderMaterial = true; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function MultiMaterial( materials ) { + + this.uuid = _Math.generateUUID(); + + this.type = 'MultiMaterial'; + + this.materials = materials instanceof Array ? materials : []; + + this.visible = true; + + } + + MultiMaterial.prototype = { + + constructor: MultiMaterial, + + isMultiMaterial: true, + + toJSON: function ( meta ) { + + var output = { + metadata: { + version: 4.2, + type: 'material', + generator: 'MaterialExporter' + }, + uuid: this.uuid, + type: this.type, + materials: [] + }; + + var materials = this.materials; + + for ( var i = 0, l = materials.length; i < l; i ++ ) { + + var material = materials[ i ].toJSON( meta ); + delete material.metadata; + + output.materials.push( material ); + + } + + output.visible = this.visible; + + return output; + + }, + + clone: function () { + + var material = new this.constructor(); + + for ( var i = 0; i < this.materials.length; i ++ ) { + + material.materials.push( this.materials[ i ].clone() ); + + } + + material.visible = this.visible; + + return material; + + } + + }; + + /** + * @author WestLangley / http://github.com/WestLangley + * + * parameters = { + * color: , + * roughness: , + * metalness: , + * opacity: , + * + * map: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * emissive: , + * emissiveIntensity: + * emissiveMap: new THREE.Texture( ), + * + * bumpMap: new THREE.Texture( ), + * bumpScale: , + * + * normalMap: new THREE.Texture( ), + * normalScale: , + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * roughnessMap: new THREE.Texture( ), + * + * metalnessMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), + * envMapIntensity: + * + * refractionRatio: , + * + * wireframe: , + * wireframeLinewidth: , + * + * skinning: , + * morphTargets: , + * morphNormals: + * } + */ + + function MeshStandardMaterial( parameters ) { + + Material.call( this ); + + this.defines = { 'STANDARD': '' }; + + this.type = 'MeshStandardMaterial'; + + this.color = new Color( 0xffffff ); // diffuse + this.roughness = 0.5; + this.metalness = 0.5; + + this.map = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; + + this.bumpMap = null; + this.bumpScale = 1; + + this.normalMap = null; + this.normalScale = new Vector2( 1, 1 ); + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.roughnessMap = null; + + this.metalnessMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.envMapIntensity = 1.0; + + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.skinning = false; + this.morphTargets = false; + this.morphNormals = false; + + this.setValues( parameters ); + + } + + MeshStandardMaterial.prototype = Object.create( Material.prototype ); + MeshStandardMaterial.prototype.constructor = MeshStandardMaterial; + + MeshStandardMaterial.prototype.isMeshStandardMaterial = true; + + MeshStandardMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.defines = { 'STANDARD': '' }; + + this.color.copy( source.color ); + this.roughness = source.roughness; + this.metalness = source.metalness; + + this.map = source.map; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; + + this.normalMap = source.normalMap; + this.normalScale.copy( source.normalScale ); + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.roughnessMap = source.roughnessMap; + + this.metalnessMap = source.metalnessMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.envMapIntensity = source.envMapIntensity; + + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + this.skinning = source.skinning; + this.morphTargets = source.morphTargets; + this.morphNormals = source.morphNormals; + + return this; + + }; + + /** + * @author WestLangley / http://github.com/WestLangley + * + * parameters = { + * reflectivity: + * } + */ + + function MeshPhysicalMaterial( parameters ) { + + MeshStandardMaterial.call( this ); + + this.defines = { 'PHYSICAL': '' }; + + this.type = 'MeshPhysicalMaterial'; + + this.reflectivity = 0.5; // maps to F0 = 0.04 + + this.clearCoat = 0.0; + this.clearCoatRoughness = 0.0; + + this.setValues( parameters ); + + } + + MeshPhysicalMaterial.prototype = Object.create( MeshStandardMaterial.prototype ); + MeshPhysicalMaterial.prototype.constructor = MeshPhysicalMaterial; + + MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true; + + MeshPhysicalMaterial.prototype.copy = function ( source ) { + + MeshStandardMaterial.prototype.copy.call( this, source ); + + this.defines = { 'PHYSICAL': '' }; + + this.reflectivity = source.reflectivity; + + this.clearCoat = source.clearCoat; + this.clearCoatRoughness = source.clearCoatRoughness; + + return this; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * color: , + * specular: , + * shininess: , + * opacity: , + * + * map: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * emissive: , + * emissiveIntensity: + * emissiveMap: new THREE.Texture( ), + * + * bumpMap: new THREE.Texture( ), + * bumpScale: , + * + * normalMap: new THREE.Texture( ), + * normalScale: , + * + * displacementMap: new THREE.Texture( ), + * displacementScale: , + * displacementBias: , + * + * specularMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), + * combine: THREE.Multiply, + * reflectivity: , + * refractionRatio: , + * + * wireframe: , + * wireframeLinewidth: , + * + * skinning: , + * morphTargets: , + * morphNormals: + * } + */ + + function MeshPhongMaterial( parameters ) { + + Material.call( this ); + + this.type = 'MeshPhongMaterial'; + + this.color = new Color( 0xffffff ); // diffuse + this.specular = new Color( 0x111111 ); + this.shininess = 30; + + this.map = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; + + this.bumpMap = null; + this.bumpScale = 1; + + this.normalMap = null; + this.normalScale = new Vector2( 1, 1 ); + + this.displacementMap = null; + this.displacementScale = 1; + this.displacementBias = 0; + + this.specularMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.skinning = false; + this.morphTargets = false; + this.morphNormals = false; + + this.setValues( parameters ); + + } + + MeshPhongMaterial.prototype = Object.create( Material.prototype ); + MeshPhongMaterial.prototype.constructor = MeshPhongMaterial; + + MeshPhongMaterial.prototype.isMeshPhongMaterial = true; + + MeshPhongMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + this.specular.copy( source.specular ); + this.shininess = source.shininess; + + this.map = source.map; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + + this.bumpMap = source.bumpMap; + this.bumpScale = source.bumpScale; + + this.normalMap = source.normalMap; + this.normalScale.copy( source.normalScale ); + + this.displacementMap = source.displacementMap; + this.displacementScale = source.displacementScale; + this.displacementBias = source.displacementBias; + + this.specularMap = source.specularMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + this.skinning = source.skinning; + this.morphTargets = source.morphTargets; + this.morphNormals = source.morphNormals; + + return this; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * + * parameters = { + * opacity: , + * + * wireframe: , + * wireframeLinewidth: + * } + */ + + function MeshNormalMaterial( parameters ) { + + Material.call( this, parameters ); + + this.type = 'MeshNormalMaterial'; + + this.wireframe = false; + this.wireframeLinewidth = 1; + + this.fog = false; + this.lights = false; + this.morphTargets = false; + + this.setValues( parameters ); + + } + + MeshNormalMaterial.prototype = Object.create( Material.prototype ); + MeshNormalMaterial.prototype.constructor = MeshNormalMaterial; + + MeshNormalMaterial.prototype.isMeshNormalMaterial = true; + + MeshNormalMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + + return this; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * color: , + * opacity: , + * + * map: new THREE.Texture( ), + * + * lightMap: new THREE.Texture( ), + * lightMapIntensity: + * + * aoMap: new THREE.Texture( ), + * aoMapIntensity: + * + * emissive: , + * emissiveIntensity: + * emissiveMap: new THREE.Texture( ), + * + * specularMap: new THREE.Texture( ), + * + * alphaMap: new THREE.Texture( ), + * + * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), + * combine: THREE.Multiply, + * reflectivity: , + * refractionRatio: , + * + * wireframe: , + * wireframeLinewidth: , + * + * skinning: , + * morphTargets: , + * morphNormals: + * } + */ + + function MeshLambertMaterial( parameters ) { + + Material.call( this ); + + this.type = 'MeshLambertMaterial'; + + this.color = new Color( 0xffffff ); // diffuse + + this.map = null; + + this.lightMap = null; + this.lightMapIntensity = 1.0; + + this.aoMap = null; + this.aoMapIntensity = 1.0; + + this.emissive = new Color( 0x000000 ); + this.emissiveIntensity = 1.0; + this.emissiveMap = null; + + this.specularMap = null; + + this.alphaMap = null; + + this.envMap = null; + this.combine = MultiplyOperation; + this.reflectivity = 1; + this.refractionRatio = 0.98; + + this.wireframe = false; + this.wireframeLinewidth = 1; + this.wireframeLinecap = 'round'; + this.wireframeLinejoin = 'round'; + + this.skinning = false; + this.morphTargets = false; + this.morphNormals = false; + + this.setValues( parameters ); + + } + + MeshLambertMaterial.prototype = Object.create( Material.prototype ); + MeshLambertMaterial.prototype.constructor = MeshLambertMaterial; + + MeshLambertMaterial.prototype.isMeshLambertMaterial = true; + + MeshLambertMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + + this.map = source.map; + + this.lightMap = source.lightMap; + this.lightMapIntensity = source.lightMapIntensity; + + this.aoMap = source.aoMap; + this.aoMapIntensity = source.aoMapIntensity; + + this.emissive.copy( source.emissive ); + this.emissiveMap = source.emissiveMap; + this.emissiveIntensity = source.emissiveIntensity; + + this.specularMap = source.specularMap; + + this.alphaMap = source.alphaMap; + + this.envMap = source.envMap; + this.combine = source.combine; + this.reflectivity = source.reflectivity; + this.refractionRatio = source.refractionRatio; + + this.wireframe = source.wireframe; + this.wireframeLinewidth = source.wireframeLinewidth; + this.wireframeLinecap = source.wireframeLinecap; + this.wireframeLinejoin = source.wireframeLinejoin; + + this.skinning = source.skinning; + this.morphTargets = source.morphTargets; + this.morphNormals = source.morphNormals; + + return this; + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + * + * parameters = { + * color: , + * opacity: , + * + * linewidth: , + * + * scale: , + * dashSize: , + * gapSize: + * } + */ + + function LineDashedMaterial( parameters ) { + + Material.call( this ); + + this.type = 'LineDashedMaterial'; + + this.color = new Color( 0xffffff ); + + this.linewidth = 1; + + this.scale = 1; + this.dashSize = 3; + this.gapSize = 1; + + this.lights = false; + + this.setValues( parameters ); + + } + + LineDashedMaterial.prototype = Object.create( Material.prototype ); + LineDashedMaterial.prototype.constructor = LineDashedMaterial; + + LineDashedMaterial.prototype.isLineDashedMaterial = true; + + LineDashedMaterial.prototype.copy = function ( source ) { + + Material.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + + this.linewidth = source.linewidth; + + this.scale = source.scale; + this.dashSize = source.dashSize; + this.gapSize = source.gapSize; + + return this; + + }; + + + + var Materials = Object.freeze({ + ShadowMaterial: ShadowMaterial, + SpriteMaterial: SpriteMaterial, + RawShaderMaterial: RawShaderMaterial, + ShaderMaterial: ShaderMaterial, + PointsMaterial: PointsMaterial, + MultiMaterial: MultiMaterial, + MeshPhysicalMaterial: MeshPhysicalMaterial, + MeshStandardMaterial: MeshStandardMaterial, + MeshPhongMaterial: MeshPhongMaterial, + MeshNormalMaterial: MeshNormalMaterial, + MeshLambertMaterial: MeshLambertMaterial, + MeshDepthMaterial: MeshDepthMaterial, + MeshBasicMaterial: MeshBasicMaterial, + LineDashedMaterial: LineDashedMaterial, + LineBasicMaterial: LineBasicMaterial, + Material: Material + }); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + var Cache = { + + enabled: false, + + files: {}, + + add: function ( key, file ) { + + if ( this.enabled === false ) return; + + // console.log( 'THREE.Cache', 'Adding key:', key ); + + this.files[ key ] = file; + + }, + + get: function ( key ) { + + if ( this.enabled === false ) return; + + // console.log( 'THREE.Cache', 'Checking key:', key ); + + return this.files[ key ]; + + }, + + remove: function ( key ) { + + delete this.files[ key ]; + + }, + + clear: function () { + + this.files = {}; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function LoadingManager( onLoad, onProgress, onError ) { + + var scope = this; + + var isLoading = false, itemsLoaded = 0, itemsTotal = 0; + + this.onStart = undefined; + this.onLoad = onLoad; + this.onProgress = onProgress; + this.onError = onError; + + this.itemStart = function ( url ) { + + itemsTotal ++; + + if ( isLoading === false ) { + + if ( scope.onStart !== undefined ) { + + scope.onStart( url, itemsLoaded, itemsTotal ); + + } + + } + + isLoading = true; + + }; + + this.itemEnd = function ( url ) { + + itemsLoaded ++; + + if ( scope.onProgress !== undefined ) { + + scope.onProgress( url, itemsLoaded, itemsTotal ); + + } + + if ( itemsLoaded === itemsTotal ) { + + isLoading = false; + + if ( scope.onLoad !== undefined ) { + + scope.onLoad(); + + } + + } + + }; + + this.itemError = function ( url ) { + + if ( scope.onError !== undefined ) { + + scope.onError( url ); + + } + + }; + + } + + var DefaultLoadingManager = new LoadingManager(); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function XHRLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + } + + Object.assign( XHRLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + if ( url === undefined ) url = ''; + + if ( this.path !== undefined ) url = this.path + url; + + var scope = this; + + var cached = Cache.get( url ); + + if ( cached !== undefined ) { + + scope.manager.itemStart( url ); + + setTimeout( function () { + + if ( onLoad ) onLoad( cached ); + + scope.manager.itemEnd( url ); + + }, 0 ); + + return cached; + + } + + // Check for data: URI + var dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; + var dataUriRegexResult = url.match( dataUriRegex ); + + // Safari can not handle Data URIs through XMLHttpRequest so process manually + if ( dataUriRegexResult ) { + + var mimeType = dataUriRegexResult[1]; + var isBase64 = !!dataUriRegexResult[2]; + var data = dataUriRegexResult[3]; + + data = window.decodeURIComponent(data); + + if( isBase64 ) { + data = window.atob(data); + } + + try { + + var response; + var responseType = ( this.responseType || '' ).toLowerCase(); + + switch ( responseType ) { + + case 'arraybuffer': + case 'blob': + + response = new ArrayBuffer( data.length ); + var view = new Uint8Array( response ); + for ( var i = 0; i < data.length; i ++ ) { + + view[ i ] = data.charCodeAt( i ); + + } + + if ( responseType === 'blob' ) { + + response = new Blob( [ response ], { "type" : mimeType } ); + + } + + break; + + case 'document': + + var parser = new DOMParser(); + response = parser.parseFromString( data, mimeType ); + + break; + + case 'json': + + response = JSON.parse( data ); + + break; + + default: // 'text' or other + + response = data; + + break; + + } + + // Wait for next browser tick + window.setTimeout( function() { + + if ( onLoad ) onLoad( response ); + + scope.manager.itemEnd( url ); + + }, 0); + + } catch ( error ) { + + // Wait for next browser tick + window.setTimeout( function() { + + if ( onError ) onError( error ); + + scope.manager.itemError( url ); + + }, 0); + + } + + } else { + + var request = new XMLHttpRequest(); + request.open( 'GET', url, true ); + + request.addEventListener( 'load', function ( event ) { + + var response = event.target.response; + + Cache.add( url, response ); + + if ( this.status === 200 ) { + + if ( onLoad ) onLoad( response ); + + scope.manager.itemEnd( url ); + + } else if ( this.status === 0 ) { + + // Some browsers return HTTP Status 0 when using non-http protocol + // e.g. 'file://' or 'data://'. Handle as success. + + console.warn( 'THREE.XHRLoader: HTTP Status 0 received.' ); + + if ( onLoad ) onLoad( response ); + + scope.manager.itemEnd( url ); + + } else { + + if ( onError ) onError( event ); + + scope.manager.itemError( url ); + + } + + }, false ); + + if ( onProgress !== undefined ) { + + request.addEventListener( 'progress', function ( event ) { + + onProgress( event ); + + }, false ); + + } + + request.addEventListener( 'error', function ( event ) { + + if ( onError ) onError( event ); + + scope.manager.itemError( url ); + + }, false ); + + if ( this.responseType !== undefined ) request.responseType = this.responseType; + if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials; + + if ( request.overrideMimeType ) request.overrideMimeType( 'text/plain' ); + + request.send( null ); + + } + + scope.manager.itemStart( url ); + + return request; + + }, + + setPath: function ( value ) { + + this.path = value; + return this; + + }, + + setResponseType: function ( value ) { + + this.responseType = value; + return this; + + }, + + setWithCredentials: function ( value ) { + + this.withCredentials = value; + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + * + * Abstract Base class to block based textures loader (dds, pvr, ...) + */ + + function CompressedTextureLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + // override in sub classes + this._parser = null; + + } + + Object.assign( CompressedTextureLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var images = []; + + var texture = new CompressedTexture(); + texture.image = images; + + var loader = new XHRLoader( this.manager ); + loader.setPath( this.path ); + loader.setResponseType( 'arraybuffer' ); + + function loadTexture( i ) { + + loader.load( url[ i ], function ( buffer ) { + + var texDatas = scope._parser( buffer, true ); + + images[ i ] = { + width: texDatas.width, + height: texDatas.height, + format: texDatas.format, + mipmaps: texDatas.mipmaps + }; + + loaded += 1; + + if ( loaded === 6 ) { + + if ( texDatas.mipmapCount === 1 ) + texture.minFilter = LinearFilter; + + texture.format = texDatas.format; + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + } + + }, onProgress, onError ); + + } + + if ( Array.isArray( url ) ) { + + var loaded = 0; + + for ( var i = 0, il = url.length; i < il; ++ i ) { + + loadTexture( i ); + + } + + } else { + + // compressed cubemap texture stored in a single DDS file + + loader.load( url, function ( buffer ) { + + var texDatas = scope._parser( buffer, true ); + + if ( texDatas.isCubemap ) { + + var faces = texDatas.mipmaps.length / texDatas.mipmapCount; + + for ( var f = 0; f < faces; f ++ ) { + + images[ f ] = { mipmaps : [] }; + + for ( var i = 0; i < texDatas.mipmapCount; i ++ ) { + + images[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] ); + images[ f ].format = texDatas.format; + images[ f ].width = texDatas.width; + images[ f ].height = texDatas.height; + + } + + } + + } else { + + texture.image.width = texDatas.width; + texture.image.height = texDatas.height; + texture.mipmaps = texDatas.mipmaps; + + } + + if ( texDatas.mipmapCount === 1 ) { + + texture.minFilter = LinearFilter; + + } + + texture.format = texDatas.format; + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + }, onProgress, onError ); + + } + + return texture; + + }, + + setPath: function ( value ) { + + this.path = value; + return this; + + } + + } ); + + /** + * @author Nikos M. / https://github.com/foo123/ + * + * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) + */ + + var DataTextureLoader = BinaryTextureLoader; + function BinaryTextureLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + // override in sub classes + this._parser = null; + + } + + Object.assign( BinaryTextureLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var texture = new DataTexture(); + + var loader = new XHRLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + + loader.load( url, function ( buffer ) { + + var texData = scope._parser( buffer ); + + if ( ! texData ) return; + + if ( undefined !== texData.image ) { + + texture.image = texData.image; + + } else if ( undefined !== texData.data ) { + + texture.image.width = texData.width; + texture.image.height = texData.height; + texture.image.data = texData.data; + + } + + texture.wrapS = undefined !== texData.wrapS ? texData.wrapS : ClampToEdgeWrapping; + texture.wrapT = undefined !== texData.wrapT ? texData.wrapT : ClampToEdgeWrapping; + + texture.magFilter = undefined !== texData.magFilter ? texData.magFilter : LinearFilter; + texture.minFilter = undefined !== texData.minFilter ? texData.minFilter : LinearMipMapLinearFilter; + + texture.anisotropy = undefined !== texData.anisotropy ? texData.anisotropy : 1; + + if ( undefined !== texData.format ) { + + texture.format = texData.format; + + } + if ( undefined !== texData.type ) { + + texture.type = texData.type; + + } + + if ( undefined !== texData.mipmaps ) { + + texture.mipmaps = texData.mipmaps; + + } + + if ( 1 === texData.mipmapCount ) { + + texture.minFilter = LinearFilter; + + } + + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture, texData ); + + }, onProgress, onError ); + + + return texture; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function ImageLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + } + + Object.assign( ImageLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' ); + image.onload = function () { + + image.onload = null; + + URL.revokeObjectURL( image.src ); + + if ( onLoad ) onLoad( image ); + + scope.manager.itemEnd( url ); + + }; + image.onerror = onError; + + if ( url.indexOf( 'data:' ) === 0 ) { + + image.src = url; + + } else { + + var loader = new XHRLoader(); + loader.setPath( this.path ); + loader.setResponseType( 'blob' ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( blob ) { + + image.src = URL.createObjectURL( blob ); + + }, onProgress, onError ); + + } + + scope.manager.itemStart( url ); + + return image; + + }, + + setCrossOrigin: function ( value ) { + + this.crossOrigin = value; + return this; + + }, + + setWithCredentials: function ( value ) { + + this.withCredentials = value; + return this; + + }, + + setPath: function ( value ) { + + this.path = value; + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function CubeTextureLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + } + + Object.assign( CubeTextureLoader.prototype, { + + load: function ( urls, onLoad, onProgress, onError ) { + + var texture = new CubeTexture(); + + var loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + loader.setPath( this.path ); + + var loaded = 0; + + function loadTexture( i ) { + + loader.load( urls[ i ], function ( image ) { + + texture.images[ i ] = image; + + loaded ++; + + if ( loaded === 6 ) { + + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture ); + + } + + }, undefined, onError ); + + } + + for ( var i = 0; i < urls.length; ++ i ) { + + loadTexture( i ); + + } + + return texture; + + }, + + setCrossOrigin: function ( value ) { + + this.crossOrigin = value; + return this; + + }, + + setPath: function ( value ) { + + this.path = value; + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function TextureLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + } + + Object.assign( TextureLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var texture = new Texture(); + + var loader = new ImageLoader( this.manager ); + loader.setCrossOrigin( this.crossOrigin ); + loader.setWithCredentials( this.withCredentials ); + loader.setPath( this.path ); + loader.load( url, function ( image ) { + + // JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB. + var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0; + + texture.format = isJPEG ? RGBFormat : RGBAFormat; + texture.image = image; + texture.needsUpdate = true; + + if ( onLoad !== undefined ) { + + onLoad( texture ); + + } + + }, onProgress, onError ); + + return texture; + + }, + + setCrossOrigin: function ( value ) { + + this.crossOrigin = value; + return this; + + }, + + setWithCredentials: function ( value ) { + + this.withCredentials = value; + return this; + + }, + + setPath: function ( value ) { + + this.path = value; + return this; + + } + + + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function Light( color, intensity ) { + + Object3D.call( this ); + + this.type = 'Light'; + + this.color = new Color( color ); + this.intensity = intensity !== undefined ? intensity : 1; + + this.receiveShadow = undefined; + + } + + Light.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Light, + + isLight: true, + + copy: function ( source ) { + + Object3D.prototype.copy.call( this, source ); + + this.color.copy( source.color ); + this.intensity = source.intensity; + + return this; + + }, + + toJSON: function ( meta ) { + + var data = Object3D.prototype.toJSON.call( this, meta ); + + data.object.color = this.color.getHex(); + data.object.intensity = this.intensity; + + if ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex(); + + if ( this.distance !== undefined ) data.object.distance = this.distance; + if ( this.angle !== undefined ) data.object.angle = this.angle; + if ( this.decay !== undefined ) data.object.decay = this.decay; + if ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra; + + if ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON(); + + return data; + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function HemisphereLight( skyColor, groundColor, intensity ) { + + Light.call( this, skyColor, intensity ); + + this.type = 'HemisphereLight'; + + this.castShadow = undefined; + + this.position.copy( Object3D.DefaultUp ); + this.updateMatrix(); + + this.groundColor = new Color( groundColor ); + + } + + HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), { + + constructor: HemisphereLight, + + isHemisphereLight: true, + + copy: function ( source ) { + + Light.prototype.copy.call( this, source ); + + this.groundColor.copy( source.groundColor ); + + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function LightShadow( camera ) { + + this.camera = camera; + + this.bias = 0; + this.radius = 1; + + this.mapSize = new Vector2( 512, 512 ); + + this.map = null; + this.matrix = new Matrix4(); + + } + + Object.assign( LightShadow.prototype, { + + copy: function ( source ) { + + this.camera = source.camera.clone(); + + this.bias = source.bias; + this.radius = source.radius; + + this.mapSize.copy( source.mapSize ); + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + toJSON: function () { + + var object = {}; + + if ( this.bias !== 0 ) object.bias = this.bias; + if ( this.radius !== 1 ) object.radius = this.radius; + if ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray(); + + object.camera = this.camera.toJSON( false ).object; + delete object.camera.matrix; + + return object; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function SpotLightShadow() { + + LightShadow.call( this, new PerspectiveCamera( 50, 1, 0.5, 500 ) ); + + } + + SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), { + + constructor: SpotLightShadow, + + isSpotLightShadow: true, + + update: function ( light ) { + + var fov = _Math.RAD2DEG * 2 * light.angle; + var aspect = this.mapSize.width / this.mapSize.height; + var far = light.distance || 500; + + var camera = this.camera; + + if ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) { + + camera.fov = fov; + camera.aspect = aspect; + camera.far = far; + camera.updateProjectionMatrix(); + + } + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function SpotLight( color, intensity, distance, angle, penumbra, decay ) { + + Light.call( this, color, intensity ); + + this.type = 'SpotLight'; + + this.position.copy( Object3D.DefaultUp ); + this.updateMatrix(); + + this.target = new Object3D(); + + Object.defineProperty( this, 'power', { + get: function () { + // intensity = power per solid angle. + // ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf + return this.intensity * Math.PI; + }, + set: function ( power ) { + // intensity = power per solid angle. + // ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf + this.intensity = power / Math.PI; + } + } ); + + this.distance = ( distance !== undefined ) ? distance : 0; + this.angle = ( angle !== undefined ) ? angle : Math.PI / 3; + this.penumbra = ( penumbra !== undefined ) ? penumbra : 0; + this.decay = ( decay !== undefined ) ? decay : 1; // for physically correct lights, should be 2. + + this.shadow = new SpotLightShadow(); + + } + + SpotLight.prototype = Object.assign( Object.create( Light.prototype ), { + + constructor: SpotLight, + + isSpotLight: true, + + copy: function ( source ) { + + Light.prototype.copy.call( this, source ); + + this.distance = source.distance; + this.angle = source.angle; + this.penumbra = source.penumbra; + this.decay = source.decay; + + this.target = source.target.clone(); + + this.shadow = source.shadow.clone(); + + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + + function PointLight( color, intensity, distance, decay ) { + + Light.call( this, color, intensity ); + + this.type = 'PointLight'; + + Object.defineProperty( this, 'power', { + get: function () { + // intensity = power per solid angle. + // ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf + return this.intensity * 4 * Math.PI; + + }, + set: function ( power ) { + // intensity = power per solid angle. + // ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf + this.intensity = power / ( 4 * Math.PI ); + } + } ); + + this.distance = ( distance !== undefined ) ? distance : 0; + this.decay = ( decay !== undefined ) ? decay : 1; // for physically correct lights, should be 2. + + this.shadow = new LightShadow( new PerspectiveCamera( 90, 1, 0.5, 500 ) ); + + } + + PointLight.prototype = Object.assign( Object.create( Light.prototype ), { + + constructor: PointLight, + + isPointLight: true, + + copy: function ( source ) { + + Light.prototype.copy.call( this, source ); + + this.distance = source.distance; + this.decay = source.decay; + + this.shadow = source.shadow.clone(); + + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function DirectionalLightShadow( light ) { + + LightShadow.call( this, new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) ); + + } + + DirectionalLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), { + + constructor: DirectionalLightShadow + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function DirectionalLight( color, intensity ) { + + Light.call( this, color, intensity ); + + this.type = 'DirectionalLight'; + + this.position.copy( Object3D.DefaultUp ); + this.updateMatrix(); + + this.target = new Object3D(); + + this.shadow = new DirectionalLightShadow(); + + } + + DirectionalLight.prototype = Object.assign( Object.create( Light.prototype ), { + + constructor: DirectionalLight, + + isDirectionalLight: true, + + copy: function ( source ) { + + Light.prototype.copy.call( this, source ); + + this.target = source.target.clone(); + + this.shadow = source.shadow.clone(); + + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function AmbientLight( color, intensity ) { + + Light.call( this, color, intensity ); + + this.type = 'AmbientLight'; + + this.castShadow = undefined; + + } + + AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), { + + constructor: AmbientLight, + + isAmbientLight: true, + + } ); + + /** + * @author tschw + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + */ + + var AnimationUtils = { + + // same as Array.prototype.slice, but also works on typed arrays + arraySlice: function( array, from, to ) { + + if ( AnimationUtils.isTypedArray( array ) ) { + + return new array.constructor( array.subarray( from, to ) ); + + } + + return array.slice( from, to ); + + }, + + // converts an array to a specific type + convertArray: function( array, type, forceClone ) { + + if ( ! array || // let 'undefined' and 'null' pass + ! forceClone && array.constructor === type ) return array; + + if ( typeof type.BYTES_PER_ELEMENT === 'number' ) { + + return new type( array ); // create typed array + + } + + return Array.prototype.slice.call( array ); // create Array + + }, + + isTypedArray: function( object ) { + + return ArrayBuffer.isView( object ) && + ! ( object instanceof DataView ); + + }, + + // returns an array by which times and values can be sorted + getKeyframeOrder: function( times ) { + + function compareTime( i, j ) { + + return times[ i ] - times[ j ]; + + } + + var n = times.length; + var result = new Array( n ); + for ( var i = 0; i !== n; ++ i ) result[ i ] = i; + + result.sort( compareTime ); + + return result; + + }, + + // uses the array previously returned by 'getKeyframeOrder' to sort data + sortedArray: function( values, stride, order ) { + + var nValues = values.length; + var result = new values.constructor( nValues ); + + for ( var i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) { + + var srcOffset = order[ i ] * stride; + + for ( var j = 0; j !== stride; ++ j ) { + + result[ dstOffset ++ ] = values[ srcOffset + j ]; + + } + + } + + return result; + + }, + + // function for parsing AOS keyframe formats + flattenJSON: function( jsonKeys, times, values, valuePropertyName ) { + + var i = 1, key = jsonKeys[ 0 ]; + + while ( key !== undefined && key[ valuePropertyName ] === undefined ) { + + key = jsonKeys[ i ++ ]; + + } + + if ( key === undefined ) return; // no data + + var value = key[ valuePropertyName ]; + if ( value === undefined ) return; // no data + + if ( Array.isArray( value ) ) { + + do { + + value = key[ valuePropertyName ]; + + if ( value !== undefined ) { + + times.push( key.time ); + values.push.apply( values, value ); // push all elements + + } + + key = jsonKeys[ i ++ ]; + + } while ( key !== undefined ); + + } else if ( value.toArray !== undefined ) { + // ...assume THREE.Math-ish + + do { + + value = key[ valuePropertyName ]; + + if ( value !== undefined ) { + + times.push( key.time ); + value.toArray( values, values.length ); + + } + + key = jsonKeys[ i ++ ]; + + } while ( key !== undefined ); + + } else { + // otherwise push as-is + + do { + + value = key[ valuePropertyName ]; + + if ( value !== undefined ) { + + times.push( key.time ); + values.push( value ); + + } + + key = jsonKeys[ i ++ ]; + + } while ( key !== undefined ); + + } + + } + + }; + + /** + * Abstract base class of interpolants over parametric samples. + * + * The parameter domain is one dimensional, typically the time or a path + * along a curve defined by the data. + * + * The sample values can have any dimensionality and derived classes may + * apply special interpretations to the data. + * + * This class provides the interval seek in a Template Method, deferring + * the actual interpolation to derived classes. + * + * Time complexity is O(1) for linear access crossing at most two points + * and O(log N) for random access, where N is the number of positions. + * + * References: + * + * http://www.oodesign.com/template-method-pattern.html + * + * @author tschw + */ + + function Interpolant( + parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + this.parameterPositions = parameterPositions; + this._cachedIndex = 0; + + this.resultBuffer = resultBuffer !== undefined ? + resultBuffer : new sampleValues.constructor( sampleSize ); + this.sampleValues = sampleValues; + this.valueSize = sampleSize; + + } + + Interpolant.prototype = { + + constructor: Interpolant, + + evaluate: function( t ) { + + var pp = this.parameterPositions, + i1 = this._cachedIndex, + + t1 = pp[ i1 ], + t0 = pp[ i1 - 1 ]; + + validate_interval: { + + seek: { + + var right; + + linear_scan: { + //- See http://jsperf.com/comparison-to-undefined/3 + //- slower code: + //- + //- if ( t >= t1 || t1 === undefined ) { + forward_scan: if ( ! ( t < t1 ) ) { + + for ( var giveUpAt = i1 + 2; ;) { + + if ( t1 === undefined ) { + + if ( t < t0 ) break forward_scan; + + // after end + + i1 = pp.length; + this._cachedIndex = i1; + return this.afterEnd_( i1 - 1, t, t0 ); + + } + + if ( i1 === giveUpAt ) break; // this loop + + t0 = t1; + t1 = pp[ ++ i1 ]; + + if ( t < t1 ) { + + // we have arrived at the sought interval + break seek; + + } + + } + + // prepare binary search on the right side of the index + right = pp.length; + break linear_scan; + + } + + //- slower code: + //- if ( t < t0 || t0 === undefined ) { + if ( ! ( t >= t0 ) ) { + + // looping? + + var t1global = pp[ 1 ]; + + if ( t < t1global ) { + + i1 = 2; // + 1, using the scan for the details + t0 = t1global; + + } + + // linear reverse scan + + for ( var giveUpAt = i1 - 2; ;) { + + if ( t0 === undefined ) { + + // before start + + this._cachedIndex = 0; + return this.beforeStart_( 0, t, t1 ); + + } + + if ( i1 === giveUpAt ) break; // this loop + + t1 = t0; + t0 = pp[ -- i1 - 1 ]; + + if ( t >= t0 ) { + + // we have arrived at the sought interval + break seek; + + } + + } + + // prepare binary search on the left side of the index + right = i1; + i1 = 0; + break linear_scan; + + } + + // the interval is valid + + break validate_interval; + + } // linear scan + + // binary search + + while ( i1 < right ) { + + var mid = ( i1 + right ) >>> 1; + + if ( t < pp[ mid ] ) { + + right = mid; + + } else { + + i1 = mid + 1; + + } + + } + + t1 = pp[ i1 ]; + t0 = pp[ i1 - 1 ]; + + // check boundary cases, again + + if ( t0 === undefined ) { + + this._cachedIndex = 0; + return this.beforeStart_( 0, t, t1 ); + + } + + if ( t1 === undefined ) { + + i1 = pp.length; + this._cachedIndex = i1; + return this.afterEnd_( i1 - 1, t0, t ); + + } + + } // seek + + this._cachedIndex = i1; + + this.intervalChanged_( i1, t0, t1 ); + + } // validate_interval + + return this.interpolate_( i1, t0, t, t1 ); + + }, + + settings: null, // optional, subclass-specific settings structure + // Note: The indirection allows central control of many interpolants. + + // --- Protected interface + + DefaultSettings_: {}, + + getSettings_: function() { + + return this.settings || this.DefaultSettings_; + + }, + + copySampleValue_: function( index ) { + + // copies a sample value to the result buffer + + var result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + offset = index * stride; + + for ( var i = 0; i !== stride; ++ i ) { + + result[ i ] = values[ offset + i ]; + + } + + return result; + + }, + + // Template methods for derived classes: + + interpolate_: function( i1, t0, t, t1 ) { + + throw new Error( "call to abstract method" ); + // implementations shall return this.resultBuffer + + }, + + intervalChanged_: function( i1, t0, t1 ) { + + // empty + + } + + }; + + Object.assign( Interpolant.prototype, { + + beforeStart_: //( 0, t, t0 ), returns this.resultBuffer + Interpolant.prototype.copySampleValue_, + + afterEnd_: //( N-1, tN-1, t ), returns this.resultBuffer + Interpolant.prototype.copySampleValue_ + + } ); + + /** + * Fast and simple cubic spline interpolant. + * + * It was derived from a Hermitian construction setting the first derivative + * at each sample position to the linear slope between neighboring positions + * over their parameter interval. + * + * @author tschw + */ + + function CubicInterpolant( + parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + Interpolant.call( + this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + + this._weightPrev = -0; + this._offsetPrev = -0; + this._weightNext = -0; + this._offsetNext = -0; + + } + + CubicInterpolant.prototype = + Object.assign( Object.create( Interpolant.prototype ), { + + constructor: CubicInterpolant, + + DefaultSettings_: { + + endingStart: ZeroCurvatureEnding, + endingEnd: ZeroCurvatureEnding + + }, + + intervalChanged_: function( i1, t0, t1 ) { + + var pp = this.parameterPositions, + iPrev = i1 - 2, + iNext = i1 + 1, + + tPrev = pp[ iPrev ], + tNext = pp[ iNext ]; + + if ( tPrev === undefined ) { + + switch ( this.getSettings_().endingStart ) { + + case ZeroSlopeEnding: + + // f'(t0) = 0 + iPrev = i1; + tPrev = 2 * t0 - t1; + + break; + + case WrapAroundEnding: + + // use the other end of the curve + iPrev = pp.length - 2; + tPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ]; + + break; + + default: // ZeroCurvatureEnding + + // f''(t0) = 0 a.k.a. Natural Spline + iPrev = i1; + tPrev = t1; + + } + + } + + if ( tNext === undefined ) { + + switch ( this.getSettings_().endingEnd ) { + + case ZeroSlopeEnding: + + // f'(tN) = 0 + iNext = i1; + tNext = 2 * t1 - t0; + + break; + + case WrapAroundEnding: + + // use the other end of the curve + iNext = 1; + tNext = t1 + pp[ 1 ] - pp[ 0 ]; + + break; + + default: // ZeroCurvatureEnding + + // f''(tN) = 0, a.k.a. Natural Spline + iNext = i1 - 1; + tNext = t0; + + } + + } + + var halfDt = ( t1 - t0 ) * 0.5, + stride = this.valueSize; + + this._weightPrev = halfDt / ( t0 - tPrev ); + this._weightNext = halfDt / ( tNext - t1 ); + this._offsetPrev = iPrev * stride; + this._offsetNext = iNext * stride; + + }, + + interpolate_: function( i1, t0, t, t1 ) { + + var result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + + o1 = i1 * stride, o0 = o1 - stride, + oP = this._offsetPrev, oN = this._offsetNext, + wP = this._weightPrev, wN = this._weightNext, + + p = ( t - t0 ) / ( t1 - t0 ), + pp = p * p, + ppp = pp * p; + + // evaluate polynomials + + var sP = - wP * ppp + 2 * wP * pp - wP * p; + var s0 = ( 1 + wP ) * ppp + (-1.5 - 2 * wP ) * pp + ( -0.5 + wP ) * p + 1; + var s1 = (-1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p; + var sN = wN * ppp - wN * pp; + + // combine data linearly + + for ( var i = 0; i !== stride; ++ i ) { + + result[ i ] = + sP * values[ oP + i ] + + s0 * values[ o0 + i ] + + s1 * values[ o1 + i ] + + sN * values[ oN + i ]; + + } + + return result; + + } + + } ); + + /** + * @author tschw + */ + + function LinearInterpolant( + parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + Interpolant.call( + this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + LinearInterpolant.prototype = + Object.assign( Object.create( Interpolant.prototype ), { + + constructor: LinearInterpolant, + + interpolate_: function( i1, t0, t, t1 ) { + + var result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + + offset1 = i1 * stride, + offset0 = offset1 - stride, + + weight1 = ( t - t0 ) / ( t1 - t0 ), + weight0 = 1 - weight1; + + for ( var i = 0; i !== stride; ++ i ) { + + result[ i ] = + values[ offset0 + i ] * weight0 + + values[ offset1 + i ] * weight1; + + } + + return result; + + } + + } ); + + /** + * + * Interpolant that evaluates to the sample value at the position preceeding + * the parameter. + * + * @author tschw + */ + + function DiscreteInterpolant( + parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + Interpolant.call( + this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + DiscreteInterpolant.prototype = + Object.assign( Object.create( Interpolant.prototype ), { + + constructor: DiscreteInterpolant, + + interpolate_: function( i1, t0, t, t1 ) { + + return this.copySampleValue_( i1 - 1 ); + + } + + } ); + + var KeyframeTrackPrototype; + + KeyframeTrackPrototype = { + + TimeBufferType: Float32Array, + ValueBufferType: Float32Array, + + DefaultInterpolation: InterpolateLinear, + + InterpolantFactoryMethodDiscrete: function( result ) { + + return new DiscreteInterpolant( + this.times, this.values, this.getValueSize(), result ); + + }, + + InterpolantFactoryMethodLinear: function( result ) { + + return new LinearInterpolant( + this.times, this.values, this.getValueSize(), result ); + + }, + + InterpolantFactoryMethodSmooth: function( result ) { + + return new CubicInterpolant( + this.times, this.values, this.getValueSize(), result ); + + }, + + setInterpolation: function( interpolation ) { + + var factoryMethod; + + switch ( interpolation ) { + + case InterpolateDiscrete: + + factoryMethod = this.InterpolantFactoryMethodDiscrete; + + break; + + case InterpolateLinear: + + factoryMethod = this.InterpolantFactoryMethodLinear; + + break; + + case InterpolateSmooth: + + factoryMethod = this.InterpolantFactoryMethodSmooth; + + break; + + } + + if ( factoryMethod === undefined ) { + + var message = "unsupported interpolation for " + + this.ValueTypeName + " keyframe track named " + this.name; + + if ( this.createInterpolant === undefined ) { + + // fall back to default, unless the default itself is messed up + if ( interpolation !== this.DefaultInterpolation ) { + + this.setInterpolation( this.DefaultInterpolation ); + + } else { + + throw new Error( message ); // fatal, in this case + + } + + } + + console.warn( message ); + return; + + } + + this.createInterpolant = factoryMethod; + + }, + + getInterpolation: function() { + + switch ( this.createInterpolant ) { + + case this.InterpolantFactoryMethodDiscrete: + + return InterpolateDiscrete; + + case this.InterpolantFactoryMethodLinear: + + return InterpolateLinear; + + case this.InterpolantFactoryMethodSmooth: + + return InterpolateSmooth; + + } + + }, + + getValueSize: function() { + + return this.values.length / this.times.length; + + }, + + // move all keyframes either forwards or backwards in time + shift: function( timeOffset ) { + + if( timeOffset !== 0.0 ) { + + var times = this.times; + + for( var i = 0, n = times.length; i !== n; ++ i ) { + + times[ i ] += timeOffset; + + } + + } + + return this; + + }, + + // scale all keyframe times by a factor (useful for frame <-> seconds conversions) + scale: function( timeScale ) { + + if( timeScale !== 1.0 ) { + + var times = this.times; + + for( var i = 0, n = times.length; i !== n; ++ i ) { + + times[ i ] *= timeScale; + + } + + } + + return this; + + }, + + // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. + // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values + trim: function( startTime, endTime ) { + + var times = this.times, + nKeys = times.length, + from = 0, + to = nKeys - 1; + + while ( from !== nKeys && times[ from ] < startTime ) ++ from; + while ( to !== -1 && times[ to ] > endTime ) -- to; + + ++ to; // inclusive -> exclusive bound + + if( from !== 0 || to !== nKeys ) { + + // empty tracks are forbidden, so keep at least one keyframe + if ( from >= to ) to = Math.max( to , 1 ), from = to - 1; + + var stride = this.getValueSize(); + this.times = AnimationUtils.arraySlice( times, from, to ); + this.values = AnimationUtils. + arraySlice( this.values, from * stride, to * stride ); + + } + + return this; + + }, + + // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable + validate: function() { + + var valid = true; + + var valueSize = this.getValueSize(); + if ( valueSize - Math.floor( valueSize ) !== 0 ) { + + console.error( "invalid value size in track", this ); + valid = false; + + } + + var times = this.times, + values = this.values, + + nKeys = times.length; + + if( nKeys === 0 ) { + + console.error( "track is empty", this ); + valid = false; + + } + + var prevTime = null; + + for( var i = 0; i !== nKeys; i ++ ) { + + var currTime = times[ i ]; + + if ( typeof currTime === 'number' && isNaN( currTime ) ) { + + console.error( "time is not a valid number", this, i, currTime ); + valid = false; + break; + + } + + if( prevTime !== null && prevTime > currTime ) { + + console.error( "out of order keys", this, i, currTime, prevTime ); + valid = false; + break; + + } + + prevTime = currTime; + + } + + if ( values !== undefined ) { + + if ( AnimationUtils.isTypedArray( values ) ) { + + for ( var i = 0, n = values.length; i !== n; ++ i ) { + + var value = values[ i ]; + + if ( isNaN( value ) ) { + + console.error( "value is not a valid number", this, i, value ); + valid = false; + break; + + } + + } + + } + + } + + return valid; + + }, + + // removes equivalent sequential keys as common in morph target sequences + // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) + optimize: function() { + + var times = this.times, + values = this.values, + stride = this.getValueSize(), + + smoothInterpolation = this.getInterpolation() === InterpolateSmooth, + + writeIndex = 1, + lastIndex = times.length - 1; + + for( var i = 1; i < lastIndex; ++ i ) { + + var keep = false; + + var time = times[ i ]; + var timeNext = times[ i + 1 ]; + + // remove adjacent keyframes scheduled at the same time + + if ( time !== timeNext && ( i !== 1 || time !== time[ 0 ] ) ) { + + if ( ! smoothInterpolation ) { + + // remove unnecessary keyframes same as their neighbors + + var offset = i * stride, + offsetP = offset - stride, + offsetN = offset + stride; + + for ( var j = 0; j !== stride; ++ j ) { + + var value = values[ offset + j ]; + + if ( value !== values[ offsetP + j ] || + value !== values[ offsetN + j ] ) { + + keep = true; + break; + + } + + } + + } else keep = true; + + } + + // in-place compaction + + if ( keep ) { + + if ( i !== writeIndex ) { + + times[ writeIndex ] = times[ i ]; + + var readOffset = i * stride, + writeOffset = writeIndex * stride; + + for ( var j = 0; j !== stride; ++ j ) + + values[ writeOffset + j ] = values[ readOffset + j ]; + + } + + ++ writeIndex; + + } + + } + + // flush last keyframe (compaction looks ahead) + + if ( lastIndex > 0 ) { + + times[ writeIndex ] = times[ lastIndex ]; + + for ( var readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) + + values[ writeOffset + j ] = values[ readOffset + j ]; + + ++ writeIndex; + + } + + if ( writeIndex !== times.length ) { + + this.times = AnimationUtils.arraySlice( times, 0, writeIndex ); + this.values = AnimationUtils.arraySlice( values, 0, writeIndex * stride ); + + } + + return this; + + } + + }; + + function KeyframeTrackConstructor( name, times, values, interpolation ) { + + if( name === undefined ) throw new Error( "track name is undefined" ); + + if( times === undefined || times.length === 0 ) { + + throw new Error( "no keyframes in track named " + name ); + + } + + this.name = name; + + this.times = AnimationUtils.convertArray( times, this.TimeBufferType ); + this.values = AnimationUtils.convertArray( values, this.ValueBufferType ); + + this.setInterpolation( interpolation || this.DefaultInterpolation ); + + this.validate(); + this.optimize(); + + } + + /** + * + * A Track of vectored keyframe values. + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function VectorKeyframeTrack( name, times, values, interpolation ) { + + KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + + } + + VectorKeyframeTrack.prototype = + Object.assign( Object.create( KeyframeTrackPrototype ), { + + constructor: VectorKeyframeTrack, + + ValueTypeName: 'vector' + + // ValueBufferType is inherited + + // DefaultInterpolation is inherited + + } ); + + /** + * Spherical linear unit quaternion interpolant. + * + * @author tschw + */ + + function QuaternionLinearInterpolant( + parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + Interpolant.call( + this, parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + QuaternionLinearInterpolant.prototype = + Object.assign( Object.create( Interpolant.prototype ), { + + constructor: QuaternionLinearInterpolant, + + interpolate_: function( i1, t0, t, t1 ) { + + var result = this.resultBuffer, + values = this.sampleValues, + stride = this.valueSize, + + offset = i1 * stride, + + alpha = ( t - t0 ) / ( t1 - t0 ); + + for ( var end = offset + stride; offset !== end; offset += 4 ) { + + Quaternion.slerpFlat( result, 0, + values, offset - stride, values, offset, alpha ); + + } + + return result; + + } + + } ); + + /** + * + * A Track of quaternion keyframe values. + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function QuaternionKeyframeTrack( name, times, values, interpolation ) { + + KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + + } + + QuaternionKeyframeTrack.prototype = + Object.assign( Object.create( KeyframeTrackPrototype ), { + + constructor: QuaternionKeyframeTrack, + + ValueTypeName: 'quaternion', + + // ValueBufferType is inherited + + DefaultInterpolation: InterpolateLinear, + + InterpolantFactoryMethodLinear: function( result ) { + + return new QuaternionLinearInterpolant( + this.times, this.values, this.getValueSize(), result ); + + }, + + InterpolantFactoryMethodSmooth: undefined // not yet implemented + + } ); + + /** + * + * A Track of numeric keyframe values. + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function NumberKeyframeTrack( name, times, values, interpolation ) { + + KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + + } + + NumberKeyframeTrack.prototype = + Object.assign( Object.create( KeyframeTrackPrototype ), { + + constructor: NumberKeyframeTrack, + + ValueTypeName: 'number', + + // ValueBufferType is inherited + + // DefaultInterpolation is inherited + + } ); + + /** + * + * A Track that interpolates Strings + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function StringKeyframeTrack( name, times, values, interpolation ) { + + KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + + } + + StringKeyframeTrack.prototype = + Object.assign( Object.create( KeyframeTrackPrototype ), { + + constructor: StringKeyframeTrack, + + ValueTypeName: 'string', + ValueBufferType: Array, + + DefaultInterpolation: InterpolateDiscrete, + + InterpolantFactoryMethodLinear: undefined, + + InterpolantFactoryMethodSmooth: undefined + + } ); + + /** + * + * A Track of Boolean keyframe values. + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function BooleanKeyframeTrack( name, times, values ) { + + KeyframeTrackConstructor.call( this, name, times, values ); + + } + + BooleanKeyframeTrack.prototype = + Object.assign( Object.create( KeyframeTrackPrototype ), { + + constructor: BooleanKeyframeTrack, + + ValueTypeName: 'bool', + ValueBufferType: Array, + + DefaultInterpolation: InterpolateDiscrete, + + InterpolantFactoryMethodLinear: undefined, + InterpolantFactoryMethodSmooth: undefined + + // Note: Actually this track could have a optimized / compressed + // representation of a single value and a custom interpolant that + // computes "firstValue ^ isOdd( index )". + + } ); + + /** + * + * A Track of keyframe values that represent color. + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function ColorKeyframeTrack( name, times, values, interpolation ) { + + KeyframeTrackConstructor.call( this, name, times, values, interpolation ); + + } + + ColorKeyframeTrack.prototype = + Object.assign( Object.create( KeyframeTrackPrototype ), { + + constructor: ColorKeyframeTrack, + + ValueTypeName: 'color' + + // ValueBufferType is inherited + + // DefaultInterpolation is inherited + + + // Note: Very basic implementation and nothing special yet. + // However, this is the place for color space parameterization. + + } ); + + /** + * + * A timed sequence of keyframes for a specific property. + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function KeyframeTrack( name, times, values, interpolation ) { + + KeyframeTrackConstructor.apply( this, arguments ); + + } + + KeyframeTrack.prototype = KeyframeTrackPrototype; + KeyframeTrackPrototype.constructor = KeyframeTrack; + + // Static methods: + + Object.assign( KeyframeTrack, { + + // Serialization (in static context, because of constructor invocation + // and automatic invocation of .toJSON): + + parse: function( json ) { + + if( json.type === undefined ) { + + throw new Error( "track type undefined, can not parse" ); + + } + + var trackType = KeyframeTrack._getTrackTypeForValueTypeName( json.type ); + + if ( json.times === undefined ) { + + var times = [], values = []; + + AnimationUtils.flattenJSON( json.keys, times, values, 'value' ); + + json.times = times; + json.values = values; + + } + + // derived classes can define a static parse method + if ( trackType.parse !== undefined ) { + + return trackType.parse( json ); + + } else { + + // by default, we asssume a constructor compatible with the base + return new trackType( + json.name, json.times, json.values, json.interpolation ); + + } + + }, + + toJSON: function( track ) { + + var trackType = track.constructor; + + var json; + + // derived classes can define a static toJSON method + if ( trackType.toJSON !== undefined ) { + + json = trackType.toJSON( track ); + + } else { + + // by default, we assume the data can be serialized as-is + json = { + + 'name': track.name, + 'times': AnimationUtils.convertArray( track.times, Array ), + 'values': AnimationUtils.convertArray( track.values, Array ) + + }; + + var interpolation = track.getInterpolation(); + + if ( interpolation !== track.DefaultInterpolation ) { + + json.interpolation = interpolation; + + } + + } + + json.type = track.ValueTypeName; // mandatory + + return json; + + }, + + _getTrackTypeForValueTypeName: function( typeName ) { + + switch( typeName.toLowerCase() ) { + + case "scalar": + case "double": + case "float": + case "number": + case "integer": + + return NumberKeyframeTrack; + + case "vector": + case "vector2": + case "vector3": + case "vector4": + + return VectorKeyframeTrack; + + case "color": + + return ColorKeyframeTrack; + + case "quaternion": + + return QuaternionKeyframeTrack; + + case "bool": + case "boolean": + + return BooleanKeyframeTrack; + + case "string": + + return StringKeyframeTrack; + + } + + throw new Error( "Unsupported typeName: " + typeName ); + + } + + } ); + + /** + * + * Reusable set of Tracks that represent an animation. + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + */ + + function AnimationClip( name, duration, tracks ) { + + this.name = name; + this.tracks = tracks; + this.duration = ( duration !== undefined ) ? duration : -1; + + this.uuid = _Math.generateUUID(); + + // this means it should figure out its duration by scanning the tracks + if ( this.duration < 0 ) { + + this.resetDuration(); + + } + + this.optimize(); + + } + + AnimationClip.prototype = { + + constructor: AnimationClip, + + resetDuration: function() { + + var tracks = this.tracks, + duration = 0; + + for ( var i = 0, n = tracks.length; i !== n; ++ i ) { + + var track = this.tracks[ i ]; + + duration = Math.max( + duration, track.times[ track.times.length - 1 ] ); + + } + + this.duration = duration; + + }, + + trim: function() { + + for ( var i = 0; i < this.tracks.length; i ++ ) { + + this.tracks[ i ].trim( 0, this.duration ); + + } + + return this; + + }, + + optimize: function() { + + for ( var i = 0; i < this.tracks.length; i ++ ) { + + this.tracks[ i ].optimize(); + + } + + return this; + + } + + }; + + // Static methods: + + Object.assign( AnimationClip, { + + parse: function( json ) { + + var tracks = [], + jsonTracks = json.tracks, + frameTime = 1.0 / ( json.fps || 1.0 ); + + for ( var i = 0, n = jsonTracks.length; i !== n; ++ i ) { + + tracks.push( KeyframeTrack.parse( jsonTracks[ i ] ).scale( frameTime ) ); + + } + + return new AnimationClip( json.name, json.duration, tracks ); + + }, + + + toJSON: function( clip ) { + + var tracks = [], + clipTracks = clip.tracks; + + var json = { + + 'name': clip.name, + 'duration': clip.duration, + 'tracks': tracks + + }; + + for ( var i = 0, n = clipTracks.length; i !== n; ++ i ) { + + tracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) ); + + } + + return json; + + }, + + + CreateFromMorphTargetSequence: function( name, morphTargetSequence, fps, noLoop ) { + + var numMorphTargets = morphTargetSequence.length; + var tracks = []; + + for ( var i = 0; i < numMorphTargets; i ++ ) { + + var times = []; + var values = []; + + times.push( + ( i + numMorphTargets - 1 ) % numMorphTargets, + i, + ( i + 1 ) % numMorphTargets ); + + values.push( 0, 1, 0 ); + + var order = AnimationUtils.getKeyframeOrder( times ); + times = AnimationUtils.sortedArray( times, 1, order ); + values = AnimationUtils.sortedArray( values, 1, order ); + + // if there is a key at the first frame, duplicate it as the + // last frame as well for perfect loop. + if ( ! noLoop && times[ 0 ] === 0 ) { + + times.push( numMorphTargets ); + values.push( values[ 0 ] ); + + } + + tracks.push( + new NumberKeyframeTrack( + '.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']', + times, values + ).scale( 1.0 / fps ) ); + } + + return new AnimationClip( name, -1, tracks ); + + }, + + findByName: function( objectOrClipArray, name ) { + + var clipArray = objectOrClipArray; + + if ( ! Array.isArray( objectOrClipArray ) ) { + + var o = objectOrClipArray; + clipArray = o.geometry && o.geometry.animations || o.animations; + + } + + for ( var i = 0; i < clipArray.length; i ++ ) { + + if ( clipArray[ i ].name === name ) { + + return clipArray[ i ]; + + } + } + + return null; + + }, + + CreateClipsFromMorphTargetSequences: function( morphTargets, fps, noLoop ) { + + var animationToMorphTargets = {}; + + // tested with https://regex101.com/ on trick sequences + // such flamingo_flyA_003, flamingo_run1_003, crdeath0059 + var pattern = /^([\w-]*?)([\d]+)$/; + + // sort morph target names into animation groups based + // patterns like Walk_001, Walk_002, Run_001, Run_002 + for ( var i = 0, il = morphTargets.length; i < il; i ++ ) { + + var morphTarget = morphTargets[ i ]; + var parts = morphTarget.name.match( pattern ); + + if ( parts && parts.length > 1 ) { + + var name = parts[ 1 ]; + + var animationMorphTargets = animationToMorphTargets[ name ]; + if ( ! animationMorphTargets ) { + + animationToMorphTargets[ name ] = animationMorphTargets = []; + + } + + animationMorphTargets.push( morphTarget ); + + } + + } + + var clips = []; + + for ( var name in animationToMorphTargets ) { + + clips.push( AnimationClip.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) ); + + } + + return clips; + + }, + + // parse the animation.hierarchy format + parseAnimation: function( animation, bones ) { + + if ( ! animation ) { + + console.error( " no animation in JSONLoader data" ); + return null; + + } + + var addNonemptyTrack = function( + trackType, trackName, animationKeys, propertyName, destTracks ) { + + // only return track if there are actually keys. + if ( animationKeys.length !== 0 ) { + + var times = []; + var values = []; + + AnimationUtils.flattenJSON( + animationKeys, times, values, propertyName ); + + // empty keys are filtered out, so check again + if ( times.length !== 0 ) { + + destTracks.push( new trackType( trackName, times, values ) ); + + } + + } + + }; + + var tracks = []; + + var clipName = animation.name || 'default'; + // automatic length determination in AnimationClip. + var duration = animation.length || -1; + var fps = animation.fps || 30; + + var hierarchyTracks = animation.hierarchy || []; + + for ( var h = 0; h < hierarchyTracks.length; h ++ ) { + + var animationKeys = hierarchyTracks[ h ].keys; + + // skip empty tracks + if ( ! animationKeys || animationKeys.length === 0 ) continue; + + // process morph targets in a way exactly compatible + // with AnimationHandler.init( animation ) + if ( animationKeys[0].morphTargets ) { + + // figure out all morph targets used in this track + var morphTargetNames = {}; + for ( var k = 0; k < animationKeys.length; k ++ ) { + + if ( animationKeys[k].morphTargets ) { + + for ( var m = 0; m < animationKeys[k].morphTargets.length; m ++ ) { + + morphTargetNames[ animationKeys[k].morphTargets[m] ] = -1; + } + + } + + } + + // create a track for each morph target with all zero + // morphTargetInfluences except for the keys in which + // the morphTarget is named. + for ( var morphTargetName in morphTargetNames ) { + + var times = []; + var values = []; + + for ( var m = 0; + m !== animationKeys[k].morphTargets.length; ++ m ) { + + var animationKey = animationKeys[k]; + + times.push( animationKey.time ); + values.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 ); + + } + + tracks.push( new NumberKeyframeTrack( + '.morphTargetInfluence[' + morphTargetName + ']', times, values ) ); + + } + + duration = morphTargetNames.length * ( fps || 1.0 ); + + } else { + // ...assume skeletal animation + + var boneName = '.bones[' + bones[ h ].name + ']'; + + addNonemptyTrack( + VectorKeyframeTrack, boneName + '.position', + animationKeys, 'pos', tracks ); + + addNonemptyTrack( + QuaternionKeyframeTrack, boneName + '.quaternion', + animationKeys, 'rot', tracks ); + + addNonemptyTrack( + VectorKeyframeTrack, boneName + '.scale', + animationKeys, 'scl', tracks ); + + } + + } + + if ( tracks.length === 0 ) { + + return null; + + } + + var clip = new AnimationClip( clipName, duration, tracks ); + + return clip; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function MaterialLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + this.textures = {}; + + } + + Object.assign( MaterialLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var loader = new XHRLoader( scope.manager ); + loader.load( url, function ( text ) { + + onLoad( scope.parse( JSON.parse( text ) ) ); + + }, onProgress, onError ); + + }, + + setTextures: function ( value ) { + + this.textures = value; + + }, + + parse: function ( json ) { + + var textures = this.textures; + + function getTexture( name ) { + + if ( textures[ name ] === undefined ) { + + console.warn( 'THREE.MaterialLoader: Undefined texture', name ); + + } + + return textures[ name ]; + + } + + var material = new Materials[ json.type ](); + + if ( json.uuid !== undefined ) material.uuid = json.uuid; + if ( json.name !== undefined ) material.name = json.name; + if ( json.color !== undefined ) material.color.setHex( json.color ); + if ( json.roughness !== undefined ) material.roughness = json.roughness; + if ( json.metalness !== undefined ) material.metalness = json.metalness; + if ( json.emissive !== undefined ) material.emissive.setHex( json.emissive ); + if ( json.specular !== undefined ) material.specular.setHex( json.specular ); + if ( json.shininess !== undefined ) material.shininess = json.shininess; + if ( json.uniforms !== undefined ) material.uniforms = json.uniforms; + if ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader; + if ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader; + if ( json.vertexColors !== undefined ) material.vertexColors = json.vertexColors; + if ( json.fog !== undefined ) material.fog = json.fog; + if ( json.shading !== undefined ) material.shading = json.shading; + if ( json.blending !== undefined ) material.blending = json.blending; + if ( json.side !== undefined ) material.side = json.side; + if ( json.opacity !== undefined ) material.opacity = json.opacity; + if ( json.transparent !== undefined ) material.transparent = json.transparent; + if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; + if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; + if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; + if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; + if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; + if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; + if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap; + if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin; + if ( json.skinning !== undefined ) material.skinning = json.skinning; + if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets; + + // for PointsMaterial + + if ( json.size !== undefined ) material.size = json.size; + if ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation; + + // maps + + if ( json.map !== undefined ) material.map = getTexture( json.map ); + + if ( json.alphaMap !== undefined ) { + + material.alphaMap = getTexture( json.alphaMap ); + material.transparent = true; + + } + + if ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap ); + if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale; + + if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap ); + if ( json.normalScale !== undefined ) { + + var normalScale = json.normalScale; + + if ( Array.isArray( normalScale ) === false ) { + + // Blender exporter used to export a scalar. See #7459 + + normalScale = [ normalScale, normalScale ]; + + } + + material.normalScale = new Vector2().fromArray( normalScale ); + + } + + if ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap ); + if ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale; + if ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias; + + if ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap ); + if ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap ); + + if ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap ); + if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity; + + if ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap ); + + if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap ); + + if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity; + + if ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap ); + if ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity; + + if ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap ); + if ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity; + + // MultiMaterial + + if ( json.materials !== undefined ) { + + for ( var i = 0, l = json.materials.length; i < l; i ++ ) { + + material.materials.push( this.parse( json.materials[ i ] ) ); + + } + + } + + return material; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function BufferGeometryLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + } + + Object.assign( BufferGeometryLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var loader = new XHRLoader( scope.manager ); + loader.load( url, function ( text ) { + + onLoad( scope.parse( JSON.parse( text ) ) ); + + }, onProgress, onError ); + + }, + + parse: function ( json ) { + + var geometry = new BufferGeometry(); + + var index = json.data.index; + + var TYPED_ARRAYS = { + 'Int8Array': Int8Array, + 'Uint8Array': Uint8Array, + 'Uint8ClampedArray': Uint8ClampedArray, + 'Int16Array': Int16Array, + 'Uint16Array': Uint16Array, + 'Int32Array': Int32Array, + 'Uint32Array': Uint32Array, + 'Float32Array': Float32Array, + 'Float64Array': Float64Array + }; + + if ( index !== undefined ) { + + var typedArray = new TYPED_ARRAYS[ index.type ]( index.array ); + geometry.setIndex( new BufferAttribute( typedArray, 1 ) ); + + } + + var attributes = json.data.attributes; + + for ( var key in attributes ) { + + var attribute = attributes[ key ]; + var typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array ); + + geometry.addAttribute( key, new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized ) ); + + } + + var groups = json.data.groups || json.data.drawcalls || json.data.offsets; + + if ( groups !== undefined ) { + + for ( var i = 0, n = groups.length; i !== n; ++ i ) { + + var group = groups[ i ]; + + geometry.addGroup( group.start, group.count, group.materialIndex ); + + } + + } + + var boundingSphere = json.data.boundingSphere; + + if ( boundingSphere !== undefined ) { + + var center = new Vector3(); + + if ( boundingSphere.center !== undefined ) { + + center.fromArray( boundingSphere.center ); + + } + + geometry.boundingSphere = new Sphere( center, boundingSphere.radius ); + + } + + return geometry; + + } + + } ); + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function Loader() { + + this.onLoadStart = function () {}; + this.onLoadProgress = function () {}; + this.onLoadComplete = function () {}; + + } + + Loader.prototype = { + + constructor: Loader, + + crossOrigin: undefined, + + extractUrlBase: function ( url ) { + + var parts = url.split( '/' ); + + if ( parts.length === 1 ) return './'; + + parts.pop(); + + return parts.join( '/' ) + '/'; + + }, + + initMaterials: function ( materials, texturePath, crossOrigin ) { + + var array = []; + + for ( var i = 0; i < materials.length; ++ i ) { + + array[ i ] = this.createMaterial( materials[ i ], texturePath, crossOrigin ); + + } + + return array; + + }, + + createMaterial: ( function () { + + var color, textureLoader, materialLoader; + + return function createMaterial( m, texturePath, crossOrigin ) { + + if ( color === undefined ) color = new Color(); + if ( textureLoader === undefined ) textureLoader = new TextureLoader(); + if ( materialLoader === undefined ) materialLoader = new MaterialLoader(); + + // convert from old material format + + var textures = {}; + + function loadTexture( path, repeat, offset, wrap, anisotropy ) { + + var fullPath = texturePath + path; + var loader = Loader.Handlers.get( fullPath ); + + var texture; + + if ( loader !== null ) { + + texture = loader.load( fullPath ); + + } else { + + textureLoader.setCrossOrigin( crossOrigin ); + texture = textureLoader.load( fullPath ); + + } + + if ( repeat !== undefined ) { + + texture.repeat.fromArray( repeat ); + + if ( repeat[ 0 ] !== 1 ) texture.wrapS = RepeatWrapping; + if ( repeat[ 1 ] !== 1 ) texture.wrapT = RepeatWrapping; + + } + + if ( offset !== undefined ) { + + texture.offset.fromArray( offset ); + + } + + if ( wrap !== undefined ) { + + if ( wrap[ 0 ] === 'repeat' ) texture.wrapS = RepeatWrapping; + if ( wrap[ 0 ] === 'mirror' ) texture.wrapS = MirroredRepeatWrapping; + + if ( wrap[ 1 ] === 'repeat' ) texture.wrapT = RepeatWrapping; + if ( wrap[ 1 ] === 'mirror' ) texture.wrapT = MirroredRepeatWrapping; + + } + + if ( anisotropy !== undefined ) { + + texture.anisotropy = anisotropy; + + } + + var uuid = _Math.generateUUID(); + + textures[ uuid ] = texture; + + return uuid; + + } + + // + + var json = { + uuid: _Math.generateUUID(), + type: 'MeshLambertMaterial' + }; + + for ( var name in m ) { + + var value = m[ name ]; + + switch ( name ) { + case 'DbgColor': + case 'DbgIndex': + case 'opticalDensity': + case 'illumination': + break; + case 'DbgName': + json.name = value; + break; + case 'blending': + json.blending = BlendingMode[ value ]; + break; + case 'colorAmbient': + case 'mapAmbient': + console.warn( 'THREE.Loader.createMaterial:', name, 'is no longer supported.' ); + break; + case 'colorDiffuse': + json.color = color.fromArray( value ).getHex(); + break; + case 'colorSpecular': + json.specular = color.fromArray( value ).getHex(); + break; + case 'colorEmissive': + json.emissive = color.fromArray( value ).getHex(); + break; + case 'specularCoef': + json.shininess = value; + break; + case 'shading': + if ( value.toLowerCase() === 'basic' ) json.type = 'MeshBasicMaterial'; + if ( value.toLowerCase() === 'phong' ) json.type = 'MeshPhongMaterial'; + if ( value.toLowerCase() === 'standard' ) json.type = 'MeshStandardMaterial'; + break; + case 'mapDiffuse': + json.map = loadTexture( value, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy ); + break; + case 'mapDiffuseRepeat': + case 'mapDiffuseOffset': + case 'mapDiffuseWrap': + case 'mapDiffuseAnisotropy': + break; + case 'mapEmissive': + json.emissiveMap = loadTexture( value, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy ); + break; + case 'mapEmissiveRepeat': + case 'mapEmissiveOffset': + case 'mapEmissiveWrap': + case 'mapEmissiveAnisotropy': + break; + case 'mapLight': + json.lightMap = loadTexture( value, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy ); + break; + case 'mapLightRepeat': + case 'mapLightOffset': + case 'mapLightWrap': + case 'mapLightAnisotropy': + break; + case 'mapAO': + json.aoMap = loadTexture( value, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy ); + break; + case 'mapAORepeat': + case 'mapAOOffset': + case 'mapAOWrap': + case 'mapAOAnisotropy': + break; + case 'mapBump': + json.bumpMap = loadTexture( value, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy ); + break; + case 'mapBumpScale': + json.bumpScale = value; + break; + case 'mapBumpRepeat': + case 'mapBumpOffset': + case 'mapBumpWrap': + case 'mapBumpAnisotropy': + break; + case 'mapNormal': + json.normalMap = loadTexture( value, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy ); + break; + case 'mapNormalFactor': + json.normalScale = [ value, value ]; + break; + case 'mapNormalRepeat': + case 'mapNormalOffset': + case 'mapNormalWrap': + case 'mapNormalAnisotropy': + break; + case 'mapSpecular': + json.specularMap = loadTexture( value, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy ); + break; + case 'mapSpecularRepeat': + case 'mapSpecularOffset': + case 'mapSpecularWrap': + case 'mapSpecularAnisotropy': + break; + case 'mapMetalness': + json.metalnessMap = loadTexture( value, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy ); + break; + case 'mapMetalnessRepeat': + case 'mapMetalnessOffset': + case 'mapMetalnessWrap': + case 'mapMetalnessAnisotropy': + break; + case 'mapRoughness': + json.roughnessMap = loadTexture( value, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy ); + break; + case 'mapRoughnessRepeat': + case 'mapRoughnessOffset': + case 'mapRoughnessWrap': + case 'mapRoughnessAnisotropy': + break; + case 'mapAlpha': + json.alphaMap = loadTexture( value, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy ); + break; + case 'mapAlphaRepeat': + case 'mapAlphaOffset': + case 'mapAlphaWrap': + case 'mapAlphaAnisotropy': + break; + case 'flipSided': + json.side = BackSide; + break; + case 'doubleSided': + json.side = DoubleSide; + break; + case 'transparency': + console.warn( 'THREE.Loader.createMaterial: transparency has been renamed to opacity' ); + json.opacity = value; + break; + case 'depthTest': + case 'depthWrite': + case 'colorWrite': + case 'opacity': + case 'reflectivity': + case 'transparent': + case 'visible': + case 'wireframe': + json[ name ] = value; + break; + case 'vertexColors': + if ( value === true ) json.vertexColors = VertexColors; + if ( value === 'face' ) json.vertexColors = FaceColors; + break; + default: + console.error( 'THREE.Loader.createMaterial: Unsupported', name, value ); + break; + } + + } + + if ( json.type === 'MeshBasicMaterial' ) delete json.emissive; + if ( json.type !== 'MeshPhongMaterial' ) delete json.specular; + + if ( json.opacity < 1 ) json.transparent = true; + + materialLoader.setTextures( textures ); + + return materialLoader.parse( json ); + + }; + + } )() + + }; + + Loader.Handlers = { + + handlers: [], + + add: function ( regex, loader ) { + + this.handlers.push( regex, loader ); + + }, + + get: function ( file ) { + + var handlers = this.handlers; + + for ( var i = 0, l = handlers.length; i < l; i += 2 ) { + + var regex = handlers[ i ]; + var loader = handlers[ i + 1 ]; + + if ( regex.test( file ) ) { + + return loader; + + } + + } + + return null; + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function JSONLoader( manager ) { + + if ( typeof manager === 'boolean' ) { + + console.warn( 'THREE.JSONLoader: showStatus parameter has been removed from constructor.' ); + manager = undefined; + + } + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + this.withCredentials = false; + + } + + Object.assign( JSONLoader.prototype, { + + load: function( url, onLoad, onProgress, onError ) { + + var scope = this; + + var texturePath = this.texturePath && ( typeof this.texturePath === "string" ) ? this.texturePath : Loader.prototype.extractUrlBase( url ); + + var loader = new XHRLoader( this.manager ); + loader.setWithCredentials( this.withCredentials ); + loader.load( url, function ( text ) { + + var json = JSON.parse( text ); + var metadata = json.metadata; + + if ( metadata !== undefined ) { + + var type = metadata.type; + + if ( type !== undefined ) { + + if ( type.toLowerCase() === 'object' ) { + + console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.ObjectLoader instead.' ); + return; + + } + + if ( type.toLowerCase() === 'scene' ) { + + console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.SceneLoader instead.' ); + return; + + } + + } + + } + + var object = scope.parse( json, texturePath ); + onLoad( object.geometry, object.materials ); + + }, onProgress, onError ); + + }, + + setTexturePath: function ( value ) { + + this.texturePath = value; + + }, + + parse: function ( json, texturePath ) { + + var geometry = new Geometry(), + scale = ( json.scale !== undefined ) ? 1.0 / json.scale : 1.0; + + parseModel( scale ); + + parseSkin(); + parseMorphing( scale ); + parseAnimations(); + + geometry.computeFaceNormals(); + geometry.computeBoundingSphere(); + + function parseModel( scale ) { + + function isBitSet( value, position ) { + + return value & ( 1 << position ); + + } + + var i, j, fi, + + offset, zLength, + + colorIndex, normalIndex, uvIndex, materialIndex, + + type, + isQuad, + hasMaterial, + hasFaceVertexUv, + hasFaceNormal, hasFaceVertexNormal, + hasFaceColor, hasFaceVertexColor, + + vertex, face, faceA, faceB, hex, normal, + + uvLayer, uv, u, v, + + faces = json.faces, + vertices = json.vertices, + normals = json.normals, + colors = json.colors, + + nUvLayers = 0; + + if ( json.uvs !== undefined ) { + + // disregard empty arrays + + for ( i = 0; i < json.uvs.length; i ++ ) { + + if ( json.uvs[ i ].length ) nUvLayers ++; + + } + + for ( i = 0; i < nUvLayers; i ++ ) { + + geometry.faceVertexUvs[ i ] = []; + + } + + } + + offset = 0; + zLength = vertices.length; + + while ( offset < zLength ) { + + vertex = new Vector3(); + + vertex.x = vertices[ offset ++ ] * scale; + vertex.y = vertices[ offset ++ ] * scale; + vertex.z = vertices[ offset ++ ] * scale; + + geometry.vertices.push( vertex ); + + } + + offset = 0; + zLength = faces.length; + + while ( offset < zLength ) { + + type = faces[ offset ++ ]; + + + isQuad = isBitSet( type, 0 ); + hasMaterial = isBitSet( type, 1 ); + hasFaceVertexUv = isBitSet( type, 3 ); + hasFaceNormal = isBitSet( type, 4 ); + hasFaceVertexNormal = isBitSet( type, 5 ); + hasFaceColor = isBitSet( type, 6 ); + hasFaceVertexColor = isBitSet( type, 7 ); + + // console.log("type", type, "bits", isQuad, hasMaterial, hasFaceVertexUv, hasFaceNormal, hasFaceVertexNormal, hasFaceColor, hasFaceVertexColor); + + if ( isQuad ) { + + faceA = new Face3(); + faceA.a = faces[ offset ]; + faceA.b = faces[ offset + 1 ]; + faceA.c = faces[ offset + 3 ]; + + faceB = new Face3(); + faceB.a = faces[ offset + 1 ]; + faceB.b = faces[ offset + 2 ]; + faceB.c = faces[ offset + 3 ]; + + offset += 4; + + if ( hasMaterial ) { + + materialIndex = faces[ offset ++ ]; + faceA.materialIndex = materialIndex; + faceB.materialIndex = materialIndex; + + } + + // to get face <=> uv index correspondence + + fi = geometry.faces.length; + + if ( hasFaceVertexUv ) { + + for ( i = 0; i < nUvLayers; i ++ ) { + + uvLayer = json.uvs[ i ]; + + geometry.faceVertexUvs[ i ][ fi ] = []; + geometry.faceVertexUvs[ i ][ fi + 1 ] = []; + + for ( j = 0; j < 4; j ++ ) { + + uvIndex = faces[ offset ++ ]; + + u = uvLayer[ uvIndex * 2 ]; + v = uvLayer[ uvIndex * 2 + 1 ]; + + uv = new Vector2( u, v ); + + if ( j !== 2 ) geometry.faceVertexUvs[ i ][ fi ].push( uv ); + if ( j !== 0 ) geometry.faceVertexUvs[ i ][ fi + 1 ].push( uv ); + + } + + } + + } + + if ( hasFaceNormal ) { + + normalIndex = faces[ offset ++ ] * 3; + + faceA.normal.set( + normals[ normalIndex ++ ], + normals[ normalIndex ++ ], + normals[ normalIndex ] + ); + + faceB.normal.copy( faceA.normal ); + + } + + if ( hasFaceVertexNormal ) { + + for ( i = 0; i < 4; i ++ ) { + + normalIndex = faces[ offset ++ ] * 3; + + normal = new Vector3( + normals[ normalIndex ++ ], + normals[ normalIndex ++ ], + normals[ normalIndex ] + ); + + + if ( i !== 2 ) faceA.vertexNormals.push( normal ); + if ( i !== 0 ) faceB.vertexNormals.push( normal ); + + } + + } + + + if ( hasFaceColor ) { + + colorIndex = faces[ offset ++ ]; + hex = colors[ colorIndex ]; + + faceA.color.setHex( hex ); + faceB.color.setHex( hex ); + + } + + + if ( hasFaceVertexColor ) { + + for ( i = 0; i < 4; i ++ ) { + + colorIndex = faces[ offset ++ ]; + hex = colors[ colorIndex ]; + + if ( i !== 2 ) faceA.vertexColors.push( new Color( hex ) ); + if ( i !== 0 ) faceB.vertexColors.push( new Color( hex ) ); + + } + + } + + geometry.faces.push( faceA ); + geometry.faces.push( faceB ); + + } else { + + face = new Face3(); + face.a = faces[ offset ++ ]; + face.b = faces[ offset ++ ]; + face.c = faces[ offset ++ ]; + + if ( hasMaterial ) { + + materialIndex = faces[ offset ++ ]; + face.materialIndex = materialIndex; + + } + + // to get face <=> uv index correspondence + + fi = geometry.faces.length; + + if ( hasFaceVertexUv ) { + + for ( i = 0; i < nUvLayers; i ++ ) { + + uvLayer = json.uvs[ i ]; + + geometry.faceVertexUvs[ i ][ fi ] = []; + + for ( j = 0; j < 3; j ++ ) { + + uvIndex = faces[ offset ++ ]; + + u = uvLayer[ uvIndex * 2 ]; + v = uvLayer[ uvIndex * 2 + 1 ]; + + uv = new Vector2( u, v ); + + geometry.faceVertexUvs[ i ][ fi ].push( uv ); + + } + + } + + } + + if ( hasFaceNormal ) { + + normalIndex = faces[ offset ++ ] * 3; + + face.normal.set( + normals[ normalIndex ++ ], + normals[ normalIndex ++ ], + normals[ normalIndex ] + ); + + } + + if ( hasFaceVertexNormal ) { + + for ( i = 0; i < 3; i ++ ) { + + normalIndex = faces[ offset ++ ] * 3; + + normal = new Vector3( + normals[ normalIndex ++ ], + normals[ normalIndex ++ ], + normals[ normalIndex ] + ); + + face.vertexNormals.push( normal ); + + } + + } + + + if ( hasFaceColor ) { + + colorIndex = faces[ offset ++ ]; + face.color.setHex( colors[ colorIndex ] ); + + } + + + if ( hasFaceVertexColor ) { + + for ( i = 0; i < 3; i ++ ) { + + colorIndex = faces[ offset ++ ]; + face.vertexColors.push( new Color( colors[ colorIndex ] ) ); + + } + + } + + geometry.faces.push( face ); + + } + + } + + } + + function parseSkin() { + + var influencesPerVertex = ( json.influencesPerVertex !== undefined ) ? json.influencesPerVertex : 2; + + if ( json.skinWeights ) { + + for ( var i = 0, l = json.skinWeights.length; i < l; i += influencesPerVertex ) { + + var x = json.skinWeights[ i ]; + var y = ( influencesPerVertex > 1 ) ? json.skinWeights[ i + 1 ] : 0; + var z = ( influencesPerVertex > 2 ) ? json.skinWeights[ i + 2 ] : 0; + var w = ( influencesPerVertex > 3 ) ? json.skinWeights[ i + 3 ] : 0; + + geometry.skinWeights.push( new Vector4( x, y, z, w ) ); + + } + + } + + if ( json.skinIndices ) { + + for ( var i = 0, l = json.skinIndices.length; i < l; i += influencesPerVertex ) { + + var a = json.skinIndices[ i ]; + var b = ( influencesPerVertex > 1 ) ? json.skinIndices[ i + 1 ] : 0; + var c = ( influencesPerVertex > 2 ) ? json.skinIndices[ i + 2 ] : 0; + var d = ( influencesPerVertex > 3 ) ? json.skinIndices[ i + 3 ] : 0; + + geometry.skinIndices.push( new Vector4( a, b, c, d ) ); + + } + + } + + geometry.bones = json.bones; + + if ( geometry.bones && geometry.bones.length > 0 && ( geometry.skinWeights.length !== geometry.skinIndices.length || geometry.skinIndices.length !== geometry.vertices.length ) ) { + + console.warn( 'When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' + + geometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.' ); + + } + + } + + function parseMorphing( scale ) { + + if ( json.morphTargets !== undefined ) { + + for ( var i = 0, l = json.morphTargets.length; i < l; i ++ ) { + + geometry.morphTargets[ i ] = {}; + geometry.morphTargets[ i ].name = json.morphTargets[ i ].name; + geometry.morphTargets[ i ].vertices = []; + + var dstVertices = geometry.morphTargets[ i ].vertices; + var srcVertices = json.morphTargets[ i ].vertices; + + for ( var v = 0, vl = srcVertices.length; v < vl; v += 3 ) { + + var vertex = new Vector3(); + vertex.x = srcVertices[ v ] * scale; + vertex.y = srcVertices[ v + 1 ] * scale; + vertex.z = srcVertices[ v + 2 ] * scale; + + dstVertices.push( vertex ); + + } + + } + + } + + if ( json.morphColors !== undefined && json.morphColors.length > 0 ) { + + console.warn( 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.' ); + + var faces = geometry.faces; + var morphColors = json.morphColors[ 0 ].colors; + + for ( var i = 0, l = faces.length; i < l; i ++ ) { + + faces[ i ].color.fromArray( morphColors, i * 3 ); + + } + + } + + } + + function parseAnimations() { + + var outputAnimations = []; + + // parse old style Bone/Hierarchy animations + var animations = []; + + if ( json.animation !== undefined ) { + + animations.push( json.animation ); + + } + + if ( json.animations !== undefined ) { + + if ( json.animations.length ) { + + animations = animations.concat( json.animations ); + + } else { + + animations.push( json.animations ); + + } + + } + + for ( var i = 0; i < animations.length; i ++ ) { + + var clip = AnimationClip.parseAnimation( animations[ i ], geometry.bones ); + if ( clip ) outputAnimations.push( clip ); + + } + + // parse implicit morph animations + if ( geometry.morphTargets ) { + + // TODO: Figure out what an appropraite FPS is for morph target animations -- defaulting to 10, but really it is completely arbitrary. + var morphAnimationClips = AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 ); + outputAnimations = outputAnimations.concat( morphAnimationClips ); + + } + + if ( outputAnimations.length > 0 ) geometry.animations = outputAnimations; + + } + + if ( json.materials === undefined || json.materials.length === 0 ) { + + return { geometry: geometry }; + + } else { + + var materials = Loader.prototype.initMaterials( json.materials, texturePath, this.crossOrigin ); + + return { geometry: geometry, materials: materials }; + + } + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function ObjectLoader ( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + this.texturePath = ''; + + } + + Object.assign( ObjectLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + if ( this.texturePath === '' ) { + + this.texturePath = url.substring( 0, url.lastIndexOf( '/' ) + 1 ); + + } + + var scope = this; + + var loader = new XHRLoader( scope.manager ); + loader.load( url, function ( text ) { + + scope.parse( JSON.parse( text ), onLoad ); + + }, onProgress, onError ); + + }, + + setTexturePath: function ( value ) { + + this.texturePath = value; + + }, + + setCrossOrigin: function ( value ) { + + this.crossOrigin = value; + + }, + + parse: function ( json, onLoad ) { + + var geometries = this.parseGeometries( json.geometries ); + + var images = this.parseImages( json.images, function () { + + if ( onLoad !== undefined ) onLoad( object ); + + } ); + + var textures = this.parseTextures( json.textures, images ); + var materials = this.parseMaterials( json.materials, textures ); + + var object = this.parseObject( json.object, geometries, materials ); + + if ( json.animations ) { + + object.animations = this.parseAnimations( json.animations ); + + } + + if ( json.images === undefined || json.images.length === 0 ) { + + if ( onLoad !== undefined ) onLoad( object ); + + } + + return object; + + }, + + parseGeometries: function ( json ) { + + var geometries = {}; + + if ( json !== undefined ) { + + var geometryLoader = new JSONLoader(); + var bufferGeometryLoader = new BufferGeometryLoader(); + + for ( var i = 0, l = json.length; i < l; i ++ ) { + + var geometry; + var data = json[ i ]; + + switch ( data.type ) { + + case 'PlaneGeometry': + case 'PlaneBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.width, + data.height, + data.widthSegments, + data.heightSegments + ); + + break; + + case 'BoxGeometry': + case 'BoxBufferGeometry': + case 'CubeGeometry': // backwards compatible + + geometry = new Geometries[ data.type ]( + data.width, + data.height, + data.depth, + data.widthSegments, + data.heightSegments, + data.depthSegments + ); + + break; + + case 'CircleGeometry': + case 'CircleBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.radius, + data.segments, + data.thetaStart, + data.thetaLength + ); + + break; + + case 'CylinderGeometry': + case 'CylinderBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.radiusTop, + data.radiusBottom, + data.height, + data.radialSegments, + data.heightSegments, + data.openEnded, + data.thetaStart, + data.thetaLength + ); + + break; + + case 'ConeGeometry': + case 'ConeBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.radius, + data.height, + data.radialSegments, + data.heightSegments, + data.openEnded, + data.thetaStart, + data.thetaLength + ); + + break; + + case 'SphereGeometry': + case 'SphereBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.radius, + data.widthSegments, + data.heightSegments, + data.phiStart, + data.phiLength, + data.thetaStart, + data.thetaLength + ); + + break; + + case 'DodecahedronGeometry': + case 'IcosahedronGeometry': + case 'OctahedronGeometry': + case 'TetrahedronGeometry': + + geometry = new Geometries[ data.type ]( + data.radius, + data.detail + ); + + break; + + case 'RingGeometry': + case 'RingBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.innerRadius, + data.outerRadius, + data.thetaSegments, + data.phiSegments, + data.thetaStart, + data.thetaLength + ); + + break; + + case 'TorusGeometry': + case 'TorusBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.radius, + data.tube, + data.radialSegments, + data.tubularSegments, + data.arc + ); + + break; + + case 'TorusKnotGeometry': + case 'TorusKnotBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.radius, + data.tube, + data.tubularSegments, + data.radialSegments, + data.p, + data.q + ); + + break; + + case 'LatheGeometry': + case 'LatheBufferGeometry': + + geometry = new Geometries[ data.type ]( + data.points, + data.segments, + data.phiStart, + data.phiLength + ); + + break; + + case 'BufferGeometry': + + geometry = bufferGeometryLoader.parse( data ); + + break; + + case 'Geometry': + + geometry = geometryLoader.parse( data.data, this.texturePath ).geometry; + + break; + + default: + + console.warn( 'THREE.ObjectLoader: Unsupported geometry type "' + data.type + '"' ); + + continue; + + } + + geometry.uuid = data.uuid; + + if ( data.name !== undefined ) geometry.name = data.name; + + geometries[ data.uuid ] = geometry; + + } + + } + + return geometries; + + }, + + parseMaterials: function ( json, textures ) { + + var materials = {}; + + if ( json !== undefined ) { + + var loader = new MaterialLoader(); + loader.setTextures( textures ); + + for ( var i = 0, l = json.length; i < l; i ++ ) { + + var material = loader.parse( json[ i ] ); + materials[ material.uuid ] = material; + + } + + } + + return materials; + + }, + + parseAnimations: function ( json ) { + + var animations = []; + + for ( var i = 0; i < json.length; i ++ ) { + + var clip = AnimationClip.parse( json[ i ] ); + + animations.push( clip ); + + } + + return animations; + + }, + + parseImages: function ( json, onLoad ) { + + var scope = this; + var images = {}; + + function loadImage( url ) { + + scope.manager.itemStart( url ); + + return loader.load( url, function () { + + scope.manager.itemEnd( url ); + + }, undefined, function () { + + scope.manager.itemError( url ); + + } ); + + } + + if ( json !== undefined && json.length > 0 ) { + + var manager = new LoadingManager( onLoad ); + + var loader = new ImageLoader( manager ); + loader.setCrossOrigin( this.crossOrigin ); + + for ( var i = 0, l = json.length; i < l; i ++ ) { + + var image = json[ i ]; + var path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( image.url ) ? image.url : scope.texturePath + image.url; + + images[ image.uuid ] = loadImage( path ); + + } + + } + + return images; + + }, + + parseTextures: function ( json, images ) { + + function parseConstant( value, type ) { + + if ( typeof( value ) === 'number' ) return value; + + console.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value ); + + return type[ value ]; + + } + + var textures = {}; + + if ( json !== undefined ) { + + for ( var i = 0, l = json.length; i < l; i ++ ) { + + var data = json[ i ]; + + if ( data.image === undefined ) { + + console.warn( 'THREE.ObjectLoader: No "image" specified for', data.uuid ); + + } + + if ( images[ data.image ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined image', data.image ); + + } + + var texture = new Texture( images[ data.image ] ); + texture.needsUpdate = true; + + texture.uuid = data.uuid; + + if ( data.name !== undefined ) texture.name = data.name; + + if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TextureMapping ); + + if ( data.offset !== undefined ) texture.offset.fromArray( data.offset ); + if ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat ); + if ( data.wrap !== undefined ) { + + texture.wrapS = parseConstant( data.wrap[ 0 ], TextureWrapping ); + texture.wrapT = parseConstant( data.wrap[ 1 ], TextureWrapping ); + + } + + if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TextureFilter ); + if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TextureFilter ); + if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy; + + if ( data.flipY !== undefined ) texture.flipY = data.flipY; + + textures[ data.uuid ] = texture; + + } + + } + + return textures; + + }, + + parseObject: function () { + + var matrix = new Matrix4(); + + return function parseObject( data, geometries, materials ) { + + var object; + + function getGeometry( name ) { + + if ( geometries[ name ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined geometry', name ); + + } + + return geometries[ name ]; + + } + + function getMaterial( name ) { + + if ( name === undefined ) return undefined; + + if ( materials[ name ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined material', name ); + + } + + return materials[ name ]; + + } + + switch ( data.type ) { + + case 'Scene': + + object = new Scene(); + + if ( data.background !== undefined ) { + + if ( Number.isInteger( data.background ) ) { + + object.background = new Color( data.background ); + + } + + } + + if ( data.fog !== undefined ) { + + if ( data.fog.type === 'Fog' ) { + + object.fog = new Fog( data.fog.color, data.fog.near, data.fog.far ); + + } else if ( data.fog.type === 'FogExp2' ) { + + object.fog = new FogExp2( data.fog.color, data.fog.density ); + + } + + } + + break; + + case 'PerspectiveCamera': + + object = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far ); + + if ( data.focus !== undefined ) object.focus = data.focus; + if ( data.zoom !== undefined ) object.zoom = data.zoom; + if ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge; + if ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset; + if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); + + break; + + case 'OrthographicCamera': + + object = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far ); + + break; + + case 'AmbientLight': + + object = new AmbientLight( data.color, data.intensity ); + + break; + + case 'DirectionalLight': + + object = new DirectionalLight( data.color, data.intensity ); + + break; + + case 'PointLight': + + object = new PointLight( data.color, data.intensity, data.distance, data.decay ); + + break; + + case 'SpotLight': + + object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay ); + + break; + + case 'HemisphereLight': + + object = new HemisphereLight( data.color, data.groundColor, data.intensity ); + + break; + + case 'Mesh': + + var geometry = getGeometry( data.geometry ); + var material = getMaterial( data.material ); + + if ( geometry.bones && geometry.bones.length > 0 ) { + + object = new SkinnedMesh( geometry, material ); + + } else { + + object = new Mesh( geometry, material ); + + } + + break; + + case 'LOD': + + object = new LOD(); + + break; + + case 'Line': + + object = new Line( getGeometry( data.geometry ), getMaterial( data.material ), data.mode ); + + break; + + case 'LineSegments': + + object = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'PointCloud': + case 'Points': + + object = new Points( getGeometry( data.geometry ), getMaterial( data.material ) ); + + break; + + case 'Sprite': + + object = new Sprite( getMaterial( data.material ) ); + + break; + + case 'Group': + + object = new Group(); + + break; + + default: + + object = new Object3D(); + + } + + object.uuid = data.uuid; + + if ( data.name !== undefined ) object.name = data.name; + if ( data.matrix !== undefined ) { + + matrix.fromArray( data.matrix ); + matrix.decompose( object.position, object.quaternion, object.scale ); + + } else { + + if ( data.position !== undefined ) object.position.fromArray( data.position ); + if ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation ); + if ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion ); + if ( data.scale !== undefined ) object.scale.fromArray( data.scale ); + + } + + if ( data.castShadow !== undefined ) object.castShadow = data.castShadow; + if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow; + + if ( data.shadow ) { + + if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias; + if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius; + if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize ); + if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera ); + + } + + if ( data.visible !== undefined ) object.visible = data.visible; + if ( data.userData !== undefined ) object.userData = data.userData; + + if ( data.children !== undefined ) { + + for ( var child in data.children ) { + + object.add( this.parseObject( data.children[ child ], geometries, materials ) ); + + } + + } + + if ( data.type === 'LOD' ) { + + var levels = data.levels; + + for ( var l = 0; l < levels.length; l ++ ) { + + var level = levels[ l ]; + var child = object.getObjectByProperty( 'uuid', level.object ); + + if ( child !== undefined ) { + + object.addLevel( child, level.distance ); + + } + + } + + } + + return object; + + }; + + }() + + } ); + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + * Extensible curve object + * + * Some common of Curve methods + * .getPoint(t), getTangent(t) + * .getPointAt(u), getTangentAt(u) + * .getPoints(), .getSpacedPoints() + * .getLength() + * .updateArcLengths() + * + * This following classes subclasses THREE.Curve: + * + * -- 2d classes -- + * THREE.LineCurve + * THREE.QuadraticBezierCurve + * THREE.CubicBezierCurve + * THREE.SplineCurve + * THREE.ArcCurve + * THREE.EllipseCurve + * + * -- 3d classes -- + * THREE.LineCurve3 + * THREE.QuadraticBezierCurve3 + * THREE.CubicBezierCurve3 + * THREE.SplineCurve3 + * + * A series of curves can be represented as a THREE.CurvePath + * + **/ + + /************************************************************** + * Abstract Curve base class + **************************************************************/ + + function Curve() {} + + Curve.prototype = { + + constructor: Curve, + + // Virtual base class method to overwrite and implement in subclasses + // - t [0 .. 1] + + getPoint: function ( t ) { + + console.warn( "THREE.Curve: Warning, getPoint() not implemented!" ); + return null; + + }, + + // Get point at relative position in curve according to arc length + // - u [0 .. 1] + + getPointAt: function ( u ) { + + var t = this.getUtoTmapping( u ); + return this.getPoint( t ); + + }, + + // Get sequence of points using getPoint( t ) + + getPoints: function ( divisions ) { + + if ( ! divisions ) divisions = 5; + + var points = []; + + for ( var d = 0; d <= divisions; d ++ ) { + + points.push( this.getPoint( d / divisions ) ); + + } + + return points; + + }, + + // Get sequence of points using getPointAt( u ) + + getSpacedPoints: function ( divisions ) { + + if ( ! divisions ) divisions = 5; + + var points = []; + + for ( var d = 0; d <= divisions; d ++ ) { + + points.push( this.getPointAt( d / divisions ) ); + + } + + return points; + + }, + + // Get total curve arc length + + getLength: function () { + + var lengths = this.getLengths(); + return lengths[ lengths.length - 1 ]; + + }, + + // Get list of cumulative segment lengths + + getLengths: function ( divisions ) { + + if ( ! divisions ) divisions = ( this.__arcLengthDivisions ) ? ( this.__arcLengthDivisions ) : 200; + + if ( this.cacheArcLengths + && ( this.cacheArcLengths.length === divisions + 1 ) + && ! this.needsUpdate ) { + + //console.log( "cached", this.cacheArcLengths ); + return this.cacheArcLengths; + + } + + this.needsUpdate = false; + + var cache = []; + var current, last = this.getPoint( 0 ); + var p, sum = 0; + + cache.push( 0 ); + + for ( p = 1; p <= divisions; p ++ ) { + + current = this.getPoint ( p / divisions ); + sum += current.distanceTo( last ); + cache.push( sum ); + last = current; + + } + + this.cacheArcLengths = cache; + + return cache; // { sums: cache, sum:sum }; Sum is in the last element. + + }, + + updateArcLengths: function() { + + this.needsUpdate = true; + this.getLengths(); + + }, + + // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant + + getUtoTmapping: function ( u, distance ) { + + var arcLengths = this.getLengths(); + + var i = 0, il = arcLengths.length; + + var targetArcLength; // The targeted u distance value to get + + if ( distance ) { + + targetArcLength = distance; + + } else { + + targetArcLength = u * arcLengths[ il - 1 ]; + + } + + //var time = Date.now(); + + // binary search for the index with largest value smaller than target u distance + + var low = 0, high = il - 1, comparison; + + while ( low <= high ) { + + i = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats + + comparison = arcLengths[ i ] - targetArcLength; + + if ( comparison < 0 ) { + + low = i + 1; + + } else if ( comparison > 0 ) { + + high = i - 1; + + } else { + + high = i; + break; + + // DONE + + } + + } + + i = high; + + //console.log('b' , i, low, high, Date.now()- time); + + if ( arcLengths[ i ] === targetArcLength ) { + + var t = i / ( il - 1 ); + return t; + + } + + // we could get finer grain at lengths, or use simple interpolation between two points + + var lengthBefore = arcLengths[ i ]; + var lengthAfter = arcLengths[ i + 1 ]; + + var segmentLength = lengthAfter - lengthBefore; + + // determine where we are between the 'before' and 'after' points + + var segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength; + + // add that fractional amount to t + + var t = ( i + segmentFraction ) / ( il - 1 ); + + return t; + + }, + + // Returns a unit vector tangent at t + // In case any sub curve does not implement its tangent derivation, + // 2 points a small delta apart will be used to find its gradient + // which seems to give a reasonable approximation + + getTangent: function( t ) { + + var delta = 0.0001; + var t1 = t - delta; + var t2 = t + delta; + + // Capping in case of danger + + if ( t1 < 0 ) t1 = 0; + if ( t2 > 1 ) t2 = 1; + + var pt1 = this.getPoint( t1 ); + var pt2 = this.getPoint( t2 ); + + var vec = pt2.clone().sub( pt1 ); + return vec.normalize(); + + }, + + getTangentAt: function ( u ) { + + var t = this.getUtoTmapping( u ); + return this.getTangent( t ); + + }, + + computeFrenetFrames: function ( segments, closed ) { + + // see http://www.cs.indiana.edu/pub/techreports/TR425.pdf + + var normal = new Vector3(); + + var tangents = []; + var normals = []; + var binormals = []; + + var vec = new Vector3(); + var mat = new Matrix4(); + + var i, u, theta; + + // compute the tangent vectors for each segment on the curve + + for ( i = 0; i <= segments; i ++ ) { + + u = i / segments; + + tangents[ i ] = this.getTangentAt( u ); + tangents[ i ].normalize(); + + } + + // select an initial normal vector perpendicular to the first tangent vector, + // and in the direction of the minimum tangent xyz component + + normals[ 0 ] = new Vector3(); + binormals[ 0 ] = new Vector3(); + var min = Number.MAX_VALUE; + var tx = Math.abs( tangents[ 0 ].x ); + var ty = Math.abs( tangents[ 0 ].y ); + var tz = Math.abs( tangents[ 0 ].z ); + + if ( tx <= min ) { + + min = tx; + normal.set( 1, 0, 0 ); + + } + + if ( ty <= min ) { + + min = ty; + normal.set( 0, 1, 0 ); + + } + + if ( tz <= min ) { + + normal.set( 0, 0, 1 ); + + } + + vec.crossVectors( tangents[ 0 ], normal ).normalize(); + + normals[ 0 ].crossVectors( tangents[ 0 ], vec ); + binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] ); + + + // compute the slowly-varying normal and binormal vectors for each segment on the curve + + for ( i = 1; i <= segments; i ++ ) { + + normals[ i ] = normals[ i - 1 ].clone(); + + binormals[ i ] = binormals[ i - 1 ].clone(); + + vec.crossVectors( tangents[ i - 1 ], tangents[ i ] ); + + if ( vec.length() > Number.EPSILON ) { + + vec.normalize(); + + theta = Math.acos( _Math.clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors + + normals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) ); + + } + + binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); + + } + + // if the curve is closed, postprocess the vectors so the first and last normal vectors are the same + + if ( closed === true ) { + + theta = Math.acos( _Math.clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) ); + theta /= segments; + + if ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) { + + theta = - theta; + + } + + for ( i = 1; i <= segments; i ++ ) { + + // twist a little... + normals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) ); + binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); + + } + + } + + return { + tangents: tangents, + normals: normals, + binormals: binormals + }; + + } + + }; + + // TODO: Transformation for Curves? + + /************************************************************** + * 3D Curves + **************************************************************/ + + // A Factory method for creating new curve subclasses + + Curve.create = function ( constructor, getPointFunc ) { + + constructor.prototype = Object.create( Curve.prototype ); + constructor.prototype.constructor = constructor; + constructor.prototype.getPoint = getPointFunc; + + return constructor; + + }; + + /************************************************************** + * Line + **************************************************************/ + + function LineCurve( v1, v2 ) { + + this.v1 = v1; + this.v2 = v2; + + } + + LineCurve.prototype = Object.create( Curve.prototype ); + LineCurve.prototype.constructor = LineCurve; + + LineCurve.prototype.isLineCurve = true; + + LineCurve.prototype.getPoint = function ( t ) { + + if ( t === 1 ) { + + return this.v2.clone(); + + } + + var point = this.v2.clone().sub( this.v1 ); + point.multiplyScalar( t ).add( this.v1 ); + + return point; + + }; + + // Line curve is linear, so we can overwrite default getPointAt + + LineCurve.prototype.getPointAt = function ( u ) { + + return this.getPoint( u ); + + }; + + LineCurve.prototype.getTangent = function( t ) { + + var tangent = this.v2.clone().sub( this.v1 ); + + return tangent.normalize(); + + }; + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + * + **/ + + /************************************************************** + * Curved Path - a curve path is simply a array of connected + * curves, but retains the api of a curve + **************************************************************/ + + function CurvePath() { + + this.curves = []; + + this.autoClose = false; // Automatically closes the path + + } + + CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), { + + constructor: CurvePath, + + add: function ( curve ) { + + this.curves.push( curve ); + + }, + + closePath: function () { + + // Add a line curve if start and end of lines are not connected + var startPoint = this.curves[ 0 ].getPoint( 0 ); + var endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 ); + + if ( ! startPoint.equals( endPoint ) ) { + + this.curves.push( new LineCurve( endPoint, startPoint ) ); + + } + + }, + + // To get accurate point with reference to + // entire path distance at time t, + // following has to be done: + + // 1. Length of each sub path have to be known + // 2. Locate and identify type of curve + // 3. Get t for the curve + // 4. Return curve.getPointAt(t') + + getPoint: function ( t ) { + + var d = t * this.getLength(); + var curveLengths = this.getCurveLengths(); + var i = 0; + + // To think about boundaries points. + + while ( i < curveLengths.length ) { + + if ( curveLengths[ i ] >= d ) { + + var diff = curveLengths[ i ] - d; + var curve = this.curves[ i ]; + + var segmentLength = curve.getLength(); + var u = segmentLength === 0 ? 0 : 1 - diff / segmentLength; + + return curve.getPointAt( u ); + + } + + i ++; + + } + + return null; + + // loop where sum != 0, sum > d , sum+1 1 && !points[ points.length - 1 ].equals( points[ 0 ] ) ) { + + points.push( points[ 0 ] ); + + } + + return points; + + }, + + /************************************************************** + * Create Geometries Helpers + **************************************************************/ + + /// Generate geometry from path points (for Line or Points objects) + + createPointsGeometry: function ( divisions ) { + + var pts = this.getPoints( divisions ); + return this.createGeometry( pts ); + + }, + + // Generate geometry from equidistant sampling along the path + + createSpacedPointsGeometry: function ( divisions ) { + + var pts = this.getSpacedPoints( divisions ); + return this.createGeometry( pts ); + + }, + + createGeometry: function ( points ) { + + var geometry = new Geometry(); + + for ( var i = 0, l = points.length; i < l; i ++ ) { + + var point = points[ i ]; + geometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) ); + + } + + return geometry; + + } + + } ); + + /************************************************************** + * Ellipse curve + **************************************************************/ + + function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + + this.aX = aX; + this.aY = aY; + + this.xRadius = xRadius; + this.yRadius = yRadius; + + this.aStartAngle = aStartAngle; + this.aEndAngle = aEndAngle; + + this.aClockwise = aClockwise; + + this.aRotation = aRotation || 0; + + } + + EllipseCurve.prototype = Object.create( Curve.prototype ); + EllipseCurve.prototype.constructor = EllipseCurve; + + EllipseCurve.prototype.isEllipseCurve = true; + + EllipseCurve.prototype.getPoint = function( t ) { + + var twoPi = Math.PI * 2; + var deltaAngle = this.aEndAngle - this.aStartAngle; + var samePoints = Math.abs( deltaAngle ) < Number.EPSILON; + + // ensures that deltaAngle is 0 .. 2 PI + while ( deltaAngle < 0 ) deltaAngle += twoPi; + while ( deltaAngle > twoPi ) deltaAngle -= twoPi; + + if ( deltaAngle < Number.EPSILON ) { + + if ( samePoints ) { + + deltaAngle = 0; + + } else { + + deltaAngle = twoPi; + + } + + } + + if ( this.aClockwise === true && ! samePoints ) { + + if ( deltaAngle === twoPi ) { + + deltaAngle = - twoPi; + + } else { + + deltaAngle = deltaAngle - twoPi; + + } + + } + + var angle = this.aStartAngle + t * deltaAngle; + var x = this.aX + this.xRadius * Math.cos( angle ); + var y = this.aY + this.yRadius * Math.sin( angle ); + + if ( this.aRotation !== 0 ) { + + var cos = Math.cos( this.aRotation ); + var sin = Math.sin( this.aRotation ); + + var tx = x - this.aX; + var ty = y - this.aY; + + // Rotate the point about the center of the ellipse. + x = tx * cos - ty * sin + this.aX; + y = tx * sin + ty * cos + this.aY; + + } + + return new Vector2( x, y ); + + }; + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + */ + + var CurveUtils = { + + tangentQuadraticBezier: function ( t, p0, p1, p2 ) { + + return 2 * ( 1 - t ) * ( p1 - p0 ) + 2 * t * ( p2 - p1 ); + + }, + + // Puay Bing, thanks for helping with this derivative! + + tangentCubicBezier: function ( t, p0, p1, p2, p3 ) { + + return - 3 * p0 * ( 1 - t ) * ( 1 - t ) + + 3 * p1 * ( 1 - t ) * ( 1 - t ) - 6 * t * p1 * ( 1 - t ) + + 6 * t * p2 * ( 1 - t ) - 3 * t * t * p2 + + 3 * t * t * p3; + + }, + + tangentSpline: function ( t, p0, p1, p2, p3 ) { + + // To check if my formulas are correct + + var h00 = 6 * t * t - 6 * t; // derived from 2t^3 − 3t^2 + 1 + var h10 = 3 * t * t - 4 * t + 1; // t^3 − 2t^2 + t + var h01 = - 6 * t * t + 6 * t; // − 2t3 + 3t2 + var h11 = 3 * t * t - 2 * t; // t3 − t2 + + return h00 + h10 + h01 + h11; + + }, + + // Catmull-Rom + + interpolate: function( p0, p1, p2, p3, t ) { + + var v0 = ( p2 - p0 ) * 0.5; + var v1 = ( p3 - p1 ) * 0.5; + var t2 = t * t; + var t3 = t * t2; + return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1; + + } + + }; + + /************************************************************** + * Spline curve + **************************************************************/ + + function SplineCurve( points /* array of Vector2 */ ) { + + this.points = ( points === undefined ) ? [] : points; + + } + + SplineCurve.prototype = Object.create( Curve.prototype ); + SplineCurve.prototype.constructor = SplineCurve; + + SplineCurve.prototype.isSplineCurve = true; + + SplineCurve.prototype.getPoint = function ( t ) { + + var points = this.points; + var point = ( points.length - 1 ) * t; + + var intPoint = Math.floor( point ); + var weight = point - intPoint; + + var point0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ]; + var point1 = points[ intPoint ]; + var point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; + var point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; + + var interpolate = CurveUtils.interpolate; + + return new Vector2( + interpolate( point0.x, point1.x, point2.x, point3.x, weight ), + interpolate( point0.y, point1.y, point2.y, point3.y, weight ) + ); + + }; + + /************************************************************** + * Cubic Bezier curve + **************************************************************/ + + function CubicBezierCurve( v0, v1, v2, v3 ) { + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; + + } + + CubicBezierCurve.prototype = Object.create( Curve.prototype ); + CubicBezierCurve.prototype.constructor = CubicBezierCurve; + + CubicBezierCurve.prototype.getPoint = function ( t ) { + + var b3 = ShapeUtils.b3; + + return new Vector2( + b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ), + b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ) + ); + + }; + + CubicBezierCurve.prototype.getTangent = function( t ) { + + var tangentCubicBezier = CurveUtils.tangentCubicBezier; + + return new Vector2( + tangentCubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ), + tangentCubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ) + ).normalize(); + + }; + + /************************************************************** + * Quadratic Bezier curve + **************************************************************/ + + + function QuadraticBezierCurve( v0, v1, v2 ) { + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + + } + + QuadraticBezierCurve.prototype = Object.create( Curve.prototype ); + QuadraticBezierCurve.prototype.constructor = QuadraticBezierCurve; + + + QuadraticBezierCurve.prototype.getPoint = function ( t ) { + + var b2 = ShapeUtils.b2; + + return new Vector2( + b2( t, this.v0.x, this.v1.x, this.v2.x ), + b2( t, this.v0.y, this.v1.y, this.v2.y ) + ); + + }; + + + QuadraticBezierCurve.prototype.getTangent = function( t ) { + + var tangentQuadraticBezier = CurveUtils.tangentQuadraticBezier; + + return new Vector2( + tangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ), + tangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y ) + ).normalize(); + + }; + + var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), { + + fromPoints: function ( vectors ) { + + this.moveTo( vectors[ 0 ].x, vectors[ 0 ].y ); + + for ( var i = 1, l = vectors.length; i < l; i ++ ) { + + this.lineTo( vectors[ i ].x, vectors[ i ].y ); + + } + + }, + + moveTo: function ( x, y ) { + + this.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying? + + }, + + lineTo: function ( x, y ) { + + var curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) ); + this.curves.push( curve ); + + this.currentPoint.set( x, y ); + + }, + + quadraticCurveTo: function ( aCPx, aCPy, aX, aY ) { + + var curve = new QuadraticBezierCurve( + this.currentPoint.clone(), + new Vector2( aCPx, aCPy ), + new Vector2( aX, aY ) + ); + + this.curves.push( curve ); + + this.currentPoint.set( aX, aY ); + + }, + + bezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { + + var curve = new CubicBezierCurve( + this.currentPoint.clone(), + new Vector2( aCP1x, aCP1y ), + new Vector2( aCP2x, aCP2y ), + new Vector2( aX, aY ) + ); + + this.curves.push( curve ); + + this.currentPoint.set( aX, aY ); + + }, + + splineThru: function ( pts /*Array of Vector*/ ) { + + var npts = [ this.currentPoint.clone() ].concat( pts ); + + var curve = new SplineCurve( npts ); + this.curves.push( curve ); + + this.currentPoint.copy( pts[ pts.length - 1 ] ); + + }, + + arc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + + var x0 = this.currentPoint.x; + var y0 = this.currentPoint.y; + + this.absarc( aX + x0, aY + y0, aRadius, + aStartAngle, aEndAngle, aClockwise ); + + }, + + absarc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + + this.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); + + }, + + ellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + + var x0 = this.currentPoint.x; + var y0 = this.currentPoint.y; + + this.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); + + }, + + absellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { + + var curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); + + if ( this.curves.length > 0 ) { + + // if a previous curve is present, attempt to join + var firstPoint = curve.getPoint( 0 ); + + if ( ! firstPoint.equals( this.currentPoint ) ) { + + this.lineTo( firstPoint.x, firstPoint.y ); + + } + + } + + this.curves.push( curve ); + + var lastPoint = curve.getPoint( 1 ); + this.currentPoint.copy( lastPoint ); + + } + + } ); + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + * Defines a 2d shape plane using paths. + **/ + + // STEP 1 Create a path. + // STEP 2 Turn path into shape. + // STEP 3 ExtrudeGeometry takes in Shape/Shapes + // STEP 3a - Extract points from each shape, turn to vertices + // STEP 3b - Triangulate each shape, add faces. + + function Shape() { + + Path.apply( this, arguments ); + + this.holes = []; + + } + + Shape.prototype = Object.assign( Object.create( PathPrototype ), { + + constructor: Shape, + + getPointsHoles: function ( divisions ) { + + var holesPts = []; + + for ( var i = 0, l = this.holes.length; i < l; i ++ ) { + + holesPts[ i ] = this.holes[ i ].getPoints( divisions ); + + } + + return holesPts; + + }, + + // Get points of shape and holes (keypoints based on segments parameter) + + extractAllPoints: function ( divisions ) { + + return { + + shape: this.getPoints( divisions ), + holes: this.getPointsHoles( divisions ) + + }; + + }, + + extractPoints: function ( divisions ) { + + return this.extractAllPoints( divisions ); + + } + + } ); + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + * Creates free form 2d path using series of points, lines or curves. + * + **/ + + function Path( points ) { + + CurvePath.call( this ); + this.currentPoint = new Vector2(); + + if ( points ) { + + this.fromPoints( points ); + + } + + } + + Path.prototype = PathPrototype; + PathPrototype.constructor = Path; + + + // minimal class for proxing functions to Path. Replaces old "extractSubpaths()" + function ShapePath() { + this.subPaths = []; + this.currentPath = null; + } + + ShapePath.prototype = { + moveTo: function ( x, y ) { + this.currentPath = new Path(); + this.subPaths.push(this.currentPath); + this.currentPath.moveTo( x, y ); + }, + lineTo: function ( x, y ) { + this.currentPath.lineTo( x, y ); + }, + quadraticCurveTo: function ( aCPx, aCPy, aX, aY ) { + this.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY ); + }, + bezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { + this.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ); + }, + splineThru: function ( pts ) { + this.currentPath.splineThru( pts ); + }, + + toShapes: function ( isCCW, noHoles ) { + + function toShapesNoHoles( inSubpaths ) { + + var shapes = []; + + for ( var i = 0, l = inSubpaths.length; i < l; i ++ ) { + + var tmpPath = inSubpaths[ i ]; + + var tmpShape = new Shape(); + tmpShape.curves = tmpPath.curves; + + shapes.push( tmpShape ); + + } + + return shapes; + + } + + function isPointInsidePolygon( inPt, inPolygon ) { + + var polyLen = inPolygon.length; + + // inPt on polygon contour => immediate success or + // toggling of inside/outside at every single! intersection point of an edge + // with the horizontal line through inPt, left of inPt + // not counting lowerY endpoints of edges and whole edges on that line + var inside = false; + for ( var p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) { + + var edgeLowPt = inPolygon[ p ]; + var edgeHighPt = inPolygon[ q ]; + + var edgeDx = edgeHighPt.x - edgeLowPt.x; + var edgeDy = edgeHighPt.y - edgeLowPt.y; + + if ( Math.abs( edgeDy ) > Number.EPSILON ) { + + // not parallel + if ( edgeDy < 0 ) { + + edgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx; + edgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy; + + } + if ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) continue; + + if ( inPt.y === edgeLowPt.y ) { + + if ( inPt.x === edgeLowPt.x ) return true; // inPt is on contour ? + // continue; // no intersection or edgeLowPt => doesn't count !!! + + } else { + + var perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y ); + if ( perpEdge === 0 ) return true; // inPt is on contour ? + if ( perpEdge < 0 ) continue; + inside = ! inside; // true intersection left of inPt + + } + + } else { + + // parallel or collinear + if ( inPt.y !== edgeLowPt.y ) continue; // parallel + // edge lies on the same horizontal line as inPt + if ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) || + ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) ) return true; // inPt: Point on contour ! + // continue; + + } + + } + + return inside; + + } + + var isClockWise = ShapeUtils.isClockWise; + + var subPaths = this.subPaths; + if ( subPaths.length === 0 ) return []; + + if ( noHoles === true ) return toShapesNoHoles( subPaths ); + + + var solid, tmpPath, tmpShape, shapes = []; + + if ( subPaths.length === 1 ) { + + tmpPath = subPaths[ 0 ]; + tmpShape = new Shape(); + tmpShape.curves = tmpPath.curves; + shapes.push( tmpShape ); + return shapes; + + } + + var holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() ); + holesFirst = isCCW ? ! holesFirst : holesFirst; + + // console.log("Holes first", holesFirst); + + var betterShapeHoles = []; + var newShapes = []; + var newShapeHoles = []; + var mainIdx = 0; + var tmpPoints; + + newShapes[ mainIdx ] = undefined; + newShapeHoles[ mainIdx ] = []; + + for ( var i = 0, l = subPaths.length; i < l; i ++ ) { + + tmpPath = subPaths[ i ]; + tmpPoints = tmpPath.getPoints(); + solid = isClockWise( tmpPoints ); + solid = isCCW ? ! solid : solid; + + if ( solid ) { + + if ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) ) mainIdx ++; + + newShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints }; + newShapes[ mainIdx ].s.curves = tmpPath.curves; + + if ( holesFirst ) mainIdx ++; + newShapeHoles[ mainIdx ] = []; + + //console.log('cw', i); + + } else { + + newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } ); + + //console.log('ccw', i); + + } + + } + + // only Holes? -> probably all Shapes with wrong orientation + if ( ! newShapes[ 0 ] ) return toShapesNoHoles( subPaths ); + + + if ( newShapes.length > 1 ) { + + var ambiguous = false; + var toChange = []; + + for ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + + betterShapeHoles[ sIdx ] = []; + + } + + for ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { + + var sho = newShapeHoles[ sIdx ]; + + for ( var hIdx = 0; hIdx < sho.length; hIdx ++ ) { + + var ho = sho[ hIdx ]; + var hole_unassigned = true; + + for ( var s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) { + + if ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) { + + if ( sIdx !== s2Idx ) toChange.push( { froms: sIdx, tos: s2Idx, hole: hIdx } ); + if ( hole_unassigned ) { + + hole_unassigned = false; + betterShapeHoles[ s2Idx ].push( ho ); + + } else { + + ambiguous = true; + + } + + } + + } + if ( hole_unassigned ) { + + betterShapeHoles[ sIdx ].push( ho ); + + } + + } + + } + // console.log("ambiguous: ", ambiguous); + if ( toChange.length > 0 ) { + + // console.log("to change: ", toChange); + if ( ! ambiguous ) newShapeHoles = betterShapeHoles; + + } + + } + + var tmpHoles; + + for ( var i = 0, il = newShapes.length; i < il; i ++ ) { + + tmpShape = newShapes[ i ].s; + shapes.push( tmpShape ); + tmpHoles = newShapeHoles[ i ]; + + for ( var j = 0, jl = tmpHoles.length; j < jl; j ++ ) { + + tmpShape.holes.push( tmpHoles[ j ].h ); + + } + + } + + //console.log("shape", shapes); + + return shapes; + + } + }; + + /** + * @author zz85 / http://www.lab4games.net/zz85/blog + * @author mrdoob / http://mrdoob.com/ + */ + + function Font( data ) { + + this.data = data; + + } + + Object.assign( Font.prototype, { + + isFont: true, + + generateShapes: function ( text, size, divisions ) { + + function createPaths( text ) { + + var chars = String( text ).split( '' ); + var scale = size / data.resolution; + var offset = 0; + + var paths = []; + + for ( var i = 0; i < chars.length; i ++ ) { + + var ret = createPath( chars[ i ], scale, offset ); + offset += ret.offset; + + paths.push( ret.path ); + + } + + return paths; + + } + + function createPath( c, scale, offset ) { + + var glyph = data.glyphs[ c ] || data.glyphs[ '?' ]; + + if ( ! glyph ) return; + + var path = new ShapePath(); + + var pts = [], b2 = ShapeUtils.b2, b3 = ShapeUtils.b3; + var x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2, laste; + + if ( glyph.o ) { + + var outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) ); + + for ( var i = 0, l = outline.length; i < l; ) { + + var action = outline[ i ++ ]; + + switch ( action ) { + + case 'm': // moveTo + + x = outline[ i ++ ] * scale + offset; + y = outline[ i ++ ] * scale; + + path.moveTo( x, y ); + + break; + + case 'l': // lineTo + + x = outline[ i ++ ] * scale + offset; + y = outline[ i ++ ] * scale; + + path.lineTo( x, y ); + + break; + + case 'q': // quadraticCurveTo + + cpx = outline[ i ++ ] * scale + offset; + cpy = outline[ i ++ ] * scale; + cpx1 = outline[ i ++ ] * scale + offset; + cpy1 = outline[ i ++ ] * scale; + + path.quadraticCurveTo( cpx1, cpy1, cpx, cpy ); + + laste = pts[ pts.length - 1 ]; + + if ( laste ) { + + cpx0 = laste.x; + cpy0 = laste.y; + + for ( var i2 = 1; i2 <= divisions; i2 ++ ) { + + var t = i2 / divisions; + b2( t, cpx0, cpx1, cpx ); + b2( t, cpy0, cpy1, cpy ); + + } + + } + + break; + + case 'b': // bezierCurveTo + + cpx = outline[ i ++ ] * scale + offset; + cpy = outline[ i ++ ] * scale; + cpx1 = outline[ i ++ ] * scale + offset; + cpy1 = outline[ i ++ ] * scale; + cpx2 = outline[ i ++ ] * scale + offset; + cpy2 = outline[ i ++ ] * scale; + + path.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy ); + + laste = pts[ pts.length - 1 ]; + + if ( laste ) { + + cpx0 = laste.x; + cpy0 = laste.y; + + for ( var i2 = 1; i2 <= divisions; i2 ++ ) { + + var t = i2 / divisions; + b3( t, cpx0, cpx1, cpx2, cpx ); + b3( t, cpy0, cpy1, cpy2, cpy ); + + } + + } + + break; + + } + + } + + } + + return { offset: glyph.ha * scale, path: path }; + + } + + // + + if ( size === undefined ) size = 100; + if ( divisions === undefined ) divisions = 4; + + var data = this.data; + + var paths = createPaths( text ); + var shapes = []; + + for ( var p = 0, pl = paths.length; p < pl; p ++ ) { + + Array.prototype.push.apply( shapes, paths[ p ].toShapes() ); + + } + + return shapes; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function FontLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + } + + Object.assign( FontLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var loader = new XHRLoader( this.manager ); + loader.load( url, function ( text ) { + + var json; + + try { + + json = JSON.parse( text ); + + } catch ( e ) { + + console.warn( 'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.' ); + json = JSON.parse( text.substring( 65, text.length - 2 ) ); + + } + + var font = scope.parse( json ); + + if ( onLoad ) onLoad( font ); + + }, onProgress, onError ); + + }, + + parse: function ( json ) { + + return new Font( json ); + + } + + } ); + + var context; + + function getAudioContext() { + + if ( context === undefined ) { + + context = new ( window.AudioContext || window.webkitAudioContext )(); + + } + + return context; + + } + + /** + * @author Reece Aaron Lecrivain / http://reecenotes.com/ + */ + + function AudioLoader( manager ) { + + this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; + + } + + Object.assign( AudioLoader.prototype, { + + load: function ( url, onLoad, onProgress, onError ) { + + var loader = new XHRLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + loader.load( url, function ( buffer ) { + + var context = getAudioContext(); + + context.decodeAudioData( buffer, function ( audioBuffer ) { + + onLoad( audioBuffer ); + + } ); + + }, onProgress, onError ); + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function StereoCamera() { + + this.type = 'StereoCamera'; + + this.aspect = 1; + + this.eyeSep = 0.064; + + this.cameraL = new PerspectiveCamera(); + this.cameraL.layers.enable( 1 ); + this.cameraL.matrixAutoUpdate = false; + + this.cameraR = new PerspectiveCamera(); + this.cameraR.layers.enable( 2 ); + this.cameraR.matrixAutoUpdate = false; + + } + + Object.assign( StereoCamera.prototype, { + + update: ( function () { + + var instance, focus, fov, aspect, near, far, zoom; + + var eyeRight = new Matrix4(); + var eyeLeft = new Matrix4(); + + return function update( camera ) { + + var needsUpdate = instance !== this || focus !== camera.focus || fov !== camera.fov || + aspect !== camera.aspect * this.aspect || near !== camera.near || + far !== camera.far || zoom !== camera.zoom; + + if ( needsUpdate ) { + + instance = this; + focus = camera.focus; + fov = camera.fov; + aspect = camera.aspect * this.aspect; + near = camera.near; + far = camera.far; + zoom = camera.zoom; + + // Off-axis stereoscopic effect based on + // http://paulbourke.net/stereographics/stereorender/ + + var projectionMatrix = camera.projectionMatrix.clone(); + var eyeSep = this.eyeSep / 2; + var eyeSepOnProjection = eyeSep * near / focus; + var ymax = ( near * Math.tan( _Math.DEG2RAD * fov * 0.5 ) ) / zoom; + var xmin, xmax; + + // translate xOffset + + eyeLeft.elements[ 12 ] = - eyeSep; + eyeRight.elements[ 12 ] = eyeSep; + + // for left eye + + xmin = - ymax * aspect + eyeSepOnProjection; + xmax = ymax * aspect + eyeSepOnProjection; + + projectionMatrix.elements[ 0 ] = 2 * near / ( xmax - xmin ); + projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + + this.cameraL.projectionMatrix.copy( projectionMatrix ); + + // for right eye + + xmin = - ymax * aspect - eyeSepOnProjection; + xmax = ymax * aspect - eyeSepOnProjection; + + projectionMatrix.elements[ 0 ] = 2 * near / ( xmax - xmin ); + projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); + + this.cameraR.projectionMatrix.copy( projectionMatrix ); + + } + + this.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft ); + this.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight ); + + }; + + } )() + + } ); + + /** + * Camera for rendering cube maps + * - renders scene into axis-aligned cube + * + * @author alteredq / http://alteredqualia.com/ + */ + + function CubeCamera( near, far, cubeResolution ) { + + Object3D.call( this ); + + this.type = 'CubeCamera'; + + var fov = 90, aspect = 1; + + var cameraPX = new PerspectiveCamera( fov, aspect, near, far ); + cameraPX.up.set( 0, - 1, 0 ); + cameraPX.lookAt( new Vector3( 1, 0, 0 ) ); + this.add( cameraPX ); + + var cameraNX = new PerspectiveCamera( fov, aspect, near, far ); + cameraNX.up.set( 0, - 1, 0 ); + cameraNX.lookAt( new Vector3( - 1, 0, 0 ) ); + this.add( cameraNX ); + + var cameraPY = new PerspectiveCamera( fov, aspect, near, far ); + cameraPY.up.set( 0, 0, 1 ); + cameraPY.lookAt( new Vector3( 0, 1, 0 ) ); + this.add( cameraPY ); + + var cameraNY = new PerspectiveCamera( fov, aspect, near, far ); + cameraNY.up.set( 0, 0, - 1 ); + cameraNY.lookAt( new Vector3( 0, - 1, 0 ) ); + this.add( cameraNY ); + + var cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); + cameraPZ.up.set( 0, - 1, 0 ); + cameraPZ.lookAt( new Vector3( 0, 0, 1 ) ); + this.add( cameraPZ ); + + var cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); + cameraNZ.up.set( 0, - 1, 0 ); + cameraNZ.lookAt( new Vector3( 0, 0, - 1 ) ); + this.add( cameraNZ ); + + var options = { format: RGBFormat, magFilter: LinearFilter, minFilter: LinearFilter }; + + this.renderTarget = new WebGLRenderTargetCube( cubeResolution, cubeResolution, options ); + + this.updateCubeMap = function ( renderer, scene ) { + + if ( this.parent === null ) this.updateMatrixWorld(); + + var renderTarget = this.renderTarget; + var generateMipmaps = renderTarget.texture.generateMipmaps; + + renderTarget.texture.generateMipmaps = false; + + renderTarget.activeCubeFace = 0; + renderer.render( scene, cameraPX, renderTarget ); + + renderTarget.activeCubeFace = 1; + renderer.render( scene, cameraNX, renderTarget ); + + renderTarget.activeCubeFace = 2; + renderer.render( scene, cameraPY, renderTarget ); + + renderTarget.activeCubeFace = 3; + renderer.render( scene, cameraNY, renderTarget ); + + renderTarget.activeCubeFace = 4; + renderer.render( scene, cameraPZ, renderTarget ); + + renderTarget.texture.generateMipmaps = generateMipmaps; + + renderTarget.activeCubeFace = 5; + renderer.render( scene, cameraNZ, renderTarget ); + + renderer.setRenderTarget( null ); + + }; + + } + + CubeCamera.prototype = Object.create( Object3D.prototype ); + CubeCamera.prototype.constructor = CubeCamera; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function AudioListener() { + + Object3D.call( this ); + + this.type = 'AudioListener'; + + this.context = getAudioContext(); + + this.gain = this.context.createGain(); + this.gain.connect( this.context.destination ); + + this.filter = null; + + } + + AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: AudioListener, + + getInput: function () { + + return this.gain; + + }, + + removeFilter: function ( ) { + + if ( this.filter !== null ) { + + this.gain.disconnect( this.filter ); + this.filter.disconnect( this.context.destination ); + this.gain.connect( this.context.destination ); + this.filter = null; + + } + + }, + + getFilter: function () { + + return this.filter; + + }, + + setFilter: function ( value ) { + + if ( this.filter !== null ) { + + this.gain.disconnect( this.filter ); + this.filter.disconnect( this.context.destination ); + + } else { + + this.gain.disconnect( this.context.destination ); + + } + + this.filter = value; + this.gain.connect( this.filter ); + this.filter.connect( this.context.destination ); + + }, + + getMasterVolume: function () { + + return this.gain.gain.value; + + }, + + setMasterVolume: function ( value ) { + + this.gain.gain.value = value; + + }, + + updateMatrixWorld: ( function () { + + var position = new Vector3(); + var quaternion = new Quaternion(); + var scale = new Vector3(); + + var orientation = new Vector3(); + + return function updateMatrixWorld( force ) { + + Object3D.prototype.updateMatrixWorld.call( this, force ); + + var listener = this.context.listener; + var up = this.up; + + this.matrixWorld.decompose( position, quaternion, scale ); + + orientation.set( 0, 0, - 1 ).applyQuaternion( quaternion ); + + listener.setPosition( position.x, position.y, position.z ); + listener.setOrientation( orientation.x, orientation.y, orientation.z, up.x, up.y, up.z ); + + }; + + } )() + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + * @author Reece Aaron Lecrivain / http://reecenotes.com/ + */ + + function Audio( listener ) { + + Object3D.call( this ); + + this.type = 'Audio'; + + this.context = listener.context; + this.source = this.context.createBufferSource(); + this.source.onended = this.onEnded.bind( this ); + + this.gain = this.context.createGain(); + this.gain.connect( listener.getInput() ); + + this.autoplay = false; + + this.startTime = 0; + this.playbackRate = 1; + this.isPlaying = false; + this.hasPlaybackControl = true; + this.sourceType = 'empty'; + + this.filters = []; + + } + + Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { + + constructor: Audio, + + getOutput: function () { + + return this.gain; + + }, + + setNodeSource: function ( audioNode ) { + + this.hasPlaybackControl = false; + this.sourceType = 'audioNode'; + this.source = audioNode; + this.connect(); + + return this; + + }, + + setBuffer: function ( audioBuffer ) { + + this.source.buffer = audioBuffer; + this.sourceType = 'buffer'; + + if ( this.autoplay ) this.play(); + + return this; + + }, + + play: function () { + + if ( this.isPlaying === true ) { + + console.warn( 'THREE.Audio: Audio is already playing.' ); + return; + + } + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + var source = this.context.createBufferSource(); + + source.buffer = this.source.buffer; + source.loop = this.source.loop; + source.onended = this.source.onended; + source.start( 0, this.startTime ); + source.playbackRate.value = this.playbackRate; + + this.isPlaying = true; + + this.source = source; + + return this.connect(); + + }, + + pause: function () { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.source.stop(); + this.startTime = this.context.currentTime; + this.isPlaying = false; + + return this; + + }, + + stop: function () { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.source.stop(); + this.startTime = 0; + this.isPlaying = false; + + return this; + + }, + + connect: function () { + + if ( this.filters.length > 0 ) { + + this.source.connect( this.filters[ 0 ] ); + + for ( var i = 1, l = this.filters.length; i < l; i ++ ) { + + this.filters[ i - 1 ].connect( this.filters[ i ] ); + + } + + this.filters[ this.filters.length - 1 ].connect( this.getOutput() ); + + } else { + + this.source.connect( this.getOutput() ); + + } + + return this; + + }, + + disconnect: function () { + + if ( this.filters.length > 0 ) { + + this.source.disconnect( this.filters[ 0 ] ); + + for ( var i = 1, l = this.filters.length; i < l; i ++ ) { + + this.filters[ i - 1 ].disconnect( this.filters[ i ] ); + + } + + this.filters[ this.filters.length - 1 ].disconnect( this.getOutput() ); + + } else { + + this.source.disconnect( this.getOutput() ); + + } + + return this; + + }, + + getFilters: function () { + + return this.filters; + + }, + + setFilters: function ( value ) { + + if ( ! value ) value = []; + + if ( this.isPlaying === true ) { + + this.disconnect(); + this.filters = value; + this.connect(); + + } else { + + this.filters = value; + + } + + return this; + + }, + + getFilter: function () { + + return this.getFilters()[ 0 ]; + + }, + + setFilter: function ( filter ) { + + return this.setFilters( filter ? [ filter ] : [] ); + + }, + + setPlaybackRate: function ( value ) { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.playbackRate = value; + + if ( this.isPlaying === true ) { + + this.source.playbackRate.value = this.playbackRate; + + } + + return this; + + }, + + getPlaybackRate: function () { + + return this.playbackRate; + + }, + + onEnded: function () { + + this.isPlaying = false; + + }, + + getLoop: function () { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return false; + + } + + return this.source.loop; + + }, + + setLoop: function ( value ) { + + if ( this.hasPlaybackControl === false ) { + + console.warn( 'THREE.Audio: this Audio has no playback control.' ); + return; + + } + + this.source.loop = value; + + }, + + getVolume: function () { + + return this.gain.gain.value; + + }, + + + setVolume: function ( value ) { + + this.gain.gain.value = value; + + return this; + + } + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function PositionalAudio( listener ) { + + Audio.call( this, listener ); + + this.panner = this.context.createPanner(); + this.panner.connect( this.gain ); + + } + + PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { + + constructor: PositionalAudio, + + getOutput: function () { + + return this.panner; + + }, + + getRefDistance: function () { + + return this.panner.refDistance; + + }, + + setRefDistance: function ( value ) { + + this.panner.refDistance = value; + + }, + + getRolloffFactor: function () { + + return this.panner.rolloffFactor; + + }, + + setRolloffFactor: function ( value ) { + + this.panner.rolloffFactor = value; + + }, + + getDistanceModel: function () { + + return this.panner.distanceModel; + + }, + + setDistanceModel: function ( value ) { + + this.panner.distanceModel = value; + + }, + + getMaxDistance: function () { + + return this.panner.maxDistance; + + }, + + setMaxDistance: function ( value ) { + + this.panner.maxDistance = value; + + }, + + updateMatrixWorld: ( function () { + + var position = new Vector3(); + + return function updateMatrixWorld( force ) { + + Object3D.prototype.updateMatrixWorld.call( this, force ); + + position.setFromMatrixPosition( this.matrixWorld ); + + this.panner.setPosition( position.x, position.y, position.z ); + + }; + + } )() + + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function AudioAnalyser( audio, fftSize ) { + + this.analyser = audio.context.createAnalyser(); + this.analyser.fftSize = fftSize !== undefined ? fftSize : 2048; + + this.data = new Uint8Array( this.analyser.frequencyBinCount ); + + audio.getOutput().connect( this.analyser ); + + } + + Object.assign( AudioAnalyser.prototype, { + + getFrequencyData: function () { + + this.analyser.getByteFrequencyData( this.data ); + + return this.data; + + }, + + getAverageFrequency: function () { + + var value = 0, data = this.getFrequencyData(); + + for ( var i = 0; i < data.length; i ++ ) { + + value += data[ i ]; + + } + + return value / data.length; + + } + + } ); + + /** + * + * Buffered scene graph property that allows weighted accumulation. + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function PropertyMixer( binding, typeName, valueSize ) { + + this.binding = binding; + this.valueSize = valueSize; + + var bufferType = Float64Array, + mixFunction; + + switch ( typeName ) { + + case 'quaternion': mixFunction = this._slerp; break; + + case 'string': + case 'bool': + + bufferType = Array, mixFunction = this._select; break; + + default: mixFunction = this._lerp; + + } + + this.buffer = new bufferType( valueSize * 4 ); + // layout: [ incoming | accu0 | accu1 | orig ] + // + // interpolators can use .buffer as their .result + // the data then goes to 'incoming' + // + // 'accu0' and 'accu1' are used frame-interleaved for + // the cumulative result and are compared to detect + // changes + // + // 'orig' stores the original state of the property + + this._mixBufferRegion = mixFunction; + + this.cumulativeWeight = 0; + + this.useCount = 0; + this.referenceCount = 0; + + } + + PropertyMixer.prototype = { + + constructor: PropertyMixer, + + // accumulate data in the 'incoming' region into 'accu' + accumulate: function( accuIndex, weight ) { + + // note: happily accumulating nothing when weight = 0, the caller knows + // the weight and shouldn't have made the call in the first place + + var buffer = this.buffer, + stride = this.valueSize, + offset = accuIndex * stride + stride, + + currentWeight = this.cumulativeWeight; + + if ( currentWeight === 0 ) { + + // accuN := incoming * weight + + for ( var i = 0; i !== stride; ++ i ) { + + buffer[ offset + i ] = buffer[ i ]; + + } + + currentWeight = weight; + + } else { + + // accuN := accuN + incoming * weight + + currentWeight += weight; + var mix = weight / currentWeight; + this._mixBufferRegion( buffer, offset, 0, mix, stride ); + + } + + this.cumulativeWeight = currentWeight; + + }, + + // apply the state of 'accu' to the binding when accus differ + apply: function( accuIndex ) { + + var stride = this.valueSize, + buffer = this.buffer, + offset = accuIndex * stride + stride, + + weight = this.cumulativeWeight, + + binding = this.binding; + + this.cumulativeWeight = 0; + + if ( weight < 1 ) { + + // accuN := accuN + original * ( 1 - cumulativeWeight ) + + var originalValueOffset = stride * 3; + + this._mixBufferRegion( + buffer, offset, originalValueOffset, 1 - weight, stride ); + + } + + for ( var i = stride, e = stride + stride; i !== e; ++ i ) { + + if ( buffer[ i ] !== buffer[ i + stride ] ) { + + // value has changed -> update scene graph + + binding.setValue( buffer, offset ); + break; + + } + + } + + }, + + // remember the state of the bound property and copy it to both accus + saveOriginalState: function() { + + var binding = this.binding; + + var buffer = this.buffer, + stride = this.valueSize, + + originalValueOffset = stride * 3; + + binding.getValue( buffer, originalValueOffset ); + + // accu[0..1] := orig -- initially detect changes against the original + for ( var i = stride, e = originalValueOffset; i !== e; ++ i ) { + + buffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ]; + + } + + this.cumulativeWeight = 0; + + }, + + // apply the state previously taken via 'saveOriginalState' to the binding + restoreOriginalState: function() { + + var originalValueOffset = this.valueSize * 3; + this.binding.setValue( this.buffer, originalValueOffset ); + + }, + + + // mix functions + + _select: function( buffer, dstOffset, srcOffset, t, stride ) { + + if ( t >= 0.5 ) { + + for ( var i = 0; i !== stride; ++ i ) { + + buffer[ dstOffset + i ] = buffer[ srcOffset + i ]; + + } + + } + + }, + + _slerp: function( buffer, dstOffset, srcOffset, t, stride ) { + + Quaternion.slerpFlat( buffer, dstOffset, + buffer, dstOffset, buffer, srcOffset, t ); + + }, + + _lerp: function( buffer, dstOffset, srcOffset, t, stride ) { + + var s = 1 - t; + + for ( var i = 0; i !== stride; ++ i ) { + + var j = dstOffset + i; + + buffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t; + + } + + } + + }; + + /** + * + * A reference to a real property in the scene graph. + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function PropertyBinding( rootNode, path, parsedPath ) { + + this.path = path; + this.parsedPath = parsedPath || + PropertyBinding.parseTrackName( path ); + + this.node = PropertyBinding.findNode( + rootNode, this.parsedPath.nodeName ) || rootNode; + + this.rootNode = rootNode; + + } + + PropertyBinding.prototype = { + + constructor: PropertyBinding, + + getValue: function getValue_unbound( targetArray, offset ) { + + this.bind(); + this.getValue( targetArray, offset ); + + // Note: This class uses a State pattern on a per-method basis: + // 'bind' sets 'this.getValue' / 'setValue' and shadows the + // prototype version of these methods with one that represents + // the bound state. When the property is not found, the methods + // become no-ops. + + }, + + setValue: function getValue_unbound( sourceArray, offset ) { + + this.bind(); + this.setValue( sourceArray, offset ); + + }, + + // create getter / setter pair for a property in the scene graph + bind: function() { + + var targetObject = this.node, + parsedPath = this.parsedPath, + + objectName = parsedPath.objectName, + propertyName = parsedPath.propertyName, + propertyIndex = parsedPath.propertyIndex; + + if ( ! targetObject ) { + + targetObject = PropertyBinding.findNode( + this.rootNode, parsedPath.nodeName ) || this.rootNode; + + this.node = targetObject; + + } + + // set fail state so we can just 'return' on error + this.getValue = this._getValue_unavailable; + this.setValue = this._setValue_unavailable; + + // ensure there is a value node + if ( ! targetObject ) { + + console.error( " trying to update node for track: " + this.path + " but it wasn't found." ); + return; + + } + + if ( objectName ) { + + var objectIndex = parsedPath.objectIndex; + + // special cases were we need to reach deeper into the hierarchy to get the face materials.... + switch ( objectName ) { + + case 'materials': + + if ( ! targetObject.material ) { + + console.error( ' can not bind to material as node does not have a material', this ); + return; + + } + + if ( ! targetObject.material.materials ) { + + console.error( ' can not bind to material.materials as node.material does not have a materials array', this ); + return; + + } + + targetObject = targetObject.material.materials; + + break; + + case 'bones': + + if ( ! targetObject.skeleton ) { + + console.error( ' can not bind to bones as node does not have a skeleton', this ); + return; + + } + + // potential future optimization: skip this if propertyIndex is already an integer + // and convert the integer string to a true integer. + + targetObject = targetObject.skeleton.bones; + + // support resolving morphTarget names into indices. + for ( var i = 0; i < targetObject.length; i ++ ) { + + if ( targetObject[ i ].name === objectIndex ) { + + objectIndex = i; + break; + + } + + } + + break; + + default: + + if ( targetObject[ objectName ] === undefined ) { + + console.error( ' can not bind to objectName of node, undefined', this ); + return; + + } + + targetObject = targetObject[ objectName ]; + + } + + + if ( objectIndex !== undefined ) { + + if ( targetObject[ objectIndex ] === undefined ) { + + console.error( " trying to bind to objectIndex of objectName, but is undefined:", this, targetObject ); + return; + + } + + targetObject = targetObject[ objectIndex ]; + + } + + } + + // resolve property + var nodeProperty = targetObject[ propertyName ]; + + if ( nodeProperty === undefined ) { + + var nodeName = parsedPath.nodeName; + + console.error( " trying to update property for track: " + nodeName + + '.' + propertyName + " but it wasn't found.", targetObject ); + return; + + } + + // determine versioning scheme + var versioning = this.Versioning.None; + + if ( targetObject.needsUpdate !== undefined ) { // material + + versioning = this.Versioning.NeedsUpdate; + this.targetObject = targetObject; + + } else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform + + versioning = this.Versioning.MatrixWorldNeedsUpdate; + this.targetObject = targetObject; + + } + + // determine how the property gets bound + var bindingType = this.BindingType.Direct; + + if ( propertyIndex !== undefined ) { + // access a sub element of the property array (only primitives are supported right now) + + if ( propertyName === "morphTargetInfluences" ) { + // potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer. + + // support resolving morphTarget names into indices. + if ( ! targetObject.geometry ) { + + console.error( ' can not bind to morphTargetInfluences becasuse node does not have a geometry', this ); + return; + + } + + if ( ! targetObject.geometry.morphTargets ) { + + console.error( ' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets', this ); + return; + + } + + for ( var i = 0; i < this.node.geometry.morphTargets.length; i ++ ) { + + if ( targetObject.geometry.morphTargets[ i ].name === propertyIndex ) { + + propertyIndex = i; + break; + + } + + } + + } + + bindingType = this.BindingType.ArrayElement; + + this.resolvedProperty = nodeProperty; + this.propertyIndex = propertyIndex; + + } else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) { + // must use copy for Object3D.Euler/Quaternion + + bindingType = this.BindingType.HasFromToArray; + + this.resolvedProperty = nodeProperty; + + } else if ( nodeProperty.length !== undefined ) { + + bindingType = this.BindingType.EntireArray; + + this.resolvedProperty = nodeProperty; + + } else { + + this.propertyName = propertyName; + + } + + // select getter / setter + this.getValue = this.GetterByBindingType[ bindingType ]; + this.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ]; + + }, + + unbind: function() { + + this.node = null; + + // back to the prototype version of getValue / setValue + // note: avoiding to mutate the shape of 'this' via 'delete' + this.getValue = this._getValue_unbound; + this.setValue = this._setValue_unbound; + + } + + }; + + Object.assign( PropertyBinding.prototype, { // prototype, continued + + // these are used to "bind" a nonexistent property + _getValue_unavailable: function() {}, + _setValue_unavailable: function() {}, + + // initial state of these methods that calls 'bind' + _getValue_unbound: PropertyBinding.prototype.getValue, + _setValue_unbound: PropertyBinding.prototype.setValue, + + BindingType: { + Direct: 0, + EntireArray: 1, + ArrayElement: 2, + HasFromToArray: 3 + }, + + Versioning: { + None: 0, + NeedsUpdate: 1, + MatrixWorldNeedsUpdate: 2 + }, + + GetterByBindingType: [ + + function getValue_direct( buffer, offset ) { + + buffer[ offset ] = this.node[ this.propertyName ]; + + }, + + function getValue_array( buffer, offset ) { + + var source = this.resolvedProperty; + + for ( var i = 0, n = source.length; i !== n; ++ i ) { + + buffer[ offset ++ ] = source[ i ]; + + } + + }, + + function getValue_arrayElement( buffer, offset ) { + + buffer[ offset ] = this.resolvedProperty[ this.propertyIndex ]; + + }, + + function getValue_toArray( buffer, offset ) { + + this.resolvedProperty.toArray( buffer, offset ); + + } + + ], + + SetterByBindingTypeAndVersioning: [ + + [ + // Direct + + function setValue_direct( buffer, offset ) { + + this.node[ this.propertyName ] = buffer[ offset ]; + + }, + + function setValue_direct_setNeedsUpdate( buffer, offset ) { + + this.node[ this.propertyName ] = buffer[ offset ]; + this.targetObject.needsUpdate = true; + + }, + + function setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.node[ this.propertyName ] = buffer[ offset ]; + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + ], [ + + // EntireArray + + function setValue_array( buffer, offset ) { + + var dest = this.resolvedProperty; + + for ( var i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + }, + + function setValue_array_setNeedsUpdate( buffer, offset ) { + + var dest = this.resolvedProperty; + + for ( var i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + this.targetObject.needsUpdate = true; + + }, + + function setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) { + + var dest = this.resolvedProperty; + + for ( var i = 0, n = dest.length; i !== n; ++ i ) { + + dest[ i ] = buffer[ offset ++ ]; + + } + + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + ], [ + + // ArrayElement + + function setValue_arrayElement( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + + }, + + function setValue_arrayElement_setNeedsUpdate( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + this.targetObject.needsUpdate = true; + + }, + + function setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + ], [ + + // HasToFromArray + + function setValue_fromArray( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + + }, + + function setValue_fromArray_setNeedsUpdate( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + this.targetObject.needsUpdate = true; + + }, + + function setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) { + + this.resolvedProperty.fromArray( buffer, offset ); + this.targetObject.matrixWorldNeedsUpdate = true; + + } + + ] + + ] + + } ); + + PropertyBinding.Composite = + function( targetGroup, path, optionalParsedPath ) { + + var parsedPath = optionalParsedPath || + PropertyBinding.parseTrackName( path ); + + this._targetGroup = targetGroup; + this._bindings = targetGroup.subscribe_( path, parsedPath ); + + }; + + PropertyBinding.Composite.prototype = { + + constructor: PropertyBinding.Composite, + + getValue: function( array, offset ) { + + this.bind(); // bind all binding + + var firstValidIndex = this._targetGroup.nCachedObjects_, + binding = this._bindings[ firstValidIndex ]; + + // and only call .getValue on the first + if ( binding !== undefined ) binding.getValue( array, offset ); + + }, + + setValue: function( array, offset ) { + + var bindings = this._bindings; + + for ( var i = this._targetGroup.nCachedObjects_, + n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].setValue( array, offset ); + + } + + }, + + bind: function() { + + var bindings = this._bindings; + + for ( var i = this._targetGroup.nCachedObjects_, + n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].bind(); + + } + + }, + + unbind: function() { + + var bindings = this._bindings; + + for ( var i = this._targetGroup.nCachedObjects_, + n = bindings.length; i !== n; ++ i ) { + + bindings[ i ].unbind(); + + } + + } + + }; + + PropertyBinding.create = function( root, path, parsedPath ) { + + if ( ! ( (root && root.isAnimationObjectGroup) ) ) { + + return new PropertyBinding( root, path, parsedPath ); + + } else { + + return new PropertyBinding.Composite( root, path, parsedPath ); + + } + + }; + + PropertyBinding.parseTrackName = function( trackName ) { + + // matches strings in the form of: + // nodeName.property + // nodeName.property[accessor] + // nodeName.material.property[accessor] + // uuid.property[accessor] + // uuid.objectName[objectIndex].propertyName[propertyIndex] + // parentName/nodeName.property + // parentName/parentName/nodeName.property[index] + // .bone[Armature.DEF_cog].position + // scene:helium_balloon_model:helium_balloon_model.position + // created and tested via https://regex101.com/#javascript + + var re = /^((?:\w+[\/:])*)(\w+)?(?:\.(\w+)(?:\[(.+)\])?)?\.(\w+)(?:\[(.+)\])?$/; + var matches = re.exec( trackName ); + + if ( ! matches ) { + + throw new Error( "cannot parse trackName at all: " + trackName ); + + } + + var results = { + // directoryName: matches[ 1 ], // (tschw) currently unused + nodeName: matches[ 2 ], // allowed to be null, specified root node. + objectName: matches[ 3 ], + objectIndex: matches[ 4 ], + propertyName: matches[ 5 ], + propertyIndex: matches[ 6 ] // allowed to be null, specifies that the whole property is set. + }; + + if ( results.propertyName === null || results.propertyName.length === 0 ) { + + throw new Error( "can not parse propertyName from trackName: " + trackName ); + + } + + return results; + + }; + + PropertyBinding.findNode = function( root, nodeName ) { + + if ( ! nodeName || nodeName === "" || nodeName === "root" || nodeName === "." || nodeName === -1 || nodeName === root.name || nodeName === root.uuid ) { + + return root; + + } + + // search into skeleton bones. + if ( root.skeleton ) { + + var searchSkeleton = function( skeleton ) { + + for( var i = 0; i < skeleton.bones.length; i ++ ) { + + var bone = skeleton.bones[ i ]; + + if ( bone.name === nodeName ) { + + return bone; + + } + } + + return null; + + }; + + var bone = searchSkeleton( root.skeleton ); + + if ( bone ) { + + return bone; + + } + } + + // search into node subtree. + if ( root.children ) { + + var searchNodeSubtree = function( children ) { + + for( var i = 0; i < children.length; i ++ ) { + + var childNode = children[ i ]; + + if ( childNode.name === nodeName || childNode.uuid === nodeName ) { + + return childNode; + + } + + var result = searchNodeSubtree( childNode.children ); + + if ( result ) return result; + + } + + return null; + + }; + + var subTreeNode = searchNodeSubtree( root.children ); + + if ( subTreeNode ) { + + return subTreeNode; + + } + + } + + return null; + + }; + + /** + * + * A group of objects that receives a shared animation state. + * + * Usage: + * + * - Add objects you would otherwise pass as 'root' to the + * constructor or the .clipAction method of AnimationMixer. + * + * - Instead pass this object as 'root'. + * + * - You can also add and remove objects later when the mixer + * is running. + * + * Note: + * + * Objects of this class appear as one object to the mixer, + * so cache control of the individual objects must be done + * on the group. + * + * Limitation: + * + * - The animated properties must be compatible among the + * all objects in the group. + * + * - A single property can either be controlled through a + * target group or directly, but not both. + * + * @author tschw + */ + + function AnimationObjectGroup( var_args ) { + + this.uuid = _Math.generateUUID(); + + // cached objects followed by the active ones + this._objects = Array.prototype.slice.call( arguments ); + + this.nCachedObjects_ = 0; // threshold + // note: read by PropertyBinding.Composite + + var indices = {}; + this._indicesByUUID = indices; // for bookkeeping + + for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + + indices[ arguments[ i ].uuid ] = i; + + } + + this._paths = []; // inside: string + this._parsedPaths = []; // inside: { we don't care, here } + this._bindings = []; // inside: Array< PropertyBinding > + this._bindingsIndicesByPath = {}; // inside: indices in these arrays + + var scope = this; + + this.stats = { + + objects: { + get total() { return scope._objects.length; }, + get inUse() { return this.total - scope.nCachedObjects_; } + }, + + get bindingsPerObject() { return scope._bindings.length; } + + }; + + } + + AnimationObjectGroup.prototype = { + + constructor: AnimationObjectGroup, + + isAnimationObjectGroup: true, + + add: function( var_args ) { + + var objects = this._objects, + nObjects = objects.length, + nCachedObjects = this.nCachedObjects_, + indicesByUUID = this._indicesByUUID, + paths = this._paths, + parsedPaths = this._parsedPaths, + bindings = this._bindings, + nBindings = bindings.length; + + for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + + var object = arguments[ i ], + uuid = object.uuid, + index = indicesByUUID[ uuid ]; + + if ( index === undefined ) { + + // unknown object -> add it to the ACTIVE region + + index = nObjects ++; + indicesByUUID[ uuid ] = index; + objects.push( object ); + + // accounting is done, now do the same for all bindings + + for ( var j = 0, m = nBindings; j !== m; ++ j ) { + + bindings[ j ].push( + new PropertyBinding( + object, paths[ j ], parsedPaths[ j ] ) ); + + } + + } else if ( index < nCachedObjects ) { + + var knownObject = objects[ index ]; + + // move existing object to the ACTIVE region + + var firstActiveIndex = -- nCachedObjects, + lastCachedObject = objects[ firstActiveIndex ]; + + indicesByUUID[ lastCachedObject.uuid ] = index; + objects[ index ] = lastCachedObject; + + indicesByUUID[ uuid ] = firstActiveIndex; + objects[ firstActiveIndex ] = object; + + // accounting is done, now do the same for all bindings + + for ( var j = 0, m = nBindings; j !== m; ++ j ) { + + var bindingsForPath = bindings[ j ], + lastCached = bindingsForPath[ firstActiveIndex ], + binding = bindingsForPath[ index ]; + + bindingsForPath[ index ] = lastCached; + + if ( binding === undefined ) { + + // since we do not bother to create new bindings + // for objects that are cached, the binding may + // or may not exist + + binding = new PropertyBinding( + object, paths[ j ], parsedPaths[ j ] ); + + } + + bindingsForPath[ firstActiveIndex ] = binding; + + } + + } else if ( objects[ index ] !== knownObject) { + + console.error( "Different objects with the same UUID " + + "detected. Clean the caches or recreate your " + + "infrastructure when reloading scenes..." ); + + } // else the object is already where we want it to be + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + }, + + remove: function( var_args ) { + + var objects = this._objects, + nCachedObjects = this.nCachedObjects_, + indicesByUUID = this._indicesByUUID, + bindings = this._bindings, + nBindings = bindings.length; + + for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + + var object = arguments[ i ], + uuid = object.uuid, + index = indicesByUUID[ uuid ]; + + if ( index !== undefined && index >= nCachedObjects ) { + + // move existing object into the CACHED region + + var lastCachedIndex = nCachedObjects ++, + firstActiveObject = objects[ lastCachedIndex ]; + + indicesByUUID[ firstActiveObject.uuid ] = index; + objects[ index ] = firstActiveObject; + + indicesByUUID[ uuid ] = lastCachedIndex; + objects[ lastCachedIndex ] = object; + + // accounting is done, now do the same for all bindings + + for ( var j = 0, m = nBindings; j !== m; ++ j ) { + + var bindingsForPath = bindings[ j ], + firstActive = bindingsForPath[ lastCachedIndex ], + binding = bindingsForPath[ index ]; + + bindingsForPath[ index ] = firstActive; + bindingsForPath[ lastCachedIndex ] = binding; + + } + + } + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + }, + + // remove & forget + uncache: function( var_args ) { + + var objects = this._objects, + nObjects = objects.length, + nCachedObjects = this.nCachedObjects_, + indicesByUUID = this._indicesByUUID, + bindings = this._bindings, + nBindings = bindings.length; + + for ( var i = 0, n = arguments.length; i !== n; ++ i ) { + + var object = arguments[ i ], + uuid = object.uuid, + index = indicesByUUID[ uuid ]; + + if ( index !== undefined ) { + + delete indicesByUUID[ uuid ]; + + if ( index < nCachedObjects ) { + + // object is cached, shrink the CACHED region + + var firstActiveIndex = -- nCachedObjects, + lastCachedObject = objects[ firstActiveIndex ], + lastIndex = -- nObjects, + lastObject = objects[ lastIndex ]; + + // last cached object takes this object's place + indicesByUUID[ lastCachedObject.uuid ] = index; + objects[ index ] = lastCachedObject; + + // last object goes to the activated slot and pop + indicesByUUID[ lastObject.uuid ] = firstActiveIndex; + objects[ firstActiveIndex ] = lastObject; + objects.pop(); + + // accounting is done, now do the same for all bindings + + for ( var j = 0, m = nBindings; j !== m; ++ j ) { + + var bindingsForPath = bindings[ j ], + lastCached = bindingsForPath[ firstActiveIndex ], + last = bindingsForPath[ lastIndex ]; + + bindingsForPath[ index ] = lastCached; + bindingsForPath[ firstActiveIndex ] = last; + bindingsForPath.pop(); + + } + + } else { + + // object is active, just swap with the last and pop + + var lastIndex = -- nObjects, + lastObject = objects[ lastIndex ]; + + indicesByUUID[ lastObject.uuid ] = index; + objects[ index ] = lastObject; + objects.pop(); + + // accounting is done, now do the same for all bindings + + for ( var j = 0, m = nBindings; j !== m; ++ j ) { + + var bindingsForPath = bindings[ j ]; + + bindingsForPath[ index ] = bindingsForPath[ lastIndex ]; + bindingsForPath.pop(); + + } + + } // cached or active + + } // if object is known + + } // for arguments + + this.nCachedObjects_ = nCachedObjects; + + }, + + // Internal interface used by befriended PropertyBinding.Composite: + + subscribe_: function( path, parsedPath ) { + // returns an array of bindings for the given path that is changed + // according to the contained objects in the group + + var indicesByPath = this._bindingsIndicesByPath, + index = indicesByPath[ path ], + bindings = this._bindings; + + if ( index !== undefined ) return bindings[ index ]; + + var paths = this._paths, + parsedPaths = this._parsedPaths, + objects = this._objects, + nObjects = objects.length, + nCachedObjects = this.nCachedObjects_, + bindingsForPath = new Array( nObjects ); + + index = bindings.length; + + indicesByPath[ path ] = index; + + paths.push( path ); + parsedPaths.push( parsedPath ); + bindings.push( bindingsForPath ); + + for ( var i = nCachedObjects, + n = objects.length; i !== n; ++ i ) { + + var object = objects[ i ]; + + bindingsForPath[ i ] = + new PropertyBinding( object, path, parsedPath ); + + } + + return bindingsForPath; + + }, + + unsubscribe_: function( path ) { + // tells the group to forget about a property path and no longer + // update the array previously obtained with 'subscribe_' + + var indicesByPath = this._bindingsIndicesByPath, + index = indicesByPath[ path ]; + + if ( index !== undefined ) { + + var paths = this._paths, + parsedPaths = this._parsedPaths, + bindings = this._bindings, + lastBindingsIndex = bindings.length - 1, + lastBindings = bindings[ lastBindingsIndex ], + lastBindingsPath = path[ lastBindingsIndex ]; + + indicesByPath[ lastBindingsPath ] = index; + + bindings[ index ] = lastBindings; + bindings.pop(); + + parsedPaths[ index ] = parsedPaths[ lastBindingsIndex ]; + parsedPaths.pop(); + + paths[ index ] = paths[ lastBindingsIndex ]; + paths.pop(); + + } + + } + + }; + + /** + * + * Action provided by AnimationMixer for scheduling clip playback on specific + * objects. + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + * + */ + + function AnimationAction( mixer, clip, localRoot ) { + + this._mixer = mixer; + this._clip = clip; + this._localRoot = localRoot || null; + + var tracks = clip.tracks, + nTracks = tracks.length, + interpolants = new Array( nTracks ); + + var interpolantSettings = { + endingStart: ZeroCurvatureEnding, + endingEnd: ZeroCurvatureEnding + }; + + for ( var i = 0; i !== nTracks; ++ i ) { + + var interpolant = tracks[ i ].createInterpolant( null ); + interpolants[ i ] = interpolant; + interpolant.settings = interpolantSettings; + + } + + this._interpolantSettings = interpolantSettings; + + this._interpolants = interpolants; // bound by the mixer + + // inside: PropertyMixer (managed by the mixer) + this._propertyBindings = new Array( nTracks ); + + this._cacheIndex = null; // for the memory manager + this._byClipCacheIndex = null; // for the memory manager + + this._timeScaleInterpolant = null; + this._weightInterpolant = null; + + this.loop = LoopRepeat; + this._loopCount = -1; + + // global mixer time when the action is to be started + // it's set back to 'null' upon start of the action + this._startTime = null; + + // scaled local time of the action + // gets clamped or wrapped to 0..clip.duration according to loop + this.time = 0; + + this.timeScale = 1; + this._effectiveTimeScale = 1; + + this.weight = 1; + this._effectiveWeight = 1; + + this.repetitions = Infinity; // no. of repetitions when looping + + this.paused = false; // false -> zero effective time scale + this.enabled = true; // true -> zero effective weight + + this.clampWhenFinished = false; // keep feeding the last frame? + + this.zeroSlopeAtStart = true; // for smooth interpolation w/o separate + this.zeroSlopeAtEnd = true; // clips for start, loop and end + + } + + AnimationAction.prototype = { + + constructor: AnimationAction, + + // State & Scheduling + + play: function() { + + this._mixer._activateAction( this ); + + return this; + + }, + + stop: function() { + + this._mixer._deactivateAction( this ); + + return this.reset(); + + }, + + reset: function() { + + this.paused = false; + this.enabled = true; + + this.time = 0; // restart clip + this._loopCount = -1; // forget previous loops + this._startTime = null; // forget scheduling + + return this.stopFading().stopWarping(); + + }, + + isRunning: function() { + + return this.enabled && ! this.paused && this.timeScale !== 0 && + this._startTime === null && this._mixer._isActiveAction( this ); + + }, + + // return true when play has been called + isScheduled: function() { + + return this._mixer._isActiveAction( this ); + + }, + + startAt: function( time ) { + + this._startTime = time; + + return this; + + }, + + setLoop: function( mode, repetitions ) { + + this.loop = mode; + this.repetitions = repetitions; + + return this; + + }, + + // Weight + + // set the weight stopping any scheduled fading + // although .enabled = false yields an effective weight of zero, this + // method does *not* change .enabled, because it would be confusing + setEffectiveWeight: function( weight ) { + + this.weight = weight; + + // note: same logic as when updated at runtime + this._effectiveWeight = this.enabled ? weight : 0; + + return this.stopFading(); + + }, + + // return the weight considering fading and .enabled + getEffectiveWeight: function() { + + return this._effectiveWeight; + + }, + + fadeIn: function( duration ) { + + return this._scheduleFading( duration, 0, 1 ); + + }, + + fadeOut: function( duration ) { + + return this._scheduleFading( duration, 1, 0 ); + + }, + + crossFadeFrom: function( fadeOutAction, duration, warp ) { + + fadeOutAction.fadeOut( duration ); + this.fadeIn( duration ); + + if( warp ) { + + var fadeInDuration = this._clip.duration, + fadeOutDuration = fadeOutAction._clip.duration, + + startEndRatio = fadeOutDuration / fadeInDuration, + endStartRatio = fadeInDuration / fadeOutDuration; + + fadeOutAction.warp( 1.0, startEndRatio, duration ); + this.warp( endStartRatio, 1.0, duration ); + + } + + return this; + + }, + + crossFadeTo: function( fadeInAction, duration, warp ) { + + return fadeInAction.crossFadeFrom( this, duration, warp ); + + }, + + stopFading: function() { + + var weightInterpolant = this._weightInterpolant; + + if ( weightInterpolant !== null ) { + + this._weightInterpolant = null; + this._mixer._takeBackControlInterpolant( weightInterpolant ); + + } + + return this; + + }, + + // Time Scale Control + + // set the weight stopping any scheduled warping + // although .paused = true yields an effective time scale of zero, this + // method does *not* change .paused, because it would be confusing + setEffectiveTimeScale: function( timeScale ) { + + this.timeScale = timeScale; + this._effectiveTimeScale = this.paused ? 0 :timeScale; + + return this.stopWarping(); + + }, + + // return the time scale considering warping and .paused + getEffectiveTimeScale: function() { + + return this._effectiveTimeScale; + + }, + + setDuration: function( duration ) { + + this.timeScale = this._clip.duration / duration; + + return this.stopWarping(); + + }, + + syncWith: function( action ) { + + this.time = action.time; + this.timeScale = action.timeScale; + + return this.stopWarping(); + + }, + + halt: function( duration ) { + + return this.warp( this._effectiveTimeScale, 0, duration ); + + }, + + warp: function( startTimeScale, endTimeScale, duration ) { + + var mixer = this._mixer, now = mixer.time, + interpolant = this._timeScaleInterpolant, + + timeScale = this.timeScale; + + if ( interpolant === null ) { + + interpolant = mixer._lendControlInterpolant(), + this._timeScaleInterpolant = interpolant; + + } + + var times = interpolant.parameterPositions, + values = interpolant.sampleValues; + + times[ 0 ] = now; + times[ 1 ] = now + duration; + + values[ 0 ] = startTimeScale / timeScale; + values[ 1 ] = endTimeScale / timeScale; + + return this; + + }, + + stopWarping: function() { + + var timeScaleInterpolant = this._timeScaleInterpolant; + + if ( timeScaleInterpolant !== null ) { + + this._timeScaleInterpolant = null; + this._mixer._takeBackControlInterpolant( timeScaleInterpolant ); + + } + + return this; + + }, + + // Object Accessors + + getMixer: function() { + + return this._mixer; + + }, + + getClip: function() { + + return this._clip; + + }, + + getRoot: function() { + + return this._localRoot || this._mixer._root; + + }, + + // Interna + + _update: function( time, deltaTime, timeDirection, accuIndex ) { + // called by the mixer + + var startTime = this._startTime; + + if ( startTime !== null ) { + + // check for scheduled start of action + + var timeRunning = ( time - startTime ) * timeDirection; + if ( timeRunning < 0 || timeDirection === 0 ) { + + return; // yet to come / don't decide when delta = 0 + + } + + // start + + this._startTime = null; // unschedule + deltaTime = timeDirection * timeRunning; + + } + + // apply time scale and advance time + + deltaTime *= this._updateTimeScale( time ); + var clipTime = this._updateTime( deltaTime ); + + // note: _updateTime may disable the action resulting in + // an effective weight of 0 + + var weight = this._updateWeight( time ); + + if ( weight > 0 ) { + + var interpolants = this._interpolants; + var propertyMixers = this._propertyBindings; + + for ( var j = 0, m = interpolants.length; j !== m; ++ j ) { + + interpolants[ j ].evaluate( clipTime ); + propertyMixers[ j ].accumulate( accuIndex, weight ); + + } + + } + + }, + + _updateWeight: function( time ) { + + var weight = 0; + + if ( this.enabled ) { + + weight = this.weight; + var interpolant = this._weightInterpolant; + + if ( interpolant !== null ) { + + var interpolantValue = interpolant.evaluate( time )[ 0 ]; + + weight *= interpolantValue; + + if ( time > interpolant.parameterPositions[ 1 ] ) { + + this.stopFading(); + + if ( interpolantValue === 0 ) { + + // faded out, disable + this.enabled = false; + + } + + } + + } + + } + + this._effectiveWeight = weight; + return weight; + + }, + + _updateTimeScale: function( time ) { + + var timeScale = 0; + + if ( ! this.paused ) { + + timeScale = this.timeScale; + + var interpolant = this._timeScaleInterpolant; + + if ( interpolant !== null ) { + + var interpolantValue = interpolant.evaluate( time )[ 0 ]; + + timeScale *= interpolantValue; + + if ( time > interpolant.parameterPositions[ 1 ] ) { + + this.stopWarping(); + + if ( timeScale === 0 ) { + + // motion has halted, pause + this.paused = true; + + } else { + + // warp done - apply final time scale + this.timeScale = timeScale; + + } + + } + + } + + } + + this._effectiveTimeScale = timeScale; + return timeScale; + + }, + + _updateTime: function( deltaTime ) { + + var time = this.time + deltaTime; + + if ( deltaTime === 0 ) return time; + + var duration = this._clip.duration, + + loop = this.loop, + loopCount = this._loopCount; + + if ( loop === LoopOnce ) { + + if ( loopCount === -1 ) { + // just started + + this.loopCount = 0; + this._setEndings( true, true, false ); + + } + + handle_stop: { + + if ( time >= duration ) { + + time = duration; + + } else if ( time < 0 ) { + + time = 0; + + } else break handle_stop; + + if ( this.clampWhenFinished ) this.paused = true; + else this.enabled = false; + + this._mixer.dispatchEvent( { + type: 'finished', action: this, + direction: deltaTime < 0 ? -1 : 1 + } ); + + } + + } else { // repetitive Repeat or PingPong + + var pingPong = ( loop === LoopPingPong ); + + if ( loopCount === -1 ) { + // just started + + if ( deltaTime >= 0 ) { + + loopCount = 0; + + this._setEndings( + true, this.repetitions === 0, pingPong ); + + } else { + + // when looping in reverse direction, the initial + // transition through zero counts as a repetition, + // so leave loopCount at -1 + + this._setEndings( + this.repetitions === 0, true, pingPong ); + + } + + } + + if ( time >= duration || time < 0 ) { + // wrap around + + var loopDelta = Math.floor( time / duration ); // signed + time -= duration * loopDelta; + + loopCount += Math.abs( loopDelta ); + + var pending = this.repetitions - loopCount; + + if ( pending < 0 ) { + // have to stop (switch state, clamp time, fire event) + + if ( this.clampWhenFinished ) this.paused = true; + else this.enabled = false; + + time = deltaTime > 0 ? duration : 0; + + this._mixer.dispatchEvent( { + type: 'finished', action: this, + direction: deltaTime > 0 ? 1 : -1 + } ); + + } else { + // keep running + + if ( pending === 0 ) { + // entering the last round + + var atStart = deltaTime < 0; + this._setEndings( atStart, ! atStart, pingPong ); + + } else { + + this._setEndings( false, false, pingPong ); + + } + + this._loopCount = loopCount; + + this._mixer.dispatchEvent( { + type: 'loop', action: this, loopDelta: loopDelta + } ); + + } + + } + + if ( pingPong && ( loopCount & 1 ) === 1 ) { + // invert time for the "pong round" + + this.time = time; + return duration - time; + + } + + } + + this.time = time; + return time; + + }, + + _setEndings: function( atStart, atEnd, pingPong ) { + + var settings = this._interpolantSettings; + + if ( pingPong ) { + + settings.endingStart = ZeroSlopeEnding; + settings.endingEnd = ZeroSlopeEnding; + + } else { + + // assuming for LoopOnce atStart == atEnd == true + + if ( atStart ) { + + settings.endingStart = this.zeroSlopeAtStart ? + ZeroSlopeEnding : ZeroCurvatureEnding; + + } else { + + settings.endingStart = WrapAroundEnding; + + } + + if ( atEnd ) { + + settings.endingEnd = this.zeroSlopeAtEnd ? + ZeroSlopeEnding : ZeroCurvatureEnding; + + } else { + + settings.endingEnd = WrapAroundEnding; + + } + + } + + }, + + _scheduleFading: function( duration, weightNow, weightThen ) { + + var mixer = this._mixer, now = mixer.time, + interpolant = this._weightInterpolant; + + if ( interpolant === null ) { + + interpolant = mixer._lendControlInterpolant(), + this._weightInterpolant = interpolant; + + } + + var times = interpolant.parameterPositions, + values = interpolant.sampleValues; + + times[ 0 ] = now; values[ 0 ] = weightNow; + times[ 1 ] = now + duration; values[ 1 ] = weightThen; + + return this; + + } + + }; + + /** + * + * Player for AnimationClips. + * + * + * @author Ben Houston / http://clara.io/ + * @author David Sarno / http://lighthaus.us/ + * @author tschw + */ + + function AnimationMixer( root ) { + + this._root = root; + this._initMemoryManager(); + this._accuIndex = 0; + + this.time = 0; + + this.timeScale = 1.0; + + } + + Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, { + + // return an action for a clip optionally using a custom root target + // object (this method allocates a lot of dynamic memory in case a + // previously unknown clip/root combination is specified) + clipAction: function( clip, optionalRoot ) { + + var root = optionalRoot || this._root, + rootUuid = root.uuid, + + clipObject = typeof clip === 'string' ? + AnimationClip.findByName( root, clip ) : clip, + + clipUuid = clipObject !== null ? clipObject.uuid : clip, + + actionsForClip = this._actionsByClip[ clipUuid ], + prototypeAction = null; + + if ( actionsForClip !== undefined ) { + + var existingAction = + actionsForClip.actionByRoot[ rootUuid ]; + + if ( existingAction !== undefined ) { + + return existingAction; + + } + + // we know the clip, so we don't have to parse all + // the bindings again but can just copy + prototypeAction = actionsForClip.knownActions[ 0 ]; + + // also, take the clip from the prototype action + if ( clipObject === null ) + clipObject = prototypeAction._clip; + + } + + // clip must be known when specified via string + if ( clipObject === null ) return null; + + // allocate all resources required to run it + var newAction = new AnimationAction( this, clipObject, optionalRoot ); + + this._bindAction( newAction, prototypeAction ); + + // and make the action known to the memory manager + this._addInactiveAction( newAction, clipUuid, rootUuid ); + + return newAction; + + }, + + // get an existing action + existingAction: function( clip, optionalRoot ) { + + var root = optionalRoot || this._root, + rootUuid = root.uuid, + + clipObject = typeof clip === 'string' ? + AnimationClip.findByName( root, clip ) : clip, + + clipUuid = clipObject ? clipObject.uuid : clip, + + actionsForClip = this._actionsByClip[ clipUuid ]; + + if ( actionsForClip !== undefined ) { + + return actionsForClip.actionByRoot[ rootUuid ] || null; + + } + + return null; + + }, + + // deactivates all previously scheduled actions + stopAllAction: function() { + + var actions = this._actions, + nActions = this._nActiveActions, + bindings = this._bindings, + nBindings = this._nActiveBindings; + + this._nActiveActions = 0; + this._nActiveBindings = 0; + + for ( var i = 0; i !== nActions; ++ i ) { + + actions[ i ].reset(); + + } + + for ( var i = 0; i !== nBindings; ++ i ) { + + bindings[ i ].useCount = 0; + + } + + return this; + + }, + + // advance the time and update apply the animation + update: function( deltaTime ) { + + deltaTime *= this.timeScale; + + var actions = this._actions, + nActions = this._nActiveActions, + + time = this.time += deltaTime, + timeDirection = Math.sign( deltaTime ), + + accuIndex = this._accuIndex ^= 1; + + // run active actions + + for ( var i = 0; i !== nActions; ++ i ) { + + var action = actions[ i ]; + + if ( action.enabled ) { + + action._update( time, deltaTime, timeDirection, accuIndex ); + + } + + } + + // update scene graph + + var bindings = this._bindings, + nBindings = this._nActiveBindings; + + for ( var i = 0; i !== nBindings; ++ i ) { + + bindings[ i ].apply( accuIndex ); + + } + + return this; + + }, + + // return this mixer's root target object + getRoot: function() { + + return this._root; + + }, + + // free all resources specific to a particular clip + uncacheClip: function( clip ) { + + var actions = this._actions, + clipUuid = clip.uuid, + actionsByClip = this._actionsByClip, + actionsForClip = actionsByClip[ clipUuid ]; + + if ( actionsForClip !== undefined ) { + + // note: just calling _removeInactiveAction would mess up the + // iteration state and also require updating the state we can + // just throw away + + var actionsToRemove = actionsForClip.knownActions; + + for ( var i = 0, n = actionsToRemove.length; i !== n; ++ i ) { + + var action = actionsToRemove[ i ]; + + this._deactivateAction( action ); + + var cacheIndex = action._cacheIndex, + lastInactiveAction = actions[ actions.length - 1 ]; + + action._cacheIndex = null; + action._byClipCacheIndex = null; + + lastInactiveAction._cacheIndex = cacheIndex; + actions[ cacheIndex ] = lastInactiveAction; + actions.pop(); + + this._removeInactiveBindingsForAction( action ); + + } + + delete actionsByClip[ clipUuid ]; + + } + + }, + + // free all resources specific to a particular root target object + uncacheRoot: function( root ) { + + var rootUuid = root.uuid, + actionsByClip = this._actionsByClip; + + for ( var clipUuid in actionsByClip ) { + + var actionByRoot = actionsByClip[ clipUuid ].actionByRoot, + action = actionByRoot[ rootUuid ]; + + if ( action !== undefined ) { + + this._deactivateAction( action ); + this._removeInactiveAction( action ); + + } + + } + + var bindingsByRoot = this._bindingsByRootAndName, + bindingByName = bindingsByRoot[ rootUuid ]; + + if ( bindingByName !== undefined ) { + + for ( var trackName in bindingByName ) { + + var binding = bindingByName[ trackName ]; + binding.restoreOriginalState(); + this._removeInactiveBinding( binding ); + + } + + } + + }, + + // remove a targeted clip from the cache + uncacheAction: function( clip, optionalRoot ) { + + var action = this.existingAction( clip, optionalRoot ); + + if ( action !== null ) { + + this._deactivateAction( action ); + this._removeInactiveAction( action ); + + } + + } + + } ); + + // Implementation details: + + Object.assign( AnimationMixer.prototype, { + + _bindAction: function( action, prototypeAction ) { + + var root = action._localRoot || this._root, + tracks = action._clip.tracks, + nTracks = tracks.length, + bindings = action._propertyBindings, + interpolants = action._interpolants, + rootUuid = root.uuid, + bindingsByRoot = this._bindingsByRootAndName, + bindingsByName = bindingsByRoot[ rootUuid ]; + + if ( bindingsByName === undefined ) { + + bindingsByName = {}; + bindingsByRoot[ rootUuid ] = bindingsByName; + + } + + for ( var i = 0; i !== nTracks; ++ i ) { + + var track = tracks[ i ], + trackName = track.name, + binding = bindingsByName[ trackName ]; + + if ( binding !== undefined ) { + + bindings[ i ] = binding; + + } else { + + binding = bindings[ i ]; + + if ( binding !== undefined ) { + + // existing binding, make sure the cache knows + + if ( binding._cacheIndex === null ) { + + ++ binding.referenceCount; + this._addInactiveBinding( binding, rootUuid, trackName ); + + } + + continue; + + } + + var path = prototypeAction && prototypeAction. + _propertyBindings[ i ].binding.parsedPath; + + binding = new PropertyMixer( + PropertyBinding.create( root, trackName, path ), + track.ValueTypeName, track.getValueSize() ); + + ++ binding.referenceCount; + this._addInactiveBinding( binding, rootUuid, trackName ); + + bindings[ i ] = binding; + + } + + interpolants[ i ].resultBuffer = binding.buffer; + + } + + }, + + _activateAction: function( action ) { + + if ( ! this._isActiveAction( action ) ) { + + if ( action._cacheIndex === null ) { + + // this action has been forgotten by the cache, but the user + // appears to be still using it -> rebind + + var rootUuid = ( action._localRoot || this._root ).uuid, + clipUuid = action._clip.uuid, + actionsForClip = this._actionsByClip[ clipUuid ]; + + this._bindAction( action, + actionsForClip && actionsForClip.knownActions[ 0 ] ); + + this._addInactiveAction( action, clipUuid, rootUuid ); + + } + + var bindings = action._propertyBindings; + + // increment reference counts / sort out state + for ( var i = 0, n = bindings.length; i !== n; ++ i ) { + + var binding = bindings[ i ]; + + if ( binding.useCount ++ === 0 ) { + + this._lendBinding( binding ); + binding.saveOriginalState(); + + } + + } + + this._lendAction( action ); + + } + + }, + + _deactivateAction: function( action ) { + + if ( this._isActiveAction( action ) ) { + + var bindings = action._propertyBindings; + + // decrement reference counts / sort out state + for ( var i = 0, n = bindings.length; i !== n; ++ i ) { + + var binding = bindings[ i ]; + + if ( -- binding.useCount === 0 ) { + + binding.restoreOriginalState(); + this._takeBackBinding( binding ); + + } + + } + + this._takeBackAction( action ); + + } + + }, + + // Memory manager + + _initMemoryManager: function() { + + this._actions = []; // 'nActiveActions' followed by inactive ones + this._nActiveActions = 0; + + this._actionsByClip = {}; + // inside: + // { + // knownActions: Array< AnimationAction > - used as prototypes + // actionByRoot: AnimationAction - lookup + // } + + + this._bindings = []; // 'nActiveBindings' followed by inactive ones + this._nActiveBindings = 0; + + this._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer > + + + this._controlInterpolants = []; // same game as above + this._nActiveControlInterpolants = 0; + + var scope = this; + + this.stats = { + + actions: { + get total() { return scope._actions.length; }, + get inUse() { return scope._nActiveActions; } + }, + bindings: { + get total() { return scope._bindings.length; }, + get inUse() { return scope._nActiveBindings; } + }, + controlInterpolants: { + get total() { return scope._controlInterpolants.length; }, + get inUse() { return scope._nActiveControlInterpolants; } + } + + }; + + }, + + // Memory management for AnimationAction objects + + _isActiveAction: function( action ) { + + var index = action._cacheIndex; + return index !== null && index < this._nActiveActions; + + }, + + _addInactiveAction: function( action, clipUuid, rootUuid ) { + + var actions = this._actions, + actionsByClip = this._actionsByClip, + actionsForClip = actionsByClip[ clipUuid ]; + + if ( actionsForClip === undefined ) { + + actionsForClip = { + + knownActions: [ action ], + actionByRoot: {} + + }; + + action._byClipCacheIndex = 0; + + actionsByClip[ clipUuid ] = actionsForClip; + + } else { + + var knownActions = actionsForClip.knownActions; + + action._byClipCacheIndex = knownActions.length; + knownActions.push( action ); + + } + + action._cacheIndex = actions.length; + actions.push( action ); + + actionsForClip.actionByRoot[ rootUuid ] = action; + + }, + + _removeInactiveAction: function( action ) { + + var actions = this._actions, + lastInactiveAction = actions[ actions.length - 1 ], + cacheIndex = action._cacheIndex; + + lastInactiveAction._cacheIndex = cacheIndex; + actions[ cacheIndex ] = lastInactiveAction; + actions.pop(); + + action._cacheIndex = null; + + + var clipUuid = action._clip.uuid, + actionsByClip = this._actionsByClip, + actionsForClip = actionsByClip[ clipUuid ], + knownActionsForClip = actionsForClip.knownActions, + + lastKnownAction = + knownActionsForClip[ knownActionsForClip.length - 1 ], + + byClipCacheIndex = action._byClipCacheIndex; + + lastKnownAction._byClipCacheIndex = byClipCacheIndex; + knownActionsForClip[ byClipCacheIndex ] = lastKnownAction; + knownActionsForClip.pop(); + + action._byClipCacheIndex = null; + + + var actionByRoot = actionsForClip.actionByRoot, + rootUuid = ( actions._localRoot || this._root ).uuid; + + delete actionByRoot[ rootUuid ]; + + if ( knownActionsForClip.length === 0 ) { + + delete actionsByClip[ clipUuid ]; + + } + + this._removeInactiveBindingsForAction( action ); + + }, + + _removeInactiveBindingsForAction: function( action ) { + + var bindings = action._propertyBindings; + for ( var i = 0, n = bindings.length; i !== n; ++ i ) { + + var binding = bindings[ i ]; + + if ( -- binding.referenceCount === 0 ) { + + this._removeInactiveBinding( binding ); + + } + + } + + }, + + _lendAction: function( action ) { + + // [ active actions | inactive actions ] + // [ active actions >| inactive actions ] + // s a + // <-swap-> + // a s + + var actions = this._actions, + prevIndex = action._cacheIndex, + + lastActiveIndex = this._nActiveActions ++, + + firstInactiveAction = actions[ lastActiveIndex ]; + + action._cacheIndex = lastActiveIndex; + actions[ lastActiveIndex ] = action; + + firstInactiveAction._cacheIndex = prevIndex; + actions[ prevIndex ] = firstInactiveAction; + + }, + + _takeBackAction: function( action ) { + + // [ active actions | inactive actions ] + // [ active actions |< inactive actions ] + // a s + // <-swap-> + // s a + + var actions = this._actions, + prevIndex = action._cacheIndex, + + firstInactiveIndex = -- this._nActiveActions, + + lastActiveAction = actions[ firstInactiveIndex ]; + + action._cacheIndex = firstInactiveIndex; + actions[ firstInactiveIndex ] = action; + + lastActiveAction._cacheIndex = prevIndex; + actions[ prevIndex ] = lastActiveAction; + + }, + + // Memory management for PropertyMixer objects + + _addInactiveBinding: function( binding, rootUuid, trackName ) { + + var bindingsByRoot = this._bindingsByRootAndName, + bindingByName = bindingsByRoot[ rootUuid ], + + bindings = this._bindings; + + if ( bindingByName === undefined ) { + + bindingByName = {}; + bindingsByRoot[ rootUuid ] = bindingByName; + + } + + bindingByName[ trackName ] = binding; + + binding._cacheIndex = bindings.length; + bindings.push( binding ); + + }, + + _removeInactiveBinding: function( binding ) { + + var bindings = this._bindings, + propBinding = binding.binding, + rootUuid = propBinding.rootNode.uuid, + trackName = propBinding.path, + bindingsByRoot = this._bindingsByRootAndName, + bindingByName = bindingsByRoot[ rootUuid ], + + lastInactiveBinding = bindings[ bindings.length - 1 ], + cacheIndex = binding._cacheIndex; + + lastInactiveBinding._cacheIndex = cacheIndex; + bindings[ cacheIndex ] = lastInactiveBinding; + bindings.pop(); + + delete bindingByName[ trackName ]; + + remove_empty_map: { + + for ( var _ in bindingByName ) break remove_empty_map; + + delete bindingsByRoot[ rootUuid ]; + + } + + }, + + _lendBinding: function( binding ) { + + var bindings = this._bindings, + prevIndex = binding._cacheIndex, + + lastActiveIndex = this._nActiveBindings ++, + + firstInactiveBinding = bindings[ lastActiveIndex ]; + + binding._cacheIndex = lastActiveIndex; + bindings[ lastActiveIndex ] = binding; + + firstInactiveBinding._cacheIndex = prevIndex; + bindings[ prevIndex ] = firstInactiveBinding; + + }, + + _takeBackBinding: function( binding ) { + + var bindings = this._bindings, + prevIndex = binding._cacheIndex, + + firstInactiveIndex = -- this._nActiveBindings, + + lastActiveBinding = bindings[ firstInactiveIndex ]; + + binding._cacheIndex = firstInactiveIndex; + bindings[ firstInactiveIndex ] = binding; + + lastActiveBinding._cacheIndex = prevIndex; + bindings[ prevIndex ] = lastActiveBinding; + + }, + + + // Memory management of Interpolants for weight and time scale + + _lendControlInterpolant: function() { + + var interpolants = this._controlInterpolants, + lastActiveIndex = this._nActiveControlInterpolants ++, + interpolant = interpolants[ lastActiveIndex ]; + + if ( interpolant === undefined ) { + + interpolant = new LinearInterpolant( + new Float32Array( 2 ), new Float32Array( 2 ), + 1, this._controlInterpolantsResultBuffer ); + + interpolant.__cacheIndex = lastActiveIndex; + interpolants[ lastActiveIndex ] = interpolant; + + } + + return interpolant; + + }, + + _takeBackControlInterpolant: function( interpolant ) { + + var interpolants = this._controlInterpolants, + prevIndex = interpolant.__cacheIndex, + + firstInactiveIndex = -- this._nActiveControlInterpolants, + + lastActiveInterpolant = interpolants[ firstInactiveIndex ]; + + interpolant.__cacheIndex = firstInactiveIndex; + interpolants[ firstInactiveIndex ] = interpolant; + + lastActiveInterpolant.__cacheIndex = prevIndex; + interpolants[ prevIndex ] = lastActiveInterpolant; + + }, + + _controlInterpolantsResultBuffer: new Float32Array( 1 ) + + } ); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function Uniform( value ) { + + if ( typeof value === 'string' ) { + + console.warn( 'THREE.Uniform: Type parameter is no longer needed.' ); + value = arguments[ 1 ]; + + } + + this.value = value; + + } + + /** + * @author benaadams / https://twitter.com/ben_a_adams + */ + + function InstancedBufferGeometry() { + + BufferGeometry.call( this ); + + this.type = 'InstancedBufferGeometry'; + this.maxInstancedCount = undefined; + + } + + InstancedBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + InstancedBufferGeometry.prototype.constructor = InstancedBufferGeometry; + + InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true; + + InstancedBufferGeometry.prototype.addGroup = function ( start, count, materialIndex ) { + + this.groups.push( { + + start: start, + count: count, + materialIndex: materialIndex + + } ); + + }; + + InstancedBufferGeometry.prototype.copy = function ( source ) { + + var index = source.index; + + if ( index !== null ) { + + this.setIndex( index.clone() ); + + } + + var attributes = source.attributes; + + for ( var name in attributes ) { + + var attribute = attributes[ name ]; + this.addAttribute( name, attribute.clone() ); + + } + + var groups = source.groups; + + for ( var i = 0, l = groups.length; i < l; i ++ ) { + + var group = groups[ i ]; + this.addGroup( group.start, group.count, group.materialIndex ); + + } + + return this; + + }; + + /** + * @author benaadams / https://twitter.com/ben_a_adams + */ + + function InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, normalized ) { + + this.uuid = _Math.generateUUID(); + + this.data = interleavedBuffer; + this.itemSize = itemSize; + this.offset = offset; + + this.normalized = normalized === true; + + } + + + InterleavedBufferAttribute.prototype = { + + constructor: InterleavedBufferAttribute, + + isInterleavedBufferAttribute: true, + + get count() { + + return this.data.count; + + }, + + get array() { + + return this.data.array; + + }, + + setX: function ( index, x ) { + + this.data.array[ index * this.data.stride + this.offset ] = x; + + return this; + + }, + + setY: function ( index, y ) { + + this.data.array[ index * this.data.stride + this.offset + 1 ] = y; + + return this; + + }, + + setZ: function ( index, z ) { + + this.data.array[ index * this.data.stride + this.offset + 2 ] = z; + + return this; + + }, + + setW: function ( index, w ) { + + this.data.array[ index * this.data.stride + this.offset + 3 ] = w; + + return this; + + }, + + getX: function ( index ) { + + return this.data.array[ index * this.data.stride + this.offset ]; + + }, + + getY: function ( index ) { + + return this.data.array[ index * this.data.stride + this.offset + 1 ]; + + }, + + getZ: function ( index ) { + + return this.data.array[ index * this.data.stride + this.offset + 2 ]; + + }, + + getW: function ( index ) { + + return this.data.array[ index * this.data.stride + this.offset + 3 ]; + + }, + + setXY: function ( index, x, y ) { + + index = index * this.data.stride + this.offset; + + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + + return this; + + }, + + setXYZ: function ( index, x, y, z ) { + + index = index * this.data.stride + this.offset; + + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + this.data.array[ index + 2 ] = z; + + return this; + + }, + + setXYZW: function ( index, x, y, z, w ) { + + index = index * this.data.stride + this.offset; + + this.data.array[ index + 0 ] = x; + this.data.array[ index + 1 ] = y; + this.data.array[ index + 2 ] = z; + this.data.array[ index + 3 ] = w; + + return this; + + } + + }; + + /** + * @author benaadams / https://twitter.com/ben_a_adams + */ + + function InterleavedBuffer( array, stride ) { + + this.uuid = _Math.generateUUID(); + + this.array = array; + this.stride = stride; + this.count = array !== undefined ? array.length / stride : 0; + + this.dynamic = false; + this.updateRange = { offset: 0, count: - 1 }; + + this.version = 0; + + } + + InterleavedBuffer.prototype = { + + constructor: InterleavedBuffer, + + isInterleavedBuffer: true, + + set needsUpdate( value ) { + + if ( value === true ) this.version ++; + + }, + + setArray: function ( array ) { + + if ( Array.isArray( array ) ) { + + throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); + + } + + this.count = array !== undefined ? array.length / this.stride : 0; + this.array = array; + + }, + + setDynamic: function ( value ) { + + this.dynamic = value; + + return this; + + }, + + copy: function ( source ) { + + this.array = new source.array.constructor( source.array ); + this.count = source.count; + this.stride = source.stride; + this.dynamic = source.dynamic; + + return this; + + }, + + copyAt: function ( index1, attribute, index2 ) { + + index1 *= this.stride; + index2 *= attribute.stride; + + for ( var i = 0, l = this.stride; i < l; i ++ ) { + + this.array[ index1 + i ] = attribute.array[ index2 + i ]; + + } + + return this; + + }, + + set: function ( value, offset ) { + + if ( offset === undefined ) offset = 0; + + this.array.set( value, offset ); + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + } + + }; + + /** + * @author benaadams / https://twitter.com/ben_a_adams + */ + + function InstancedInterleavedBuffer( array, stride, meshPerAttribute ) { + + InterleavedBuffer.call( this, array, stride ); + + this.meshPerAttribute = meshPerAttribute || 1; + + } + + InstancedInterleavedBuffer.prototype = Object.create( InterleavedBuffer.prototype ); + InstancedInterleavedBuffer.prototype.constructor = InstancedInterleavedBuffer; + + InstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true; + + InstancedInterleavedBuffer.prototype.copy = function ( source ) { + + InterleavedBuffer.prototype.copy.call( this, source ); + + this.meshPerAttribute = source.meshPerAttribute; + + return this; + + }; + + /** + * @author benaadams / https://twitter.com/ben_a_adams + */ + + function InstancedBufferAttribute( array, itemSize, meshPerAttribute ) { + + BufferAttribute.call( this, array, itemSize ); + + this.meshPerAttribute = meshPerAttribute || 1; + + } + + InstancedBufferAttribute.prototype = Object.create( BufferAttribute.prototype ); + InstancedBufferAttribute.prototype.constructor = InstancedBufferAttribute; + + InstancedBufferAttribute.prototype.isInstancedBufferAttribute = true; + + InstancedBufferAttribute.prototype.copy = function ( source ) { + + BufferAttribute.prototype.copy.call( this, source ); + + this.meshPerAttribute = source.meshPerAttribute; + + return this; + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author bhouston / http://clara.io/ + * @author stephomi / http://stephaneginier.com/ + */ + + function Raycaster( origin, direction, near, far ) { + + this.ray = new Ray( origin, direction ); + // direction is assumed to be normalized (for accurate distance calculations) + + this.near = near || 0; + this.far = far || Infinity; + + this.params = { + Mesh: {}, + Line: {}, + LOD: {}, + Points: { threshold: 1 }, + Sprite: {} + }; + + Object.defineProperties( this.params, { + PointCloud: { + get: function () { + console.warn( 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.' ); + return this.Points; + } + } + } ); + + } + + function ascSort( a, b ) { + + return a.distance - b.distance; + + } + + function intersectObject( object, raycaster, intersects, recursive ) { + + if ( object.visible === false ) return; + + object.raycast( raycaster, intersects ); + + if ( recursive === true ) { + + var children = object.children; + + for ( var i = 0, l = children.length; i < l; i ++ ) { + + intersectObject( children[ i ], raycaster, intersects, true ); + + } + + } + + } + + // + + Raycaster.prototype = { + + constructor: Raycaster, + + linePrecision: 1, + + set: function ( origin, direction ) { + + // direction is assumed to be normalized (for accurate distance calculations) + + this.ray.set( origin, direction ); + + }, + + setFromCamera: function ( coords, camera ) { + + if ( (camera && camera.isPerspectiveCamera) ) { + + this.ray.origin.setFromMatrixPosition( camera.matrixWorld ); + this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize(); + + } else if ( (camera && camera.isOrthographicCamera) ) { + + this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera + this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ); + + } else { + + console.error( 'THREE.Raycaster: Unsupported camera type.' ); + + } + + }, + + intersectObject: function ( object, recursive ) { + + var intersects = []; + + intersectObject( object, this, intersects, recursive ); + + intersects.sort( ascSort ); + + return intersects; + + }, + + intersectObjects: function ( objects, recursive ) { + + var intersects = []; + + if ( Array.isArray( objects ) === false ) { + + console.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.' ); + return intersects; + + } + + for ( var i = 0, l = objects.length; i < l; i ++ ) { + + intersectObject( objects[ i ], this, intersects, recursive ); + + } + + intersects.sort( ascSort ); + + return intersects; + + } + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function Clock( autoStart ) { + + this.autoStart = ( autoStart !== undefined ) ? autoStart : true; + + this.startTime = 0; + this.oldTime = 0; + this.elapsedTime = 0; + + this.running = false; + + } + + Clock.prototype = { + + constructor: Clock, + + start: function () { + + this.startTime = ( performance || Date ).now(); + + this.oldTime = this.startTime; + this.elapsedTime = 0; + this.running = true; + + }, + + stop: function () { + + this.getElapsedTime(); + this.running = false; + + }, + + getElapsedTime: function () { + + this.getDelta(); + return this.elapsedTime; + + }, + + getDelta: function () { + + var diff = 0; + + if ( this.autoStart && ! this.running ) { + + this.start(); + + } + + if ( this.running ) { + + var newTime = ( performance || Date ).now(); + + diff = ( newTime - this.oldTime ) / 1000; + this.oldTime = newTime; + + this.elapsedTime += diff; + + } + + return diff; + + } + + }; + + /** + * Spline from Tween.js, slightly optimized (and trashed) + * http://sole.github.com/tween.js/examples/05_spline.html + * + * @author mrdoob / http://mrdoob.com/ + * @author alteredq / http://alteredqualia.com/ + */ + + function Spline( points ) { + + this.points = points; + + var c = [], v3 = { x: 0, y: 0, z: 0 }, + point, intPoint, weight, w2, w3, + pa, pb, pc, pd; + + this.initFromArray = function ( a ) { + + this.points = []; + + for ( var i = 0; i < a.length; i ++ ) { + + this.points[ i ] = { x: a[ i ][ 0 ], y: a[ i ][ 1 ], z: a[ i ][ 2 ] }; + + } + + }; + + this.getPoint = function ( k ) { + + point = ( this.points.length - 1 ) * k; + intPoint = Math.floor( point ); + weight = point - intPoint; + + c[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1; + c[ 1 ] = intPoint; + c[ 2 ] = intPoint > this.points.length - 2 ? this.points.length - 1 : intPoint + 1; + c[ 3 ] = intPoint > this.points.length - 3 ? this.points.length - 1 : intPoint + 2; + + pa = this.points[ c[ 0 ] ]; + pb = this.points[ c[ 1 ] ]; + pc = this.points[ c[ 2 ] ]; + pd = this.points[ c[ 3 ] ]; + + w2 = weight * weight; + w3 = weight * w2; + + v3.x = interpolate( pa.x, pb.x, pc.x, pd.x, weight, w2, w3 ); + v3.y = interpolate( pa.y, pb.y, pc.y, pd.y, weight, w2, w3 ); + v3.z = interpolate( pa.z, pb.z, pc.z, pd.z, weight, w2, w3 ); + + return v3; + + }; + + this.getControlPointsArray = function () { + + var i, p, l = this.points.length, + coords = []; + + for ( i = 0; i < l; i ++ ) { + + p = this.points[ i ]; + coords[ i ] = [ p.x, p.y, p.z ]; + + } + + return coords; + + }; + + // approximate length by summing linear segments + + this.getLength = function ( nSubDivisions ) { + + var i, index, nSamples, position, + point = 0, intPoint = 0, oldIntPoint = 0, + oldPosition = new Vector3(), + tmpVec = new Vector3(), + chunkLengths = [], + totalLength = 0; + + // first point has 0 length + + chunkLengths[ 0 ] = 0; + + if ( ! nSubDivisions ) nSubDivisions = 100; + + nSamples = this.points.length * nSubDivisions; + + oldPosition.copy( this.points[ 0 ] ); + + for ( i = 1; i < nSamples; i ++ ) { + + index = i / nSamples; + + position = this.getPoint( index ); + tmpVec.copy( position ); + + totalLength += tmpVec.distanceTo( oldPosition ); + + oldPosition.copy( position ); + + point = ( this.points.length - 1 ) * index; + intPoint = Math.floor( point ); + + if ( intPoint !== oldIntPoint ) { + + chunkLengths[ intPoint ] = totalLength; + oldIntPoint = intPoint; + + } + + } + + // last point ends with total length + + chunkLengths[ chunkLengths.length ] = totalLength; + + return { chunks: chunkLengths, total: totalLength }; + + }; + + this.reparametrizeByArcLength = function ( samplingCoef ) { + + var i, j, + index, indexCurrent, indexNext, + realDistance, + sampling, position, + newpoints = [], + tmpVec = new Vector3(), + sl = this.getLength(); + + newpoints.push( tmpVec.copy( this.points[ 0 ] ).clone() ); + + for ( i = 1; i < this.points.length; i ++ ) { + + //tmpVec.copy( this.points[ i - 1 ] ); + //linearDistance = tmpVec.distanceTo( this.points[ i ] ); + + realDistance = sl.chunks[ i ] - sl.chunks[ i - 1 ]; + + sampling = Math.ceil( samplingCoef * realDistance / sl.total ); + + indexCurrent = ( i - 1 ) / ( this.points.length - 1 ); + indexNext = i / ( this.points.length - 1 ); + + for ( j = 1; j < sampling - 1; j ++ ) { + + index = indexCurrent + j * ( 1 / sampling ) * ( indexNext - indexCurrent ); + + position = this.getPoint( index ); + newpoints.push( tmpVec.copy( position ).clone() ); + + } + + newpoints.push( tmpVec.copy( this.points[ i ] ).clone() ); + + } + + this.points = newpoints; + + }; + + // Catmull-Rom + + function interpolate( p0, p1, p2, p3, t, t2, t3 ) { + + var v0 = ( p2 - p0 ) * 0.5, + v1 = ( p3 - p1 ) * 0.5; + + return ( 2 * ( p1 - p2 ) + v0 + v1 ) * t3 + ( - 3 * ( p1 - p2 ) - 2 * v0 - v1 ) * t2 + v0 * t + p1; + + } + + } + + /** + * @author bhouston / http://clara.io + * @author WestLangley / http://github.com/WestLangley + * + * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system + * + * The poles (phi) are at the positive and negative y axis. + * The equator starts at positive z. + */ + + function Spherical( radius, phi, theta ) { + + this.radius = ( radius !== undefined ) ? radius : 1.0; + this.phi = ( phi !== undefined ) ? phi : 0; // up / down towards top and bottom pole + this.theta = ( theta !== undefined ) ? theta : 0; // around the equator of the sphere + + return this; + + } + + Spherical.prototype = { + + constructor: Spherical, + + set: function ( radius, phi, theta ) { + + this.radius = radius; + this.phi = phi; + this.theta = theta; + + return this; + + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( other ) { + + this.radius = other.radius; + this.phi = other.phi; + this.theta = other.theta; + + return this; + + }, + + // restrict phi to be betwee EPS and PI-EPS + makeSafe: function() { + + var EPS = 0.000001; + this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) ); + + return this; + + }, + + setFromVector3: function( vec3 ) { + + this.radius = vec3.length(); + + if ( this.radius === 0 ) { + + this.theta = 0; + this.phi = 0; + + } else { + + this.theta = Math.atan2( vec3.x, vec3.z ); // equator angle around y-up axis + this.phi = Math.acos( _Math.clamp( vec3.y / this.radius, - 1, 1 ) ); // polar angle + + } + + return this; + + }, + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function MorphBlendMesh( geometry, material ) { + + Mesh.call( this, geometry, material ); + + this.animationsMap = {}; + this.animationsList = []; + + // prepare default animation + // (all frames played together in 1 second) + + var numFrames = this.geometry.morphTargets.length; + + var name = "__default"; + + var startFrame = 0; + var endFrame = numFrames - 1; + + var fps = numFrames / 1; + + this.createAnimation( name, startFrame, endFrame, fps ); + this.setAnimationWeight( name, 1 ); + + } + + MorphBlendMesh.prototype = Object.create( Mesh.prototype ); + MorphBlendMesh.prototype.constructor = MorphBlendMesh; + + MorphBlendMesh.prototype.createAnimation = function ( name, start, end, fps ) { + + var animation = { + + start: start, + end: end, + + length: end - start + 1, + + fps: fps, + duration: ( end - start ) / fps, + + lastFrame: 0, + currentFrame: 0, + + active: false, + + time: 0, + direction: 1, + weight: 1, + + directionBackwards: false, + mirroredLoop: false + + }; + + this.animationsMap[ name ] = animation; + this.animationsList.push( animation ); + + }; + + MorphBlendMesh.prototype.autoCreateAnimations = function ( fps ) { + + var pattern = /([a-z]+)_?(\d+)/i; + + var firstAnimation, frameRanges = {}; + + var geometry = this.geometry; + + for ( var i = 0, il = geometry.morphTargets.length; i < il; i ++ ) { + + var morph = geometry.morphTargets[ i ]; + var chunks = morph.name.match( pattern ); + + if ( chunks && chunks.length > 1 ) { + + var name = chunks[ 1 ]; + + if ( ! frameRanges[ name ] ) frameRanges[ name ] = { start: Infinity, end: - Infinity }; + + var range = frameRanges[ name ]; + + if ( i < range.start ) range.start = i; + if ( i > range.end ) range.end = i; + + if ( ! firstAnimation ) firstAnimation = name; + + } + + } + + for ( var name in frameRanges ) { + + var range = frameRanges[ name ]; + this.createAnimation( name, range.start, range.end, fps ); + + } + + this.firstAnimation = firstAnimation; + + }; + + MorphBlendMesh.prototype.setAnimationDirectionForward = function ( name ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.direction = 1; + animation.directionBackwards = false; + + } + + }; + + MorphBlendMesh.prototype.setAnimationDirectionBackward = function ( name ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.direction = - 1; + animation.directionBackwards = true; + + } + + }; + + MorphBlendMesh.prototype.setAnimationFPS = function ( name, fps ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.fps = fps; + animation.duration = ( animation.end - animation.start ) / animation.fps; + + } + + }; + + MorphBlendMesh.prototype.setAnimationDuration = function ( name, duration ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.duration = duration; + animation.fps = ( animation.end - animation.start ) / animation.duration; + + } + + }; + + MorphBlendMesh.prototype.setAnimationWeight = function ( name, weight ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.weight = weight; + + } + + }; + + MorphBlendMesh.prototype.setAnimationTime = function ( name, time ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.time = time; + + } + + }; + + MorphBlendMesh.prototype.getAnimationTime = function ( name ) { + + var time = 0; + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + time = animation.time; + + } + + return time; + + }; + + MorphBlendMesh.prototype.getAnimationDuration = function ( name ) { + + var duration = - 1; + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + duration = animation.duration; + + } + + return duration; + + }; + + MorphBlendMesh.prototype.playAnimation = function ( name ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.time = 0; + animation.active = true; + + } else { + + console.warn( "THREE.MorphBlendMesh: animation[" + name + "] undefined in .playAnimation()" ); + + } + + }; + + MorphBlendMesh.prototype.stopAnimation = function ( name ) { + + var animation = this.animationsMap[ name ]; + + if ( animation ) { + + animation.active = false; + + } + + }; + + MorphBlendMesh.prototype.update = function ( delta ) { + + for ( var i = 0, il = this.animationsList.length; i < il; i ++ ) { + + var animation = this.animationsList[ i ]; + + if ( ! animation.active ) continue; + + var frameTime = animation.duration / animation.length; + + animation.time += animation.direction * delta; + + if ( animation.mirroredLoop ) { + + if ( animation.time > animation.duration || animation.time < 0 ) { + + animation.direction *= - 1; + + if ( animation.time > animation.duration ) { + + animation.time = animation.duration; + animation.directionBackwards = true; + + } + + if ( animation.time < 0 ) { + + animation.time = 0; + animation.directionBackwards = false; + + } + + } + + } else { + + animation.time = animation.time % animation.duration; + + if ( animation.time < 0 ) animation.time += animation.duration; + + } + + var keyframe = animation.start + _Math.clamp( Math.floor( animation.time / frameTime ), 0, animation.length - 1 ); + var weight = animation.weight; + + if ( keyframe !== animation.currentFrame ) { + + this.morphTargetInfluences[ animation.lastFrame ] = 0; + this.morphTargetInfluences[ animation.currentFrame ] = 1 * weight; + + this.morphTargetInfluences[ keyframe ] = 0; + + animation.lastFrame = animation.currentFrame; + animation.currentFrame = keyframe; + + } + + var mix = ( animation.time % frameTime ) / frameTime; + + if ( animation.directionBackwards ) mix = 1 - mix; + + if ( animation.currentFrame !== animation.lastFrame ) { + + this.morphTargetInfluences[ animation.currentFrame ] = mix * weight; + this.morphTargetInfluences[ animation.lastFrame ] = ( 1 - mix ) * weight; + + } else { + + this.morphTargetInfluences[ animation.currentFrame ] = weight; + + } + + } + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + function ImmediateRenderObject( material ) { + + Object3D.call( this ); + + this.material = material; + this.render = function ( renderCallback ) {}; + + } + + ImmediateRenderObject.prototype = Object.create( Object3D.prototype ); + ImmediateRenderObject.prototype.constructor = ImmediateRenderObject; + + ImmediateRenderObject.prototype.isImmediateRenderObject = true; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author WestLangley / http://github.com/WestLangley + */ + + function VertexNormalsHelper( object, size, hex, linewidth ) { + + this.object = object; + + this.size = ( size !== undefined ) ? size : 1; + + var color = ( hex !== undefined ) ? hex : 0xff0000; + + var width = ( linewidth !== undefined ) ? linewidth : 1; + + // + + var nNormals = 0; + + var objGeometry = this.object.geometry; + + if ( (objGeometry && objGeometry.isGeometry) ) { + + nNormals = objGeometry.faces.length * 3; + + } else if ( (objGeometry && objGeometry.isBufferGeometry) ) { + + nNormals = objGeometry.attributes.normal.count; + + } + + // + + var geometry = new BufferGeometry(); + + var positions = new Float32Attribute( nNormals * 2 * 3, 3 ); + + geometry.addAttribute( 'position', positions ); + + LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) ); + + // + + this.matrixAutoUpdate = false; + + this.update(); + + } + + VertexNormalsHelper.prototype = Object.create( LineSegments.prototype ); + VertexNormalsHelper.prototype.constructor = VertexNormalsHelper; + + VertexNormalsHelper.prototype.update = ( function () { + + var v1 = new Vector3(); + var v2 = new Vector3(); + var normalMatrix = new Matrix3(); + + return function update() { + + var keys = [ 'a', 'b', 'c' ]; + + this.object.updateMatrixWorld( true ); + + normalMatrix.getNormalMatrix( this.object.matrixWorld ); + + var matrixWorld = this.object.matrixWorld; + + var position = this.geometry.attributes.position; + + // + + var objGeometry = this.object.geometry; + + if ( (objGeometry && objGeometry.isGeometry) ) { + + var vertices = objGeometry.vertices; + + var faces = objGeometry.faces; + + var idx = 0; + + for ( var i = 0, l = faces.length; i < l; i ++ ) { + + var face = faces[ i ]; + + for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) { + + var vertex = vertices[ face[ keys[ j ] ] ]; + + var normal = face.vertexNormals[ j ]; + + v1.copy( vertex ).applyMatrix4( matrixWorld ); + + v2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 ); + + position.setXYZ( idx, v1.x, v1.y, v1.z ); + + idx = idx + 1; + + position.setXYZ( idx, v2.x, v2.y, v2.z ); + + idx = idx + 1; + + } + + } + + } else if ( (objGeometry && objGeometry.isBufferGeometry) ) { + + var objPos = objGeometry.attributes.position; + + var objNorm = objGeometry.attributes.normal; + + var idx = 0; + + // for simplicity, ignore index and drawcalls, and render every normal + + for ( var j = 0, jl = objPos.count; j < jl; j ++ ) { + + v1.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld ); + + v2.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) ); + + v2.applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 ); + + position.setXYZ( idx, v1.x, v1.y, v1.z ); + + idx = idx + 1; + + position.setXYZ( idx, v2.x, v2.y, v2.z ); + + idx = idx + 1; + + } + + } + + position.needsUpdate = true; + + return this; + + }; + + }() ); + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + * @author WestLangley / http://github.com/WestLangley + */ + + function SpotLightHelper( light ) { + + Object3D.call( this ); + + this.light = light; + this.light.updateMatrixWorld(); + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + var geometry = new BufferGeometry(); + + var positions = [ + 0, 0, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 1, + 0, 0, 0, - 1, 0, 1, + 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, - 1, 1 + ]; + + for ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { + + var p1 = ( i / l ) * Math.PI * 2; + var p2 = ( j / l ) * Math.PI * 2; + + positions.push( + Math.cos( p1 ), Math.sin( p1 ), 1, + Math.cos( p2 ), Math.sin( p2 ), 1 + ); + + } + + geometry.addAttribute( 'position', new Float32Attribute( positions, 3 ) ); + + var material = new LineBasicMaterial( { fog: false } ); + + this.cone = new LineSegments( geometry, material ); + this.add( this.cone ); + + this.update(); + + } + + SpotLightHelper.prototype = Object.create( Object3D.prototype ); + SpotLightHelper.prototype.constructor = SpotLightHelper; + + SpotLightHelper.prototype.dispose = function () { + + this.cone.geometry.dispose(); + this.cone.material.dispose(); + + }; + + SpotLightHelper.prototype.update = function () { + + var vector = new Vector3(); + var vector2 = new Vector3(); + + return function update() { + + var coneLength = this.light.distance ? this.light.distance : 1000; + var coneWidth = coneLength * Math.tan( this.light.angle ); + + this.cone.scale.set( coneWidth, coneWidth, coneLength ); + + vector.setFromMatrixPosition( this.light.matrixWorld ); + vector2.setFromMatrixPosition( this.light.target.matrixWorld ); + + this.cone.lookAt( vector2.sub( vector ) ); + + this.cone.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity ); + + }; + + }(); + + /** + * @author Sean Griffin / http://twitter.com/sgrif + * @author Michael Guerrero / http://realitymeltdown.com + * @author mrdoob / http://mrdoob.com/ + * @author ikerr / http://verold.com + */ + + function SkeletonHelper( object ) { + + this.bones = this.getBoneList( object ); + + var geometry = new Geometry(); + + for ( var i = 0; i < this.bones.length; i ++ ) { + + var bone = this.bones[ i ]; + + if ( (bone.parent && bone.parent.isBone) ) { + + geometry.vertices.push( new Vector3() ); + geometry.vertices.push( new Vector3() ); + geometry.colors.push( new Color( 0, 0, 1 ) ); + geometry.colors.push( new Color( 0, 1, 0 ) ); + + } + + } + + geometry.dynamic = true; + + var material = new LineBasicMaterial( { vertexColors: VertexColors, depthTest: false, depthWrite: false, transparent: true } ); + + LineSegments.call( this, geometry, material ); + + this.root = object; + + this.matrix = object.matrixWorld; + this.matrixAutoUpdate = false; + + this.update(); + + } + + + SkeletonHelper.prototype = Object.create( LineSegments.prototype ); + SkeletonHelper.prototype.constructor = SkeletonHelper; + + SkeletonHelper.prototype.getBoneList = function( object ) { + + var boneList = []; + + if ( (object && object.isBone) ) { + + boneList.push( object ); + + } + + for ( var i = 0; i < object.children.length; i ++ ) { + + boneList.push.apply( boneList, this.getBoneList( object.children[ i ] ) ); + + } + + return boneList; + + }; + + SkeletonHelper.prototype.update = function () { + + var geometry = this.geometry; + + var matrixWorldInv = new Matrix4().getInverse( this.root.matrixWorld ); + + var boneMatrix = new Matrix4(); + + var j = 0; + + for ( var i = 0; i < this.bones.length; i ++ ) { + + var bone = this.bones[ i ]; + + if ( (bone.parent && bone.parent.isBone) ) { + + boneMatrix.multiplyMatrices( matrixWorldInv, bone.matrixWorld ); + geometry.vertices[ j ].setFromMatrixPosition( boneMatrix ); + + boneMatrix.multiplyMatrices( matrixWorldInv, bone.parent.matrixWorld ); + geometry.vertices[ j + 1 ].setFromMatrixPosition( boneMatrix ); + + j += 2; + + } + + } + + geometry.verticesNeedUpdate = true; + + geometry.computeBoundingSphere(); + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + */ + + function PointLightHelper( light, sphereSize ) { + + this.light = light; + this.light.updateMatrixWorld(); + + var geometry = new SphereBufferGeometry( sphereSize, 4, 2 ); + var material = new MeshBasicMaterial( { wireframe: true, fog: false } ); + material.color.copy( this.light.color ).multiplyScalar( this.light.intensity ); + + Mesh.call( this, geometry, material ); + + this.matrix = this.light.matrixWorld; + this.matrixAutoUpdate = false; + + /* + var distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 ); + var distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } ); + + this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial ); + this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial ); + + var d = light.distance; + + if ( d === 0.0 ) { + + this.lightDistance.visible = false; + + } else { + + this.lightDistance.scale.set( d, d, d ); + + } + + this.add( this.lightDistance ); + */ + + } + + PointLightHelper.prototype = Object.create( Mesh.prototype ); + PointLightHelper.prototype.constructor = PointLightHelper; + + PointLightHelper.prototype.dispose = function () { + + this.geometry.dispose(); + this.material.dispose(); + + }; + + PointLightHelper.prototype.update = function () { + + this.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity ); + + /* + var d = this.light.distance; + + if ( d === 0.0 ) { + + this.lightDistance.visible = false; + + } else { + + this.lightDistance.visible = true; + this.lightDistance.scale.set( d, d, d ); + + } + */ + + }; + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + */ + + function HemisphereLightHelper( light, sphereSize ) { + + Object3D.call( this ); + + this.light = light; + this.light.updateMatrixWorld(); + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + this.colors = [ new Color(), new Color() ]; + + var geometry = new SphereGeometry( sphereSize, 4, 2 ); + geometry.rotateX( - Math.PI / 2 ); + + for ( var i = 0, il = 8; i < il; i ++ ) { + + geometry.faces[ i ].color = this.colors[ i < 4 ? 0 : 1 ]; + + } + + var material = new MeshBasicMaterial( { vertexColors: FaceColors, wireframe: true } ); + + this.lightSphere = new Mesh( geometry, material ); + this.add( this.lightSphere ); + + this.update(); + + } + + HemisphereLightHelper.prototype = Object.create( Object3D.prototype ); + HemisphereLightHelper.prototype.constructor = HemisphereLightHelper; + + HemisphereLightHelper.prototype.dispose = function () { + + this.lightSphere.geometry.dispose(); + this.lightSphere.material.dispose(); + + }; + + HemisphereLightHelper.prototype.update = function () { + + var vector = new Vector3(); + + return function update() { + + this.colors[ 0 ].copy( this.light.color ).multiplyScalar( this.light.intensity ); + this.colors[ 1 ].copy( this.light.groundColor ).multiplyScalar( this.light.intensity ); + + this.lightSphere.lookAt( vector.setFromMatrixPosition( this.light.matrixWorld ).negate() ); + this.lightSphere.geometry.colorsNeedUpdate = true; + + }; + + }(); + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function GridHelper( size, divisions, color1, color2 ) { + + divisions = divisions || 1; + color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); + color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); + + var center = divisions / 2; + var step = ( size * 2 ) / divisions; + var vertices = [], colors = []; + + for ( var i = 0, j = 0, k = - size; i <= divisions; i ++, k += step ) { + + vertices.push( - size, 0, k, size, 0, k ); + vertices.push( k, 0, - size, k, 0, size ); + + var color = i === center ? color1 : color2; + + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + + } + + var geometry = new BufferGeometry(); + geometry.addAttribute( 'position', new Float32Attribute( vertices, 3 ) ); + geometry.addAttribute( 'color', new Float32Attribute( colors, 3 ) ); + + var material = new LineBasicMaterial( { vertexColors: VertexColors } ); + + LineSegments.call( this, geometry, material ); + + } + + GridHelper.prototype = Object.create( LineSegments.prototype ); + GridHelper.prototype.constructor = GridHelper; + + GridHelper.prototype.setColors = function () { + + console.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' ); + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + * @author WestLangley / http://github.com/WestLangley + */ + + function FaceNormalsHelper( object, size, hex, linewidth ) { + + // FaceNormalsHelper only supports THREE.Geometry + + this.object = object; + + this.size = ( size !== undefined ) ? size : 1; + + var color = ( hex !== undefined ) ? hex : 0xffff00; + + var width = ( linewidth !== undefined ) ? linewidth : 1; + + // + + var nNormals = 0; + + var objGeometry = this.object.geometry; + + if ( (objGeometry && objGeometry.isGeometry) ) { + + nNormals = objGeometry.faces.length; + + } else { + + console.warn( 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.' ); + + } + + // + + var geometry = new BufferGeometry(); + + var positions = new Float32Attribute( nNormals * 2 * 3, 3 ); + + geometry.addAttribute( 'position', positions ); + + LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) ); + + // + + this.matrixAutoUpdate = false; + this.update(); + + } + + FaceNormalsHelper.prototype = Object.create( LineSegments.prototype ); + FaceNormalsHelper.prototype.constructor = FaceNormalsHelper; + + FaceNormalsHelper.prototype.update = ( function () { + + var v1 = new Vector3(); + var v2 = new Vector3(); + var normalMatrix = new Matrix3(); + + return function update() { + + this.object.updateMatrixWorld( true ); + + normalMatrix.getNormalMatrix( this.object.matrixWorld ); + + var matrixWorld = this.object.matrixWorld; + + var position = this.geometry.attributes.position; + + // + + var objGeometry = this.object.geometry; + + var vertices = objGeometry.vertices; + + var faces = objGeometry.faces; + + var idx = 0; + + for ( var i = 0, l = faces.length; i < l; i ++ ) { + + var face = faces[ i ]; + + var normal = face.normal; + + v1.copy( vertices[ face.a ] ) + .add( vertices[ face.b ] ) + .add( vertices[ face.c ] ) + .divideScalar( 3 ) + .applyMatrix4( matrixWorld ); + + v2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 ); + + position.setXYZ( idx, v1.x, v1.y, v1.z ); + + idx = idx + 1; + + position.setXYZ( idx, v2.x, v2.y, v2.z ); + + idx = idx + 1; + + } + + position.needsUpdate = true; + + return this; + + }; + + }() ); + + /** + * @author alteredq / http://alteredqualia.com/ + * @author mrdoob / http://mrdoob.com/ + * @author WestLangley / http://github.com/WestLangley + */ + + function DirectionalLightHelper( light, size ) { + + Object3D.call( this ); + + this.light = light; + this.light.updateMatrixWorld(); + + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; + + if ( size === undefined ) size = 1; + + var geometry = new BufferGeometry(); + geometry.addAttribute( 'position', new Float32Attribute( [ + - size, size, 0, + size, size, 0, + size, - size, 0, + - size, - size, 0, + - size, size, 0 + ], 3 ) ); + + var material = new LineBasicMaterial( { fog: false } ); + + this.add( new Line( geometry, material ) ); + + geometry = new BufferGeometry(); + geometry.addAttribute( 'position', new Float32Attribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); + + this.add( new Line( geometry, material )); + + this.update(); + + } + + DirectionalLightHelper.prototype = Object.create( Object3D.prototype ); + DirectionalLightHelper.prototype.constructor = DirectionalLightHelper; + + DirectionalLightHelper.prototype.dispose = function () { + + var lightPlane = this.children[ 0 ]; + var targetLine = this.children[ 1 ]; + + lightPlane.geometry.dispose(); + lightPlane.material.dispose(); + targetLine.geometry.dispose(); + targetLine.material.dispose(); + + }; + + DirectionalLightHelper.prototype.update = function () { + + var v1 = new Vector3(); + var v2 = new Vector3(); + var v3 = new Vector3(); + + return function update() { + + v1.setFromMatrixPosition( this.light.matrixWorld ); + v2.setFromMatrixPosition( this.light.target.matrixWorld ); + v3.subVectors( v2, v1 ); + + var lightPlane = this.children[ 0 ]; + var targetLine = this.children[ 1 ]; + + lightPlane.lookAt( v3 ); + lightPlane.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity ); + + targetLine.lookAt( v3 ); + targetLine.scale.z = v3.length(); + + }; + + }(); + + /** + * @author alteredq / http://alteredqualia.com/ + * + * - shows frustum, line of sight and up of the camera + * - suitable for fast updates + * - based on frustum visualization in lightgl.js shadowmap example + * http://evanw.github.com/lightgl.js/tests/shadowmap.html + */ + + function CameraHelper( camera ) { + + var geometry = new Geometry(); + var material = new LineBasicMaterial( { color: 0xffffff, vertexColors: FaceColors } ); + + var pointMap = {}; + + // colors + + var hexFrustum = 0xffaa00; + var hexCone = 0xff0000; + var hexUp = 0x00aaff; + var hexTarget = 0xffffff; + var hexCross = 0x333333; + + // near + + addLine( "n1", "n2", hexFrustum ); + addLine( "n2", "n4", hexFrustum ); + addLine( "n4", "n3", hexFrustum ); + addLine( "n3", "n1", hexFrustum ); + + // far + + addLine( "f1", "f2", hexFrustum ); + addLine( "f2", "f4", hexFrustum ); + addLine( "f4", "f3", hexFrustum ); + addLine( "f3", "f1", hexFrustum ); + + // sides + + addLine( "n1", "f1", hexFrustum ); + addLine( "n2", "f2", hexFrustum ); + addLine( "n3", "f3", hexFrustum ); + addLine( "n4", "f4", hexFrustum ); + + // cone + + addLine( "p", "n1", hexCone ); + addLine( "p", "n2", hexCone ); + addLine( "p", "n3", hexCone ); + addLine( "p", "n4", hexCone ); + + // up + + addLine( "u1", "u2", hexUp ); + addLine( "u2", "u3", hexUp ); + addLine( "u3", "u1", hexUp ); + + // target + + addLine( "c", "t", hexTarget ); + addLine( "p", "c", hexCross ); + + // cross + + addLine( "cn1", "cn2", hexCross ); + addLine( "cn3", "cn4", hexCross ); + + addLine( "cf1", "cf2", hexCross ); + addLine( "cf3", "cf4", hexCross ); + + function addLine( a, b, hex ) { + + addPoint( a, hex ); + addPoint( b, hex ); + + } + + function addPoint( id, hex ) { + + geometry.vertices.push( new Vector3() ); + geometry.colors.push( new Color( hex ) ); + + if ( pointMap[ id ] === undefined ) { + + pointMap[ id ] = []; + + } + + pointMap[ id ].push( geometry.vertices.length - 1 ); + + } + + LineSegments.call( this, geometry, material ); + + this.camera = camera; + if( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix(); + + this.matrix = camera.matrixWorld; + this.matrixAutoUpdate = false; + + this.pointMap = pointMap; + + this.update(); + + } + + CameraHelper.prototype = Object.create( LineSegments.prototype ); + CameraHelper.prototype.constructor = CameraHelper; + + CameraHelper.prototype.update = function () { + + var geometry, pointMap; + + var vector = new Vector3(); + var camera = new Camera(); + + function setPoint( point, x, y, z ) { + + vector.set( x, y, z ).unproject( camera ); + + var points = pointMap[ point ]; + + if ( points !== undefined ) { + + for ( var i = 0, il = points.length; i < il; i ++ ) { + + geometry.vertices[ points[ i ] ].copy( vector ); + + } + + } + + } + + return function update() { + + geometry = this.geometry; + pointMap = this.pointMap; + + var w = 1, h = 1; + + // we need just camera projection matrix + // world matrix must be identity + + camera.projectionMatrix.copy( this.camera.projectionMatrix ); + + // center / target + + setPoint( "c", 0, 0, - 1 ); + setPoint( "t", 0, 0, 1 ); + + // near + + setPoint( "n1", - w, - h, - 1 ); + setPoint( "n2", w, - h, - 1 ); + setPoint( "n3", - w, h, - 1 ); + setPoint( "n4", w, h, - 1 ); + + // far + + setPoint( "f1", - w, - h, 1 ); + setPoint( "f2", w, - h, 1 ); + setPoint( "f3", - w, h, 1 ); + setPoint( "f4", w, h, 1 ); + + // up + + setPoint( "u1", w * 0.7, h * 1.1, - 1 ); + setPoint( "u2", - w * 0.7, h * 1.1, - 1 ); + setPoint( "u3", 0, h * 2, - 1 ); + + // cross + + setPoint( "cf1", - w, 0, 1 ); + setPoint( "cf2", w, 0, 1 ); + setPoint( "cf3", 0, - h, 1 ); + setPoint( "cf4", 0, h, 1 ); + + setPoint( "cn1", - w, 0, - 1 ); + setPoint( "cn2", w, 0, - 1 ); + setPoint( "cn3", 0, - h, - 1 ); + setPoint( "cn4", 0, h, - 1 ); + + geometry.verticesNeedUpdate = true; + + }; + + }(); + + /** + * @author WestLangley / http://github.com/WestLangley + */ + + // a helper to show the world-axis-aligned bounding box for an object + + function BoundingBoxHelper( object, hex ) { + + var color = ( hex !== undefined ) ? hex : 0x888888; + + this.object = object; + + this.box = new Box3(); + + Mesh.call( this, new BoxGeometry( 1, 1, 1 ), new MeshBasicMaterial( { color: color, wireframe: true } ) ); + + } + + BoundingBoxHelper.prototype = Object.create( Mesh.prototype ); + BoundingBoxHelper.prototype.constructor = BoundingBoxHelper; + + BoundingBoxHelper.prototype.update = function () { + + this.box.setFromObject( this.object ); + + this.box.getSize( this.scale ); + + this.box.getCenter( this.position ); + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function BoxHelper( object, color ) { + + if ( color === undefined ) color = 0xffff00; + + var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + var positions = new Float32Array( 8 * 3 ); + + var geometry = new BufferGeometry(); + geometry.setIndex( new BufferAttribute( indices, 1 ) ); + geometry.addAttribute( 'position', new BufferAttribute( positions, 3 ) ); + + LineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) ); + + if ( object !== undefined ) { + + this.update( object ); + + } + + } + + BoxHelper.prototype = Object.create( LineSegments.prototype ); + BoxHelper.prototype.constructor = BoxHelper; + + BoxHelper.prototype.update = ( function () { + + var box = new Box3(); + + return function update( object ) { + + if ( (object && object.isBox3) ) { + + box.copy( object ); + + } else { + + box.setFromObject( object ); + + } + + if ( box.isEmpty() ) return; + + var min = box.min; + var max = box.max; + + /* + 5____4 + 1/___0/| + | 6__|_7 + 2/___3/ + + 0: max.x, max.y, max.z + 1: min.x, max.y, max.z + 2: min.x, min.y, max.z + 3: max.x, min.y, max.z + 4: max.x, max.y, min.z + 5: min.x, max.y, min.z + 6: min.x, min.y, min.z + 7: max.x, min.y, min.z + */ + + var position = this.geometry.attributes.position; + var array = position.array; + + array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; + array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; + array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; + array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; + array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; + array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; + array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; + array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; + + position.needsUpdate = true; + + this.geometry.computeBoundingSphere(); + + }; + + } )(); + + /** + * @author WestLangley / http://github.com/WestLangley + * @author zz85 / http://github.com/zz85 + * @author bhouston / http://clara.io + * + * Creates an arrow for visualizing directions + * + * Parameters: + * dir - Vector3 + * origin - Vector3 + * length - Number + * color - color in hex value + * headLength - Number + * headWidth - Number + */ + + var lineGeometry = new BufferGeometry(); + lineGeometry.addAttribute( 'position', new Float32Attribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); + + var coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 ); + coneGeometry.translate( 0, - 0.5, 0 ); + + function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { + + // dir is assumed to be normalized + + Object3D.call( this ); + + if ( color === undefined ) color = 0xffff00; + if ( length === undefined ) length = 1; + if ( headLength === undefined ) headLength = 0.2 * length; + if ( headWidth === undefined ) headWidth = 0.2 * headLength; + + this.position.copy( origin ); + + this.line = new Line( lineGeometry, new LineBasicMaterial( { color: color } ) ); + this.line.matrixAutoUpdate = false; + this.add( this.line ); + + this.cone = new Mesh( coneGeometry, new MeshBasicMaterial( { color: color } ) ); + this.cone.matrixAutoUpdate = false; + this.add( this.cone ); + + this.setDirection( dir ); + this.setLength( length, headLength, headWidth ); + + } + + ArrowHelper.prototype = Object.create( Object3D.prototype ); + ArrowHelper.prototype.constructor = ArrowHelper; + + ArrowHelper.prototype.setDirection = ( function () { + + var axis = new Vector3(); + var radians; + + return function setDirection( dir ) { + + // dir is assumed to be normalized + + if ( dir.y > 0.99999 ) { + + this.quaternion.set( 0, 0, 0, 1 ); + + } else if ( dir.y < - 0.99999 ) { + + this.quaternion.set( 1, 0, 0, 0 ); + + } else { + + axis.set( dir.z, 0, - dir.x ).normalize(); + + radians = Math.acos( dir.y ); + + this.quaternion.setFromAxisAngle( axis, radians ); + + } + + }; + + }() ); + + ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) { + + if ( headLength === undefined ) headLength = 0.2 * length; + if ( headWidth === undefined ) headWidth = 0.2 * headLength; + + this.line.scale.set( 1, Math.max( 0, length - headLength ), 1 ); + this.line.updateMatrix(); + + this.cone.scale.set( headWidth, headLength, headWidth ); + this.cone.position.y = length; + this.cone.updateMatrix(); + + }; + + ArrowHelper.prototype.setColor = function ( color ) { + + this.line.material.color.copy( color ); + this.cone.material.color.copy( color ); + + }; + + /** + * @author sroucheray / http://sroucheray.org/ + * @author mrdoob / http://mrdoob.com/ + */ + + function AxisHelper( size ) { + + size = size || 1; + + var vertices = new Float32Array( [ + 0, 0, 0, size, 0, 0, + 0, 0, 0, 0, size, 0, + 0, 0, 0, 0, 0, size + ] ); + + var colors = new Float32Array( [ + 1, 0, 0, 1, 0.6, 0, + 0, 1, 0, 0.6, 1, 0, + 0, 0, 1, 0, 0.6, 1 + ] ); + + var geometry = new BufferGeometry(); + geometry.addAttribute( 'position', new BufferAttribute( vertices, 3 ) ); + geometry.addAttribute( 'color', new BufferAttribute( colors, 3 ) ); + + var material = new LineBasicMaterial( { vertexColors: VertexColors } ); + + LineSegments.call( this, geometry, material ); + + } + + AxisHelper.prototype = Object.create( LineSegments.prototype ); + AxisHelper.prototype.constructor = AxisHelper; + + /** + * @author zz85 https://github.com/zz85 + * + * Centripetal CatmullRom Curve - which is useful for avoiding + * cusps and self-intersections in non-uniform catmull rom curves. + * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf + * + * curve.type accepts centripetal(default), chordal and catmullrom + * curve.tension is used for catmullrom which defaults to 0.5 + */ + + var CatmullRomCurve3 = ( function() { + + var + tmp = new Vector3(), + px = new CubicPoly(), + py = new CubicPoly(), + pz = new CubicPoly(); + + /* + Based on an optimized c++ solution in + - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/ + - http://ideone.com/NoEbVM + + This CubicPoly class could be used for reusing some variables and calculations, + but for three.js curve use, it could be possible inlined and flatten into a single function call + which can be placed in CurveUtils. + */ + + function CubicPoly() {} + + /* + * Compute coefficients for a cubic polynomial + * p(s) = c0 + c1*s + c2*s^2 + c3*s^3 + * such that + * p(0) = x0, p(1) = x1 + * and + * p'(0) = t0, p'(1) = t1. + */ + CubicPoly.prototype.init = function( x0, x1, t0, t1 ) { + + this.c0 = x0; + this.c1 = t0; + this.c2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1; + this.c3 = 2 * x0 - 2 * x1 + t0 + t1; + + }; + + CubicPoly.prototype.initNonuniformCatmullRom = function( x0, x1, x2, x3, dt0, dt1, dt2 ) { + + // compute tangents when parameterized in [t1,t2] + var t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1; + var t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2; + + // rescale tangents for parametrization in [0,1] + t1 *= dt1; + t2 *= dt1; + + // initCubicPoly + this.init( x1, x2, t1, t2 ); + + }; + + // standard Catmull-Rom spline: interpolate between x1 and x2 with previous/following points x1/x4 + CubicPoly.prototype.initCatmullRom = function( x0, x1, x2, x3, tension ) { + + this.init( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) ); + + }; + + CubicPoly.prototype.calc = function( t ) { + + var t2 = t * t; + var t3 = t2 * t; + return this.c0 + this.c1 * t + this.c2 * t2 + this.c3 * t3; + + }; + + // Subclass Three.js curve + return Curve.create( + + function ( p /* array of Vector3 */ ) { + + this.points = p || []; + this.closed = false; + + }, + + function ( t ) { + + var points = this.points, + point, intPoint, weight, l; + + l = points.length; + + if ( l < 2 ) console.log( 'duh, you need at least 2 points' ); + + point = ( l - ( this.closed ? 0 : 1 ) ) * t; + intPoint = Math.floor( point ); + weight = point - intPoint; + + if ( this.closed ) { + + intPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / points.length ) + 1 ) * points.length; + + } else if ( weight === 0 && intPoint === l - 1 ) { + + intPoint = l - 2; + weight = 1; + + } + + var p0, p1, p2, p3; // 4 points + + if ( this.closed || intPoint > 0 ) { + + p0 = points[ ( intPoint - 1 ) % l ]; + + } else { + + // extrapolate first point + tmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] ); + p0 = tmp; + + } + + p1 = points[ intPoint % l ]; + p2 = points[ ( intPoint + 1 ) % l ]; + + if ( this.closed || intPoint + 2 < l ) { + + p3 = points[ ( intPoint + 2 ) % l ]; + + } else { + + // extrapolate last point + tmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] ); + p3 = tmp; + + } + + if ( this.type === undefined || this.type === 'centripetal' || this.type === 'chordal' ) { + + // init Centripetal / Chordal Catmull-Rom + var pow = this.type === 'chordal' ? 0.5 : 0.25; + var dt0 = Math.pow( p0.distanceToSquared( p1 ), pow ); + var dt1 = Math.pow( p1.distanceToSquared( p2 ), pow ); + var dt2 = Math.pow( p2.distanceToSquared( p3 ), pow ); + + // safety check for repeated points + if ( dt1 < 1e-4 ) dt1 = 1.0; + if ( dt0 < 1e-4 ) dt0 = dt1; + if ( dt2 < 1e-4 ) dt2 = dt1; + + px.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 ); + py.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 ); + pz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 ); + + } else if ( this.type === 'catmullrom' ) { + + var tension = this.tension !== undefined ? this.tension : 0.5; + px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, tension ); + py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, tension ); + pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, tension ); + + } + + var v = new Vector3( + px.calc( weight ), + py.calc( weight ), + pz.calc( weight ) + ); + + return v; + + } + + ); + + } )(); + + /************************************************************** + * Closed Spline 3D curve + **************************************************************/ + + + function ClosedSplineCurve3( points ) { + + console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.' ); + + CatmullRomCurve3.call( this, points ); + this.type = 'catmullrom'; + this.closed = true; + + } + + ClosedSplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype ); + + /************************************************************** + * Spline 3D curve + **************************************************************/ + + + var SplineCurve3 = Curve.create( + + function ( points /* array of Vector3 */ ) { + + console.warn( 'THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3' ); + this.points = ( points === undefined ) ? [] : points; + + }, + + function ( t ) { + + var points = this.points; + var point = ( points.length - 1 ) * t; + + var intPoint = Math.floor( point ); + var weight = point - intPoint; + + var point0 = points[ intPoint == 0 ? intPoint : intPoint - 1 ]; + var point1 = points[ intPoint ]; + var point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; + var point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; + + var interpolate = CurveUtils.interpolate; + + return new Vector3( + interpolate( point0.x, point1.x, point2.x, point3.x, weight ), + interpolate( point0.y, point1.y, point2.y, point3.y, weight ), + interpolate( point0.z, point1.z, point2.z, point3.z, weight ) + ); + + } + + ); + + /************************************************************** + * Cubic Bezier 3D curve + **************************************************************/ + + var CubicBezierCurve3 = Curve.create( + + function ( v0, v1, v2, v3 ) { + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + this.v3 = v3; + + }, + + function ( t ) { + + var b3 = ShapeUtils.b3; + + return new Vector3( + b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ), + b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ), + b3( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z ) + ); + + } + + ); + + /************************************************************** + * Quadratic Bezier 3D curve + **************************************************************/ + + var QuadraticBezierCurve3 = Curve.create( + + function ( v0, v1, v2 ) { + + this.v0 = v0; + this.v1 = v1; + this.v2 = v2; + + }, + + function ( t ) { + + var b2 = ShapeUtils.b2; + + return new Vector3( + b2( t, this.v0.x, this.v1.x, this.v2.x ), + b2( t, this.v0.y, this.v1.y, this.v2.y ), + b2( t, this.v0.z, this.v1.z, this.v2.z ) + ); + + } + + ); + + /************************************************************** + * Line3D + **************************************************************/ + + var LineCurve3 = Curve.create( + + function ( v1, v2 ) { + + this.v1 = v1; + this.v2 = v2; + + }, + + function ( t ) { + + if ( t === 1 ) { + + return this.v2.clone(); + + } + + var vector = new Vector3(); + + vector.subVectors( this.v2, this.v1 ); // diff + vector.multiplyScalar( t ); + vector.add( this.v1 ); + + return vector; + + } + + ); + + /************************************************************** + * Arc curve + **************************************************************/ + + function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { + + EllipseCurve.call( this, aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); + + } + + ArcCurve.prototype = Object.create( EllipseCurve.prototype ); + ArcCurve.prototype.constructor = ArcCurve; + + /** + * @author alteredq / http://alteredqualia.com/ + */ + + var SceneUtils = { + + createMultiMaterialObject: function ( geometry, materials ) { + + var group = new Group(); + + for ( var i = 0, l = materials.length; i < l; i ++ ) { + + group.add( new Mesh( geometry, materials[ i ] ) ); + + } + + return group; + + }, + + detach: function ( child, parent, scene ) { + + child.applyMatrix( parent.matrixWorld ); + parent.remove( child ); + scene.add( child ); + + }, + + attach: function ( child, scene, parent ) { + + var matrixWorldInverse = new Matrix4(); + matrixWorldInverse.getInverse( parent.matrixWorld ); + child.applyMatrix( matrixWorldInverse ); + + scene.remove( child ); + parent.add( child ); + + } + + }; + + /** + * @author mrdoob / http://mrdoob.com/ + */ + + function Face4 ( a, b, c, d, normal, color, materialIndex ) { + console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' ); + return new Face3( a, b, c, normal, color, materialIndex ); + } + + var LineStrip = 0; + + var LinePieces = 1; + + function PointCloud ( geometry, material ) { + console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' ); + return new Points( geometry, material ); + } + + function ParticleSystem ( geometry, material ) { + console.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' ); + return new Points( geometry, material ); + } + + function PointCloudMaterial ( parameters ) { + console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' ); + return new PointsMaterial( parameters ); + } + + function ParticleBasicMaterial ( parameters ) { + console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' ); + return new PointsMaterial( parameters ); + } + + function ParticleSystemMaterial ( parameters ) { + console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' ); + return new PointsMaterial( parameters ); + } + + function Vertex ( x, y, z ) { + console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' ); + return new Vector3( x, y, z ); + } + + // + + function EdgesHelper( object, hex ) { + console.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' ); + return new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); + } + + function WireframeHelper( object, hex ) { + console.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' ); + return new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); + } + + // + + Object.assign( Box2.prototype, { + center: function ( optionalTarget ) { + console.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' ); + return this.getCenter( optionalTarget ); + }, + empty: function () { + console.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' ); + return this.isEmpty(); + }, + isIntersectionBox: function ( box ) { + console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' ); + return this.intersectsBox( box ); + }, + size: function ( optionalTarget ) { + console.warn( 'THREE.Box2: .size() has been renamed to .getSize().' ); + return this.getSize( optionalTarget ); + } + } ); + + Object.assign( Box3.prototype, { + center: function ( optionalTarget ) { + console.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' ); + return this.getCenter( optionalTarget ); + }, + empty: function () { + console.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' ); + return this.isEmpty(); + }, + isIntersectionBox: function ( box ) { + console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' ); + return this.intersectsBox( box ); + }, + isIntersectionSphere: function ( sphere ) { + console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); + return this.intersectsSphere( sphere ); + }, + size: function ( optionalTarget ) { + console.warn( 'THREE.Box3: .size() has been renamed to .getSize().' ); + return this.getSize( optionalTarget ); + } + } ); + + Object.assign( Line3.prototype, { + center: function ( optionalTarget ) { + console.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' ); + return this.getCenter( optionalTarget ); + } + } ); + + Object.assign( Matrix3.prototype, { + multiplyVector3: function ( vector ) { + console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' ); + return vector.applyMatrix3( this ); + }, + multiplyVector3Array: function ( a ) { + console.warn( 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' ); + return this.applyToVector3Array( a ); + } + } ); + + Object.assign( Matrix4.prototype, { + extractPosition: function ( m ) { + console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' ); + return this.copyPosition( m ); + }, + setRotationFromQuaternion: function ( q ) { + console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' ); + return this.makeRotationFromQuaternion( q ); + }, + multiplyVector3: function ( vector ) { + console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.' ); + return vector.applyProjection( this ); + }, + multiplyVector4: function ( vector ) { + console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); + return vector.applyMatrix4( this ); + }, + multiplyVector3Array: function ( a ) { + console.warn( 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' ); + return this.applyToVector3Array( a ); + }, + rotateAxis: function ( v ) { + console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' ); + v.transformDirection( this ); + }, + crossVector: function ( vector ) { + console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); + return vector.applyMatrix4( this ); + }, + translate: function ( v ) { + console.error( 'THREE.Matrix4: .translate() has been removed.' ); + }, + rotateX: function ( angle ) { + console.error( 'THREE.Matrix4: .rotateX() has been removed.' ); + }, + rotateY: function ( angle ) { + console.error( 'THREE.Matrix4: .rotateY() has been removed.' ); + }, + rotateZ: function ( angle ) { + console.error( 'THREE.Matrix4: .rotateZ() has been removed.' ); + }, + rotateByAxis: function ( axis, angle ) { + console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' ); + } + } ); + + Object.assign( Plane.prototype, { + isIntersectionLine: function ( line ) { + console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' ); + return this.intersectsLine( line ); + } + } ); + + Object.assign( Quaternion.prototype, { + multiplyVector3: function ( vector ) { + console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' ); + return vector.applyQuaternion( this ); + } + } ); + + Object.assign( Ray.prototype, { + isIntersectionBox: function ( box ) { + console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' ); + return this.intersectsBox( box ); + }, + isIntersectionPlane: function ( plane ) { + console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' ); + return this.intersectsPlane( plane ); + }, + isIntersectionSphere: function ( sphere ) { + console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); + return this.intersectsSphere( sphere ); + } + } ); + + Object.assign( Shape.prototype, { + extrude: function ( options ) { + console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' ); + return new ExtrudeGeometry( this, options ); + }, + makeGeometry: function ( options ) { + console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' ); + return new ShapeGeometry( this, options ); + } + } ); + + Object.assign( Vector3.prototype, { + setEulerFromRotationMatrix: function () { + console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' ); + }, + setEulerFromQuaternion: function () { + console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' ); + }, + getPositionFromMatrix: function ( m ) { + console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' ); + return this.setFromMatrixPosition( m ); + }, + getScaleFromMatrix: function ( m ) { + console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' ); + return this.setFromMatrixScale( m ); + }, + getColumnFromMatrix: function ( index, matrix ) { + console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' ); + return this.setFromMatrixColumn( matrix, index ); + } + } ); + + // + + Object.assign( Object3D.prototype, { + getChildByName: function ( name ) { + console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' ); + return this.getObjectByName( name ); + }, + renderDepth: function ( value ) { + console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' ); + }, + translate: function ( distance, axis ) { + console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' ); + return this.translateOnAxis( axis, distance ); + } + } ); + + Object.defineProperties( Object3D.prototype, { + eulerOrder: { + get: function () { + console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); + return this.rotation.order; + }, + set: function ( value ) { + console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); + this.rotation.order = value; + } + }, + useQuaternion: { + get: function () { + console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); + }, + set: function ( value ) { + console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); + } + } + } ); + + Object.defineProperties( LOD.prototype, { + objects: { + get: function () { + console.warn( 'THREE.LOD: .objects has been renamed to .levels.' ); + return this.levels; + } + } + } ); + + // + + PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) { + + console.warn( "THREE.PerspectiveCamera.setLens is deprecated. " + + "Use .setFocalLength and .filmGauge for a photographic setup." ); + + if ( filmGauge !== undefined ) this.filmGauge = filmGauge; + this.setFocalLength( focalLength ); + + }; + + // + + Object.defineProperties( Light.prototype, { + onlyShadow: { + set: function ( value ) { + console.warn( 'THREE.Light: .onlyShadow has been removed.' ); + } + }, + shadowCameraFov: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' ); + this.shadow.camera.fov = value; + } + }, + shadowCameraLeft: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' ); + this.shadow.camera.left = value; + } + }, + shadowCameraRight: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' ); + this.shadow.camera.right = value; + } + }, + shadowCameraTop: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' ); + this.shadow.camera.top = value; + } + }, + shadowCameraBottom: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' ); + this.shadow.camera.bottom = value; + } + }, + shadowCameraNear: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' ); + this.shadow.camera.near = value; + } + }, + shadowCameraFar: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' ); + this.shadow.camera.far = value; + } + }, + shadowCameraVisible: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' ); + } + }, + shadowBias: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' ); + this.shadow.bias = value; + } + }, + shadowDarkness: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowDarkness has been removed.' ); + } + }, + shadowMapWidth: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' ); + this.shadow.mapSize.width = value; + } + }, + shadowMapHeight: { + set: function ( value ) { + console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' ); + this.shadow.mapSize.height = value; + } + } + } ); + + // + + Object.defineProperties( BufferAttribute.prototype, { + length: { + get: function () { + console.warn( 'THREE.BufferAttribute: .length has been deprecated. Please use .count.' ); + return this.array.length; + } + } + } ); + + Object.assign( BufferGeometry.prototype, { + addIndex: function ( index ) { + console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' ); + this.setIndex( index ); + }, + addDrawCall: function ( start, count, indexOffset ) { + if ( indexOffset !== undefined ) { + console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' ); + } + console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' ); + this.addGroup( start, count ); + }, + clearDrawCalls: function () { + console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' ); + this.clearGroups(); + }, + computeTangents: function () { + console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' ); + }, + computeOffsets: function () { + console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' ); + } + } ); + + Object.defineProperties( BufferGeometry.prototype, { + drawcalls: { + get: function () { + console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' ); + return this.groups; + } + }, + offsets: { + get: function () { + console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' ); + return this.groups; + } + } + } ); + + // + + Object.defineProperties( Material.prototype, { + wrapAround: { + get: function () { + console.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' ); + }, + set: function ( value ) { + console.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' ); + } + }, + wrapRGB: { + get: function () { + console.warn( 'THREE.' + this.type + ': .wrapRGB has been removed.' ); + return new Color(); + } + } + } ); + + Object.defineProperties( MeshPhongMaterial.prototype, { + metal: { + get: function () { + console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' ); + return false; + }, + set: function ( value ) { + console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' ); + } + } + } ); + + Object.defineProperties( ShaderMaterial.prototype, { + derivatives: { + get: function () { + console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); + return this.extensions.derivatives; + }, + set: function ( value ) { + console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); + this.extensions.derivatives = value; + } + } + } ); + + // + + EventDispatcher.prototype = Object.assign( Object.create( { + + // Note: Extra base ensures these properties are not 'assign'ed. + + constructor: EventDispatcher, + + apply: function ( target ) { + + console.warn( "THREE.EventDispatcher: .apply is deprecated, " + + "just inherit or Object.assign the prototype to mix-in." ); + + Object.assign( target, this ); + + } + + } ), EventDispatcher.prototype ); + + // + + Object.defineProperties( Uniform.prototype, { + dynamic: { + set: function ( value ) { + console.warn( 'THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.' ); + } + }, + onUpdate: { + value: function () { + console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' ); + return this; + } + } + } ); + + // + + Object.assign( WebGLRenderer.prototype, { + supportsFloatTextures: function () { + console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' ); + return this.extensions.get( 'OES_texture_float' ); + }, + supportsHalfFloatTextures: function () { + console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' ); + return this.extensions.get( 'OES_texture_half_float' ); + }, + supportsStandardDerivatives: function () { + console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' ); + return this.extensions.get( 'OES_standard_derivatives' ); + }, + supportsCompressedTextureS3TC: function () { + console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' ); + return this.extensions.get( 'WEBGL_compressed_texture_s3tc' ); + }, + supportsCompressedTexturePVRTC: function () { + console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' ); + return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' ); + }, + supportsBlendMinMax: function () { + console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' ); + return this.extensions.get( 'EXT_blend_minmax' ); + }, + supportsVertexTextures: function () { + return this.capabilities.vertexTextures; + }, + supportsInstancedArrays: function () { + console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' ); + return this.extensions.get( 'ANGLE_instanced_arrays' ); + }, + enableScissorTest: function ( boolean ) { + console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' ); + this.setScissorTest( boolean ); + }, + initMaterial: function () { + console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' ); + }, + addPrePlugin: function () { + console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' ); + }, + addPostPlugin: function () { + console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' ); + }, + updateShadowMap: function () { + console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' ); + } + } ); + + Object.defineProperties( WebGLRenderer.prototype, { + shadowMapEnabled: { + get: function () { + return this.shadowMap.enabled; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' ); + this.shadowMap.enabled = value; + } + }, + shadowMapType: { + get: function () { + return this.shadowMap.type; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' ); + this.shadowMap.type = value; + } + }, + shadowMapCullFace: { + get: function () { + return this.shadowMap.cullFace; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' ); + this.shadowMap.cullFace = value; + } + } + } ); + + Object.defineProperties( WebGLShadowMap.prototype, { + cullFace: { + get: function () { + return this.renderReverseSided ? CullFaceFront : CullFaceBack; + }, + set: function ( cullFace ) { + var value = ( cullFace !== CullFaceBack ); + console.warn( "WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to " + value + "." ); + this.renderReverseSided = value; + } + } + } ); + + // + + Object.defineProperties( WebGLRenderTarget.prototype, { + wrapS: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); + return this.texture.wrapS; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); + this.texture.wrapS = value; + } + }, + wrapT: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); + return this.texture.wrapT; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); + this.texture.wrapT = value; + } + }, + magFilter: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); + return this.texture.magFilter; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); + this.texture.magFilter = value; + } + }, + minFilter: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); + return this.texture.minFilter; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); + this.texture.minFilter = value; + } + }, + anisotropy: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); + return this.texture.anisotropy; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); + this.texture.anisotropy = value; + } + }, + offset: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); + return this.texture.offset; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); + this.texture.offset = value; + } + }, + repeat: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); + return this.texture.repeat; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); + this.texture.repeat = value; + } + }, + format: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); + return this.texture.format; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); + this.texture.format = value; + } + }, + type: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); + return this.texture.type; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); + this.texture.type = value; + } + }, + generateMipmaps: { + get: function () { + console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); + return this.texture.generateMipmaps; + }, + set: function ( value ) { + console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); + this.texture.generateMipmaps = value; + } + } + } ); + + // + + Object.assign( Audio.prototype, { + load: function ( file ) { + console.warn( 'THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.' ); + var scope = this; + var audioLoader = new AudioLoader(); + audioLoader.load( file, function ( buffer ) { + scope.setBuffer( buffer ); + } ); + return this; + } + } ); + + Object.assign( AudioAnalyser.prototype, { + getData: function ( file ) { + console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' ); + return this.getFrequencyData(); + } + } ); + + // + + var GeometryUtils = { + + merge: function ( geometry1, geometry2, materialIndexOffset ) { + + console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' ); + + var matrix; + + if ( geometry2.isMesh ) { + + geometry2.matrixAutoUpdate && geometry2.updateMatrix(); + + matrix = geometry2.matrix; + geometry2 = geometry2.geometry; + + } + + geometry1.merge( geometry2, matrix, materialIndexOffset ); + + }, + + center: function ( geometry ) { + + console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' ); + return geometry.center(); + + } + + }; + + var ImageUtils = { + + crossOrigin: undefined, + + loadTexture: function ( url, mapping, onLoad, onError ) { + + console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' ); + + var loader = new TextureLoader(); + loader.setCrossOrigin( this.crossOrigin ); + + var texture = loader.load( url, onLoad, undefined, onError ); + + if ( mapping ) texture.mapping = mapping; + + return texture; + + }, + + loadTextureCube: function ( urls, mapping, onLoad, onError ) { + + console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' ); + + var loader = new CubeTextureLoader(); + loader.setCrossOrigin( this.crossOrigin ); + + var texture = loader.load( urls, onLoad, undefined, onError ); + + if ( mapping ) texture.mapping = mapping; + + return texture; + + }, + + loadCompressedTexture: function () { + + console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' ); + + }, + + loadCompressedTextureCube: function () { + + console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' ); + + } + + }; + + // + + function Projector () { + + console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' ); + + this.projectVector = function ( vector, camera ) { + + console.warn( 'THREE.Projector: .projectVector() is now vector.project().' ); + vector.project( camera ); + + }; + + this.unprojectVector = function ( vector, camera ) { + + console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' ); + vector.unproject( camera ); + + }; + + this.pickingRay = function ( vector, camera ) { + + console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' ); + + }; + + } + + // + + function CanvasRenderer () { + + console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' ); + + this.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); + this.clear = function () {}; + this.render = function () {}; + this.setClearColor = function () {}; + this.setSize = function () {}; + + } + + exports.WebGLRenderTargetCube = WebGLRenderTargetCube; + exports.WebGLRenderTarget = WebGLRenderTarget; + exports.WebGLRenderer = WebGLRenderer; + exports.ShaderLib = ShaderLib; + exports.UniformsLib = UniformsLib; + exports.UniformsUtils = UniformsUtils; + exports.ShaderChunk = ShaderChunk; + exports.FogExp2 = FogExp2; + exports.Fog = Fog; + exports.Scene = Scene; + exports.LensFlare = LensFlare; + exports.Sprite = Sprite; + exports.LOD = LOD; + exports.SkinnedMesh = SkinnedMesh; + exports.Skeleton = Skeleton; + exports.Bone = Bone; + exports.Mesh = Mesh; + exports.LineSegments = LineSegments; + exports.Line = Line; + exports.Points = Points; + exports.Group = Group; + exports.VideoTexture = VideoTexture; + exports.DataTexture = DataTexture; + exports.CompressedTexture = CompressedTexture; + exports.CubeTexture = CubeTexture; + exports.CanvasTexture = CanvasTexture; + exports.DepthTexture = DepthTexture; + exports.TextureIdCount = TextureIdCount; + exports.Texture = Texture; + exports.MaterialIdCount = MaterialIdCount; + exports.CompressedTextureLoader = CompressedTextureLoader; + exports.BinaryTextureLoader = BinaryTextureLoader; + exports.DataTextureLoader = DataTextureLoader; + exports.CubeTextureLoader = CubeTextureLoader; + exports.TextureLoader = TextureLoader; + exports.ObjectLoader = ObjectLoader; + exports.MaterialLoader = MaterialLoader; + exports.BufferGeometryLoader = BufferGeometryLoader; + exports.DefaultLoadingManager = DefaultLoadingManager; + exports.LoadingManager = LoadingManager; + exports.JSONLoader = JSONLoader; + exports.ImageLoader = ImageLoader; + exports.FontLoader = FontLoader; + exports.XHRLoader = XHRLoader; + exports.Loader = Loader; + exports.Cache = Cache; + exports.AudioLoader = AudioLoader; + exports.SpotLightShadow = SpotLightShadow; + exports.SpotLight = SpotLight; + exports.PointLight = PointLight; + exports.HemisphereLight = HemisphereLight; + exports.DirectionalLightShadow = DirectionalLightShadow; + exports.DirectionalLight = DirectionalLight; + exports.AmbientLight = AmbientLight; + exports.LightShadow = LightShadow; + exports.Light = Light; + exports.StereoCamera = StereoCamera; + exports.PerspectiveCamera = PerspectiveCamera; + exports.OrthographicCamera = OrthographicCamera; + exports.CubeCamera = CubeCamera; + exports.Camera = Camera; + exports.AudioListener = AudioListener; + exports.PositionalAudio = PositionalAudio; + exports.getAudioContext = getAudioContext; + exports.AudioAnalyser = AudioAnalyser; + exports.Audio = Audio; + exports.VectorKeyframeTrack = VectorKeyframeTrack; + exports.StringKeyframeTrack = StringKeyframeTrack; + exports.QuaternionKeyframeTrack = QuaternionKeyframeTrack; + exports.NumberKeyframeTrack = NumberKeyframeTrack; + exports.ColorKeyframeTrack = ColorKeyframeTrack; + exports.BooleanKeyframeTrack = BooleanKeyframeTrack; + exports.PropertyMixer = PropertyMixer; + exports.PropertyBinding = PropertyBinding; + exports.KeyframeTrack = KeyframeTrack; + exports.AnimationUtils = AnimationUtils; + exports.AnimationObjectGroup = AnimationObjectGroup; + exports.AnimationMixer = AnimationMixer; + exports.AnimationClip = AnimationClip; + exports.Uniform = Uniform; + exports.InstancedBufferGeometry = InstancedBufferGeometry; + exports.BufferGeometry = BufferGeometry; + exports.GeometryIdCount = GeometryIdCount; + exports.Geometry = Geometry; + exports.InterleavedBufferAttribute = InterleavedBufferAttribute; + exports.InstancedInterleavedBuffer = InstancedInterleavedBuffer; + exports.InterleavedBuffer = InterleavedBuffer; + exports.InstancedBufferAttribute = InstancedBufferAttribute; + exports.DynamicBufferAttribute = DynamicBufferAttribute; + exports.Float64Attribute = Float64Attribute; + exports.Float32Attribute = Float32Attribute; + exports.Uint32Attribute = Uint32Attribute; + exports.Int32Attribute = Int32Attribute; + exports.Uint16Attribute = Uint16Attribute; + exports.Int16Attribute = Int16Attribute; + exports.Uint8ClampedAttribute = Uint8ClampedAttribute; + exports.Uint8Attribute = Uint8Attribute; + exports.Int8Attribute = Int8Attribute; + exports.BufferAttribute = BufferAttribute; + exports.Face3 = Face3; + exports.Object3DIdCount = Object3DIdCount; + exports.Object3D = Object3D; + exports.Raycaster = Raycaster; + exports.Layers = Layers; + exports.EventDispatcher = EventDispatcher; + exports.Clock = Clock; + exports.QuaternionLinearInterpolant = QuaternionLinearInterpolant; + exports.LinearInterpolant = LinearInterpolant; + exports.DiscreteInterpolant = DiscreteInterpolant; + exports.CubicInterpolant = CubicInterpolant; + exports.Interpolant = Interpolant; + exports.Triangle = Triangle; + exports.Spline = Spline; + exports.Math = _Math; + exports.Spherical = Spherical; + exports.Plane = Plane; + exports.Frustum = Frustum; + exports.Sphere = Sphere; + exports.Ray = Ray; + exports.Matrix4 = Matrix4; + exports.Matrix3 = Matrix3; + exports.Box3 = Box3; + exports.Box2 = Box2; + exports.Line3 = Line3; + exports.Euler = Euler; + exports.Vector4 = Vector4; + exports.Vector3 = Vector3; + exports.Vector2 = Vector2; + exports.Quaternion = Quaternion; + exports.ColorKeywords = ColorKeywords; + exports.Color = Color; + exports.MorphBlendMesh = MorphBlendMesh; + exports.ImmediateRenderObject = ImmediateRenderObject; + exports.VertexNormalsHelper = VertexNormalsHelper; + exports.SpotLightHelper = SpotLightHelper; + exports.SkeletonHelper = SkeletonHelper; + exports.PointLightHelper = PointLightHelper; + exports.HemisphereLightHelper = HemisphereLightHelper; + exports.GridHelper = GridHelper; + exports.FaceNormalsHelper = FaceNormalsHelper; + exports.DirectionalLightHelper = DirectionalLightHelper; + exports.CameraHelper = CameraHelper; + exports.BoundingBoxHelper = BoundingBoxHelper; + exports.BoxHelper = BoxHelper; + exports.ArrowHelper = ArrowHelper; + exports.AxisHelper = AxisHelper; + exports.ClosedSplineCurve3 = ClosedSplineCurve3; + exports.CatmullRomCurve3 = CatmullRomCurve3; + exports.SplineCurve3 = SplineCurve3; + exports.CubicBezierCurve3 = CubicBezierCurve3; + exports.QuadraticBezierCurve3 = QuadraticBezierCurve3; + exports.LineCurve3 = LineCurve3; + exports.ArcCurve = ArcCurve; + exports.EllipseCurve = EllipseCurve; + exports.SplineCurve = SplineCurve; + exports.CubicBezierCurve = CubicBezierCurve; + exports.QuadraticBezierCurve = QuadraticBezierCurve; + exports.LineCurve = LineCurve; + exports.Shape = Shape; + exports.ShapePath = ShapePath; + exports.Path = Path; + exports.Font = Font; + exports.CurvePath = CurvePath; + exports.Curve = Curve; + exports.ShapeUtils = ShapeUtils; + exports.SceneUtils = SceneUtils; + exports.CurveUtils = CurveUtils; + exports.WireframeGeometry = WireframeGeometry; + exports.ParametricGeometry = ParametricGeometry; + exports.ParametricBufferGeometry = ParametricBufferGeometry; + exports.TetrahedronGeometry = TetrahedronGeometry; + exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry; + exports.OctahedronGeometry = OctahedronGeometry; + exports.OctahedronBufferGeometry = OctahedronBufferGeometry; + exports.IcosahedronGeometry = IcosahedronGeometry; + exports.IcosahedronBufferGeometry = IcosahedronBufferGeometry; + exports.DodecahedronGeometry = DodecahedronGeometry; + exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry; + exports.PolyhedronGeometry = PolyhedronGeometry; + exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry; + exports.TubeGeometry = TubeGeometry; + exports.TubeBufferGeometry = TubeBufferGeometry; + exports.TorusKnotGeometry = TorusKnotGeometry; + exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry; + exports.TorusGeometry = TorusGeometry; + exports.TorusBufferGeometry = TorusBufferGeometry; + exports.TextGeometry = TextGeometry; + exports.SphereBufferGeometry = SphereBufferGeometry; + exports.SphereGeometry = SphereGeometry; + exports.RingGeometry = RingGeometry; + exports.RingBufferGeometry = RingBufferGeometry; + exports.PlaneBufferGeometry = PlaneBufferGeometry; + exports.PlaneGeometry = PlaneGeometry; + exports.LatheGeometry = LatheGeometry; + exports.LatheBufferGeometry = LatheBufferGeometry; + exports.ShapeGeometry = ShapeGeometry; + exports.ExtrudeGeometry = ExtrudeGeometry; + exports.EdgesGeometry = EdgesGeometry; + exports.ConeGeometry = ConeGeometry; + exports.ConeBufferGeometry = ConeBufferGeometry; + exports.CylinderGeometry = CylinderGeometry; + exports.CylinderBufferGeometry = CylinderBufferGeometry; + exports.CircleBufferGeometry = CircleBufferGeometry; + exports.CircleGeometry = CircleGeometry; + exports.BoxBufferGeometry = BoxBufferGeometry; + exports.BoxGeometry = BoxGeometry; + exports.ShadowMaterial = ShadowMaterial; + exports.SpriteMaterial = SpriteMaterial; + exports.RawShaderMaterial = RawShaderMaterial; + exports.ShaderMaterial = ShaderMaterial; + exports.PointsMaterial = PointsMaterial; + exports.MultiMaterial = MultiMaterial; + exports.MeshPhysicalMaterial = MeshPhysicalMaterial; + exports.MeshStandardMaterial = MeshStandardMaterial; + exports.MeshPhongMaterial = MeshPhongMaterial; + exports.MeshNormalMaterial = MeshNormalMaterial; + exports.MeshLambertMaterial = MeshLambertMaterial; + exports.MeshDepthMaterial = MeshDepthMaterial; + exports.MeshBasicMaterial = MeshBasicMaterial; + exports.LineDashedMaterial = LineDashedMaterial; + exports.LineBasicMaterial = LineBasicMaterial; + exports.Material = Material; + exports.REVISION = REVISION; + exports.MOUSE = MOUSE; + exports.CullFaceNone = CullFaceNone; + exports.CullFaceBack = CullFaceBack; + exports.CullFaceFront = CullFaceFront; + exports.CullFaceFrontBack = CullFaceFrontBack; + exports.FrontFaceDirectionCW = FrontFaceDirectionCW; + exports.FrontFaceDirectionCCW = FrontFaceDirectionCCW; + exports.BasicShadowMap = BasicShadowMap; + exports.PCFShadowMap = PCFShadowMap; + exports.PCFSoftShadowMap = PCFSoftShadowMap; + exports.FrontSide = FrontSide; + exports.BackSide = BackSide; + exports.DoubleSide = DoubleSide; + exports.FlatShading = FlatShading; + exports.SmoothShading = SmoothShading; + exports.NoColors = NoColors; + exports.FaceColors = FaceColors; + exports.VertexColors = VertexColors; + exports.NoBlending = NoBlending; + exports.NormalBlending = NormalBlending; + exports.AdditiveBlending = AdditiveBlending; + exports.SubtractiveBlending = SubtractiveBlending; + exports.MultiplyBlending = MultiplyBlending; + exports.CustomBlending = CustomBlending; + exports.BlendingMode = BlendingMode; + exports.AddEquation = AddEquation; + exports.SubtractEquation = SubtractEquation; + exports.ReverseSubtractEquation = ReverseSubtractEquation; + exports.MinEquation = MinEquation; + exports.MaxEquation = MaxEquation; + exports.ZeroFactor = ZeroFactor; + exports.OneFactor = OneFactor; + exports.SrcColorFactor = SrcColorFactor; + exports.OneMinusSrcColorFactor = OneMinusSrcColorFactor; + exports.SrcAlphaFactor = SrcAlphaFactor; + exports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor; + exports.DstAlphaFactor = DstAlphaFactor; + exports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor; + exports.DstColorFactor = DstColorFactor; + exports.OneMinusDstColorFactor = OneMinusDstColorFactor; + exports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor; + exports.NeverDepth = NeverDepth; + exports.AlwaysDepth = AlwaysDepth; + exports.LessDepth = LessDepth; + exports.LessEqualDepth = LessEqualDepth; + exports.EqualDepth = EqualDepth; + exports.GreaterEqualDepth = GreaterEqualDepth; + exports.GreaterDepth = GreaterDepth; + exports.NotEqualDepth = NotEqualDepth; + exports.MultiplyOperation = MultiplyOperation; + exports.MixOperation = MixOperation; + exports.AddOperation = AddOperation; + exports.NoToneMapping = NoToneMapping; + exports.LinearToneMapping = LinearToneMapping; + exports.ReinhardToneMapping = ReinhardToneMapping; + exports.Uncharted2ToneMapping = Uncharted2ToneMapping; + exports.CineonToneMapping = CineonToneMapping; + exports.UVMapping = UVMapping; + exports.CubeReflectionMapping = CubeReflectionMapping; + exports.CubeRefractionMapping = CubeRefractionMapping; + exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping; + exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping; + exports.SphericalReflectionMapping = SphericalReflectionMapping; + exports.CubeUVReflectionMapping = CubeUVReflectionMapping; + exports.CubeUVRefractionMapping = CubeUVRefractionMapping; + exports.TextureMapping = TextureMapping; + exports.RepeatWrapping = RepeatWrapping; + exports.ClampToEdgeWrapping = ClampToEdgeWrapping; + exports.MirroredRepeatWrapping = MirroredRepeatWrapping; + exports.TextureWrapping = TextureWrapping; + exports.NearestFilter = NearestFilter; + exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter; + exports.NearestMipMapLinearFilter = NearestMipMapLinearFilter; + exports.LinearFilter = LinearFilter; + exports.LinearMipMapNearestFilter = LinearMipMapNearestFilter; + exports.LinearMipMapLinearFilter = LinearMipMapLinearFilter; + exports.TextureFilter = TextureFilter; + exports.UnsignedByteType = UnsignedByteType; + exports.ByteType = ByteType; + exports.ShortType = ShortType; + exports.UnsignedShortType = UnsignedShortType; + exports.IntType = IntType; + exports.UnsignedIntType = UnsignedIntType; + exports.FloatType = FloatType; + exports.HalfFloatType = HalfFloatType; + exports.UnsignedShort4444Type = UnsignedShort4444Type; + exports.UnsignedShort5551Type = UnsignedShort5551Type; + exports.UnsignedShort565Type = UnsignedShort565Type; + exports.UnsignedInt248Type = UnsignedInt248Type; + exports.AlphaFormat = AlphaFormat; + exports.RGBFormat = RGBFormat; + exports.RGBAFormat = RGBAFormat; + exports.LuminanceFormat = LuminanceFormat; + exports.LuminanceAlphaFormat = LuminanceAlphaFormat; + exports.RGBEFormat = RGBEFormat; + exports.DepthFormat = DepthFormat; + exports.DepthStencilFormat = DepthStencilFormat; + exports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format; + exports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format; + exports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format; + exports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format; + exports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format; + exports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format; + exports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format; + exports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format; + exports.RGB_ETC1_Format = RGB_ETC1_Format; + exports.LoopOnce = LoopOnce; + exports.LoopRepeat = LoopRepeat; + exports.LoopPingPong = LoopPingPong; + exports.InterpolateDiscrete = InterpolateDiscrete; + exports.InterpolateLinear = InterpolateLinear; + exports.InterpolateSmooth = InterpolateSmooth; + exports.ZeroCurvatureEnding = ZeroCurvatureEnding; + exports.ZeroSlopeEnding = ZeroSlopeEnding; + exports.WrapAroundEnding = WrapAroundEnding; + exports.TrianglesDrawMode = TrianglesDrawMode; + exports.TriangleStripDrawMode = TriangleStripDrawMode; + exports.TriangleFanDrawMode = TriangleFanDrawMode; + exports.LinearEncoding = LinearEncoding; + exports.sRGBEncoding = sRGBEncoding; + exports.GammaEncoding = GammaEncoding; + exports.RGBEEncoding = RGBEEncoding; + exports.LogLuvEncoding = LogLuvEncoding; + exports.RGBM7Encoding = RGBM7Encoding; + exports.RGBM16Encoding = RGBM16Encoding; + exports.RGBDEncoding = RGBDEncoding; + exports.BasicDepthPacking = BasicDepthPacking; + exports.RGBADepthPacking = RGBADepthPacking; + exports.CubeGeometry = BoxGeometry; + exports.Face4 = Face4; + exports.LineStrip = LineStrip; + exports.LinePieces = LinePieces; + exports.MeshFaceMaterial = MultiMaterial; + exports.PointCloud = PointCloud; + exports.Particle = Sprite; + exports.ParticleSystem = ParticleSystem; + exports.PointCloudMaterial = PointCloudMaterial; + exports.ParticleBasicMaterial = ParticleBasicMaterial; + exports.ParticleSystemMaterial = ParticleSystemMaterial; + exports.Vertex = Vertex; + exports.EdgesHelper = EdgesHelper; + exports.WireframeHelper = WireframeHelper; + exports.GeometryUtils = GeometryUtils; + exports.ImageUtils = ImageUtils; + exports.Projector = Projector; + exports.CanvasRenderer = CanvasRenderer; + + Object.defineProperty(exports, '__esModule', { value: true }); + + Object.defineProperty( exports, 'AudioContext', { + get: function () { + return exports.getAudioContext(); + } + }); + + }))); + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + + module.exports = function( THREE ) { + /** + * @author qiao / https://github.com/qiao + * @author mrdoob / http://mrdoob.com + * @author alteredq / http://alteredqualia.com/ + * @author WestLangley / http://github.com/WestLangley + * @author erich666 / http://erichaines.com + */ + + // This set of controls performs orbiting, dollying (zooming), and panning. + // Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default). + // + // Orbit - left mouse / touch: one finger move + // Zoom - middle mouse, or mousewheel / touch: two finger spread or squish + // Pan - right mouse, or arrow keys / touch: three finter swipe + + function OrbitControls( object, domElement ) { + + this.object = object; + + this.domElement = ( domElement !== undefined ) ? domElement : document; + + // Set to false to disable this control + this.enabled = true; + + // "target" sets the location of focus, where the object orbits around + this.target = new THREE.Vector3(); + + // How far you can dolly in and out ( PerspectiveCamera only ) + this.minDistance = 0; + this.maxDistance = Infinity; + + // How far you can zoom in and out ( OrthographicCamera only ) + this.minZoom = 0; + this.maxZoom = Infinity; + + // How far you can orbit vertically, upper and lower limits. + // Range is 0 to Math.PI radians. + this.minPolarAngle = 0; // radians + this.maxPolarAngle = Math.PI; // radians + + // How far you can orbit horizontally, upper and lower limits. + // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ]. + this.minAzimuthAngle = - Infinity; // radians + this.maxAzimuthAngle = Infinity; // radians + + // Set to true to enable damping (inertia) + // If damping is enabled, you must call controls.update() in your animation loop + this.enableDamping = false; + this.dampingFactor = 0.25; + + // This option actually enables dollying in and out; left as "zoom" for backwards compatibility. + // Set to false to disable zooming + this.enableZoom = true; + this.zoomSpeed = 1.0; + + // Set to false to disable rotating + this.enableRotate = true; + this.rotateSpeed = 1.0; + + // Set to false to disable panning + this.enablePan = true; + this.keyPanSpeed = 7.0; // pixels moved per arrow key push + + // Set to true to automatically rotate around the target + // If auto-rotate is enabled, you must call controls.update() in your animation loop + this.autoRotate = false; + this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60 + + // Set to false to disable use of the keys + this.enableKeys = true; + + // The four arrow keys + this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }; + + // Mouse buttons + this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT }; + + // for reset + this.target0 = this.target.clone(); + this.position0 = this.object.position.clone(); + this.zoom0 = this.object.zoom; + + // + // public methods + // + + this.getPolarAngle = function () { + + return spherical.phi; + + }; + + this.getAzimuthalAngle = function () { + + return spherical.theta; + + }; + + this.reset = function () { + + scope.target.copy( scope.target0 ); + scope.object.position.copy( scope.position0 ); + scope.object.zoom = scope.zoom0; + + scope.object.updateProjectionMatrix(); + scope.dispatchEvent( changeEvent ); + + scope.update(); + + state = STATE.NONE; + + }; + + // this method is exposed, but perhaps it would be better if we can make it private... + this.update = function() { + + var offset = new THREE.Vector3(); + + // so camera.up is the orbit axis + var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) ); + var quatInverse = quat.clone().inverse(); + + var lastPosition = new THREE.Vector3(); + var lastQuaternion = new THREE.Quaternion(); + + return function update () { + + var position = scope.object.position; + + offset.copy( position ).sub( scope.target ); + + // rotate offset to "y-axis-is-up" space + offset.applyQuaternion( quat ); + + // angle from z-axis around y-axis + spherical.setFromVector3( offset ); + + if ( scope.autoRotate && state === STATE.NONE ) { + + rotateLeft( getAutoRotationAngle() ); + + } + + spherical.theta += sphericalDelta.theta; + spherical.phi += sphericalDelta.phi; + + // restrict theta to be between desired limits + spherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) ); + + // restrict phi to be between desired limits + spherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) ); + + spherical.makeSafe(); + + + spherical.radius *= scale; + + // restrict radius to be between desired limits + spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) ); + + // move target to panned location + scope.target.add( panOffset ); + + offset.setFromSpherical( spherical ); + + // rotate offset back to "camera-up-vector-is-up" space + offset.applyQuaternion( quatInverse ); + + position.copy( scope.target ).add( offset ); + + scope.object.lookAt( scope.target ); + + if ( scope.enableDamping === true ) { + + sphericalDelta.theta *= ( 1 - scope.dampingFactor ); + sphericalDelta.phi *= ( 1 - scope.dampingFactor ); + + } else { + + sphericalDelta.set( 0, 0, 0 ); + + } + + scale = 1; + panOffset.set( 0, 0, 0 ); + + // update condition is: + // min(camera displacement, camera rotation in radians)^2 > EPS + // using small-angle approximation cos(x/2) = 1 - x^2 / 8 + + if ( zoomChanged || + lastPosition.distanceToSquared( scope.object.position ) > EPS || + 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) { + + scope.dispatchEvent( changeEvent ); + + lastPosition.copy( scope.object.position ); + lastQuaternion.copy( scope.object.quaternion ); + zoomChanged = false; + + return true; + + } + + return false; + + }; + + }(); + + this.dispose = function() { + + scope.domElement.removeEventListener( 'contextmenu', onContextMenu, false ); + scope.domElement.removeEventListener( 'mousedown', onMouseDown, false ); + scope.domElement.removeEventListener( 'wheel', onMouseWheel, false ); + + scope.domElement.removeEventListener( 'touchstart', onTouchStart, false ); + scope.domElement.removeEventListener( 'touchend', onTouchEnd, false ); + scope.domElement.removeEventListener( 'touchmove', onTouchMove, false ); + + document.removeEventListener( 'mousemove', onMouseMove, false ); + document.removeEventListener( 'mouseup', onMouseUp, false ); + + window.removeEventListener( 'keydown', onKeyDown, false ); + + //scope.dispatchEvent( { type: 'dispose' } ); // should this be added here? + + }; + + // + // internals + // + + var scope = this; + + var changeEvent = { type: 'change' }; + var startEvent = { type: 'start' }; + var endEvent = { type: 'end' }; + + var STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 }; + + var state = STATE.NONE; + + var EPS = 0.000001; + + // current position in spherical coordinates + var spherical = new THREE.Spherical(); + var sphericalDelta = new THREE.Spherical(); + + var scale = 1; + var panOffset = new THREE.Vector3(); + var zoomChanged = false; + + var rotateStart = new THREE.Vector2(); + var rotateEnd = new THREE.Vector2(); + var rotateDelta = new THREE.Vector2(); + + var panStart = new THREE.Vector2(); + var panEnd = new THREE.Vector2(); + var panDelta = new THREE.Vector2(); + + var dollyStart = new THREE.Vector2(); + var dollyEnd = new THREE.Vector2(); + var dollyDelta = new THREE.Vector2(); + + function getAutoRotationAngle() { + + return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed; + + } + + function getZoomScale() { + + return Math.pow( 0.95, scope.zoomSpeed ); + + } + + function rotateLeft( angle ) { + + sphericalDelta.theta -= angle; + + } + + function rotateUp( angle ) { + + sphericalDelta.phi -= angle; + + } + + var panLeft = function() { + + var v = new THREE.Vector3(); + + return function panLeft( distance, objectMatrix ) { + + v.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix + v.multiplyScalar( - distance ); + + panOffset.add( v ); + + }; + + }(); + + var panUp = function() { + + var v = new THREE.Vector3(); + + return function panUp( distance, objectMatrix ) { + + v.setFromMatrixColumn( objectMatrix, 1 ); // get Y column of objectMatrix + v.multiplyScalar( distance ); + + panOffset.add( v ); + + }; + + }(); + + // deltaX and deltaY are in pixels; right and down are positive + var pan = function() { + + var offset = new THREE.Vector3(); + + return function pan ( deltaX, deltaY ) { + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + // perspective + var position = scope.object.position; + offset.copy( position ).sub( scope.target ); + var targetDistance = offset.length(); + + // half of the fov is center to top of screen + targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 ); + + // we actually don't use screenWidth, since perspective camera is fixed to screen height + panLeft( 2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix ); + panUp( 2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix ); + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + // orthographic + panLeft( deltaX * ( scope.object.right - scope.object.left ) / scope.object.zoom / element.clientWidth, scope.object.matrix ); + panUp( deltaY * ( scope.object.top - scope.object.bottom ) / scope.object.zoom / element.clientHeight, scope.object.matrix ); + + } else { + + // camera neither orthographic nor perspective + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' ); + scope.enablePan = false; + + } + + }; + + }(); + + function dollyIn( dollyScale ) { + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + scale /= dollyScale; + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom * dollyScale ) ); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + + } else { + + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ); + scope.enableZoom = false; + + } + + } + + function dollyOut( dollyScale ) { + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + scale *= dollyScale; + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / dollyScale ) ); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + + } else { + + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ); + scope.enableZoom = false; + + } + + } + + // + // event callbacks - update the object state + // + + function handleMouseDownRotate( event ) { + + //console.log( 'handleMouseDownRotate' ); + + rotateStart.set( event.clientX, event.clientY ); + + } + + function handleMouseDownDolly( event ) { + + //console.log( 'handleMouseDownDolly' ); + + dollyStart.set( event.clientX, event.clientY ); + + } + + function handleMouseDownPan( event ) { + + //console.log( 'handleMouseDownPan' ); + + panStart.set( event.clientX, event.clientY ); + + } + + function handleMouseMoveRotate( event ) { + + //console.log( 'handleMouseMoveRotate' ); + + rotateEnd.set( event.clientX, event.clientY ); + rotateDelta.subVectors( rotateEnd, rotateStart ); + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + // rotating across whole screen goes 360 degrees around + rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); + + // rotating up and down along whole screen attempts to go 360, but limited to 180 + rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); + + rotateStart.copy( rotateEnd ); + + scope.update(); + + } + + function handleMouseMoveDolly( event ) { + + //console.log( 'handleMouseMoveDolly' ); + + dollyEnd.set( event.clientX, event.clientY ); + + dollyDelta.subVectors( dollyEnd, dollyStart ); + + if ( dollyDelta.y > 0 ) { + + dollyIn( getZoomScale() ); + + } else if ( dollyDelta.y < 0 ) { + + dollyOut( getZoomScale() ); + + } + + dollyStart.copy( dollyEnd ); + + scope.update(); + + } + + function handleMouseMovePan( event ) { + + //console.log( 'handleMouseMovePan' ); + + panEnd.set( event.clientX, event.clientY ); + + panDelta.subVectors( panEnd, panStart ); + + pan( panDelta.x, panDelta.y ); + + panStart.copy( panEnd ); + + scope.update(); + + } + + function handleMouseUp( event ) { + + //console.log( 'handleMouseUp' ); + + } + + function handleMouseWheel( event ) { + + //console.log( 'handleMouseWheel' ); + + if ( event.deltaY < 0 ) { + + dollyOut( getZoomScale() ); + + } else if ( event.deltaY > 0 ) { + + dollyIn( getZoomScale() ); + + } + + scope.update(); + + } + + function handleKeyDown( event ) { + + //console.log( 'handleKeyDown' ); + + switch ( event.keyCode ) { + + case scope.keys.UP: + pan( 0, scope.keyPanSpeed ); + scope.update(); + break; + + case scope.keys.BOTTOM: + pan( 0, - scope.keyPanSpeed ); + scope.update(); + break; + + case scope.keys.LEFT: + pan( scope.keyPanSpeed, 0 ); + scope.update(); + break; + + case scope.keys.RIGHT: + pan( - scope.keyPanSpeed, 0 ); + scope.update(); + break; + + } + + } + + function handleTouchStartRotate( event ) { + + //console.log( 'handleTouchStartRotate' ); + + rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + + } + + function handleTouchStartDolly( event ) { + + //console.log( 'handleTouchStartDolly' ); + + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + + var distance = Math.sqrt( dx * dx + dy * dy ); + + dollyStart.set( 0, distance ); + + } + + function handleTouchStartPan( event ) { + + //console.log( 'handleTouchStartPan' ); + + panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + + } + + function handleTouchMoveRotate( event ) { + + //console.log( 'handleTouchMoveRotate' ); + + rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + rotateDelta.subVectors( rotateEnd, rotateStart ); + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + // rotating across whole screen goes 360 degrees around + rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); + + // rotating up and down along whole screen attempts to go 360, but limited to 180 + rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); + + rotateStart.copy( rotateEnd ); + + scope.update(); + + } + + function handleTouchMoveDolly( event ) { + + //console.log( 'handleTouchMoveDolly' ); + + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + + var distance = Math.sqrt( dx * dx + dy * dy ); + + dollyEnd.set( 0, distance ); + + dollyDelta.subVectors( dollyEnd, dollyStart ); + + if ( dollyDelta.y > 0 ) { + + dollyOut( getZoomScale() ); + + } else if ( dollyDelta.y < 0 ) { + + dollyIn( getZoomScale() ); + + } + + dollyStart.copy( dollyEnd ); + + scope.update(); + + } + + function handleTouchMovePan( event ) { + + //console.log( 'handleTouchMovePan' ); + + panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + + panDelta.subVectors( panEnd, panStart ); + + pan( panDelta.x, panDelta.y ); + + panStart.copy( panEnd ); + + scope.update(); + + } + + function handleTouchEnd( event ) { + + //console.log( 'handleTouchEnd' ); + + } + + // + // event handlers - FSM: listen for events and reset state + // + + function onMouseDown( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + + if ( event.button === scope.mouseButtons.ORBIT ) { + + if ( scope.enableRotate === false ) return; + + handleMouseDownRotate( event ); + + state = STATE.ROTATE; + + } else if ( event.button === scope.mouseButtons.ZOOM ) { + + if ( scope.enableZoom === false ) return; + + handleMouseDownDolly( event ); + + state = STATE.DOLLY; + + } else if ( event.button === scope.mouseButtons.PAN ) { + + if ( scope.enablePan === false ) return; + + handleMouseDownPan( event ); + + state = STATE.PAN; + + } + + if ( state !== STATE.NONE ) { + + document.addEventListener( 'mousemove', onMouseMove, false ); + document.addEventListener( 'mouseup', onMouseUp, false ); + + scope.dispatchEvent( startEvent ); + + } + + } + + function onMouseMove( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + + if ( state === STATE.ROTATE ) { + + if ( scope.enableRotate === false ) return; + + handleMouseMoveRotate( event ); + + } else if ( state === STATE.DOLLY ) { + + if ( scope.enableZoom === false ) return; + + handleMouseMoveDolly( event ); + + } else if ( state === STATE.PAN ) { + + if ( scope.enablePan === false ) return; + + handleMouseMovePan( event ); + + } + + } + + function onMouseUp( event ) { + + if ( scope.enabled === false ) return; + + handleMouseUp( event ); + + document.removeEventListener( 'mousemove', onMouseMove, false ); + document.removeEventListener( 'mouseup', onMouseUp, false ); + + scope.dispatchEvent( endEvent ); + + state = STATE.NONE; + + } + + function onMouseWheel( event ) { + + if ( scope.enabled === false || scope.enableZoom === false || ( state !== STATE.NONE && state !== STATE.ROTATE ) ) return; + + event.preventDefault(); + event.stopPropagation(); + + handleMouseWheel( event ); + + scope.dispatchEvent( startEvent ); // not sure why these are here... + scope.dispatchEvent( endEvent ); + + } + + function onKeyDown( event ) { + + if ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return; + + handleKeyDown( event ); + + } + + function onTouchStart( event ) { + + if ( scope.enabled === false ) return; + + switch ( event.touches.length ) { + + case 1: // one-fingered touch: rotate + + if ( scope.enableRotate === false ) return; + + handleTouchStartRotate( event ); + + state = STATE.TOUCH_ROTATE; + + break; + + case 2: // two-fingered touch: dolly + + if ( scope.enableZoom === false ) return; + + handleTouchStartDolly( event ); + + state = STATE.TOUCH_DOLLY; + + break; + + case 3: // three-fingered touch: pan + + if ( scope.enablePan === false ) return; + + handleTouchStartPan( event ); + + state = STATE.TOUCH_PAN; + + break; + + default: + + state = STATE.NONE; + + } + + if ( state !== STATE.NONE ) { + + scope.dispatchEvent( startEvent ); + + } + + } + + function onTouchMove( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + switch ( event.touches.length ) { + + case 1: // one-fingered touch: rotate + + if ( scope.enableRotate === false ) return; + if ( state !== STATE.TOUCH_ROTATE ) return; // is this needed?... + + handleTouchMoveRotate( event ); + + break; + + case 2: // two-fingered touch: dolly + + if ( scope.enableZoom === false ) return; + if ( state !== STATE.TOUCH_DOLLY ) return; // is this needed?... + + handleTouchMoveDolly( event ); + + break; + + case 3: // three-fingered touch: pan + + if ( scope.enablePan === false ) return; + if ( state !== STATE.TOUCH_PAN ) return; // is this needed?... + + handleTouchMovePan( event ); + + break; + + default: + + state = STATE.NONE; + + } + + } + + function onTouchEnd( event ) { + + if ( scope.enabled === false ) return; + + handleTouchEnd( event ); + + scope.dispatchEvent( endEvent ); + + state = STATE.NONE; + + } + + function onContextMenu( event ) { + + event.preventDefault(); + + } + + // + + scope.domElement.addEventListener( 'contextmenu', onContextMenu, false ); + + scope.domElement.addEventListener( 'mousedown', onMouseDown, false ); + scope.domElement.addEventListener( 'wheel', onMouseWheel, false ); + + scope.domElement.addEventListener( 'touchstart', onTouchStart, false ); + scope.domElement.addEventListener( 'touchend', onTouchEnd, false ); + scope.domElement.addEventListener( 'touchmove', onTouchMove, false ); + + window.addEventListener( 'keydown', onKeyDown, false ); + + // force an update at start + + this.update(); + + }; + + OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype ); + OrbitControls.prototype.constructor = OrbitControls; + + Object.defineProperties( OrbitControls.prototype, { + + center: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .center has been renamed to .target' ); + return this.target; + + } + + }, + + // backward compatibility + + noZoom: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' ); + return ! this.enableZoom; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' ); + this.enableZoom = ! value; + + } + + }, + + noRotate: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' ); + return ! this.enableRotate; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' ); + this.enableRotate = ! value; + + } + + }, + + noPan: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' ); + return ! this.enablePan; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' ); + this.enablePan = ! value; + + } + + }, + + noKeys: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' ); + return ! this.enableKeys; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' ); + this.enableKeys = ! value; + + } + + }, + + staticMoving : { + + get: function () { + + console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' ); + return ! this.enableDamping; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' ); + this.enableDamping = ! value; + + } + + }, + + dynamicDampingFactor : { + + get: function () { + + console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' ); + return this.dampingFactor; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' ); + this.dampingFactor = value; + + } + + } + + } ); + + return OrbitControls; + }; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _houseLsystem = __webpack_require__(9); + + var _houseLsystem2 = _interopRequireDefault(_houseLsystem); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var THREE = __webpack_require__(6); + + + var ParserState = function ParserState(pos, dir, r) { + return { + pos: new THREE.Vector3(pos.x, pos.y, pos.z), + dir: new THREE.Vector3(dir.x, dir.y, dir.z), + radius: r + }; + }; + + var Parser = function () { + function Parser(position, direction, scene, iterations, radius) { + _classCallCheck(this, Parser); + + this.initPos = position; + this.initDir = direction; + + this.state = new ParserState(this.initPos, this.initDir, radius); + this.stack = []; + + this.scene = scene; + this.totalIter = iterations; + + this.renderGrammar = { + 'L': this.addLevel.bind(this), + '[': this.saveState.bind(this), + ']': this.applyState.bind(this), + '0': this.shiftState.bind(this, 0), + '1': this.shiftState.bind(this, 1), + '2': this.shiftState.bind(this, 2), + '3': this.shiftState.bind(this, 3), + '4': this.shiftState.bind(this, 4), + '5': this.shiftState.bind(this, 5), + '6': this.shiftState.bind(this, 6), + '7': this.shiftState.bind(this, 7), + 'r': this.decreaseRadius.bind(this) + }; + + this.stdDir = [new THREE.Vector3(-1, 0, 1).normalize(), new THREE.Vector3(0, 0, 1), new THREE.Vector3(1, 0, 1).normalize(), new THREE.Vector3(1, 0, 0), new THREE.Vector3(1, 0, -1).normalize(), new THREE.Vector3(0, 0, -1), new THREE.Vector3(-1, 0, -1).normalize(), new THREE.Vector3(-1, 0, 0)]; + } + + _createClass(Parser, [{ + key: 'saveState', + value: function saveState() { + var newState = new ParserState(this.state.pos, this.state.dir, this.state.radius); + this.stack.push(newState); + } + }, { + key: 'applyState', + value: function applyState() { + this.state = this.stack.pop(); + } + }, { + key: 'shiftState', + value: function shiftState(posNum) { + + var currR = this.state.radius; + + var pos = this.state.pos; + var newP = new THREE.Vector3(pos.x, pos.y, pos.z).addScaledVector(this.stdDir[posNum], 3 * currR / 4); + + this.state.radius = currR / 4; + this.state.pos = newP; + } + }, { + key: 'decreaseRadius', + value: function decreaseRadius() { + this.state.radius *= 0.7; + } + }, { + key: 'addLevel', + value: function addLevel() { + if (Math.random() > 0.5) { + this.addCylinder(); + } else { + this.addBox(); + } + } + }, { + key: 'addCylinder', + value: function addCylinder() { + var currR = this.state.radius; + var outerR = currR - Math.random() * currR / 2; + var innerR = outerR - Math.random() * outerR / 2; + this.state.radius = innerR; + + var height = currR * 0.1 + Math.random() * Math.pow(this.currIdx, 0.25); + + var color = new THREE.Color(Math.random(), Math.random(), Math.random()); + + var geom = new THREE.CylinderGeometry(innerR, outerR, height, 16); + var material = new THREE.MeshLambertMaterial({ color: color }); + var cyl = new THREE.Mesh(geom, material); + + var pos = this.state.pos; + var dir = this.state.dir; + + pos.addScaledVector(dir, height / 2); + cyl.position.set(pos.x, pos.y, pos.z); + + cyl.lookAt(pos.addScaledVector(dir, height / 2)); + cyl.rotateX(Math.PI / 2); + + this.scene.add(cyl); + } + }, { + key: 'addBox', + value: function addBox() { + var currR = this.state.radius; + var width = currR - Math.random() * currR / 2; + var depth = currR - Math.random() * currR / 2; + this.state.radius = Math.min(width, depth) / 2; + + var height = currR * 0.1 + Math.random() * Math.pow(this.currIdx, 0.25); + + var color = new THREE.Color(Math.random(), Math.random(), Math.random()); + + var geom = new THREE.BoxGeometry(width, height, depth); + var material = new THREE.MeshLambertMaterial({ color: color }); + var box = new THREE.Mesh(geom, material); + + var pos = this.state.pos; + var dir = this.state.dir; + + pos.addScaledVector(dir, height / 2); + box.position.set(pos.x, pos.y, pos.z); + + box.lookAt(pos.addScaledVector(dir, height / 2)); + box.rotateX(Math.PI / 2); + + this.scene.add(box); + } + }, { + key: 'renderSymbol', + value: function renderSymbol(symbolNode) { + var func = this.renderGrammar[symbolNode.symbol]; + if (func) { + func(); + } + } + }, { + key: 'renderSymbols', + value: function renderSymbols(linkedList) { + if (!linkedList) { + console.log("Cant find house"); + return; + } + this.currIdx = 0; + for (var currentNode = linkedList.head; currentNode != null; currentNode = currentNode.next) { + this.renderSymbol(currentNode); + this.currIdx++; + } + } + }, { + key: 'render', + value: function render() { + var house = new _houseLsystem2.default(); + this.renderSymbols(house.doIterations(this.totalIter)); + } + }]); + + return Parser; + }(); + + exports.default = Parser; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.stringToLinkedList = stringToLinkedList; + exports.linkedListToString = linkedListToString; + exports.default = House; + var THREE = __webpack_require__(6); + function Rule(prob, str) { + this.probability = prob; + this.successorString = str; + } + + function Node(symbol, iter) { + this.next = null; + this.prev = null; + this.symbol = symbol; + this.iter = iter; + } + + function LinkedList(pos) { + this.head = null; + this.length = 0; + this.scale = new THREE.Vector3(1.0, 1.0, 1.0); + this.position = new THREE.Vector3(0, 0, 0); + if (pos) { + this.position = pos; + } + } + + LinkedList.prototype.getTailNode = function () { + var currentNode = this.head; + while (currentNode.next != null) { + currentNode = currentNode.next; + } + return currentNode; + }; + + LinkedList.prototype.add = function (symbol, iter) { + var node = new Node(symbol, iter); + var currentNode = this.head; + if (currentNode == null) { + this.head = node; + this.length = 1; + return; + } + var tail = this.getTailNode(); + this.link(tail, node); + this.length++; + }; + + LinkedList.prototype.link = function (first, second) { + if (first != null) { + first.next = second; + if (second != null) { + second.prev = first; + } + } + }; + + function stringToLinkedList(input_string, iter) { + var ll = new LinkedList(); + for (var i = 0; i < input_string.length; i++) { + ll.add(input_string[i], iter); + } + return ll; + } + + function linkedListToString(linkedList) { + var result = ""; + var currentNode = linkedList.head; + while (currentNode != null) { + result += currentNode.symbol; + currentNode = currentNode.next; + } + return result; + } + + function replaceNode(linkedList, node, replacementString, iter) { + + var nodeBefore = node.prev; + var nodeAfter = node.next; + + var stringList = stringToLinkedList(replacementString, iter); + var tail = stringList.getTailNode(); + + if (nodeBefore == null && nodeAfter == null) { + linkedList.head = stringList.head; + } else if (nodeBefore == null) { + linkedList.head = stringList.head; + linkedList.link(tail, nodeAfter); + } else if (nodeAfter == null) { + linkedList.link(nodeBefore, stringList.head); + } else { + linkedList.link(nodeBefore, stringList.head); + linkedList.link(tail, nodeAfter); + } + + linkedList.length += replacementString.length - 1; + return linkedList; + } + + function House() { + this.axiom = "X"; + this.grammar = {}; + this.grammar['X'] = [new Rule(0.5, 'LX'), new Rule(0.25, 'LS'), new Rule(0.25, 'LSrX')]; + this.grammar['S'] = [new Rule(0.35, 'D'), new Rule(0.25, 'T'), new Rule(0.25, 'Q'), new Rule(0.15, '[0LX][1LX][2LX][3LX][4LX][5LX][6LX][7LX]')]; + this.grammar['D'] = [new Rule(0.04, '[0LX][1LX]'), new Rule(0.04, '[0LX][2LX]'), new Rule(0.04, '[0LX][3LX]'), new Rule(0.04, '[0LX][4LX]'), new Rule(0.04, '[0LX][5LX]'), new Rule(0.04, '[0LX][6LX]'), new Rule(0.04, '[0LX][7LX]'), new Rule(0.04, '[1LX][2LX]'), new Rule(0.04, '[1LX][3LX]'), new Rule(0.04, '[1LX][4LX]'), new Rule(0.04, '[1LX][5LX]'), new Rule(0.04, '[1LX][6LX]'), new Rule(0.04, '[1LX][7LX]'), new Rule(0.04, '[2LX][3LX]'), new Rule(0.04, '[2LX][4LX]'), new Rule(0.04, '[2LX][5LX]'), new Rule(0.04, '[2LX][6LX]'), new Rule(0.04, '[2LX][7LX]'), new Rule(0.04, '[3LX][4LX]'), new Rule(0.04, '[3LX][5LX]'), new Rule(0.04, '[3LX][6LX]'), new Rule(0.04, '[3LX][7LX]'), new Rule(0.04, '[4LX][5LX]'), new Rule(0.04, '[4LX][6LX]'), new Rule(0.04, '[4LX][7LX]'), new Rule(0.04, '[5LX][6LX]'), new Rule(0.04, '[5LX][7LX]'), new Rule(0.04, '[6LX][7LX]')]; + this.grammar['T'] = [new Rule(0.028, '[0LX][1LX][2LX]'), new Rule(0.028, '[0LX][1LX][3LX]'), new Rule(0.028, '[0LX][1LX][4LX]'), new Rule(0.028, '[0LX][1LX][5LX]'), new Rule(0.028, '[0LX][1LX][6LX]'), new Rule(0.028, '[0LX][1LX][7LX]'), new Rule(0.028, '[0LX][2LX][3LX]'), new Rule(0.028, '[0LX][2LX][4LX]'), new Rule(0.028, '[0LX][2LX][5LX]'), new Rule(0.028, '[0LX][2LX][6LX]'), new Rule(0.028, '[0LX][2LX][7LX]'), new Rule(0.028, '[0LX][3LX][4LX]'), new Rule(0.028, '[0LX][3LX][5LX]'), new Rule(0.028, '[0LX][3LX][6LX]'), new Rule(0.028, '[0LX][3LX][7LX]'), new Rule(0.028, '[0LX][4LX][5LX]'), new Rule(0.028, '[0LX][4LX][6LX]'), new Rule(0.028, '[0LX][4LX][7LX]'), new Rule(0.028, '[0LX][5LX][6LX]'), new Rule(0.028, '[0LX][5LX][7LX]'), new Rule(0.028, '[0LX][6LX][7LX]'), new Rule(0.028, '[1LX][2LX][3LX]'), new Rule(0.028, '[1LX][2LX][4LX]'), new Rule(0.028, '[1LX][2LX][5LX]'), new Rule(0.028, '[1LX][2LX][6LX]'), new Rule(0.028, '[1LX][2LX][7LX]'), new Rule(0.028, '[1LX][3LX][4LX]'), new Rule(0.028, '[1LX][3LX][5LX]'), new Rule(0.028, '[1LX][3LX][6LX]'), new Rule(0.028, '[1LX][3LX][7LX]'), new Rule(0.028, '[1LX][4LX][5LX]'), new Rule(0.028, '[1LX][4LX][6LX]'), new Rule(0.028, '[1LX][4LX][7LX]'), new Rule(0.028, '[1LX][5LX][6LX]'), new Rule(0.028, '[1LX][5LX][7LX]'), new Rule(0.028, '[1LX][6LX][7LX]'), new Rule(0.028, '[2LX][3LX][4LX]'), new Rule(0.028, '[2LX][3LX][5LX]'), new Rule(0.028, '[2LX][3LX][6LX]'), new Rule(0.028, '[2LX][3LX][7LX]'), new Rule(0.028, '[2LX][4LX][5LX]'), new Rule(0.028, '[2LX][4LX][6LX]'), new Rule(0.028, '[2LX][4LX][7LX]'), new Rule(0.028, '[2LX][5LX][6LX]'), new Rule(0.028, '[2LX][5LX][7LX]'), new Rule(0.028, '[2LX][6LX][7LX]'), new Rule(0.028, '[3LX][4LX][5LX]'), new Rule(0.028, '[3LX][4LX][6LX]'), new Rule(0.028, '[3LX][4LX][7LX]'), new Rule(0.028, '[3LX][5LX][6LX]'), new Rule(0.028, '[3LX][5LX][7LX]'), new Rule(0.028, '[3LX][6LX][7LX]'), new Rule(0.028, '[4LX][5LX][6LX]'), new Rule(0.028, '[4LX][5LX][7LX]'), new Rule(0.028, '[4LX][6LX][7LX]'), new Rule(0.028, '[5LX][6LX][7LX]')]; + this.grammar['Q'] = [new Rule(0.028, '[0LX][1LX][2LX][3LX]'), new Rule(0.028, '[0LX][1LX][2LX][4LX]'), new Rule(0.028, '[0LX][1LX][2LX][5LX]'), new Rule(0.028, '[0LX][1LX][2LX][6LX]'), new Rule(0.028, '[0LX][1LX][2LX][7LX]'), new Rule(0.028, '[0LX][1LX][3LX][4LX]'), new Rule(0.028, '[0LX][1LX][3LX][5LX]'), new Rule(0.028, '[0LX][1LX][3LX][6LX]'), new Rule(0.028, '[0LX][1LX][3LX][7LX]'), new Rule(0.028, '[0LX][1LX][4LX][5LX]'), new Rule(0.028, '[0LX][1LX][5LX][6LX]'), new Rule(0.028, '[0LX][1LX][5LX][7LX]'), new Rule(0.028, '[0LX][1LX][6LX][7LX]'), new Rule(0.028, '[0LX][2LX][3LX][4LX]'), new Rule(0.028, '[0LX][2LX][3LX][5LX]'), new Rule(0.028, '[0LX][2LX][3LX][6LX]'), new Rule(0.028, '[0LX][2LX][3LX][7LX]'), new Rule(0.028, '[0LX][2LX][4LX][5LX]'), new Rule(0.028, '[0LX][2LX][4LX][6LX]'), new Rule(0.028, '[0LX][2LX][4LX][7LX]'), new Rule(0.028, '[0LX][2LX][5LX][6LX]'), new Rule(0.028, '[0LX][2LX][5LX][7LX]'), new Rule(0.028, '[0LX][2LX][6LX][7LX]'), new Rule(0.028, '[0LX][3LX][4LX][5LX]'), new Rule(0.028, '[0LX][3LX][4LX][6LX]'), new Rule(0.028, '[0LX][3LX][4LX][7LX]'), new Rule(0.028, '[0LX][3LX][5LX][6LX]'), new Rule(0.028, '[0LX][3LX][5LX][7LX]'), new Rule(0.028, '[0LX][3LX][6LX][7LX]'), new Rule(0.028, '[0LX][4LX][5LX][6LX]'), new Rule(0.028, '[0LX][4LX][5LX][7LX]'), new Rule(0.028, '[0LX][4LX][6LX][7LX]'), new Rule(0.028, '[0LX][5LX][6LX][7LX]'), new Rule(0.028, '[1LX][2LX][3LX][4LX]'), new Rule(0.028, '[1LX][2LX][3LX][5LX]'), new Rule(0.028, '[1LX][2LX][3LX][6LX]'), new Rule(0.028, '[1LX][2LX][3LX][7LX]'), new Rule(0.028, '[1LX][2LX][4LX][5LX]'), new Rule(0.028, '[1LX][2LX][4LX][6LX]'), new Rule(0.028, '[1LX][2LX][4LX][7LX]'), new Rule(0.028, '[1LX][2LX][5LX][6LX]'), new Rule(0.028, '[1LX][2LX][5LX][7LX]'), new Rule(0.028, '[1LX][2LX][6LX][7LX]'), new Rule(0.028, '[1LX][3LX][4LX][5LX]'), new Rule(0.028, '[1LX][3LX][4LX][6LX]'), new Rule(0.028, '[1LX][3LX][4LX][7LX]'), new Rule(0.028, '[1LX][3LX][5LX][6LX]'), new Rule(0.028, '[1LX][3LX][5LX][7LX]'), new Rule(0.028, '[1LX][3LX][6LX][7LX]'), new Rule(0.028, '[1LX][4LX][5LX][6LX]'), new Rule(0.028, '[1LX][4LX][5LX][7LX]'), new Rule(0.028, '[1LX][4LX][6LX][7LX]'), new Rule(0.028, '[1LX][5LX][6LX][7LX]'), new Rule(0.028, '[2LX][3LX][4LX][5LX]'), new Rule(0.028, '[2LX][3LX][4LX][6LX]'), new Rule(0.028, '[2LX][3LX][4LX][7LX]'), new Rule(0.028, '[2LX][3LX][5LX][6LX]'), new Rule(0.028, '[2LX][3LX][5LX][7LX]'), new Rule(0.028, '[2LX][3LX][6LX][7LX]'), new Rule(0.028, '[2LX][4LX][5LX][6LX]'), new Rule(0.028, '[2LX][4LX][5LX][7LX]'), new Rule(0.028, '[2LX][4LX][6LX][7LX]'), new Rule(0.028, '[2LX][5LX][6LX][7LX]'), new Rule(0.028, '[3LX][4LX][5LX][6LX]'), new Rule(0.028, '[3LX][4LX][5LX][7LX]'), new Rule(0.028, '[3LX][4LX][6LX][7LX]'), new Rule(0.028, '[4LX][5LX][6LX][7LX]')]; + + this.updateAxiom = function (axiom) { + if (typeof axiom !== "undefined") { + this.axiom = axiom; + } + }; + + this.updateGrammar = function (rule) { + if (typeof axiom !== "undefined") { + this.axiom = axiom; + } + }; + + this.doIterations = function (n) { + var lSystemLL = stringToLinkedList(this.axiom, 0); + lSystemLL.position = this.position; + for (var i = 0; i < n; i++) { + var currentNode = lSystemLL.head; + + while (currentNode != null) { + var next = currentNode.next; + var symbol = currentNode.symbol; + var iter = currentNode.iter; + + if (this.grammar[symbol]) { + var rand = Math.random(); + var sum = 0.0; + var rules = this.grammar[symbol]; + for (var j = 0; j < rules.length; j++) { + sum += rules[j].probability; + if (rand <= sum) { + replaceNode(lSystemLL, currentNode, rules[j].successorString, i + 1); + break; + } + } + } + currentNode = next; + } + } + return lSystemLL; + }; + } + +/***/ }) +/******/ ]); +//# sourceMappingURL=bundle.js.map \ No newline at end of file diff --git a/bundle.js.map b/bundle.js.map new file mode 100644 index 00000000..bf1d18b1 --- /dev/null +++ b/bundle.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap 7c758f2574c190b45da9","webpack:///./src/main.js","webpack:///./src/framework.js","webpack:///./~/stats-js/build/stats.min.js","webpack:///./~/dat-gui/index.js","webpack:///./~/dat-gui/vendor/dat.gui.js","webpack:///./~/dat-gui/vendor/dat.color.js","webpack:///./~/three/build/three.js","webpack:///./~/three-orbit-controls/index.js","webpack:///./src/house-parser.js","webpack:///./src/house-lsystem.js"],"names":["THREE","require","input","layout","shapeGrammar","onLoad","framework","scene","camera","renderer","gui","stats","lightsCamera","showShapeGrammar","showLayout","add","onChange","newVal","updateProjectionMatrix","clearScene","children","length","remove","position","set","lookAt","Vector3","light","AmbientLight","directionalLight","DirectionalLight","direction","parser","render","height","radius","spkMG","CylinderGeometry","spkMM","MeshLambertMaterial","color","spkM","Mesh","spkTG","spkTM","spkT","spkBG","spkBM","spkB","y","x","z","Math","sqrt","dir","dirO","cg","m","cyl","rotateX","PI","cg2","cyl2","normalize","position2","direction2","parser2","onUpdate","init","OrbitControls","callback","update","setMode","domElement","style","left","top","document","body","appendChild","GUI","window","addEventListener","Scene","PerspectiveCamera","innerWidth","innerHeight","WebGLRenderer","antialias","setPixelRatio","devicePixelRatio","setSize","setClearColor","controls","enableDamping","enableZoom","target","rotateSpeed","zoomSpeed","panSpeed","aspect","tick","begin","end","requestAnimationFrame","e","ParserState","pos","r","Parser","iterations","initPos","initDir","state","stack","totalIter","renderGrammar","addLevel","bind","saveState","applyState","shiftState","decreaseRadius","stdDir","newState","push","pop","posNum","currR","newP","addScaledVector","random","addCylinder","addBox","outerR","innerR","pow","currIdx","Color","geom","material","width","depth","min","BoxGeometry","box","symbolNode","func","symbol","linkedList","console","log","currentNode","head","next","renderSymbol","house","renderSymbols","doIterations","stringToLinkedList","linkedListToString","House","Rule","prob","str","probability","successorString","Node","iter","prev","LinkedList","scale","prototype","getTailNode","node","tail","link","first","second","input_string","ll","i","result","replaceNode","replacementString","nodeBefore","nodeAfter","stringList","axiom","grammar","updateAxiom","updateGrammar","rule","n","lSystemLL","rand","sum","rules","j"],"mappings":"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EA,QAAO;;AAEP;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,EAAC;;;AAGD;;AAEA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,eAAc;AACd;AACA;;AAEA;AACA;AACA,eAAc;AACd;AACA;;AAEA;AACA;AACA,eAAc;AACd;AACA;;AAEA;AACA;AACA,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA,eAAc;AACd;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAmB,SAAS;AAC5B;AACA,sBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA,oBAAmB,SAAS;AAC5B;AACA,sBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,sBAAqB,2BAA2B;AAChD;AACA;AACA;AACA,UAAS;;AAET;AACA,sBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA,EAAC;;;AAGD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;;AAEA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,EAAC;;;AAGD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,gBAAgB;AAC7B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,EAAC;AACD;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,gCAA+B;AAC/B,QAAO;AACP;AACA;AACA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,YAAW;AACX;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAS;;AAET;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,sBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA,sBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA,sBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;;AAEA,EAAC;AACD;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,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ACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;;AAEA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA;;AAEA;;;AAGA,EAAC;AACD;;;AAGA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB;AACA,cAAa,QAAQ;AACrB,cAAa,YAAY;AACzB,cAAa,QAAQ;AACrB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;;AAGL;;AAEA;AACA;;AAEA,MAAK;;AAEL,sBAAqB;;AAErB;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAe;AACf;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA,gBAAe;AACf;AACA;AACA;AACA;AACA;;AAEA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA,gBAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,UAAS;;AAET;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA,QAAO;;;AAGP;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;AAGA;AACA;;AAEA;;AAEA,4CAA2C,mBAAmB;AAC9D,4DAA2D,kBAAkB,EAAE;AAC/E,sDAAqD,mBAAmB;AACxE,uDAAsD,mBAAmB;AACzE;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,sBAAqB,2BAA2B;AAChD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAS;;AAET;AACA;AACA;AACA,sBAAqB,gCAAgC;AACrD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX,UAAS;;AAET;;AAEA;AACA;AACA;;AAEA,UAAS;;AAET;AACA;AACA,sBAAqB,YAAY;AACjC,qBAAoB,MAAM;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAgC;;AAEhC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,yCAAwC;;AAExC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;AACb;;AAEA;AACA;AACA;;AAEA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA,oBAAmB,UAAU;AAC7B,qBAAoB,MAAM;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;;AAEA,UAAS;;AAET;AACA,sBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA,sBAAqB,OAAO;AAC5B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW;;AAEX;;AAEA,UAAS;;AAET;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,UAAS;;AAET;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,UAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,YAAW;;AAEX;AACA;AACA,YAAW;;AAEX;AACA;AACA;;;AAGA,UAAS;;AAET;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,QAAO;;AAEP;AACA;AACA;AACA,QAAO;;AAEP;AACA;AACA;AACA,QAAO;;AAEP;AACA;AACA;AACA;;AAEA,MAAK;;AAEL;AACA;;AAEA;AACA,YAAW,wEAAwE;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe;;AAEf;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAO;;AAEP;AACA,6BAA4B;AAC5B,QAAO;;AAEP;AACA;;AAEA;AACA;AACA,QAAO;;AAEP;AACA;AACA,QAAO;;AAEP;AACA;AACA,QAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;;AAEP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,UAAS;;AAET;AACA;;AAEA,UAAS;;AAET;;AAEA;;AAEA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,8BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,QAAO;;AAEP,MAAK;AACL;AACA;;AAEA;;;AAGA,0BAAyB,oCAAoC;AAC7D;AACA;;AAEA;;AAEA,MAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA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+DAA8D,uCAAuC;;AAErG;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa,OAAO;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;;AAGL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8BAA6B;AAC7B;AACA;AACA,MAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAS;;AAET,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,2BAA0B;AAC1B;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW;;AAEX;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,yGAAwG;AACxG,MAAK;AACL;;AAEA;AACA;AACA,8JAA6J;AAC7J,2JAA0J;AAC1J,sJAAqJ;AACrJ,uJAAsJ;AACtJ,mJAAkJ;AAClJ;;;AAGA;;AAEA,EAAC;AACD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,QAAO;;AAEP;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,QAAO;;AAEP;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;;AAEA;;AAEA;;AAEA,EAAC;AACD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,EAAC;AACD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,EAAC;AACD;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA,MAAK;;;AAGL;;AAEA;;AAEA;;;;AAIA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,EAAC;AACD;AACA;AACA,mB;;;;;;AC3kHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,W;;AAEA,cAAa;;AAEb;;AAEA;;AAEA;AACA;AACA;;AAEA,QAAO;;AAEP;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;;AAEA,QAAO;;AAEP;;AAEA,MAAK;;AAEL;AACA;AACA;AACA;AACA,6CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA,MAAK;;AAEL;;;AAGA,kD;;AAEA;;AAEA,QAAO,0CAA0C;;AAEjD,0CAAyC,SAAS;AAClD;AACA;;AAEA,QAAO;;AAEP;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,EAAC;;;AAGD;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA,EAAC;;;AAGD;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,QAAO;;AAEP;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,QAAO;;AAEP;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;;AAEA;;AAEA;;AAEA,EAAC;;AAED;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,UAAS;;AAET;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAW;;AAEX;;AAEA,UAAS;;AAET;;AAEA;;AAEA,oDAAmD,EAAE;AACrD;;AAEA;AACA;AACA;AACA;;AAEA,YAAW;;AAEX;;AAEA,UAAS;;AAET;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAW;;AAEX;;AAEA,UAAS;;AAET;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAW;;AAEX;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;;AAEA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;;AAEX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;AAGA;;AAEA;;;AAGA,EAAC;AACD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;;AAEA,EAAC;AACD;AACA,mB;;;;;;AClvBA;AACA;AACA;AACA,6CAA4C;AAC5C,EAAC,4BAA4B;;AAE7B;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,yBAAwB,0BAA0B;;AAElD;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,iBAAgB,YAAY;;AAE5B;;AAEA;;AAEA,iBAAgB,YAAY;;AAE5B;;AAEA;;AAEA;;AAEA;;AAEA,GAAE;;AAEF;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,qBAAoB,QAAQ;;AAE5B;;AAEA;;AAEA,OAAM;;AAEN;;AAEA,OAAM;;AAEN;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,4BAA2B;AAC3B,4BAA2B;AAC3B;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA,KAAI;;AAEJ;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uCAAsC,0BAA0B;;AAEhE;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,4BAA2B;;;AAG3B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;A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;AAEA;AACA;AACA,uDAAsD;;AAEtD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA,yBAAwB,kBAAkB;;AAE1C;;AAEA,GAAE;;AAEF;AACA;AACA;;AAEA;;AAEA;;AAEA,2BAA0B;AAC1B;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;;AAEA;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;;AAEA;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,OAAM;;AAEN;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,4BAA2B;AAC3B,4BAA2B;AAC3B,4BAA2B;AAC3B;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA,KAAI;;AAEJ;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA,oEAAmE;;AAEnE;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AA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wF,yGAAyG,0CAA0C,qnBAAqnB,yDAAyD,6IAA6I;;AAEvpE,wEAAuE,8CAA8C,gYAAgY,iTAAiT,+QAA+Q,gEAAgE;;AAErnC,2CAA0C,uBAAuB,sIAAsI,sGAAsG,sCAAsC;;AAEnV,0CAAyC,kJAAkJ,iDAAiD,kKAAkK;;AAE9Y,0CAAyC,wBAAwB,+QAA+Q,4EAA4E,iDAAiD,0KAA0K,yDAAyD,6IAA6I;;AAE7zB,wCAAuC,sBAAsB,8KAA8K,wKAAwK,mCAAmC,gJAAgJ;;AAEtkB,2CAA0C,yKAAyK,+EAA+E,GAAG;;AAErS,oEAAmE,wHAAwH;;AAE3L;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAE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AAEA,IAAG;;AAEH;;AAEA;;AAEA,mBAAkB,OAAO;;AAEzB;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA,+CAA8C;;AAE9C;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,oBA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A;;AAEA;AACA;;AAEA,KAAI;;AAEJ;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,KAAI;;AAEJ;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,MAAK;;AAEL;AACA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;AACA;;AAEA,MAAK;;AAEL;AACA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;AACA;;AAEA,MAA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AEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,GAAE;;AAEF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,GAAE;;AAEF;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,GAAE;;AAEF;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,MAAK;;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CA;;AAEA,qBAAoB;;AAEpB;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;;AAEA,KAAI;;AAEJ,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;A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;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,qBAAoB;AACpB;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,oBAAmB,8BAA8B;;AAEjD;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AAC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A;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,gBAAe,qBAAqB;;AAEpC;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,gBAAe,qBAAqB;;AAEpC;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,gBAAe,sBAAsB;;AAErC,iBAAgB,qBAAqB;;AAErC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,gBAAe,sBAAsB;;AAErC,iBAAgB,qBAAqB;;AAErC;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,eAAc,sBAAsB;;AAEpC;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,gBAAe,qBAAqB;;AAEpC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,eAAc,sBAAsB;;AAEpC,gBAAe,qBAAqB;;AAEpC;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAmC;AACnC,oCAAmC;AACnC,oCAAmC;;AAEnC;AACA,oCAAmC;AACnC,oCAAmC;AACnC,oCAAmC;;AAEnC;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,eAAc,qBAAqB;;AAEnC,gBAAe,sBAAsB;;AAErC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,eAAc,qBAAqB;;AAEnC,gBAAe,sBAAsB;;AAErC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,+BAA8B,OAAO;;AAErC;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAiB;AACjB,kBAAiB;AACjB,kBAAiB;;AAEjB,iBAAgB,OAAO;;AAEvB;AACA;;AAEA;AACA;AACA;;AAEA,oBAAmB;AACnB,oBAAmB;AACnB,oBAAmB;;AAEnB;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,kBAAiB,OAAO;;AAExB,MAAK;;AAEL,kBAAiB,OAAO;;AAExB;;AAEA;;AAEA;;AAEA,wBAAuB;;AAEvB,sBAAqB,QAAQ;;AAE7B;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,YAAW,yBAAyB;AACpC,gBAAe,uBAAuB;AACtC,gBAAe,uBAAuB;;AAEtC;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;;AAEA;;AAEA,8BAA6B,QAAQ;;AAErC;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,OAAM;;AAEN;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA,OAAM;;AAEN;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,OAAM;;AAEN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAe;AACf,+CAA8C;;AAE9C,MAAK;;AAEL;AACA;AACA;;AAEA;AACA,4DAA2D;AAC3D,4DAA2D;AAC3D;AACA;;AAEA;AACA,sDAAqD;AACrD,4BAA2B;;AAE3B;AACA;AACA;;AAEA,wFAAuF;AACvF;;AAEA;AACA;AACA;;AAEA,wFAAuF;AACvF;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,4BAA2B;AAC3B,4BAA2B;;AAE3B,QAAO;;AAEP,4BAA2B;AAC3B,4BAA2B;;AAE3B;AACA;;AAEA,4BAA2B;AAC3B,4BAA2B;;AAE3B,QAAO;;AAEP,4BAA2B;AAC3B,4BAA2B;;AAE3B;;AAEA,OAAM;;AAEN;AACA;;AAEA,4BAA2B;AAC3B,4BAA2B;;AAE3B,QAAO;;AAEP,4BAA2B;AAC3B,4BAA2B;;AAE3B;AACA;;AAEA,4BAA2B;AAC3B,4BAA2B;;AAE3B,QAAO;;AAEP,4BAA2B;AAC3B,4BAA2B;;AAE3B;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,OAAM;;AAEN;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAiC,aAAa;AAC9C;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA,OAAM;;AAEN;AACA;;AAEA;;AAEA,MAAK;;AAEL;AACA;AACA;;AAEA;;AAEA;;;AAGA;;AAEA,kCAAiC;AACjC;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,qBAAoB,qBAAqB;;AAEzC,0BAAyB;AACzB;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,sBAAqB,2BAA2B;;AAEhD;AACA,sBAAqB,uBAAuB;;AAE5C,2BAA0B;AAC1B;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,wCAAuC,QAAQ;;AAE/C;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,uCAAsC,2BAA2B;;AAEjE;AACA;;AAEA;AACA,uBAAsB,uBAAuB;;AAE7C;;AAEA;AACA;AACA;;AAEA;AACA,yBAAwB,kBAAkB;;AAE1C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA,oCAAmC;;AAEnC,oCAAmC;;AAEnC;AACA,mCAAkC;;AAElC;;AAEA;;AAEA,kBAAiB;;AAEjB;;;AAGA;AACA;AACA;;AAEA;;AAEA;;AAEA,uCAAsC,QAAQ;;AAE9C;;AAEA;;AAEA;;AAEA;;AAEA,uCAAsC,QAAQ;;AAE9C;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,uEAAsE;AACtE;;AAEA;;AAEA,uCAAsC,QAAQ;;AAE9C;;AAEA,iBAAgB,OAAO;;AAEvB;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,mBAAkB,QAAQ;;AAE1B;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,0FAAyF;AACzF,4FAA2F;AAC3F;;AAEA,uFAAsF;;AAEtF;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,yBAAwB;;AAExB;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,oBAAmB;AACnB;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,mCAAkC,QAAQ;;AAE1C;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,oBAAmB;;AAEnB;;;AAGA;;AAEA;;AAEA,0BAAyB;;AAEzB,kCAAiC,QAAQ;;AAEzC;;AAEA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;AAGA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA2C;;AAE3C;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA,8BAA6B;AAC7B;;AAEA;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA,OAAM;;AAEN;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,MAAK;;AAEL;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;;AAGA;;AAEA,+DAA8D,QAAQ;;AAEtE;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,kCAAiC,QAAQ;;AAEzC;;AAEA;;AAEA,0DAAyD,QAAQ;;AAEjE;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;AAGA;;AAEA,eAAc,mBAAmB;;AAEjC,8BAA6B,OAAO;;AAEpC;AACA;AACA;;AAEA;;AAEA,qCAAoC,QAAQ;;AAE5C;;AAEA;;AAEA;;AAEA;;AAEA,mCAAkC,QAAQ;;AAE1C;AACA;;AAEA,oCAAmC,QAAQ;;AAE3C;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,eAAc,UAAU;;AAExB;;AAEA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,eAAc,YAAY;;AAE1B,gBAAe,UAAU;;AAEzB;;AAEA;;AAEA;;AAEA,MAAK;;AAEL;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;AAGA;;AAEA,iBAAgB,oBAAoB;AACpC,+BAA8B,QAAQ;;AAEtC;AACA;AACA;;AAEA;;AAEA,qCAAoC,QAAQ;;AAE5C;AACA;;AAEA;;AAEA;;AAEA,mCAAkC,QAAQ;;AAE1C;AACA;;AAEA,oCAAmC,QAAQ;;AAE3C;;AAEA;;AAEA;;AAEA,OAAM;;AAEN;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA,mBAAkB;AAClB;;AAEA;;AAEA,iBAAgB,UAAU;;AAE1B;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,iBAAgB,UAAU;;AAE1B;AACA;;AAEA;;AAEA,KAAI;;AAEJ;;AAEA,iBAAgB,UAAU;;AAE1B;AACA;;AAEA;;AAEA;;AAEA,iBAAgB,UAAU;;AAE1B;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,mCAAkC,QAAQ;;AAE1C;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA,iBAAgB,QAAQ;;AAExB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA,mBAAkB,qBAAqB;;AAEvC;;AAEA;;AAEA,oBAAmB,oBAAoB;;AAEvC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,mBAAkB,oBAAoB;;AAEtC,oBAAmB,mBAAmB;;AAEtC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,eAAc,kBAAkB;;AAEhC,gBAAe,oBAAoB;;AAEnC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,eAAc,iBAAiB;;AAE/B;;AAEA,gBAAe,mBAAmB;;AAElC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAmC;AACnC,oCAAmC;AACnC,oCAAmC;;AAEnC;AACA,oCAAmC;AACnC,oCAAmC;AACnC,oCAAmC;;AAEnC;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,eAAc,eAAe;;AAE7B;;AAEA;AACA;;AAEA,gBAAe,4BAA4B;;AAE3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAC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EA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,gBAAe,qBAAqB;;AAEpC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,gBAAe,oBAAoB;;AAEnC;AACA;;AAEA;;AAEA;AACA,qCAAoC;AACpC,yCAAwC;AACxC,qCAAoC;;AAEpC,MAAK;;AAEL;AACA,yCAAwC;AACxC,qCAAoC;AACpC,qCAAoC;;AAEpC;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mCAAkC,eAAe;;AAEjD;;AAEA;AACA;;AAEA,yBAAwB;;AAExB;AACA;;AAEA;;AAEA;;AAEA,mBAAkB,eAAe;;AAEjC;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,gBAAe;AACf;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA,0CAAyC,OAAO;;AAEhD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,oBAAmB,2BAA2B;;AAE9C;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,mBAAkB;;AAElB;;AAEA,sCAAqC;AACrC;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,mBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,mBAAkB;;AAElB;;AAEA,2BAA0B;;AAE1B;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,mBAAkB;;AAElB;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,sCAAqC;AACrC;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;A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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,yCAAwC,OAAO;;AAE/C;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,KAAI;;AAEJ,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,kBAAiB,qBAAqB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EH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,0FAAyF,4CAA4C;AACrI;;AAEA;AACA;AACA,8FAA6F,4CAA4C;AACzI;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,GAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA,GAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAA+C,cAAc;;AAE7D;AACA;AACA;AACA;AACA,GAAE;;AAEF,EAAC;;;;;;;ACxzyCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0BAAyB;AACzB,gCAA+B;;AAE/B;AACA;AACA,qCAAoC;AACpC,mCAAkC;;AAElC;AACA;AACA;AACA;;AAEA,uDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0BAAyB;;AAEzB;AACA;AACA;AACA,8BAA6B;;AAE7B;AACA;;AAEA;AACA,gBAAe;;AAEf;AACA,wBAAuB;;AAEvB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,MAAK;;AAEL;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,IAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;A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","file":"./bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 7c758f2574c190b45da9","const THREE = require('three');\nimport Framework from './framework'\nimport Parser from './house-parser'\n\nvar input = {\n layout: false,\n shapeGrammar: true\n};\n\nfunction onLoad(framework) {\n var {scene, camera, renderer, gui, stats} = framework; \n\n lightsCamera(scene, camera);\n showShapeGrammar(scene, camera);\n showLayout(scene, camera);\n\n gui.add(camera, 'fov', 0, 180).onChange(function(newVal) {\n camera.updateProjectionMatrix();\n });\n\n gui.add(input, \"shapeGrammar\").onChange(function(newVal) {\n clearScene(scene, camera);\n showShapeGrammar(scene, camera);\n showLayout(scene, camera);\n });\n\n gui.add(input, \"layout\").onChange(function(newVal) {\n clearScene(scene, camera);\n showShapeGrammar(scene, camera);\n showLayout(scene, camera);\n });\n\n}\n\nfunction clearScene(scene, camera) {\n while(scene.children.length > 0){ \n scene.remove(scene.children[0]); \n }\n\n lightsCamera(scene, camera);\n}\n\nfunction lightsCamera(scene, camera) {\n camera.position.set(1, 100, 200);\n camera.lookAt(new THREE.Vector3(0,0,0));\n\n var light = new THREE.AmbientLight( 0x404040 ); // soft white light\n scene.add( light );\n\n var directionalLight = new THREE.DirectionalLight( 0xffffff, 1.0 );\n directionalLight.position.set(75, 100, 0);\n scene.add( directionalLight );\n}\n\nfunction showShapeGrammar(scene, camera) {\n if (input.shapeGrammar && !input.layout)\n {\n camera.position.set(1, 10, 10);\n camera.lookAt(new THREE.Vector3(0,0,0));\n\n var position = new THREE.Vector3(0, 0, 0);\n var direction = new THREE.Vector3(0, 1, 0);\n var parser = new Parser(position, direction, scene, 4, 10);\n parser.render();\n }\n}\n\nfunction showLayout(scene, camera) {\n if (input.layout) {\n camera.position.set(1, 100, 200);\n camera.lookAt(new THREE.Vector3(0,0,0));\n\n var height = 100;\n var radius = 50;\n\n //speaker mid\n var spkMG = new THREE.CylinderGeometry( radius, radius, height, 32 );\n var spkMM = new THREE.MeshLambertMaterial({color: 0xa9a9a9});\n var spkM = new THREE.Mesh(spkMG, spkMM);\n scene.add(spkM);\n\n //speaker top\n var spkTG = new THREE.CylinderGeometry( 2 * radius / 3, radius, height / 4, 32 );\n var spkTM = new THREE.MeshLambertMaterial({color: 0xa9a9a9});\n var spkT = new THREE.Mesh(spkTG, spkTM);\n spkT.position.set(0, 10 * height / 16, 0);\n scene.add(spkT);\n\n //speaker base\n var spkBG = new THREE.CylinderGeometry(radius, 2 * radius / 3, height / 4, 32);\n var spkBM = new THREE.MeshLambertMaterial({color: 0xa9a9a9});\n var spkB = new THREE.Mesh(spkBG, spkBM);\n spkB.position.set(0, - 5 * height / 8, 0);\n scene.add(spkB);\n \n for (var y = - (height / 2) + 5; y < height / 2; y+= 5) \n {\n for (var x = 5 - radius; x < radius; x+= 5) \n {\n var z = Math.sqrt((radius * radius) - (x * x));\n var dir = new THREE.Vector3(-x, y, -z);\n var dirO = new THREE.Vector3(-x, y, z);\n\n var cg = new THREE.CylinderGeometry(2.5, 2.5, 2, 16);\n var m = new THREE.MeshLambertMaterial({color: 0xffff00});\n var cyl = new THREE.Mesh(cg, m);\n \n cyl.position.set(x, y, z);\n cyl.lookAt(dir);\n cyl.rotateX(Math.PI / 2);\n scene.add(cyl);\n\n var cg2 = new THREE.CylinderGeometry(2.5, 2.5, 2, 16);\n var cyl2 = new THREE.Mesh(cg2, m);\n \n cyl2.position.set(x, y, -z);\n cyl2.lookAt(dirO);\n cyl2.rotateX(Math.PI / 2);\n scene.add(cyl2);\n\n if (input.shapeGrammar) {\n var position = new THREE.Vector3(x, y, -z);\n var direction = dir.normalize();\n var parser = new Parser(position, direction, scene, 4, 2.5);\n \n var position2 = new THREE.Vector3(x, y, z);\n var direction2 = dirO.normalize();\n var parser2 = new Parser(position2, direction2, scene, 4, 2.5);\n \n parser.render();\n parser2.render();\n }\n }\n }\n }\n}\n\nfunction onUpdate(framework) {\n\n}\n\nFramework.init(onLoad, onUpdate);\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","\nconst THREE = require('three');\nconst OrbitControls = require('three-orbit-controls')(THREE)\nimport Stats from 'stats-js'\nimport DAT from 'dat-gui'\n\n// when the scene is done initializing, the function passed as `callback` will be executed\n// then, every frame, the function passed as `update` will be executed\nfunction init(callback, update) {\n var stats = new Stats();\n stats.setMode(1);\n stats.domElement.style.position = 'absolute';\n stats.domElement.style.left = '0px';\n stats.domElement.style.top = '0px';\n document.body.appendChild(stats.domElement);\n\n var gui = new DAT.GUI();\n\n var framework = {\n gui: gui,\n stats: stats\n };\n\n // run this function after the window loads\n window.addEventListener('load', function() {\n\n var scene = new THREE.Scene();\n var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );\n var renderer = new THREE.WebGLRenderer( { antialias: true } );\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.setClearColor(0xeeeeee, 1);\n\n var controls = new OrbitControls(camera, renderer.domElement);\n controls.enableDamping = true;\n controls.enableZoom = true;\n controls.target.set(0, 0, 0);\n controls.rotateSpeed = 0.3;\n controls.zoomSpeed = 1.0;\n controls.panSpeed = 2.0;\n\n document.body.appendChild(renderer.domElement);\n\n // resize the canvas when the window changes\n window.addEventListener('resize', function() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\n });\n\n // assign THREE.js objects to the object we will return\n framework.scene = scene;\n framework.camera = camera;\n framework.renderer = renderer;\n\n // begin the animation loop\n (function tick() {\n stats.begin();\n update(framework); // perform any requested updates\n renderer.render(scene, camera); // render the scene\n stats.end();\n requestAnimationFrame(tick); // register to call this again when the browser renders a new frame\n })();\n\n // we will pass the scene, gui, renderer, camera, etc... to the callback function\n return callback(framework);\n });\n}\n\nexport default {\n init: init\n}\n\nexport const PI = 3.14159265\nexport const e = 2.7181718\n\n\n// WEBPACK FOOTER //\n// ./src/framework.js","// stats.js - http://github.com/mrdoob/stats.js\nvar Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement(\"div\");f.id=\"stats\";f.addEventListener(\"mousedown\",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText=\"width:80px;opacity:0.9;cursor:pointer\";var a=document.createElement(\"div\");a.id=\"fps\";a.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#002\";f.appendChild(a);var i=document.createElement(\"div\");i.id=\"fpsText\";i.style.cssText=\"color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";\ni.innerHTML=\"FPS\";a.appendChild(i);var c=document.createElement(\"div\");c.id=\"fpsGraph\";c.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0ff\";for(a.appendChild(c);74>c.children.length;){var j=document.createElement(\"span\");j.style.cssText=\"width:1px;height:30px;float:left;background-color:#113\";c.appendChild(j)}var d=document.createElement(\"div\");d.id=\"ms\";d.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#020;display:none\";f.appendChild(d);var k=document.createElement(\"div\");\nk.id=\"msText\";k.style.cssText=\"color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";k.innerHTML=\"MS\";d.appendChild(k);var e=document.createElement(\"div\");e.id=\"msGraph\";e.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0f0\";for(d.appendChild(e);74>e.children.length;)j=document.createElement(\"span\"),j.style.cssText=\"width:1px;height:30px;float:left;background-color:#131\",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display=\n\"block\";d.style.display=\"none\";break;case 1:a.style.display=\"none\",d.style.display=\"block\"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+\" MS (\"+n+\"-\"+o+\")\";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+\"px\";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+\" FPS (\"+p+\"-\"+q+\")\",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height=\na+\"px\",m=b,r=0);return b},update:function(){l=this.end()}}};\"object\"===typeof module&&(module.exports=Stats);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/stats-js/build/stats.min.js\n// module id = 2\n// module chunks = 0","module.exports = require('./vendor/dat.gui')\nmodule.exports.color = require('./vendor/dat.color')\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dat-gui/index.js\n// module id = 3\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/** @namespace */\nvar dat = module.exports = dat || {};\n\n/** @namespace */\ndat.gui = dat.gui || {};\n\n/** @namespace */\ndat.utils = dat.utils || {};\n\n/** @namespace */\ndat.controllers = dat.controllers || {};\n\n/** @namespace */\ndat.dom = dat.dom || {};\n\n/** @namespace */\ndat.color = dat.color || {};\n\ndat.utils.css = (function () {\n return {\n load: function (url, doc) {\n doc = doc || document;\n var link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n inject: function(css, doc) {\n doc = doc || document;\n var injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = css;\n doc.getElementsByTagName('head')[0].appendChild(injected);\n }\n }\n})();\n\n\ndat.utils.common = (function () {\n \n var ARR_EACH = Array.prototype.forEach;\n var ARR_SLICE = Array.prototype.slice;\n\n /**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\n return { \n \n BREAK: {},\n \n extend: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (!this.isUndefined(obj[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n defaults: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (this.isUndefined(target[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n compose: function() {\n var toCall = ARR_SLICE.call(arguments);\n return function() {\n var args = ARR_SLICE.call(arguments);\n for (var i = toCall.length -1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n }\n },\n \n each: function(obj, itr, scope) {\n\n \n if (ARR_EACH && obj.forEach === ARR_EACH) { \n \n obj.forEach(itr, scope);\n \n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n \n for (var key = 0, l = obj.length; key < l; key++)\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) \n return;\n \n } else {\n\n for (var key in obj) \n if (itr.call(scope, obj[key], key) === this.BREAK)\n return;\n \n }\n \n },\n \n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n \n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n \n isNull: function(obj) {\n return obj === null;\n },\n \n isNaN: function(obj) {\n return obj !== obj;\n },\n \n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n \n isObject: function(obj) {\n return obj === Object(obj);\n },\n \n isNumber: function(obj) {\n return obj === obj+0;\n },\n \n isString: function(obj) {\n return obj === obj+'';\n },\n \n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n \n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n \n };\n \n})();\n\n\ndat.controllers.Controller = (function (common) {\n\n /**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var Controller = function(object, property) {\n\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n\n };\n\n common.extend(\n\n Controller.prototype,\n\n /** @lends dat.controllers.Controller.prototype */\n {\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {dat.controllers.Controller} this\n */\n onChange: function(fnc) {\n this.__onChange = fnc;\n return this;\n },\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {dat.controllers.Controller} this\n */\n onFinishChange: function(fnc) {\n this.__onFinishChange = fnc;\n return this;\n },\n\n /**\n * Change the value of object[property]\n *\n * @param {Object} newValue The new value of object[property]\n */\n setValue: function(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n this.updateDisplay();\n return this;\n },\n\n /**\n * Gets the value of object[property]\n *\n * @returns {Object} The current value of object[property]\n */\n getValue: function() {\n return this.object[this.property];\n },\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {dat.controllers.Controller} this\n */\n updateDisplay: function() {\n return this;\n },\n\n /**\n * @returns {Boolean} true if the value has deviated from initialValue\n */\n isModified: function() {\n return this.initialValue !== this.getValue()\n }\n\n }\n\n );\n\n return Controller;\n\n\n})(dat.utils.common);\n\n\ndat.dom.dom = (function (common) {\n\n var EVENT_MAP = {\n 'HTMLEvents': ['change'],\n 'MouseEvents': ['click','mousemove','mousedown','mouseup', 'mouseover'],\n 'KeyboardEvents': ['keydown']\n };\n\n var EVENT_MAP_INV = {};\n common.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n });\n\n var CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\n function cssValueToPixels(val) {\n\n if (val === '0' || common.isUndefined(val)) return 0;\n\n var match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n\n }\n\n /**\n * @namespace\n * @member dat.dom\n */\n var dom = {\n\n /**\n * \n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vertical\n */\n makeFullscreen: function(elem, horizontal, vertical) {\n\n if (common.isUndefined(horizontal)) horizontal = true;\n if (common.isUndefined(vertical)) vertical = true;\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, params, aux) {\n params = params || {};\n var className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n var evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n var clientX = params.x || params.clientX || 0;\n var clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false,\n params.cancelable || true, window, params.clickCount || 1,\n 0, //screen X\n 0, //screen Y\n clientX, //client X\n clientY, //client Y\n false, false, false, false, 0, null);\n break;\n case 'KeyboardEvents':\n var init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false,\n params.cancelable, window,\n params.ctrlKey, params.altKey,\n params.shiftKey, params.metaKey,\n params.keyCode, params.charCode);\n break;\n default:\n evt.initEvent(eventType, params.bubbles || false,\n params.cancelable || true);\n break;\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, bool) {\n bool = bool || false;\n if (elem.addEventListener)\n elem.addEventListener(event, func, bool);\n else if (elem.attachEvent)\n elem.attachEvent('on' + event, func);\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, bool) {\n bool = bool || false;\n if (elem.removeEventListener)\n elem.removeEventListener(event, func, bool);\n else if (elem.detachEvent)\n elem.detachEvent('on' + event, func);\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n var classes = elem.className.split(/ +/);\n if (classes.indexOf(className) == -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === undefined) {\n // elem.className = className;\n } else if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n var classes = elem.className.split(/ +/);\n var index = classes.indexOf(className);\n if (index != -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n\n var style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style['width']);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n\n var style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style['height']);\n },\n\n /**\n *\n * @param elem\n */\n getOffset: function(elem) {\n var offset = {left: 0, top:0};\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n } while (elem = elem.offsetParent);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n * \n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && ( elem.type || elem.href );\n }\n\n };\n\n return dom;\n\n})(dat.utils.common);\n\n\ndat.controllers.OptionController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n *\n * @member dat.controllers\n */\n var OptionController = function(object, property, options) {\n\n OptionController.superclass.call(this, object, property);\n\n var _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n var map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n\n var opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n var desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n\n };\n\n OptionController.superclass = Controller;\n\n common.extend(\n\n OptionController.prototype,\n Controller.prototype,\n\n {\n\n setValue: function(v) {\n var toReturn = OptionController.superclass.prototype.setValue.call(this, v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n },\n\n updateDisplay: function() {\n this.__select.value = this.getValue();\n return OptionController.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n );\n\n return OptionController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.controllers.NumberController = (function (Controller, common) {\n\n /**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n *\n * @member dat.controllers\n */\n var NumberController = function(object, property, params) {\n\n NumberController.superclass.call(this, object, property);\n\n params = params || {};\n\n this.__min = params.min;\n this.__max = params.max;\n this.__step = params.step;\n\n if (common.isUndefined(this.__step)) {\n\n if (this.initialValue == 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue)/Math.LN10))/10;\n }\n\n } else {\n\n this.__impliedStep = this.__step;\n\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n\n\n };\n\n NumberController.superclass = Controller;\n\n common.extend(\n\n NumberController.prototype,\n Controller.prototype,\n\n /** @lends dat.controllers.NumberController.prototype */\n {\n\n setValue: function(v) {\n\n if (this.__min !== undefined && v < this.__min) {\n v = this.__min;\n } else if (this.__max !== undefined && v > this.__max) {\n v = this.__max;\n }\n\n if (this.__step !== undefined && v % this.__step != 0) {\n v = Math.round(v / this.__step) * this.__step;\n }\n\n return NumberController.superclass.prototype.setValue.call(this, v);\n\n },\n\n /**\n * Specify a minimum value for object[property].\n *\n * @param {Number} minValue The minimum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n min: function(v) {\n this.__min = v;\n return this;\n },\n\n /**\n * Specify a maximum value for object[property].\n *\n * @param {Number} maxValue The maximum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n max: function(v) {\n this.__max = v;\n return this;\n },\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step: function(v) {\n this.__step = v;\n return this;\n }\n\n }\n\n );\n\n function numDecimals(x) {\n x = x.toString();\n if (x.indexOf('.') > -1) {\n return x.length - x.indexOf('.') - 1;\n } else {\n return 0;\n }\n }\n\n return NumberController;\n\n})(dat.controllers.Controller,\ndat.utils.common);\n\n\ndat.controllers.NumberControllerBox = (function (NumberController, dom, common) {\n\n /**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n *\n * @member dat.controllers\n */\n var NumberControllerBox = function(object, property, params) {\n\n this.__truncationSuspended = false;\n\n NumberControllerBox.superclass.call(this, object, property, params);\n\n var _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n var prev_y;\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, 'keydown', function(e) {\n\n // When pressing entire, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n }\n\n });\n\n function onChange() {\n var attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) _this.setValue(attempted);\n }\n\n function onBlur() {\n onChange();\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prev_y = e.clientY;\n }\n\n function onMouseDrag(e) {\n\n var diff = prev_y - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prev_y = e.clientY;\n\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n }\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n\n };\n\n NumberControllerBox.superclass = NumberController;\n\n common.extend(\n\n NumberControllerBox.prototype,\n NumberController.prototype,\n\n {\n\n updateDisplay: function() {\n\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return NumberControllerBox.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n );\n\n function roundToDecimal(value, decimals) {\n var tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n }\n\n return NumberControllerBox;\n\n})(dat.controllers.NumberController,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.controllers.NumberControllerSlider = (function (NumberController, dom, css, common, styleSheet) {\n\n /**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <div> tags, not the html5\n * <slider> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n * \n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n *\n * @member dat.controllers\n */\n var NumberControllerSlider = function(object, property, min, max, step) {\n\n NumberControllerSlider.superclass.call(this, object, property, { min: min, max: max, step: step });\n\n var _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n \n\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n \n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseDown(e) {\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n\n e.preventDefault();\n\n var offset = dom.getOffset(_this.__background);\n var width = dom.getWidth(_this.__background);\n \n _this.setValue(\n map(e.clientX, offset.left, offset.left + width, _this.__min, _this.__max)\n );\n\n return false;\n\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n\n };\n\n NumberControllerSlider.superclass = NumberController;\n\n /**\n * Injects default stylesheet for slider elements.\n */\n NumberControllerSlider.useDefaultStyles = function() {\n css.inject(styleSheet);\n };\n\n common.extend(\n\n NumberControllerSlider.prototype,\n NumberController.prototype,\n\n {\n\n updateDisplay: function() {\n var pct = (this.getValue() - this.__min)/(this.__max - this.__min);\n this.__foreground.style.width = pct*100+'%';\n return NumberControllerSlider.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n\n\n );\n\n function map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n }\n\n return NumberControllerSlider;\n \n})(dat.controllers.NumberController,\ndat.dom.dom,\ndat.utils.css,\ndat.utils.common,\n\".slider {\\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\\n height: 1em;\\n border-radius: 1em;\\n background-color: #eee;\\n padding: 0 0.5em;\\n overflow: hidden;\\n}\\n\\n.slider-fg {\\n padding: 1px 0 2px 0;\\n background-color: #aaa;\\n height: 1em;\\n margin-left: -0.5em;\\n padding-right: 0.5em;\\n border-radius: 1em 0 0 1em;\\n}\\n\\n.slider-fg:after {\\n display: inline-block;\\n border-radius: 1em;\\n background-color: #fff;\\n border: 1px solid #aaa;\\n content: '';\\n float: right;\\n margin-right: -1em;\\n margin-top: -1px;\\n height: 0.9em;\\n width: 0.9em;\\n}\");\n\n\ndat.controllers.FunctionController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var FunctionController = function(object, property, text) {\n\n FunctionController.superclass.call(this, object, property);\n\n var _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n\n\n };\n\n FunctionController.superclass = Controller;\n\n common.extend(\n\n FunctionController.prototype,\n Controller.prototype,\n {\n \n fire: function() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.getValue().call(this.object);\n }\n }\n\n );\n\n return FunctionController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.controllers.BooleanController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a checkbox input to alter the boolean property of an object.\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var BooleanController = function(object, property) {\n\n BooleanController.superclass.call(this, object, property);\n\n var _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n };\n\n BooleanController.superclass = Controller;\n\n common.extend(\n\n BooleanController.prototype,\n Controller.prototype,\n\n {\n\n setValue: function(v) {\n var toReturn = BooleanController.superclass.prototype.setValue.call(this, v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n },\n\n updateDisplay: function() {\n \n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true; \n } else {\n this.__checkbox.checked = false;\n }\n\n return BooleanController.superclass.prototype.updateDisplay.call(this);\n\n }\n\n\n }\n\n );\n\n return BooleanController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common);\n\n\ndat.color.toString = (function (common) {\n\n return function(color) {\n\n if (color.a == 1 || common.isUndefined(color.a)) {\n\n var s = color.hex.toString(16);\n while (s.length < 6) {\n s = '0' + s;\n }\n\n return '#' + s;\n\n } else {\n\n return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')';\n\n }\n\n }\n\n})(dat.utils.common);\n\n\ndat.color.interpret = (function (toString, common) {\n\n var result, toReturn;\n\n var interpret = function() {\n\n toReturn = false;\n\n var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n\n common.each(INTERPRETATIONS, function(family) {\n\n if (family.litmus(original)) {\n\n common.each(family.conversions, function(conversion, conversionName) {\n\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n\n }\n\n });\n\n return common.BREAK;\n\n }\n\n });\n\n return toReturn;\n\n };\n\n var INTERPRETATIONS = [\n\n // Strings\n {\n\n litmus: common.isString,\n\n conversions: {\n\n THREE_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString())\n };\n\n },\n\n write: toString\n\n },\n\n SIX_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString())\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGB: {\n\n read: function(original) {\n\n var test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGBA: {\n\n read: function(original) {\n\n var test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n\n },\n\n write: toString\n\n }\n\n }\n\n },\n\n // Numbers\n {\n\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n }\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n\n litmus: common.isArray,\n\n conversions: {\n\n RGB_ARRAY: {\n read: function(original) {\n if (original.length != 3) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length != 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n\n }\n\n }\n\n },\n\n // Objects\n {\n\n litmus: common.isObject,\n\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n }\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n }\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n }\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n }\n }\n\n }\n\n }\n\n }\n\n\n ];\n\n return interpret;\n\n\n})(dat.color.toString,\ndat.utils.common);\n\n\ndat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, controllerFactory, Controller, BooleanController, FunctionController, NumberControllerBox, NumberControllerSlider, OptionController, ColorController, requestAnimationFrame, CenteredDiv, dom, common) {\n\n css.inject(styleSheet);\n\n /** Outer-most className for GUI's */\n var CSS_NAMESPACE = 'dg';\n\n var HIDE_KEY_CODE = 72;\n\n /** The only value shared between the JS and SCSS. Use caution. */\n var CLOSE_BUTTON_HEIGHT = 20;\n\n var DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\n var SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return 'localStorage' in window && window['localStorage'] !== null;\n } catch (e) {\n return false;\n }\n })();\n\n var SAVE_DIALOGUE;\n\n /** Have we yet to create an autoPlace GUI? */\n var auto_place_virgin = true;\n\n /** Fixed position div that auto place GUI's go inside */\n var auto_place_container;\n\n /** Are we hiding the GUI's ? */\n var hide = false;\n\n /** GUI's which should be hidden */\n var hideable_guis = [];\n\n /**\n * A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n * @class\n *\n * @member dat.gui\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {Boolean} [params.auto=true]\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.closed] If true, starts closed\n */\n var GUI = function(params) {\n\n var _this = this;\n\n /**\n * Outermost DOM Element\n * @type DOMElement\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n params = params || {};\n\n // Default parameters\n params = common.defaults(params, {\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n\n if (!common.isUndefined(params.load)) {\n\n // Explicit preset\n if (params.preset) params.load.preset = params.preset;\n\n } else {\n\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideable_guis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n var use_local_storage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n Object.defineProperties(this,\n\n /** @lends dat.gui.GUI.prototype */\n {\n\n /**\n * The parent GUI\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles GUI's element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n } else {\n return params.load.preset;\n }\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n\n },\n\n /**\n * The width of GUI element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of GUI. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (title_row_name) {\n title_row_name.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the GUI is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use localStorage as the means for\n * remembering\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return use_local_storage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n use_local_storage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n\n }\n\n });\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n\n params.closed = false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n\n if (use_local_storage) {\n\n _this.useLocalStorage = true;\n\n var saved_gui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (saved_gui) {\n params.load = JSON.parse(saved_gui);\n }\n\n }\n\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n this.domElement.appendChild(this.__closeButton);\n\n dom.bind(this.__closeButton, 'click', function() {\n\n _this.closed = !_this.closed;\n\n\n });\n\n\n // Oh, you're a nested GUI!\n } else {\n\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n var title_row_name = document.createTextNode(params.name);\n dom.addClass(title_row_name, 'controller-name');\n\n var title_row = addRow(_this, title_row_name);\n\n var on_click_title = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(title_row, 'title');\n dom.bind(title_row, 'click', on_click_title);\n\n if (!params.closed) {\n this.closed = false;\n }\n\n }\n\n if (params.autoPlace) {\n\n if (common.isUndefined(params.parent)) {\n\n if (auto_place_virgin) {\n auto_place_container = document.createElement('div');\n dom.addClass(auto_place_container, CSS_NAMESPACE);\n dom.addClass(auto_place_container, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(auto_place_container);\n auto_place_virgin = false;\n }\n\n // Put it in the dom for you.\n auto_place_container.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n\n }\n\n\n // Make it not elastic.\n if (!this.parent) setWidth(_this, params.width);\n\n }\n\n dom.bind(window, 'resize', function() { _this.onResize() });\n dom.bind(this.__ul, 'webkitTransitionEnd', function() { _this.onResize(); });\n dom.bind(this.__ul, 'transitionend', function() { _this.onResize() });\n dom.bind(this.__ul, 'oTransitionEnd', function() { _this.onResize() });\n this.onResize();\n\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n function saveToLocalStorage() {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n\n var root = _this.getRoot();\n function resetWidth() {\n var root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n\n };\n\n GUI.toggleHide = function() {\n\n hide = !hide;\n common.each(hideable_guis, function(gui) {\n gui.domElement.style.zIndex = hide ? -999 : 999;\n gui.domElement.style.opacity = hide ? 0 : 1;\n });\n };\n\n GUI.CLASS_AUTO_PLACE = 'a';\n GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\n GUI.CLASS_MAIN = 'main';\n GUI.CLASS_CONTROLLER_ROW = 'cr';\n GUI.CLASS_TOO_TALL = 'taller-than-window';\n GUI.CLASS_CLOSED = 'closed';\n GUI.CLASS_CLOSE_BUTTON = 'close-button';\n GUI.CLASS_DRAG = 'drag';\n\n GUI.DEFAULT_WIDTH = 245;\n GUI.TEXT_CLOSED = 'Close Controls';\n GUI.TEXT_OPEN = 'Open Controls';\n\n dom.bind(window, 'keydown', function(e) {\n\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode == HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n\n }, false);\n\n common.extend(\n\n GUI.prototype,\n\n /** @lends dat.gui.GUI */\n {\n\n /**\n * @param object\n * @param property\n * @returns {dat.controllers.Controller} The new controller that was added.\n * @instance\n */\n add: function(object, property) {\n\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n\n },\n\n /**\n * @param object\n * @param property\n * @returns {dat.controllers.ColorController} The new controller that was added.\n * @instance\n */\n addColor: function(object, property) {\n\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n\n },\n\n /**\n * @param controller\n * @instance\n */\n remove: function(controller) {\n\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.slice(this.__controllers.indexOf(controller), 1);\n var _this = this;\n common.defer(function() {\n _this.onResize();\n });\n\n },\n\n destroy: function() {\n\n if (this.autoPlace) {\n auto_place_container.removeChild(this.domElement);\n }\n\n },\n\n /**\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n var new_gui_params = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n new_gui_params.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n\n // Start me closed if I was closed\n new_gui_params.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n new_gui_params.load = this.load.folders[name];\n\n }\n\n var gui = new GUI(new_gui_params);\n this.__folders[name] = gui;\n\n var li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n\n },\n\n open: function() {\n this.closed = false;\n },\n\n close: function() {\n this.closed = true;\n },\n\n onResize: function() {\n\n var root = this.getRoot();\n\n if (root.scrollable) {\n\n var top = dom.getOffset(root.__ul).top;\n var h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (! (root.autoPlace && node === root.__save_row))\n h += dom.getHeight(node);\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n\n },\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {Object...} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n */\n remember: function() {\n\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error(\"You can only call remember on a top level GUI.\");\n }\n\n var _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length == 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) == -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n var gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n\n var toReturn = this.load;\n\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n\n },\n\n save: function() {\n\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n\n },\n\n saveAs: function(presetName) {\n\n if (!this.load.remembered) {\n\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n\n },\n\n revert: function(gui) {\n\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n\n\n },\n\n listen: function(controller) {\n\n var init = this.__listening.length == 0;\n this.__listening.push(controller);\n if (init) updateDisplays(this.__listening);\n\n }\n\n }\n\n );\n\n function add(gui, object, property, params) {\n\n if (object[property] === undefined) {\n throw new Error(\"Object \" + object + \" has no property \\\"\" + property + \"\\\"\");\n }\n\n var controller;\n\n if (params.color) {\n\n controller = new ColorController(object, property);\n\n } else {\n\n var factoryArgs = [object,property].concat(params.factoryArgs);\n controller = controllerFactory.apply(gui, factoryArgs);\n\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n var name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n var container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n var li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n dom.addClass(li, typeof controller.getValue());\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n\n }\n\n /**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [dom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n */\n function addRow(gui, dom, liBefore) {\n var li = document.createElement('li');\n if (dom) li.appendChild(dom);\n if (liBefore) {\n gui.__ul.insertBefore(li, params.before);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n }\n\n function augmentController(gui, li, controller) {\n\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, {\n\n options: function(options) {\n\n if (arguments.length > 1) {\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [options]\n }\n );\n\n }\n\n },\n\n name: function(v) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = v;\n return controller;\n },\n\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n\n var box = new NumberControllerBox(controller.object, controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step });\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange'], function(method) {\n var pc = controller[method];\n var pb = box[method];\n controller[method] = box[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n pc.apply(controller, args);\n return pb.apply(box, args);\n }\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n\n }\n else if (controller instanceof NumberControllerBox) {\n\n var r = function(returned) {\n\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n\n // Well, then lets just replace this with a slider.\n controller.remove();\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n\n }\n\n return returned;\n\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n\n }\n else if (controller instanceof BooleanController) {\n\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n })\n\n }\n else if (controller instanceof FunctionController) {\n\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n\n }\n else if (controller instanceof ColorController) {\n\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(r) {\n li.style.borderLeftColor = controller.__color.toString();\n return r;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n\n }\n\n controller.setValue = common.compose(function(r) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n return r;\n }, controller.setValue);\n\n }\n\n function recallSavedValue(gui, controller) {\n\n // Find the topmost GUI, that's where remembered objects live.\n var root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n var matched_index = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matched_index != -1) {\n\n // Let me fetch a map of controllers for thcommon.isObject.\n var controller_map =\n root.__rememberedObjectIndecesToControllers[matched_index];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controller_map === undefined) {\n controller_map = {};\n root.__rememberedObjectIndecesToControllers[matched_index] =\n controller_map;\n }\n\n // Keep track of this controller\n controller_map[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n\n var preset_map = root.load.remembered;\n\n // Which preset are we trying to load?\n var preset;\n\n if (preset_map[gui.preset]) {\n\n preset = preset_map[gui.preset];\n\n } else if (preset_map[DEFAULT_DEFAULT_PRESET_NAME]) {\n\n // Uhh, you can have the default instead?\n preset = preset_map[DEFAULT_DEFAULT_PRESET_NAME];\n\n } else {\n\n // Nada.\n\n return;\n\n }\n\n\n // Did the loaded object remember thcommon.isObject?\n if (preset[matched_index] &&\n\n // Did we remember this particular property?\n preset[matched_index][controller.property] !== undefined) {\n\n // We did remember something for this guy ...\n var value = preset[matched_index][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n\n }\n\n }\n\n }\n\n }\n\n function getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n\n }\n\n function addSaveMenu(gui) {\n\n var div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n var gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n var button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n var button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n var button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n var select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key == gui.preset);\n });\n\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n\n\n for (var index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n\n var saveLocally = document.getElementById('dg-save-locally');\n var explain = document.getElementById('dg-local-explain');\n\n saveLocally.style.display = 'block';\n\n var localStorageCheckBox = document.getElementById('dg-local-storage');\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n function showHideExplain() {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n }\n\n showHideExplain();\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain();\n });\n\n }\n\n var newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode == 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n var presetName = prompt('Enter a new preset name.');\n if (presetName) gui.saveAs(presetName);\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n// div.appendChild(button2);\n\n }\n\n function addResizeHandle(gui) {\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n// border: '1px solid blue'\n\n });\n\n var pmouseX;\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n\n function dragStart(e) {\n\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n\n }\n\n function drag(e) {\n\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n\n }\n\n function dragStop() {\n\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n\n }\n\n }\n\n function setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n }\n\n function getCurrentPreset(gui, useInitialValues) {\n\n var toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n\n var saved_values = {};\n\n // The controllers I've made for thcommon.isObject by property\n var controller_map =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controller_map, function(controller, property) {\n saved_values[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = saved_values;\n\n });\n\n return toReturn;\n\n }\n\n function addPresetOption(gui, name, setSelected) {\n var opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n }\n\n function setPresetSelectIndex(gui) {\n for (var index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value == gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n }\n\n function markPresetModified(gui, modified) {\n var opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n// console.log('mark', modified, opt);\n if (modified) {\n opt.innerHTML = opt.value + \"*\";\n } else {\n opt.innerHTML = opt.value;\n }\n }\n\n function updateDisplays(controllerArray) {\n\n\n if (controllerArray.length != 0) {\n\n requestAnimationFrame(function() {\n updateDisplays(controllerArray);\n });\n\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n\n }\n\n return GUI;\n\n})(dat.utils.css,\n\"
\\n\\n Here's the new load parameter for your GUI's constructor:\\n\\n \\n\\n
\\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
The values saved to localStorage will\\n override those passed to dat.GUI's constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n \\n
\\n \\n
\\n\\n
\",\n\".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\\n\",\ndat.controllers.factory = (function (OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, common) {\n\n return function(object, property) {\n\n var initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n\n if (common.isNumber(initialValue)) {\n\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n\n // Has min and max.\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n\n } else {\n\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n\n }\n\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n }\n\n })(dat.controllers.OptionController,\ndat.controllers.NumberControllerBox,\ndat.controllers.NumberControllerSlider,\ndat.controllers.StringController = (function (Controller, dom, common) {\n\n /**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\n var StringController = function(object, property) {\n\n StringController.superclass.call(this, object, property);\n\n var _this = this;\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n \n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n\n };\n\n StringController.superclass = Controller;\n\n common.extend(\n\n StringController.prototype,\n Controller.prototype,\n\n {\n\n updateDisplay: function() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return StringController.superclass.prototype.updateDisplay.call(this);\n }\n\n }\n\n );\n\n return StringController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.utils.common),\ndat.controllers.FunctionController,\ndat.controllers.BooleanController,\ndat.utils.common),\ndat.controllers.Controller,\ndat.controllers.BooleanController,\ndat.controllers.FunctionController,\ndat.controllers.NumberControllerBox,\ndat.controllers.NumberControllerSlider,\ndat.controllers.OptionController,\ndat.controllers.ColorController = (function (Controller, dom, Color, interpret, common) {\n\n var ColorController = function(object, property) {\n\n ColorController.superclass.call(this, object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n var _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(e) {\n\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(e) {\n dom.removeClass(_this.__selector, 'drag');\n });\n\n });\n\n var value_field = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < .5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n \n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(value_field.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n \n linearGradient(value_field, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n display: 'inline-block',\n border: '1px solid #555',\n cursor: 'ns-resize'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n// width: '120px',\n textAlign: 'center',\n// padding: '4px',\n// marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', function(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'mouseup', unbindH);\n });\n\n function fieldDown(e) {\n setSV(e);\n // document.body.style.cursor = 'none';\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'mouseup', unbindSV);\n }\n\n function unbindSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'mouseup', unbindSV);\n // document.body.style.cursor = 'default';\n }\n\n function onBlur() {\n var i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function unbindH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'mouseup', unbindH);\n }\n\n this.__saturation_field.appendChild(value_field);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n\n e.preventDefault();\n\n var w = dom.getWidth(_this.__saturation_field);\n var o = dom.getOffset(_this.__saturation_field);\n var s = (e.clientX - o.left + document.body.scrollLeft) / w;\n var v = 1 - (e.clientY - o.top + document.body.scrollTop) / w;\n\n if (v > 1) v = 1;\n else if (v < 0) v = 0;\n\n if (s > 1) s = 1;\n else if (s < 0) s = 0;\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n\n return false;\n\n }\n\n function setH(e) {\n\n e.preventDefault();\n\n var s = dom.getHeight(_this.__hue_field);\n var o = dom.getOffset(_this.__hue_field);\n var h = 1 - (e.clientY - o.top + document.body.scrollTop) / s;\n\n if (h > 1) h = 1;\n else if (h < 0) h = 0;\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n\n }\n\n };\n\n ColorController.superclass = Controller;\n\n common.extend(\n\n ColorController.prototype,\n Controller.prototype,\n\n {\n\n updateDisplay: function() {\n\n var i = interpret(this.getValue());\n\n if (i !== false) {\n\n var mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) &&\n !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n var flip = (this.__color.v < .5 || this.__color.s > .5) ? 255 : 0;\n var _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip +')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px'\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toString());\n\n common.extend(this.__input.style, {\n backgroundColor: this.__input.value = this.__color.toString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip +')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip +',.7)'\n });\n\n }\n\n }\n\n );\n \n var vendors = ['-moz-','-o-','-webkit-','-ms-',''];\n \n function linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient('+x+', '+a+' 0%, ' + b + ' 100%); ';\n });\n }\n \n function hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'\n }\n\n\n return ColorController;\n\n})(dat.controllers.Controller,\ndat.dom.dom,\ndat.color.Color = (function (interpret, math, toString, common) {\n\n var Color = function() {\n\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw 'Failed to interpret color arguments';\n }\n\n this.__state.a = this.__state.a || 1;\n\n\n };\n\n Color.COMPONENTS = ['r','g','b','h','s','v','hex','a'];\n\n common.extend(Color.prototype, {\n\n toString: function() {\n return toString(this);\n },\n\n toOriginal: function() {\n return this.__state.conversion.write(this);\n }\n\n });\n\n defineRGBComponent(Color.prototype, 'r', 2);\n defineRGBComponent(Color.prototype, 'g', 1);\n defineRGBComponent(Color.prototype, 'b', 0);\n\n defineHSVComponent(Color.prototype, 'h');\n defineHSVComponent(Color.prototype, 's');\n defineHSVComponent(Color.prototype, 'v');\n\n Object.defineProperty(Color.prototype, 'a', {\n\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n\n });\n\n Object.defineProperty(Color.prototype, 'hex', {\n\n get: function() {\n\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n\n },\n\n set: function(v) {\n\n this.__state.space = 'HEX';\n this.__state.hex = v;\n\n }\n\n });\n\n function defineRGBComponent(target, component, componentHexIndex) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'RGB') {\n recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function defineHSVComponent(target, component) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'HSV')\n return this.__state[component];\n\n recalculateHSV(this);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'HSV') {\n recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function recalculateRGB(color, component, componentHexIndex) {\n\n if (color.__state.space === 'HEX') {\n\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n\n } else if (color.__state.space === 'HSV') {\n\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n\n } else {\n\n throw 'Corrupted color state';\n\n }\n\n }\n\n function recalculateHSV(color) {\n\n var result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n\n }\n\n return Color;\n\n})(dat.color.interpret,\ndat.color.math = (function () {\n\n var tmpComponent;\n\n return {\n\n hsv_to_rgb: function(h, s, v) {\n\n var hi = Math.floor(h / 60) % 6;\n\n var f = h / 60 - Math.floor(h / 60);\n var p = v * (1.0 - s);\n var q = v * (1.0 - (f * s));\n var t = v * (1.0 - ((1.0 - f) * s));\n var c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n\n },\n\n rgb_to_hsv: function(r, g, b) {\n\n var min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s;\n\n if (max != 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r == max) {\n h = (g - b) / delta;\n } else if (g == max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n var hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent));\n }\n\n }\n\n})(),\ndat.color.toString,\ndat.utils.common),\ndat.color.interpret,\ndat.utils.common),\ndat.utils.requestAnimationFrame = (function () {\n\n /**\n * requirejs version of Paul Irish's RequestAnimationFrame\n * http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n */\n\n return window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(callback, element) {\n\n window.setTimeout(callback, 1000 / 60);\n\n };\n})(),\ndat.dom.CenteredDiv = (function (dom, common) {\n\n\n var CenteredDiv = function() {\n\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n var _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n\n\n };\n\n CenteredDiv.prototype.show = function() {\n\n var _this = this;\n \n\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n// this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n\n };\n\n CenteredDiv.prototype.hide = function() {\n\n var _this = this;\n\n var hide = function() {\n\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n// this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n };\n\n CenteredDiv.prototype.layout = function() {\n this.domElement.style.left = window.innerWidth/2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight/2 - dom.getHeight(this.domElement) / 2 + 'px';\n };\n \n function lockScroll(e) {\n console.log(e);\n }\n\n return CenteredDiv;\n\n})(dat.dom.dom,\ndat.utils.common),\ndat.dom.dom,\ndat.utils.common);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dat-gui/vendor/dat.gui.js\n// module id = 4\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/** @namespace */\nvar dat = module.exports = dat || {};\n\n/** @namespace */\ndat.color = dat.color || {};\n\n/** @namespace */\ndat.utils = dat.utils || {};\n\ndat.utils.common = (function () {\n \n var ARR_EACH = Array.prototype.forEach;\n var ARR_SLICE = Array.prototype.slice;\n\n /**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\n return { \n \n BREAK: {},\n \n extend: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (!this.isUndefined(obj[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n defaults: function(target) {\n \n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n \n for (var key in obj)\n if (this.isUndefined(target[key])) \n target[key] = obj[key];\n \n }, this);\n \n return target;\n \n },\n \n compose: function() {\n var toCall = ARR_SLICE.call(arguments);\n return function() {\n var args = ARR_SLICE.call(arguments);\n for (var i = toCall.length -1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n }\n },\n \n each: function(obj, itr, scope) {\n\n \n if (ARR_EACH && obj.forEach === ARR_EACH) { \n \n obj.forEach(itr, scope);\n \n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n \n for (var key = 0, l = obj.length; key < l; key++)\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) \n return;\n \n } else {\n\n for (var key in obj) \n if (itr.call(scope, obj[key], key) === this.BREAK)\n return;\n \n }\n \n },\n \n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n \n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n \n isNull: function(obj) {\n return obj === null;\n },\n \n isNaN: function(obj) {\n return obj !== obj;\n },\n \n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n \n isObject: function(obj) {\n return obj === Object(obj);\n },\n \n isNumber: function(obj) {\n return obj === obj+0;\n },\n \n isString: function(obj) {\n return obj === obj+'';\n },\n \n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n \n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n \n };\n \n})();\n\n\ndat.color.toString = (function (common) {\n\n return function(color) {\n\n if (color.a == 1 || common.isUndefined(color.a)) {\n\n var s = color.hex.toString(16);\n while (s.length < 6) {\n s = '0' + s;\n }\n\n return '#' + s;\n\n } else {\n\n return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')';\n\n }\n\n }\n\n})(dat.utils.common);\n\n\ndat.Color = dat.color.Color = (function (interpret, math, toString, common) {\n\n var Color = function() {\n\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw 'Failed to interpret color arguments';\n }\n\n this.__state.a = this.__state.a || 1;\n\n\n };\n\n Color.COMPONENTS = ['r','g','b','h','s','v','hex','a'];\n\n common.extend(Color.prototype, {\n\n toString: function() {\n return toString(this);\n },\n\n toOriginal: function() {\n return this.__state.conversion.write(this);\n }\n\n });\n\n defineRGBComponent(Color.prototype, 'r', 2);\n defineRGBComponent(Color.prototype, 'g', 1);\n defineRGBComponent(Color.prototype, 'b', 0);\n\n defineHSVComponent(Color.prototype, 'h');\n defineHSVComponent(Color.prototype, 's');\n defineHSVComponent(Color.prototype, 'v');\n\n Object.defineProperty(Color.prototype, 'a', {\n\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n\n });\n\n Object.defineProperty(Color.prototype, 'hex', {\n\n get: function() {\n\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n\n },\n\n set: function(v) {\n\n this.__state.space = 'HEX';\n this.__state.hex = v;\n\n }\n\n });\n\n function defineRGBComponent(target, component, componentHexIndex) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'RGB') {\n recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function defineHSVComponent(target, component) {\n\n Object.defineProperty(target, component, {\n\n get: function() {\n\n if (this.__state.space === 'HSV')\n return this.__state[component];\n\n recalculateHSV(this);\n\n return this.__state[component];\n\n },\n\n set: function(v) {\n\n if (this.__state.space !== 'HSV') {\n recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n\n }\n\n });\n\n }\n\n function recalculateRGB(color, component, componentHexIndex) {\n\n if (color.__state.space === 'HEX') {\n\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n\n } else if (color.__state.space === 'HSV') {\n\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n\n } else {\n\n throw 'Corrupted color state';\n\n }\n\n }\n\n function recalculateHSV(color) {\n\n var result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n\n }\n\n return Color;\n\n})(dat.color.interpret = (function (toString, common) {\n\n var result, toReturn;\n\n var interpret = function() {\n\n toReturn = false;\n\n var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n\n common.each(INTERPRETATIONS, function(family) {\n\n if (family.litmus(original)) {\n\n common.each(family.conversions, function(conversion, conversionName) {\n\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n\n }\n\n });\n\n return common.BREAK;\n\n }\n\n });\n\n return toReturn;\n\n };\n\n var INTERPRETATIONS = [\n\n // Strings\n {\n\n litmus: common.isString,\n\n conversions: {\n\n THREE_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString())\n };\n\n },\n\n write: toString\n\n },\n\n SIX_CHAR_HEX: {\n\n read: function(original) {\n\n var test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) return false;\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString())\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGB: {\n\n read: function(original) {\n\n var test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n\n },\n\n write: toString\n\n },\n\n CSS_RGBA: {\n\n read: function(original) {\n\n var test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\,\\s*(.+)\\s*\\)/);\n if (test === null) return false;\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n\n },\n\n write: toString\n\n }\n\n }\n\n },\n\n // Numbers\n {\n\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n }\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n\n litmus: common.isArray,\n\n conversions: {\n\n RGB_ARRAY: {\n read: function(original) {\n if (original.length != 3) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length != 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n\n }\n\n }\n\n },\n\n // Objects\n {\n\n litmus: common.isObject,\n\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n }\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n }\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n }\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n }\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n }\n }\n\n }\n\n }\n\n }\n\n\n ];\n\n return interpret;\n\n\n})(dat.color.toString,\ndat.utils.common),\ndat.color.math = (function () {\n\n var tmpComponent;\n\n return {\n\n hsv_to_rgb: function(h, s, v) {\n\n var hi = Math.floor(h / 60) % 6;\n\n var f = h / 60 - Math.floor(h / 60);\n var p = v * (1.0 - s);\n var q = v * (1.0 - (f * s));\n var t = v * (1.0 - ((1.0 - f) * s));\n var c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n\n },\n\n rgb_to_hsv: function(r, g, b) {\n\n var min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s;\n\n if (max != 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r == max) {\n h = (g - b) / delta;\n } else if (g == max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n var hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent));\n }\n\n }\n\n})(),\ndat.color.toString,\ndat.utils.common);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dat-gui/vendor/dat.color.js\n// module id = 5\n// module chunks = 0","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.THREE = global.THREE || {})));\n}(this, (function (exports) { 'use strict';\n\n\t// Polyfills\n\n\tif ( Number.EPSILON === undefined ) {\n\n\t\tNumber.EPSILON = Math.pow( 2, - 52 );\n\n\t}\n\n\t//\n\n\tif ( Math.sign === undefined ) {\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\n\n\t\tMath.sign = function ( x ) {\n\n\t\t\treturn ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x;\n\n\t\t};\n\n\t}\n\n\tif ( Function.prototype.name === undefined ) {\n\n\t\t// Missing in IE9-11.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name\n\n\t\tObject.defineProperty( Function.prototype, 'name', {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.toString().match( /^\\s*function\\s*(\\S*)\\s*\\(/ )[ 1 ];\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n\tif ( Object.assign === undefined ) {\n\n\t\t// Missing in IE.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n\n\t\t( function () {\n\n\t\t\tObject.assign = function ( target ) {\n\n\t\t\t\t'use strict';\n\n\t\t\t\tif ( target === undefined || target === null ) {\n\n\t\t\t\t\tthrow new TypeError( 'Cannot convert undefined or null to object' );\n\n\t\t\t\t}\n\n\t\t\t\tvar output = Object( target );\n\n\t\t\t\tfor ( var index = 1; index < arguments.length; index ++ ) {\n\n\t\t\t\t\tvar source = arguments[ index ];\n\n\t\t\t\t\tif ( source !== undefined && source !== null ) {\n\n\t\t\t\t\t\tfor ( var nextKey in source ) {\n\n\t\t\t\t\t\t\tif ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) {\n\n\t\t\t\t\t\t\t\toutput[ nextKey ] = source[ nextKey ];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn output;\n\n\t\t\t};\n\n\t\t} )();\n\n\t}\n\n\t/**\n\t * https://github.com/mrdoob/eventdispatcher.js/\n\t */\n\n\tfunction EventDispatcher() {}\n\n\tObject.assign( EventDispatcher.prototype, {\n\n\t\taddEventListener: function ( type, listener ) {\n\n\t\t\tif ( this._listeners === undefined ) this._listeners = {};\n\n\t\t\tvar listeners = this._listeners;\n\n\t\t\tif ( listeners[ type ] === undefined ) {\n\n\t\t\t\tlisteners[ type ] = [];\n\n\t\t\t}\n\n\t\t\tif ( listeners[ type ].indexOf( listener ) === - 1 ) {\n\n\t\t\t\tlisteners[ type ].push( listener );\n\n\t\t\t}\n\n\t\t},\n\n\t\thasEventListener: function ( type, listener ) {\n\n\t\t\tif ( this._listeners === undefined ) return false;\n\n\t\t\tvar listeners = this._listeners;\n\n\t\t\tif ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t},\n\n\t\tremoveEventListener: function ( type, listener ) {\n\n\t\t\tif ( this._listeners === undefined ) return;\n\n\t\t\tvar listeners = this._listeners;\n\t\t\tvar listenerArray = listeners[ type ];\n\n\t\t\tif ( listenerArray !== undefined ) {\n\n\t\t\t\tvar index = listenerArray.indexOf( listener );\n\n\t\t\t\tif ( index !== - 1 ) {\n\n\t\t\t\t\tlistenerArray.splice( index, 1 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\tdispatchEvent: function ( event ) {\n\n\t\t\tif ( this._listeners === undefined ) return;\n\n\t\t\tvar listeners = this._listeners;\n\t\t\tvar listenerArray = listeners[ event.type ];\n\n\t\t\tif ( listenerArray !== undefined ) {\n\n\t\t\t\tevent.target = this;\n\n\t\t\t\tvar array = [], i = 0;\n\t\t\t\tvar length = listenerArray.length;\n\n\t\t\t\tfor ( i = 0; i < length; i ++ ) {\n\n\t\t\t\t\tarray[ i ] = listenerArray[ i ];\n\n\t\t\t\t}\n\n\t\t\t\tfor ( i = 0; i < length; i ++ ) {\n\n\t\t\t\t\tarray[ i ].call( this, event );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\tvar REVISION = '82';\n\tvar MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\tvar CullFaceNone = 0;\n\tvar CullFaceBack = 1;\n\tvar CullFaceFront = 2;\n\tvar CullFaceFrontBack = 3;\n\tvar FrontFaceDirectionCW = 0;\n\tvar FrontFaceDirectionCCW = 1;\n\tvar BasicShadowMap = 0;\n\tvar PCFShadowMap = 1;\n\tvar PCFSoftShadowMap = 2;\n\tvar FrontSide = 0;\n\tvar BackSide = 1;\n\tvar DoubleSide = 2;\n\tvar FlatShading = 1;\n\tvar SmoothShading = 2;\n\tvar NoColors = 0;\n\tvar FaceColors = 1;\n\tvar VertexColors = 2;\n\tvar NoBlending = 0;\n\tvar NormalBlending = 1;\n\tvar AdditiveBlending = 2;\n\tvar SubtractiveBlending = 3;\n\tvar MultiplyBlending = 4;\n\tvar CustomBlending = 5;\n\tvar BlendingMode = {\n\t\tNoBlending: NoBlending,\n\t\tNormalBlending: NormalBlending,\n\t\tAdditiveBlending: AdditiveBlending,\n\t\tSubtractiveBlending: SubtractiveBlending,\n\t\tMultiplyBlending: MultiplyBlending,\n\t\tCustomBlending: CustomBlending\n\t};\n\tvar AddEquation = 100;\n\tvar SubtractEquation = 101;\n\tvar ReverseSubtractEquation = 102;\n\tvar MinEquation = 103;\n\tvar MaxEquation = 104;\n\tvar ZeroFactor = 200;\n\tvar OneFactor = 201;\n\tvar SrcColorFactor = 202;\n\tvar OneMinusSrcColorFactor = 203;\n\tvar SrcAlphaFactor = 204;\n\tvar OneMinusSrcAlphaFactor = 205;\n\tvar DstAlphaFactor = 206;\n\tvar OneMinusDstAlphaFactor = 207;\n\tvar DstColorFactor = 208;\n\tvar OneMinusDstColorFactor = 209;\n\tvar SrcAlphaSaturateFactor = 210;\n\tvar NeverDepth = 0;\n\tvar AlwaysDepth = 1;\n\tvar LessDepth = 2;\n\tvar LessEqualDepth = 3;\n\tvar EqualDepth = 4;\n\tvar GreaterEqualDepth = 5;\n\tvar GreaterDepth = 6;\n\tvar NotEqualDepth = 7;\n\tvar MultiplyOperation = 0;\n\tvar MixOperation = 1;\n\tvar AddOperation = 2;\n\tvar NoToneMapping = 0;\n\tvar LinearToneMapping = 1;\n\tvar ReinhardToneMapping = 2;\n\tvar Uncharted2ToneMapping = 3;\n\tvar CineonToneMapping = 4;\n\tvar UVMapping = 300;\n\tvar CubeReflectionMapping = 301;\n\tvar CubeRefractionMapping = 302;\n\tvar EquirectangularReflectionMapping = 303;\n\tvar EquirectangularRefractionMapping = 304;\n\tvar SphericalReflectionMapping = 305;\n\tvar CubeUVReflectionMapping = 306;\n\tvar CubeUVRefractionMapping = 307;\n\tvar TextureMapping = {\n\t\tUVMapping: UVMapping,\n\t\tCubeReflectionMapping: CubeReflectionMapping,\n\t\tCubeRefractionMapping: CubeRefractionMapping,\n\t\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\t\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\t\tSphericalReflectionMapping: SphericalReflectionMapping,\n\t\tCubeUVReflectionMapping: CubeUVReflectionMapping,\n\t\tCubeUVRefractionMapping: CubeUVRefractionMapping\n\t};\n\tvar RepeatWrapping = 1000;\n\tvar ClampToEdgeWrapping = 1001;\n\tvar MirroredRepeatWrapping = 1002;\n\tvar TextureWrapping = {\n\t\tRepeatWrapping: RepeatWrapping,\n\t\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\t\tMirroredRepeatWrapping: MirroredRepeatWrapping\n\t};\n\tvar NearestFilter = 1003;\n\tvar NearestMipMapNearestFilter = 1004;\n\tvar NearestMipMapLinearFilter = 1005;\n\tvar LinearFilter = 1006;\n\tvar LinearMipMapNearestFilter = 1007;\n\tvar LinearMipMapLinearFilter = 1008;\n\tvar TextureFilter = {\n\t\tNearestFilter: NearestFilter,\n\t\tNearestMipMapNearestFilter: NearestMipMapNearestFilter,\n\t\tNearestMipMapLinearFilter: NearestMipMapLinearFilter,\n\t\tLinearFilter: LinearFilter,\n\t\tLinearMipMapNearestFilter: LinearMipMapNearestFilter,\n\t\tLinearMipMapLinearFilter: LinearMipMapLinearFilter\n\t};\n\tvar UnsignedByteType = 1009;\n\tvar ByteType = 1010;\n\tvar ShortType = 1011;\n\tvar UnsignedShortType = 1012;\n\tvar IntType = 1013;\n\tvar UnsignedIntType = 1014;\n\tvar FloatType = 1015;\n\tvar HalfFloatType = 1016;\n\tvar UnsignedShort4444Type = 1017;\n\tvar UnsignedShort5551Type = 1018;\n\tvar UnsignedShort565Type = 1019;\n\tvar UnsignedInt248Type = 1020;\n\tvar AlphaFormat = 1021;\n\tvar RGBFormat = 1022;\n\tvar RGBAFormat = 1023;\n\tvar LuminanceFormat = 1024;\n\tvar LuminanceAlphaFormat = 1025;\n\tvar RGBEFormat = RGBAFormat;\n\tvar DepthFormat = 1026;\n\tvar DepthStencilFormat = 1027;\n\tvar RGB_S3TC_DXT1_Format = 2001;\n\tvar RGBA_S3TC_DXT1_Format = 2002;\n\tvar RGBA_S3TC_DXT3_Format = 2003;\n\tvar RGBA_S3TC_DXT5_Format = 2004;\n\tvar RGB_PVRTC_4BPPV1_Format = 2100;\n\tvar RGB_PVRTC_2BPPV1_Format = 2101;\n\tvar RGBA_PVRTC_4BPPV1_Format = 2102;\n\tvar RGBA_PVRTC_2BPPV1_Format = 2103;\n\tvar RGB_ETC1_Format = 2151;\n\tvar LoopOnce = 2200;\n\tvar LoopRepeat = 2201;\n\tvar LoopPingPong = 2202;\n\tvar InterpolateDiscrete = 2300;\n\tvar InterpolateLinear = 2301;\n\tvar InterpolateSmooth = 2302;\n\tvar ZeroCurvatureEnding = 2400;\n\tvar ZeroSlopeEnding = 2401;\n\tvar WrapAroundEnding = 2402;\n\tvar TrianglesDrawMode = 0;\n\tvar TriangleStripDrawMode = 1;\n\tvar TriangleFanDrawMode = 2;\n\tvar LinearEncoding = 3000;\n\tvar sRGBEncoding = 3001;\n\tvar GammaEncoding = 3007;\n\tvar RGBEEncoding = 3002;\n\tvar LogLuvEncoding = 3003;\n\tvar RGBM7Encoding = 3004;\n\tvar RGBM16Encoding = 3005;\n\tvar RGBDEncoding = 3006;\n\tvar BasicDepthPacking = 3200;\n\tvar RGBADepthPacking = 3201;\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tvar _Math = {\n\n\t\tDEG2RAD: Math.PI / 180,\n\t\tRAD2DEG: 180 / Math.PI,\n\n\t\tgenerateUUID: function () {\n\n\t\t\t// http://www.broofa.com/Tools/Math.uuid.htm\n\n\t\t\tvar chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split( '' );\n\t\t\tvar uuid = new Array( 36 );\n\t\t\tvar rnd = 0, r;\n\n\t\t\treturn function generateUUID() {\n\n\t\t\t\tfor ( var i = 0; i < 36; i ++ ) {\n\n\t\t\t\t\tif ( i === 8 || i === 13 || i === 18 || i === 23 ) {\n\n\t\t\t\t\t\tuuid[ i ] = '-';\n\n\t\t\t\t\t} else if ( i === 14 ) {\n\n\t\t\t\t\t\tuuid[ i ] = '4';\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( rnd <= 0x02 ) rnd = 0x2000000 + ( Math.random() * 0x1000000 ) | 0;\n\t\t\t\t\t\tr = rnd & 0xf;\n\t\t\t\t\t\trnd = rnd >> 4;\n\t\t\t\t\t\tuuid[ i ] = chars[ ( i === 19 ) ? ( r & 0x3 ) | 0x8 : r ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn uuid.join( '' );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclamp: function ( value, min, max ) {\n\n\t\t\treturn Math.max( min, Math.min( max, value ) );\n\n\t\t},\n\n\t\t// compute euclidian modulo of m % n\n\t\t// https://en.wikipedia.org/wiki/Modulo_operation\n\n\t\teuclideanModulo: function ( n, m ) {\n\n\t\t\treturn ( ( n % m ) + m ) % m;\n\n\t\t},\n\n\t\t// Linear mapping from range to range \n\n\t\tmapLinear: function ( x, a1, a2, b1, b2 ) {\n\n\t\t\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n\t\t},\n\n\t\t// https://en.wikipedia.org/wiki/Linear_interpolation\n\n\t\tlerp: function ( x, y, t ) {\n\n\t\t\treturn ( 1 - t ) * x + t * y;\n\n\t\t},\n\n\t\t// http://en.wikipedia.org/wiki/Smoothstep\n\n\t\tsmoothstep: function ( x, min, max ) {\n\n\t\t\tif ( x <= min ) return 0;\n\t\t\tif ( x >= max ) return 1;\n\n\t\t\tx = ( x - min ) / ( max - min );\n\n\t\t\treturn x * x * ( 3 - 2 * x );\n\n\t\t},\n\n\t\tsmootherstep: function ( x, min, max ) {\n\n\t\t\tif ( x <= min ) return 0;\n\t\t\tif ( x >= max ) return 1;\n\n\t\t\tx = ( x - min ) / ( max - min );\n\n\t\t\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n\t\t},\n\n\t\trandom16: function () {\n\n\t\t\tconsole.warn( 'THREE.Math.random16() has been deprecated. Use Math.random() instead.' );\n\t\t\treturn Math.random();\n\n\t\t},\n\n\t\t// Random integer from interval\n\n\t\trandInt: function ( low, high ) {\n\n\t\t\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n\t\t},\n\n\t\t// Random float from interval\n\n\t\trandFloat: function ( low, high ) {\n\n\t\t\treturn low + Math.random() * ( high - low );\n\n\t\t},\n\n\t\t// Random float from <-range/2, range/2> interval\n\n\t\trandFloatSpread: function ( range ) {\n\n\t\t\treturn range * ( 0.5 - Math.random() );\n\n\t\t},\n\n\t\tdegToRad: function ( degrees ) {\n\n\t\t\treturn degrees * _Math.DEG2RAD;\n\n\t\t},\n\n\t\tradToDeg: function ( radians ) {\n\n\t\t\treturn radians * _Math.RAD2DEG;\n\n\t\t},\n\n\t\tisPowerOfTwo: function ( value ) {\n\n\t\t\treturn ( value & ( value - 1 ) ) === 0 && value !== 0;\n\n\t\t},\n\n\t\tnearestPowerOfTwo: function ( value ) {\n\n\t\t\treturn Math.pow( 2, Math.round( Math.log( value ) / Math.LN2 ) );\n\n\t\t},\n\n\t\tnextPowerOfTwo: function ( value ) {\n\n\t\t\tvalue --;\n\t\t\tvalue |= value >> 1;\n\t\t\tvalue |= value >> 2;\n\t\t\tvalue |= value >> 4;\n\t\t\tvalue |= value >> 8;\n\t\t\tvalue |= value >> 16;\n\t\t\tvalue ++;\n\n\t\t\treturn value;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author philogb / http://blog.thejit.org/\n\t * @author egraether / http://egraether.com/\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t */\n\n\tfunction Vector2( x, y ) {\n\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\n\t}\n\n\tVector2.prototype = {\n\n\t\tconstructor: Vector2,\n\n\t\tisVector2: true,\n\n\t\tget width() {\n\n\t\t\treturn this.x;\n\n\t\t},\n\n\t\tset width( value ) {\n\n\t\t\tthis.x = value;\n\n\t\t},\n\n\t\tget height() {\n\n\t\t\treturn this.y;\n\n\t\t},\n\n\t\tset height( value ) {\n\n\t\t\tthis.y = value;\n\n\t\t},\n\n\t\t//\n\n\t\tset: function ( x, y ) {\n\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetScalar: function ( scalar ) {\n\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetX: function ( x ) {\n\n\t\t\tthis.x = x;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetY: function ( y ) {\n\n\t\t\tthis.y = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetComponent: function ( index, value ) {\n\n\t\t\tswitch ( index ) {\n\n\t\t\t\tcase 0: this.x = value; break;\n\t\t\t\tcase 1: this.y = value; break;\n\t\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t\t}\n\t\t\t\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetComponent: function ( index ) {\n\n\t\t\tswitch ( index ) {\n\n\t\t\t\tcase 0: return this.x;\n\t\t\t\tcase 1: return this.y;\n\t\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t\t}\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.x, this.y );\n\n\t\t},\n\n\t\tcopy: function ( v ) {\n\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tadd: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );\n\t\t\t\treturn this.addVectors( v, w );\n\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddScalar: function ( s ) {\n\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddVectors: function ( a, b ) {\n\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddScaledVector: function ( v, s ) {\n\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsub: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );\n\t\t\t\treturn this.subVectors( v, w );\n\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsubScalar: function ( s ) {\n\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsubVectors: function ( a, b ) {\n\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiply: function ( v ) {\n\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiplyScalar: function ( scalar ) {\n\n\t\t\tif ( isFinite( scalar ) ) {\n\n\t\t\t\tthis.x *= scalar;\n\t\t\t\tthis.y *= scalar;\n\n\t\t\t} else {\n\n\t\t\t\tthis.x = 0;\n\t\t\t\tthis.y = 0;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdivide: function ( v ) {\n\n\t\t\tthis.x /= v.x;\n\t\t\tthis.y /= v.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdivideScalar: function ( scalar ) {\n\n\t\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t\t},\n\n\t\tmin: function ( v ) {\n\n\t\t\tthis.x = Math.min( this.x, v.x );\n\t\t\tthis.y = Math.min( this.y, v.y );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmax: function ( v ) {\n\n\t\t\tthis.x = Math.max( this.x, v.x );\n\t\t\tthis.y = Math.max( this.y, v.y );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclamp: function ( min, max ) {\n\n\t\t\t// This function assumes min < max, if this assumption isn't true it will not operate correctly\n\n\t\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclampScalar: function () {\n\n\t\t\tvar min, max;\n\n\t\t\treturn function clampScalar( minVal, maxVal ) {\n\n\t\t\t\tif ( min === undefined ) {\n\n\t\t\t\t\tmin = new Vector2();\n\t\t\t\t\tmax = new Vector2();\n\n\t\t\t\t}\n\n\t\t\t\tmin.set( minVal, minVal );\n\t\t\t\tmax.set( maxVal, maxVal );\n\n\t\t\t\treturn this.clamp( min, max );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclampLength: function ( min, max ) {\n\n\t\t\tvar length = this.length();\n\n\t\t\treturn this.multiplyScalar( Math.max( min, Math.min( max, length ) ) / length );\n\n\t\t},\n\n\t\tfloor: function () {\n\n\t\t\tthis.x = Math.floor( this.x );\n\t\t\tthis.y = Math.floor( this.y );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tceil: function () {\n\n\t\t\tthis.x = Math.ceil( this.x );\n\t\t\tthis.y = Math.ceil( this.y );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tround: function () {\n\n\t\t\tthis.x = Math.round( this.x );\n\t\t\tthis.y = Math.round( this.y );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\troundToZero: function () {\n\n\t\t\tthis.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );\n\t\t\tthis.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tnegate: function () {\n\n\t\t\tthis.x = - this.x;\n\t\t\tthis.y = - this.y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdot: function ( v ) {\n\n\t\t\treturn this.x * v.x + this.y * v.y;\n\n\t\t},\n\n\t\tlengthSq: function () {\n\n\t\t\treturn this.x * this.x + this.y * this.y;\n\n\t\t},\n\n\t\tlength: function () {\n\n\t\t\treturn Math.sqrt( this.x * this.x + this.y * this.y );\n\n\t\t},\n\n\t\tlengthManhattan: function() {\n\n\t\t\treturn Math.abs( this.x ) + Math.abs( this.y );\n\n\t\t},\n\n\t\tnormalize: function () {\n\n\t\t\treturn this.divideScalar( this.length() );\n\n\t\t},\n\n\t\tangle: function () {\n\n\t\t\t// computes the angle in radians with respect to the positive x-axis\n\n\t\t\tvar angle = Math.atan2( this.y, this.x );\n\n\t\t\tif ( angle < 0 ) angle += 2 * Math.PI;\n\n\t\t\treturn angle;\n\n\t\t},\n\n\t\tdistanceTo: function ( v ) {\n\n\t\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t\t},\n\n\t\tdistanceToSquared: function ( v ) {\n\n\t\t\tvar dx = this.x - v.x, dy = this.y - v.y;\n\t\t\treturn dx * dx + dy * dy;\n\n\t\t},\n\n\t\tdistanceToManhattan: function ( v ) {\n\n\t\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );\n\n\t\t},\n\n\t\tsetLength: function ( length ) {\n\n\t\t\treturn this.multiplyScalar( length / this.length() );\n\n\t\t},\n\n\t\tlerp: function ( v, alpha ) {\n\n\t\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\t\tthis.y += ( v.y - this.y ) * alpha;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tlerpVectors: function ( v1, v2, alpha ) {\n\n\t\t\treturn this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 );\n\n\t\t},\n\n\t\tequals: function ( v ) {\n\n\t\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) );\n\n\t\t},\n\n\t\tfromArray: function ( array, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tthis.x = array[ offset ];\n\t\t\tthis.y = array[ offset + 1 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tarray[ offset ] = this.x;\n\t\t\tarray[ offset + 1 ] = this.y;\n\n\t\t\treturn array;\n\n\t\t},\n\n\t\tfromAttribute: function ( attribute, index, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tindex = index * attribute.itemSize + offset;\n\n\t\t\tthis.x = attribute.array[ index ];\n\t\t\tthis.y = attribute.array[ index + 1 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\trotateAround: function ( center, angle ) {\n\n\t\t\tvar c = Math.cos( angle ), s = Math.sin( angle );\n\n\t\t\tvar x = this.x - center.x;\n\t\t\tvar y = this.y - center.y;\n\n\t\t\tthis.x = x * c - y * s + center.x;\n\t\t\tthis.y = x * s + y * c + center.y;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author szimek / https://github.com/szimek/\n\t */\n\n\tfunction Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {\n\n\t\tObject.defineProperty( this, 'id', { value: TextureIdCount() } );\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.sourceFile = '';\n\n\t\tthis.image = image !== undefined ? image : Texture.DEFAULT_IMAGE;\n\t\tthis.mipmaps = [];\n\n\t\tthis.mapping = mapping !== undefined ? mapping : Texture.DEFAULT_MAPPING;\n\n\t\tthis.wrapS = wrapS !== undefined ? wrapS : ClampToEdgeWrapping;\n\t\tthis.wrapT = wrapT !== undefined ? wrapT : ClampToEdgeWrapping;\n\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : LinearFilter;\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : LinearMipMapLinearFilter;\n\n\t\tthis.anisotropy = anisotropy !== undefined ? anisotropy : 1;\n\n\t\tthis.format = format !== undefined ? format : RGBAFormat;\n\t\tthis.type = type !== undefined ? type : UnsignedByteType;\n\n\t\tthis.offset = new Vector2( 0, 0 );\n\t\tthis.repeat = new Vector2( 1, 1 );\n\n\t\tthis.generateMipmaps = true;\n\t\tthis.premultiplyAlpha = false;\n\t\tthis.flipY = true;\n\t\tthis.unpackAlignment = 4;\t// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\n\n\t\t// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.\n\t\t//\n\t\t// Also changing the encoding after already used by a Material will not automatically make the Material\n\t\t// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.\n\t\tthis.encoding = encoding !== undefined ? encoding : LinearEncoding;\n\n\t\tthis.version = 0;\n\t\tthis.onUpdate = null;\n\n\t}\n\n\tTexture.DEFAULT_IMAGE = undefined;\n\tTexture.DEFAULT_MAPPING = UVMapping;\n\n\tTexture.prototype = {\n\n\t\tconstructor: Texture,\n\n\t\tisTexture: true,\n\n\t\tset needsUpdate( value ) {\n\n\t\t\tif ( value === true ) this.version ++;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.image = source.image;\n\t\t\tthis.mipmaps = source.mipmaps.slice( 0 );\n\n\t\t\tthis.mapping = source.mapping;\n\n\t\t\tthis.wrapS = source.wrapS;\n\t\t\tthis.wrapT = source.wrapT;\n\n\t\t\tthis.magFilter = source.magFilter;\n\t\t\tthis.minFilter = source.minFilter;\n\n\t\t\tthis.anisotropy = source.anisotropy;\n\n\t\t\tthis.format = source.format;\n\t\t\tthis.type = source.type;\n\n\t\t\tthis.offset.copy( source.offset );\n\t\t\tthis.repeat.copy( source.repeat );\n\n\t\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\t\tthis.flipY = source.flipY;\n\t\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\t\tthis.encoding = source.encoding;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\tif ( meta.textures[ this.uuid ] !== undefined ) {\n\n\t\t\t\treturn meta.textures[ this.uuid ];\n\n\t\t\t}\n\n\t\t\tfunction getDataURL( image ) {\n\n\t\t\t\tvar canvas;\n\n\t\t\t\tif ( image.toDataURL !== undefined ) {\n\n\t\t\t\t\tcanvas = image;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcanvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );\n\t\t\t\t\tcanvas.width = image.width;\n\t\t\t\t\tcanvas.height = image.height;\n\n\t\t\t\t\tcanvas.getContext( '2d' ).drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\t\t}\n\n\t\t\t\tif ( canvas.width > 2048 || canvas.height > 2048 ) {\n\n\t\t\t\t\treturn canvas.toDataURL( 'image/jpeg', 0.6 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn canvas.toDataURL( 'image/png' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar output = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.4,\n\t\t\t\t\ttype: 'Texture',\n\t\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t\t},\n\n\t\t\t\tuuid: this.uuid,\n\t\t\t\tname: this.name,\n\n\t\t\t\tmapping: this.mapping,\n\n\t\t\t\trepeat: [ this.repeat.x, this.repeat.y ],\n\t\t\t\toffset: [ this.offset.x, this.offset.y ],\n\t\t\t\twrap: [ this.wrapS, this.wrapT ],\n\n\t\t\t\tminFilter: this.minFilter,\n\t\t\t\tmagFilter: this.magFilter,\n\t\t\t\tanisotropy: this.anisotropy,\n\n\t\t\t\tflipY: this.flipY\n\t\t\t};\n\n\t\t\tif ( this.image !== undefined ) {\n\n\t\t\t\t// TODO: Move to THREE.Image\n\n\t\t\t\tvar image = this.image;\n\n\t\t\t\tif ( image.uuid === undefined ) {\n\n\t\t\t\t\timage.uuid = _Math.generateUUID(); // UGH\n\n\t\t\t\t}\n\n\t\t\t\tif ( meta.images[ image.uuid ] === undefined ) {\n\n\t\t\t\t\tmeta.images[ image.uuid ] = {\n\t\t\t\t\t\tuuid: image.uuid,\n\t\t\t\t\t\turl: getDataURL( image )\n\t\t\t\t\t};\n\n\t\t\t\t}\n\n\t\t\t\toutput.image = image.uuid;\n\n\t\t\t}\n\n\t\t\tmeta.textures[ this.uuid ] = output;\n\n\t\t\treturn output;\n\n\t\t},\n\n\t\tdispose: function () {\n\n\t\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\t},\n\n\t\ttransformUv: function ( uv ) {\n\n\t\t\tif ( this.mapping !== UVMapping ) return;\n\n\t\t\tuv.multiply( this.repeat );\n\t\t\tuv.add( this.offset );\n\n\t\t\tif ( uv.x < 0 || uv.x > 1 ) {\n\n\t\t\t\tswitch ( this.wrapS ) {\n\n\t\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\t\tuv.x = uv.x < 0 ? 0 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\t\tif ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\t\tuv.x = Math.ceil( uv.x ) - uv.x;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( uv.y < 0 || uv.y > 1 ) {\n\n\t\t\t\tswitch ( this.wrapT ) {\n\n\t\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\t\tuv.y = uv.y < 0 ? 0 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\t\tif ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\t\tuv.y = Math.ceil( uv.y ) - uv.y;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.flipY ) {\n\n\t\t\t\tuv.y = 1 - uv.y;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tObject.assign( Texture.prototype, EventDispatcher.prototype );\n\n\tvar count = 0;\n\tfunction TextureIdCount() { return count++; }\n\n\t/**\n\t * @author supereggbert / http://www.paulbrunt.co.uk/\n\t * @author philogb / http://blog.thejit.org/\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author egraether / http://egraether.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\n\tfunction Vector4( x, y, z, w ) {\n\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.z = z || 0;\n\t\tthis.w = ( w !== undefined ) ? w : 1;\n\n\t}\n\n\tVector4.prototype = {\n\n\t\tconstructor: Vector4,\n\n\t\tisVector4: true,\n\n\t\tset: function ( x, y, z, w ) {\n\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t\tthis.w = w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetScalar: function ( scalar ) {\n\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\tthis.z = scalar;\n\t\t\tthis.w = scalar;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetX: function ( x ) {\n\n\t\t\tthis.x = x;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetY: function ( y ) {\n\n\t\t\tthis.y = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetZ: function ( z ) {\n\n\t\t\tthis.z = z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetW: function ( w ) {\n\n\t\t\tthis.w = w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetComponent: function ( index, value ) {\n\n\t\t\tswitch ( index ) {\n\n\t\t\t\tcase 0: this.x = value; break;\n\t\t\t\tcase 1: this.y = value; break;\n\t\t\t\tcase 2: this.z = value; break;\n\t\t\t\tcase 3: this.w = value; break;\n\t\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t\t}\n\t\t\t\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetComponent: function ( index ) {\n\n\t\t\tswitch ( index ) {\n\n\t\t\t\tcase 0: return this.x;\n\t\t\t\tcase 1: return this.y;\n\t\t\t\tcase 2: return this.z;\n\t\t\t\tcase 3: return this.w;\n\t\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t\t}\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t\t},\n\n\t\tcopy: function ( v ) {\n\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\tthis.z = v.z;\n\t\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tadd: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );\n\t\t\t\treturn this.addVectors( v, w );\n\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\tthis.z += v.z;\n\t\t\tthis.w += v.w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddScalar: function ( s ) {\n\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\tthis.z += s;\n\t\t\tthis.w += s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddVectors: function ( a, b ) {\n\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\tthis.z = a.z + b.z;\n\t\t\tthis.w = a.w + b.w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddScaledVector: function ( v, s ) {\n\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\tthis.z += v.z * s;\n\t\t\tthis.w += v.w * s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsub: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );\n\t\t\t\treturn this.subVectors( v, w );\n\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\tthis.z -= v.z;\n\t\t\tthis.w -= v.w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsubScalar: function ( s ) {\n\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\tthis.z -= s;\n\t\t\tthis.w -= s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsubVectors: function ( a, b ) {\n\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\tthis.z = a.z - b.z;\n\t\t\tthis.w = a.w - b.w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiplyScalar: function ( scalar ) {\n\n\t\t\tif ( isFinite( scalar ) ) {\n\n\t\t\t\tthis.x *= scalar;\n\t\t\t\tthis.y *= scalar;\n\t\t\t\tthis.z *= scalar;\n\t\t\t\tthis.w *= scalar;\n\n\t\t\t} else {\n\n\t\t\t\tthis.x = 0;\n\t\t\t\tthis.y = 0;\n\t\t\t\tthis.z = 0;\n\t\t\t\tthis.w = 0;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyMatrix4: function ( m ) {\n\n\t\t\tvar x = this.x, y = this.y, z = this.z, w = this.w;\n\t\t\tvar e = m.elements;\n\n\t\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdivideScalar: function ( scalar ) {\n\n\t\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t\t},\n\n\t\tsetAxisAngleFromQuaternion: function ( q ) {\n\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t\t// q is assumed to be normalized\n\n\t\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\t\tvar s = Math.sqrt( 1 - q.w * q.w );\n\n\t\t\tif ( s < 0.0001 ) {\n\n\t\t\t\t this.x = 1;\n\t\t\t\t this.y = 0;\n\t\t\t\t this.z = 0;\n\n\t\t\t} else {\n\n\t\t\t\t this.x = q.x / s;\n\t\t\t\t this.y = q.y / s;\n\t\t\t\t this.z = q.z / s;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetAxisAngleFromRotationMatrix: function ( m ) {\n\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\t\tvar angle, x, y, z,\t\t// variables for result\n\t\t\t\tepsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\t\tte = m.elements,\n\n\t\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t\t ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t\t ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t\t// singularity found\n\t\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t\t ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t\t ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t\t ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t\t}\n\n\t\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\t\tangle = Math.PI;\n\n\t\t\t\tvar xx = ( m11 + 1 ) / 2;\n\t\t\t\tvar yy = ( m22 + 1 ) / 2;\n\t\t\t\tvar zz = ( m33 + 1 ) / 2;\n\t\t\t\tvar xy = ( m12 + m21 ) / 4;\n\t\t\t\tvar xz = ( m13 + m31 ) / 4;\n\t\t\t\tvar yz = ( m23 + m32 ) / 4;\n\n\t\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\t\ty = xy / x;\n\t\t\t\t\t\tz = xz / x;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\t\tx = xy / y;\n\t\t\t\t\t\tz = yz / y;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\t\tz = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\t\tx = xz / z;\n\t\t\t\t\t\ty = yz / z;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tthis.set( x, y, z, angle );\n\n\t\t\t\treturn this; // return 180 deg rotation\n\n\t\t\t}\n\n\t\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\t\tvar s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t ( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\t\tthis.x = ( m32 - m23 ) / s;\n\t\t\tthis.y = ( m13 - m31 ) / s;\n\t\t\tthis.z = ( m21 - m12 ) / s;\n\t\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmin: function ( v ) {\n\n\t\t\tthis.x = Math.min( this.x, v.x );\n\t\t\tthis.y = Math.min( this.y, v.y );\n\t\t\tthis.z = Math.min( this.z, v.z );\n\t\t\tthis.w = Math.min( this.w, v.w );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmax: function ( v ) {\n\n\t\t\tthis.x = Math.max( this.x, v.x );\n\t\t\tthis.y = Math.max( this.y, v.y );\n\t\t\tthis.z = Math.max( this.z, v.z );\n\t\t\tthis.w = Math.max( this.w, v.w );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclamp: function ( min, max ) {\n\n\t\t\t// This function assumes min < max, if this assumption isn't true it will not operate correctly\n\n\t\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\t\t\tthis.w = Math.max( min.w, Math.min( max.w, this.w ) );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclampScalar: function () {\n\n\t\t\tvar min, max;\n\n\t\t\treturn function clampScalar( minVal, maxVal ) {\n\n\t\t\t\tif ( min === undefined ) {\n\n\t\t\t\t\tmin = new Vector4();\n\t\t\t\t\tmax = new Vector4();\n\n\t\t\t\t}\n\n\t\t\t\tmin.set( minVal, minVal, minVal, minVal );\n\t\t\t\tmax.set( maxVal, maxVal, maxVal, maxVal );\n\n\t\t\t\treturn this.clamp( min, max );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tfloor: function () {\n\n\t\t\tthis.x = Math.floor( this.x );\n\t\t\tthis.y = Math.floor( this.y );\n\t\t\tthis.z = Math.floor( this.z );\n\t\t\tthis.w = Math.floor( this.w );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tceil: function () {\n\n\t\t\tthis.x = Math.ceil( this.x );\n\t\t\tthis.y = Math.ceil( this.y );\n\t\t\tthis.z = Math.ceil( this.z );\n\t\t\tthis.w = Math.ceil( this.w );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tround: function () {\n\n\t\t\tthis.x = Math.round( this.x );\n\t\t\tthis.y = Math.round( this.y );\n\t\t\tthis.z = Math.round( this.z );\n\t\t\tthis.w = Math.round( this.w );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\troundToZero: function () {\n\n\t\t\tthis.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );\n\t\t\tthis.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );\n\t\t\tthis.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );\n\t\t\tthis.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tnegate: function () {\n\n\t\t\tthis.x = - this.x;\n\t\t\tthis.y = - this.y;\n\t\t\tthis.z = - this.z;\n\t\t\tthis.w = - this.w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdot: function ( v ) {\n\n\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t\t},\n\n\t\tlengthSq: function () {\n\n\t\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t\t},\n\n\t\tlength: function () {\n\n\t\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t\t},\n\n\t\tlengthManhattan: function () {\n\n\t\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t\t},\n\n\t\tnormalize: function () {\n\n\t\t\treturn this.divideScalar( this.length() );\n\n\t\t},\n\n\t\tsetLength: function ( length ) {\n\n\t\t\treturn this.multiplyScalar( length / this.length() );\n\n\t\t},\n\n\t\tlerp: function ( v, alpha ) {\n\n\t\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tlerpVectors: function ( v1, v2, alpha ) {\n\n\t\t\treturn this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 );\n\n\t\t},\n\n\t\tequals: function ( v ) {\n\n\t\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t\t},\n\n\t\tfromArray: function ( array, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tthis.x = array[ offset ];\n\t\t\tthis.y = array[ offset + 1 ];\n\t\t\tthis.z = array[ offset + 2 ];\n\t\t\tthis.w = array[ offset + 3 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tarray[ offset ] = this.x;\n\t\t\tarray[ offset + 1 ] = this.y;\n\t\t\tarray[ offset + 2 ] = this.z;\n\t\t\tarray[ offset + 3 ] = this.w;\n\n\t\t\treturn array;\n\n\t\t},\n\n\t\tfromAttribute: function ( attribute, index, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tindex = index * attribute.itemSize + offset;\n\n\t\t\tthis.x = attribute.array[ index ];\n\t\t\tthis.y = attribute.array[ index + 1 ];\n\t\t\tthis.z = attribute.array[ index + 2 ];\n\t\t\tthis.w = attribute.array[ index + 3 ];\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author szimek / https://github.com/szimek/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author Marius Kintel / https://github.com/kintel\n\t */\n\n\t/*\n\t In options, we can specify:\n\t * Texture parameters for an auto-generated target texture\n\t * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n\t*/\n\tfunction WebGLRenderTarget( width, height, options ) {\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\n\t\tthis.scissor = new Vector4( 0, 0, width, height );\n\t\tthis.scissorTest = false;\n\n\t\tthis.viewport = new Vector4( 0, 0, width, height );\n\n\t\toptions = options || {};\n\n\t\tif ( options.minFilter === undefined ) options.minFilter = LinearFilter;\n\n\t\tthis.texture = new Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );\n\n\t\tthis.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;\n\t\tthis.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;\n\t\tthis.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;\n\n\t}\n\n\tObject.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {\n\n\t\tisWebGLRenderTarget: true,\n\n\t\tsetSize: function ( width, height ) {\n\n\t\t\tif ( this.width !== width || this.height !== height ) {\n\n\t\t\t\tthis.width = width;\n\t\t\t\tthis.height = height;\n\n\t\t\t\tthis.dispose();\n\n\t\t\t}\n\n\t\t\tthis.viewport.set( 0, 0, width, height );\n\t\t\tthis.scissor.set( 0, 0, width, height );\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.width = source.width;\n\t\t\tthis.height = source.height;\n\n\t\t\tthis.viewport.copy( source.viewport );\n\n\t\t\tthis.texture = source.texture.clone();\n\n\t\t\tthis.depthBuffer = source.depthBuffer;\n\t\t\tthis.stencilBuffer = source.stencilBuffer;\n\t\t\tthis.depthTexture = source.depthTexture;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdispose: function () {\n\n\t\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com\n\t */\n\n\tfunction WebGLRenderTargetCube( width, height, options ) {\n\n\t\tWebGLRenderTarget.call( this, width, height, options );\n\n\t\tthis.activeCubeFace = 0; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5\n\t\tthis.activeMipMapLevel = 0;\n\n\t}\n\n\tWebGLRenderTargetCube.prototype = Object.create( WebGLRenderTarget.prototype );\n\tWebGLRenderTargetCube.prototype.constructor = WebGLRenderTargetCube;\n\n\tWebGLRenderTargetCube.prototype.isWebGLRenderTargetCube = true;\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Quaternion( x, y, z, w ) {\n\n\t\tthis._x = x || 0;\n\t\tthis._y = y || 0;\n\t\tthis._z = z || 0;\n\t\tthis._w = ( w !== undefined ) ? w : 1;\n\n\t}\n\n\tQuaternion.prototype = {\n\n\t\tconstructor: Quaternion,\n\n\t\tget x () {\n\n\t\t\treturn this._x;\n\n\t\t},\n\n\t\tset x ( value ) {\n\n\t\t\tthis._x = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tget y () {\n\n\t\t\treturn this._y;\n\n\t\t},\n\n\t\tset y ( value ) {\n\n\t\t\tthis._y = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tget z () {\n\n\t\t\treturn this._z;\n\n\t\t},\n\n\t\tset z ( value ) {\n\n\t\t\tthis._z = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tget w () {\n\n\t\t\treturn this._w;\n\n\t\t},\n\n\t\tset w ( value ) {\n\n\t\t\tthis._w = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tset: function ( x, y, z, w ) {\n\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._w = w;\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this._x, this._y, this._z, this._w );\n\n\t\t},\n\n\t\tcopy: function ( quaternion ) {\n\n\t\t\tthis._x = quaternion.x;\n\t\t\tthis._y = quaternion.y;\n\t\t\tthis._z = quaternion.z;\n\t\t\tthis._w = quaternion.w;\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromEuler: function ( euler, update ) {\n\n\t\t\tif ( (euler && euler.isEuler) === false ) {\n\n\t\t\t\tthrow new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' );\n\n\t\t\t}\n\n\t\t\t// http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t\t//\tcontent/SpinCalc.m\n\n\t\t\tvar c1 = Math.cos( euler._x / 2 );\n\t\t\tvar c2 = Math.cos( euler._y / 2 );\n\t\t\tvar c3 = Math.cos( euler._z / 2 );\n\t\t\tvar s1 = Math.sin( euler._x / 2 );\n\t\t\tvar s2 = Math.sin( euler._y / 2 );\n\t\t\tvar s3 = Math.sin( euler._z / 2 );\n\n\t\t\tvar order = euler.order;\n\n\t\t\tif ( order === 'XYZ' ) {\n\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\n\t\t\t} else if ( order === 'YXZ' ) {\n\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\n\t\t\t} else if ( order === 'ZXY' ) {\n\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\n\t\t\t} else if ( order === 'ZYX' ) {\n\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\n\t\t\t} else if ( order === 'YZX' ) {\n\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\n\t\t\t} else if ( order === 'XZY' ) {\n\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\n\t\t\t}\n\n\t\t\tif ( update !== false ) this.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromAxisAngle: function ( axis, angle ) {\n\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\n\t\t\t// assumes axis is normalized\n\n\t\t\tvar halfAngle = angle / 2, s = Math.sin( halfAngle );\n\n\t\t\tthis._x = axis.x * s;\n\t\t\tthis._y = axis.y * s;\n\t\t\tthis._z = axis.z * s;\n\t\t\tthis._w = Math.cos( halfAngle );\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromRotationMatrix: function ( m ) {\n\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\t\tvar te = m.elements,\n\n\t\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],\n\n\t\t\t\ttrace = m11 + m22 + m33,\n\t\t\t\ts;\n\n\t\t\tif ( trace > 0 ) {\n\n\t\t\t\ts = 0.5 / Math.sqrt( trace + 1.0 );\n\n\t\t\t\tthis._w = 0.25 / s;\n\t\t\t\tthis._x = ( m32 - m23 ) * s;\n\t\t\t\tthis._y = ( m13 - m31 ) * s;\n\t\t\t\tthis._z = ( m21 - m12 ) * s;\n\n\t\t\t} else if ( m11 > m22 && m11 > m33 ) {\n\n\t\t\t\ts = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );\n\n\t\t\t\tthis._w = ( m32 - m23 ) / s;\n\t\t\t\tthis._x = 0.25 * s;\n\t\t\t\tthis._y = ( m12 + m21 ) / s;\n\t\t\t\tthis._z = ( m13 + m31 ) / s;\n\n\t\t\t} else if ( m22 > m33 ) {\n\n\t\t\t\ts = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );\n\n\t\t\t\tthis._w = ( m13 - m31 ) / s;\n\t\t\t\tthis._x = ( m12 + m21 ) / s;\n\t\t\t\tthis._y = 0.25 * s;\n\t\t\t\tthis._z = ( m23 + m32 ) / s;\n\n\t\t\t} else {\n\n\t\t\t\ts = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );\n\n\t\t\t\tthis._w = ( m21 - m12 ) / s;\n\t\t\t\tthis._x = ( m13 + m31 ) / s;\n\t\t\t\tthis._y = ( m23 + m32 ) / s;\n\t\t\t\tthis._z = 0.25 * s;\n\n\t\t\t}\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromUnitVectors: function () {\n\n\t\t\t// http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final\n\n\t\t\t// assumes direction vectors vFrom and vTo are normalized\n\n\t\t\tvar v1, r;\n\n\t\t\tvar EPS = 0.000001;\n\n\t\t\treturn function setFromUnitVectors( vFrom, vTo ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\n\t\t\t\tr = vFrom.dot( vTo ) + 1;\n\n\t\t\t\tif ( r < EPS ) {\n\n\t\t\t\t\tr = 0;\n\n\t\t\t\t\tif ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {\n\n\t\t\t\t\t\tv1.set( - vFrom.y, vFrom.x, 0 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv1.set( 0, - vFrom.z, vFrom.y );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tv1.crossVectors( vFrom, vTo );\n\n\t\t\t\t}\n\n\t\t\t\tthis._x = v1.x;\n\t\t\t\tthis._y = v1.y;\n\t\t\t\tthis._z = v1.z;\n\t\t\t\tthis._w = r;\n\n\t\t\t\treturn this.normalize();\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tinverse: function () {\n\n\t\t\treturn this.conjugate().normalize();\n\n\t\t},\n\n\t\tconjugate: function () {\n\n\t\t\tthis._x *= - 1;\n\t\t\tthis._y *= - 1;\n\t\t\tthis._z *= - 1;\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdot: function ( v ) {\n\n\t\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\n\t\t},\n\n\t\tlengthSq: function () {\n\n\t\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\n\t\t},\n\n\t\tlength: function () {\n\n\t\t\treturn Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );\n\n\t\t},\n\n\t\tnormalize: function () {\n\n\t\t\tvar l = this.length();\n\n\t\t\tif ( l === 0 ) {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = 0;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = 1;\n\n\t\t\t} else {\n\n\t\t\t\tl = 1 / l;\n\n\t\t\t\tthis._x = this._x * l;\n\t\t\t\tthis._y = this._y * l;\n\t\t\t\tthis._z = this._z * l;\n\t\t\t\tthis._w = this._w * l;\n\n\t\t\t}\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiply: function ( q, p ) {\n\n\t\t\tif ( p !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' );\n\t\t\t\treturn this.multiplyQuaternions( q, p );\n\n\t\t\t}\n\n\t\t\treturn this.multiplyQuaternions( this, q );\n\n\t\t},\n\n\t\tpremultiply: function ( q ) {\n\n\t\t\treturn this.multiplyQuaternions( q, this );\n\n\t\t},\n\n\t\tmultiplyQuaternions: function ( a, b ) {\n\n\t\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\n\t\t\tvar qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;\n\t\t\tvar qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;\n\n\t\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tslerp: function ( qb, t ) {\n\n\t\t\tif ( t === 0 ) return this;\n\t\t\tif ( t === 1 ) return this.copy( qb );\n\n\t\t\tvar x = this._x, y = this._y, z = this._z, w = this._w;\n\n\t\t\t// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\t\tvar cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\t\tif ( cosHalfTheta < 0 ) {\n\n\t\t\t\tthis._w = - qb._w;\n\t\t\t\tthis._x = - qb._x;\n\t\t\t\tthis._y = - qb._y;\n\t\t\t\tthis._z = - qb._z;\n\n\t\t\t\tcosHalfTheta = - cosHalfTheta;\n\n\t\t\t} else {\n\n\t\t\t\tthis.copy( qb );\n\n\t\t\t}\n\n\t\t\tif ( cosHalfTheta >= 1.0 ) {\n\n\t\t\t\tthis._w = w;\n\t\t\t\tthis._x = x;\n\t\t\t\tthis._y = y;\n\t\t\t\tthis._z = z;\n\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\tvar sinHalfTheta = Math.sqrt( 1.0 - cosHalfTheta * cosHalfTheta );\n\n\t\t\tif ( Math.abs( sinHalfTheta ) < 0.001 ) {\n\n\t\t\t\tthis._w = 0.5 * ( w + this._w );\n\t\t\t\tthis._x = 0.5 * ( x + this._x );\n\t\t\t\tthis._y = 0.5 * ( y + this._y );\n\t\t\t\tthis._z = 0.5 * ( z + this._z );\n\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\tvar halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );\n\t\t\tvar ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,\n\t\t\tratioB = Math.sin( t * halfTheta ) / sinHalfTheta;\n\n\t\t\tthis._w = ( w * ratioA + this._w * ratioB );\n\t\t\tthis._x = ( x * ratioA + this._x * ratioB );\n\t\t\tthis._y = ( y * ratioA + this._y * ratioB );\n\t\t\tthis._z = ( z * ratioA + this._z * ratioB );\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( quaternion ) {\n\n\t\t\treturn ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w );\n\n\t\t},\n\n\t\tfromArray: function ( array, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tthis._x = array[ offset ];\n\t\t\tthis._y = array[ offset + 1 ];\n\t\t\tthis._z = array[ offset + 2 ];\n\t\t\tthis._w = array[ offset + 3 ];\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tarray[ offset ] = this._x;\n\t\t\tarray[ offset + 1 ] = this._y;\n\t\t\tarray[ offset + 2 ] = this._z;\n\t\t\tarray[ offset + 3 ] = this._w;\n\n\t\t\treturn array;\n\n\t\t},\n\n\t\tonChange: function ( callback ) {\n\n\t\t\tthis.onChangeCallback = callback;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tonChangeCallback: function () {}\n\n\t};\n\n\tObject.assign( Quaternion, {\n\n\t\tslerp: function( qa, qb, qm, t ) {\n\n\t\t\treturn qm.copy( qa ).slerp( qb, t );\n\n\t\t},\n\n\t\tslerpFlat: function(\n\t\t\t\tdst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {\n\n\t\t\t// fuzz-free, array-based Quaternion SLERP operation\n\n\t\t\tvar x0 = src0[ srcOffset0 + 0 ],\n\t\t\t\ty0 = src0[ srcOffset0 + 1 ],\n\t\t\t\tz0 = src0[ srcOffset0 + 2 ],\n\t\t\t\tw0 = src0[ srcOffset0 + 3 ],\n\n\t\t\t\tx1 = src1[ srcOffset1 + 0 ],\n\t\t\t\ty1 = src1[ srcOffset1 + 1 ],\n\t\t\t\tz1 = src1[ srcOffset1 + 2 ],\n\t\t\t\tw1 = src1[ srcOffset1 + 3 ];\n\n\t\t\tif ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {\n\n\t\t\t\tvar s = 1 - t,\n\n\t\t\t\t\tcos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\n\t\t\t\t\tdir = ( cos >= 0 ? 1 : - 1 ),\n\t\t\t\t\tsqrSin = 1 - cos * cos;\n\n\t\t\t\t// Skip the Slerp for tiny steps to avoid numeric problems:\n\t\t\t\tif ( sqrSin > Number.EPSILON ) {\n\n\t\t\t\t\tvar sin = Math.sqrt( sqrSin ),\n\t\t\t\t\t\tlen = Math.atan2( sin, cos * dir );\n\n\t\t\t\t\ts = Math.sin( s * len ) / sin;\n\t\t\t\t\tt = Math.sin( t * len ) / sin;\n\n\t\t\t\t}\n\n\t\t\t\tvar tDir = t * dir;\n\n\t\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\t\tw0 = w0 * s + w1 * tDir;\n\n\t\t\t\t// Normalize in case we just did a lerp:\n\t\t\t\tif ( s === 1 - t ) {\n\n\t\t\t\t\tvar f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );\n\n\t\t\t\t\tx0 *= f;\n\t\t\t\t\ty0 *= f;\n\t\t\t\t\tz0 *= f;\n\t\t\t\t\tw0 *= f;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdst[ dstOffset ] = x0;\n\t\t\tdst[ dstOffset + 1 ] = y0;\n\t\t\tdst[ dstOffset + 2 ] = z0;\n\t\t\tdst[ dstOffset + 3 ] = w0;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author *kile / http://kile.stravaganza.org/\n\t * @author philogb / http://blog.thejit.org/\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author egraether / http://egraether.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\n\tfunction Vector3( x, y, z ) {\n\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.z = z || 0;\n\n\t}\n\n\tVector3.prototype = {\n\n\t\tconstructor: Vector3,\n\n\t\tisVector3: true,\n\n\t\tset: function ( x, y, z ) {\n\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetScalar: function ( scalar ) {\n\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\tthis.z = scalar;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetX: function ( x ) {\n\n\t\t\tthis.x = x;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetY: function ( y ) {\n\n\t\t\tthis.y = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetZ: function ( z ) {\n\n\t\t\tthis.z = z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetComponent: function ( index, value ) {\n\n\t\t\tswitch ( index ) {\n\n\t\t\t\tcase 0: this.x = value; break;\n\t\t\t\tcase 1: this.y = value; break;\n\t\t\t\tcase 2: this.z = value; break;\n\t\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t\t}\n\t\t\t\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetComponent: function ( index ) {\n\n\t\t\tswitch ( index ) {\n\n\t\t\t\tcase 0: return this.x;\n\t\t\t\tcase 1: return this.y;\n\t\t\t\tcase 2: return this.z;\n\t\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t\t}\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.x, this.y, this.z );\n\n\t\t},\n\n\t\tcopy: function ( v ) {\n\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\tthis.z = v.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tadd: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );\n\t\t\t\treturn this.addVectors( v, w );\n\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\tthis.z += v.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddScalar: function ( s ) {\n\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\tthis.z += s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddVectors: function ( a, b ) {\n\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\tthis.z = a.z + b.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddScaledVector: function ( v, s ) {\n\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\tthis.z += v.z * s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsub: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );\n\t\t\t\treturn this.subVectors( v, w );\n\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\tthis.z -= v.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsubScalar: function ( s ) {\n\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\tthis.z -= s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsubVectors: function ( a, b ) {\n\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\tthis.z = a.z - b.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiply: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' );\n\t\t\t\treturn this.multiplyVectors( v, w );\n\n\t\t\t}\n\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\t\t\tthis.z *= v.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiplyScalar: function ( scalar ) {\n\n\t\t\tif ( isFinite( scalar ) ) {\n\n\t\t\t\tthis.x *= scalar;\n\t\t\t\tthis.y *= scalar;\n\t\t\t\tthis.z *= scalar;\n\n\t\t\t} else {\n\n\t\t\t\tthis.x = 0;\n\t\t\t\tthis.y = 0;\n\t\t\t\tthis.z = 0;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiplyVectors: function ( a, b ) {\n\n\t\t\tthis.x = a.x * b.x;\n\t\t\tthis.y = a.y * b.y;\n\t\t\tthis.z = a.z * b.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyEuler: function () {\n\n\t\t\tvar quaternion;\n\n\t\t\treturn function applyEuler( euler ) {\n\n\t\t\t\tif ( (euler && euler.isEuler) === false ) {\n\n\t\t\t\t\tconsole.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );\n\n\t\t\t\t}\n\n\t\t\t\tif ( quaternion === undefined ) quaternion = new Quaternion();\n\n\t\t\t\treturn this.applyQuaternion( quaternion.setFromEuler( euler ) );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tapplyAxisAngle: function () {\n\n\t\t\tvar quaternion;\n\n\t\t\treturn function applyAxisAngle( axis, angle ) {\n\n\t\t\t\tif ( quaternion === undefined ) quaternion = new Quaternion();\n\n\t\t\t\treturn this.applyQuaternion( quaternion.setFromAxisAngle( axis, angle ) );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tapplyMatrix3: function ( m ) {\n\n\t\t\tvar x = this.x, y = this.y, z = this.z;\n\t\t\tvar e = m.elements;\n\n\t\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;\n\t\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;\n\t\t\tthis.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyMatrix4: function ( m ) {\n\n\t\t\t// input: THREE.Matrix4 affine matrix\n\n\t\t\tvar x = this.x, y = this.y, z = this.z;\n\t\t\tvar e = m.elements;\n\n\t\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ];\n\t\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ];\n\t\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyProjection: function ( m ) {\n\n\t\t\t// input: THREE.Matrix4 projection matrix\n\n\t\t\tvar x = this.x, y = this.y, z = this.z;\n\t\t\tvar e = m.elements;\n\t\t\tvar d = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); // perspective divide\n\n\t\t\tthis.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * d;\n\t\t\tthis.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * d;\n\t\t\tthis.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * d;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyQuaternion: function ( q ) {\n\n\t\t\tvar x = this.x, y = this.y, z = this.z;\n\t\t\tvar qx = q.x, qy = q.y, qz = q.z, qw = q.w;\n\n\t\t\t// calculate quat * vector\n\n\t\t\tvar ix = qw * x + qy * z - qz * y;\n\t\t\tvar iy = qw * y + qz * x - qx * z;\n\t\t\tvar iz = qw * z + qx * y - qy * x;\n\t\t\tvar iw = - qx * x - qy * y - qz * z;\n\n\t\t\t// calculate result * inverse quat\n\n\t\t\tthis.x = ix * qw + iw * - qx + iy * - qz - iz * - qy;\n\t\t\tthis.y = iy * qw + iw * - qy + iz * - qx - ix * - qz;\n\t\t\tthis.z = iz * qw + iw * - qz + ix * - qy - iy * - qx;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tproject: function () {\n\n\t\t\tvar matrix;\n\n\t\t\treturn function project( camera ) {\n\n\t\t\t\tif ( matrix === undefined ) matrix = new Matrix4();\n\n\t\t\t\tmatrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) );\n\t\t\t\treturn this.applyProjection( matrix );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tunproject: function () {\n\n\t\t\tvar matrix;\n\n\t\t\treturn function unproject( camera ) {\n\n\t\t\t\tif ( matrix === undefined ) matrix = new Matrix4();\n\n\t\t\t\tmatrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) );\n\t\t\t\treturn this.applyProjection( matrix );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttransformDirection: function ( m ) {\n\n\t\t\t// input: THREE.Matrix4 affine matrix\n\t\t\t// vector interpreted as a direction\n\n\t\t\tvar x = this.x, y = this.y, z = this.z;\n\t\t\tvar e = m.elements;\n\n\t\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;\n\t\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;\n\t\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;\n\n\t\t\treturn this.normalize();\n\n\t\t},\n\n\t\tdivide: function ( v ) {\n\n\t\t\tthis.x /= v.x;\n\t\t\tthis.y /= v.y;\n\t\t\tthis.z /= v.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdivideScalar: function ( scalar ) {\n\n\t\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t\t},\n\n\t\tmin: function ( v ) {\n\n\t\t\tthis.x = Math.min( this.x, v.x );\n\t\t\tthis.y = Math.min( this.y, v.y );\n\t\t\tthis.z = Math.min( this.z, v.z );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmax: function ( v ) {\n\n\t\t\tthis.x = Math.max( this.x, v.x );\n\t\t\tthis.y = Math.max( this.y, v.y );\n\t\t\tthis.z = Math.max( this.z, v.z );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclamp: function ( min, max ) {\n\n\t\t\t// This function assumes min < max, if this assumption isn't true it will not operate correctly\n\n\t\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclampScalar: function () {\n\n\t\t\tvar min, max;\n\n\t\t\treturn function clampScalar( minVal, maxVal ) {\n\n\t\t\t\tif ( min === undefined ) {\n\n\t\t\t\t\tmin = new Vector3();\n\t\t\t\t\tmax = new Vector3();\n\n\t\t\t\t}\n\n\t\t\t\tmin.set( minVal, minVal, minVal );\n\t\t\t\tmax.set( maxVal, maxVal, maxVal );\n\n\t\t\t\treturn this.clamp( min, max );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclampLength: function ( min, max ) {\n\n\t\t\tvar length = this.length();\n\n\t\t\treturn this.multiplyScalar( Math.max( min, Math.min( max, length ) ) / length );\n\n\t\t},\n\n\t\tfloor: function () {\n\n\t\t\tthis.x = Math.floor( this.x );\n\t\t\tthis.y = Math.floor( this.y );\n\t\t\tthis.z = Math.floor( this.z );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tceil: function () {\n\n\t\t\tthis.x = Math.ceil( this.x );\n\t\t\tthis.y = Math.ceil( this.y );\n\t\t\tthis.z = Math.ceil( this.z );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tround: function () {\n\n\t\t\tthis.x = Math.round( this.x );\n\t\t\tthis.y = Math.round( this.y );\n\t\t\tthis.z = Math.round( this.z );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\troundToZero: function () {\n\n\t\t\tthis.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );\n\t\t\tthis.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );\n\t\t\tthis.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tnegate: function () {\n\n\t\t\tthis.x = - this.x;\n\t\t\tthis.y = - this.y;\n\t\t\tthis.z = - this.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdot: function ( v ) {\n\n\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\n\t\t},\n\n\t\tlengthSq: function () {\n\n\t\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\n\t\t},\n\n\t\tlength: function () {\n\n\t\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );\n\n\t\t},\n\n\t\tlengthManhattan: function () {\n\n\t\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );\n\n\t\t},\n\n\t\tnormalize: function () {\n\n\t\t\treturn this.divideScalar( this.length() );\n\n\t\t},\n\n\t\tsetLength: function ( length ) {\n\n\t\t\treturn this.multiplyScalar( length / this.length() );\n\n\t\t},\n\n\t\tlerp: function ( v, alpha ) {\n\n\t\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\t\tthis.z += ( v.z - this.z ) * alpha;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tlerpVectors: function ( v1, v2, alpha ) {\n\n\t\t\treturn this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 );\n\n\t\t},\n\n\t\tcross: function ( v, w ) {\n\n\t\t\tif ( w !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' );\n\t\t\t\treturn this.crossVectors( v, w );\n\n\t\t\t}\n\n\t\t\tvar x = this.x, y = this.y, z = this.z;\n\n\t\t\tthis.x = y * v.z - z * v.y;\n\t\t\tthis.y = z * v.x - x * v.z;\n\t\t\tthis.z = x * v.y - y * v.x;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcrossVectors: function ( a, b ) {\n\n\t\t\tvar ax = a.x, ay = a.y, az = a.z;\n\t\t\tvar bx = b.x, by = b.y, bz = b.z;\n\n\t\t\tthis.x = ay * bz - az * by;\n\t\t\tthis.y = az * bx - ax * bz;\n\t\t\tthis.z = ax * by - ay * bx;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tprojectOnVector: function ( vector ) {\n\n\t\t\tvar scalar = vector.dot( this ) / vector.lengthSq();\n\n\t\t\treturn this.copy( vector ).multiplyScalar( scalar );\n\n\t\t},\n\n\t\tprojectOnPlane: function () {\n\n\t\t\tvar v1;\n\n\t\t\treturn function projectOnPlane( planeNormal ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\n\t\t\t\tv1.copy( this ).projectOnVector( planeNormal );\n\n\t\t\t\treturn this.sub( v1 );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\treflect: function () {\n\n\t\t\t// reflect incident vector off plane orthogonal to normal\n\t\t\t// normal is assumed to have unit length\n\n\t\t\tvar v1;\n\n\t\t\treturn function reflect( normal ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\n\t\t\t\treturn this.sub( v1.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tangleTo: function ( v ) {\n\n\t\t\tvar theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) );\n\n\t\t\t// clamp, to handle numerical problems\n\n\t\t\treturn Math.acos( _Math.clamp( theta, - 1, 1 ) );\n\n\t\t},\n\n\t\tdistanceTo: function ( v ) {\n\n\t\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t\t},\n\n\t\tdistanceToSquared: function ( v ) {\n\n\t\t\tvar dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;\n\n\t\t\treturn dx * dx + dy * dy + dz * dz;\n\n\t\t},\n\n\t\tdistanceToManhattan: function ( v ) {\n\n\t\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );\n\n\t\t},\n\n\t\tsetFromSpherical: function( s ) {\n\n\t\t\tvar sinPhiRadius = Math.sin( s.phi ) * s.radius;\n\n\t\t\tthis.x = sinPhiRadius * Math.sin( s.theta );\n\t\t\tthis.y = Math.cos( s.phi ) * s.radius;\n\t\t\tthis.z = sinPhiRadius * Math.cos( s.theta );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromMatrixPosition: function ( m ) {\n\n\t\t\treturn this.setFromMatrixColumn( m, 3 );\n\n\t\t},\n\n\t\tsetFromMatrixScale: function ( m ) {\n\n\t\t\tvar sx = this.setFromMatrixColumn( m, 0 ).length();\n\t\t\tvar sy = this.setFromMatrixColumn( m, 1 ).length();\n\t\t\tvar sz = this.setFromMatrixColumn( m, 2 ).length();\n\n\t\t\tthis.x = sx;\n\t\t\tthis.y = sy;\n\t\t\tthis.z = sz;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromMatrixColumn: function ( m, index ) {\n\n\t\t\tif ( typeof m === 'number' ) {\n\n\t\t\t\tconsole.warn( 'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).' );\n\t\t\t\tvar temp = m;\n\t\t\t\tm = index;\n\t\t\t\tindex = temp;\n\n\t\t\t}\n\n\t\t\treturn this.fromArray( m.elements, index * 4 );\n\n\t\t},\n\n\t\tequals: function ( v ) {\n\n\t\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );\n\n\t\t},\n\n\t\tfromArray: function ( array, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tthis.x = array[ offset ];\n\t\t\tthis.y = array[ offset + 1 ];\n\t\t\tthis.z = array[ offset + 2 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tarray[ offset ] = this.x;\n\t\t\tarray[ offset + 1 ] = this.y;\n\t\t\tarray[ offset + 2 ] = this.z;\n\n\t\t\treturn array;\n\n\t\t},\n\n\t\tfromAttribute: function ( attribute, index, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tindex = index * attribute.itemSize + offset;\n\n\t\t\tthis.x = attribute.array[ index ];\n\t\t\tthis.y = attribute.array[ index + 1 ];\n\t\t\tthis.z = attribute.array[ index + 2 ];\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author supereggbert / http://www.paulbrunt.co.uk/\n\t * @author philogb / http://blog.thejit.org/\n\t * @author jordi_ros / http://plattsoft.com\n\t * @author D1plo1d / http://github.com/D1plo1d\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author timknip / http://www.floorplanner.com/\n\t * @author bhouston / http://clara.io\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\n\tfunction Matrix4() {\n\n\t\tthis.elements = new Float32Array( [\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t] );\n\n\t\tif ( arguments.length > 0 ) {\n\n\t\t\tconsole.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' );\n\n\t\t}\n\n\t}\n\n\tMatrix4.prototype = {\n\n\t\tconstructor: Matrix4,\n\n\t\tisMatrix4: true,\n\n\t\tset: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tte[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;\n\t\t\tte[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;\n\t\t\tte[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;\n\t\t\tte[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tidentity: function () {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, 0,\n\t\t\t\t0, 1, 0, 0,\n\t\t\t\t0, 0, 1, 0,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new Matrix4().fromArray( this.elements );\n\n\t\t},\n\n\t\tcopy: function ( m ) {\n\n\t\t\tthis.elements.set( m.elements );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyPosition: function ( m ) {\n\n\t\t\tvar te = this.elements;\n\t\t\tvar me = m.elements;\n\n\t\t\tte[ 12 ] = me[ 12 ];\n\t\t\tte[ 13 ] = me[ 13 ];\n\t\t\tte[ 14 ] = me[ 14 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\textractBasis: function ( xAxis, yAxis, zAxis ) {\n\n\t\t\txAxis.setFromMatrixColumn( this, 0 );\n\t\t\tyAxis.setFromMatrixColumn( this, 1 );\n\t\t\tzAxis.setFromMatrixColumn( this, 2 );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeBasis: function ( xAxis, yAxis, zAxis ) {\n\n\t\t\tthis.set(\n\t\t\t\txAxis.x, yAxis.x, zAxis.x, 0,\n\t\t\t\txAxis.y, yAxis.y, zAxis.y, 0,\n\t\t\t\txAxis.z, yAxis.z, zAxis.z, 0,\n\t\t\t\t0, 0, 0, 1\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\textractRotation: function () {\n\n\t\t\tvar v1;\n\n\t\t\treturn function extractRotation( m ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\n\t\t\t\tvar te = this.elements;\n\t\t\t\tvar me = m.elements;\n\n\t\t\t\tvar scaleX = 1 / v1.setFromMatrixColumn( m, 0 ).length();\n\t\t\t\tvar scaleY = 1 / v1.setFromMatrixColumn( m, 1 ).length();\n\t\t\t\tvar scaleZ = 1 / v1.setFromMatrixColumn( m, 2 ).length();\n\n\t\t\t\tte[ 0 ] = me[ 0 ] * scaleX;\n\t\t\t\tte[ 1 ] = me[ 1 ] * scaleX;\n\t\t\t\tte[ 2 ] = me[ 2 ] * scaleX;\n\n\t\t\t\tte[ 4 ] = me[ 4 ] * scaleY;\n\t\t\t\tte[ 5 ] = me[ 5 ] * scaleY;\n\t\t\t\tte[ 6 ] = me[ 6 ] * scaleY;\n\n\t\t\t\tte[ 8 ] = me[ 8 ] * scaleZ;\n\t\t\t\tte[ 9 ] = me[ 9 ] * scaleZ;\n\t\t\t\tte[ 10 ] = me[ 10 ] * scaleZ;\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tmakeRotationFromEuler: function ( euler ) {\n\n\t\t\tif ( (euler && euler.isEuler) === false ) {\n\n\t\t\t\tconsole.error( 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' );\n\n\t\t\t}\n\n\t\t\tvar te = this.elements;\n\n\t\t\tvar x = euler.x, y = euler.y, z = euler.z;\n\t\t\tvar a = Math.cos( x ), b = Math.sin( x );\n\t\t\tvar c = Math.cos( y ), d = Math.sin( y );\n\t\t\tvar e = Math.cos( z ), f = Math.sin( z );\n\n\t\t\tif ( euler.order === 'XYZ' ) {\n\n\t\t\t\tvar ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\t\tte[ 0 ] = c * e;\n\t\t\t\tte[ 4 ] = - c * f;\n\t\t\t\tte[ 8 ] = d;\n\n\t\t\t\tte[ 1 ] = af + be * d;\n\t\t\t\tte[ 5 ] = ae - bf * d;\n\t\t\t\tte[ 9 ] = - b * c;\n\n\t\t\t\tte[ 2 ] = bf - ae * d;\n\t\t\t\tte[ 6 ] = be + af * d;\n\t\t\t\tte[ 10 ] = a * c;\n\n\t\t\t} else if ( euler.order === 'YXZ' ) {\n\n\t\t\t\tvar ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\t\tte[ 0 ] = ce + df * b;\n\t\t\t\tte[ 4 ] = de * b - cf;\n\t\t\t\tte[ 8 ] = a * d;\n\n\t\t\t\tte[ 1 ] = a * f;\n\t\t\t\tte[ 5 ] = a * e;\n\t\t\t\tte[ 9 ] = - b;\n\n\t\t\t\tte[ 2 ] = cf * b - de;\n\t\t\t\tte[ 6 ] = df + ce * b;\n\t\t\t\tte[ 10 ] = a * c;\n\n\t\t\t} else if ( euler.order === 'ZXY' ) {\n\n\t\t\t\tvar ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\t\tte[ 0 ] = ce - df * b;\n\t\t\t\tte[ 4 ] = - a * f;\n\t\t\t\tte[ 8 ] = de + cf * b;\n\n\t\t\t\tte[ 1 ] = cf + de * b;\n\t\t\t\tte[ 5 ] = a * e;\n\t\t\t\tte[ 9 ] = df - ce * b;\n\n\t\t\t\tte[ 2 ] = - a * d;\n\t\t\t\tte[ 6 ] = b;\n\t\t\t\tte[ 10 ] = a * c;\n\n\t\t\t} else if ( euler.order === 'ZYX' ) {\n\n\t\t\t\tvar ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\t\tte[ 0 ] = c * e;\n\t\t\t\tte[ 4 ] = be * d - af;\n\t\t\t\tte[ 8 ] = ae * d + bf;\n\n\t\t\t\tte[ 1 ] = c * f;\n\t\t\t\tte[ 5 ] = bf * d + ae;\n\t\t\t\tte[ 9 ] = af * d - be;\n\n\t\t\t\tte[ 2 ] = - d;\n\t\t\t\tte[ 6 ] = b * c;\n\t\t\t\tte[ 10 ] = a * c;\n\n\t\t\t} else if ( euler.order === 'YZX' ) {\n\n\t\t\t\tvar ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\t\tte[ 0 ] = c * e;\n\t\t\t\tte[ 4 ] = bd - ac * f;\n\t\t\t\tte[ 8 ] = bc * f + ad;\n\n\t\t\t\tte[ 1 ] = f;\n\t\t\t\tte[ 5 ] = a * e;\n\t\t\t\tte[ 9 ] = - b * e;\n\n\t\t\t\tte[ 2 ] = - d * e;\n\t\t\t\tte[ 6 ] = ad * f + bc;\n\t\t\t\tte[ 10 ] = ac - bd * f;\n\n\t\t\t} else if ( euler.order === 'XZY' ) {\n\n\t\t\t\tvar ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\t\tte[ 0 ] = c * e;\n\t\t\t\tte[ 4 ] = - f;\n\t\t\t\tte[ 8 ] = d * e;\n\n\t\t\t\tte[ 1 ] = ac * f + bd;\n\t\t\t\tte[ 5 ] = a * e;\n\t\t\t\tte[ 9 ] = ad * f - bc;\n\n\t\t\t\tte[ 2 ] = bc * f - ad;\n\t\t\t\tte[ 6 ] = b * e;\n\t\t\t\tte[ 10 ] = bd * f + ac;\n\n\t\t\t}\n\n\t\t\t// last column\n\t\t\tte[ 3 ] = 0;\n\t\t\tte[ 7 ] = 0;\n\t\t\tte[ 11 ] = 0;\n\n\t\t\t// bottom row\n\t\t\tte[ 12 ] = 0;\n\t\t\tte[ 13 ] = 0;\n\t\t\tte[ 14 ] = 0;\n\t\t\tte[ 15 ] = 1;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeRotationFromQuaternion: function ( q ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tvar x = q.x, y = q.y, z = q.z, w = q.w;\n\t\t\tvar x2 = x + x, y2 = y + y, z2 = z + z;\n\t\t\tvar xx = x * x2, xy = x * y2, xz = x * z2;\n\t\t\tvar yy = y * y2, yz = y * z2, zz = z * z2;\n\t\t\tvar wx = w * x2, wy = w * y2, wz = w * z2;\n\n\t\t\tte[ 0 ] = 1 - ( yy + zz );\n\t\t\tte[ 4 ] = xy - wz;\n\t\t\tte[ 8 ] = xz + wy;\n\n\t\t\tte[ 1 ] = xy + wz;\n\t\t\tte[ 5 ] = 1 - ( xx + zz );\n\t\t\tte[ 9 ] = yz - wx;\n\n\t\t\tte[ 2 ] = xz - wy;\n\t\t\tte[ 6 ] = yz + wx;\n\t\t\tte[ 10 ] = 1 - ( xx + yy );\n\n\t\t\t// last column\n\t\t\tte[ 3 ] = 0;\n\t\t\tte[ 7 ] = 0;\n\t\t\tte[ 11 ] = 0;\n\n\t\t\t// bottom row\n\t\t\tte[ 12 ] = 0;\n\t\t\tte[ 13 ] = 0;\n\t\t\tte[ 14 ] = 0;\n\t\t\tte[ 15 ] = 1;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tlookAt: function () {\n\n\t\t\tvar x, y, z;\n\n\t\t\treturn function lookAt( eye, target, up ) {\n\n\t\t\t\tif ( x === undefined ) {\n\n\t\t\t\t\tx = new Vector3();\n\t\t\t\t\ty = new Vector3();\n\t\t\t\t\tz = new Vector3();\n\n\t\t\t\t}\n\n\t\t\t\tvar te = this.elements;\n\n\t\t\t\tz.subVectors( eye, target ).normalize();\n\n\t\t\t\tif ( z.lengthSq() === 0 ) {\n\n\t\t\t\t\tz.z = 1;\n\n\t\t\t\t}\n\n\t\t\t\tx.crossVectors( up, z ).normalize();\n\n\t\t\t\tif ( x.lengthSq() === 0 ) {\n\n\t\t\t\t\tz.z += 0.0001;\n\t\t\t\t\tx.crossVectors( up, z ).normalize();\n\n\t\t\t\t}\n\n\t\t\t\ty.crossVectors( z, x );\n\n\n\t\t\t\tte[ 0 ] = x.x; te[ 4 ] = y.x; te[ 8 ] = z.x;\n\t\t\t\tte[ 1 ] = x.y; te[ 5 ] = y.y; te[ 9 ] = z.y;\n\t\t\t\tte[ 2 ] = x.z; te[ 6 ] = y.z; te[ 10 ] = z.z;\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tmultiply: function ( m, n ) {\n\n\t\t\tif ( n !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' );\n\t\t\t\treturn this.multiplyMatrices( m, n );\n\n\t\t\t}\n\n\t\t\treturn this.multiplyMatrices( this, m );\n\n\t\t},\n\n\t\tpremultiply: function ( m ) {\n\n\t\t\treturn this.multiplyMatrices( m, this );\n\n\t\t},\n\n\t\tmultiplyMatrices: function ( a, b ) {\n\n\t\t\tvar ae = a.elements;\n\t\t\tvar be = b.elements;\n\t\t\tvar te = this.elements;\n\n\t\t\tvar a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];\n\t\t\tvar a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];\n\t\t\tvar a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];\n\t\t\tvar a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];\n\n\t\t\tvar b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];\n\t\t\tvar b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];\n\t\t\tvar b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];\n\t\t\tvar b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];\n\n\t\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\t\tte[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\t\tte[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\t\tte[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n\t\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\t\tte[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\t\tte[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\t\tte[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n\t\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\t\tte[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\t\tte[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\t\tte[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n\t\t\tte[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\t\tte[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\t\tte[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\t\tte[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiplyToArray: function ( a, b, r ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tthis.multiplyMatrices( a, b );\n\n\t\t\tr[ 0 ] = te[ 0 ]; r[ 1 ] = te[ 1 ]; r[ 2 ] = te[ 2 ]; r[ 3 ] = te[ 3 ];\n\t\t\tr[ 4 ] = te[ 4 ]; r[ 5 ] = te[ 5 ]; r[ 6 ] = te[ 6 ]; r[ 7 ] = te[ 7 ];\n\t\t\tr[ 8 ] = te[ 8 ]; r[ 9 ] = te[ 9 ]; r[ 10 ] = te[ 10 ]; r[ 11 ] = te[ 11 ];\n\t\t\tr[ 12 ] = te[ 12 ]; r[ 13 ] = te[ 13 ]; r[ 14 ] = te[ 14 ]; r[ 15 ] = te[ 15 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiplyScalar: function ( s ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tte[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;\n\t\t\tte[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;\n\t\t\tte[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;\n\t\t\tte[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyToVector3Array: function () {\n\n\t\t\tvar v1;\n\n\t\t\treturn function applyToVector3Array( array, offset, length ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\t\t\t\tif ( offset === undefined ) offset = 0;\n\t\t\t\tif ( length === undefined ) length = array.length;\n\n\t\t\t\tfor ( var i = 0, j = offset; i < length; i += 3, j += 3 ) {\n\n\t\t\t\t\tv1.fromArray( array, j );\n\t\t\t\t\tv1.applyMatrix4( this );\n\t\t\t\t\tv1.toArray( array, j );\n\n\t\t\t\t}\n\n\t\t\t\treturn array;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tapplyToBuffer: function () {\n\n\t\t\tvar v1;\n\n\t\t\treturn function applyToBuffer( buffer, offset, length ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\t\t\t\tif ( offset === undefined ) offset = 0;\n\t\t\t\tif ( length === undefined ) length = buffer.length / buffer.itemSize;\n\n\t\t\t\tfor ( var i = 0, j = offset; i < length; i ++, j ++ ) {\n\n\t\t\t\t\tv1.x = buffer.getX( j );\n\t\t\t\t\tv1.y = buffer.getY( j );\n\t\t\t\t\tv1.z = buffer.getZ( j );\n\n\t\t\t\t\tv1.applyMatrix4( this );\n\n\t\t\t\t\tbuffer.setXYZ( j, v1.x, v1.y, v1.z );\n\n\t\t\t\t}\n\n\t\t\t\treturn buffer;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tdeterminant: function () {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tvar n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];\n\t\t\tvar n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];\n\t\t\tvar n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];\n\t\t\tvar n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];\n\n\t\t\t//TODO: make this more efficient\n\t\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\t\treturn (\n\t\t\t\tn41 * (\n\t\t\t\t\t+ n14 * n23 * n32\n\t\t\t\t\t - n13 * n24 * n32\n\t\t\t\t\t - n14 * n22 * n33\n\t\t\t\t\t + n12 * n24 * n33\n\t\t\t\t\t + n13 * n22 * n34\n\t\t\t\t\t - n12 * n23 * n34\n\t\t\t\t) +\n\t\t\t\tn42 * (\n\t\t\t\t\t+ n11 * n23 * n34\n\t\t\t\t\t - n11 * n24 * n33\n\t\t\t\t\t + n14 * n21 * n33\n\t\t\t\t\t - n13 * n21 * n34\n\t\t\t\t\t + n13 * n24 * n31\n\t\t\t\t\t - n14 * n23 * n31\n\t\t\t\t) +\n\t\t\t\tn43 * (\n\t\t\t\t\t+ n11 * n24 * n32\n\t\t\t\t\t - n11 * n22 * n34\n\t\t\t\t\t - n14 * n21 * n32\n\t\t\t\t\t + n12 * n21 * n34\n\t\t\t\t\t + n14 * n22 * n31\n\t\t\t\t\t - n12 * n24 * n31\n\t\t\t\t) +\n\t\t\t\tn44 * (\n\t\t\t\t\t- n13 * n22 * n31\n\t\t\t\t\t - n11 * n23 * n32\n\t\t\t\t\t + n11 * n22 * n33\n\t\t\t\t\t + n13 * n21 * n32\n\t\t\t\t\t - n12 * n21 * n33\n\t\t\t\t\t + n12 * n23 * n31\n\t\t\t\t)\n\n\t\t\t);\n\n\t\t},\n\n\t\ttranspose: function () {\n\n\t\t\tvar te = this.elements;\n\t\t\tvar tmp;\n\n\t\t\ttmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;\n\t\t\ttmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;\n\t\t\ttmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;\n\n\t\t\ttmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;\n\t\t\ttmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;\n\t\t\ttmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tflattenToArrayOffset: function ( array, offset ) {\n\n\t\t\tconsole.warn( \"THREE.Matrix3: .flattenToArrayOffset is deprecated \" +\n\t\t\t\t\t\"- just use .toArray instead.\" );\n\n\t\t\treturn this.toArray( array, offset );\n\n\t\t},\n\n\t\tgetPosition: function () {\n\n\t\t\tvar v1;\n\n\t\t\treturn function getPosition() {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\t\t\t\tconsole.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' );\n\n\t\t\t\treturn v1.setFromMatrixColumn( this, 3 );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tsetPosition: function ( v ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tte[ 12 ] = v.x;\n\t\t\tte[ 13 ] = v.y;\n\t\t\tte[ 14 ] = v.z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetInverse: function ( m, throwOnDegenerate ) {\n\n\t\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\t\tvar te = this.elements,\n\t\t\t\tme = m.elements,\n\n\t\t\t\tn11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ],\n\t\t\t\tn12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ],\n\t\t\t\tn13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ],\n\t\t\t\tn14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ],\n\n\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n\t\t\tvar det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\n\t\t\tif ( det === 0 ) {\n\n\t\t\t\tvar msg = \"THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0\";\n\n\t\t\t\tif ( throwOnDegenerate === true ) {\n\n\t\t\t\t\tthrow new Error( msg );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( msg );\n\n\t\t\t\t}\n\n\t\t\t\treturn this.identity();\n\n\t\t\t}\n\n\t\t\tvar detInv = 1 / det;\n\n\t\t\tte[ 0 ] = t11 * detInv;\n\t\t\tte[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;\n\t\t\tte[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;\n\t\t\tte[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;\n\n\t\t\tte[ 4 ] = t12 * detInv;\n\t\t\tte[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;\n\t\t\tte[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;\n\t\t\tte[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;\n\n\t\t\tte[ 8 ] = t13 * detInv;\n\t\t\tte[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;\n\t\t\tte[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;\n\t\t\tte[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;\n\n\t\t\tte[ 12 ] = t14 * detInv;\n\t\t\tte[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;\n\t\t\tte[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;\n\t\t\tte[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tscale: function ( v ) {\n\n\t\t\tvar te = this.elements;\n\t\t\tvar x = v.x, y = v.y, z = v.z;\n\n\t\t\tte[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;\n\t\t\tte[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;\n\t\t\tte[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;\n\t\t\tte[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetMaxScaleOnAxis: function () {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tvar scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];\n\t\t\tvar scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];\n\t\t\tvar scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];\n\n\t\t\treturn Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );\n\n\t\t},\n\n\t\tmakeTranslation: function ( x, y, z ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x,\n\t\t\t\t0, 1, 0, y,\n\t\t\t\t0, 0, 1, z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeRotationX: function ( theta ) {\n\n\t\t\tvar c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, 0,\n\t\t\t\t0, c, - s, 0,\n\t\t\t\t0, s, c, 0,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeRotationY: function ( theta ) {\n\n\t\t\tvar c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\t\tthis.set(\n\n\t\t\t\t c, 0, s, 0,\n\t\t\t\t 0, 1, 0, 0,\n\t\t\t\t- s, 0, c, 0,\n\t\t\t\t 0, 0, 0, 1\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeRotationZ: function ( theta ) {\n\n\t\t\tvar c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\t\tthis.set(\n\n\t\t\t\tc, - s, 0, 0,\n\t\t\t\ts, c, 0, 0,\n\t\t\t\t0, 0, 1, 0,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeRotationAxis: function ( axis, angle ) {\n\n\t\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n\t\t\tvar c = Math.cos( angle );\n\t\t\tvar s = Math.sin( angle );\n\t\t\tvar t = 1 - c;\n\t\t\tvar x = axis.x, y = axis.y, z = axis.z;\n\t\t\tvar tx = t * x, ty = t * y;\n\n\t\t\tthis.set(\n\n\t\t\t\ttx * x + c, tx * y - s * z, tx * z + s * y, 0,\n\t\t\t\ttx * y + s * z, ty * y + c, ty * z - s * x, 0,\n\t\t\t\ttx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t\t return this;\n\n\t\t},\n\n\t\tmakeScale: function ( x, y, z ) {\n\n\t\t\tthis.set(\n\n\t\t\t\tx, 0, 0, 0,\n\t\t\t\t0, y, 0, 0,\n\t\t\t\t0, 0, z, 0,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcompose: function ( position, quaternion, scale ) {\n\n\t\t\tthis.makeRotationFromQuaternion( quaternion );\n\t\t\tthis.scale( scale );\n\t\t\tthis.setPosition( position );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdecompose: function () {\n\n\t\t\tvar vector, matrix;\n\n\t\t\treturn function decompose( position, quaternion, scale ) {\n\n\t\t\t\tif ( vector === undefined ) {\n\n\t\t\t\t\tvector = new Vector3();\n\t\t\t\t\tmatrix = new Matrix4();\n\n\t\t\t\t}\n\n\t\t\t\tvar te = this.elements;\n\n\t\t\t\tvar sx = vector.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();\n\t\t\t\tvar sy = vector.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();\n\t\t\t\tvar sz = vector.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();\n\n\t\t\t\t// if determine is negative, we need to invert one scale\n\t\t\t\tvar det = this.determinant();\n\t\t\t\tif ( det < 0 ) {\n\n\t\t\t\t\tsx = - sx;\n\n\t\t\t\t}\n\n\t\t\t\tposition.x = te[ 12 ];\n\t\t\t\tposition.y = te[ 13 ];\n\t\t\t\tposition.z = te[ 14 ];\n\n\t\t\t\t// scale the rotation part\n\n\t\t\t\tmatrix.elements.set( this.elements ); // at this point matrix is incomplete so we can't use .copy()\n\n\t\t\t\tvar invSX = 1 / sx;\n\t\t\t\tvar invSY = 1 / sy;\n\t\t\t\tvar invSZ = 1 / sz;\n\n\t\t\t\tmatrix.elements[ 0 ] *= invSX;\n\t\t\t\tmatrix.elements[ 1 ] *= invSX;\n\t\t\t\tmatrix.elements[ 2 ] *= invSX;\n\n\t\t\t\tmatrix.elements[ 4 ] *= invSY;\n\t\t\t\tmatrix.elements[ 5 ] *= invSY;\n\t\t\t\tmatrix.elements[ 6 ] *= invSY;\n\n\t\t\t\tmatrix.elements[ 8 ] *= invSZ;\n\t\t\t\tmatrix.elements[ 9 ] *= invSZ;\n\t\t\t\tmatrix.elements[ 10 ] *= invSZ;\n\n\t\t\t\tquaternion.setFromRotationMatrix( matrix );\n\n\t\t\t\tscale.x = sx;\n\t\t\t\tscale.y = sy;\n\t\t\t\tscale.z = sz;\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tmakeFrustum: function ( left, right, bottom, top, near, far ) {\n\n\t\t\tvar te = this.elements;\n\t\t\tvar x = 2 * near / ( right - left );\n\t\t\tvar y = 2 * near / ( top - bottom );\n\n\t\t\tvar a = ( right + left ) / ( right - left );\n\t\t\tvar b = ( top + bottom ) / ( top - bottom );\n\t\t\tvar c = - ( far + near ) / ( far - near );\n\t\t\tvar d = - 2 * far * near / ( far - near );\n\n\t\t\tte[ 0 ] = x;\tte[ 4 ] = 0;\tte[ 8 ] = a;\tte[ 12 ] = 0;\n\t\t\tte[ 1 ] = 0;\tte[ 5 ] = y;\tte[ 9 ] = b;\tte[ 13 ] = 0;\n\t\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = c;\tte[ 14 ] = d;\n\t\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = - 1;\tte[ 15 ] = 0;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakePerspective: function ( fov, aspect, near, far ) {\n\n\t\t\tvar ymax = near * Math.tan( _Math.DEG2RAD * fov * 0.5 );\n\t\t\tvar ymin = - ymax;\n\t\t\tvar xmin = ymin * aspect;\n\t\t\tvar xmax = ymax * aspect;\n\n\t\t\treturn this.makeFrustum( xmin, xmax, ymin, ymax, near, far );\n\n\t\t},\n\n\t\tmakeOrthographic: function ( left, right, top, bottom, near, far ) {\n\n\t\t\tvar te = this.elements;\n\t\t\tvar w = 1.0 / ( right - left );\n\t\t\tvar h = 1.0 / ( top - bottom );\n\t\t\tvar p = 1.0 / ( far - near );\n\n\t\t\tvar x = ( right + left ) * w;\n\t\t\tvar y = ( top + bottom ) * h;\n\t\t\tvar z = ( far + near ) * p;\n\n\t\t\tte[ 0 ] = 2 * w;\tte[ 4 ] = 0;\tte[ 8 ] = 0;\tte[ 12 ] = - x;\n\t\t\tte[ 1 ] = 0;\tte[ 5 ] = 2 * h;\tte[ 9 ] = 0;\tte[ 13 ] = - y;\n\t\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = - 2 * p;\tte[ 14 ] = - z;\n\t\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = 0;\tte[ 15 ] = 1;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( matrix ) {\n\n\t\t\tvar te = this.elements;\n\t\t\tvar me = matrix.elements;\n\n\t\t\tfor ( var i = 0; i < 16; i ++ ) {\n\n\t\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t},\n\n\t\tfromArray: function ( array, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tfor( var i = 0; i < 16; i ++ ) {\n\n\t\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tvar te = this.elements;\n\n\t\t\tarray[ offset ] = te[ 0 ];\n\t\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\t\tarray[ offset + 2 ] = te[ 2 ];\n\t\t\tarray[ offset + 3 ] = te[ 3 ];\n\n\t\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\t\tarray[ offset + 5 ] = te[ 5 ];\n\t\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\t\tarray[ offset + 7 ] = te[ 7 ];\n\n\t\t\tarray[ offset + 8 ] = te[ 8 ];\n\t\t\tarray[ offset + 9 ] = te[ 9 ];\n\t\t\tarray[ offset + 10 ] = te[ 10 ];\n\t\t\tarray[ offset + 11 ] = te[ 11 ];\n\n\t\t\tarray[ offset + 12 ] = te[ 12 ];\n\t\t\tarray[ offset + 13 ] = te[ 13 ];\n\t\t\tarray[ offset + 14 ] = te[ 14 ];\n\t\t\tarray[ offset + 15 ] = te[ 15 ];\n\n\t\t\treturn array;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {\n\n\t\timages = images !== undefined ? images : [];\n\t\tmapping = mapping !== undefined ? mapping : CubeReflectionMapping;\n\n\t\tTexture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );\n\n\t\tthis.flipY = false;\n\n\t}\n\n\tCubeTexture.prototype = Object.create( Texture.prototype );\n\tCubeTexture.prototype.constructor = CubeTexture;\n\n\tCubeTexture.prototype.isCubeTexture = true;\n\n\tObject.defineProperty( CubeTexture.prototype, 'images', {\n\n\t\tget: function () {\n\n\t\t\treturn this.image;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis.image = value;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author tschw\n\t *\n\t * Uniforms of a program.\n\t * Those form a tree structure with a special top-level container for the root,\n\t * which you get by calling 'new WebGLUniforms( gl, program, renderer )'.\n\t *\n\t *\n\t * Properties of inner nodes including the top-level container:\n\t *\n\t * .seq - array of nested uniforms\n\t * .map - nested uniforms by name\n\t *\n\t *\n\t * Methods of all nodes except the top-level container:\n\t *\n\t * .setValue( gl, value, [renderer] )\n\t *\n\t * \t\tuploads a uniform value(s)\n\t * \tthe 'renderer' parameter is needed for sampler uniforms\n\t *\n\t *\n\t * Static methods of the top-level container (renderer factorizations):\n\t *\n\t * .upload( gl, seq, values, renderer )\n\t *\n\t * \t\tsets uniforms in 'seq' to 'values[id].value'\n\t *\n\t * .seqWithValue( seq, values ) : filteredSeq\n\t *\n\t * \t\tfilters 'seq' entries with corresponding entry in values\n\t *\n\t *\n\t * Methods of the top-level container (renderer factorizations):\n\t *\n\t * .setValue( gl, name, value )\n\t *\n\t * \t\tsets uniform with name 'name' to 'value'\n\t *\n\t * .set( gl, obj, prop )\n\t *\n\t * \t\tsets uniform from object and property with same name than uniform\n\t *\n\t * .setOptional( gl, obj, prop )\n\t *\n\t * \t\tlike .set for an optional property of the object\n\t *\n\t */\n\n\tvar emptyTexture = new Texture();\n\tvar emptyCubeTexture = new CubeTexture();\n\n\t// --- Base for inner nodes (including the root) ---\n\n\tfunction UniformContainer() {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}\n\n\t// --- Utilities ---\n\n\t// Array Caches (provide typed arrays for temporary by size)\n\n\tvar arrayCacheF32 = [];\n\tvar arrayCacheI32 = [];\n\n\t// Flattening for arrays of vectors and matrices\n\n\tfunction flatten( array, nBlocks, blockSize ) {\n\n\t\tvar firstElem = array[ 0 ];\n\n\t\tif ( firstElem <= 0 || firstElem > 0 ) return array;\n\t\t// unoptimized: ! isNaN( firstElem )\n\t\t// see http://jacksondunstan.com/articles/983\n\n\t\tvar n = nBlocks * blockSize,\n\t\t\tr = arrayCacheF32[ n ];\n\n\t\tif ( r === undefined ) {\n\n\t\t\tr = new Float32Array( n );\n\t\t\tarrayCacheF32[ n ] = r;\n\n\t\t}\n\n\t\tif ( nBlocks !== 0 ) {\n\n\t\t\tfirstElem.toArray( r, 0 );\n\n\t\t\tfor ( var i = 1, offset = 0; i !== nBlocks; ++ i ) {\n\n\t\t\t\toffset += blockSize;\n\t\t\t\tarray[ i ].toArray( r, offset );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn r;\n\n\t}\n\n\t// Texture unit allocation\n\n\tfunction allocTexUnits( renderer, n ) {\n\n\t\tvar r = arrayCacheI32[ n ];\n\n\t\tif ( r === undefined ) {\n\n\t\t\tr = new Int32Array( n );\n\t\t\tarrayCacheI32[ n ] = r;\n\n\t\t}\n\n\t\tfor ( var i = 0; i !== n; ++ i )\n\t\t\tr[ i ] = renderer.allocTextureUnit();\n\n\t\treturn r;\n\n\t}\n\n\t// --- Setters ---\n\n\t// Note: Defining these methods externally, because they come in a bunch\n\t// and this way their names minify.\n\n\t// Single scalar\n\n\tfunction setValue1f( gl, v ) { gl.uniform1f( this.addr, v ); }\n\tfunction setValue1i( gl, v ) { gl.uniform1i( this.addr, v ); }\n\n\t// Single float vector (from flat array or THREE.VectorN)\n\n\tfunction setValue2fv( gl, v ) {\n\n\t\tif ( v.x === undefined ) gl.uniform2fv( this.addr, v );\n\t\telse gl.uniform2f( this.addr, v.x, v.y );\n\n\t}\n\n\tfunction setValue3fv( gl, v ) {\n\n\t\tif ( v.x !== undefined )\n\t\t\tgl.uniform3f( this.addr, v.x, v.y, v.z );\n\t\telse if ( v.r !== undefined )\n\t\t\tgl.uniform3f( this.addr, v.r, v.g, v.b );\n\t\telse\n\t\t\tgl.uniform3fv( this.addr, v );\n\n\t}\n\n\tfunction setValue4fv( gl, v ) {\n\n\t\tif ( v.x === undefined ) gl.uniform4fv( this.addr, v );\n\t\telse gl.uniform4f( this.addr, v.x, v.y, v.z, v.w );\n\n\t}\n\n\t// Single matrix (from flat array or MatrixN)\n\n\tfunction setValue2fm( gl, v ) {\n\n\t\tgl.uniformMatrix2fv( this.addr, false, v.elements || v );\n\n\t}\n\n\tfunction setValue3fm( gl, v ) {\n\n\t\tgl.uniformMatrix3fv( this.addr, false, v.elements || v );\n\n\t}\n\n\tfunction setValue4fm( gl, v ) {\n\n\t\tgl.uniformMatrix4fv( this.addr, false, v.elements || v );\n\n\t}\n\n\t// Single texture (2D / Cube)\n\n\tfunction setValueT1( gl, v, renderer ) {\n\n\t\tvar unit = renderer.allocTextureUnit();\n\t\tgl.uniform1i( this.addr, unit );\n\t\trenderer.setTexture2D( v || emptyTexture, unit );\n\n\t}\n\n\tfunction setValueT6( gl, v, renderer ) {\n\n\t\tvar unit = renderer.allocTextureUnit();\n\t\tgl.uniform1i( this.addr, unit );\n\t\trenderer.setTextureCube( v || emptyCubeTexture, unit );\n\n\t}\n\n\t// Integer / Boolean vectors or arrays thereof (always flat arrays)\n\n\tfunction setValue2iv( gl, v ) { gl.uniform2iv( this.addr, v ); }\n\tfunction setValue3iv( gl, v ) { gl.uniform3iv( this.addr, v ); }\n\tfunction setValue4iv( gl, v ) { gl.uniform4iv( this.addr, v ); }\n\n\t// Helper to pick the right setter for the singular case\n\n\tfunction getSingularSetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1f; // FLOAT\n\t\t\tcase 0x8b50: return setValue2fv; // _VEC2\n\t\t\tcase 0x8b51: return setValue3fv; // _VEC3\n\t\t\tcase 0x8b52: return setValue4fv; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValue2fm; // _MAT2\n\t\t\tcase 0x8b5b: return setValue3fm; // _MAT3\n\t\t\tcase 0x8b5c: return setValue4fm; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1i; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}\n\n\t// Array of scalars\n\n\tfunction setValue1fv( gl, v ) { gl.uniform1fv( this.addr, v ); }\n\tfunction setValue1iv( gl, v ) { gl.uniform1iv( this.addr, v ); }\n\n\t// Array of vectors (flat or from THREE classes)\n\n\tfunction setValueV2a( gl, v ) {\n\n\t\tgl.uniform2fv( this.addr, flatten( v, this.size, 2 ) );\n\n\t}\n\n\tfunction setValueV3a( gl, v ) {\n\n\t\tgl.uniform3fv( this.addr, flatten( v, this.size, 3 ) );\n\n\t}\n\n\tfunction setValueV4a( gl, v ) {\n\n\t\tgl.uniform4fv( this.addr, flatten( v, this.size, 4 ) );\n\n\t}\n\n\t// Array of matrices (flat or from THREE clases)\n\n\tfunction setValueM2a( gl, v ) {\n\n\t\tgl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );\n\n\t}\n\n\tfunction setValueM3a( gl, v ) {\n\n\t\tgl.uniformMatrix3fv( this.addr, false, flatten( v, this.size, 9 ) );\n\n\t}\n\n\tfunction setValueM4a( gl, v ) {\n\n\t\tgl.uniformMatrix4fv( this.addr, false, flatten( v, this.size, 16 ) );\n\n\t}\n\n\t// Array of textures (2D / Cube)\n\n\tfunction setValueT1a( gl, v, renderer ) {\n\n\t\tvar n = v.length,\n\t\t\tunits = allocTexUnits( renderer, n );\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tfor ( var i = 0; i !== n; ++ i ) {\n\n\t\t\trenderer.setTexture2D( v[ i ] || emptyTexture, units[ i ] );\n\n\t\t}\n\n\t}\n\n\tfunction setValueT6a( gl, v, renderer ) {\n\n\t\tvar n = v.length,\n\t\t\tunits = allocTexUnits( renderer, n );\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tfor ( var i = 0; i !== n; ++ i ) {\n\n\t\t\trenderer.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );\n\n\t\t}\n\n\t}\n\n\t// Helper to pick the right setter for a pure (bottom-level) array\n\n\tfunction getPureArraySetter( type ) {\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 0x1406: return setValue1fv; // FLOAT\n\t\t\tcase 0x8b50: return setValueV2a; // _VEC2\n\t\t\tcase 0x8b51: return setValueV3a; // _VEC3\n\t\t\tcase 0x8b52: return setValueV4a; // _VEC4\n\n\t\t\tcase 0x8b5a: return setValueM2a; // _MAT2\n\t\t\tcase 0x8b5b: return setValueM3a; // _MAT3\n\t\t\tcase 0x8b5c: return setValueM4a; // _MAT4\n\n\t\t\tcase 0x8b5e: return setValueT1a; // SAMPLER_2D\n\t\t\tcase 0x8b60: return setValueT6a; // SAMPLER_CUBE\n\n\t\t\tcase 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL\n\t\t\tcase 0x8b53: case 0x8b57: return setValue2iv; // _VEC2\n\t\t\tcase 0x8b54: case 0x8b58: return setValue3iv; // _VEC3\n\t\t\tcase 0x8b55: case 0x8b59: return setValue4iv; // _VEC4\n\n\t\t}\n\n\t}\n\n\t// --- Uniform Classes ---\n\n\tfunction SingleUniform( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.setValue = getSingularSetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n\tfunction PureArrayUniform( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.size = activeInfo.size;\n\t\tthis.setValue = getPureArraySetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n\tfunction StructuredUniform( id ) {\n\n\t\tthis.id = id;\n\n\t\tUniformContainer.call( this ); // mix-in\n\n\t}\n\n\tStructuredUniform.prototype.setValue = function( gl, value ) {\n\n\t\t// Note: Don't need an extra 'renderer' parameter, since samplers\n\t\t// are not allowed in structured uniforms.\n\n\t\tvar seq = this.seq;\n\n\t\tfor ( var i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tvar u = seq[ i ];\n\t\t\tu.setValue( gl, value[ u.id ] );\n\n\t\t}\n\n\t};\n\n\t// --- Top-level ---\n\n\t// Parser - builds up the property tree from the path strings\n\n\tvar RePathPart = /([\\w\\d_]+)(\\])?(\\[|\\.)?/g;\n\n\t// extracts\n\t// \t- the identifier (member name or array index)\n\t// - followed by an optional right bracket (found when array index)\n\t// - followed by an optional left bracket or dot (type of subscript)\n\t//\n\t// Note: These portions can be read in a non-overlapping fashion and\n\t// allow straightforward parsing of the hierarchy that WebGL encodes\n\t// in the uniform names.\n\n\tfunction addUniform( container, uniformObject ) {\n\n\t\tcontainer.seq.push( uniformObject );\n\t\tcontainer.map[ uniformObject.id ] = uniformObject;\n\n\t}\n\n\tfunction parseUniform( activeInfo, addr, container ) {\n\n\t\tvar path = activeInfo.name,\n\t\t\tpathLength = path.length;\n\n\t\t// reset RegExp object, because of the early exit of a previous run\n\t\tRePathPart.lastIndex = 0;\n\n\t\tfor (; ;) {\n\n\t\t\tvar match = RePathPart.exec( path ),\n\t\t\t\tmatchEnd = RePathPart.lastIndex,\n\n\t\t\t\tid = match[ 1 ],\n\t\t\t\tidIsIndex = match[ 2 ] === ']',\n\t\t\t\tsubscript = match[ 3 ];\n\n\t\t\tif ( idIsIndex ) id = id | 0; // convert to integer\n\n\t\t\tif ( subscript === undefined ||\n\t\t\t\t\tsubscript === '[' && matchEnd + 2 === pathLength ) {\n\t\t\t\t// bare name or \"pure\" bottom-level array \"[0]\" suffix\n\n\t\t\t\taddUniform( container, subscript === undefined ?\n\t\t\t\t\t\tnew SingleUniform( id, activeInfo, addr ) :\n\t\t\t\t\t\tnew PureArrayUniform( id, activeInfo, addr ) );\n\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\t// step into inner node / create it in case it doesn't exist\n\n\t\t\t\tvar map = container.map,\n\t\t\t\t\tnext = map[ id ];\n\n\t\t\t\tif ( next === undefined ) {\n\n\t\t\t\t\tnext = new StructuredUniform( id );\n\t\t\t\t\taddUniform( container, next );\n\n\t\t\t\t}\n\n\t\t\t\tcontainer = next;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// Root Container\n\n\tfunction WebGLUniforms( gl, program, renderer ) {\n\n\t\tUniformContainer.call( this );\n\n\t\tthis.renderer = renderer;\n\n\t\tvar n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS );\n\n\t\tfor ( var i = 0; i !== n; ++ i ) {\n\n\t\t\tvar info = gl.getActiveUniform( program, i ),\n\t\t\t\tpath = info.name,\n\t\t\t\taddr = gl.getUniformLocation( program, path );\n\n\t\t\tparseUniform( info, addr, this );\n\n\t\t}\n\n\t}\n\n\tWebGLUniforms.prototype.setValue = function( gl, name, value ) {\n\n\t\tvar u = this.map[ name ];\n\n\t\tif ( u !== undefined ) u.setValue( gl, value, this.renderer );\n\n\t};\n\n\tWebGLUniforms.prototype.set = function( gl, object, name ) {\n\n\t\tvar u = this.map[ name ];\n\n\t\tif ( u !== undefined ) u.setValue( gl, object[ name ], this.renderer );\n\n\t};\n\n\tWebGLUniforms.prototype.setOptional = function( gl, object, name ) {\n\n\t\tvar v = object[ name ];\n\n\t\tif ( v !== undefined ) this.setValue( gl, name, v );\n\n\t};\n\n\n\t// Static interface\n\n\tWebGLUniforms.upload = function( gl, seq, values, renderer ) {\n\n\t\tfor ( var i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tvar u = seq[ i ],\n\t\t\t\tv = values[ u.id ];\n\n\t\t\tif ( v.needsUpdate !== false ) {\n\t\t\t\t// note: always updating when .needsUpdate is undefined\n\n\t\t\t\tu.setValue( gl, v.value, renderer );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tWebGLUniforms.seqWithValue = function( seq, values ) {\n\n\t\tvar r = [];\n\n\t\tfor ( var i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tvar u = seq[ i ];\n\t\t\tif ( u.id in values ) r.push( u );\n\n\t\t}\n\n\t\treturn r;\n\n\t};\n\n\t/**\n\t * Uniform Utilities\n\t */\n\n\tvar UniformsUtils = {\n\n\t\tmerge: function ( uniforms ) {\n\n\t\t\tvar merged = {};\n\n\t\t\tfor ( var u = 0; u < uniforms.length; u ++ ) {\n\n\t\t\t\tvar tmp = this.clone( uniforms[ u ] );\n\n\t\t\t\tfor ( var p in tmp ) {\n\n\t\t\t\t\tmerged[ p ] = tmp[ p ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn merged;\n\n\t\t},\n\n\t\tclone: function ( uniforms_src ) {\n\n\t\t\tvar uniforms_dst = {};\n\n\t\t\tfor ( var u in uniforms_src ) {\n\n\t\t\t\tuniforms_dst[ u ] = {};\n\n\t\t\t\tfor ( var p in uniforms_src[ u ] ) {\n\n\t\t\t\t\tvar parameter_src = uniforms_src[ u ][ p ];\n\n\t\t\t\t\tif ( parameter_src && ( parameter_src.isColor ||\n\t\t\t\t\t\tparameter_src.isMatrix3 || parameter_src.isMatrix4 ||\n\t\t\t\t\t\tparameter_src.isVector2 || parameter_src.isVector3 || parameter_src.isVector4 ||\n\t\t\t\t\t\tparameter_src.isTexture ) ) {\n\n\t\t\t\t\t\tuniforms_dst[ u ][ p ] = parameter_src.clone();\n\n\t\t\t\t\t} else if ( Array.isArray( parameter_src ) ) {\n\n\t\t\t\t\t\tuniforms_dst[ u ][ p ] = parameter_src.slice();\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuniforms_dst[ u ][ p ] = parameter_src;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn uniforms_dst;\n\n\t\t}\n\n\t};\n\n\tvar alphamap_fragment = \"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\\n\";\n\n\tvar alphamap_pars_fragment = \"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\\n\";\n\n\tvar alphatest_fragment = \"#ifdef ALPHATEST\\n\\tif ( diffuseColor.a < ALPHATEST ) discard;\\n#endif\\n\";\n\n\tvar aomap_fragment = \"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\\n\\t#endif\\n#endif\\n\";\n\n\tvar aomap_pars_fragment = \"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";\n\n\tvar begin_vertex = \"\\nvec3 transformed = vec3( position );\\n\";\n\n\tvar beginnormal_vertex = \"\\nvec3 objectNormal = vec3( normal );\\n\";\n\n\tvar bsdfs = \"bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\\n\\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\\n}\\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\t\\tif( decayExponent > 0.0 ) {\\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\t\\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\t\\treturn distanceFalloff * maxDistanceCutoffFactor;\\n#else\\n\\t\\t\\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n#endif\\n\\t\\t}\\n\\t\\treturn 1.0;\\n}\\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\\n\\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\\n\\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\\n}\\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\treturn 1.0 / ( gl * gv );\\n}\\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\\n\\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\\n\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\\n\\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, dotLH );\\n\\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\n\\treturn F * ( G * D );\\n}\\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\\n\\treturn specularColor * AB.x + AB.y;\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\\n\\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\\n\\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, dotLH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n}\\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\\n\\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\\n}\\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\\n\\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\\n}\\n\";\n\n\tvar bumpmap_pars_fragment = \"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\\n\\t\\treturn vec2( dBx, dBy );\\n\\t}\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\\n\\t\\tvec3 vSigmaX = dFdx( surf_pos );\\n\\t\\tvec3 vSigmaY = dFdy( surf_pos );\\n\\t\\tvec3 vN = surf_norm;\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\t\\tfloat fDet = dot( vSigmaX, R1 );\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\t}\\n#endif\\n\";\n\n\tvar clipping_planes_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\\n\\t\\tvec4 plane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t\\t\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\\n\\t\\t\\tvec4 plane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\tif ( clipped ) discard;\\n\\t\\n\\t#endif\\n#endif\\n\";\n\n\tvar clipping_planes_pars_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\t\\tvarying vec3 vViewPosition;\\n\\t#endif\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\\n\";\n\n\tvar clipping_planes_pars_vertex = \"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n\";\n\n\tvar clipping_planes_vertex = \"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n\";\n\n\tvar color_fragment = \"#ifdef USE_COLOR\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";\n\n\tvar color_pars_fragment = \"#ifdef USE_COLOR\\n\\tvarying vec3 vColor;\\n#endif\\n\";\n\n\tvar color_pars_vertex = \"#ifdef USE_COLOR\\n\\tvarying vec3 vColor;\\n#endif\";\n\n\tvar color_vertex = \"#ifdef USE_COLOR\\n\\tvColor.xyz = color.xyz;\\n#endif\";\n\n\tvar common = \"#define PI 3.14159265359\\n#define PI2 6.28318530718\\n#define RECIPROCAL_PI 0.31830988618\\n#define RECIPROCAL_PI2 0.15915494\\n#define LOG2 1.442695\\n#define EPSILON 1e-6\\n#define saturate(a) clamp( a, 0.0, 1.0 )\\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract(sin(sn) * c);\\n}\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n};\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\tfloat distance = dot( planeNormal, point - pointOnPlane );\\n\\treturn - distance * planeNormal + point;\\n}\\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\treturn sign( dot( point - pointOnPlane, planeNormal ) );\\n}\\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\\n\\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\\n}\\n\";\n\n\tvar cube_uv_reflection_fragment = \"#ifdef ENVMAP_TYPE_CUBE_UV\\n#define cubeUV_textureSize (1024.0)\\nint getFaceFromDirection(vec3 direction) {\\n\\tvec3 absDirection = abs(direction);\\n\\tint face = -1;\\n\\tif( absDirection.x > absDirection.z ) {\\n\\t\\tif(absDirection.x > absDirection.y )\\n\\t\\t\\tface = direction.x > 0.0 ? 0 : 3;\\n\\t\\telse\\n\\t\\t\\tface = direction.y > 0.0 ? 1 : 4;\\n\\t}\\n\\telse {\\n\\t\\tif(absDirection.z > absDirection.y )\\n\\t\\t\\tface = direction.z > 0.0 ? 2 : 5;\\n\\t\\telse\\n\\t\\t\\tface = direction.y > 0.0 ? 1 : 4;\\n\\t}\\n\\treturn face;\\n}\\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\\n\\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\\n\\tfloat dxRoughness = dFdx(roughness);\\n\\tfloat dyRoughness = dFdy(roughness);\\n\\tvec3 dx = dFdx( vec * scale * dxRoughness );\\n\\tvec3 dy = dFdy( vec * scale * dyRoughness );\\n\\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\\n\\td = clamp(d, 1.0, cubeUV_rangeClamp);\\n\\tfloat mipLevel = 0.5 * log2(d);\\n\\treturn vec2(floor(mipLevel), fract(mipLevel));\\n}\\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\\n\\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\\n\\tfloat a = 16.0 * cubeUV_rcpTextureSize;\\n\\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\\n\\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\\n\\tfloat powScale = exp2_packed.x * exp2_packed.y;\\n\\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\\n\\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\\n\\tbool bRes = mipLevel == 0.0;\\n\\tscale = bRes && (scale < a) ? a : scale;\\n\\tvec3 r;\\n\\tvec2 offset;\\n\\tint face = getFaceFromDirection(direction);\\n\\tfloat rcpPowScale = 1.0 / powScale;\\n\\tif( face == 0) {\\n\\t\\tr = vec3(direction.x, -direction.z, direction.y);\\n\\t\\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 1) {\\n\\t\\tr = vec3(direction.y, direction.x, direction.z);\\n\\t\\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 2) {\\n\\t\\tr = vec3(direction.z, direction.x, direction.y);\\n\\t\\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\\n\\t}\\n\\telse if( face == 3) {\\n\\t\\tr = vec3(direction.x, direction.z, direction.y);\\n\\t\\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\telse if( face == 4) {\\n\\t\\tr = vec3(direction.y, direction.x, -direction.z);\\n\\t\\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\telse {\\n\\t\\tr = vec3(direction.z, -direction.x, direction.y);\\n\\t\\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\\n\\t\\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\\n\\t}\\n\\tr = normalize(r);\\n\\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\\n\\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\\n\\tvec2 base = offset + vec2( texelOffset );\\n\\treturn base + s * ( scale - 2.0 * texelOffset );\\n}\\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\\n\\tfloat roughnessVal = roughness* cubeUV_maxLods3;\\n\\tfloat r1 = floor(roughnessVal);\\n\\tfloat r2 = r1 + 1.0;\\n\\tfloat t = fract(roughnessVal);\\n\\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\\n\\tfloat s = mipInfo.y;\\n\\tfloat level0 = mipInfo.x;\\n\\tfloat level1 = level0 + 1.0;\\n\\tlevel1 = level1 > 5.0 ? 5.0 : level1;\\n\\tlevel0 += min( floor( s + 0.5 ), 5.0 );\\n\\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\\n\\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\\n\\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\\n\\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\\n\\tvec4 result = mix(color10, color20, t);\\n\\treturn vec4(result.rgb, 1.0);\\n}\\n#endif\\n\";\n\n\tvar defaultnormal_vertex = \"#ifdef FLIP_SIDED\\n\\tobjectNormal = -objectNormal;\\n#endif\\nvec3 transformedNormal = normalMatrix * objectNormal;\\n\";\n\n\tvar displacementmap_pars_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\\n\";\n\n\tvar displacementmap_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\\n#endif\\n\";\n\n\tvar emissivemap_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\\n\";\n\n\tvar emissivemap_pars_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\\n\";\n\n\tvar encodings_fragment = \" gl_FragColor = linearToOutputTexel( gl_FragColor );\\n\";\n\n\tvar encodings_pars_fragment = \"\\nvec4 LinearToLinear( in vec4 value ) {\\n return value;\\n}\\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\\n}\\nvec4 sRGBToLinear( in vec4 value ) {\\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\\n}\\nvec4 LinearTosRGB( in vec4 value ) {\\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\\n}\\nvec4 RGBEToLinear( in vec4 value ) {\\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\n}\\nvec4 LinearToRGBE( in vec4 value ) {\\n float maxComponent = max( max( value.r, value.g ), value.b );\\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\\n}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n return vec4( value.xyz * value.w * maxRange, 1.0 );\\n}\\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\\n float maxRGB = max( value.x, max( value.g, value.b ) );\\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\\n M = ceil( M * 255.0 ) / 255.0;\\n return vec4( value.rgb / ( M * maxRange ), M );\\n}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\n}\\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\\n float maxRGB = max( value.x, max( value.g, value.b ) );\\n float D = max( maxRange / maxRGB, 1.0 );\\n D = min( floor( D ) / 255.0, 1.0 );\\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\\n}\\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\\nvec4 LinearToLogLuv( in vec4 value ) {\\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\\n vec4 vResult;\\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\\n vResult.w = fract(Le);\\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\\n return vResult;\\n}\\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\\nvec4 LogLuvToLinear( in vec4 value ) {\\n float Le = value.z * 255.0 + value.w;\\n vec3 Xp_Y_XYZp;\\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\\n return vec4( max(vRGB, 0.0), 1.0 );\\n}\\n\";\n\n\tvar envmap_fragment = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\\t\\tvec2 sampleUV;\\n\\t\\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\\n\\t\\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\\t\\tvec4 envColor = texture2D( envMap, sampleUV );\\n\\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\\t\\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\\n\\t\\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\tenvColor = envMapTexelToLinear( envColor );\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\\n\";\n\n\tvar envmap_pars_fragment = \"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\\n\\tuniform float reflectivity;\\n\\tuniform float envMapIntenstiy;\\n#endif\\n#ifdef USE_ENVMAP\\n\\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\tuniform float flipEnvMap;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\\n\";\n\n\tvar envmap_pars_vertex = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\\n\";\n\n\tvar envmap_vertex = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\n\";\n\n\tvar fog_fragment = \"#ifdef USE_FOG\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\\n\\t#else\\n\\t\\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\n\\t#endif\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\\n\";\n\n\tvar fog_pars_fragment = \"#ifdef USE_FOG\\n\\tuniform vec3 fogColor;\\n\\t#ifdef FOG_EXP2\\n\\t\\tuniform float fogDensity;\\n\\t#else\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n#endif\";\n\n\tvar lightmap_fragment = \"#ifdef USE_LIGHTMAP\\n\\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n#endif\\n\";\n\n\tvar lightmap_pars_fragment = \"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";\n\n\tvar lights_lambert_vertex = \"vec3 diffuse = vec3( 1.0 );\\nGeometricContext geometry;\\ngeometry.position = mvPosition.xyz;\\ngeometry.normal = normalize( transformedNormal );\\ngeometry.viewDir = normalize( -mvPosition.xyz );\\nGeometricContext backGeometry;\\nbackGeometry.position = geometry.position;\\nbackGeometry.normal = -geometry.normal;\\nbackGeometry.viewDir = geometry.viewDir;\\nvLightFront = vec3( 0.0 );\\n#ifdef DOUBLE_SIDED\\n\\tvLightBack = vec3( 0.0 );\\n#endif\\nIncidentLight directLight;\\nfloat dotNL;\\nvec3 directLightColor_Diffuse;\\n#if NUM_POINT_LIGHTS > 0\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_DIR_LIGHTS > 0\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = PI * directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\";\n\n\tvar lights_pars = \"uniform vec3 ambientLightColor;\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\treturn irradiance;\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\\n\\t\\tdirectLight.color = directionalLight.color;\\n\\t\\tdirectLight.direction = directionalLight.direction;\\n\\t\\tdirectLight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\n\\t\\tdirectLight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\\n\\t\\t\\tdirectLight.color = pointLight.color;\\n\\t\\t\\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\t\\tdirectLight.visible = true;\\n\\t\\t} else {\\n\\t\\t\\tdirectLight.color = vec3( 0.0 );\\n\\t\\t\\tdirectLight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t\\tint shadow;\\n\\t\\tfloat shadowBias;\\n\\t\\tfloat shadowRadius;\\n\\t\\tvec2 shadowMapSize;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\n\\t\\tdirectLight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tfloat angleCos = dot( directLight.direction, spotLight.direction );\\n\\t\\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\\n\\t\\t\\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\t\\tdirectLight.color = spotLight.color;\\n\\t\\t\\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tdirectLight.visible = true;\\n\\t\\t} else {\\n\\t\\t\\tdirectLight.color = vec3( 0.0 );\\n\\t\\t\\tdirectLight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\\n\\t\\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tirradiance *= PI;\\n\\t\\t#endif\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\\n\\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\\n\\t\\t#include \\n\\t\\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\t\\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\\n\\t\\t#else\\n\\t\\t\\tvec4 envMapColor = vec4( 0.0 );\\n\\t\\t#endif\\n\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t}\\n\\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\\n\\t\\tfloat maxMIPLevelScalar = float( maxMIPLevel );\\n\\t\\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\\n\\t\\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\\n\\t}\\n\\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\\n\\t\\t#endif\\n\\t\\t#include \\n\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\t\\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\\n\\t\\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\\t\\t\\tvec2 sampleUV;\\n\\t\\t\\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\\n\\t\\t\\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\\t\\t\\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\\n\\t\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\t\\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\\n\\t\\t\\t#endif\\n\\t\\t\\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\\n\\t\\t#endif\\n\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t}\\n#endif\\n\";\n\n\tvar lights_phong_fragment = \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\\n\";\n\n\tvar lights_phong_pars_fragment = \"varying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\nstruct BlinnPhongMaterial {\\n\\tvec3\\tdiffuseColor;\\n\\tvec3\\tspecularColor;\\n\\tfloat\\tspecularShininess;\\n\\tfloat\\tspecularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\\n#define Material_LightProbeLOD( material )\\t(0)\\n\";\n\n\tvar lights_physical_fragment = \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\\n#ifdef STANDARD\\n\\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.clearCoat = saturate( clearCoat );\\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\\n#endif\\n\";\n\n\tvar lights_physical_pars_fragment = \"struct PhysicalMaterial {\\n\\tvec3\\tdiffuseColor;\\n\\tfloat\\tspecularRoughness;\\n\\tvec3\\tspecularColor;\\n\\t#ifndef STANDARD\\n\\t\\tfloat clearCoat;\\n\\t\\tfloat clearCoatRoughness;\\n\\t#endif\\n};\\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\\n\\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\\n}\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tirradiance *= PI;\\n\\t#endif\\n\\t#ifndef STANDARD\\n\\t\\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\\n\\t#else\\n\\t\\tfloat clearCoatDHR = 0.0;\\n\\t#endif\\n\\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\\n\\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n\\t#ifndef STANDARD\\n\\t\\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\\n\\t#endif\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t#ifndef STANDARD\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\tfloat dotNL = dotNV;\\n\\t\\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\\n\\t#else\\n\\t\\tfloat clearCoatDHR = 0.0;\\n\\t#endif\\n\\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\\n\\t#ifndef STANDARD\\n\\t\\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\\n\\t#endif\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\\n\";\n\n\tvar lights_template = \"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = normalize( vViewPosition );\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\\n\\t\\t#ifdef USE_SHADOWMAP\\n\\t\\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tlightMapIrradiance *= PI;\\n\\t\\t#endif\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\\n\\t\\t}\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t \\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\\n\\t#endif\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\\n\\t#ifndef STANDARD\\n\\t\\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\\n\\t#else\\n\\t\\tvec3 clearCoatRadiance = vec3( 0.0 );\\n\\t#endif\\n\\t\\t\\n\\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\\n#endif\\n\";\n\n\tvar logdepthbuf_fragment = \"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\\n\\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\\n#endif\";\n\n\tvar logdepthbuf_pars_fragment = \"#ifdef USE_LOGDEPTHBUF\\n\\tuniform float logDepthBufFC;\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t#endif\\n#endif\\n\";\n\n\tvar logdepthbuf_pars_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t#endif\\n\\tuniform float logDepthBufFC;\\n#endif\";\n\n\tvar logdepthbuf_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t#else\\n\\t\\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\\n\\t#endif\\n#endif\\n\";\n\n\tvar map_fragment = \"#ifdef USE_MAP\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\ttexelColor = mapTexelToLinear( texelColor );\\n\\tdiffuseColor *= texelColor;\\n#endif\\n\";\n\n\tvar map_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n\";\n\n\tvar map_particle_fragment = \"#ifdef USE_MAP\\n\\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\\n\\tdiffuseColor *= mapTexelToLinear( mapTexel );\\n#endif\\n\";\n\n\tvar map_particle_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform vec4 offsetRepeat;\\n\\tuniform sampler2D map;\\n#endif\\n\";\n\n\tvar metalnessmap_fragment = \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.r;\\n#endif\\n\";\n\n\tvar metalnessmap_pars_fragment = \"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";\n\n\tvar morphnormal_vertex = \"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\\n\\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\\n\\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\\n\\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\\n#endif\\n\";\n\n\tvar morphtarget_pars_vertex = \"#ifdef USE_MORPHTARGETS\\n\\t#ifndef USE_MORPHNORMALS\\n\\tuniform float morphTargetInfluences[ 8 ];\\n\\t#else\\n\\tuniform float morphTargetInfluences[ 4 ];\\n\\t#endif\\n#endif\";\n\n\tvar morphtarget_vertex = \"#ifdef USE_MORPHTARGETS\\n\\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\\n\\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\\n\\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\\n\\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\\n\\t#ifndef USE_MORPHNORMALS\\n\\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\\n\\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\\n\\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\\n\\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\\n\\t#endif\\n#endif\\n\";\n\n\tvar normal_flip = \"#ifdef DOUBLE_SIDED\\n\\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\\n#else\\n\\tfloat flipNormal = 1.0;\\n#endif\\n\";\n\n\tvar normal_fragment = \"#ifdef FLAT_SHADED\\n\\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\\n\\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\\n\\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\\tvec3 normal = normalize( vNormal ) * flipNormal;\\n#endif\\n#ifdef USE_NORMALMAP\\n\\tnormal = perturbNormal2Arb( -vViewPosition, normal );\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\\n#endif\\n\";\n\n\tvar normalmap_pars_fragment = \"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\\n\\t\\tvec3 q0 = dFdx( eye_pos.xyz );\\n\\t\\tvec3 q1 = dFdy( eye_pos.xyz );\\n\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\t\\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\\n\\t\\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\\n\\t\\tvec3 N = normalize( surf_norm );\\n\\t\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t\\tmapN.xy = normalScale * mapN.xy;\\n\\t\\tmat3 tsn = mat3( S, T, N );\\n\\t\\treturn normalize( tsn * mapN );\\n\\t}\\n#endif\\n\";\n\n\tvar packing = \"vec3 packNormalToRGB( const in vec3 normal ) {\\n return normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n return 1.0 - 2.0 * rgb.xyz;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n return ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n return linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\\n\";\n\n\tvar premultiplied_alpha_fragment = \"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\\n\";\n\n\tvar project_vertex = \"#ifdef USE_SKINNING\\n\\tvec4 mvPosition = modelViewMatrix * skinned;\\n#else\\n\\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\\n#endif\\ngl_Position = projectionMatrix * mvPosition;\\n\";\n\n\tvar roughnessmap_fragment = \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.r;\\n#endif\\n\";\n\n\tvar roughnessmap_pars_fragment = \"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";\n\n\tvar shadowmap_pars_fragment = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\\n\\t\\tconst vec2 offset = vec2( 0.0, 1.0 );\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / size;\\n\\t\\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\\n\\t\\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\\n\\t\\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\\n\\t\\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\\n\\t\\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\\n\\t\\tvec2 f = fract( uv * size + 0.5 );\\n\\t\\tfloat a = mix( lb, lt, f.y );\\n\\t\\tfloat b = mix( rb, rt, f.y );\\n\\t\\tfloat c = mix( a, b, f.x );\\n\\t\\treturn c;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn 1.0;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\\n\";\n\n\tvar shadowmap_pars_vertex = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\t\\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\\n\\t#endif\\n#endif\\n\";\n\n\tvar shadowmap_vertex = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\\n\\t}\\n\\t#endif\\n#endif\\n\";\n\n\tvar shadowmask_pars_fragment = \"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHTS > 0\\n\\tDirectionalLight directionalLight;\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHTS > 0\\n\\tSpotLight spotLight;\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#if NUM_POINT_LIGHTS > 0\\n\\tPointLight pointLight;\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\\n\";\n\n\tvar skinbase_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\";\n\n\tvar skinning_pars_vertex = \"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\t#ifdef BONE_TEXTURE\\n\\t\\tuniform sampler2D boneTexture;\\n\\t\\tuniform int boneTextureWidth;\\n\\t\\tuniform int boneTextureHeight;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureWidth ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureWidth ) );\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureWidth );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureHeight );\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#else\\n\\t\\tuniform mat4 boneMatrices[ MAX_BONES ];\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tmat4 bone = boneMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#endif\\n#endif\\n\";\n\n\tvar skinning_vertex = \"#ifdef USE_SKINNING\\n\\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\tskinned = bindMatrixInverse * skinned;\\n#endif\\n\";\n\n\tvar skinnormal_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n#endif\\n\";\n\n\tvar specularmap_fragment = \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\";\n\n\tvar specularmap_pars_fragment = \"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";\n\n\tvar tonemapping_fragment = \"#if defined( TONE_MAPPING )\\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\\n\";\n\n\tvar tonemapping_pars_fragment = \"#define saturate(a) clamp( a, 0.0, 1.0 )\\nuniform float toneMappingExposure;\\nuniform float toneMappingWhitePoint;\\nvec3 LinearToneMapping( vec3 color ) {\\n return toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n color *= toneMappingExposure;\\n return saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\\nvec3 Uncharted2ToneMapping( vec3 color ) {\\n color *= toneMappingExposure;\\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n color *= toneMappingExposure;\\n color = max( vec3( 0.0 ), color - 0.004 );\\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\n\";\n\n\tvar uv_pars_fragment = \"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvarying vec2 vUv;\\n#endif\";\n\n\tvar uv_pars_vertex = \"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvarying vec2 vUv;\\n\\tuniform vec4 offsetRepeat;\\n#endif\\n\";\n\n\tvar uv_vertex = \"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\\n\\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\\n#endif\";\n\n\tvar uv2_pars_fragment = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\";\n\n\tvar uv2_pars_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n#endif\";\n\n\tvar uv2_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = uv2;\\n#endif\";\n\n\tvar worldpos_vertex = \"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\\n\\t#ifdef USE_SKINNING\\n\\t\\tvec4 worldPosition = modelMatrix * skinned;\\n\\t#else\\n\\t\\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\\n\\t#endif\\n#endif\\n\";\n\n\tvar cube_frag = \"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\\n\\tgl_FragColor.a *= opacity;\\n}\\n\";\n\n\tvar cube_vert = \"varying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar depth_frag = \"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\\n\\t#endif\\n}\\n\";\n\n\tvar depth_vert = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar distanceRGBA_frag = \"uniform vec3 lightPos;\\nvarying vec4 vWorldPosition;\\n#include \\n#include \\n#include \\nvoid main () {\\n\\t#include \\n\\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\\n}\\n\";\n\n\tvar distanceRGBA_vert = \"varying vec4 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvWorldPosition = worldPosition;\\n}\\n\";\n\n\tvar equirect_frag = \"uniform sampler2D tEquirect;\\nuniform float tFlip;\\nvarying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\\tvec3 direction = normalize( vWorldPosition );\\n\\tvec2 sampleUV;\\n\\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\\n\\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n}\\n\";\n\n\tvar equirect_vert = \"varying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar linedashed_frag = \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar linedashed_vert = \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvLineDistance = scale * lineDistance;\\n\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshbasic_frag = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tReflectedLight reflectedLight;\\n\\treflectedLight.directDiffuse = vec3( 0.0 );\\n\\treflectedLight.directSpecular = vec3( 0.0 );\\n\\treflectedLight.indirectDiffuse = diffuseColor.rgb;\\n\\treflectedLight.indirectSpecular = vec3( 0.0 );\\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include \\n\\t#include \\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshbasic_vert = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef USE_ENVMAP\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshlambert_frag = \"uniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\\n\\t#include \\n\\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\\n\\t#else\\n\\t\\treflectedLight.directDiffuse = vLightFront;\\n\\t#endif\\n\\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshlambert_vert = \"#define LAMBERT\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshphong_frag = \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include \\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshphong_vert = \"#define PHONG\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshphysical_frag = \"#define PHYSICAL\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifndef STANDARD\\n\\tuniform float clearCoat;\\n\\tuniform float clearCoatRoughness;\\n#endif\\nuniform float envMapIntensity;\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar meshphysical_vert = \"#define PHYSICAL\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar normal_frag = \"uniform float opacity;\\nvarying vec3 vNormal;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tgl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\\n\\t#include \\n}\\n\";\n\n\tvar normal_vert = \"varying vec3 vNormal;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvNormal = normalize( normalMatrix * normal );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar points_frag = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar points_vert = \"uniform float size;\\nuniform float scale;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tgl_PointSize = size * ( scale / - mvPosition.z );\\n\\t#else\\n\\t\\tgl_PointSize = size;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar shadow_frag = \"uniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\\n}\\n\";\n\n\tvar shadow_vert = \"#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n\";\n\n\tvar ShaderChunk = {\n\t\talphamap_fragment: alphamap_fragment,\n\t\talphamap_pars_fragment: alphamap_pars_fragment,\n\t\talphatest_fragment: alphatest_fragment,\n\t\taomap_fragment: aomap_fragment,\n\t\taomap_pars_fragment: aomap_pars_fragment,\n\t\tbegin_vertex: begin_vertex,\n\t\tbeginnormal_vertex: beginnormal_vertex,\n\t\tbsdfs: bsdfs,\n\t\tbumpmap_pars_fragment: bumpmap_pars_fragment,\n\t\tclipping_planes_fragment: clipping_planes_fragment,\n\t\tclipping_planes_pars_fragment: clipping_planes_pars_fragment,\n\t\tclipping_planes_pars_vertex: clipping_planes_pars_vertex,\n\t\tclipping_planes_vertex: clipping_planes_vertex,\n\t\tcolor_fragment: color_fragment,\n\t\tcolor_pars_fragment: color_pars_fragment,\n\t\tcolor_pars_vertex: color_pars_vertex,\n\t\tcolor_vertex: color_vertex,\n\t\tcommon: common,\n\t\tcube_uv_reflection_fragment: cube_uv_reflection_fragment,\n\t\tdefaultnormal_vertex: defaultnormal_vertex,\n\t\tdisplacementmap_pars_vertex: displacementmap_pars_vertex,\n\t\tdisplacementmap_vertex: displacementmap_vertex,\n\t\temissivemap_fragment: emissivemap_fragment,\n\t\temissivemap_pars_fragment: emissivemap_pars_fragment,\n\t\tencodings_fragment: encodings_fragment,\n\t\tencodings_pars_fragment: encodings_pars_fragment,\n\t\tenvmap_fragment: envmap_fragment,\n\t\tenvmap_pars_fragment: envmap_pars_fragment,\n\t\tenvmap_pars_vertex: envmap_pars_vertex,\n\t\tenvmap_vertex: envmap_vertex,\n\t\tfog_fragment: fog_fragment,\n\t\tfog_pars_fragment: fog_pars_fragment,\n\t\tlightmap_fragment: lightmap_fragment,\n\t\tlightmap_pars_fragment: lightmap_pars_fragment,\n\t\tlights_lambert_vertex: lights_lambert_vertex,\n\t\tlights_pars: lights_pars,\n\t\tlights_phong_fragment: lights_phong_fragment,\n\t\tlights_phong_pars_fragment: lights_phong_pars_fragment,\n\t\tlights_physical_fragment: lights_physical_fragment,\n\t\tlights_physical_pars_fragment: lights_physical_pars_fragment,\n\t\tlights_template: lights_template,\n\t\tlogdepthbuf_fragment: logdepthbuf_fragment,\n\t\tlogdepthbuf_pars_fragment: logdepthbuf_pars_fragment,\n\t\tlogdepthbuf_pars_vertex: logdepthbuf_pars_vertex,\n\t\tlogdepthbuf_vertex: logdepthbuf_vertex,\n\t\tmap_fragment: map_fragment,\n\t\tmap_pars_fragment: map_pars_fragment,\n\t\tmap_particle_fragment: map_particle_fragment,\n\t\tmap_particle_pars_fragment: map_particle_pars_fragment,\n\t\tmetalnessmap_fragment: metalnessmap_fragment,\n\t\tmetalnessmap_pars_fragment: metalnessmap_pars_fragment,\n\t\tmorphnormal_vertex: morphnormal_vertex,\n\t\tmorphtarget_pars_vertex: morphtarget_pars_vertex,\n\t\tmorphtarget_vertex: morphtarget_vertex,\n\t\tnormal_flip: normal_flip,\n\t\tnormal_fragment: normal_fragment,\n\t\tnormalmap_pars_fragment: normalmap_pars_fragment,\n\t\tpacking: packing,\n\t\tpremultiplied_alpha_fragment: premultiplied_alpha_fragment,\n\t\tproject_vertex: project_vertex,\n\t\troughnessmap_fragment: roughnessmap_fragment,\n\t\troughnessmap_pars_fragment: roughnessmap_pars_fragment,\n\t\tshadowmap_pars_fragment: shadowmap_pars_fragment,\n\t\tshadowmap_pars_vertex: shadowmap_pars_vertex,\n\t\tshadowmap_vertex: shadowmap_vertex,\n\t\tshadowmask_pars_fragment: shadowmask_pars_fragment,\n\t\tskinbase_vertex: skinbase_vertex,\n\t\tskinning_pars_vertex: skinning_pars_vertex,\n\t\tskinning_vertex: skinning_vertex,\n\t\tskinnormal_vertex: skinnormal_vertex,\n\t\tspecularmap_fragment: specularmap_fragment,\n\t\tspecularmap_pars_fragment: specularmap_pars_fragment,\n\t\ttonemapping_fragment: tonemapping_fragment,\n\t\ttonemapping_pars_fragment: tonemapping_pars_fragment,\n\t\tuv_pars_fragment: uv_pars_fragment,\n\t\tuv_pars_vertex: uv_pars_vertex,\n\t\tuv_vertex: uv_vertex,\n\t\tuv2_pars_fragment: uv2_pars_fragment,\n\t\tuv2_pars_vertex: uv2_pars_vertex,\n\t\tuv2_vertex: uv2_vertex,\n\t\tworldpos_vertex: worldpos_vertex,\n\n\t\tcube_frag: cube_frag,\n\t\tcube_vert: cube_vert,\n\t\tdepth_frag: depth_frag,\n\t\tdepth_vert: depth_vert,\n\t\tdistanceRGBA_frag: distanceRGBA_frag,\n\t\tdistanceRGBA_vert: distanceRGBA_vert,\n\t\tequirect_frag: equirect_frag,\n\t\tequirect_vert: equirect_vert,\n\t\tlinedashed_frag: linedashed_frag,\n\t\tlinedashed_vert: linedashed_vert,\n\t\tmeshbasic_frag: meshbasic_frag,\n\t\tmeshbasic_vert: meshbasic_vert,\n\t\tmeshlambert_frag: meshlambert_frag,\n\t\tmeshlambert_vert: meshlambert_vert,\n\t\tmeshphong_frag: meshphong_frag,\n\t\tmeshphong_vert: meshphong_vert,\n\t\tmeshphysical_frag: meshphysical_frag,\n\t\tmeshphysical_vert: meshphysical_vert,\n\t\tnormal_frag: normal_frag,\n\t\tnormal_vert: normal_vert,\n\t\tpoints_frag: points_frag,\n\t\tpoints_vert: points_vert,\n\t\tshadow_frag: shadow_frag,\n\t\tshadow_vert: shadow_vert\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Color( r, g, b ) {\n\n\t\tif ( g === undefined && b === undefined ) {\n\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set( r );\n\n\t\t}\n\n\t\treturn this.setRGB( r, g, b );\n\n\t}\n\n\tColor.prototype = {\n\n\t\tconstructor: Color,\n\n\t\tisColor: true,\n\n\t\tr: 1, g: 1, b: 1,\n\n\t\tset: function ( value ) {\n\n\t\t\tif ( (value && value.isColor) ) {\n\n\t\t\t\tthis.copy( value );\n\n\t\t\t} else if ( typeof value === 'number' ) {\n\n\t\t\t\tthis.setHex( value );\n\n\t\t\t} else if ( typeof value === 'string' ) {\n\n\t\t\t\tthis.setStyle( value );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetScalar: function ( scalar ) {\n\n\t\t\tthis.r = scalar;\n\t\t\tthis.g = scalar;\n\t\t\tthis.b = scalar;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetHex: function ( hex ) {\n\n\t\t\thex = Math.floor( hex );\n\n\t\t\tthis.r = ( hex >> 16 & 255 ) / 255;\n\t\t\tthis.g = ( hex >> 8 & 255 ) / 255;\n\t\t\tthis.b = ( hex & 255 ) / 255;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetRGB: function ( r, g, b ) {\n\n\t\t\tthis.r = r;\n\t\t\tthis.g = g;\n\t\t\tthis.b = b;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetHSL: function () {\n\n\t\t\tfunction hue2rgb( p, q, t ) {\n\n\t\t\t\tif ( t < 0 ) t += 1;\n\t\t\t\tif ( t > 1 ) t -= 1;\n\t\t\t\tif ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;\n\t\t\t\tif ( t < 1 / 2 ) return q;\n\t\t\t\tif ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );\n\t\t\t\treturn p;\n\n\t\t\t}\n\n\t\t\treturn function setHSL( h, s, l ) {\n\n\t\t\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\t\t\th = _Math.euclideanModulo( h, 1 );\n\t\t\t\ts = _Math.clamp( s, 0, 1 );\n\t\t\t\tl = _Math.clamp( l, 0, 1 );\n\n\t\t\t\tif ( s === 0 ) {\n\n\t\t\t\t\tthis.r = this.g = this.b = l;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );\n\t\t\t\t\tvar q = ( 2 * l ) - p;\n\n\t\t\t\t\tthis.r = hue2rgb( q, p, h + 1 / 3 );\n\t\t\t\t\tthis.g = hue2rgb( q, p, h );\n\t\t\t\t\tthis.b = hue2rgb( q, p, h - 1 / 3 );\n\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tsetStyle: function ( style ) {\n\n\t\t\tfunction handleAlpha( string ) {\n\n\t\t\t\tif ( string === undefined ) return;\n\n\t\t\t\tif ( parseFloat( string ) < 1 ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\tvar m;\n\n\t\t\tif ( m = /^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec( style ) ) {\n\n\t\t\t\t// rgb / hsl\n\n\t\t\t\tvar color;\n\t\t\t\tvar name = m[ 1 ];\n\t\t\t\tvar components = m[ 2 ];\n\n\t\t\t\tswitch ( name ) {\n\n\t\t\t\t\tcase 'rgb':\n\t\t\t\t\tcase 'rgba':\n\n\t\t\t\t\t\tif ( color = /^(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\t\tthis.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255;\n\t\t\t\t\t\t\tthis.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255;\n\t\t\t\t\t\t\tthis.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255;\n\n\t\t\t\t\t\t\thandleAlpha( color[ 5 ] );\n\n\t\t\t\t\t\t\treturn this;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( color = /^(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\t\tthis.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100;\n\t\t\t\t\t\t\tthis.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100;\n\t\t\t\t\t\t\tthis.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100;\n\n\t\t\t\t\t\t\thandleAlpha( color[ 5 ] );\n\n\t\t\t\t\t\t\treturn this;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'hsl':\n\t\t\t\t\tcase 'hsla':\n\n\t\t\t\t\t\tif ( color = /^([0-9]*\\.?[0-9]+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\t\tvar h = parseFloat( color[ 1 ] ) / 360;\n\t\t\t\t\t\t\tvar s = parseInt( color[ 2 ], 10 ) / 100;\n\t\t\t\t\t\t\tvar l = parseInt( color[ 3 ], 10 ) / 100;\n\n\t\t\t\t\t\t\thandleAlpha( color[ 5 ] );\n\n\t\t\t\t\t\t\treturn this.setHSL( h, s, l );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t} else if ( m = /^\\#([A-Fa-f0-9]+)$/.exec( style ) ) {\n\n\t\t\t\t// hex color\n\n\t\t\t\tvar hex = m[ 1 ];\n\t\t\t\tvar size = hex.length;\n\n\t\t\t\tif ( size === 3 ) {\n\n\t\t\t\t\t// #ff0\n\t\t\t\t\tthis.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255;\n\t\t\t\t\tthis.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255;\n\t\t\t\t\tthis.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255;\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t} else if ( size === 6 ) {\n\n\t\t\t\t\t// #ff0000\n\t\t\t\t\tthis.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255;\n\t\t\t\t\tthis.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255;\n\t\t\t\t\tthis.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255;\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( style && style.length > 0 ) {\n\n\t\t\t\t// color keywords\n\t\t\t\tvar hex = ColorKeywords[ style ];\n\n\t\t\t\tif ( hex !== undefined ) {\n\n\t\t\t\t\t// red\n\t\t\t\t\tthis.setHex( hex );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// unknown color\n\t\t\t\t\tconsole.warn( 'THREE.Color: Unknown color ' + style );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.r, this.g, this.b );\n\n\t\t},\n\n\t\tcopy: function ( color ) {\n\n\t\t\tthis.r = color.r;\n\t\t\tthis.g = color.g;\n\t\t\tthis.b = color.b;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyGammaToLinear: function ( color, gammaFactor ) {\n\n\t\t\tif ( gammaFactor === undefined ) gammaFactor = 2.0;\n\n\t\t\tthis.r = Math.pow( color.r, gammaFactor );\n\t\t\tthis.g = Math.pow( color.g, gammaFactor );\n\t\t\tthis.b = Math.pow( color.b, gammaFactor );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyLinearToGamma: function ( color, gammaFactor ) {\n\n\t\t\tif ( gammaFactor === undefined ) gammaFactor = 2.0;\n\n\t\t\tvar safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0;\n\n\t\t\tthis.r = Math.pow( color.r, safeInverse );\n\t\t\tthis.g = Math.pow( color.g, safeInverse );\n\t\t\tthis.b = Math.pow( color.b, safeInverse );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tconvertGammaToLinear: function () {\n\n\t\t\tvar r = this.r, g = this.g, b = this.b;\n\n\t\t\tthis.r = r * r;\n\t\t\tthis.g = g * g;\n\t\t\tthis.b = b * b;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tconvertLinearToGamma: function () {\n\n\t\t\tthis.r = Math.sqrt( this.r );\n\t\t\tthis.g = Math.sqrt( this.g );\n\t\t\tthis.b = Math.sqrt( this.b );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetHex: function () {\n\n\t\t\treturn ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0;\n\n\t\t},\n\n\t\tgetHexString: function () {\n\n\t\t\treturn ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 );\n\n\t\t},\n\n\t\tgetHSL: function ( optionalTarget ) {\n\n\t\t\t// h,s,l ranges are in 0.0 - 1.0\n\n\t\t\tvar hsl = optionalTarget || { h: 0, s: 0, l: 0 };\n\n\t\t\tvar r = this.r, g = this.g, b = this.b;\n\n\t\t\tvar max = Math.max( r, g, b );\n\t\t\tvar min = Math.min( r, g, b );\n\n\t\t\tvar hue, saturation;\n\t\t\tvar lightness = ( min + max ) / 2.0;\n\n\t\t\tif ( min === max ) {\n\n\t\t\t\thue = 0;\n\t\t\t\tsaturation = 0;\n\n\t\t\t} else {\n\n\t\t\t\tvar delta = max - min;\n\n\t\t\t\tsaturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );\n\n\t\t\t\tswitch ( max ) {\n\n\t\t\t\t\tcase r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break;\n\t\t\t\t\tcase g: hue = ( b - r ) / delta + 2; break;\n\t\t\t\t\tcase b: hue = ( r - g ) / delta + 4; break;\n\n\t\t\t\t}\n\n\t\t\t\thue /= 6;\n\n\t\t\t}\n\n\t\t\thsl.h = hue;\n\t\t\thsl.s = saturation;\n\t\t\thsl.l = lightness;\n\n\t\t\treturn hsl;\n\n\t\t},\n\n\t\tgetStyle: function () {\n\n\t\t\treturn 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';\n\n\t\t},\n\n\t\toffsetHSL: function ( h, s, l ) {\n\n\t\t\tvar hsl = this.getHSL();\n\n\t\t\thsl.h += h; hsl.s += s; hsl.l += l;\n\n\t\t\tthis.setHSL( hsl.h, hsl.s, hsl.l );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tadd: function ( color ) {\n\n\t\t\tthis.r += color.r;\n\t\t\tthis.g += color.g;\n\t\t\tthis.b += color.b;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddColors: function ( color1, color2 ) {\n\n\t\t\tthis.r = color1.r + color2.r;\n\t\t\tthis.g = color1.g + color2.g;\n\t\t\tthis.b = color1.b + color2.b;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddScalar: function ( s ) {\n\n\t\t\tthis.r += s;\n\t\t\tthis.g += s;\n\t\t\tthis.b += s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsub: function( color ) {\n\n\t\t\tthis.r = Math.max( 0, this.r - color.r );\n\t\t\tthis.g = Math.max( 0, this.g - color.g );\n\t\t\tthis.b = Math.max( 0, this.b - color.b );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiply: function ( color ) {\n\n\t\t\tthis.r *= color.r;\n\t\t\tthis.g *= color.g;\n\t\t\tthis.b *= color.b;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmultiplyScalar: function ( s ) {\n\n\t\t\tthis.r *= s;\n\t\t\tthis.g *= s;\n\t\t\tthis.b *= s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tlerp: function ( color, alpha ) {\n\n\t\t\tthis.r += ( color.r - this.r ) * alpha;\n\t\t\tthis.g += ( color.g - this.g ) * alpha;\n\t\t\tthis.b += ( color.b - this.b ) * alpha;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( c ) {\n\n\t\t\treturn ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );\n\n\t\t},\n\n\t\tfromArray: function ( array, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tthis.r = array[ offset ];\n\t\t\tthis.g = array[ offset + 1 ];\n\t\t\tthis.b = array[ offset + 2 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tarray[ offset ] = this.r;\n\t\t\tarray[ offset + 1 ] = this.g;\n\t\t\tarray[ offset + 2 ] = this.b;\n\n\t\t\treturn array;\n\n\t\t},\n\n\t\ttoJSON: function () {\n\n\t\t\treturn this.getHex();\n\n\t\t}\n\n\t};\n\n\tvar ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };\n\n\t/**\n\t * Uniforms library for shared webgl shaders\n\t */\n\n\tvar UniformsLib = {\n\n\t\tcommon: {\n\n\t\t\tdiffuse: { value: new Color( 0xeeeeee ) },\n\t\t\topacity: { value: 1.0 },\n\n\t\t\tmap: { value: null },\n\t\t\toffsetRepeat: { value: new Vector4( 0, 0, 1, 1 ) },\n\n\t\t\tspecularMap: { value: null },\n\t\t\talphaMap: { value: null },\n\n\t\t\tenvMap: { value: null },\n\t\t\tflipEnvMap: { value: - 1 },\n\t\t\treflectivity: { value: 1.0 },\n\t\t\trefractionRatio: { value: 0.98 }\n\n\t\t},\n\n\t\taomap: {\n\n\t\t\taoMap: { value: null },\n\t\t\taoMapIntensity: { value: 1 }\n\n\t\t},\n\n\t\tlightmap: {\n\n\t\t\tlightMap: { value: null },\n\t\t\tlightMapIntensity: { value: 1 }\n\n\t\t},\n\n\t\temissivemap: {\n\n\t\t\temissiveMap: { value: null }\n\n\t\t},\n\n\t\tbumpmap: {\n\n\t\t\tbumpMap: { value: null },\n\t\t\tbumpScale: { value: 1 }\n\n\t\t},\n\n\t\tnormalmap: {\n\n\t\t\tnormalMap: { value: null },\n\t\t\tnormalScale: { value: new Vector2( 1, 1 ) }\n\n\t\t},\n\n\t\tdisplacementmap: {\n\n\t\t\tdisplacementMap: { value: null },\n\t\t\tdisplacementScale: { value: 1 },\n\t\t\tdisplacementBias: { value: 0 }\n\n\t\t},\n\n\t\troughnessmap: {\n\n\t\t\troughnessMap: { value: null }\n\n\t\t},\n\n\t\tmetalnessmap: {\n\n\t\t\tmetalnessMap: { value: null }\n\n\t\t},\n\n\t\tfog: {\n\n\t\t\tfogDensity: { value: 0.00025 },\n\t\t\tfogNear: { value: 1 },\n\t\t\tfogFar: { value: 2000 },\n\t\t\tfogColor: { value: new Color( 0xffffff ) }\n\n\t\t},\n\n\t\tlights: {\n\n\t\t\tambientLightColor: { value: [] },\n\n\t\t\tdirectionalLights: { value: [], properties: {\n\t\t\t\tdirection: {},\n\t\t\t\tcolor: {},\n\n\t\t\t\tshadow: {},\n\t\t\t\tshadowBias: {},\n\t\t\t\tshadowRadius: {},\n\t\t\t\tshadowMapSize: {}\n\t\t\t} },\n\n\t\t\tdirectionalShadowMap: { value: [] },\n\t\t\tdirectionalShadowMatrix: { value: [] },\n\n\t\t\tspotLights: { value: [], properties: {\n\t\t\t\tcolor: {},\n\t\t\t\tposition: {},\n\t\t\t\tdirection: {},\n\t\t\t\tdistance: {},\n\t\t\t\tconeCos: {},\n\t\t\t\tpenumbraCos: {},\n\t\t\t\tdecay: {},\n\n\t\t\t\tshadow: {},\n\t\t\t\tshadowBias: {},\n\t\t\t\tshadowRadius: {},\n\t\t\t\tshadowMapSize: {}\n\t\t\t} },\n\n\t\t\tspotShadowMap: { value: [] },\n\t\t\tspotShadowMatrix: { value: [] },\n\n\t\t\tpointLights: { value: [], properties: {\n\t\t\t\tcolor: {},\n\t\t\t\tposition: {},\n\t\t\t\tdecay: {},\n\t\t\t\tdistance: {},\n\n\t\t\t\tshadow: {},\n\t\t\t\tshadowBias: {},\n\t\t\t\tshadowRadius: {},\n\t\t\t\tshadowMapSize: {}\n\t\t\t} },\n\n\t\t\tpointShadowMap: { value: [] },\n\t\t\tpointShadowMatrix: { value: [] },\n\n\t\t\themisphereLights: { value: [], properties: {\n\t\t\t\tdirection: {},\n\t\t\t\tskyColor: {},\n\t\t\t\tgroundColor: {}\n\t\t\t} }\n\n\t\t},\n\n\t\tpoints: {\n\n\t\t\tdiffuse: { value: new Color( 0xeeeeee ) },\n\t\t\topacity: { value: 1.0 },\n\t\t\tsize: { value: 1.0 },\n\t\t\tscale: { value: 1.0 },\n\t\t\tmap: { value: null },\n\t\t\toffsetRepeat: { value: new Vector4( 0, 0, 1, 1 ) }\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author mikael emtinger / http://gomo.se/\n\t */\n\n\tvar ShaderLib = {\n\n\t\tbasic: {\n\n\t\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\t\tUniformsLib.common,\n\t\t\t\tUniformsLib.aomap,\n\t\t\t\tUniformsLib.fog\n\n\t\t\t] ),\n\n\t\t\tvertexShader: ShaderChunk.meshbasic_vert,\n\t\t\tfragmentShader: ShaderChunk.meshbasic_frag\n\n\t\t},\n\n\t\tlambert: {\n\n\t\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\t\tUniformsLib.common,\n\t\t\t\tUniformsLib.aomap,\n\t\t\t\tUniformsLib.lightmap,\n\t\t\t\tUniformsLib.emissivemap,\n\t\t\t\tUniformsLib.fog,\n\t\t\t\tUniformsLib.lights,\n\n\t\t\t\t{\n\t\t\t\t\temissive : { value: new Color( 0x000000 ) }\n\t\t\t\t}\n\n\t\t\t] ),\n\n\t\t\tvertexShader: ShaderChunk.meshlambert_vert,\n\t\t\tfragmentShader: ShaderChunk.meshlambert_frag\n\n\t\t},\n\n\t\tphong: {\n\n\t\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\t\tUniformsLib.common,\n\t\t\t\tUniformsLib.aomap,\n\t\t\t\tUniformsLib.lightmap,\n\t\t\t\tUniformsLib.emissivemap,\n\t\t\t\tUniformsLib.bumpmap,\n\t\t\t\tUniformsLib.normalmap,\n\t\t\t\tUniformsLib.displacementmap,\n\t\t\t\tUniformsLib.fog,\n\t\t\t\tUniformsLib.lights,\n\n\t\t\t\t{\n\t\t\t\t\temissive : { value: new Color( 0x000000 ) },\n\t\t\t\t\tspecular : { value: new Color( 0x111111 ) },\n\t\t\t\t\tshininess: { value: 30 }\n\t\t\t\t}\n\n\t\t\t] ),\n\n\t\t\tvertexShader: ShaderChunk.meshphong_vert,\n\t\t\tfragmentShader: ShaderChunk.meshphong_frag\n\n\t\t},\n\n\t\tstandard: {\n\n\t\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\t\tUniformsLib.common,\n\t\t\t\tUniformsLib.aomap,\n\t\t\t\tUniformsLib.lightmap,\n\t\t\t\tUniformsLib.emissivemap,\n\t\t\t\tUniformsLib.bumpmap,\n\t\t\t\tUniformsLib.normalmap,\n\t\t\t\tUniformsLib.displacementmap,\n\t\t\t\tUniformsLib.roughnessmap,\n\t\t\t\tUniformsLib.metalnessmap,\n\t\t\t\tUniformsLib.fog,\n\t\t\t\tUniformsLib.lights,\n\n\t\t\t\t{\n\t\t\t\t\temissive : { value: new Color( 0x000000 ) },\n\t\t\t\t\troughness: { value: 0.5 },\n\t\t\t\t\tmetalness: { value: 0 },\n\t\t\t\t\tenvMapIntensity : { value: 1 }, // temporary\n\t\t\t\t}\n\n\t\t\t] ),\n\n\t\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\n\t\t},\n\n\t\tpoints: {\n\n\t\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\t\tUniformsLib.points,\n\t\t\t\tUniformsLib.fog\n\n\t\t\t] ),\n\n\t\t\tvertexShader: ShaderChunk.points_vert,\n\t\t\tfragmentShader: ShaderChunk.points_frag\n\n\t\t},\n\n\t\tdashed: {\n\n\t\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\t\tUniformsLib.common,\n\t\t\t\tUniformsLib.fog,\n\n\t\t\t\t{\n\t\t\t\t\tscale : { value: 1 },\n\t\t\t\t\tdashSize : { value: 1 },\n\t\t\t\t\ttotalSize: { value: 2 }\n\t\t\t\t}\n\n\t\t\t] ),\n\n\t\t\tvertexShader: ShaderChunk.linedashed_vert,\n\t\t\tfragmentShader: ShaderChunk.linedashed_frag\n\n\t\t},\n\n\t\tdepth: {\n\n\t\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\t\tUniformsLib.common,\n\t\t\t\tUniformsLib.displacementmap\n\n\t\t\t] ),\n\n\t\t\tvertexShader: ShaderChunk.depth_vert,\n\t\t\tfragmentShader: ShaderChunk.depth_frag\n\n\t\t},\n\n\t\tnormal: {\n\n\t\t\tuniforms: {\n\n\t\t\t\topacity : { value: 1.0 }\n\n\t\t\t},\n\n\t\t\tvertexShader: ShaderChunk.normal_vert,\n\t\t\tfragmentShader: ShaderChunk.normal_frag\n\n\t\t},\n\n\t\t/* -------------------------------------------------------------------------\n\t\t//\tCube map shader\n\t\t ------------------------------------------------------------------------- */\n\n\t\tcube: {\n\n\t\t\tuniforms: {\n\t\t\t\ttCube: { value: null },\n\t\t\t\ttFlip: { value: - 1 },\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t},\n\n\t\t\tvertexShader: ShaderChunk.cube_vert,\n\t\t\tfragmentShader: ShaderChunk.cube_frag\n\n\t\t},\n\n\t\t/* -------------------------------------------------------------------------\n\t\t//\tCube map shader\n\t\t ------------------------------------------------------------------------- */\n\n\t\tequirect: {\n\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: { value: null },\n\t\t\t\ttFlip: { value: - 1 }\n\t\t\t},\n\n\t\t\tvertexShader: ShaderChunk.equirect_vert,\n\t\t\tfragmentShader: ShaderChunk.equirect_frag\n\n\t\t},\n\n\t\tdistanceRGBA: {\n\n\t\t\tuniforms: {\n\n\t\t\t\tlightPos: { value: new Vector3() }\n\n\t\t\t},\n\n\t\t\tvertexShader: ShaderChunk.distanceRGBA_vert,\n\t\t\tfragmentShader: ShaderChunk.distanceRGBA_frag\n\n\t\t}\n\n\t};\n\n\tShaderLib.physical = {\n\n\t\tuniforms: UniformsUtils.merge( [\n\n\t\t\tShaderLib.standard.uniforms,\n\n\t\t\t{\n\t\t\t\tclearCoat: { value: 0 },\n\t\t\t\tclearCoatRoughness: { value: 0 }\n\t\t\t}\n\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\n\t};\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Box2( min, max ) {\n\n\t\tthis.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity );\n\t\tthis.max = ( max !== undefined ) ? max : new Vector2( - Infinity, - Infinity );\n\n\t}\n\n\tBox2.prototype = {\n\n\t\tconstructor: Box2,\n\n\t\tset: function ( min, max ) {\n\n\t\t\tthis.min.copy( min );\n\t\t\tthis.max.copy( max );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromPoints: function ( points ) {\n\n\t\t\tthis.makeEmpty();\n\n\t\t\tfor ( var i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromCenterAndSize: function () {\n\n\t\t\tvar v1 = new Vector2();\n\n\t\t\treturn function setFromCenterAndSize( center, size ) {\n\n\t\t\t\tvar halfSize = v1.copy( size ).multiplyScalar( 0.5 );\n\t\t\t\tthis.min.copy( center ).sub( halfSize );\n\t\t\t\tthis.max.copy( center ).add( halfSize );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( box ) {\n\n\t\t\tthis.min.copy( box.min );\n\t\t\tthis.max.copy( box.max );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeEmpty: function () {\n\n\t\t\tthis.min.x = this.min.y = + Infinity;\n\t\t\tthis.max.x = this.max.y = - Infinity;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tisEmpty: function () {\n\n\t\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y );\n\n\t\t},\n\n\t\tgetCenter: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector2();\n\t\t\treturn this.isEmpty() ? result.set( 0, 0 ) : result.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t\t},\n\n\t\tgetSize: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector2();\n\t\t\treturn this.isEmpty() ? result.set( 0, 0 ) : result.subVectors( this.max, this.min );\n\n\t\t},\n\n\t\texpandByPoint: function ( point ) {\n\n\t\t\tthis.min.min( point );\n\t\t\tthis.max.max( point );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\texpandByVector: function ( vector ) {\n\n\t\t\tthis.min.sub( vector );\n\t\t\tthis.max.add( vector );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\texpandByScalar: function ( scalar ) {\n\n\t\t\tthis.min.addScalar( - scalar );\n\t\t\tthis.max.addScalar( scalar );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcontainsPoint: function ( point ) {\n\n\t\t\tif ( point.x < this.min.x || point.x > this.max.x ||\n\t\t\t point.y < this.min.y || point.y > this.max.y ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t},\n\n\t\tcontainsBox: function ( box ) {\n\n\t\t\tif ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&\n\t\t\t ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t},\n\n\t\tgetParameter: function ( point, optionalTarget ) {\n\n\t\t\t// This can potentially have a divide by zero if the box\n\t\t\t// has a size dimension of 0.\n\n\t\t\tvar result = optionalTarget || new Vector2();\n\n\t\t\treturn result.set(\n\t\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y )\n\t\t\t);\n\n\t\t},\n\n\t\tintersectsBox: function ( box ) {\n\n\t\t\t// using 6 splitting planes to rule out intersections.\n\n\t\t\tif ( box.max.x < this.min.x || box.min.x > this.max.x ||\n\t\t\t box.max.y < this.min.y || box.min.y > this.max.y ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t},\n\n\t\tclampPoint: function ( point, optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector2();\n\t\t\treturn result.copy( point ).clamp( this.min, this.max );\n\n\t\t},\n\n\t\tdistanceToPoint: function () {\n\n\t\t\tvar v1 = new Vector2();\n\n\t\t\treturn function distanceToPoint( point ) {\n\n\t\t\t\tvar clampedPoint = v1.copy( point ).clamp( this.min, this.max );\n\t\t\t\treturn clampedPoint.sub( point ).length();\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tintersect: function ( box ) {\n\n\t\t\tthis.min.max( box.min );\n\t\t\tthis.max.min( box.max );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tunion: function ( box ) {\n\n\t\t\tthis.min.min( box.min );\n\t\t\tthis.max.max( box.max );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttranslate: function ( offset ) {\n\n\t\t\tthis.min.add( offset );\n\t\t\tthis.max.add( offset );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( box ) {\n\n\t\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction LensFlarePlugin( renderer, flares ) {\n\n\t\tvar gl = renderer.context;\n\t\tvar state = renderer.state;\n\n\t\tvar vertexBuffer, elementBuffer;\n\t\tvar shader, program, attributes, uniforms;\n\n\t\tvar tempTexture, occlusionTexture;\n\n\t\tfunction init() {\n\n\t\t\tvar vertices = new Float32Array( [\n\t\t\t\t- 1, - 1, 0, 0,\n\t\t\t\t 1, - 1, 1, 0,\n\t\t\t\t 1, 1, 1, 1,\n\t\t\t\t- 1, 1, 0, 1\n\t\t\t] );\n\n\t\t\tvar faces = new Uint16Array( [\n\t\t\t\t0, 1, 2,\n\t\t\t\t0, 2, 3\n\t\t\t] );\n\n\t\t\t// buffers\n\n\t\t\tvertexBuffer = gl.createBuffer();\n\t\t\telementBuffer = gl.createBuffer();\n\n\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer );\n\t\t\tgl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW );\n\n\t\t\tgl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer );\n\t\t\tgl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW );\n\n\t\t\t// textures\n\n\t\t\ttempTexture = gl.createTexture();\n\t\t\tocclusionTexture = gl.createTexture();\n\n\t\t\tstate.bindTexture( gl.TEXTURE_2D, tempTexture );\n\t\t\tgl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST );\n\n\t\t\tstate.bindTexture( gl.TEXTURE_2D, occlusionTexture );\n\t\t\tgl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST );\n\t\t\tgl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST );\n\n\t\t\tshader = {\n\n\t\t\t\tvertexShader: [\n\n\t\t\t\t\t\"uniform lowp int renderType;\",\n\n\t\t\t\t\t\"uniform vec3 screenPosition;\",\n\t\t\t\t\t\"uniform vec2 scale;\",\n\t\t\t\t\t\"uniform float rotation;\",\n\n\t\t\t\t\t\"uniform sampler2D occlusionMap;\",\n\n\t\t\t\t\t\"attribute vec2 position;\",\n\t\t\t\t\t\"attribute vec2 uv;\",\n\n\t\t\t\t\t\"varying vec2 vUV;\",\n\t\t\t\t\t\"varying float vVisibility;\",\n\n\t\t\t\t\t\"void main() {\",\n\n\t\t\t\t\t\t\"vUV = uv;\",\n\n\t\t\t\t\t\t\"vec2 pos = position;\",\n\n\t\t\t\t\t\t\"if ( renderType == 2 ) {\",\n\n\t\t\t\t\t\t\t\"vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\",\n\t\t\t\t\t\t\t\"visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\",\n\n\t\t\t\t\t\t\t\"vVisibility = visibility.r / 9.0;\",\n\t\t\t\t\t\t\t\"vVisibility *= 1.0 - visibility.g / 9.0;\",\n\t\t\t\t\t\t\t\"vVisibility *= visibility.b / 9.0;\",\n\t\t\t\t\t\t\t\"vVisibility *= 1.0 - visibility.a / 9.0;\",\n\n\t\t\t\t\t\t\t\"pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\",\n\t\t\t\t\t\t\t\"pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\",\n\n\t\t\t\t\t\t\"}\",\n\n\t\t\t\t\t\t\"gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\",\n\n\t\t\t\t\t\"}\"\n\n\t\t\t\t].join( \"\\n\" ),\n\n\t\t\t\tfragmentShader: [\n\n\t\t\t\t\t\"uniform lowp int renderType;\",\n\n\t\t\t\t\t\"uniform sampler2D map;\",\n\t\t\t\t\t\"uniform float opacity;\",\n\t\t\t\t\t\"uniform vec3 color;\",\n\n\t\t\t\t\t\"varying vec2 vUV;\",\n\t\t\t\t\t\"varying float vVisibility;\",\n\n\t\t\t\t\t\"void main() {\",\n\n\t\t\t\t\t\t// pink square\n\n\t\t\t\t\t\t\"if ( renderType == 0 ) {\",\n\n\t\t\t\t\t\t\t\"gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\",\n\n\t\t\t\t\t\t// restore\n\n\t\t\t\t\t\t\"} else if ( renderType == 1 ) {\",\n\n\t\t\t\t\t\t\t\"gl_FragColor = texture2D( map, vUV );\",\n\n\t\t\t\t\t\t// flare\n\n\t\t\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\t\t\"vec4 texture = texture2D( map, vUV );\",\n\t\t\t\t\t\t\t\"texture.a *= opacity * vVisibility;\",\n\t\t\t\t\t\t\t\"gl_FragColor = texture;\",\n\t\t\t\t\t\t\t\"gl_FragColor.rgb *= color;\",\n\n\t\t\t\t\t\t\"}\",\n\n\t\t\t\t\t\"}\"\n\n\t\t\t\t].join( \"\\n\" )\n\n\t\t\t};\n\n\t\t\tprogram = createProgram( shader );\n\n\t\t\tattributes = {\n\t\t\t\tvertex: gl.getAttribLocation ( program, \"position\" ),\n\t\t\t\tuv: gl.getAttribLocation ( program, \"uv\" )\n\t\t\t};\n\n\t\t\tuniforms = {\n\t\t\t\trenderType: gl.getUniformLocation( program, \"renderType\" ),\n\t\t\t\tmap: gl.getUniformLocation( program, \"map\" ),\n\t\t\t\tocclusionMap: gl.getUniformLocation( program, \"occlusionMap\" ),\n\t\t\t\topacity: gl.getUniformLocation( program, \"opacity\" ),\n\t\t\t\tcolor: gl.getUniformLocation( program, \"color\" ),\n\t\t\t\tscale: gl.getUniformLocation( program, \"scale\" ),\n\t\t\t\trotation: gl.getUniformLocation( program, \"rotation\" ),\n\t\t\t\tscreenPosition: gl.getUniformLocation( program, \"screenPosition\" )\n\t\t\t};\n\n\t\t}\n\n\t\t/*\n\t\t * Render lens flares\n\t\t * Method: renders 16x16 0xff00ff-colored points scattered over the light source area,\n\t\t * reads these back and calculates occlusion.\n\t\t */\n\n\t\tthis.render = function ( scene, camera, viewport ) {\n\n\t\t\tif ( flares.length === 0 ) return;\n\n\t\t\tvar tempPosition = new Vector3();\n\n\t\t\tvar invAspect = viewport.w / viewport.z,\n\t\t\t\thalfViewportWidth = viewport.z * 0.5,\n\t\t\t\thalfViewportHeight = viewport.w * 0.5;\n\n\t\t\tvar size = 16 / viewport.w,\n\t\t\t\tscale = new Vector2( size * invAspect, size );\n\n\t\t\tvar screenPosition = new Vector3( 1, 1, 0 ),\n\t\t\t\tscreenPositionPixels = new Vector2( 1, 1 );\n\n\t\t\tvar validArea = new Box2();\n\n\t\t\tvalidArea.min.set( viewport.x, viewport.y );\n\t\t\tvalidArea.max.set( viewport.x + ( viewport.z - 16 ), viewport.y + ( viewport.w - 16 ) );\n\n\t\t\tif ( program === undefined ) {\n\n\t\t\t\tinit();\n\n\t\t\t}\n\n\t\t\tgl.useProgram( program );\n\n\t\t\tstate.initAttributes();\n\t\t\tstate.enableAttribute( attributes.vertex );\n\t\t\tstate.enableAttribute( attributes.uv );\n\t\t\tstate.disableUnusedAttributes();\n\n\t\t\t// loop through all lens flares to update their occlusion and positions\n\t\t\t// setup gl and common used attribs/uniforms\n\n\t\t\tgl.uniform1i( uniforms.occlusionMap, 0 );\n\t\t\tgl.uniform1i( uniforms.map, 1 );\n\n\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer );\n\t\t\tgl.vertexAttribPointer( attributes.vertex, 2, gl.FLOAT, false, 2 * 8, 0 );\n\t\t\tgl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 );\n\n\t\t\tgl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer );\n\n\t\t\tstate.disable( gl.CULL_FACE );\n\t\t\tstate.setDepthWrite( false );\n\n\t\t\tfor ( var i = 0, l = flares.length; i < l; i ++ ) {\n\n\t\t\t\tsize = 16 / viewport.w;\n\t\t\t\tscale.set( size * invAspect, size );\n\n\t\t\t\t// calc object screen position\n\n\t\t\t\tvar flare = flares[ i ];\n\n\t\t\t\ttempPosition.set( flare.matrixWorld.elements[ 12 ], flare.matrixWorld.elements[ 13 ], flare.matrixWorld.elements[ 14 ] );\n\n\t\t\t\ttempPosition.applyMatrix4( camera.matrixWorldInverse );\n\t\t\t\ttempPosition.applyProjection( camera.projectionMatrix );\n\n\t\t\t\t// setup arrays for gl programs\n\n\t\t\t\tscreenPosition.copy( tempPosition );\n\n\t\t\t\t// horizontal and vertical coordinate of the lower left corner of the pixels to copy\n\n\t\t\t\tscreenPositionPixels.x = viewport.x + ( screenPosition.x * halfViewportWidth ) + halfViewportWidth - 8;\n\t\t\t\tscreenPositionPixels.y = viewport.y + ( screenPosition.y * halfViewportHeight ) + halfViewportHeight - 8;\n\n\t\t\t\t// screen cull\n\n\t\t\t\tif ( validArea.containsPoint( screenPositionPixels ) === true ) {\n\n\t\t\t\t\t// save current RGB to temp texture\n\n\t\t\t\t\tstate.activeTexture( gl.TEXTURE0 );\n\t\t\t\t\tstate.bindTexture( gl.TEXTURE_2D, null );\n\t\t\t\t\tstate.activeTexture( gl.TEXTURE1 );\n\t\t\t\t\tstate.bindTexture( gl.TEXTURE_2D, tempTexture );\n\t\t\t\t\tgl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, screenPositionPixels.x, screenPositionPixels.y, 16, 16, 0 );\n\n\n\t\t\t\t\t// render pink quad\n\n\t\t\t\t\tgl.uniform1i( uniforms.renderType, 0 );\n\t\t\t\t\tgl.uniform2f( uniforms.scale, scale.x, scale.y );\n\t\t\t\t\tgl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z );\n\n\t\t\t\t\tstate.disable( gl.BLEND );\n\t\t\t\t\tstate.enable( gl.DEPTH_TEST );\n\n\t\t\t\t\tgl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );\n\n\n\t\t\t\t\t// copy result to occlusionMap\n\n\t\t\t\t\tstate.activeTexture( gl.TEXTURE0 );\n\t\t\t\t\tstate.bindTexture( gl.TEXTURE_2D, occlusionTexture );\n\t\t\t\t\tgl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA, screenPositionPixels.x, screenPositionPixels.y, 16, 16, 0 );\n\n\n\t\t\t\t\t// restore graphics\n\n\t\t\t\t\tgl.uniform1i( uniforms.renderType, 1 );\n\t\t\t\t\tstate.disable( gl.DEPTH_TEST );\n\n\t\t\t\t\tstate.activeTexture( gl.TEXTURE1 );\n\t\t\t\t\tstate.bindTexture( gl.TEXTURE_2D, tempTexture );\n\t\t\t\t\tgl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );\n\n\n\t\t\t\t\t// update object positions\n\n\t\t\t\t\tflare.positionScreen.copy( screenPosition );\n\n\t\t\t\t\tif ( flare.customUpdateCallback ) {\n\n\t\t\t\t\t\tflare.customUpdateCallback( flare );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tflare.updateLensFlares();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// render flares\n\n\t\t\t\t\tgl.uniform1i( uniforms.renderType, 2 );\n\t\t\t\t\tstate.enable( gl.BLEND );\n\n\t\t\t\t\tfor ( var j = 0, jl = flare.lensFlares.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tvar sprite = flare.lensFlares[ j ];\n\n\t\t\t\t\t\tif ( sprite.opacity > 0.001 && sprite.scale > 0.001 ) {\n\n\t\t\t\t\t\t\tscreenPosition.x = sprite.x;\n\t\t\t\t\t\t\tscreenPosition.y = sprite.y;\n\t\t\t\t\t\t\tscreenPosition.z = sprite.z;\n\n\t\t\t\t\t\t\tsize = sprite.size * sprite.scale / viewport.w;\n\n\t\t\t\t\t\t\tscale.x = size * invAspect;\n\t\t\t\t\t\t\tscale.y = size;\n\n\t\t\t\t\t\t\tgl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z );\n\t\t\t\t\t\t\tgl.uniform2f( uniforms.scale, scale.x, scale.y );\n\t\t\t\t\t\t\tgl.uniform1f( uniforms.rotation, sprite.rotation );\n\n\t\t\t\t\t\t\tgl.uniform1f( uniforms.opacity, sprite.opacity );\n\t\t\t\t\t\t\tgl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b );\n\n\t\t\t\t\t\t\tstate.setBlending( sprite.blending, sprite.blendEquation, sprite.blendSrc, sprite.blendDst );\n\t\t\t\t\t\t\trenderer.setTexture2D( sprite.texture, 1 );\n\n\t\t\t\t\t\t\tgl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// restore gl\n\n\t\t\tstate.enable( gl.CULL_FACE );\n\t\t\tstate.enable( gl.DEPTH_TEST );\n\t\t\tstate.setDepthWrite( true );\n\n\t\t\trenderer.resetGLState();\n\n\t\t};\n\n\t\tfunction createProgram( shader ) {\n\n\t\t\tvar program = gl.createProgram();\n\n\t\t\tvar fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );\n\t\t\tvar vertexShader = gl.createShader( gl.VERTEX_SHADER );\n\n\t\t\tvar prefix = \"precision \" + renderer.getPrecision() + \" float;\\n\";\n\n\t\t\tgl.shaderSource( fragmentShader, prefix + shader.fragmentShader );\n\t\t\tgl.shaderSource( vertexShader, prefix + shader.vertexShader );\n\n\t\t\tgl.compileShader( fragmentShader );\n\t\t\tgl.compileShader( vertexShader );\n\n\t\t\tgl.attachShader( program, fragmentShader );\n\t\t\tgl.attachShader( program, vertexShader );\n\n\t\t\tgl.linkProgram( program );\n\n\t\t\treturn program;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction SpritePlugin( renderer, sprites ) {\n\n\t\tvar gl = renderer.context;\n\t\tvar state = renderer.state;\n\n\t\tvar vertexBuffer, elementBuffer;\n\t\tvar program, attributes, uniforms;\n\n\t\tvar texture;\n\n\t\t// decompose matrixWorld\n\n\t\tvar spritePosition = new Vector3();\n\t\tvar spriteRotation = new Quaternion();\n\t\tvar spriteScale = new Vector3();\n\n\t\tfunction init() {\n\n\t\t\tvar vertices = new Float32Array( [\n\t\t\t\t- 0.5, - 0.5, 0, 0,\n\t\t\t\t 0.5, - 0.5, 1, 0,\n\t\t\t\t 0.5, 0.5, 1, 1,\n\t\t\t\t- 0.5, 0.5, 0, 1\n\t\t\t] );\n\n\t\t\tvar faces = new Uint16Array( [\n\t\t\t\t0, 1, 2,\n\t\t\t\t0, 2, 3\n\t\t\t] );\n\n\t\t\tvertexBuffer = gl.createBuffer();\n\t\t\telementBuffer = gl.createBuffer();\n\n\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer );\n\t\t\tgl.bufferData( gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW );\n\n\t\t\tgl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer );\n\t\t\tgl.bufferData( gl.ELEMENT_ARRAY_BUFFER, faces, gl.STATIC_DRAW );\n\n\t\t\tprogram = createProgram();\n\n\t\t\tattributes = {\n\t\t\t\tposition:\t\t\tgl.getAttribLocation ( program, 'position' ),\n\t\t\t\tuv:\t\t\t\t\tgl.getAttribLocation ( program, 'uv' )\n\t\t\t};\n\n\t\t\tuniforms = {\n\t\t\t\tuvOffset:\t\t\tgl.getUniformLocation( program, 'uvOffset' ),\n\t\t\t\tuvScale:\t\t\tgl.getUniformLocation( program, 'uvScale' ),\n\n\t\t\t\trotation:\t\t\tgl.getUniformLocation( program, 'rotation' ),\n\t\t\t\tscale:\t\t\t\tgl.getUniformLocation( program, 'scale' ),\n\n\t\t\t\tcolor:\t\t\t\tgl.getUniformLocation( program, 'color' ),\n\t\t\t\tmap:\t\t\t\tgl.getUniformLocation( program, 'map' ),\n\t\t\t\topacity:\t\t\tgl.getUniformLocation( program, 'opacity' ),\n\n\t\t\t\tmodelViewMatrix: \tgl.getUniformLocation( program, 'modelViewMatrix' ),\n\t\t\t\tprojectionMatrix:\tgl.getUniformLocation( program, 'projectionMatrix' ),\n\n\t\t\t\tfogType:\t\t\tgl.getUniformLocation( program, 'fogType' ),\n\t\t\t\tfogDensity:\t\t\tgl.getUniformLocation( program, 'fogDensity' ),\n\t\t\t\tfogNear:\t\t\tgl.getUniformLocation( program, 'fogNear' ),\n\t\t\t\tfogFar:\t\t\t\tgl.getUniformLocation( program, 'fogFar' ),\n\t\t\t\tfogColor:\t\t\tgl.getUniformLocation( program, 'fogColor' ),\n\n\t\t\t\talphaTest:\t\t\tgl.getUniformLocation( program, 'alphaTest' )\n\t\t\t};\n\n\t\t\tvar canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );\n\t\t\tcanvas.width = 8;\n\t\t\tcanvas.height = 8;\n\n\t\t\tvar context = canvas.getContext( '2d' );\n\t\t\tcontext.fillStyle = 'white';\n\t\t\tcontext.fillRect( 0, 0, 8, 8 );\n\n\t\t\ttexture = new Texture( canvas );\n\t\t\ttexture.needsUpdate = true;\n\n\t\t}\n\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( sprites.length === 0 ) return;\n\n\t\t\t// setup gl\n\n\t\t\tif ( program === undefined ) {\n\n\t\t\t\tinit();\n\n\t\t\t}\n\n\t\t\tgl.useProgram( program );\n\n\t\t\tstate.initAttributes();\n\t\t\tstate.enableAttribute( attributes.position );\n\t\t\tstate.enableAttribute( attributes.uv );\n\t\t\tstate.disableUnusedAttributes();\n\n\t\t\tstate.disable( gl.CULL_FACE );\n\t\t\tstate.enable( gl.BLEND );\n\n\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer );\n\t\t\tgl.vertexAttribPointer( attributes.position, 2, gl.FLOAT, false, 2 * 8, 0 );\n\t\t\tgl.vertexAttribPointer( attributes.uv, 2, gl.FLOAT, false, 2 * 8, 8 );\n\n\t\t\tgl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer );\n\n\t\t\tgl.uniformMatrix4fv( uniforms.projectionMatrix, false, camera.projectionMatrix.elements );\n\n\t\t\tstate.activeTexture( gl.TEXTURE0 );\n\t\t\tgl.uniform1i( uniforms.map, 0 );\n\n\t\t\tvar oldFogType = 0;\n\t\t\tvar sceneFogType = 0;\n\t\t\tvar fog = scene.fog;\n\n\t\t\tif ( fog ) {\n\n\t\t\t\tgl.uniform3f( uniforms.fogColor, fog.color.r, fog.color.g, fog.color.b );\n\n\t\t\t\tif ( (fog && fog.isFog) ) {\n\n\t\t\t\t\tgl.uniform1f( uniforms.fogNear, fog.near );\n\t\t\t\t\tgl.uniform1f( uniforms.fogFar, fog.far );\n\n\t\t\t\t\tgl.uniform1i( uniforms.fogType, 1 );\n\t\t\t\t\toldFogType = 1;\n\t\t\t\t\tsceneFogType = 1;\n\n\t\t\t\t} else if ( (fog && fog.isFogExp2) ) {\n\n\t\t\t\t\tgl.uniform1f( uniforms.fogDensity, fog.density );\n\n\t\t\t\t\tgl.uniform1i( uniforms.fogType, 2 );\n\t\t\t\t\toldFogType = 2;\n\t\t\t\t\tsceneFogType = 2;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tgl.uniform1i( uniforms.fogType, 0 );\n\t\t\t\toldFogType = 0;\n\t\t\t\tsceneFogType = 0;\n\n\t\t\t}\n\n\n\t\t\t// update positions and sort\n\n\t\t\tfor ( var i = 0, l = sprites.length; i < l; i ++ ) {\n\n\t\t\t\tvar sprite = sprites[ i ];\n\n\t\t\t\tsprite.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld );\n\t\t\t\tsprite.z = - sprite.modelViewMatrix.elements[ 14 ];\n\n\t\t\t}\n\n\t\t\tsprites.sort( painterSortStable );\n\n\t\t\t// render all sprites\n\n\t\t\tvar scale = [];\n\n\t\t\tfor ( var i = 0, l = sprites.length; i < l; i ++ ) {\n\n\t\t\t\tvar sprite = sprites[ i ];\n\t\t\t\tvar material = sprite.material;\n\n\t\t\t\tif ( material.visible === false ) continue;\n\n\t\t\t\tgl.uniform1f( uniforms.alphaTest, material.alphaTest );\n\t\t\t\tgl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite.modelViewMatrix.elements );\n\n\t\t\t\tsprite.matrixWorld.decompose( spritePosition, spriteRotation, spriteScale );\n\n\t\t\t\tscale[ 0 ] = spriteScale.x;\n\t\t\t\tscale[ 1 ] = spriteScale.y;\n\n\t\t\t\tvar fogType = 0;\n\n\t\t\t\tif ( scene.fog && material.fog ) {\n\n\t\t\t\t\tfogType = sceneFogType;\n\n\t\t\t\t}\n\n\t\t\t\tif ( oldFogType !== fogType ) {\n\n\t\t\t\t\tgl.uniform1i( uniforms.fogType, fogType );\n\t\t\t\t\toldFogType = fogType;\n\n\t\t\t\t}\n\n\t\t\t\tif ( material.map !== null ) {\n\n\t\t\t\t\tgl.uniform2f( uniforms.uvOffset, material.map.offset.x, material.map.offset.y );\n\t\t\t\t\tgl.uniform2f( uniforms.uvScale, material.map.repeat.x, material.map.repeat.y );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tgl.uniform2f( uniforms.uvOffset, 0, 0 );\n\t\t\t\t\tgl.uniform2f( uniforms.uvScale, 1, 1 );\n\n\t\t\t\t}\n\n\t\t\t\tgl.uniform1f( uniforms.opacity, material.opacity );\n\t\t\t\tgl.uniform3f( uniforms.color, material.color.r, material.color.g, material.color.b );\n\n\t\t\t\tgl.uniform1f( uniforms.rotation, material.rotation );\n\t\t\t\tgl.uniform2fv( uniforms.scale, scale );\n\n\t\t\t\tstate.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst );\n\t\t\t\tstate.setDepthTest( material.depthTest );\n\t\t\t\tstate.setDepthWrite( material.depthWrite );\n\n\t\t\t\tif ( material.map ) {\n\n\t\t\t\t\trenderer.setTexture2D( material.map, 0 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setTexture2D( texture, 0 );\n\n\t\t\t\t}\n\n\t\t\t\tgl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );\n\n\t\t\t}\n\n\t\t\t// restore gl\n\n\t\t\tstate.enable( gl.CULL_FACE );\n\n\t\t\trenderer.resetGLState();\n\n\t\t};\n\n\t\tfunction createProgram() {\n\n\t\t\tvar program = gl.createProgram();\n\n\t\t\tvar vertexShader = gl.createShader( gl.VERTEX_SHADER );\n\t\t\tvar fragmentShader = gl.createShader( gl.FRAGMENT_SHADER );\n\n\t\t\tgl.shaderSource( vertexShader, [\n\n\t\t\t\t'precision ' + renderer.getPrecision() + ' float;',\n\n\t\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t\t'uniform float rotation;',\n\t\t\t\t'uniform vec2 scale;',\n\t\t\t\t'uniform vec2 uvOffset;',\n\t\t\t\t'uniform vec2 uvScale;',\n\n\t\t\t\t'attribute vec2 position;',\n\t\t\t\t'attribute vec2 uv;',\n\n\t\t\t\t'varying vec2 vUV;',\n\n\t\t\t\t'void main() {',\n\n\t\t\t\t\t'vUV = uvOffset + uv * uvScale;',\n\n\t\t\t\t\t'vec2 alignedPosition = position * scale;',\n\n\t\t\t\t\t'vec2 rotatedPosition;',\n\t\t\t\t\t'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',\n\t\t\t\t\t'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',\n\n\t\t\t\t\t'vec4 finalPosition;',\n\n\t\t\t\t\t'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',\n\t\t\t\t\t'finalPosition.xy += rotatedPosition;',\n\t\t\t\t\t'finalPosition = projectionMatrix * finalPosition;',\n\n\t\t\t\t\t'gl_Position = finalPosition;',\n\n\t\t\t\t'}'\n\n\t\t\t].join( '\\n' ) );\n\n\t\t\tgl.shaderSource( fragmentShader, [\n\n\t\t\t\t'precision ' + renderer.getPrecision() + ' float;',\n\n\t\t\t\t'uniform vec3 color;',\n\t\t\t\t'uniform sampler2D map;',\n\t\t\t\t'uniform float opacity;',\n\n\t\t\t\t'uniform int fogType;',\n\t\t\t\t'uniform vec3 fogColor;',\n\t\t\t\t'uniform float fogDensity;',\n\t\t\t\t'uniform float fogNear;',\n\t\t\t\t'uniform float fogFar;',\n\t\t\t\t'uniform float alphaTest;',\n\n\t\t\t\t'varying vec2 vUV;',\n\n\t\t\t\t'void main() {',\n\n\t\t\t\t\t'vec4 texture = texture2D( map, vUV );',\n\n\t\t\t\t\t'if ( texture.a < alphaTest ) discard;',\n\n\t\t\t\t\t'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',\n\n\t\t\t\t\t'if ( fogType > 0 ) {',\n\n\t\t\t\t\t\t'float depth = gl_FragCoord.z / gl_FragCoord.w;',\n\t\t\t\t\t\t'float fogFactor = 0.0;',\n\n\t\t\t\t\t\t'if ( fogType == 1 ) {',\n\n\t\t\t\t\t\t\t'fogFactor = smoothstep( fogNear, fogFar, depth );',\n\n\t\t\t\t\t\t'} else {',\n\n\t\t\t\t\t\t\t'const float LOG2 = 1.442695;',\n\t\t\t\t\t\t\t'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',\n\t\t\t\t\t\t\t'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',\n\n\t\t\t\t\t\t'}',\n\n\t\t\t\t\t\t'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',\n\n\t\t\t\t\t'}',\n\n\t\t\t\t'}'\n\n\t\t\t].join( '\\n' ) );\n\n\t\t\tgl.compileShader( vertexShader );\n\t\t\tgl.compileShader( fragmentShader );\n\n\t\t\tgl.attachShader( program, vertexShader );\n\t\t\tgl.attachShader( program, fragmentShader );\n\n\t\t\tgl.linkProgram( program );\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\tfunction painterSortStable( a, b ) {\n\n\t\t\tif ( a.renderOrder !== b.renderOrder ) {\n\n\t\t\t\treturn a.renderOrder - b.renderOrder;\n\n\t\t\t} else if ( a.z !== b.z ) {\n\n\t\t\t\treturn b.z - a.z;\n\n\t\t\t} else {\n\n\t\t\t\treturn b.id - a.id;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Material() {\n\n\t\tObject.defineProperty( this, 'id', { value: MaterialIdCount() } );\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Material';\n\n\t\tthis.fog = true;\n\t\tthis.lights = true;\n\n\t\tthis.blending = NormalBlending;\n\t\tthis.side = FrontSide;\n\t\tthis.shading = SmoothShading; // THREE.FlatShading, THREE.SmoothShading\n\t\tthis.vertexColors = NoColors; // THREE.NoColors, THREE.VertexColors, THREE.FaceColors\n\n\t\tthis.opacity = 1;\n\t\tthis.transparent = false;\n\n\t\tthis.blendSrc = SrcAlphaFactor;\n\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\t\tthis.blendEquation = AddEquation;\n\t\tthis.blendSrcAlpha = null;\n\t\tthis.blendDstAlpha = null;\n\t\tthis.blendEquationAlpha = null;\n\n\t\tthis.depthFunc = LessEqualDepth;\n\t\tthis.depthTest = true;\n\t\tthis.depthWrite = true;\n\n\t\tthis.clippingPlanes = null;\n\t\tthis.clipIntersection = false;\n\t\tthis.clipShadows = false;\n\n\t\tthis.colorWrite = true;\n\n\t\tthis.precision = null; // override the renderer's default precision for this material\n\n\t\tthis.polygonOffset = false;\n\t\tthis.polygonOffsetFactor = 0;\n\t\tthis.polygonOffsetUnits = 0;\n\n\t\tthis.alphaTest = 0;\n\t\tthis.premultipliedAlpha = false;\n\n\t\tthis.overdraw = 0; // Overdrawn pixels (typically between 0 and 1) for fixing antialiasing gaps in CanvasRenderer\n\n\t\tthis.visible = true;\n\n\t\tthis._needsUpdate = true;\n\n\t}\n\n\tMaterial.prototype = {\n\n\t\tconstructor: Material,\n\n\t\tisMaterial: true,\n\n\t\tget needsUpdate() {\n\n\t\t\treturn this._needsUpdate;\n\n\t\t},\n\n\t\tset needsUpdate( value ) {\n\n\t\t\tif ( value === true ) this.update();\n\t\t\tthis._needsUpdate = value;\n\n\t\t},\n\n\t\tsetValues: function ( values ) {\n\n\t\t\tif ( values === undefined ) return;\n\n\t\t\tfor ( var key in values ) {\n\n\t\t\t\tvar newValue = values[ key ];\n\n\t\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\t\tconsole.warn( \"THREE.Material: '\" + key + \"' parameter is undefined.\" );\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tvar currentValue = this[ key ];\n\n\t\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\t\tconsole.warn( \"THREE.\" + this.type + \": '\" + key + \"' is not a property of this material.\" );\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tif ( (currentValue && currentValue.isColor) ) {\n\n\t\t\t\t\tcurrentValue.set( newValue );\n\n\t\t\t\t} else if ( (currentValue && currentValue.isVector3) && (newValue && newValue.isVector3) ) {\n\n\t\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t\t} else if ( key === 'overdraw' ) {\n\n\t\t\t\t\t// ensure overdraw is backwards-compatible with legacy boolean type\n\t\t\t\t\tthis[ key ] = Number( newValue );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\tvar isRoot = meta === undefined;\n\n\t\t\tif ( isRoot ) {\n\n\t\t\t\tmeta = {\n\t\t\t\t\ttextures: {},\n\t\t\t\t\timages: {}\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tvar data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.4,\n\t\t\t\t\ttype: 'Material',\n\t\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// standard Material serialization\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.type = this.type;\n\n\t\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\t\tif ( (this.color && this.color.isColor) ) data.color = this.color.getHex();\n\n\t\t\tif ( this.roughness !== undefined ) data.roughness = this.roughness;\n\t\t\tif ( this.metalness !== undefined ) data.metalness = this.metalness;\n\n\t\t\tif ( (this.emissive && this.emissive.isColor) ) data.emissive = this.emissive.getHex();\n\t\t\tif ( (this.specular && this.specular.isColor) ) data.specular = this.specular.getHex();\n\t\t\tif ( this.shininess !== undefined ) data.shininess = this.shininess;\n\n\t\t\tif ( (this.map && this.map.isTexture) ) data.map = this.map.toJSON( meta ).uuid;\n\t\t\tif ( (this.alphaMap && this.alphaMap.isTexture) ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;\n\t\t\tif ( (this.lightMap && this.lightMap.isTexture) ) data.lightMap = this.lightMap.toJSON( meta ).uuid;\n\t\t\tif ( (this.bumpMap && this.bumpMap.isTexture) ) {\n\n\t\t\t\tdata.bumpMap = this.bumpMap.toJSON( meta ).uuid;\n\t\t\t\tdata.bumpScale = this.bumpScale;\n\n\t\t\t}\n\t\t\tif ( (this.normalMap && this.normalMap.isTexture) ) {\n\n\t\t\t\tdata.normalMap = this.normalMap.toJSON( meta ).uuid;\n\t\t\t\tdata.normalScale = this.normalScale.toArray();\n\n\t\t\t}\n\t\t\tif ( (this.displacementMap && this.displacementMap.isTexture) ) {\n\n\t\t\t\tdata.displacementMap = this.displacementMap.toJSON( meta ).uuid;\n\t\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\t\tdata.displacementBias = this.displacementBias;\n\n\t\t\t}\n\t\t\tif ( (this.roughnessMap && this.roughnessMap.isTexture) ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid;\n\t\t\tif ( (this.metalnessMap && this.metalnessMap.isTexture) ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid;\n\n\t\t\tif ( (this.emissiveMap && this.emissiveMap.isTexture) ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid;\n\t\t\tif ( (this.specularMap && this.specularMap.isTexture) ) data.specularMap = this.specularMap.toJSON( meta ).uuid;\n\n\t\t\tif ( (this.envMap && this.envMap.isTexture) ) {\n\n\t\t\t\tdata.envMap = this.envMap.toJSON( meta ).uuid;\n\t\t\t\tdata.reflectivity = this.reflectivity; // Scale behind envMap\n\n\t\t\t}\n\n\t\t\tif ( this.size !== undefined ) data.size = this.size;\n\t\t\tif ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;\n\n\t\t\tif ( this.blending !== NormalBlending ) data.blending = this.blending;\n\t\t\tif ( this.shading !== SmoothShading ) data.shading = this.shading;\n\t\t\tif ( this.side !== FrontSide ) data.side = this.side;\n\t\t\tif ( this.vertexColors !== NoColors ) data.vertexColors = this.vertexColors;\n\n\t\t\tif ( this.opacity < 1 ) data.opacity = this.opacity;\n\t\t\tif ( this.transparent === true ) data.transparent = this.transparent;\n\n\t\t\tdata.depthFunc = this.depthFunc;\n\t\t\tdata.depthTest = this.depthTest;\n\t\t\tdata.depthWrite = this.depthWrite;\n\n\t\t\tif ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;\n\t\t\tif ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;\n\t\t\tif ( this.wireframe === true ) data.wireframe = this.wireframe;\n\t\t\tif ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\t\tif ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;\n\t\t\tif ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;\n\n\t\t\tdata.skinning = this.skinning;\n\t\t\tdata.morphTargets = this.morphTargets;\n\n\t\t\t// TODO: Copied from Object3D.toJSON\n\n\t\t\tfunction extractFromCache( cache ) {\n\n\t\t\t\tvar values = [];\n\n\t\t\t\tfor ( var key in cache ) {\n\n\t\t\t\t\tvar data = cache[ key ];\n\t\t\t\t\tdelete data.metadata;\n\t\t\t\t\tvalues.push( data );\n\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\n\t\t\t}\n\n\t\t\tif ( isRoot ) {\n\n\t\t\t\tvar textures = extractFromCache( meta.textures );\n\t\t\t\tvar images = extractFromCache( meta.images );\n\n\t\t\t\tif ( textures.length > 0 ) data.textures = textures;\n\t\t\t\tif ( images.length > 0 ) data.images = images;\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.name = source.name;\n\n\t\t\tthis.fog = source.fog;\n\t\t\tthis.lights = source.lights;\n\n\t\t\tthis.blending = source.blending;\n\t\t\tthis.side = source.side;\n\t\t\tthis.shading = source.shading;\n\t\t\tthis.vertexColors = source.vertexColors;\n\n\t\t\tthis.opacity = source.opacity;\n\t\t\tthis.transparent = source.transparent;\n\n\t\t\tthis.blendSrc = source.blendSrc;\n\t\t\tthis.blendDst = source.blendDst;\n\t\t\tthis.blendEquation = source.blendEquation;\n\t\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\n\t\t\tthis.depthFunc = source.depthFunc;\n\t\t\tthis.depthTest = source.depthTest;\n\t\t\tthis.depthWrite = source.depthWrite;\n\n\t\t\tthis.colorWrite = source.colorWrite;\n\n\t\t\tthis.precision = source.precision;\n\n\t\t\tthis.polygonOffset = source.polygonOffset;\n\t\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\n\t\t\tthis.alphaTest = source.alphaTest;\n\n\t\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\n\t\t\tthis.overdraw = source.overdraw;\n\n\t\t\tthis.visible = source.visible;\n\t\t\tthis.clipShadows = source.clipShadows;\n\t\t\tthis.clipIntersection = source.clipIntersection;\n\n\t\t\tvar srcPlanes = source.clippingPlanes,\n\t\t\t\tdstPlanes = null;\n\n\t\t\tif ( srcPlanes !== null ) {\n\n\t\t\t\tvar n = srcPlanes.length;\n\t\t\t\tdstPlanes = new Array( n );\n\n\t\t\t\tfor ( var i = 0; i !== n; ++ i )\n\t\t\t\t\tdstPlanes[ i ] = srcPlanes[ i ].clone();\n\n\t\t\t}\n\n\t\t\tthis.clippingPlanes = dstPlanes;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tthis.dispatchEvent( { type: 'update' } );\n\n\t\t},\n\n\t\tdispose: function () {\n\n\t\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\t}\n\n\t};\n\n\tObject.assign( Material.prototype, EventDispatcher.prototype );\n\n\tvar count$1 = 0;\n\tfunction MaterialIdCount() { return count$1++; }\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * defines: { \"label\" : \"value\" },\n\t * uniforms: { \"parameter1\": { value: 1.0 }, \"parameter2\": { value2: 2 } },\n\t *\n\t * fragmentShader: ,\n\t * vertexShader: ,\n\t *\n\t * wireframe: ,\n\t * wireframeLinewidth: ,\n\t *\n\t * lights: ,\n\t *\n\t * skinning: ,\n\t * morphTargets: ,\n\t * morphNormals: \n\t * }\n\t */\n\n\tfunction ShaderMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'ShaderMaterial';\n\n\t\tthis.defines = {};\n\t\tthis.uniforms = {};\n\n\t\tthis.vertexShader = 'void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}';\n\t\tthis.fragmentShader = 'void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}';\n\n\t\tthis.linewidth = 1;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false; // set to use scene fog\n\t\tthis.lights = false; // set to use scene lights\n\t\tthis.clipping = false; // set to use user-defined clipping planes\n\n\t\tthis.skinning = false; // set to use skinning attribute streams\n\t\tthis.morphTargets = false; // set to use morph targets\n\t\tthis.morphNormals = false; // set to use morph normals\n\n\t\tthis.extensions = {\n\t\t\tderivatives: false, // set to use derivatives\n\t\t\tfragDepth: false, // set to use fragment depth values\n\t\t\tdrawBuffers: false, // set to use draw buffers\n\t\t\tshaderTextureLOD: false // set to use shader texture LOD\n\t\t};\n\n\t\t// When rendered geometry doesn't include these attributes but the material does,\n\t\t// use these default values in WebGL. This avoids errors when buffer data is missing.\n\t\tthis.defaultAttributeValues = {\n\t\t\t'color': [ 1, 1, 1 ],\n\t\t\t'uv': [ 0, 0 ],\n\t\t\t'uv2': [ 0, 0 ]\n\t\t};\n\n\t\tthis.index0AttributeName = undefined;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tif ( parameters.attributes !== undefined ) {\n\n\t\t\t\tconsole.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' );\n\n\t\t\t}\n\n\t\t\tthis.setValues( parameters );\n\n\t\t}\n\n\t}\n\n\tShaderMaterial.prototype = Object.create( Material.prototype );\n\tShaderMaterial.prototype.constructor = ShaderMaterial;\n\n\tShaderMaterial.prototype.isShaderMaterial = true;\n\n\tShaderMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.fragmentShader = source.fragmentShader;\n\t\tthis.vertexShader = source.vertexShader;\n\n\t\tthis.uniforms = UniformsUtils.clone( source.uniforms );\n\n\t\tthis.defines = source.defines;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.lights = source.lights;\n\t\tthis.clipping = source.clipping;\n\n\t\tthis.skinning = source.skinning;\n\n\t\tthis.morphTargets = source.morphTargets;\n\t\tthis.morphNormals = source.morphNormals;\n\n\t\tthis.extensions = source.extensions;\n\n\t\treturn this;\n\n\t};\n\n\tShaderMaterial.prototype.toJSON = function ( meta ) {\n\n\t\tvar data = Material.prototype.toJSON.call( this, meta );\n\n\t\tdata.uniforms = this.uniforms;\n\t\tdata.vertexShader = this.vertexShader;\n\t\tdata.fragmentShader = this.fragmentShader;\n\n\t\treturn data;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author bhouston / https://clara.io\n\t * @author WestLangley / http://github.com/WestLangley\n\t *\n\t * parameters = {\n\t *\n\t * opacity: ,\n\t *\n\t * map: new THREE.Texture( ),\n\t *\n\t * alphaMap: new THREE.Texture( ),\n\t *\n\t * displacementMap: new THREE.Texture( ),\n\t * displacementScale: ,\n\t * displacementBias: ,\n\t *\n\t * wireframe: ,\n\t * wireframeLinewidth: \n\t * }\n\t */\n\n\tfunction MeshDepthMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'MeshDepthMaterial';\n\n\t\tthis.depthPacking = BasicDepthPacking;\n\n\t\tthis.skinning = false;\n\t\tthis.morphTargets = false;\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false;\n\t\tthis.lights = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tMeshDepthMaterial.prototype = Object.create( Material.prototype );\n\tMeshDepthMaterial.prototype.constructor = MeshDepthMaterial;\n\n\tMeshDepthMaterial.prototype.isMeshDepthMaterial = true;\n\n\tMeshDepthMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.depthPacking = source.depthPacking;\n\n\t\tthis.skinning = source.skinning;\n\t\tthis.morphTargets = source.morphTargets;\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\n\tfunction Box3( min, max ) {\n\n\t\tthis.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity );\n\t\tthis.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity );\n\n\t}\n\n\tBox3.prototype = {\n\n\t\tconstructor: Box3,\n\n\t\tisBox3: true,\n\n\t\tset: function ( min, max ) {\n\n\t\t\tthis.min.copy( min );\n\t\t\tthis.max.copy( max );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromArray: function ( array ) {\n\n\t\t\tvar minX = + Infinity;\n\t\t\tvar minY = + Infinity;\n\t\t\tvar minZ = + Infinity;\n\n\t\t\tvar maxX = - Infinity;\n\t\t\tvar maxY = - Infinity;\n\t\t\tvar maxZ = - Infinity;\n\n\t\t\tfor ( var i = 0, l = array.length; i < l; i += 3 ) {\n\n\t\t\t\tvar x = array[ i ];\n\t\t\t\tvar y = array[ i + 1 ];\n\t\t\t\tvar z = array[ i + 2 ];\n\n\t\t\t\tif ( x < minX ) minX = x;\n\t\t\t\tif ( y < minY ) minY = y;\n\t\t\t\tif ( z < minZ ) minZ = z;\n\n\t\t\t\tif ( x > maxX ) maxX = x;\n\t\t\t\tif ( y > maxY ) maxY = y;\n\t\t\t\tif ( z > maxZ ) maxZ = z;\n\n\t\t\t}\n\n\t\t\tthis.min.set( minX, minY, minZ );\n\t\t\tthis.max.set( maxX, maxY, maxZ );\n\n\t\t},\n\n\t\tsetFromPoints: function ( points ) {\n\n\t\t\tthis.makeEmpty();\n\n\t\t\tfor ( var i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromCenterAndSize: function () {\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function setFromCenterAndSize( center, size ) {\n\n\t\t\t\tvar halfSize = v1.copy( size ).multiplyScalar( 0.5 );\n\n\t\t\t\tthis.min.copy( center ).sub( halfSize );\n\t\t\t\tthis.max.copy( center ).add( halfSize );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tsetFromObject: function () {\n\n\t\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t\t// accounting for both the object's, and children's, world transforms\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function setFromObject( object ) {\n\n\t\t\t\tvar scope = this;\n\n\t\t\t\tobject.updateMatrixWorld( true );\n\n\t\t\t\tthis.makeEmpty();\n\n\t\t\t\tobject.traverse( function ( node ) {\n\n\t\t\t\t\tvar geometry = node.geometry;\n\n\t\t\t\t\tif ( geometry !== undefined ) {\n\n\t\t\t\t\t\tif ( (geometry && geometry.isGeometry) ) {\n\n\t\t\t\t\t\t\tvar vertices = geometry.vertices;\n\n\t\t\t\t\t\t\tfor ( var i = 0, il = vertices.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\t\tv1.copy( vertices[ i ] );\n\t\t\t\t\t\t\t\tv1.applyMatrix4( node.matrixWorld );\n\n\t\t\t\t\t\t\t\tscope.expandByPoint( v1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( (geometry && geometry.isBufferGeometry) ) {\n\n\t\t\t\t\t\t\tvar attribute = geometry.attributes.position;\n\n\t\t\t\t\t\t\tif ( attribute !== undefined ) {\n\n\t\t\t\t\t\t\t\tvar array, offset, stride;\n\n\t\t\t\t\t\t\t\tif ( (attribute && attribute.isInterleavedBufferAttribute) ) {\n\n\t\t\t\t\t\t\t\t\tarray = attribute.data.array;\n\t\t\t\t\t\t\t\t\toffset = attribute.offset;\n\t\t\t\t\t\t\t\t\tstride = attribute.data.stride;\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tarray = attribute.array;\n\t\t\t\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\t\t\t\tstride = 3;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfor ( var i = offset, il = array.length; i < il; i += stride ) {\n\n\t\t\t\t\t\t\t\t\tv1.fromArray( array, i );\n\t\t\t\t\t\t\t\t\tv1.applyMatrix4( node.matrixWorld );\n\n\t\t\t\t\t\t\t\t\tscope.expandByPoint( v1 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( box ) {\n\n\t\t\tthis.min.copy( box.min );\n\t\t\tthis.max.copy( box.max );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tmakeEmpty: function () {\n\n\t\t\tthis.min.x = this.min.y = this.min.z = + Infinity;\n\t\t\tthis.max.x = this.max.y = this.max.z = - Infinity;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tisEmpty: function () {\n\n\t\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z );\n\n\t\t},\n\n\t\tgetCenter: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn this.isEmpty() ? result.set( 0, 0, 0 ) : result.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t\t},\n\n\t\tgetSize: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn this.isEmpty() ? result.set( 0, 0, 0 ) : result.subVectors( this.max, this.min );\n\n\t\t},\n\n\t\texpandByPoint: function ( point ) {\n\n\t\t\tthis.min.min( point );\n\t\t\tthis.max.max( point );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\texpandByVector: function ( vector ) {\n\n\t\t\tthis.min.sub( vector );\n\t\t\tthis.max.add( vector );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\texpandByScalar: function ( scalar ) {\n\n\t\t\tthis.min.addScalar( - scalar );\n\t\t\tthis.max.addScalar( scalar );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcontainsPoint: function ( point ) {\n\n\t\t\tif ( point.x < this.min.x || point.x > this.max.x ||\n\t\t\t\t\t point.y < this.min.y || point.y > this.max.y ||\n\t\t\t\t\t point.z < this.min.z || point.z > this.max.z ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t},\n\n\t\tcontainsBox: function ( box ) {\n\n\t\t\tif ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&\n\t\t\t\t ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) &&\n\t\t\t\t ( this.min.z <= box.min.z ) && ( box.max.z <= this.max.z ) ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t},\n\n\t\tgetParameter: function ( point, optionalTarget ) {\n\n\t\t\t// This can potentially have a divide by zero if the box\n\t\t\t// has a size dimension of 0.\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\treturn result.set(\n\t\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y ),\n\t\t\t\t( point.z - this.min.z ) / ( this.max.z - this.min.z )\n\t\t\t);\n\n\t\t},\n\n\t\tintersectsBox: function ( box ) {\n\n\t\t\t// using 6 splitting planes to rule out intersections.\n\n\t\t\tif ( box.max.x < this.min.x || box.min.x > this.max.x ||\n\t\t\t\t\t box.max.y < this.min.y || box.min.y > this.max.y ||\n\t\t\t\t\t box.max.z < this.min.z || box.min.z > this.max.z ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t},\n\n\t\tintersectsSphere: ( function () {\n\n\t\t\tvar closestPoint;\n\n\t\t\treturn function intersectsSphere( sphere ) {\n\n\t\t\t\tif ( closestPoint === undefined ) closestPoint = new Vector3();\n\n\t\t\t\t// Find the point on the AABB closest to the sphere center.\n\t\t\t\tthis.clampPoint( sphere.center, closestPoint );\n\n\t\t\t\t// If that point is inside the sphere, the AABB and sphere intersect.\n\t\t\t\treturn closestPoint.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t\t\t};\n\n\t\t} )(),\n\n\t\tintersectsPlane: function ( plane ) {\n\n\t\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\n\t\t\tvar min, max;\n\n\t\t\tif ( plane.normal.x > 0 ) {\n\n\t\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\t\tmax = plane.normal.x * this.max.x;\n\n\t\t\t} else {\n\n\t\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\t\tmax = plane.normal.x * this.min.x;\n\n\t\t\t}\n\n\t\t\tif ( plane.normal.y > 0 ) {\n\n\t\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\t\tmax += plane.normal.y * this.max.y;\n\n\t\t\t} else {\n\n\t\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\t\tmax += plane.normal.y * this.min.y;\n\n\t\t\t}\n\n\t\t\tif ( plane.normal.z > 0 ) {\n\n\t\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\t\tmax += plane.normal.z * this.max.z;\n\n\t\t\t} else {\n\n\t\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\t\tmax += plane.normal.z * this.min.z;\n\n\t\t\t}\n\n\t\t\treturn ( min <= plane.constant && max >= plane.constant );\n\n\t\t},\n\n\t\tclampPoint: function ( point, optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn result.copy( point ).clamp( this.min, this.max );\n\n\t\t},\n\n\t\tdistanceToPoint: function () {\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function distanceToPoint( point ) {\n\n\t\t\t\tvar clampedPoint = v1.copy( point ).clamp( this.min, this.max );\n\t\t\t\treturn clampedPoint.sub( point ).length();\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tgetBoundingSphere: function () {\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function getBoundingSphere( optionalTarget ) {\n\n\t\t\t\tvar result = optionalTarget || new Sphere();\n\n\t\t\t\tthis.getCenter( result.center );\n\n\t\t\t\tresult.radius = this.getSize( v1 ).length() * 0.5;\n\n\t\t\t\treturn result;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tintersect: function ( box ) {\n\n\t\t\tthis.min.max( box.min );\n\t\t\tthis.max.min( box.max );\n\n\t\t\t// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\t\t\tif( this.isEmpty() ) this.makeEmpty();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tunion: function ( box ) {\n\n\t\t\tthis.min.min( box.min );\n\t\t\tthis.max.max( box.max );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyMatrix4: function () {\n\n\t\t\tvar points = [\n\t\t\t\tnew Vector3(),\n\t\t\t\tnew Vector3(),\n\t\t\t\tnew Vector3(),\n\t\t\t\tnew Vector3(),\n\t\t\t\tnew Vector3(),\n\t\t\t\tnew Vector3(),\n\t\t\t\tnew Vector3(),\n\t\t\t\tnew Vector3()\n\t\t\t];\n\n\t\t\treturn function applyMatrix4( matrix ) {\n\n\t\t\t\t// transform of empty box is an empty box.\n\t\t\t\tif( this.isEmpty() ) return this;\n\n\t\t\t\t// NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\t\t\t\tpoints[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000\n\t\t\t\tpoints[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001\n\t\t\t\tpoints[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010\n\t\t\t\tpoints[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011\n\t\t\t\tpoints[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100\n\t\t\t\tpoints[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101\n\t\t\t\tpoints[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110\n\t\t\t\tpoints[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix );\t// 111\n\n\t\t\t\tthis.setFromPoints( points );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslate: function ( offset ) {\n\n\t\t\tthis.min.add( offset );\n\t\t\tthis.max.add( offset );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( box ) {\n\n\t\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Sphere( center, radius ) {\n\n\t\tthis.center = ( center !== undefined ) ? center : new Vector3();\n\t\tthis.radius = ( radius !== undefined ) ? radius : 0;\n\n\t}\n\n\tSphere.prototype = {\n\n\t\tconstructor: Sphere,\n\n\t\tset: function ( center, radius ) {\n\n\t\t\tthis.center.copy( center );\n\t\t\tthis.radius = radius;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromPoints: function () {\n\n\t\t\tvar box = new Box3();\n\n\t\t\treturn function setFromPoints( points, optionalCenter ) {\n\n\t\t\t\tvar center = this.center;\n\n\t\t\t\tif ( optionalCenter !== undefined ) {\n\n\t\t\t\t\tcenter.copy( optionalCenter );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbox.setFromPoints( points ).getCenter( center );\n\n\t\t\t\t}\n\n\t\t\t\tvar maxRadiusSq = 0;\n\n\t\t\t\tfor ( var i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tthis.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( sphere ) {\n\n\t\t\tthis.center.copy( sphere.center );\n\t\t\tthis.radius = sphere.radius;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tempty: function () {\n\n\t\t\treturn ( this.radius <= 0 );\n\n\t\t},\n\n\t\tcontainsPoint: function ( point ) {\n\n\t\t\treturn ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) );\n\n\t\t},\n\n\t\tdistanceToPoint: function ( point ) {\n\n\t\t\treturn ( point.distanceTo( this.center ) - this.radius );\n\n\t\t},\n\n\t\tintersectsSphere: function ( sphere ) {\n\n\t\t\tvar radiusSum = this.radius + sphere.radius;\n\n\t\t\treturn sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum );\n\n\t\t},\n\n\t\tintersectsBox: function ( box ) {\n\n\t\t\treturn box.intersectsSphere( this );\n\n\t\t},\n\n\t\tintersectsPlane: function ( plane ) {\n\n\t\t\t// We use the following equation to compute the signed distance from\n\t\t\t// the center of the sphere to the plane.\n\t\t\t//\n\t\t\t// distance = q * n - d\n\t\t\t//\n\t\t\t// If this distance is greater than the radius of the sphere,\n\t\t\t// then there is no intersection.\n\n\t\t\treturn Math.abs( this.center.dot( plane.normal ) - plane.constant ) <= this.radius;\n\n\t\t},\n\n\t\tclampPoint: function ( point, optionalTarget ) {\n\n\t\t\tvar deltaLengthSq = this.center.distanceToSquared( point );\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\tresult.copy( point );\n\n\t\t\tif ( deltaLengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\t\tresult.sub( this.center ).normalize();\n\t\t\t\tresult.multiplyScalar( this.radius ).add( this.center );\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t},\n\n\t\tgetBoundingBox: function ( optionalTarget ) {\n\n\t\t\tvar box = optionalTarget || new Box3();\n\n\t\t\tbox.set( this.center, this.center );\n\t\t\tbox.expandByScalar( this.radius );\n\n\t\t\treturn box;\n\n\t\t},\n\n\t\tapplyMatrix4: function ( matrix ) {\n\n\t\t\tthis.center.applyMatrix4( matrix );\n\t\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttranslate: function ( offset ) {\n\n\t\t\tthis.center.add( offset );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( sphere ) {\n\n\t\t\treturn sphere.center.equals( this.center ) && ( sphere.radius === this.radius );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author bhouston / http://clara.io\n\t * @author tschw\n\t */\n\n\tfunction Matrix3() {\n\n\t\tthis.elements = new Float32Array( [\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t] );\n\n\t\tif ( arguments.length > 0 ) {\n\n\t\t\tconsole.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' );\n\n\t\t}\n\n\t}\n\n\tMatrix3.prototype = {\n\n\t\tconstructor: Matrix3,\n\n\t\tisMatrix3: true,\n\n\t\tset: function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tte[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31;\n\t\t\tte[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32;\n\t\t\tte[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tidentity: function () {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0,\n\t\t\t\t0, 1, 0,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().fromArray( this.elements );\n\n\t\t},\n\n\t\tcopy: function ( m ) {\n\n\t\t\tvar me = m.elements;\n\n\t\t\tthis.set(\n\n\t\t\t\tme[ 0 ], me[ 3 ], me[ 6 ],\n\t\t\t\tme[ 1 ], me[ 4 ], me[ 7 ],\n\t\t\t\tme[ 2 ], me[ 5 ], me[ 8 ]\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromMatrix4: function( m ) {\n\n\t\t\tvar me = m.elements;\n\n\t\t\tthis.set(\n\n\t\t\t\tme[ 0 ], me[ 4 ], me[ 8 ],\n\t\t\t\tme[ 1 ], me[ 5 ], me[ 9 ],\n\t\t\t\tme[ 2 ], me[ 6 ], me[ 10 ]\n\n\t\t\t);\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tapplyToVector3Array: function () {\n\n\t\t\tvar v1;\n\n\t\t\treturn function applyToVector3Array( array, offset, length ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\t\t\t\tif ( offset === undefined ) offset = 0;\n\t\t\t\tif ( length === undefined ) length = array.length;\n\n\t\t\t\tfor ( var i = 0, j = offset; i < length; i += 3, j += 3 ) {\n\n\t\t\t\t\tv1.fromArray( array, j );\n\t\t\t\t\tv1.applyMatrix3( this );\n\t\t\t\t\tv1.toArray( array, j );\n\n\t\t\t\t}\n\n\t\t\t\treturn array;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tapplyToBuffer: function () {\n\n\t\t\tvar v1;\n\n\t\t\treturn function applyToBuffer( buffer, offset, length ) {\n\n\t\t\t\tif ( v1 === undefined ) v1 = new Vector3();\n\t\t\t\tif ( offset === undefined ) offset = 0;\n\t\t\t\tif ( length === undefined ) length = buffer.length / buffer.itemSize;\n\n\t\t\t\tfor ( var i = 0, j = offset; i < length; i ++, j ++ ) {\n\n\t\t\t\t\tv1.x = buffer.getX( j );\n\t\t\t\t\tv1.y = buffer.getY( j );\n\t\t\t\t\tv1.z = buffer.getZ( j );\n\n\t\t\t\t\tv1.applyMatrix3( this );\n\n\t\t\t\t\tbuffer.setXYZ( j, v1.x, v1.y, v1.z );\n\n\t\t\t\t}\n\n\t\t\t\treturn buffer;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tmultiplyScalar: function ( s ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tte[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s;\n\t\t\tte[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s;\n\t\t\tte[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdeterminant: function () {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tvar a = te[ 0 ], b = te[ 1 ], c = te[ 2 ],\n\t\t\t\td = te[ 3 ], e = te[ 4 ], f = te[ 5 ],\n\t\t\t\tg = te[ 6 ], h = te[ 7 ], i = te[ 8 ];\n\n\t\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\n\t\t},\n\n\t\tgetInverse: function ( matrix, throwOnDegenerate ) {\n\n\t\t\tif ( (matrix && matrix.isMatrix4) ) {\n\n\t\t\t\tconsole.error( \"THREE.Matrix3.getInverse no longer takes a Matrix4 argument.\" );\n\n\t\t\t}\n\n\t\t\tvar me = matrix.elements,\n\t\t\t\tte = this.elements,\n\n\t\t\t\tn11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ],\n\t\t\t\tn12 = me[ 3 ], n22 = me[ 4 ], n32 = me[ 5 ],\n\t\t\t\tn13 = me[ 6 ], n23 = me[ 7 ], n33 = me[ 8 ],\n\n\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\n\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\n\t\t\tif ( det === 0 ) {\n\n\t\t\t\tvar msg = \"THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0\";\n\n\t\t\t\tif ( throwOnDegenerate === true ) {\n\n\t\t\t\t\tthrow new Error( msg );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( msg );\n\n\t\t\t\t}\n\n\t\t\t\treturn this.identity();\n\t\t\t}\n\n\t\t\tvar detInv = 1 / det;\n\n\t\t\tte[ 0 ] = t11 * detInv;\n\t\t\tte[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv;\n\t\t\tte[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv;\n\n\t\t\tte[ 3 ] = t12 * detInv;\n\t\t\tte[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv;\n\t\t\tte[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv;\n\n\t\t\tte[ 6 ] = t13 * detInv;\n\t\t\tte[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv;\n\t\t\tte[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttranspose: function () {\n\n\t\t\tvar tmp, m = this.elements;\n\n\t\t\ttmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp;\n\t\t\ttmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp;\n\t\t\ttmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tflattenToArrayOffset: function ( array, offset ) {\n\n\t\t\tconsole.warn( \"THREE.Matrix3: .flattenToArrayOffset is deprecated \" +\n\t\t\t\t\t\"- just use .toArray instead.\" );\n\n\t\t\treturn this.toArray( array, offset );\n\n\t\t},\n\n\t\tgetNormalMatrix: function ( matrix4 ) {\n\n\t\t\treturn this.setFromMatrix4( matrix4 ).getInverse( this ).transpose();\n\n\t\t},\n\n\t\ttransposeIntoArray: function ( r ) {\n\n\t\t\tvar m = this.elements;\n\n\t\t\tr[ 0 ] = m[ 0 ];\n\t\t\tr[ 1 ] = m[ 3 ];\n\t\t\tr[ 2 ] = m[ 6 ];\n\t\t\tr[ 3 ] = m[ 1 ];\n\t\t\tr[ 4 ] = m[ 4 ];\n\t\t\tr[ 5 ] = m[ 7 ];\n\t\t\tr[ 6 ] = m[ 2 ];\n\t\t\tr[ 7 ] = m[ 5 ];\n\t\t\tr[ 8 ] = m[ 8 ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tfromArray: function ( array, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tfor( var i = 0; i < 9; i ++ ) {\n\n\t\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tvar te = this.elements;\n\n\t\t\tarray[ offset ] = te[ 0 ];\n\t\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\t\tarray[ offset + 2 ] = te[ 2 ];\n\n\t\t\tarray[ offset + 3 ] = te[ 3 ];\n\t\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\t\tarray[ offset + 5 ] = te[ 5 ];\n\n\t\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\t\tarray[ offset + 7 ] = te[ 7 ];\n\t\t\tarray[ offset + 8 ] = te[ 8 ];\n\n\t\t\treturn array;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Plane( normal, constant ) {\n\n\t\tthis.normal = ( normal !== undefined ) ? normal : new Vector3( 1, 0, 0 );\n\t\tthis.constant = ( constant !== undefined ) ? constant : 0;\n\n\t}\n\n\tPlane.prototype = {\n\n\t\tconstructor: Plane,\n\n\t\tset: function ( normal, constant ) {\n\n\t\t\tthis.normal.copy( normal );\n\t\t\tthis.constant = constant;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetComponents: function ( x, y, z, w ) {\n\n\t\t\tthis.normal.set( x, y, z );\n\t\t\tthis.constant = w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromNormalAndCoplanarPoint: function ( normal, point ) {\n\n\t\t\tthis.normal.copy( normal );\n\t\t\tthis.constant = - point.dot( this.normal );\t// must be this.normal, not normal, as this.normal is normalized\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromCoplanarPoints: function () {\n\n\t\t\tvar v1 = new Vector3();\n\t\t\tvar v2 = new Vector3();\n\n\t\t\treturn function setFromCoplanarPoints( a, b, c ) {\n\n\t\t\t\tvar normal = v1.subVectors( c, b ).cross( v2.subVectors( a, b ) ).normalize();\n\n\t\t\t\t// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\t\t\t\tthis.setFromNormalAndCoplanarPoint( normal, a );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( plane ) {\n\n\t\t\tthis.normal.copy( plane.normal );\n\t\t\tthis.constant = plane.constant;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tnormalize: function () {\n\n\t\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\n\t\t\tvar inverseNormalLength = 1.0 / this.normal.length();\n\t\t\tthis.normal.multiplyScalar( inverseNormalLength );\n\t\t\tthis.constant *= inverseNormalLength;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tnegate: function () {\n\n\t\t\tthis.constant *= - 1;\n\t\t\tthis.normal.negate();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdistanceToPoint: function ( point ) {\n\n\t\t\treturn this.normal.dot( point ) + this.constant;\n\n\t\t},\n\n\t\tdistanceToSphere: function ( sphere ) {\n\n\t\t\treturn this.distanceToPoint( sphere.center ) - sphere.radius;\n\n\t\t},\n\n\t\tprojectPoint: function ( point, optionalTarget ) {\n\n\t\t\treturn this.orthoPoint( point, optionalTarget ).sub( point ).negate();\n\n\t\t},\n\n\t\torthoPoint: function ( point, optionalTarget ) {\n\n\t\t\tvar perpendicularMagnitude = this.distanceToPoint( point );\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn result.copy( this.normal ).multiplyScalar( perpendicularMagnitude );\n\n\t\t},\n\n\t\tintersectLine: function () {\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function intersectLine( line, optionalTarget ) {\n\n\t\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\t\tvar direction = line.delta( v1 );\n\n\t\t\t\tvar denominator = this.normal.dot( direction );\n\n\t\t\t\tif ( denominator === 0 ) {\n\n\t\t\t\t\t// line is coplanar, return origin\n\t\t\t\t\tif ( this.distanceToPoint( line.start ) === 0 ) {\n\n\t\t\t\t\t\treturn result.copy( line.start );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Unsure if this is the correct method to handle this case.\n\t\t\t\t\treturn undefined;\n\n\t\t\t\t}\n\n\t\t\t\tvar t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;\n\n\t\t\t\tif ( t < 0 || t > 1 ) {\n\n\t\t\t\t\treturn undefined;\n\n\t\t\t\t}\n\n\t\t\t\treturn result.copy( direction ).multiplyScalar( t ).add( line.start );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tintersectsLine: function ( line ) {\n\n\t\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n\t\t\tvar startSign = this.distanceToPoint( line.start );\n\t\t\tvar endSign = this.distanceToPoint( line.end );\n\n\t\t\treturn ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );\n\n\t\t},\n\n\t\tintersectsBox: function ( box ) {\n\n\t\t\treturn box.intersectsPlane( this );\n\n\t\t},\n\n\t\tintersectsSphere: function ( sphere ) {\n\n\t\t\treturn sphere.intersectsPlane( this );\n\n\t\t},\n\n\t\tcoplanarPoint: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn result.copy( this.normal ).multiplyScalar( - this.constant );\n\n\t\t},\n\n\t\tapplyMatrix4: function () {\n\n\t\t\tvar v1 = new Vector3();\n\t\t\tvar m1 = new Matrix3();\n\n\t\t\treturn function applyMatrix4( matrix, optionalNormalMatrix ) {\n\n\t\t\t\tvar referencePoint = this.coplanarPoint( v1 ).applyMatrix4( matrix );\n\n\t\t\t\t// transform normal based on theory here:\n\t\t\t\t// http://www.songho.ca/opengl/gl_normaltransform.html\n\t\t\t\tvar normalMatrix = optionalNormalMatrix || m1.getNormalMatrix( matrix );\n\t\t\t\tvar normal = this.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\t\t\t// recalculate constant (like in setFromNormalAndCoplanarPoint)\n\t\t\t\tthis.constant = - referencePoint.dot( normal );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslate: function ( offset ) {\n\n\t\t\tthis.constant = this.constant - offset.dot( this.normal );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( plane ) {\n\n\t\t\treturn plane.normal.equals( this.normal ) && ( plane.constant === this.constant );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Frustum( p0, p1, p2, p3, p4, p5 ) {\n\n\t\tthis.planes = [\n\n\t\t\t( p0 !== undefined ) ? p0 : new Plane(),\n\t\t\t( p1 !== undefined ) ? p1 : new Plane(),\n\t\t\t( p2 !== undefined ) ? p2 : new Plane(),\n\t\t\t( p3 !== undefined ) ? p3 : new Plane(),\n\t\t\t( p4 !== undefined ) ? p4 : new Plane(),\n\t\t\t( p5 !== undefined ) ? p5 : new Plane()\n\n\t\t];\n\n\t}\n\n\tFrustum.prototype = {\n\n\t\tconstructor: Frustum,\n\n\t\tset: function ( p0, p1, p2, p3, p4, p5 ) {\n\n\t\t\tvar planes = this.planes;\n\n\t\t\tplanes[ 0 ].copy( p0 );\n\t\t\tplanes[ 1 ].copy( p1 );\n\t\t\tplanes[ 2 ].copy( p2 );\n\t\t\tplanes[ 3 ].copy( p3 );\n\t\t\tplanes[ 4 ].copy( p4 );\n\t\t\tplanes[ 5 ].copy( p5 );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( frustum ) {\n\n\t\t\tvar planes = this.planes;\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\tplanes[ i ].copy( frustum.planes[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromMatrix: function ( m ) {\n\n\t\t\tvar planes = this.planes;\n\t\t\tvar me = m.elements;\n\t\t\tvar me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ];\n\t\t\tvar me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ];\n\t\t\tvar me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ];\n\t\t\tvar me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ];\n\n\t\t\tplanes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize();\n\t\t\tplanes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();\n\t\t\tplanes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();\n\t\t\tplanes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();\n\t\t\tplanes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();\n\t\t\tplanes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tintersectsObject: function () {\n\n\t\t\tvar sphere = new Sphere();\n\n\t\t\treturn function intersectsObject( object ) {\n\n\t\t\t\tvar geometry = object.geometry;\n\n\t\t\t\tif ( geometry.boundingSphere === null )\n\t\t\t\t\tgeometry.computeBoundingSphere();\n\n\t\t\t\tsphere.copy( geometry.boundingSphere )\n\t\t\t\t\t.applyMatrix4( object.matrixWorld );\n\n\t\t\t\treturn this.intersectsSphere( sphere );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tintersectsSprite: function () {\n\n\t\t\tvar sphere = new Sphere();\n\n\t\t\treturn function intersectsSprite( sprite ) {\n\n\t\t\t\tsphere.center.set( 0, 0, 0 );\n\t\t\t\tsphere.radius = 0.7071067811865476;\n\t\t\t\tsphere.applyMatrix4( sprite.matrixWorld );\n\n\t\t\t\treturn this.intersectsSphere( sphere );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tintersectsSphere: function ( sphere ) {\n\n\t\t\tvar planes = this.planes;\n\t\t\tvar center = sphere.center;\n\t\t\tvar negRadius = - sphere.radius;\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\tvar distance = planes[ i ].distanceToPoint( center );\n\n\t\t\t\tif ( distance < negRadius ) {\n\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t},\n\n\t\tintersectsBox: function () {\n\n\t\t\tvar p1 = new Vector3(),\n\t\t\t\tp2 = new Vector3();\n\n\t\t\treturn function intersectsBox( box ) {\n\n\t\t\t\tvar planes = this.planes;\n\n\t\t\t\tfor ( var i = 0; i < 6 ; i ++ ) {\n\n\t\t\t\t\tvar plane = planes[ i ];\n\n\t\t\t\t\tp1.x = plane.normal.x > 0 ? box.min.x : box.max.x;\n\t\t\t\t\tp2.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t\t\tp1.y = plane.normal.y > 0 ? box.min.y : box.max.y;\n\t\t\t\t\tp2.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t\t\tp1.z = plane.normal.z > 0 ? box.min.z : box.max.z;\n\t\t\t\t\tp2.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\t\t\tvar d1 = plane.distanceToPoint( p1 );\n\t\t\t\t\tvar d2 = plane.distanceToPoint( p2 );\n\n\t\t\t\t\t// if both outside plane, no intersection\n\n\t\t\t\t\tif ( d1 < 0 && d2 < 0 ) {\n\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\t};\n\n\t\t}(),\n\n\n\t\tcontainsPoint: function ( point ) {\n\n\t\t\tvar planes = this.planes;\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( planes[ i ].distanceToPoint( point ) < 0 ) {\n\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {\n\n\t\tvar _gl = _renderer.context,\n\t\t_state = _renderer.state,\n\t\t_frustum = new Frustum(),\n\t\t_projScreenMatrix = new Matrix4(),\n\n\t\t_lightShadows = _lights.shadows,\n\n\t\t_shadowMapSize = new Vector2(),\n\t\t_maxShadowMapSize = new Vector2( capabilities.maxTextureSize, capabilities.maxTextureSize ),\n\n\t\t_lookTarget = new Vector3(),\n\t\t_lightPositionWorld = new Vector3(),\n\n\t\t_renderList = [],\n\n\t\t_MorphingFlag = 1,\n\t\t_SkinningFlag = 2,\n\n\t\t_NumberOfMaterialVariants = ( _MorphingFlag | _SkinningFlag ) + 1,\n\n\t\t_depthMaterials = new Array( _NumberOfMaterialVariants ),\n\t\t_distanceMaterials = new Array( _NumberOfMaterialVariants ),\n\n\t\t_materialCache = {};\n\n\t\tvar cubeDirections = [\n\t\t\tnew Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ),\n\t\t\tnew Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 )\n\t\t];\n\n\t\tvar cubeUps = [\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ),\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ),\tnew Vector3( 0, 0, - 1 )\n\t\t];\n\n\t\tvar cube2DViewPorts = [\n\t\t\tnew Vector4(), new Vector4(), new Vector4(),\n\t\t\tnew Vector4(), new Vector4(), new Vector4()\n\t\t];\n\n\t\t// init\n\n\t\tvar depthMaterialTemplate = new MeshDepthMaterial();\n\t\tdepthMaterialTemplate.depthPacking = RGBADepthPacking;\n\t\tdepthMaterialTemplate.clipping = true;\n\n\t\tvar distanceShader = ShaderLib[ \"distanceRGBA\" ];\n\t\tvar distanceUniforms = UniformsUtils.clone( distanceShader.uniforms );\n\n\t\tfor ( var i = 0; i !== _NumberOfMaterialVariants; ++ i ) {\n\n\t\t\tvar useMorphing = ( i & _MorphingFlag ) !== 0;\n\t\t\tvar useSkinning = ( i & _SkinningFlag ) !== 0;\n\n\t\t\tvar depthMaterial = depthMaterialTemplate.clone();\n\t\t\tdepthMaterial.morphTargets = useMorphing;\n\t\t\tdepthMaterial.skinning = useSkinning;\n\n\t\t\t_depthMaterials[ i ] = depthMaterial;\n\n\t\t\tvar distanceMaterial = new ShaderMaterial( {\n\t\t\t\tdefines: {\n\t\t\t\t\t'USE_SHADOWMAP': ''\n\t\t\t\t},\n\t\t\t\tuniforms: distanceUniforms,\n\t\t\t\tvertexShader: distanceShader.vertexShader,\n\t\t\t\tfragmentShader: distanceShader.fragmentShader,\n\t\t\t\tmorphTargets: useMorphing,\n\t\t\t\tskinning: useSkinning,\n\t\t\t\tclipping: true\n\t\t\t} );\n\n\t\t\t_distanceMaterials[ i ] = distanceMaterial;\n\n\t\t}\n\n\t\t//\n\n\t\tvar scope = this;\n\n\t\tthis.enabled = false;\n\n\t\tthis.autoUpdate = true;\n\t\tthis.needsUpdate = false;\n\n\t\tthis.type = PCFShadowMap;\n\n\t\tthis.renderReverseSided = true;\n\t\tthis.renderSingleSided = true;\n\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\t\t\tif ( scope.autoUpdate === false && scope.needsUpdate === false ) return;\n\n\t\t\tif ( _lightShadows.length === 0 ) return;\n\n\t\t\t// Set GL state for depth map.\n\t\t\t_state.clearColor( 1, 1, 1, 1 );\n\t\t\t_state.disable( _gl.BLEND );\n\t\t\t_state.setDepthTest( true );\n\t\t\t_state.setScissorTest( false );\n\n\t\t\t// render depth map\n\n\t\t\tvar faceCount, isPointLight;\n\n\t\t\tfor ( var i = 0, il = _lightShadows.length; i < il; i ++ ) {\n\n\t\t\t\tvar light = _lightShadows[ i ];\n\t\t\t\tvar shadow = light.shadow;\n\n\t\t\t\tif ( shadow === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tvar shadowCamera = shadow.camera;\n\n\t\t\t\t_shadowMapSize.copy( shadow.mapSize );\n\t\t\t\t_shadowMapSize.min( _maxShadowMapSize );\n\n\t\t\t\tif ( (light && light.isPointLight) ) {\n\n\t\t\t\t\tfaceCount = 6;\n\t\t\t\t\tisPointLight = true;\n\n\t\t\t\t\tvar vpWidth = _shadowMapSize.x;\n\t\t\t\t\tvar vpHeight = _shadowMapSize.y;\n\n\t\t\t\t\t// These viewports map a cube-map onto a 2D texture with the\n\t\t\t\t\t// following orientation:\n\t\t\t\t\t//\n\t\t\t\t\t// xzXZ\n\t\t\t\t\t// y Y\n\t\t\t\t\t//\n\t\t\t\t\t// X - Positive x direction\n\t\t\t\t\t// x - Negative x direction\n\t\t\t\t\t// Y - Positive y direction\n\t\t\t\t\t// y - Negative y direction\n\t\t\t\t\t// Z - Positive z direction\n\t\t\t\t\t// z - Negative z direction\n\n\t\t\t\t\t// positive X\n\t\t\t\t\tcube2DViewPorts[ 0 ].set( vpWidth * 2, vpHeight, vpWidth, vpHeight );\n\t\t\t\t\t// negative X\n\t\t\t\t\tcube2DViewPorts[ 1 ].set( 0, vpHeight, vpWidth, vpHeight );\n\t\t\t\t\t// positive Z\n\t\t\t\t\tcube2DViewPorts[ 2 ].set( vpWidth * 3, vpHeight, vpWidth, vpHeight );\n\t\t\t\t\t// negative Z\n\t\t\t\t\tcube2DViewPorts[ 3 ].set( vpWidth, vpHeight, vpWidth, vpHeight );\n\t\t\t\t\t// positive Y\n\t\t\t\t\tcube2DViewPorts[ 4 ].set( vpWidth * 3, 0, vpWidth, vpHeight );\n\t\t\t\t\t// negative Y\n\t\t\t\t\tcube2DViewPorts[ 5 ].set( vpWidth, 0, vpWidth, vpHeight );\n\n\t\t\t\t\t_shadowMapSize.x *= 4.0;\n\t\t\t\t\t_shadowMapSize.y *= 2.0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfaceCount = 1;\n\t\t\t\t\tisPointLight = false;\n\n\t\t\t\t}\n\n\t\t\t\tif ( shadow.map === null ) {\n\n\t\t\t\t\tvar pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };\n\n\t\t\t\t\tshadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );\n\n\t\t\t\t\tshadowCamera.updateProjectionMatrix();\n\n\t\t\t\t}\n\n\t\t\t\tif ( (shadow && shadow.isSpotLightShadow) ) {\n\n\t\t\t\t\tshadow.update( light );\n\n\t\t\t\t}\n\n\t\t\t\tvar shadowMap = shadow.map;\n\t\t\t\tvar shadowMatrix = shadow.matrix;\n\n\t\t\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tshadowCamera.position.copy( _lightPositionWorld );\n\n\t\t\t\t_renderer.setRenderTarget( shadowMap );\n\t\t\t\t_renderer.clear();\n\n\t\t\t\t// render shadow map for each cube face (if omni-directional) or\n\t\t\t\t// run a single pass if not\n\n\t\t\t\tfor ( var face = 0; face < faceCount; face ++ ) {\n\n\t\t\t\t\tif ( isPointLight ) {\n\n\t\t\t\t\t\t_lookTarget.copy( shadowCamera.position );\n\t\t\t\t\t\t_lookTarget.add( cubeDirections[ face ] );\n\t\t\t\t\t\tshadowCamera.up.copy( cubeUps[ face ] );\n\t\t\t\t\t\tshadowCamera.lookAt( _lookTarget );\n\n\t\t\t\t\t\tvar vpDimensions = cube2DViewPorts[ face ];\n\t\t\t\t\t\t_state.viewport( vpDimensions );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_lookTarget.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\t\t\tshadowCamera.lookAt( _lookTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tshadowCamera.updateMatrixWorld();\n\t\t\t\t\tshadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld );\n\n\t\t\t\t\t// compute shadow matrix\n\n\t\t\t\t\tshadowMatrix.set(\n\t\t\t\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t\t\t\t);\n\n\t\t\t\t\tshadowMatrix.multiply( shadowCamera.projectionMatrix );\n\t\t\t\t\tshadowMatrix.multiply( shadowCamera.matrixWorldInverse );\n\n\t\t\t\t\t// update camera matrices and frustum\n\n\t\t\t\t\t_projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );\n\t\t\t\t\t_frustum.setFromMatrix( _projScreenMatrix );\n\n\t\t\t\t\t// set object matrices & frustum culling\n\n\t\t\t\t\t_renderList.length = 0;\n\n\t\t\t\t\tprojectObject( scene, camera, shadowCamera );\n\n\t\t\t\t\t// render shadow map\n\t\t\t\t\t// render regular objects\n\n\t\t\t\t\tfor ( var j = 0, jl = _renderList.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tvar object = _renderList[ j ];\n\t\t\t\t\t\tvar geometry = _objects.update( object );\n\t\t\t\t\t\tvar material = object.material;\n\n\t\t\t\t\t\tif ( (material && material.isMultiMaterial) ) {\n\n\t\t\t\t\t\t\tvar groups = geometry.groups;\n\t\t\t\t\t\t\tvar materials = material.materials;\n\n\t\t\t\t\t\t\tfor ( var k = 0, kl = groups.length; k < kl; k ++ ) {\n\n\t\t\t\t\t\t\t\tvar group = groups[ k ];\n\t\t\t\t\t\t\t\tvar groupMaterial = materials[ group.materialIndex ];\n\n\t\t\t\t\t\t\t\tif ( groupMaterial.visible === true ) {\n\n\t\t\t\t\t\t\t\t\tvar depthMaterial = getDepthMaterial( object, groupMaterial, isPointLight, _lightPositionWorld );\n\t\t\t\t\t\t\t\t\t_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvar depthMaterial = getDepthMaterial( object, material, isPointLight, _lightPositionWorld );\n\t\t\t\t\t\t\t_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Restore GL state.\n\t\t\tvar clearColor = _renderer.getClearColor(),\n\t\t\tclearAlpha = _renderer.getClearAlpha();\n\t\t\t_renderer.setClearColor( clearColor, clearAlpha );\n\n\t\t\tscope.needsUpdate = false;\n\n\t\t};\n\n\t\tfunction getDepthMaterial( object, material, isPointLight, lightPositionWorld ) {\n\n\t\t\tvar geometry = object.geometry;\n\n\t\t\tvar result = null;\n\n\t\t\tvar materialVariants = _depthMaterials;\n\t\t\tvar customMaterial = object.customDepthMaterial;\n\n\t\t\tif ( isPointLight ) {\n\n\t\t\t\tmaterialVariants = _distanceMaterials;\n\t\t\t\tcustomMaterial = object.customDistanceMaterial;\n\n\t\t\t}\n\n\t\t\tif ( ! customMaterial ) {\n\n\t\t\t\tvar useMorphing = false;\n\n\t\t\t\tif ( material.morphTargets ) {\n\n\t\t\t\t\tif ( (geometry && geometry.isBufferGeometry) ) {\n\n\t\t\t\t\t\tuseMorphing = geometry.morphAttributes && geometry.morphAttributes.position && geometry.morphAttributes.position.length > 0;\n\n\t\t\t\t\t} else if ( (geometry && geometry.isGeometry) ) {\n\n\t\t\t\t\t\tuseMorphing = geometry.morphTargets && geometry.morphTargets.length > 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar useSkinning = object.isSkinnedMesh && material.skinning;\n\n\t\t\t\tvar variantIndex = 0;\n\n\t\t\t\tif ( useMorphing ) variantIndex |= _MorphingFlag;\n\t\t\t\tif ( useSkinning ) variantIndex |= _SkinningFlag;\n\n\t\t\t\tresult = materialVariants[ variantIndex ];\n\n\t\t\t} else {\n\n\t\t\t\tresult = customMaterial;\n\n\t\t\t}\n\n\t\t\tif ( _renderer.localClippingEnabled &&\n\t\t\t\t material.clipShadows === true &&\n\t\t\t\t\tmaterial.clippingPlanes.length !== 0 ) {\n\n\t\t\t\t// in this case we need a unique material instance reflecting the\n\t\t\t\t// appropriate state\n\n\t\t\t\tvar keyA = result.uuid, keyB = material.uuid;\n\n\t\t\t\tvar materialsForVariant = _materialCache[ keyA ];\n\n\t\t\t\tif ( materialsForVariant === undefined ) {\n\n\t\t\t\t\tmaterialsForVariant = {};\n\t\t\t\t\t_materialCache[ keyA ] = materialsForVariant;\n\n\t\t\t\t}\n\n\t\t\t\tvar cachedMaterial = materialsForVariant[ keyB ];\n\n\t\t\t\tif ( cachedMaterial === undefined ) {\n\n\t\t\t\t\tcachedMaterial = result.clone();\n\t\t\t\t\tmaterialsForVariant[ keyB ] = cachedMaterial;\n\n\t\t\t\t}\n\n\t\t\t\tresult = cachedMaterial;\n\n\t\t\t}\n\n\t\t\tresult.visible = material.visible;\n\t\t\tresult.wireframe = material.wireframe;\n\n\t\t\tvar side = material.side;\n\n\t\t\tif ( scope.renderSingleSided && side == DoubleSide ) {\n\n\t\t\t\tside = FrontSide;\n\n\t\t\t}\n\n\t\t\tif ( scope.renderReverseSided ) {\n\n\t\t\t\tif ( side === FrontSide ) side = BackSide;\n\t\t\t\telse if ( side === BackSide ) side = FrontSide;\n\n\t\t\t}\n\n\t\t\tresult.side = side;\n\n\t\t\tresult.clipShadows = material.clipShadows;\n\t\t\tresult.clippingPlanes = material.clippingPlanes;\n\n\t\t\tresult.wireframeLinewidth = material.wireframeLinewidth;\n\t\t\tresult.linewidth = material.linewidth;\n\n\t\t\tif ( isPointLight && result.uniforms.lightPos !== undefined ) {\n\n\t\t\t\tresult.uniforms.lightPos.value.copy( lightPositionWorld );\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}\n\n\t\tfunction projectObject( object, camera, shadowCamera ) {\n\n\t\t\tif ( object.visible === false ) return;\n\n\t\t\tvar visible = ( object.layers.mask & camera.layers.mask ) !== 0;\n\n\t\t\tif ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) {\n\n\t\t\t\tif ( object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {\n\n\t\t\t\t\tvar material = object.material;\n\n\t\t\t\t\tif ( material.visible === true ) {\n\n\t\t\t\t\t\tobject.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );\n\t\t\t\t\t\t_renderList.push( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar children = object.children;\n\n\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tprojectObject( children[ i ], camera, shadowCamera );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Ray( origin, direction ) {\n\n\t\tthis.origin = ( origin !== undefined ) ? origin : new Vector3();\n\t\tthis.direction = ( direction !== undefined ) ? direction : new Vector3();\n\n\t}\n\n\tRay.prototype = {\n\n\t\tconstructor: Ray,\n\n\t\tset: function ( origin, direction ) {\n\n\t\t\tthis.origin.copy( origin );\n\t\t\tthis.direction.copy( direction );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( ray ) {\n\n\t\t\tthis.origin.copy( ray.origin );\n\t\t\tthis.direction.copy( ray.direction );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tat: function ( t, optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\treturn result.copy( this.direction ).multiplyScalar( t ).add( this.origin );\n\n\t\t},\n\n\t\tlookAt: function ( v ) {\n\n\t\t\tthis.direction.copy( v ).sub( this.origin ).normalize();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\trecast: function () {\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function recast( t ) {\n\n\t\t\t\tthis.origin.copy( this.at( t, v1 ) );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclosestPointToPoint: function ( point, optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\tresult.subVectors( point, this.origin );\n\t\t\tvar directionDistance = result.dot( this.direction );\n\n\t\t\tif ( directionDistance < 0 ) {\n\n\t\t\t\treturn result.copy( this.origin );\n\n\t\t\t}\n\n\t\t\treturn result.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin );\n\n\t\t},\n\n\t\tdistanceToPoint: function ( point ) {\n\n\t\t\treturn Math.sqrt( this.distanceSqToPoint( point ) );\n\n\t\t},\n\n\t\tdistanceSqToPoint: function () {\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function distanceSqToPoint( point ) {\n\n\t\t\t\tvar directionDistance = v1.subVectors( point, this.origin ).dot( this.direction );\n\n\t\t\t\t// point behind the ray\n\n\t\t\t\tif ( directionDistance < 0 ) {\n\n\t\t\t\t\treturn this.origin.distanceToSquared( point );\n\n\t\t\t\t}\n\n\t\t\t\tv1.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin );\n\n\t\t\t\treturn v1.distanceToSquared( point );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tdistanceSqToSegment: function () {\n\n\t\t\tvar segCenter = new Vector3();\n\t\t\tvar segDir = new Vector3();\n\t\t\tvar diff = new Vector3();\n\n\t\t\treturn function distanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {\n\n\t\t\t\t// from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t\t\t// It returns the min distance between the ray and the segment\n\t\t\t\t// defined by v0 and v1\n\t\t\t\t// It can also set two optional targets :\n\t\t\t\t// - The closest point on the ray\n\t\t\t\t// - The closest point on the segment\n\n\t\t\t\tsegCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 );\n\t\t\t\tsegDir.copy( v1 ).sub( v0 ).normalize();\n\t\t\t\tdiff.copy( this.origin ).sub( segCenter );\n\n\t\t\t\tvar segExtent = v0.distanceTo( v1 ) * 0.5;\n\t\t\t\tvar a01 = - this.direction.dot( segDir );\n\t\t\t\tvar b0 = diff.dot( this.direction );\n\t\t\t\tvar b1 = - diff.dot( segDir );\n\t\t\t\tvar c = diff.lengthSq();\n\t\t\t\tvar det = Math.abs( 1 - a01 * a01 );\n\t\t\t\tvar s0, s1, sqrDist, extDet;\n\n\t\t\t\tif ( det > 0 ) {\n\n\t\t\t\t\t// The ray and segment are not parallel.\n\n\t\t\t\t\ts0 = a01 * b1 - b0;\n\t\t\t\t\ts1 = a01 * b0 - b1;\n\t\t\t\t\textDet = segExtent * det;\n\n\t\t\t\t\tif ( s0 >= 0 ) {\n\n\t\t\t\t\t\tif ( s1 >= - extDet ) {\n\n\t\t\t\t\t\t\tif ( s1 <= extDet ) {\n\n\t\t\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\n\t\t\t\t\t\t\t\tvar invDet = 1 / det;\n\t\t\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\t\t\tsqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// region 1\n\n\t\t\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// region 5\n\n\t\t\t\t\t\t\ts1 = - segExtent;\n\t\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( s1 <= - extDet ) {\n\n\t\t\t\t\t\t\t// region 4\n\n\t\t\t\t\t\t\ts0 = Math.max( 0, - ( - a01 * segExtent + b0 ) );\n\t\t\t\t\t\t\ts1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t\t} else if ( s1 <= extDet ) {\n\n\t\t\t\t\t\t\t// region 3\n\n\t\t\t\t\t\t\ts0 = 0;\n\t\t\t\t\t\t\ts1 = Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\t\t\tsqrDist = s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// region 2\n\n\t\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * segExtent + b0 ) );\n\t\t\t\t\t\t\ts1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Ray and segment are parallel.\n\n\t\t\t\t\ts1 = ( a01 > 0 ) ? - segExtent : segExtent;\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t\tif ( optionalPointOnRay ) {\n\n\t\t\t\t\toptionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin );\n\n\t\t\t\t}\n\n\t\t\t\tif ( optionalPointOnSegment ) {\n\n\t\t\t\t\toptionalPointOnSegment.copy( segDir ).multiplyScalar( s1 ).add( segCenter );\n\n\t\t\t\t}\n\n\t\t\t\treturn sqrDist;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tintersectSphere: function () {\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function intersectSphere( sphere, optionalTarget ) {\n\n\t\t\t\tv1.subVectors( sphere.center, this.origin );\n\t\t\t\tvar tca = v1.dot( this.direction );\n\t\t\t\tvar d2 = v1.dot( v1 ) - tca * tca;\n\t\t\t\tvar radius2 = sphere.radius * sphere.radius;\n\n\t\t\t\tif ( d2 > radius2 ) return null;\n\n\t\t\t\tvar thc = Math.sqrt( radius2 - d2 );\n\n\t\t\t\t// t0 = first intersect point - entrance on front of sphere\n\t\t\t\tvar t0 = tca - thc;\n\n\t\t\t\t// t1 = second intersect point - exit point on back of sphere\n\t\t\t\tvar t1 = tca + thc;\n\n\t\t\t\t// test to see if both t0 and t1 are behind the ray - if so, return null\n\t\t\t\tif ( t0 < 0 && t1 < 0 ) return null;\n\n\t\t\t\t// test to see if t0 is behind the ray:\n\t\t\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t\t\t// in order to always return an intersect point that is in front of the ray.\n\t\t\t\tif ( t0 < 0 ) return this.at( t1, optionalTarget );\n\n\t\t\t\t// else t0 is in front of the ray, so return the first collision point scaled by t0\n\t\t\t\treturn this.at( t0, optionalTarget );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tintersectsSphere: function ( sphere ) {\n\n\t\t\treturn this.distanceToPoint( sphere.center ) <= sphere.radius;\n\n\t\t},\n\n\t\tdistanceToPlane: function ( plane ) {\n\n\t\t\tvar denominator = plane.normal.dot( this.direction );\n\n\t\t\tif ( denominator === 0 ) {\n\n\t\t\t\t// line is coplanar, return origin\n\t\t\t\tif ( plane.distanceToPoint( this.origin ) === 0 ) {\n\n\t\t\t\t\treturn 0;\n\n\t\t\t\t}\n\n\t\t\t\t// Null is preferable to undefined since undefined means.... it is undefined\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tvar t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator;\n\n\t\t\t// Return if the ray never intersects the plane\n\n\t\t\treturn t >= 0 ? t : null;\n\n\t\t},\n\n\t\tintersectPlane: function ( plane, optionalTarget ) {\n\n\t\t\tvar t = this.distanceToPlane( plane );\n\n\t\t\tif ( t === null ) {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\treturn this.at( t, optionalTarget );\n\n\t\t},\n\n\n\n\t\tintersectsPlane: function ( plane ) {\n\n\t\t\t// check if the ray lies on the plane first\n\n\t\t\tvar distToPoint = plane.distanceToPoint( this.origin );\n\n\t\t\tif ( distToPoint === 0 ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t\tvar denominator = plane.normal.dot( this.direction );\n\n\t\t\tif ( denominator * distToPoint < 0 ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t\t// ray origin is behind the plane (and is pointing behind it)\n\n\t\t\treturn false;\n\n\t\t},\n\n\t\tintersectBox: function ( box, optionalTarget ) {\n\n\t\t\tvar tmin, tmax, tymin, tymax, tzmin, tzmax;\n\n\t\t\tvar invdirx = 1 / this.direction.x,\n\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\tinvdirz = 1 / this.direction.z;\n\n\t\t\tvar origin = this.origin;\n\n\t\t\tif ( invdirx >= 0 ) {\n\n\t\t\t\ttmin = ( box.min.x - origin.x ) * invdirx;\n\t\t\t\ttmax = ( box.max.x - origin.x ) * invdirx;\n\n\t\t\t} else {\n\n\t\t\t\ttmin = ( box.max.x - origin.x ) * invdirx;\n\t\t\t\ttmax = ( box.min.x - origin.x ) * invdirx;\n\n\t\t\t}\n\n\t\t\tif ( invdiry >= 0 ) {\n\n\t\t\t\ttymin = ( box.min.y - origin.y ) * invdiry;\n\t\t\t\ttymax = ( box.max.y - origin.y ) * invdiry;\n\n\t\t\t} else {\n\n\t\t\t\ttymin = ( box.max.y - origin.y ) * invdiry;\n\t\t\t\ttymax = ( box.min.y - origin.y ) * invdiry;\n\n\t\t\t}\n\n\t\t\tif ( ( tmin > tymax ) || ( tymin > tmax ) ) return null;\n\n\t\t\t// These lines also handle the case where tmin or tmax is NaN\n\t\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\t\tif ( tymin > tmin || tmin !== tmin ) tmin = tymin;\n\n\t\t\tif ( tymax < tmax || tmax !== tmax ) tmax = tymax;\n\n\t\t\tif ( invdirz >= 0 ) {\n\n\t\t\t\ttzmin = ( box.min.z - origin.z ) * invdirz;\n\t\t\t\ttzmax = ( box.max.z - origin.z ) * invdirz;\n\n\t\t\t} else {\n\n\t\t\t\ttzmin = ( box.max.z - origin.z ) * invdirz;\n\t\t\t\ttzmax = ( box.min.z - origin.z ) * invdirz;\n\n\t\t\t}\n\n\t\t\tif ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null;\n\n\t\t\tif ( tzmin > tmin || tmin !== tmin ) tmin = tzmin;\n\n\t\t\tif ( tzmax < tmax || tmax !== tmax ) tmax = tzmax;\n\n\t\t\t//return point closest to the ray (positive side)\n\n\t\t\tif ( tmax < 0 ) return null;\n\n\t\t\treturn this.at( tmin >= 0 ? tmin : tmax, optionalTarget );\n\n\t\t},\n\n\t\tintersectsBox: ( function () {\n\n\t\t\tvar v = new Vector3();\n\n\t\t\treturn function intersectsBox( box ) {\n\n\t\t\t\treturn this.intersectBox( box, v ) !== null;\n\n\t\t\t};\n\n\t\t} )(),\n\n\t\tintersectTriangle: function () {\n\n\t\t\t// Compute the offset origin, edges, and normal.\n\t\t\tvar diff = new Vector3();\n\t\t\tvar edge1 = new Vector3();\n\t\t\tvar edge2 = new Vector3();\n\t\t\tvar normal = new Vector3();\n\n\t\t\treturn function intersectTriangle( a, b, c, backfaceCulling, optionalTarget ) {\n\n\t\t\t\t// from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\n\t\t\t\tedge1.subVectors( b, a );\n\t\t\t\tedge2.subVectors( c, a );\n\t\t\t\tnormal.crossVectors( edge1, edge2 );\n\n\t\t\t\t// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t\t\t// |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t\t\t// |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t\t\t// |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\t\t\t\tvar DdN = this.direction.dot( normal );\n\t\t\t\tvar sign;\n\n\t\t\t\tif ( DdN > 0 ) {\n\n\t\t\t\t\tif ( backfaceCulling ) return null;\n\t\t\t\t\tsign = 1;\n\n\t\t\t\t} else if ( DdN < 0 ) {\n\n\t\t\t\t\tsign = - 1;\n\t\t\t\t\tDdN = - DdN;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tdiff.subVectors( this.origin, a );\n\t\t\t\tvar DdQxE2 = sign * this.direction.dot( edge2.crossVectors( diff, edge2 ) );\n\n\t\t\t\t// b1 < 0, no intersection\n\t\t\t\tif ( DdQxE2 < 0 ) {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tvar DdE1xQ = sign * this.direction.dot( edge1.cross( diff ) );\n\n\t\t\t\t// b2 < 0, no intersection\n\t\t\t\tif ( DdE1xQ < 0 ) {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\t// b1+b2 > 1, no intersection\n\t\t\t\tif ( DdQxE2 + DdE1xQ > DdN ) {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\t// Line intersects triangle, check if ray does.\n\t\t\t\tvar QdN = - sign * diff.dot( normal );\n\n\t\t\t\t// t < 0, no intersection\n\t\t\t\tif ( QdN < 0 ) {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\t// Ray intersects triangle.\n\t\t\t\treturn this.at( QdN / DdN, optionalTarget );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tapplyMatrix4: function ( matrix4 ) {\n\n\t\t\tthis.direction.add( this.origin ).applyMatrix4( matrix4 );\n\t\t\tthis.origin.applyMatrix4( matrix4 );\n\t\t\tthis.direction.sub( this.origin );\n\t\t\tthis.direction.normalize();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( ray ) {\n\n\t\t\treturn ray.origin.equals( this.origin ) && ray.direction.equals( this.direction );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Euler( x, y, z, order ) {\n\n\t\tthis._x = x || 0;\n\t\tthis._y = y || 0;\n\t\tthis._z = z || 0;\n\t\tthis._order = order || Euler.DefaultOrder;\n\n\t}\n\n\tEuler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ];\n\n\tEuler.DefaultOrder = 'XYZ';\n\n\tEuler.prototype = {\n\n\t\tconstructor: Euler,\n\n\t\tisEuler: true,\n\n\t\tget x () {\n\n\t\t\treturn this._x;\n\n\t\t},\n\n\t\tset x ( value ) {\n\n\t\t\tthis._x = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tget y () {\n\n\t\t\treturn this._y;\n\n\t\t},\n\n\t\tset y ( value ) {\n\n\t\t\tthis._y = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tget z () {\n\n\t\t\treturn this._z;\n\n\t\t},\n\n\t\tset z ( value ) {\n\n\t\t\tthis._z = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tget order () {\n\n\t\t\treturn this._order;\n\n\t\t},\n\n\t\tset order ( value ) {\n\n\t\t\tthis._order = value;\n\t\t\tthis.onChangeCallback();\n\n\t\t},\n\n\t\tset: function ( x, y, z, order ) {\n\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._order = order || this._order;\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this._x, this._y, this._z, this._order );\n\n\t\t},\n\n\t\tcopy: function ( euler ) {\n\n\t\t\tthis._x = euler._x;\n\t\t\tthis._y = euler._y;\n\t\t\tthis._z = euler._z;\n\t\t\tthis._order = euler._order;\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromRotationMatrix: function ( m, order, update ) {\n\n\t\t\tvar clamp = _Math.clamp;\n\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\t\tvar te = m.elements;\n\t\t\tvar m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ];\n\t\t\tvar m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ];\n\t\t\tvar m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\t\torder = order || this._order;\n\n\t\t\tif ( order === 'XYZ' ) {\n\n\t\t\t\tthis._y = Math.asin( clamp( m13, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m13 ) < 0.99999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t} else if ( order === 'YXZ' ) {\n\n\t\t\t\tthis._x = Math.asin( - clamp( m23, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m23 ) < 0.99999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t} else if ( order === 'ZXY' ) {\n\n\t\t\t\tthis._x = Math.asin( clamp( m32, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m32 ) < 0.99999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t}\n\n\t\t\t} else if ( order === 'ZYX' ) {\n\n\t\t\t\tthis._y = Math.asin( - clamp( m31, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m31 ) < 0.99999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t}\n\n\t\t\t} else if ( order === 'YZX' ) {\n\n\t\t\t\tthis._z = Math.asin( clamp( m21, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m21 ) < 0.99999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m22 );\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\n\t\t\t\t}\n\n\t\t\t} else if ( order === 'XZY' ) {\n\n\t\t\t\tthis._z = Math.asin( - clamp( m12, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m12 ) < 0.99999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._y = Math.atan2( m13, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._y = 0;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + order );\n\n\t\t\t}\n\n\t\t\tthis._order = order;\n\n\t\t\tif ( update !== false ) this.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromQuaternion: function () {\n\n\t\t\tvar matrix;\n\n\t\t\treturn function setFromQuaternion( q, order, update ) {\n\n\t\t\t\tif ( matrix === undefined ) matrix = new Matrix4();\n\n\t\t\t\tmatrix.makeRotationFromQuaternion( q );\n\n\t\t\t\treturn this.setFromRotationMatrix( matrix, order, update );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tsetFromVector3: function ( v, order ) {\n\n\t\t\treturn this.set( v.x, v.y, v.z, order || this._order );\n\n\t\t},\n\n\t\treorder: function () {\n\n\t\t\t// WARNING: this discards revolution information -bhouston\n\n\t\t\tvar q = new Quaternion();\n\n\t\t\treturn function reorder( newOrder ) {\n\n\t\t\t\tq.setFromEuler( this );\n\n\t\t\t\treturn this.setFromQuaternion( q, newOrder );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tequals: function ( euler ) {\n\n\t\t\treturn ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order );\n\n\t\t},\n\n\t\tfromArray: function ( array ) {\n\n\t\t\tthis._x = array[ 0 ];\n\t\t\tthis._y = array[ 1 ];\n\t\t\tthis._z = array[ 2 ];\n\t\t\tif ( array[ 3 ] !== undefined ) this._order = array[ 3 ];\n\n\t\t\tthis.onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoArray: function ( array, offset ) {\n\n\t\t\tif ( array === undefined ) array = [];\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tarray[ offset ] = this._x;\n\t\t\tarray[ offset + 1 ] = this._y;\n\t\t\tarray[ offset + 2 ] = this._z;\n\t\t\tarray[ offset + 3 ] = this._order;\n\n\t\t\treturn array;\n\n\t\t},\n\n\t\ttoVector3: function ( optionalResult ) {\n\n\t\t\tif ( optionalResult ) {\n\n\t\t\t\treturn optionalResult.set( this._x, this._y, this._z );\n\n\t\t\t} else {\n\n\t\t\t\treturn new Vector3( this._x, this._y, this._z );\n\n\t\t\t}\n\n\t\t},\n\n\t\tonChange: function ( callback ) {\n\n\t\t\tthis.onChangeCallback = callback;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tonChangeCallback: function () {}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Layers() {\n\n\t\tthis.mask = 1;\n\n\t}\n\n\tLayers.prototype = {\n\n\t\tconstructor: Layers,\n\n\t\tset: function ( channel ) {\n\n\t\t\tthis.mask = 1 << channel;\n\n\t\t},\n\n\t\tenable: function ( channel ) {\n\n\t\t\tthis.mask |= 1 << channel;\n\n\t\t},\n\n\t\ttoggle: function ( channel ) {\n\n\t\t\tthis.mask ^= 1 << channel;\n\n\t\t},\n\n\t\tdisable: function ( channel ) {\n\n\t\t\tthis.mask &= ~ ( 1 << channel );\n\n\t\t},\n\n\t\ttest: function ( layers ) {\n\n\t\t\treturn ( this.mask & layers.mask ) !== 0;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author elephantatwork / www.elephantatwork.ch\n\t */\n\n\tfunction Object3D() {\n\n\t\tObject.defineProperty( this, 'id', { value: Object3DIdCount() } );\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Object3D';\n\n\t\tthis.parent = null;\n\t\tthis.children = [];\n\n\t\tthis.up = Object3D.DefaultUp.clone();\n\n\t\tvar position = new Vector3();\n\t\tvar rotation = new Euler();\n\t\tvar quaternion = new Quaternion();\n\t\tvar scale = new Vector3( 1, 1, 1 );\n\n\t\tfunction onRotationChange() {\n\n\t\t\tquaternion.setFromEuler( rotation, false );\n\n\t\t}\n\n\t\tfunction onQuaternionChange() {\n\n\t\t\trotation.setFromQuaternion( quaternion, undefined, false );\n\n\t\t}\n\n\t\trotation.onChange( onRotationChange );\n\t\tquaternion.onChange( onQuaternionChange );\n\n\t\tObject.defineProperties( this, {\n\t\t\tposition: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: position\n\t\t\t},\n\t\t\trotation: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: rotation\n\t\t\t},\n\t\t\tquaternion: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: quaternion\n\t\t\t},\n\t\t\tscale: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: scale\n\t\t\t},\n\t\t\tmodelViewMatrix: {\n\t\t\t\tvalue: new Matrix4()\n\t\t\t},\n\t\t\tnormalMatrix: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t} );\n\n\t\tthis.matrix = new Matrix4();\n\t\tthis.matrixWorld = new Matrix4();\n\n\t\tthis.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;\n\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\tthis.layers = new Layers();\n\t\tthis.visible = true;\n\n\t\tthis.castShadow = false;\n\t\tthis.receiveShadow = false;\n\n\t\tthis.frustumCulled = true;\n\t\tthis.renderOrder = 0;\n\n\t\tthis.userData = {};\n\n\t\tthis.onBeforeRender = function(){}; \n\t\tthis.onAfterRender = function(){};\n\n\t}\n\n\tObject3D.DefaultUp = new Vector3( 0, 1, 0 );\n\tObject3D.DefaultMatrixAutoUpdate = true;\n\n\tObject.assign( Object3D.prototype, EventDispatcher.prototype, {\n\n\t\tisObject3D: true,\n\n\t\tapplyMatrix: function ( matrix ) {\n\n\t\t\tthis.matrix.multiplyMatrices( matrix, this.matrix );\n\n\t\t\tthis.matrix.decompose( this.position, this.quaternion, this.scale );\n\n\t\t},\n\n\t\tsetRotationFromAxisAngle: function ( axis, angle ) {\n\n\t\t\t// assumes axis is normalized\n\n\t\t\tthis.quaternion.setFromAxisAngle( axis, angle );\n\n\t\t},\n\n\t\tsetRotationFromEuler: function ( euler ) {\n\n\t\t\tthis.quaternion.setFromEuler( euler, true );\n\n\t\t},\n\n\t\tsetRotationFromMatrix: function ( m ) {\n\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\t\tthis.quaternion.setFromRotationMatrix( m );\n\n\t\t},\n\n\t\tsetRotationFromQuaternion: function ( q ) {\n\n\t\t\t// assumes q is normalized\n\n\t\t\tthis.quaternion.copy( q );\n\n\t\t},\n\n\t\trotateOnAxis: function () {\n\n\t\t\t// rotate object on axis in object space\n\t\t\t// axis is assumed to be normalized\n\n\t\t\tvar q1 = new Quaternion();\n\n\t\t\treturn function rotateOnAxis( axis, angle ) {\n\n\t\t\t\tq1.setFromAxisAngle( axis, angle );\n\n\t\t\t\tthis.quaternion.multiply( q1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\trotateX: function () {\n\n\t\t\tvar v1 = new Vector3( 1, 0, 0 );\n\n\t\t\treturn function rotateX( angle ) {\n\n\t\t\t\treturn this.rotateOnAxis( v1, angle );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\trotateY: function () {\n\n\t\t\tvar v1 = new Vector3( 0, 1, 0 );\n\n\t\t\treturn function rotateY( angle ) {\n\n\t\t\t\treturn this.rotateOnAxis( v1, angle );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\trotateZ: function () {\n\n\t\t\tvar v1 = new Vector3( 0, 0, 1 );\n\n\t\t\treturn function rotateZ( angle ) {\n\n\t\t\t\treturn this.rotateOnAxis( v1, angle );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslateOnAxis: function () {\n\n\t\t\t// translate object by distance along axis in object space\n\t\t\t// axis is assumed to be normalized\n\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function translateOnAxis( axis, distance ) {\n\n\t\t\t\tv1.copy( axis ).applyQuaternion( this.quaternion );\n\n\t\t\t\tthis.position.add( v1.multiplyScalar( distance ) );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslateX: function () {\n\n\t\t\tvar v1 = new Vector3( 1, 0, 0 );\n\n\t\t\treturn function translateX( distance ) {\n\n\t\t\t\treturn this.translateOnAxis( v1, distance );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslateY: function () {\n\n\t\t\tvar v1 = new Vector3( 0, 1, 0 );\n\n\t\t\treturn function translateY( distance ) {\n\n\t\t\t\treturn this.translateOnAxis( v1, distance );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslateZ: function () {\n\n\t\t\tvar v1 = new Vector3( 0, 0, 1 );\n\n\t\t\treturn function translateZ( distance ) {\n\n\t\t\t\treturn this.translateOnAxis( v1, distance );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tlocalToWorld: function ( vector ) {\n\n\t\t\treturn vector.applyMatrix4( this.matrixWorld );\n\n\t\t},\n\n\t\tworldToLocal: function () {\n\n\t\t\tvar m1 = new Matrix4();\n\n\t\t\treturn function worldToLocal( vector ) {\n\n\t\t\t\treturn vector.applyMatrix4( m1.getInverse( this.matrixWorld ) );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tlookAt: function () {\n\n\t\t\t// This routine does not support objects with rotated and/or translated parent(s)\n\n\t\t\tvar m1 = new Matrix4();\n\n\t\t\treturn function lookAt( vector ) {\n\n\t\t\t\tm1.lookAt( vector, this.position, this.up );\n\n\t\t\t\tthis.quaternion.setFromRotationMatrix( m1 );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tadd: function ( object ) {\n\n\t\t\tif ( arguments.length > 1 ) {\n\n\t\t\t\tfor ( var i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\t\tthis.add( arguments[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\tif ( object === this ) {\n\n\t\t\t\tconsole.error( \"THREE.Object3D.add: object can't be added as a child of itself.\", object );\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\tif ( (object && object.isObject3D) ) {\n\n\t\t\t\tif ( object.parent !== null ) {\n\n\t\t\t\t\tobject.parent.remove( object );\n\n\t\t\t\t}\n\n\t\t\t\tobject.parent = this;\n\t\t\t\tobject.dispatchEvent( { type: 'added' } );\n\n\t\t\t\tthis.children.push( object );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( \"THREE.Object3D.add: object not an instance of THREE.Object3D.\", object );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tremove: function ( object ) {\n\n\t\t\tif ( arguments.length > 1 ) {\n\n\t\t\t\tfor ( var i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\t\tthis.remove( arguments[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar index = this.children.indexOf( object );\n\n\t\t\tif ( index !== - 1 ) {\n\n\t\t\t\tobject.parent = null;\n\n\t\t\t\tobject.dispatchEvent( { type: 'removed' } );\n\n\t\t\t\tthis.children.splice( index, 1 );\n\n\t\t\t}\n\n\t\t},\n\n\t\tgetObjectById: function ( id ) {\n\n\t\t\treturn this.getObjectByProperty( 'id', id );\n\n\t\t},\n\n\t\tgetObjectByName: function ( name ) {\n\n\t\t\treturn this.getObjectByProperty( 'name', name );\n\n\t\t},\n\n\t\tgetObjectByProperty: function ( name, value ) {\n\n\t\t\tif ( this[ name ] === value ) return this;\n\n\t\t\tfor ( var i = 0, l = this.children.length; i < l; i ++ ) {\n\n\t\t\t\tvar child = this.children[ i ];\n\t\t\t\tvar object = child.getObjectByProperty( name, value );\n\n\t\t\t\tif ( object !== undefined ) {\n\n\t\t\t\t\treturn object;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn undefined;\n\n\t\t},\n\n\t\tgetWorldPosition: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\treturn result.setFromMatrixPosition( this.matrixWorld );\n\n\t\t},\n\n\t\tgetWorldQuaternion: function () {\n\n\t\t\tvar position = new Vector3();\n\t\t\tvar scale = new Vector3();\n\n\t\t\treturn function getWorldQuaternion( optionalTarget ) {\n\n\t\t\t\tvar result = optionalTarget || new Quaternion();\n\n\t\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\t\tthis.matrixWorld.decompose( position, result, scale );\n\n\t\t\t\treturn result;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tgetWorldRotation: function () {\n\n\t\t\tvar quaternion = new Quaternion();\n\n\t\t\treturn function getWorldRotation( optionalTarget ) {\n\n\t\t\t\tvar result = optionalTarget || new Euler();\n\n\t\t\t\tthis.getWorldQuaternion( quaternion );\n\n\t\t\t\treturn result.setFromQuaternion( quaternion, this.rotation.order, false );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tgetWorldScale: function () {\n\n\t\t\tvar position = new Vector3();\n\t\t\tvar quaternion = new Quaternion();\n\n\t\t\treturn function getWorldScale( optionalTarget ) {\n\n\t\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\t\tthis.matrixWorld.decompose( position, quaternion, result );\n\n\t\t\t\treturn result;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tgetWorldDirection: function () {\n\n\t\t\tvar quaternion = new Quaternion();\n\n\t\t\treturn function getWorldDirection( optionalTarget ) {\n\n\t\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\t\tthis.getWorldQuaternion( quaternion );\n\n\t\t\t\treturn result.set( 0, 0, 1 ).applyQuaternion( quaternion );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\traycast: function () {},\n\n\t\ttraverse: function ( callback ) {\n\n\t\t\tcallback( this );\n\n\t\t\tvar children = this.children;\n\n\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tchildren[ i ].traverse( callback );\n\n\t\t\t}\n\n\t\t},\n\n\t\ttraverseVisible: function ( callback ) {\n\n\t\t\tif ( this.visible === false ) return;\n\n\t\t\tcallback( this );\n\n\t\t\tvar children = this.children;\n\n\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tchildren[ i ].traverseVisible( callback );\n\n\t\t\t}\n\n\t\t},\n\n\t\ttraverseAncestors: function ( callback ) {\n\n\t\t\tvar parent = this.parent;\n\n\t\t\tif ( parent !== null ) {\n\n\t\t\t\tcallback( parent );\n\n\t\t\t\tparent.traverseAncestors( callback );\n\n\t\t\t}\n\n\t\t},\n\n\t\tupdateMatrix: function () {\n\n\t\t\tthis.matrix.compose( this.position, this.quaternion, this.scale );\n\n\t\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t\t},\n\n\t\tupdateMatrixWorld: function ( force ) {\n\n\t\t\tif ( this.matrixAutoUpdate === true ) this.updateMatrix();\n\n\t\t\tif ( this.matrixWorldNeedsUpdate === true || force === true ) {\n\n\t\t\t\tif ( this.parent === null ) {\n\n\t\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t\t}\n\n\t\t\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t\t\tforce = true;\n\n\t\t\t}\n\n\t\t\t// update children\n\n\t\t\tvar children = this.children;\n\n\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tchildren[ i ].updateMatrixWorld( force );\n\n\t\t\t}\n\n\t\t},\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\t// meta is '' when called from JSON.stringify\n\t\t\tvar isRootObject = ( meta === undefined || meta === '' );\n\n\t\t\tvar output = {};\n\n\t\t\t// meta is a hash used to collect geometries, materials.\n\t\t\t// not providing it implies that this is the root object\n\t\t\t// being serialized.\n\t\t\tif ( isRootObject ) {\n\n\t\t\t\t// initialize meta obj\n\t\t\t\tmeta = {\n\t\t\t\t\tgeometries: {},\n\t\t\t\t\tmaterials: {},\n\t\t\t\t\ttextures: {},\n\t\t\t\t\timages: {}\n\t\t\t\t};\n\n\t\t\t\toutput.metadata = {\n\t\t\t\t\tversion: 4.4,\n\t\t\t\t\ttype: 'Object',\n\t\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\t// standard Object3D serialization\n\n\t\t\tvar object = {};\n\n\t\t\tobject.uuid = this.uuid;\n\t\t\tobject.type = this.type;\n\n\t\t\tif ( this.name !== '' ) object.name = this.name;\n\t\t\tif ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;\n\t\t\tif ( this.castShadow === true ) object.castShadow = true;\n\t\t\tif ( this.receiveShadow === true ) object.receiveShadow = true;\n\t\t\tif ( this.visible === false ) object.visible = false;\n\n\t\t\tobject.matrix = this.matrix.toArray();\n\n\t\t\t//\n\n\t\t\tif ( this.geometry !== undefined ) {\n\n\t\t\t\tif ( meta.geometries[ this.geometry.uuid ] === undefined ) {\n\n\t\t\t\t\tmeta.geometries[ this.geometry.uuid ] = this.geometry.toJSON( meta );\n\n\t\t\t\t}\n\n\t\t\t\tobject.geometry = this.geometry.uuid;\n\n\t\t\t}\n\n\t\t\tif ( this.material !== undefined ) {\n\n\t\t\t\tif ( meta.materials[ this.material.uuid ] === undefined ) {\n\n\t\t\t\t\tmeta.materials[ this.material.uuid ] = this.material.toJSON( meta );\n\n\t\t\t\t}\n\n\t\t\t\tobject.material = this.material.uuid;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( this.children.length > 0 ) {\n\n\t\t\t\tobject.children = [];\n\n\t\t\t\tfor ( var i = 0; i < this.children.length; i ++ ) {\n\n\t\t\t\t\tobject.children.push( this.children[ i ].toJSON( meta ).object );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( isRootObject ) {\n\n\t\t\t\tvar geometries = extractFromCache( meta.geometries );\n\t\t\t\tvar materials = extractFromCache( meta.materials );\n\t\t\t\tvar textures = extractFromCache( meta.textures );\n\t\t\t\tvar images = extractFromCache( meta.images );\n\n\t\t\t\tif ( geometries.length > 0 ) output.geometries = geometries;\n\t\t\t\tif ( materials.length > 0 ) output.materials = materials;\n\t\t\t\tif ( textures.length > 0 ) output.textures = textures;\n\t\t\t\tif ( images.length > 0 ) output.images = images;\n\n\t\t\t}\n\n\t\t\toutput.object = object;\n\n\t\t\treturn output;\n\n\t\t\t// extract data from the cache hash\n\t\t\t// remove metadata on each item\n\t\t\t// and return as array\n\t\t\tfunction extractFromCache( cache ) {\n\n\t\t\t\tvar values = [];\n\t\t\t\tfor ( var key in cache ) {\n\n\t\t\t\t\tvar data = cache[ key ];\n\t\t\t\t\tdelete data.metadata;\n\t\t\t\t\tvalues.push( data );\n\n\t\t\t\t}\n\t\t\t\treturn values;\n\n\t\t\t}\n\n\t\t},\n\n\t\tclone: function ( recursive ) {\n\n\t\t\treturn new this.constructor().copy( this, recursive );\n\n\t\t},\n\n\t\tcopy: function ( source, recursive ) {\n\n\t\t\tif ( recursive === undefined ) recursive = true;\n\n\t\t\tthis.name = source.name;\n\n\t\t\tthis.up.copy( source.up );\n\n\t\t\tthis.position.copy( source.position );\n\t\t\tthis.quaternion.copy( source.quaternion );\n\t\t\tthis.scale.copy( source.scale );\n\n\t\t\tthis.matrix.copy( source.matrix );\n\t\t\tthis.matrixWorld.copy( source.matrixWorld );\n\n\t\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\n\t\t\tthis.visible = source.visible;\n\n\t\t\tthis.castShadow = source.castShadow;\n\t\t\tthis.receiveShadow = source.receiveShadow;\n\n\t\t\tthis.frustumCulled = source.frustumCulled;\n\t\t\tthis.renderOrder = source.renderOrder;\n\n\t\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\t\tif ( recursive === true ) {\n\n\t\t\t\tfor ( var i = 0; i < source.children.length; i ++ ) {\n\n\t\t\t\t\tvar child = source.children[ i ];\n\t\t\t\t\tthis.add( child.clone() );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\tvar count$2 = 0;\n\tfunction Object3DIdCount() { return count$2++; }\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Line3( start, end ) {\n\n\t\tthis.start = ( start !== undefined ) ? start : new Vector3();\n\t\tthis.end = ( end !== undefined ) ? end : new Vector3();\n\n\t}\n\n\tLine3.prototype = {\n\n\t\tconstructor: Line3,\n\n\t\tset: function ( start, end ) {\n\n\t\t\tthis.start.copy( start );\n\t\t\tthis.end.copy( end );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( line ) {\n\n\t\t\tthis.start.copy( line.start );\n\t\t\tthis.end.copy( line.end );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetCenter: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn result.addVectors( this.start, this.end ).multiplyScalar( 0.5 );\n\n\t\t},\n\n\t\tdelta: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn result.subVectors( this.end, this.start );\n\n\t\t},\n\n\t\tdistanceSq: function () {\n\n\t\t\treturn this.start.distanceToSquared( this.end );\n\n\t\t},\n\n\t\tdistance: function () {\n\n\t\t\treturn this.start.distanceTo( this.end );\n\n\t\t},\n\n\t\tat: function ( t, optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\treturn this.delta( result ).multiplyScalar( t ).add( this.start );\n\n\t\t},\n\n\t\tclosestPointToPointParameter: function () {\n\n\t\t\tvar startP = new Vector3();\n\t\t\tvar startEnd = new Vector3();\n\n\t\t\treturn function closestPointToPointParameter( point, clampToLine ) {\n\n\t\t\t\tstartP.subVectors( point, this.start );\n\t\t\t\tstartEnd.subVectors( this.end, this.start );\n\n\t\t\t\tvar startEnd2 = startEnd.dot( startEnd );\n\t\t\t\tvar startEnd_startP = startEnd.dot( startP );\n\n\t\t\t\tvar t = startEnd_startP / startEnd2;\n\n\t\t\t\tif ( clampToLine ) {\n\n\t\t\t\t\tt = _Math.clamp( t, 0, 1 );\n\n\t\t\t\t}\n\n\t\t\t\treturn t;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tclosestPointToPoint: function ( point, clampToLine, optionalTarget ) {\n\n\t\t\tvar t = this.closestPointToPointParameter( point, clampToLine );\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\treturn this.delta( result ).multiplyScalar( t ).add( this.start );\n\n\t\t},\n\n\t\tapplyMatrix4: function ( matrix ) {\n\n\t\t\tthis.start.applyMatrix4( matrix );\n\t\t\tthis.end.applyMatrix4( matrix );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tequals: function ( line ) {\n\n\t\t\treturn line.start.equals( this.start ) && line.end.equals( this.end );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Triangle( a, b, c ) {\n\n\t\tthis.a = ( a !== undefined ) ? a : new Vector3();\n\t\tthis.b = ( b !== undefined ) ? b : new Vector3();\n\t\tthis.c = ( c !== undefined ) ? c : new Vector3();\n\n\t}\n\n\tTriangle.normal = function () {\n\n\t\tvar v0 = new Vector3();\n\n\t\treturn function normal( a, b, c, optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\tresult.subVectors( c, b );\n\t\t\tv0.subVectors( a, b );\n\t\t\tresult.cross( v0 );\n\n\t\t\tvar resultLengthSq = result.lengthSq();\n\t\t\tif ( resultLengthSq > 0 ) {\n\n\t\t\t\treturn result.multiplyScalar( 1 / Math.sqrt( resultLengthSq ) );\n\n\t\t\t}\n\n\t\t\treturn result.set( 0, 0, 0 );\n\n\t\t};\n\n\t}();\n\n\t// static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\tTriangle.barycoordFromPoint = function () {\n\n\t\tvar v0 = new Vector3();\n\t\tvar v1 = new Vector3();\n\t\tvar v2 = new Vector3();\n\n\t\treturn function barycoordFromPoint( point, a, b, c, optionalTarget ) {\n\n\t\t\tv0.subVectors( c, a );\n\t\t\tv1.subVectors( b, a );\n\t\t\tv2.subVectors( point, a );\n\n\t\t\tvar dot00 = v0.dot( v0 );\n\t\t\tvar dot01 = v0.dot( v1 );\n\t\t\tvar dot02 = v0.dot( v2 );\n\t\t\tvar dot11 = v1.dot( v1 );\n\t\t\tvar dot12 = v1.dot( v2 );\n\n\t\t\tvar denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\t// collinear or singular triangle\n\t\t\tif ( denom === 0 ) {\n\n\t\t\t\t// arbitrary location outside of triangle?\n\t\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\t\treturn result.set( - 2, - 1, - 1 );\n\n\t\t\t}\n\n\t\t\tvar invDenom = 1 / denom;\n\t\t\tvar u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\t\tvar v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t\t// barycentric coordinates must always sum to 1\n\t\t\treturn result.set( 1 - u - v, v, u );\n\n\t\t};\n\n\t}();\n\n\tTriangle.containsPoint = function () {\n\n\t\tvar v1 = new Vector3();\n\n\t\treturn function containsPoint( point, a, b, c ) {\n\n\t\t\tvar result = Triangle.barycoordFromPoint( point, a, b, c, v1 );\n\n\t\t\treturn ( result.x >= 0 ) && ( result.y >= 0 ) && ( ( result.x + result.y ) <= 1 );\n\n\t\t};\n\n\t}();\n\n\tTriangle.prototype = {\n\n\t\tconstructor: Triangle,\n\n\t\tset: function ( a, b, c ) {\n\n\t\t\tthis.a.copy( a );\n\t\t\tthis.b.copy( b );\n\t\t\tthis.c.copy( c );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromPointsAndIndices: function ( points, i0, i1, i2 ) {\n\n\t\t\tthis.a.copy( points[ i0 ] );\n\t\t\tthis.b.copy( points[ i1 ] );\n\t\t\tthis.c.copy( points[ i2 ] );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( triangle ) {\n\n\t\t\tthis.a.copy( triangle.a );\n\t\t\tthis.b.copy( triangle.b );\n\t\t\tthis.c.copy( triangle.c );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tarea: function () {\n\n\t\t\tvar v0 = new Vector3();\n\t\t\tvar v1 = new Vector3();\n\n\t\t\treturn function area() {\n\n\t\t\t\tv0.subVectors( this.c, this.b );\n\t\t\t\tv1.subVectors( this.a, this.b );\n\n\t\t\t\treturn v0.cross( v1 ).length() * 0.5;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tmidpoint: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\treturn result.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t\t},\n\n\t\tnormal: function ( optionalTarget ) {\n\n\t\t\treturn Triangle.normal( this.a, this.b, this.c, optionalTarget );\n\n\t\t},\n\n\t\tplane: function ( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Plane();\n\n\t\t\treturn result.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t\t},\n\n\t\tbarycoordFromPoint: function ( point, optionalTarget ) {\n\n\t\t\treturn Triangle.barycoordFromPoint( point, this.a, this.b, this.c, optionalTarget );\n\n\t\t},\n\n\t\tcontainsPoint: function ( point ) {\n\n\t\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t\t},\n\n\t\tclosestPointToPoint: function () {\n\n\t\t\tvar plane, edgeList, projectedPoint, closestPoint;\n\n\t\t\treturn function closestPointToPoint( point, optionalTarget ) {\n\n\t\t\t\tif ( plane === undefined ) {\n\n\t\t\t\t\tplane = new Plane();\n\t\t\t\t\tedgeList = [ new Line3(), new Line3(), new Line3() ];\n\t\t\t\t\tprojectedPoint = new Vector3();\n\t\t\t\t\tclosestPoint = new Vector3();\n\n\t\t\t\t}\n\n\t\t\t\tvar result = optionalTarget || new Vector3();\n\t\t\t\tvar minDistance = Infinity;\n\n\t\t\t\t// project the point onto the plane of the triangle\n\n\t\t\t\tplane.setFromCoplanarPoints( this.a, this.b, this.c );\n\t\t\t\tplane.projectPoint( point, projectedPoint );\n\n\t\t\t\t// check if the projection lies within the triangle\n\n\t\t\t\tif( this.containsPoint( projectedPoint ) === true ) {\n\n\t\t\t\t\t// if so, this is the closest point\n\n\t\t\t\t\tresult.copy( projectedPoint );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// if not, the point falls outside the triangle. the result is the closest point to the triangle's edges or vertices\n\n\t\t\t\t\tedgeList[ 0 ].set( this.a, this.b );\n\t\t\t\t\tedgeList[ 1 ].set( this.b, this.c );\n\t\t\t\t\tedgeList[ 2 ].set( this.c, this.a );\n\n\t\t\t\t\tfor( var i = 0; i < edgeList.length; i ++ ) {\n\n\t\t\t\t\t\tedgeList[ i ].closestPointToPoint( projectedPoint, true, closestPoint );\n\n\t\t\t\t\t\tvar distance = projectedPoint.distanceToSquared( closestPoint );\n\n\t\t\t\t\t\tif( distance < minDistance ) {\n\n\t\t\t\t\t\t\tminDistance = distance;\n\n\t\t\t\t\t\t\tresult.copy( closestPoint );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tequals: function ( triangle ) {\n\n\t\t\treturn triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Face3( a, b, c, normal, color, materialIndex ) {\n\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\n\t\tthis.normal = (normal && normal.isVector3) ? normal : new Vector3();\n\t\tthis.vertexNormals = Array.isArray( normal ) ? normal : [];\n\n\t\tthis.color = (color && color.isColor) ? color : new Color();\n\t\tthis.vertexColors = Array.isArray( color ) ? color : [];\n\n\t\tthis.materialIndex = materialIndex !== undefined ? materialIndex : 0;\n\n\t}\n\n\tFace3.prototype = {\n\n\t\tconstructor: Face3,\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.a = source.a;\n\t\t\tthis.b = source.b;\n\t\t\tthis.c = source.c;\n\n\t\t\tthis.normal.copy( source.normal );\n\t\t\tthis.color.copy( source.color );\n\n\t\t\tthis.materialIndex = source.materialIndex;\n\n\t\t\tfor ( var i = 0, il = source.vertexNormals.length; i < il; i ++ ) {\n\n\t\t\t\tthis.vertexNormals[ i ] = source.vertexNormals[ i ].clone();\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0, il = source.vertexColors.length; i < il; i ++ ) {\n\n\t\t\t\tthis.vertexColors[ i ] = source.vertexColors[ i ].clone();\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * color: ,\n\t * opacity: ,\n\t * map: new THREE.Texture( ),\n\t *\n\t * aoMap: new THREE.Texture( ),\n\t * aoMapIntensity: \n\t *\n\t * specularMap: new THREE.Texture( ),\n\t *\n\t * alphaMap: new THREE.Texture( ),\n\t *\n\t * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),\n\t * combine: THREE.Multiply,\n\t * reflectivity: ,\n\t * refractionRatio: ,\n\t *\n\t * shading: THREE.SmoothShading,\n\t * depthTest: ,\n\t * depthWrite: ,\n\t *\n\t * wireframe: ,\n\t * wireframeLinewidth: ,\n\t *\n\t * skinning: ,\n\t * morphTargets: \n\t * }\n\t */\n\n\tfunction MeshBasicMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'MeshBasicMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // emissive\n\n\t\tthis.map = null;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.skinning = false;\n\t\tthis.morphTargets = false;\n\n\t\tthis.lights = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tMeshBasicMaterial.prototype = Object.create( Material.prototype );\n\tMeshBasicMaterial.prototype.constructor = MeshBasicMaterial;\n\n\tMeshBasicMaterial.prototype.isMeshBasicMaterial = true;\n\n\tMeshBasicMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.skinning = source.skinning;\n\t\tthis.morphTargets = source.morphTargets;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction BufferAttribute( array, itemSize, normalized ) {\n\n\t\tif ( Array.isArray( array ) ) {\n\n\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t}\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.array = array;\n\t\tthis.itemSize = itemSize;\n\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\t\tthis.normalized = normalized === true;\n\n\t\tthis.dynamic = false;\n\t\tthis.updateRange = { offset: 0, count: - 1 };\n\n\t\tthis.version = 0;\n\n\t}\n\n\tBufferAttribute.prototype = {\n\n\t\tconstructor: BufferAttribute,\n\n\t\tisBufferAttribute: true,\n\n\t\tset needsUpdate( value ) {\n\n\t\t\tif ( value === true ) this.version ++;\n\n\t\t},\n\n\t\tsetArray: function ( array ) {\n\n\t\t\tif ( Array.isArray( array ) ) {\n\n\t\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t\t}\n\n\t\t\tthis.count = array !== undefined ? array.length / this.itemSize : 0;\n\t\t\tthis.array = array;\n\n\t\t},\n\n\t\tsetDynamic: function ( value ) {\n\n\t\t\tthis.dynamic = value;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.array = new source.array.constructor( source.array );\n\t\t\tthis.itemSize = source.itemSize;\n\t\t\tthis.count = source.count;\n\t\t\tthis.normalized = source.normalized;\n\n\t\t\tthis.dynamic = source.dynamic;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyAt: function ( index1, attribute, index2 ) {\n\n\t\t\tindex1 *= this.itemSize;\n\t\t\tindex2 *= attribute.itemSize;\n\n\t\t\tfor ( var i = 0, l = this.itemSize; i < l; i ++ ) {\n\n\t\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyArray: function ( array ) {\n\n\t\t\tthis.array.set( array );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyColorsArray: function ( colors ) {\n\n\t\t\tvar array = this.array, offset = 0;\n\n\t\t\tfor ( var i = 0, l = colors.length; i < l; i ++ ) {\n\n\t\t\t\tvar color = colors[ i ];\n\n\t\t\t\tif ( color === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', i );\n\t\t\t\t\tcolor = new Color();\n\n\t\t\t\t}\n\n\t\t\t\tarray[ offset ++ ] = color.r;\n\t\t\t\tarray[ offset ++ ] = color.g;\n\t\t\t\tarray[ offset ++ ] = color.b;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyIndicesArray: function ( indices ) {\n\n\t\t\tvar array = this.array, offset = 0;\n\n\t\t\tfor ( var i = 0, l = indices.length; i < l; i ++ ) {\n\n\t\t\t\tvar index = indices[ i ];\n\n\t\t\t\tarray[ offset ++ ] = index.a;\n\t\t\t\tarray[ offset ++ ] = index.b;\n\t\t\t\tarray[ offset ++ ] = index.c;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyVector2sArray: function ( vectors ) {\n\n\t\t\tvar array = this.array, offset = 0;\n\n\t\t\tfor ( var i = 0, l = vectors.length; i < l; i ++ ) {\n\n\t\t\t\tvar vector = vectors[ i ];\n\n\t\t\t\tif ( vector === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i );\n\t\t\t\t\tvector = new Vector2();\n\n\t\t\t\t}\n\n\t\t\t\tarray[ offset ++ ] = vector.x;\n\t\t\t\tarray[ offset ++ ] = vector.y;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyVector3sArray: function ( vectors ) {\n\n\t\t\tvar array = this.array, offset = 0;\n\n\t\t\tfor ( var i = 0, l = vectors.length; i < l; i ++ ) {\n\n\t\t\t\tvar vector = vectors[ i ];\n\n\t\t\t\tif ( vector === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i );\n\t\t\t\t\tvector = new Vector3();\n\n\t\t\t\t}\n\n\t\t\t\tarray[ offset ++ ] = vector.x;\n\t\t\t\tarray[ offset ++ ] = vector.y;\n\t\t\t\tarray[ offset ++ ] = vector.z;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyVector4sArray: function ( vectors ) {\n\n\t\t\tvar array = this.array, offset = 0;\n\n\t\t\tfor ( var i = 0, l = vectors.length; i < l; i ++ ) {\n\n\t\t\t\tvar vector = vectors[ i ];\n\n\t\t\t\tif ( vector === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i );\n\t\t\t\t\tvector = new Vector4();\n\n\t\t\t\t}\n\n\t\t\t\tarray[ offset ++ ] = vector.x;\n\t\t\t\tarray[ offset ++ ] = vector.y;\n\t\t\t\tarray[ offset ++ ] = vector.z;\n\t\t\t\tarray[ offset ++ ] = vector.w;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tset: function ( value, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tthis.array.set( value, offset );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetX: function ( index ) {\n\n\t\t\treturn this.array[ index * this.itemSize ];\n\n\t\t},\n\n\t\tsetX: function ( index, x ) {\n\n\t\t\tthis.array[ index * this.itemSize ] = x;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetY: function ( index ) {\n\n\t\t\treturn this.array[ index * this.itemSize + 1 ];\n\n\t\t},\n\n\t\tsetY: function ( index, y ) {\n\n\t\t\tthis.array[ index * this.itemSize + 1 ] = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetZ: function ( index ) {\n\n\t\t\treturn this.array[ index * this.itemSize + 2 ];\n\n\t\t},\n\n\t\tsetZ: function ( index, z ) {\n\n\t\t\tthis.array[ index * this.itemSize + 2 ] = z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetW: function ( index ) {\n\n\t\t\treturn this.array[ index * this.itemSize + 3 ];\n\n\t\t},\n\n\t\tsetW: function ( index, w ) {\n\n\t\t\tthis.array[ index * this.itemSize + 3 ] = w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetXY: function ( index, x, y ) {\n\n\t\t\tindex *= this.itemSize;\n\n\t\t\tthis.array[ index + 0 ] = x;\n\t\t\tthis.array[ index + 1 ] = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetXYZ: function ( index, x, y, z ) {\n\n\t\t\tindex *= this.itemSize;\n\n\t\t\tthis.array[ index + 0 ] = x;\n\t\t\tthis.array[ index + 1 ] = y;\n\t\t\tthis.array[ index + 2 ] = z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetXYZW: function ( index, x, y, z, w ) {\n\n\t\t\tindex *= this.itemSize;\n\n\t\t\tthis.array[ index + 0 ] = x;\n\t\t\tthis.array[ index + 1 ] = y;\n\t\t\tthis.array[ index + 2 ] = z;\n\t\t\tthis.array[ index + 3 ] = w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t}\n\n\t};\n\n\t//\n\n\tfunction Int8Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Int8Array( array ), itemSize );\n\n\t}\n\n\tfunction Uint8Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Uint8Array( array ), itemSize );\n\n\t}\n\n\tfunction Uint8ClampedAttribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Uint8ClampedArray( array ), itemSize );\n\n\t}\n\n\tfunction Int16Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Int16Array( array ), itemSize );\n\n\t}\n\n\tfunction Uint16Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Uint16Array( array ), itemSize );\n\n\t}\n\n\tfunction Int32Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Int32Array( array ), itemSize );\n\n\t}\n\n\tfunction Uint32Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Uint32Array( array ), itemSize );\n\n\t}\n\n\tfunction Float32Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Float32Array( array ), itemSize );\n\n\t}\n\n\tfunction Float64Attribute( array, itemSize ) {\n\n\t\treturn new BufferAttribute( new Float64Array( array ), itemSize );\n\n\t}\n\n\t// Deprecated\n\n\tfunction DynamicBufferAttribute( array, itemSize ) {\n\n\t\tconsole.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.' );\n\t\treturn new BufferAttribute( array, itemSize ).setDynamic( true );\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author kile / http://kile.stravaganza.org/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t * @author bhouston / http://clara.io\n\t */\n\n\tfunction Geometry() {\n\n\t\tObject.defineProperty( this, 'id', { value: GeometryIdCount() } );\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Geometry';\n\n\t\tthis.vertices = [];\n\t\tthis.colors = [];\n\t\tthis.faces = [];\n\t\tthis.faceVertexUvs = [ [] ];\n\n\t\tthis.morphTargets = [];\n\t\tthis.morphNormals = [];\n\n\t\tthis.skinWeights = [];\n\t\tthis.skinIndices = [];\n\n\t\tthis.lineDistances = [];\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\t// update flags\n\n\t\tthis.elementsNeedUpdate = false;\n\t\tthis.verticesNeedUpdate = false;\n\t\tthis.uvsNeedUpdate = false;\n\t\tthis.normalsNeedUpdate = false;\n\t\tthis.colorsNeedUpdate = false;\n\t\tthis.lineDistancesNeedUpdate = false;\n\t\tthis.groupsNeedUpdate = false;\n\n\t}\n\n\tObject.assign( Geometry.prototype, EventDispatcher.prototype, {\n\n\t\tisGeometry: true,\n\n\t\tapplyMatrix: function ( matrix ) {\n\n\t\t\tvar normalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\tfor ( var i = 0, il = this.vertices.length; i < il; i ++ ) {\n\n\t\t\t\tvar vertex = this.vertices[ i ];\n\t\t\t\tvertex.applyMatrix4( matrix );\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0, il = this.faces.length; i < il; i ++ ) {\n\n\t\t\t\tvar face = this.faces[ i ];\n\t\t\t\tface.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\t\t\tfor ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) {\n\n\t\t\t\t\tface.vertexNormals[ j ].applyMatrix3( normalMatrix ).normalize();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox !== null ) {\n\n\t\t\t\tthis.computeBoundingBox();\n\n\t\t\t}\n\n\t\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\t\tthis.computeBoundingSphere();\n\n\t\t\t}\n\n\t\t\tthis.verticesNeedUpdate = true;\n\t\t\tthis.normalsNeedUpdate = true;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\trotateX: function () {\n\n\t\t\t// rotate geometry around world x-axis\n\n\t\t\tvar m1;\n\n\t\t\treturn function rotateX( angle ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeRotationX( angle );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\trotateY: function () {\n\n\t\t\t// rotate geometry around world y-axis\n\n\t\t\tvar m1;\n\n\t\t\treturn function rotateY( angle ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeRotationY( angle );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\trotateZ: function () {\n\n\t\t\t// rotate geometry around world z-axis\n\n\t\t\tvar m1;\n\n\t\t\treturn function rotateZ( angle ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeRotationZ( angle );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslate: function () {\n\n\t\t\t// translate geometry\n\n\t\t\tvar m1;\n\n\t\t\treturn function translate( x, y, z ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeTranslation( x, y, z );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tscale: function () {\n\n\t\t\t// scale geometry\n\n\t\t\tvar m1;\n\n\t\t\treturn function scale( x, y, z ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeScale( x, y, z );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tlookAt: function () {\n\n\t\t\tvar obj;\n\n\t\t\treturn function lookAt( vector ) {\n\n\t\t\t\tif ( obj === undefined ) obj = new Object3D();\n\n\t\t\t\tobj.lookAt( vector );\n\n\t\t\t\tobj.updateMatrix();\n\n\t\t\t\tthis.applyMatrix( obj.matrix );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tfromBufferGeometry: function ( geometry ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar indices = geometry.index !== null ? geometry.index.array : undefined;\n\t\t\tvar attributes = geometry.attributes;\n\n\t\t\tvar positions = attributes.position.array;\n\t\t\tvar normals = attributes.normal !== undefined ? attributes.normal.array : undefined;\n\t\t\tvar colors = attributes.color !== undefined ? attributes.color.array : undefined;\n\t\t\tvar uvs = attributes.uv !== undefined ? attributes.uv.array : undefined;\n\t\t\tvar uvs2 = attributes.uv2 !== undefined ? attributes.uv2.array : undefined;\n\n\t\t\tif ( uvs2 !== undefined ) this.faceVertexUvs[ 1 ] = [];\n\n\t\t\tvar tempNormals = [];\n\t\t\tvar tempUVs = [];\n\t\t\tvar tempUVs2 = [];\n\n\t\t\tfor ( var i = 0, j = 0; i < positions.length; i += 3, j += 2 ) {\n\n\t\t\t\tscope.vertices.push( new Vector3( positions[ i ], positions[ i + 1 ], positions[ i + 2 ] ) );\n\n\t\t\t\tif ( normals !== undefined ) {\n\n\t\t\t\t\ttempNormals.push( new Vector3( normals[ i ], normals[ i + 1 ], normals[ i + 2 ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( colors !== undefined ) {\n\n\t\t\t\t\tscope.colors.push( new Color( colors[ i ], colors[ i + 1 ], colors[ i + 2 ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( uvs !== undefined ) {\n\n\t\t\t\t\ttempUVs.push( new Vector2( uvs[ j ], uvs[ j + 1 ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( uvs2 !== undefined ) {\n\n\t\t\t\t\ttempUVs2.push( new Vector2( uvs2[ j ], uvs2[ j + 1 ] ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction addFace( a, b, c, materialIndex ) {\n\n\t\t\t\tvar vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : [];\n\t\t\t\tvar vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : [];\n\n\t\t\t\tvar face = new Face3( a, b, c, vertexNormals, vertexColors, materialIndex );\n\n\t\t\t\tscope.faces.push( face );\n\n\t\t\t\tif ( uvs !== undefined ) {\n\n\t\t\t\t\tscope.faceVertexUvs[ 0 ].push( [ tempUVs[ a ].clone(), tempUVs[ b ].clone(), tempUVs[ c ].clone() ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( uvs2 !== undefined ) {\n\n\t\t\t\t\tscope.faceVertexUvs[ 1 ].push( [ tempUVs2[ a ].clone(), tempUVs2[ b ].clone(), tempUVs2[ c ].clone() ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( indices !== undefined ) {\n\n\t\t\t\tvar groups = geometry.groups;\n\n\t\t\t\tif ( groups.length > 0 ) {\n\n\t\t\t\t\tfor ( var i = 0; i < groups.length; i ++ ) {\n\n\t\t\t\t\t\tvar group = groups[ i ];\n\n\t\t\t\t\t\tvar start = group.start;\n\t\t\t\t\t\tvar count = group.count;\n\n\t\t\t\t\t\tfor ( var j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\t\t\t\taddFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfor ( var i = 0; i < indices.length; i += 3 ) {\n\n\t\t\t\t\t\taddFace( indices[ i ], indices[ i + 1 ], indices[ i + 2 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tfor ( var i = 0; i < positions.length / 3; i += 3 ) {\n\n\t\t\t\t\taddFace( i, i + 1, i + 2 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.computeFaceNormals();\n\n\t\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\t\tthis.boundingBox = geometry.boundingBox.clone();\n\n\t\t\t}\n\n\t\t\tif ( geometry.boundingSphere !== null ) {\n\n\t\t\t\tthis.boundingSphere = geometry.boundingSphere.clone();\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcenter: function () {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t\tvar offset = this.boundingBox.getCenter().negate();\n\n\t\t\tthis.translate( offset.x, offset.y, offset.z );\n\n\t\t\treturn offset;\n\n\t\t},\n\n\t\tnormalize: function () {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t\tvar center = this.boundingSphere.center;\n\t\t\tvar radius = this.boundingSphere.radius;\n\n\t\t\tvar s = radius === 0 ? 1 : 1.0 / radius;\n\n\t\t\tvar matrix = new Matrix4();\n\t\t\tmatrix.set(\n\t\t\t\ts, 0, 0, - s * center.x,\n\t\t\t\t0, s, 0, - s * center.y,\n\t\t\t\t0, 0, s, - s * center.z,\n\t\t\t\t0, 0, 0, 1\n\t\t\t);\n\n\t\t\tthis.applyMatrix( matrix );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcomputeFaceNormals: function () {\n\n\t\t\tvar cb = new Vector3(), ab = new Vector3();\n\n\t\t\tfor ( var f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\tvar face = this.faces[ f ];\n\n\t\t\t\tvar vA = this.vertices[ face.a ];\n\t\t\t\tvar vB = this.vertices[ face.b ];\n\t\t\t\tvar vC = this.vertices[ face.c ];\n\n\t\t\t\tcb.subVectors( vC, vB );\n\t\t\t\tab.subVectors( vA, vB );\n\t\t\t\tcb.cross( ab );\n\n\t\t\t\tcb.normalize();\n\n\t\t\t\tface.normal.copy( cb );\n\n\t\t\t}\n\n\t\t},\n\n\t\tcomputeVertexNormals: function ( areaWeighted ) {\n\n\t\t\tif ( areaWeighted === undefined ) areaWeighted = true;\n\n\t\t\tvar v, vl, f, fl, face, vertices;\n\n\t\t\tvertices = new Array( this.vertices.length );\n\n\t\t\tfor ( v = 0, vl = this.vertices.length; v < vl; v ++ ) {\n\n\t\t\t\tvertices[ v ] = new Vector3();\n\n\t\t\t}\n\n\t\t\tif ( areaWeighted ) {\n\n\t\t\t\t// vertex normals weighted by triangle areas\n\t\t\t\t// http://www.iquilezles.org/www/articles/normals/normals.htm\n\n\t\t\t\tvar vA, vB, vC;\n\t\t\t\tvar cb = new Vector3(), ab = new Vector3();\n\n\t\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\t\tface = this.faces[ f ];\n\n\t\t\t\t\tvA = this.vertices[ face.a ];\n\t\t\t\t\tvB = this.vertices[ face.b ];\n\t\t\t\t\tvC = this.vertices[ face.c ];\n\n\t\t\t\t\tcb.subVectors( vC, vB );\n\t\t\t\t\tab.subVectors( vA, vB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tvertices[ face.a ].add( cb );\n\t\t\t\t\tvertices[ face.b ].add( cb );\n\t\t\t\t\tvertices[ face.c ].add( cb );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tthis.computeFaceNormals();\n\n\t\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\t\tface = this.faces[ f ];\n\n\t\t\t\t\tvertices[ face.a ].add( face.normal );\n\t\t\t\t\tvertices[ face.b ].add( face.normal );\n\t\t\t\t\tvertices[ face.c ].add( face.normal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( v = 0, vl = this.vertices.length; v < vl; v ++ ) {\n\n\t\t\t\tvertices[ v ].normalize();\n\n\t\t\t}\n\n\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\tface = this.faces[ f ];\n\n\t\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\t\tif ( vertexNormals.length === 3 ) {\n\n\t\t\t\t\tvertexNormals[ 0 ].copy( vertices[ face.a ] );\n\t\t\t\t\tvertexNormals[ 1 ].copy( vertices[ face.b ] );\n\t\t\t\t\tvertexNormals[ 2 ].copy( vertices[ face.c ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvertexNormals[ 0 ] = vertices[ face.a ].clone();\n\t\t\t\t\tvertexNormals[ 1 ] = vertices[ face.b ].clone();\n\t\t\t\t\tvertexNormals[ 2 ] = vertices[ face.c ].clone();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.faces.length > 0 ) {\n\n\t\t\t\tthis.normalsNeedUpdate = true;\n\n\t\t\t}\n\n\t\t},\n\n\t\tcomputeFlatVertexNormals: function () {\n\n\t\t\tvar f, fl, face;\n\n\t\t\tthis.computeFaceNormals();\n\n\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\tface = this.faces[ f ];\n\n\t\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\t\tif ( vertexNormals.length === 3 ) {\n\n\t\t\t\t\tvertexNormals[ 0 ].copy( face.normal );\n\t\t\t\t\tvertexNormals[ 1 ].copy( face.normal );\n\t\t\t\t\tvertexNormals[ 2 ].copy( face.normal );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvertexNormals[ 0 ] = face.normal.clone();\n\t\t\t\t\tvertexNormals[ 1 ] = face.normal.clone();\n\t\t\t\t\tvertexNormals[ 2 ] = face.normal.clone();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.faces.length > 0 ) {\n\n\t\t\t\tthis.normalsNeedUpdate = true;\n\n\t\t\t}\n\n\t\t},\n\n\t\tcomputeMorphNormals: function () {\n\n\t\t\tvar i, il, f, fl, face;\n\n\t\t\t// save original normals\n\t\t\t// - create temp variables on first access\n\t\t\t// otherwise just copy (for faster repeated calls)\n\n\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\tface = this.faces[ f ];\n\n\t\t\t\tif ( ! face.__originalFaceNormal ) {\n\n\t\t\t\t\tface.__originalFaceNormal = face.normal.clone();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tface.__originalFaceNormal.copy( face.normal );\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! face.__originalVertexNormals ) face.__originalVertexNormals = [];\n\n\t\t\t\tfor ( i = 0, il = face.vertexNormals.length; i < il; i ++ ) {\n\n\t\t\t\t\tif ( ! face.__originalVertexNormals[ i ] ) {\n\n\t\t\t\t\t\tface.__originalVertexNormals[ i ] = face.vertexNormals[ i ].clone();\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tface.__originalVertexNormals[ i ].copy( face.vertexNormals[ i ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// use temp geometry to compute face and vertex normals for each morph\n\n\t\t\tvar tmpGeo = new Geometry();\n\t\t\ttmpGeo.faces = this.faces;\n\n\t\t\tfor ( i = 0, il = this.morphTargets.length; i < il; i ++ ) {\n\n\t\t\t\t// create on first access\n\n\t\t\t\tif ( ! this.morphNormals[ i ] ) {\n\n\t\t\t\t\tthis.morphNormals[ i ] = {};\n\t\t\t\t\tthis.morphNormals[ i ].faceNormals = [];\n\t\t\t\t\tthis.morphNormals[ i ].vertexNormals = [];\n\n\t\t\t\t\tvar dstNormalsFace = this.morphNormals[ i ].faceNormals;\n\t\t\t\t\tvar dstNormalsVertex = this.morphNormals[ i ].vertexNormals;\n\n\t\t\t\t\tvar faceNormal, vertexNormals;\n\n\t\t\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\t\t\tfaceNormal = new Vector3();\n\t\t\t\t\t\tvertexNormals = { a: new Vector3(), b: new Vector3(), c: new Vector3() };\n\n\t\t\t\t\t\tdstNormalsFace.push( faceNormal );\n\t\t\t\t\t\tdstNormalsVertex.push( vertexNormals );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar morphNormals = this.morphNormals[ i ];\n\n\t\t\t\t// set vertices to morph target\n\n\t\t\t\ttmpGeo.vertices = this.morphTargets[ i ].vertices;\n\n\t\t\t\t// compute morph normals\n\n\t\t\t\ttmpGeo.computeFaceNormals();\n\t\t\t\ttmpGeo.computeVertexNormals();\n\n\t\t\t\t// store morph normals\n\n\t\t\t\tvar faceNormal, vertexNormals;\n\n\t\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\t\tface = this.faces[ f ];\n\n\t\t\t\t\tfaceNormal = morphNormals.faceNormals[ f ];\n\t\t\t\t\tvertexNormals = morphNormals.vertexNormals[ f ];\n\n\t\t\t\t\tfaceNormal.copy( face.normal );\n\n\t\t\t\t\tvertexNormals.a.copy( face.vertexNormals[ 0 ] );\n\t\t\t\t\tvertexNormals.b.copy( face.vertexNormals[ 1 ] );\n\t\t\t\t\tvertexNormals.c.copy( face.vertexNormals[ 2 ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// restore original normals\n\n\t\t\tfor ( f = 0, fl = this.faces.length; f < fl; f ++ ) {\n\n\t\t\t\tface = this.faces[ f ];\n\n\t\t\t\tface.normal = face.__originalFaceNormal;\n\t\t\t\tface.vertexNormals = face.__originalVertexNormals;\n\n\t\t\t}\n\n\t\t},\n\n\t\tcomputeTangents: function () {\n\n\t\t\tconsole.warn( 'THREE.Geometry: .computeTangents() has been removed.' );\n\n\t\t},\n\n\t\tcomputeLineDistances: function () {\n\n\t\t\tvar d = 0;\n\t\t\tvar vertices = this.vertices;\n\n\t\t\tfor ( var i = 0, il = vertices.length; i < il; i ++ ) {\n\n\t\t\t\tif ( i > 0 ) {\n\n\t\t\t\t\td += vertices[ i ].distanceTo( vertices[ i - 1 ] );\n\n\t\t\t\t}\n\n\t\t\t\tthis.lineDistances[ i ] = d;\n\n\t\t\t}\n\n\t\t},\n\n\t\tcomputeBoundingBox: function () {\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.boundingBox = new Box3();\n\n\t\t\t}\n\n\t\t\tthis.boundingBox.setFromPoints( this.vertices );\n\n\t\t},\n\n\t\tcomputeBoundingSphere: function () {\n\n\t\t\tif ( this.boundingSphere === null ) {\n\n\t\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t\t}\n\n\t\t\tthis.boundingSphere.setFromPoints( this.vertices );\n\n\t\t},\n\n\t\tmerge: function ( geometry, matrix, materialIndexOffset ) {\n\n\t\t\tif ( (geometry && geometry.isGeometry) === false ) {\n\n\t\t\t\tconsole.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tvar normalMatrix,\n\t\t\tvertexOffset = this.vertices.length,\n\t\t\tvertices1 = this.vertices,\n\t\t\tvertices2 = geometry.vertices,\n\t\t\tfaces1 = this.faces,\n\t\t\tfaces2 = geometry.faces,\n\t\t\tuvs1 = this.faceVertexUvs[ 0 ],\n\t\t\tuvs2 = geometry.faceVertexUvs[ 0 ],\n\t\t\tcolors1 = this.colors,\n\t\t\tcolors2 = geometry.colors;\n\n\t\t\tif ( materialIndexOffset === undefined ) materialIndexOffset = 0;\n\n\t\t\tif ( matrix !== undefined ) {\n\n\t\t\t\tnormalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\t}\n\n\t\t\t// vertices\n\n\t\t\tfor ( var i = 0, il = vertices2.length; i < il; i ++ ) {\n\n\t\t\t\tvar vertex = vertices2[ i ];\n\n\t\t\t\tvar vertexCopy = vertex.clone();\n\n\t\t\t\tif ( matrix !== undefined ) vertexCopy.applyMatrix4( matrix );\n\n\t\t\t\tvertices1.push( vertexCopy );\n\n\t\t\t}\n\n\t\t\t// colors\n\n\t\t\tfor ( var i = 0, il = colors2.length; i < il; i ++ ) {\n\n\t\t\t\tcolors1.push( colors2[ i ].clone() );\n\n\t\t\t}\n\n\t\t\t// faces\n\n\t\t\tfor ( i = 0, il = faces2.length; i < il; i ++ ) {\n\n\t\t\t\tvar face = faces2[ i ], faceCopy, normal, color,\n\t\t\t\tfaceVertexNormals = face.vertexNormals,\n\t\t\t\tfaceVertexColors = face.vertexColors;\n\n\t\t\t\tfaceCopy = new Face3( face.a + vertexOffset, face.b + vertexOffset, face.c + vertexOffset );\n\t\t\t\tfaceCopy.normal.copy( face.normal );\n\n\t\t\t\tif ( normalMatrix !== undefined ) {\n\n\t\t\t\t\tfaceCopy.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var j = 0, jl = faceVertexNormals.length; j < jl; j ++ ) {\n\n\t\t\t\t\tnormal = faceVertexNormals[ j ].clone();\n\n\t\t\t\t\tif ( normalMatrix !== undefined ) {\n\n\t\t\t\t\t\tnormal.applyMatrix3( normalMatrix ).normalize();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfaceCopy.vertexNormals.push( normal );\n\n\t\t\t\t}\n\n\t\t\t\tfaceCopy.color.copy( face.color );\n\n\t\t\t\tfor ( var j = 0, jl = faceVertexColors.length; j < jl; j ++ ) {\n\n\t\t\t\t\tcolor = faceVertexColors[ j ];\n\t\t\t\t\tfaceCopy.vertexColors.push( color.clone() );\n\n\t\t\t\t}\n\n\t\t\t\tfaceCopy.materialIndex = face.materialIndex + materialIndexOffset;\n\n\t\t\t\tfaces1.push( faceCopy );\n\n\t\t\t}\n\n\t\t\t// uvs\n\n\t\t\tfor ( i = 0, il = uvs2.length; i < il; i ++ ) {\n\n\t\t\t\tvar uv = uvs2[ i ], uvCopy = [];\n\n\t\t\t\tif ( uv === undefined ) {\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var j = 0, jl = uv.length; j < jl; j ++ ) {\n\n\t\t\t\t\tuvCopy.push( uv[ j ].clone() );\n\n\t\t\t\t}\n\n\t\t\t\tuvs1.push( uvCopy );\n\n\t\t\t}\n\n\t\t},\n\n\t\tmergeMesh: function ( mesh ) {\n\n\t\t\tif ( (mesh && mesh.isMesh) === false ) {\n\n\t\t\t\tconsole.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tmesh.matrixAutoUpdate && mesh.updateMatrix();\n\n\t\t\tthis.merge( mesh.geometry, mesh.matrix );\n\n\t\t},\n\n\t\t/*\n\t\t * Checks for duplicate vertices with hashmap.\n\t\t * Duplicated vertices are removed\n\t\t * and faces' vertices are updated.\n\t\t */\n\n\t\tmergeVertices: function () {\n\n\t\t\tvar verticesMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique)\n\t\t\tvar unique = [], changes = [];\n\n\t\t\tvar v, key;\n\t\t\tvar precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001\n\t\t\tvar precision = Math.pow( 10, precisionPoints );\n\t\t\tvar i, il, face;\n\t\t\tvar indices, j, jl;\n\n\t\t\tfor ( i = 0, il = this.vertices.length; i < il; i ++ ) {\n\n\t\t\t\tv = this.vertices[ i ];\n\t\t\t\tkey = Math.round( v.x * precision ) + '_' + Math.round( v.y * precision ) + '_' + Math.round( v.z * precision );\n\n\t\t\t\tif ( verticesMap[ key ] === undefined ) {\n\n\t\t\t\t\tverticesMap[ key ] = i;\n\t\t\t\t\tunique.push( this.vertices[ i ] );\n\t\t\t\t\tchanges[ i ] = unique.length - 1;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t//console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]);\n\t\t\t\t\tchanges[ i ] = changes[ verticesMap[ key ] ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t// if faces are completely degenerate after merging vertices, we\n\t\t\t// have to remove them from the geometry.\n\t\t\tvar faceIndicesToRemove = [];\n\n\t\t\tfor ( i = 0, il = this.faces.length; i < il; i ++ ) {\n\n\t\t\t\tface = this.faces[ i ];\n\n\t\t\t\tface.a = changes[ face.a ];\n\t\t\t\tface.b = changes[ face.b ];\n\t\t\t\tface.c = changes[ face.c ];\n\n\t\t\t\tindices = [ face.a, face.b, face.c ];\n\n\t\t\t\tvar dupIndex = - 1;\n\n\t\t\t\t// if any duplicate vertices are found in a Face3\n\t\t\t\t// we have to remove the face as nothing can be saved\n\t\t\t\tfor ( var n = 0; n < 3; n ++ ) {\n\n\t\t\t\t\tif ( indices[ n ] === indices[ ( n + 1 ) % 3 ] ) {\n\n\t\t\t\t\t\tdupIndex = n;\n\t\t\t\t\t\tfaceIndicesToRemove.push( i );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) {\n\n\t\t\t\tvar idx = faceIndicesToRemove[ i ];\n\n\t\t\t\tthis.faces.splice( idx, 1 );\n\n\t\t\t\tfor ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tthis.faceVertexUvs[ j ].splice( idx, 1 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Use unique set of vertices\n\n\t\t\tvar diff = this.vertices.length - unique.length;\n\t\t\tthis.vertices = unique;\n\t\t\treturn diff;\n\n\t\t},\n\n\t\tsortFacesByMaterialIndex: function () {\n\n\t\t\tvar faces = this.faces;\n\t\t\tvar length = faces.length;\n\n\t\t\t// tag faces\n\n\t\t\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\t\t\tfaces[ i ]._id = i;\n\n\t\t\t}\n\n\t\t\t// sort faces\n\n\t\t\tfunction materialIndexSort( a, b ) {\n\n\t\t\t\treturn a.materialIndex - b.materialIndex;\n\n\t\t\t}\n\n\t\t\tfaces.sort( materialIndexSort );\n\n\t\t\t// sort uvs\n\n\t\t\tvar uvs1 = this.faceVertexUvs[ 0 ];\n\t\t\tvar uvs2 = this.faceVertexUvs[ 1 ];\n\n\t\t\tvar newUvs1, newUvs2;\n\n\t\t\tif ( uvs1 && uvs1.length === length ) newUvs1 = [];\n\t\t\tif ( uvs2 && uvs2.length === length ) newUvs2 = [];\n\n\t\t\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\t\t\tvar id = faces[ i ]._id;\n\n\t\t\t\tif ( newUvs1 ) newUvs1.push( uvs1[ id ] );\n\t\t\t\tif ( newUvs2 ) newUvs2.push( uvs2[ id ] );\n\n\t\t\t}\n\n\t\t\tif ( newUvs1 ) this.faceVertexUvs[ 0 ] = newUvs1;\n\t\t\tif ( newUvs2 ) this.faceVertexUvs[ 1 ] = newUvs2;\n\n\t\t},\n\n\t\ttoJSON: function () {\n\n\t\t\tvar data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.4,\n\t\t\t\t\ttype: 'Geometry',\n\t\t\t\t\tgenerator: 'Geometry.toJSON'\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// standard Geometry serialization\n\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.type = this.type;\n\t\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\t\tif ( this.parameters !== undefined ) {\n\n\t\t\t\tvar parameters = this.parameters;\n\n\t\t\t\tfor ( var key in parameters ) {\n\n\t\t\t\t\tif ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];\n\n\t\t\t\t}\n\n\t\t\t\treturn data;\n\n\t\t\t}\n\n\t\t\tvar vertices = [];\n\n\t\t\tfor ( var i = 0; i < this.vertices.length; i ++ ) {\n\n\t\t\t\tvar vertex = this.vertices[ i ];\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t}\n\n\t\t\tvar faces = [];\n\t\t\tvar normals = [];\n\t\t\tvar normalsHash = {};\n\t\t\tvar colors = [];\n\t\t\tvar colorsHash = {};\n\t\t\tvar uvs = [];\n\t\t\tvar uvsHash = {};\n\n\t\t\tfor ( var i = 0; i < this.faces.length; i ++ ) {\n\n\t\t\t\tvar face = this.faces[ i ];\n\n\t\t\t\tvar hasMaterial = true;\n\t\t\t\tvar hasFaceUv = false; // deprecated\n\t\t\t\tvar hasFaceVertexUv = this.faceVertexUvs[ 0 ][ i ] !== undefined;\n\t\t\t\tvar hasFaceNormal = face.normal.length() > 0;\n\t\t\t\tvar hasFaceVertexNormal = face.vertexNormals.length > 0;\n\t\t\t\tvar hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1;\n\t\t\t\tvar hasFaceVertexColor = face.vertexColors.length > 0;\n\n\t\t\t\tvar faceType = 0;\n\n\t\t\t\tfaceType = setBit( faceType, 0, 0 ); // isQuad\n\t\t\t\tfaceType = setBit( faceType, 1, hasMaterial );\n\t\t\t\tfaceType = setBit( faceType, 2, hasFaceUv );\n\t\t\t\tfaceType = setBit( faceType, 3, hasFaceVertexUv );\n\t\t\t\tfaceType = setBit( faceType, 4, hasFaceNormal );\n\t\t\t\tfaceType = setBit( faceType, 5, hasFaceVertexNormal );\n\t\t\t\tfaceType = setBit( faceType, 6, hasFaceColor );\n\t\t\t\tfaceType = setBit( faceType, 7, hasFaceVertexColor );\n\n\t\t\t\tfaces.push( faceType );\n\t\t\t\tfaces.push( face.a, face.b, face.c );\n\t\t\t\tfaces.push( face.materialIndex );\n\n\t\t\t\tif ( hasFaceVertexUv ) {\n\n\t\t\t\t\tvar faceVertexUvs = this.faceVertexUvs[ 0 ][ i ];\n\n\t\t\t\t\tfaces.push(\n\t\t\t\t\t\tgetUvIndex( faceVertexUvs[ 0 ] ),\n\t\t\t\t\t\tgetUvIndex( faceVertexUvs[ 1 ] ),\n\t\t\t\t\t\tgetUvIndex( faceVertexUvs[ 2 ] )\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t\tif ( hasFaceNormal ) {\n\n\t\t\t\t\tfaces.push( getNormalIndex( face.normal ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( hasFaceVertexNormal ) {\n\n\t\t\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\t\t\tfaces.push(\n\t\t\t\t\t\tgetNormalIndex( vertexNormals[ 0 ] ),\n\t\t\t\t\t\tgetNormalIndex( vertexNormals[ 1 ] ),\n\t\t\t\t\t\tgetNormalIndex( vertexNormals[ 2 ] )\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t\tif ( hasFaceColor ) {\n\n\t\t\t\t\tfaces.push( getColorIndex( face.color ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( hasFaceVertexColor ) {\n\n\t\t\t\t\tvar vertexColors = face.vertexColors;\n\n\t\t\t\t\tfaces.push(\n\t\t\t\t\t\tgetColorIndex( vertexColors[ 0 ] ),\n\t\t\t\t\t\tgetColorIndex( vertexColors[ 1 ] ),\n\t\t\t\t\t\tgetColorIndex( vertexColors[ 2 ] )\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction setBit( value, position, enabled ) {\n\n\t\t\t\treturn enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position ) );\n\n\t\t\t}\n\n\t\t\tfunction getNormalIndex( normal ) {\n\n\t\t\t\tvar hash = normal.x.toString() + normal.y.toString() + normal.z.toString();\n\n\t\t\t\tif ( normalsHash[ hash ] !== undefined ) {\n\n\t\t\t\t\treturn normalsHash[ hash ];\n\n\t\t\t\t}\n\n\t\t\t\tnormalsHash[ hash ] = normals.length / 3;\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\treturn normalsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tfunction getColorIndex( color ) {\n\n\t\t\t\tvar hash = color.r.toString() + color.g.toString() + color.b.toString();\n\n\t\t\t\tif ( colorsHash[ hash ] !== undefined ) {\n\n\t\t\t\t\treturn colorsHash[ hash ];\n\n\t\t\t\t}\n\n\t\t\t\tcolorsHash[ hash ] = colors.length;\n\t\t\t\tcolors.push( color.getHex() );\n\n\t\t\t\treturn colorsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tfunction getUvIndex( uv ) {\n\n\t\t\t\tvar hash = uv.x.toString() + uv.y.toString();\n\n\t\t\t\tif ( uvsHash[ hash ] !== undefined ) {\n\n\t\t\t\t\treturn uvsHash[ hash ];\n\n\t\t\t\t}\n\n\t\t\t\tuvsHash[ hash ] = uvs.length / 2;\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\treturn uvsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tdata.data = {};\n\n\t\t\tdata.data.vertices = vertices;\n\t\t\tdata.data.normals = normals;\n\t\t\tif ( colors.length > 0 ) data.data.colors = colors;\n\t\t\tif ( uvs.length > 0 ) data.data.uvs = [ uvs ]; // temporal backward compatibility\n\t\t\tdata.data.faces = faces;\n\n\t\t\treturn data;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\t/*\n\t\t\t// Handle primitives\n\n\t\t\tvar parameters = this.parameters;\n\n\t\t\tif ( parameters !== undefined ) {\n\n\t\t\t\tvar values = [];\n\n\t\t\t\tfor ( var key in parameters ) {\n\n\t\t\t\t\tvalues.push( parameters[ key ] );\n\n\t\t\t\t}\n\n\t\t\t\tvar geometry = Object.create( this.constructor.prototype );\n\t\t\t\tthis.constructor.apply( geometry, values );\n\t\t\t\treturn geometry;\n\n\t\t\t}\n\n\t\t\treturn new this.constructor().copy( this );\n\t\t\t*/\n\n\t\t\treturn new Geometry().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.vertices = [];\n\t\t\tthis.faces = [];\n\t\t\tthis.faceVertexUvs = [ [] ];\n\t\t\tthis.colors = [];\n\n\t\t\tvar vertices = source.vertices;\n\n\t\t\tfor ( var i = 0, il = vertices.length; i < il; i ++ ) {\n\n\t\t\t\tthis.vertices.push( vertices[ i ].clone() );\n\n\t\t\t}\n\n\t\t\tvar colors = source.colors;\n\n\t\t\tfor ( var i = 0, il = colors.length; i < il; i ++ ) {\n\n\t\t\t\tthis.colors.push( colors[ i ].clone() );\n\n\t\t\t}\n\n\t\t\tvar faces = source.faces;\n\n\t\t\tfor ( var i = 0, il = faces.length; i < il; i ++ ) {\n\n\t\t\t\tthis.faces.push( faces[ i ].clone() );\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0, il = source.faceVertexUvs.length; i < il; i ++ ) {\n\n\t\t\t\tvar faceVertexUvs = source.faceVertexUvs[ i ];\n\n\t\t\t\tif ( this.faceVertexUvs[ i ] === undefined ) {\n\n\t\t\t\t\tthis.faceVertexUvs[ i ] = [];\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var j = 0, jl = faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tvar uvs = faceVertexUvs[ j ], uvsCopy = [];\n\n\t\t\t\t\tfor ( var k = 0, kl = uvs.length; k < kl; k ++ ) {\n\n\t\t\t\t\t\tvar uv = uvs[ k ];\n\n\t\t\t\t\t\tuvsCopy.push( uv.clone() );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.faceVertexUvs[ i ].push( uvsCopy );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdispose: function () {\n\n\t\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\t}\n\n\t} );\n\n\tvar count$3 = 0;\n\tfunction GeometryIdCount() { return count$3++; }\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction DirectGeometry() {\n\n\t\tObject.defineProperty( this, 'id', { value: GeometryIdCount() } );\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'DirectGeometry';\n\n\t\tthis.indices = [];\n\t\tthis.vertices = [];\n\t\tthis.normals = [];\n\t\tthis.colors = [];\n\t\tthis.uvs = [];\n\t\tthis.uvs2 = [];\n\n\t\tthis.groups = [];\n\n\t\tthis.morphTargets = {};\n\n\t\tthis.skinWeights = [];\n\t\tthis.skinIndices = [];\n\n\t\t// this.lineDistances = [];\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\t// update flags\n\n\t\tthis.verticesNeedUpdate = false;\n\t\tthis.normalsNeedUpdate = false;\n\t\tthis.colorsNeedUpdate = false;\n\t\tthis.uvsNeedUpdate = false;\n\t\tthis.groupsNeedUpdate = false;\n\n\t}\n\n\tObject.assign( DirectGeometry.prototype, EventDispatcher.prototype, {\n\n\t\tcomputeBoundingBox: Geometry.prototype.computeBoundingBox,\n\t\tcomputeBoundingSphere: Geometry.prototype.computeBoundingSphere,\n\n\t\tcomputeFaceNormals: function () {\n\n\t\t\tconsole.warn( 'THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.' );\n\n\t\t},\n\n\t\tcomputeVertexNormals: function () {\n\n\t\t\tconsole.warn( 'THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.' );\n\n\t\t},\n\n\t\tcomputeGroups: function ( geometry ) {\n\n\t\t\tvar group;\n\t\t\tvar groups = [];\n\t\t\tvar materialIndex;\n\n\t\t\tvar faces = geometry.faces;\n\n\t\t\tfor ( var i = 0; i < faces.length; i ++ ) {\n\n\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\t// materials\n\n\t\t\t\tif ( face.materialIndex !== materialIndex ) {\n\n\t\t\t\t\tmaterialIndex = face.materialIndex;\n\n\t\t\t\t\tif ( group !== undefined ) {\n\n\t\t\t\t\t\tgroup.count = ( i * 3 ) - group.start;\n\t\t\t\t\t\tgroups.push( group );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgroup = {\n\t\t\t\t\t\tstart: i * 3,\n\t\t\t\t\t\tmaterialIndex: materialIndex\n\t\t\t\t\t};\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( group !== undefined ) {\n\n\t\t\t\tgroup.count = ( i * 3 ) - group.start;\n\t\t\t\tgroups.push( group );\n\n\t\t\t}\n\n\t\t\tthis.groups = groups;\n\n\t\t},\n\n\t\tfromGeometry: function ( geometry ) {\n\n\t\t\tvar faces = geometry.faces;\n\t\t\tvar vertices = geometry.vertices;\n\t\t\tvar faceVertexUvs = geometry.faceVertexUvs;\n\n\t\t\tvar hasFaceVertexUv = faceVertexUvs[ 0 ] && faceVertexUvs[ 0 ].length > 0;\n\t\t\tvar hasFaceVertexUv2 = faceVertexUvs[ 1 ] && faceVertexUvs[ 1 ].length > 0;\n\n\t\t\t// morphs\n\n\t\t\tvar morphTargets = geometry.morphTargets;\n\t\t\tvar morphTargetsLength = morphTargets.length;\n\n\t\t\tvar morphTargetsPosition;\n\n\t\t\tif ( morphTargetsLength > 0 ) {\n\n\t\t\t\tmorphTargetsPosition = [];\n\n\t\t\t\tfor ( var i = 0; i < morphTargetsLength; i ++ ) {\n\n\t\t\t\t\tmorphTargetsPosition[ i ] = [];\n\n\t\t\t\t}\n\n\t\t\t\tthis.morphTargets.position = morphTargetsPosition;\n\n\t\t\t}\n\n\t\t\tvar morphNormals = geometry.morphNormals;\n\t\t\tvar morphNormalsLength = morphNormals.length;\n\n\t\t\tvar morphTargetsNormal;\n\n\t\t\tif ( morphNormalsLength > 0 ) {\n\n\t\t\t\tmorphTargetsNormal = [];\n\n\t\t\t\tfor ( var i = 0; i < morphNormalsLength; i ++ ) {\n\n\t\t\t\t\tmorphTargetsNormal[ i ] = [];\n\n\t\t\t\t}\n\n\t\t\t\tthis.morphTargets.normal = morphTargetsNormal;\n\n\t\t\t}\n\n\t\t\t// skins\n\n\t\t\tvar skinIndices = geometry.skinIndices;\n\t\t\tvar skinWeights = geometry.skinWeights;\n\n\t\t\tvar hasSkinIndices = skinIndices.length === vertices.length;\n\t\t\tvar hasSkinWeights = skinWeights.length === vertices.length;\n\n\t\t\t//\n\n\t\t\tfor ( var i = 0; i < faces.length; i ++ ) {\n\n\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\tthis.vertices.push( vertices[ face.a ], vertices[ face.b ], vertices[ face.c ] );\n\n\t\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\t\tif ( vertexNormals.length === 3 ) {\n\n\t\t\t\t\tthis.normals.push( vertexNormals[ 0 ], vertexNormals[ 1 ], vertexNormals[ 2 ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar normal = face.normal;\n\n\t\t\t\t\tthis.normals.push( normal, normal, normal );\n\n\t\t\t\t}\n\n\t\t\t\tvar vertexColors = face.vertexColors;\n\n\t\t\t\tif ( vertexColors.length === 3 ) {\n\n\t\t\t\t\tthis.colors.push( vertexColors[ 0 ], vertexColors[ 1 ], vertexColors[ 2 ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar color = face.color;\n\n\t\t\t\t\tthis.colors.push( color, color, color );\n\n\t\t\t\t}\n\n\t\t\t\tif ( hasFaceVertexUv === true ) {\n\n\t\t\t\t\tvar vertexUvs = faceVertexUvs[ 0 ][ i ];\n\n\t\t\t\t\tif ( vertexUvs !== undefined ) {\n\n\t\t\t\t\t\tthis.uvs.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', i );\n\n\t\t\t\t\t\tthis.uvs.push( new Vector2(), new Vector2(), new Vector2() );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( hasFaceVertexUv2 === true ) {\n\n\t\t\t\t\tvar vertexUvs = faceVertexUvs[ 1 ][ i ];\n\n\t\t\t\t\tif ( vertexUvs !== undefined ) {\n\n\t\t\t\t\t\tthis.uvs2.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', i );\n\n\t\t\t\t\t\tthis.uvs2.push( new Vector2(), new Vector2(), new Vector2() );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// morphs\n\n\t\t\t\tfor ( var j = 0; j < morphTargetsLength; j ++ ) {\n\n\t\t\t\t\tvar morphTarget = morphTargets[ j ].vertices;\n\n\t\t\t\t\tmorphTargetsPosition[ j ].push( morphTarget[ face.a ], morphTarget[ face.b ], morphTarget[ face.c ] );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var j = 0; j < morphNormalsLength; j ++ ) {\n\n\t\t\t\t\tvar morphNormal = morphNormals[ j ].vertexNormals[ i ];\n\n\t\t\t\t\tmorphTargetsNormal[ j ].push( morphNormal.a, morphNormal.b, morphNormal.c );\n\n\t\t\t\t}\n\n\t\t\t\t// skins\n\n\t\t\t\tif ( hasSkinIndices ) {\n\n\t\t\t\t\tthis.skinIndices.push( skinIndices[ face.a ], skinIndices[ face.b ], skinIndices[ face.c ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( hasSkinWeights ) {\n\n\t\t\t\t\tthis.skinWeights.push( skinWeights[ face.a ], skinWeights[ face.b ], skinWeights[ face.c ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.computeGroups( geometry );\n\n\t\t\tthis.verticesNeedUpdate = geometry.verticesNeedUpdate;\n\t\t\tthis.normalsNeedUpdate = geometry.normalsNeedUpdate;\n\t\t\tthis.colorsNeedUpdate = geometry.colorsNeedUpdate;\n\t\t\tthis.uvsNeedUpdate = geometry.uvsNeedUpdate;\n\t\t\tthis.groupsNeedUpdate = geometry.groupsNeedUpdate;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdispose: function () {\n\n\t\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction BufferGeometry() {\n\n\t\tObject.defineProperty( this, 'id', { value: GeometryIdCount() } );\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'BufferGeometry';\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\n\t\tthis.morphAttributes = {};\n\n\t\tthis.groups = [];\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\tthis.drawRange = { start: 0, count: Infinity };\n\n\t}\n\n\tObject.assign( BufferGeometry.prototype, EventDispatcher.prototype, {\n\n\t\tisBufferGeometry: true,\n\n\t\tgetIndex: function () {\n\n\t\t\treturn this.index;\n\n\t\t},\n\n\t\tsetIndex: function ( index ) {\n\n\t\t\tthis.index = index;\n\n\t\t},\n\n\t\taddAttribute: function ( name, attribute ) {\n\n\t\t\tif ( (attribute && attribute.isBufferAttribute) === false && (attribute && attribute.isInterleavedBufferAttribute) === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );\n\n\t\t\t\tthis.addAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( name === 'index' ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );\n\t\t\t\tthis.setIndex( attribute );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tthis.attributes[ name ] = attribute;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetAttribute: function ( name ) {\n\n\t\t\treturn this.attributes[ name ];\n\n\t\t},\n\n\t\tremoveAttribute: function ( name ) {\n\n\t\t\tdelete this.attributes[ name ];\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddGroup: function ( start, count, materialIndex ) {\n\n\t\t\tthis.groups.push( {\n\n\t\t\t\tstart: start,\n\t\t\t\tcount: count,\n\t\t\t\tmaterialIndex: materialIndex !== undefined ? materialIndex : 0\n\n\t\t\t} );\n\n\t\t},\n\n\t\tclearGroups: function () {\n\n\t\t\tthis.groups = [];\n\n\t\t},\n\n\t\tsetDrawRange: function ( start, count ) {\n\n\t\t\tthis.drawRange.start = start;\n\t\t\tthis.drawRange.count = count;\n\n\t\t},\n\n\t\tapplyMatrix: function ( matrix ) {\n\n\t\t\tvar position = this.attributes.position;\n\n\t\t\tif ( position !== undefined ) {\n\n\t\t\t\tmatrix.applyToVector3Array( position.array );\n\t\t\t\tposition.needsUpdate = true;\n\n\t\t\t}\n\n\t\t\tvar normal = this.attributes.normal;\n\n\t\t\tif ( normal !== undefined ) {\n\n\t\t\t\tvar normalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\t\tnormalMatrix.applyToVector3Array( normal.array );\n\t\t\t\tnormal.needsUpdate = true;\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox !== null ) {\n\n\t\t\t\tthis.computeBoundingBox();\n\n\t\t\t}\n\n\t\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\t\tthis.computeBoundingSphere();\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\trotateX: function () {\n\n\t\t\t// rotate geometry around world x-axis\n\n\t\t\tvar m1;\n\n\t\t\treturn function rotateX( angle ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeRotationX( angle );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\trotateY: function () {\n\n\t\t\t// rotate geometry around world y-axis\n\n\t\t\tvar m1;\n\n\t\t\treturn function rotateY( angle ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeRotationY( angle );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\trotateZ: function () {\n\n\t\t\t// rotate geometry around world z-axis\n\n\t\t\tvar m1;\n\n\t\t\treturn function rotateZ( angle ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeRotationZ( angle );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttranslate: function () {\n\n\t\t\t// translate geometry\n\n\t\t\tvar m1;\n\n\t\t\treturn function translate( x, y, z ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeTranslation( x, y, z );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tscale: function () {\n\n\t\t\t// scale geometry\n\n\t\t\tvar m1;\n\n\t\t\treturn function scale( x, y, z ) {\n\n\t\t\t\tif ( m1 === undefined ) m1 = new Matrix4();\n\n\t\t\t\tm1.makeScale( x, y, z );\n\n\t\t\t\tthis.applyMatrix( m1 );\n\n\t\t\t\treturn this;\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tlookAt: function () {\n\n\t\t\tvar obj;\n\n\t\t\treturn function lookAt( vector ) {\n\n\t\t\t\tif ( obj === undefined ) obj = new Object3D();\n\n\t\t\t\tobj.lookAt( vector );\n\n\t\t\t\tobj.updateMatrix();\n\n\t\t\t\tthis.applyMatrix( obj.matrix );\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tcenter: function () {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t\tvar offset = this.boundingBox.getCenter().negate();\n\n\t\t\tthis.translate( offset.x, offset.y, offset.z );\n\n\t\t\treturn offset;\n\n\t\t},\n\n\t\tsetFromObject: function ( object ) {\n\n\t\t\t// console.log( 'THREE.BufferGeometry.setFromObject(). Converting', object, this );\n\n\t\t\tvar geometry = object.geometry;\n\n\t\t\tif ( (object && object.isPoints) || (object && object.isLine) ) {\n\n\t\t\t\tvar positions = new Float32Attribute( geometry.vertices.length * 3, 3 );\n\t\t\t\tvar colors = new Float32Attribute( geometry.colors.length * 3, 3 );\n\n\t\t\t\tthis.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) );\n\t\t\t\tthis.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) );\n\n\t\t\t\tif ( geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length ) {\n\n\t\t\t\t\tvar lineDistances = new Float32Attribute( geometry.lineDistances.length, 1 );\n\n\t\t\t\t\tthis.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometry.boundingSphere !== null ) {\n\n\t\t\t\t\tthis.boundingSphere = geometry.boundingSphere.clone();\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\t\t\tthis.boundingBox = geometry.boundingBox.clone();\n\n\t\t\t\t}\n\n\t\t\t} else if ( (object && object.isMesh) ) {\n\n\t\t\t\tif ( (geometry && geometry.isGeometry) ) {\n\n\t\t\t\t\tthis.fromGeometry( geometry );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tupdateFromObject: function ( object ) {\n\n\t\t\tvar geometry = object.geometry;\n\n\t\t\tif ( (object && object.isMesh) ) {\n\n\t\t\t\tvar direct = geometry.__directGeometry;\n\n\t\t\t\tif ( geometry.elementsNeedUpdate === true ) {\n\n\t\t\t\t\tdirect = undefined;\n\t\t\t\t\tgeometry.elementsNeedUpdate = false;\n\n\t\t\t\t}\n\n\t\t\t\tif ( direct === undefined ) {\n\n\t\t\t\t\treturn this.fromGeometry( geometry );\n\n\t\t\t\t}\n\n\t\t\t\tdirect.verticesNeedUpdate = geometry.verticesNeedUpdate;\n\t\t\t\tdirect.normalsNeedUpdate = geometry.normalsNeedUpdate;\n\t\t\t\tdirect.colorsNeedUpdate = geometry.colorsNeedUpdate;\n\t\t\t\tdirect.uvsNeedUpdate = geometry.uvsNeedUpdate;\n\t\t\t\tdirect.groupsNeedUpdate = geometry.groupsNeedUpdate;\n\n\t\t\t\tgeometry.verticesNeedUpdate = false;\n\t\t\t\tgeometry.normalsNeedUpdate = false;\n\t\t\t\tgeometry.colorsNeedUpdate = false;\n\t\t\t\tgeometry.uvsNeedUpdate = false;\n\t\t\t\tgeometry.groupsNeedUpdate = false;\n\n\t\t\t\tgeometry = direct;\n\n\t\t\t}\n\n\t\t\tvar attribute;\n\n\t\t\tif ( geometry.verticesNeedUpdate === true ) {\n\n\t\t\t\tattribute = this.attributes.position;\n\n\t\t\t\tif ( attribute !== undefined ) {\n\n\t\t\t\t\tattribute.copyVector3sArray( geometry.vertices );\n\t\t\t\t\tattribute.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.verticesNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( geometry.normalsNeedUpdate === true ) {\n\n\t\t\t\tattribute = this.attributes.normal;\n\n\t\t\t\tif ( attribute !== undefined ) {\n\n\t\t\t\t\tattribute.copyVector3sArray( geometry.normals );\n\t\t\t\t\tattribute.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.normalsNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( geometry.colorsNeedUpdate === true ) {\n\n\t\t\t\tattribute = this.attributes.color;\n\n\t\t\t\tif ( attribute !== undefined ) {\n\n\t\t\t\t\tattribute.copyColorsArray( geometry.colors );\n\t\t\t\t\tattribute.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.colorsNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( geometry.uvsNeedUpdate ) {\n\n\t\t\t\tattribute = this.attributes.uv;\n\n\t\t\t\tif ( attribute !== undefined ) {\n\n\t\t\t\t\tattribute.copyVector2sArray( geometry.uvs );\n\t\t\t\t\tattribute.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.uvsNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( geometry.lineDistancesNeedUpdate ) {\n\n\t\t\t\tattribute = this.attributes.lineDistance;\n\n\t\t\t\tif ( attribute !== undefined ) {\n\n\t\t\t\t\tattribute.copyArray( geometry.lineDistances );\n\t\t\t\t\tattribute.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.lineDistancesNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( geometry.groupsNeedUpdate ) {\n\n\t\t\t\tgeometry.computeGroups( object.geometry );\n\t\t\t\tthis.groups = geometry.groups;\n\n\t\t\t\tgeometry.groupsNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tfromGeometry: function ( geometry ) {\n\n\t\t\tgeometry.__directGeometry = new DirectGeometry().fromGeometry( geometry );\n\n\t\t\treturn this.fromDirectGeometry( geometry.__directGeometry );\n\n\t\t},\n\n\t\tfromDirectGeometry: function ( geometry ) {\n\n\t\t\tvar positions = new Float32Array( geometry.vertices.length * 3 );\n\t\t\tthis.addAttribute( 'position', new BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices ) );\n\n\t\t\tif ( geometry.normals.length > 0 ) {\n\n\t\t\t\tvar normals = new Float32Array( geometry.normals.length * 3 );\n\t\t\t\tthis.addAttribute( 'normal', new BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) );\n\n\t\t\t}\n\n\t\t\tif ( geometry.colors.length > 0 ) {\n\n\t\t\t\tvar colors = new Float32Array( geometry.colors.length * 3 );\n\t\t\t\tthis.addAttribute( 'color', new BufferAttribute( colors, 3 ).copyColorsArray( geometry.colors ) );\n\n\t\t\t}\n\n\t\t\tif ( geometry.uvs.length > 0 ) {\n\n\t\t\t\tvar uvs = new Float32Array( geometry.uvs.length * 2 );\n\t\t\t\tthis.addAttribute( 'uv', new BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) );\n\n\t\t\t}\n\n\t\t\tif ( geometry.uvs2.length > 0 ) {\n\n\t\t\t\tvar uvs2 = new Float32Array( geometry.uvs2.length * 2 );\n\t\t\t\tthis.addAttribute( 'uv2', new BufferAttribute( uvs2, 2 ).copyVector2sArray( geometry.uvs2 ) );\n\n\t\t\t}\n\n\t\t\tif ( geometry.indices.length > 0 ) {\n\n\t\t\t\tvar TypeArray = geometry.vertices.length > 65535 ? Uint32Array : Uint16Array;\n\t\t\t\tvar indices = new TypeArray( geometry.indices.length * 3 );\n\t\t\t\tthis.setIndex( new BufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices ) );\n\n\t\t\t}\n\n\t\t\t// groups\n\n\t\t\tthis.groups = geometry.groups;\n\n\t\t\t// morphs\n\n\t\t\tfor ( var name in geometry.morphTargets ) {\n\n\t\t\t\tvar array = [];\n\t\t\t\tvar morphTargets = geometry.morphTargets[ name ];\n\n\t\t\t\tfor ( var i = 0, l = morphTargets.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar morphTarget = morphTargets[ i ];\n\n\t\t\t\t\tvar attribute = new Float32Attribute( morphTarget.length * 3, 3 );\n\n\t\t\t\t\tarray.push( attribute.copyVector3sArray( morphTarget ) );\n\n\t\t\t\t}\n\n\t\t\t\tthis.morphAttributes[ name ] = array;\n\n\t\t\t}\n\n\t\t\t// skinning\n\n\t\t\tif ( geometry.skinIndices.length > 0 ) {\n\n\t\t\t\tvar skinIndices = new Float32Attribute( geometry.skinIndices.length * 4, 4 );\n\t\t\t\tthis.addAttribute( 'skinIndex', skinIndices.copyVector4sArray( geometry.skinIndices ) );\n\n\t\t\t}\n\n\t\t\tif ( geometry.skinWeights.length > 0 ) {\n\n\t\t\t\tvar skinWeights = new Float32Attribute( geometry.skinWeights.length * 4, 4 );\n\t\t\t\tthis.addAttribute( 'skinWeight', skinWeights.copyVector4sArray( geometry.skinWeights ) );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( geometry.boundingSphere !== null ) {\n\n\t\t\t\tthis.boundingSphere = geometry.boundingSphere.clone();\n\n\t\t\t}\n\n\t\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\t\tthis.boundingBox = geometry.boundingBox.clone();\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcomputeBoundingBox: function () {\n\n\t\t\tif ( this.boundingBox === null ) {\n\n\t\t\t\tthis.boundingBox = new Box3();\n\n\t\t\t}\n\n\t\t\tvar positions = this.attributes.position.array;\n\n\t\t\tif ( positions !== undefined ) {\n\n\t\t\t\tthis.boundingBox.setFromArray( positions );\n\n\t\t\t} else {\n\n\t\t\t\tthis.boundingBox.makeEmpty();\n\n\t\t\t}\n\n\t\t\tif ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t\t}\n\n\t\t},\n\n\t\tcomputeBoundingSphere: function () {\n\n\t\t\tvar box = new Box3();\n\t\t\tvar vector = new Vector3();\n\n\t\t\treturn function computeBoundingSphere() {\n\n\t\t\t\tif ( this.boundingSphere === null ) {\n\n\t\t\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t\t\t}\n\n\t\t\t\tvar positions = this.attributes.position;\n\n\t\t\t\tif ( positions ) {\n\n\t\t\t\t\tvar array = positions.array;\n\t\t\t\t\tvar center = this.boundingSphere.center;\n\n\t\t\t\t\tbox.setFromArray( array );\n\t\t\t\t\tbox.getCenter( center );\n\n\t\t\t\t\t// hoping to find a boundingSphere with a radius smaller than the\n\t\t\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\t\t\t\t\tvar maxRadiusSq = 0;\n\n\t\t\t\t\tfor ( var i = 0, il = array.length; i < il; i += 3 ) {\n\n\t\t\t\t\t\tvector.fromArray( array, i );\n\t\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}(),\n\n\t\tcomputeFaceNormals: function () {\n\n\t\t\t// backwards compatibility\n\n\t\t},\n\n\t\tcomputeVertexNormals: function () {\n\n\t\t\tvar index = this.index;\n\t\t\tvar attributes = this.attributes;\n\t\t\tvar groups = this.groups;\n\n\t\t\tif ( attributes.position ) {\n\n\t\t\t\tvar positions = attributes.position.array;\n\n\t\t\t\tif ( attributes.normal === undefined ) {\n\n\t\t\t\t\tthis.addAttribute( 'normal', new BufferAttribute( new Float32Array( positions.length ), 3 ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// reset existing normals to zero\n\n\t\t\t\t\tvar array = attributes.normal.array;\n\n\t\t\t\t\tfor ( var i = 0, il = array.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tarray[ i ] = 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar normals = attributes.normal.array;\n\n\t\t\t\tvar vA, vB, vC,\n\n\t\t\t\tpA = new Vector3(),\n\t\t\t\tpB = new Vector3(),\n\t\t\t\tpC = new Vector3(),\n\n\t\t\t\tcb = new Vector3(),\n\t\t\t\tab = new Vector3();\n\n\t\t\t\t// indexed elements\n\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tvar indices = index.array;\n\n\t\t\t\t\tif ( groups.length === 0 ) {\n\n\t\t\t\t\t\tthis.addGroup( 0, indices.length );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var j = 0, jl = groups.length; j < jl; ++ j ) {\n\n\t\t\t\t\t\tvar group = groups[ j ];\n\n\t\t\t\t\t\tvar start = group.start;\n\t\t\t\t\t\tvar count = group.count;\n\n\t\t\t\t\t\tfor ( var i = start, il = start + count; i < il; i += 3 ) {\n\n\t\t\t\t\t\t\tvA = indices[ i + 0 ] * 3;\n\t\t\t\t\t\t\tvB = indices[ i + 1 ] * 3;\n\t\t\t\t\t\t\tvC = indices[ i + 2 ] * 3;\n\n\t\t\t\t\t\t\tpA.fromArray( positions, vA );\n\t\t\t\t\t\t\tpB.fromArray( positions, vB );\n\t\t\t\t\t\t\tpC.fromArray( positions, vC );\n\n\t\t\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\t\t\tnormals[ vA ] += cb.x;\n\t\t\t\t\t\t\tnormals[ vA + 1 ] += cb.y;\n\t\t\t\t\t\t\tnormals[ vA + 2 ] += cb.z;\n\n\t\t\t\t\t\t\tnormals[ vB ] += cb.x;\n\t\t\t\t\t\t\tnormals[ vB + 1 ] += cb.y;\n\t\t\t\t\t\t\tnormals[ vB + 2 ] += cb.z;\n\n\t\t\t\t\t\t\tnormals[ vC ] += cb.x;\n\t\t\t\t\t\t\tnormals[ vC + 1 ] += cb.y;\n\t\t\t\t\t\t\tnormals[ vC + 2 ] += cb.z;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\n\t\t\t\t\tfor ( var i = 0, il = positions.length; i < il; i += 9 ) {\n\n\t\t\t\t\t\tpA.fromArray( positions, i );\n\t\t\t\t\t\tpB.fromArray( positions, i + 3 );\n\t\t\t\t\t\tpC.fromArray( positions, i + 6 );\n\n\t\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\t\tnormals[ i ] = cb.x;\n\t\t\t\t\t\tnormals[ i + 1 ] = cb.y;\n\t\t\t\t\t\tnormals[ i + 2 ] = cb.z;\n\n\t\t\t\t\t\tnormals[ i + 3 ] = cb.x;\n\t\t\t\t\t\tnormals[ i + 4 ] = cb.y;\n\t\t\t\t\t\tnormals[ i + 5 ] = cb.z;\n\n\t\t\t\t\t\tnormals[ i + 6 ] = cb.x;\n\t\t\t\t\t\tnormals[ i + 7 ] = cb.y;\n\t\t\t\t\t\tnormals[ i + 8 ] = cb.z;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tthis.normalizeNormals();\n\n\t\t\t\tattributes.normal.needsUpdate = true;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmerge: function ( geometry, offset ) {\n\n\t\t\tif ( (geometry && geometry.isBufferGeometry) === false ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tvar attributes = this.attributes;\n\n\t\t\tfor ( var key in attributes ) {\n\n\t\t\t\tif ( geometry.attributes[ key ] === undefined ) continue;\n\n\t\t\t\tvar attribute1 = attributes[ key ];\n\t\t\t\tvar attributeArray1 = attribute1.array;\n\n\t\t\t\tvar attribute2 = geometry.attributes[ key ];\n\t\t\t\tvar attributeArray2 = attribute2.array;\n\n\t\t\t\tvar attributeSize = attribute2.itemSize;\n\n\t\t\t\tfor ( var i = 0, j = attributeSize * offset; i < attributeArray2.length; i ++, j ++ ) {\n\n\t\t\t\t\tattributeArray1[ j ] = attributeArray2[ i ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tnormalizeNormals: function () {\n\n\t\t\tvar normals = this.attributes.normal.array;\n\n\t\t\tvar x, y, z, n;\n\n\t\t\tfor ( var i = 0, il = normals.length; i < il; i += 3 ) {\n\n\t\t\t\tx = normals[ i ];\n\t\t\t\ty = normals[ i + 1 ];\n\t\t\t\tz = normals[ i + 2 ];\n\n\t\t\t\tn = 1.0 / Math.sqrt( x * x + y * y + z * z );\n\n\t\t\t\tnormals[ i ] *= n;\n\t\t\t\tnormals[ i + 1 ] *= n;\n\t\t\t\tnormals[ i + 2 ] *= n;\n\n\t\t\t}\n\n\t\t},\n\n\t\ttoNonIndexed: function () {\n\n\t\t\tif ( this.index === null ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.' );\n\t\t\t\treturn this;\n\n\t\t\t}\n\n\t\t\tvar geometry2 = new BufferGeometry();\n\n\t\t\tvar indices = this.index.array;\n\t\t\tvar attributes = this.attributes;\n\n\t\t\tfor ( var name in attributes ) {\n\n\t\t\t\tvar attribute = attributes[ name ];\n\n\t\t\t\tvar array = attribute.array;\n\t\t\t\tvar itemSize = attribute.itemSize;\n\n\t\t\t\tvar array2 = new array.constructor( indices.length * itemSize );\n\n\t\t\t\tvar index = 0, index2 = 0;\n\n\t\t\t\tfor ( var i = 0, l = indices.length; i < l; i ++ ) {\n\n\t\t\t\t\tindex = indices[ i ] * itemSize;\n\n\t\t\t\t\tfor ( var j = 0; j < itemSize; j ++ ) {\n\n\t\t\t\t\t\tarray2[ index2 ++ ] = array[ index ++ ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tgeometry2.addAttribute( name, new BufferAttribute( array2, itemSize ) );\n\n\t\t\t}\n\n\t\t\treturn geometry2;\n\n\t\t},\n\n\t\ttoJSON: function () {\n\n\t\t\tvar data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.4,\n\t\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// standard BufferGeometry serialization\n\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.type = this.type;\n\t\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\t\tif ( this.parameters !== undefined ) {\n\n\t\t\t\tvar parameters = this.parameters;\n\n\t\t\t\tfor ( var key in parameters ) {\n\n\t\t\t\t\tif ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];\n\n\t\t\t\t}\n\n\t\t\t\treturn data;\n\n\t\t\t}\n\n\t\t\tdata.data = { attributes: {} };\n\n\t\t\tvar index = this.index;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tvar array = Array.prototype.slice.call( index.array );\n\n\t\t\t\tdata.data.index = {\n\t\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\t\tarray: array\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tvar attributes = this.attributes;\n\n\t\t\tfor ( var key in attributes ) {\n\n\t\t\t\tvar attribute = attributes[ key ];\n\n\t\t\t\tvar array = Array.prototype.slice.call( attribute.array );\n\n\t\t\t\tdata.data.attributes[ key ] = {\n\t\t\t\t\titemSize: attribute.itemSize,\n\t\t\t\t\ttype: attribute.array.constructor.name,\n\t\t\t\t\tarray: array,\n\t\t\t\t\tnormalized: attribute.normalized\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tvar groups = this.groups;\n\n\t\t\tif ( groups.length > 0 ) {\n\n\t\t\t\tdata.data.groups = JSON.parse( JSON.stringify( groups ) );\n\n\t\t\t}\n\n\t\t\tvar boundingSphere = this.boundingSphere;\n\n\t\t\tif ( boundingSphere !== null ) {\n\n\t\t\t\tdata.data.boundingSphere = {\n\t\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\t\tradius: boundingSphere.radius\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\t/*\n\t\t\t// Handle primitives\n\n\t\t\tvar parameters = this.parameters;\n\n\t\t\tif ( parameters !== undefined ) {\n\n\t\t\t\tvar values = [];\n\n\t\t\t\tfor ( var key in parameters ) {\n\n\t\t\t\t\tvalues.push( parameters[ key ] );\n\n\t\t\t\t}\n\n\t\t\t\tvar geometry = Object.create( this.constructor.prototype );\n\t\t\t\tthis.constructor.apply( geometry, values );\n\t\t\t\treturn geometry;\n\n\t\t\t}\n\n\t\t\treturn new this.constructor().copy( this );\n\t\t\t*/\n\n\t\t\treturn new BufferGeometry().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tvar index = source.index;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tthis.setIndex( index.clone() );\n\n\t\t\t}\n\n\t\t\tvar attributes = source.attributes;\n\n\t\t\tfor ( var name in attributes ) {\n\n\t\t\t\tvar attribute = attributes[ name ];\n\t\t\t\tthis.addAttribute( name, attribute.clone() );\n\n\t\t\t}\n\n\t\t\tvar groups = source.groups;\n\n\t\t\tfor ( var i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\tvar group = groups[ i ];\n\t\t\t\tthis.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdispose: function () {\n\n\t\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\t}\n\n\t} );\n\n\tBufferGeometry.MaxIndex = 65535;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author jonobr1 / http://jonobr1.com/\n\t */\n\n\tfunction Mesh( geometry, material ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Mesh';\n\n\t\tthis.geometry = geometry !== undefined ? geometry : new BufferGeometry();\n\t\tthis.material = material !== undefined ? material : new MeshBasicMaterial( { color: Math.random() * 0xffffff } );\n\n\t\tthis.drawMode = TrianglesDrawMode;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tMesh.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Mesh,\n\n\t\tisMesh: true,\n\n\t\tsetDrawMode: function ( value ) {\n\n\t\t\tthis.drawMode = value;\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tObject3D.prototype.copy.call( this, source );\n\n\t\t\tthis.drawMode = source.drawMode;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tupdateMorphTargets: function () {\n\n\t\t\tvar morphTargets = this.geometry.morphTargets;\n\n\t\t\tif ( morphTargets !== undefined && morphTargets.length > 0 ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( var m = 0, ml = morphTargets.length; m < ml; m ++ ) {\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ morphTargets[ m ].name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\traycast: ( function () {\n\n\t\t\tvar inverseMatrix = new Matrix4();\n\t\t\tvar ray = new Ray();\n\t\t\tvar sphere = new Sphere();\n\n\t\t\tvar vA = new Vector3();\n\t\t\tvar vB = new Vector3();\n\t\t\tvar vC = new Vector3();\n\n\t\t\tvar tempA = new Vector3();\n\t\t\tvar tempB = new Vector3();\n\t\t\tvar tempC = new Vector3();\n\n\t\t\tvar uvA = new Vector2();\n\t\t\tvar uvB = new Vector2();\n\t\t\tvar uvC = new Vector2();\n\n\t\t\tvar barycoord = new Vector3();\n\n\t\t\tvar intersectionPoint = new Vector3();\n\t\t\tvar intersectionPointWorld = new Vector3();\n\n\t\t\tfunction uvIntersection( point, p1, p2, p3, uv1, uv2, uv3 ) {\n\n\t\t\t\tTriangle.barycoordFromPoint( point, p1, p2, p3, barycoord );\n\n\t\t\t\tuv1.multiplyScalar( barycoord.x );\n\t\t\t\tuv2.multiplyScalar( barycoord.y );\n\t\t\t\tuv3.multiplyScalar( barycoord.z );\n\n\t\t\t\tuv1.add( uv2 ).add( uv3 );\n\n\t\t\t\treturn uv1.clone();\n\n\t\t\t}\n\n\t\t\tfunction checkIntersection( object, raycaster, ray, pA, pB, pC, point ) {\n\n\t\t\t\tvar intersect;\n\t\t\t\tvar material = object.material;\n\n\t\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tintersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point );\n\n\t\t\t\t}\n\n\t\t\t\tif ( intersect === null ) return null;\n\n\t\t\t\tintersectionPointWorld.copy( point );\n\t\t\t\tintersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\t\t\t\tvar distance = raycaster.ray.origin.distanceTo( intersectionPointWorld );\n\n\t\t\t\tif ( distance < raycaster.near || distance > raycaster.far ) return null;\n\n\t\t\t\treturn {\n\t\t\t\t\tdistance: distance,\n\t\t\t\t\tpoint: intersectionPointWorld.clone(),\n\t\t\t\t\tobject: object\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tfunction checkBufferGeometryIntersection( object, raycaster, ray, positions, uvs, a, b, c ) {\n\n\t\t\t\tvA.fromArray( positions, a * 3 );\n\t\t\t\tvB.fromArray( positions, b * 3 );\n\t\t\t\tvC.fromArray( positions, c * 3 );\n\n\t\t\t\tvar intersection = checkIntersection( object, raycaster, ray, vA, vB, vC, intersectionPoint );\n\n\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\tif ( uvs ) {\n\n\t\t\t\t\t\tuvA.fromArray( uvs, a * 2 );\n\t\t\t\t\t\tuvB.fromArray( uvs, b * 2 );\n\t\t\t\t\t\tuvC.fromArray( uvs, c * 2 );\n\n\t\t\t\t\t\tintersection.uv = uvIntersection( intersectionPoint, vA, vB, vC, uvA, uvB, uvC );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tintersection.face = new Face3( a, b, c, Triangle.normal( vA, vB, vC ) );\n\t\t\t\t\tintersection.faceIndex = a;\n\n\t\t\t\t}\n\n\t\t\t\treturn intersection;\n\n\t\t\t}\n\n\t\t\treturn function raycast( raycaster, intersects ) {\n\n\t\t\t\tvar geometry = this.geometry;\n\t\t\t\tvar material = this.material;\n\t\t\t\tvar matrixWorld = this.matrixWorld;\n\n\t\t\t\tif ( material === undefined ) return;\n\n\t\t\t\t// Checking boundingSphere distance to ray\n\n\t\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t\tsphere.copy( geometry.boundingSphere );\n\t\t\t\tsphere.applyMatrix4( matrixWorld );\n\n\t\t\t\tif ( raycaster.ray.intersectsSphere( sphere ) === false ) return;\n\n\t\t\t\t//\n\n\t\t\t\tinverseMatrix.getInverse( matrixWorld );\n\t\t\t\tray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );\n\n\t\t\t\t// Check boundingBox before continuing\n\n\t\t\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\t\t\tif ( ray.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t\t\t}\n\n\t\t\t\tvar uvs, intersection;\n\n\t\t\t\tif ( (geometry && geometry.isBufferGeometry) ) {\n\n\t\t\t\t\tvar a, b, c;\n\t\t\t\t\tvar index = geometry.index;\n\t\t\t\t\tvar attributes = geometry.attributes;\n\t\t\t\t\tvar positions = attributes.position.array;\n\n\t\t\t\t\tif ( attributes.uv !== undefined ) {\n\n\t\t\t\t\t\tuvs = attributes.uv.array;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( index !== null ) {\n\n\t\t\t\t\t\tvar indices = index.array;\n\n\t\t\t\t\t\tfor ( var i = 0, l = indices.length; i < l; i += 3 ) {\n\n\t\t\t\t\t\t\ta = indices[ i ];\n\t\t\t\t\t\t\tb = indices[ i + 1 ];\n\t\t\t\t\t\t\tc = indices[ i + 2 ];\n\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c );\n\n\t\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indices buffer semantics\n\t\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\n\t\t\t\t\t\tfor ( var i = 0, l = positions.length; i < l; i += 9 ) {\n\n\t\t\t\t\t\t\ta = i / 3;\n\t\t\t\t\t\t\tb = a + 1;\n\t\t\t\t\t\t\tc = a + 2;\n\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection( this, raycaster, ray, positions, uvs, a, b, c );\n\n\t\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\t\tintersection.index = a; // triangle number in positions buffer semantics\n\t\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( (geometry && geometry.isGeometry) ) {\n\n\t\t\t\t\tvar fvA, fvB, fvC;\n\t\t\t\t\tvar isFaceMaterial = (material && material.isMultiMaterial);\n\t\t\t\t\tvar materials = isFaceMaterial === true ? material.materials : null;\n\n\t\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\t\tvar faces = geometry.faces;\n\t\t\t\t\tvar faceVertexUvs = geometry.faceVertexUvs[ 0 ];\n\t\t\t\t\tif ( faceVertexUvs.length > 0 ) uvs = faceVertexUvs;\n\n\t\t\t\t\tfor ( var f = 0, fl = faces.length; f < fl; f ++ ) {\n\n\t\t\t\t\t\tvar face = faces[ f ];\n\t\t\t\t\t\tvar faceMaterial = isFaceMaterial === true ? materials[ face.materialIndex ] : material;\n\n\t\t\t\t\t\tif ( faceMaterial === undefined ) continue;\n\n\t\t\t\t\t\tfvA = vertices[ face.a ];\n\t\t\t\t\t\tfvB = vertices[ face.b ];\n\t\t\t\t\t\tfvC = vertices[ face.c ];\n\n\t\t\t\t\t\tif ( faceMaterial.morphTargets === true ) {\n\n\t\t\t\t\t\t\tvar morphTargets = geometry.morphTargets;\n\t\t\t\t\t\t\tvar morphInfluences = this.morphTargetInfluences;\n\n\t\t\t\t\t\t\tvA.set( 0, 0, 0 );\n\t\t\t\t\t\t\tvB.set( 0, 0, 0 );\n\t\t\t\t\t\t\tvC.set( 0, 0, 0 );\n\n\t\t\t\t\t\t\tfor ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) {\n\n\t\t\t\t\t\t\t\tvar influence = morphInfluences[ t ];\n\n\t\t\t\t\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t\t\t\t\tvar targets = morphTargets[ t ].vertices;\n\n\t\t\t\t\t\t\t\tvA.addScaledVector( tempA.subVectors( targets[ face.a ], fvA ), influence );\n\t\t\t\t\t\t\t\tvB.addScaledVector( tempB.subVectors( targets[ face.b ], fvB ), influence );\n\t\t\t\t\t\t\t\tvC.addScaledVector( tempC.subVectors( targets[ face.c ], fvC ), influence );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvA.add( fvA );\n\t\t\t\t\t\t\tvB.add( fvB );\n\t\t\t\t\t\t\tvC.add( fvC );\n\n\t\t\t\t\t\t\tfvA = vA;\n\t\t\t\t\t\t\tfvB = vB;\n\t\t\t\t\t\t\tfvC = vC;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tintersection = checkIntersection( this, raycaster, ray, fvA, fvB, fvC, intersectionPoint );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tif ( uvs ) {\n\n\t\t\t\t\t\t\t\tvar uvs_f = uvs[ f ];\n\t\t\t\t\t\t\t\tuvA.copy( uvs_f[ 0 ] );\n\t\t\t\t\t\t\t\tuvB.copy( uvs_f[ 1 ] );\n\t\t\t\t\t\t\t\tuvC.copy( uvs_f[ 2 ] );\n\n\t\t\t\t\t\t\t\tintersection.uv = uvIntersection( intersectionPoint, fvA, fvB, fvC, uvA, uvB, uvC );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tintersection.face = face;\n\t\t\t\t\t\t\tintersection.faceIndex = f;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}() ),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.geometry, this.material ).copy( this );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'BoxBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\tdepth: depth,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tdepthSegments: depthSegments\n\t\t};\n\n\t\tvar scope = this;\n\n\t\t// segments\n\t\twidthSegments = Math.floor( widthSegments ) || 1;\n\t\theightSegments = Math.floor( heightSegments ) || 1;\n\t\tdepthSegments = Math.floor( depthSegments ) || 1;\n\n\t\t// these are used to calculate buffer length\n\t\tvar vertexCount = calculateVertexCount( widthSegments, heightSegments, depthSegments );\n\t\tvar indexCount = calculateIndexCount( widthSegments, heightSegments, depthSegments );\n\n\t\t// buffers\n\t\tvar indices = new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount );\n\t\tvar vertices = new Float32Array( vertexCount * 3 );\n\t\tvar normals = new Float32Array( vertexCount * 3 );\n\t\tvar uvs = new Float32Array( vertexCount * 2 );\n\n\t\t// offset variables\n\t\tvar vertexBufferOffset = 0;\n\t\tvar uvBufferOffset = 0;\n\t\tvar indexBufferOffset = 0;\n\t\tvar numberOfVertices = 0;\n\n\t\t// group variables\n\t\tvar groupStart = 0;\n\n\t\t// build each side of the box geometry\n\t\tbuildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px\n\t\tbuildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx\n\t\tbuildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py\n\t\tbuildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny\n\t\tbuildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz\n\t\tbuildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz\n\n\t\t// build geometry\n\t\tthis.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tthis.addAttribute( 'position', new BufferAttribute( vertices, 3 ) );\n\t\tthis.addAttribute( 'normal', new BufferAttribute( normals, 3 ) );\n\t\tthis.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) );\n\n\t\t// helper functions\n\n\t\tfunction calculateVertexCount( w, h, d ) {\n\n\t\t\tvar vertices = 0;\n\n\t\t\t// calculate the amount of vertices for each side (plane)\n\t\t\tvertices += (w + 1) * (h + 1) * 2; // xy\n\t\t\tvertices += (w + 1) * (d + 1) * 2; // xz\n\t\t\tvertices += (d + 1) * (h + 1) * 2; // zy\n\n\t\t\treturn vertices;\n\n\t\t}\n\n\t\tfunction calculateIndexCount( w, h, d ) {\n\n\t\t\tvar index = 0;\n\n\t\t\t// calculate the amount of squares for each side\n\t\t\tindex += w * h * 2; // xy\n\t\t\tindex += w * d * 2; // xz\n\t\t\tindex += d * h * 2; // zy\n\n\t\t\treturn index * 6; // two triangles per square => six vertices per square\n\n\t\t}\n\n\t\tfunction buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {\n\n\t\t\tvar segmentWidth\t= width / gridX;\n\t\t\tvar segmentHeight = height / gridY;\n\n\t\t\tvar widthHalf = width / 2;\n\t\t\tvar heightHalf = height / 2;\n\t\t\tvar depthHalf = depth / 2;\n\n\t\t\tvar gridX1 = gridX + 1;\n\t\t\tvar gridY1 = gridY + 1;\n\n\t\t\tvar vertexCounter = 0;\n\t\t\tvar groupCount = 0;\n\n\t\t\tvar vector = new Vector3();\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\t\tvar y = iy * segmentHeight - heightHalf;\n\n\t\t\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\t\tvar x = ix * segmentWidth - widthHalf;\n\n\t\t\t\t\t// set values to correct vector component\n\t\t\t\t\tvector[ u ] = x * udir;\n\t\t\t\t\tvector[ v ] = y * vdir;\n\t\t\t\t\tvector[ w ] = depthHalf;\n\n\t\t\t\t\t// now apply vector to vertex buffer\n\t\t\t\t\tvertices[ vertexBufferOffset ] = vector.x;\n\t\t\t\t\tvertices[ vertexBufferOffset + 1 ] = vector.y;\n\t\t\t\t\tvertices[ vertexBufferOffset + 2 ] = vector.z;\n\n\t\t\t\t\t// set values to correct vector component\n\t\t\t\t\tvector[ u ] = 0;\n\t\t\t\t\tvector[ v ] = 0;\n\t\t\t\t\tvector[ w ] = depth > 0 ? 1 : - 1;\n\n\t\t\t\t\t// now apply vector to normal buffer\n\t\t\t\t\tnormals[ vertexBufferOffset ] = vector.x;\n\t\t\t\t\tnormals[ vertexBufferOffset + 1 ] = vector.y;\n\t\t\t\t\tnormals[ vertexBufferOffset + 2 ] = vector.z;\n\n\t\t\t\t\t// uvs\n\t\t\t\t\tuvs[ uvBufferOffset ] = ix / gridX;\n\t\t\t\t\tuvs[ uvBufferOffset + 1 ] = 1 - ( iy / gridY );\n\n\t\t\t\t\t// update offsets and counters\n\t\t\t\t\tvertexBufferOffset += 3;\n\t\t\t\t\tuvBufferOffset += 2;\n\t\t\t\t\tvertexCounter += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// 1. you need three indices to draw a single face\n\t\t\t// 2. a single segment consists of two faces\n\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\t\t\tfor ( iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\t\tfor ( ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\t\t// indices\n\t\t\t\t\tvar a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\tvar b = numberOfVertices + ix + gridX1 * ( iy + 1 );\n\t\t\t\t\tvar c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\t\tvar d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\t\t// face one\n\t\t\t\t\tindices[ indexBufferOffset ] = a;\n\t\t\t\t\tindices[ indexBufferOffset + 1 ] = b;\n\t\t\t\t\tindices[ indexBufferOffset + 2 ] = d;\n\n\t\t\t\t\t// face two\n\t\t\t\t\tindices[ indexBufferOffset + 3 ] = b;\n\t\t\t\t\tindices[ indexBufferOffset + 4 ] = c;\n\t\t\t\t\tindices[ indexBufferOffset + 5 ] = d;\n\n\t\t\t\t\t// update offsets and counters\n\t\t\t\t\tindexBufferOffset += 6;\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\t\t\tscope.addGroup( groupStart, groupCount, materialIndex );\n\n\t\t\t// calculate new start value for groups\n\t\t\tgroupStart += groupCount;\n\n\t\t\t// update total number of vertices\n\t\t\tnumberOfVertices += vertexCounter;\n\n\t\t}\n\n\t}\n\n\tBoxBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tBoxBufferGeometry.prototype.constructor = BoxBufferGeometry;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n\t */\n\n\tfunction PlaneBufferGeometry( width, height, widthSegments, heightSegments ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'PlaneBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments\n\t\t};\n\n\t\tvar width_half = width / 2;\n\t\tvar height_half = height / 2;\n\n\t\tvar gridX = Math.floor( widthSegments ) || 1;\n\t\tvar gridY = Math.floor( heightSegments ) || 1;\n\n\t\tvar gridX1 = gridX + 1;\n\t\tvar gridY1 = gridY + 1;\n\n\t\tvar segment_width = width / gridX;\n\t\tvar segment_height = height / gridY;\n\n\t\tvar vertices = new Float32Array( gridX1 * gridY1 * 3 );\n\t\tvar normals = new Float32Array( gridX1 * gridY1 * 3 );\n\t\tvar uvs = new Float32Array( gridX1 * gridY1 * 2 );\n\n\t\tvar offset = 0;\n\t\tvar offset2 = 0;\n\n\t\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\tvar y = iy * segment_height - height_half;\n\n\t\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\t\tvertices[ offset ] = x;\n\t\t\t\tvertices[ offset + 1 ] = - y;\n\n\t\t\t\tnormals[ offset + 2 ] = 1;\n\n\t\t\t\tuvs[ offset2 ] = ix / gridX;\n\t\t\t\tuvs[ offset2 + 1 ] = 1 - ( iy / gridY );\n\n\t\t\t\toffset += 3;\n\t\t\t\toffset2 += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\toffset = 0;\n\n\t\tvar indices = new ( ( vertices.length / 3 ) > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 );\n\n\t\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\tvar a = ix + gridX1 * iy;\n\t\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\tindices[ offset ] = a;\n\t\t\t\tindices[ offset + 1 ] = b;\n\t\t\t\tindices[ offset + 2 ] = d;\n\n\t\t\t\tindices[ offset + 3 ] = b;\n\t\t\t\tindices[ offset + 4 ] = c;\n\t\t\t\tindices[ offset + 5 ] = d;\n\n\t\t\t\toffset += 6;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tthis.addAttribute( 'position', new BufferAttribute( vertices, 3 ) );\n\t\tthis.addAttribute( 'normal', new BufferAttribute( normals, 3 ) );\n\t\tthis.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tPlaneBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tPlaneBufferGeometry.prototype.constructor = PlaneBufferGeometry;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author WestLangley / http://github.com/WestLangley\n\t*/\n\n\tfunction Camera() {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Camera';\n\n\t\tthis.matrixWorldInverse = new Matrix4();\n\t\tthis.projectionMatrix = new Matrix4();\n\n\t}\n\n\tCamera.prototype = Object.create( Object3D.prototype );\n\tCamera.prototype.constructor = Camera;\n\n\tCamera.prototype.isCamera = true;\n\n\tCamera.prototype.getWorldDirection = function () {\n\n\t\tvar quaternion = new Quaternion();\n\n\t\treturn function getWorldDirection( optionalTarget ) {\n\n\t\t\tvar result = optionalTarget || new Vector3();\n\n\t\t\tthis.getWorldQuaternion( quaternion );\n\n\t\t\treturn result.set( 0, 0, - 1 ).applyQuaternion( quaternion );\n\n\t\t};\n\n\t}();\n\n\tCamera.prototype.lookAt = function () {\n\n\t\t// This routine does not support cameras with rotated and/or translated parent(s)\n\n\t\tvar m1 = new Matrix4();\n\n\t\treturn function lookAt( vector ) {\n\n\t\t\tm1.lookAt( this.position, vector, this.up );\n\n\t\t\tthis.quaternion.setFromRotationMatrix( m1 );\n\n\t\t};\n\n\t}();\n\n\tCamera.prototype.clone = function () {\n\n\t\treturn new this.constructor().copy( this );\n\n\t};\n\n\tCamera.prototype.copy = function ( source ) {\n\n\t\tObject3D.prototype.copy.call( this, source );\n\n\t\tthis.matrixWorldInverse.copy( source.matrixWorldInverse );\n\t\tthis.projectionMatrix.copy( source.projectionMatrix );\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author greggman / http://games.greggman.com/\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t * @author tschw\n\t */\n\n\tfunction PerspectiveCamera( fov, aspect, near, far ) {\n\n\t\tCamera.call( this );\n\n\t\tthis.type = 'PerspectiveCamera';\n\n\t\tthis.fov = fov !== undefined ? fov : 50;\n\t\tthis.zoom = 1;\n\n\t\tthis.near = near !== undefined ? near : 0.1;\n\t\tthis.far = far !== undefined ? far : 2000;\n\t\tthis.focus = 10;\n\n\t\tthis.aspect = aspect !== undefined ? aspect : 1;\n\t\tthis.view = null;\n\n\t\tthis.filmGauge = 35;\t// width of the film (default in millimeters)\n\t\tthis.filmOffset = 0;\t// horizontal film offset (same unit as gauge)\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tPerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ), {\n\n\t\tconstructor: PerspectiveCamera,\n\n\t\tisPerspectiveCamera: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tCamera.prototype.copy.call( this, source );\n\n\t\t\tthis.fov = source.fov;\n\t\t\tthis.zoom = source.zoom;\n\n\t\t\tthis.near = source.near;\n\t\t\tthis.far = source.far;\n\t\t\tthis.focus = source.focus;\n\n\t\t\tthis.aspect = source.aspect;\n\t\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\t\tthis.filmGauge = source.filmGauge;\n\t\t\tthis.filmOffset = source.filmOffset;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t/**\n\t\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t\t *\n\t\t * The default film gauge is 35, so that the focal length can be specified for\n\t\t * a 35mm (full frame) camera.\n\t\t *\n\t\t * Values for focal length and film gauge must have the same unit.\n\t\t */\n\t\tsetFocalLength: function ( focalLength ) {\n\n\t\t\t// see http://www.bobatkins.com/photography/technical/field_of_view.html\n\t\t\tvar vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\n\t\t\tthis.fov = _Math.RAD2DEG * 2 * Math.atan( vExtentSlope );\n\t\t\tthis.updateProjectionMatrix();\n\n\t\t},\n\n\t\t/**\n\t\t * Calculates the focal length from the current .fov and .filmGauge.\n\t\t */\n\t\tgetFocalLength: function () {\n\n\t\t\tvar vExtentSlope = Math.tan( _Math.DEG2RAD * 0.5 * this.fov );\n\n\t\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t\t},\n\n\t\tgetEffectiveFOV: function () {\n\n\t\t\treturn _Math.RAD2DEG * 2 * Math.atan(\n\t\t\t\t\tMath.tan( _Math.DEG2RAD * 0.5 * this.fov ) / this.zoom );\n\n\t\t},\n\n\t\tgetFilmWidth: function () {\n\n\t\t\t// film not completely covered in portrait format (aspect < 1)\n\t\t\treturn this.filmGauge * Math.min( this.aspect, 1 );\n\n\t\t},\n\n\t\tgetFilmHeight: function () {\n\n\t\t\t// film not completely covered in landscape format (aspect > 1)\n\t\t\treturn this.filmGauge / Math.max( this.aspect, 1 );\n\n\t\t},\n\n\t\t/**\n\t\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t\t * multi-monitor/multi-machine setups.\n\t\t *\n\t\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t\t * the monitors are in grid like this\n\t\t *\n\t\t * +---+---+---+\n\t\t * | A | B | C |\n\t\t * +---+---+---+\n\t\t * | D | E | F |\n\t\t * +---+---+---+\n\t\t *\n\t\t * then for each monitor you would call it like this\n\t\t *\n\t\t * var w = 1920;\n\t\t * var h = 1080;\n\t\t * var fullWidth = w * 3;\n\t\t * var fullHeight = h * 2;\n\t\t *\n\t\t * --A--\n\t\t * camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t\t * --B--\n\t\t * camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t\t * --C--\n\t\t * camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t\t * --D--\n\t\t * camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t\t * --E--\n\t\t * camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t\t * --F--\n\t\t * camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t\t *\n\t\t * Note there is no reason monitors have to be the same size or in a grid.\n\t\t */\n\t\tsetViewOffset: function ( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\t\tthis.view = {\n\t\t\t\tfullWidth: fullWidth,\n\t\t\t\tfullHeight: fullHeight,\n\t\t\t\toffsetX: x,\n\t\t\t\toffsetY: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\n\t\t\tthis.updateProjectionMatrix();\n\n\t\t},\n\n\t\tclearViewOffset: function() {\n\n\t\t\tthis.view = null;\n\t\t\tthis.updateProjectionMatrix();\n\n\t\t},\n\n\t\tupdateProjectionMatrix: function () {\n\n\t\t\tvar near = this.near,\n\t\t\t\ttop = near * Math.tan(\n\t\t\t\t\t\t_Math.DEG2RAD * 0.5 * this.fov ) / this.zoom,\n\t\t\t\theight = 2 * top,\n\t\t\t\twidth = this.aspect * height,\n\t\t\t\tleft = - 0.5 * width,\n\t\t\t\tview = this.view;\n\n\t\t\tif ( view !== null ) {\n\n\t\t\t\tvar fullWidth = view.fullWidth,\n\t\t\t\t\tfullHeight = view.fullHeight;\n\n\t\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\t\twidth *= view.width / fullWidth;\n\t\t\t\theight *= view.height / fullHeight;\n\n\t\t\t}\n\n\t\t\tvar skew = this.filmOffset;\n\t\t\tif ( skew !== 0 ) left += near * skew / this.getFilmWidth();\n\n\t\t\tthis.projectionMatrix.makeFrustum(\n\t\t\t\t\tleft, left + width, top - height, top, near, this.far );\n\n\t\t},\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\tvar data = Object3D.prototype.toJSON.call( this, meta );\n\n\t\t\tdata.object.fov = this.fov;\n\t\t\tdata.object.zoom = this.zoom;\n\n\t\t\tdata.object.near = this.near;\n\t\t\tdata.object.far = this.far;\n\t\t\tdata.object.focus = this.focus;\n\n\t\t\tdata.object.aspect = this.aspect;\n\n\t\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\t\tdata.object.filmGauge = this.filmGauge;\n\t\t\tdata.object.filmOffset = this.filmOffset;\n\n\t\t\treturn data;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author arose / http://github.com/arose\n\t */\n\n\tfunction OrthographicCamera( left, right, top, bottom, near, far ) {\n\n\t\tCamera.call( this );\n\n\t\tthis.type = 'OrthographicCamera';\n\n\t\tthis.zoom = 1;\n\t\tthis.view = null;\n\n\t\tthis.left = left;\n\t\tthis.right = right;\n\t\tthis.top = top;\n\t\tthis.bottom = bottom;\n\n\t\tthis.near = ( near !== undefined ) ? near : 0.1;\n\t\tthis.far = ( far !== undefined ) ? far : 2000;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tOrthographicCamera.prototype = Object.assign( Object.create( Camera.prototype ), {\n\n\t\tconstructor: OrthographicCamera,\n\n\t\tisOrthographicCamera: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tCamera.prototype.copy.call( this, source );\n\n\t\t\tthis.left = source.left;\n\t\t\tthis.right = source.right;\n\t\t\tthis.top = source.top;\n\t\t\tthis.bottom = source.bottom;\n\t\t\tthis.near = source.near;\n\t\t\tthis.far = source.far;\n\n\t\t\tthis.zoom = source.zoom;\n\t\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetViewOffset: function( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\t\tthis.view = {\n\t\t\t\tfullWidth: fullWidth,\n\t\t\t\tfullHeight: fullHeight,\n\t\t\t\toffsetX: x,\n\t\t\t\toffsetY: y,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\n\t\t\tthis.updateProjectionMatrix();\n\n\t\t},\n\n\t\tclearViewOffset: function() {\n\n\t\t\tthis.view = null;\n\t\t\tthis.updateProjectionMatrix();\n\n\t\t},\n\n\t\tupdateProjectionMatrix: function () {\n\n\t\t\tvar dx = ( this.right - this.left ) / ( 2 * this.zoom );\n\t\t\tvar dy = ( this.top - this.bottom ) / ( 2 * this.zoom );\n\t\t\tvar cx = ( this.right + this.left ) / 2;\n\t\t\tvar cy = ( this.top + this.bottom ) / 2;\n\n\t\t\tvar left = cx - dx;\n\t\t\tvar right = cx + dx;\n\t\t\tvar top = cy + dy;\n\t\t\tvar bottom = cy - dy;\n\n\t\t\tif ( this.view !== null ) {\n\n\t\t\t\tvar zoomW = this.zoom / ( this.view.width / this.view.fullWidth );\n\t\t\t\tvar zoomH = this.zoom / ( this.view.height / this.view.fullHeight );\n\t\t\t\tvar scaleW = ( this.right - this.left ) / this.view.width;\n\t\t\t\tvar scaleH = ( this.top - this.bottom ) / this.view.height;\n\n\t\t\t\tleft += scaleW * ( this.view.offsetX / zoomW );\n\t\t\t\tright = left + scaleW * ( this.view.width / zoomW );\n\t\t\t\ttop -= scaleH * ( this.view.offsetY / zoomH );\n\t\t\t\tbottom = top - scaleH * ( this.view.height / zoomH );\n\n\t\t\t}\n\n\t\t\tthis.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far );\n\n\t\t},\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\tvar data = Object3D.prototype.toJSON.call( this, meta );\n\n\t\t\tdata.object.zoom = this.zoom;\n\t\t\tdata.object.left = this.left;\n\t\t\tdata.object.right = this.right;\n\t\t\tdata.object.top = this.top;\n\t\t\tdata.object.bottom = this.bottom;\n\t\t\tdata.object.near = this.near;\n\t\t\tdata.object.far = this.far;\n\n\t\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\t\treturn data;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLIndexedBufferRenderer( gl, extensions, infoRender ) {\n\n\t\tvar mode;\n\n\t\tfunction setMode( value ) {\n\n\t\t\tmode = value;\n\n\t\t}\n\n\t\tvar type, size;\n\n\t\tfunction setIndex( index ) {\n\n\t\t\tif ( index.array instanceof Uint32Array && extensions.get( 'OES_element_index_uint' ) ) {\n\n\t\t\t\ttype = gl.UNSIGNED_INT;\n\t\t\t\tsize = 4;\n\n\t\t\t} else {\n\n\t\t\t\ttype = gl.UNSIGNED_SHORT;\n\t\t\t\tsize = 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction render( start, count ) {\n\n\t\t\tgl.drawElements( mode, count, type, start * size );\n\n\t\t\tinfoRender.calls ++;\n\t\t\tinfoRender.vertices += count;\n\n\t\t\tif ( mode === gl.TRIANGLES ) infoRender.faces += count / 3;\n\n\t\t}\n\n\t\tfunction renderInstances( geometry, start, count ) {\n\n\t\t\tvar extension = extensions.get( 'ANGLE_instanced_arrays' );\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\textension.drawElementsInstancedANGLE( mode, count, type, start * size, geometry.maxInstancedCount );\n\n\t\t\tinfoRender.calls ++;\n\t\t\tinfoRender.vertices += count * geometry.maxInstancedCount;\n\n\t\t\tif ( mode === gl.TRIANGLES ) infoRender.faces += geometry.maxInstancedCount * count / 3;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tsetMode: setMode,\n\t\t\tsetIndex: setIndex,\n\t\t\trender: render,\n\t\t\trenderInstances: renderInstances\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLBufferRenderer( gl, extensions, infoRender ) {\n\n\t\tvar mode;\n\n\t\tfunction setMode( value ) {\n\n\t\t\tmode = value;\n\n\t\t}\n\n\t\tfunction render( start, count ) {\n\n\t\t\tgl.drawArrays( mode, start, count );\n\n\t\t\tinfoRender.calls ++;\n\t\t\tinfoRender.vertices += count;\n\n\t\t\tif ( mode === gl.TRIANGLES ) infoRender.faces += count / 3;\n\n\t\t}\n\n\t\tfunction renderInstances( geometry ) {\n\n\t\t\tvar extension = extensions.get( 'ANGLE_instanced_arrays' );\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tvar position = geometry.attributes.position;\n\n\t\t\tvar count = 0;\n\n\t\t\tif ( (position && position.isInterleavedBufferAttribute) ) {\n\n\t\t\t\tcount = position.data.count;\n\n\t\t\t\textension.drawArraysInstancedANGLE( mode, 0, count, geometry.maxInstancedCount );\n\n\t\t\t} else {\n\n\t\t\t\tcount = position.count;\n\n\t\t\t\textension.drawArraysInstancedANGLE( mode, 0, count, geometry.maxInstancedCount );\n\n\t\t\t}\n\n\t\t\tinfoRender.calls ++;\n\t\t\tinfoRender.vertices += count * geometry.maxInstancedCount;\n\n\t\t\tif ( mode === gl.TRIANGLES ) infoRender.faces += geometry.maxInstancedCount * count / 3;\n\n\t\t}\n\n\t\treturn {\n\t\t\tsetMode: setMode,\n\t\t\trender: render,\n\t\t\trenderInstances: renderInstances\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLLights() {\n\n\t\tvar lights = {};\n\n\t\treturn {\n\n\t\t\tget: function ( light ) {\n\n\t\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\t\treturn lights[ light.id ];\n\n\t\t\t\t}\n\n\t\t\t\tvar uniforms;\n\n\t\t\t\tswitch ( light.type ) {\n\n\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color(),\n\n\t\t\t\t\t\t\tshadow: false,\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\t\tconeCos: 0,\n\t\t\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\t\t\tdecay: 0,\n\n\t\t\t\t\t\t\tshadow: false,\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\t\tdecay: 0,\n\n\t\t\t\t\t\t\tshadow: false,\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tskyColor: new Color(),\n\t\t\t\t\t\t\tgroundColor: new Color()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\t\treturn uniforms;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction addLineNumbers( string ) {\n\n\t\tvar lines = string.split( '\\n' );\n\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tlines[ i ] = ( i + 1 ) + ': ' + lines[ i ];\n\n\t\t}\n\n\t\treturn lines.join( '\\n' );\n\n\t}\n\n\tfunction WebGLShader( gl, type, string ) {\n\n\t\tvar shader = gl.createShader( type );\n\n\t\tgl.shaderSource( shader, string );\n\t\tgl.compileShader( shader );\n\n\t\tif ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === false ) {\n\n\t\t\tconsole.error( 'THREE.WebGLShader: Shader couldn\\'t compile.' );\n\n\t\t}\n\n\t\tif ( gl.getShaderInfoLog( shader ) !== '' ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLShader: gl.getShaderInfoLog()', type === gl.VERTEX_SHADER ? 'vertex' : 'fragment', gl.getShaderInfoLog( shader ), addLineNumbers( string ) );\n\n\t\t}\n\n\t\t// --enable-privileged-webgl-extension\n\t\t// console.log( type, gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\n\n\t\treturn shader;\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tvar programIdCount = 0;\n\n\tfunction getEncodingComponents( encoding ) {\n\n\t\tswitch ( encoding ) {\n\n\t\t\tcase LinearEncoding:\n\t\t\t\treturn [ 'Linear','( value )' ];\n\t\t\tcase sRGBEncoding:\n\t\t\t\treturn [ 'sRGB','( value )' ];\n\t\t\tcase RGBEEncoding:\n\t\t\t\treturn [ 'RGBE','( value )' ];\n\t\t\tcase RGBM7Encoding:\n\t\t\t\treturn [ 'RGBM','( value, 7.0 )' ];\n\t\t\tcase RGBM16Encoding:\n\t\t\t\treturn [ 'RGBM','( value, 16.0 )' ];\n\t\t\tcase RGBDEncoding:\n\t\t\t\treturn [ 'RGBD','( value, 256.0 )' ];\n\t\t\tcase GammaEncoding:\n\t\t\t\treturn [ 'Gamma','( value, float( GAMMA_FACTOR ) )' ];\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'unsupported encoding: ' + encoding );\n\n\t\t}\n\n\t}\n\n\tfunction getTexelDecodingFunction( functionName, encoding ) {\n\n\t\tvar components = getEncodingComponents( encoding );\n\t\treturn \"vec4 \" + functionName + \"( vec4 value ) { return \" + components[ 0 ] + \"ToLinear\" + components[ 1 ] + \"; }\";\n\n\t}\n\n\tfunction getTexelEncodingFunction( functionName, encoding ) {\n\n\t\tvar components = getEncodingComponents( encoding );\n\t\treturn \"vec4 \" + functionName + \"( vec4 value ) { return LinearTo\" + components[ 0 ] + components[ 1 ] + \"; }\";\n\n\t}\n\n\tfunction getToneMappingFunction( functionName, toneMapping ) {\n\n\t\tvar toneMappingName;\n\n\t\tswitch ( toneMapping ) {\n\n\t\t\tcase LinearToneMapping:\n\t\t\t\ttoneMappingName = \"Linear\";\n\t\t\t\tbreak;\n\n\t\t\tcase ReinhardToneMapping:\n\t\t\t\ttoneMappingName = \"Reinhard\";\n\t\t\t\tbreak;\n\n\t\t\tcase Uncharted2ToneMapping:\n\t\t\t\ttoneMappingName = \"Uncharted2\";\n\t\t\t\tbreak;\n\n\t\t\tcase CineonToneMapping:\n\t\t\t\ttoneMappingName = \"OptimizedCineon\";\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'unsupported toneMapping: ' + toneMapping );\n\n\t\t}\n\n\t\treturn \"vec3 \" + functionName + \"( vec3 color ) { return \" + toneMappingName + \"ToneMapping( color ); }\";\n\n\t}\n\n\tfunction generateExtensions( extensions, parameters, rendererExtensions ) {\n\n\t\textensions = extensions || {};\n\n\t\tvar chunks = [\n\t\t\t( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.normalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '',\n\t\t\t( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ? '#extension GL_EXT_frag_depth : enable' : '',\n\t\t\t( extensions.drawBuffers ) && rendererExtensions.get( 'WEBGL_draw_buffers' ) ? '#extension GL_EXT_draw_buffers : require' : '',\n\t\t\t( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ? '#extension GL_EXT_shader_texture_lod : enable' : '',\n\t\t];\n\n\t\treturn chunks.filter( filterEmptyLine ).join( '\\n' );\n\n\t}\n\n\tfunction generateDefines( defines ) {\n\n\t\tvar chunks = [];\n\n\t\tfor ( var name in defines ) {\n\n\t\t\tvar value = defines[ name ];\n\n\t\t\tif ( value === false ) continue;\n\n\t\t\tchunks.push( '#define ' + name + ' ' + value );\n\n\t\t}\n\n\t\treturn chunks.join( '\\n' );\n\n\t}\n\n\tfunction fetchAttributeLocations( gl, program, identifiers ) {\n\n\t\tvar attributes = {};\n\n\t\tvar n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES );\n\n\t\tfor ( var i = 0; i < n; i ++ ) {\n\n\t\t\tvar info = gl.getActiveAttrib( program, i );\n\t\t\tvar name = info.name;\n\n\t\t\t// console.log(\"THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:\", name, i );\n\n\t\t\tattributes[ name ] = gl.getAttribLocation( program, name );\n\n\t\t}\n\n\t\treturn attributes;\n\n\t}\n\n\tfunction filterEmptyLine( string ) {\n\n\t\treturn string !== '';\n\n\t}\n\n\tfunction replaceLightNums( string, parameters ) {\n\n\t\treturn string\n\t\t\t.replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights )\n\t\t\t.replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights )\n\t\t\t.replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights )\n\t\t\t.replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights );\n\n\t}\n\n\tfunction parseIncludes( string ) {\n\n\t\tvar pattern = /#include +<([\\w\\d.]+)>/g;\n\n\t\tfunction replace( match, include ) {\n\n\t\t\tvar replace = ShaderChunk[ include ];\n\n\t\t\tif ( replace === undefined ) {\n\n\t\t\t\tthrow new Error( 'Can not resolve #include <' + include + '>' );\n\n\t\t\t}\n\n\t\t\treturn parseIncludes( replace );\n\n\t\t}\n\n\t\treturn string.replace( pattern, replace );\n\n\t}\n\n\tfunction unrollLoops( string ) {\n\n\t\tvar pattern = /for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g;\n\n\t\tfunction replace( match, start, end, snippet ) {\n\n\t\t\tvar unroll = '';\n\n\t\t\tfor ( var i = parseInt( start ); i < parseInt( end ); i ++ ) {\n\n\t\t\t\tunroll += snippet.replace( /\\[ i \\]/g, '[ ' + i + ' ]' );\n\n\t\t\t}\n\n\t\t\treturn unroll;\n\n\t\t}\n\n\t\treturn string.replace( pattern, replace );\n\n\t}\n\n\tfunction WebGLProgram( renderer, code, material, parameters ) {\n\n\t\tvar gl = renderer.context;\n\n\t\tvar extensions = material.extensions;\n\t\tvar defines = material.defines;\n\n\t\tvar vertexShader = material.__webglShader.vertexShader;\n\t\tvar fragmentShader = material.__webglShader.fragmentShader;\n\n\t\tvar shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC';\n\n\t\tif ( parameters.shadowMapType === PCFShadowMap ) {\n\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF';\n\n\t\t} else if ( parameters.shadowMapType === PCFSoftShadowMap ) {\n\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT';\n\n\t\t}\n\n\t\tvar envMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\tvar envMapModeDefine = 'ENVMAP_MODE_REFLECTION';\n\t\tvar envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\n\t\tif ( parameters.envMap ) {\n\n\t\t\tswitch ( material.envMap.mapping ) {\n\n\t\t\t\tcase CubeReflectionMapping:\n\t\t\t\tcase CubeRefractionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CubeUVReflectionMapping:\n\t\t\t\tcase CubeUVRefractionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase EquirectangularReflectionMapping:\n\t\t\t\tcase EquirectangularRefractionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_EQUIREC';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase SphericalReflectionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_SPHERE';\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tswitch ( material.envMap.mapping ) {\n\n\t\t\t\tcase CubeRefractionMapping:\n\t\t\t\tcase EquirectangularRefractionMapping:\n\t\t\t\t\tenvMapModeDefine = 'ENVMAP_MODE_REFRACTION';\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tswitch ( material.combine ) {\n\n\t\t\t\tcase MultiplyOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MixOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MIX';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase AddOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_ADD';\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar gammaFactorDefine = ( renderer.gammaFactor > 0 ) ? renderer.gammaFactor : 1.0;\n\n\t\t// console.log( 'building new program ' );\n\n\t\t//\n\n\t\tvar customExtensions = generateExtensions( extensions, parameters, renderer.extensions );\n\n\t\tvar customDefines = generateDefines( defines );\n\n\t\t//\n\n\t\tvar program = gl.createProgram();\n\n\t\tvar prefixVertex, prefixFragment;\n\n\t\tif ( material.isRawShaderMaterial ) {\n\n\t\t\tprefixVertex = [\n\n\t\t\t\tcustomDefines,\n\n\t\t\t\t'\\n'\n\n\t\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\t\tprefixFragment = [\n\n\t\t\t\tcustomExtensions,\n\t\t\t\tcustomDefines,\n\n\t\t\t\t'\\n'\n\n\t\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\t} else {\n\n\t\t\tprefixVertex = [\n\n\t\t\t\t'precision ' + parameters.precision + ' float;',\n\t\t\t\t'precision ' + parameters.precision + ' int;',\n\n\t\t\t\t'#define SHADER_NAME ' + material.__webglShader.name,\n\n\t\t\t\tcustomDefines,\n\n\t\t\t\tparameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',\n\n\t\t\t\t'#define GAMMA_FACTOR ' + gammaFactorDefine,\n\n\t\t\t\t'#define MAX_BONES ' + parameters.maxBones,\n\n\t\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\t\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\t\tparameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',\n\t\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\t\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\t\tparameters.vertexColors ? '#define USE_COLOR' : '',\n\n\t\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\t\tparameters.skinning ? '#define USE_SKINNING' : '',\n\t\t\t\tparameters.useVertexTexture ? '#define BONE_TEXTURE' : '',\n\n\t\t\t\tparameters.morphTargets ? '#define USE_MORPHTARGETS' : '',\n\t\t\t\tparameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '',\n\t\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\t\t'#define NUM_CLIPPING_PLANES ' + parameters.numClippingPlanes,\n\n\t\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\t\tparameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',\n\n\t\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\t\tparameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '',\n\n\t\t\t\t'uniform mat4 modelMatrix;',\n\t\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t\t'uniform mat3 normalMatrix;',\n\t\t\t\t'uniform vec3 cameraPosition;',\n\n\t\t\t\t'attribute vec3 position;',\n\t\t\t\t'attribute vec3 normal;',\n\t\t\t\t'attribute vec2 uv;',\n\n\t\t\t\t'#ifdef USE_COLOR',\n\n\t\t\t\t'\tattribute vec3 color;',\n\n\t\t\t\t'#endif',\n\n\t\t\t\t'#ifdef USE_MORPHTARGETS',\n\n\t\t\t\t'\tattribute vec3 morphTarget0;',\n\t\t\t\t'\tattribute vec3 morphTarget1;',\n\t\t\t\t'\tattribute vec3 morphTarget2;',\n\t\t\t\t'\tattribute vec3 morphTarget3;',\n\n\t\t\t\t'\t#ifdef USE_MORPHNORMALS',\n\n\t\t\t\t'\t\tattribute vec3 morphNormal0;',\n\t\t\t\t'\t\tattribute vec3 morphNormal1;',\n\t\t\t\t'\t\tattribute vec3 morphNormal2;',\n\t\t\t\t'\t\tattribute vec3 morphNormal3;',\n\n\t\t\t\t'\t#else',\n\n\t\t\t\t'\t\tattribute vec3 morphTarget4;',\n\t\t\t\t'\t\tattribute vec3 morphTarget5;',\n\t\t\t\t'\t\tattribute vec3 morphTarget6;',\n\t\t\t\t'\t\tattribute vec3 morphTarget7;',\n\n\t\t\t\t'\t#endif',\n\n\t\t\t\t'#endif',\n\n\t\t\t\t'#ifdef USE_SKINNING',\n\n\t\t\t\t'\tattribute vec4 skinIndex;',\n\t\t\t\t'\tattribute vec4 skinWeight;',\n\n\t\t\t\t'#endif',\n\n\t\t\t\t'\\n'\n\n\t\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\t\tprefixFragment = [\n\n\t\t\t\tcustomExtensions,\n\n\t\t\t\t'precision ' + parameters.precision + ' float;',\n\t\t\t\t'precision ' + parameters.precision + ' int;',\n\n\t\t\t\t'#define SHADER_NAME ' + material.__webglShader.name,\n\n\t\t\t\tcustomDefines,\n\n\t\t\t\tparameters.alphaTest ? '#define ALPHATEST ' + parameters.alphaTest : '',\n\n\t\t\t\t'#define GAMMA_FACTOR ' + gammaFactorDefine,\n\n\t\t\t\t( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '',\n\t\t\t\t( parameters.useFog && parameters.fogExp ) ? '#define FOG_EXP2' : '',\n\n\t\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\t\tparameters.envMap ? '#define ' + envMapTypeDefine : '',\n\t\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\t\tparameters.envMap ? '#define ' + envMapBlendingDefine : '',\n\t\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\t\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\t\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\t\tparameters.vertexColors ? '#define USE_COLOR' : '',\n\n\t\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\t\t'#define NUM_CLIPPING_PLANES ' + parameters.numClippingPlanes,\n\t\t\t\t'#define UNION_CLIPPING_PLANES ' + (parameters.numClippingPlanes - parameters.numClipIntersection),\n\n\t\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\t\tparameters.premultipliedAlpha ? \"#define PREMULTIPLIED_ALPHA\" : '',\n\n\t\t\t\tparameters.physicallyCorrectLights ? \"#define PHYSICALLY_CORRECT_LIGHTS\" : '',\n\n\t\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\t\tparameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '',\n\n\t\t\t\tparameters.envMap && renderer.extensions.get( 'EXT_shader_texture_lod' ) ? '#define TEXTURE_LOD_EXT' : '',\n\n\t\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t\t'uniform vec3 cameraPosition;',\n\n\t\t\t\t( parameters.toneMapping !== NoToneMapping ) ? \"#define TONE_MAPPING\" : '',\n\t\t\t\t( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below\n\t\t\t\t( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( \"toneMapping\", parameters.toneMapping ) : '',\n\n\t\t\t\t( parameters.outputEncoding || parameters.mapEncoding || parameters.envMapEncoding || parameters.emissiveMapEncoding ) ? ShaderChunk[ 'encodings_pars_fragment' ] : '', // this code is required here because it is used by the various encoding/decoding function defined below\n\t\t\t\tparameters.mapEncoding ? getTexelDecodingFunction( 'mapTexelToLinear', parameters.mapEncoding ) : '',\n\t\t\t\tparameters.envMapEncoding ? getTexelDecodingFunction( 'envMapTexelToLinear', parameters.envMapEncoding ) : '',\n\t\t\t\tparameters.emissiveMapEncoding ? getTexelDecodingFunction( 'emissiveMapTexelToLinear', parameters.emissiveMapEncoding ) : '',\n\t\t\t\tparameters.outputEncoding ? getTexelEncodingFunction( \"linearToOutputTexel\", parameters.outputEncoding ) : '',\n\n\t\t\t\tparameters.depthPacking ? \"#define DEPTH_PACKING \" + material.depthPacking : '',\n\n\t\t\t\t'\\n'\n\n\t\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\t}\n\n\t\tvertexShader = parseIncludes( vertexShader, parameters );\n\t\tvertexShader = replaceLightNums( vertexShader, parameters );\n\n\t\tfragmentShader = parseIncludes( fragmentShader, parameters );\n\t\tfragmentShader = replaceLightNums( fragmentShader, parameters );\n\n\t\tif ( ! material.isShaderMaterial ) {\n\n\t\t\tvertexShader = unrollLoops( vertexShader );\n\t\t\tfragmentShader = unrollLoops( fragmentShader );\n\n\t\t}\n\n\t\tvar vertexGlsl = prefixVertex + vertexShader;\n\t\tvar fragmentGlsl = prefixFragment + fragmentShader;\n\n\t\t// console.log( '*VERTEX*', vertexGlsl );\n\t\t// console.log( '*FRAGMENT*', fragmentGlsl );\n\n\t\tvar glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );\n\t\tvar glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );\n\n\t\tgl.attachShader( program, glVertexShader );\n\t\tgl.attachShader( program, glFragmentShader );\n\n\t\t// Force a particular attribute to index 0.\n\n\t\tif ( material.index0AttributeName !== undefined ) {\n\n\t\t\tgl.bindAttribLocation( program, 0, material.index0AttributeName );\n\n\t\t} else if ( parameters.morphTargets === true ) {\n\n\t\t\t// programs with morphTargets displace position out of attribute 0\n\t\t\tgl.bindAttribLocation( program, 0, 'position' );\n\n\t\t}\n\n\t\tgl.linkProgram( program );\n\n\t\tvar programLog = gl.getProgramInfoLog( program );\n\t\tvar vertexLog = gl.getShaderInfoLog( glVertexShader );\n\t\tvar fragmentLog = gl.getShaderInfoLog( glFragmentShader );\n\n\t\tvar runnable = true;\n\t\tvar haveDiagnostics = true;\n\n\t\t// console.log( '**VERTEX**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) );\n\t\t// console.log( '**FRAGMENT**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) );\n\n\t\tif ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) {\n\n\t\t\trunnable = false;\n\n\t\t\tconsole.error( 'THREE.WebGLProgram: shader error: ', gl.getError(), 'gl.VALIDATE_STATUS', gl.getProgramParameter( program, gl.VALIDATE_STATUS ), 'gl.getProgramInfoLog', programLog, vertexLog, fragmentLog );\n\n\t\t} else if ( programLog !== '' ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLProgram: gl.getProgramInfoLog()', programLog );\n\n\t\t} else if ( vertexLog === '' || fragmentLog === '' ) {\n\n\t\t\thaveDiagnostics = false;\n\n\t\t}\n\n\t\tif ( haveDiagnostics ) {\n\n\t\t\tthis.diagnostics = {\n\n\t\t\t\trunnable: runnable,\n\t\t\t\tmaterial: material,\n\n\t\t\t\tprogramLog: programLog,\n\n\t\t\t\tvertexShader: {\n\n\t\t\t\t\tlog: vertexLog,\n\t\t\t\t\tprefix: prefixVertex\n\n\t\t\t\t},\n\n\t\t\t\tfragmentShader: {\n\n\t\t\t\t\tlog: fragmentLog,\n\t\t\t\t\tprefix: prefixFragment\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}\n\n\t\t// clean up\n\n\t\tgl.deleteShader( glVertexShader );\n\t\tgl.deleteShader( glFragmentShader );\n\n\t\t// set up caching for uniform locations\n\n\t\tvar cachedUniforms;\n\n\t\tthis.getUniforms = function() {\n\n\t\t\tif ( cachedUniforms === undefined ) {\n\n\t\t\t\tcachedUniforms =\n\t\t\t\t\t\tnew WebGLUniforms( gl, program, renderer );\n\n\t\t\t}\n\n\t\t\treturn cachedUniforms;\n\n\t\t};\n\n\t\t// set up caching for attribute locations\n\n\t\tvar cachedAttributes;\n\n\t\tthis.getAttributes = function() {\n\n\t\t\tif ( cachedAttributes === undefined ) {\n\n\t\t\t\tcachedAttributes = fetchAttributeLocations( gl, program );\n\n\t\t\t}\n\n\t\t\treturn cachedAttributes;\n\n\t\t};\n\n\t\t// free resource\n\n\t\tthis.destroy = function() {\n\n\t\t\tgl.deleteProgram( program );\n\t\t\tthis.program = undefined;\n\n\t\t};\n\n\t\t// DEPRECATED\n\n\t\tObject.defineProperties( this, {\n\n\t\t\tuniforms: {\n\t\t\t\tget: function() {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLProgram: .uniforms is now .getUniforms().' );\n\t\t\t\t\treturn this.getUniforms();\n\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tattributes: {\n\t\t\t\tget: function() {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLProgram: .attributes is now .getAttributes().' );\n\t\t\t\t\treturn this.getAttributes();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t} );\n\n\n\t\t//\n\n\t\tthis.id = programIdCount ++;\n\t\tthis.code = code;\n\t\tthis.usedTimes = 1;\n\t\tthis.program = program;\n\t\tthis.vertexShader = glVertexShader;\n\t\tthis.fragmentShader = glFragmentShader;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLPrograms( renderer, capabilities ) {\n\n\t\tvar programs = [];\n\n\t\tvar shaderIDs = {\n\t\t\tMeshDepthMaterial: 'depth',\n\t\t\tMeshNormalMaterial: 'normal',\n\t\t\tMeshBasicMaterial: 'basic',\n\t\t\tMeshLambertMaterial: 'lambert',\n\t\t\tMeshPhongMaterial: 'phong',\n\t\t\tMeshStandardMaterial: 'physical',\n\t\t\tMeshPhysicalMaterial: 'physical',\n\t\t\tLineBasicMaterial: 'basic',\n\t\t\tLineDashedMaterial: 'dashed',\n\t\t\tPointsMaterial: 'points'\n\t\t};\n\n\t\tvar parameterNames = [\n\t\t\t\"precision\", \"supportsVertexTextures\", \"map\", \"mapEncoding\", \"envMap\", \"envMapMode\", \"envMapEncoding\",\n\t\t\t\"lightMap\", \"aoMap\", \"emissiveMap\", \"emissiveMapEncoding\", \"bumpMap\", \"normalMap\", \"displacementMap\", \"specularMap\",\n\t\t\t\"roughnessMap\", \"metalnessMap\",\n\t\t\t\"alphaMap\", \"combine\", \"vertexColors\", \"fog\", \"useFog\", \"fogExp\",\n\t\t\t\"flatShading\", \"sizeAttenuation\", \"logarithmicDepthBuffer\", \"skinning\",\n\t\t\t\"maxBones\", \"useVertexTexture\", \"morphTargets\", \"morphNormals\",\n\t\t\t\"maxMorphTargets\", \"maxMorphNormals\", \"premultipliedAlpha\",\n\t\t\t\"numDirLights\", \"numPointLights\", \"numSpotLights\", \"numHemiLights\",\n\t\t\t\"shadowMapEnabled\", \"shadowMapType\", \"toneMapping\", 'physicallyCorrectLights',\n\t\t\t\"alphaTest\", \"doubleSided\", \"flipSided\", \"numClippingPlanes\", \"numClipIntersection\", \"depthPacking\"\n\t\t];\n\n\n\t\tfunction allocateBones( object ) {\n\n\t\t\tif ( capabilities.floatVertexTextures && object && object.skeleton && object.skeleton.useVertexTexture ) {\n\n\t\t\t\treturn 1024;\n\n\t\t\t} else {\n\n\t\t\t\t// default for when object is not specified\n\t\t\t\t// ( for example when prebuilding shader to be used with multiple objects )\n\t\t\t\t//\n\t\t\t\t// - leave some extra space for other uniforms\n\t\t\t\t// - limit here is ANGLE's 254 max uniform vectors\n\t\t\t\t// (up to 54 should be safe)\n\n\t\t\t\tvar nVertexUniforms = capabilities.maxVertexUniforms;\n\t\t\t\tvar nVertexMatrices = Math.floor( ( nVertexUniforms - 20 ) / 4 );\n\n\t\t\t\tvar maxBones = nVertexMatrices;\n\n\t\t\t\tif ( object !== undefined && (object && object.isSkinnedMesh) ) {\n\n\t\t\t\t\tmaxBones = Math.min( object.skeleton.bones.length, maxBones );\n\n\t\t\t\t\tif ( maxBones < object.skeleton.bones.length ) {\n\n\t\t\t\t\t\tconsole.warn( 'WebGLRenderer: too many bones - ' + object.skeleton.bones.length + ', this GPU supports just ' + maxBones + ' (try OpenGL instead of ANGLE)' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn maxBones;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getTextureEncodingFromMap( map, gammaOverrideLinear ) {\n\n\t\t\tvar encoding;\n\n\t\t\tif ( ! map ) {\n\n\t\t\t\tencoding = LinearEncoding;\n\n\t\t\t} else if ( (map && map.isTexture) ) {\n\n\t\t\t\tencoding = map.encoding;\n\n\t\t\t} else if ( (map && map.isWebGLRenderTarget) ) {\n\n\t\t\t\tconsole.warn( \"THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.\" );\n\t\t\t\tencoding = map.texture.encoding;\n\n\t\t\t}\n\n\t\t\t// add backwards compatibility for WebGLRenderer.gammaInput/gammaOutput parameter, should probably be removed at some point.\n\t\t\tif ( encoding === LinearEncoding && gammaOverrideLinear ) {\n\n\t\t\t\tencoding = GammaEncoding;\n\n\t\t\t}\n\n\t\t\treturn encoding;\n\n\t\t}\n\n\t\tthis.getParameters = function ( material, lights, fog, nClipPlanes, nClipIntersection, object ) {\n\n\t\t\tvar shaderID = shaderIDs[ material.type ];\n\n\t\t\t// heuristics to create shader parameters according to lights in the scene\n\t\t\t// (not to blow over maxLights budget)\n\n\t\t\tvar maxBones = allocateBones( object );\n\t\t\tvar precision = renderer.getPrecision();\n\n\t\t\tif ( material.precision !== null ) {\n\n\t\t\t\tprecision = capabilities.getMaxPrecision( material.precision );\n\n\t\t\t\tif ( precision !== material.precision ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar currentRenderTarget = renderer.getCurrentRenderTarget();\n\n\t\t\tvar parameters = {\n\n\t\t\t\tshaderID: shaderID,\n\n\t\t\t\tprecision: precision,\n\t\t\t\tsupportsVertexTextures: capabilities.vertexTextures,\n\t\t\t\toutputEncoding: getTextureEncodingFromMap( ( ! currentRenderTarget ) ? null : currentRenderTarget.texture, renderer.gammaOutput ),\n\t\t\t\tmap: !! material.map,\n\t\t\t\tmapEncoding: getTextureEncodingFromMap( material.map, renderer.gammaInput ),\n\t\t\t\tenvMap: !! material.envMap,\n\t\t\t\tenvMapMode: material.envMap && material.envMap.mapping,\n\t\t\t\tenvMapEncoding: getTextureEncodingFromMap( material.envMap, renderer.gammaInput ),\n\t\t\t\tenvMapCubeUV: ( !! material.envMap ) && ( ( material.envMap.mapping === CubeUVReflectionMapping ) || ( material.envMap.mapping === CubeUVRefractionMapping ) ),\n\t\t\t\tlightMap: !! material.lightMap,\n\t\t\t\taoMap: !! material.aoMap,\n\t\t\t\temissiveMap: !! material.emissiveMap,\n\t\t\t\temissiveMapEncoding: getTextureEncodingFromMap( material.emissiveMap, renderer.gammaInput ),\n\t\t\t\tbumpMap: !! material.bumpMap,\n\t\t\t\tnormalMap: !! material.normalMap,\n\t\t\t\tdisplacementMap: !! material.displacementMap,\n\t\t\t\troughnessMap: !! material.roughnessMap,\n\t\t\t\tmetalnessMap: !! material.metalnessMap,\n\t\t\t\tspecularMap: !! material.specularMap,\n\t\t\t\talphaMap: !! material.alphaMap,\n\n\t\t\t\tcombine: material.combine,\n\n\t\t\t\tvertexColors: material.vertexColors,\n\n\t\t\t\tfog: !! fog,\n\t\t\t\tuseFog: material.fog,\n\t\t\t\tfogExp: (fog && fog.isFogExp2),\n\n\t\t\t\tflatShading: material.shading === FlatShading,\n\n\t\t\t\tsizeAttenuation: material.sizeAttenuation,\n\t\t\t\tlogarithmicDepthBuffer: capabilities.logarithmicDepthBuffer,\n\n\t\t\t\tskinning: material.skinning,\n\t\t\t\tmaxBones: maxBones,\n\t\t\t\tuseVertexTexture: capabilities.floatVertexTextures && object && object.skeleton && object.skeleton.useVertexTexture,\n\n\t\t\t\tmorphTargets: material.morphTargets,\n\t\t\t\tmorphNormals: material.morphNormals,\n\t\t\t\tmaxMorphTargets: renderer.maxMorphTargets,\n\t\t\t\tmaxMorphNormals: renderer.maxMorphNormals,\n\n\t\t\t\tnumDirLights: lights.directional.length,\n\t\t\t\tnumPointLights: lights.point.length,\n\t\t\t\tnumSpotLights: lights.spot.length,\n\t\t\t\tnumHemiLights: lights.hemi.length,\n\n\t\t\t\tnumClippingPlanes: nClipPlanes,\n\t\t\t\tnumClipIntersection: nClipIntersection,\n\n\t\t\t\tshadowMapEnabled: renderer.shadowMap.enabled && object.receiveShadow && lights.shadows.length > 0,\n\t\t\t\tshadowMapType: renderer.shadowMap.type,\n\n\t\t\t\ttoneMapping: renderer.toneMapping,\n\t\t\t\tphysicallyCorrectLights: renderer.physicallyCorrectLights,\n\n\t\t\t\tpremultipliedAlpha: material.premultipliedAlpha,\n\n\t\t\t\talphaTest: material.alphaTest,\n\t\t\t\tdoubleSided: material.side === DoubleSide,\n\t\t\t\tflipSided: material.side === BackSide,\n\n\t\t\t\tdepthPacking: ( material.depthPacking !== undefined ) ? material.depthPacking : false\n\n\t\t\t};\n\n\t\t\treturn parameters;\n\n\t\t};\n\n\t\tthis.getProgramCode = function ( material, parameters ) {\n\n\t\t\tvar array = [];\n\n\t\t\tif ( parameters.shaderID ) {\n\n\t\t\t\tarray.push( parameters.shaderID );\n\n\t\t\t} else {\n\n\t\t\t\tarray.push( material.fragmentShader );\n\t\t\t\tarray.push( material.vertexShader );\n\n\t\t\t}\n\n\t\t\tif ( material.defines !== undefined ) {\n\n\t\t\t\tfor ( var name in material.defines ) {\n\n\t\t\t\t\tarray.push( name );\n\t\t\t\t\tarray.push( material.defines[ name ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0; i < parameterNames.length; i ++ ) {\n\n\t\t\t\tarray.push( parameters[ parameterNames[ i ] ] );\n\n\t\t\t}\n\n\t\t\treturn array.join();\n\n\t\t};\n\n\t\tthis.acquireProgram = function ( material, parameters, code ) {\n\n\t\t\tvar program;\n\n\t\t\t// Check if code has been already compiled\n\t\t\tfor ( var p = 0, pl = programs.length; p < pl; p ++ ) {\n\n\t\t\t\tvar programInfo = programs[ p ];\n\n\t\t\t\tif ( programInfo.code === code ) {\n\n\t\t\t\t\tprogram = programInfo;\n\t\t\t\t\t++ program.usedTimes;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( program === undefined ) {\n\n\t\t\t\tprogram = new WebGLProgram( renderer, code, material, parameters );\n\t\t\t\tprograms.push( program );\n\n\t\t\t}\n\n\t\t\treturn program;\n\n\t\t};\n\n\t\tthis.releaseProgram = function( program ) {\n\n\t\t\tif ( -- program.usedTimes === 0 ) {\n\n\t\t\t\t// Remove from unordered set\n\t\t\t\tvar i = programs.indexOf( program );\n\t\t\t\tprograms[ i ] = programs[ programs.length - 1 ];\n\t\t\t\tprograms.pop();\n\n\t\t\t\t// Free WebGL resources\n\t\t\t\tprogram.destroy();\n\n\t\t\t}\n\n\t\t};\n\n\t\t// Exposed for resource monitoring & error feedback via renderer.info:\n\t\tthis.programs = programs;\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLGeometries( gl, properties, info ) {\n\n\t\tvar geometries = {};\n\n\t\tfunction onGeometryDispose( event ) {\n\n\t\t\tvar geometry = event.target;\n\t\t\tvar buffergeometry = geometries[ geometry.id ];\n\n\t\t\tif ( buffergeometry.index !== null ) {\n\n\t\t\t\tdeleteAttribute( buffergeometry.index );\n\n\t\t\t}\n\n\t\t\tdeleteAttributes( buffergeometry.attributes );\n\n\t\t\tgeometry.removeEventListener( 'dispose', onGeometryDispose );\n\n\t\t\tdelete geometries[ geometry.id ];\n\n\t\t\t// TODO\n\n\t\t\tvar property = properties.get( geometry );\n\n\t\t\tif ( property.wireframe ) {\n\n\t\t\t\tdeleteAttribute( property.wireframe );\n\n\t\t\t}\n\n\t\t\tproperties.delete( geometry );\n\n\t\t\tvar bufferproperty = properties.get( buffergeometry );\n\n\t\t\tif ( bufferproperty.wireframe ) {\n\n\t\t\t\tdeleteAttribute( bufferproperty.wireframe );\n\n\t\t\t}\n\n\t\t\tproperties.delete( buffergeometry );\n\n\t\t\t//\n\n\t\t\tinfo.memory.geometries --;\n\n\t\t}\n\n\t\tfunction getAttributeBuffer( attribute ) {\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\treturn properties.get( attribute.data ).__webglBuffer;\n\n\t\t\t}\n\n\t\t\treturn properties.get( attribute ).__webglBuffer;\n\n\t\t}\n\n\t\tfunction deleteAttribute( attribute ) {\n\n\t\t\tvar buffer = getAttributeBuffer( attribute );\n\n\t\t\tif ( buffer !== undefined ) {\n\n\t\t\t\tgl.deleteBuffer( buffer );\n\t\t\t\tremoveAttributeBuffer( attribute );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction deleteAttributes( attributes ) {\n\n\t\t\tfor ( var name in attributes ) {\n\n\t\t\t\tdeleteAttribute( attributes[ name ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction removeAttributeBuffer( attribute ) {\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tproperties.delete( attribute.data );\n\n\t\t\t} else {\n\n\t\t\t\tproperties.delete( attribute );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tget: function ( object ) {\n\n\t\t\t\tvar geometry = object.geometry;\n\n\t\t\t\tif ( geometries[ geometry.id ] !== undefined ) {\n\n\t\t\t\t\treturn geometries[ geometry.id ];\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.addEventListener( 'dispose', onGeometryDispose );\n\n\t\t\t\tvar buffergeometry;\n\n\t\t\t\tif ( geometry.isBufferGeometry ) {\n\n\t\t\t\t\tbuffergeometry = geometry;\n\n\t\t\t\t} else if ( geometry.isGeometry ) {\n\n\t\t\t\t\tif ( geometry._bufferGeometry === undefined ) {\n\n\t\t\t\t\t\tgeometry._bufferGeometry = new BufferGeometry().setFromObject( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbuffergeometry = geometry._bufferGeometry;\n\n\t\t\t\t}\n\n\t\t\t\tgeometries[ geometry.id ] = buffergeometry;\n\n\t\t\t\tinfo.memory.geometries ++;\n\n\t\t\t\treturn buffergeometry;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLObjects( gl, properties, info ) {\n\n\t\tvar geometries = new WebGLGeometries( gl, properties, info );\n\n\t\t//\n\n\t\tfunction update( object ) {\n\n\t\t\t// TODO: Avoid updating twice (when using shadowMap). Maybe add frame counter.\n\n\t\t\tvar geometry = geometries.get( object );\n\n\t\t\tif ( object.geometry.isGeometry ) {\n\n\t\t\t\tgeometry.updateFromObject( object );\n\n\t\t\t}\n\n\t\t\tvar index = geometry.index;\n\t\t\tvar attributes = geometry.attributes;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tupdateAttribute( index, gl.ELEMENT_ARRAY_BUFFER );\n\n\t\t\t}\n\n\t\t\tfor ( var name in attributes ) {\n\n\t\t\t\tupdateAttribute( attributes[ name ], gl.ARRAY_BUFFER );\n\n\t\t\t}\n\n\t\t\t// morph targets\n\n\t\t\tvar morphAttributes = geometry.morphAttributes;\n\n\t\t\tfor ( var name in morphAttributes ) {\n\n\t\t\t\tvar array = morphAttributes[ name ];\n\n\t\t\t\tfor ( var i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\t\tupdateAttribute( array[ i ], gl.ARRAY_BUFFER );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tfunction updateAttribute( attribute, bufferType ) {\n\n\t\t\tvar data = ( attribute.isInterleavedBufferAttribute ) ? attribute.data : attribute;\n\n\t\t\tvar attributeProperties = properties.get( data );\n\n\t\t\tif ( attributeProperties.__webglBuffer === undefined ) {\n\n\t\t\t\tcreateBuffer( attributeProperties, data, bufferType );\n\n\t\t\t} else if ( attributeProperties.version !== data.version ) {\n\n\t\t\t\tupdateBuffer( attributeProperties, data, bufferType );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction createBuffer( attributeProperties, data, bufferType ) {\n\n\t\t\tattributeProperties.__webglBuffer = gl.createBuffer();\n\t\t\tgl.bindBuffer( bufferType, attributeProperties.__webglBuffer );\n\n\t\t\tvar usage = data.dynamic ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;\n\n\t\t\tgl.bufferData( bufferType, data.array, usage );\n\n\t\t\tattributeProperties.version = data.version;\n\n\t\t}\n\n\t\tfunction updateBuffer( attributeProperties, data, bufferType ) {\n\n\t\t\tgl.bindBuffer( bufferType, attributeProperties.__webglBuffer );\n\n\t\t\tif ( data.dynamic === false ) {\n\n\t\t\t\tgl.bufferData( bufferType, data.array, gl.STATIC_DRAW );\n\n\t\t\t} else if ( data.updateRange.count === - 1 ) {\n\n\t\t\t\t// Not using update ranges\n\n\t\t\t\tgl.bufferSubData( bufferType, 0, data.array );\n\n\t\t\t} else if ( data.updateRange.count === 0 ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.' );\n\n\t\t\t} else {\n\n\t\t\t\tgl.bufferSubData( bufferType, data.updateRange.offset * data.array.BYTES_PER_ELEMENT,\n\t\t\t\t\t\t\t\t data.array.subarray( data.updateRange.offset, data.updateRange.offset + data.updateRange.count ) );\n\n\t\t\t\tdata.updateRange.count = 0; // reset range\n\n\t\t\t}\n\n\t\t\tattributeProperties.version = data.version;\n\n\t\t}\n\n\t\tfunction getAttributeBuffer( attribute ) {\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\treturn properties.get( attribute.data ).__webglBuffer;\n\n\t\t\t}\n\n\t\t\treturn properties.get( attribute ).__webglBuffer;\n\n\t\t}\n\n\t\tfunction getWireframeAttribute( geometry ) {\n\n\t\t\tvar property = properties.get( geometry );\n\n\t\t\tif ( property.wireframe !== undefined ) {\n\n\t\t\t\treturn property.wireframe;\n\n\t\t\t}\n\n\t\t\tvar indices = [];\n\n\t\t\tvar index = geometry.index;\n\t\t\tvar attributes = geometry.attributes;\n\t\t\tvar position = attributes.position;\n\n\t\t\t// console.time( 'wireframe' );\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tvar edges = {};\n\t\t\t\tvar array = index.array;\n\n\t\t\t\tfor ( var i = 0, l = array.length; i < l; i += 3 ) {\n\n\t\t\t\t\tvar a = array[ i + 0 ];\n\t\t\t\t\tvar b = array[ i + 1 ];\n\t\t\t\t\tvar c = array[ i + 2 ];\n\n\t\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tvar array = attributes.position.array;\n\n\t\t\t\tfor ( var i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) {\n\n\t\t\t\t\tvar a = i + 0;\n\t\t\t\t\tvar b = i + 1;\n\t\t\t\t\tvar c = i + 2;\n\n\t\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// console.timeEnd( 'wireframe' );\n\n\t\t\tvar TypeArray = position.count > 65535 ? Uint32Array : Uint16Array;\n\t\t\tvar attribute = new BufferAttribute( new TypeArray( indices ), 1 );\n\n\t\t\tupdateAttribute( attribute, gl.ELEMENT_ARRAY_BUFFER );\n\n\t\t\tproperty.wireframe = attribute;\n\n\t\t\treturn attribute;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tgetAttributeBuffer: getAttributeBuffer,\n\t\t\tgetWireframeAttribute: getWireframeAttribute,\n\n\t\t\tupdate: update\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLTextures( _gl, extensions, state, properties, capabilities, paramThreeToGL, info ) {\n\n\t\tvar _infoMemory = info.memory;\n\t\tvar _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );\n\n\t\t//\n\n\t\tfunction clampToMaxSize( image, maxSize ) {\n\n\t\t\tif ( image.width > maxSize || image.height > maxSize ) {\n\n\t\t\t\t// Warning: Scaling through the canvas will only work with images that use\n\t\t\t\t// premultiplied alpha.\n\n\t\t\t\tvar scale = maxSize / Math.max( image.width, image.height );\n\n\t\t\t\tvar canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );\n\t\t\t\tcanvas.width = Math.floor( image.width * scale );\n\t\t\t\tcanvas.height = Math.floor( image.height * scale );\n\n\t\t\t\tvar context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height );\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: image is too big (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height, image );\n\n\t\t\t\treturn canvas;\n\n\t\t\t}\n\n\t\t\treturn image;\n\n\t\t}\n\n\t\tfunction isPowerOfTwo( image ) {\n\n\t\t\treturn _Math.isPowerOfTwo( image.width ) && _Math.isPowerOfTwo( image.height );\n\n\t\t}\n\n\t\tfunction makePowerOfTwo( image ) {\n\n\t\t\tif ( image instanceof HTMLImageElement || image instanceof HTMLCanvasElement ) {\n\n\t\t\t\tvar canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );\n\t\t\t\tcanvas.width = _Math.nearestPowerOfTwo( image.width );\n\t\t\t\tcanvas.height = _Math.nearestPowerOfTwo( image.height );\n\n\t\t\t\tvar context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, canvas.width, canvas.height );\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: image is not power of two (' + image.width + 'x' + image.height + '). Resized to ' + canvas.width + 'x' + canvas.height, image );\n\n\t\t\t\treturn canvas;\n\n\t\t\t}\n\n\t\t\treturn image;\n\n\t\t}\n\n\t\tfunction textureNeedsPowerOfTwo( texture ) {\n\n\t\t\tif ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) return true;\n\t\t\tif ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) return true;\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// Fallback filters for non-power-of-2 textures\n\n\t\tfunction filterFallback( f ) {\n\n\t\t\tif ( f === NearestFilter || f === NearestMipMapNearestFilter || f === NearestMipMapLinearFilter ) {\n\n\t\t\t\treturn _gl.NEAREST;\n\n\t\t\t}\n\n\t\t\treturn _gl.LINEAR;\n\n\t\t}\n\n\t\t//\n\n\t\tfunction onTextureDispose( event ) {\n\n\t\t\tvar texture = event.target;\n\n\t\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\t\tdeallocateTexture( texture );\n\n\t\t\t_infoMemory.textures --;\n\n\n\t\t}\n\n\t\tfunction onRenderTargetDispose( event ) {\n\n\t\t\tvar renderTarget = event.target;\n\n\t\t\trenderTarget.removeEventListener( 'dispose', onRenderTargetDispose );\n\n\t\t\tdeallocateRenderTarget( renderTarget );\n\n\t\t\t_infoMemory.textures --;\n\n\t\t}\n\n\t\t//\n\n\t\tfunction deallocateTexture( texture ) {\n\n\t\t\tvar textureProperties = properties.get( texture );\n\n\t\t\tif ( texture.image && textureProperties.__image__webglTextureCube ) {\n\n\t\t\t\t// cube texture\n\n\t\t\t\t_gl.deleteTexture( textureProperties.__image__webglTextureCube );\n\n\t\t\t} else {\n\n\t\t\t\t// 2D texture\n\n\t\t\t\tif ( textureProperties.__webglInit === undefined ) return;\n\n\t\t\t\t_gl.deleteTexture( textureProperties.__webglTexture );\n\n\t\t\t}\n\n\t\t\t// remove all webgl properties\n\t\t\tproperties.delete( texture );\n\n\t\t}\n\n\t\tfunction deallocateRenderTarget( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\t\tif ( ! renderTarget ) return;\n\n\t\t\tif ( textureProperties.__webglTexture !== undefined ) {\n\n\t\t\t\t_gl.deleteTexture( textureProperties.__webglTexture );\n\n\t\t\t}\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\trenderTarget.depthTexture.dispose();\n\n\t\t\t}\n\n\t\t\tif ( (renderTarget && renderTarget.isWebGLRenderTargetCube) ) {\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer );\n\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer );\n\n\t\t\t}\n\n\t\t\tproperties.delete( renderTarget.texture );\n\t\t\tproperties.delete( renderTarget );\n\n\t\t}\n\n\t\t//\n\n\n\n\t\tfunction setTexture2D( texture, slot ) {\n\n\t\t\tvar textureProperties = properties.get( texture );\n\n\t\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\t\tvar image = texture.image;\n\n\t\t\t\tif ( image === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined', texture );\n\n\t\t\t\t} else if ( image.complete === false ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete', texture );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );\n\n\t\t}\n\n\t\tfunction setTextureCube( texture, slot ) {\n\n\t\t\tvar textureProperties = properties.get( texture );\n\n\t\t\tif ( texture.image.length === 6 ) {\n\n\t\t\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\t\t\tif ( ! textureProperties.__image__webglTextureCube ) {\n\n\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\ttextureProperties.__image__webglTextureCube = _gl.createTexture();\n\n\t\t\t\t\t\t_infoMemory.textures ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\t\t\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__image__webglTextureCube );\n\n\t\t\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\n\t\t\t\t\tvar isCompressed = (texture && texture.isCompressedTexture);\n\t\t\t\t\tvar isDataTexture = (texture.image[ 0 ] && texture.image[ 0 ].isDataTexture);\n\n\t\t\t\t\tvar cubeImage = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\tif ( ! isCompressed && ! isDataTexture ) {\n\n\t\t\t\t\t\t\tcubeImage[ i ] = clampToMaxSize( texture.image[ i ], capabilities.maxCubemapSize );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tcubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar image = cubeImage[ 0 ],\n\t\t\t\t\tisPowerOfTwoImage = isPowerOfTwo( image ),\n\t\t\t\t\tglFormat = paramThreeToGL( texture.format ),\n\t\t\t\t\tglType = paramThreeToGL( texture.type );\n\n\t\t\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, isPowerOfTwoImage );\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\tif ( ! isCompressed ) {\n\n\t\t\t\t\t\t\tif ( isDataTexture ) {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvar mipmap, mipmaps = cubeImage[ i ].mipmaps;\n\n\t\t\t\t\t\t\tfor ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\t\t\tmipmap = mipmaps[ j ];\n\n\t\t\t\t\t\t\t\tif ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) {\n\n\t\t\t\t\t\t\t\t\tif ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\tconsole.warn( \"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()\" );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( texture.generateMipmaps && isPowerOfTwoImage ) {\n\n\t\t\t\t\t\t_gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttextureProperties.__version = texture.version;\n\n\t\t\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\t\t\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__image__webglTextureCube );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction setTextureCubeDynamic( texture, slot ) {\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, properties.get( texture ).__webglTexture );\n\n\t\t}\n\n\t\tfunction setTextureParameters( textureType, texture, isPowerOfTwoImage ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( isPowerOfTwoImage ) {\n\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, paramThreeToGL( texture.wrapS ) );\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, paramThreeToGL( texture.wrapT ) );\n\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, paramThreeToGL( texture.magFilter ) );\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, paramThreeToGL( texture.minFilter ) );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE );\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE );\n\n\t\t\t\tif ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', texture );\n\n\t\t\t\t}\n\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterFallback( texture.magFilter ) );\n\t\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterFallback( texture.minFilter ) );\n\n\t\t\t\tif ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', texture );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\textension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\n\t\t\tif ( extension ) {\n\n\t\t\t\tif ( texture.type === FloatType && extensions.get( 'OES_texture_float_linear' ) === null ) return;\n\t\t\t\tif ( texture.type === HalfFloatType && extensions.get( 'OES_texture_half_float_linear' ) === null ) return;\n\n\t\t\t\tif ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {\n\n\t\t\t\t\t_gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );\n\t\t\t\t\tproperties.get( texture ).__currentAnisotropy = texture.anisotropy;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction uploadTexture( textureProperties, texture, slot ) {\n\n\t\t\tif ( textureProperties.__webglInit === undefined ) {\n\n\t\t\t\ttextureProperties.__webglInit = true;\n\n\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t\t_infoMemory.textures ++;\n\n\t\t\t}\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );\n\n\t\t\tvar image = clampToMaxSize( texture.image, capabilities.maxTextureSize );\n\n\t\t\tif ( textureNeedsPowerOfTwo( texture ) && isPowerOfTwo( image ) === false ) {\n\n\t\t\t\timage = makePowerOfTwo( image );\n\n\t\t\t}\n\n\t\t\tvar isPowerOfTwoImage = isPowerOfTwo( image ),\n\t\t\tglFormat = paramThreeToGL( texture.format ),\n\t\t\tglType = paramThreeToGL( texture.type );\n\n\t\t\tsetTextureParameters( _gl.TEXTURE_2D, texture, isPowerOfTwoImage );\n\n\t\t\tvar mipmap, mipmaps = texture.mipmaps;\n\n\t\t\tif ( (texture && texture.isDepthTexture) ) {\n\n\t\t\t\t// populate depth texture with dummy data\n\n\t\t\t\tvar internalFormat = _gl.DEPTH_COMPONENT;\n\n\t\t\t\tif ( texture.type === FloatType ) {\n\n\t\t\t\t\tif ( !_isWebGL2 ) throw new Error('Float Depth Texture only supported in WebGL2.0');\n\t\t\t\t\tinternalFormat = _gl.DEPTH_COMPONENT32F;\n\n\t\t\t\t} else if ( _isWebGL2 ) {\n\n\t\t\t\t\t// WebGL 2.0 requires signed internalformat for glTexImage2D\n\t\t\t\t\tinternalFormat = _gl.DEPTH_COMPONENT16;\n\n\t\t\t\t}\n\n\t\t\t\t// Depth stencil textures need the DEPTH_STENCIL internal format\n\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\tif ( texture.format === DepthStencilFormat ) {\n\n\t\t\t\t\tinternalFormat = _gl.DEPTH_STENCIL;\n\n\t\t\t\t}\n\n\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, internalFormat, image.width, image.height, 0, glFormat, glType, null );\n\n\t\t\t} else if ( (texture && texture.isDataTexture) ) {\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 && isPowerOfTwoImage ) {\n\n\t\t\t\t\tfor ( var i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t} else if ( (texture && texture.isCompressedTexture) ) {\n\n\t\t\t\tfor ( var i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\tif ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) {\n\n\t\t\t\t\t\tif ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) {\n\n\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( \"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\" );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// regular Texture (image, video, canvas)\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 && isPowerOfTwoImage ) {\n\n\t\t\t\t\tfor ( var i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glFormat, glFormat, glType, mipmap );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, image );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( texture.generateMipmaps && isPowerOfTwoImage ) _gl.generateMipmap( _gl.TEXTURE_2D );\n\n\t\t\ttextureProperties.__version = texture.version;\n\n\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t}\n\n\t\t// Render targets\n\n\t\t// Setup storage for target texture and bind it to correct framebuffer\n\t\tfunction setupFrameBufferTexture( framebuffer, renderTarget, attachment, textureTarget ) {\n\n\t\t\tvar glFormat = paramThreeToGL( renderTarget.texture.format );\n\t\t\tvar glType = paramThreeToGL( renderTarget.texture.type );\n\t\t\tstate.texImage2D( textureTarget, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 );\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t}\n\n\t\t// Setup storage for internal depth/stencil buffers and bind to correct framebuffer\n\t\tfunction setupRenderBufferStorage( renderbuffer, renderTarget ) {\n\n\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\n\t\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height );\n\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height );\n\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t\t} else {\n\n\t\t\t\t// FIXME: We don't support !depth !stencil\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\n\t\t}\n\n\t\t// Setup resources for a Depth Texture for a FBO (needs an extension)\n\t\tfunction setupDepthTexture( framebuffer, renderTarget ) {\n\n\t\t\tvar isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) );\n\t\t\tif ( isCube ) throw new Error('Depth Texture with cube render targets is not supported!');\n\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\tif ( !( (renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture) ) ) {\n\n\t\t\t\tthrow new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture');\n\n\t\t\t}\n\n\t\t\t// upload an empty depth texture with framebuffer size\n\t\t\tif ( !properties.get( renderTarget.depthTexture ).__webglTexture ||\n\t\t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\n\t\t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\n\t\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\t\t\t}\n\n\t\t\tsetTexture2D( renderTarget.depthTexture, 0 );\n\n\t\t\tvar webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture;\n\n\t\t\tif ( renderTarget.depthTexture.format === DepthFormat ) {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error('Unknown depthTexture format')\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Setup GL resources for a non-texture depth buffer\n\t\tfunction setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t}\n\n\t\t// Set up GL resources for the render target\n\t\tfunction setupRenderTarget( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t_infoMemory.textures ++;\n\n\t\t\tvar isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) );\n\t\t\tvar isTargetPowerOfTwo = isPowerOfTwo( renderTarget );\n\n\t\t\t// Setup framebuffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t\t// Setup color buffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo );\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i );\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, null );\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );\n\n\t\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_2D, null );\n\n\t\t\t}\n\n\t\t\t// Setup depth and stencil buffers\n\n\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction updateRenderTargetMipmap( renderTarget ) {\n\n\t\t\tvar texture = renderTarget.texture;\n\n\t\t\tif ( texture.generateMipmaps && isPowerOfTwo( renderTarget ) &&\n\t\t\t\t\ttexture.minFilter !== NearestFilter &&\n\t\t\t\t\ttexture.minFilter !== LinearFilter ) {\n\n\t\t\t\tvar target = (renderTarget && renderTarget.isWebGLRenderTargetCube) ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;\n\t\t\t\tvar webglTexture = properties.get( texture ).__webglTexture;\n\n\t\t\t\tstate.bindTexture( target, webglTexture );\n\t\t\t\t_gl.generateMipmap( target );\n\t\t\t\tstate.bindTexture( target, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setTexture2D = setTexture2D;\n\t\tthis.setTextureCube = setTextureCube;\n\t\tthis.setTextureCubeDynamic = setTextureCubeDynamic;\n\t\tthis.setupRenderTarget = setupRenderTarget;\n\t\tthis.updateRenderTargetMipmap = updateRenderTargetMipmap;\n\n\t}\n\n\t/**\n\t * @author fordacious / fordacious.github.io\n\t */\n\n\tfunction WebGLProperties() {\n\n\t\tvar properties = {};\n\n\t\treturn {\n\n\t\t\tget: function ( object ) {\n\n\t\t\t\tvar uuid = object.uuid;\n\t\t\t\tvar map = properties[ uuid ];\n\n\t\t\t\tif ( map === undefined ) {\n\n\t\t\t\t\tmap = {};\n\t\t\t\t\tproperties[ uuid ] = map;\n\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\n\t\t\t},\n\n\t\t\tdelete: function ( object ) {\n\n\t\t\t\tdelete properties[ object.uuid ];\n\n\t\t\t},\n\n\t\t\tclear: function () {\n\n\t\t\t\tproperties = {};\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLState( gl, extensions, paramThreeToGL ) {\n\n\t\tfunction ColorBuffer() {\n\n\t\t\tvar locked = false;\n\n\t\t\tvar color = new Vector4();\n\t\t\tvar currentColorMask = null;\n\t\t\tvar currentColorClear = new Vector4();\n\n\t\t\treturn {\n\n\t\t\t\tsetMask: function ( colorMask ) {\n\n\t\t\t\t\tif ( currentColorMask !== colorMask && ! locked ) {\n\n\t\t\t\t\t\tgl.colorMask( colorMask, colorMask, colorMask, colorMask );\n\t\t\t\t\t\tcurrentColorMask = colorMask;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\t\tlocked = lock;\n\n\t\t\t\t},\n\n\t\t\t\tsetClear: function ( r, g, b, a ) {\n\n\t\t\t\t\tcolor.set( r, g, b, a );\n\n\t\t\t\t\tif ( currentColorClear.equals( color ) === false ) {\n\n\t\t\t\t\t\tgl.clearColor( r, g, b, a );\n\t\t\t\t\t\tcurrentColorClear.copy( color );\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\treset: function () {\n\n\t\t\t\t\tlocked = false;\n\n\t\t\t\t\tcurrentColorMask = null;\n\t\t\t\t\tcurrentColorClear.set( 0, 0, 0, 1 );\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}\n\n\t\tfunction DepthBuffer() {\n\n\t\t\tvar locked = false;\n\n\t\t\tvar currentDepthMask = null;\n\t\t\tvar currentDepthFunc = null;\n\t\t\tvar currentDepthClear = null;\n\n\t\t\treturn {\n\n\t\t\t\tsetTest: function ( depthTest ) {\n\n\t\t\t\t\tif ( depthTest ) {\n\n\t\t\t\t\t\tenable( gl.DEPTH_TEST );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tdisable( gl.DEPTH_TEST );\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetMask: function ( depthMask ) {\n\n\t\t\t\t\tif ( currentDepthMask !== depthMask && ! locked ) {\n\n\t\t\t\t\t\tgl.depthMask( depthMask );\n\t\t\t\t\t\tcurrentDepthMask = depthMask;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetFunc: function ( depthFunc ) {\n\n\t\t\t\t\tif ( currentDepthFunc !== depthFunc ) {\n\n\t\t\t\t\t\tif ( depthFunc ) {\n\n\t\t\t\t\t\t\tswitch ( depthFunc ) {\n\n\t\t\t\t\t\t\t\tcase NeverDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.NEVER );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase AlwaysDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.ALWAYS );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase LessDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.LESS );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase LessEqualDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase EqualDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.EQUAL );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase GreaterEqualDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.GEQUAL );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase GreaterDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.GREATER );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase NotEqualDepth:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.NOTEQUAL );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentDepthFunc = depthFunc;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\t\tlocked = lock;\n\n\t\t\t\t},\n\n\t\t\t\tsetClear: function ( depth ) {\n\n\t\t\t\t\tif ( currentDepthClear !== depth ) {\n\n\t\t\t\t\t\tgl.clearDepth( depth );\n\t\t\t\t\t\tcurrentDepthClear = depth;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\treset: function () {\n\n\t\t\t\t\tlocked = false;\n\n\t\t\t\t\tcurrentDepthMask = null;\n\t\t\t\t\tcurrentDepthFunc = null;\n\t\t\t\t\tcurrentDepthClear = null;\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}\n\n\t\tfunction StencilBuffer() {\n\n\t\t\tvar locked = false;\n\n\t\t\tvar currentStencilMask = null;\n\t\t\tvar currentStencilFunc = null;\n\t\t\tvar currentStencilRef = null;\n\t\t\tvar currentStencilFuncMask = null;\n\t\t\tvar currentStencilFail = null;\n\t\t\tvar currentStencilZFail = null;\n\t\t\tvar currentStencilZPass = null;\n\t\t\tvar currentStencilClear = null;\n\n\t\t\treturn {\n\n\t\t\t\tsetTest: function ( stencilTest ) {\n\n\t\t\t\t\tif ( stencilTest ) {\n\n\t\t\t\t\t\tenable( gl.STENCIL_TEST );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tdisable( gl.STENCIL_TEST );\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetMask: function ( stencilMask ) {\n\n\t\t\t\t\tif ( currentStencilMask !== stencilMask && ! locked ) {\n\n\t\t\t\t\t\tgl.stencilMask( stencilMask );\n\t\t\t\t\t\tcurrentStencilMask = stencilMask;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetFunc: function ( stencilFunc, stencilRef, stencilMask ) {\n\n\t\t\t\t\tif ( currentStencilFunc !== stencilFunc ||\n\t\t\t\t\t currentStencilRef \t!== stencilRef \t||\n\t\t\t\t\t currentStencilFuncMask !== stencilMask ) {\n\n\t\t\t\t\t\tgl.stencilFunc( stencilFunc, stencilRef, stencilMask );\n\n\t\t\t\t\t\tcurrentStencilFunc = stencilFunc;\n\t\t\t\t\t\tcurrentStencilRef = stencilRef;\n\t\t\t\t\t\tcurrentStencilFuncMask = stencilMask;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetOp: function ( stencilFail, stencilZFail, stencilZPass ) {\n\n\t\t\t\t\tif ( currentStencilFail\t !== stencilFail \t||\n\t\t\t\t\t currentStencilZFail !== stencilZFail ||\n\t\t\t\t\t currentStencilZPass !== stencilZPass ) {\n\n\t\t\t\t\t\tgl.stencilOp( stencilFail, stencilZFail, stencilZPass );\n\n\t\t\t\t\t\tcurrentStencilFail = stencilFail;\n\t\t\t\t\t\tcurrentStencilZFail = stencilZFail;\n\t\t\t\t\t\tcurrentStencilZPass = stencilZPass;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\t\tlocked = lock;\n\n\t\t\t\t},\n\n\t\t\t\tsetClear: function ( stencil ) {\n\n\t\t\t\t\tif ( currentStencilClear !== stencil ) {\n\n\t\t\t\t\t\tgl.clearStencil( stencil );\n\t\t\t\t\t\tcurrentStencilClear = stencil;\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\treset: function () {\n\n\t\t\t\t\tlocked = false;\n\n\t\t\t\t\tcurrentStencilMask = null;\n\t\t\t\t\tcurrentStencilFunc = null;\n\t\t\t\t\tcurrentStencilRef = null;\n\t\t\t\t\tcurrentStencilFuncMask = null;\n\t\t\t\t\tcurrentStencilFail = null;\n\t\t\t\t\tcurrentStencilZFail = null;\n\t\t\t\t\tcurrentStencilZPass = null;\n\t\t\t\t\tcurrentStencilClear = null;\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}\n\n\t\t//\n\n\t\tvar colorBuffer = new ColorBuffer();\n\t\tvar depthBuffer = new DepthBuffer();\n\t\tvar stencilBuffer = new StencilBuffer();\n\n\t\tvar maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\t\tvar newAttributes = new Uint8Array( maxVertexAttributes );\n\t\tvar enabledAttributes = new Uint8Array( maxVertexAttributes );\n\t\tvar attributeDivisors = new Uint8Array( maxVertexAttributes );\n\n\t\tvar capabilities = {};\n\n\t\tvar compressedTextureFormats = null;\n\n\t\tvar currentBlending = null;\n\t\tvar currentBlendEquation = null;\n\t\tvar currentBlendSrc = null;\n\t\tvar currentBlendDst = null;\n\t\tvar currentBlendEquationAlpha = null;\n\t\tvar currentBlendSrcAlpha = null;\n\t\tvar currentBlendDstAlpha = null;\n\t\tvar currentPremultipledAlpha = false;\n\n\t\tvar currentFlipSided = null;\n\t\tvar currentCullFace = null;\n\n\t\tvar currentLineWidth = null;\n\n\t\tvar currentPolygonOffsetFactor = null;\n\t\tvar currentPolygonOffsetUnits = null;\n\n\t\tvar currentScissorTest = null;\n\n\t\tvar maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );\n\n\t\tvar currentTextureSlot = null;\n\t\tvar currentBoundTextures = {};\n\n\t\tvar currentScissor = new Vector4();\n\t\tvar currentViewport = new Vector4();\n\n\t\tfunction createTexture( type, target, count ) {\n\n\t\t\tvar data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.\n\t\t\tvar texture = gl.createTexture();\n\n\t\t\tgl.bindTexture( type, texture );\n\t\t\tgl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST );\n\t\t\tgl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST );\n\n\t\t\tfor ( var i = 0; i < count; i ++ ) {\n\n\t\t\t\tgl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );\n\n\t\t\t}\n\n\t\t\treturn texture;\n\n\t\t}\n\n\t\tvar emptyTextures = {};\n\t\temptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );\n\t\temptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );\n\n\t\t//\n\n\t\tfunction init() {\n\n\t\t\tclearColor( 0, 0, 0, 1 );\n\t\t\tclearDepth( 1 );\n\t\t\tclearStencil( 0 );\n\n\t\t\tenable( gl.DEPTH_TEST );\n\t\t\tsetDepthFunc( LessEqualDepth );\n\n\t\t\tsetFlipSided( false );\n\t\t\tsetCullFace( CullFaceBack );\n\t\t\tenable( gl.CULL_FACE );\n\n\t\t\tenable( gl.BLEND );\n\t\t\tsetBlending( NormalBlending );\n\n\t\t}\n\n\t\tfunction initAttributes() {\n\n\t\t\tfor ( var i = 0, l = newAttributes.length; i < l; i ++ ) {\n\n\t\t\t\tnewAttributes[ i ] = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction enableAttribute( attribute ) {\n\n\t\t\tnewAttributes[ attribute ] = 1;\n\n\t\t\tif ( enabledAttributes[ attribute ] === 0 ) {\n\n\t\t\t\tgl.enableVertexAttribArray( attribute );\n\t\t\t\tenabledAttributes[ attribute ] = 1;\n\n\t\t\t}\n\n\t\t\tif ( attributeDivisors[ attribute ] !== 0 ) {\n\n\t\t\t\tvar extension = extensions.get( 'ANGLE_instanced_arrays' );\n\n\t\t\t\textension.vertexAttribDivisorANGLE( attribute, 0 );\n\t\t\t\tattributeDivisors[ attribute ] = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction enableAttributeAndDivisor( attribute, meshPerAttribute, extension ) {\n\n\t\t\tnewAttributes[ attribute ] = 1;\n\n\t\t\tif ( enabledAttributes[ attribute ] === 0 ) {\n\n\t\t\t\tgl.enableVertexAttribArray( attribute );\n\t\t\t\tenabledAttributes[ attribute ] = 1;\n\n\t\t\t}\n\n\t\t\tif ( attributeDivisors[ attribute ] !== meshPerAttribute ) {\n\n\t\t\t\textension.vertexAttribDivisorANGLE( attribute, meshPerAttribute );\n\t\t\t\tattributeDivisors[ attribute ] = meshPerAttribute;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction disableUnusedAttributes() {\n\n\t\t\tfor ( var i = 0, l = enabledAttributes.length; i !== l; ++ i ) {\n\n\t\t\t\tif ( enabledAttributes[ i ] !== newAttributes[ i ] ) {\n\n\t\t\t\t\tgl.disableVertexAttribArray( i );\n\t\t\t\t\tenabledAttributes[ i ] = 0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction enable( id ) {\n\n\t\t\tif ( capabilities[ id ] !== true ) {\n\n\t\t\t\tgl.enable( id );\n\t\t\t\tcapabilities[ id ] = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction disable( id ) {\n\n\t\t\tif ( capabilities[ id ] !== false ) {\n\n\t\t\t\tgl.disable( id );\n\t\t\t\tcapabilities[ id ] = false;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getCompressedTextureFormats() {\n\n\t\t\tif ( compressedTextureFormats === null ) {\n\n\t\t\t\tcompressedTextureFormats = [];\n\n\t\t\t\tif ( extensions.get( 'WEBGL_compressed_texture_pvrtc' ) ||\n\t\t\t\t extensions.get( 'WEBGL_compressed_texture_s3tc' ) ||\n\t\t\t\t extensions.get( 'WEBGL_compressed_texture_etc1' ) ) {\n\n\t\t\t\t\tvar formats = gl.getParameter( gl.COMPRESSED_TEXTURE_FORMATS );\n\n\t\t\t\t\tfor ( var i = 0; i < formats.length; i ++ ) {\n\n\t\t\t\t\t\tcompressedTextureFormats.push( formats[ i ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn compressedTextureFormats;\n\n\t\t}\n\n\t\tfunction setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) {\n\n\t\t\tif ( blending !== NoBlending ) {\n\n\t\t\t\tenable( gl.BLEND );\n\n\t\t\t} else {\n\n\t\t\t\tdisable( gl.BLEND );\n\n\t\t\t}\n\n\t\t\tif ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) {\n\n\t\t\t\tif ( blending === AdditiveBlending ) {\n\n\t\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\t\tgl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFuncSeparate( gl.ONE, gl.ONE, gl.ONE, gl.ONE );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFunc( gl.SRC_ALPHA, gl.ONE );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( blending === SubtractiveBlending ) {\n\n\t\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\t\tgl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ONE_MINUS_SRC_ALPHA );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFunc( gl.ZERO, gl.ONE_MINUS_SRC_COLOR );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( blending === MultiplyBlending ) {\n\n\t\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\t\tgl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFunc( gl.ZERO, gl.SRC_COLOR );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\t\tgl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );\n\t\t\t\t\t\tgl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcurrentBlending = blending;\n\t\t\t\tcurrentPremultipledAlpha = premultipliedAlpha;\n\n\t\t\t}\n\n\t\t\tif ( blending === CustomBlending ) {\n\n\t\t\t\tblendEquationAlpha = blendEquationAlpha || blendEquation;\n\t\t\t\tblendSrcAlpha = blendSrcAlpha || blendSrc;\n\t\t\t\tblendDstAlpha = blendDstAlpha || blendDst;\n\n\t\t\t\tif ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) {\n\n\t\t\t\t\tgl.blendEquationSeparate( paramThreeToGL( blendEquation ), paramThreeToGL( blendEquationAlpha ) );\n\n\t\t\t\t\tcurrentBlendEquation = blendEquation;\n\t\t\t\t\tcurrentBlendEquationAlpha = blendEquationAlpha;\n\n\t\t\t\t}\n\n\t\t\t\tif ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) {\n\n\t\t\t\t\tgl.blendFuncSeparate( paramThreeToGL( blendSrc ), paramThreeToGL( blendDst ), paramThreeToGL( blendSrcAlpha ), paramThreeToGL( blendDstAlpha ) );\n\n\t\t\t\t\tcurrentBlendSrc = blendSrc;\n\t\t\t\t\tcurrentBlendDst = blendDst;\n\t\t\t\t\tcurrentBlendSrcAlpha = blendSrcAlpha;\n\t\t\t\t\tcurrentBlendDstAlpha = blendDstAlpha;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tcurrentBlendEquation = null;\n\t\t\t\tcurrentBlendSrc = null;\n\t\t\t\tcurrentBlendDst = null;\n\t\t\t\tcurrentBlendEquationAlpha = null;\n\t\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\t\tcurrentBlendDstAlpha = null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// TODO Deprecate\n\n\t\tfunction setColorWrite( colorWrite ) {\n\n\t\t\tcolorBuffer.setMask( colorWrite );\n\n\t\t}\n\n\t\tfunction setDepthTest( depthTest ) {\n\n\t\t\tdepthBuffer.setTest( depthTest );\n\n\t\t}\n\n\t\tfunction setDepthWrite( depthWrite ) {\n\n\t\t\tdepthBuffer.setMask( depthWrite );\n\n\t\t}\n\n\t\tfunction setDepthFunc( depthFunc ) {\n\n\t\t\tdepthBuffer.setFunc( depthFunc );\n\n\t\t}\n\n\t\tfunction setStencilTest( stencilTest ) {\n\n\t\t\tstencilBuffer.setTest( stencilTest );\n\n\t\t}\n\n\t\tfunction setStencilWrite( stencilWrite ) {\n\n\t\t\tstencilBuffer.setMask( stencilWrite );\n\n\t\t}\n\n\t\tfunction setStencilFunc( stencilFunc, stencilRef, stencilMask ) {\n\n\t\t\tstencilBuffer.setFunc( stencilFunc, stencilRef, stencilMask );\n\n\t\t}\n\n\t\tfunction setStencilOp( stencilFail, stencilZFail, stencilZPass ) {\n\n\t\t\tstencilBuffer.setOp( stencilFail, stencilZFail, stencilZPass );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction setFlipSided( flipSided ) {\n\n\t\t\tif ( currentFlipSided !== flipSided ) {\n\n\t\t\t\tif ( flipSided ) {\n\n\t\t\t\t\tgl.frontFace( gl.CW );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tgl.frontFace( gl.CCW );\n\n\t\t\t\t}\n\n\t\t\t\tcurrentFlipSided = flipSided;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction setCullFace( cullFace ) {\n\n\t\t\tif ( cullFace !== CullFaceNone ) {\n\n\t\t\t\tenable( gl.CULL_FACE );\n\n\t\t\t\tif ( cullFace !== currentCullFace ) {\n\n\t\t\t\t\tif ( cullFace === CullFaceBack ) {\n\n\t\t\t\t\t\tgl.cullFace( gl.BACK );\n\n\t\t\t\t\t} else if ( cullFace === CullFaceFront ) {\n\n\t\t\t\t\t\tgl.cullFace( gl.FRONT );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgl.cullFace( gl.FRONT_AND_BACK );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tdisable( gl.CULL_FACE );\n\n\t\t\t}\n\n\t\t\tcurrentCullFace = cullFace;\n\n\t\t}\n\n\t\tfunction setLineWidth( width ) {\n\n\t\t\tif ( width !== currentLineWidth ) {\n\n\t\t\t\tgl.lineWidth( width );\n\n\t\t\t\tcurrentLineWidth = width;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction setPolygonOffset( polygonOffset, factor, units ) {\n\n\t\t\tif ( polygonOffset ) {\n\n\t\t\t\tenable( gl.POLYGON_OFFSET_FILL );\n\n\t\t\t\tif ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) {\n\n\t\t\t\t\tgl.polygonOffset( factor, units );\n\n\t\t\t\t\tcurrentPolygonOffsetFactor = factor;\n\t\t\t\t\tcurrentPolygonOffsetUnits = units;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tdisable( gl.POLYGON_OFFSET_FILL );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getScissorTest() {\n\n\t\t\treturn currentScissorTest;\n\n\t\t}\n\n\t\tfunction setScissorTest( scissorTest ) {\n\n\t\t\tcurrentScissorTest = scissorTest;\n\n\t\t\tif ( scissorTest ) {\n\n\t\t\t\tenable( gl.SCISSOR_TEST );\n\n\t\t\t} else {\n\n\t\t\t\tdisable( gl.SCISSOR_TEST );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// texture\n\n\t\tfunction activeTexture( webglSlot ) {\n\n\t\t\tif ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\t\tgl.activeTexture( webglSlot );\n\t\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction bindTexture( webglType, webglTexture ) {\n\n\t\t\tif ( currentTextureSlot === null ) {\n\n\t\t\t\tactiveTexture();\n\n\t\t\t}\n\n\t\t\tvar boundTexture = currentBoundTextures[ currentTextureSlot ];\n\n\t\t\tif ( boundTexture === undefined ) {\n\n\t\t\t\tboundTexture = { type: undefined, texture: undefined };\n\t\t\t\tcurrentBoundTextures[ currentTextureSlot ] = boundTexture;\n\n\t\t\t}\n\n\t\t\tif ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) {\n\n\t\t\t\tgl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] );\n\n\t\t\t\tboundTexture.type = webglType;\n\t\t\t\tboundTexture.texture = webglTexture;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction compressedTexImage2D() {\n\n\t\t\ttry {\n\n\t\t\t\tgl.compressedTexImage2D.apply( gl, arguments );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tconsole.error( error );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction texImage2D() {\n\n\t\t\ttry {\n\n\t\t\t\tgl.texImage2D.apply( gl, arguments );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tconsole.error( error );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// TODO Deprecate\n\n\t\tfunction clearColor( r, g, b, a ) {\n\n\t\t\tcolorBuffer.setClear( r, g, b, a );\n\n\t\t}\n\n\t\tfunction clearDepth( depth ) {\n\n\t\t\tdepthBuffer.setClear( depth );\n\n\t\t}\n\n\t\tfunction clearStencil( stencil ) {\n\n\t\t\tstencilBuffer.setClear( stencil );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction scissor( scissor ) {\n\n\t\t\tif ( currentScissor.equals( scissor ) === false ) {\n\n\t\t\t\tgl.scissor( scissor.x, scissor.y, scissor.z, scissor.w );\n\t\t\t\tcurrentScissor.copy( scissor );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction viewport( viewport ) {\n\n\t\t\tif ( currentViewport.equals( viewport ) === false ) {\n\n\t\t\t\tgl.viewport( viewport.x, viewport.y, viewport.z, viewport.w );\n\t\t\t\tcurrentViewport.copy( viewport );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tfunction reset() {\n\n\t\t\tfor ( var i = 0; i < enabledAttributes.length; i ++ ) {\n\n\t\t\t\tif ( enabledAttributes[ i ] === 1 ) {\n\n\t\t\t\t\tgl.disableVertexAttribArray( i );\n\t\t\t\t\tenabledAttributes[ i ] = 0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tcapabilities = {};\n\n\t\t\tcompressedTextureFormats = null;\n\n\t\t\tcurrentTextureSlot = null;\n\t\t\tcurrentBoundTextures = {};\n\n\t\t\tcurrentBlending = null;\n\n\t\t\tcurrentFlipSided = null;\n\t\t\tcurrentCullFace = null;\n\n\t\t\tcolorBuffer.reset();\n\t\t\tdepthBuffer.reset();\n\t\t\tstencilBuffer.reset();\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tbuffers: {\n\t\t\t\tcolor: colorBuffer,\n\t\t\t\tdepth: depthBuffer,\n\t\t\t\tstencil: stencilBuffer\n\t\t\t},\n\n\t\t\tinit: init,\n\t\t\tinitAttributes: initAttributes,\n\t\t\tenableAttribute: enableAttribute,\n\t\t\tenableAttributeAndDivisor: enableAttributeAndDivisor,\n\t\t\tdisableUnusedAttributes: disableUnusedAttributes,\n\t\t\tenable: enable,\n\t\t\tdisable: disable,\n\t\t\tgetCompressedTextureFormats: getCompressedTextureFormats,\n\n\t\t\tsetBlending: setBlending,\n\n\t\t\tsetColorWrite: setColorWrite,\n\t\t\tsetDepthTest: setDepthTest,\n\t\t\tsetDepthWrite: setDepthWrite,\n\t\t\tsetDepthFunc: setDepthFunc,\n\t\t\tsetStencilTest: setStencilTest,\n\t\t\tsetStencilWrite: setStencilWrite,\n\t\t\tsetStencilFunc: setStencilFunc,\n\t\t\tsetStencilOp: setStencilOp,\n\n\t\t\tsetFlipSided: setFlipSided,\n\t\t\tsetCullFace: setCullFace,\n\n\t\t\tsetLineWidth: setLineWidth,\n\t\t\tsetPolygonOffset: setPolygonOffset,\n\n\t\t\tgetScissorTest: getScissorTest,\n\t\t\tsetScissorTest: setScissorTest,\n\n\t\t\tactiveTexture: activeTexture,\n\t\t\tbindTexture: bindTexture,\n\t\t\tcompressedTexImage2D: compressedTexImage2D,\n\t\t\ttexImage2D: texImage2D,\n\n\t\t\tclearColor: clearColor,\n\t\t\tclearDepth: clearDepth,\n\t\t\tclearStencil: clearStencil,\n\n\t\t\tscissor: scissor,\n\t\t\tviewport: viewport,\n\n\t\t\treset: reset\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLCapabilities( gl, extensions, parameters ) {\n\n\t\tvar maxAnisotropy;\n\n\t\tfunction getMaxAnisotropy() {\n\n\t\t\tif ( maxAnisotropy !== undefined ) return maxAnisotropy;\n\n\t\t\tvar extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tmaxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT );\n\n\t\t\t} else {\n\n\t\t\t\tmaxAnisotropy = 0;\n\n\t\t\t}\n\n\t\t\treturn maxAnisotropy;\n\n\t\t}\n\n\t\tfunction getMaxPrecision( precision ) {\n\n\t\t\tif ( precision === 'highp' ) {\n\n\t\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 &&\n\t\t\t\t gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) {\n\n\t\t\t\t\treturn 'highp';\n\n\t\t\t\t}\n\n\t\t\t\tprecision = 'mediump';\n\n\t\t\t}\n\n\t\t\tif ( precision === 'mediump' ) {\n\n\t\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 &&\n\t\t\t\t gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) {\n\n\t\t\t\t\treturn 'mediump';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn 'lowp';\n\n\t\t}\n\n\t\tvar precision = parameters.precision !== undefined ? parameters.precision : 'highp';\n\t\tvar maxPrecision = getMaxPrecision( precision );\n\n\t\tif ( maxPrecision !== precision ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );\n\t\t\tprecision = maxPrecision;\n\n\t\t}\n\n\t\tvar logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true && !! extensions.get( 'EXT_frag_depth' );\n\n\t\tvar maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );\n\t\tvar maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS );\n\t\tvar maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE );\n\t\tvar maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE );\n\n\t\tvar maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\t\tvar maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS );\n\t\tvar maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS );\n\t\tvar maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS );\n\n\t\tvar vertexTextures = maxVertexTextures > 0;\n\t\tvar floatFragmentTextures = !! extensions.get( 'OES_texture_float' );\n\t\tvar floatVertexTextures = vertexTextures && floatFragmentTextures;\n\n\t\treturn {\n\n\t\t\tgetMaxAnisotropy: getMaxAnisotropy,\n\t\t\tgetMaxPrecision: getMaxPrecision,\n\n\t\t\tprecision: precision,\n\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\n\t\t\tmaxTextures: maxTextures,\n\t\t\tmaxVertexTextures: maxVertexTextures,\n\t\t\tmaxTextureSize: maxTextureSize,\n\t\t\tmaxCubemapSize: maxCubemapSize,\n\n\t\t\tmaxAttributes: maxAttributes,\n\t\t\tmaxVertexUniforms: maxVertexUniforms,\n\t\t\tmaxVaryings: maxVaryings,\n\t\t\tmaxFragmentUniforms: maxFragmentUniforms,\n\n\t\t\tvertexTextures: vertexTextures,\n\t\t\tfloatFragmentTextures: floatFragmentTextures,\n\t\t\tfloatVertexTextures: floatVertexTextures\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebGLExtensions( gl ) {\n\n\t\tvar extensions = {};\n\n\t\treturn {\n\n\t\t\tget: function ( name ) {\n\n\t\t\t\tif ( extensions[ name ] !== undefined ) {\n\n\t\t\t\t\treturn extensions[ name ];\n\n\t\t\t\t}\n\n\t\t\t\tvar extension;\n\n\t\t\t\tswitch ( name ) {\n\n\t\t\t\t\tcase 'WEBGL_depth_texture':\n\t\t\t\t\t\textension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'EXT_texture_filter_anisotropic':\n\t\t\t\t\t\textension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'WEBGL_compressed_texture_s3tc':\n\t\t\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'WEBGL_compressed_texture_pvrtc':\n\t\t\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'WEBGL_compressed_texture_etc1':\n\t\t\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_etc1' );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\textension = gl.getExtension( name );\n\n\t\t\t\t}\n\n\t\t\t\tif ( extension === null ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' );\n\n\t\t\t\t}\n\n\t\t\t\textensions[ name ] = extension;\n\n\t\t\t\treturn extension;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t/**\n\t * @author tschw\n\t */\n\n\tfunction WebGLClipping() {\n\n\t\tvar scope = this,\n\n\t\t\tglobalState = null,\n\t\t\tnumGlobalPlanes = 0,\n\t\t\tlocalClippingEnabled = false,\n\t\t\trenderingShadows = false,\n\n\t\t\tplane = new Plane(),\n\t\t\tviewNormalMatrix = new Matrix3(),\n\n\t\t\tuniform = { value: null, needsUpdate: false };\n\n\t\tthis.uniform = uniform;\n\t\tthis.numPlanes = 0;\n\t\tthis.numIntersection = 0;\n\n\t\tthis.init = function( planes, enableLocalClipping, camera ) {\n\n\t\t\tvar enabled =\n\t\t\t\tplanes.length !== 0 ||\n\t\t\t\tenableLocalClipping ||\n\t\t\t\t// enable state of previous frame - the clipping code has to\n\t\t\t\t// run another frame in order to reset the state:\n\t\t\t\tnumGlobalPlanes !== 0 ||\n\t\t\t\tlocalClippingEnabled;\n\n\t\t\tlocalClippingEnabled = enableLocalClipping;\n\n\t\t\tglobalState = projectPlanes( planes, camera, 0 );\n\t\t\tnumGlobalPlanes = planes.length;\n\n\t\t\treturn enabled;\n\n\t\t};\n\n\t\tthis.beginShadows = function() {\n\n\t\t\trenderingShadows = true;\n\t\t\tprojectPlanes( null );\n\n\t\t};\n\n\t\tthis.endShadows = function() {\n\n\t\t\trenderingShadows = false;\n\t\t\tresetGlobalState();\n\n\t\t};\n\n\t\tthis.setState = function( planes, clipIntersection, clipShadows, camera, cache, fromCache ) {\n\n\t\t\tif ( ! localClippingEnabled ||\n\t\t\t\t\tplanes === null || planes.length === 0 ||\n\t\t\t\t\trenderingShadows && ! clipShadows ) {\n\t\t\t\t// there's no local clipping\n\n\t\t\t\tif ( renderingShadows ) {\n\t\t\t\t\t// there's no global clipping\n\n\t\t\t\t\tprojectPlanes( null );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tresetGlobalState();\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tvar nGlobal = renderingShadows ? 0 : numGlobalPlanes,\n\t\t\t\t\tlGlobal = nGlobal * 4,\n\n\t\t\t\t\tdstArray = cache.clippingState || null;\n\n\t\t\t\tuniform.value = dstArray; // ensure unique state\n\n\t\t\t\tdstArray = projectPlanes( planes, camera, lGlobal, fromCache );\n\n\t\t\t\tfor ( var i = 0; i !== lGlobal; ++ i ) {\n\n\t\t\t\t\tdstArray[ i ] = globalState[ i ];\n\n\t\t\t\t}\n\n\t\t\t\tcache.clippingState = dstArray;\n\t\t\t\tthis.numIntersection = clipIntersection ? this.numPlanes : 0;\n\t\t\t\tthis.numPlanes += nGlobal;\n\n\t\t\t}\n\n\n\t\t};\n\n\t\tfunction resetGlobalState() {\n\n\t\t\tif ( uniform.value !== globalState ) {\n\n\t\t\t\tuniform.value = globalState;\n\t\t\t\tuniform.needsUpdate = numGlobalPlanes > 0;\n\n\t\t\t}\n\n\t\t\tscope.numPlanes = numGlobalPlanes;\n\t\t\tscope.numIntersection = 0;\n\n\t\t}\n\n\t\tfunction projectPlanes( planes, camera, dstOffset, skipTransform ) {\n\n\t\t\tvar nPlanes = planes !== null ? planes.length : 0,\n\t\t\t\tdstArray = null;\n\n\t\t\tif ( nPlanes !== 0 ) {\n\n\t\t\t\tdstArray = uniform.value;\n\n\t\t\t\tif ( skipTransform !== true || dstArray === null ) {\n\n\t\t\t\t\tvar flatSize = dstOffset + nPlanes * 4,\n\t\t\t\t\t\tviewMatrix = camera.matrixWorldInverse;\n\n\t\t\t\t\tviewNormalMatrix.getNormalMatrix( viewMatrix );\n\n\t\t\t\t\tif ( dstArray === null || dstArray.length < flatSize ) {\n\n\t\t\t\t\t\tdstArray = new Float32Array( flatSize );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var i = 0, i4 = dstOffset;\n\t\t\t\t\t\t\t\t\t\ti !== nPlanes; ++ i, i4 += 4 ) {\n\n\t\t\t\t\t\tplane.copy( planes[ i ] ).\n\t\t\t\t\t\t\t\tapplyMatrix4( viewMatrix, viewNormalMatrix );\n\n\t\t\t\t\t\tplane.normal.toArray( dstArray, i4 );\n\t\t\t\t\t\tdstArray[ i4 + 3 ] = plane.constant;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tuniform.value = dstArray;\n\t\t\t\tuniform.needsUpdate = true;\n\n\t\t\t}\n\n\t\t\tscope.numPlanes = nPlanes;\n\t\t\t\n\t\t\treturn dstArray;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * @author supereggbert / http://www.paulbrunt.co.uk/\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author szimek / https://github.com/szimek/\n\t * @author tschw\n\t */\n\n\tfunction WebGLRenderer( parameters ) {\n\n\t\tconsole.log( 'THREE.WebGLRenderer', REVISION );\n\n\t\tparameters = parameters || {};\n\n\t\tvar _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ),\n\t\t_context = parameters.context !== undefined ? parameters.context : null,\n\n\t\t_alpha = parameters.alpha !== undefined ? parameters.alpha : false,\n\t\t_depth = parameters.depth !== undefined ? parameters.depth : true,\n\t\t_stencil = parameters.stencil !== undefined ? parameters.stencil : true,\n\t\t_antialias = parameters.antialias !== undefined ? parameters.antialias : false,\n\t\t_premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true,\n\t\t_preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false;\n\n\t\tvar lights = [];\n\n\t\tvar opaqueObjects = [];\n\t\tvar opaqueObjectsLastIndex = - 1;\n\t\tvar transparentObjects = [];\n\t\tvar transparentObjectsLastIndex = - 1;\n\n\t\tvar morphInfluences = new Float32Array( 8 );\n\n\t\tvar sprites = [];\n\t\tvar lensFlares = [];\n\n\t\t// public properties\n\n\t\tthis.domElement = _canvas;\n\t\tthis.context = null;\n\n\t\t// clearing\n\n\t\tthis.autoClear = true;\n\t\tthis.autoClearColor = true;\n\t\tthis.autoClearDepth = true;\n\t\tthis.autoClearStencil = true;\n\n\t\t// scene graph\n\n\t\tthis.sortObjects = true;\n\n\t\t// user-defined clipping\n\n\t\tthis.clippingPlanes = [];\n\t\tthis.localClippingEnabled = false;\n\n\t\t// physically based shading\n\n\t\tthis.gammaFactor = 2.0;\t// for backwards compatibility\n\t\tthis.gammaInput = false;\n\t\tthis.gammaOutput = false;\n\n\t\t// physical lights\n\n\t\tthis.physicallyCorrectLights = false;\n\n\t\t// tone mapping\n\n\t\tthis.toneMapping = LinearToneMapping;\n\t\tthis.toneMappingExposure = 1.0;\n\t\tthis.toneMappingWhitePoint = 1.0;\n\n\t\t// morphs\n\n\t\tthis.maxMorphTargets = 8;\n\t\tthis.maxMorphNormals = 4;\n\n\t\t// internal properties\n\n\t\tvar _this = this,\n\n\t\t// internal state cache\n\n\t\t_currentProgram = null,\n\t\t_currentRenderTarget = null,\n\t\t_currentFramebuffer = null,\n\t\t_currentMaterialId = - 1,\n\t\t_currentGeometryProgram = '',\n\t\t_currentCamera = null,\n\n\t\t_currentScissor = new Vector4(),\n\t\t_currentScissorTest = null,\n\n\t\t_currentViewport = new Vector4(),\n\n\t\t//\n\n\t\t_usedTextureUnits = 0,\n\n\t\t//\n\n\t\t_clearColor = new Color( 0x000000 ),\n\t\t_clearAlpha = 0,\n\n\t\t_width = _canvas.width,\n\t\t_height = _canvas.height,\n\n\t\t_pixelRatio = 1,\n\n\t\t_scissor = new Vector4( 0, 0, _width, _height ),\n\t\t_scissorTest = false,\n\n\t\t_viewport = new Vector4( 0, 0, _width, _height ),\n\n\t\t// frustum\n\n\t\t_frustum = new Frustum(),\n\n\t\t// clipping\n\n\t\t_clipping = new WebGLClipping(),\n\t\t_clippingEnabled = false,\n\t\t_localClippingEnabled = false,\n\n\t\t_sphere = new Sphere(),\n\n\t\t// camera matrices cache\n\n\t\t_projScreenMatrix = new Matrix4(),\n\n\t\t_vector3 = new Vector3(),\n\n\t\t// light arrays cache\n\n\t\t_lights = {\n\n\t\t\thash: '',\n\n\t\t\tambient: [ 0, 0, 0 ],\n\t\t\tdirectional: [],\n\t\t\tdirectionalShadowMap: [],\n\t\t\tdirectionalShadowMatrix: [],\n\t\t\tspot: [],\n\t\t\tspotShadowMap: [],\n\t\t\tspotShadowMatrix: [],\n\t\t\tpoint: [],\n\t\t\tpointShadowMap: [],\n\t\t\tpointShadowMatrix: [],\n\t\t\themi: [],\n\n\t\t\tshadows: []\n\n\t\t},\n\n\t\t// info\n\n\t\t_infoRender = {\n\n\t\t\tcalls: 0,\n\t\t\tvertices: 0,\n\t\t\tfaces: 0,\n\t\t\tpoints: 0\n\n\t\t};\n\n\t\tthis.info = {\n\n\t\t\trender: _infoRender,\n\t\t\tmemory: {\n\n\t\t\t\tgeometries: 0,\n\t\t\t\ttextures: 0\n\n\t\t\t},\n\t\t\tprograms: null\n\n\t\t};\n\n\n\t\t// initialize\n\n\t\tvar _gl;\n\n\t\ttry {\n\n\t\t\tvar attributes = {\n\t\t\t\talpha: _alpha,\n\t\t\t\tdepth: _depth,\n\t\t\t\tstencil: _stencil,\n\t\t\t\tantialias: _antialias,\n\t\t\t\tpremultipliedAlpha: _premultipliedAlpha,\n\t\t\t\tpreserveDrawingBuffer: _preserveDrawingBuffer\n\t\t\t};\n\n\t\t\t_gl = _context || _canvas.getContext( 'webgl', attributes ) || _canvas.getContext( 'experimental-webgl', attributes );\n\n\t\t\tif ( _gl === null ) {\n\n\t\t\t\tif ( _canvas.getContext( 'webgl' ) !== null ) {\n\n\t\t\t\t\tthrow 'Error creating WebGL context with your selected attributes.';\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow 'Error creating WebGL context.';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Some experimental-webgl implementations do not have getShaderPrecisionFormat\n\n\t\t\tif ( _gl.getShaderPrecisionFormat === undefined ) {\n\n\t\t\t\t_gl.getShaderPrecisionFormat = function () {\n\n\t\t\t\t\treturn { 'rangeMin': 1, 'rangeMax': 1, 'precision': 1 };\n\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\t_canvas.addEventListener( 'webglcontextlost', onContextLost, false );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: ' + error );\n\n\t\t}\n\n\t\tvar extensions = new WebGLExtensions( _gl );\n\n\t\textensions.get( 'WEBGL_depth_texture' );\n\t\textensions.get( 'OES_texture_float' );\n\t\textensions.get( 'OES_texture_float_linear' );\n\t\textensions.get( 'OES_texture_half_float' );\n\t\textensions.get( 'OES_texture_half_float_linear' );\n\t\textensions.get( 'OES_standard_derivatives' );\n\t\textensions.get( 'ANGLE_instanced_arrays' );\n\n\t\tif ( extensions.get( 'OES_element_index_uint' ) ) {\n\n\t\t\tBufferGeometry.MaxIndex = 4294967296;\n\n\t\t}\n\n\t\tvar capabilities = new WebGLCapabilities( _gl, extensions, parameters );\n\n\t\tvar state = new WebGLState( _gl, extensions, paramThreeToGL );\n\t\tvar properties = new WebGLProperties();\n\t\tvar textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, paramThreeToGL, this.info );\n\t\tvar objects = new WebGLObjects( _gl, properties, this.info );\n\t\tvar programCache = new WebGLPrograms( this, capabilities );\n\t\tvar lightCache = new WebGLLights();\n\n\t\tthis.info.programs = programCache.programs;\n\n\t\tvar bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender );\n\t\tvar indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender );\n\n\t\t//\n\n\t\tvar backgroundCamera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );\n\t\tvar backgroundCamera2 = new PerspectiveCamera();\n\t\tvar backgroundPlaneMesh = new Mesh(\n\t\t\tnew PlaneBufferGeometry( 2, 2 ),\n\t\t\tnew MeshBasicMaterial( { depthTest: false, depthWrite: false, fog: false } )\n\t\t);\n\t\tvar backgroundBoxShader = ShaderLib[ 'cube' ];\n\t\tvar backgroundBoxMesh = new Mesh(\n\t\t\tnew BoxBufferGeometry( 5, 5, 5 ),\n\t\t\tnew ShaderMaterial( {\n\t\t\t\tuniforms: backgroundBoxShader.uniforms,\n\t\t\t\tvertexShader: backgroundBoxShader.vertexShader,\n\t\t\t\tfragmentShader: backgroundBoxShader.fragmentShader,\n\t\t\t\tside: BackSide,\n\t\t\t\tdepthTest: false,\n\t\t\t\tdepthWrite: false,\n\t\t\t\tfog: false\n\t\t\t} )\n\t\t);\n\n\t\t//\n\n\t\tfunction getTargetPixelRatio() {\n\n\t\t\treturn _currentRenderTarget === null ? _pixelRatio : 1;\n\n\t\t}\n\n\t\tfunction glClearColor( r, g, b, a ) {\n\n\t\t\tif ( _premultipliedAlpha === true ) {\n\n\t\t\t\tr *= a; g *= a; b *= a;\n\n\t\t\t}\n\n\t\t\tstate.clearColor( r, g, b, a );\n\n\t\t}\n\n\t\tfunction setDefaultGLState() {\n\n\t\t\tstate.init();\n\n\t\t\tstate.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );\n\t\t\tstate.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );\n\n\t\t\tglClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha );\n\n\t\t}\n\n\t\tfunction resetGLState() {\n\n\t\t\t_currentProgram = null;\n\t\t\t_currentCamera = null;\n\n\t\t\t_currentGeometryProgram = '';\n\t\t\t_currentMaterialId = - 1;\n\n\t\t\tstate.reset();\n\n\t\t}\n\n\t\tsetDefaultGLState();\n\n\t\tthis.context = _gl;\n\t\tthis.capabilities = capabilities;\n\t\tthis.extensions = extensions;\n\t\tthis.properties = properties;\n\t\tthis.state = state;\n\n\t\t// shadow map\n\n\t\tvar shadowMap = new WebGLShadowMap( this, _lights, objects, capabilities );\n\n\t\tthis.shadowMap = shadowMap;\n\n\n\t\t// Plugins\n\n\t\tvar spritePlugin = new SpritePlugin( this, sprites );\n\t\tvar lensFlarePlugin = new LensFlarePlugin( this, lensFlares );\n\n\t\t// API\n\n\t\tthis.getContext = function () {\n\n\t\t\treturn _gl;\n\n\t\t};\n\n\t\tthis.getContextAttributes = function () {\n\n\t\t\treturn _gl.getContextAttributes();\n\n\t\t};\n\n\t\tthis.forceContextLoss = function () {\n\n\t\t\textensions.get( 'WEBGL_lose_context' ).loseContext();\n\n\t\t};\n\n\t\tthis.getMaxAnisotropy = function () {\n\n\t\t\treturn capabilities.getMaxAnisotropy();\n\n\t\t};\n\n\t\tthis.getPrecision = function () {\n\n\t\t\treturn capabilities.precision;\n\n\t\t};\n\n\t\tthis.getPixelRatio = function () {\n\n\t\t\treturn _pixelRatio;\n\n\t\t};\n\n\t\tthis.setPixelRatio = function ( value ) {\n\n\t\t\tif ( value === undefined ) return;\n\n\t\t\t_pixelRatio = value;\n\n\t\t\tthis.setSize( _viewport.z, _viewport.w, false );\n\n\t\t};\n\n\t\tthis.getSize = function () {\n\n\t\t\treturn {\n\t\t\t\twidth: _width,\n\t\t\t\theight: _height\n\t\t\t};\n\n\t\t};\n\n\t\tthis.setSize = function ( width, height, updateStyle ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_canvas.width = width * _pixelRatio;\n\t\t\t_canvas.height = height * _pixelRatio;\n\n\t\t\tif ( updateStyle !== false ) {\n\n\t\t\t\t_canvas.style.width = width + 'px';\n\t\t\t\t_canvas.style.height = height + 'px';\n\n\t\t\t}\n\n\t\t\tthis.setViewport( 0, 0, width, height );\n\n\t\t};\n\n\t\tthis.setViewport = function ( x, y, width, height ) {\n\n\t\t\tstate.viewport( _viewport.set( x, y, width, height ) );\n\n\t\t};\n\n\t\tthis.setScissor = function ( x, y, width, height ) {\n\n\t\t\tstate.scissor( _scissor.set( x, y, width, height ) );\n\n\t\t};\n\n\t\tthis.setScissorTest = function ( boolean ) {\n\n\t\t\tstate.setScissorTest( _scissorTest = boolean );\n\n\t\t};\n\n\t\t// Clearing\n\n\t\tthis.getClearColor = function () {\n\n\t\t\treturn _clearColor;\n\n\t\t};\n\n\t\tthis.setClearColor = function ( color, alpha ) {\n\n\t\t\t_clearColor.set( color );\n\n\t\t\t_clearAlpha = alpha !== undefined ? alpha : 1;\n\n\t\t\tglClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha );\n\n\t\t};\n\n\t\tthis.getClearAlpha = function () {\n\n\t\t\treturn _clearAlpha;\n\n\t\t};\n\n\t\tthis.setClearAlpha = function ( alpha ) {\n\n\t\t\t_clearAlpha = alpha;\n\n\t\t\tglClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha );\n\n\t\t};\n\n\t\tthis.clear = function ( color, depth, stencil ) {\n\n\t\t\tvar bits = 0;\n\n\t\t\tif ( color === undefined || color ) bits |= _gl.COLOR_BUFFER_BIT;\n\t\t\tif ( depth === undefined || depth ) bits |= _gl.DEPTH_BUFFER_BIT;\n\t\t\tif ( stencil === undefined || stencil ) bits |= _gl.STENCIL_BUFFER_BIT;\n\n\t\t\t_gl.clear( bits );\n\n\t\t};\n\n\t\tthis.clearColor = function () {\n\n\t\t\tthis.clear( true, false, false );\n\n\t\t};\n\n\t\tthis.clearDepth = function () {\n\n\t\t\tthis.clear( false, true, false );\n\n\t\t};\n\n\t\tthis.clearStencil = function () {\n\n\t\t\tthis.clear( false, false, true );\n\n\t\t};\n\n\t\tthis.clearTarget = function ( renderTarget, color, depth, stencil ) {\n\n\t\t\tthis.setRenderTarget( renderTarget );\n\t\t\tthis.clear( color, depth, stencil );\n\n\t\t};\n\n\t\t// Reset\n\n\t\tthis.resetGLState = resetGLState;\n\n\t\tthis.dispose = function() {\n\n\t\t\ttransparentObjects = [];\n\t\t\ttransparentObjectsLastIndex = -1;\n\t\t\topaqueObjects = [];\n\t\t\topaqueObjectsLastIndex = -1;\n\n\t\t\t_canvas.removeEventListener( 'webglcontextlost', onContextLost, false );\n\n\t\t};\n\n\t\t// Events\n\n\t\tfunction onContextLost( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tresetGLState();\n\t\t\tsetDefaultGLState();\n\n\t\t\tproperties.clear();\n\n\t\t}\n\n\t\tfunction onMaterialDispose( event ) {\n\n\t\t\tvar material = event.target;\n\n\t\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\t\tdeallocateMaterial( material );\n\n\t\t}\n\n\t\t// Buffer deallocation\n\n\t\tfunction deallocateMaterial( material ) {\n\n\t\t\treleaseMaterialProgramReference( material );\n\n\t\t\tproperties.delete( material );\n\n\t\t}\n\n\n\t\tfunction releaseMaterialProgramReference( material ) {\n\n\t\t\tvar programInfo = properties.get( material ).program;\n\n\t\t\tmaterial.program = undefined;\n\n\t\t\tif ( programInfo !== undefined ) {\n\n\t\t\t\tprogramCache.releaseProgram( programInfo );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Buffer rendering\n\n\t\tthis.renderBufferImmediate = function ( object, program, material ) {\n\n\t\t\tstate.initAttributes();\n\n\t\t\tvar buffers = properties.get( object );\n\n\t\t\tif ( object.hasPositions && ! buffers.position ) buffers.position = _gl.createBuffer();\n\t\t\tif ( object.hasNormals && ! buffers.normal ) buffers.normal = _gl.createBuffer();\n\t\t\tif ( object.hasUvs && ! buffers.uv ) buffers.uv = _gl.createBuffer();\n\t\t\tif ( object.hasColors && ! buffers.color ) buffers.color = _gl.createBuffer();\n\n\t\t\tvar attributes = program.getAttributes();\n\n\t\t\tif ( object.hasPositions ) {\n\n\t\t\t\t_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.position );\n\t\t\t\t_gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW );\n\n\t\t\t\tstate.enableAttribute( attributes.position );\n\t\t\t\t_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );\n\n\t\t\t}\n\n\t\t\tif ( object.hasNormals ) {\n\n\t\t\t\t_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal );\n\n\t\t\t\tif ( ! material.isMeshPhongMaterial &&\n\t\t\t\t ! material.isMeshStandardMaterial &&\n\t\t\t\t material.shading === FlatShading ) {\n\n\t\t\t\t\tfor ( var i = 0, l = object.count * 3; i < l; i += 9 ) {\n\n\t\t\t\t\t\tvar array = object.normalArray;\n\n\t\t\t\t\t\tvar nx = ( array[ i + 0 ] + array[ i + 3 ] + array[ i + 6 ] ) / 3;\n\t\t\t\t\t\tvar ny = ( array[ i + 1 ] + array[ i + 4 ] + array[ i + 7 ] ) / 3;\n\t\t\t\t\t\tvar nz = ( array[ i + 2 ] + array[ i + 5 ] + array[ i + 8 ] ) / 3;\n\n\t\t\t\t\t\tarray[ i + 0 ] = nx;\n\t\t\t\t\t\tarray[ i + 1 ] = ny;\n\t\t\t\t\t\tarray[ i + 2 ] = nz;\n\n\t\t\t\t\t\tarray[ i + 3 ] = nx;\n\t\t\t\t\t\tarray[ i + 4 ] = ny;\n\t\t\t\t\t\tarray[ i + 5 ] = nz;\n\n\t\t\t\t\t\tarray[ i + 6 ] = nx;\n\t\t\t\t\t\tarray[ i + 7 ] = ny;\n\t\t\t\t\t\tarray[ i + 8 ] = nz;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t_gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW );\n\n\t\t\t\tstate.enableAttribute( attributes.normal );\n\n\t\t\t\t_gl.vertexAttribPointer( attributes.normal, 3, _gl.FLOAT, false, 0, 0 );\n\n\t\t\t}\n\n\t\t\tif ( object.hasUvs && material.map ) {\n\n\t\t\t\t_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.uv );\n\t\t\t\t_gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW );\n\n\t\t\t\tstate.enableAttribute( attributes.uv );\n\n\t\t\t\t_gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 );\n\n\t\t\t}\n\n\t\t\tif ( object.hasColors && material.vertexColors !== NoColors ) {\n\n\t\t\t\t_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.color );\n\t\t\t\t_gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW );\n\n\t\t\t\tstate.enableAttribute( attributes.color );\n\n\t\t\t\t_gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 );\n\n\t\t\t}\n\n\t\t\tstate.disableUnusedAttributes();\n\n\t\t\t_gl.drawArrays( _gl.TRIANGLES, 0, object.count );\n\n\t\t\tobject.count = 0;\n\n\t\t};\n\n\t\tthis.renderBufferDirect = function ( camera, fog, geometry, material, object, group ) {\n\n\t\t\tsetMaterial( material );\n\n\t\t\tvar program = setProgram( camera, fog, material, object );\n\n\t\t\tvar updateBuffers = false;\n\t\t\tvar geometryProgram = geometry.id + '_' + program.id + '_' + material.wireframe;\n\n\t\t\tif ( geometryProgram !== _currentGeometryProgram ) {\n\n\t\t\t\t_currentGeometryProgram = geometryProgram;\n\t\t\t\tupdateBuffers = true;\n\n\t\t\t}\n\n\t\t\t// morph targets\n\n\t\t\tvar morphTargetInfluences = object.morphTargetInfluences;\n\n\t\t\tif ( morphTargetInfluences !== undefined ) {\n\n\t\t\t\tvar activeInfluences = [];\n\n\t\t\t\tfor ( var i = 0, l = morphTargetInfluences.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar influence = morphTargetInfluences[ i ];\n\t\t\t\t\tactiveInfluences.push( [ influence, i ] );\n\n\t\t\t\t}\n\n\t\t\t\tactiveInfluences.sort( absNumericalSort );\n\n\t\t\t\tif ( activeInfluences.length > 8 ) {\n\n\t\t\t\t\tactiveInfluences.length = 8;\n\n\t\t\t\t}\n\n\t\t\t\tvar morphAttributes = geometry.morphAttributes;\n\n\t\t\t\tfor ( var i = 0, l = activeInfluences.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar influence = activeInfluences[ i ];\n\t\t\t\t\tmorphInfluences[ i ] = influence[ 0 ];\n\n\t\t\t\t\tif ( influence[ 0 ] !== 0 ) {\n\n\t\t\t\t\t\tvar index = influence[ 1 ];\n\n\t\t\t\t\t\tif ( material.morphTargets === true && morphAttributes.position ) geometry.addAttribute( 'morphTarget' + i, morphAttributes.position[ index ] );\n\t\t\t\t\t\tif ( material.morphNormals === true && morphAttributes.normal ) geometry.addAttribute( 'morphNormal' + i, morphAttributes.normal[ index ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( material.morphTargets === true ) geometry.removeAttribute( 'morphTarget' + i );\n\t\t\t\t\t\tif ( material.morphNormals === true ) geometry.removeAttribute( 'morphNormal' + i );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var i = activeInfluences.length, il = morphInfluences.length; i < il; i ++ ) {\n\n\t\t\t\t\tmorphInfluences[ i ] = 0.0;\n\n\t\t\t\t}\n\n\t\t\t\tprogram.getUniforms().setValue(\n\t\t\t\t\t\t_gl, 'morphTargetInfluences', morphInfluences );\n\n\t\t\t\tupdateBuffers = true;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tvar index = geometry.index;\n\t\t\tvar position = geometry.attributes.position;\n\t\t\tvar rangeFactor = 1;\n\n\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\tindex = objects.getWireframeAttribute( geometry );\n\t\t\t\trangeFactor = 2;\n\n\t\t\t}\n\n\t\t\tvar renderer;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\trenderer = indexedBufferRenderer;\n\t\t\t\trenderer.setIndex( index );\n\n\t\t\t} else {\n\n\t\t\t\trenderer = bufferRenderer;\n\n\t\t\t}\n\n\t\t\tif ( updateBuffers ) {\n\n\t\t\t\tsetupVertexAttributes( material, program, geometry );\n\n\t\t\t\tif ( index !== null ) {\n\n\t\t\t\t\t_gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, objects.getAttributeBuffer( index ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tvar dataCount = 0;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tdataCount = index.count;\n\n\t\t\t} else if ( position !== undefined ) {\n\n\t\t\t\tdataCount = position.count;\n\n\t\t\t}\n\n\t\t\tvar rangeStart = geometry.drawRange.start * rangeFactor;\n\t\t\tvar rangeCount = geometry.drawRange.count * rangeFactor;\n\n\t\t\tvar groupStart = group !== null ? group.start * rangeFactor : 0;\n\t\t\tvar groupCount = group !== null ? group.count * rangeFactor : Infinity;\n\n\t\t\tvar drawStart = Math.max( rangeStart, groupStart );\n\t\t\tvar drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1;\n\n\t\t\tvar drawCount = Math.max( 0, drawEnd - drawStart + 1 );\n\n\t\t\tif ( drawCount === 0 ) return;\n\n\t\t\t//\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\t\tstate.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() );\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tswitch ( object.drawMode ) {\n\n\t\t\t\t\t\tcase TrianglesDrawMode:\n\t\t\t\t\t\t\trenderer.setMode( _gl.TRIANGLES );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase TriangleStripDrawMode:\n\t\t\t\t\t\t\trenderer.setMode( _gl.TRIANGLE_STRIP );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase TriangleFanDrawMode:\n\t\t\t\t\t\t\trenderer.setMode( _gl.TRIANGLE_FAN );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t} else if ( object.isLine ) {\n\n\t\t\t\tvar lineWidth = material.linewidth;\n\n\t\t\t\tif ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material\n\n\t\t\t\tstate.setLineWidth( lineWidth * getTargetPixelRatio() );\n\n\t\t\t\tif ( object.isLineSegments ) {\n\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setMode( _gl.LINE_STRIP );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isPoints ) {\n\n\t\t\t\trenderer.setMode( _gl.POINTS );\n\n\t\t\t}\n\n\t\t\tif ( geometry && geometry.isInstancedBufferGeometry ) {\n\n\t\t\t\tif ( geometry.maxInstancedCount > 0 ) {\n\n\t\t\t\t\trenderer.renderInstances( geometry, drawStart, drawCount );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderer.render( drawStart, drawCount );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction setupVertexAttributes( material, program, geometry, startIndex ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( geometry && geometry.isInstancedBufferGeometry ) {\n\n\t\t\t\textension = extensions.get( 'ANGLE_instanced_arrays' );\n\n\t\t\t\tif ( extension === null ) {\n\n\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( startIndex === undefined ) startIndex = 0;\n\n\t\t\tstate.initAttributes();\n\n\t\t\tvar geometryAttributes = geometry.attributes;\n\n\t\t\tvar programAttributes = program.getAttributes();\n\n\t\t\tvar materialDefaultAttributeValues = material.defaultAttributeValues;\n\n\t\t\tfor ( var name in programAttributes ) {\n\n\t\t\t\tvar programAttribute = programAttributes[ name ];\n\n\t\t\t\tif ( programAttribute >= 0 ) {\n\n\t\t\t\t\tvar geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\t\tif ( geometryAttribute !== undefined ) {\n\n\t\t\t\t\t\tvar type = _gl.FLOAT;\n\t\t\t\t\t\tvar array = geometryAttribute.array;\n\t\t\t\t\t\tvar normalized = geometryAttribute.normalized;\n\n\t\t\t\t\t\tif ( array instanceof Float32Array ) {\n\n\t\t\t\t\t\t\ttype = _gl.FLOAT;\n\n\t\t\t\t\t\t} else if ( array instanceof Float64Array ) {\n\n\t\t\t\t\t\t\tconsole.warn( \"Unsupported data buffer format: Float64Array\" );\n\n\t\t\t\t\t\t} else if ( array instanceof Uint16Array ) {\n\n\t\t\t\t\t\t\ttype = _gl.UNSIGNED_SHORT;\n\n\t\t\t\t\t\t} else if ( array instanceof Int16Array ) {\n\n\t\t\t\t\t\t\ttype = _gl.SHORT;\n\n\t\t\t\t\t\t} else if ( array instanceof Uint32Array ) {\n\n\t\t\t\t\t\t\ttype = _gl.UNSIGNED_INT;\n\n\t\t\t\t\t\t} else if ( array instanceof Int32Array ) {\n\n\t\t\t\t\t\t\ttype = _gl.INT;\n\n\t\t\t\t\t\t} else if ( array instanceof Int8Array ) {\n\n\t\t\t\t\t\t\ttype = _gl.BYTE;\n\n\t\t\t\t\t\t} else if ( array instanceof Uint8Array ) {\n\n\t\t\t\t\t\t\ttype = _gl.UNSIGNED_BYTE;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar size = geometryAttribute.itemSize;\n\t\t\t\t\t\tvar buffer = objects.getAttributeBuffer( geometryAttribute );\n\n\t\t\t\t\t\tif ( geometryAttribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\t\tvar data = geometryAttribute.data;\n\t\t\t\t\t\t\tvar stride = data.stride;\n\t\t\t\t\t\t\tvar offset = geometryAttribute.offset;\n\n\t\t\t\t\t\t\tif ( data && data.isInstancedInterleavedBuffer ) {\n\n\t\t\t\t\t\t\t\tstate.enableAttributeAndDivisor( programAttribute, data.meshPerAttribute, extension );\n\n\t\t\t\t\t\t\t\tif ( geometry.maxInstancedCount === undefined ) {\n\n\t\t\t\t\t\t\t\t\tgeometry.maxInstancedCount = data.meshPerAttribute * data.count;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.enableAttribute( programAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_gl.bindBuffer( _gl.ARRAY_BUFFER, buffer );\n\t\t\t\t\t\t\t_gl.vertexAttribPointer( programAttribute, size, type, normalized, stride * data.array.BYTES_PER_ELEMENT, ( startIndex * stride + offset ) * data.array.BYTES_PER_ELEMENT );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( geometryAttribute.isInstancedBufferAttribute ) {\n\n\t\t\t\t\t\t\t\tstate.enableAttributeAndDivisor( programAttribute, geometryAttribute.meshPerAttribute, extension );\n\n\t\t\t\t\t\t\t\tif ( geometry.maxInstancedCount === undefined ) {\n\n\t\t\t\t\t\t\t\t\tgeometry.maxInstancedCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.enableAttribute( programAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_gl.bindBuffer( _gl.ARRAY_BUFFER, buffer );\n\t\t\t\t\t\t\t_gl.vertexAttribPointer( programAttribute, size, type, normalized, 0, startIndex * size * geometryAttribute.array.BYTES_PER_ELEMENT );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( materialDefaultAttributeValues !== undefined ) {\n\n\t\t\t\t\t\tvar value = materialDefaultAttributeValues[ name ];\n\n\t\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\t\tswitch ( value.length ) {\n\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t_gl.vertexAttrib2fv( programAttribute, value );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t_gl.vertexAttrib3fv( programAttribute, value );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\t_gl.vertexAttrib4fv( programAttribute, value );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t_gl.vertexAttrib1fv( programAttribute, value );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.disableUnusedAttributes();\n\n\t\t}\n\n\t\t// Sorting\n\n\t\tfunction absNumericalSort( a, b ) {\n\n\t\t\treturn Math.abs( b[ 0 ] ) - Math.abs( a[ 0 ] );\n\n\t\t}\n\n\t\tfunction painterSortStable( a, b ) {\n\n\t\t\tif ( a.object.renderOrder !== b.object.renderOrder ) {\n\n\t\t\t\treturn a.object.renderOrder - b.object.renderOrder;\n\n\t\t\t} else if ( a.material.program && b.material.program && a.material.program !== b.material.program ) {\n\n\t\t\t\treturn a.material.program.id - b.material.program.id;\n\n\t\t\t} else if ( a.material.id !== b.material.id ) {\n\n\t\t\t\treturn a.material.id - b.material.id;\n\n\t\t\t} else if ( a.z !== b.z ) {\n\n\t\t\t\treturn a.z - b.z;\n\n\t\t\t} else {\n\n\t\t\t\treturn a.id - b.id;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction reversePainterSortStable( a, b ) {\n\n\t\t\tif ( a.object.renderOrder !== b.object.renderOrder ) {\n\n\t\t\t\treturn a.object.renderOrder - b.object.renderOrder;\n\n\t\t\t} if ( a.z !== b.z ) {\n\n\t\t\t\treturn b.z - a.z;\n\n\t\t\t} else {\n\n\t\t\t\treturn a.id - b.id;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Rendering\n\n\t\tthis.render = function ( scene, camera, renderTarget, forceClear ) {\n\n\t\t\tif ( camera !== undefined && camera.isCamera !== true ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// reset caching for this frame\n\n\t\t\t_currentGeometryProgram = '';\n\t\t\t_currentMaterialId = - 1;\n\t\t\t_currentCamera = null;\n\n\t\t\t// update scene graph\n\n\t\t\tif ( scene.autoUpdate === true ) scene.updateMatrixWorld();\n\n\t\t\t// update camera matrices and frustum\n\n\t\t\tif ( camera.parent === null ) camera.updateMatrixWorld();\n\n\t\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\n\t\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\t\t_frustum.setFromMatrix( _projScreenMatrix );\n\n\t\t\tlights.length = 0;\n\n\t\t\topaqueObjectsLastIndex = - 1;\n\t\t\ttransparentObjectsLastIndex = - 1;\n\n\t\t\tsprites.length = 0;\n\t\t\tlensFlares.length = 0;\n\n\t\t\t_localClippingEnabled = this.localClippingEnabled;\n\t\t\t_clippingEnabled = _clipping.init( this.clippingPlanes, _localClippingEnabled, camera );\n\n\t\t\tprojectObject( scene, camera );\n\n\t\t\topaqueObjects.length = opaqueObjectsLastIndex + 1;\n\t\t\ttransparentObjects.length = transparentObjectsLastIndex + 1;\n\n\t\t\tif ( _this.sortObjects === true ) {\n\n\t\t\t\topaqueObjects.sort( painterSortStable );\n\t\t\t\ttransparentObjects.sort( reversePainterSortStable );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( _clippingEnabled ) _clipping.beginShadows();\n\n\t\t\tsetupShadows( lights );\n\n\t\t\tshadowMap.render( scene, camera );\n\n\t\t\tsetupLights( lights, camera );\n\n\t\t\tif ( _clippingEnabled ) _clipping.endShadows();\n\n\t\t\t//\n\n\t\t\t_infoRender.calls = 0;\n\t\t\t_infoRender.vertices = 0;\n\t\t\t_infoRender.faces = 0;\n\t\t\t_infoRender.points = 0;\n\n\t\t\tif ( renderTarget === undefined ) {\n\n\t\t\t\trenderTarget = null;\n\n\t\t\t}\n\n\t\t\tthis.setRenderTarget( renderTarget );\n\n\t\t\t//\n\n\t\t\tvar background = scene.background;\n\n\t\t\tif ( background === null ) {\n\n\t\t\t\tglClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha );\n\n\t\t\t} else if ( background && background.isColor ) {\n\n\t\t\t\tglClearColor( background.r, background.g, background.b, 1 );\n\t\t\t\tforceClear = true;\n\n\t\t\t}\n\n\t\t\tif ( this.autoClear || forceClear ) {\n\n\t\t\t\tthis.clear( this.autoClearColor, this.autoClearDepth, this.autoClearStencil );\n\n\t\t\t}\n\n\t\t\tif ( background && background.isCubeTexture ) {\n\n\t\t\t\tbackgroundCamera2.projectionMatrix.copy( camera.projectionMatrix );\n\n\t\t\t\tbackgroundCamera2.matrixWorld.extractRotation( camera.matrixWorld );\n\t\t\t\tbackgroundCamera2.matrixWorldInverse.getInverse( backgroundCamera2.matrixWorld );\n\n\t\t\t\tbackgroundBoxMesh.material.uniforms[ \"tCube\" ].value = background;\n\t\t\t\tbackgroundBoxMesh.modelViewMatrix.multiplyMatrices( backgroundCamera2.matrixWorldInverse, backgroundBoxMesh.matrixWorld );\n\n\t\t\t\tobjects.update( backgroundBoxMesh );\n\n\t\t\t\t_this.renderBufferDirect( backgroundCamera2, null, backgroundBoxMesh.geometry, backgroundBoxMesh.material, backgroundBoxMesh, null );\n\n\t\t\t} else if ( background && background.isTexture ) {\n\n\t\t\t\tbackgroundPlaneMesh.material.map = background;\n\n\t\t\t\tobjects.update( backgroundPlaneMesh );\n\n\t\t\t\t_this.renderBufferDirect( backgroundCamera, null, backgroundPlaneMesh.geometry, backgroundPlaneMesh.material, backgroundPlaneMesh, null );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( scene.overrideMaterial ) {\n\n\t\t\t\tvar overrideMaterial = scene.overrideMaterial;\n\n\t\t\t\trenderObjects( opaqueObjects, scene, camera, overrideMaterial );\n\t\t\t\trenderObjects( transparentObjects, scene, camera, overrideMaterial );\n\n\t\t\t} else {\n\n\t\t\t\t// opaque pass (front-to-back order)\n\n\t\t\t\tstate.setBlending( NoBlending );\n\t\t\t\trenderObjects( opaqueObjects, scene, camera );\n\n\t\t\t\t// transparent pass (back-to-front order)\n\n\t\t\t\trenderObjects( transparentObjects, scene, camera );\n\n\t\t\t}\n\n\t\t\t// custom render plugins (post pass)\n\n\t\t\tspritePlugin.render( scene, camera );\n\t\t\tlensFlarePlugin.render( scene, camera, _currentViewport );\n\n\t\t\t// Generate mipmap if we're using any kind of mipmap filtering\n\n\t\t\tif ( renderTarget ) {\n\n\t\t\t\ttextures.updateRenderTargetMipmap( renderTarget );\n\n\t\t\t}\n\n\t\t\t// Ensure depth buffer writing is enabled so it can be cleared on next render\n\n\t\t\tstate.setDepthTest( true );\n\t\t\tstate.setDepthWrite( true );\n\t\t\tstate.setColorWrite( true );\n\n\t\t\t// _gl.finish();\n\n\t\t};\n\n\t\tfunction pushRenderItem( object, geometry, material, z, group ) {\n\n\t\t\tvar array, index;\n\n\t\t\t// allocate the next position in the appropriate array\n\n\t\t\tif ( material.transparent ) {\n\n\t\t\t\tarray = transparentObjects;\n\t\t\t\tindex = ++ transparentObjectsLastIndex;\n\n\t\t\t} else {\n\n\t\t\t\tarray = opaqueObjects;\n\t\t\t\tindex = ++ opaqueObjectsLastIndex;\n\n\t\t\t}\n\n\t\t\t// recycle existing render item or grow the array\n\n\t\t\tvar renderItem = array[ index ];\n\n\t\t\tif ( renderItem !== undefined ) {\n\n\t\t\t\trenderItem.id = object.id;\n\t\t\t\trenderItem.object = object;\n\t\t\t\trenderItem.geometry = geometry;\n\t\t\t\trenderItem.material = material;\n\t\t\t\trenderItem.z = _vector3.z;\n\t\t\t\trenderItem.group = group;\n\n\t\t\t} else {\n\n\t\t\t\trenderItem = {\n\t\t\t\t\tid: object.id,\n\t\t\t\t\tobject: object,\n\t\t\t\t\tgeometry: geometry,\n\t\t\t\t\tmaterial: material,\n\t\t\t\t\tz: _vector3.z,\n\t\t\t\t\tgroup: group\n\t\t\t\t};\n\n\t\t\t\t// assert( index === array.length );\n\t\t\t\tarray.push( renderItem );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// TODO Duplicated code (Frustum)\n\n\t\tfunction isObjectViewable( object ) {\n\n\t\t\tvar geometry = object.geometry;\n\n\t\t\tif ( geometry.boundingSphere === null )\n\t\t\t\tgeometry.computeBoundingSphere();\n\n\t\t\t_sphere.copy( geometry.boundingSphere ).\n\t\t\t\tapplyMatrix4( object.matrixWorld );\n\n\t\t\treturn isSphereViewable( _sphere );\n\n\t\t}\n\n\t\tfunction isSpriteViewable( sprite ) {\n\n\t\t\t_sphere.center.set( 0, 0, 0 );\n\t\t\t_sphere.radius = 0.7071067811865476;\n\t\t\t_sphere.applyMatrix4( sprite.matrixWorld );\n\n\t\t\treturn isSphereViewable( _sphere );\n\n\t\t}\n\n\t\tfunction isSphereViewable( sphere ) {\n\n\t\t\tif ( ! _frustum.intersectsSphere( sphere ) ) return false;\n\n\t\t\tvar numPlanes = _clipping.numPlanes;\n\n\t\t\tif ( numPlanes === 0 ) return true;\n\n\t\t\tvar planes = _this.clippingPlanes,\n\n\t\t\t\tcenter = sphere.center,\n\t\t\t\tnegRad = - sphere.radius,\n\t\t\t\ti = 0;\n\n\t\t\tdo {\n\n\t\t\t\t// out when deeper than radius in the negative halfspace\n\t\t\t\tif ( planes[ i ].distanceToPoint( center ) < negRad ) return false;\n\n\t\t\t} while ( ++ i !== numPlanes );\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tfunction projectObject( object, camera ) {\n\n\t\t\tif ( object.visible === false ) return;\n\n\t\t\tvar visible = ( object.layers.mask & camera.layers.mask ) !== 0;\n\n\t\t\tif ( visible ) {\n\n\t\t\t\tif ( object.isLight ) {\n\n\t\t\t\t\tlights.push( object );\n\n\t\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\t\tif ( object.frustumCulled === false || isSpriteViewable( object ) === true ) {\n\n\t\t\t\t\t\tsprites.push( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( object.isLensFlare ) {\n\n\t\t\t\t\tlensFlares.push( object );\n\n\t\t\t\t} else if ( object.isImmediateRenderObject ) {\n\n\t\t\t\t\tif ( _this.sortObjects === true ) {\n\n\t\t\t\t\t\t_vector3.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t\t\t_vector3.applyProjection( _projScreenMatrix );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tpushRenderItem( object, null, object.material, _vector3.z, null );\n\n\t\t\t\t} else if ( object.isMesh || object.isLine || object.isPoints ) {\n\n\t\t\t\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\t\t\t\tobject.skeleton.update();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( object.frustumCulled === false || isObjectViewable( object ) === true ) {\n\n\t\t\t\t\t\tvar material = object.material;\n\n\t\t\t\t\t\tif ( material.visible === true ) {\n\n\t\t\t\t\t\t\tif ( _this.sortObjects === true ) {\n\n\t\t\t\t\t\t\t\t_vector3.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t\t\t\t\t_vector3.applyProjection( _projScreenMatrix );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar geometry = objects.update( object );\n\n\t\t\t\t\t\t\tif ( material.isMultiMaterial ) {\n\n\t\t\t\t\t\t\t\tvar groups = geometry.groups;\n\t\t\t\t\t\t\t\tvar materials = material.materials;\n\n\t\t\t\t\t\t\t\tfor ( var i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t\t\t\tvar group = groups[ i ];\n\t\t\t\t\t\t\t\t\tvar groupMaterial = materials[ group.materialIndex ];\n\n\t\t\t\t\t\t\t\t\tif ( groupMaterial.visible === true ) {\n\n\t\t\t\t\t\t\t\t\t\tpushRenderItem( object, geometry, groupMaterial, _vector3.z, group );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tpushRenderItem( object, geometry, material, _vector3.z, null );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar children = object.children;\n\n\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tprojectObject( children[ i ], camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObjects( renderList, scene, camera, overrideMaterial ) {\n\n\t\t\tfor ( var i = 0, l = renderList.length; i < l; i ++ ) {\n\n\t\t\t\tvar renderItem = renderList[ i ];\n\n\t\t\t\tvar object = renderItem.object;\n\t\t\t\tvar geometry = renderItem.geometry;\n\t\t\t\tvar material = overrideMaterial === undefined ? renderItem.material : overrideMaterial;\n\t\t\t\tvar group = renderItem.group;\n\n\t\t\t\tobject.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );\n\t\t\t\tobject.normalMatrix.getNormalMatrix( object.modelViewMatrix );\n\n\t\t\t\tobject.onBeforeRender( _this, scene, camera, geometry, material, group );\n\n\t\t\t\tif ( object.isImmediateRenderObject ) {\n\n\t\t\t\t\tsetMaterial( material );\n\n\t\t\t\t\tvar program = setProgram( camera, scene.fog, material, object );\n\n\t\t\t\t\t_currentGeometryProgram = '';\n\n\t\t\t\t\tobject.render( function ( object ) {\n\n\t\t\t\t\t\t_this.renderBufferImmediate( object, program, material );\n\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_this.renderBufferDirect( camera, scene.fog, geometry, material, object, group );\n\n\t\t\t\t}\n\n\t\t\t\tobject.onAfterRender( _this, scene, camera, geometry, material, group );\n\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction initMaterial( material, fog, object ) {\n\n\t\t\tvar materialProperties = properties.get( material );\n\n\t\t\tvar parameters = programCache.getParameters(\n\t\t\t\t\tmaterial, _lights, fog, _clipping.numPlanes, _clipping.numIntersection, object );\n\n\t\t\tvar code = programCache.getProgramCode( material, parameters );\n\n\t\t\tvar program = materialProperties.program;\n\t\t\tvar programChange = true;\n\n\t\t\tif ( program === undefined ) {\n\n\t\t\t\t// new material\n\t\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\t} else if ( program.code !== code ) {\n\n\t\t\t\t// changed glsl or parameters\n\t\t\t\treleaseMaterialProgramReference( material );\n\n\t\t\t} else if ( parameters.shaderID !== undefined ) {\n\n\t\t\t\t// same glsl and uniform list\n\t\t\t\treturn;\n\n\t\t\t} else {\n\n\t\t\t\t// only rebuild uniform list\n\t\t\t\tprogramChange = false;\n\n\t\t\t}\n\n\t\t\tif ( programChange ) {\n\n\t\t\t\tif ( parameters.shaderID ) {\n\n\t\t\t\t\tvar shader = ShaderLib[ parameters.shaderID ];\n\n\t\t\t\t\tmaterialProperties.__webglShader = {\n\t\t\t\t\t\tname: material.type,\n\t\t\t\t\t\tuniforms: UniformsUtils.clone( shader.uniforms ),\n\t\t\t\t\t\tvertexShader: shader.vertexShader,\n\t\t\t\t\t\tfragmentShader: shader.fragmentShader\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmaterialProperties.__webglShader = {\n\t\t\t\t\t\tname: material.type,\n\t\t\t\t\t\tuniforms: material.uniforms,\n\t\t\t\t\t\tvertexShader: material.vertexShader,\n\t\t\t\t\t\tfragmentShader: material.fragmentShader\n\t\t\t\t\t};\n\n\t\t\t\t}\n\n\t\t\t\tmaterial.__webglShader = materialProperties.__webglShader;\n\n\t\t\t\tprogram = programCache.acquireProgram( material, parameters, code );\n\n\t\t\t\tmaterialProperties.program = program;\n\t\t\t\tmaterial.program = program;\n\n\t\t\t}\n\n\t\t\tvar attributes = program.getAttributes();\n\n\t\t\tif ( material.morphTargets ) {\n\n\t\t\t\tmaterial.numSupportedMorphTargets = 0;\n\n\t\t\t\tfor ( var i = 0; i < _this.maxMorphTargets; i ++ ) {\n\n\t\t\t\t\tif ( attributes[ 'morphTarget' + i ] >= 0 ) {\n\n\t\t\t\t\t\tmaterial.numSupportedMorphTargets ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( material.morphNormals ) {\n\n\t\t\t\tmaterial.numSupportedMorphNormals = 0;\n\n\t\t\t\tfor ( var i = 0; i < _this.maxMorphNormals; i ++ ) {\n\n\t\t\t\t\tif ( attributes[ 'morphNormal' + i ] >= 0 ) {\n\n\t\t\t\t\t\tmaterial.numSupportedMorphNormals ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar uniforms = materialProperties.__webglShader.uniforms;\n\n\t\t\tif ( ! material.isShaderMaterial &&\n\t\t\t ! material.isRawShaderMaterial ||\n\t\t\t material.clipping === true ) {\n\n\t\t\t\tmaterialProperties.numClippingPlanes = _clipping.numPlanes;\n\t\t\t\tmaterialProperties.numIntersection = _clipping.numIntersection;\n\t\t\t\tuniforms.clippingPlanes = _clipping.uniform;\n\n\t\t\t}\n\n\t\t\tmaterialProperties.fog = fog;\n\n\t\t\t// store the light setup it was created for\n\n\t\t\tmaterialProperties.lightsHash = _lights.hash;\n\n\t\t\tif ( material.lights ) {\n\n\t\t\t\t// wire up the material to this renderer's lighting state\n\n\t\t\t\tuniforms.ambientLightColor.value = _lights.ambient;\n\t\t\t\tuniforms.directionalLights.value = _lights.directional;\n\t\t\t\tuniforms.spotLights.value = _lights.spot;\n\t\t\t\tuniforms.pointLights.value = _lights.point;\n\t\t\t\tuniforms.hemisphereLights.value = _lights.hemi;\n\n\t\t\t\tuniforms.directionalShadowMap.value = _lights.directionalShadowMap;\n\t\t\t\tuniforms.directionalShadowMatrix.value = _lights.directionalShadowMatrix;\n\t\t\t\tuniforms.spotShadowMap.value = _lights.spotShadowMap;\n\t\t\t\tuniforms.spotShadowMatrix.value = _lights.spotShadowMatrix;\n\t\t\t\tuniforms.pointShadowMap.value = _lights.pointShadowMap;\n\t\t\t\tuniforms.pointShadowMatrix.value = _lights.pointShadowMatrix;\n\n\t\t\t}\n\n\t\t\tvar progUniforms = materialProperties.program.getUniforms(),\n\t\t\t\tuniformsList =\n\t\t\t\t\t\tWebGLUniforms.seqWithValue( progUniforms.seq, uniforms );\n\n\t\t\tmaterialProperties.uniformsList = uniformsList;\n\n\t\t}\n\n\t\tfunction setMaterial( material ) {\n\n\t\t\tmaterial.side === DoubleSide\n\t\t\t\t? state.disable( _gl.CULL_FACE )\n\t\t\t\t: state.enable( _gl.CULL_FACE );\n\n\t\t\tstate.setFlipSided( material.side === BackSide );\n\n\t\t\tmaterial.transparent === true\n\t\t\t\t? state.setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha )\n\t\t\t\t: state.setBlending( NoBlending );\n\n\t\t\tstate.setDepthFunc( material.depthFunc );\n\t\t\tstate.setDepthTest( material.depthTest );\n\t\t\tstate.setDepthWrite( material.depthWrite );\n\t\t\tstate.setColorWrite( material.colorWrite );\n\t\t\tstate.setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );\n\n\t\t}\n\n\t\tfunction setProgram( camera, fog, material, object ) {\n\n\t\t\t_usedTextureUnits = 0;\n\n\t\t\tvar materialProperties = properties.get( material );\n\n\t\t\tif ( _clippingEnabled ) {\n\n\t\t\t\tif ( _localClippingEnabled || camera !== _currentCamera ) {\n\n\t\t\t\t\tvar useCache =\n\t\t\t\t\t\t\tcamera === _currentCamera &&\n\t\t\t\t\t\t\tmaterial.id === _currentMaterialId;\n\n\t\t\t\t\t// we might want to call this function with some ClippingGroup\n\t\t\t\t\t// object instead of the material, once it becomes feasible\n\t\t\t\t\t// (#8465, #8379)\n\t\t\t\t\t_clipping.setState(\n\t\t\t\t\t\t\tmaterial.clippingPlanes, material.clipIntersection, material.clipShadows,\n\t\t\t\t\t\t\tcamera, materialProperties, useCache );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( material.needsUpdate === false ) {\n\n\t\t\t\tif ( materialProperties.program === undefined ) {\n\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t} else if ( material.fog && materialProperties.fog !== fog ) {\n\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t} else if ( material.lights && materialProperties.lightsHash !== _lights.hash ) {\n\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t} else if ( materialProperties.numClippingPlanes !== undefined &&\n\t\t\t\t\t( materialProperties.numClippingPlanes !== _clipping.numPlanes || \n\t \t\t\t\t materialProperties.numIntersection !== _clipping.numIntersection ) ) {\n\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( material.needsUpdate ) {\n\n\t\t\t\tinitMaterial( material, fog, object );\n\t\t\t\tmaterial.needsUpdate = false;\n\n\t\t\t}\n\n\t\t\tvar refreshProgram = false;\n\t\t\tvar refreshMaterial = false;\n\t\t\tvar refreshLights = false;\n\n\t\t\tvar program = materialProperties.program,\n\t\t\t\tp_uniforms = program.getUniforms(),\n\t\t\t\tm_uniforms = materialProperties.__webglShader.uniforms;\n\n\t\t\tif ( program.id !== _currentProgram ) {\n\n\t\t\t\t_gl.useProgram( program.program );\n\t\t\t\t_currentProgram = program.id;\n\n\t\t\t\trefreshProgram = true;\n\t\t\t\trefreshMaterial = true;\n\t\t\t\trefreshLights = true;\n\n\t\t\t}\n\n\t\t\tif ( material.id !== _currentMaterialId ) {\n\n\t\t\t\t_currentMaterialId = material.id;\n\n\t\t\t\trefreshMaterial = true;\n\n\t\t\t}\n\n\t\t\tif ( refreshProgram || camera !== _currentCamera ) {\n\n\t\t\t\tp_uniforms.set( _gl, camera, 'projectionMatrix' );\n\n\t\t\t\tif ( capabilities.logarithmicDepthBuffer ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'logDepthBufFC',\n\t\t\t\t\t\t\t2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );\n\n\t\t\t\t}\n\n\n\t\t\t\tif ( camera !== _currentCamera ) {\n\n\t\t\t\t\t_currentCamera = camera;\n\n\t\t\t\t\t// lighting uniforms depend on the camera so enforce an update\n\t\t\t\t\t// now, in case this material supports lights - or later, when\n\t\t\t\t\t// the next material that does gets activated:\n\n\t\t\t\t\trefreshMaterial = true;\t\t// set to true on material change\n\t\t\t\t\trefreshLights = true;\t\t// remains set until update done\n\n\t\t\t\t}\n\n\t\t\t\t// load material specific uniforms\n\t\t\t\t// (shader material also gets them for the sake of genericity)\n\n\t\t\t\tif ( material.isShaderMaterial ||\n\t\t\t\t material.isMeshPhongMaterial ||\n\t\t\t\t material.isMeshStandardMaterial ||\n\t\t\t\t material.envMap ) {\n\n\t\t\t\t\tvar uCamPos = p_uniforms.map.cameraPosition;\n\n\t\t\t\t\tif ( uCamPos !== undefined ) {\n\n\t\t\t\t\t\tuCamPos.setValue( _gl,\n\t\t\t\t\t\t\t\t_vector3.setFromMatrixPosition( camera.matrixWorld ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( material.isMeshPhongMaterial ||\n\t\t\t\t material.isMeshLambertMaterial ||\n\t\t\t\t material.isMeshBasicMaterial ||\n\t\t\t\t material.isMeshStandardMaterial ||\n\t\t\t\t material.isShaderMaterial ||\n\t\t\t\t material.skinning ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );\n\n\t\t\t\t}\n\n\t\t\t\tp_uniforms.set( _gl, _this, 'toneMappingExposure' );\n\t\t\t\tp_uniforms.set( _gl, _this, 'toneMappingWhitePoint' );\n\n\t\t\t}\n\n\t\t\t// skinning uniforms must be set even if material didn't change\n\t\t\t// auto-setting of texture unit for bone texture must go before other textures\n\t\t\t// not sure why, but otherwise weird things happen\n\n\t\t\tif ( material.skinning ) {\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrix' );\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );\n\n\t\t\t\tvar skeleton = object.skeleton;\n\n\t\t\t\tif ( skeleton ) {\n\n\t\t\t\t\tif ( capabilities.floatVertexTextures && skeleton.useVertexTexture ) {\n\n\t\t\t\t\t\tp_uniforms.set( _gl, skeleton, 'boneTexture' );\n\t\t\t\t\t\tp_uniforms.set( _gl, skeleton, 'boneTextureWidth' );\n\t\t\t\t\t\tp_uniforms.set( _gl, skeleton, 'boneTextureHeight' );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp_uniforms.setOptional( _gl, skeleton, 'boneMatrices' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( refreshMaterial ) {\n\n\t\t\t\tif ( material.lights ) {\n\n\t\t\t\t\t// the current material requires lighting info\n\n\t\t\t\t\t// note: all lighting uniforms are always set correctly\n\t\t\t\t\t// they simply reference the renderer's state for their\n\t\t\t\t\t// values\n\t\t\t\t\t//\n\t\t\t\t\t// use the current material's .needsUpdate flags to set\n\t\t\t\t\t// the GL state when required\n\n\t\t\t\t\tmarkUniformsLightsNeedsUpdate( m_uniforms, refreshLights );\n\n\t\t\t\t}\n\n\t\t\t\t// refresh uniforms common to several materials\n\n\t\t\t\tif ( fog && material.fog ) {\n\n\t\t\t\t\trefreshUniformsFog( m_uniforms, fog );\n\n\t\t\t\t}\n\n\t\t\t\tif ( material.isMeshBasicMaterial ||\n\t\t\t\t material.isMeshLambertMaterial ||\n\t\t\t\t material.isMeshPhongMaterial ||\n\t\t\t\t material.isMeshStandardMaterial ||\n\t\t\t\t material.isMeshDepthMaterial ) {\n\n\t\t\t\t\trefreshUniformsCommon( m_uniforms, material );\n\n\t\t\t\t}\n\n\t\t\t\t// refresh single material specific uniforms\n\n\t\t\t\tif ( material.isLineBasicMaterial ) {\n\n\t\t\t\t\trefreshUniformsLine( m_uniforms, material );\n\n\t\t\t\t} else if ( material.isLineDashedMaterial ) {\n\n\t\t\t\t\trefreshUniformsLine( m_uniforms, material );\n\t\t\t\t\trefreshUniformsDash( m_uniforms, material );\n\n\t\t\t\t} else if ( material.isPointsMaterial ) {\n\n\t\t\t\t\trefreshUniformsPoints( m_uniforms, material );\n\n\t\t\t\t} else if ( material.isMeshLambertMaterial ) {\n\n\t\t\t\t\trefreshUniformsLambert( m_uniforms, material );\n\n\t\t\t\t} else if ( material.isMeshPhongMaterial ) {\n\n\t\t\t\t\trefreshUniformsPhong( m_uniforms, material );\n\n\t\t\t\t} else if ( material.isMeshPhysicalMaterial ) {\n\n\t\t\t\t\trefreshUniformsPhysical( m_uniforms, material );\n\n\t\t\t\t} else if ( material.isMeshStandardMaterial ) {\n\n\t\t\t\t\trefreshUniformsStandard( m_uniforms, material );\n\n\t\t\t\t} else if ( material.isMeshDepthMaterial ) {\n\n\t\t\t\t\tif ( material.displacementMap ) {\n\n\t\t\t\t\t\tm_uniforms.displacementMap.value = material.displacementMap;\n\t\t\t\t\t\tm_uniforms.displacementScale.value = material.displacementScale;\n\t\t\t\t\t\tm_uniforms.displacementBias.value = material.displacementBias;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( material.isMeshNormalMaterial ) {\n\n\t\t\t\t\tm_uniforms.opacity.value = material.opacity;\n\n\t\t\t\t}\n\n\t\t\t\tWebGLUniforms.upload(\n\t\t\t\t\t\t_gl, materialProperties.uniformsList, m_uniforms, _this );\n\n\t\t\t}\n\n\n\t\t\t// common matrices\n\n\t\t\tp_uniforms.set( _gl, object, 'modelViewMatrix' );\n\t\t\tp_uniforms.set( _gl, object, 'normalMatrix' );\n\t\t\tp_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\t// Uniforms (refresh uniforms objects)\n\n\t\tfunction refreshUniformsCommon( uniforms, material ) {\n\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t\tuniforms.diffuse.value = material.color;\n\n\t\t\tif ( material.emissive ) {\n\n\t\t\t\tuniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );\n\n\t\t\t}\n\n\t\t\tuniforms.map.value = material.map;\n\t\t\tuniforms.specularMap.value = material.specularMap;\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\tif ( material.aoMap ) {\n\n\t\t\t\tuniforms.aoMap.value = material.aoMap;\n\t\t\t\tuniforms.aoMapIntensity.value = material.aoMapIntensity;\n\n\t\t\t}\n\n\t\t\t// uv repeat and offset setting priorities\n\t\t\t// 1. color map\n\t\t\t// 2. specular map\n\t\t\t// 3. normal map\n\t\t\t// 4. bump map\n\t\t\t// 5. alpha map\n\t\t\t// 6. emissive map\n\n\t\t\tvar uvScaleMap;\n\n\t\t\tif ( material.map ) {\n\n\t\t\t\tuvScaleMap = material.map;\n\n\t\t\t} else if ( material.specularMap ) {\n\n\t\t\t\tuvScaleMap = material.specularMap;\n\n\t\t\t} else if ( material.displacementMap ) {\n\n\t\t\t\tuvScaleMap = material.displacementMap;\n\n\t\t\t} else if ( material.normalMap ) {\n\n\t\t\t\tuvScaleMap = material.normalMap;\n\n\t\t\t} else if ( material.bumpMap ) {\n\n\t\t\t\tuvScaleMap = material.bumpMap;\n\n\t\t\t} else if ( material.roughnessMap ) {\n\n\t\t\t\tuvScaleMap = material.roughnessMap;\n\n\t\t\t} else if ( material.metalnessMap ) {\n\n\t\t\t\tuvScaleMap = material.metalnessMap;\n\n\t\t\t} else if ( material.alphaMap ) {\n\n\t\t\t\tuvScaleMap = material.alphaMap;\n\n\t\t\t} else if ( material.emissiveMap ) {\n\n\t\t\t\tuvScaleMap = material.emissiveMap;\n\n\t\t\t}\n\n\t\t\tif ( uvScaleMap !== undefined ) {\n\n\t\t\t\t// backwards compatibility\n\t\t\t\tif ( uvScaleMap.isWebGLRenderTarget ) {\n\n\t\t\t\t\tuvScaleMap = uvScaleMap.texture;\n\n\t\t\t\t}\n\n\t\t\t\tvar offset = uvScaleMap.offset;\n\t\t\t\tvar repeat = uvScaleMap.repeat;\n\n\t\t\t\tuniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );\n\n\t\t\t}\n\n\t\t\tuniforms.envMap.value = material.envMap;\n\n\t\t\t// don't flip CubeTexture envMaps, flip everything else:\n\t\t\t// WebGLRenderTargetCube will be flipped for backwards compatibility\n\t\t\t// WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture\n\t\t\t// this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future\n\t\t\tuniforms.flipEnvMap.value = ( ! ( material.envMap && material.envMap.isCubeTexture ) ) ? 1 : - 1;\n\n\t\t\tuniforms.reflectivity.value = material.reflectivity;\n\t\t\tuniforms.refractionRatio.value = material.refractionRatio;\n\n\t\t}\n\n\t\tfunction refreshUniformsLine( uniforms, material ) {\n\n\t\t\tuniforms.diffuse.value = material.color;\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t}\n\n\t\tfunction refreshUniformsDash( uniforms, material ) {\n\n\t\t\tuniforms.dashSize.value = material.dashSize;\n\t\t\tuniforms.totalSize.value = material.dashSize + material.gapSize;\n\t\t\tuniforms.scale.value = material.scale;\n\n\t\t}\n\n\t\tfunction refreshUniformsPoints( uniforms, material ) {\n\n\t\t\tuniforms.diffuse.value = material.color;\n\t\t\tuniforms.opacity.value = material.opacity;\n\t\t\tuniforms.size.value = material.size * _pixelRatio;\n\t\t\tuniforms.scale.value = _height * 0.5;\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\tif ( material.map !== null ) {\n\n\t\t\t\tvar offset = material.map.offset;\n\t\t\t\tvar repeat = material.map.repeat;\n\n\t\t\t\tuniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction refreshUniformsFog( uniforms, fog ) {\n\n\t\t\tuniforms.fogColor.value = fog.color;\n\n\t\t\tif ( fog.isFog ) {\n\n\t\t\t\tuniforms.fogNear.value = fog.near;\n\t\t\t\tuniforms.fogFar.value = fog.far;\n\n\t\t\t} else if ( fog.isFogExp2 ) {\n\n\t\t\t\tuniforms.fogDensity.value = fog.density;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction refreshUniformsLambert( uniforms, material ) {\n\n\t\t\tif ( material.lightMap ) {\n\n\t\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\n\t\t\t}\n\n\t\t\tif ( material.emissiveMap ) {\n\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction refreshUniformsPhong( uniforms, material ) {\n\n\t\t\tuniforms.specular.value = material.specular;\n\t\t\tuniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )\n\n\t\t\tif ( material.lightMap ) {\n\n\t\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\n\t\t\t}\n\n\t\t\tif ( material.emissiveMap ) {\n\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t\t}\n\n\t\t\tif ( material.bumpMap ) {\n\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\n\t\t\t}\n\n\t\t\tif ( material.normalMap ) {\n\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\n\t\t\t}\n\n\t\t\tif ( material.displacementMap ) {\n\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction refreshUniformsStandard( uniforms, material ) {\n\n\t\t\tuniforms.roughness.value = material.roughness;\n\t\t\tuniforms.metalness.value = material.metalness;\n\n\t\t\tif ( material.roughnessMap ) {\n\n\t\t\t\tuniforms.roughnessMap.value = material.roughnessMap;\n\n\t\t\t}\n\n\t\t\tif ( material.metalnessMap ) {\n\n\t\t\t\tuniforms.metalnessMap.value = material.metalnessMap;\n\n\t\t\t}\n\n\t\t\tif ( material.lightMap ) {\n\n\t\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\n\t\t\t}\n\n\t\t\tif ( material.emissiveMap ) {\n\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t\t}\n\n\t\t\tif ( material.bumpMap ) {\n\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\n\t\t\t}\n\n\t\t\tif ( material.normalMap ) {\n\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\n\t\t\t}\n\n\t\t\tif ( material.displacementMap ) {\n\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t\t}\n\n\t\t\tif ( material.envMap ) {\n\n\t\t\t\t//uniforms.envMap.value = material.envMap; // part of uniforms common\n\t\t\t\tuniforms.envMapIntensity.value = material.envMapIntensity;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction refreshUniformsPhysical( uniforms, material ) {\n\n\t\t\tuniforms.clearCoat.value = material.clearCoat;\n\t\t\tuniforms.clearCoatRoughness.value = material.clearCoatRoughness;\n\n\t\t\trefreshUniformsStandard( uniforms, material );\n\n\t\t}\n\n\t\t// If uniforms are marked as clean, they don't need to be loaded to the GPU.\n\n\t\tfunction markUniformsLightsNeedsUpdate( uniforms, value ) {\n\n\t\t\tuniforms.ambientLightColor.needsUpdate = value;\n\n\t\t\tuniforms.directionalLights.needsUpdate = value;\n\t\t\tuniforms.pointLights.needsUpdate = value;\n\t\t\tuniforms.spotLights.needsUpdate = value;\n\t\t\tuniforms.hemisphereLights.needsUpdate = value;\n\n\t\t}\n\n\t\t// Lighting\n\n\t\tfunction setupShadows( lights ) {\n\n\t\t\tvar lightShadowsLength = 0;\n\n\t\t\tfor ( var i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\t\tvar light = lights[ i ];\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\t_lights.shadows[ lightShadowsLength ++ ] = light;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_lights.shadows.length = lightShadowsLength;\n\n\t\t}\n\n\t\tfunction setupLights( lights, camera ) {\n\n\t\t\tvar l, ll, light,\n\t\t\tr = 0, g = 0, b = 0,\n\t\t\tcolor,\n\t\t\tintensity,\n\t\t\tdistance,\n\t\t\tshadowMap,\n\n\t\t\tviewMatrix = camera.matrixWorldInverse,\n\n\t\t\tdirectionalLength = 0,\n\t\t\tpointLength = 0,\n\t\t\tspotLength = 0,\n\t\t\themiLength = 0;\n\n\t\t\tfor ( l = 0, ll = lights.length; l < ll; l ++ ) {\n\n\t\t\t\tlight = lights[ l ];\n\n\t\t\t\tcolor = light.color;\n\t\t\t\tintensity = light.intensity;\n\t\t\t\tdistance = light.distance;\n\n\t\t\t\tshadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null;\n\n\t\t\t\tif ( light.isAmbientLight ) {\n\n\t\t\t\t\tr += color.r * intensity;\n\t\t\t\t\tg += color.g * intensity;\n\t\t\t\t\tb += color.b * intensity;\n\n\t\t\t\t} else if ( light.isDirectionalLight ) {\n\n\t\t\t\t\tvar uniforms = lightCache.get( light );\n\n\t\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity );\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\t_vector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\t\tuniforms.direction.sub( _vector3 );\n\t\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\t\tuniforms.shadow = light.castShadow;\n\n\t\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\t\tuniforms.shadowBias = light.shadow.bias;\n\t\t\t\t\t\tuniforms.shadowRadius = light.shadow.radius;\n\t\t\t\t\t\tuniforms.shadowMapSize = light.shadow.mapSize;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_lights.directionalShadowMap[ directionalLength ] = shadowMap;\n\t\t\t\t\t_lights.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix;\n\t\t\t\t\t_lights.directional[ directionalLength ++ ] = uniforms;\n\n\t\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\t\tvar uniforms = lightCache.get( light );\n\n\t\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity );\n\t\t\t\t\tuniforms.distance = distance;\n\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\t_vector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\t\tuniforms.direction.sub( _vector3 );\n\t\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\t\tuniforms.coneCos = Math.cos( light.angle );\n\t\t\t\t\tuniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) );\n\t\t\t\t\tuniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay;\n\n\t\t\t\t\tuniforms.shadow = light.castShadow;\n\n\t\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\t\tuniforms.shadowBias = light.shadow.bias;\n\t\t\t\t\t\tuniforms.shadowRadius = light.shadow.radius;\n\t\t\t\t\t\tuniforms.shadowMapSize = light.shadow.mapSize;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_lights.spotShadowMap[ spotLength ] = shadowMap;\n\t\t\t\t\t_lights.spotShadowMatrix[ spotLength ] = light.shadow.matrix;\n\t\t\t\t\t_lights.spot[ spotLength ++ ] = uniforms;\n\n\t\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\t\tvar uniforms = lightCache.get( light );\n\n\t\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity );\n\t\t\t\t\tuniforms.distance = light.distance;\n\t\t\t\t\tuniforms.decay = ( light.distance === 0 ) ? 0.0 : light.decay;\n\n\t\t\t\t\tuniforms.shadow = light.castShadow;\n\n\t\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\t\tuniforms.shadowBias = light.shadow.bias;\n\t\t\t\t\t\tuniforms.shadowRadius = light.shadow.radius;\n\t\t\t\t\t\tuniforms.shadowMapSize = light.shadow.mapSize;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_lights.pointShadowMap[ pointLength ] = shadowMap;\n\n\t\t\t\t\tif ( _lights.pointShadowMatrix[ pointLength ] === undefined ) {\n\n\t\t\t\t\t\t_lights.pointShadowMatrix[ pointLength ] = new Matrix4();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// for point lights we set the shadow matrix to be a translation-only matrix\n\t\t\t\t\t// equal to inverse of the light's position\n\t\t\t\t\t_vector3.setFromMatrixPosition( light.matrixWorld ).negate();\n\t\t\t\t\t_lights.pointShadowMatrix[ pointLength ].identity().setPosition( _vector3 );\n\n\t\t\t\t\t_lights.point[ pointLength ++ ] = uniforms;\n\n\t\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\t\tvar uniforms = lightCache.get( light );\n\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\t\t\t\t\tuniforms.direction.normalize();\n\n\t\t\t\t\tuniforms.skyColor.copy( light.color ).multiplyScalar( intensity );\n\t\t\t\t\tuniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity );\n\n\t\t\t\t\t_lights.hemi[ hemiLength ++ ] = uniforms;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_lights.ambient[ 0 ] = r;\n\t\t\t_lights.ambient[ 1 ] = g;\n\t\t\t_lights.ambient[ 2 ] = b;\n\n\t\t\t_lights.directional.length = directionalLength;\n\t\t\t_lights.spot.length = spotLength;\n\t\t\t_lights.point.length = pointLength;\n\t\t\t_lights.hemi.length = hemiLength;\n\n\t\t\t_lights.hash = directionalLength + ',' + pointLength + ',' + spotLength + ',' + hemiLength + ',' + _lights.shadows.length;\n\n\t\t}\n\n\t\t// GL state setting\n\n\t\tthis.setFaceCulling = function ( cullFace, frontFaceDirection ) {\n\n\t\t\tstate.setCullFace( cullFace );\n\t\t\tstate.setFlipSided( frontFaceDirection === FrontFaceDirectionCW );\n\n\t\t};\n\n\t\t// Textures\n\n\t\tfunction allocTextureUnit() {\n\n\t\t\tvar textureUnit = _usedTextureUnits;\n\n\t\t\tif ( textureUnit >= capabilities.maxTextures ) {\n\n\t\t\t\tconsole.warn( 'WebGLRenderer: trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures );\n\n\t\t\t}\n\n\t\t\t_usedTextureUnits += 1;\n\n\t\t\treturn textureUnit;\n\n\t\t}\n\n\t\tthis.allocTextureUnit = allocTextureUnit;\n\n\t\t// this.setTexture2D = setTexture2D;\n\t\tthis.setTexture2D = ( function() {\n\n\t\t\tvar warned = false;\n\n\t\t\t// backwards compatibility: peel texture.texture\n\t\t\treturn function setTexture2D( texture, slot ) {\n\n\t\t\t\tif ( texture && texture.isWebGLRenderTarget ) {\n\n\t\t\t\t\tif ( ! warned ) {\n\n\t\t\t\t\t\tconsole.warn( \"THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead.\" );\n\t\t\t\t\t\twarned = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture = texture.texture;\n\n\t\t\t\t}\n\n\t\t\t\ttextures.setTexture2D( texture, slot );\n\n\t\t\t};\n\n\t\t}() );\n\n\t\tthis.setTexture = ( function() {\n\n\t\t\tvar warned = false;\n\n\t\t\treturn function setTexture( texture, slot ) {\n\n\t\t\t\tif ( ! warned ) {\n\n\t\t\t\t\tconsole.warn( \"THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead.\" );\n\t\t\t\t\twarned = true;\n\n\t\t\t\t}\n\n\t\t\t\ttextures.setTexture2D( texture, slot );\n\n\t\t\t};\n\n\t\t}() );\n\n\t\tthis.setTextureCube = ( function() {\n\n\t\t\tvar warned = false;\n\n\t\t\treturn function setTextureCube( texture, slot ) {\n\n\t\t\t\t// backwards compatibility: peel texture.texture\n\t\t\t\tif ( texture && texture.isWebGLRenderTargetCube ) {\n\n\t\t\t\t\tif ( ! warned ) {\n\n\t\t\t\t\t\tconsole.warn( \"THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead.\" );\n\t\t\t\t\t\twarned = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture = texture.texture;\n\n\t\t\t\t}\n\n\t\t\t\t// currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture\n\t\t\t\t// TODO: unify these code paths\n\t\t\t\tif ( ( texture && texture.isCubeTexture ) ||\n\t\t\t\t\t ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) {\n\n\t\t\t\t\t// CompressedTexture can have Array in image :/\n\n\t\t\t\t\t// this function alone should take care of cube textures\n\t\t\t\t\ttextures.setTextureCube( texture, slot );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// assumed: texture property of THREE.WebGLRenderTargetCube\n\n\t\t\t\t\ttextures.setTextureCubeDynamic( texture, slot );\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}() );\n\n\t\tthis.getCurrentRenderTarget = function() {\n\n\t\t\treturn _currentRenderTarget;\n\n\t\t};\n\n\t\tthis.setRenderTarget = function ( renderTarget ) {\n\n\t\t\t_currentRenderTarget = renderTarget;\n\n\t\t\tif ( renderTarget && properties.get( renderTarget ).__webglFramebuffer === undefined ) {\n\n\t\t\t\ttextures.setupRenderTarget( renderTarget );\n\n\t\t\t}\n\n\t\t\tvar isCube = ( renderTarget && renderTarget.isWebGLRenderTargetCube );\n\t\t\tvar framebuffer;\n\n\t\t\tif ( renderTarget ) {\n\n\t\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\tframebuffer = renderTargetProperties.__webglFramebuffer[ renderTarget.activeCubeFace ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tframebuffer = renderTargetProperties.__webglFramebuffer;\n\n\t\t\t\t}\n\n\t\t\t\t_currentScissor.copy( renderTarget.scissor );\n\t\t\t\t_currentScissorTest = renderTarget.scissorTest;\n\n\t\t\t\t_currentViewport.copy( renderTarget.viewport );\n\n\t\t\t} else {\n\n\t\t\t\tframebuffer = null;\n\n\t\t\t\t_currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio );\n\t\t\t\t_currentScissorTest = _scissorTest;\n\n\t\t\t\t_currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio );\n\n\t\t\t}\n\n\t\t\tif ( _currentFramebuffer !== framebuffer ) {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\t\t\t\t_currentFramebuffer = framebuffer;\n\n\t\t\t}\n\n\t\t\tstate.scissor( _currentScissor );\n\t\t\tstate.setScissorTest( _currentScissorTest );\n\n\t\t\tstate.viewport( _currentViewport );\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + renderTarget.activeCubeFace, textureProperties.__webglTexture, renderTarget.activeMipMapLevel );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer ) {\n\n\t\t\tif ( ( renderTarget && renderTarget.isWebGLRenderTarget ) === false ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tvar framebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\tif ( framebuffer ) {\n\n\t\t\t\tvar restore = false;\n\n\t\t\t\tif ( framebuffer !== _currentFramebuffer ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\t\trestore = true;\n\n\t\t\t\t}\n\n\t\t\t\ttry {\n\n\t\t\t\t\tvar texture = renderTarget.texture;\n\t\t\t\t\tvar textureFormat = texture.format;\n\t\t\t\t\tvar textureType = texture.type;\n\n\t\t\t\t\tif ( textureFormat !== RGBAFormat && paramThreeToGL( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( textureType !== UnsignedByteType && paramThreeToGL( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513)\n\t\t\t\t\t ! ( textureType === FloatType && ( extensions.get( 'OES_texture_float' ) || extensions.get( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox\n\t\t\t\t\t ! ( textureType === HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) {\n\n\t\t\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\n\t\t\t\t\t\tif ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {\n\n\t\t\t\t\t\t\t_gl.readPixels( x, y, width, height, paramThreeToGL( textureFormat ), paramThreeToGL( textureType ), buffer );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\n\t\t\t\t\tif ( restore ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, _currentFramebuffer );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\t// Map three.js constants to WebGL constants\n\n\t\tfunction paramThreeToGL( p ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\t\tif ( p === HalfFloatType ) {\n\n\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t\t}\n\n\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\t p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t}\n\n\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t}\n\n\t\t\treturn 0;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction FogExp2 ( color, density ) {\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\t\tthis.density = ( density !== undefined ) ? density : 0.00025;\n\n\t}\n\n\tFogExp2.prototype.isFogExp2 = true;\n\n\tFogExp2.prototype.clone = function () {\n\n\t\treturn new FogExp2( this.color.getHex(), this.density );\n\n\t};\n\n\tFogExp2.prototype.toJSON = function ( meta ) {\n\n\t\treturn {\n\t\t\ttype: 'FogExp2',\n\t\t\tcolor: this.color.getHex(),\n\t\t\tdensity: this.density\n\t\t};\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Fog ( color, near, far ) {\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\n\t\tthis.near = ( near !== undefined ) ? near : 1;\n\t\tthis.far = ( far !== undefined ) ? far : 1000;\n\n\t}\n\n\tFog.prototype.isFog = true;\n\n\tFog.prototype.clone = function () {\n\n\t\treturn new Fog( this.color.getHex(), this.near, this.far );\n\n\t};\n\n\tFog.prototype.toJSON = function ( meta ) {\n\n\t\treturn {\n\t\t\ttype: 'Fog',\n\t\t\tcolor: this.color.getHex(),\n\t\t\tnear: this.near,\n\t\t\tfar: this.far\n\t\t};\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Scene () {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Scene';\n\n\t\tthis.background = null;\n\t\tthis.fog = null;\n\t\tthis.overrideMaterial = null;\n\n\t\tthis.autoUpdate = true; // checked by the renderer\n\n\t}\n\n\tScene.prototype = Object.create( Object3D.prototype );\n\n\tScene.prototype.constructor = Scene;\n\n\tScene.prototype.copy = function ( source, recursive ) {\n\n\t\tObject3D.prototype.copy.call( this, source, recursive );\n\n\t\tif ( source.background !== null ) this.background = source.background.clone();\n\t\tif ( source.fog !== null ) this.fog = source.fog.clone();\n\t\tif ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\treturn this;\n\n\t};\n\n\tScene.prototype.toJSON = function ( meta ) {\n\n\t\tvar data = Object3D.prototype.toJSON.call( this, meta );\n\n\t\tif ( this.background !== null ) data.object.background = this.background.toJSON( meta );\n\t\tif ( this.fog !== null ) data.object.fog = this.fog.toJSON();\n\n\t\treturn data;\n\n\t};\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction LensFlare( texture, size, distance, blending, color ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.lensFlares = [];\n\n\t\tthis.positionScreen = new Vector3();\n\t\tthis.customUpdateCallback = undefined;\n\n\t\tif ( texture !== undefined ) {\n\n\t\t\tthis.add( texture, size, distance, blending, color );\n\n\t\t}\n\n\t}\n\n\tLensFlare.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: LensFlare,\n\n\t\tisLensFlare: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tObject3D.prototype.copy.call( this, source );\n\n\t\t\tthis.positionScreen.copy( source.positionScreen );\n\t\t\tthis.customUpdateCallback = source.customUpdateCallback;\n\n\t\t\tfor ( var i = 0, l = source.lensFlares.length; i < l; i ++ ) {\n\n\t\t\t\tthis.lensFlares.push( source.lensFlares[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tadd: function ( texture, size, distance, blending, color, opacity ) {\n\n\t\t\tif ( size === undefined ) size = - 1;\n\t\t\tif ( distance === undefined ) distance = 0;\n\t\t\tif ( opacity === undefined ) opacity = 1;\n\t\t\tif ( color === undefined ) color = new Color( 0xffffff );\n\t\t\tif ( blending === undefined ) blending = NormalBlending;\n\n\t\t\tdistance = Math.min( distance, Math.max( 0, distance ) );\n\n\t\t\tthis.lensFlares.push( {\n\t\t\t\ttexture: texture,\t// THREE.Texture\n\t\t\t\tsize: size, \t\t// size in pixels (-1 = use texture.width)\n\t\t\t\tdistance: distance, \t// distance (0-1) from light source (0=at light source)\n\t\t\t\tx: 0, y: 0, z: 0,\t// screen position (-1 => 1) z = 0 is in front z = 1 is back\n\t\t\t\tscale: 1, \t\t// scale\n\t\t\t\trotation: 0, \t\t// rotation\n\t\t\t\topacity: opacity,\t// opacity\n\t\t\t\tcolor: color,\t\t// color\n\t\t\t\tblending: blending\t// blending\n\t\t\t} );\n\n\t\t},\n\n\t\t/*\n\t\t * Update lens flares update positions on all flares based on the screen position\n\t\t * Set myLensFlare.customUpdateCallback to alter the flares in your project specific way.\n\t\t */\n\n\t\tupdateLensFlares: function () {\n\n\t\t\tvar f, fl = this.lensFlares.length;\n\t\t\tvar flare;\n\t\t\tvar vecX = - this.positionScreen.x * 2;\n\t\t\tvar vecY = - this.positionScreen.y * 2;\n\n\t\t\tfor ( f = 0; f < fl; f ++ ) {\n\n\t\t\t\tflare = this.lensFlares[ f ];\n\n\t\t\t\tflare.x = this.positionScreen.x + vecX * flare.distance;\n\t\t\t\tflare.y = this.positionScreen.y + vecY * flare.distance;\n\n\t\t\t\tflare.wantedRotation = flare.x * Math.PI * 0.25;\n\t\t\t\tflare.rotation += ( flare.wantedRotation - flare.rotation ) * 0.25;\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * color: ,\n\t * opacity: ,\n\t * map: new THREE.Texture( ),\n\t *\n\t *\tuvOffset: new THREE.Vector2(),\n\t *\tuvScale: new THREE.Vector2()\n\t * }\n\t */\n\n\tfunction SpriteMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'SpriteMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\t\tthis.map = null;\n\n\t\tthis.rotation = 0;\n\n\t\tthis.fog = false;\n\t\tthis.lights = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tSpriteMaterial.prototype = Object.create( Material.prototype );\n\tSpriteMaterial.prototype.constructor = SpriteMaterial;\n\n\tSpriteMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.map = source.map;\n\n\t\tthis.rotation = source.rotation;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Sprite( material ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Sprite';\n\n\t\tthis.material = ( material !== undefined ) ? material : new SpriteMaterial();\n\n\t}\n\n\tSprite.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Sprite,\n\n\t\tisSprite: true,\n\n\t\traycast: ( function () {\n\n\t\t\tvar matrixPosition = new Vector3();\n\n\t\t\treturn function raycast( raycaster, intersects ) {\n\n\t\t\t\tmatrixPosition.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\t\tvar distanceSq = raycaster.ray.distanceSqToPoint( matrixPosition );\n\t\t\t\tvar guessSizeSq = this.scale.x * this.scale.y / 4;\n\n\t\t\t\tif ( distanceSq > guessSizeSq ) {\n\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tintersects.push( {\n\n\t\t\t\t\tdistance: Math.sqrt( distanceSq ),\n\t\t\t\t\tpoint: this.position,\n\t\t\t\t\tface: null,\n\t\t\t\t\tobject: this\n\n\t\t\t\t} );\n\n\t\t\t};\n\n\t\t}() ),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.material ).copy( this );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction LOD() {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'LOD';\n\n\t\tObject.defineProperties( this, {\n\t\t\tlevels: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: []\n\t\t\t}\n\t\t} );\n\n\t}\n\n\n\tLOD.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: LOD,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tObject3D.prototype.copy.call( this, source, false );\n\n\t\t\tvar levels = source.levels;\n\n\t\t\tfor ( var i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tvar level = levels[ i ];\n\n\t\t\t\tthis.addLevel( level.object.clone(), level.distance );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\taddLevel: function ( object, distance ) {\n\n\t\t\tif ( distance === undefined ) distance = 0;\n\n\t\t\tdistance = Math.abs( distance );\n\n\t\t\tvar levels = this.levels;\n\n\t\t\tfor ( var l = 0; l < levels.length; l ++ ) {\n\n\t\t\t\tif ( distance < levels[ l ].distance ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tlevels.splice( l, 0, { distance: distance, object: object } );\n\n\t\t\tthis.add( object );\n\n\t\t},\n\n\t\tgetObjectForDistance: function ( distance ) {\n\n\t\t\tvar levels = this.levels;\n\n\t\t\tfor ( var i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tif ( distance < levels[ i ].distance ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn levels[ i - 1 ].object;\n\n\t\t},\n\n\t\traycast: ( function () {\n\n\t\t\tvar matrixPosition = new Vector3();\n\n\t\t\treturn function raycast( raycaster, intersects ) {\n\n\t\t\t\tmatrixPosition.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\t\tvar distance = raycaster.ray.origin.distanceTo( matrixPosition );\n\n\t\t\t\tthis.getObjectForDistance( distance ).raycast( raycaster, intersects );\n\n\t\t\t};\n\n\t\t}() ),\n\n\t\tupdate: function () {\n\n\t\t\tvar v1 = new Vector3();\n\t\t\tvar v2 = new Vector3();\n\n\t\t\treturn function update( camera ) {\n\n\t\t\t\tvar levels = this.levels;\n\n\t\t\t\tif ( levels.length > 1 ) {\n\n\t\t\t\t\tv1.setFromMatrixPosition( camera.matrixWorld );\n\t\t\t\t\tv2.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\t\t\tvar distance = v1.distanceTo( v2 );\n\n\t\t\t\t\tlevels[ 0 ].object.visible = true;\n\n\t\t\t\t\tfor ( var i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tif ( distance >= levels[ i ].distance ) {\n\n\t\t\t\t\t\t\tlevels[ i - 1 ].object.visible = false;\n\t\t\t\t\t\t\tlevels[ i ].object.visible = true;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( ; i < l; i ++ ) {\n\n\t\t\t\t\t\tlevels[ i ].object.visible = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}(),\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\tvar data = Object3D.prototype.toJSON.call( this, meta );\n\n\t\t\tdata.object.levels = [];\n\n\t\t\tvar levels = this.levels;\n\n\t\t\tfor ( var i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tvar level = levels[ i ];\n\n\t\t\t\tdata.object.levels.push( {\n\t\t\t\t\tobject: level.object.uuid,\n\t\t\t\t\tdistance: level.distance\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {\n\n\t\tTexture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );\n\n\t\tthis.image = { data: data, width: width, height: height };\n\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : NearestFilter;\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : NearestFilter;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n\tDataTexture.prototype = Object.create( Texture.prototype );\n\tDataTexture.prototype.constructor = DataTexture;\n\n\tDataTexture.prototype.isDataTexture = true;\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author michael guerrero / http://realitymeltdown.com\n\t * @author ikerr / http://verold.com\n\t */\n\n\tfunction Skeleton( bones, boneInverses, useVertexTexture ) {\n\n\t\tthis.useVertexTexture = useVertexTexture !== undefined ? useVertexTexture : true;\n\n\t\tthis.identityMatrix = new Matrix4();\n\n\t\t// copy the bone array\n\n\t\tbones = bones || [];\n\n\t\tthis.bones = bones.slice( 0 );\n\n\t\t// create a bone texture or an array of floats\n\n\t\tif ( this.useVertexTexture ) {\n\n\t\t\t// layout (1 matrix = 4 pixels)\n\t\t\t// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t\t// with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8)\n\t\t\t// 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16)\n\t\t\t// 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32)\n\t\t\t// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\n\n\t\t\tvar size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix\n\t\t\tsize = _Math.nextPowerOfTwo( Math.ceil( size ) );\n\t\t\tsize = Math.max( size, 4 );\n\n\t\t\tthis.boneTextureWidth = size;\n\t\t\tthis.boneTextureHeight = size;\n\n\t\t\tthis.boneMatrices = new Float32Array( this.boneTextureWidth * this.boneTextureHeight * 4 ); // 4 floats per RGBA pixel\n\t\t\tthis.boneTexture = new DataTexture( this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, RGBAFormat, FloatType );\n\n\t\t} else {\n\n\t\t\tthis.boneMatrices = new Float32Array( 16 * this.bones.length );\n\n\t\t}\n\n\t\t// use the supplied bone inverses or calculate the inverses\n\n\t\tif ( boneInverses === undefined ) {\n\n\t\t\tthis.calculateInverses();\n\n\t\t} else {\n\n\t\t\tif ( this.bones.length === boneInverses.length ) {\n\n\t\t\t\tthis.boneInverses = boneInverses.slice( 0 );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton bonInverses is the wrong length.' );\n\n\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\tfor ( var b = 0, bl = this.bones.length; b < bl; b ++ ) {\n\n\t\t\t\t\tthis.boneInverses.push( new Matrix4() );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tObject.assign( Skeleton.prototype, {\n\n\t\tcalculateInverses: function () {\n\n\t\t\tthis.boneInverses = [];\n\n\t\t\tfor ( var b = 0, bl = this.bones.length; b < bl; b ++ ) {\n\n\t\t\t\tvar inverse = new Matrix4();\n\n\t\t\t\tif ( this.bones[ b ] ) {\n\n\t\t\t\t\tinverse.getInverse( this.bones[ b ].matrixWorld );\n\n\t\t\t\t}\n\n\t\t\t\tthis.boneInverses.push( inverse );\n\n\t\t\t}\n\n\t\t},\n\n\t\tpose: function () {\n\n\t\t\tvar bone;\n\n\t\t\t// recover the bind-time world matrices\n\n\t\t\tfor ( var b = 0, bl = this.bones.length; b < bl; b ++ ) {\n\n\t\t\t\tbone = this.bones[ b ];\n\n\t\t\t\tif ( bone ) {\n\n\t\t\t\t\tbone.matrixWorld.getInverse( this.boneInverses[ b ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// compute the local matrices, positions, rotations and scales\n\n\t\t\tfor ( var b = 0, bl = this.bones.length; b < bl; b ++ ) {\n\n\t\t\t\tbone = this.bones[ b ];\n\n\t\t\t\tif ( bone ) {\n\n\t\t\t\t\tif ( (bone.parent && bone.parent.isBone) ) {\n\n\t\t\t\t\t\tbone.matrix.getInverse( bone.parent.matrixWorld );\n\t\t\t\t\t\tbone.matrix.multiply( bone.matrixWorld );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tbone.matrix.copy( bone.matrixWorld );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbone.matrix.decompose( bone.position, bone.quaternion, bone.scale );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\tupdate: ( function () {\n\n\t\t\tvar offsetMatrix = new Matrix4();\n\n\t\t\treturn function update() {\n\n\t\t\t\t// flatten bone matrices to array\n\n\t\t\t\tfor ( var b = 0, bl = this.bones.length; b < bl; b ++ ) {\n\n\t\t\t\t\t// compute the offset between the current and the original transform\n\n\t\t\t\t\tvar matrix = this.bones[ b ] ? this.bones[ b ].matrixWorld : this.identityMatrix;\n\n\t\t\t\t\toffsetMatrix.multiplyMatrices( matrix, this.boneInverses[ b ] );\n\t\t\t\t\toffsetMatrix.toArray( this.boneMatrices, b * 16 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.useVertexTexture ) {\n\n\t\t\t\t\tthis.boneTexture.needsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t} )(),\n\n\t\tclone: function () {\n\n\t\t\treturn new Skeleton( this.bones, this.boneInverses, this.useVertexTexture );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author ikerr / http://verold.com\n\t */\n\n\tfunction Bone( skin ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Bone';\n\n\t\tthis.skin = skin;\n\n\t}\n\n\tBone.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Bone,\n\n\t\tisBone: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tObject3D.prototype.copy.call( this, source );\n\n\t\t\tthis.skin = source.skin;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mikael emtinger / http://gomo.se/\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author ikerr / http://verold.com\n\t */\n\n\tfunction SkinnedMesh( geometry, material, useVertexTexture ) {\n\n\t\tMesh.call( this, geometry, material );\n\n\t\tthis.type = 'SkinnedMesh';\n\n\t\tthis.bindMode = \"attached\";\n\t\tthis.bindMatrix = new Matrix4();\n\t\tthis.bindMatrixInverse = new Matrix4();\n\n\t\t// init bones\n\n\t\t// TODO: remove bone creation as there is no reason (other than\n\t\t// convenience) for THREE.SkinnedMesh to do this.\n\n\t\tvar bones = [];\n\n\t\tif ( this.geometry && this.geometry.bones !== undefined ) {\n\n\t\t\tvar bone, gbone;\n\n\t\t\tfor ( var b = 0, bl = this.geometry.bones.length; b < bl; ++ b ) {\n\n\t\t\t\tgbone = this.geometry.bones[ b ];\n\n\t\t\t\tbone = new Bone( this );\n\t\t\t\tbones.push( bone );\n\n\t\t\t\tbone.name = gbone.name;\n\t\t\t\tbone.position.fromArray( gbone.pos );\n\t\t\t\tbone.quaternion.fromArray( gbone.rotq );\n\t\t\t\tif ( gbone.scl !== undefined ) bone.scale.fromArray( gbone.scl );\n\n\t\t\t}\n\n\t\t\tfor ( var b = 0, bl = this.geometry.bones.length; b < bl; ++ b ) {\n\n\t\t\t\tgbone = this.geometry.bones[ b ];\n\n\t\t\t\tif ( gbone.parent !== - 1 && gbone.parent !== null &&\n\t\t\t\t\t\tbones[ gbone.parent ] !== undefined ) {\n\n\t\t\t\t\tbones[ gbone.parent ].add( bones[ b ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.add( bones[ b ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.normalizeSkinWeights();\n\n\t\tthis.updateMatrixWorld( true );\n\t\tthis.bind( new Skeleton( bones, undefined, useVertexTexture ), this.matrixWorld );\n\n\t}\n\n\n\tSkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {\n\n\t\tconstructor: SkinnedMesh,\n\n\t\tisSkinnedMesh: true,\n\n\t\tbind: function( skeleton, bindMatrix ) {\n\n\t\t\tthis.skeleton = skeleton;\n\n\t\t\tif ( bindMatrix === undefined ) {\n\n\t\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\t\tthis.skeleton.calculateInverses();\n\n\t\t\t\tbindMatrix = this.matrixWorld;\n\n\t\t\t}\n\n\t\t\tthis.bindMatrix.copy( bindMatrix );\n\t\t\tthis.bindMatrixInverse.getInverse( bindMatrix );\n\n\t\t},\n\n\t\tpose: function () {\n\n\t\t\tthis.skeleton.pose();\n\n\t\t},\n\n\t\tnormalizeSkinWeights: function () {\n\n\t\t\tif ( (this.geometry && this.geometry.isGeometry) ) {\n\n\t\t\t\tfor ( var i = 0; i < this.geometry.skinWeights.length; i ++ ) {\n\n\t\t\t\t\tvar sw = this.geometry.skinWeights[ i ];\n\n\t\t\t\t\tvar scale = 1.0 / sw.lengthManhattan();\n\n\t\t\t\t\tif ( scale !== Infinity ) {\n\n\t\t\t\t\t\tsw.multiplyScalar( scale );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tsw.set( 1, 0, 0, 0 ); // do something reasonable\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( (this.geometry && this.geometry.isBufferGeometry) ) {\n\n\t\t\t\tvar vec = new Vector4();\n\n\t\t\t\tvar skinWeight = this.geometry.attributes.skinWeight;\n\n\t\t\t\tfor ( var i = 0; i < skinWeight.count; i ++ ) {\n\n\t\t\t\t\tvec.x = skinWeight.getX( i );\n\t\t\t\t\tvec.y = skinWeight.getY( i );\n\t\t\t\t\tvec.z = skinWeight.getZ( i );\n\t\t\t\t\tvec.w = skinWeight.getW( i );\n\n\t\t\t\t\tvar scale = 1.0 / vec.lengthManhattan();\n\n\t\t\t\t\tif ( scale !== Infinity ) {\n\n\t\t\t\t\t\tvec.multiplyScalar( scale );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tvec.set( 1, 0, 0, 0 ); // do something reasonable\n\n\t\t\t\t\t}\n\n\t\t\t\t\tskinWeight.setXYZW( i, vec.x, vec.y, vec.z, vec.w );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\tupdateMatrixWorld: function( force ) {\n\n\t\t\tMesh.prototype.updateMatrixWorld.call( this, true );\n\n\t\t\tif ( this.bindMode === \"attached\" ) {\n\n\t\t\t\tthis.bindMatrixInverse.getInverse( this.matrixWorld );\n\n\t\t\t} else if ( this.bindMode === \"detached\" ) {\n\n\t\t\t\tthis.bindMatrixInverse.getInverse( this.bindMatrix );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode );\n\n\t\t\t}\n\n\t\t},\n\n\t\tclone: function() {\n\n\t\t\treturn new this.constructor( this.geometry, this.material, this.skeleton.useVertexTexture ).copy( this );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * color: ,\n\t * opacity: ,\n\t *\n\t * linewidth: ,\n\t * linecap: \"round\",\n\t * linejoin: \"round\"\n\t * }\n\t */\n\n\tfunction LineBasicMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'LineBasicMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.linewidth = 1;\n\t\tthis.linecap = 'round';\n\t\tthis.linejoin = 'round';\n\n\t\tthis.lights = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tLineBasicMaterial.prototype = Object.create( Material.prototype );\n\tLineBasicMaterial.prototype.constructor = LineBasicMaterial;\n\n\tLineBasicMaterial.prototype.isLineBasicMaterial = true;\n\n\tLineBasicMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.linewidth = source.linewidth;\n\t\tthis.linecap = source.linecap;\n\t\tthis.linejoin = source.linejoin;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Line( geometry, material, mode ) {\n\n\t\tif ( mode === 1 ) {\n\n\t\t\tconsole.warn( 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.' );\n\t\t\treturn new LineSegments( geometry, material );\n\n\t\t}\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Line';\n\n\t\tthis.geometry = geometry !== undefined ? geometry : new BufferGeometry();\n\t\tthis.material = material !== undefined ? material : new LineBasicMaterial( { color: Math.random() * 0xffffff } );\n\n\t}\n\n\tLine.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Line,\n\n\t\tisLine: true,\n\n\t\traycast: ( function () {\n\n\t\t\tvar inverseMatrix = new Matrix4();\n\t\t\tvar ray = new Ray();\n\t\t\tvar sphere = new Sphere();\n\n\t\t\treturn function raycast( raycaster, intersects ) {\n\n\t\t\t\tvar precision = raycaster.linePrecision;\n\t\t\t\tvar precisionSq = precision * precision;\n\n\t\t\t\tvar geometry = this.geometry;\n\t\t\t\tvar matrixWorld = this.matrixWorld;\n\n\t\t\t\t// Checking boundingSphere distance to ray\n\n\t\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t\tsphere.copy( geometry.boundingSphere );\n\t\t\t\tsphere.applyMatrix4( matrixWorld );\n\n\t\t\t\tif ( raycaster.ray.intersectsSphere( sphere ) === false ) return;\n\n\t\t\t\t//\n\n\t\t\t\tinverseMatrix.getInverse( matrixWorld );\n\t\t\t\tray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );\n\n\t\t\t\tvar vStart = new Vector3();\n\t\t\t\tvar vEnd = new Vector3();\n\t\t\t\tvar interSegment = new Vector3();\n\t\t\t\tvar interRay = new Vector3();\n\t\t\t\tvar step = (this && this.isLineSegments) ? 2 : 1;\n\n\t\t\t\tif ( (geometry && geometry.isBufferGeometry) ) {\n\n\t\t\t\t\tvar index = geometry.index;\n\t\t\t\t\tvar attributes = geometry.attributes;\n\t\t\t\t\tvar positions = attributes.position.array;\n\n\t\t\t\t\tif ( index !== null ) {\n\n\t\t\t\t\t\tvar indices = index.array;\n\n\t\t\t\t\t\tfor ( var i = 0, l = indices.length - 1; i < l; i += step ) {\n\n\t\t\t\t\t\t\tvar a = indices[ i ];\n\t\t\t\t\t\t\tvar b = indices[ i + 1 ];\n\n\t\t\t\t\t\t\tvStart.fromArray( positions, a * 3 );\n\t\t\t\t\t\t\tvEnd.fromArray( positions, b * 3 );\n\n\t\t\t\t\t\t\tvar distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );\n\n\t\t\t\t\t\t\tif ( distSq > precisionSq ) continue;\n\n\t\t\t\t\t\t\tinterRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation\n\n\t\t\t\t\t\t\tvar distance = raycaster.ray.origin.distanceTo( interRay );\n\n\t\t\t\t\t\t\tif ( distance < raycaster.near || distance > raycaster.far ) continue;\n\n\t\t\t\t\t\t\tintersects.push( {\n\n\t\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4( this.matrixWorld ),\n\t\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\t\t\tobject: this\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tfor ( var i = 0, l = positions.length / 3 - 1; i < l; i += step ) {\n\n\t\t\t\t\t\t\tvStart.fromArray( positions, 3 * i );\n\t\t\t\t\t\t\tvEnd.fromArray( positions, 3 * i + 3 );\n\n\t\t\t\t\t\t\tvar distSq = ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );\n\n\t\t\t\t\t\t\tif ( distSq > precisionSq ) continue;\n\n\t\t\t\t\t\t\tinterRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation\n\n\t\t\t\t\t\t\tvar distance = raycaster.ray.origin.distanceTo( interRay );\n\n\t\t\t\t\t\t\tif ( distance < raycaster.near || distance > raycaster.far ) continue;\n\n\t\t\t\t\t\t\tintersects.push( {\n\n\t\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4( this.matrixWorld ),\n\t\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\t\t\tobject: this\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( (geometry && geometry.isGeometry) ) {\n\n\t\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\t\tvar nbVertices = vertices.length;\n\n\t\t\t\t\tfor ( var i = 0; i < nbVertices - 1; i += step ) {\n\n\t\t\t\t\t\tvar distSq = ray.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment );\n\n\t\t\t\t\t\tif ( distSq > precisionSq ) continue;\n\n\t\t\t\t\t\tinterRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation\n\n\t\t\t\t\t\tvar distance = raycaster.ray.origin.distanceTo( interRay );\n\n\t\t\t\t\t\tif ( distance < raycaster.near || distance > raycaster.far ) continue;\n\n\t\t\t\t\t\tintersects.push( {\n\n\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4( this.matrixWorld ),\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\t\tobject: this\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}() ),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.geometry, this.material ).copy( this );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction LineSegments( geometry, material ) {\n\n\t\tLine.call( this, geometry, material );\n\n\t\tthis.type = 'LineSegments';\n\n\t}\n\n\tLineSegments.prototype = Object.assign( Object.create( Line.prototype ), {\n\n\t\tconstructor: LineSegments,\n\n\t\tisLineSegments: true\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * color: ,\n\t * opacity: ,\n\t * map: new THREE.Texture( ),\n\t *\n\t * size: ,\n\t * sizeAttenuation: \n\t * }\n\t */\n\n\tfunction PointsMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'PointsMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.size = 1;\n\t\tthis.sizeAttenuation = true;\n\n\t\tthis.lights = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tPointsMaterial.prototype = Object.create( Material.prototype );\n\tPointsMaterial.prototype.constructor = PointsMaterial;\n\n\tPointsMaterial.prototype.isPointsMaterial = true;\n\n\tPointsMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.size = source.size;\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Points( geometry, material ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Points';\n\n\t\tthis.geometry = geometry !== undefined ? geometry : new BufferGeometry();\n\t\tthis.material = material !== undefined ? material : new PointsMaterial( { color: Math.random() * 0xffffff } );\n\n\t}\n\n\tPoints.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Points,\n\n\t\tisPoints: true,\n\n\t\traycast: ( function () {\n\n\t\t\tvar inverseMatrix = new Matrix4();\n\t\t\tvar ray = new Ray();\n\t\t\tvar sphere = new Sphere();\n\n\t\t\treturn function raycast( raycaster, intersects ) {\n\n\t\t\t\tvar object = this;\n\t\t\t\tvar geometry = this.geometry;\n\t\t\t\tvar matrixWorld = this.matrixWorld;\n\t\t\t\tvar threshold = raycaster.params.Points.threshold;\n\n\t\t\t\t// Checking boundingSphere distance to ray\n\n\t\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t\tsphere.copy( geometry.boundingSphere );\n\t\t\t\tsphere.applyMatrix4( matrixWorld );\n\n\t\t\t\tif ( raycaster.ray.intersectsSphere( sphere ) === false ) return;\n\n\t\t\t\t//\n\n\t\t\t\tinverseMatrix.getInverse( matrixWorld );\n\t\t\t\tray.copy( raycaster.ray ).applyMatrix4( inverseMatrix );\n\n\t\t\t\tvar localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\t\t\tvar localThresholdSq = localThreshold * localThreshold;\n\t\t\t\tvar position = new Vector3();\n\n\t\t\t\tfunction testPoint( point, index ) {\n\n\t\t\t\t\tvar rayPointDistanceSq = ray.distanceSqToPoint( point );\n\n\t\t\t\t\tif ( rayPointDistanceSq < localThresholdSq ) {\n\n\t\t\t\t\t\tvar intersectPoint = ray.closestPointToPoint( point );\n\t\t\t\t\t\tintersectPoint.applyMatrix4( matrixWorld );\n\n\t\t\t\t\t\tvar distance = raycaster.ray.origin.distanceTo( intersectPoint );\n\n\t\t\t\t\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\t\t\t\t\tintersects.push( {\n\n\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\tdistanceToRay: Math.sqrt( rayPointDistanceSq ),\n\t\t\t\t\t\t\tpoint: intersectPoint.clone(),\n\t\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\tobject: object\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( (geometry && geometry.isBufferGeometry) ) {\n\n\t\t\t\t\tvar index = geometry.index;\n\t\t\t\t\tvar attributes = geometry.attributes;\n\t\t\t\t\tvar positions = attributes.position.array;\n\n\t\t\t\t\tif ( index !== null ) {\n\n\t\t\t\t\t\tvar indices = index.array;\n\n\t\t\t\t\t\tfor ( var i = 0, il = indices.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\tvar a = indices[ i ];\n\n\t\t\t\t\t\t\tposition.fromArray( positions, a * 3 );\n\n\t\t\t\t\t\t\ttestPoint( position, a );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tfor ( var i = 0, l = positions.length / 3; i < l; i ++ ) {\n\n\t\t\t\t\t\t\tposition.fromArray( positions, i * 3 );\n\n\t\t\t\t\t\t\ttestPoint( position, i );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar vertices = geometry.vertices;\n\n\t\t\t\t\tfor ( var i = 0, l = vertices.length; i < l; i ++ ) {\n\n\t\t\t\t\t\ttestPoint( vertices[ i ], i );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}() ),\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor( this.geometry, this.material ).copy( this );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Group() {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Group';\n\n\t}\n\n\tGroup.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Group\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tTexture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.generateMipmaps = false;\n\n\t\tvar scope = this;\n\n\t\tfunction update() {\n\n\t\t\trequestAnimationFrame( update );\n\n\t\t\tif ( video.readyState >= video.HAVE_CURRENT_DATA ) {\n\n\t\t\t\tscope.needsUpdate = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tupdate();\n\n\t}\n\n\tVideoTexture.prototype = Object.create( Texture.prototype );\n\tVideoTexture.prototype.constructor = VideoTexture;\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction CompressedTexture( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {\n\n\t\tTexture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );\n\n\t\tthis.image = { width: width, height: height };\n\t\tthis.mipmaps = mipmaps;\n\n\t\t// no flipping for cube textures\n\t\t// (also flipping doesn't work for compressed textures )\n\n\t\tthis.flipY = false;\n\n\t\t// can't generate mipmaps for compressed textures\n\t\t// mips must be embedded in DDS files\n\n\t\tthis.generateMipmaps = false;\n\n\t}\n\n\tCompressedTexture.prototype = Object.create( Texture.prototype );\n\tCompressedTexture.prototype.constructor = CompressedTexture;\n\n\tCompressedTexture.prototype.isCompressedTexture = true;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction CanvasTexture( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tTexture.call( this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n\tCanvasTexture.prototype = Object.create( Texture.prototype );\n\tCanvasTexture.prototype.constructor = CanvasTexture;\n\n\t/**\n\t * @author Matt DesLauriers / @mattdesl\n\t * @author atix / arthursilber.de\n\t */\n\n\tfunction DepthTexture( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) {\n\n\t\tformat = format !== undefined ? format : DepthFormat;\n\n\t\tif ( format !== DepthFormat && format !== DepthStencilFormat ) {\n\n\t\t\tthrow new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' )\n\n\t\t}\n\n\t\tTexture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.image = { width: width, height: height };\n\n\t\tthis.type = type !== undefined ? type : UnsignedShortType;\n\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : NearestFilter;\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : NearestFilter;\n\n\t\tthis.flipY = false;\n\t\tthis.generateMipmaps\t= false;\n\n\t}\n\n\tDepthTexture.prototype = Object.create( Texture.prototype );\n\tDepthTexture.prototype.constructor = DepthTexture;\n\tDepthTexture.prototype.isDepthTexture = true;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WireframeGeometry( geometry ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tvar edge = [ 0, 0 ], hash = {};\n\n\t\tfunction sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}\n\n\t\tvar keys = [ 'a', 'b', 'c' ];\n\n\t\tif ( (geometry && geometry.isGeometry) ) {\n\n\t\t\tvar vertices = geometry.vertices;\n\t\t\tvar faces = geometry.faces;\n\t\t\tvar numEdges = 0;\n\n\t\t\t// allocate maximal size\n\t\t\tvar edges = new Uint32Array( 6 * faces.length );\n\n\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\tedge[ 0 ] = face[ keys[ j ] ];\n\t\t\t\t\tedge[ 1 ] = face[ keys[ ( j + 1 ) % 3 ] ];\n\t\t\t\t\tedge.sort( sortFunction );\n\n\t\t\t\t\tvar key = edge.toString();\n\n\t\t\t\t\tif ( hash[ key ] === undefined ) {\n\n\t\t\t\t\t\tedges[ 2 * numEdges ] = edge[ 0 ];\n\t\t\t\t\t\tedges[ 2 * numEdges + 1 ] = edge[ 1 ];\n\t\t\t\t\t\thash[ key ] = true;\n\t\t\t\t\t\tnumEdges ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar coords = new Float32Array( numEdges * 2 * 3 );\n\n\t\t\tfor ( var i = 0, l = numEdges; i < l; i ++ ) {\n\n\t\t\t\tfor ( var j = 0; j < 2; j ++ ) {\n\n\t\t\t\t\tvar vertex = vertices[ edges [ 2 * i + j ] ];\n\n\t\t\t\t\tvar index = 6 * i + 3 * j;\n\t\t\t\t\tcoords[ index + 0 ] = vertex.x;\n\t\t\t\t\tcoords[ index + 1 ] = vertex.y;\n\t\t\t\t\tcoords[ index + 2 ] = vertex.z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.addAttribute( 'position', new BufferAttribute( coords, 3 ) );\n\n\t\t} else if ( (geometry && geometry.isBufferGeometry) ) {\n\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\t// Indexed BufferGeometry\n\n\t\t\t\tvar indices = geometry.index.array;\n\t\t\t\tvar vertices = geometry.attributes.position;\n\t\t\t\tvar groups = geometry.groups;\n\t\t\t\tvar numEdges = 0;\n\n\t\t\t\tif ( groups.length === 0 ) {\n\n\t\t\t\t\tgeometry.addGroup( 0, indices.length );\n\n\t\t\t\t}\n\n\t\t\t\t// allocate maximal size\n\t\t\t\tvar edges = new Uint32Array( 2 * indices.length );\n\n\t\t\t\tfor ( var o = 0, ol = groups.length; o < ol; ++ o ) {\n\n\t\t\t\t\tvar group = groups[ o ];\n\n\t\t\t\t\tvar start = group.start;\n\t\t\t\t\tvar count = group.count;\n\n\t\t\t\t\tfor ( var i = start, il = start + count; i < il; i += 3 ) {\n\n\t\t\t\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\tedge[ 0 ] = indices[ i + j ];\n\t\t\t\t\t\t\tedge[ 1 ] = indices[ i + ( j + 1 ) % 3 ];\n\t\t\t\t\t\t\tedge.sort( sortFunction );\n\n\t\t\t\t\t\t\tvar key = edge.toString();\n\n\t\t\t\t\t\t\tif ( hash[ key ] === undefined ) {\n\n\t\t\t\t\t\t\t\tedges[ 2 * numEdges ] = edge[ 0 ];\n\t\t\t\t\t\t\t\tedges[ 2 * numEdges + 1 ] = edge[ 1 ];\n\t\t\t\t\t\t\t\thash[ key ] = true;\n\t\t\t\t\t\t\t\tnumEdges ++;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar coords = new Float32Array( numEdges * 2 * 3 );\n\n\t\t\t\tfor ( var i = 0, l = numEdges; i < l; i ++ ) {\n\n\t\t\t\t\tfor ( var j = 0; j < 2; j ++ ) {\n\n\t\t\t\t\t\tvar index = 6 * i + 3 * j;\n\t\t\t\t\t\tvar index2 = edges[ 2 * i + j ];\n\n\t\t\t\t\t\tcoords[ index + 0 ] = vertices.getX( index2 );\n\t\t\t\t\t\tcoords[ index + 1 ] = vertices.getY( index2 );\n\t\t\t\t\t\tcoords[ index + 2 ] = vertices.getZ( index2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tthis.addAttribute( 'position', new BufferAttribute( coords, 3 ) );\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed BufferGeometry\n\n\t\t\t\tvar vertices = geometry.attributes.position.array;\n\t\t\t\tvar numEdges = vertices.length / 3;\n\t\t\t\tvar numTris = numEdges / 3;\n\n\t\t\t\tvar coords = new Float32Array( numEdges * 2 * 3 );\n\n\t\t\t\tfor ( var i = 0, l = numTris; i < l; i ++ ) {\n\n\t\t\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\tvar index = 18 * i + 6 * j;\n\n\t\t\t\t\t\tvar index1 = 9 * i + 3 * j;\n\t\t\t\t\t\tcoords[ index + 0 ] = vertices[ index1 ];\n\t\t\t\t\t\tcoords[ index + 1 ] = vertices[ index1 + 1 ];\n\t\t\t\t\t\tcoords[ index + 2 ] = vertices[ index1 + 2 ];\n\n\t\t\t\t\t\tvar index2 = 9 * i + 3 * ( ( j + 1 ) % 3 );\n\t\t\t\t\t\tcoords[ index + 3 ] = vertices[ index2 ];\n\t\t\t\t\t\tcoords[ index + 4 ] = vertices[ index2 + 1 ];\n\t\t\t\t\t\tcoords[ index + 5 ] = vertices[ index2 + 2 ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tthis.addAttribute( 'position', new BufferAttribute( coords, 3 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tWireframeGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tWireframeGeometry.prototype.constructor = WireframeGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t *\n\t * Parametric Surfaces Geometry\n\t * based on the brilliant article by @prideout http://prideout.net/blog/?p=44\n\t */\n\n\tfunction ParametricBufferGeometry( func, slices, stacks ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'ParametricBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tfunc: func,\n\t\t\tslices: slices,\n\t\t\tstacks: stacks\n\t\t};\n\n\t\t// generate vertices and uvs\n\n\t\tvar vertices = [];\n\t\tvar uvs = [];\n\n\t\tvar i, j, p;\n\t\tvar u, v;\n\n\t\tvar sliceCount = slices + 1;\n\n\t\tfor ( i = 0; i <= stacks; i ++ ) {\n\n\t\t\tv = i / stacks;\n\n\t\t\tfor ( j = 0; j <= slices; j ++ ) {\n\n\t\t\t\tu = j / slices;\n\n\t\t\t\tp = func( u, v );\n\t\t\t\tvertices.push( p.x, p.y, p.z );\n\n\t\t\t\tuvs.push( u, v );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tvar indices = [];\n\t\tvar a, b, c, d;\n\n\t\tfor ( i = 0; i < stacks; i ++ ) {\n\n\t\t\tfor ( j = 0; j < slices; j ++ ) {\n\n\t\t\t\ta = i * sliceCount + j;\n\t\t\t\tb = i * sliceCount + j + 1;\n\t\t\t\tc = ( i + 1 ) * sliceCount + j + 1;\n\t\t\t\td = ( i + 1 ) * sliceCount + j;\n\n\t\t\t\t// faces one and two\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( ( indices.length > 65535 ? Uint32Attribute : Uint16Attribute )( indices, 1 ) );\n\t\tthis.addAttribute( 'position', Float32Attribute( vertices, 3 ) );\n\t\tthis.addAttribute( 'uv', Float32Attribute( uvs, 2 ) );\n\n\t\t// generate normals\n\n\t\tthis.computeVertexNormals();\n\n\t}\n\n\tParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tParametricBufferGeometry.prototype.constructor = ParametricBufferGeometry;\n\n\t/**\n\t * @author zz85 / https://github.com/zz85\n\t *\n\t * Parametric Surfaces Geometry\n\t * based on the brilliant article by @prideout http://prideout.net/blog/?p=44\n\t */\n\n\tfunction ParametricGeometry( func, slices, stacks ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'ParametricGeometry';\n\n\t\tthis.parameters = {\n\t\t\tfunc: func,\n\t\t\tslices: slices,\n\t\t\tstacks: stacks\n\t\t};\n\n\t\tthis.fromBufferGeometry( new ParametricBufferGeometry( func, slices, stacks ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tParametricGeometry.prototype = Object.create( Geometry.prototype );\n\tParametricGeometry.prototype.constructor = ParametricGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction PolyhedronBufferGeometry( vertices, indices, radius, detail ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'PolyhedronBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tvertices: vertices,\n\t\t\tindices: indices,\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\tradius = radius || 1;\n\t\tdetail = detail || 0;\n\n\t\t// default buffer data\n\n\t\tvar vertexBuffer = [];\n\t\tvar uvBuffer = [];\n\n\t\t// the subdivision creates the vertex buffer data\n\n\t\tsubdivide( detail );\n\n\t\t// all vertices should lie on a conceptual sphere with a given radius\n\n\t\tappplyRadius( radius );\n\n\t\t// finally, create the uv data\n\n\t\tgenerateUVs();\n\n\t\t// build non-indexed geometry\n\n\t\tthis.addAttribute( 'position', Float32Attribute( vertexBuffer, 3 ) );\n\t\tthis.addAttribute( 'normal', Float32Attribute( vertexBuffer.slice(), 3 ) );\n\t\tthis.addAttribute( 'uv', Float32Attribute( uvBuffer, 2 ) );\n\t\tthis.normalizeNormals();\n\n\t\tthis.boundingSphere = new Sphere( new Vector3(), radius );\n\n\t\t// helper functions\n\n\t\tfunction subdivide( detail ) {\n\n\t\t\tvar a = new Vector3();\n\t\t\tvar b = new Vector3();\n\t\t\tvar c = new Vector3();\n\n\t\t\t// iterate over all faces and apply a subdivison with the given detail value\n\n\t\t\tfor ( var i = 0; i < indices.length; i += 3 ) {\n\n\t\t\t\t// get the vertices of the face\n\n\t\t\t\tgetVertexByIndex( indices[ i + 0 ], a );\n\t\t\t\tgetVertexByIndex( indices[ i + 1 ], b );\n\t\t\t\tgetVertexByIndex( indices[ i + 2 ], c );\n\n\t\t\t\t// perform subdivision\n\n\t\t\t\tsubdivideFace( a, b, c, detail );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction subdivideFace( a, b, c, detail ) {\n\n\t\t\tvar cols = Math.pow( 2, detail );\n\n\t\t\t// we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\tvar v = [];\n\n\t\t\tvar i, j;\n\n\t\t\t// construct all of the vertices for this subdivision\n\n\t\t\tfor ( i = 0 ; i <= cols; i ++ ) {\n\n\t\t\t\tv[ i ] = [];\n\n\t\t\t\tvar aj = a.clone().lerp( c, i / cols );\n\t\t\t\tvar bj = b.clone().lerp( c, i / cols );\n\n\t\t\t\tvar rows = cols - i;\n\n\t\t\t\tfor ( j = 0; j <= rows; j ++ ) {\n\n\t\t\t\t\tif ( j === 0 && i === cols ) {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj.clone().lerp( bj, j / rows );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// construct all of the faces\n\n\t\t\tfor ( i = 0; i < cols ; i ++ ) {\n\n\t\t\t\tfor ( j = 0; j < 2 * ( cols - i ) - 1; j ++ ) {\n\n\t\t\t\t\tvar k = Math.floor( j / 2 );\n\n\t\t\t\t\tif ( j % 2 === 0 ) {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\t\t\t\t\t\tpushVertex( v[ i ][ k ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction appplyRadius( radius ) {\n\n\t\t\tvar vertex = new Vector3();\n\n\t\t\t// iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\tfor ( var i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tvertex.normalize().multiplyScalar( radius );\n\n\t\t\t\tvertexBuffer[ i + 0 ] = vertex.x;\n\t\t\t\tvertexBuffer[ i + 1 ] = vertex.y;\n\t\t\t\tvertexBuffer[ i + 2 ] = vertex.z;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tvar vertex = new Vector3();\n\n\t\t\tfor ( var i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tvar u = azimuth( vertex ) / 2 / Math.PI + 0.5;\n\t\t\t\tvar v = inclination( vertex ) / Math.PI + 0.5;\n\t\t\t\tuvBuffer.push( u, 1 - v );\n\n\t\t\t}\n\n\t\t\tcorrectUVs();\n\n\t\t\tcorrectSeam();\n\n\t\t}\n\n\t\tfunction correctSeam() {\n\n\t\t\t// handle case when face straddles the seam, see #3269\n\n\t\t\tfor ( var i = 0; i < uvBuffer.length; i += 6 ) {\n\n\t\t\t\t// uv data of a single face\n\n\t\t\t\tvar x0 = uvBuffer[ i + 0 ];\n\t\t\t\tvar x1 = uvBuffer[ i + 2 ];\n\t\t\t\tvar x2 = uvBuffer[ i + 4 ];\n\n\t\t\t\tvar max = Math.max( x0, x1, x2 );\n\t\t\t\tvar min = Math.min( x0, x1, x2 );\n\n\t\t\t\t// 0.9 is somewhat arbitrary\n\n\t\t\t\tif ( max > 0.9 && min < 0.1 ) {\n\n\t\t\t\t\tif ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1;\n\t\t\t\t\tif ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1;\n\t\t\t\t\tif ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction pushVertex( vertex ) {\n\n\t\t\tvertexBuffer.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tfunction getVertexByIndex( index, vertex ) {\n\n\t\t\tvar stride = index * 3;\n\n\t\t\tvertex.x = vertices[ stride + 0 ];\n\t\t\tvertex.y = vertices[ stride + 1 ];\n\t\t\tvertex.z = vertices[ stride + 2 ];\n\n\t\t}\n\n\t\tfunction correctUVs() {\n\n\t\t\tvar a = new Vector3();\n\t\t\tvar b = new Vector3();\n\t\t\tvar c = new Vector3();\n\n\t\t\tvar centroid = new Vector3();\n\n\t\t\tvar uvA = new Vector2();\n\t\t\tvar uvB = new Vector2();\n\t\t\tvar uvC = new Vector2();\n\n\t\t\tfor ( var i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) {\n\n\t\t\t\ta.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] );\n\t\t\t\tb.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] );\n\t\t\t\tc.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] );\n\n\t\t\t\tuvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] );\n\t\t\t\tuvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] );\n\t\t\t\tuvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] );\n\n\t\t\t\tcentroid.copy( a ).add( b ).add( c ).divideScalar( 3 );\n\n\t\t\t\tvar azi = azimuth( centroid );\n\n\t\t\t\tcorrectUV( uvA, j + 0, a, azi );\n\t\t\t\tcorrectUV( uvB, j + 2, b, azi );\n\t\t\t\tcorrectUV( uvC, j + 4, c, azi );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction correctUV( uv, stride, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = uv.x - 1;\n\n\t\t\t}\n\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Angle around the Y axis, counter-clockwise when looking from above.\n\n\t\tfunction azimuth( vector ) {\n\n\t\t\treturn Math.atan2( vector.z, - vector.x );\n\n\t\t}\n\n\n\t\t// Angle above the XZ plane.\n\n\t\tfunction inclination( vector ) {\n\n\t\t\treturn Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) );\n\n\t\t}\n\n\t}\n\n\tPolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tPolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction TetrahedronBufferGeometry( radius, detail ) {\n\n\t\tvar vertices = [\n\t\t\t1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1\n\t\t];\n\n\t\tvar indices = [\n\t\t\t2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1\n\t\t];\n\n\t\tPolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );\n\n\t\tthis.type = 'TetrahedronBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tTetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );\n\tTetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry;\n\n\t/**\n\t * @author timothypratley / https://github.com/timothypratley\n\t */\n\n\tfunction TetrahedronGeometry( radius, detail ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'TetrahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\tthis.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tTetrahedronGeometry.prototype = Object.create( Geometry.prototype );\n\tTetrahedronGeometry.prototype.constructor = TetrahedronGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction OctahedronBufferGeometry( radius,detail ) {\n\n\t\tvar vertices = [\n\t\t\t1, 0, 0, - 1, 0, 0, 0, 1, 0, 0, - 1, 0, 0, 0, 1, 0, 0, - 1\n\t\t];\n\n\t\tvar indices = [\n\t\t\t0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2\n\t\t];\n\n\t\tPolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );\n\n\t\tthis.type = 'OctahedronBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tOctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );\n\tOctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry;\n\n\t/**\n\t * @author timothypratley / https://github.com/timothypratley\n\t */\n\n\tfunction OctahedronGeometry( radius, detail ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'OctahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\tthis.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tOctahedronGeometry.prototype = Object.create( Geometry.prototype );\n\tOctahedronGeometry.prototype.constructor = OctahedronGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction IcosahedronBufferGeometry( radius, detail ) {\n\n\t\tvar t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\n\t\tvar vertices = [\n\t\t\t- 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0,\n\t\t\t 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t,\n\t\t\t t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1\n\t\t];\n\n\t\tvar indices = [\n\t\t\t 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11,\n\t\t\t 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8,\n\t\t\t 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9,\n\t\t\t 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1\n\t\t];\n\n\t\tPolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );\n\n\t\tthis.type = 'IcosahedronBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tIcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );\n\tIcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry;\n\n\t/**\n\t * @author timothypratley / https://github.com/timothypratley\n\t */\n\n\tfunction IcosahedronGeometry( radius, detail ) {\n\n\t \tGeometry.call( this );\n\n\t\tthis.type = 'IcosahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\tthis.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tIcosahedronGeometry.prototype = Object.create( Geometry.prototype );\n\tIcosahedronGeometry.prototype.constructor = IcosahedronGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction DodecahedronBufferGeometry( radius, detail ) {\n\n\t\tvar t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\t\tvar r = 1 / t;\n\n\t\tvar vertices = [\n\n\t\t\t// (±1, ±1, ±1)\n\t\t\t- 1, - 1, - 1, - 1, - 1, 1,\n\t\t\t- 1, 1, - 1, - 1, 1, 1,\n\t\t\t 1, - 1, - 1, 1, - 1, 1,\n\t\t\t 1, 1, - 1, 1, 1, 1,\n\n\t\t\t// (0, ±1/φ, ±φ)\n\t\t\t 0, - r, - t, 0, - r, t,\n\t\t\t 0, r, - t, 0, r, t,\n\n\t\t\t// (±1/φ, ±φ, 0)\n\t\t\t- r, - t, 0, - r, t, 0,\n\t\t\t r, - t, 0, r, t, 0,\n\n\t\t\t// (±φ, 0, ±1/φ)\n\t\t\t- t, 0, - r, t, 0, - r,\n\t\t\t- t, 0, r, t, 0, r\n\t\t];\n\n\t\tvar indices = [\n\t\t\t 3, 11, 7, 3, 7, 15, 3, 15, 13,\n\t\t\t 7, 19, 17, 7, 17, 6, 7, 6, 15,\n\t\t\t17, 4, 8, 17, 8, 10, 17, 10, 6,\n\t\t\t 8, 0, 16, 8, 16, 2, 8, 2, 10,\n\t\t\t 0, 12, 1, 0, 1, 18, 0, 18, 16,\n\t\t\t 6, 10, 2, 6, 2, 13, 6, 13, 15,\n\t\t\t 2, 16, 18, 2, 18, 3, 2, 3, 13,\n\t\t\t18, 1, 9, 18, 9, 11, 18, 11, 3,\n\t\t\t 4, 14, 12, 4, 12, 0, 4, 0, 8,\n\t\t\t11, 9, 5, 11, 5, 19, 11, 19, 7,\n\t\t\t19, 5, 14, 19, 14, 4, 19, 4, 17,\n\t\t\t 1, 12, 14, 1, 14, 5, 1, 5, 9\n\t\t];\n\n\t\tPolyhedronBufferGeometry.call( this, vertices, indices, radius, detail );\n\n\t\tthis.type = 'DodecahedronBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tDodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype );\n\tDodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry;\n\n\t/**\n\t * @author Abe Pazos / https://hamoid.com\n\t */\n\n\tfunction DodecahedronGeometry( radius, detail ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'DodecahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\tthis.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tDodecahedronGeometry.prototype = Object.create( Geometry.prototype );\n\tDodecahedronGeometry.prototype.constructor = DodecahedronGeometry;\n\n\t/**\n\t * @author clockworkgeek / https://github.com/clockworkgeek\n\t * @author timothypratley / https://github.com/timothypratley\n\t * @author WestLangley / http://github.com/WestLangley\n\t*/\n\n\tfunction PolyhedronGeometry( vertices, indices, radius, detail ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'PolyhedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tvertices: vertices,\n\t\t\tindices: indices,\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\tthis.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tPolyhedronGeometry.prototype = Object.create( Geometry.prototype );\n\tPolyhedronGeometry.prototype.constructor = PolyhedronGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t *\n\t * Creates a tube which extrudes along a 3d spline.\n\t *\n\t */\n\n\tfunction TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'TubeBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpath: path,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradius: radius,\n\t\t\tradialSegments: radialSegments,\n\t\t\tclosed: closed\n\t\t};\n\n\t\ttubularSegments = tubularSegments || 64;\n\t\tradius = radius || 1;\n\t\tradialSegments = radialSegments || 8;\n\t\tclosed = closed || false;\n\n\t\tvar frames = path.computeFrenetFrames( tubularSegments, closed );\n\n\t\t// expose internals\n\n\t\tthis.tangents = frames.tangents;\n\t\tthis.normals = frames.normals;\n\t\tthis.binormals = frames.binormals;\n\n\t\t// helper variables\n\n\t\tvar vertex = new Vector3();\n\t\tvar normal = new Vector3();\n\t\tvar uv = new Vector2();\n\n\t\tvar i, j;\n\n\t\t// buffer\n\n\t\tvar vertices = [];\n\t\tvar normals = [];\n\t\tvar uvs = [];\n\t\tvar indices = [];\n\n\t\t// create buffer data\n\n\t\tgenerateBufferData();\n\n\t\t// build geometry\n\n\t\tthis.setIndex( ( indices.length > 65535 ? Uint32Attribute : Uint16Attribute )( indices, 1 ) );\n\t\tthis.addAttribute( 'position', Float32Attribute( vertices, 3 ) );\n\t\tthis.addAttribute( 'normal', Float32Attribute( normals, 3 ) );\n\t\tthis.addAttribute( 'uv', Float32Attribute( uvs, 2 ) );\n\n\t\t// functions\n\n\t\tfunction generateBufferData() {\n\n\t\t\tfor ( i = 0; i < tubularSegments; i ++ ) {\n\n\t\t\t\tgenerateSegment( i );\n\n\t\t\t}\n\n\t\t\t// if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t// at the regular position on the given path\n\t\t\t//\n\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\t\t\tgenerateSegment( ( closed === false ) ? tubularSegments : 0 );\n\n\t\t\t// uvs are generated in a separate function.\n\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\tgenerateUVs();\n\n\t\t\t// finally create faces\n\n\t\t\tgenerateIndices();\n\n\t\t}\n\n\t\tfunction generateSegment( i ) {\n\n\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\n\t\t\tvar P = path.getPointAt( i / tubularSegments );\n\n\t\t\t// retrieve corresponding normal and binormal\n\n\t\t\tvar N = frames.normals[ i ];\n\t\t\tvar B = frames.binormals[ i ];\n\n\t\t\t// generate normals and vertices for the current segment\n\n\t\t\tfor ( j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\tvar v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\tvar sin = Math.sin( v );\n\t\t\t\tvar cos = - Math.cos( v );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.x = ( cos * N.x + sin * B.x );\n\t\t\t\tnormal.y = ( cos * N.y + sin * B.y );\n\t\t\t\tnormal.z = ( cos * N.z + sin * B.z );\n\t\t\t\tnormal.normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\tvertex.z = P.z + radius * normal.z;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateIndices() {\n\n\t\t\tfor ( j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\t\tfor ( i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t\tvar a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\t\tvar b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\t\tvar c = ( radialSegments + 1 ) * j + i;\n\t\t\t\t\tvar d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tfor ( i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tfor ( j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\tuv.y = j / radialSegments;\n\n\t\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tTubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tTubeBufferGeometry.prototype.constructor = TubeBufferGeometry;\n\n\t/**\n\t * @author oosmoxiecode / https://github.com/oosmoxiecode\n\t * @author WestLangley / https://github.com/WestLangley\n\t * @author zz85 / https://github.com/zz85\n\t * @author miningold / https://github.com/miningold\n\t * @author jonobr1 / https://github.com/jonobr1\n\t *\n\t * Creates a tube which extrudes along a 3d spline.\n\t */\n\n\tfunction TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'TubeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpath: path,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradius: radius,\n\t\t\tradialSegments: radialSegments,\n\t\t\tclosed: closed\n\t\t};\n\n\t\tif ( taper !== undefined ) console.warn( 'THREE.TubeGeometry: taper has been removed.' );\n\n\t\tvar bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed );\n\n\t\t// expose internals\n\n\t\tthis.tangents = bufferGeometry.tangents;\n\t\tthis.normals = bufferGeometry.normals;\n\t\tthis.binormals = bufferGeometry.binormals;\n\n\t\t// create geometry\n\n\t\tthis.fromBufferGeometry( bufferGeometry );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tTubeGeometry.prototype = Object.create( Geometry.prototype );\n\tTubeGeometry.prototype.constructor = TubeGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t *\n\t * see: http://www.blackpawn.com/texts/pqtorus/\n\t */\n\tfunction TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'TorusKnotBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\tp: p,\n\t\t\tq: q\n\t\t};\n\n\t\tradius = radius || 100;\n\t\ttube = tube || 40;\n\t\ttubularSegments = Math.floor( tubularSegments ) || 64;\n\t\tradialSegments = Math.floor( radialSegments ) || 8;\n\t\tp = p || 2;\n\t\tq = q || 3;\n\n\t\t// used to calculate buffer length\n\t\tvar vertexCount = ( ( radialSegments + 1 ) * ( tubularSegments + 1 ) );\n\t\tvar indexCount = radialSegments * tubularSegments * 2 * 3;\n\n\t\t// buffers\n\t\tvar indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ) , 1 );\n\t\tvar vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 );\n\n\t\t// helper variables\n\t\tvar i, j, index = 0, indexOffset = 0;\n\n\t\tvar vertex = new Vector3();\n\t\tvar normal = new Vector3();\n\t\tvar uv = new Vector2();\n\n\t\tvar P1 = new Vector3();\n\t\tvar P2 = new Vector3();\n\n\t\tvar B = new Vector3();\n\t\tvar T = new Vector3();\n\t\tvar N = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( i = 0; i <= tubularSegments; ++ i ) {\n\n\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segement\n\n\t\t\tvar u = i / tubularSegments * p * Math.PI * 2;\n\n\t\t\t// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\tcalculatePositionOnCurve( u, p, q, radius, P1 );\n\t\t\tcalculatePositionOnCurve( u + 0.01, p, q, radius, P2 );\n\n\t\t\t// calculate orthonormal basis\n\n\t\t\tT.subVectors( P2, P1 );\n\t\t\tN.addVectors( P2, P1 );\n\t\t\tB.crossVectors( T, N );\n\t\t\tN.crossVectors( B, T );\n\n\t\t\t// normalize B, N. T can be ignored, we don't use it\n\n\t\t\tB.normalize();\n\t\t\tN.normalize();\n\n\t\t\tfor ( j = 0; j <= radialSegments; ++ j ) {\n\n\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\n\t\t\t\tvar v = j / radialSegments * Math.PI * 2;\n\t\t\t\tvar cx = - tube * Math.cos( v );\n\t\t\t\tvar cy = tube * Math.sin( v );\n\n\t\t\t\t// now calculate the final vertex position.\n\t\t\t\t// first we orient the extrusion with our basis vectos, then we add it to the current position on the curve\n\n\t\t\t\tvertex.x = P1.x + ( cx * N.x + cy * B.x );\n\t\t\t\tvertex.y = P1.y + ( cx * N.y + cy * B.y );\n\t\t\t\tvertex.z = P1.z + ( cx * N.z + cy * B.z );\n\n\t\t\t\t// vertex\n\t\t\t\tvertices.setXYZ( index, vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\t\t\t\tnormal.subVectors( vertex, P1 ).normalize();\n\t\t\t\tnormals.setXYZ( index, normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\tuv.y = j / radialSegments;\n\t\t\t\tuvs.setXY( index, uv.x, uv.y );\n\n\t\t\t\t// increase index\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\tfor ( i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t// indices\n\t\t\t\tvar a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\tvar b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\tvar c = ( radialSegments + 1 ) * j + i;\n\t\t\t\tvar d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t// face one\n\t\t\t\tindices.setX( indexOffset, a ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, b ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, d ); indexOffset++;\n\n\t\t\t\t// face two\n\t\t\t\tindices.setX( indexOffset, b ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, c ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, d ); indexOffset++;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.addAttribute( 'position', vertices );\n\t\tthis.addAttribute( 'normal', normals );\n\t\tthis.addAttribute( 'uv', uvs );\n\n\t\t// this function calculates the current position on the torus curve\n\n\t\tfunction calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}\n\n\t}\n\n\tTorusKnotBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tTorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry;\n\n\t/**\n\t * @author oosmoxiecode\n\t */\n\n\tfunction TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'TorusKnotGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\tp: p,\n\t\t\tq: q\n\t\t};\n\n\t\tif( heightScale !== undefined ) console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' );\n\n\t\tthis.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tTorusKnotGeometry.prototype = Object.create( Geometry.prototype );\n\tTorusKnotGeometry.prototype.constructor = TorusKnotGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'TorusBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tradius = radius || 100;\n\t\ttube = tube || 40;\n\t\tradialSegments = Math.floor( radialSegments ) || 8;\n\t\ttubularSegments = Math.floor( tubularSegments ) || 6;\n\t\tarc = arc || Math.PI * 2;\n\n\t\t// used to calculate buffer length\n\t\tvar vertexCount = ( ( radialSegments + 1 ) * ( tubularSegments + 1 ) );\n\t\tvar indexCount = radialSegments * tubularSegments * 2 * 3;\n\n\t\t// buffers\n\t\tvar indices = new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount );\n\t\tvar vertices = new Float32Array( vertexCount * 3 );\n\t\tvar normals = new Float32Array( vertexCount * 3 );\n\t\tvar uvs = new Float32Array( vertexCount * 2 );\n\n\t\t// offset variables\n\t\tvar vertexBufferOffset = 0;\n\t\tvar uvBufferOffset = 0;\n\t\tvar indexBufferOffset = 0;\n\n\t\t// helper variables\n\t\tvar center = new Vector3();\n\t\tvar vertex = new Vector3();\n\t\tvar normal = new Vector3();\n\n\t\tvar j, i;\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tvar u = i / tubularSegments * arc;\n\t\t\t\tvar v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\t// vertex\n\t\t\t\tvertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u );\n\t\t\t\tvertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u );\n\t\t\t\tvertex.z = tube * Math.sin( v );\n\n\t\t\t\tvertices[ vertexBufferOffset ] = vertex.x;\n\t\t\t\tvertices[ vertexBufferOffset + 1 ] = vertex.y;\n\t\t\t\tvertices[ vertexBufferOffset + 2 ] = vertex.z;\n\n\t\t\t\t// this vector is used to calculate the normal\n\t\t\t\tcenter.x = radius * Math.cos( u );\n\t\t\t\tcenter.y = radius * Math.sin( u );\n\n\t\t\t\t// normal\n\t\t\t\tnormal.subVectors( vertex, center ).normalize();\n\n\t\t\t\tnormals[ vertexBufferOffset ] = normal.x;\n\t\t\t\tnormals[ vertexBufferOffset + 1 ] = normal.y;\n\t\t\t\tnormals[ vertexBufferOffset + 2 ] = normal.z;\n\n\t\t\t\t// uv\n\t\t\t\tuvs[ uvBufferOffset ] = i / tubularSegments;\n\t\t\t\tuvs[ uvBufferOffset + 1 ] = j / radialSegments;\n\n\t\t\t\t// update offsets\n\t\t\t\tvertexBufferOffset += 3;\n\t\t\t\tuvBufferOffset += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( j = 1; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( i = 1; i <= tubularSegments; i ++ ) {\n\n\t\t\t\t// indices\n\t\t\t\tvar a = ( tubularSegments + 1 ) * j + i - 1;\n\t\t\t\tvar b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1;\n\t\t\t\tvar c = ( tubularSegments + 1 ) * ( j - 1 ) + i;\n\t\t\t\tvar d = ( tubularSegments + 1 ) * j + i;\n\n\t\t\t\t// face one\n\t\t\t\tindices[ indexBufferOffset ] = a;\n\t\t\t\tindices[ indexBufferOffset + 1 ] = b;\n\t\t\t\tindices[ indexBufferOffset + 2 ] = d;\n\n\t\t\t\t// face two\n\t\t\t\tindices[ indexBufferOffset + 3 ] = b;\n\t\t\t\tindices[ indexBufferOffset + 4 ] = c;\n\t\t\t\tindices[ indexBufferOffset + 5 ] = d;\n\n\t\t\t\t// update offset\n\t\t\t\tindexBufferOffset += 6;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\t\tthis.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tthis.addAttribute( 'position', new BufferAttribute( vertices, 3 ) );\n\t\tthis.addAttribute( 'normal', new BufferAttribute( normals, 3 ) );\n\t\tthis.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tTorusBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tTorusBufferGeometry.prototype.constructor = TorusBufferGeometry;\n\n\t/**\n\t * @author oosmoxiecode\n\t * @author mrdoob / http://mrdoob.com/\n\t * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888\n\t */\n\n\tfunction TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'TorusGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tthis.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) );\n\n\t}\n\n\tTorusGeometry.prototype = Object.create( Geometry.prototype );\n\tTorusGeometry.prototype.constructor = TorusGeometry;\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t */\n\n\tvar ShapeUtils = {\n\n\t\t// calculate area of the contour polygon\n\n\t\tarea: function ( contour ) {\n\n\t\t\tvar n = contour.length;\n\t\t\tvar a = 0.0;\n\n\t\t\tfor ( var p = n - 1, q = 0; q < n; p = q ++ ) {\n\n\t\t\t\ta += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y;\n\n\t\t\t}\n\n\t\t\treturn a * 0.5;\n\n\t\t},\n\n\t\ttriangulate: ( function () {\n\n\t\t\t/**\n\t\t\t * This code is a quick port of code written in C++ which was submitted to\n\t\t\t * flipcode.com by John W. Ratcliff // July 22, 2000\n\t\t\t * See original code and more information here:\n\t\t\t * http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml\n\t\t\t *\n\t\t\t * ported to actionscript by Zevan Rosser\n\t\t\t * www.actionsnippet.com\n\t\t\t *\n\t\t\t * ported to javascript by Joshua Koo\n\t\t\t * http://www.lab4games.net/zz85/blog\n\t\t\t *\n\t\t\t */\n\n\t\t\tfunction snip( contour, u, v, w, n, verts ) {\n\n\t\t\t\tvar p;\n\t\t\t\tvar ax, ay, bx, by;\n\t\t\t\tvar cx, cy, px, py;\n\n\t\t\t\tax = contour[ verts[ u ] ].x;\n\t\t\t\tay = contour[ verts[ u ] ].y;\n\n\t\t\t\tbx = contour[ verts[ v ] ].x;\n\t\t\t\tby = contour[ verts[ v ] ].y;\n\n\t\t\t\tcx = contour[ verts[ w ] ].x;\n\t\t\t\tcy = contour[ verts[ w ] ].y;\n\n\t\t\t\tif ( ( bx - ax ) * ( cy - ay ) - ( by - ay ) * ( cx - ax ) <= 0 ) return false;\n\n\t\t\t\tvar aX, aY, bX, bY, cX, cY;\n\t\t\t\tvar apx, apy, bpx, bpy, cpx, cpy;\n\t\t\t\tvar cCROSSap, bCROSScp, aCROSSbp;\n\n\t\t\t\taX = cx - bx; aY = cy - by;\n\t\t\t\tbX = ax - cx; bY = ay - cy;\n\t\t\t\tcX = bx - ax; cY = by - ay;\n\n\t\t\t\tfor ( p = 0; p < n; p ++ ) {\n\n\t\t\t\t\tpx = contour[ verts[ p ] ].x;\n\t\t\t\t\tpy = contour[ verts[ p ] ].y;\n\n\t\t\t\t\tif ( ( ( px === ax ) && ( py === ay ) ) ||\n\t\t\t\t\t\t ( ( px === bx ) && ( py === by ) ) ||\n\t\t\t\t\t\t ( ( px === cx ) && ( py === cy ) ) )\tcontinue;\n\n\t\t\t\t\tapx = px - ax; apy = py - ay;\n\t\t\t\t\tbpx = px - bx; bpy = py - by;\n\t\t\t\t\tcpx = px - cx; cpy = py - cy;\n\n\t\t\t\t\t// see if p is inside triangle abc\n\n\t\t\t\t\taCROSSbp = aX * bpy - aY * bpx;\n\t\t\t\t\tcCROSSap = cX * apy - cY * apx;\n\t\t\t\t\tbCROSScp = bX * cpy - bY * cpx;\n\n\t\t\t\t\tif ( ( aCROSSbp >= - Number.EPSILON ) && ( bCROSScp >= - Number.EPSILON ) && ( cCROSSap >= - Number.EPSILON ) ) return false;\n\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t\t// takes in an contour array and returns\n\n\t\t\treturn function triangulate( contour, indices ) {\n\n\t\t\t\tvar n = contour.length;\n\n\t\t\t\tif ( n < 3 ) return null;\n\n\t\t\t\tvar result = [],\n\t\t\t\t\tverts = [],\n\t\t\t\t\tvertIndices = [];\n\n\t\t\t\t/* we want a counter-clockwise polygon in verts */\n\n\t\t\t\tvar u, v, w;\n\n\t\t\t\tif ( ShapeUtils.area( contour ) > 0.0 ) {\n\n\t\t\t\t\tfor ( v = 0; v < n; v ++ ) verts[ v ] = v;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfor ( v = 0; v < n; v ++ ) verts[ v ] = ( n - 1 ) - v;\n\n\t\t\t\t}\n\n\t\t\t\tvar nv = n;\n\n\t\t\t\t/* remove nv - 2 vertices, creating 1 triangle every time */\n\n\t\t\t\tvar count = 2 * nv; /* error detection */\n\n\t\t\t\tfor ( v = nv - 1; nv > 2; ) {\n\n\t\t\t\t\t/* if we loop, it is probably a non-simple polygon */\n\n\t\t\t\t\tif ( ( count -- ) <= 0 ) {\n\n\t\t\t\t\t\t//** Triangulate: ERROR - probable bad polygon!\n\n\t\t\t\t\t\t//throw ( \"Warning, unable to triangulate polygon!\" );\n\t\t\t\t\t\t//return null;\n\t\t\t\t\t\t// Sometimes warning is fine, especially polygons are triangulated in reverse.\n\t\t\t\t\t\tconsole.warn( 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()' );\n\n\t\t\t\t\t\tif ( indices ) return vertIndices;\n\t\t\t\t\t\treturn result;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t/* three consecutive vertices in current polygon, */\n\n\t\t\t\t\tu = v; \t \tif ( nv <= u ) u = 0; /* previous */\n\t\t\t\t\tv = u + 1; if ( nv <= v ) v = 0; /* new v */\n\t\t\t\t\tw = v + 1; if ( nv <= w ) w = 0; /* next */\n\n\t\t\t\t\tif ( snip( contour, u, v, w, nv, verts ) ) {\n\n\t\t\t\t\t\tvar a, b, c, s, t;\n\n\t\t\t\t\t\t/* true names of the vertices */\n\n\t\t\t\t\t\ta = verts[ u ];\n\t\t\t\t\t\tb = verts[ v ];\n\t\t\t\t\t\tc = verts[ w ];\n\n\t\t\t\t\t\t/* output Triangle */\n\n\t\t\t\t\t\tresult.push( [ contour[ a ],\n\t\t\t\t\t\t\tcontour[ b ],\n\t\t\t\t\t\t\tcontour[ c ] ] );\n\n\n\t\t\t\t\t\tvertIndices.push( [ verts[ u ], verts[ v ], verts[ w ] ] );\n\n\t\t\t\t\t\t/* remove v from the remaining polygon */\n\n\t\t\t\t\t\tfor ( s = v, t = v + 1; t < nv; s ++, t ++ ) {\n\n\t\t\t\t\t\t\tverts[ s ] = verts[ t ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnv --;\n\n\t\t\t\t\t\t/* reset error detection counter */\n\n\t\t\t\t\t\tcount = 2 * nv;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( indices ) return vertIndices;\n\t\t\t\treturn result;\n\n\t\t\t}\n\n\t\t} )(),\n\n\t\ttriangulateShape: function ( contour, holes ) {\n\n\t\t\tfunction removeDupEndPts(points) {\n\n\t\t\t\tvar l = points.length;\n\n\t\t\t\tif ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {\n\n\t\t\t\t\tpoints.pop();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tremoveDupEndPts( contour );\n\t\t\tholes.forEach( removeDupEndPts );\n\n\t\t\tfunction point_in_segment_2D_colin( inSegPt1, inSegPt2, inOtherPt ) {\n\n\t\t\t\t// inOtherPt needs to be collinear to the inSegment\n\t\t\t\tif ( inSegPt1.x !== inSegPt2.x ) {\n\n\t\t\t\t\tif ( inSegPt1.x < inSegPt2.x ) {\n\n\t\t\t\t\t\treturn\t( ( inSegPt1.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt2.x ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\treturn\t( ( inSegPt2.x <= inOtherPt.x ) && ( inOtherPt.x <= inSegPt1.x ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( inSegPt1.y < inSegPt2.y ) {\n\n\t\t\t\t\t\treturn\t( ( inSegPt1.y <= inOtherPt.y ) && ( inOtherPt.y <= inSegPt2.y ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\treturn\t( ( inSegPt2.y <= inOtherPt.y ) && ( inOtherPt.y <= inSegPt1.y ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction intersect_segments_2D( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1, inSeg2Pt2, inExcludeAdjacentSegs ) {\n\n\t\t\t\tvar seg1dx = inSeg1Pt2.x - inSeg1Pt1.x, seg1dy = inSeg1Pt2.y - inSeg1Pt1.y;\n\t\t\t\tvar seg2dx = inSeg2Pt2.x - inSeg2Pt1.x, seg2dy = inSeg2Pt2.y - inSeg2Pt1.y;\n\n\t\t\t\tvar seg1seg2dx = inSeg1Pt1.x - inSeg2Pt1.x;\n\t\t\t\tvar seg1seg2dy = inSeg1Pt1.y - inSeg2Pt1.y;\n\n\t\t\t\tvar limit\t\t= seg1dy * seg2dx - seg1dx * seg2dy;\n\t\t\t\tvar perpSeg1\t= seg1dy * seg1seg2dx - seg1dx * seg1seg2dy;\n\n\t\t\t\tif ( Math.abs( limit ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not parallel\n\n\t\t\t\t\tvar perpSeg2;\n\t\t\t\t\tif ( limit > 0 ) {\n\n\t\t\t\t\t\tif ( ( perpSeg1 < 0 ) || ( perpSeg1 > limit ) ) \t\treturn [];\n\t\t\t\t\t\tperpSeg2 = seg2dy * seg1seg2dx - seg2dx * seg1seg2dy;\n\t\t\t\t\t\tif ( ( perpSeg2 < 0 ) || ( perpSeg2 > limit ) ) \t\treturn [];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( ( perpSeg1 > 0 ) || ( perpSeg1 < limit ) ) \t\treturn [];\n\t\t\t\t\t\tperpSeg2 = seg2dy * seg1seg2dx - seg2dx * seg1seg2dy;\n\t\t\t\t\t\tif ( ( perpSeg2 > 0 ) || ( perpSeg2 < limit ) ) \t\treturn [];\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// i.e. to reduce rounding errors\n\t\t\t\t\t// intersection at endpoint of segment#1?\n\t\t\t\t\tif ( perpSeg2 === 0 ) {\n\n\t\t\t\t\t\tif ( ( inExcludeAdjacentSegs ) &&\n\t\t\t\t\t\t\t ( ( perpSeg1 === 0 ) || ( perpSeg1 === limit ) ) )\t\treturn [];\n\t\t\t\t\t\treturn [ inSeg1Pt1 ];\n\n\t\t\t\t\t}\n\t\t\t\t\tif ( perpSeg2 === limit ) {\n\n\t\t\t\t\t\tif ( ( inExcludeAdjacentSegs ) &&\n\t\t\t\t\t\t\t ( ( perpSeg1 === 0 ) || ( perpSeg1 === limit ) ) )\t\treturn [];\n\t\t\t\t\t\treturn [ inSeg1Pt2 ];\n\n\t\t\t\t\t}\n\t\t\t\t\t// intersection at endpoint of segment#2?\n\t\t\t\t\tif ( perpSeg1 === 0 )\t\treturn [ inSeg2Pt1 ];\n\t\t\t\t\tif ( perpSeg1 === limit )\treturn [ inSeg2Pt2 ];\n\n\t\t\t\t\t// return real intersection point\n\t\t\t\t\tvar factorSeg1 = perpSeg2 / limit;\n\t\t\t\t\treturn\t[ { x: inSeg1Pt1.x + factorSeg1 * seg1dx,\n\t\t\t\t\t\t\t\ty: inSeg1Pt1.y + factorSeg1 * seg1dy } ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// parallel or collinear\n\t\t\t\t\tif ( ( perpSeg1 !== 0 ) ||\n\t\t\t\t\t\t ( seg2dy * seg1seg2dx !== seg2dx * seg1seg2dy ) ) \t\t\treturn [];\n\n\t\t\t\t\t// they are collinear or degenerate\n\t\t\t\t\tvar seg1Pt = ( ( seg1dx === 0 ) && ( seg1dy === 0 ) );\t// segment1 is just a point?\n\t\t\t\t\tvar seg2Pt = ( ( seg2dx === 0 ) && ( seg2dy === 0 ) );\t// segment2 is just a point?\n\t\t\t\t\t// both segments are points\n\t\t\t\t\tif ( seg1Pt && seg2Pt ) {\n\n\t\t\t\t\t\tif ( ( inSeg1Pt1.x !== inSeg2Pt1.x ) ||\n\t\t\t\t\t\t\t ( inSeg1Pt1.y !== inSeg2Pt1.y ) )\t\treturn [];\t// they are distinct points\n\t\t\t\t\t\treturn [ inSeg1Pt1 ]; \t\t\t\t\t\t// they are the same point\n\n\t\t\t\t\t}\n\t\t\t\t\t// segment#1 is a single point\n\t\t\t\t\tif ( seg1Pt ) {\n\n\t\t\t\t\t\tif ( ! point_in_segment_2D_colin( inSeg2Pt1, inSeg2Pt2, inSeg1Pt1 ) )\t\treturn [];\t\t// but not in segment#2\n\t\t\t\t\t\treturn [ inSeg1Pt1 ];\n\n\t\t\t\t\t}\n\t\t\t\t\t// segment#2 is a single point\n\t\t\t\t\tif ( seg2Pt ) {\n\n\t\t\t\t\t\tif ( ! point_in_segment_2D_colin( inSeg1Pt1, inSeg1Pt2, inSeg2Pt1 ) )\t\treturn [];\t\t// but not in segment#1\n\t\t\t\t\t\treturn [ inSeg2Pt1 ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// they are collinear segments, which might overlap\n\t\t\t\t\tvar seg1min, seg1max, seg1minVal, seg1maxVal;\n\t\t\t\t\tvar seg2min, seg2max, seg2minVal, seg2maxVal;\n\t\t\t\t\tif ( seg1dx !== 0 ) {\n\n\t\t\t\t\t\t// the segments are NOT on a vertical line\n\t\t\t\t\t\tif ( inSeg1Pt1.x < inSeg1Pt2.x ) {\n\n\t\t\t\t\t\t\tseg1min = inSeg1Pt1; seg1minVal = inSeg1Pt1.x;\n\t\t\t\t\t\t\tseg1max = inSeg1Pt2; seg1maxVal = inSeg1Pt2.x;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tseg1min = inSeg1Pt2; seg1minVal = inSeg1Pt2.x;\n\t\t\t\t\t\t\tseg1max = inSeg1Pt1; seg1maxVal = inSeg1Pt1.x;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( inSeg2Pt1.x < inSeg2Pt2.x ) {\n\n\t\t\t\t\t\t\tseg2min = inSeg2Pt1; seg2minVal = inSeg2Pt1.x;\n\t\t\t\t\t\t\tseg2max = inSeg2Pt2; seg2maxVal = inSeg2Pt2.x;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tseg2min = inSeg2Pt2; seg2minVal = inSeg2Pt2.x;\n\t\t\t\t\t\t\tseg2max = inSeg2Pt1; seg2maxVal = inSeg2Pt1.x;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// the segments are on a vertical line\n\t\t\t\t\t\tif ( inSeg1Pt1.y < inSeg1Pt2.y ) {\n\n\t\t\t\t\t\t\tseg1min = inSeg1Pt1; seg1minVal = inSeg1Pt1.y;\n\t\t\t\t\t\t\tseg1max = inSeg1Pt2; seg1maxVal = inSeg1Pt2.y;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tseg1min = inSeg1Pt2; seg1minVal = inSeg1Pt2.y;\n\t\t\t\t\t\t\tseg1max = inSeg1Pt1; seg1maxVal = inSeg1Pt1.y;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( inSeg2Pt1.y < inSeg2Pt2.y ) {\n\n\t\t\t\t\t\t\tseg2min = inSeg2Pt1; seg2minVal = inSeg2Pt1.y;\n\t\t\t\t\t\t\tseg2max = inSeg2Pt2; seg2maxVal = inSeg2Pt2.y;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tseg2min = inSeg2Pt2; seg2minVal = inSeg2Pt2.y;\n\t\t\t\t\t\t\tseg2max = inSeg2Pt1; seg2maxVal = inSeg2Pt1.y;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif ( seg1minVal <= seg2minVal ) {\n\n\t\t\t\t\t\tif ( seg1maxVal < seg2minVal )\treturn [];\n\t\t\t\t\t\tif ( seg1maxVal === seg2minVal )\t{\n\n\t\t\t\t\t\t\tif ( inExcludeAdjacentSegs )\t\treturn [];\n\t\t\t\t\t\t\treturn [ seg2min ];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( seg1maxVal <= seg2maxVal )\treturn [ seg2min, seg1max ];\n\t\t\t\t\t\treturn\t[ seg2min, seg2max ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( seg1minVal > seg2maxVal )\treturn [];\n\t\t\t\t\t\tif ( seg1minVal === seg2maxVal )\t{\n\n\t\t\t\t\t\t\tif ( inExcludeAdjacentSegs )\t\treturn [];\n\t\t\t\t\t\t\treturn [ seg1min ];\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( seg1maxVal <= seg2maxVal )\treturn [ seg1min, seg1max ];\n\t\t\t\t\t\treturn\t[ seg1min, seg2max ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction isPointInsideAngle( inVertex, inLegFromPt, inLegToPt, inOtherPt ) {\n\n\t\t\t\t// The order of legs is important\n\n\t\t\t\t// translation of all points, so that Vertex is at (0,0)\n\t\t\t\tvar legFromPtX\t= inLegFromPt.x - inVertex.x, legFromPtY\t= inLegFromPt.y - inVertex.y;\n\t\t\t\tvar legToPtX\t= inLegToPt.x\t- inVertex.x, legToPtY\t\t= inLegToPt.y\t- inVertex.y;\n\t\t\t\tvar otherPtX\t= inOtherPt.x\t- inVertex.x, otherPtY\t\t= inOtherPt.y\t- inVertex.y;\n\n\t\t\t\t// main angle >0: < 180 deg.; 0: 180 deg.; <0: > 180 deg.\n\t\t\t\tvar from2toAngle\t= legFromPtX * legToPtY - legFromPtY * legToPtX;\n\t\t\t\tvar from2otherAngle\t= legFromPtX * otherPtY - legFromPtY * otherPtX;\n\n\t\t\t\tif ( Math.abs( from2toAngle ) > Number.EPSILON ) {\n\n\t\t\t\t\t// angle != 180 deg.\n\n\t\t\t\t\tvar other2toAngle\t\t= otherPtX * legToPtY - otherPtY * legToPtX;\n\t\t\t\t\t// console.log( \"from2to: \" + from2toAngle + \", from2other: \" + from2otherAngle + \", other2to: \" + other2toAngle );\n\n\t\t\t\t\tif ( from2toAngle > 0 ) {\n\n\t\t\t\t\t\t// main angle < 180 deg.\n\t\t\t\t\t\treturn\t( ( from2otherAngle >= 0 ) && ( other2toAngle >= 0 ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// main angle > 180 deg.\n\t\t\t\t\t\treturn\t( ( from2otherAngle >= 0 ) || ( other2toAngle >= 0 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// angle == 180 deg.\n\t\t\t\t\t// console.log( \"from2to: 180 deg., from2other: \" + from2otherAngle );\n\t\t\t\t\treturn\t( from2otherAngle > 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\tfunction removeHoles( contour, holes ) {\n\n\t\t\t\tvar shape = contour.concat(); // work on this shape\n\t\t\t\tvar hole;\n\n\t\t\t\tfunction isCutLineInsideAngles( inShapeIdx, inHoleIdx ) {\n\n\t\t\t\t\t// Check if hole point lies within angle around shape point\n\t\t\t\t\tvar lastShapeIdx = shape.length - 1;\n\n\t\t\t\t\tvar prevShapeIdx = inShapeIdx - 1;\n\t\t\t\t\tif ( prevShapeIdx < 0 )\t\t\tprevShapeIdx = lastShapeIdx;\n\n\t\t\t\t\tvar nextShapeIdx = inShapeIdx + 1;\n\t\t\t\t\tif ( nextShapeIdx > lastShapeIdx )\tnextShapeIdx = 0;\n\n\t\t\t\t\tvar insideAngle = isPointInsideAngle( shape[ inShapeIdx ], shape[ prevShapeIdx ], shape[ nextShapeIdx ], hole[ inHoleIdx ] );\n\t\t\t\t\tif ( ! insideAngle ) {\n\n\t\t\t\t\t\t// console.log( \"Vertex (Shape): \" + inShapeIdx + \", Point: \" + hole[inHoleIdx].x + \"/\" + hole[inHoleIdx].y );\n\t\t\t\t\t\treturn\tfalse;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if shape point lies within angle around hole point\n\t\t\t\t\tvar lastHoleIdx = hole.length - 1;\n\n\t\t\t\t\tvar prevHoleIdx = inHoleIdx - 1;\n\t\t\t\t\tif ( prevHoleIdx < 0 )\t\t\tprevHoleIdx = lastHoleIdx;\n\n\t\t\t\t\tvar nextHoleIdx = inHoleIdx + 1;\n\t\t\t\t\tif ( nextHoleIdx > lastHoleIdx )\tnextHoleIdx = 0;\n\n\t\t\t\t\tinsideAngle = isPointInsideAngle( hole[ inHoleIdx ], hole[ prevHoleIdx ], hole[ nextHoleIdx ], shape[ inShapeIdx ] );\n\t\t\t\t\tif ( ! insideAngle ) {\n\n\t\t\t\t\t\t// console.log( \"Vertex (Hole): \" + inHoleIdx + \", Point: \" + shape[inShapeIdx].x + \"/\" + shape[inShapeIdx].y );\n\t\t\t\t\t\treturn\tfalse;\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn\ttrue;\n\n\t\t\t\t}\n\n\t\t\t\tfunction intersectsShapeEdge( inShapePt, inHolePt ) {\n\n\t\t\t\t\t// checks for intersections with shape edges\n\t\t\t\t\tvar sIdx, nextIdx, intersection;\n\t\t\t\t\tfor ( sIdx = 0; sIdx < shape.length; sIdx ++ ) {\n\n\t\t\t\t\t\tnextIdx = sIdx + 1; nextIdx %= shape.length;\n\t\t\t\t\t\tintersection = intersect_segments_2D( inShapePt, inHolePt, shape[ sIdx ], shape[ nextIdx ], true );\n\t\t\t\t\t\tif ( intersection.length > 0 )\t\treturn\ttrue;\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn\tfalse;\n\n\t\t\t\t}\n\n\t\t\t\tvar indepHoles = [];\n\n\t\t\t\tfunction intersectsHoleEdge( inShapePt, inHolePt ) {\n\n\t\t\t\t\t// checks for intersections with hole edges\n\t\t\t\t\tvar ihIdx, chkHole,\n\t\t\t\t\t\thIdx, nextIdx, intersection;\n\t\t\t\t\tfor ( ihIdx = 0; ihIdx < indepHoles.length; ihIdx ++ ) {\n\n\t\t\t\t\t\tchkHole = holes[ indepHoles[ ihIdx ]];\n\t\t\t\t\t\tfor ( hIdx = 0; hIdx < chkHole.length; hIdx ++ ) {\n\n\t\t\t\t\t\t\tnextIdx = hIdx + 1; nextIdx %= chkHole.length;\n\t\t\t\t\t\t\tintersection = intersect_segments_2D( inShapePt, inHolePt, chkHole[ hIdx ], chkHole[ nextIdx ], true );\n\t\t\t\t\t\t\tif ( intersection.length > 0 )\t\treturn\ttrue;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\treturn\tfalse;\n\n\t\t\t\t}\n\n\t\t\t\tvar holeIndex, shapeIndex,\n\t\t\t\t\tshapePt, holePt,\n\t\t\t\t\tholeIdx, cutKey, failedCuts = [],\n\t\t\t\t\ttmpShape1, tmpShape2,\n\t\t\t\t\ttmpHole1, tmpHole2;\n\n\t\t\t\tfor ( var h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tindepHoles.push( h );\n\n\t\t\t\t}\n\n\t\t\t\tvar minShapeIndex = 0;\n\t\t\t\tvar counter = indepHoles.length * 2;\n\t\t\t\twhile ( indepHoles.length > 0 ) {\n\n\t\t\t\t\tcounter --;\n\t\t\t\t\tif ( counter < 0 ) {\n\n\t\t\t\t\t\tconsole.log( \"Infinite Loop! Holes left:\" + indepHoles.length + \", Probably Hole outside Shape!\" );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// search for shape-vertex and hole-vertex,\n\t\t\t\t\t// which can be connected without intersections\n\t\t\t\t\tfor ( shapeIndex = minShapeIndex; shapeIndex < shape.length; shapeIndex ++ ) {\n\n\t\t\t\t\t\tshapePt = shape[ shapeIndex ];\n\t\t\t\t\t\tholeIndex\t= - 1;\n\n\t\t\t\t\t\t// search for hole which can be reached without intersections\n\t\t\t\t\t\tfor ( var h = 0; h < indepHoles.length; h ++ ) {\n\n\t\t\t\t\t\t\tholeIdx = indepHoles[ h ];\n\n\t\t\t\t\t\t\t// prevent multiple checks\n\t\t\t\t\t\t\tcutKey = shapePt.x + \":\" + shapePt.y + \":\" + holeIdx;\n\t\t\t\t\t\t\tif ( failedCuts[ cutKey ] !== undefined )\t\t\tcontinue;\n\n\t\t\t\t\t\t\thole = holes[ holeIdx ];\n\t\t\t\t\t\t\tfor ( var h2 = 0; h2 < hole.length; h2 ++ ) {\n\n\t\t\t\t\t\t\t\tholePt = hole[ h2 ];\n\t\t\t\t\t\t\t\tif ( ! isCutLineInsideAngles( shapeIndex, h2 ) )\t\tcontinue;\n\t\t\t\t\t\t\t\tif ( intersectsShapeEdge( shapePt, holePt ) )\t\tcontinue;\n\t\t\t\t\t\t\t\tif ( intersectsHoleEdge( shapePt, holePt ) )\t\tcontinue;\n\n\t\t\t\t\t\t\t\tholeIndex = h2;\n\t\t\t\t\t\t\t\tindepHoles.splice( h, 1 );\n\n\t\t\t\t\t\t\t\ttmpShape1 = shape.slice( 0, shapeIndex + 1 );\n\t\t\t\t\t\t\t\ttmpShape2 = shape.slice( shapeIndex );\n\t\t\t\t\t\t\t\ttmpHole1 = hole.slice( holeIndex );\n\t\t\t\t\t\t\t\ttmpHole2 = hole.slice( 0, holeIndex + 1 );\n\n\t\t\t\t\t\t\t\tshape = tmpShape1.concat( tmpHole1 ).concat( tmpHole2 ).concat( tmpShape2 );\n\n\t\t\t\t\t\t\t\tminShapeIndex = shapeIndex;\n\n\t\t\t\t\t\t\t\t// Debug only, to show the selected cuts\n\t\t\t\t\t\t\t\t// glob_CutLines.push( [ shapePt, holePt ] );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( holeIndex >= 0 )\tbreak;\t\t// hole-vertex found\n\n\t\t\t\t\t\t\tfailedCuts[ cutKey ] = true;\t\t\t// remember failure\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( holeIndex >= 0 )\tbreak;\t\t// hole-vertex found\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn shape; \t\t\t/* shape with no holes */\n\n\t\t\t}\n\n\n\t\t\tvar i, il, f, face,\n\t\t\t\tkey, index,\n\t\t\t\tallPointsMap = {};\n\n\t\t\t// To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first.\n\n\t\t\tvar allpoints = contour.concat();\n\n\t\t\tfor ( var h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tArray.prototype.push.apply( allpoints, holes[ h ] );\n\n\t\t\t}\n\n\t\t\t//console.log( \"allpoints\",allpoints, allpoints.length );\n\n\t\t\t// prepare all points map\n\n\t\t\tfor ( i = 0, il = allpoints.length; i < il; i ++ ) {\n\n\t\t\t\tkey = allpoints[ i ].x + \":\" + allpoints[ i ].y;\n\n\t\t\t\tif ( allPointsMap[ key ] !== undefined ) {\n\n\t\t\t\t\tconsole.warn( \"THREE.ShapeUtils: Duplicate point\", key, i );\n\n\t\t\t\t}\n\n\t\t\t\tallPointsMap[ key ] = i;\n\n\t\t\t}\n\n\t\t\t// remove holes by cutting paths to holes and adding them to the shape\n\t\t\tvar shapeWithoutHoles = removeHoles( contour, holes );\n\n\t\t\tvar triangles = ShapeUtils.triangulate( shapeWithoutHoles, false ); // True returns indices for points of spooled shape\n\t\t\t//console.log( \"triangles\",triangles, triangles.length );\n\n\t\t\t// check all face vertices against all points map\n\n\t\t\tfor ( i = 0, il = triangles.length; i < il; i ++ ) {\n\n\t\t\t\tface = triangles[ i ];\n\n\t\t\t\tfor ( f = 0; f < 3; f ++ ) {\n\n\t\t\t\t\tkey = face[ f ].x + \":\" + face[ f ].y;\n\n\t\t\t\t\tindex = allPointsMap[ key ];\n\n\t\t\t\t\tif ( index !== undefined ) {\n\n\t\t\t\t\t\tface[ f ] = index;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn triangles.concat();\n\n\t\t},\n\n\t\tisClockWise: function ( pts ) {\n\n\t\t\treturn ShapeUtils.area( pts ) < 0;\n\n\t\t},\n\n\t\t// Bezier Curves formulas obtained from\n\t\t// http://en.wikipedia.org/wiki/B%C3%A9zier_curve\n\n\t\t// Quad Bezier Functions\n\n\t\tb2: ( function () {\n\n\t\t\tfunction b2p0( t, p ) {\n\n\t\t\t\tvar k = 1 - t;\n\t\t\t\treturn k * k * p;\n\n\t\t\t}\n\n\t\t\tfunction b2p1( t, p ) {\n\n\t\t\t\treturn 2 * ( 1 - t ) * t * p;\n\n\t\t\t}\n\n\t\t\tfunction b2p2( t, p ) {\n\n\t\t\t\treturn t * t * p;\n\n\t\t\t}\n\n\t\t\treturn function b2( t, p0, p1, p2 ) {\n\n\t\t\t\treturn b2p0( t, p0 ) + b2p1( t, p1 ) + b2p2( t, p2 );\n\n\t\t\t};\n\n\t\t} )(),\n\n\t\t// Cubic Bezier Functions\n\n\t\tb3: ( function () {\n\n\t\t\tfunction b3p0( t, p ) {\n\n\t\t\t\tvar k = 1 - t;\n\t\t\t\treturn k * k * k * p;\n\n\t\t\t}\n\n\t\t\tfunction b3p1( t, p ) {\n\n\t\t\t\tvar k = 1 - t;\n\t\t\t\treturn 3 * k * k * t * p;\n\n\t\t\t}\n\n\t\t\tfunction b3p2( t, p ) {\n\n\t\t\t\tvar k = 1 - t;\n\t\t\t\treturn 3 * k * t * t * p;\n\n\t\t\t}\n\n\t\t\tfunction b3p3( t, p ) {\n\n\t\t\t\treturn t * t * t * p;\n\n\t\t\t}\n\n\t\t\treturn function b3( t, p0, p1, p2, p3 ) {\n\n\t\t\t\treturn b3p0( t, p0 ) + b3p1( t, p1 ) + b3p2( t, p2 ) + b3p3( t, p3 );\n\n\t\t\t};\n\n\t\t} )()\n\n\t};\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t *\n\t * Creates extruded geometry from a path shape.\n\t *\n\t * parameters = {\n\t *\n\t * curveSegments: , // number of points on the curves\n\t * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n\t * amount: , // Depth to extrude the shape\n\t *\n\t * bevelEnabled: , // turn on bevel\n\t * bevelThickness: , // how deep into the original shape bevel goes\n\t * bevelSize: , // how far from shape outline is bevel\n\t * bevelSegments: , // number of bevel layers\n\t *\n\t * extrudePath: // 3d spline path to extrude shape along. (creates Frames if .frames aren't defined)\n\t * frames: // containing arrays of tangents, normals, binormals\n\t *\n\t * uvGenerator: // object that provides UV generator functions\n\t *\n\t * }\n\t **/\n\n\tfunction ExtrudeGeometry( shapes, options ) {\n\n\t\tif ( typeof( shapes ) === \"undefined\" ) {\n\n\t\t\tshapes = [];\n\t\t\treturn;\n\n\t\t}\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'ExtrudeGeometry';\n\n\t\tshapes = Array.isArray( shapes ) ? shapes : [ shapes ];\n\n\t\tthis.addShapeList( shapes, options );\n\n\t\tthis.computeFaceNormals();\n\n\t\t// can't really use automatic vertex normals\n\t\t// as then front and back sides get smoothed too\n\t\t// should do separate smoothing just for sides\n\n\t\t//this.computeVertexNormals();\n\n\t\t//console.log( \"took\", ( Date.now() - startTime ) );\n\n\t}\n\n\tExtrudeGeometry.prototype = Object.create( Geometry.prototype );\n\tExtrudeGeometry.prototype.constructor = ExtrudeGeometry;\n\n\tExtrudeGeometry.prototype.addShapeList = function ( shapes, options ) {\n\n\t\tvar sl = shapes.length;\n\n\t\tfor ( var s = 0; s < sl; s ++ ) {\n\n\t\t\tvar shape = shapes[ s ];\n\t\t\tthis.addShape( shape, options );\n\n\t\t}\n\n\t};\n\n\tExtrudeGeometry.prototype.addShape = function ( shape, options ) {\n\n\t\tvar amount = options.amount !== undefined ? options.amount : 100;\n\n\t\tvar bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; // 10\n\t\tvar bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; // 8\n\t\tvar bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\n\t\tvar bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; // false\n\n\t\tvar curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\n\t\tvar steps = options.steps !== undefined ? options.steps : 1;\n\n\t\tvar extrudePath = options.extrudePath;\n\t\tvar extrudePts, extrudeByPath = false;\n\n\t\t// Use default WorldUVGenerator if no UV generators are specified.\n\t\tvar uvgen = options.UVGenerator !== undefined ? options.UVGenerator : ExtrudeGeometry.WorldUVGenerator;\n\n\t\tvar splineTube, binormal, normal, position2;\n\t\tif ( extrudePath ) {\n\n\t\t\textrudePts = extrudePath.getSpacedPoints( steps );\n\n\t\t\textrudeByPath = true;\n\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\n\t\t\t// SETUP TNB variables\n\n\t\t\t// TODO1 - have a .isClosed in spline?\n\n\t\t\tsplineTube = options.frames !== undefined ? options.frames : extrudePath.computeFrenetFrames( steps, false );\n\n\t\t\t// console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\tbinormal = new Vector3();\n\t\t\tnormal = new Vector3();\n\t\t\tposition2 = new Vector3();\n\n\t\t}\n\n\t\t// Safeguards if bevels are not enabled\n\n\t\tif ( ! bevelEnabled ) {\n\n\t\t\tbevelSegments = 0;\n\t\t\tbevelThickness = 0;\n\t\t\tbevelSize = 0;\n\n\t\t}\n\n\t\t// Variables initialization\n\n\t\tvar ahole, h, hl; // looping of holes\n\t\tvar scope = this;\n\n\t\tvar shapesOffset = this.vertices.length;\n\n\t\tvar shapePoints = shape.extractPoints( curveSegments );\n\n\t\tvar vertices = shapePoints.shape;\n\t\tvar holes = shapePoints.holes;\n\n\t\tvar reverse = ! ShapeUtils.isClockWise( vertices );\n\n\t\tif ( reverse ) {\n\n\t\t\tvertices = vertices.reverse();\n\n\t\t\t// Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\n\t\t\t\tif ( ShapeUtils.isClockWise( ahole ) ) {\n\n\t\t\t\t\tholes[ h ] = ahole.reverse();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treverse = false; // If vertices are in order now, we shouldn't need to worry about them again (hopefully)!\n\n\t\t}\n\n\n\t\tvar faces = ShapeUtils.triangulateShape( vertices, holes );\n\n\t\t/* Vertices */\n\n\t\tvar contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\n\t\t\tvertices = vertices.concat( ahole );\n\n\t\t}\n\n\n\t\tfunction scalePt2( pt, vec, size ) {\n\n\t\t\tif ( ! vec ) console.error( \"THREE.ExtrudeGeometry: vec does not exist\" );\n\n\t\t\treturn vec.clone().multiplyScalar( size ).add( pt );\n\n\t\t}\n\n\t\tvar b, bs, t, z,\n\t\t\tvert, vlen = vertices.length,\n\t\t\tface, flen = faces.length;\n\n\n\t\t// Find directions for point movement\n\n\n\t\tfunction getBevelVec( inPt, inPrev, inNext ) {\n\n\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t// shifted by 1 unit (length of normalized vector) to the left\n\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t//\n\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t// adjacent edges of inPt at a distance of 1 unit on the left side.\n\n\t\t\tvar v_trans_x, v_trans_y, shrink_by = 1;\t\t// resulting translation vector for inPt\n\n\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\tvar v_prev_x = inPt.x - inPrev.x, v_prev_y = inPt.y - inPrev.y;\n\t\t\tvar v_next_x = inNext.x - inPt.x, v_next_y = inNext.y - inPt.y;\n\n\t\t\tvar v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );\n\n\t\t\t// check for collinear edges\n\t\t\tvar collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\tif ( Math.abs( collinear0 ) > Number.EPSILON ) {\n\n\t\t\t\t// not collinear\n\n\t\t\t\t// length of vectors for normalizing\n\n\t\t\t\tvar v_prev_len = Math.sqrt( v_prev_lensq );\n\t\t\t\tvar v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );\n\n\t\t\t\t// shift adjacent points by unit vectors to the left\n\n\t\t\t\tvar ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len );\n\t\t\t\tvar ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len );\n\n\t\t\t\tvar ptNextShift_x = ( inNext.x - v_next_y / v_next_len );\n\t\t\t\tvar ptNextShift_y = ( inNext.y + v_next_x / v_next_len );\n\n\t\t\t\t// scaling factor for v_prev to intersection point\n\n\t\t\t\tvar sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y -\n\t\t\t\t\t\t\t( ptNextShift_y - ptPrevShift_y ) * v_next_x ) /\n\t\t\t\t\t\t ( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\t// vector from inPt to intersection point\n\n\t\t\t\tv_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );\n\t\t\t\tv_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );\n\n\t\t\t\t// Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t// but prevent crazy spikes\n\t\t\t\tvar v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );\n\t\t\t\tif ( v_trans_lensq <= 2 ) {\n\n\t\t\t\t\treturn\tnew Vector2( v_trans_x, v_trans_y );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tshrink_by = Math.sqrt( v_trans_lensq / 2 );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// handle special case of collinear edges\n\n\t\t\t\tvar direction_eq = false;\t\t// assumes: opposite\n\t\t\t\tif ( v_prev_x > Number.EPSILON ) {\n\n\t\t\t\t\tif ( v_next_x > Number.EPSILON ) {\n\n\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( v_prev_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\tif ( v_next_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) {\n\n\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( direction_eq ) {\n\n\t\t\t\t\t// console.log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\tv_trans_x = - v_prev_y;\n\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// console.log(\"Warning: lines are a straight spike\");\n\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq / 2 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn\tnew Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );\n\n\t\t}\n\n\n\t\tvar contourMovements = [];\n\n\t\tfor ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\tif ( j === il ) j = 0;\n\t\t\tif ( k === il ) k = 0;\n\n\t\t\t// (j)---(i)---(k)\n\t\t\t// console.log('i,j,k', i, j , k)\n\n\t\t\tcontourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );\n\n\t\t}\n\n\t\tvar holesMovements = [], oneHoleMovements, verticesMovements = contourMovements.concat();\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\n\t\t\toneHoleMovements = [];\n\n\t\t\tfor ( i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t// (j)---(i)---(k)\n\t\t\t\toneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] );\n\n\t\t\t}\n\n\t\t\tholesMovements.push( oneHoleMovements );\n\t\t\tverticesMovements = verticesMovements.concat( oneHoleMovements );\n\n\t\t}\n\n\n\t\t// Loop bevelSegments, 1 for the front, 1 for the back\n\n\t\tfor ( b = 0; b < bevelSegments; b ++ ) {\n\n\t\t\t//for ( b = bevelSegments; b > 0; b -- ) {\n\n\t\t\tt = b / bevelSegments;\n\t\t\tz = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\tbs = bevelSize * Math.sin( t * Math.PI / 2 );\n\n\t\t\t// contract shape\n\n\t\t\tfor ( i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\tvert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\n\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t}\n\n\t\t\t// expand holes\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\tfor ( i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\tvert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tbs = bevelSize;\n\n\t\t// Back facing vertices\n\n\t\tfor ( i = 0; i < vlen; i ++ ) {\n\n\t\t\tvert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\tv( vert.x, vert.y, 0 );\n\n\t\t\t} else {\n\n\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\n\t\t\t\tnormal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x );\n\t\t\t\tbinormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y );\n\n\t\t\t\tposition2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal );\n\n\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Add stepped vertices...\n\t\t// Including front facing vertices\n\n\t\tvar s;\n\n\t\tfor ( s = 1; s <= steps; s ++ ) {\n\n\t\t\tfor ( i = 0; i < vlen; i ++ ) {\n\n\t\t\t\tvert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\tv( vert.x, vert.y, amount / steps * s );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\n\t\t\t\t\tnormal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x );\n\t\t\t\t\tbinormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\tposition2.copy( extrudePts[ s ] ).add( normal ).add( binormal );\n\n\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\n\t\t// Add bevel segments planes\n\n\t\t//for ( b = 1; b <= bevelSegments; b ++ ) {\n\t\tfor ( b = bevelSegments - 1; b >= 0; b -- ) {\n\n\t\t\tt = b / bevelSegments;\n\t\t\tz = bevelThickness * Math.cos ( t * Math.PI / 2 );\n\t\t\tbs = bevelSize * Math.sin( t * Math.PI / 2 );\n\n\t\t\t// contract shape\n\n\t\t\tfor ( i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\tvert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\t\t\t\tv( vert.x, vert.y, amount + z );\n\n\t\t\t}\n\n\t\t\t// expand holes\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\tfor ( i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\tvert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\tv( vert.x, vert.y, amount + z );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t/* Faces */\n\n\t\t// Top and bottom faces\n\n\t\tbuildLidFaces();\n\n\t\t// Sides faces\n\n\t\tbuildSideFaces();\n\n\n\t\t///// Internal functions\n\n\t\tfunction buildLidFaces() {\n\n\t\t\tif ( bevelEnabled ) {\n\n\t\t\t\tvar layer = 0; // steps + 1\n\t\t\t\tvar offset = vlen * layer;\n\n\t\t\t\t// Bottom faces\n\n\t\t\t\tfor ( i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\tface = faces[ i ];\n\t\t\t\t\tf3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );\n\n\t\t\t\t}\n\n\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\toffset = vlen * layer;\n\n\t\t\t\t// Top faces\n\n\t\t\t\tfor ( i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\tface = faces[ i ];\n\t\t\t\t\tf3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// Bottom faces\n\n\t\t\t\tfor ( i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\tface = faces[ i ];\n\t\t\t\t\tf3( face[ 2 ], face[ 1 ], face[ 0 ] );\n\n\t\t\t\t}\n\n\t\t\t\t// Top faces\n\n\t\t\t\tfor ( i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\tface = faces[ i ];\n\t\t\t\t\tf3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Create faces for the z-sides of the shape\n\n\t\tfunction buildSideFaces() {\n\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction sidewalls( contour, layeroffset ) {\n\n\t\t\tvar j, k;\n\t\t\ti = contour.length;\n\n\t\t\twhile ( -- i >= 0 ) {\n\n\t\t\t\tj = i;\n\t\t\t\tk = i - 1;\n\t\t\t\tif ( k < 0 ) k = contour.length - 1;\n\n\t\t\t\t//console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\tvar s = 0, sl = steps + bevelSegments * 2;\n\n\t\t\t\tfor ( s = 0; s < sl; s ++ ) {\n\n\t\t\t\t\tvar slen1 = vlen * s;\n\t\t\t\t\tvar slen2 = vlen * ( s + 1 );\n\n\t\t\t\t\tvar a = layeroffset + j + slen1,\n\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\td = layeroffset + j + slen2;\n\n\t\t\t\t\tf4( a, b, c, d, contour, s, sl, j, k );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tfunction v( x, y, z ) {\n\n\t\t\tscope.vertices.push( new Vector3( x, y, z ) );\n\n\t\t}\n\n\t\tfunction f3( a, b, c ) {\n\n\t\t\ta += shapesOffset;\n\t\t\tb += shapesOffset;\n\t\t\tc += shapesOffset;\n\n\t\t\tscope.faces.push( new Face3( a, b, c, null, null, 0 ) );\n\n\t\t\tvar uvs = uvgen.generateTopUV( scope, a, b, c );\n\n\t\t\tscope.faceVertexUvs[ 0 ].push( uvs );\n\n\t\t}\n\n\t\tfunction f4( a, b, c, d, wallContour, stepIndex, stepsLength, contourIndex1, contourIndex2 ) {\n\n\t\t\ta += shapesOffset;\n\t\t\tb += shapesOffset;\n\t\t\tc += shapesOffset;\n\t\t\td += shapesOffset;\n\n\t\t\tscope.faces.push( new Face3( a, b, d, null, null, 1 ) );\n\t\t\tscope.faces.push( new Face3( b, c, d, null, null, 1 ) );\n\n\t\t\tvar uvs = uvgen.generateSideWallUV( scope, a, b, c, d );\n\n\t\t\tscope.faceVertexUvs[ 0 ].push( [ uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] ] );\n\t\t\tscope.faceVertexUvs[ 0 ].push( [ uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] ] );\n\n\t\t}\n\n\t};\n\n\tExtrudeGeometry.WorldUVGenerator = {\n\n\t\tgenerateTopUV: function ( geometry, indexA, indexB, indexC ) {\n\n\t\t\tvar vertices = geometry.vertices;\n\n\t\t\tvar a = vertices[ indexA ];\n\t\t\tvar b = vertices[ indexB ];\n\t\t\tvar c = vertices[ indexC ];\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a.x, a.y ),\n\t\t\t\tnew Vector2( b.x, b.y ),\n\t\t\t\tnew Vector2( c.x, c.y )\n\t\t\t];\n\n\t\t},\n\n\t\tgenerateSideWallUV: function ( geometry, indexA, indexB, indexC, indexD ) {\n\n\t\t\tvar vertices = geometry.vertices;\n\n\t\t\tvar a = vertices[ indexA ];\n\t\t\tvar b = vertices[ indexB ];\n\t\t\tvar c = vertices[ indexC ];\n\t\t\tvar d = vertices[ indexD ];\n\n\t\t\tif ( Math.abs( a.y - b.y ) < 0.01 ) {\n\n\t\t\t\treturn [\n\t\t\t\t\tnew Vector2( a.x, 1 - a.z ),\n\t\t\t\t\tnew Vector2( b.x, 1 - b.z ),\n\t\t\t\t\tnew Vector2( c.x, 1 - c.z ),\n\t\t\t\t\tnew Vector2( d.x, 1 - d.z )\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\treturn [\n\t\t\t\t\tnew Vector2( a.y, 1 - a.z ),\n\t\t\t\t\tnew Vector2( b.y, 1 - b.z ),\n\t\t\t\t\tnew Vector2( c.y, 1 - c.z ),\n\t\t\t\t\tnew Vector2( d.y, 1 - d.z )\n\t\t\t\t];\n\n\t\t\t}\n\n\t\t}\n\t};\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * Text = 3D Text\n\t *\n\t * parameters = {\n\t * font: , // font\n\t *\n\t * size: , // size of the text\n\t * height: , // thickness to extrude text\n\t * curveSegments: , // number of points on the curves\n\t *\n\t * bevelEnabled: , // turn on bevel\n\t * bevelThickness: , // how deep into text bevel goes\n\t * bevelSize: // how far from text outline is bevel\n\t * }\n\t */\n\n\tfunction TextGeometry( text, parameters ) {\n\n\t\tparameters = parameters || {};\n\n\t\tvar font = parameters.font;\n\n\t\tif ( (font && font.isFont) === false ) {\n\n\t\t\tconsole.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' );\n\t\t\treturn new Geometry();\n\n\t\t}\n\n\t\tvar shapes = font.generateShapes( text, parameters.size, parameters.curveSegments );\n\n\t\t// translate parameters to ExtrudeGeometry API\n\n\t\tparameters.amount = parameters.height !== undefined ? parameters.height : 50;\n\n\t\t// defaults\n\n\t\tif ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10;\n\t\tif ( parameters.bevelSize === undefined ) parameters.bevelSize = 8;\n\t\tif ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false;\n\n\t\tExtrudeGeometry.call( this, shapes, parameters );\n\n\t\tthis.type = 'TextGeometry';\n\n\t}\n\n\tTextGeometry.prototype = Object.create( ExtrudeGeometry.prototype );\n\tTextGeometry.prototype.constructor = TextGeometry;\n\n\t/**\n\t * @author benaadams / https://twitter.com/ben_a_adams\n\t * based on THREE.SphereGeometry\n\t */\n\n\tfunction SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'SphereBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tradius = radius || 50;\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 );\n\n\t\tphiStart = phiStart !== undefined ? phiStart : 0;\n\t\tphiLength = phiLength !== undefined ? phiLength : Math.PI * 2;\n\n\t\tthetaStart = thetaStart !== undefined ? thetaStart : 0;\n\t\tthetaLength = thetaLength !== undefined ? thetaLength : Math.PI;\n\n\t\tvar thetaEnd = thetaStart + thetaLength;\n\n\t\tvar vertexCount = ( ( widthSegments + 1 ) * ( heightSegments + 1 ) );\n\n\t\tvar positions = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 );\n\n\t\tvar index = 0, vertices = [], normal = new Vector3();\n\n\t\tfor ( var y = 0; y <= heightSegments; y ++ ) {\n\n\t\t\tvar verticesRow = [];\n\n\t\t\tvar v = y / heightSegments;\n\n\t\t\tfor ( var x = 0; x <= widthSegments; x ++ ) {\n\n\t\t\t\tvar u = x / widthSegments;\n\n\t\t\t\tvar px = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\t\t\t\tvar py = radius * Math.cos( thetaStart + v * thetaLength );\n\t\t\t\tvar pz = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\n\t\t\t\tnormal.set( px, py, pz ).normalize();\n\n\t\t\t\tpositions.setXYZ( index, px, py, pz );\n\t\t\t\tnormals.setXYZ( index, normal.x, normal.y, normal.z );\n\t\t\t\tuvs.setXY( index, u, 1 - v );\n\n\t\t\t\tverticesRow.push( index );\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\tvertices.push( verticesRow );\n\n\t\t}\n\n\t\tvar indices = [];\n\n\t\tfor ( var y = 0; y < heightSegments; y ++ ) {\n\n\t\t\tfor ( var x = 0; x < widthSegments; x ++ ) {\n\n\t\t\t\tvar v1 = vertices[ y ][ x + 1 ];\n\t\t\t\tvar v2 = vertices[ y ][ x ];\n\t\t\t\tvar v3 = vertices[ y + 1 ][ x ];\n\t\t\t\tvar v4 = vertices[ y + 1 ][ x + 1 ];\n\n\t\t\t\tif ( y !== 0 || thetaStart > 0 ) indices.push( v1, v2, v4 );\n\t\t\t\tif ( y !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( v2, v3, v4 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setIndex( new ( positions.count > 65535 ? Uint32Attribute : Uint16Attribute )( indices, 1 ) );\n\t\tthis.addAttribute( 'position', positions );\n\t\tthis.addAttribute( 'normal', normals );\n\t\tthis.addAttribute( 'uv', uvs );\n\n\t\tthis.boundingSphere = new Sphere( new Vector3(), radius );\n\n\t}\n\n\tSphereBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tSphereBufferGeometry.prototype.constructor = SphereBufferGeometry;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'SphereGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthis.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) );\n\n\t}\n\n\tSphereGeometry.prototype = Object.create( Geometry.prototype );\n\tSphereGeometry.prototype.constructor = SphereGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'RingBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tinnerRadius: innerRadius,\n\t\t\touterRadius: outerRadius,\n\t\t\tthetaSegments: thetaSegments,\n\t\t\tphiSegments: phiSegments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tinnerRadius = innerRadius || 20;\n\t\touterRadius = outerRadius || 50;\n\n\t\tthetaStart = thetaStart !== undefined ? thetaStart : 0;\n\t\tthetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;\n\n\t\tthetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8;\n\t\tphiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1;\n\n\t\t// these are used to calculate buffer length\n\t\tvar vertexCount = ( thetaSegments + 1 ) * ( phiSegments + 1 );\n\t\tvar indexCount = thetaSegments * phiSegments * 2 * 3;\n\n\t\t// buffers\n\t\tvar indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ) , 1 );\n\t\tvar vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 );\n\n\t\t// some helper variables\n\t\tvar index = 0, indexOffset = 0, segment;\n\t\tvar radius = innerRadius;\n\t\tvar radiusStep = ( ( outerRadius - innerRadius ) / phiSegments );\n\t\tvar vertex = new Vector3();\n\t\tvar uv = new Vector2();\n\t\tvar j, i;\n\n\t\t// generate vertices, normals and uvs\n\n\t\t// values are generate from the inside of the ring to the outside\n\n\t\tfor ( j = 0; j <= phiSegments; j ++ ) {\n\n\t\t\tfor ( i = 0; i <= thetaSegments; i ++ ) {\n\n\t\t\t\tsegment = thetaStart + i / thetaSegments * thetaLength;\n\n\t\t\t\t// vertex\n\t\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\t\tvertex.y = radius * Math.sin( segment );\n\t\t\t\tvertices.setXYZ( index, vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\t\t\t\tnormals.setXYZ( index, 0, 0, 1 );\n\n\t\t\t\t// uv\n\t\t\t\tuv.x = ( vertex.x / outerRadius + 1 ) / 2;\n\t\t\t\tuv.y = ( vertex.y / outerRadius + 1 ) / 2;\n\t\t\t\tuvs.setXY( index, uv.x, uv.y );\n\n\t\t\t\t// increase index\n\t\t\t\tindex++;\n\n\t\t\t}\n\n\t\t\t// increase the radius for next row of vertices\n\t\t\tradius += radiusStep;\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( j = 0; j < phiSegments; j ++ ) {\n\n\t\t\tvar thetaSegmentLevel = j * ( thetaSegments + 1 );\n\n\t\t\tfor ( i = 0; i < thetaSegments; i ++ ) {\n\n\t\t\t\tsegment = i + thetaSegmentLevel;\n\n\t\t\t\t// indices\n\t\t\t\tvar a = segment;\n\t\t\t\tvar b = segment + thetaSegments + 1;\n\t\t\t\tvar c = segment + thetaSegments + 2;\n\t\t\t\tvar d = segment + 1;\n\n\t\t\t\t// face one\n\t\t\t\tindices.setX( indexOffset, a ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, b ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, c ); indexOffset++;\n\n\t\t\t\t// face two\n\t\t\t\tindices.setX( indexOffset, a ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, c ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, d ); indexOffset++;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.addAttribute( 'position', vertices );\n\t\tthis.addAttribute( 'normal', normals );\n\t\tthis.addAttribute( 'uv', uvs );\n\n\t}\n\n\tRingBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tRingBufferGeometry.prototype.constructor = RingBufferGeometry;\n\n\t/**\n\t * @author Kaleb Murphy\n\t */\n\n\tfunction RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'RingGeometry';\n\n\t\tthis.parameters = {\n\t\t\tinnerRadius: innerRadius,\n\t\t\touterRadius: outerRadius,\n\t\t\tthetaSegments: thetaSegments,\n\t\t\tphiSegments: phiSegments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthis.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) );\n\n\t}\n\n\tRingGeometry.prototype = Object.create( Geometry.prototype );\n\tRingGeometry.prototype.constructor = RingGeometry;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n\t */\n\n\tfunction PlaneGeometry( width, height, widthSegments, heightSegments ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'PlaneGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments\n\t\t};\n\n\t\tthis.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) );\n\n\t}\n\n\tPlaneGeometry.prototype = Object.create( Geometry.prototype );\n\tPlaneGeometry.prototype.constructor = PlaneGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\t // points - to create a closed torus, one must use a set of points\n\t // like so: [ a, b, c, d, a ], see first is the same as last.\n\t // segments - the number of circumference segments to create\n\t // phiStart - the starting radian\n\t // phiLength - the radian (0 to 2PI) range of the lathed section\n\t // 2PI is a closed lathe, less than 2PI is a portion.\n\n\tfunction LatheBufferGeometry( points, segments, phiStart, phiLength ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'LatheBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpoints: points,\n\t\t\tsegments: segments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength\n\t\t};\n\n\t\tsegments = Math.floor( segments ) || 12;\n\t\tphiStart = phiStart || 0;\n\t\tphiLength = phiLength || Math.PI * 2;\n\n\t\t// clamp phiLength so it's in range of [ 0, 2PI ]\n\t\tphiLength = _Math.clamp( phiLength, 0, Math.PI * 2 );\n\n\t\t// these are used to calculate buffer length\n\t\tvar vertexCount = ( segments + 1 ) * points.length;\n\t\tvar indexCount = segments * points.length * 2 * 3;\n\n\t\t// buffers\n\t\tvar indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ) , 1 );\n\t\tvar vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 );\n\n\t\t// helper variables\n\t\tvar index = 0, indexOffset = 0, base;\n\t\tvar inverseSegments = 1.0 / segments;\n\t\tvar vertex = new Vector3();\n\t\tvar uv = new Vector2();\n\t\tvar i, j;\n\n\t\t// generate vertices and uvs\n\n\t\tfor ( i = 0; i <= segments; i ++ ) {\n\n\t\t\tvar phi = phiStart + i * inverseSegments * phiLength;\n\n\t\t\tvar sin = Math.sin( phi );\n\t\t\tvar cos = Math.cos( phi );\n\n\t\t\tfor ( j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\t\t// vertex\n\t\t\t\tvertex.x = points[ j ].x * sin;\n\t\t\t\tvertex.y = points[ j ].y;\n\t\t\t\tvertex.z = points[ j ].x * cos;\n\t\t\t\tvertices.setXYZ( index, vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// uv\n\t\t\t\tuv.x = i / segments;\n\t\t\t\tuv.y = j / ( points.length - 1 );\n\t\t\t\tuvs.setXY( index, uv.x, uv.y );\n\n\t\t\t\t// increase index\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( i = 0; i < segments; i ++ ) {\n\n\t\t\tfor ( j = 0; j < ( points.length - 1 ); j ++ ) {\n\n\t\t\t\tbase = j + i * points.length;\n\n\t\t\t\t// indices\n\t\t\t\tvar a = base;\n\t\t\t\tvar b = base + points.length;\n\t\t\t\tvar c = base + points.length + 1;\n\t\t\t\tvar d = base + 1;\n\n\t\t\t\t// face one\n\t\t\t\tindices.setX( indexOffset, a ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, b ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, d ); indexOffset++;\n\n\t\t\t\t// face two\n\t\t\t\tindices.setX( indexOffset, b ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, c ); indexOffset++;\n\t\t\t\tindices.setX( indexOffset, d ); indexOffset++;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.addAttribute( 'position', vertices );\n\t\tthis.addAttribute( 'uv', uvs );\n\n\t\t// generate normals\n\n\t\tthis.computeVertexNormals();\n\n\t\t// if the geometry is closed, we need to average the normals along the seam.\n\t\t// because the corresponding vertices are identical (but still have different UVs).\n\n\t\tif( phiLength === Math.PI * 2 ) {\n\n\t\t\tvar normals = this.attributes.normal.array;\n\t\t\tvar n1 = new Vector3();\n\t\t\tvar n2 = new Vector3();\n\t\t\tvar n = new Vector3();\n\n\t\t\t// this is the buffer offset for the last line of vertices\n\t\t\tbase = segments * points.length * 3;\n\n\t\t\tfor( i = 0, j = 0; i < points.length; i ++, j += 3 ) {\n\n\t\t\t\t// select the normal of the vertex in the first line\n\t\t\t\tn1.x = normals[ j + 0 ];\n\t\t\t\tn1.y = normals[ j + 1 ];\n\t\t\t\tn1.z = normals[ j + 2 ];\n\n\t\t\t\t// select the normal of the vertex in the last line\n\t\t\t\tn2.x = normals[ base + j + 0 ];\n\t\t\t\tn2.y = normals[ base + j + 1 ];\n\t\t\t\tn2.z = normals[ base + j + 2 ];\n\n\t\t\t\t// average normals\n\t\t\t\tn.addVectors( n1, n2 ).normalize();\n\n\t\t\t\t// assign the new values to both normals\n\t\t\t\tnormals[ j + 0 ] = normals[ base + j + 0 ] = n.x;\n\t\t\t\tnormals[ j + 1 ] = normals[ base + j + 1 ] = n.y;\n\t\t\t\tnormals[ j + 2 ] = normals[ base + j + 2 ] = n.z;\n\n\t\t\t} // next row\n\n\t\t}\n\n\t}\n\n\tLatheBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tLatheBufferGeometry.prototype.constructor = LatheBufferGeometry;\n\n\t/**\n\t * @author astrodud / http://astrodud.isgreat.org/\n\t * @author zz85 / https://github.com/zz85\n\t * @author bhouston / http://clara.io\n\t */\n\n\t// points - to create a closed torus, one must use a set of points\n\t// like so: [ a, b, c, d, a ], see first is the same as last.\n\t// segments - the number of circumference segments to create\n\t// phiStart - the starting radian\n\t// phiLength - the radian (0 to 2PI) range of the lathed section\n\t// 2PI is a closed lathe, less than 2PI is a portion.\n\n\tfunction LatheGeometry( points, segments, phiStart, phiLength ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'LatheGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpoints: points,\n\t\t\tsegments: segments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength\n\t\t};\n\n\t\tthis.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tLatheGeometry.prototype = Object.create( Geometry.prototype );\n\tLatheGeometry.prototype.constructor = LatheGeometry;\n\n\t/**\n\t * @author jonobr1 / http://jonobr1.com\n\t *\n\t * Creates a one-sided polygonal geometry from a path shape. Similar to\n\t * ExtrudeGeometry.\n\t *\n\t * parameters = {\n\t *\n\t *\tcurveSegments: , // number of points on the curves. NOT USED AT THE MOMENT.\n\t *\n\t *\tmaterial: // material index for front and back faces\n\t *\tuvGenerator: // object that provides UV generator functions\n\t *\n\t * }\n\t **/\n\n\tfunction ShapeGeometry( shapes, options ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'ShapeGeometry';\n\n\t\tif ( Array.isArray( shapes ) === false ) shapes = [ shapes ];\n\n\t\tthis.addShapeList( shapes, options );\n\n\t\tthis.computeFaceNormals();\n\n\t}\n\n\tShapeGeometry.prototype = Object.create( Geometry.prototype );\n\tShapeGeometry.prototype.constructor = ShapeGeometry;\n\n\t/**\n\t * Add an array of shapes to THREE.ShapeGeometry.\n\t */\n\tShapeGeometry.prototype.addShapeList = function ( shapes, options ) {\n\n\t\tfor ( var i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tthis.addShape( shapes[ i ], options );\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * Adds a shape to THREE.ShapeGeometry, based on THREE.ExtrudeGeometry.\n\t */\n\tShapeGeometry.prototype.addShape = function ( shape, options ) {\n\n\t\tif ( options === undefined ) options = {};\n\t\tvar curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\n\t\tvar material = options.material;\n\t\tvar uvgen = options.UVGenerator === undefined ? ExtrudeGeometry.WorldUVGenerator : options.UVGenerator;\n\n\t\t//\n\n\t\tvar i, l, hole;\n\n\t\tvar shapesOffset = this.vertices.length;\n\t\tvar shapePoints = shape.extractPoints( curveSegments );\n\n\t\tvar vertices = shapePoints.shape;\n\t\tvar holes = shapePoints.holes;\n\n\t\tvar reverse = ! ShapeUtils.isClockWise( vertices );\n\n\t\tif ( reverse ) {\n\n\t\t\tvertices = vertices.reverse();\n\n\t\t\t// Maybe we should also check if holes are in the opposite direction, just to be safe...\n\n\t\t\tfor ( i = 0, l = holes.length; i < l; i ++ ) {\n\n\t\t\t\thole = holes[ i ];\n\n\t\t\t\tif ( ShapeUtils.isClockWise( hole ) ) {\n\n\t\t\t\t\tholes[ i ] = hole.reverse();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treverse = false;\n\n\t\t}\n\n\t\tvar faces = ShapeUtils.triangulateShape( vertices, holes );\n\n\t\t// Vertices\n\n\t\tfor ( i = 0, l = holes.length; i < l; i ++ ) {\n\n\t\t\thole = holes[ i ];\n\t\t\tvertices = vertices.concat( hole );\n\n\t\t}\n\n\t\t//\n\n\t\tvar vert, vlen = vertices.length;\n\t\tvar face, flen = faces.length;\n\n\t\tfor ( i = 0; i < vlen; i ++ ) {\n\n\t\t\tvert = vertices[ i ];\n\n\t\t\tthis.vertices.push( new Vector3( vert.x, vert.y, 0 ) );\n\n\t\t}\n\n\t\tfor ( i = 0; i < flen; i ++ ) {\n\n\t\t\tface = faces[ i ];\n\n\t\t\tvar a = face[ 0 ] + shapesOffset;\n\t\t\tvar b = face[ 1 ] + shapesOffset;\n\t\t\tvar c = face[ 2 ] + shapesOffset;\n\n\t\t\tthis.faces.push( new Face3( a, b, c, null, null, material ) );\n\t\t\tthis.faceVertexUvs[ 0 ].push( uvgen.generateTopUV( this, a, b, c ) );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\n\tfunction EdgesGeometry( geometry, thresholdAngle ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1;\n\n\t\tvar thresholdDot = Math.cos( _Math.DEG2RAD * thresholdAngle );\n\n\t\tvar edge = [ 0, 0 ], hash = {};\n\n\t\tfunction sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}\n\n\t\tvar keys = [ 'a', 'b', 'c' ];\n\n\t\tvar geometry2;\n\n\t\tif ( (geometry && geometry.isBufferGeometry) ) {\n\n\t\t\tgeometry2 = new Geometry();\n\t\t\tgeometry2.fromBufferGeometry( geometry );\n\n\t\t} else {\n\n\t\t\tgeometry2 = geometry.clone();\n\n\t\t}\n\n\t\tgeometry2.mergeVertices();\n\t\tgeometry2.computeFaceNormals();\n\n\t\tvar vertices = geometry2.vertices;\n\t\tvar faces = geometry2.faces;\n\n\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\tvar face = faces[ i ];\n\n\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\tedge[ 0 ] = face[ keys[ j ] ];\n\t\t\t\tedge[ 1 ] = face[ keys[ ( j + 1 ) % 3 ] ];\n\t\t\t\tedge.sort( sortFunction );\n\n\t\t\t\tvar key = edge.toString();\n\n\t\t\t\tif ( hash[ key ] === undefined ) {\n\n\t\t\t\t\thash[ key ] = { vert1: edge[ 0 ], vert2: edge[ 1 ], face1: i, face2: undefined };\n\n\t\t\t\t} else {\n\n\t\t\t\t\thash[ key ].face2 = i;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar coords = [];\n\n\t\tfor ( var key in hash ) {\n\n\t\t\tvar h = hash[ key ];\n\n\t\t\tif ( h.face2 === undefined || faces[ h.face1 ].normal.dot( faces[ h.face2 ].normal ) <= thresholdDot ) {\n\n\t\t\t\tvar vertex = vertices[ h.vert1 ];\n\t\t\t\tcoords.push( vertex.x );\n\t\t\t\tcoords.push( vertex.y );\n\t\t\t\tcoords.push( vertex.z );\n\n\t\t\t\tvertex = vertices[ h.vert2 ];\n\t\t\t\tcoords.push( vertex.x );\n\t\t\t\tcoords.push( vertex.y );\n\t\t\t\tcoords.push( vertex.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.addAttribute( 'position', new BufferAttribute( new Float32Array( coords ), 3 ) );\n\n\t}\n\n\tEdgesGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tEdgesGeometry.prototype.constructor = EdgesGeometry;\n\n\t/**\n\t * @author Mugen87 / https://github.com/Mugen87\n\t */\n\n\tfunction CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'CylinderBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradiusTop: radiusTop,\n\t\t\tradiusBottom: radiusBottom,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tvar scope = this;\n\n\t\tradiusTop = radiusTop !== undefined ? radiusTop : 20;\n\t\tradiusBottom = radiusBottom !== undefined ? radiusBottom : 20;\n\t\theight = height !== undefined ? height : 100;\n\n\t\tradialSegments = Math.floor( radialSegments ) || 8;\n\t\theightSegments = Math.floor( heightSegments ) || 1;\n\n\t\topenEnded = openEnded !== undefined ? openEnded : false;\n\t\tthetaStart = thetaStart !== undefined ? thetaStart : 0.0;\n\t\tthetaLength = thetaLength !== undefined ? thetaLength : 2.0 * Math.PI;\n\n\t\t// used to calculate buffer length\n\n\t\tvar nbCap = 0;\n\n\t\tif ( openEnded === false ) {\n\n\t\t\tif ( radiusTop > 0 ) nbCap ++;\n\t\t\tif ( radiusBottom > 0 ) nbCap ++;\n\n\t\t}\n\n\t\tvar vertexCount = calculateVertexCount();\n\t\tvar indexCount = calculateIndexCount();\n\n\t\t// buffers\n\n\t\tvar indices = new BufferAttribute( new ( indexCount > 65535 ? Uint32Array : Uint16Array )( indexCount ), 1 );\n\t\tvar vertices = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar normals = new BufferAttribute( new Float32Array( vertexCount * 3 ), 3 );\n\t\tvar uvs = new BufferAttribute( new Float32Array( vertexCount * 2 ), 2 );\n\n\t\t// helper variables\n\n\t\tvar index = 0,\n\t\t indexOffset = 0,\n\t\t indexArray = [],\n\t\t halfHeight = height / 2;\n\n\t\t// group variables\n\t\tvar groupStart = 0;\n\n\t\t// generate geometry\n\n\t\tgenerateTorso();\n\n\t\tif ( openEnded === false ) {\n\n\t\t\tif ( radiusTop > 0 ) generateCap( true );\n\t\t\tif ( radiusBottom > 0 ) generateCap( false );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.addAttribute( 'position', vertices );\n\t\tthis.addAttribute( 'normal', normals );\n\t\tthis.addAttribute( 'uv', uvs );\n\n\t\t// helper functions\n\n\t\tfunction calculateVertexCount() {\n\n\t\t\tvar count = ( radialSegments + 1 ) * ( heightSegments + 1 );\n\n\t\t\tif ( openEnded === false ) {\n\n\t\t\t\tcount += ( ( radialSegments + 1 ) * nbCap ) + ( radialSegments * nbCap );\n\n\t\t\t}\n\n\t\t\treturn count;\n\n\t\t}\n\n\t\tfunction calculateIndexCount() {\n\n\t\t\tvar count = radialSegments * heightSegments * 2 * 3;\n\n\t\t\tif ( openEnded === false ) {\n\n\t\t\t\tcount += radialSegments * nbCap * 3;\n\n\t\t\t}\n\n\t\t\treturn count;\n\n\t\t}\n\n\t\tfunction generateTorso() {\n\n\t\t\tvar x, y;\n\t\t\tvar normal = new Vector3();\n\t\t\tvar vertex = new Vector3();\n\n\t\t\tvar groupCount = 0;\n\n\t\t\t// this will be used to calculate the normal\n\t\t\tvar slope = ( radiusBottom - radiusTop ) / height;\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( y = 0; y <= heightSegments; y ++ ) {\n\n\t\t\t\tvar indexRow = [];\n\n\t\t\t\tvar v = y / heightSegments;\n\n\t\t\t\t// calculate the radius of the current row\n\t\t\t\tvar radius = v * ( radiusBottom - radiusTop ) + radiusTop;\n\n\t\t\t\tfor ( x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\t\tvar u = x / radialSegments;\n\n\t\t\t\t\tvar theta = u * thetaLength + thetaStart;\n\n\t\t\t\t\tvar sinTheta = Math.sin( theta );\n\t\t\t\t\tvar cosTheta = Math.cos( theta );\n\n\t\t\t\t\t// vertex\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = - v * height + halfHeight;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.setXYZ( index, vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t\t// normal\n\t\t\t\t\tnormal.set( sinTheta, slope, cosTheta ).normalize();\n\t\t\t\t\tnormals.setXYZ( index, normal.x, normal.y, normal.z );\n\n\t\t\t\t\t// uv\n\t\t\t\t\tuvs.setXY( index, u, 1 - v );\n\n\t\t\t\t\t// save index of vertex in respective row\n\t\t\t\t\tindexRow.push( index );\n\n\t\t\t\t\t// increase index\n\t\t\t\t\tindex ++;\n\n\t\t\t\t}\n\n\t\t\t\t// now save vertices of the row in our index array\n\t\t\t\tindexArray.push( indexRow );\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tfor ( y = 0; y < heightSegments; y ++ ) {\n\n\t\t\t\t\t// we use the index array to access the correct indices\n\t\t\t\t\tvar i1 = indexArray[ y ][ x ];\n\t\t\t\t\tvar i2 = indexArray[ y + 1 ][ x ];\n\t\t\t\t\tvar i3 = indexArray[ y + 1 ][ x + 1 ];\n\t\t\t\t\tvar i4 = indexArray[ y ][ x + 1 ];\n\n\t\t\t\t\t// face one\n\t\t\t\t\tindices.setX( indexOffset, i1 ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, i2 ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, i4 ); indexOffset ++;\n\n\t\t\t\t\t// face two\n\t\t\t\t\tindices.setX( indexOffset, i2 ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, i3 ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, i4 ); indexOffset ++;\n\n\t\t\t\t\t// update counters\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\t\t\tscope.addGroup( groupStart, groupCount, 0 );\n\n\t\t\t// calculate new start value for groups\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t\tfunction generateCap( top ) {\n\n\t\t\tvar x, centerIndexStart, centerIndexEnd;\n\n\t\t\tvar uv = new Vector2();\n\t\t\tvar vertex = new Vector3();\n\n\t\t\tvar groupCount = 0;\n\n\t\t\tvar radius = ( top === true ) ? radiusTop : radiusBottom;\n\t\t\tvar sign = ( top === true ) ? 1 : - 1;\n\n\t\t\t// save the index of the first center vertex\n\t\t\tcenterIndexStart = index;\n\n\t\t\t// first we generate the center vertex data of the cap.\n\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\tfor ( x = 1; x <= radialSegments; x ++ ) {\n\n\t\t\t\t// vertex\n\t\t\t\tvertices.setXYZ( index, 0, halfHeight * sign, 0 );\n\n\t\t\t\t// normal\n\t\t\t\tnormals.setXYZ( index, 0, sign, 0 );\n\n\t\t\t\t// uv\n\t\t\t\tuv.x = 0.5;\n\t\t\t\tuv.y = 0.5;\n\n\t\t\t\tuvs.setXY( index, uv.x, uv.y );\n\n\t\t\t\t// increase index\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// save the index of the last center vertex\n\t\t\tcenterIndexEnd = index;\n\n\t\t\t// now we generate the surrounding vertices, normals and uvs\n\n\t\t\tfor ( x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\tvar u = x / radialSegments;\n\t\t\t\tvar theta = u * thetaLength + thetaStart;\n\n\t\t\t\tvar cosTheta = Math.cos( theta );\n\t\t\t\tvar sinTheta = Math.sin( theta );\n\n\t\t\t\t// vertex\n\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\tvertices.setXYZ( index, vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\t\t\t\tnormals.setXYZ( index, 0, sign, 0 );\n\n\t\t\t\t// uv\n\t\t\t\tuv.x = ( cosTheta * 0.5 ) + 0.5;\n\t\t\t\tuv.y = ( sinTheta * 0.5 * sign ) + 0.5;\n\t\t\t\tuvs.setXY( index, uv.x, uv.y );\n\n\t\t\t\t// increase index\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tvar c = centerIndexStart + x;\n\t\t\t\tvar i = centerIndexEnd + x;\n\n\t\t\t\tif ( top === true ) {\n\n\t\t\t\t\t// face top\n\t\t\t\t\tindices.setX( indexOffset, i ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, i + 1 ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, c ); indexOffset ++;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// face bottom\n\t\t\t\t\tindices.setX( indexOffset, i + 1 ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, i ); indexOffset ++;\n\t\t\t\t\tindices.setX( indexOffset, c ); indexOffset ++;\n\n\t\t\t\t}\n\n\t\t\t\t// update counters\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\t\t\tscope.addGroup( groupStart, groupCount, top === true ? 1 : 2 );\n\n\t\t\t// calculate new start value for groups\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t}\n\n\tCylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tCylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'CylinderGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradiusTop: radiusTop,\n\t\t\tradiusBottom: radiusBottom,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthis.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tCylinderGeometry.prototype = Object.create( Geometry.prototype );\n\tCylinderGeometry.prototype.constructor = CylinderGeometry;\n\n\t/**\n\t * @author abelnation / http://github.com/abelnation\n\t */\n\n\tfunction ConeGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {\n\n\t\tCylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );\n\n\t\tthis.type = 'ConeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t}\n\n\tConeGeometry.prototype = Object.create( CylinderGeometry.prototype );\n\tConeGeometry.prototype.constructor = ConeGeometry;\n\n\t/**\n\t * @author: abelnation / http://github.com/abelnation\n\t */\n\n\tfunction ConeBufferGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {\n\n\t\tCylinderBufferGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );\n\n\t\tthis.type = 'ConeBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t}\n\n\tConeBufferGeometry.prototype = Object.create( CylinderBufferGeometry.prototype );\n\tConeBufferGeometry.prototype.constructor = ConeBufferGeometry;\n\n\t/**\n\t * @author benaadams / https://twitter.com/ben_a_adams\n\t */\n\n\tfunction CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'CircleBufferGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tsegments: segments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tradius = radius || 50;\n\t\tsegments = segments !== undefined ? Math.max( 3, segments ) : 8;\n\n\t\tthetaStart = thetaStart !== undefined ? thetaStart : 0;\n\t\tthetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;\n\n\t\tvar vertices = segments + 2;\n\n\t\tvar positions = new Float32Array( vertices * 3 );\n\t\tvar normals = new Float32Array( vertices * 3 );\n\t\tvar uvs = new Float32Array( vertices * 2 );\n\n\t\t// center data is already zero, but need to set a few extras\n\t\tnormals[ 2 ] = 1.0;\n\t\tuvs[ 0 ] = 0.5;\n\t\tuvs[ 1 ] = 0.5;\n\n\t\tfor ( var s = 0, i = 3, ii = 2 ; s <= segments; s ++, i += 3, ii += 2 ) {\n\n\t\t\tvar segment = thetaStart + s / segments * thetaLength;\n\n\t\t\tpositions[ i ] = radius * Math.cos( segment );\n\t\t\tpositions[ i + 1 ] = radius * Math.sin( segment );\n\n\t\t\tnormals[ i + 2 ] = 1; // normal z\n\n\t\t\tuvs[ ii ] = ( positions[ i ] / radius + 1 ) / 2;\n\t\t\tuvs[ ii + 1 ] = ( positions[ i + 1 ] / radius + 1 ) / 2;\n\n\t\t}\n\n\t\tvar indices = [];\n\n\t\tfor ( var i = 1; i <= segments; i ++ ) {\n\n\t\t\tindices.push( i, i + 1, 0 );\n\n\t\t}\n\n\t\tthis.setIndex( new BufferAttribute( new Uint16Array( indices ), 1 ) );\n\t\tthis.addAttribute( 'position', new BufferAttribute( positions, 3 ) );\n\t\tthis.addAttribute( 'normal', new BufferAttribute( normals, 3 ) );\n\t\tthis.addAttribute( 'uv', new BufferAttribute( uvs, 2 ) );\n\n\t\tthis.boundingSphere = new Sphere( new Vector3(), radius );\n\n\t}\n\n\tCircleBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tCircleBufferGeometry.prototype.constructor = CircleBufferGeometry;\n\n\t/**\n\t * @author hughes\n\t */\n\n\tfunction CircleGeometry( radius, segments, thetaStart, thetaLength ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'CircleGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tsegments: segments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthis.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) );\n\n\t}\n\n\tCircleGeometry.prototype = Object.create( Geometry.prototype );\n\tCircleGeometry.prototype.constructor = CircleGeometry;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as\n\t */\n\n\tfunction BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) {\n\n\t\tGeometry.call( this );\n\n\t\tthis.type = 'BoxGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\tdepth: depth,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tdepthSegments: depthSegments\n\t\t};\n\n\t\tthis.fromBufferGeometry( new BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) );\n\t\tthis.mergeVertices();\n\n\t}\n\n\tBoxGeometry.prototype = Object.create( Geometry.prototype );\n\tBoxGeometry.prototype.constructor = BoxGeometry;\n\n\n\n\tvar Geometries = Object.freeze({\n\t\tWireframeGeometry: WireframeGeometry,\n\t\tParametricGeometry: ParametricGeometry,\n\t\tParametricBufferGeometry: ParametricBufferGeometry,\n\t\tTetrahedronGeometry: TetrahedronGeometry,\n\t\tTetrahedronBufferGeometry: TetrahedronBufferGeometry,\n\t\tOctahedronGeometry: OctahedronGeometry,\n\t\tOctahedronBufferGeometry: OctahedronBufferGeometry,\n\t\tIcosahedronGeometry: IcosahedronGeometry,\n\t\tIcosahedronBufferGeometry: IcosahedronBufferGeometry,\n\t\tDodecahedronGeometry: DodecahedronGeometry,\n\t\tDodecahedronBufferGeometry: DodecahedronBufferGeometry,\n\t\tPolyhedronGeometry: PolyhedronGeometry,\n\t\tPolyhedronBufferGeometry: PolyhedronBufferGeometry,\n\t\tTubeGeometry: TubeGeometry,\n\t\tTubeBufferGeometry: TubeBufferGeometry,\n\t\tTorusKnotGeometry: TorusKnotGeometry,\n\t\tTorusKnotBufferGeometry: TorusKnotBufferGeometry,\n\t\tTorusGeometry: TorusGeometry,\n\t\tTorusBufferGeometry: TorusBufferGeometry,\n\t\tTextGeometry: TextGeometry,\n\t\tSphereBufferGeometry: SphereBufferGeometry,\n\t\tSphereGeometry: SphereGeometry,\n\t\tRingGeometry: RingGeometry,\n\t\tRingBufferGeometry: RingBufferGeometry,\n\t\tPlaneBufferGeometry: PlaneBufferGeometry,\n\t\tPlaneGeometry: PlaneGeometry,\n\t\tLatheGeometry: LatheGeometry,\n\t\tLatheBufferGeometry: LatheBufferGeometry,\n\t\tShapeGeometry: ShapeGeometry,\n\t\tExtrudeGeometry: ExtrudeGeometry,\n\t\tEdgesGeometry: EdgesGeometry,\n\t\tConeGeometry: ConeGeometry,\n\t\tConeBufferGeometry: ConeBufferGeometry,\n\t\tCylinderGeometry: CylinderGeometry,\n\t\tCylinderBufferGeometry: CylinderBufferGeometry,\n\t\tCircleBufferGeometry: CircleBufferGeometry,\n\t\tCircleGeometry: CircleGeometry,\n\t\tBoxBufferGeometry: BoxBufferGeometry,\n\t\tBoxGeometry: BoxGeometry\n\t});\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction ShadowMaterial() {\n\n\t\tShaderMaterial.call( this, {\n\t\t\tuniforms: UniformsUtils.merge( [\n\t\t\t\tUniformsLib[ \"lights\" ],\n\t\t\t\t{\n\t\t\t\t\topacity: { value: 1.0 }\n\t\t\t\t}\n\t\t\t] ),\n\t\t\tvertexShader: ShaderChunk[ 'shadow_vert' ],\n\t\t\tfragmentShader: ShaderChunk[ 'shadow_frag' ]\n\t\t} );\n\n\t\tthis.lights = true;\n\t\tthis.transparent = true;\n\n\t\tObject.defineProperties( this, {\n\t\t\topacity: {\n\t\t\t\tenumerable: true,\n\t\t\t\tget: function () {\n\t\t\t\t\treturn this.uniforms.opacity.value;\n\t\t\t\t},\n\t\t\t\tset: function ( value ) {\n\t\t\t\t\tthis.uniforms.opacity.value = value;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t}\n\n\tShadowMaterial.prototype = Object.create( ShaderMaterial.prototype );\n\tShadowMaterial.prototype.constructor = ShadowMaterial;\n\n\tShadowMaterial.prototype.isShadowMaterial = true;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction RawShaderMaterial( parameters ) {\n\n\t\tShaderMaterial.call( this, parameters );\n\n\t\tthis.type = 'RawShaderMaterial';\n\n\t}\n\n\tRawShaderMaterial.prototype = Object.create( ShaderMaterial.prototype );\n\tRawShaderMaterial.prototype.constructor = RawShaderMaterial;\n\n\tRawShaderMaterial.prototype.isRawShaderMaterial = true;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction MultiMaterial( materials ) {\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.type = 'MultiMaterial';\n\n\t\tthis.materials = materials instanceof Array ? materials : [];\n\n\t\tthis.visible = true;\n\n\t}\n\n\tMultiMaterial.prototype = {\n\n\t\tconstructor: MultiMaterial,\n\n\t\tisMultiMaterial: true,\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\tvar output = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.2,\n\t\t\t\t\ttype: 'material',\n\t\t\t\t\tgenerator: 'MaterialExporter'\n\t\t\t\t},\n\t\t\t\tuuid: this.uuid,\n\t\t\t\ttype: this.type,\n\t\t\t\tmaterials: []\n\t\t\t};\n\n\t\t\tvar materials = this.materials;\n\n\t\t\tfor ( var i = 0, l = materials.length; i < l; i ++ ) {\n\n\t\t\t\tvar material = materials[ i ].toJSON( meta );\n\t\t\t\tdelete material.metadata;\n\n\t\t\t\toutput.materials.push( material );\n\n\t\t\t}\n\n\t\t\toutput.visible = this.visible;\n\n\t\t\treturn output;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\tvar material = new this.constructor();\n\n\t\t\tfor ( var i = 0; i < this.materials.length; i ++ ) {\n\n\t\t\t\tmaterial.materials.push( this.materials[ i ].clone() );\n\n\t\t\t}\n\n\t\t\tmaterial.visible = this.visible;\n\n\t\t\treturn material;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author WestLangley / http://github.com/WestLangley\n\t *\n\t * parameters = {\n\t * color: ,\n\t * roughness: ,\n\t * metalness: ,\n\t * opacity: ,\n\t *\n\t * map: new THREE.Texture( ),\n\t *\n\t * lightMap: new THREE.Texture( ),\n\t * lightMapIntensity: \n\t *\n\t * aoMap: new THREE.Texture( ),\n\t * aoMapIntensity: \n\t *\n\t * emissive: ,\n\t * emissiveIntensity: \n\t * emissiveMap: new THREE.Texture( ),\n\t *\n\t * bumpMap: new THREE.Texture( ),\n\t * bumpScale: ,\n\t *\n\t * normalMap: new THREE.Texture( ),\n\t * normalScale: ,\n\t *\n\t * displacementMap: new THREE.Texture( ),\n\t * displacementScale: ,\n\t * displacementBias: ,\n\t *\n\t * roughnessMap: new THREE.Texture( ),\n\t *\n\t * metalnessMap: new THREE.Texture( ),\n\t *\n\t * alphaMap: new THREE.Texture( ),\n\t *\n\t * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t * envMapIntensity: \n\t *\n\t * refractionRatio: ,\n\t *\n\t * wireframe: ,\n\t * wireframeLinewidth: ,\n\t *\n\t * skinning: ,\n\t * morphTargets: ,\n\t * morphNormals: \n\t * }\n\t */\n\n\tfunction MeshStandardMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.type = 'MeshStandardMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.roughness = 0.5;\n\t\tthis.metalness = 0.5;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.roughnessMap = null;\n\n\t\tthis.metalnessMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapIntensity = 1.0;\n\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.skinning = false;\n\t\tthis.morphTargets = false;\n\t\tthis.morphNormals = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tMeshStandardMaterial.prototype = Object.create( Material.prototype );\n\tMeshStandardMaterial.prototype.constructor = MeshStandardMaterial;\n\n\tMeshStandardMaterial.prototype.isMeshStandardMaterial = true;\n\n\tMeshStandardMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.color.copy( source.color );\n\t\tthis.roughness = source.roughness;\n\t\tthis.metalness = source.metalness;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.roughnessMap = source.roughnessMap;\n\n\t\tthis.metalnessMap = source.metalnessMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapIntensity = source.envMapIntensity;\n\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.skinning = source.skinning;\n\t\tthis.morphTargets = source.morphTargets;\n\t\tthis.morphNormals = source.morphNormals;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author WestLangley / http://github.com/WestLangley\n\t *\n\t * parameters = {\n\t * reflectivity: \n\t * }\n\t */\n\n\tfunction MeshPhysicalMaterial( parameters ) {\n\n\t\tMeshStandardMaterial.call( this );\n\n\t\tthis.defines = { 'PHYSICAL': '' };\n\n\t\tthis.type = 'MeshPhysicalMaterial';\n\n\t\tthis.reflectivity = 0.5; // maps to F0 = 0.04\n\n\t\tthis.clearCoat = 0.0;\n\t\tthis.clearCoatRoughness = 0.0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tMeshPhysicalMaterial.prototype = Object.create( MeshStandardMaterial.prototype );\n\tMeshPhysicalMaterial.prototype.constructor = MeshPhysicalMaterial;\n\n\tMeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;\n\n\tMeshPhysicalMaterial.prototype.copy = function ( source ) {\n\n\t\tMeshStandardMaterial.prototype.copy.call( this, source );\n\n\t\tthis.defines = { 'PHYSICAL': '' };\n\n\t\tthis.reflectivity = source.reflectivity;\n\n\t\tthis.clearCoat = source.clearCoat;\n\t\tthis.clearCoatRoughness = source.clearCoatRoughness;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * color: ,\n\t * specular: ,\n\t * shininess: ,\n\t * opacity: ,\n\t *\n\t * map: new THREE.Texture( ),\n\t *\n\t * lightMap: new THREE.Texture( ),\n\t * lightMapIntensity: \n\t *\n\t * aoMap: new THREE.Texture( ),\n\t * aoMapIntensity: \n\t *\n\t * emissive: ,\n\t * emissiveIntensity: \n\t * emissiveMap: new THREE.Texture( ),\n\t *\n\t * bumpMap: new THREE.Texture( ),\n\t * bumpScale: ,\n\t *\n\t * normalMap: new THREE.Texture( ),\n\t * normalScale: ,\n\t *\n\t * displacementMap: new THREE.Texture( ),\n\t * displacementScale: ,\n\t * displacementBias: ,\n\t *\n\t * specularMap: new THREE.Texture( ),\n\t *\n\t * alphaMap: new THREE.Texture( ),\n\t *\n\t * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),\n\t * combine: THREE.Multiply,\n\t * reflectivity: ,\n\t * refractionRatio: ,\n\t *\n\t * wireframe: ,\n\t * wireframeLinewidth: ,\n\t *\n\t * skinning: ,\n\t * morphTargets: ,\n\t * morphNormals: \n\t * }\n\t */\n\n\tfunction MeshPhongMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'MeshPhongMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.specular = new Color( 0x111111 );\n\t\tthis.shininess = 30;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.skinning = false;\n\t\tthis.morphTargets = false;\n\t\tthis.morphNormals = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tMeshPhongMaterial.prototype = Object.create( Material.prototype );\n\tMeshPhongMaterial.prototype.constructor = MeshPhongMaterial;\n\n\tMeshPhongMaterial.prototype.isMeshPhongMaterial = true;\n\n\tMeshPhongMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.specular.copy( source.specular );\n\t\tthis.shininess = source.shininess;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.skinning = source.skinning;\n\t\tthis.morphTargets = source.morphTargets;\n\t\tthis.morphNormals = source.morphNormals;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t *\n\t * parameters = {\n\t * opacity: ,\n\t *\n\t * wireframe: ,\n\t * wireframeLinewidth: \n\t * }\n\t */\n\n\tfunction MeshNormalMaterial( parameters ) {\n\n\t\tMaterial.call( this, parameters );\n\n\t\tthis.type = 'MeshNormalMaterial';\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false;\n\t\tthis.lights = false;\n\t\tthis.morphTargets = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tMeshNormalMaterial.prototype = Object.create( Material.prototype );\n\tMeshNormalMaterial.prototype.constructor = MeshNormalMaterial;\n\n\tMeshNormalMaterial.prototype.isMeshNormalMaterial = true;\n\n\tMeshNormalMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * color: ,\n\t * opacity: ,\n\t *\n\t * map: new THREE.Texture( ),\n\t *\n\t * lightMap: new THREE.Texture( ),\n\t * lightMapIntensity: \n\t *\n\t * aoMap: new THREE.Texture( ),\n\t * aoMapIntensity: \n\t *\n\t * emissive: ,\n\t * emissiveIntensity: \n\t * emissiveMap: new THREE.Texture( ),\n\t *\n\t * specularMap: new THREE.Texture( ),\n\t *\n\t * alphaMap: new THREE.Texture( ),\n\t *\n\t * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),\n\t * combine: THREE.Multiply,\n\t * reflectivity: ,\n\t * refractionRatio: ,\n\t *\n\t * wireframe: ,\n\t * wireframeLinewidth: ,\n\t *\n\t * skinning: ,\n\t * morphTargets: ,\n\t * morphNormals: \n\t * }\n\t */\n\n\tfunction MeshLambertMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'MeshLambertMaterial';\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.skinning = false;\n\t\tthis.morphTargets = false;\n\t\tthis.morphNormals = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tMeshLambertMaterial.prototype = Object.create( Material.prototype );\n\tMeshLambertMaterial.prototype.constructor = MeshLambertMaterial;\n\n\tMeshLambertMaterial.prototype.isMeshLambertMaterial = true;\n\n\tMeshLambertMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.skinning = source.skinning;\n\t\tthis.morphTargets = source.morphTargets;\n\t\tthis.morphNormals = source.morphNormals;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t * parameters = {\n\t * color: ,\n\t * opacity: ,\n\t *\n\t * linewidth: ,\n\t *\n\t * scale: ,\n\t * dashSize: ,\n\t * gapSize: \n\t * }\n\t */\n\n\tfunction LineDashedMaterial( parameters ) {\n\n\t\tMaterial.call( this );\n\n\t\tthis.type = 'LineDashedMaterial';\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.linewidth = 1;\n\n\t\tthis.scale = 1;\n\t\tthis.dashSize = 3;\n\t\tthis.gapSize = 1;\n\n\t\tthis.lights = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tLineDashedMaterial.prototype = Object.create( Material.prototype );\n\tLineDashedMaterial.prototype.constructor = LineDashedMaterial;\n\n\tLineDashedMaterial.prototype.isLineDashedMaterial = true;\n\n\tLineDashedMaterial.prototype.copy = function ( source ) {\n\n\t\tMaterial.prototype.copy.call( this, source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.linewidth = source.linewidth;\n\n\t\tthis.scale = source.scale;\n\t\tthis.dashSize = source.dashSize;\n\t\tthis.gapSize = source.gapSize;\n\n\t\treturn this;\n\n\t};\n\n\n\n\tvar Materials = Object.freeze({\n\t\tShadowMaterial: ShadowMaterial,\n\t\tSpriteMaterial: SpriteMaterial,\n\t\tRawShaderMaterial: RawShaderMaterial,\n\t\tShaderMaterial: ShaderMaterial,\n\t\tPointsMaterial: PointsMaterial,\n\t\tMultiMaterial: MultiMaterial,\n\t\tMeshPhysicalMaterial: MeshPhysicalMaterial,\n\t\tMeshStandardMaterial: MeshStandardMaterial,\n\t\tMeshPhongMaterial: MeshPhongMaterial,\n\t\tMeshNormalMaterial: MeshNormalMaterial,\n\t\tMeshLambertMaterial: MeshLambertMaterial,\n\t\tMeshDepthMaterial: MeshDepthMaterial,\n\t\tMeshBasicMaterial: MeshBasicMaterial,\n\t\tLineDashedMaterial: LineDashedMaterial,\n\t\tLineBasicMaterial: LineBasicMaterial,\n\t\tMaterial: Material\n\t});\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tvar Cache = {\n\n\t\tenabled: false,\n\n\t\tfiles: {},\n\n\t\tadd: function ( key, file ) {\n\n\t\t\tif ( this.enabled === false ) return;\n\n\t\t\t// console.log( 'THREE.Cache', 'Adding key:', key );\n\n\t\t\tthis.files[ key ] = file;\n\n\t\t},\n\n\t\tget: function ( key ) {\n\n\t\t\tif ( this.enabled === false ) return;\n\n\t\t\t// console.log( 'THREE.Cache', 'Checking key:', key );\n\n\t\t\treturn this.files[ key ];\n\n\t\t},\n\n\t\tremove: function ( key ) {\n\n\t\t\tdelete this.files[ key ];\n\n\t\t},\n\n\t\tclear: function () {\n\n\t\t\tthis.files = {};\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction LoadingManager( onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar isLoading = false, itemsLoaded = 0, itemsTotal = 0;\n\n\t\tthis.onStart = undefined;\n\t\tthis.onLoad = onLoad;\n\t\tthis.onProgress = onProgress;\n\t\tthis.onError = onError;\n\n\t\tthis.itemStart = function ( url ) {\n\n\t\t\titemsTotal ++;\n\n\t\t\tif ( isLoading === false ) {\n\n\t\t\t\tif ( scope.onStart !== undefined ) {\n\n\t\t\t\t\tscope.onStart( url, itemsLoaded, itemsTotal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tisLoading = true;\n\n\t\t};\n\n\t\tthis.itemEnd = function ( url ) {\n\n\t\t\titemsLoaded ++;\n\n\t\t\tif ( scope.onProgress !== undefined ) {\n\n\t\t\t\tscope.onProgress( url, itemsLoaded, itemsTotal );\n\n\t\t\t}\n\n\t\t\tif ( itemsLoaded === itemsTotal ) {\n\n\t\t\t\tisLoading = false;\n\n\t\t\t\tif ( scope.onLoad !== undefined ) {\n\n\t\t\t\t\tscope.onLoad();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.itemError = function ( url ) {\n\n\t\t\tif ( scope.onError !== undefined ) {\n\n\t\t\t\tscope.onError( url );\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tvar DefaultLoadingManager = new LoadingManager();\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction XHRLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t}\n\n\tObject.assign( XHRLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tif ( url === undefined ) url = '';\n\n\t\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\t\tvar scope = this;\n\n\t\t\tvar cached = Cache.get( url );\n\n\t\t\tif ( cached !== undefined ) {\n\n\t\t\t\tscope.manager.itemStart( url );\n\n\t\t\t\tsetTimeout( function () {\n\n\t\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t}, 0 );\n\n\t\t\t\treturn cached;\n\n\t\t\t}\n\n\t\t\t// Check for data: URI\n\t\t\tvar dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\n\t\t\tvar dataUriRegexResult = url.match( dataUriRegex );\n\n\t\t\t// Safari can not handle Data URIs through XMLHttpRequest so process manually\n\t\t\tif ( dataUriRegexResult ) {\n\n\t\t\t\tvar mimeType = dataUriRegexResult[1];\n\t\t\t\tvar isBase64 = !!dataUriRegexResult[2];\n\t\t\t\tvar data = dataUriRegexResult[3];\n\n\t\t\t\tdata = window.decodeURIComponent(data);\n\n\t\t\t\tif( isBase64 ) {\n\t\t\t\t\tdata = window.atob(data);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\n\t\t\t\t\tvar response;\n\t\t\t\t\tvar responseType = ( this.responseType || '' ).toLowerCase();\n\n\t\t\t\t\tswitch ( responseType ) {\n\n\t\t\t\t\t\tcase 'arraybuffer':\n\t\t\t\t\t\tcase 'blob':\n\n\t\t\t\t\t\t \tresponse = new ArrayBuffer( data.length );\n\t\t\t\t\t\t\tvar view = new Uint8Array( response );\n\t\t\t\t\t\t\tfor ( var i = 0; i < data.length; i ++ ) {\n\n\t\t\t\t\t\t\t\t\tview[ i ] = data.charCodeAt( i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( responseType === 'blob' ) {\n\n\t\t\t\t\t\t\t\tresponse = new Blob( [ response ], { \"type\" : mimeType } );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'document':\n\n\t\t\t\t\t\t\tvar parser = new DOMParser();\n\t\t\t\t\t\t\tresponse = parser.parseFromString( data, mimeType );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'json':\n\n\t\t\t\t\t\t\tresponse = JSON.parse( data );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault: // 'text' or other\n\n\t\t\t\t\t\t\tresponse = data;\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Wait for next browser tick\n\t\t\t\t\twindow.setTimeout( function() {\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( response );\n\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t}, 0);\n\n\t\t\t\t} catch ( error ) {\n\n\t\t\t\t\t// Wait for next browser tick\n\t\t\t\t\twindow.setTimeout( function() {\n\n\t\t\t\t\t\tif ( onError ) onError( error );\n\n\t\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t\t}, 0);\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tvar request = new XMLHttpRequest();\n\t\t\t\trequest.open( 'GET', url, true );\n\n\t\t\t\trequest.addEventListener( 'load', function ( event ) {\n\n\t\t\t\t\tvar response = event.target.response;\n\n\t\t\t\t\tCache.add( url, response );\n\n\t\t\t\t\tif ( this.status === 200 ) {\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( response );\n\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t} else if ( this.status === 0 ) {\n\n\t\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\n\t\t\t\t\t\tconsole.warn( 'THREE.XHRLoader: HTTP Status 0 received.' );\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( response );\n\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( onError ) onError( event );\n\n\t\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t\t}\n\n\t\t\t\t}, false );\n\n\t\t\t\tif ( onProgress !== undefined ) {\n\n\t\t\t\t\trequest.addEventListener( 'progress', function ( event ) {\n\n\t\t\t\t\t\tonProgress( event );\n\n\t\t\t\t\t}, false );\n\n\t\t\t\t}\n\n\t\t\t\trequest.addEventListener( 'error', function ( event ) {\n\n\t\t\t\t\tif ( onError ) onError( event );\n\n\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t}, false );\n\n\t\t\t\tif ( this.responseType !== undefined ) request.responseType = this.responseType;\n\t\t\t\tif ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;\n\n\t\t\t\tif ( request.overrideMimeType ) request.overrideMimeType( 'text/plain' );\n\n\t\t\t\trequest.send( null );\n\n\t\t\t}\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\treturn request;\n\n\t\t},\n\n\t\tsetPath: function ( value ) {\n\n\t\t\tthis.path = value;\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetResponseType: function ( value ) {\n\n\t\t\tthis.responseType = value;\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetWithCredentials: function ( value ) {\n\n\t\t\tthis.withCredentials = value;\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t *\n\t * Abstract Base class to block based textures loader (dds, pvr, ...)\n\t */\n\n\tfunction CompressedTextureLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\t// override in sub classes\n\t\tthis._parser = null;\n\n\t}\n\n\tObject.assign( CompressedTextureLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar images = [];\n\n\t\t\tvar texture = new CompressedTexture();\n\t\t\ttexture.image = images;\n\n\t\t\tvar loader = new XHRLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\n\t\t\tfunction loadTexture( i ) {\n\n\t\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\t\tvar texDatas = scope._parser( buffer, true );\n\n\t\t\t\t\timages[ i ] = {\n\t\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t\t};\n\n\t\t\t\t\tloaded += 1;\n\n\t\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\t\tif ( texDatas.mipmapCount === 1 )\n\t\t\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t\t}\n\n\t\t\t\t}, onProgress, onError );\n\n\t\t\t}\n\n\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\tvar loaded = 0;\n\n\t\t\t\tfor ( var i = 0, il = url.length; i < il; ++ i ) {\n\n\t\t\t\t\tloadTexture( i );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\t\tvar texDatas = scope._parser( buffer, true );\n\n\t\t\t\t\tif ( texDatas.isCubemap ) {\n\n\t\t\t\t\t\tvar faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\t\tfor ( var f = 0; f < faces; f ++ ) {\n\n\t\t\t\t\t\t\timages[ f ] = { mipmaps : [] };\n\n\t\t\t\t\t\t\tfor ( var i = 0; i < texDatas.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\t\timages[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] );\n\t\t\t\t\t\t\t\timages[ f ].format = texDatas.format;\n\t\t\t\t\t\t\t\timages[ f ].width = texDatas.width;\n\t\t\t\t\t\t\t\timages[ f ].height = texDatas.height;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( texDatas.mipmapCount === 1 ) {\n\n\t\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}, onProgress, onError );\n\n\t\t\t}\n\n\t\t\treturn texture;\n\n\t\t},\n\n\t\tsetPath: function ( value ) {\n\n\t\t\tthis.path = value;\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author Nikos M. / https://github.com/foo123/\n\t *\n\t * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)\n\t */\n\n\tvar DataTextureLoader = BinaryTextureLoader;\n\tfunction BinaryTextureLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\t// override in sub classes\n\t\tthis._parser = null;\n\n\t}\n\n\tObject.assign( BinaryTextureLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar texture = new DataTexture();\n\n\t\t\tvar loader = new XHRLoader( this.manager );\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tvar texData = scope._parser( buffer );\n\n\t\t\t\tif ( ! texData ) return;\n\n\t\t\t\tif ( undefined !== texData.image ) {\n\n\t\t\t\t\ttexture.image = texData.image;\n\n\t\t\t\t} else if ( undefined !== texData.data ) {\n\n\t\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\t\ttexture.image.data = texData.data;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.wrapS = undefined !== texData.wrapS ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\t\ttexture.wrapT = undefined !== texData.wrapT ? texData.wrapT : ClampToEdgeWrapping;\n\n\t\t\t\ttexture.magFilter = undefined !== texData.magFilter ? texData.magFilter : LinearFilter;\n\t\t\t\ttexture.minFilter = undefined !== texData.minFilter ? texData.minFilter : LinearMipMapLinearFilter;\n\n\t\t\t\ttexture.anisotropy = undefined !== texData.anisotropy ? texData.anisotropy : 1;\n\n\t\t\t\tif ( undefined !== texData.format ) {\n\n\t\t\t\t\ttexture.format = texData.format;\n\n\t\t\t\t}\n\t\t\t\tif ( undefined !== texData.type ) {\n\n\t\t\t\t\ttexture.type = texData.type;\n\n\t\t\t\t}\n\n\t\t\t\tif ( undefined !== texData.mipmaps ) {\n\n\t\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\tif ( 1 === texData.mipmapCount ) {\n\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture, texData );\n\n\t\t\t}, onProgress, onError );\n\n\n\t\t\treturn texture;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction ImageLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t}\n\n\tObject.assign( ImageLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' );\n\t\t\timage.onload = function () {\n\n\t\t\t\timage.onload = null;\n\n\t\t\t\tURL.revokeObjectURL( image.src );\n\n\t\t\t\tif ( onLoad ) onLoad( image );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t};\n\t\t\timage.onerror = onError;\n\n\t\t\tif ( url.indexOf( 'data:' ) === 0 ) {\n\n\t\t\t\timage.src = url;\n\n\t\t\t} else {\n\n\t\t\t\tvar loader = new XHRLoader();\n\t\t\t\tloader.setPath( this.path );\n\t\t\t\tloader.setResponseType( 'blob' );\n\t\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\t\tloader.load( url, function ( blob ) {\n\n\t\t\t\t\timage.src = URL.createObjectURL( blob );\n\n\t\t\t\t}, onProgress, onError );\n\n\t\t\t}\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\treturn image;\n\n\t\t},\n\n\t\tsetCrossOrigin: function ( value ) {\n\n\t\t\tthis.crossOrigin = value;\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetWithCredentials: function ( value ) {\n\n\t\t\tthis.withCredentials = value;\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetPath: function ( value ) {\n\n\t\t\tthis.path = value;\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction CubeTextureLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t}\n\n\tObject.assign( CubeTextureLoader.prototype, {\n\n\t\tload: function ( urls, onLoad, onProgress, onError ) {\n\n\t\t\tvar texture = new CubeTexture();\n\n\t\t\tvar loader = new ImageLoader( this.manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\t\tloader.setPath( this.path );\n\n\t\t\tvar loaded = 0;\n\n\t\t\tfunction loadTexture( i ) {\n\n\t\t\t\tloader.load( urls[ i ], function ( image ) {\n\n\t\t\t\t\ttexture.images[ i ] = image;\n\n\t\t\t\t\tloaded ++;\n\n\t\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t\t}\n\n\t\t\t\t}, undefined, onError );\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0; i < urls.length; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t\treturn texture;\n\n\t\t},\n\n\t\tsetCrossOrigin: function ( value ) {\n\n\t\t\tthis.crossOrigin = value;\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetPath: function ( value ) {\n\n\t\t\tthis.path = value;\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction TextureLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t}\n\n\tObject.assign( TextureLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar texture = new Texture();\n\n\t\t\tvar loader = new ImageLoader( this.manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.load( url, function ( image ) {\n\n\t\t\t\t// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.\n\t\t\t\tvar isJPEG = url.search( /\\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\\:image\\/jpeg/ ) === 0;\n\n\t\t\t\ttexture.format = isJPEG ? RGBFormat : RGBAFormat;\n\t\t\t\ttexture.image = image;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad !== undefined ) {\n\n\t\t\t\t\tonLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t\treturn texture;\n\n\t\t},\n\n\t\tsetCrossOrigin: function ( value ) {\n\n\t\t\tthis.crossOrigin = value;\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetWithCredentials: function ( value ) {\n\n\t\t\tthis.withCredentials = value;\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetPath: function ( value ) {\n\n\t\t\tthis.path = value;\n\t\t\treturn this;\n\n\t\t}\n\n\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Light( color, intensity ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Light';\n\n\t\tthis.color = new Color( color );\n\t\tthis.intensity = intensity !== undefined ? intensity : 1;\n\n\t\tthis.receiveShadow = undefined;\n\n\t}\n\n\tLight.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Light,\n\n\t\tisLight: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tObject3D.prototype.copy.call( this, source );\n\n\t\t\tthis.color.copy( source.color );\n\t\t\tthis.intensity = source.intensity;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\ttoJSON: function ( meta ) {\n\n\t\t\tvar data = Object3D.prototype.toJSON.call( this, meta );\n\n\t\t\tdata.object.color = this.color.getHex();\n\t\t\tdata.object.intensity = this.intensity;\n\n\t\t\tif ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex();\n\n\t\t\tif ( this.distance !== undefined ) data.object.distance = this.distance;\n\t\t\tif ( this.angle !== undefined ) data.object.angle = this.angle;\n\t\t\tif ( this.decay !== undefined ) data.object.decay = this.decay;\n\t\t\tif ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra;\n\n\t\t\tif ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON();\n\n\t\t\treturn data;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction HemisphereLight( skyColor, groundColor, intensity ) {\n\n\t\tLight.call( this, skyColor, intensity );\n\n\t\tthis.type = 'HemisphereLight';\n\n\t\tthis.castShadow = undefined;\n\n\t\tthis.position.copy( Object3D.DefaultUp );\n\t\tthis.updateMatrix();\n\n\t\tthis.groundColor = new Color( groundColor );\n\n\t}\n\n\tHemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), {\n\n\t\tconstructor: HemisphereLight,\n\n\t\tisHemisphereLight: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tLight.prototype.copy.call( this, source );\n\n\t\t\tthis.groundColor.copy( source.groundColor );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction LightShadow( camera ) {\n\n\t\tthis.camera = camera;\n\n\t\tthis.bias = 0;\n\t\tthis.radius = 1;\n\n\t\tthis.mapSize = new Vector2( 512, 512 );\n\n\t\tthis.map = null;\n\t\tthis.matrix = new Matrix4();\n\n\t}\n\n\tObject.assign( LightShadow.prototype, {\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.camera = source.camera.clone();\n\n\t\t\tthis.bias = source.bias;\n\t\t\tthis.radius = source.radius;\n\n\t\t\tthis.mapSize.copy( source.mapSize );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\ttoJSON: function () {\n\n\t\t\tvar object = {};\n\n\t\t\tif ( this.bias !== 0 ) object.bias = this.bias;\n\t\t\tif ( this.radius !== 1 ) object.radius = this.radius;\n\t\t\tif ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();\n\n\t\t\tobject.camera = this.camera.toJSON( false ).object;\n\t\t\tdelete object.camera.matrix;\n\n\t\t\treturn object;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction SpotLightShadow() {\n\n\t\tLightShadow.call( this, new PerspectiveCamera( 50, 1, 0.5, 500 ) );\n\n\t}\n\n\tSpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), {\n\n\t\tconstructor: SpotLightShadow,\n\n\t\tisSpotLightShadow: true,\n\n\t\tupdate: function ( light ) {\n\n\t\t\tvar fov = _Math.RAD2DEG * 2 * light.angle;\n\t\t\tvar aspect = this.mapSize.width / this.mapSize.height;\n\t\t\tvar far = light.distance || 500;\n\n\t\t\tvar camera = this.camera;\n\n\t\t\tif ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) {\n\n\t\t\t\tcamera.fov = fov;\n\t\t\t\tcamera.aspect = aspect;\n\t\t\t\tcamera.far = far;\n\t\t\t\tcamera.updateProjectionMatrix();\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction SpotLight( color, intensity, distance, angle, penumbra, decay ) {\n\n\t\tLight.call( this, color, intensity );\n\n\t\tthis.type = 'SpotLight';\n\n\t\tthis.position.copy( Object3D.DefaultUp );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tObject.defineProperty( this, 'power', {\n\t\t\tget: function () {\n\t\t\t\t// intensity = power per solid angle.\n\t\t\t\t// ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\n\t\t\t\treturn this.intensity * Math.PI;\n\t\t\t},\n\t\t\tset: function ( power ) {\n\t\t\t\t// intensity = power per solid angle.\n\t\t\t\t// ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\n\t\t\t\tthis.intensity = power / Math.PI;\n\t\t\t}\n\t\t} );\n\n\t\tthis.distance = ( distance !== undefined ) ? distance : 0;\n\t\tthis.angle = ( angle !== undefined ) ? angle : Math.PI / 3;\n\t\tthis.penumbra = ( penumbra !== undefined ) ? penumbra : 0;\n\t\tthis.decay = ( decay !== undefined ) ? decay : 1;\t// for physically correct lights, should be 2.\n\n\t\tthis.shadow = new SpotLightShadow();\n\n\t}\n\n\tSpotLight.prototype = Object.assign( Object.create( Light.prototype ), {\n\n\t\tconstructor: SpotLight,\n\n\t\tisSpotLight: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tLight.prototype.copy.call( this, source );\n\n\t\t\tthis.distance = source.distance;\n\t\t\tthis.angle = source.angle;\n\t\t\tthis.penumbra = source.penumbra;\n\t\t\tthis.decay = source.decay;\n\n\t\t\tthis.target = source.target.clone();\n\n\t\t\tthis.shadow = source.shadow.clone();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\n\tfunction PointLight( color, intensity, distance, decay ) {\n\n\t\tLight.call( this, color, intensity );\n\n\t\tthis.type = 'PointLight';\n\n\t\tObject.defineProperty( this, 'power', {\n\t\t\tget: function () {\n\t\t\t\t// intensity = power per solid angle.\n\t\t\t\t// ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\n\t\t\t\treturn this.intensity * 4 * Math.PI;\n\n\t\t\t},\n\t\t\tset: function ( power ) {\n\t\t\t\t// intensity = power per solid angle.\n\t\t\t\t// ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\n\t\t\t\tthis.intensity = power / ( 4 * Math.PI );\n\t\t\t}\n\t\t} );\n\n\t\tthis.distance = ( distance !== undefined ) ? distance : 0;\n\t\tthis.decay = ( decay !== undefined ) ? decay : 1;\t// for physically correct lights, should be 2.\n\n\t\tthis.shadow = new LightShadow( new PerspectiveCamera( 90, 1, 0.5, 500 ) );\n\n\t}\n\n\tPointLight.prototype = Object.assign( Object.create( Light.prototype ), {\n\n\t\tconstructor: PointLight,\n\n\t\tisPointLight: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tLight.prototype.copy.call( this, source );\n\n\t\t\tthis.distance = source.distance;\n\t\t\tthis.decay = source.decay;\n\n\t\t\tthis.shadow = source.shadow.clone();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction DirectionalLightShadow( light ) {\n\n\t\tLightShadow.call( this, new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );\n\n\t}\n\n\tDirectionalLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), {\n\n\t\tconstructor: DirectionalLightShadow\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction DirectionalLight( color, intensity ) {\n\n\t\tLight.call( this, color, intensity );\n\n\t\tthis.type = 'DirectionalLight';\n\n\t\tthis.position.copy( Object3D.DefaultUp );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tthis.shadow = new DirectionalLightShadow();\n\n\t}\n\n\tDirectionalLight.prototype = Object.assign( Object.create( Light.prototype ), {\n\n\t\tconstructor: DirectionalLight,\n\n\t\tisDirectionalLight: true,\n\n\t\tcopy: function ( source ) {\n\n\t\t\tLight.prototype.copy.call( this, source );\n\n\t\t\tthis.target = source.target.clone();\n\n\t\t\tthis.shadow = source.shadow.clone();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction AmbientLight( color, intensity ) {\n\n\t\tLight.call( this, color, intensity );\n\n\t\tthis.type = 'AmbientLight';\n\n\t\tthis.castShadow = undefined;\n\n\t}\n\n\tAmbientLight.prototype = Object.assign( Object.create( Light.prototype ), {\n\n\t\tconstructor: AmbientLight,\n\n\t\tisAmbientLight: true,\n\n\t} );\n\n\t/**\n\t * @author tschw\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t */\n\n\tvar AnimationUtils = {\n\n\t\t// same as Array.prototype.slice, but also works on typed arrays\n\t\tarraySlice: function( array, from, to ) {\n\n\t\t\tif ( AnimationUtils.isTypedArray( array ) ) {\n\n\t\t\t\treturn new array.constructor( array.subarray( from, to ) );\n\n\t\t\t}\n\n\t\t\treturn array.slice( from, to );\n\n\t\t},\n\n\t\t// converts an array to a specific type\n\t\tconvertArray: function( array, type, forceClone ) {\n\n\t\t\tif ( ! array || // let 'undefined' and 'null' pass\n\t\t\t\t\t! forceClone && array.constructor === type ) return array;\n\n\t\t\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\t\t\treturn new type( array ); // create typed array\n\n\t\t\t}\n\n\t\t\treturn Array.prototype.slice.call( array ); // create Array\n\n\t\t},\n\n\t\tisTypedArray: function( object ) {\n\n\t\t\treturn ArrayBuffer.isView( object ) &&\n\t\t\t\t\t! ( object instanceof DataView );\n\n\t\t},\n\n\t\t// returns an array by which times and values can be sorted\n\t\tgetKeyframeOrder: function( times ) {\n\n\t\t\tfunction compareTime( i, j ) {\n\n\t\t\t\treturn times[ i ] - times[ j ];\n\n\t\t\t}\n\n\t\t\tvar n = times.length;\n\t\t\tvar result = new Array( n );\n\t\t\tfor ( var i = 0; i !== n; ++ i ) result[ i ] = i;\n\n\t\t\tresult.sort( compareTime );\n\n\t\t\treturn result;\n\n\t\t},\n\n\t\t// uses the array previously returned by 'getKeyframeOrder' to sort data\n\t\tsortedArray: function( values, stride, order ) {\n\n\t\t\tvar nValues = values.length;\n\t\t\tvar result = new values.constructor( nValues );\n\n\t\t\tfor ( var i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) {\n\n\t\t\t\tvar srcOffset = order[ i ] * stride;\n\n\t\t\t\tfor ( var j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\tresult[ dstOffset ++ ] = values[ srcOffset + j ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t},\n\n\t\t// function for parsing AOS keyframe formats\n\t\tflattenJSON: function( jsonKeys, times, values, valuePropertyName ) {\n\n\t\t\tvar i = 1, key = jsonKeys[ 0 ];\n\n\t\t\twhile ( key !== undefined && key[ valuePropertyName ] === undefined ) {\n\n\t\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t\t}\n\n\t\t\tif ( key === undefined ) return; // no data\n\n\t\t\tvar value = key[ valuePropertyName ];\n\t\t\tif ( value === undefined ) return; // no data\n\n\t\t\tif ( Array.isArray( value ) ) {\n\n\t\t\t\tdo {\n\n\t\t\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\ttimes.push( key.time );\n\t\t\t\t\t\tvalues.push.apply( values, value ); // push all elements\n\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t\t\t} while ( key !== undefined );\n\n\t\t\t} else if ( value.toArray !== undefined ) {\n\t\t\t\t// ...assume THREE.Math-ish\n\n\t\t\t\tdo {\n\n\t\t\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\ttimes.push( key.time );\n\t\t\t\t\t\tvalue.toArray( values, values.length );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t\t\t} while ( key !== undefined );\n\n\t\t\t} else {\n\t\t\t\t// otherwise push as-is\n\n\t\t\t\tdo {\n\n\t\t\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\ttimes.push( key.time );\n\t\t\t\t\t\tvalues.push( value );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t\t\t} while ( key !== undefined );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t/**\n\t * Abstract base class of interpolants over parametric samples.\n\t *\n\t * The parameter domain is one dimensional, typically the time or a path\n\t * along a curve defined by the data.\n\t *\n\t * The sample values can have any dimensionality and derived classes may\n\t * apply special interpretations to the data.\n\t *\n\t * This class provides the interval seek in a Template Method, deferring\n\t * the actual interpolation to derived classes.\n\t *\n\t * Time complexity is O(1) for linear access crossing at most two points\n\t * and O(log N) for random access, where N is the number of positions.\n\t *\n\t * References:\n\t *\n\t * \t\thttp://www.oodesign.com/template-method-pattern.html\n\t *\n\t * @author tschw\n\t */\n\n\tfunction Interpolant(\n\t\t\tparameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\n\t\tthis.resultBuffer = resultBuffer !== undefined ?\n\t\t\t\tresultBuffer : new sampleValues.constructor( sampleSize );\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\n\t}\n\n\tInterpolant.prototype = {\n\n\t\tconstructor: Interpolant,\n\n\t\tevaluate: function( t ) {\n\n\t\t\tvar pp = this.parameterPositions,\n\t\t\t\ti1 = this._cachedIndex,\n\n\t\t\t\tt1 = pp[ i1 ],\n\t\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\t\tvalidate_interval: {\n\n\t\t\t\tseek: {\n\n\t\t\t\t\tvar right;\n\n\t\t\t\t\tlinear_scan: {\n\t//- See http://jsperf.com/comparison-to-undefined/3\n\t//- slower code:\n\t//-\n\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\t\tforward_scan: if ( ! ( t < t1 ) ) {\n\n\t\t\t\t\t\t\tfor ( var giveUpAt = i1 + 2; ;) {\n\n\t\t\t\t\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\t\t\t\t\tif ( t < t0 ) break forward_scan;\n\n\t\t\t\t\t\t\t\t\t// after end\n\n\t\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\t\treturn this.afterEnd_( i1 - 1, t, t0 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\t\tt1 = pp[ ++ i1 ];\n\n\t\t\t\t\t\t\t\tif ( t < t1 ) {\n\n\t\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// prepare binary search on the right side of the index\n\t\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t\t}\n\n\t//- slower code:\n\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\t\t\t\t\t\tif ( ! ( t >= t0 ) ) {\n\n\t\t\t\t\t\t\t// looping?\n\n\t\t\t\t\t\t\tvar t1global = pp[ 1 ];\n\n\t\t\t\t\t\t\tif ( t < t1global ) {\n\n\t\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\t\t\t\t\t\t\t\tt0 = t1global;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// linear reverse scan\n\n\t\t\t\t\t\t\tfor ( var giveUpAt = i1 - 2; ;) {\n\n\t\t\t\t\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\t\t\t\t\t// before start\n\n\t\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\t\treturn this.beforeStart_( 0, t, t1 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\t\tt0 = pp[ -- i1 - 1 ];\n\n\t\t\t\t\t\t\t\tif ( t >= t0 ) {\n\n\t\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// prepare binary search on the left side of the index\n\t\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// the interval is valid\n\n\t\t\t\t\t\tbreak validate_interval;\n\n\t\t\t\t\t} // linear scan\n\n\t\t\t\t\t// binary search\n\n\t\t\t\t\twhile ( i1 < right ) {\n\n\t\t\t\t\t\tvar mid = ( i1 + right ) >>> 1;\n\n\t\t\t\t\t\tif ( t < pp[ mid ] ) {\n\n\t\t\t\t\t\t\tright = mid;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\ti1 = mid + 1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tt1 = pp[ i1 ];\n\t\t\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\t\t\t\t// check boundary cases, again\n\n\t\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\treturn this.beforeStart_( 0, t, t1 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\treturn this.afterEnd_( i1 - 1, t0, t );\n\n\t\t\t\t\t}\n\n\t\t\t\t} // seek\n\n\t\t\t\tthis._cachedIndex = i1;\n\n\t\t\t\tthis.intervalChanged_( i1, t0, t1 );\n\n\t\t\t} // validate_interval\n\n\t\t\treturn this.interpolate_( i1, t0, t, t1 );\n\n\t\t},\n\n\t\tsettings: null, // optional, subclass-specific settings structure\n\t\t// Note: The indirection allows central control of many interpolants.\n\n\t\t// --- Protected interface\n\n\t\tDefaultSettings_: {},\n\n\t\tgetSettings_: function() {\n\n\t\t\treturn this.settings || this.DefaultSettings_;\n\n\t\t},\n\n\t\tcopySampleValue_: function( index ) {\n\n\t\t\t// copies a sample value to the result buffer\n\n\t\t\tvar result = this.resultBuffer,\n\t\t\t\tvalues = this.sampleValues,\n\t\t\t\tstride = this.valueSize,\n\t\t\t\toffset = index * stride;\n\n\t\t\tfor ( var i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t},\n\n\t\t// Template methods for derived classes:\n\n\t\tinterpolate_: function( i1, t0, t, t1 ) {\n\n\t\t\tthrow new Error( \"call to abstract method\" );\n\t\t\t// implementations shall return this.resultBuffer\n\n\t\t},\n\n\t\tintervalChanged_: function( i1, t0, t1 ) {\n\n\t\t\t// empty\n\n\t\t}\n\n\t};\n\n\tObject.assign( Interpolant.prototype, {\n\n\t\tbeforeStart_: //( 0, t, t0 ), returns this.resultBuffer\n\t\t\tInterpolant.prototype.copySampleValue_,\n\n\t\tafterEnd_: //( N-1, tN-1, t ), returns this.resultBuffer\n\t\t\tInterpolant.prototype.copySampleValue_\n\n\t} );\n\n\t/**\n\t * Fast and simple cubic spline interpolant.\n\t *\n\t * It was derived from a Hermitian construction setting the first derivative\n\t * at each sample position to the linear slope between neighboring positions\n\t * over their parameter interval.\n\t *\n\t * @author tschw\n\t */\n\n\tfunction CubicInterpolant(\n\t\t\tparameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tInterpolant.call(\n\t\t\t\tthis, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\tthis._weightPrev = -0;\n\t\tthis._offsetPrev = -0;\n\t\tthis._weightNext = -0;\n\t\tthis._offsetNext = -0;\n\n\t}\n\n\tCubicInterpolant.prototype =\n\t\t\tObject.assign( Object.create( Interpolant.prototype ), {\n\n\t\tconstructor: CubicInterpolant,\n\n\t\tDefaultSettings_: {\n\n\t\t\tendingStart: \tZeroCurvatureEnding,\n\t\t\tendingEnd:\t\tZeroCurvatureEnding\n\n\t\t},\n\n\t\tintervalChanged_: function( i1, t0, t1 ) {\n\n\t\t\tvar pp = this.parameterPositions,\n\t\t\t\tiPrev = i1 - 2,\n\t\t\t\tiNext = i1 + 1,\n\n\t\t\t\ttPrev = pp[ iPrev ],\n\t\t\t\ttNext = pp[ iNext ];\n\n\t\t\tif ( tPrev === undefined ) {\n\n\t\t\t\tswitch ( this.getSettings_().endingStart ) {\n\n\t\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\t\tiPrev = i1;\n\t\t\t\t\t\ttPrev = 2 * t0 - t1;\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\t\ttPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ];\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\t\tiPrev = i1;\n\t\t\t\t\t\ttPrev = t1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( tNext === undefined ) {\n\n\t\t\t\tswitch ( this.getSettings_().endingEnd ) {\n\n\t\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\t\tiNext = i1;\n\t\t\t\t\t\ttNext = 2 * t1 - t0;\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\t\tiNext = 1;\n\t\t\t\t\t\ttNext = t1 + pp[ 1 ] - pp[ 0 ];\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\t\ttNext = t0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar halfDt = ( t1 - t0 ) * 0.5,\n\t\t\t\tstride = this.valueSize;\n\n\t\t\tthis._weightPrev = halfDt / ( t0 - tPrev );\n\t\t\tthis._weightNext = halfDt / ( tNext - t1 );\n\t\t\tthis._offsetPrev = iPrev * stride;\n\t\t\tthis._offsetNext = iNext * stride;\n\n\t\t},\n\n\t\tinterpolate_: function( i1, t0, t, t1 ) {\n\n\t\t\tvar result = this.resultBuffer,\n\t\t\t\tvalues = this.sampleValues,\n\t\t\t\tstride = this.valueSize,\n\n\t\t\t\to1 = i1 * stride,\t\to0 = o1 - stride,\n\t\t\t\toP = this._offsetPrev, \toN = this._offsetNext,\n\t\t\t\twP = this._weightPrev,\twN = this._weightNext,\n\n\t\t\t\tp = ( t - t0 ) / ( t1 - t0 ),\n\t\t\t\tpp = p * p,\n\t\t\t\tppp = pp * p;\n\n\t\t\t// evaluate polynomials\n\n\t\t\tvar sP = - wP * ppp + 2 * wP * pp - wP * p;\n\t\t\tvar s0 = ( 1 + wP ) * ppp + (-1.5 - 2 * wP ) * pp + ( -0.5 + wP ) * p + 1;\n\t\t\tvar s1 = (-1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p;\n\t\t\tvar sN = wN * ppp - wN * pp;\n\n\t\t\t// combine data linearly\n\n\t\t\tfor ( var i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tresult[ i ] =\n\t\t\t\t\t\tsP * values[ oP + i ] +\n\t\t\t\t\t\ts0 * values[ o0 + i ] +\n\t\t\t\t\t\ts1 * values[ o1 + i ] +\n\t\t\t\t\t\tsN * values[ oN + i ];\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author tschw\n\t */\n\n\tfunction LinearInterpolant(\n\t\t\tparameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tInterpolant.call(\n\t\t\t\tthis, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tLinearInterpolant.prototype =\n\t\t\tObject.assign( Object.create( Interpolant.prototype ), {\n\n\t\tconstructor: LinearInterpolant,\n\n\t\tinterpolate_: function( i1, t0, t, t1 ) {\n\n\t\t\tvar result = this.resultBuffer,\n\t\t\t\tvalues = this.sampleValues,\n\t\t\t\tstride = this.valueSize,\n\n\t\t\t\toffset1 = i1 * stride,\n\t\t\t\toffset0 = offset1 - stride,\n\n\t\t\t\tweight1 = ( t - t0 ) / ( t1 - t0 ),\n\t\t\t\tweight0 = 1 - weight1;\n\n\t\t\tfor ( var i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tresult[ i ] =\n\t\t\t\t\t\tvalues[ offset0 + i ] * weight0 +\n\t\t\t\t\t\tvalues[ offset1 + i ] * weight1;\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t *\n\t * Interpolant that evaluates to the sample value at the position preceeding\n\t * the parameter.\n\t *\n\t * @author tschw\n\t */\n\n\tfunction DiscreteInterpolant(\n\t\t\tparameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tInterpolant.call(\n\t\t\t\tthis, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tDiscreteInterpolant.prototype =\n\t\t\tObject.assign( Object.create( Interpolant.prototype ), {\n\n\t\tconstructor: DiscreteInterpolant,\n\n\t\tinterpolate_: function( i1, t0, t, t1 ) {\n\n\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t}\n\n\t} );\n\n\tvar KeyframeTrackPrototype;\n\n\tKeyframeTrackPrototype = {\n\n\t\tTimeBufferType: Float32Array,\n\t\tValueBufferType: Float32Array,\n\n\t\tDefaultInterpolation: InterpolateLinear,\n\n\t\tInterpolantFactoryMethodDiscrete: function( result ) {\n\n\t\t\treturn new DiscreteInterpolant(\n\t\t\t\t\tthis.times, this.values, this.getValueSize(), result );\n\n\t\t},\n\n\t\tInterpolantFactoryMethodLinear: function( result ) {\n\n\t\t\treturn new LinearInterpolant(\n\t\t\t\t\tthis.times, this.values, this.getValueSize(), result );\n\n\t\t},\n\n\t\tInterpolantFactoryMethodSmooth: function( result ) {\n\n\t\t\treturn new CubicInterpolant(\n\t\t\t\t\tthis.times, this.values, this.getValueSize(), result );\n\n\t\t},\n\n\t\tsetInterpolation: function( interpolation ) {\n\n\t\t\tvar factoryMethod;\n\n\t\t\tswitch ( interpolation ) {\n\n\t\t\t\tcase InterpolateDiscrete:\n\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase InterpolateLinear:\n\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase InterpolateSmooth:\n\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( factoryMethod === undefined ) {\n\n\t\t\t\tvar message = \"unsupported interpolation for \" +\n\t\t\t\t\t\tthis.ValueTypeName + \" keyframe track named \" + this.name;\n\n\t\t\t\tif ( this.createInterpolant === undefined ) {\n\n\t\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\t\tif ( interpolation !== this.DefaultInterpolation ) {\n\n\t\t\t\t\t\tthis.setInterpolation( this.DefaultInterpolation );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthrow new Error( message ); // fatal, in this case\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconsole.warn( message );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tthis.createInterpolant = factoryMethod;\n\n\t\t},\n\n\t\tgetInterpolation: function() {\n\n\t\t\tswitch ( this.createInterpolant ) {\n\n\t\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\n\t\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\t\tcase this.InterpolantFactoryMethodLinear:\n\n\t\t\t\t\treturn InterpolateLinear;\n\n\t\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\n\t\t\t\t\treturn InterpolateSmooth;\n\n\t\t\t}\n\n\t\t},\n\n\t\tgetValueSize: function() {\n\n\t\t\treturn this.values.length / this.times.length;\n\n\t\t},\n\n\t\t// move all keyframes either forwards or backwards in time\n\t\tshift: function( timeOffset ) {\n\n\t\t\tif( timeOffset !== 0.0 ) {\n\n\t\t\t\tvar times = this.times;\n\n\t\t\t\tfor( var i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\t\ttimes[ i ] += timeOffset;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// scale all keyframe times by a factor (useful for frame <-> seconds conversions)\n\t\tscale: function( timeScale ) {\n\n\t\t\tif( timeScale !== 1.0 ) {\n\n\t\t\t\tvar times = this.times;\n\n\t\t\t\tfor( var i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\t\ttimes[ i ] *= timeScale;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n\t\t// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\n\t\ttrim: function( startTime, endTime ) {\n\n\t\t\tvar times = this.times,\n\t\t\t\tnKeys = times.length,\n\t\t\t\tfrom = 0,\n\t\t\t\tto = nKeys - 1;\n\n\t\t\twhile ( from !== nKeys && times[ from ] < startTime ) ++ from;\n\t\t\twhile ( to !== -1 && times[ to ] > endTime ) -- to;\n\n\t\t\t++ to; // inclusive -> exclusive bound\n\n\t\t\tif( from !== 0 || to !== nKeys ) {\n\n\t\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\t\tif ( from >= to ) to = Math.max( to , 1 ), from = to - 1;\n\n\t\t\t\tvar stride = this.getValueSize();\n\t\t\t\tthis.times = AnimationUtils.arraySlice( times, from, to );\n\t\t\t\tthis.values = AnimationUtils.\n\t\t\t\t\t\tarraySlice( this.values, from * stride, to * stride );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\n\t\tvalidate: function() {\n\n\t\t\tvar valid = true;\n\n\t\t\tvar valueSize = this.getValueSize();\n\t\t\tif ( valueSize - Math.floor( valueSize ) !== 0 ) {\n\n\t\t\t\tconsole.error( \"invalid value size in track\", this );\n\t\t\t\tvalid = false;\n\n\t\t\t}\n\n\t\t\tvar times = this.times,\n\t\t\t\tvalues = this.values,\n\n\t\t\t\tnKeys = times.length;\n\n\t\t\tif( nKeys === 0 ) {\n\n\t\t\t\tconsole.error( \"track is empty\", this );\n\t\t\t\tvalid = false;\n\n\t\t\t}\n\n\t\t\tvar prevTime = null;\n\n\t\t\tfor( var i = 0; i !== nKeys; i ++ ) {\n\n\t\t\t\tvar currTime = times[ i ];\n\n\t\t\t\tif ( typeof currTime === 'number' && isNaN( currTime ) ) {\n\n\t\t\t\t\tconsole.error( \"time is not a valid number\", this, i, currTime );\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tif( prevTime !== null && prevTime > currTime ) {\n\n\t\t\t\t\tconsole.error( \"out of order keys\", this, i, currTime, prevTime );\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tprevTime = currTime;\n\n\t\t\t}\n\n\t\t\tif ( values !== undefined ) {\n\n\t\t\t\tif ( AnimationUtils.isTypedArray( values ) ) {\n\n\t\t\t\t\tfor ( var i = 0, n = values.length; i !== n; ++ i ) {\n\n\t\t\t\t\t\tvar value = values[ i ];\n\n\t\t\t\t\t\tif ( isNaN( value ) ) {\n\n\t\t\t\t\t\t\tconsole.error( \"value is not a valid number\", this, i, value );\n\t\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn valid;\n\n\t\t},\n\n\t\t// removes equivalent sequential keys as common in morph target sequences\n\t\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\n\t\toptimize: function() {\n\n\t\t\tvar times = this.times,\n\t\t\t\tvalues = this.values,\n\t\t\t\tstride = this.getValueSize(),\n\n\t\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\n\t\t\t\twriteIndex = 1,\n\t\t\t\tlastIndex = times.length - 1;\n\n\t\t\tfor( var i = 1; i < lastIndex; ++ i ) {\n\n\t\t\t\tvar keep = false;\n\n\t\t\t\tvar time = times[ i ];\n\t\t\t\tvar timeNext = times[ i + 1 ];\n\n\t\t\t\t// remove adjacent keyframes scheduled at the same time\n\n\t\t\t\tif ( time !== timeNext && ( i !== 1 || time !== time[ 0 ] ) ) {\n\n\t\t\t\t\tif ( ! smoothInterpolation ) {\n\n\t\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\n\t\t\t\t\t\tvar offset = i * stride,\n\t\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\t\tfor ( var j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\t\tvar value = values[ offset + j ];\n\n\t\t\t\t\t\t\tif ( value !== values[ offsetP + j ] ||\n\t\t\t\t\t\t\t\t\tvalue !== values[ offsetN + j ] ) {\n\n\t\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else keep = true;\n\n\t\t\t\t}\n\n\t\t\t\t// in-place compaction\n\n\t\t\t\tif ( keep ) {\n\n\t\t\t\t\tif ( i !== writeIndex ) {\n\n\t\t\t\t\t\ttimes[ writeIndex ] = times[ i ];\n\n\t\t\t\t\t\tvar readOffset = i * stride,\n\t\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\t\tfor ( var j = 0; j !== stride; ++ j )\n\n\t\t\t\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\t++ writeIndex;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// flush last keyframe (compaction looks ahead)\n\n\t\t\tif ( lastIndex > 0 ) {\n\n\t\t\t\ttimes[ writeIndex ] = times[ lastIndex ];\n\n\t\t\t\tfor ( var readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j )\n\n\t\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t\t++ writeIndex;\n\n\t\t\t}\n\n\t\t\tif ( writeIndex !== times.length ) {\n\n\t\t\t\tthis.times = AnimationUtils.arraySlice( times, 0, writeIndex );\n\t\t\t\tthis.values = AnimationUtils.arraySlice( values, 0, writeIndex * stride );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\tfunction KeyframeTrackConstructor( name, times, values, interpolation ) {\n\n\t\tif( name === undefined ) throw new Error( \"track name is undefined\" );\n\n\t\tif( times === undefined || times.length === 0 ) {\n\n\t\t\tthrow new Error( \"no keyframes in track named \" + name );\n\n\t\t}\n\n\t\tthis.name = name;\n\n\t\tthis.times = AnimationUtils.convertArray( times, this.TimeBufferType );\n\t\tthis.values = AnimationUtils.convertArray( values, this.ValueBufferType );\n\n\t\tthis.setInterpolation( interpolation || this.DefaultInterpolation );\n\n\t\tthis.validate();\n\t\tthis.optimize();\n\n\t}\n\n\t/**\n\t *\n\t * A Track of vectored keyframe values.\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction VectorKeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.call( this, name, times, values, interpolation );\n\n\t}\n\n\tVectorKeyframeTrack.prototype =\n\t\t\tObject.assign( Object.create( KeyframeTrackPrototype ), {\n\n\t\tconstructor: VectorKeyframeTrack,\n\n\t\tValueTypeName: 'vector'\n\n\t\t// ValueBufferType is inherited\n\n\t\t// DefaultInterpolation is inherited\n\n\t} );\n\n\t/**\n\t * Spherical linear unit quaternion interpolant.\n\t *\n\t * @author tschw\n\t */\n\n\tfunction QuaternionLinearInterpolant(\n\t\t\tparameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tInterpolant.call(\n\t\t\t\tthis, parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tQuaternionLinearInterpolant.prototype =\n\t\t\tObject.assign( Object.create( Interpolant.prototype ), {\n\n\t\tconstructor: QuaternionLinearInterpolant,\n\n\t\tinterpolate_: function( i1, t0, t, t1 ) {\n\n\t\t\tvar result = this.resultBuffer,\n\t\t\t\tvalues = this.sampleValues,\n\t\t\t\tstride = this.valueSize,\n\n\t\t\t\toffset = i1 * stride,\n\n\t\t\t\talpha = ( t - t0 ) / ( t1 - t0 );\n\n\t\t\tfor ( var end = offset + stride; offset !== end; offset += 4 ) {\n\n\t\t\t\tQuaternion.slerpFlat( result, 0,\n\t\t\t\t\t\tvalues, offset - stride, values, offset, alpha );\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t *\n\t * A Track of quaternion keyframe values.\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction QuaternionKeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.call( this, name, times, values, interpolation );\n\n\t}\n\n\tQuaternionKeyframeTrack.prototype =\n\t\t\tObject.assign( Object.create( KeyframeTrackPrototype ), {\n\n\t\tconstructor: QuaternionKeyframeTrack,\n\n\t\tValueTypeName: 'quaternion',\n\n\t\t// ValueBufferType is inherited\n\n\t\tDefaultInterpolation: InterpolateLinear,\n\n\t\tInterpolantFactoryMethodLinear: function( result ) {\n\n\t\t\treturn new QuaternionLinearInterpolant(\n\t\t\t\t\tthis.times, this.values, this.getValueSize(), result );\n\n\t\t},\n\n\t\tInterpolantFactoryMethodSmooth: undefined // not yet implemented\n\n\t} );\n\n\t/**\n\t *\n\t * A Track of numeric keyframe values.\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction NumberKeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.call( this, name, times, values, interpolation );\n\n\t}\n\n\tNumberKeyframeTrack.prototype =\n\t\t\tObject.assign( Object.create( KeyframeTrackPrototype ), {\n\n\t\tconstructor: NumberKeyframeTrack,\n\n\t\tValueTypeName: 'number',\n\n\t\t// ValueBufferType is inherited\n\n\t\t// DefaultInterpolation is inherited\n\n\t} );\n\n\t/**\n\t *\n\t * A Track that interpolates Strings\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction StringKeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.call( this, name, times, values, interpolation );\n\n\t}\n\n\tStringKeyframeTrack.prototype =\n\t\t\tObject.assign( Object.create( KeyframeTrackPrototype ), {\n\n\t\tconstructor: StringKeyframeTrack,\n\n\t\tValueTypeName: 'string',\n\t\tValueBufferType: Array,\n\n\t\tDefaultInterpolation: InterpolateDiscrete,\n\n\t\tInterpolantFactoryMethodLinear: undefined,\n\n\t\tInterpolantFactoryMethodSmooth: undefined\n\n\t} );\n\n\t/**\n\t *\n\t * A Track of Boolean keyframe values.\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction BooleanKeyframeTrack( name, times, values ) {\n\n\t\tKeyframeTrackConstructor.call( this, name, times, values );\n\n\t}\n\n\tBooleanKeyframeTrack.prototype =\n\t\t\tObject.assign( Object.create( KeyframeTrackPrototype ), {\n\n\t\tconstructor: BooleanKeyframeTrack,\n\n\t\tValueTypeName: 'bool',\n\t\tValueBufferType: Array,\n\n\t\tDefaultInterpolation: InterpolateDiscrete,\n\n\t\tInterpolantFactoryMethodLinear: undefined,\n\t\tInterpolantFactoryMethodSmooth: undefined\n\n\t\t// Note: Actually this track could have a optimized / compressed\n\t\t// representation of a single value and a custom interpolant that\n\t\t// computes \"firstValue ^ isOdd( index )\".\n\n\t} );\n\n\t/**\n\t *\n\t * A Track of keyframe values that represent color.\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction ColorKeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.call( this, name, times, values, interpolation );\n\n\t}\n\n\tColorKeyframeTrack.prototype =\n\t\t\tObject.assign( Object.create( KeyframeTrackPrototype ), {\n\n\t\tconstructor: ColorKeyframeTrack,\n\n\t\tValueTypeName: 'color'\n\n\t\t// ValueBufferType is inherited\n\n\t\t// DefaultInterpolation is inherited\n\n\n\t\t// Note: Very basic implementation and nothing special yet.\n\t\t// However, this is the place for color space parameterization.\n\n\t} );\n\n\t/**\n\t *\n\t * A timed sequence of keyframes for a specific property.\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction KeyframeTrack( name, times, values, interpolation ) {\n\n\t\tKeyframeTrackConstructor.apply( this, arguments );\n\n\t}\n\n\tKeyframeTrack.prototype = KeyframeTrackPrototype;\n\tKeyframeTrackPrototype.constructor = KeyframeTrack;\n\n\t// Static methods:\n\n\tObject.assign( KeyframeTrack, {\n\n\t\t// Serialization (in static context, because of constructor invocation\n\t\t// and automatic invocation of .toJSON):\n\n\t\tparse: function( json ) {\n\n\t\t\tif( json.type === undefined ) {\n\n\t\t\t\tthrow new Error( \"track type undefined, can not parse\" );\n\n\t\t\t}\n\n\t\t\tvar trackType = KeyframeTrack._getTrackTypeForValueTypeName( json.type );\n\n\t\t\tif ( json.times === undefined ) {\n\n\t\t\t\tvar times = [], values = [];\n\n\t\t\t\tAnimationUtils.flattenJSON( json.keys, times, values, 'value' );\n\n\t\t\t\tjson.times = times;\n\t\t\t\tjson.values = values;\n\n\t\t\t}\n\n\t\t\t// derived classes can define a static parse method\n\t\t\tif ( trackType.parse !== undefined ) {\n\n\t\t\t\treturn trackType.parse( json );\n\n\t\t\t} else {\n\n\t\t\t\t// by default, we asssume a constructor compatible with the base\n\t\t\t\treturn new trackType(\n\t\t\t\t\t\tjson.name, json.times, json.values, json.interpolation );\n\n\t\t\t}\n\n\t\t},\n\n\t\ttoJSON: function( track ) {\n\n\t\t\tvar trackType = track.constructor;\n\n\t\t\tvar json;\n\n\t\t\t// derived classes can define a static toJSON method\n\t\t\tif ( trackType.toJSON !== undefined ) {\n\n\t\t\t\tjson = trackType.toJSON( track );\n\n\t\t\t} else {\n\n\t\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\t\tjson = {\n\n\t\t\t\t\t'name': track.name,\n\t\t\t\t\t'times': AnimationUtils.convertArray( track.times, Array ),\n\t\t\t\t\t'values': AnimationUtils.convertArray( track.values, Array )\n\n\t\t\t\t};\n\n\t\t\t\tvar interpolation = track.getInterpolation();\n\n\t\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\t\treturn json;\n\n\t\t},\n\n\t\t_getTrackTypeForValueTypeName: function( typeName ) {\n\n\t\t\tswitch( typeName.toLowerCase() ) {\n\n\t\t\t\tcase \"scalar\":\n\t\t\t\tcase \"double\":\n\t\t\t\tcase \"float\":\n\t\t\t\tcase \"number\":\n\t\t\t\tcase \"integer\":\n\n\t\t\t\t\treturn NumberKeyframeTrack;\n\n\t\t\t\tcase \"vector\":\n\t\t\t\tcase \"vector2\":\n\t\t\t\tcase \"vector3\":\n\t\t\t\tcase \"vector4\":\n\n\t\t\t\t\treturn VectorKeyframeTrack;\n\n\t\t\t\tcase \"color\":\n\n\t\t\t\t\treturn ColorKeyframeTrack;\n\n\t\t\t\tcase \"quaternion\":\n\n\t\t\t\t\treturn QuaternionKeyframeTrack;\n\n\t\t\t\tcase \"bool\":\n\t\t\t\tcase \"boolean\":\n\n\t\t\t\t\treturn BooleanKeyframeTrack;\n\n\t\t\t\tcase \"string\":\n\n\t\t\t\t\treturn StringKeyframeTrack;\n\n\t\t\t}\n\n\t\t\tthrow new Error( \"Unsupported typeName: \" + typeName );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t *\n\t * Reusable set of Tracks that represent an animation.\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t */\n\n\tfunction AnimationClip( name, duration, tracks ) {\n\n\t\tthis.name = name;\n\t\tthis.tracks = tracks;\n\t\tthis.duration = ( duration !== undefined ) ? duration : -1;\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\t// this means it should figure out its duration by scanning the tracks\n\t\tif ( this.duration < 0 ) {\n\n\t\t\tthis.resetDuration();\n\n\t\t}\n\n\t\tthis.optimize();\n\n\t}\n\n\tAnimationClip.prototype = {\n\n\t\tconstructor: AnimationClip,\n\n\t\tresetDuration: function() {\n\n\t\t\tvar tracks = this.tracks,\n\t\t\t\tduration = 0;\n\n\t\t\tfor ( var i = 0, n = tracks.length; i !== n; ++ i ) {\n\n\t\t\t\tvar track = this.tracks[ i ];\n\n\t\t\t\tduration = Math.max(\n\t\t\t\t\t\tduration, track.times[ track.times.length - 1 ] );\n\n\t\t\t}\n\n\t\t\tthis.duration = duration;\n\n\t\t},\n\n\t\ttrim: function() {\n\n\t\t\tfor ( var i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\t\tthis.tracks[ i ].trim( 0, this.duration );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\toptimize: function() {\n\n\t\t\tfor ( var i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\t\tthis.tracks[ i ].optimize();\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\t// Static methods:\n\n\tObject.assign( AnimationClip, {\n\n\t\tparse: function( json ) {\n\n\t\t\tvar tracks = [],\n\t\t\t\tjsonTracks = json.tracks,\n\t\t\t\tframeTime = 1.0 / ( json.fps || 1.0 );\n\n\t\t\tfor ( var i = 0, n = jsonTracks.length; i !== n; ++ i ) {\n\n\t\t\t\ttracks.push( KeyframeTrack.parse( jsonTracks[ i ] ).scale( frameTime ) );\n\n\t\t\t}\n\n\t\t\treturn new AnimationClip( json.name, json.duration, tracks );\n\n\t\t},\n\n\n\t\ttoJSON: function( clip ) {\n\n\t\t\tvar tracks = [],\n\t\t\t\tclipTracks = clip.tracks;\n\n\t\t\tvar json = {\n\n\t\t\t\t'name': clip.name,\n\t\t\t\t'duration': clip.duration,\n\t\t\t\t'tracks': tracks\n\n\t\t\t};\n\n\t\t\tfor ( var i = 0, n = clipTracks.length; i !== n; ++ i ) {\n\n\t\t\t\ttracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) );\n\n\t\t\t}\n\n\t\t\treturn json;\n\n\t\t},\n\n\n\t\tCreateFromMorphTargetSequence: function( name, morphTargetSequence, fps, noLoop ) {\n\n\t\t\tvar numMorphTargets = morphTargetSequence.length;\n\t\t\tvar tracks = [];\n\n\t\t\tfor ( var i = 0; i < numMorphTargets; i ++ ) {\n\n\t\t\t\tvar times = [];\n\t\t\t\tvar values = [];\n\n\t\t\t\ttimes.push(\n\t\t\t\t\t\t( i + numMorphTargets - 1 ) % numMorphTargets,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\t( i + 1 ) % numMorphTargets );\n\n\t\t\t\tvalues.push( 0, 1, 0 );\n\n\t\t\t\tvar order = AnimationUtils.getKeyframeOrder( times );\n\t\t\t\ttimes = AnimationUtils.sortedArray( times, 1, order );\n\t\t\t\tvalues = AnimationUtils.sortedArray( values, 1, order );\n\n\t\t\t\t// if there is a key at the first frame, duplicate it as the\n\t\t\t\t// last frame as well for perfect loop.\n\t\t\t\tif ( ! noLoop && times[ 0 ] === 0 ) {\n\n\t\t\t\t\ttimes.push( numMorphTargets );\n\t\t\t\t\tvalues.push( values[ 0 ] );\n\n\t\t\t\t}\n\n\t\t\t\ttracks.push(\n\t\t\t\t\t\tnew NumberKeyframeTrack(\n\t\t\t\t\t\t\t'.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']',\n\t\t\t\t\t\t\ttimes, values\n\t\t\t\t\t\t).scale( 1.0 / fps ) );\n\t\t\t}\n\n\t\t\treturn new AnimationClip( name, -1, tracks );\n\n\t\t},\n\n\t\tfindByName: function( objectOrClipArray, name ) {\n\n\t\t\tvar clipArray = objectOrClipArray;\n\n\t\t\tif ( ! Array.isArray( objectOrClipArray ) ) {\n\n\t\t\t\tvar o = objectOrClipArray;\n\t\t\t\tclipArray = o.geometry && o.geometry.animations || o.animations;\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0; i < clipArray.length; i ++ ) {\n\n\t\t\t\tif ( clipArray[ i ].name === name ) {\n\n\t\t\t\t\treturn clipArray[ i ];\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t},\n\n\t\tCreateClipsFromMorphTargetSequences: function( morphTargets, fps, noLoop ) {\n\n\t\t\tvar animationToMorphTargets = {};\n\n\t\t\t// tested with https://regex101.com/ on trick sequences\n\t\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\t\t\tvar pattern = /^([\\w-]*?)([\\d]+)$/;\n\n\t\t\t// sort morph target names into animation groups based\n\t\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\t\t\tfor ( var i = 0, il = morphTargets.length; i < il; i ++ ) {\n\n\t\t\t\tvar morphTarget = morphTargets[ i ];\n\t\t\t\tvar parts = morphTarget.name.match( pattern );\n\n\t\t\t\tif ( parts && parts.length > 1 ) {\n\n\t\t\t\t\tvar name = parts[ 1 ];\n\n\t\t\t\t\tvar animationMorphTargets = animationToMorphTargets[ name ];\n\t\t\t\t\tif ( ! animationMorphTargets ) {\n\n\t\t\t\t\t\tanimationToMorphTargets[ name ] = animationMorphTargets = [];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tanimationMorphTargets.push( morphTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar clips = [];\n\n\t\t\tfor ( var name in animationToMorphTargets ) {\n\n\t\t\t\tclips.push( AnimationClip.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) );\n\n\t\t\t}\n\n\t\t\treturn clips;\n\n\t\t},\n\n\t\t// parse the animation.hierarchy format\n\t\tparseAnimation: function( animation, bones ) {\n\n\t\t\tif ( ! animation ) {\n\n\t\t\t\tconsole.error( \" no animation in JSONLoader data\" );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tvar addNonemptyTrack = function(\n\t\t\t\t\ttrackType, trackName, animationKeys, propertyName, destTracks ) {\n\n\t\t\t\t// only return track if there are actually keys.\n\t\t\t\tif ( animationKeys.length !== 0 ) {\n\n\t\t\t\t\tvar times = [];\n\t\t\t\t\tvar values = [];\n\n\t\t\t\t\tAnimationUtils.flattenJSON(\n\t\t\t\t\t\t\tanimationKeys, times, values, propertyName );\n\n\t\t\t\t\t// empty keys are filtered out, so check again\n\t\t\t\t\tif ( times.length !== 0 ) {\n\n\t\t\t\t\t\tdestTracks.push( new trackType( trackName, times, values ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\tvar tracks = [];\n\n\t\t\tvar clipName = animation.name || 'default';\n\t\t\t// automatic length determination in AnimationClip.\n\t\t\tvar duration = animation.length || -1;\n\t\t\tvar fps = animation.fps || 30;\n\n\t\t\tvar hierarchyTracks = animation.hierarchy || [];\n\n\t\t\tfor ( var h = 0; h < hierarchyTracks.length; h ++ ) {\n\n\t\t\t\tvar animationKeys = hierarchyTracks[ h ].keys;\n\n\t\t\t\t// skip empty tracks\n\t\t\t\tif ( ! animationKeys || animationKeys.length === 0 ) continue;\n\n\t\t\t\t// process morph targets in a way exactly compatible\n\t\t\t\t// with AnimationHandler.init( animation )\n\t\t\t\tif ( animationKeys[0].morphTargets ) {\n\n\t\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\t\tvar morphTargetNames = {};\n\t\t\t\t\tfor ( var k = 0; k < animationKeys.length; k ++ ) {\n\n\t\t\t\t\t\tif ( animationKeys[k].morphTargets ) {\n\n\t\t\t\t\t\t\tfor ( var m = 0; m < animationKeys[k].morphTargets.length; m ++ ) {\n\n\t\t\t\t\t\t\t\tmorphTargetNames[ animationKeys[k].morphTargets[m] ] = -1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// create a track for each morph target with all zero\n\t\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t\t// the morphTarget is named.\n\t\t\t\t\tfor ( var morphTargetName in morphTargetNames ) {\n\n\t\t\t\t\t\tvar times = [];\n\t\t\t\t\t\tvar values = [];\n\n\t\t\t\t\t\tfor ( var m = 0;\n\t\t\t\t\t\t\t\tm !== animationKeys[k].morphTargets.length; ++ m ) {\n\n\t\t\t\t\t\t\tvar animationKey = animationKeys[k];\n\n\t\t\t\t\t\t\ttimes.push( animationKey.time );\n\t\t\t\t\t\t\tvalues.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttracks.push( new NumberKeyframeTrack(\n\t\t\t\t\t\t\t\t'.morphTargetInfluence[' + morphTargetName + ']', times, values ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tduration = morphTargetNames.length * ( fps || 1.0 );\n\n\t\t\t\t} else {\n\t\t\t\t\t// ...assume skeletal animation\n\n\t\t\t\t\tvar boneName = '.bones[' + bones[ h ].name + ']';\n\n\t\t\t\t\taddNonemptyTrack(\n\t\t\t\t\t\t\tVectorKeyframeTrack, boneName + '.position',\n\t\t\t\t\t\t\tanimationKeys, 'pos', tracks );\n\n\t\t\t\t\taddNonemptyTrack(\n\t\t\t\t\t\t\tQuaternionKeyframeTrack, boneName + '.quaternion',\n\t\t\t\t\t\t\tanimationKeys, 'rot', tracks );\n\n\t\t\t\t\taddNonemptyTrack(\n\t\t\t\t\t\t\tVectorKeyframeTrack, boneName + '.scale',\n\t\t\t\t\t\t\tanimationKeys, 'scl', tracks );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( tracks.length === 0 ) {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tvar clip = new AnimationClip( clipName, duration, tracks );\n\n\t\t\treturn clip;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction MaterialLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\t\tthis.textures = {};\n\n\t}\n\n\tObject.assign( MaterialLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar loader = new XHRLoader( scope.manager );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t}, onProgress, onError );\n\n\t\t},\n\n\t\tsetTextures: function ( value ) {\n\n\t\t\tthis.textures = value;\n\n\t\t},\n\n\t\tparse: function ( json ) {\n\n\t\t\tvar textures = this.textures;\n\n\t\t\tfunction getTexture( name ) {\n\n\t\t\t\tif ( textures[ name ] === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.MaterialLoader: Undefined texture', name );\n\n\t\t\t\t}\n\n\t\t\t\treturn textures[ name ];\n\n\t\t\t}\n\n\t\t\tvar material = new Materials[ json.type ]();\n\n\t\t\tif ( json.uuid !== undefined ) material.uuid = json.uuid;\n\t\t\tif ( json.name !== undefined ) material.name = json.name;\n\t\t\tif ( json.color !== undefined ) material.color.setHex( json.color );\n\t\t\tif ( json.roughness !== undefined ) material.roughness = json.roughness;\n\t\t\tif ( json.metalness !== undefined ) material.metalness = json.metalness;\n\t\t\tif ( json.emissive !== undefined ) material.emissive.setHex( json.emissive );\n\t\t\tif ( json.specular !== undefined ) material.specular.setHex( json.specular );\n\t\t\tif ( json.shininess !== undefined ) material.shininess = json.shininess;\n\t\t\tif ( json.uniforms !== undefined ) material.uniforms = json.uniforms;\n\t\t\tif ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader;\n\t\t\tif ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader;\n\t\t\tif ( json.vertexColors !== undefined ) material.vertexColors = json.vertexColors;\n\t\t\tif ( json.fog !== undefined ) material.fog = json.fog;\n\t\t\tif ( json.shading !== undefined ) material.shading = json.shading;\n\t\t\tif ( json.blending !== undefined ) material.blending = json.blending;\n\t\t\tif ( json.side !== undefined ) material.side = json.side;\n\t\t\tif ( json.opacity !== undefined ) material.opacity = json.opacity;\n\t\t\tif ( json.transparent !== undefined ) material.transparent = json.transparent;\n\t\t\tif ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;\n\t\t\tif ( json.depthTest !== undefined ) material.depthTest = json.depthTest;\n\t\t\tif ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;\n\t\t\tif ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;\n\t\t\tif ( json.wireframe !== undefined ) material.wireframe = json.wireframe;\n\t\t\tif ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\t\tif ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;\n\t\t\tif ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;\n\t\t\tif ( json.skinning !== undefined ) material.skinning = json.skinning;\n\t\t\tif ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets;\n\n\t\t\t// for PointsMaterial\n\n\t\t\tif ( json.size !== undefined ) material.size = json.size;\n\t\t\tif ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation;\n\n\t\t\t// maps\n\n\t\t\tif ( json.map !== undefined ) material.map = getTexture( json.map );\n\n\t\t\tif ( json.alphaMap !== undefined ) {\n\n\t\t\t\tmaterial.alphaMap = getTexture( json.alphaMap );\n\t\t\t\tmaterial.transparent = true;\n\n\t\t\t}\n\n\t\t\tif ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );\n\t\t\tif ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;\n\n\t\t\tif ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );\n\t\t\tif ( json.normalScale !== undefined ) {\n\n\t\t\t\tvar normalScale = json.normalScale;\n\n\t\t\t\tif ( Array.isArray( normalScale ) === false ) {\n\n\t\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\n\t\t\t\t\tnormalScale = [ normalScale, normalScale ];\n\n\t\t\t\t}\n\n\t\t\t\tmaterial.normalScale = new Vector2().fromArray( normalScale );\n\n\t\t\t}\n\n\t\t\tif ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap );\n\t\t\tif ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale;\n\t\t\tif ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias;\n\n\t\t\tif ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap );\n\t\t\tif ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap );\n\n\t\t\tif ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap );\n\t\t\tif ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;\n\n\t\t\tif ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap );\n\n\t\t\tif ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );\n\n\t\t\tif ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;\n\n\t\t\tif ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap );\n\t\t\tif ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity;\n\n\t\t\tif ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap );\n\t\t\tif ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity;\n\n\t\t\t// MultiMaterial\n\n\t\t\tif ( json.materials !== undefined ) {\n\n\t\t\t\tfor ( var i = 0, l = json.materials.length; i < l; i ++ ) {\n\n\t\t\t\t\tmaterial.materials.push( this.parse( json.materials[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn material;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction BufferGeometryLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t}\n\n\tObject.assign( BufferGeometryLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar loader = new XHRLoader( scope.manager );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t}, onProgress, onError );\n\n\t\t},\n\n\t\tparse: function ( json ) {\n\n\t\t\tvar geometry = new BufferGeometry();\n\n\t\t\tvar index = json.data.index;\n\n\t\t\tvar TYPED_ARRAYS = {\n\t\t\t\t'Int8Array': Int8Array,\n\t\t\t\t'Uint8Array': Uint8Array,\n\t\t\t\t'Uint8ClampedArray': Uint8ClampedArray,\n\t\t\t\t'Int16Array': Int16Array,\n\t\t\t\t'Uint16Array': Uint16Array,\n\t\t\t\t'Int32Array': Int32Array,\n\t\t\t\t'Uint32Array': Uint32Array,\n\t\t\t\t'Float32Array': Float32Array,\n\t\t\t\t'Float64Array': Float64Array\n\t\t\t};\n\n\t\t\tif ( index !== undefined ) {\n\n\t\t\t\tvar typedArray = new TYPED_ARRAYS[ index.type ]( index.array );\n\t\t\t\tgeometry.setIndex( new BufferAttribute( typedArray, 1 ) );\n\n\t\t\t}\n\n\t\t\tvar attributes = json.data.attributes;\n\n\t\t\tfor ( var key in attributes ) {\n\n\t\t\t\tvar attribute = attributes[ key ];\n\t\t\t\tvar typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array );\n\n\t\t\t\tgeometry.addAttribute( key, new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized ) );\n\n\t\t\t}\n\n\t\t\tvar groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\t\tif ( groups !== undefined ) {\n\n\t\t\t\tfor ( var i = 0, n = groups.length; i !== n; ++ i ) {\n\n\t\t\t\t\tvar group = groups[ i ];\n\n\t\t\t\t\tgeometry.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar boundingSphere = json.data.boundingSphere;\n\n\t\t\tif ( boundingSphere !== undefined ) {\n\n\t\t\t\tvar center = new Vector3();\n\n\t\t\t\tif ( boundingSphere.center !== undefined ) {\n\n\t\t\t\t\tcenter.fromArray( boundingSphere.center );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.boundingSphere = new Sphere( center, boundingSphere.radius );\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Loader() {\n\n\t\tthis.onLoadStart = function () {};\n\t\tthis.onLoadProgress = function () {};\n\t\tthis.onLoadComplete = function () {};\n\n\t}\n\n\tLoader.prototype = {\n\n\t\tconstructor: Loader,\n\n\t\tcrossOrigin: undefined,\n\n\t\textractUrlBase: function ( url ) {\n\n\t\t\tvar parts = url.split( '/' );\n\n\t\t\tif ( parts.length === 1 ) return './';\n\n\t\t\tparts.pop();\n\n\t\t\treturn parts.join( '/' ) + '/';\n\n\t\t},\n\n\t\tinitMaterials: function ( materials, texturePath, crossOrigin ) {\n\n\t\t\tvar array = [];\n\n\t\t\tfor ( var i = 0; i < materials.length; ++ i ) {\n\n\t\t\t\tarray[ i ] = this.createMaterial( materials[ i ], texturePath, crossOrigin );\n\n\t\t\t}\n\n\t\t\treturn array;\n\n\t\t},\n\n\t\tcreateMaterial: ( function () {\n\n\t\t\tvar color, textureLoader, materialLoader;\n\n\t\t\treturn function createMaterial( m, texturePath, crossOrigin ) {\n\n\t\t\t\tif ( color === undefined ) color = new Color();\n\t\t\t\tif ( textureLoader === undefined ) textureLoader = new TextureLoader();\n\t\t\t\tif ( materialLoader === undefined ) materialLoader = new MaterialLoader();\n\n\t\t\t\t// convert from old material format\n\n\t\t\t\tvar textures = {};\n\n\t\t\t\tfunction loadTexture( path, repeat, offset, wrap, anisotropy ) {\n\n\t\t\t\t\tvar fullPath = texturePath + path;\n\t\t\t\t\tvar loader = Loader.Handlers.get( fullPath );\n\n\t\t\t\t\tvar texture;\n\n\t\t\t\t\tif ( loader !== null ) {\n\n\t\t\t\t\t\ttexture = loader.load( fullPath );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttextureLoader.setCrossOrigin( crossOrigin );\n\t\t\t\t\t\ttexture = textureLoader.load( fullPath );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( repeat !== undefined ) {\n\n\t\t\t\t\t\ttexture.repeat.fromArray( repeat );\n\n\t\t\t\t\t\tif ( repeat[ 0 ] !== 1 ) texture.wrapS = RepeatWrapping;\n\t\t\t\t\t\tif ( repeat[ 1 ] !== 1 ) texture.wrapT = RepeatWrapping;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( offset !== undefined ) {\n\n\t\t\t\t\t\ttexture.offset.fromArray( offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( wrap !== undefined ) {\n\n\t\t\t\t\t\tif ( wrap[ 0 ] === 'repeat' ) texture.wrapS = RepeatWrapping;\n\t\t\t\t\t\tif ( wrap[ 0 ] === 'mirror' ) texture.wrapS = MirroredRepeatWrapping;\n\n\t\t\t\t\t\tif ( wrap[ 1 ] === 'repeat' ) texture.wrapT = RepeatWrapping;\n\t\t\t\t\t\tif ( wrap[ 1 ] === 'mirror' ) texture.wrapT = MirroredRepeatWrapping;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( anisotropy !== undefined ) {\n\n\t\t\t\t\t\ttexture.anisotropy = anisotropy;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar uuid = _Math.generateUUID();\n\n\t\t\t\t\ttextures[ uuid ] = texture;\n\n\t\t\t\t\treturn uuid;\n\n\t\t\t\t}\n\n\t\t\t\t//\n\n\t\t\t\tvar json = {\n\t\t\t\t\tuuid: _Math.generateUUID(),\n\t\t\t\t\ttype: 'MeshLambertMaterial'\n\t\t\t\t};\n\n\t\t\t\tfor ( var name in m ) {\n\n\t\t\t\t\tvar value = m[ name ];\n\n\t\t\t\t\tswitch ( name ) {\n\t\t\t\t\t\tcase 'DbgColor':\n\t\t\t\t\t\tcase 'DbgIndex':\n\t\t\t\t\t\tcase 'opticalDensity':\n\t\t\t\t\t\tcase 'illumination':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'DbgName':\n\t\t\t\t\t\t\tjson.name = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'blending':\n\t\t\t\t\t\t\tjson.blending = BlendingMode[ value ];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'colorAmbient':\n\t\t\t\t\t\tcase 'mapAmbient':\n\t\t\t\t\t\t\tconsole.warn( 'THREE.Loader.createMaterial:', name, 'is no longer supported.' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'colorDiffuse':\n\t\t\t\t\t\t\tjson.color = color.fromArray( value ).getHex();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'colorSpecular':\n\t\t\t\t\t\t\tjson.specular = color.fromArray( value ).getHex();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'colorEmissive':\n\t\t\t\t\t\t\tjson.emissive = color.fromArray( value ).getHex();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'specularCoef':\n\t\t\t\t\t\t\tjson.shininess = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'shading':\n\t\t\t\t\t\t\tif ( value.toLowerCase() === 'basic' ) json.type = 'MeshBasicMaterial';\n\t\t\t\t\t\t\tif ( value.toLowerCase() === 'phong' ) json.type = 'MeshPhongMaterial';\n\t\t\t\t\t\t\tif ( value.toLowerCase() === 'standard' ) json.type = 'MeshStandardMaterial';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapDiffuse':\n\t\t\t\t\t\t\tjson.map = loadTexture( value, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapDiffuseRepeat':\n\t\t\t\t\t\tcase 'mapDiffuseOffset':\n\t\t\t\t\t\tcase 'mapDiffuseWrap':\n\t\t\t\t\t\tcase 'mapDiffuseAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapEmissive':\n\t\t\t\t\t\t\tjson.emissiveMap = loadTexture( value, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapEmissiveRepeat':\n\t\t\t\t\t\tcase 'mapEmissiveOffset':\n\t\t\t\t\t\tcase 'mapEmissiveWrap':\n\t\t\t\t\t\tcase 'mapEmissiveAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapLight':\n\t\t\t\t\t\t\tjson.lightMap = loadTexture( value, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapLightRepeat':\n\t\t\t\t\t\tcase 'mapLightOffset':\n\t\t\t\t\t\tcase 'mapLightWrap':\n\t\t\t\t\t\tcase 'mapLightAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapAO':\n\t\t\t\t\t\t\tjson.aoMap = loadTexture( value, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapAORepeat':\n\t\t\t\t\t\tcase 'mapAOOffset':\n\t\t\t\t\t\tcase 'mapAOWrap':\n\t\t\t\t\t\tcase 'mapAOAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapBump':\n\t\t\t\t\t\t\tjson.bumpMap = loadTexture( value, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapBumpScale':\n\t\t\t\t\t\t\tjson.bumpScale = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapBumpRepeat':\n\t\t\t\t\t\tcase 'mapBumpOffset':\n\t\t\t\t\t\tcase 'mapBumpWrap':\n\t\t\t\t\t\tcase 'mapBumpAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapNormal':\n\t\t\t\t\t\t\tjson.normalMap = loadTexture( value, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapNormalFactor':\n\t\t\t\t\t\t\tjson.normalScale = [ value, value ];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapNormalRepeat':\n\t\t\t\t\t\tcase 'mapNormalOffset':\n\t\t\t\t\t\tcase 'mapNormalWrap':\n\t\t\t\t\t\tcase 'mapNormalAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapSpecular':\n\t\t\t\t\t\t\tjson.specularMap = loadTexture( value, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapSpecularRepeat':\n\t\t\t\t\t\tcase 'mapSpecularOffset':\n\t\t\t\t\t\tcase 'mapSpecularWrap':\n\t\t\t\t\t\tcase 'mapSpecularAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapMetalness':\n\t\t\t\t\t\t\tjson.metalnessMap = loadTexture( value, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapMetalnessRepeat':\n\t\t\t\t\t\tcase 'mapMetalnessOffset':\n\t\t\t\t\t\tcase 'mapMetalnessWrap':\n\t\t\t\t\t\tcase 'mapMetalnessAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapRoughness':\n\t\t\t\t\t\t\tjson.roughnessMap = loadTexture( value, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapRoughnessRepeat':\n\t\t\t\t\t\tcase 'mapRoughnessOffset':\n\t\t\t\t\t\tcase 'mapRoughnessWrap':\n\t\t\t\t\t\tcase 'mapRoughnessAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapAlpha':\n\t\t\t\t\t\t\tjson.alphaMap = loadTexture( value, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'mapAlphaRepeat':\n\t\t\t\t\t\tcase 'mapAlphaOffset':\n\t\t\t\t\t\tcase 'mapAlphaWrap':\n\t\t\t\t\t\tcase 'mapAlphaAnisotropy':\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'flipSided':\n\t\t\t\t\t\t\tjson.side = BackSide;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'doubleSided':\n\t\t\t\t\t\t\tjson.side = DoubleSide;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'transparency':\n\t\t\t\t\t\t\tconsole.warn( 'THREE.Loader.createMaterial: transparency has been renamed to opacity' );\n\t\t\t\t\t\t\tjson.opacity = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'depthTest':\n\t\t\t\t\t\tcase 'depthWrite':\n\t\t\t\t\t\tcase 'colorWrite':\n\t\t\t\t\t\tcase 'opacity':\n\t\t\t\t\t\tcase 'reflectivity':\n\t\t\t\t\t\tcase 'transparent':\n\t\t\t\t\t\tcase 'visible':\n\t\t\t\t\t\tcase 'wireframe':\n\t\t\t\t\t\t\tjson[ name ] = value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'vertexColors':\n\t\t\t\t\t\t\tif ( value === true ) json.vertexColors = VertexColors;\n\t\t\t\t\t\t\tif ( value === 'face' ) json.vertexColors = FaceColors;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.Loader.createMaterial: Unsupported', name, value );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( json.type === 'MeshBasicMaterial' ) delete json.emissive;\n\t\t\t\tif ( json.type !== 'MeshPhongMaterial' ) delete json.specular;\n\n\t\t\t\tif ( json.opacity < 1 ) json.transparent = true;\n\n\t\t\t\tmaterialLoader.setTextures( textures );\n\n\t\t\t\treturn materialLoader.parse( json );\n\n\t\t\t};\n\n\t\t} )()\n\n\t};\n\n\tLoader.Handlers = {\n\n\t\thandlers: [],\n\n\t\tadd: function ( regex, loader ) {\n\n\t\t\tthis.handlers.push( regex, loader );\n\n\t\t},\n\n\t\tget: function ( file ) {\n\n\t\t\tvar handlers = this.handlers;\n\n\t\t\tfor ( var i = 0, l = handlers.length; i < l; i += 2 ) {\n\n\t\t\t\tvar regex = handlers[ i ];\n\t\t\t\tvar loader = handlers[ i + 1 ];\n\n\t\t\t\tif ( regex.test( file ) ) {\n\n\t\t\t\t\treturn loader;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction JSONLoader( manager ) {\n\n\t\tif ( typeof manager === 'boolean' ) {\n\n\t\t\tconsole.warn( 'THREE.JSONLoader: showStatus parameter has been removed from constructor.' );\n\t\t\tmanager = undefined;\n\n\t\t}\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\tthis.withCredentials = false;\n\n\t}\n\n\tObject.assign( JSONLoader.prototype, {\n\n\t\tload: function( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar texturePath = this.texturePath && ( typeof this.texturePath === \"string\" ) ? this.texturePath : Loader.prototype.extractUrlBase( url );\n\n\t\t\tvar loader = new XHRLoader( this.manager );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\tvar json = JSON.parse( text );\n\t\t\t\tvar metadata = json.metadata;\n\n\t\t\t\tif ( metadata !== undefined ) {\n\n\t\t\t\t\tvar type = metadata.type;\n\n\t\t\t\t\tif ( type !== undefined ) {\n\n\t\t\t\t\t\tif ( type.toLowerCase() === 'object' ) {\n\n\t\t\t\t\t\t\tconsole.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.ObjectLoader instead.' );\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( type.toLowerCase() === 'scene' ) {\n\n\t\t\t\t\t\t\tconsole.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.SceneLoader instead.' );\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar object = scope.parse( json, texturePath );\n\t\t\t\tonLoad( object.geometry, object.materials );\n\n\t\t\t}, onProgress, onError );\n\n\t\t},\n\n\t\tsetTexturePath: function ( value ) {\n\n\t\t\tthis.texturePath = value;\n\n\t\t},\n\n\t\tparse: function ( json, texturePath ) {\n\n\t\t\tvar geometry = new Geometry(),\n\t\t\tscale = ( json.scale !== undefined ) ? 1.0 / json.scale : 1.0;\n\n\t\t\tparseModel( scale );\n\n\t\t\tparseSkin();\n\t\t\tparseMorphing( scale );\n\t\t\tparseAnimations();\n\n\t\t\tgeometry.computeFaceNormals();\n\t\t\tgeometry.computeBoundingSphere();\n\n\t\t\tfunction parseModel( scale ) {\n\n\t\t\t\tfunction isBitSet( value, position ) {\n\n\t\t\t\t\treturn value & ( 1 << position );\n\n\t\t\t\t}\n\n\t\t\t\tvar i, j, fi,\n\n\t\t\t\toffset, zLength,\n\n\t\t\tcolorIndex, normalIndex, uvIndex, materialIndex,\n\n\t\t\t\ttype,\n\t\t\t\tisQuad,\n\t\t\t\thasMaterial,\n\t\t\t\thasFaceVertexUv,\n\t\t\t\thasFaceNormal, hasFaceVertexNormal,\n\t\t\t\thasFaceColor, hasFaceVertexColor,\n\n\t\t\tvertex, face, faceA, faceB, hex, normal,\n\n\t\t\t\tuvLayer, uv, u, v,\n\n\t\t\t\tfaces = json.faces,\n\t\t\t\tvertices = json.vertices,\n\t\t\t\tnormals = json.normals,\n\t\t\t\tcolors = json.colors,\n\n\t\t\t\tnUvLayers = 0;\n\n\t\t\t\tif ( json.uvs !== undefined ) {\n\n\t\t\t\t\t// disregard empty arrays\n\n\t\t\t\t\tfor ( i = 0; i < json.uvs.length; i ++ ) {\n\n\t\t\t\t\t\tif ( json.uvs[ i ].length ) nUvLayers ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( i = 0; i < nUvLayers; i ++ ) {\n\n\t\t\t\t\t\tgeometry.faceVertexUvs[ i ] = [];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\toffset = 0;\n\t\t\t\tzLength = vertices.length;\n\n\t\t\t\twhile ( offset < zLength ) {\n\n\t\t\t\t\tvertex = new Vector3();\n\n\t\t\t\t\tvertex.x = vertices[ offset ++ ] * scale;\n\t\t\t\t\tvertex.y = vertices[ offset ++ ] * scale;\n\t\t\t\t\tvertex.z = vertices[ offset ++ ] * scale;\n\n\t\t\t\t\tgeometry.vertices.push( vertex );\n\n\t\t\t\t}\n\n\t\t\t\toffset = 0;\n\t\t\t\tzLength = faces.length;\n\n\t\t\t\twhile ( offset < zLength ) {\n\n\t\t\t\t\ttype = faces[ offset ++ ];\n\n\n\t\t\t\t\tisQuad = isBitSet( type, 0 );\n\t\t\t\t\thasMaterial = isBitSet( type, 1 );\n\t\t\t\t\thasFaceVertexUv = isBitSet( type, 3 );\n\t\t\t\t\thasFaceNormal = isBitSet( type, 4 );\n\t\t\t\t\thasFaceVertexNormal = isBitSet( type, 5 );\n\t\t\t\t\thasFaceColor\t = isBitSet( type, 6 );\n\t\t\t\t\thasFaceVertexColor = isBitSet( type, 7 );\n\n\t\t\t\t\t// console.log(\"type\", type, \"bits\", isQuad, hasMaterial, hasFaceVertexUv, hasFaceNormal, hasFaceVertexNormal, hasFaceColor, hasFaceVertexColor);\n\n\t\t\t\t\tif ( isQuad ) {\n\n\t\t\t\t\t\tfaceA = new Face3();\n\t\t\t\t\t\tfaceA.a = faces[ offset ];\n\t\t\t\t\t\tfaceA.b = faces[ offset + 1 ];\n\t\t\t\t\t\tfaceA.c = faces[ offset + 3 ];\n\n\t\t\t\t\t\tfaceB = new Face3();\n\t\t\t\t\t\tfaceB.a = faces[ offset + 1 ];\n\t\t\t\t\t\tfaceB.b = faces[ offset + 2 ];\n\t\t\t\t\t\tfaceB.c = faces[ offset + 3 ];\n\n\t\t\t\t\t\toffset += 4;\n\n\t\t\t\t\t\tif ( hasMaterial ) {\n\n\t\t\t\t\t\t\tmaterialIndex = faces[ offset ++ ];\n\t\t\t\t\t\t\tfaceA.materialIndex = materialIndex;\n\t\t\t\t\t\t\tfaceB.materialIndex = materialIndex;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// to get face <=> uv index correspondence\n\n\t\t\t\t\t\tfi = geometry.faces.length;\n\n\t\t\t\t\t\tif ( hasFaceVertexUv ) {\n\n\t\t\t\t\t\t\tfor ( i = 0; i < nUvLayers; i ++ ) {\n\n\t\t\t\t\t\t\t\tuvLayer = json.uvs[ i ];\n\n\t\t\t\t\t\t\t\tgeometry.faceVertexUvs[ i ][ fi ] = [];\n\t\t\t\t\t\t\t\tgeometry.faceVertexUvs[ i ][ fi + 1 ] = [];\n\n\t\t\t\t\t\t\t\tfor ( j = 0; j < 4; j ++ ) {\n\n\t\t\t\t\t\t\t\t\tuvIndex = faces[ offset ++ ];\n\n\t\t\t\t\t\t\t\t\tu = uvLayer[ uvIndex * 2 ];\n\t\t\t\t\t\t\t\t\tv = uvLayer[ uvIndex * 2 + 1 ];\n\n\t\t\t\t\t\t\t\t\tuv = new Vector2( u, v );\n\n\t\t\t\t\t\t\t\t\tif ( j !== 2 ) geometry.faceVertexUvs[ i ][ fi ].push( uv );\n\t\t\t\t\t\t\t\t\tif ( j !== 0 ) geometry.faceVertexUvs[ i ][ fi + 1 ].push( uv );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( hasFaceNormal ) {\n\n\t\t\t\t\t\t\tnormalIndex = faces[ offset ++ ] * 3;\n\n\t\t\t\t\t\t\tfaceA.normal.set(\n\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\tnormals[ normalIndex ]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tfaceB.normal.copy( faceA.normal );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( hasFaceVertexNormal ) {\n\n\t\t\t\t\t\t\tfor ( i = 0; i < 4; i ++ ) {\n\n\t\t\t\t\t\t\t\tnormalIndex = faces[ offset ++ ] * 3;\n\n\t\t\t\t\t\t\t\tnormal = new Vector3(\n\t\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\t\tnormals[ normalIndex ]\n\t\t\t\t\t\t\t\t);\n\n\n\t\t\t\t\t\t\t\tif ( i !== 2 ) faceA.vertexNormals.push( normal );\n\t\t\t\t\t\t\t\tif ( i !== 0 ) faceB.vertexNormals.push( normal );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif ( hasFaceColor ) {\n\n\t\t\t\t\t\t\tcolorIndex = faces[ offset ++ ];\n\t\t\t\t\t\t\thex = colors[ colorIndex ];\n\n\t\t\t\t\t\t\tfaceA.color.setHex( hex );\n\t\t\t\t\t\t\tfaceB.color.setHex( hex );\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif ( hasFaceVertexColor ) {\n\n\t\t\t\t\t\t\tfor ( i = 0; i < 4; i ++ ) {\n\n\t\t\t\t\t\t\t\tcolorIndex = faces[ offset ++ ];\n\t\t\t\t\t\t\t\thex = colors[ colorIndex ];\n\n\t\t\t\t\t\t\t\tif ( i !== 2 ) faceA.vertexColors.push( new Color( hex ) );\n\t\t\t\t\t\t\t\tif ( i !== 0 ) faceB.vertexColors.push( new Color( hex ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgeometry.faces.push( faceA );\n\t\t\t\t\t\tgeometry.faces.push( faceB );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tface = new Face3();\n\t\t\t\t\t\tface.a = faces[ offset ++ ];\n\t\t\t\t\t\tface.b = faces[ offset ++ ];\n\t\t\t\t\t\tface.c = faces[ offset ++ ];\n\n\t\t\t\t\t\tif ( hasMaterial ) {\n\n\t\t\t\t\t\t\tmaterialIndex = faces[ offset ++ ];\n\t\t\t\t\t\t\tface.materialIndex = materialIndex;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// to get face <=> uv index correspondence\n\n\t\t\t\t\t\tfi = geometry.faces.length;\n\n\t\t\t\t\t\tif ( hasFaceVertexUv ) {\n\n\t\t\t\t\t\t\tfor ( i = 0; i < nUvLayers; i ++ ) {\n\n\t\t\t\t\t\t\t\tuvLayer = json.uvs[ i ];\n\n\t\t\t\t\t\t\t\tgeometry.faceVertexUvs[ i ][ fi ] = [];\n\n\t\t\t\t\t\t\t\tfor ( j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\t\t\tuvIndex = faces[ offset ++ ];\n\n\t\t\t\t\t\t\t\t\tu = uvLayer[ uvIndex * 2 ];\n\t\t\t\t\t\t\t\t\tv = uvLayer[ uvIndex * 2 + 1 ];\n\n\t\t\t\t\t\t\t\t\tuv = new Vector2( u, v );\n\n\t\t\t\t\t\t\t\t\tgeometry.faceVertexUvs[ i ][ fi ].push( uv );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( hasFaceNormal ) {\n\n\t\t\t\t\t\t\tnormalIndex = faces[ offset ++ ] * 3;\n\n\t\t\t\t\t\t\tface.normal.set(\n\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\tnormals[ normalIndex ]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( hasFaceVertexNormal ) {\n\n\t\t\t\t\t\t\tfor ( i = 0; i < 3; i ++ ) {\n\n\t\t\t\t\t\t\t\tnormalIndex = faces[ offset ++ ] * 3;\n\n\t\t\t\t\t\t\t\tnormal = new Vector3(\n\t\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\t\tnormals[ normalIndex ++ ],\n\t\t\t\t\t\t\t\t\tnormals[ normalIndex ]\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tface.vertexNormals.push( normal );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif ( hasFaceColor ) {\n\n\t\t\t\t\t\t\tcolorIndex = faces[ offset ++ ];\n\t\t\t\t\t\t\tface.color.setHex( colors[ colorIndex ] );\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif ( hasFaceVertexColor ) {\n\n\t\t\t\t\t\t\tfor ( i = 0; i < 3; i ++ ) {\n\n\t\t\t\t\t\t\t\tcolorIndex = faces[ offset ++ ];\n\t\t\t\t\t\t\t\tface.vertexColors.push( new Color( colors[ colorIndex ] ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgeometry.faces.push( face );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction parseSkin() {\n\n\t\t\t\tvar influencesPerVertex = ( json.influencesPerVertex !== undefined ) ? json.influencesPerVertex : 2;\n\n\t\t\t\tif ( json.skinWeights ) {\n\n\t\t\t\t\tfor ( var i = 0, l = json.skinWeights.length; i < l; i += influencesPerVertex ) {\n\n\t\t\t\t\t\tvar x = json.skinWeights[ i ];\n\t\t\t\t\t\tvar y = ( influencesPerVertex > 1 ) ? json.skinWeights[ i + 1 ] : 0;\n\t\t\t\t\t\tvar z = ( influencesPerVertex > 2 ) ? json.skinWeights[ i + 2 ] : 0;\n\t\t\t\t\t\tvar w = ( influencesPerVertex > 3 ) ? json.skinWeights[ i + 3 ] : 0;\n\n\t\t\t\t\t\tgeometry.skinWeights.push( new Vector4( x, y, z, w ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( json.skinIndices ) {\n\n\t\t\t\t\tfor ( var i = 0, l = json.skinIndices.length; i < l; i += influencesPerVertex ) {\n\n\t\t\t\t\t\tvar a = json.skinIndices[ i ];\n\t\t\t\t\t\tvar b = ( influencesPerVertex > 1 ) ? json.skinIndices[ i + 1 ] : 0;\n\t\t\t\t\t\tvar c = ( influencesPerVertex > 2 ) ? json.skinIndices[ i + 2 ] : 0;\n\t\t\t\t\t\tvar d = ( influencesPerVertex > 3 ) ? json.skinIndices[ i + 3 ] : 0;\n\n\t\t\t\t\t\tgeometry.skinIndices.push( new Vector4( a, b, c, d ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.bones = json.bones;\n\n\t\t\t\tif ( geometry.bones && geometry.bones.length > 0 && ( geometry.skinWeights.length !== geometry.skinIndices.length || geometry.skinIndices.length !== geometry.vertices.length ) ) {\n\n\t\t\t\t\tconsole.warn( 'When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' +\n\t\t\t\t\t\tgeometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction parseMorphing( scale ) {\n\n\t\t\t\tif ( json.morphTargets !== undefined ) {\n\n\t\t\t\t\tfor ( var i = 0, l = json.morphTargets.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tgeometry.morphTargets[ i ] = {};\n\t\t\t\t\t\tgeometry.morphTargets[ i ].name = json.morphTargets[ i ].name;\n\t\t\t\t\t\tgeometry.morphTargets[ i ].vertices = [];\n\n\t\t\t\t\t\tvar dstVertices = geometry.morphTargets[ i ].vertices;\n\t\t\t\t\t\tvar srcVertices = json.morphTargets[ i ].vertices;\n\n\t\t\t\t\t\tfor ( var v = 0, vl = srcVertices.length; v < vl; v += 3 ) {\n\n\t\t\t\t\t\t\tvar vertex = new Vector3();\n\t\t\t\t\t\t\tvertex.x = srcVertices[ v ] * scale;\n\t\t\t\t\t\t\tvertex.y = srcVertices[ v + 1 ] * scale;\n\t\t\t\t\t\t\tvertex.z = srcVertices[ v + 2 ] * scale;\n\n\t\t\t\t\t\t\tdstVertices.push( vertex );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( json.morphColors !== undefined && json.morphColors.length > 0 ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.JSONLoader: \"morphColors\" no longer supported. Using them as face colors.' );\n\n\t\t\t\t\tvar faces = geometry.faces;\n\t\t\t\t\tvar morphColors = json.morphColors[ 0 ].colors;\n\n\t\t\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tfaces[ i ].color.fromArray( morphColors, i * 3 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction parseAnimations() {\n\n\t\t\t\tvar outputAnimations = [];\n\n\t\t\t\t// parse old style Bone/Hierarchy animations\n\t\t\t\tvar animations = [];\n\n\t\t\t\tif ( json.animation !== undefined ) {\n\n\t\t\t\t\tanimations.push( json.animation );\n\n\t\t\t\t}\n\n\t\t\t\tif ( json.animations !== undefined ) {\n\n\t\t\t\t\tif ( json.animations.length ) {\n\n\t\t\t\t\t\tanimations = animations.concat( json.animations );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tanimations.push( json.animations );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var i = 0; i < animations.length; i ++ ) {\n\n\t\t\t\t\tvar clip = AnimationClip.parseAnimation( animations[ i ], geometry.bones );\n\t\t\t\t\tif ( clip ) outputAnimations.push( clip );\n\n\t\t\t\t}\n\n\t\t\t\t// parse implicit morph animations\n\t\t\t\tif ( geometry.morphTargets ) {\n\n\t\t\t\t\t// TODO: Figure out what an appropraite FPS is for morph target animations -- defaulting to 10, but really it is completely arbitrary.\n\t\t\t\t\tvar morphAnimationClips = AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 );\n\t\t\t\t\toutputAnimations = outputAnimations.concat( morphAnimationClips );\n\n\t\t\t\t}\n\n\t\t\t\tif ( outputAnimations.length > 0 ) geometry.animations = outputAnimations;\n\n\t\t\t}\n\n\t\t\tif ( json.materials === undefined || json.materials.length === 0 ) {\n\n\t\t\t\treturn { geometry: geometry };\n\n\t\t\t} else {\n\n\t\t\t\tvar materials = Loader.prototype.initMaterials( json.materials, texturePath, this.crossOrigin );\n\n\t\t\t\treturn { geometry: geometry, materials: materials };\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction ObjectLoader ( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\t\tthis.texturePath = '';\n\n\t}\n\n\tObject.assign( ObjectLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tif ( this.texturePath === '' ) {\n\n\t\t\t\tthis.texturePath = url.substring( 0, url.lastIndexOf( '/' ) + 1 );\n\n\t\t\t}\n\n\t\t\tvar scope = this;\n\n\t\t\tvar loader = new XHRLoader( scope.manager );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\tscope.parse( JSON.parse( text ), onLoad );\n\n\t\t\t}, onProgress, onError );\n\n\t\t},\n\n\t\tsetTexturePath: function ( value ) {\n\n\t\t\tthis.texturePath = value;\n\n\t\t},\n\n\t\tsetCrossOrigin: function ( value ) {\n\n\t\t\tthis.crossOrigin = value;\n\n\t\t},\n\n\t\tparse: function ( json, onLoad ) {\n\n\t\t\tvar geometries = this.parseGeometries( json.geometries );\n\n\t\t\tvar images = this.parseImages( json.images, function () {\n\n\t\t\t\tif ( onLoad !== undefined ) onLoad( object );\n\n\t\t\t} );\n\n\t\t\tvar textures = this.parseTextures( json.textures, images );\n\t\t\tvar materials = this.parseMaterials( json.materials, textures );\n\n\t\t\tvar object = this.parseObject( json.object, geometries, materials );\n\n\t\t\tif ( json.animations ) {\n\n\t\t\t\tobject.animations = this.parseAnimations( json.animations );\n\n\t\t\t}\n\n\t\t\tif ( json.images === undefined || json.images.length === 0 ) {\n\n\t\t\t\tif ( onLoad !== undefined ) onLoad( object );\n\n\t\t\t}\n\n\t\t\treturn object;\n\n\t\t},\n\n\t\tparseGeometries: function ( json ) {\n\n\t\t\tvar geometries = {};\n\n\t\t\tif ( json !== undefined ) {\n\n\t\t\t\tvar geometryLoader = new JSONLoader();\n\t\t\t\tvar bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\t\tfor ( var i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar geometry;\n\t\t\t\t\tvar data = json[ i ];\n\n\t\t\t\t\tswitch ( data.type ) {\n\n\t\t\t\t\t\tcase 'PlaneGeometry':\n\t\t\t\t\t\tcase 'PlaneBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.width,\n\t\t\t\t\t\t\t\tdata.height,\n\t\t\t\t\t\t\t\tdata.widthSegments,\n\t\t\t\t\t\t\t\tdata.heightSegments\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'BoxGeometry':\n\t\t\t\t\t\tcase 'BoxBufferGeometry':\n\t\t\t\t\t\tcase 'CubeGeometry': // backwards compatible\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.width,\n\t\t\t\t\t\t\t\tdata.height,\n\t\t\t\t\t\t\t\tdata.depth,\n\t\t\t\t\t\t\t\tdata.widthSegments,\n\t\t\t\t\t\t\t\tdata.heightSegments,\n\t\t\t\t\t\t\t\tdata.depthSegments\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'CircleGeometry':\n\t\t\t\t\t\tcase 'CircleBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\t\t\tdata.segments,\n\t\t\t\t\t\t\t\tdata.thetaStart,\n\t\t\t\t\t\t\t\tdata.thetaLength\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'CylinderGeometry':\n\t\t\t\t\t\tcase 'CylinderBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.radiusTop,\n\t\t\t\t\t\t\t\tdata.radiusBottom,\n\t\t\t\t\t\t\t\tdata.height,\n\t\t\t\t\t\t\t\tdata.radialSegments,\n\t\t\t\t\t\t\t\tdata.heightSegments,\n\t\t\t\t\t\t\t\tdata.openEnded,\n\t\t\t\t\t\t\t\tdata.thetaStart,\n\t\t\t\t\t\t\t\tdata.thetaLength\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'ConeGeometry':\n\t\t\t\t\t\tcase 'ConeBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\t\t\tdata.height,\n\t\t\t\t\t\t\t\tdata.radialSegments,\n\t\t\t\t\t\t\t\tdata.heightSegments,\n\t\t\t\t\t\t\t\tdata.openEnded,\n\t\t\t\t\t\t\t\tdata.thetaStart,\n\t\t\t\t\t\t\t\tdata.thetaLength\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'SphereGeometry':\n\t\t\t\t\t\tcase 'SphereBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\t\t\tdata.widthSegments,\n\t\t\t\t\t\t\t\tdata.heightSegments,\n\t\t\t\t\t\t\t\tdata.phiStart,\n\t\t\t\t\t\t\t\tdata.phiLength,\n\t\t\t\t\t\t\t\tdata.thetaStart,\n\t\t\t\t\t\t\t\tdata.thetaLength\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'DodecahedronGeometry':\n\t\t\t\t\t\tcase 'IcosahedronGeometry':\n\t\t\t\t\t\tcase 'OctahedronGeometry':\n\t\t\t\t\t\tcase 'TetrahedronGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\t\t\tdata.detail\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'RingGeometry':\n\t\t\t\t\t\tcase 'RingBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.innerRadius,\n\t\t\t\t\t\t\t\tdata.outerRadius,\n\t\t\t\t\t\t\t\tdata.thetaSegments,\n\t\t\t\t\t\t\t\tdata.phiSegments,\n\t\t\t\t\t\t\t\tdata.thetaStart,\n\t\t\t\t\t\t\t\tdata.thetaLength\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'TorusGeometry':\n\t\t\t\t\t\tcase 'TorusBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\t\t\tdata.tube,\n\t\t\t\t\t\t\t\tdata.radialSegments,\n\t\t\t\t\t\t\t\tdata.tubularSegments,\n\t\t\t\t\t\t\t\tdata.arc\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'TorusKnotGeometry':\n\t\t\t\t\t\tcase 'TorusKnotBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.radius,\n\t\t\t\t\t\t\t\tdata.tube,\n\t\t\t\t\t\t\t\tdata.tubularSegments,\n\t\t\t\t\t\t\t\tdata.radialSegments,\n\t\t\t\t\t\t\t\tdata.p,\n\t\t\t\t\t\t\t\tdata.q\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'LatheGeometry':\n\t\t\t\t\t\tcase 'LatheBufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = new Geometries[ data.type ](\n\t\t\t\t\t\t\t\tdata.points,\n\t\t\t\t\t\t\t\tdata.segments,\n\t\t\t\t\t\t\t\tdata.phiStart,\n\t\t\t\t\t\t\t\tdata.phiLength\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'BufferGeometry':\n\n\t\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse( data );\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'Geometry':\n\n\t\t\t\t\t\t\tgeometry = geometryLoader.parse( data.data, this.texturePath ).geometry;\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Unsupported geometry type \"' + data.type + '\"' );\n\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.uuid = data.uuid;\n\n\t\t\t\t\tif ( data.name !== undefined ) geometry.name = data.name;\n\n\t\t\t\t\tgeometries[ data.uuid ] = geometry;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn geometries;\n\n\t\t},\n\n\t\tparseMaterials: function ( json, textures ) {\n\n\t\t\tvar materials = {};\n\n\t\t\tif ( json !== undefined ) {\n\n\t\t\t\tvar loader = new MaterialLoader();\n\t\t\t\tloader.setTextures( textures );\n\n\t\t\t\tfor ( var i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar material = loader.parse( json[ i ] );\n\t\t\t\t\tmaterials[ material.uuid ] = material;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn materials;\n\n\t\t},\n\n\t\tparseAnimations: function ( json ) {\n\n\t\t\tvar animations = [];\n\n\t\t\tfor ( var i = 0; i < json.length; i ++ ) {\n\n\t\t\t\tvar clip = AnimationClip.parse( json[ i ] );\n\n\t\t\t\tanimations.push( clip );\n\n\t\t\t}\n\n\t\t\treturn animations;\n\n\t\t},\n\n\t\tparseImages: function ( json, onLoad ) {\n\n\t\t\tvar scope = this;\n\t\t\tvar images = {};\n\n\t\t\tfunction loadImage( url ) {\n\n\t\t\t\tscope.manager.itemStart( url );\n\n\t\t\t\treturn loader.load( url, function () {\n\n\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t}, undefined, function () {\n\n\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\t\tvar manager = new LoadingManager( onLoad );\n\n\t\t\t\tvar loader = new ImageLoader( manager );\n\t\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\t\tfor ( var i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar image = json[ i ];\n\t\t\t\t\tvar path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( image.url ) ? image.url : scope.texturePath + image.url;\n\n\t\t\t\t\timages[ image.uuid ] = loadImage( path );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn images;\n\n\t\t},\n\n\t\tparseTextures: function ( json, images ) {\n\n\t\t\tfunction parseConstant( value, type ) {\n\n\t\t\t\tif ( typeof( value ) === 'number' ) return value;\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value );\n\n\t\t\t\treturn type[ value ];\n\n\t\t\t}\n\n\t\t\tvar textures = {};\n\n\t\t\tif ( json !== undefined ) {\n\n\t\t\t\tfor ( var i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar data = json[ i ];\n\n\t\t\t\t\tif ( data.image === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No \"image\" specified for', data.uuid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( images[ data.image ] === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined image', data.image );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar texture = new Texture( images[ data.image ] );\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\ttexture.uuid = data.uuid;\n\n\t\t\t\t\tif ( data.name !== undefined ) texture.name = data.name;\n\n\t\t\t\t\tif ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TextureMapping );\n\n\t\t\t\t\tif ( data.offset !== undefined ) texture.offset.fromArray( data.offset );\n\t\t\t\t\tif ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );\n\t\t\t\t\tif ( data.wrap !== undefined ) {\n\n\t\t\t\t\t\ttexture.wrapS = parseConstant( data.wrap[ 0 ], TextureWrapping );\n\t\t\t\t\t\ttexture.wrapT = parseConstant( data.wrap[ 1 ], TextureWrapping );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TextureFilter );\n\t\t\t\t\tif ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TextureFilter );\n\t\t\t\t\tif ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;\n\n\t\t\t\t\tif ( data.flipY !== undefined ) texture.flipY = data.flipY;\n\n\t\t\t\t\ttextures[ data.uuid ] = texture;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn textures;\n\n\t\t},\n\n\t\tparseObject: function () {\n\n\t\t\tvar matrix = new Matrix4();\n\n\t\t\treturn function parseObject( data, geometries, materials ) {\n\n\t\t\t\tvar object;\n\n\t\t\t\tfunction getGeometry( name ) {\n\n\t\t\t\t\tif ( geometries[ name ] === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined geometry', name );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn geometries[ name ];\n\n\t\t\t\t}\n\n\t\t\t\tfunction getMaterial( name ) {\n\n\t\t\t\t\tif ( name === undefined ) return undefined;\n\n\t\t\t\t\tif ( materials[ name ] === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', name );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn materials[ name ];\n\n\t\t\t\t}\n\n\t\t\t\tswitch ( data.type ) {\n\n\t\t\t\t\tcase 'Scene':\n\n\t\t\t\t\t\tobject = new Scene();\n\n\t\t\t\t\t\tif ( data.background !== undefined ) {\n\n\t\t\t\t\t\t\tif ( Number.isInteger( data.background ) ) {\n\n\t\t\t\t\t\t\t\tobject.background = new Color( data.background );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( data.fog !== undefined ) {\n\n\t\t\t\t\t\t\tif ( data.fog.type === 'Fog' ) {\n\n\t\t\t\t\t\t\t\tobject.fog = new Fog( data.fog.color, data.fog.near, data.fog.far );\n\n\t\t\t\t\t\t\t} else if ( data.fog.type === 'FogExp2' ) {\n\n\t\t\t\t\t\t\t\tobject.fog = new FogExp2( data.fog.color, data.fog.density );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PerspectiveCamera':\n\n\t\t\t\t\t\tobject = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far );\n\n\t\t\t\t\t\tif ( data.focus !== undefined ) object.focus = data.focus;\n\t\t\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\t\t\tif ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge;\n\t\t\t\t\t\tif ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset;\n\t\t\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'OrthographicCamera':\n\n\t\t\t\t\t\tobject = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'AmbientLight':\n\n\t\t\t\t\t\tobject = new AmbientLight( data.color, data.intensity );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'DirectionalLight':\n\n\t\t\t\t\t\tobject = new DirectionalLight( data.color, data.intensity );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PointLight':\n\n\t\t\t\t\t\tobject = new PointLight( data.color, data.intensity, data.distance, data.decay );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'SpotLight':\n\n\t\t\t\t\t\tobject = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'HemisphereLight':\n\n\t\t\t\t\t\tobject = new HemisphereLight( data.color, data.groundColor, data.intensity );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Mesh':\n\n\t\t\t\t\t\tvar geometry = getGeometry( data.geometry );\n\t\t\t\t\t\tvar material = getMaterial( data.material );\n\n\t\t\t\t\t\tif ( geometry.bones && geometry.bones.length > 0 ) {\n\n\t\t\t\t\t\t\tobject = new SkinnedMesh( geometry, material );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tobject = new Mesh( geometry, material );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'LOD':\n\n\t\t\t\t\t\tobject = new LOD();\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Line':\n\n\t\t\t\t\t\tobject = new Line( getGeometry( data.geometry ), getMaterial( data.material ), data.mode );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'LineSegments':\n\n\t\t\t\t\t\tobject = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PointCloud':\n\t\t\t\t\tcase 'Points':\n\n\t\t\t\t\t\tobject = new Points( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Sprite':\n\n\t\t\t\t\t\tobject = new Sprite( getMaterial( data.material ) );\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Group':\n\n\t\t\t\t\t\tobject = new Group();\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tobject = new Object3D();\n\n\t\t\t\t}\n\n\t\t\t\tobject.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) object.name = data.name;\n\t\t\t\tif ( data.matrix !== undefined ) {\n\n\t\t\t\t\tmatrix.fromArray( data.matrix );\n\t\t\t\t\tmatrix.decompose( object.position, object.quaternion, object.scale );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( data.position !== undefined ) object.position.fromArray( data.position );\n\t\t\t\t\tif ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation );\n\t\t\t\t\tif ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion );\n\t\t\t\t\tif ( data.scale !== undefined ) object.scale.fromArray( data.scale );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.castShadow !== undefined ) object.castShadow = data.castShadow;\n\t\t\t\tif ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;\n\n\t\t\t\tif ( data.shadow ) {\n\n\t\t\t\t\tif ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;\n\t\t\t\t\tif ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;\n\t\t\t\t\tif ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );\n\t\t\t\t\tif ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.visible !== undefined ) object.visible = data.visible;\n\t\t\t\tif ( data.userData !== undefined ) object.userData = data.userData;\n\n\t\t\t\tif ( data.children !== undefined ) {\n\n\t\t\t\t\tfor ( var child in data.children ) {\n\n\t\t\t\t\t\tobject.add( this.parseObject( data.children[ child ], geometries, materials ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.type === 'LOD' ) {\n\n\t\t\t\t\tvar levels = data.levels;\n\n\t\t\t\t\tfor ( var l = 0; l < levels.length; l ++ ) {\n\n\t\t\t\t\t\tvar level = levels[ l ];\n\t\t\t\t\t\tvar child = object.getObjectByProperty( 'uuid', level.object );\n\n\t\t\t\t\t\tif ( child !== undefined ) {\n\n\t\t\t\t\t\t\tobject.addLevel( child, level.distance );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn object;\n\n\t\t\t};\n\n\t\t}()\n\n\t} );\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t * Extensible curve object\n\t *\n\t * Some common of Curve methods\n\t * .getPoint(t), getTangent(t)\n\t * .getPointAt(u), getTangentAt(u)\n\t * .getPoints(), .getSpacedPoints()\n\t * .getLength()\n\t * .updateArcLengths()\n\t *\n\t * This following classes subclasses THREE.Curve:\n\t *\n\t * -- 2d classes --\n\t * THREE.LineCurve\n\t * THREE.QuadraticBezierCurve\n\t * THREE.CubicBezierCurve\n\t * THREE.SplineCurve\n\t * THREE.ArcCurve\n\t * THREE.EllipseCurve\n\t *\n\t * -- 3d classes --\n\t * THREE.LineCurve3\n\t * THREE.QuadraticBezierCurve3\n\t * THREE.CubicBezierCurve3\n\t * THREE.SplineCurve3\n\t *\n\t * A series of curves can be represented as a THREE.CurvePath\n\t *\n\t **/\n\n\t/**************************************************************\n\t *\tAbstract Curve base class\n\t **************************************************************/\n\n\tfunction Curve() {}\n\n\tCurve.prototype = {\n\n\t\tconstructor: Curve,\n\n\t\t// Virtual base class method to overwrite and implement in subclasses\n\t\t//\t- t [0 .. 1]\n\n\t\tgetPoint: function ( t ) {\n\n\t\t\tconsole.warn( \"THREE.Curve: Warning, getPoint() not implemented!\" );\n\t\t\treturn null;\n\n\t\t},\n\n\t\t// Get point at relative position in curve according to arc length\n\t\t// - u [0 .. 1]\n\n\t\tgetPointAt: function ( u ) {\n\n\t\t\tvar t = this.getUtoTmapping( u );\n\t\t\treturn this.getPoint( t );\n\n\t\t},\n\n\t\t// Get sequence of points using getPoint( t )\n\n\t\tgetPoints: function ( divisions ) {\n\n\t\t\tif ( ! divisions ) divisions = 5;\n\n\t\t\tvar points = [];\n\n\t\t\tfor ( var d = 0; d <= divisions; d ++ ) {\n\n\t\t\t\tpoints.push( this.getPoint( d / divisions ) );\n\n\t\t\t}\n\n\t\t\treturn points;\n\n\t\t},\n\n\t\t// Get sequence of points using getPointAt( u )\n\n\t\tgetSpacedPoints: function ( divisions ) {\n\n\t\t\tif ( ! divisions ) divisions = 5;\n\n\t\t\tvar points = [];\n\n\t\t\tfor ( var d = 0; d <= divisions; d ++ ) {\n\n\t\t\t\tpoints.push( this.getPointAt( d / divisions ) );\n\n\t\t\t}\n\n\t\t\treturn points;\n\n\t\t},\n\n\t\t// Get total curve arc length\n\n\t\tgetLength: function () {\n\n\t\t\tvar lengths = this.getLengths();\n\t\t\treturn lengths[ lengths.length - 1 ];\n\n\t\t},\n\n\t\t// Get list of cumulative segment lengths\n\n\t\tgetLengths: function ( divisions ) {\n\n\t\t\tif ( ! divisions ) divisions = ( this.__arcLengthDivisions ) ? ( this.__arcLengthDivisions ) : 200;\n\n\t\t\tif ( this.cacheArcLengths\n\t\t\t\t&& ( this.cacheArcLengths.length === divisions + 1 )\n\t\t\t\t&& ! this.needsUpdate ) {\n\n\t\t\t\t//console.log( \"cached\", this.cacheArcLengths );\n\t\t\t\treturn this.cacheArcLengths;\n\n\t\t\t}\n\n\t\t\tthis.needsUpdate = false;\n\n\t\t\tvar cache = [];\n\t\t\tvar current, last = this.getPoint( 0 );\n\t\t\tvar p, sum = 0;\n\n\t\t\tcache.push( 0 );\n\n\t\t\tfor ( p = 1; p <= divisions; p ++ ) {\n\n\t\t\t\tcurrent = this.getPoint ( p / divisions );\n\t\t\t\tsum += current.distanceTo( last );\n\t\t\t\tcache.push( sum );\n\t\t\t\tlast = current;\n\n\t\t\t}\n\n\t\t\tthis.cacheArcLengths = cache;\n\n\t\t\treturn cache; // { sums: cache, sum:sum }; Sum is in the last element.\n\n\t\t},\n\n\t\tupdateArcLengths: function() {\n\n\t\t\tthis.needsUpdate = true;\n\t\t\tthis.getLengths();\n\n\t\t},\n\n\t\t// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\n\n\t\tgetUtoTmapping: function ( u, distance ) {\n\n\t\t\tvar arcLengths = this.getLengths();\n\n\t\t\tvar i = 0, il = arcLengths.length;\n\n\t\t\tvar targetArcLength; // The targeted u distance value to get\n\n\t\t\tif ( distance ) {\n\n\t\t\t\ttargetArcLength = distance;\n\n\t\t\t} else {\n\n\t\t\t\ttargetArcLength = u * arcLengths[ il - 1 ];\n\n\t\t\t}\n\n\t\t\t//var time = Date.now();\n\n\t\t\t// binary search for the index with largest value smaller than target u distance\n\n\t\t\tvar low = 0, high = il - 1, comparison;\n\n\t\t\twhile ( low <= high ) {\n\n\t\t\t\ti = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\t\tcomparison = arcLengths[ i ] - targetArcLength;\n\n\t\t\t\tif ( comparison < 0 ) {\n\n\t\t\t\t\tlow = i + 1;\n\n\t\t\t\t} else if ( comparison > 0 ) {\n\n\t\t\t\t\thigh = i - 1;\n\n\t\t\t\t} else {\n\n\t\t\t\t\thigh = i;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\t// DONE\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ti = high;\n\n\t\t\t//console.log('b' , i, low, high, Date.now()- time);\n\n\t\t\tif ( arcLengths[ i ] === targetArcLength ) {\n\n\t\t\t\tvar t = i / ( il - 1 );\n\t\t\t\treturn t;\n\n\t\t\t}\n\n\t\t\t// we could get finer grain at lengths, or use simple interpolation between two points\n\n\t\t\tvar lengthBefore = arcLengths[ i ];\n\t\t\tvar lengthAfter = arcLengths[ i + 1 ];\n\n\t\t\tvar segmentLength = lengthAfter - lengthBefore;\n\n\t\t\t// determine where we are between the 'before' and 'after' points\n\n\t\t\tvar segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength;\n\n\t\t\t// add that fractional amount to t\n\n\t\t\tvar t = ( i + segmentFraction ) / ( il - 1 );\n\n\t\t\treturn t;\n\n\t\t},\n\n\t\t// Returns a unit vector tangent at t\n\t\t// In case any sub curve does not implement its tangent derivation,\n\t\t// 2 points a small delta apart will be used to find its gradient\n\t\t// which seems to give a reasonable approximation\n\n\t\tgetTangent: function( t ) {\n\n\t\t\tvar delta = 0.0001;\n\t\t\tvar t1 = t - delta;\n\t\t\tvar t2 = t + delta;\n\n\t\t\t// Capping in case of danger\n\n\t\t\tif ( t1 < 0 ) t1 = 0;\n\t\t\tif ( t2 > 1 ) t2 = 1;\n\n\t\t\tvar pt1 = this.getPoint( t1 );\n\t\t\tvar pt2 = this.getPoint( t2 );\n\n\t\t\tvar vec = pt2.clone().sub( pt1 );\n\t\t\treturn vec.normalize();\n\n\t\t},\n\n\t\tgetTangentAt: function ( u ) {\n\n\t\t\tvar t = this.getUtoTmapping( u );\n\t\t\treturn this.getTangent( t );\n\n\t\t},\n\n\t\tcomputeFrenetFrames: function ( segments, closed ) {\n\n\t\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\n\t\t\tvar normal = new Vector3();\n\n\t\t\tvar tangents = [];\n\t\t\tvar normals = [];\n\t\t\tvar binormals = [];\n\n\t\t\tvar vec = new Vector3();\n\t\t\tvar mat = new Matrix4();\n\n\t\t\tvar i, u, theta;\n\n\t\t\t// compute the tangent vectors for each segment on the curve\n\n\t\t\tfor ( i = 0; i <= segments; i ++ ) {\n\n\t\t\t\tu = i / segments;\n\n\t\t\t\ttangents[ i ] = this.getTangentAt( u );\n\t\t\t\ttangents[ i ].normalize();\n\n\t\t\t}\n\n\t\t\t// select an initial normal vector perpendicular to the first tangent vector,\n\t\t\t// and in the direction of the minimum tangent xyz component\n\n\t\t\tnormals[ 0 ] = new Vector3();\n\t\t\tbinormals[ 0 ] = new Vector3();\n\t\t\tvar min = Number.MAX_VALUE;\n\t\t\tvar tx = Math.abs( tangents[ 0 ].x );\n\t\t\tvar ty = Math.abs( tangents[ 0 ].y );\n\t\t\tvar tz = Math.abs( tangents[ 0 ].z );\n\n\t\t\tif ( tx <= min ) {\n\n\t\t\t\tmin = tx;\n\t\t\t\tnormal.set( 1, 0, 0 );\n\n\t\t\t}\n\n\t\t\tif ( ty <= min ) {\n\n\t\t\t\tmin = ty;\n\t\t\t\tnormal.set( 0, 1, 0 );\n\n\t\t\t}\n\n\t\t\tif ( tz <= min ) {\n\n\t\t\t\tnormal.set( 0, 0, 1 );\n\n\t\t\t}\n\n\t\t\tvec.crossVectors( tangents[ 0 ], normal ).normalize();\n\n\t\t\tnormals[ 0 ].crossVectors( tangents[ 0 ], vec );\n\t\t\tbinormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] );\n\n\n\t\t\t// compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\t\tfor ( i = 1; i <= segments; i ++ ) {\n\n\t\t\t\tnormals[ i ] = normals[ i - 1 ].clone();\n\n\t\t\t\tbinormals[ i ] = binormals[ i - 1 ].clone();\n\n\t\t\t\tvec.crossVectors( tangents[ i - 1 ], tangents[ i ] );\n\n\t\t\t\tif ( vec.length() > Number.EPSILON ) {\n\n\t\t\t\t\tvec.normalize();\n\n\t\t\t\t\ttheta = Math.acos( _Math.clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors\n\n\t\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) );\n\n\t\t\t\t}\n\n\t\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t\t}\n\n\t\t\t// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\t\t\tif ( closed === true ) {\n\n\t\t\t\ttheta = Math.acos( _Math.clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) );\n\t\t\t\ttheta /= segments;\n\n\t\t\t\tif ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) {\n\n\t\t\t\t\ttheta = - theta;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( i = 1; i <= segments; i ++ ) {\n\n\t\t\t\t\t// twist a little...\n\t\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) );\n\t\t\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttangents: tangents,\n\t\t\t\tnormals: normals,\n\t\t\t\tbinormals: binormals\n\t\t\t};\n\n\t\t}\n\n\t};\n\n\t// TODO: Transformation for Curves?\n\n\t/**************************************************************\n\t *\t3D Curves\n\t **************************************************************/\n\n\t// A Factory method for creating new curve subclasses\n\n\tCurve.create = function ( constructor, getPointFunc ) {\n\n\t\tconstructor.prototype = Object.create( Curve.prototype );\n\t\tconstructor.prototype.constructor = constructor;\n\t\tconstructor.prototype.getPoint = getPointFunc;\n\n\t\treturn constructor;\n\n\t};\n\n\t/**************************************************************\n\t *\tLine\n\t **************************************************************/\n\n\tfunction LineCurve( v1, v2 ) {\n\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tLineCurve.prototype = Object.create( Curve.prototype );\n\tLineCurve.prototype.constructor = LineCurve;\n\n\tLineCurve.prototype.isLineCurve = true;\n\n\tLineCurve.prototype.getPoint = function ( t ) {\n\n\t\tif ( t === 1 ) {\n\n\t\t\treturn this.v2.clone();\n\n\t\t}\n\n\t\tvar point = this.v2.clone().sub( this.v1 );\n\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\treturn point;\n\n\t};\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\n\tLineCurve.prototype.getPointAt = function ( u ) {\n\n\t\treturn this.getPoint( u );\n\n\t};\n\n\tLineCurve.prototype.getTangent = function( t ) {\n\n\t\tvar tangent = this.v2.clone().sub( this.v1 );\n\n\t\treturn tangent.normalize();\n\n\t};\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t *\n\t **/\n\n\t/**************************************************************\n\t *\tCurved Path - a curve path is simply a array of connected\n\t * curves, but retains the api of a curve\n\t **************************************************************/\n\n\tfunction CurvePath() {\n\n\t\tthis.curves = [];\n\n\t\tthis.autoClose = false; // Automatically closes the path\n\n\t}\n\n\tCurvePath.prototype = Object.assign( Object.create( Curve.prototype ), {\n\n\t\tconstructor: CurvePath,\n\n\t\tadd: function ( curve ) {\n\n\t\t\tthis.curves.push( curve );\n\n\t\t},\n\n\t\tclosePath: function () {\n\n\t\t\t// Add a line curve if start and end of lines are not connected\n\t\t\tvar startPoint = this.curves[ 0 ].getPoint( 0 );\n\t\t\tvar endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 );\n\n\t\t\tif ( ! startPoint.equals( endPoint ) ) {\n\n\t\t\t\tthis.curves.push( new LineCurve( endPoint, startPoint ) );\n\n\t\t\t}\n\n\t\t},\n\n\t\t// To get accurate point with reference to\n\t\t// entire path distance at time t,\n\t\t// following has to be done:\n\n\t\t// 1. Length of each sub path have to be known\n\t\t// 2. Locate and identify type of curve\n\t\t// 3. Get t for the curve\n\t\t// 4. Return curve.getPointAt(t')\n\n\t\tgetPoint: function ( t ) {\n\n\t\t\tvar d = t * this.getLength();\n\t\t\tvar curveLengths = this.getCurveLengths();\n\t\t\tvar i = 0;\n\n\t\t\t// To think about boundaries points.\n\n\t\t\twhile ( i < curveLengths.length ) {\n\n\t\t\t\tif ( curveLengths[ i ] >= d ) {\n\n\t\t\t\t\tvar diff = curveLengths[ i ] - d;\n\t\t\t\t\tvar curve = this.curves[ i ];\n\n\t\t\t\t\tvar segmentLength = curve.getLength();\n\t\t\t\t\tvar u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\n\t\t\t\t\treturn curve.getPointAt( u );\n\n\t\t\t\t}\n\n\t\t\t\ti ++;\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t\t// loop where sum != 0, sum > d , sum+1 1 && !points[ points.length - 1 ].equals( points[ 0 ] ) ) {\n\n\t\t\t\tpoints.push( points[ 0 ] );\n\n\t\t\t}\n\n\t\t\treturn points;\n\n\t\t},\n\n\t\t/**************************************************************\n\t\t *\tCreate Geometries Helpers\n\t\t **************************************************************/\n\n\t\t/// Generate geometry from path points (for Line or Points objects)\n\n\t\tcreatePointsGeometry: function ( divisions ) {\n\n\t\t\tvar pts = this.getPoints( divisions );\n\t\t\treturn this.createGeometry( pts );\n\n\t\t},\n\n\t\t// Generate geometry from equidistant sampling along the path\n\n\t\tcreateSpacedPointsGeometry: function ( divisions ) {\n\n\t\t\tvar pts = this.getSpacedPoints( divisions );\n\t\t\treturn this.createGeometry( pts );\n\n\t\t},\n\n\t\tcreateGeometry: function ( points ) {\n\n\t\t\tvar geometry = new Geometry();\n\n\t\t\tfor ( var i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\t\tvar point = points[ i ];\n\t\t\t\tgeometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) );\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t} );\n\n\t/**************************************************************\n\t *\tEllipse curve\n\t **************************************************************/\n\n\tfunction EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tthis.aX = aX;\n\t\tthis.aY = aY;\n\n\t\tthis.xRadius = xRadius;\n\t\tthis.yRadius = yRadius;\n\n\t\tthis.aStartAngle = aStartAngle;\n\t\tthis.aEndAngle = aEndAngle;\n\n\t\tthis.aClockwise = aClockwise;\n\n\t\tthis.aRotation = aRotation || 0;\n\n\t}\n\n\tEllipseCurve.prototype = Object.create( Curve.prototype );\n\tEllipseCurve.prototype.constructor = EllipseCurve;\n\n\tEllipseCurve.prototype.isEllipseCurve = true;\n\n\tEllipseCurve.prototype.getPoint = function( t ) {\n\n\t\tvar twoPi = Math.PI * 2;\n\t\tvar deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\tvar samePoints = Math.abs( deltaAngle ) < Number.EPSILON;\n\n\t\t// ensures that deltaAngle is 0 .. 2 PI\n\t\twhile ( deltaAngle < 0 ) deltaAngle += twoPi;\n\t\twhile ( deltaAngle > twoPi ) deltaAngle -= twoPi;\n\n\t\tif ( deltaAngle < Number.EPSILON ) {\n\n\t\t\tif ( samePoints ) {\n\n\t\t\t\tdeltaAngle = 0;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.aClockwise === true && ! samePoints ) {\n\n\t\t\tif ( deltaAngle === twoPi ) {\n\n\t\t\t\tdeltaAngle = - twoPi;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar angle = this.aStartAngle + t * deltaAngle;\n\t\tvar x = this.aX + this.xRadius * Math.cos( angle );\n\t\tvar y = this.aY + this.yRadius * Math.sin( angle );\n\n\t\tif ( this.aRotation !== 0 ) {\n\n\t\t\tvar cos = Math.cos( this.aRotation );\n\t\t\tvar sin = Math.sin( this.aRotation );\n\n\t\t\tvar tx = x - this.aX;\n\t\t\tvar ty = y - this.aY;\n\n\t\t\t// Rotate the point about the center of the ellipse.\n\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\ty = tx * sin + ty * cos + this.aY;\n\n\t\t}\n\n\t\treturn new Vector2( x, y );\n\n\t};\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t */\n\n\tvar CurveUtils = {\n\n\t\ttangentQuadraticBezier: function ( t, p0, p1, p2 ) {\n\n\t\t\treturn 2 * ( 1 - t ) * ( p1 - p0 ) + 2 * t * ( p2 - p1 );\n\n\t\t},\n\n\t\t// Puay Bing, thanks for helping with this derivative!\n\n\t\ttangentCubicBezier: function ( t, p0, p1, p2, p3 ) {\n\n\t\t\treturn - 3 * p0 * ( 1 - t ) * ( 1 - t ) +\n\t\t\t\t3 * p1 * ( 1 - t ) * ( 1 - t ) - 6 * t * p1 * ( 1 - t ) +\n\t\t\t\t6 * t * p2 * ( 1 - t ) - 3 * t * t * p2 +\n\t\t\t\t3 * t * t * p3;\n\n\t\t},\n\n\t\ttangentSpline: function ( t, p0, p1, p2, p3 ) {\n\n\t\t\t// To check if my formulas are correct\n\n\t\t\tvar h00 = 6 * t * t - 6 * t; \t// derived from 2t^3 − 3t^2 + 1\n\t\t\tvar h10 = 3 * t * t - 4 * t + 1; // t^3 − 2t^2 + t\n\t\t\tvar h01 = - 6 * t * t + 6 * t; \t// − 2t3 + 3t2\n\t\t\tvar h11 = 3 * t * t - 2 * t;\t// t3 − t2\n\n\t\t\treturn h00 + h10 + h01 + h11;\n\n\t\t},\n\n\t\t// Catmull-Rom\n\n\t\tinterpolate: function( p0, p1, p2, p3, t ) {\n\n\t\t\tvar v0 = ( p2 - p0 ) * 0.5;\n\t\t\tvar v1 = ( p3 - p1 ) * 0.5;\n\t\t\tvar t2 = t * t;\n\t\t\tvar t3 = t * t2;\n\t\t\treturn ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n\t\t}\n\n\t};\n\n\t/**************************************************************\n\t *\tSpline curve\n\t **************************************************************/\n\n\tfunction SplineCurve( points /* array of Vector2 */ ) {\n\n\t\tthis.points = ( points === undefined ) ? [] : points;\n\n\t}\n\n\tSplineCurve.prototype = Object.create( Curve.prototype );\n\tSplineCurve.prototype.constructor = SplineCurve;\n\n\tSplineCurve.prototype.isSplineCurve = true;\n\n\tSplineCurve.prototype.getPoint = function ( t ) {\n\n\t\tvar points = this.points;\n\t\tvar point = ( points.length - 1 ) * t;\n\n\t\tvar intPoint = Math.floor( point );\n\t\tvar weight = point - intPoint;\n\n\t\tvar point0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];\n\t\tvar point1 = points[ intPoint ];\n\t\tvar point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];\n\t\tvar point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];\n\n\t\tvar interpolate = CurveUtils.interpolate;\n\n\t\treturn new Vector2(\n\t\t\tinterpolate( point0.x, point1.x, point2.x, point3.x, weight ),\n\t\t\tinterpolate( point0.y, point1.y, point2.y, point3.y, weight )\n\t\t);\n\n\t};\n\n\t/**************************************************************\n\t *\tCubic Bezier curve\n\t **************************************************************/\n\n\tfunction CubicBezierCurve( v0, v1, v2, v3 ) {\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\t\tthis.v3 = v3;\n\n\t}\n\n\tCubicBezierCurve.prototype = Object.create( Curve.prototype );\n\tCubicBezierCurve.prototype.constructor = CubicBezierCurve;\n\n\tCubicBezierCurve.prototype.getPoint = function ( t ) {\n\n\t\tvar b3 = ShapeUtils.b3;\n\n\t\treturn new Vector2(\n\t\t\tb3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ),\n\t\t\tb3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y )\n\t\t);\n\n\t};\n\n\tCubicBezierCurve.prototype.getTangent = function( t ) {\n\n\t\tvar tangentCubicBezier = CurveUtils.tangentCubicBezier;\n\n\t\treturn new Vector2(\n\t\t\ttangentCubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ),\n\t\t\ttangentCubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y )\n\t\t).normalize();\n\n\t};\n\n\t/**************************************************************\n\t *\tQuadratic Bezier curve\n\t **************************************************************/\n\n\n\tfunction QuadraticBezierCurve( v0, v1, v2 ) {\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tQuadraticBezierCurve.prototype = Object.create( Curve.prototype );\n\tQuadraticBezierCurve.prototype.constructor = QuadraticBezierCurve;\n\n\n\tQuadraticBezierCurve.prototype.getPoint = function ( t ) {\n\n\t\tvar b2 = ShapeUtils.b2;\n\n\t\treturn new Vector2(\n\t\t\tb2( t, this.v0.x, this.v1.x, this.v2.x ),\n\t\t\tb2( t, this.v0.y, this.v1.y, this.v2.y )\n\t\t);\n\n\t};\n\n\n\tQuadraticBezierCurve.prototype.getTangent = function( t ) {\n\n\t\tvar tangentQuadraticBezier = CurveUtils.tangentQuadraticBezier;\n\n\t\treturn new Vector2(\n\t\t\ttangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ),\n\t\t\ttangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y )\n\t\t).normalize();\n\n\t};\n\n\tvar PathPrototype = Object.assign( Object.create( CurvePath.prototype ), {\n\n\t\tfromPoints: function ( vectors ) {\n\n\t\t\tthis.moveTo( vectors[ 0 ].x, vectors[ 0 ].y );\n\n\t\t\tfor ( var i = 1, l = vectors.length; i < l; i ++ ) {\n\n\t\t\t\tthis.lineTo( vectors[ i ].x, vectors[ i ].y );\n\n\t\t\t}\n\n\t\t},\n\n\t\tmoveTo: function ( x, y ) {\n\n\t\t\tthis.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying?\n\n\t\t},\n\n\t\tlineTo: function ( x, y ) {\n\n\t\t\tvar curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) );\n\t\t\tthis.curves.push( curve );\n\n\t\t\tthis.currentPoint.set( x, y );\n\n\t\t},\n\n\t\tquadraticCurveTo: function ( aCPx, aCPy, aX, aY ) {\n\n\t\t\tvar curve = new QuadraticBezierCurve(\n\t\t\t\tthis.currentPoint.clone(),\n\t\t\t\tnew Vector2( aCPx, aCPy ),\n\t\t\t\tnew Vector2( aX, aY )\n\t\t\t);\n\n\t\t\tthis.curves.push( curve );\n\n\t\t\tthis.currentPoint.set( aX, aY );\n\n\t\t},\n\n\t\tbezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\t\tvar curve = new CubicBezierCurve(\n\t\t\t\tthis.currentPoint.clone(),\n\t\t\t\tnew Vector2( aCP1x, aCP1y ),\n\t\t\t\tnew Vector2( aCP2x, aCP2y ),\n\t\t\t\tnew Vector2( aX, aY )\n\t\t\t);\n\n\t\t\tthis.curves.push( curve );\n\n\t\t\tthis.currentPoint.set( aX, aY );\n\n\t\t},\n\n\t\tsplineThru: function ( pts /*Array of Vector*/ ) {\n\n\t\t\tvar npts = [ this.currentPoint.clone() ].concat( pts );\n\n\t\t\tvar curve = new SplineCurve( npts );\n\t\t\tthis.curves.push( curve );\n\n\t\t\tthis.currentPoint.copy( pts[ pts.length - 1 ] );\n\n\t\t},\n\n\t\tarc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\t\tvar x0 = this.currentPoint.x;\n\t\t\tvar y0 = this.currentPoint.y;\n\n\t\t\tthis.absarc( aX + x0, aY + y0, aRadius,\n\t\t\t\taStartAngle, aEndAngle, aClockwise );\n\n\t\t},\n\n\t\tabsarc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\t\tthis.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\t},\n\n\t\tellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\t\tvar x0 = this.currentPoint.x;\n\t\t\tvar y0 = this.currentPoint.y;\n\n\t\t\tthis.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\t},\n\n\t\tabsellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\t\tvar curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\t\tif ( this.curves.length > 0 ) {\n\n\t\t\t\t// if a previous curve is present, attempt to join\n\t\t\t\tvar firstPoint = curve.getPoint( 0 );\n\n\t\t\t\tif ( ! firstPoint.equals( this.currentPoint ) ) {\n\n\t\t\t\t\tthis.lineTo( firstPoint.x, firstPoint.y );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.curves.push( curve );\n\n\t\t\tvar lastPoint = curve.getPoint( 1 );\n\t\t\tthis.currentPoint.copy( lastPoint );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t * Defines a 2d shape plane using paths.\n\t **/\n\n\t// STEP 1 Create a path.\n\t// STEP 2 Turn path into shape.\n\t// STEP 3 ExtrudeGeometry takes in Shape/Shapes\n\t// STEP 3a - Extract points from each shape, turn to vertices\n\t// STEP 3b - Triangulate each shape, add faces.\n\n\tfunction Shape() {\n\n\t\tPath.apply( this, arguments );\n\n\t\tthis.holes = [];\n\n\t}\n\n\tShape.prototype = Object.assign( Object.create( PathPrototype ), {\n\n\t\tconstructor: Shape,\n\n\t\tgetPointsHoles: function ( divisions ) {\n\n\t\t\tvar holesPts = [];\n\n\t\t\tfor ( var i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\t\tholesPts[ i ] = this.holes[ i ].getPoints( divisions );\n\n\t\t\t}\n\n\t\t\treturn holesPts;\n\n\t\t},\n\n\t\t// Get points of shape and holes (keypoints based on segments parameter)\n\n\t\textractAllPoints: function ( divisions ) {\n\n\t\t\treturn {\n\n\t\t\t\tshape: this.getPoints( divisions ),\n\t\t\t\tholes: this.getPointsHoles( divisions )\n\n\t\t\t};\n\n\t\t},\n\n\t\textractPoints: function ( divisions ) {\n\n\t\t\treturn this.extractAllPoints( divisions );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t * Creates free form 2d path using series of points, lines or curves.\n\t *\n\t **/\n\n\tfunction Path( points ) {\n\n\t\tCurvePath.call( this );\n\t\tthis.currentPoint = new Vector2();\n\n\t\tif ( points ) {\n\n\t\t\tthis.fromPoints( points );\n\n\t\t}\n\n\t}\n\n\tPath.prototype = PathPrototype;\n\tPathPrototype.constructor = Path;\n\n\n\t// minimal class for proxing functions to Path. Replaces old \"extractSubpaths()\"\n\tfunction ShapePath() {\n\t\tthis.subPaths = [];\n\t\tthis.currentPath = null;\n\t}\n\n\tShapePath.prototype = {\n\t\tmoveTo: function ( x, y ) {\n\t\t\tthis.currentPath = new Path();\n\t\t\tthis.subPaths.push(this.currentPath);\n\t\t\tthis.currentPath.moveTo( x, y );\n\t\t},\n\t\tlineTo: function ( x, y ) {\n\t\t\tthis.currentPath.lineTo( x, y );\n\t\t},\n\t\tquadraticCurveTo: function ( aCPx, aCPy, aX, aY ) {\n\t\t\tthis.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY );\n\t\t},\n\t\tbezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\t\t\tthis.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY );\n\t\t},\n\t\tsplineThru: function ( pts ) {\n\t\t\tthis.currentPath.splineThru( pts );\n\t\t},\n\n\t\ttoShapes: function ( isCCW, noHoles ) {\n\n\t\t\tfunction toShapesNoHoles( inSubpaths ) {\n\n\t\t\t\tvar shapes = [];\n\n\t\t\t\tfor ( var i = 0, l = inSubpaths.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar tmpPath = inSubpaths[ i ];\n\n\t\t\t\t\tvar tmpShape = new Shape();\n\t\t\t\t\ttmpShape.curves = tmpPath.curves;\n\n\t\t\t\t\tshapes.push( tmpShape );\n\n\t\t\t\t}\n\n\t\t\t\treturn shapes;\n\n\t\t\t}\n\n\t\t\tfunction isPointInsidePolygon( inPt, inPolygon ) {\n\n\t\t\t\tvar polyLen = inPolygon.length;\n\n\t\t\t\t// inPt on polygon contour => immediate success or\n\t\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t\t// with the horizontal line through inPt, left of inPt\n\t\t\t\t// not counting lowerY endpoints of edges and whole edges on that line\n\t\t\t\tvar inside = false;\n\t\t\t\tfor ( var p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) {\n\n\t\t\t\t\tvar edgeLowPt = inPolygon[ p ];\n\t\t\t\t\tvar edgeHighPt = inPolygon[ q ];\n\n\t\t\t\t\tvar edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\t\tvar edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\t\tif ( Math.abs( edgeDy ) > Number.EPSILON ) {\n\n\t\t\t\t\t\t// not parallel\n\t\t\t\t\t\tif ( edgeDy < 0 ) {\n\n\t\t\t\t\t\t\tedgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx;\n\t\t\t\t\t\t\tedgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) \t\tcontinue;\n\n\t\t\t\t\t\tif ( inPt.y === edgeLowPt.y ) {\n\n\t\t\t\t\t\t\tif ( inPt.x === edgeLowPt.x )\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvar perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y );\n\t\t\t\t\t\t\tif ( perpEdge === 0 )\t\t\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\t\tif ( perpEdge < 0 ) \t\t\t\tcontinue;\n\t\t\t\t\t\t\tinside = ! inside;\t\t// true intersection left of inPt\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// parallel or collinear\n\t\t\t\t\t\tif ( inPt.y !== edgeLowPt.y ) \t\tcontinue;\t\t\t// parallel\n\t\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\t\t\t\t\t\tif ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) ||\n\t\t\t\t\t\t\t ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) )\t\treturn\ttrue;\t// inPt: Point on contour !\n\t\t\t\t\t\t// continue;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn\tinside;\n\n\t\t\t}\n\n\t\t\tvar isClockWise = ShapeUtils.isClockWise;\n\n\t\t\tvar subPaths = this.subPaths;\n\t\t\tif ( subPaths.length === 0 ) return [];\n\n\t\t\tif ( noHoles === true )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\t\tvar solid, tmpPath, tmpShape, shapes = [];\n\n\t\t\tif ( subPaths.length === 1 ) {\n\n\t\t\t\ttmpPath = subPaths[ 0 ];\n\t\t\t\ttmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\t\tshapes.push( tmpShape );\n\t\t\t\treturn shapes;\n\n\t\t\t}\n\n\t\t\tvar holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );\n\t\t\tholesFirst = isCCW ? ! holesFirst : holesFirst;\n\n\t\t\t// console.log(\"Holes first\", holesFirst);\n\n\t\t\tvar betterShapeHoles = [];\n\t\t\tvar newShapes = [];\n\t\t\tvar newShapeHoles = [];\n\t\t\tvar mainIdx = 0;\n\t\t\tvar tmpPoints;\n\n\t\t\tnewShapes[ mainIdx ] = undefined;\n\t\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\t\tfor ( var i = 0, l = subPaths.length; i < l; i ++ ) {\n\n\t\t\t\ttmpPath = subPaths[ i ];\n\t\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\t\tsolid = isClockWise( tmpPoints );\n\t\t\t\tsolid = isCCW ? ! solid : solid;\n\n\t\t\t\tif ( solid ) {\n\n\t\t\t\t\tif ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) )\tmainIdx ++;\n\n\t\t\t\t\tnewShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints };\n\t\t\t\t\tnewShapes[ mainIdx ].s.curves = tmpPath.curves;\n\n\t\t\t\t\tif ( holesFirst )\tmainIdx ++;\n\t\t\t\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\t\t\t\t//console.log('cw', i);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tnewShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );\n\n\t\t\t\t\t//console.log('ccw', i);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// only Holes? -> probably all Shapes with wrong orientation\n\t\t\tif ( ! newShapes[ 0 ] )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\t\tif ( newShapes.length > 1 ) {\n\n\t\t\t\tvar ambiguous = false;\n\t\t\t\tvar toChange = [];\n\n\t\t\t\tfor ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\t\tbetterShapeHoles[ sIdx ] = [];\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\t\tvar sho = newShapeHoles[ sIdx ];\n\n\t\t\t\t\tfor ( var hIdx = 0; hIdx < sho.length; hIdx ++ ) {\n\n\t\t\t\t\t\tvar ho = sho[ hIdx ];\n\t\t\t\t\t\tvar hole_unassigned = true;\n\n\t\t\t\t\t\tfor ( var s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) {\n\n\t\t\t\t\t\t\tif ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) {\n\n\t\t\t\t\t\t\t\tif ( sIdx !== s2Idx )\ttoChange.push( { froms: sIdx, tos: s2Idx, hole: hIdx } );\n\t\t\t\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\t\tbetterShapeHoles[ s2Idx ].push( ho );\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tambiguous = true;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\t\tbetterShapeHoles[ sIdx ].push( ho );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// console.log(\"ambiguous: \", ambiguous);\n\t\t\t\tif ( toChange.length > 0 ) {\n\n\t\t\t\t\t// console.log(\"to change: \", toChange);\n\t\t\t\t\tif ( ! ambiguous )\tnewShapeHoles = betterShapeHoles;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar tmpHoles;\n\n\t\t\tfor ( var i = 0, il = newShapes.length; i < il; i ++ ) {\n\n\t\t\t\ttmpShape = newShapes[ i ].s;\n\t\t\t\tshapes.push( tmpShape );\n\t\t\t\ttmpHoles = newShapeHoles[ i ];\n\n\t\t\t\tfor ( var j = 0, jl = tmpHoles.length; j < jl; j ++ ) {\n\n\t\t\t\t\ttmpShape.holes.push( tmpHoles[ j ].h );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//console.log(\"shape\", shapes);\n\n\t\t\treturn shapes;\n\n\t\t}\n\t};\n\n\t/**\n\t * @author zz85 / http://www.lab4games.net/zz85/blog\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Font( data ) {\n\n\t\tthis.data = data;\n\n\t}\n\n\tObject.assign( Font.prototype, {\n\n\t\tisFont: true,\n\n\t\tgenerateShapes: function ( text, size, divisions ) {\n\n\t\t\tfunction createPaths( text ) {\n\n\t\t\t\tvar chars = String( text ).split( '' );\n\t\t\t\tvar scale = size / data.resolution;\n\t\t\t\tvar offset = 0;\n\n\t\t\t\tvar paths = [];\n\n\t\t\t\tfor ( var i = 0; i < chars.length; i ++ ) {\n\n\t\t\t\t\tvar ret = createPath( chars[ i ], scale, offset );\n\t\t\t\t\toffset += ret.offset;\n\n\t\t\t\t\tpaths.push( ret.path );\n\n\t\t\t\t}\n\n\t\t\t\treturn paths;\n\n\t\t\t}\n\n\t\t\tfunction createPath( c, scale, offset ) {\n\n\t\t\t\tvar glyph = data.glyphs[ c ] || data.glyphs[ '?' ];\n\n\t\t\t\tif ( ! glyph ) return;\n\n\t\t\t\tvar path = new ShapePath();\n\n\t\t\t\tvar pts = [], b2 = ShapeUtils.b2, b3 = ShapeUtils.b3;\n\t\t\t\tvar x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2, laste;\n\n\t\t\t\tif ( glyph.o ) {\n\n\t\t\t\t\tvar outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) );\n\n\t\t\t\t\tfor ( var i = 0, l = outline.length; i < l; ) {\n\n\t\t\t\t\t\tvar action = outline[ i ++ ];\n\n\t\t\t\t\t\tswitch ( action ) {\n\n\t\t\t\t\t\t\tcase 'm': // moveTo\n\n\t\t\t\t\t\t\t\tx = outline[ i ++ ] * scale + offset;\n\t\t\t\t\t\t\t\ty = outline[ i ++ ] * scale;\n\n\t\t\t\t\t\t\t\tpath.moveTo( x, y );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'l': // lineTo\n\n\t\t\t\t\t\t\t\tx = outline[ i ++ ] * scale + offset;\n\t\t\t\t\t\t\t\ty = outline[ i ++ ] * scale;\n\n\t\t\t\t\t\t\t\tpath.lineTo( x, y );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'q': // quadraticCurveTo\n\n\t\t\t\t\t\t\t\tcpx = outline[ i ++ ] * scale + offset;\n\t\t\t\t\t\t\t\tcpy = outline[ i ++ ] * scale;\n\t\t\t\t\t\t\t\tcpx1 = outline[ i ++ ] * scale + offset;\n\t\t\t\t\t\t\t\tcpy1 = outline[ i ++ ] * scale;\n\n\t\t\t\t\t\t\t\tpath.quadraticCurveTo( cpx1, cpy1, cpx, cpy );\n\n\t\t\t\t\t\t\t\tlaste = pts[ pts.length - 1 ];\n\n\t\t\t\t\t\t\t\tif ( laste ) {\n\n\t\t\t\t\t\t\t\t\tcpx0 = laste.x;\n\t\t\t\t\t\t\t\t\tcpy0 = laste.y;\n\n\t\t\t\t\t\t\t\t\tfor ( var i2 = 1; i2 <= divisions; i2 ++ ) {\n\n\t\t\t\t\t\t\t\t\t\tvar t = i2 / divisions;\n\t\t\t\t\t\t\t\t\t\tb2( t, cpx0, cpx1, cpx );\n\t\t\t\t\t\t\t\t\t\tb2( t, cpy0, cpy1, cpy );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'b': // bezierCurveTo\n\n\t\t\t\t\t\t\t\tcpx = outline[ i ++ ] * scale + offset;\n\t\t\t\t\t\t\t\tcpy = outline[ i ++ ] * scale;\n\t\t\t\t\t\t\t\tcpx1 = outline[ i ++ ] * scale + offset;\n\t\t\t\t\t\t\t\tcpy1 = outline[ i ++ ] * scale;\n\t\t\t\t\t\t\t\tcpx2 = outline[ i ++ ] * scale + offset;\n\t\t\t\t\t\t\t\tcpy2 = outline[ i ++ ] * scale;\n\n\t\t\t\t\t\t\t\tpath.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy );\n\n\t\t\t\t\t\t\t\tlaste = pts[ pts.length - 1 ];\n\n\t\t\t\t\t\t\t\tif ( laste ) {\n\n\t\t\t\t\t\t\t\t\tcpx0 = laste.x;\n\t\t\t\t\t\t\t\t\tcpy0 = laste.y;\n\n\t\t\t\t\t\t\t\t\tfor ( var i2 = 1; i2 <= divisions; i2 ++ ) {\n\n\t\t\t\t\t\t\t\t\t\tvar t = i2 / divisions;\n\t\t\t\t\t\t\t\t\t\tb3( t, cpx0, cpx1, cpx2, cpx );\n\t\t\t\t\t\t\t\t\t\tb3( t, cpy0, cpy1, cpy2, cpy );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn { offset: glyph.ha * scale, path: path };\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( size === undefined ) size = 100;\n\t\t\tif ( divisions === undefined ) divisions = 4;\n\n\t\t\tvar data = this.data;\n\n\t\t\tvar paths = createPaths( text );\n\t\t\tvar shapes = [];\n\n\t\t\tfor ( var p = 0, pl = paths.length; p < pl; p ++ ) {\n\n\t\t\t\tArray.prototype.push.apply( shapes, paths[ p ].toShapes() );\n\n\t\t\t}\n\n\t\t\treturn shapes;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction FontLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t}\n\n\tObject.assign( FontLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar scope = this;\n\n\t\t\tvar loader = new XHRLoader( this.manager );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\tvar json;\n\n\t\t\t\ttry {\n\n\t\t\t\t\tjson = JSON.parse( text );\n\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.' );\n\t\t\t\t\tjson = JSON.parse( text.substring( 65, text.length - 2 ) );\n\n\t\t\t\t}\n\n\t\t\t\tvar font = scope.parse( json );\n\n\t\t\t\tif ( onLoad ) onLoad( font );\n\n\t\t\t}, onProgress, onError );\n\n\t\t},\n\n\t\tparse: function ( json ) {\n\n\t\t\treturn new Font( json );\n\n\t\t}\n\n\t} );\n\n\tvar context;\n\n\tfunction getAudioContext() {\n\n\t\tif ( context === undefined ) {\n\n\t\t\tcontext = new ( window.AudioContext || window.webkitAudioContext )();\n\n\t\t}\n\n\t\treturn context;\n\n\t}\n\n\t/**\n\t * @author Reece Aaron Lecrivain / http://reecenotes.com/\n\t */\n\n\tfunction AudioLoader( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t}\n\n\tObject.assign( AudioLoader.prototype, {\n\n\t\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\t\tvar loader = new XHRLoader( this.manager );\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tvar context = getAudioContext();\n\n\t\t\t\tcontext.decodeAudioData( buffer, function ( audioBuffer ) {\n\n\t\t\t\t\tonLoad( audioBuffer );\n\n\t\t\t\t} );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction StereoCamera() {\n\n\t\tthis.type = 'StereoCamera';\n\n\t\tthis.aspect = 1;\n\n\t\tthis.eyeSep = 0.064;\n\n\t\tthis.cameraL = new PerspectiveCamera();\n\t\tthis.cameraL.layers.enable( 1 );\n\t\tthis.cameraL.matrixAutoUpdate = false;\n\n\t\tthis.cameraR = new PerspectiveCamera();\n\t\tthis.cameraR.layers.enable( 2 );\n\t\tthis.cameraR.matrixAutoUpdate = false;\n\n\t}\n\n\tObject.assign( StereoCamera.prototype, {\n\n\t\tupdate: ( function () {\n\n\t\t\tvar instance, focus, fov, aspect, near, far, zoom;\n\n\t\t\tvar eyeRight = new Matrix4();\n\t\t\tvar eyeLeft = new Matrix4();\n\n\t\t\treturn function update( camera ) {\n\n\t\t\t\tvar needsUpdate = instance !== this || focus !== camera.focus || fov !== camera.fov ||\n\t\t\t\t\t\t\t\t\t\t\t\t\taspect !== camera.aspect * this.aspect || near !== camera.near ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tfar !== camera.far || zoom !== camera.zoom;\n\n\t\t\t\tif ( needsUpdate ) {\n\n\t\t\t\t\tinstance = this;\n\t\t\t\t\tfocus = camera.focus;\n\t\t\t\t\tfov = camera.fov;\n\t\t\t\t\taspect = camera.aspect * this.aspect;\n\t\t\t\t\tnear = camera.near;\n\t\t\t\t\tfar = camera.far;\n\t\t\t\t\tzoom = camera.zoom;\n\n\t\t\t\t\t// Off-axis stereoscopic effect based on\n\t\t\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t\t\tvar projectionMatrix = camera.projectionMatrix.clone();\n\t\t\t\t\tvar eyeSep = this.eyeSep / 2;\n\t\t\t\t\tvar eyeSepOnProjection = eyeSep * near / focus;\n\t\t\t\t\tvar ymax = ( near * Math.tan( _Math.DEG2RAD * fov * 0.5 ) ) / zoom;\n\t\t\t\t\tvar xmin, xmax;\n\n\t\t\t\t\t// translate xOffset\n\n\t\t\t\t\teyeLeft.elements[ 12 ] = - eyeSep;\n\t\t\t\t\teyeRight.elements[ 12 ] = eyeSep;\n\n\t\t\t\t\t// for left eye\n\n\t\t\t\t\txmin = - ymax * aspect + eyeSepOnProjection;\n\t\t\t\t\txmax = ymax * aspect + eyeSepOnProjection;\n\n\t\t\t\t\tprojectionMatrix.elements[ 0 ] = 2 * near / ( xmax - xmin );\n\t\t\t\t\tprojectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t\t\tthis.cameraL.projectionMatrix.copy( projectionMatrix );\n\n\t\t\t\t\t// for right eye\n\n\t\t\t\t\txmin = - ymax * aspect - eyeSepOnProjection;\n\t\t\t\t\txmax = ymax * aspect - eyeSepOnProjection;\n\n\t\t\t\t\tprojectionMatrix.elements[ 0 ] = 2 * near / ( xmax - xmin );\n\t\t\t\t\tprojectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t\t\tthis.cameraR.projectionMatrix.copy( projectionMatrix );\n\n\t\t\t\t}\n\n\t\t\t\tthis.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );\n\t\t\t\tthis.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );\n\n\t\t\t};\n\n\t\t} )()\n\n\t} );\n\n\t/**\n\t * Camera for rendering cube maps\n\t *\t- renders scene into axis-aligned cube\n\t *\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction CubeCamera( near, far, cubeResolution ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'CubeCamera';\n\n\t\tvar fov = 90, aspect = 1;\n\n\t\tvar cameraPX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPX.up.set( 0, - 1, 0 );\n\t\tcameraPX.lookAt( new Vector3( 1, 0, 0 ) );\n\t\tthis.add( cameraPX );\n\n\t\tvar cameraNX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNX.up.set( 0, - 1, 0 );\n\t\tcameraNX.lookAt( new Vector3( - 1, 0, 0 ) );\n\t\tthis.add( cameraNX );\n\n\t\tvar cameraPY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPY.up.set( 0, 0, 1 );\n\t\tcameraPY.lookAt( new Vector3( 0, 1, 0 ) );\n\t\tthis.add( cameraPY );\n\n\t\tvar cameraNY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNY.up.set( 0, 0, - 1 );\n\t\tcameraNY.lookAt( new Vector3( 0, - 1, 0 ) );\n\t\tthis.add( cameraNY );\n\n\t\tvar cameraPZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPZ.up.set( 0, - 1, 0 );\n\t\tcameraPZ.lookAt( new Vector3( 0, 0, 1 ) );\n\t\tthis.add( cameraPZ );\n\n\t\tvar cameraNZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNZ.up.set( 0, - 1, 0 );\n\t\tcameraNZ.lookAt( new Vector3( 0, 0, - 1 ) );\n\t\tthis.add( cameraNZ );\n\n\t\tvar options = { format: RGBFormat, magFilter: LinearFilter, minFilter: LinearFilter };\n\n\t\tthis.renderTarget = new WebGLRenderTargetCube( cubeResolution, cubeResolution, options );\n\n\t\tthis.updateCubeMap = function ( renderer, scene ) {\n\n\t\t\tif ( this.parent === null ) this.updateMatrixWorld();\n\n\t\t\tvar renderTarget = this.renderTarget;\n\t\t\tvar generateMipmaps = renderTarget.texture.generateMipmaps;\n\n\t\t\trenderTarget.texture.generateMipmaps = false;\n\n\t\t\trenderTarget.activeCubeFace = 0;\n\t\t\trenderer.render( scene, cameraPX, renderTarget );\n\n\t\t\trenderTarget.activeCubeFace = 1;\n\t\t\trenderer.render( scene, cameraNX, renderTarget );\n\n\t\t\trenderTarget.activeCubeFace = 2;\n\t\t\trenderer.render( scene, cameraPY, renderTarget );\n\n\t\t\trenderTarget.activeCubeFace = 3;\n\t\t\trenderer.render( scene, cameraNY, renderTarget );\n\n\t\t\trenderTarget.activeCubeFace = 4;\n\t\t\trenderer.render( scene, cameraPZ, renderTarget );\n\n\t\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\n\t\t\trenderTarget.activeCubeFace = 5;\n\t\t\trenderer.render( scene, cameraNZ, renderTarget );\n\n\t\t\trenderer.setRenderTarget( null );\n\n\t\t};\n\n\t}\n\n\tCubeCamera.prototype = Object.create( Object3D.prototype );\n\tCubeCamera.prototype.constructor = CubeCamera;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction AudioListener() {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'AudioListener';\n\n\t\tthis.context = getAudioContext();\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( this.context.destination );\n\n\t\tthis.filter = null;\n\n\t}\n\n\tAudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: AudioListener,\n\n\t\tgetInput: function () {\n\n\t\t\treturn this.gain;\n\n\t\t},\n\n\t\tremoveFilter: function ( ) {\n\n\t\t\tif ( this.filter !== null ) {\n\n\t\t\t\tthis.gain.disconnect( this.filter );\n\t\t\t\tthis.filter.disconnect( this.context.destination );\n\t\t\t\tthis.gain.connect( this.context.destination );\n\t\t\t\tthis.filter = null;\n\n\t\t\t}\n\n\t\t},\n\n\t\tgetFilter: function () {\n\n\t\t\treturn this.filter;\n\n\t\t},\n\n\t\tsetFilter: function ( value ) {\n\n\t\t\tif ( this.filter !== null ) {\n\n\t\t\t\tthis.gain.disconnect( this.filter );\n\t\t\t\tthis.filter.disconnect( this.context.destination );\n\n\t\t\t} else {\n\n\t\t\t\tthis.gain.disconnect( this.context.destination );\n\n\t\t\t}\n\n\t\t\tthis.filter = value;\n\t\t\tthis.gain.connect( this.filter );\n\t\t\tthis.filter.connect( this.context.destination );\n\n\t\t},\n\n\t\tgetMasterVolume: function () {\n\n\t\t\treturn this.gain.gain.value;\n\n\t\t},\n\n\t\tsetMasterVolume: function ( value ) {\n\n\t\t\tthis.gain.gain.value = value;\n\n\t\t},\n\n\t\tupdateMatrixWorld: ( function () {\n\n\t\t\tvar position = new Vector3();\n\t\t\tvar quaternion = new Quaternion();\n\t\t\tvar scale = new Vector3();\n\n\t\t\tvar orientation = new Vector3();\n\n\t\t\treturn function updateMatrixWorld( force ) {\n\n\t\t\t\tObject3D.prototype.updateMatrixWorld.call( this, force );\n\n\t\t\t\tvar listener = this.context.listener;\n\t\t\t\tvar up = this.up;\n\n\t\t\t\tthis.matrixWorld.decompose( position, quaternion, scale );\n\n\t\t\t\torientation.set( 0, 0, - 1 ).applyQuaternion( quaternion );\n\n\t\t\t\tlistener.setPosition( position.x, position.y, position.z );\n\t\t\t\tlistener.setOrientation( orientation.x, orientation.y, orientation.z, up.x, up.y, up.z );\n\n\t\t\t};\n\n\t\t} )()\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author Reece Aaron Lecrivain / http://reecenotes.com/\n\t */\n\n\tfunction Audio( listener ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.type = 'Audio';\n\n\t\tthis.context = listener.context;\n\t\tthis.source = this.context.createBufferSource();\n\t\tthis.source.onended = this.onEnded.bind( this );\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( listener.getInput() );\n\n\t\tthis.autoplay = false;\n\n\t\tthis.startTime = 0;\n\t\tthis.playbackRate = 1;\n\t\tthis.isPlaying = false;\n\t\tthis.hasPlaybackControl = true;\n\t\tthis.sourceType = 'empty';\n\n\t\tthis.filters = [];\n\n\t}\n\n\tAudio.prototype = Object.assign( Object.create( Object3D.prototype ), {\n\n\t\tconstructor: Audio,\n\n\t\tgetOutput: function () {\n\n\t\t\treturn this.gain;\n\n\t\t},\n\n\t\tsetNodeSource: function ( audioNode ) {\n\n\t\t\tthis.hasPlaybackControl = false;\n\t\t\tthis.sourceType = 'audioNode';\n\t\t\tthis.source = audioNode;\n\t\t\tthis.connect();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetBuffer: function ( audioBuffer ) {\n\n\t\t\tthis.source.buffer = audioBuffer;\n\t\t\tthis.sourceType = 'buffer';\n\n\t\t\tif ( this.autoplay ) this.play();\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tplay: function () {\n\n\t\t\tif ( this.isPlaying === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.Audio: Audio is already playing.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tvar source = this.context.createBufferSource();\n\n\t\t\tsource.buffer = this.source.buffer;\n\t\t\tsource.loop = this.source.loop;\n\t\t\tsource.onended = this.source.onended;\n\t\t\tsource.start( 0, this.startTime );\n\t\t\tsource.playbackRate.value = this.playbackRate;\n\n\t\t\tthis.isPlaying = true;\n\n\t\t\tthis.source = source;\n\n\t\t\treturn this.connect();\n\n\t\t},\n\n\t\tpause: function () {\n\n\t\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tthis.source.stop();\n\t\t\tthis.startTime = this.context.currentTime;\n\t\t\tthis.isPlaying = false;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tstop: function () {\n\n\t\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tthis.source.stop();\n\t\t\tthis.startTime = 0;\n\t\t\tthis.isPlaying = false;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tconnect: function () {\n\n\t\t\tif ( this.filters.length > 0 ) {\n\n\t\t\t\tthis.source.connect( this.filters[ 0 ] );\n\n\t\t\t\tfor ( var i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\t\tthis.filters[ i - 1 ].connect( this.filters[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\tthis.filters[ this.filters.length - 1 ].connect( this.getOutput() );\n\n\t\t\t} else {\n\n\t\t\t\tthis.source.connect( this.getOutput() );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tdisconnect: function () {\n\n\t\t\tif ( this.filters.length > 0 ) {\n\n\t\t\t\tthis.source.disconnect( this.filters[ 0 ] );\n\n\t\t\t\tfor ( var i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\t\tthis.filters[ i - 1 ].disconnect( this.filters[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\tthis.filters[ this.filters.length - 1 ].disconnect( this.getOutput() );\n\n\t\t\t} else {\n\n\t\t\t\tthis.source.disconnect( this.getOutput() );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetFilters: function () {\n\n\t\t\treturn this.filters;\n\n\t\t},\n\n\t\tsetFilters: function ( value ) {\n\n\t\t\tif ( ! value ) value = [];\n\n\t\t\tif ( this.isPlaying === true ) {\n\n\t\t\t\tthis.disconnect();\n\t\t\t\tthis.filters = value;\n\t\t\t\tthis.connect();\n\n\t\t\t} else {\n\n\t\t\t\tthis.filters = value;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetFilter: function () {\n\n\t\t\treturn this.getFilters()[ 0 ];\n\n\t\t},\n\n\t\tsetFilter: function ( filter ) {\n\n\t\t\treturn this.setFilters( filter ? [ filter ] : [] );\n\n\t\t},\n\n\t\tsetPlaybackRate: function ( value ) {\n\n\t\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tthis.playbackRate = value;\n\n\t\t\tif ( this.isPlaying === true ) {\n\n\t\t\t\tthis.source.playbackRate.value = this.playbackRate;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetPlaybackRate: function () {\n\n\t\t\treturn this.playbackRate;\n\n\t\t},\n\n\t\tonEnded: function () {\n\n\t\t\tthis.isPlaying = false;\n\n\t\t},\n\n\t\tgetLoop: function () {\n\n\t\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\treturn this.source.loop;\n\n\t\t},\n\n\t\tsetLoop: function ( value ) {\n\n\t\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tthis.source.loop = value;\n\n\t\t},\n\n\t\tgetVolume: function () {\n\n\t\t\treturn this.gain.gain.value;\n\n\t\t},\n\n\n\t\tsetVolume: function ( value ) {\n\n\t\t\tthis.gain.gain.value = value;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction PositionalAudio( listener ) {\n\n\t\tAudio.call( this, listener );\n\n\t\tthis.panner = this.context.createPanner();\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tPositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {\n\n\t\tconstructor: PositionalAudio,\n\n\t\tgetOutput: function () {\n\n\t\t\treturn this.panner;\n\n\t\t},\n\n\t\tgetRefDistance: function () {\n\n\t\t\treturn this.panner.refDistance;\n\n\t\t},\n\n\t\tsetRefDistance: function ( value ) {\n\n\t\t\tthis.panner.refDistance = value;\n\n\t\t},\n\n\t\tgetRolloffFactor: function () {\n\n\t\t\treturn this.panner.rolloffFactor;\n\n\t\t},\n\n\t\tsetRolloffFactor: function ( value ) {\n\n\t\t\tthis.panner.rolloffFactor = value;\n\n\t\t},\n\n\t\tgetDistanceModel: function () {\n\n\t\t\treturn this.panner.distanceModel;\n\n\t\t},\n\n\t\tsetDistanceModel: function ( value ) {\n\n\t\t\tthis.panner.distanceModel = value;\n\n\t\t},\n\n\t\tgetMaxDistance: function () {\n\n\t\t\treturn this.panner.maxDistance;\n\n\t\t},\n\n\t\tsetMaxDistance: function ( value ) {\n\n\t\t\tthis.panner.maxDistance = value;\n\n\t\t},\n\n\t\tupdateMatrixWorld: ( function () {\n\n\t\t\tvar position = new Vector3();\n\n\t\t\treturn function updateMatrixWorld( force ) {\n\n\t\t\t\tObject3D.prototype.updateMatrixWorld.call( this, force );\n\n\t\t\t\tposition.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\t\tthis.panner.setPosition( position.x, position.y, position.z );\n\n\t\t\t};\n\n\t\t} )()\n\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction AudioAnalyser( audio, fftSize ) {\n\n\t\tthis.analyser = audio.context.createAnalyser();\n\t\tthis.analyser.fftSize = fftSize !== undefined ? fftSize : 2048;\n\n\t\tthis.data = new Uint8Array( this.analyser.frequencyBinCount );\n\n\t\taudio.getOutput().connect( this.analyser );\n\n\t}\n\n\tObject.assign( AudioAnalyser.prototype, {\n\n\t\tgetFrequencyData: function () {\n\n\t\t\tthis.analyser.getByteFrequencyData( this.data );\n\n\t\t\treturn this.data;\n\n\t\t},\n\n\t\tgetAverageFrequency: function () {\n\n\t\t\tvar value = 0, data = this.getFrequencyData();\n\n\t\t\tfor ( var i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tvalue += data[ i ];\n\n\t\t\t}\n\n\t\t\treturn value / data.length;\n\n\t\t}\n\n\t} );\n\n\t/**\n\t *\n\t * Buffered scene graph property that allows weighted accumulation.\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction PropertyMixer( binding, typeName, valueSize ) {\n\n\t\tthis.binding = binding;\n\t\tthis.valueSize = valueSize;\n\n\t\tvar bufferType = Float64Array,\n\t\t\tmixFunction;\n\n\t\tswitch ( typeName ) {\n\n\t\t\tcase 'quaternion':\t\t\tmixFunction = this._slerp;\t\tbreak;\n\n\t\t\tcase 'string':\n\t\t\tcase 'bool':\n\n\t\t\t\tbufferType = Array,\t\tmixFunction = this._select;\t\tbreak;\n\n\t\t\tdefault:\t\t\t\t\tmixFunction = this._lerp;\n\n\t\t}\n\n\t\tthis.buffer = new bufferType( valueSize * 4 );\n\t\t// layout: [ incoming | accu0 | accu1 | orig ]\n\t\t//\n\t\t// interpolators can use .buffer as their .result\n\t\t// the data then goes to 'incoming'\n\t\t//\n\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t// the cumulative result and are compared to detect\n\t\t// changes\n\t\t//\n\t\t// 'orig' stores the original state of the property\n\n\t\tthis._mixBufferRegion = mixFunction;\n\n\t\tthis.cumulativeWeight = 0;\n\n\t\tthis.useCount = 0;\n\t\tthis.referenceCount = 0;\n\n\t}\n\n\tPropertyMixer.prototype = {\n\n\t\tconstructor: PropertyMixer,\n\n\t\t// accumulate data in the 'incoming' region into 'accu'\n\t\taccumulate: function( accuIndex, weight ) {\n\n\t\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t\t// the weight and shouldn't have made the call in the first place\n\n\t\t\tvar buffer = this.buffer,\n\t\t\t\tstride = this.valueSize,\n\t\t\t\toffset = accuIndex * stride + stride,\n\n\t\t\t\tcurrentWeight = this.cumulativeWeight;\n\n\t\t\tif ( currentWeight === 0 ) {\n\n\t\t\t\t// accuN := incoming * weight\n\n\t\t\t\tfor ( var i = 0; i !== stride; ++ i ) {\n\n\t\t\t\t\tbuffer[ offset + i ] = buffer[ i ];\n\n\t\t\t\t}\n\n\t\t\t\tcurrentWeight = weight;\n\n\t\t\t} else {\n\n\t\t\t\t// accuN := accuN + incoming * weight\n\n\t\t\t\tcurrentWeight += weight;\n\t\t\t\tvar mix = weight / currentWeight;\n\t\t\t\tthis._mixBufferRegion( buffer, offset, 0, mix, stride );\n\n\t\t\t}\n\n\t\t\tthis.cumulativeWeight = currentWeight;\n\n\t\t},\n\n\t\t// apply the state of 'accu' to the binding when accus differ\n\t\tapply: function( accuIndex ) {\n\n\t\t\tvar stride = this.valueSize,\n\t\t\t\tbuffer = this.buffer,\n\t\t\t\toffset = accuIndex * stride + stride,\n\n\t\t\t\tweight = this.cumulativeWeight,\n\n\t\t\t\tbinding = this.binding;\n\n\t\t\tthis.cumulativeWeight = 0;\n\n\t\t\tif ( weight < 1 ) {\n\n\t\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\n\t\t\t\tvar originalValueOffset = stride * 3;\n\n\t\t\t\tthis._mixBufferRegion(\n\t\t\t\t\t\tbuffer, offset, originalValueOffset, 1 - weight, stride );\n\n\t\t\t}\n\n\t\t\tfor ( var i = stride, e = stride + stride; i !== e; ++ i ) {\n\n\t\t\t\tif ( buffer[ i ] !== buffer[ i + stride ] ) {\n\n\t\t\t\t\t// value has changed -> update scene graph\n\n\t\t\t\t\tbinding.setValue( buffer, offset );\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\t// remember the state of the bound property and copy it to both accus\n\t\tsaveOriginalState: function() {\n\n\t\t\tvar binding = this.binding;\n\n\t\t\tvar buffer = this.buffer,\n\t\t\t\tstride = this.valueSize,\n\n\t\t\t\toriginalValueOffset = stride * 3;\n\n\t\t\tbinding.getValue( buffer, originalValueOffset );\n\n\t\t\t// accu[0..1] := orig -- initially detect changes against the original\n\t\t\tfor ( var i = stride, e = originalValueOffset; i !== e; ++ i ) {\n\n\t\t\t\tbuffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];\n\n\t\t\t}\n\n\t\t\tthis.cumulativeWeight = 0;\n\n\t\t},\n\n\t\t// apply the state previously taken via 'saveOriginalState' to the binding\n\t\trestoreOriginalState: function() {\n\n\t\t\tvar originalValueOffset = this.valueSize * 3;\n\t\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t\t},\n\n\n\t\t// mix functions\n\n\t\t_select: function( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\t\tif ( t >= 0.5 ) {\n\n\t\t\t\tfor ( var i = 0; i !== stride; ++ i ) {\n\n\t\t\t\t\tbuffer[ dstOffset + i ] = buffer[ srcOffset + i ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\t_slerp: function( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\t\tQuaternion.slerpFlat( buffer, dstOffset,\n\t\t\t\t\tbuffer, dstOffset, buffer, srcOffset, t );\n\n\t\t},\n\n\t\t_lerp: function( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\t\tvar s = 1 - t;\n\n\t\t\tfor ( var i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tvar j = dstOffset + i;\n\n\t\t\t\tbuffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t/**\n\t *\n\t * A reference to a real property in the scene graph.\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction PropertyBinding( rootNode, path, parsedPath ) {\n\n\t\tthis.path = path;\n\t\tthis.parsedPath = parsedPath ||\n\t\t\t\tPropertyBinding.parseTrackName( path );\n\n\t\tthis.node = PropertyBinding.findNode(\n\t\t\t\trootNode, this.parsedPath.nodeName ) || rootNode;\n\n\t\tthis.rootNode = rootNode;\n\n\t}\n\n\tPropertyBinding.prototype = {\n\n\t\tconstructor: PropertyBinding,\n\n\t\tgetValue: function getValue_unbound( targetArray, offset ) {\n\n\t\t\tthis.bind();\n\t\t\tthis.getValue( targetArray, offset );\n\n\t\t\t// Note: This class uses a State pattern on a per-method basis:\n\t\t\t// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n\t\t\t// prototype version of these methods with one that represents\n\t\t\t// the bound state. When the property is not found, the methods\n\t\t\t// become no-ops.\n\n\t\t},\n\n\t\tsetValue: function getValue_unbound( sourceArray, offset ) {\n\n\t\t\tthis.bind();\n\t\t\tthis.setValue( sourceArray, offset );\n\n\t\t},\n\n\t\t// create getter / setter pair for a property in the scene graph\n\t\tbind: function() {\n\n\t\t\tvar targetObject = this.node,\n\t\t\t\tparsedPath = this.parsedPath,\n\n\t\t\t\tobjectName = parsedPath.objectName,\n\t\t\t\tpropertyName = parsedPath.propertyName,\n\t\t\t\tpropertyIndex = parsedPath.propertyIndex;\n\n\t\t\tif ( ! targetObject ) {\n\n\t\t\t\ttargetObject = PropertyBinding.findNode(\n\t\t\t\t\t\tthis.rootNode, parsedPath.nodeName ) || this.rootNode;\n\n\t\t\t\tthis.node = targetObject;\n\n\t\t\t}\n\n\t\t\t// set fail state so we can just 'return' on error\n\t\t\tthis.getValue = this._getValue_unavailable;\n\t\t\tthis.setValue = this._setValue_unavailable;\n\n\t \t\t// ensure there is a value node\n\t\t\tif ( ! targetObject ) {\n\n\t\t\t\tconsole.error( \" trying to update node for track: \" + this.path + \" but it wasn't found.\" );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( objectName ) {\n\n\t\t\t\tvar objectIndex = parsedPath.objectIndex;\n\n\t\t\t\t// special cases were we need to reach deeper into the hierarchy to get the face materials....\n\t\t\t\tswitch ( objectName ) {\n\n\t\t\t\t\tcase 'materials':\n\n\t\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\t\tconsole.error( ' can not bind to material as node does not have a material', this );\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( ! targetObject.material.materials ) {\n\n\t\t\t\t\t\t\tconsole.error( ' can not bind to material.materials as node.material does not have a materials array', this );\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttargetObject = targetObject.material.materials;\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'bones':\n\n\t\t\t\t\t\tif ( ! targetObject.skeleton ) {\n\n\t\t\t\t\t\t\tconsole.error( ' can not bind to bones as node does not have a skeleton', this );\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t\t// and convert the integer string to a true integer.\n\n\t\t\t\t\t\ttargetObject = targetObject.skeleton.bones;\n\n\t\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\t\tfor ( var i = 0; i < targetObject.length; i ++ ) {\n\n\t\t\t\t\t\t\tif ( targetObject[ i ].name === objectIndex ) {\n\n\t\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( targetObject[ objectName ] === undefined ) {\n\n\t\t\t\t\t\t\tconsole.error( ' can not bind to objectName of node, undefined', this );\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttargetObject = targetObject[ objectName ];\n\n\t\t\t\t}\n\n\n\t\t\t\tif ( objectIndex !== undefined ) {\n\n\t\t\t\t\tif ( targetObject[ objectIndex ] === undefined ) {\n\n\t\t\t\t\t\tconsole.error( \" trying to bind to objectIndex of objectName, but is undefined:\", this, targetObject );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[ objectIndex ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// resolve property\n\t\t\tvar nodeProperty = targetObject[ propertyName ];\n\n\t\t\tif ( nodeProperty === undefined ) {\n\n\t\t\t\tvar nodeName = parsedPath.nodeName;\n\n\t\t\t\tconsole.error( \" trying to update property for track: \" + nodeName +\n\t\t\t\t\t\t'.' + propertyName + \" but it wasn't found.\", targetObject );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// determine versioning scheme\n\t\t\tvar versioning = this.Versioning.None;\n\n\t\t\tif ( targetObject.needsUpdate !== undefined ) { // material\n\n\t\t\t\tversioning = this.Versioning.NeedsUpdate;\n\t\t\t\tthis.targetObject = targetObject;\n\n\t\t\t} else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform\n\n\t\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\t\t\t\tthis.targetObject = targetObject;\n\n\t\t\t}\n\n\t\t\t// determine how the property gets bound\n\t\t\tvar bindingType = this.BindingType.Direct;\n\n\t\t\tif ( propertyIndex !== undefined ) {\n\t\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\n\t\t\t\tif ( propertyName === \"morphTargetInfluences\" ) {\n\t\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tif ( ! targetObject.geometry ) {\n\n\t\t\t\t\t\tconsole.error( ' can not bind to morphTargetInfluences becasuse node does not have a geometry', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.geometry.morphTargets ) {\n\n\t\t\t\t\t\tconsole.error( ' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var i = 0; i < this.node.geometry.morphTargets.length; i ++ ) {\n\n\t\t\t\t\t\tif ( targetObject.geometry.morphTargets[ i ].name === propertyIndex ) {\n\n\t\t\t\t\t\t\tpropertyIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbindingType = this.BindingType.ArrayElement;\n\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\t\tthis.propertyIndex = propertyIndex;\n\n\t\t\t} else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) {\n\t\t\t\t// must use copy for Object3D.Euler/Quaternion\n\n\t\t\t\tbindingType = this.BindingType.HasFromToArray;\n\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t\t} else if ( nodeProperty.length !== undefined ) {\n\n\t\t\t\tbindingType = this.BindingType.EntireArray;\n\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t\t} else {\n\n\t\t\t\tthis.propertyName = propertyName;\n\n\t\t\t}\n\n\t\t\t// select getter / setter\n\t\t\tthis.getValue = this.GetterByBindingType[ bindingType ];\n\t\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ];\n\n\t\t},\n\n\t\tunbind: function() {\n\n\t\t\tthis.node = null;\n\n\t\t\t// back to the prototype version of getValue / setValue\n\t\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\t\t\tthis.getValue = this._getValue_unbound;\n\t\t\tthis.setValue = this._setValue_unbound;\n\n\t\t}\n\n\t};\n\n\tObject.assign( PropertyBinding.prototype, { // prototype, continued\n\n\t\t// these are used to \"bind\" a nonexistent property\n\t\t_getValue_unavailable: function() {},\n\t\t_setValue_unavailable: function() {},\n\n\t\t// initial state of these methods that calls 'bind'\n\t\t_getValue_unbound: PropertyBinding.prototype.getValue,\n\t\t_setValue_unbound: PropertyBinding.prototype.setValue,\n\n\t\tBindingType: {\n\t\t\tDirect: 0,\n\t\t\tEntireArray: 1,\n\t\t\tArrayElement: 2,\n\t\t\tHasFromToArray: 3\n\t\t},\n\n\t\tVersioning: {\n\t\t\tNone: 0,\n\t\t\tNeedsUpdate: 1,\n\t\t\tMatrixWorldNeedsUpdate: 2\n\t\t},\n\n\t\tGetterByBindingType: [\n\n\t\t\tfunction getValue_direct( buffer, offset ) {\n\n\t\t\t\tbuffer[ offset ] = this.node[ this.propertyName ];\n\n\t\t\t},\n\n\t\t\tfunction getValue_array( buffer, offset ) {\n\n\t\t\t\tvar source = this.resolvedProperty;\n\n\t\t\t\tfor ( var i = 0, n = source.length; i !== n; ++ i ) {\n\n\t\t\t\t\tbuffer[ offset ++ ] = source[ i ];\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tfunction getValue_arrayElement( buffer, offset ) {\n\n\t\t\t\tbuffer[ offset ] = this.resolvedProperty[ this.propertyIndex ];\n\n\t\t\t},\n\n\t\t\tfunction getValue_toArray( buffer, offset ) {\n\n\t\t\t\tthis.resolvedProperty.toArray( buffer, offset );\n\n\t\t\t}\n\n\t\t],\n\n\t\tSetterByBindingTypeAndVersioning: [\n\n\t\t\t[\n\t\t\t\t// Direct\n\n\t\t\t\tfunction setValue_direct( buffer, offset ) {\n\n\t\t\t\t\tthis.node[ this.propertyName ] = buffer[ offset ];\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_direct_setNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tthis.node[ this.propertyName ] = buffer[ offset ];\n\t\t\t\t\tthis.targetObject.needsUpdate = true;\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tthis.node[ this.propertyName ] = buffer[ offset ];\n\t\t\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t], [\n\n\t\t\t\t// EntireArray\n\n\t\t\t\tfunction setValue_array( buffer, offset ) {\n\n\t\t\t\t\tvar dest = this.resolvedProperty;\n\n\t\t\t\t\tfor ( var i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\t\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_array_setNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tvar dest = this.resolvedProperty;\n\n\t\t\t\t\tfor ( var i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\t\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.targetObject.needsUpdate = true;\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tvar dest = this.resolvedProperty;\n\n\t\t\t\t\tfor ( var i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\t\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t], [\n\n\t\t\t\t// ArrayElement\n\n\t\t\t\tfunction setValue_arrayElement( buffer, offset ) {\n\n\t\t\t\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_arrayElement_setNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\t\t\t\tthis.targetObject.needsUpdate = true;\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\t\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t], [\n\n\t\t\t\t// HasToFromArray\n\n\t\t\t\tfunction setValue_fromArray( buffer, offset ) {\n\n\t\t\t\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_fromArray_setNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\t\t\t\tthis.targetObject.needsUpdate = true;\n\n\t\t\t\t},\n\n\t\t\t\tfunction setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\t\t\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\t\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t]\n\n\t\t]\n\n\t} );\n\n\tPropertyBinding.Composite =\n\t\t\tfunction( targetGroup, path, optionalParsedPath ) {\n\n\t\tvar parsedPath = optionalParsedPath ||\n\t\t\t\tPropertyBinding.parseTrackName( path );\n\n\t\tthis._targetGroup = targetGroup;\n\t\tthis._bindings = targetGroup.subscribe_( path, parsedPath );\n\n\t};\n\n\tPropertyBinding.Composite.prototype = {\n\n\t\tconstructor: PropertyBinding.Composite,\n\n\t\tgetValue: function( array, offset ) {\n\n\t\t\tthis.bind(); // bind all binding\n\n\t\t\tvar firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\t\tbinding = this._bindings[ firstValidIndex ];\n\n\t\t\t// and only call .getValue on the first\n\t\t\tif ( binding !== undefined ) binding.getValue( array, offset );\n\n\t\t},\n\n\t\tsetValue: function( array, offset ) {\n\n\t\t\tvar bindings = this._bindings;\n\n\t\t\tfor ( var i = this._targetGroup.nCachedObjects_,\n\t\t\t\t\tn = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tbindings[ i ].setValue( array, offset );\n\n\t\t\t}\n\n\t\t},\n\n\t\tbind: function() {\n\n\t\t\tvar bindings = this._bindings;\n\n\t\t\tfor ( var i = this._targetGroup.nCachedObjects_,\n\t\t\t\t\tn = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tbindings[ i ].bind();\n\n\t\t\t}\n\n\t\t},\n\n\t\tunbind: function() {\n\n\t\t\tvar bindings = this._bindings;\n\n\t\t\tfor ( var i = this._targetGroup.nCachedObjects_,\n\t\t\t\t\tn = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tbindings[ i ].unbind();\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tPropertyBinding.create = function( root, path, parsedPath ) {\n\n\t\tif ( ! ( (root && root.isAnimationObjectGroup) ) ) {\n\n\t\t\treturn new PropertyBinding( root, path, parsedPath );\n\n\t\t} else {\n\n\t\t\treturn new PropertyBinding.Composite( root, path, parsedPath );\n\n\t\t}\n\n\t};\n\n\tPropertyBinding.parseTrackName = function( trackName ) {\n\n\t\t// matches strings in the form of:\n\t\t// nodeName.property\n\t\t// nodeName.property[accessor]\n\t\t// nodeName.material.property[accessor]\n\t\t// uuid.property[accessor]\n\t\t// uuid.objectName[objectIndex].propertyName[propertyIndex]\n\t\t// parentName/nodeName.property\n\t\t// parentName/parentName/nodeName.property[index]\n\t\t// .bone[Armature.DEF_cog].position\n\t\t// scene:helium_balloon_model:helium_balloon_model.position\n\t\t// created and tested via https://regex101.com/#javascript\n\n\t\tvar re = /^((?:\\w+[\\/:])*)(\\w+)?(?:\\.(\\w+)(?:\\[(.+)\\])?)?\\.(\\w+)(?:\\[(.+)\\])?$/;\n\t\tvar matches = re.exec( trackName );\n\n\t\tif ( ! matches ) {\n\n\t\t\tthrow new Error( \"cannot parse trackName at all: \" + trackName );\n\n\t\t}\n\n\t\tvar results = {\n\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\tnodeName: matches[ 2 ], \t// allowed to be null, specified root node.\n\t\t\tobjectName: matches[ 3 ],\n\t\t\tobjectIndex: matches[ 4 ],\n\t\t\tpropertyName: matches[ 5 ],\n\t\t\tpropertyIndex: matches[ 6 ]\t// allowed to be null, specifies that the whole property is set.\n\t\t};\n\n\t\tif ( results.propertyName === null || results.propertyName.length === 0 ) {\n\n\t\t\tthrow new Error( \"can not parse propertyName from trackName: \" + trackName );\n\n\t\t}\n\n\t\treturn results;\n\n\t};\n\n\tPropertyBinding.findNode = function( root, nodeName ) {\n\n\t\tif ( ! nodeName || nodeName === \"\" || nodeName === \"root\" || nodeName === \".\" || nodeName === -1 || nodeName === root.name || nodeName === root.uuid ) {\n\n\t\t\treturn root;\n\n\t\t}\n\n\t\t// search into skeleton bones.\n\t\tif ( root.skeleton ) {\n\n\t\t\tvar searchSkeleton = function( skeleton ) {\n\n\t\t\t\tfor( var i = 0; i < skeleton.bones.length; i ++ ) {\n\n\t\t\t\t\tvar bone = skeleton.bones[ i ];\n\n\t\t\t\t\tif ( bone.name === nodeName ) {\n\n\t\t\t\t\t\treturn bone;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\n\t\t\t};\n\n\t\t\tvar bone = searchSkeleton( root.skeleton );\n\n\t\t\tif ( bone ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\t\t}\n\n\t\t// search into node subtree.\n\t\tif ( root.children ) {\n\n\t\t\tvar searchNodeSubtree = function( children ) {\n\n\t\t\t\tfor( var i = 0; i < children.length; i ++ ) {\n\n\t\t\t\t\tvar childNode = children[ i ];\n\n\t\t\t\t\tif ( childNode.name === nodeName || childNode.uuid === nodeName ) {\n\n\t\t\t\t\t\treturn childNode;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar result = searchNodeSubtree( childNode.children );\n\n\t\t\t\t\tif ( result ) return result;\n\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\n\t\t\t};\n\n\t\t\tvar subTreeNode = searchNodeSubtree( root.children );\n\n\t\t\tif ( subTreeNode ) {\n\n\t\t\t\treturn subTreeNode;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\t/**\n\t *\n\t * A group of objects that receives a shared animation state.\n\t *\n\t * Usage:\n\t *\n\t * \t-\tAdd objects you would otherwise pass as 'root' to the\n\t * \t\tconstructor or the .clipAction method of AnimationMixer.\n\t *\n\t * \t-\tInstead pass this object as 'root'.\n\t *\n\t * \t-\tYou can also add and remove objects later when the mixer\n\t * \t\tis running.\n\t *\n\t * Note:\n\t *\n\t * \tObjects of this class appear as one object to the mixer,\n\t * \tso cache control of the individual objects must be done\n\t * \ton the group.\n\t *\n\t * Limitation:\n\t *\n\t * \t- \tThe animated properties must be compatible among the\n\t * \t\tall objects in the group.\n\t *\n\t * -\tA single property can either be controlled through a\n\t * \ttarget group or directly, but not both.\n\t *\n\t * @author tschw\n\t */\n\n\tfunction AnimationObjectGroup( var_args ) {\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\t// cached objects followed by the active ones\n\t\tthis._objects = Array.prototype.slice.call( arguments );\n\n\t\tthis.nCachedObjects_ = 0;\t\t\t// threshold\n\t\t// note: read by PropertyBinding.Composite\n\n\t\tvar indices = {};\n\t\tthis._indicesByUUID = indices;\t\t// for bookkeeping\n\n\t\tfor ( var i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tindices[ arguments[ i ].uuid ] = i;\n\n\t\t}\n\n\t\tthis._paths = [];\t\t\t\t\t// inside: string\n\t\tthis._parsedPaths = [];\t\t\t\t// inside: { we don't care, here }\n\t\tthis._bindings = []; \t\t\t\t// inside: Array< PropertyBinding >\n\t\tthis._bindingsIndicesByPath = {}; \t// inside: indices in these arrays\n\n\t\tvar scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tobjects: {\n\t\t\t\tget total() { return scope._objects.length; },\n\t\t\t\tget inUse() { return this.total - scope.nCachedObjects_; }\n\t\t\t},\n\n\t\t\tget bindingsPerObject() { return scope._bindings.length; }\n\n\t\t};\n\n\t}\n\n\tAnimationObjectGroup.prototype = {\n\n\t\tconstructor: AnimationObjectGroup,\n\n\t\tisAnimationObjectGroup: true,\n\n\t\tadd: function( var_args ) {\n\n\t\t\tvar objects = this._objects,\n\t\t\t\tnObjects = objects.length,\n\t\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\tpaths = this._paths,\n\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tnBindings = bindings.length;\n\n\t\t\tfor ( var i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\t\tvar object = arguments[ i ],\n\t\t\t\t\tuuid = object.uuid,\n\t\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index === undefined ) {\n\n\t\t\t\t\t// unknown object -> add it to the ACTIVE region\n\n\t\t\t\t\tindex = nObjects ++;\n\t\t\t\t\tindicesByUUID[ uuid ] = index;\n\t\t\t\t\tobjects.push( object );\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( var j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tbindings[ j ].push(\n\t\t\t\t\t\t\t\tnew PropertyBinding(\n\t\t\t\t\t\t\t\t\tobject, paths[ j ], parsedPaths[ j ] ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( index < nCachedObjects ) {\n\n\t\t\t\t\tvar knownObject = objects[ index ];\n\n\t\t\t\t\t// move existing object to the ACTIVE region\n\n\t\t\t\t\tvar firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ];\n\n\t\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\t\tindicesByUUID[ uuid ] = firstActiveIndex;\n\t\t\t\t\tobjects[ firstActiveIndex ] = object;\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( var j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tvar bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ],\n\t\t\t\t\t\t\tbinding = bindingsForPath[ index ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\n\t\t\t\t\t\tif ( binding === undefined ) {\n\n\t\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t\t// or may not exist\n\n\t\t\t\t\t\t\tbinding = new PropertyBinding(\n\t\t\t\t\t\t\t\t\tobject, paths[ j ], parsedPaths[ j ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = binding;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( objects[ index ] !== knownObject) {\n\n\t\t\t\t\tconsole.error( \"Different objects with the same UUID \" +\n\t\t\t\t\t\t\t\"detected. Clean the caches or recreate your \" +\n\t\t\t\t\t\t\t\"infrastructure when reloading scenes...\" );\n\n\t\t\t\t} // else the object is already where we want it to be\n\n\t\t\t} // for arguments\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t\t},\n\n\t\tremove: function( var_args ) {\n\n\t\t\tvar objects = this._objects,\n\t\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tnBindings = bindings.length;\n\n\t\t\tfor ( var i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\t\tvar object = arguments[ i ],\n\t\t\t\t\tuuid = object.uuid,\n\t\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index !== undefined && index >= nCachedObjects ) {\n\n\t\t\t\t\t// move existing object into the CACHED region\n\n\t\t\t\t\tvar lastCachedIndex = nCachedObjects ++,\n\t\t\t\t\t\tfirstActiveObject = objects[ lastCachedIndex ];\n\n\t\t\t\t\tindicesByUUID[ firstActiveObject.uuid ] = index;\n\t\t\t\t\tobjects[ index ] = firstActiveObject;\n\n\t\t\t\t\tindicesByUUID[ uuid ] = lastCachedIndex;\n\t\t\t\t\tobjects[ lastCachedIndex ] = object;\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( var j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tvar bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\tfirstActive = bindingsForPath[ lastCachedIndex ],\n\t\t\t\t\t\t\tbinding = bindingsForPath[ index ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = firstActive;\n\t\t\t\t\t\tbindingsForPath[ lastCachedIndex ] = binding;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} // for arguments\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t\t},\n\n\t\t// remove & forget\n\t\tuncache: function( var_args ) {\n\n\t\t\tvar objects = this._objects,\n\t\t\t\tnObjects = objects.length,\n\t\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tnBindings = bindings.length;\n\n\t\t\tfor ( var i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\t\tvar object = arguments[ i ],\n\t\t\t\t\tuuid = object.uuid,\n\t\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index !== undefined ) {\n\n\t\t\t\t\tdelete indicesByUUID[ uuid ];\n\n\t\t\t\t\tif ( index < nCachedObjects ) {\n\n\t\t\t\t\t\t// object is cached, shrink the CACHED region\n\n\t\t\t\t\t\tvar firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ],\n\t\t\t\t\t\t\tlastIndex = -- nObjects,\n\t\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\t\t// last cached object takes this object's place\n\t\t\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\t\t\t// last object goes to the activated slot and pop\n\t\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = firstActiveIndex;\n\t\t\t\t\t\tobjects[ firstActiveIndex ] = lastObject;\n\t\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\t\tfor ( var j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\t\tvar bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ],\n\t\t\t\t\t\t\t\tlast = bindingsForPath[ lastIndex ];\n\n\t\t\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\t\t\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = last;\n\t\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// object is active, just swap with the last and pop\n\n\t\t\t\t\t\tvar lastIndex = -- nObjects,\n\t\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = index;\n\t\t\t\t\t\tobjects[ index ] = lastObject;\n\t\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\t\tfor ( var j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\t\tvar bindingsForPath = bindings[ j ];\n\n\t\t\t\t\t\t\tbindingsForPath[ index ] = bindingsForPath[ lastIndex ];\n\t\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} // cached or active\n\n\t\t\t\t} // if object is known\n\n\t\t\t} // for arguments\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t\t},\n\n\t\t// Internal interface used by befriended PropertyBinding.Composite:\n\n\t\tsubscribe_: function( path, parsedPath ) {\n\t\t\t// returns an array of bindings for the given path that is changed\n\t\t\t// according to the contained objects in the group\n\n\t\t\tvar indicesByPath = this._bindingsIndicesByPath,\n\t\t\t\tindex = indicesByPath[ path ],\n\t\t\t\tbindings = this._bindings;\n\n\t\t\tif ( index !== undefined ) return bindings[ index ];\n\n\t\t\tvar paths = this._paths,\n\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\tobjects = this._objects,\n\t\t\t\tnObjects = objects.length,\n\t\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\t\tbindingsForPath = new Array( nObjects );\n\n\t\t\tindex = bindings.length;\n\n\t\t\tindicesByPath[ path ] = index;\n\n\t\t\tpaths.push( path );\n\t\t\tparsedPaths.push( parsedPath );\n\t\t\tbindings.push( bindingsForPath );\n\n\t\t\tfor ( var i = nCachedObjects,\n\t\t\t\t\tn = objects.length; i !== n; ++ i ) {\n\n\t\t\t\tvar object = objects[ i ];\n\n\t\t\t\tbindingsForPath[ i ] =\n\t\t\t\t\t\tnew PropertyBinding( object, path, parsedPath );\n\n\t\t\t}\n\n\t\t\treturn bindingsForPath;\n\n\t\t},\n\n\t\tunsubscribe_: function( path ) {\n\t\t\t// tells the group to forget about a property path and no longer\n\t\t\t// update the array previously obtained with 'subscribe_'\n\n\t\t\tvar indicesByPath = this._bindingsIndicesByPath,\n\t\t\t\tindex = indicesByPath[ path ];\n\n\t\t\tif ( index !== undefined ) {\n\n\t\t\t\tvar paths = this._paths,\n\t\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\t\tlastBindings = bindings[ lastBindingsIndex ],\n\t\t\t\t\tlastBindingsPath = path[ lastBindingsIndex ];\n\n\t\t\t\tindicesByPath[ lastBindingsPath ] = index;\n\n\t\t\t\tbindings[ index ] = lastBindings;\n\t\t\t\tbindings.pop();\n\n\t\t\t\tparsedPaths[ index ] = parsedPaths[ lastBindingsIndex ];\n\t\t\t\tparsedPaths.pop();\n\n\t\t\t\tpaths[ index ] = paths[ lastBindingsIndex ];\n\t\t\t\tpaths.pop();\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t/**\n\t *\n\t * Action provided by AnimationMixer for scheduling clip playback on specific\n\t * objects.\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t *\n\t */\n\n\tfunction AnimationAction( mixer, clip, localRoot ) {\n\n\t\tthis._mixer = mixer;\n\t\tthis._clip = clip;\n\t\tthis._localRoot = localRoot || null;\n\n\t\tvar tracks = clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tinterpolants = new Array( nTracks );\n\n\t\tvar interpolantSettings = {\n\t\t\t\tendingStart: \tZeroCurvatureEnding,\n\t\t\t\tendingEnd:\t\tZeroCurvatureEnding\n\t\t};\n\n\t\tfor ( var i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tvar interpolant = tracks[ i ].createInterpolant( null );\n\t\t\tinterpolants[ i ] = interpolant;\n\t\t\tinterpolant.settings = interpolantSettings;\n\n\t\t}\n\n\t\tthis._interpolantSettings = interpolantSettings;\n\n\t\tthis._interpolants = interpolants;\t// bound by the mixer\n\n\t\t// inside: PropertyMixer (managed by the mixer)\n\t\tthis._propertyBindings = new Array( nTracks );\n\n\t\tthis._cacheIndex = null;\t\t\t// for the memory manager\n\t\tthis._byClipCacheIndex = null;\t\t// for the memory manager\n\n\t\tthis._timeScaleInterpolant = null;\n\t\tthis._weightInterpolant = null;\n\n\t\tthis.loop = LoopRepeat;\n\t\tthis._loopCount = -1;\n\n\t\t// global mixer time when the action is to be started\n\t\t// it's set back to 'null' upon start of the action\n\t\tthis._startTime = null;\n\n\t\t// scaled local time of the action\n\t\t// gets clamped or wrapped to 0..clip.duration according to loop\n\t\tthis.time = 0;\n\n\t\tthis.timeScale = 1;\n\t\tthis._effectiveTimeScale = 1;\n\n\t\tthis.weight = 1;\n\t\tthis._effectiveWeight = 1;\n\n\t\tthis.repetitions = Infinity; \t\t// no. of repetitions when looping\n\n\t\tthis.paused = false;\t\t\t\t// false -> zero effective time scale\n\t\tthis.enabled = true;\t\t\t\t// true -> zero effective weight\n\n\t\tthis.clampWhenFinished \t= false;\t// keep feeding the last frame?\n\n\t\tthis.zeroSlopeAtStart \t= true;\t\t// for smooth interpolation w/o separate\n\t\tthis.zeroSlopeAtEnd\t\t= true;\t\t// clips for start, loop and end\n\n\t}\n\n\tAnimationAction.prototype = {\n\n\t\tconstructor: AnimationAction,\n\n\t\t// State & Scheduling\n\n\t\tplay: function() {\n\n\t\t\tthis._mixer._activateAction( this );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tstop: function() {\n\n\t\t\tthis._mixer._deactivateAction( this );\n\n\t\t\treturn this.reset();\n\n\t\t},\n\n\t\treset: function() {\n\n\t\t\tthis.paused = false;\n\t\t\tthis.enabled = true;\n\n\t\t\tthis.time = 0;\t\t\t// restart clip\n\t\t\tthis._loopCount = -1;\t// forget previous loops\n\t\t\tthis._startTime = null;\t// forget scheduling\n\n\t\t\treturn this.stopFading().stopWarping();\n\n\t\t},\n\n\t\tisRunning: function() {\n\n\t\t\treturn this.enabled && ! this.paused && this.timeScale !== 0 &&\n\t\t\t\t\tthis._startTime === null && this._mixer._isActiveAction( this );\n\n\t\t},\n\n\t\t// return true when play has been called\n\t\tisScheduled: function() {\n\n\t\t\treturn this._mixer._isActiveAction( this );\n\n\t\t},\n\n\t\tstartAt: function( time ) {\n\n\t\t\tthis._startTime = time;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetLoop: function( mode, repetitions ) {\n\n\t\t\tthis.loop = mode;\n\t\t\tthis.repetitions = repetitions;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// Weight\n\n\t\t// set the weight stopping any scheduled fading\n\t\t// although .enabled = false yields an effective weight of zero, this\n\t\t// method does *not* change .enabled, because it would be confusing\n\t\tsetEffectiveWeight: function( weight ) {\n\n\t\t\tthis.weight = weight;\n\n\t\t\t// note: same logic as when updated at runtime\n\t\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\t\treturn this.stopFading();\n\n\t\t},\n\n\t\t// return the weight considering fading and .enabled\n\t\tgetEffectiveWeight: function() {\n\n\t\t\treturn this._effectiveWeight;\n\n\t\t},\n\n\t\tfadeIn: function( duration ) {\n\n\t\t\treturn this._scheduleFading( duration, 0, 1 );\n\n\t\t},\n\n\t\tfadeOut: function( duration ) {\n\n\t\t\treturn this._scheduleFading( duration, 1, 0 );\n\n\t\t},\n\n\t\tcrossFadeFrom: function( fadeOutAction, duration, warp ) {\n\n\t\t\tfadeOutAction.fadeOut( duration );\n\t\t\tthis.fadeIn( duration );\n\n\t\t\tif( warp ) {\n\n\t\t\t\tvar fadeInDuration = this._clip.duration,\n\t\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\n\t\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\n\t\t\t\tfadeOutAction.warp( 1.0, startEndRatio, duration );\n\t\t\t\tthis.warp( endStartRatio, 1.0, duration );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcrossFadeTo: function( fadeInAction, duration, warp ) {\n\n\t\t\treturn fadeInAction.crossFadeFrom( this, duration, warp );\n\n\t\t},\n\n\t\tstopFading: function() {\n\n\t\t\tvar weightInterpolant = this._weightInterpolant;\n\n\t\t\tif ( weightInterpolant !== null ) {\n\n\t\t\t\tthis._weightInterpolant = null;\n\t\t\t\tthis._mixer._takeBackControlInterpolant( weightInterpolant );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// Time Scale Control\n\n\t\t// set the weight stopping any scheduled warping\n\t\t// although .paused = true yields an effective time scale of zero, this\n\t\t// method does *not* change .paused, because it would be confusing\n\t\tsetEffectiveTimeScale: function( timeScale ) {\n\n\t\t\tthis.timeScale = timeScale;\n\t\t\tthis._effectiveTimeScale = this.paused ? 0 :timeScale;\n\n\t\t\treturn this.stopWarping();\n\n\t\t},\n\n\t\t// return the time scale considering warping and .paused\n\t\tgetEffectiveTimeScale: function() {\n\n\t\t\treturn this._effectiveTimeScale;\n\n\t\t},\n\n\t\tsetDuration: function( duration ) {\n\n\t\t\tthis.timeScale = this._clip.duration / duration;\n\n\t\t\treturn this.stopWarping();\n\n\t\t},\n\n\t\tsyncWith: function( action ) {\n\n\t\t\tthis.time = action.time;\n\t\t\tthis.timeScale = action.timeScale;\n\n\t\t\treturn this.stopWarping();\n\n\t\t},\n\n\t\thalt: function( duration ) {\n\n\t\t\treturn this.warp( this._effectiveTimeScale, 0, duration );\n\n\t\t},\n\n\t\twarp: function( startTimeScale, endTimeScale, duration ) {\n\n\t\t\tvar mixer = this._mixer, now = mixer.time,\n\t\t\t\tinterpolant = this._timeScaleInterpolant,\n\n\t\t\t\ttimeScale = this.timeScale;\n\n\t\t\tif ( interpolant === null ) {\n\n\t\t\t\tinterpolant = mixer._lendControlInterpolant(),\n\t\t\t\tthis._timeScaleInterpolant = interpolant;\n\n\t\t\t}\n\n\t\t\tvar times = interpolant.parameterPositions,\n\t\t\t\tvalues = interpolant.sampleValues;\n\n\t\t\ttimes[ 0 ] = now;\n\t\t\ttimes[ 1 ] = now + duration;\n\n\t\t\tvalues[ 0 ] = startTimeScale / timeScale;\n\t\t\tvalues[ 1 ] = endTimeScale / timeScale;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tstopWarping: function() {\n\n\t\t\tvar timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\t\tif ( timeScaleInterpolant !== null ) {\n\n\t\t\t\tthis._timeScaleInterpolant = null;\n\t\t\t\tthis._mixer._takeBackControlInterpolant( timeScaleInterpolant );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// Object Accessors\n\n\t\tgetMixer: function() {\n\n\t\t\treturn this._mixer;\n\n\t\t},\n\n\t\tgetClip: function() {\n\n\t\t\treturn this._clip;\n\n\t\t},\n\n\t\tgetRoot: function() {\n\n\t\t\treturn this._localRoot || this._mixer._root;\n\n\t\t},\n\n\t\t// Interna\n\n\t\t_update: function( time, deltaTime, timeDirection, accuIndex ) {\n\t\t\t// called by the mixer\n\n\t\t\tvar startTime = this._startTime;\n\n\t\t\tif ( startTime !== null ) {\n\n\t\t\t\t// check for scheduled start of action\n\n\t\t\t\tvar timeRunning = ( time - startTime ) * timeDirection;\n\t\t\t\tif ( timeRunning < 0 || timeDirection === 0 ) {\n\n\t\t\t\t\treturn; // yet to come / don't decide when delta = 0\n\n\t\t\t\t}\n\n\t\t\t\t// start\n\n\t\t\t\tthis._startTime = null; // unschedule\n\t\t\t\tdeltaTime = timeDirection * timeRunning;\n\n\t\t\t}\n\n\t\t\t// apply time scale and advance time\n\n\t\t\tdeltaTime *= this._updateTimeScale( time );\n\t\t\tvar clipTime = this._updateTime( deltaTime );\n\n\t\t\t// note: _updateTime may disable the action resulting in\n\t\t\t// an effective weight of 0\n\n\t\t\tvar weight = this._updateWeight( time );\n\n\t\t\tif ( weight > 0 ) {\n\n\t\t\t\tvar interpolants = this._interpolants;\n\t\t\t\tvar propertyMixers = this._propertyBindings;\n\n\t\t\t\tfor ( var j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\tpropertyMixers[ j ].accumulate( accuIndex, weight );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\t_updateWeight: function( time ) {\n\n\t\t\tvar weight = 0;\n\n\t\t\tif ( this.enabled ) {\n\n\t\t\t\tweight = this.weight;\n\t\t\t\tvar interpolant = this._weightInterpolant;\n\n\t\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\t\tvar interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\t\tif ( interpolantValue === 0 ) {\n\n\t\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\t\tthis.enabled = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._effectiveWeight = weight;\n\t\t\treturn weight;\n\n\t\t},\n\n\t\t_updateTimeScale: function( time ) {\n\n\t\t\tvar timeScale = 0;\n\n\t\t\tif ( ! this.paused ) {\n\n\t\t\t\ttimeScale = this.timeScale;\n\n\t\t\t\tvar interpolant = this._timeScaleInterpolant;\n\n\t\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\t\tvar interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\t\tif ( timeScale === 0 ) {\n\n\t\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\t\tthis.paused = true;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\t\tthis.timeScale = timeScale;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._effectiveTimeScale = timeScale;\n\t\t\treturn timeScale;\n\n\t\t},\n\n\t\t_updateTime: function( deltaTime ) {\n\n\t\t\tvar time = this.time + deltaTime;\n\n\t\t\tif ( deltaTime === 0 ) return time;\n\n\t\t\tvar duration = this._clip.duration,\n\n\t\t\t\tloop = this.loop,\n\t\t\t\tloopCount = this._loopCount;\n\n\t\t\tif ( loop === LoopOnce ) {\n\n\t\t\t\tif ( loopCount === -1 ) {\n\t\t\t\t\t// just started\n\n\t\t\t\t\tthis.loopCount = 0;\n\t\t\t\t\tthis._setEndings( true, true, false );\n\n\t\t\t\t}\n\n\t\t\t\thandle_stop: {\n\n\t\t\t\t\tif ( time >= duration ) {\n\n\t\t\t\t\t\ttime = duration;\n\n\t\t\t\t\t} else if ( time < 0 ) {\n\n\t\t\t\t\t\ttime = 0;\n\n\t\t\t\t\t} else break handle_stop;\n\n\t\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\t\telse this.enabled = false;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\t\tdirection: deltaTime < 0 ? -1 : 1\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else { // repetitive Repeat or PingPong\n\n\t\t\t\tvar pingPong = ( loop === LoopPingPong );\n\n\t\t\t\tif ( loopCount === -1 ) {\n\t\t\t\t\t// just started\n\n\t\t\t\t\tif ( deltaTime >= 0 ) {\n\n\t\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\t\tthis._setEndings(\n\t\t\t\t\t\t\t\ttrue, this.repetitions === 0, pingPong );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t\t// so leave loopCount at -1\n\n\t\t\t\t\t\tthis._setEndings(\n\t\t\t\t\t\t\t\tthis.repetitions === 0, true, pingPong );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( time >= duration || time < 0 ) {\n\t\t\t\t\t// wrap around\n\n\t\t\t\t\tvar loopDelta = Math.floor( time / duration ); // signed\n\t\t\t\t\ttime -= duration * loopDelta;\n\n\t\t\t\t\tloopCount += Math.abs( loopDelta );\n\n\t\t\t\t\tvar pending = this.repetitions - loopCount;\n\n\t\t\t\t\tif ( pending < 0 ) {\n\t\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\n\t\t\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\t\t\telse this.enabled = false;\n\n\t\t\t\t\t\ttime = deltaTime > 0 ? duration : 0;\n\n\t\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\t\t\tdirection: deltaTime > 0 ? 1 : -1\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// keep running\n\n\t\t\t\t\t\tif ( pending === 0 ) {\n\t\t\t\t\t\t\t// entering the last round\n\n\t\t\t\t\t\t\tvar atStart = deltaTime < 0;\n\t\t\t\t\t\t\tthis._setEndings( atStart, ! atStart, pingPong );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tthis._setEndings( false, false, pingPong );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._loopCount = loopCount;\n\n\t\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\t\ttype: 'loop', action: this, loopDelta: loopDelta\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( pingPong && ( loopCount & 1 ) === 1 ) {\n\t\t\t\t\t// invert time for the \"pong round\"\n\n\t\t\t\t\tthis.time = time;\n\t\t\t\t\treturn duration - time;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.time = time;\n\t\t\treturn time;\n\n\t\t},\n\n\t\t_setEndings: function( atStart, atEnd, pingPong ) {\n\n\t\t\tvar settings = this._interpolantSettings;\n\n\t\t\tif ( pingPong ) {\n\n\t\t\t\tsettings.endingStart \t= ZeroSlopeEnding;\n\t\t\t\tsettings.endingEnd\t\t= ZeroSlopeEnding;\n\n\t\t\t} else {\n\n\t\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\n\t\t\t\tif ( atStart ) {\n\n\t\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ?\n\t\t\t\t\t\t\tZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\n\t\t\t\t}\n\n\t\t\t\tif ( atEnd ) {\n\n\t\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ?\n\t\t\t\t\t\t\tZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tsettings.endingEnd \t = WrapAroundEnding;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\t_scheduleFading: function( duration, weightNow, weightThen ) {\n\n\t\t\tvar mixer = this._mixer, now = mixer.time,\n\t\t\t\tinterpolant = this._weightInterpolant;\n\n\t\t\tif ( interpolant === null ) {\n\n\t\t\t\tinterpolant = mixer._lendControlInterpolant(),\n\t\t\t\tthis._weightInterpolant = interpolant;\n\n\t\t\t}\n\n\t\t\tvar times = interpolant.parameterPositions,\n\t\t\t\tvalues = interpolant.sampleValues;\n\n\t\t\ttimes[ 0 ] = now; \t\t\t\tvalues[ 0 ] = weightNow;\n\t\t\ttimes[ 1 ] = now + duration;\tvalues[ 1 ] = weightThen;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\t/**\n\t *\n\t * Player for AnimationClips.\n\t *\n\t *\n\t * @author Ben Houston / http://clara.io/\n\t * @author David Sarno / http://lighthaus.us/\n\t * @author tschw\n\t */\n\n\tfunction AnimationMixer( root ) {\n\n\t\tthis._root = root;\n\t\tthis._initMemoryManager();\n\t\tthis._accuIndex = 0;\n\n\t\tthis.time = 0;\n\n\t\tthis.timeScale = 1.0;\n\n\t}\n\n\tObject.assign( AnimationMixer.prototype, EventDispatcher.prototype, {\n\n\t\t// return an action for a clip optionally using a custom root target\n\t\t// object (this method allocates a lot of dynamic memory in case a\n\t\t// previously unknown clip/root combination is specified)\n\t\tclipAction: function( clip, optionalRoot ) {\n\n\t\t\tvar root = optionalRoot || this._root,\n\t\t\t\trootUuid = root.uuid,\n\n\t\t\t\tclipObject = typeof clip === 'string' ?\n\t\t\t\t\t\tAnimationClip.findByName( root, clip ) : clip,\n\n\t\t\t\tclipUuid = clipObject !== null ? clipObject.uuid : clip,\n\n\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ],\n\t\t\t\tprototypeAction = null;\n\n\t\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t\tvar existingAction =\n\t\t\t\t\t\tactionsForClip.actionByRoot[ rootUuid ];\n\n\t\t\t\tif ( existingAction !== undefined ) {\n\n\t\t\t\t\treturn existingAction;\n\n\t\t\t\t}\n\n\t\t\t\t// we know the clip, so we don't have to parse all\n\t\t\t\t// the bindings again but can just copy\n\t\t\t\tprototypeAction = actionsForClip.knownActions[ 0 ];\n\n\t\t\t\t// also, take the clip from the prototype action\n\t\t\t\tif ( clipObject === null )\n\t\t\t\t\tclipObject = prototypeAction._clip;\n\n\t\t\t}\n\n\t\t\t// clip must be known when specified via string\n\t\t\tif ( clipObject === null ) return null;\n\n\t\t\t// allocate all resources required to run it\n\t\t\tvar newAction = new AnimationAction( this, clipObject, optionalRoot );\n\n\t\t\tthis._bindAction( newAction, prototypeAction );\n\n\t\t\t// and make the action known to the memory manager\n\t\t\tthis._addInactiveAction( newAction, clipUuid, rootUuid );\n\n\t\t\treturn newAction;\n\n\t\t},\n\n\t\t// get an existing action\n\t\texistingAction: function( clip, optionalRoot ) {\n\n\t\t\tvar root = optionalRoot || this._root,\n\t\t\t\trootUuid = root.uuid,\n\n\t\t\t\tclipObject = typeof clip === 'string' ?\n\t\t\t\t\t\tAnimationClip.findByName( root, clip ) : clip,\n\n\t\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\n\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t\treturn actionsForClip.actionByRoot[ rootUuid ] || null;\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t},\n\n\t\t// deactivates all previously scheduled actions\n\t\tstopAllAction: function() {\n\n\t\t\tvar actions = this._actions,\n\t\t\t\tnActions = this._nActiveActions,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tnBindings = this._nActiveBindings;\n\n\t\t\tthis._nActiveActions = 0;\n\t\t\tthis._nActiveBindings = 0;\n\n\t\t\tfor ( var i = 0; i !== nActions; ++ i ) {\n\n\t\t\t\tactions[ i ].reset();\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0; i !== nBindings; ++ i ) {\n\n\t\t\t\tbindings[ i ].useCount = 0;\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// advance the time and update apply the animation\n\t\tupdate: function( deltaTime ) {\n\n\t\t\tdeltaTime *= this.timeScale;\n\n\t\t\tvar actions = this._actions,\n\t\t\t\tnActions = this._nActiveActions,\n\n\t\t\t\ttime = this.time += deltaTime,\n\t\t\t\ttimeDirection = Math.sign( deltaTime ),\n\n\t\t\t\taccuIndex = this._accuIndex ^= 1;\n\n\t\t\t// run active actions\n\n\t\t\tfor ( var i = 0; i !== nActions; ++ i ) {\n\n\t\t\t\tvar action = actions[ i ];\n\n\t\t\t\tif ( action.enabled ) {\n\n\t\t\t\t\taction._update( time, deltaTime, timeDirection, accuIndex );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// update scene graph\n\n\t\t\tvar bindings = this._bindings,\n\t\t\t\tnBindings = this._nActiveBindings;\n\n\t\t\tfor ( var i = 0; i !== nBindings; ++ i ) {\n\n\t\t\t\tbindings[ i ].apply( accuIndex );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// return this mixer's root target object\n\t\tgetRoot: function() {\n\n\t\t\treturn this._root;\n\n\t\t},\n\n\t\t// free all resources specific to a particular clip\n\t\tuncacheClip: function( clip ) {\n\n\t\t\tvar actions = this._actions,\n\t\t\t\tclipUuid = clip.uuid,\n\t\t\t\tactionsByClip = this._actionsByClip,\n\t\t\t\tactionsForClip = actionsByClip[ clipUuid ];\n\n\t\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t\t// iteration state and also require updating the state we can\n\t\t\t\t// just throw away\n\n\t\t\t\tvar actionsToRemove = actionsForClip.knownActions;\n\n\t\t\t\tfor ( var i = 0, n = actionsToRemove.length; i !== n; ++ i ) {\n\n\t\t\t\t\tvar action = actionsToRemove[ i ];\n\n\t\t\t\t\tthis._deactivateAction( action );\n\n\t\t\t\t\tvar cacheIndex = action._cacheIndex,\n\t\t\t\t\t\tlastInactiveAction = actions[ actions.length - 1 ];\n\n\t\t\t\t\taction._cacheIndex = null;\n\t\t\t\t\taction._byClipCacheIndex = null;\n\n\t\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\t\t\t\tactions.pop();\n\n\t\t\t\t\tthis._removeInactiveBindingsForAction( action );\n\n\t\t\t\t}\n\n\t\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t\t}\n\n\t\t},\n\n\t\t// free all resources specific to a particular root target object\n\t\tuncacheRoot: function( root ) {\n\n\t\t\tvar rootUuid = root.uuid,\n\t\t\t\tactionsByClip = this._actionsByClip;\n\n\t\t\tfor ( var clipUuid in actionsByClip ) {\n\n\t\t\t\tvar actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\t\tif ( action !== undefined ) {\n\n\t\t\t\t\tthis._deactivateAction( action );\n\t\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar bindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\t\tif ( bindingByName !== undefined ) {\n\n\t\t\t\tfor ( var trackName in bindingByName ) {\n\n\t\t\t\t\tvar binding = bindingByName[ trackName ];\n\t\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\t// remove a targeted clip from the cache\n\t\tuncacheAction: function( clip, optionalRoot ) {\n\n\t\t\tvar action = this.existingAction( clip, optionalRoot );\n\n\t\t\tif ( action !== null ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\t// Implementation details:\n\n\tObject.assign( AnimationMixer.prototype, {\n\n\t\t_bindAction: function( action, prototypeAction ) {\n\n\t\t\tvar root = action._localRoot || this._root,\n\t\t\t\ttracks = action._clip.tracks,\n\t\t\t\tnTracks = tracks.length,\n\t\t\t\tbindings = action._propertyBindings,\n\t\t\t\tinterpolants = action._interpolants,\n\t\t\t\trootUuid = root.uuid,\n\t\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\tbindingsByName = bindingsByRoot[ rootUuid ];\n\n\t\t\tif ( bindingsByName === undefined ) {\n\n\t\t\t\tbindingsByName = {};\n\t\t\t\tbindingsByRoot[ rootUuid ] = bindingsByName;\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0; i !== nTracks; ++ i ) {\n\n\t\t\t\tvar track = tracks[ i ],\n\t\t\t\t\ttrackName = track.name,\n\t\t\t\t\tbinding = bindingsByName[ trackName ];\n\n\t\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbinding = bindings[ i ];\n\n\t\t\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t\t\t// existing binding, make sure the cache knows\n\n\t\t\t\t\t\tif ( binding._cacheIndex === null ) {\n\n\t\t\t\t\t\t\t++ binding.referenceCount;\n\t\t\t\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar path = prototypeAction && prototypeAction.\n\t\t\t\t\t\t\t_propertyBindings[ i ].binding.parsedPath;\n\n\t\t\t\t\tbinding = new PropertyMixer(\n\t\t\t\t\t\t\tPropertyBinding.create( root, trackName, path ),\n\t\t\t\t\t\t\ttrack.ValueTypeName, track.getValueSize() );\n\n\t\t\t\t\t++ binding.referenceCount;\n\t\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t\t}\n\n\t\t\t\tinterpolants[ i ].resultBuffer = binding.buffer;\n\n\t\t\t}\n\n\t\t},\n\n\t\t_activateAction: function( action ) {\n\n\t\t\tif ( ! this._isActiveAction( action ) ) {\n\n\t\t\t\tif ( action._cacheIndex === null ) {\n\n\t\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t\t// appears to be still using it -> rebind\n\n\t\t\t\t\tvar rootUuid = ( action._localRoot || this._root ).uuid,\n\t\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\t\t\t\tthis._bindAction( action,\n\t\t\t\t\t\t\tactionsForClip && actionsForClip.knownActions[ 0 ] );\n\n\t\t\t\t\tthis._addInactiveAction( action, clipUuid, rootUuid );\n\n\t\t\t\t}\n\n\t\t\t\tvar bindings = action._propertyBindings;\n\n\t\t\t\t// increment reference counts / sort out state\n\t\t\t\tfor ( var i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\t\tvar binding = bindings[ i ];\n\n\t\t\t\t\tif ( binding.useCount ++ === 0 ) {\n\n\t\t\t\t\t\tthis._lendBinding( binding );\n\t\t\t\t\t\tbinding.saveOriginalState();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tthis._lendAction( action );\n\n\t\t\t}\n\n\t\t},\n\n\t\t_deactivateAction: function( action ) {\n\n\t\t\tif ( this._isActiveAction( action ) ) {\n\n\t\t\t\tvar bindings = action._propertyBindings;\n\n\t\t\t\t// decrement reference counts / sort out state\n\t\t\t\tfor ( var i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\t\tvar binding = bindings[ i ];\n\n\t\t\t\t\tif ( -- binding.useCount === 0 ) {\n\n\t\t\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\t\t\tthis._takeBackBinding( binding );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tthis._takeBackAction( action );\n\n\t\t\t}\n\n\t\t},\n\n\t\t// Memory manager\n\n\t\t_initMemoryManager: function() {\n\n\t\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\t\t\tthis._nActiveActions = 0;\n\n\t\t\tthis._actionsByClip = {};\n\t\t\t// inside:\n\t\t\t// {\n\t\t\t// \t\tknownActions: Array< AnimationAction >\t- used as prototypes\n\t\t\t// \t\tactionByRoot: AnimationAction\t\t\t- lookup\n\t\t\t// }\n\n\n\t\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\t\t\tthis._nActiveBindings = 0;\n\n\t\t\tthis._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer >\n\n\n\t\t\tthis._controlInterpolants = []; // same game as above\n\t\t\tthis._nActiveControlInterpolants = 0;\n\n\t\t\tvar scope = this;\n\n\t\t\tthis.stats = {\n\n\t\t\t\tactions: {\n\t\t\t\t\tget total() { return scope._actions.length; },\n\t\t\t\t\tget inUse() { return scope._nActiveActions; }\n\t\t\t\t},\n\t\t\t\tbindings: {\n\t\t\t\t\tget total() { return scope._bindings.length; },\n\t\t\t\t\tget inUse() { return scope._nActiveBindings; }\n\t\t\t\t},\n\t\t\t\tcontrolInterpolants: {\n\t\t\t\t\tget total() { return scope._controlInterpolants.length; },\n\t\t\t\t\tget inUse() { return scope._nActiveControlInterpolants; }\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t},\n\n\t\t// Memory management for AnimationAction objects\n\n\t\t_isActiveAction: function( action ) {\n\n\t\t\tvar index = action._cacheIndex;\n\t\t\treturn index !== null && index < this._nActiveActions;\n\n\t\t},\n\n\t\t_addInactiveAction: function( action, clipUuid, rootUuid ) {\n\n\t\t\tvar actions = this._actions,\n\t\t\t\tactionsByClip = this._actionsByClip,\n\t\t\t\tactionsForClip = actionsByClip[ clipUuid ];\n\n\t\t\tif ( actionsForClip === undefined ) {\n\n\t\t\t\tactionsForClip = {\n\n\t\t\t\t\tknownActions: [ action ],\n\t\t\t\t\tactionByRoot: {}\n\n\t\t\t\t};\n\n\t\t\t\taction._byClipCacheIndex = 0;\n\n\t\t\t\tactionsByClip[ clipUuid ] = actionsForClip;\n\n\t\t\t} else {\n\n\t\t\t\tvar knownActions = actionsForClip.knownActions;\n\n\t\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\t\tknownActions.push( action );\n\n\t\t\t}\n\n\t\t\taction._cacheIndex = actions.length;\n\t\t\tactions.push( action );\n\n\t\t\tactionsForClip.actionByRoot[ rootUuid ] = action;\n\n\t\t},\n\n\t\t_removeInactiveAction: function( action ) {\n\n\t\t\tvar actions = this._actions,\n\t\t\t\tlastInactiveAction = actions[ actions.length - 1 ],\n\t\t\t\tcacheIndex = action._cacheIndex;\n\n\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\t\tactions.pop();\n\n\t\t\taction._cacheIndex = null;\n\n\n\t\t\tvar clipUuid = action._clip.uuid,\n\t\t\t\tactionsByClip = this._actionsByClip,\n\t\t\t\tactionsForClip = actionsByClip[ clipUuid ],\n\t\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\n\t\t\t\tlastKnownAction =\n\t\t\t\t\tknownActionsForClip[ knownActionsForClip.length - 1 ],\n\n\t\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\n\t\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\t\tknownActionsForClip[ byClipCacheIndex ] = lastKnownAction;\n\t\t\tknownActionsForClip.pop();\n\n\t\t\taction._byClipCacheIndex = null;\n\n\n\t\t\tvar actionByRoot = actionsForClip.actionByRoot,\n\t\t\t\trootUuid = ( actions._localRoot || this._root ).uuid;\n\n\t\t\tdelete actionByRoot[ rootUuid ];\n\n\t\t\tif ( knownActionsForClip.length === 0 ) {\n\n\t\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t\t}\n\n\t\t\tthis._removeInactiveBindingsForAction( action );\n\n\t\t},\n\n\t\t_removeInactiveBindingsForAction: function( action ) {\n\n\t\t\tvar bindings = action._propertyBindings;\n\t\t\tfor ( var i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tvar binding = bindings[ i ];\n\n\t\t\t\tif ( -- binding.referenceCount === 0 ) {\n\n\t\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\n\t\t_lendAction: function( action ) {\n\n\t\t\t// [ active actions | inactive actions ]\n\t\t\t// [ active actions >| inactive actions ]\n\t\t\t// s a\n\t\t\t// <-swap->\n\t\t\t// a s\n\n\t\t\tvar actions = this._actions,\n\t\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\t\tlastActiveIndex = this._nActiveActions ++,\n\n\t\t\t\tfirstInactiveAction = actions[ lastActiveIndex ];\n\n\t\t\taction._cacheIndex = lastActiveIndex;\n\t\t\tactions[ lastActiveIndex ] = action;\n\n\t\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\t\tactions[ prevIndex ] = firstInactiveAction;\n\n\t\t},\n\n\t\t_takeBackAction: function( action ) {\n\n\t\t\t// [ active actions | inactive actions ]\n\t\t\t// [ active actions |< inactive actions ]\n\t\t\t// a s\n\t\t\t// <-swap->\n\t\t\t// s a\n\n\t\t\tvar actions = this._actions,\n\t\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\t\tfirstInactiveIndex = -- this._nActiveActions,\n\n\t\t\t\tlastActiveAction = actions[ firstInactiveIndex ];\n\n\t\t\taction._cacheIndex = firstInactiveIndex;\n\t\t\tactions[ firstInactiveIndex ] = action;\n\n\t\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\t\tactions[ prevIndex ] = lastActiveAction;\n\n\t\t},\n\n\t\t// Memory management for PropertyMixer objects\n\n\t\t_addInactiveBinding: function( binding, rootUuid, trackName ) {\n\n\t\t\tvar bindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\tbindingByName = bindingsByRoot[ rootUuid ],\n\n\t\t\t\tbindings = this._bindings;\n\n\t\t\tif ( bindingByName === undefined ) {\n\n\t\t\t\tbindingByName = {};\n\t\t\t\tbindingsByRoot[ rootUuid ] = bindingByName;\n\n\t\t\t}\n\n\t\t\tbindingByName[ trackName ] = binding;\n\n\t\t\tbinding._cacheIndex = bindings.length;\n\t\t\tbindings.push( binding );\n\n\t\t},\n\n\t\t_removeInactiveBinding: function( binding ) {\n\n\t\t\tvar bindings = this._bindings,\n\t\t\t\tpropBinding = binding.binding,\n\t\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\t\ttrackName = propBinding.path,\n\t\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\tbindingByName = bindingsByRoot[ rootUuid ],\n\n\t\t\t\tlastInactiveBinding = bindings[ bindings.length - 1 ],\n\t\t\t\tcacheIndex = binding._cacheIndex;\n\n\t\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\t\tbindings[ cacheIndex ] = lastInactiveBinding;\n\t\t\tbindings.pop();\n\n\t\t\tdelete bindingByName[ trackName ];\n\n\t\t\tremove_empty_map: {\n\n\t\t\t\tfor ( var _ in bindingByName ) break remove_empty_map;\n\n\t\t\t\tdelete bindingsByRoot[ rootUuid ];\n\n\t\t\t}\n\n\t\t},\n\n\t\t_lendBinding: function( binding ) {\n\n\t\t\tvar bindings = this._bindings,\n\t\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\t\tlastActiveIndex = this._nActiveBindings ++,\n\n\t\t\t\tfirstInactiveBinding = bindings[ lastActiveIndex ];\n\n\t\t\tbinding._cacheIndex = lastActiveIndex;\n\t\t\tbindings[ lastActiveIndex ] = binding;\n\n\t\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\t\tbindings[ prevIndex ] = firstInactiveBinding;\n\n\t\t},\n\n\t\t_takeBackBinding: function( binding ) {\n\n\t\t\tvar bindings = this._bindings,\n\t\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\t\tfirstInactiveIndex = -- this._nActiveBindings,\n\n\t\t\t\tlastActiveBinding = bindings[ firstInactiveIndex ];\n\n\t\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\t\tbindings[ firstInactiveIndex ] = binding;\n\n\t\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\t\tbindings[ prevIndex ] = lastActiveBinding;\n\n\t\t},\n\n\n\t\t// Memory management of Interpolants for weight and time scale\n\n\t\t_lendControlInterpolant: function() {\n\n\t\t\tvar interpolants = this._controlInterpolants,\n\t\t\t\tlastActiveIndex = this._nActiveControlInterpolants ++,\n\t\t\t\tinterpolant = interpolants[ lastActiveIndex ];\n\n\t\t\tif ( interpolant === undefined ) {\n\n\t\t\t\tinterpolant = new LinearInterpolant(\n\t\t\t\t\t\tnew Float32Array( 2 ), new Float32Array( 2 ),\n\t\t\t\t\t\t\t1, this._controlInterpolantsResultBuffer );\n\n\t\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\t\tinterpolants[ lastActiveIndex ] = interpolant;\n\n\t\t\t}\n\n\t\t\treturn interpolant;\n\n\t\t},\n\n\t\t_takeBackControlInterpolant: function( interpolant ) {\n\n\t\t\tvar interpolants = this._controlInterpolants,\n\t\t\t\tprevIndex = interpolant.__cacheIndex,\n\n\t\t\t\tfirstInactiveIndex = -- this._nActiveControlInterpolants,\n\n\t\t\t\tlastActiveInterpolant = interpolants[ firstInactiveIndex ];\n\n\t\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\t\tinterpolants[ firstInactiveIndex ] = interpolant;\n\n\t\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\t\tinterpolants[ prevIndex ] = lastActiveInterpolant;\n\n\t\t},\n\n\t\t_controlInterpolantsResultBuffer: new Float32Array( 1 )\n\n\t} );\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Uniform( value ) {\n\n\t\tif ( typeof value === 'string' ) {\n\n\t\t\tconsole.warn( 'THREE.Uniform: Type parameter is no longer needed.' );\n\t\t\tvalue = arguments[ 1 ];\n\n\t\t}\n\n\t\tthis.value = value;\n\n\t}\n\n\t/**\n\t * @author benaadams / https://twitter.com/ben_a_adams\n\t */\n\n\tfunction InstancedBufferGeometry() {\n\n\t\tBufferGeometry.call( this );\n\n\t\tthis.type = 'InstancedBufferGeometry';\n\t\tthis.maxInstancedCount = undefined;\n\n\t}\n\n\tInstancedBufferGeometry.prototype = Object.create( BufferGeometry.prototype );\n\tInstancedBufferGeometry.prototype.constructor = InstancedBufferGeometry;\n\n\tInstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;\n\n\tInstancedBufferGeometry.prototype.addGroup = function ( start, count, materialIndex ) {\n\n\t\tthis.groups.push( {\n\n\t\t\tstart: start,\n\t\t\tcount: count,\n\t\t\tmaterialIndex: materialIndex\n\n\t\t} );\n\n\t};\n\n\tInstancedBufferGeometry.prototype.copy = function ( source ) {\n\n\t\tvar index = source.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tthis.setIndex( index.clone() );\n\n\t\t}\n\n\t\tvar attributes = source.attributes;\n\n\t\tfor ( var name in attributes ) {\n\n\t\t\tvar attribute = attributes[ name ];\n\t\t\tthis.addAttribute( name, attribute.clone() );\n\n\t\t}\n\n\t\tvar groups = source.groups;\n\n\t\tfor ( var i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tvar group = groups[ i ];\n\t\t\tthis.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author benaadams / https://twitter.com/ben_a_adams\n\t */\n\n\tfunction InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, normalized ) {\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.data = interleavedBuffer;\n\t\tthis.itemSize = itemSize;\n\t\tthis.offset = offset;\n\n\t\tthis.normalized = normalized === true;\n\n\t}\n\n\n\tInterleavedBufferAttribute.prototype = {\n\n\t\tconstructor: InterleavedBufferAttribute,\n\n\t\tisInterleavedBufferAttribute: true,\n\n\t\tget count() {\n\n\t\t\treturn this.data.count;\n\n\t\t},\n\n\t\tget array() {\n\n\t\t\treturn this.data.array;\n\n\t\t},\n\n\t\tsetX: function ( index, x ) {\n\n\t\t\tthis.data.array[ index * this.data.stride + this.offset ] = x;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetY: function ( index, y ) {\n\n\t\t\tthis.data.array[ index * this.data.stride + this.offset + 1 ] = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetZ: function ( index, z ) {\n\n\t\t\tthis.data.array[ index * this.data.stride + this.offset + 2 ] = z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetW: function ( index, w ) {\n\n\t\t\tthis.data.array[ index * this.data.stride + this.offset + 3 ] = w;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tgetX: function ( index ) {\n\n\t\t\treturn this.data.array[ index * this.data.stride + this.offset ];\n\n\t\t},\n\n\t\tgetY: function ( index ) {\n\n\t\t\treturn this.data.array[ index * this.data.stride + this.offset + 1 ];\n\n\t\t},\n\n\t\tgetZ: function ( index ) {\n\n\t\t\treturn this.data.array[ index * this.data.stride + this.offset + 2 ];\n\n\t\t},\n\n\t\tgetW: function ( index ) {\n\n\t\t\treturn this.data.array[ index * this.data.stride + this.offset + 3 ];\n\n\t\t},\n\n\t\tsetXY: function ( index, x, y ) {\n\n\t\t\tindex = index * this.data.stride + this.offset;\n\n\t\t\tthis.data.array[ index + 0 ] = x;\n\t\t\tthis.data.array[ index + 1 ] = y;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetXYZ: function ( index, x, y, z ) {\n\n\t\t\tindex = index * this.data.stride + this.offset;\n\n\t\t\tthis.data.array[ index + 0 ] = x;\n\t\t\tthis.data.array[ index + 1 ] = y;\n\t\t\tthis.data.array[ index + 2 ] = z;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetXYZW: function ( index, x, y, z, w ) {\n\n\t\t\tindex = index * this.data.stride + this.offset;\n\n\t\t\tthis.data.array[ index + 0 ] = x;\n\t\t\tthis.data.array[ index + 1 ] = y;\n\t\t\tthis.data.array[ index + 2 ] = z;\n\t\t\tthis.data.array[ index + 3 ] = w;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author benaadams / https://twitter.com/ben_a_adams\n\t */\n\n\tfunction InterleavedBuffer( array, stride ) {\n\n\t\tthis.uuid = _Math.generateUUID();\n\n\t\tthis.array = array;\n\t\tthis.stride = stride;\n\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\n\t\tthis.dynamic = false;\n\t\tthis.updateRange = { offset: 0, count: - 1 };\n\n\t\tthis.version = 0;\n\n\t}\n\n\tInterleavedBuffer.prototype = {\n\n\t\tconstructor: InterleavedBuffer,\n\n\t\tisInterleavedBuffer: true,\n\n\t\tset needsUpdate( value ) {\n\n\t\t\tif ( value === true ) this.version ++;\n\n\t\t},\n\n\t\tsetArray: function ( array ) {\n\n\t\t\tif ( Array.isArray( array ) ) {\n\n\t\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t\t}\n\n\t\t\tthis.count = array !== undefined ? array.length / this.stride : 0;\n\t\t\tthis.array = array;\n\n\t\t},\n\n\t\tsetDynamic: function ( value ) {\n\n\t\t\tthis.dynamic = value;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopy: function ( source ) {\n\n\t\t\tthis.array = new source.array.constructor( source.array );\n\t\t\tthis.count = source.count;\n\t\t\tthis.stride = source.stride;\n\t\t\tthis.dynamic = source.dynamic;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tcopyAt: function ( index1, attribute, index2 ) {\n\n\t\t\tindex1 *= this.stride;\n\t\t\tindex2 *= attribute.stride;\n\n\t\t\tfor ( var i = 0, l = this.stride; i < l; i ++ ) {\n\n\t\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tset: function ( value, offset ) {\n\n\t\t\tif ( offset === undefined ) offset = 0;\n\n\t\t\tthis.array.set( value, offset );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author benaadams / https://twitter.com/ben_a_adams\n\t */\n\n\tfunction InstancedInterleavedBuffer( array, stride, meshPerAttribute ) {\n\n\t\tInterleavedBuffer.call( this, array, stride );\n\n\t\tthis.meshPerAttribute = meshPerAttribute || 1;\n\n\t}\n\n\tInstancedInterleavedBuffer.prototype = Object.create( InterleavedBuffer.prototype );\n\tInstancedInterleavedBuffer.prototype.constructor = InstancedInterleavedBuffer;\n\n\tInstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;\n\n\tInstancedInterleavedBuffer.prototype.copy = function ( source ) {\n\n\t\tInterleavedBuffer.prototype.copy.call( this, source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author benaadams / https://twitter.com/ben_a_adams\n\t */\n\n\tfunction InstancedBufferAttribute( array, itemSize, meshPerAttribute ) {\n\n\t\tBufferAttribute.call( this, array, itemSize );\n\n\t\tthis.meshPerAttribute = meshPerAttribute || 1;\n\n\t}\n\n\tInstancedBufferAttribute.prototype = Object.create( BufferAttribute.prototype );\n\tInstancedBufferAttribute.prototype.constructor = InstancedBufferAttribute;\n\n\tInstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;\n\n\tInstancedBufferAttribute.prototype.copy = function ( source ) {\n\n\t\tBufferAttribute.prototype.copy.call( this, source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author bhouston / http://clara.io/\n\t * @author stephomi / http://stephaneginier.com/\n\t */\n\n\tfunction Raycaster( origin, direction, near, far ) {\n\n\t\tthis.ray = new Ray( origin, direction );\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.near = near || 0;\n\t\tthis.far = far || Infinity;\n\n\t\tthis.params = {\n\t\t\tMesh: {},\n\t\t\tLine: {},\n\t\t\tLOD: {},\n\t\t\tPoints: { threshold: 1 },\n\t\t\tSprite: {}\n\t\t};\n\n\t\tObject.defineProperties( this.params, {\n\t\t\tPointCloud: {\n\t\t\t\tget: function () {\n\t\t\t\t\tconsole.warn( 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.' );\n\t\t\t\t\treturn this.Points;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t}\n\n\tfunction ascSort( a, b ) {\n\n\t\treturn a.distance - b.distance;\n\n\t}\n\n\tfunction intersectObject( object, raycaster, intersects, recursive ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tobject.raycast( raycaster, intersects );\n\n\t\tif ( recursive === true ) {\n\n\t\t\tvar children = object.children;\n\n\t\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tintersectObject( children[ i ], raycaster, intersects, true );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//\n\n\tRaycaster.prototype = {\n\n\t\tconstructor: Raycaster,\n\n\t\tlinePrecision: 1,\n\n\t\tset: function ( origin, direction ) {\n\n\t\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\t\tthis.ray.set( origin, direction );\n\n\t\t},\n\n\t\tsetFromCamera: function ( coords, camera ) {\n\n\t\t\tif ( (camera && camera.isPerspectiveCamera) ) {\n\n\t\t\t\tthis.ray.origin.setFromMatrixPosition( camera.matrixWorld );\n\t\t\t\tthis.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();\n\n\t\t\t} else if ( (camera && camera.isOrthographicCamera) ) {\n\n\t\t\t\tthis.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera\n\t\t\t\tthis.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.Raycaster: Unsupported camera type.' );\n\n\t\t\t}\n\n\t\t},\n\n\t\tintersectObject: function ( object, recursive ) {\n\n\t\t\tvar intersects = [];\n\n\t\t\tintersectObject( object, this, intersects, recursive );\n\n\t\t\tintersects.sort( ascSort );\n\n\t\t\treturn intersects;\n\n\t\t},\n\n\t\tintersectObjects: function ( objects, recursive ) {\n\n\t\t\tvar intersects = [];\n\n\t\t\tif ( Array.isArray( objects ) === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.' );\n\t\t\t\treturn intersects;\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0, l = objects.length; i < l; i ++ ) {\n\n\t\t\t\tintersectObject( objects[ i ], this, intersects, recursive );\n\n\t\t\t}\n\n\t\t\tintersects.sort( ascSort );\n\n\t\t\treturn intersects;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Clock( autoStart ) {\n\n\t\tthis.autoStart = ( autoStart !== undefined ) ? autoStart : true;\n\n\t\tthis.startTime = 0;\n\t\tthis.oldTime = 0;\n\t\tthis.elapsedTime = 0;\n\n\t\tthis.running = false;\n\n\t}\n\n\tClock.prototype = {\n\n\t\tconstructor: Clock,\n\n\t\tstart: function () {\n\n\t\t\tthis.startTime = ( performance || Date ).now();\n\n\t\t\tthis.oldTime = this.startTime;\n\t\t\tthis.elapsedTime = 0;\n\t\t\tthis.running = true;\n\n\t\t},\n\n\t\tstop: function () {\n\n\t\t\tthis.getElapsedTime();\n\t\t\tthis.running = false;\n\n\t\t},\n\n\t\tgetElapsedTime: function () {\n\n\t\t\tthis.getDelta();\n\t\t\treturn this.elapsedTime;\n\n\t\t},\n\n\t\tgetDelta: function () {\n\n\t\t\tvar diff = 0;\n\n\t\t\tif ( this.autoStart && ! this.running ) {\n\n\t\t\t\tthis.start();\n\n\t\t\t}\n\n\t\t\tif ( this.running ) {\n\n\t\t\t\tvar newTime = ( performance || Date ).now();\n\n\t\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\t\tthis.oldTime = newTime;\n\n\t\t\t\tthis.elapsedTime += diff;\n\n\t\t\t}\n\n\t\t\treturn diff;\n\n\t\t}\n\n\t};\n\n\t/**\n\t * Spline from Tween.js, slightly optimized (and trashed)\n\t * http://sole.github.com/tween.js/examples/05_spline.html\n\t *\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction Spline( points ) {\n\n\t\tthis.points = points;\n\n\t\tvar c = [], v3 = { x: 0, y: 0, z: 0 },\n\t\tpoint, intPoint, weight, w2, w3,\n\t\tpa, pb, pc, pd;\n\n\t\tthis.initFromArray = function ( a ) {\n\n\t\t\tthis.points = [];\n\n\t\t\tfor ( var i = 0; i < a.length; i ++ ) {\n\n\t\t\t\tthis.points[ i ] = { x: a[ i ][ 0 ], y: a[ i ][ 1 ], z: a[ i ][ 2 ] };\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getPoint = function ( k ) {\n\n\t\t\tpoint = ( this.points.length - 1 ) * k;\n\t\t\tintPoint = Math.floor( point );\n\t\t\tweight = point - intPoint;\n\n\t\t\tc[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1;\n\t\t\tc[ 1 ] = intPoint;\n\t\t\tc[ 2 ] = intPoint > this.points.length - 2 ? this.points.length - 1 : intPoint + 1;\n\t\t\tc[ 3 ] = intPoint > this.points.length - 3 ? this.points.length - 1 : intPoint + 2;\n\n\t\t\tpa = this.points[ c[ 0 ] ];\n\t\t\tpb = this.points[ c[ 1 ] ];\n\t\t\tpc = this.points[ c[ 2 ] ];\n\t\t\tpd = this.points[ c[ 3 ] ];\n\n\t\t\tw2 = weight * weight;\n\t\t\tw3 = weight * w2;\n\n\t\t\tv3.x = interpolate( pa.x, pb.x, pc.x, pd.x, weight, w2, w3 );\n\t\t\tv3.y = interpolate( pa.y, pb.y, pc.y, pd.y, weight, w2, w3 );\n\t\t\tv3.z = interpolate( pa.z, pb.z, pc.z, pd.z, weight, w2, w3 );\n\n\t\t\treturn v3;\n\n\t\t};\n\n\t\tthis.getControlPointsArray = function () {\n\n\t\t\tvar i, p, l = this.points.length,\n\t\t\t\tcoords = [];\n\n\t\t\tfor ( i = 0; i < l; i ++ ) {\n\n\t\t\t\tp = this.points[ i ];\n\t\t\t\tcoords[ i ] = [ p.x, p.y, p.z ];\n\n\t\t\t}\n\n\t\t\treturn coords;\n\n\t\t};\n\n\t\t// approximate length by summing linear segments\n\n\t\tthis.getLength = function ( nSubDivisions ) {\n\n\t\t\tvar i, index, nSamples, position,\n\t\t\t\tpoint = 0, intPoint = 0, oldIntPoint = 0,\n\t\t\t\toldPosition = new Vector3(),\n\t\t\t\ttmpVec = new Vector3(),\n\t\t\t\tchunkLengths = [],\n\t\t\t\ttotalLength = 0;\n\n\t\t\t// first point has 0 length\n\n\t\t\tchunkLengths[ 0 ] = 0;\n\n\t\t\tif ( ! nSubDivisions ) nSubDivisions = 100;\n\n\t\t\tnSamples = this.points.length * nSubDivisions;\n\n\t\t\toldPosition.copy( this.points[ 0 ] );\n\n\t\t\tfor ( i = 1; i < nSamples; i ++ ) {\n\n\t\t\t\tindex = i / nSamples;\n\n\t\t\t\tposition = this.getPoint( index );\n\t\t\t\ttmpVec.copy( position );\n\n\t\t\t\ttotalLength += tmpVec.distanceTo( oldPosition );\n\n\t\t\t\toldPosition.copy( position );\n\n\t\t\t\tpoint = ( this.points.length - 1 ) * index;\n\t\t\t\tintPoint = Math.floor( point );\n\n\t\t\t\tif ( intPoint !== oldIntPoint ) {\n\n\t\t\t\t\tchunkLengths[ intPoint ] = totalLength;\n\t\t\t\t\toldIntPoint = intPoint;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// last point ends with total length\n\n\t\t\tchunkLengths[ chunkLengths.length ] = totalLength;\n\n\t\t\treturn { chunks: chunkLengths, total: totalLength };\n\n\t\t};\n\n\t\tthis.reparametrizeByArcLength = function ( samplingCoef ) {\n\n\t\t\tvar i, j,\n\t\t\t\tindex, indexCurrent, indexNext,\n\t\t\t\trealDistance,\n\t\t\t\tsampling, position,\n\t\t\t\tnewpoints = [],\n\t\t\t\ttmpVec = new Vector3(),\n\t\t\t\tsl = this.getLength();\n\n\t\t\tnewpoints.push( tmpVec.copy( this.points[ 0 ] ).clone() );\n\n\t\t\tfor ( i = 1; i < this.points.length; i ++ ) {\n\n\t\t\t\t//tmpVec.copy( this.points[ i - 1 ] );\n\t\t\t\t//linearDistance = tmpVec.distanceTo( this.points[ i ] );\n\n\t\t\t\trealDistance = sl.chunks[ i ] - sl.chunks[ i - 1 ];\n\n\t\t\t\tsampling = Math.ceil( samplingCoef * realDistance / sl.total );\n\n\t\t\t\tindexCurrent = ( i - 1 ) / ( this.points.length - 1 );\n\t\t\t\tindexNext = i / ( this.points.length - 1 );\n\n\t\t\t\tfor ( j = 1; j < sampling - 1; j ++ ) {\n\n\t\t\t\t\tindex = indexCurrent + j * ( 1 / sampling ) * ( indexNext - indexCurrent );\n\n\t\t\t\t\tposition = this.getPoint( index );\n\t\t\t\t\tnewpoints.push( tmpVec.copy( position ).clone() );\n\n\t\t\t\t}\n\n\t\t\t\tnewpoints.push( tmpVec.copy( this.points[ i ] ).clone() );\n\n\t\t\t}\n\n\t\t\tthis.points = newpoints;\n\n\t\t};\n\n\t\t// Catmull-Rom\n\n\t\tfunction interpolate( p0, p1, p2, p3, t, t2, t3 ) {\n\n\t\t\tvar v0 = ( p2 - p0 ) * 0.5,\n\t\t\t\tv1 = ( p3 - p1 ) * 0.5;\n\n\t\t\treturn ( 2 * ( p1 - p2 ) + v0 + v1 ) * t3 + ( - 3 * ( p1 - p2 ) - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * @author bhouston / http://clara.io\n\t * @author WestLangley / http://github.com/WestLangley\n\t *\n\t * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n\t *\n\t * The poles (phi) are at the positive and negative y axis.\n\t * The equator starts at positive z.\n\t */\n\n\tfunction Spherical( radius, phi, theta ) {\n\n\t\tthis.radius = ( radius !== undefined ) ? radius : 1.0;\n\t\tthis.phi = ( phi !== undefined ) ? phi : 0; // up / down towards top and bottom pole\n\t\tthis.theta = ( theta !== undefined ) ? theta : 0; // around the equator of the sphere\n\n\t\treturn this;\n\n\t}\n\n\tSpherical.prototype = {\n\n\t\tconstructor: Spherical,\n\n\t\tset: function ( radius, phi, theta ) {\n\n\t\t\tthis.radius = radius;\n\t\t\tthis.phi = phi;\n\t\t\tthis.theta = theta;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tclone: function () {\n\n\t\t\treturn new this.constructor().copy( this );\n\n\t\t},\n\n\t\tcopy: function ( other ) {\n\n\t\t\tthis.radius = other.radius;\n\t\t\tthis.phi = other.phi;\n\t\t\tthis.theta = other.theta;\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\tmakeSafe: function() {\n\n\t\t\tvar EPS = 0.000001;\n\t\t\tthis.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );\n\n\t\t\treturn this;\n\n\t\t},\n\n\t\tsetFromVector3: function( vec3 ) {\n\n\t\t\tthis.radius = vec3.length();\n\n\t\t\tif ( this.radius === 0 ) {\n\n\t\t\t\tthis.theta = 0;\n\t\t\t\tthis.phi = 0;\n\n\t\t\t} else {\n\n\t\t\t\tthis.theta = Math.atan2( vec3.x, vec3.z ); // equator angle around y-up axis\n\t\t\t\tthis.phi = Math.acos( _Math.clamp( vec3.y / this.radius, - 1, 1 ) ); // polar angle\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t},\n\n\t};\n\n\t/**\r\n\t * @author alteredq / http://alteredqualia.com/\r\n\t */\r\n\r\n\tfunction MorphBlendMesh( geometry, material ) {\n\r\n\t\tMesh.call( this, geometry, material );\r\n\r\n\t\tthis.animationsMap = {};\r\n\t\tthis.animationsList = [];\r\n\r\n\t\t// prepare default animation\r\n\t\t// (all frames played together in 1 second)\r\n\r\n\t\tvar numFrames = this.geometry.morphTargets.length;\r\n\r\n\t\tvar name = \"__default\";\r\n\r\n\t\tvar startFrame = 0;\r\n\t\tvar endFrame = numFrames - 1;\r\n\r\n\t\tvar fps = numFrames / 1;\r\n\r\n\t\tthis.createAnimation( name, startFrame, endFrame, fps );\r\n\t\tthis.setAnimationWeight( name, 1 );\r\n\r\n\t}\r\n\r\n\tMorphBlendMesh.prototype = Object.create( Mesh.prototype );\r\n\tMorphBlendMesh.prototype.constructor = MorphBlendMesh;\r\n\r\n\tMorphBlendMesh.prototype.createAnimation = function ( name, start, end, fps ) {\r\n\r\n\t\tvar animation = {\r\n\r\n\t\t\tstart: start,\r\n\t\t\tend: end,\r\n\r\n\t\t\tlength: end - start + 1,\r\n\r\n\t\t\tfps: fps,\r\n\t\t\tduration: ( end - start ) / fps,\r\n\r\n\t\t\tlastFrame: 0,\r\n\t\t\tcurrentFrame: 0,\r\n\r\n\t\t\tactive: false,\r\n\r\n\t\t\ttime: 0,\r\n\t\t\tdirection: 1,\r\n\t\t\tweight: 1,\r\n\r\n\t\t\tdirectionBackwards: false,\r\n\t\t\tmirroredLoop: false\r\n\r\n\t\t};\r\n\r\n\t\tthis.animationsMap[ name ] = animation;\r\n\t\tthis.animationsList.push( animation );\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.autoCreateAnimations = function ( fps ) {\r\n\r\n\t\tvar pattern = /([a-z]+)_?(\\d+)/i;\r\n\r\n\t\tvar firstAnimation, frameRanges = {};\r\n\r\n\t\tvar geometry = this.geometry;\r\n\r\n\t\tfor ( var i = 0, il = geometry.morphTargets.length; i < il; i ++ ) {\r\n\r\n\t\t\tvar morph = geometry.morphTargets[ i ];\r\n\t\t\tvar chunks = morph.name.match( pattern );\r\n\r\n\t\t\tif ( chunks && chunks.length > 1 ) {\r\n\r\n\t\t\t\tvar name = chunks[ 1 ];\r\n\r\n\t\t\t\tif ( ! frameRanges[ name ] ) frameRanges[ name ] = { start: Infinity, end: - Infinity };\r\n\r\n\t\t\t\tvar range = frameRanges[ name ];\r\n\r\n\t\t\t\tif ( i < range.start ) range.start = i;\r\n\t\t\t\tif ( i > range.end ) range.end = i;\r\n\r\n\t\t\t\tif ( ! firstAnimation ) firstAnimation = name;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tfor ( var name in frameRanges ) {\r\n\r\n\t\t\tvar range = frameRanges[ name ];\r\n\t\t\tthis.createAnimation( name, range.start, range.end, fps );\r\n\r\n\t\t}\r\n\r\n\t\tthis.firstAnimation = firstAnimation;\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.setAnimationDirectionForward = function ( name ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.direction = 1;\r\n\t\t\tanimation.directionBackwards = false;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.setAnimationDirectionBackward = function ( name ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.direction = - 1;\r\n\t\t\tanimation.directionBackwards = true;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.setAnimationFPS = function ( name, fps ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.fps = fps;\r\n\t\t\tanimation.duration = ( animation.end - animation.start ) / animation.fps;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.setAnimationDuration = function ( name, duration ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.duration = duration;\r\n\t\t\tanimation.fps = ( animation.end - animation.start ) / animation.duration;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.setAnimationWeight = function ( name, weight ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.weight = weight;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.setAnimationTime = function ( name, time ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.time = time;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.getAnimationTime = function ( name ) {\r\n\r\n\t\tvar time = 0;\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\ttime = animation.time;\r\n\r\n\t\t}\r\n\r\n\t\treturn time;\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.getAnimationDuration = function ( name ) {\r\n\r\n\t\tvar duration = - 1;\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tduration = animation.duration;\r\n\r\n\t\t}\r\n\r\n\t\treturn duration;\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.playAnimation = function ( name ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.time = 0;\r\n\t\t\tanimation.active = true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconsole.warn( \"THREE.MorphBlendMesh: animation[\" + name + \"] undefined in .playAnimation()\" );\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.stopAnimation = function ( name ) {\r\n\r\n\t\tvar animation = this.animationsMap[ name ];\r\n\r\n\t\tif ( animation ) {\r\n\r\n\t\t\tanimation.active = false;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tMorphBlendMesh.prototype.update = function ( delta ) {\r\n\r\n\t\tfor ( var i = 0, il = this.animationsList.length; i < il; i ++ ) {\r\n\r\n\t\t\tvar animation = this.animationsList[ i ];\r\n\r\n\t\t\tif ( ! animation.active ) continue;\r\n\r\n\t\t\tvar frameTime = animation.duration / animation.length;\r\n\r\n\t\t\tanimation.time += animation.direction * delta;\r\n\r\n\t\t\tif ( animation.mirroredLoop ) {\r\n\r\n\t\t\t\tif ( animation.time > animation.duration || animation.time < 0 ) {\r\n\r\n\t\t\t\t\tanimation.direction *= - 1;\r\n\r\n\t\t\t\t\tif ( animation.time > animation.duration ) {\r\n\r\n\t\t\t\t\t\tanimation.time = animation.duration;\r\n\t\t\t\t\t\tanimation.directionBackwards = true;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( animation.time < 0 ) {\r\n\r\n\t\t\t\t\t\tanimation.time = 0;\r\n\t\t\t\t\t\tanimation.directionBackwards = false;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tanimation.time = animation.time % animation.duration;\r\n\r\n\t\t\t\tif ( animation.time < 0 ) animation.time += animation.duration;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar keyframe = animation.start + _Math.clamp( Math.floor( animation.time / frameTime ), 0, animation.length - 1 );\r\n\t\t\tvar weight = animation.weight;\r\n\r\n\t\t\tif ( keyframe !== animation.currentFrame ) {\r\n\r\n\t\t\t\tthis.morphTargetInfluences[ animation.lastFrame ] = 0;\r\n\t\t\t\tthis.morphTargetInfluences[ animation.currentFrame ] = 1 * weight;\r\n\r\n\t\t\t\tthis.morphTargetInfluences[ keyframe ] = 0;\r\n\r\n\t\t\t\tanimation.lastFrame = animation.currentFrame;\r\n\t\t\t\tanimation.currentFrame = keyframe;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar mix = ( animation.time % frameTime ) / frameTime;\r\n\r\n\t\t\tif ( animation.directionBackwards ) mix = 1 - mix;\r\n\r\n\t\t\tif ( animation.currentFrame !== animation.lastFrame ) {\r\n\r\n\t\t\t\tthis.morphTargetInfluences[ animation.currentFrame ] = mix * weight;\r\n\t\t\t\tthis.morphTargetInfluences[ animation.lastFrame ] = ( 1 - mix ) * weight;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tthis.morphTargetInfluences[ animation.currentFrame ] = weight;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tfunction ImmediateRenderObject( material ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.material = material;\n\t\tthis.render = function ( renderCallback ) {};\n\n\t}\n\n\tImmediateRenderObject.prototype = Object.create( Object3D.prototype );\n\tImmediateRenderObject.prototype.constructor = ImmediateRenderObject;\n\n\tImmediateRenderObject.prototype.isImmediateRenderObject = true;\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t*/\n\n\tfunction VertexNormalsHelper( object, size, hex, linewidth ) {\n\n\t\tthis.object = object;\n\n\t\tthis.size = ( size !== undefined ) ? size : 1;\n\n\t\tvar color = ( hex !== undefined ) ? hex : 0xff0000;\n\n\t\tvar width = ( linewidth !== undefined ) ? linewidth : 1;\n\n\t\t//\n\n\t\tvar nNormals = 0;\n\n\t\tvar objGeometry = this.object.geometry;\n\n\t\tif ( (objGeometry && objGeometry.isGeometry) ) {\n\n\t\t\tnNormals = objGeometry.faces.length * 3;\n\n\t\t} else if ( (objGeometry && objGeometry.isBufferGeometry) ) {\n\n\t\t\tnNormals = objGeometry.attributes.normal.count;\n\n\t\t}\n\n\t\t//\n\n\t\tvar geometry = new BufferGeometry();\n\n\t\tvar positions = new Float32Attribute( nNormals * 2 * 3, 3 );\n\n\t\tgeometry.addAttribute( 'position', positions );\n\n\t\tLineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) );\n\n\t\t//\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\tVertexNormalsHelper.prototype = Object.create( LineSegments.prototype );\n\tVertexNormalsHelper.prototype.constructor = VertexNormalsHelper;\n\n\tVertexNormalsHelper.prototype.update = ( function () {\n\n\t\tvar v1 = new Vector3();\n\t\tvar v2 = new Vector3();\n\t\tvar normalMatrix = new Matrix3();\n\n\t\treturn function update() {\n\n\t\t\tvar keys = [ 'a', 'b', 'c' ];\n\n\t\t\tthis.object.updateMatrixWorld( true );\n\n\t\t\tnormalMatrix.getNormalMatrix( this.object.matrixWorld );\n\n\t\t\tvar matrixWorld = this.object.matrixWorld;\n\n\t\t\tvar position = this.geometry.attributes.position;\n\n\t\t\t//\n\n\t\t\tvar objGeometry = this.object.geometry;\n\n\t\t\tif ( (objGeometry && objGeometry.isGeometry) ) {\n\n\t\t\t\tvar vertices = objGeometry.vertices;\n\n\t\t\t\tvar faces = objGeometry.faces;\n\n\t\t\t\tvar idx = 0;\n\n\t\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\t\tfor ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tvar vertex = vertices[ face[ keys[ j ] ] ];\n\n\t\t\t\t\t\tvar normal = face.vertexNormals[ j ];\n\n\t\t\t\t\t\tv1.copy( vertex ).applyMatrix4( matrixWorld );\n\n\t\t\t\t\t\tv2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );\n\n\t\t\t\t\t\tposition.setXYZ( idx, v1.x, v1.y, v1.z );\n\n\t\t\t\t\t\tidx = idx + 1;\n\n\t\t\t\t\t\tposition.setXYZ( idx, v2.x, v2.y, v2.z );\n\n\t\t\t\t\t\tidx = idx + 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( (objGeometry && objGeometry.isBufferGeometry) ) {\n\n\t\t\t\tvar objPos = objGeometry.attributes.position;\n\n\t\t\t\tvar objNorm = objGeometry.attributes.normal;\n\n\t\t\t\tvar idx = 0;\n\n\t\t\t\t// for simplicity, ignore index and drawcalls, and render every normal\n\n\t\t\t\tfor ( var j = 0, jl = objPos.count; j < jl; j ++ ) {\n\n\t\t\t\t\tv1.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld );\n\n\t\t\t\t\tv2.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) );\n\n\t\t\t\t\tv2.applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );\n\n\t\t\t\t\tposition.setXYZ( idx, v1.x, v1.y, v1.z );\n\n\t\t\t\t\tidx = idx + 1;\n\n\t\t\t\t\tposition.setXYZ( idx, v2.x, v2.y, v2.z );\n\n\t\t\t\t\tidx = idx + 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t*/\n\n\tfunction SpotLightHelper( light ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tvar geometry = new BufferGeometry();\n\n\t\tvar positions = [\n\t\t\t0, 0, 0, 0, 0, 1,\n\t\t\t0, 0, 0, 1, 0, 1,\n\t\t\t0, 0, 0, - 1, 0, 1,\n\t\t\t0, 0, 0, 0, 1, 1,\n\t\t\t0, 0, 0, 0, - 1, 1\n\t\t];\n\n\t\tfor ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) {\n\n\t\t\tvar p1 = ( i / l ) * Math.PI * 2;\n\t\t\tvar p2 = ( j / l ) * Math.PI * 2;\n\n\t\t\tpositions.push(\n\t\t\t\tMath.cos( p1 ), Math.sin( p1 ), 1,\n\t\t\t\tMath.cos( p2 ), Math.sin( p2 ), 1\n\t\t\t);\n\n\t\t}\n\n\t\tgeometry.addAttribute( 'position', new Float32Attribute( positions, 3 ) );\n\n\t\tvar material = new LineBasicMaterial( { fog: false } );\n\n\t\tthis.cone = new LineSegments( geometry, material );\n\t\tthis.add( this.cone );\n\n\t\tthis.update();\n\n\t}\n\n\tSpotLightHelper.prototype = Object.create( Object3D.prototype );\n\tSpotLightHelper.prototype.constructor = SpotLightHelper;\n\n\tSpotLightHelper.prototype.dispose = function () {\n\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t};\n\n\tSpotLightHelper.prototype.update = function () {\n\n\t\tvar vector = new Vector3();\n\t\tvar vector2 = new Vector3();\n\n\t\treturn function update() {\n\n\t\t\tvar coneLength = this.light.distance ? this.light.distance : 1000;\n\t\t\tvar coneWidth = coneLength * Math.tan( this.light.angle );\n\n\t\t\tthis.cone.scale.set( coneWidth, coneWidth, coneLength );\n\n\t\t\tvector.setFromMatrixPosition( this.light.matrixWorld );\n\t\t\tvector2.setFromMatrixPosition( this.light.target.matrixWorld );\n\n\t\t\tthis.cone.lookAt( vector2.sub( vector ) );\n\n\t\t\tthis.cone.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );\n\n\t\t};\n\n\t}();\n\n\t/**\n\t * @author Sean Griffin / http://twitter.com/sgrif\n\t * @author Michael Guerrero / http://realitymeltdown.com\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author ikerr / http://verold.com\n\t */\n\n\tfunction SkeletonHelper( object ) {\n\n\t\tthis.bones = this.getBoneList( object );\n\n\t\tvar geometry = new Geometry();\n\n\t\tfor ( var i = 0; i < this.bones.length; i ++ ) {\n\n\t\t\tvar bone = this.bones[ i ];\n\n\t\t\tif ( (bone.parent && bone.parent.isBone) ) {\n\n\t\t\t\tgeometry.vertices.push( new Vector3() );\n\t\t\t\tgeometry.vertices.push( new Vector3() );\n\t\t\t\tgeometry.colors.push( new Color( 0, 0, 1 ) );\n\t\t\t\tgeometry.colors.push( new Color( 0, 1, 0 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.dynamic = true;\n\n\t\tvar material = new LineBasicMaterial( { vertexColors: VertexColors, depthTest: false, depthWrite: false, transparent: true } );\n\n\t\tLineSegments.call( this, geometry, material );\n\n\t\tthis.root = object;\n\n\t\tthis.matrix = object.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\n\tSkeletonHelper.prototype = Object.create( LineSegments.prototype );\n\tSkeletonHelper.prototype.constructor = SkeletonHelper;\n\n\tSkeletonHelper.prototype.getBoneList = function( object ) {\n\n\t\tvar boneList = [];\n\n\t\tif ( (object && object.isBone) ) {\n\n\t\t\tboneList.push( object );\n\n\t\t}\n\n\t\tfor ( var i = 0; i < object.children.length; i ++ ) {\n\n\t\t\tboneList.push.apply( boneList, this.getBoneList( object.children[ i ] ) );\n\n\t\t}\n\n\t\treturn boneList;\n\n\t};\n\n\tSkeletonHelper.prototype.update = function () {\n\n\t\tvar geometry = this.geometry;\n\n\t\tvar matrixWorldInv = new Matrix4().getInverse( this.root.matrixWorld );\n\n\t\tvar boneMatrix = new Matrix4();\n\n\t\tvar j = 0;\n\n\t\tfor ( var i = 0; i < this.bones.length; i ++ ) {\n\n\t\t\tvar bone = this.bones[ i ];\n\n\t\t\tif ( (bone.parent && bone.parent.isBone) ) {\n\n\t\t\t\tboneMatrix.multiplyMatrices( matrixWorldInv, bone.matrixWorld );\n\t\t\t\tgeometry.vertices[ j ].setFromMatrixPosition( boneMatrix );\n\n\t\t\t\tboneMatrix.multiplyMatrices( matrixWorldInv, bone.parent.matrixWorld );\n\t\t\t\tgeometry.vertices[ j + 1 ].setFromMatrixPosition( boneMatrix );\n\n\t\t\t\tj += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.verticesNeedUpdate = true;\n\n\t\tgeometry.computeBoundingSphere();\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction PointLightHelper( light, sphereSize ) {\n\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tvar geometry = new SphereBufferGeometry( sphereSize, 4, 2 );\n\t\tvar material = new MeshBasicMaterial( { wireframe: true, fog: false } );\n\t\tmaterial.color.copy( this.light.color ).multiplyScalar( this.light.intensity );\n\n\t\tMesh.call( this, geometry, material );\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/*\n\t\tvar distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );\n\t\tvar distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\n\t\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\t\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\n\t\tvar d = light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\n\t\tthis.add( this.lightDistance );\n\t\t*/\n\n\t}\n\n\tPointLightHelper.prototype = Object.create( Mesh.prototype );\n\tPointLightHelper.prototype.constructor = PointLightHelper;\n\n\tPointLightHelper.prototype.dispose = function () {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t};\n\n\tPointLightHelper.prototype.update = function () {\n\n\t\tthis.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );\n\n\t\t/*\n\t\tvar d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t};\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction HemisphereLightHelper( light, sphereSize ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.colors = [ new Color(), new Color() ];\n\n\t\tvar geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tgeometry.rotateX( - Math.PI / 2 );\n\n\t\tfor ( var i = 0, il = 8; i < il; i ++ ) {\n\n\t\t\tgeometry.faces[ i ].color = this.colors[ i < 4 ? 0 : 1 ];\n\n\t\t}\n\n\t\tvar material = new MeshBasicMaterial( { vertexColors: FaceColors, wireframe: true } );\n\n\t\tthis.lightSphere = new Mesh( geometry, material );\n\t\tthis.add( this.lightSphere );\n\n\t\tthis.update();\n\n\t}\n\n\tHemisphereLightHelper.prototype = Object.create( Object3D.prototype );\n\tHemisphereLightHelper.prototype.constructor = HemisphereLightHelper;\n\n\tHemisphereLightHelper.prototype.dispose = function () {\n\n\t\tthis.lightSphere.geometry.dispose();\n\t\tthis.lightSphere.material.dispose();\n\n\t};\n\n\tHemisphereLightHelper.prototype.update = function () {\n\n\t\tvar vector = new Vector3();\n\n\t\treturn function update() {\n\n\t\t\tthis.colors[ 0 ].copy( this.light.color ).multiplyScalar( this.light.intensity );\n\t\t\tthis.colors[ 1 ].copy( this.light.groundColor ).multiplyScalar( this.light.intensity );\n\n\t\t\tthis.lightSphere.lookAt( vector.setFromMatrixPosition( this.light.matrixWorld ).negate() );\n\t\t\tthis.lightSphere.geometry.colorsNeedUpdate = true;\n\n\t\t};\n\n\t}();\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction GridHelper( size, divisions, color1, color2 ) {\n\n\t\tdivisions = divisions || 1;\n\t\tcolor1 = new Color( color1 !== undefined ? color1 : 0x444444 );\n\t\tcolor2 = new Color( color2 !== undefined ? color2 : 0x888888 );\n\n\t\tvar center = divisions / 2;\n\t\tvar step = ( size * 2 ) / divisions;\n\t\tvar vertices = [], colors = [];\n\n\t\tfor ( var i = 0, j = 0, k = - size; i <= divisions; i ++, k += step ) {\n\n\t\t\tvertices.push( - size, 0, k, size, 0, k );\n\t\t\tvertices.push( k, 0, - size, k, 0, size );\n\n\t\t\tvar color = i === center ? color1 : color2;\n\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\n\t\t}\n\n\t\tvar geometry = new BufferGeometry();\n\t\tgeometry.addAttribute( 'position', new Float32Attribute( vertices, 3 ) );\n\t\tgeometry.addAttribute( 'color', new Float32Attribute( colors, 3 ) );\n\n\t\tvar material = new LineBasicMaterial( { vertexColors: VertexColors } );\n\n\t\tLineSegments.call( this, geometry, material );\n\n\t}\n\n\tGridHelper.prototype = Object.create( LineSegments.prototype );\n\tGridHelper.prototype.constructor = GridHelper;\n\n\tGridHelper.prototype.setColors = function () {\n\n\t\tconsole.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' );\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t*/\n\n\tfunction FaceNormalsHelper( object, size, hex, linewidth ) {\n\n\t\t// FaceNormalsHelper only supports THREE.Geometry\n\n\t\tthis.object = object;\n\n\t\tthis.size = ( size !== undefined ) ? size : 1;\n\n\t\tvar color = ( hex !== undefined ) ? hex : 0xffff00;\n\n\t\tvar width = ( linewidth !== undefined ) ? linewidth : 1;\n\n\t\t//\n\n\t\tvar nNormals = 0;\n\n\t\tvar objGeometry = this.object.geometry;\n\n\t\tif ( (objGeometry && objGeometry.isGeometry) ) {\n\n\t\t\tnNormals = objGeometry.faces.length;\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.' );\n\n\t\t}\n\n\t\t//\n\n\t\tvar geometry = new BufferGeometry();\n\n\t\tvar positions = new Float32Attribute( nNormals * 2 * 3, 3 );\n\n\t\tgeometry.addAttribute( 'position', positions );\n\n\t\tLineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) );\n\n\t\t//\n\n\t\tthis.matrixAutoUpdate = false;\n\t\tthis.update();\n\n\t}\n\n\tFaceNormalsHelper.prototype = Object.create( LineSegments.prototype );\n\tFaceNormalsHelper.prototype.constructor = FaceNormalsHelper;\n\n\tFaceNormalsHelper.prototype.update = ( function () {\n\n\t\tvar v1 = new Vector3();\n\t\tvar v2 = new Vector3();\n\t\tvar normalMatrix = new Matrix3();\n\n\t\treturn function update() {\n\n\t\t\tthis.object.updateMatrixWorld( true );\n\n\t\t\tnormalMatrix.getNormalMatrix( this.object.matrixWorld );\n\n\t\t\tvar matrixWorld = this.object.matrixWorld;\n\n\t\t\tvar position = this.geometry.attributes.position;\n\n\t\t\t//\n\n\t\t\tvar objGeometry = this.object.geometry;\n\n\t\t\tvar vertices = objGeometry.vertices;\n\n\t\t\tvar faces = objGeometry.faces;\n\n\t\t\tvar idx = 0;\n\n\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\tvar normal = face.normal;\n\n\t\t\t\tv1.copy( vertices[ face.a ] )\n\t\t\t\t\t.add( vertices[ face.b ] )\n\t\t\t\t\t.add( vertices[ face.c ] )\n\t\t\t\t\t.divideScalar( 3 )\n\t\t\t\t\t.applyMatrix4( matrixWorld );\n\n\t\t\t\tv2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );\n\n\t\t\t\tposition.setXYZ( idx, v1.x, v1.y, v1.z );\n\n\t\t\t\tidx = idx + 1;\n\n\t\t\t\tposition.setXYZ( idx, v2.x, v2.y, v2.z );\n\n\t\t\t\tidx = idx + 1;\n\n\t\t\t}\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}() );\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\n\tfunction DirectionalLightHelper( light, size ) {\n\n\t\tObject3D.call( this );\n\n\t\tthis.light = light;\n\t\tthis.light.updateMatrixWorld();\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tif ( size === undefined ) size = 1;\n\n\t\tvar geometry = new BufferGeometry();\n\t\tgeometry.addAttribute( 'position', new Float32Attribute( [\n\t\t\t- size, size, 0,\n\t\t\t size, size, 0,\n\t\t\t size, - size, 0,\n\t\t\t- size, - size, 0,\n\t\t\t- size, size, 0\n\t\t], 3 ) );\n\n\t\tvar material = new LineBasicMaterial( { fog: false } );\n\n\t\tthis.add( new Line( geometry, material ) );\n\n\t\tgeometry = new BufferGeometry();\n\t\tgeometry.addAttribute( 'position', new Float32Attribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );\n\n\t\tthis.add( new Line( geometry, material ));\n\n\t\tthis.update();\n\n\t}\n\n\tDirectionalLightHelper.prototype = Object.create( Object3D.prototype );\n\tDirectionalLightHelper.prototype.constructor = DirectionalLightHelper;\n\n\tDirectionalLightHelper.prototype.dispose = function () {\n\n\t\tvar lightPlane = this.children[ 0 ];\n\t\tvar targetLine = this.children[ 1 ];\n\n\t\tlightPlane.geometry.dispose();\n\t\tlightPlane.material.dispose();\n\t\ttargetLine.geometry.dispose();\n\t\ttargetLine.material.dispose();\n\n\t};\n\n\tDirectionalLightHelper.prototype.update = function () {\n\n\t\tvar v1 = new Vector3();\n\t\tvar v2 = new Vector3();\n\t\tvar v3 = new Vector3();\n\n\t\treturn function update() {\n\n\t\t\tv1.setFromMatrixPosition( this.light.matrixWorld );\n\t\t\tv2.setFromMatrixPosition( this.light.target.matrixWorld );\n\t\t\tv3.subVectors( v2, v1 );\n\n\t\t\tvar lightPlane = this.children[ 0 ];\n\t\t\tvar targetLine = this.children[ 1 ];\n\n\t\t\tlightPlane.lookAt( v3 );\n\t\t\tlightPlane.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );\n\n\t\t\ttargetLine.lookAt( v3 );\n\t\t\ttargetLine.scale.z = v3.length();\n\n\t\t};\n\n\t}();\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t *\n\t *\t- shows frustum, line of sight and up of the camera\n\t *\t- suitable for fast updates\n\t * \t- based on frustum visualization in lightgl.js shadowmap example\n\t *\t\thttp://evanw.github.com/lightgl.js/tests/shadowmap.html\n\t */\n\n\tfunction CameraHelper( camera ) {\n\n\t\tvar geometry = new Geometry();\n\t\tvar material = new LineBasicMaterial( { color: 0xffffff, vertexColors: FaceColors } );\n\n\t\tvar pointMap = {};\n\n\t\t// colors\n\n\t\tvar hexFrustum = 0xffaa00;\n\t\tvar hexCone = 0xff0000;\n\t\tvar hexUp = 0x00aaff;\n\t\tvar hexTarget = 0xffffff;\n\t\tvar hexCross = 0x333333;\n\n\t\t// near\n\n\t\taddLine( \"n1\", \"n2\", hexFrustum );\n\t\taddLine( \"n2\", \"n4\", hexFrustum );\n\t\taddLine( \"n4\", \"n3\", hexFrustum );\n\t\taddLine( \"n3\", \"n1\", hexFrustum );\n\n\t\t// far\n\n\t\taddLine( \"f1\", \"f2\", hexFrustum );\n\t\taddLine( \"f2\", \"f4\", hexFrustum );\n\t\taddLine( \"f4\", \"f3\", hexFrustum );\n\t\taddLine( \"f3\", \"f1\", hexFrustum );\n\n\t\t// sides\n\n\t\taddLine( \"n1\", \"f1\", hexFrustum );\n\t\taddLine( \"n2\", \"f2\", hexFrustum );\n\t\taddLine( \"n3\", \"f3\", hexFrustum );\n\t\taddLine( \"n4\", \"f4\", hexFrustum );\n\n\t\t// cone\n\n\t\taddLine( \"p\", \"n1\", hexCone );\n\t\taddLine( \"p\", \"n2\", hexCone );\n\t\taddLine( \"p\", \"n3\", hexCone );\n\t\taddLine( \"p\", \"n4\", hexCone );\n\n\t\t// up\n\n\t\taddLine( \"u1\", \"u2\", hexUp );\n\t\taddLine( \"u2\", \"u3\", hexUp );\n\t\taddLine( \"u3\", \"u1\", hexUp );\n\n\t\t// target\n\n\t\taddLine( \"c\", \"t\", hexTarget );\n\t\taddLine( \"p\", \"c\", hexCross );\n\n\t\t// cross\n\n\t\taddLine( \"cn1\", \"cn2\", hexCross );\n\t\taddLine( \"cn3\", \"cn4\", hexCross );\n\n\t\taddLine( \"cf1\", \"cf2\", hexCross );\n\t\taddLine( \"cf3\", \"cf4\", hexCross );\n\n\t\tfunction addLine( a, b, hex ) {\n\n\t\t\taddPoint( a, hex );\n\t\t\taddPoint( b, hex );\n\n\t\t}\n\n\t\tfunction addPoint( id, hex ) {\n\n\t\t\tgeometry.vertices.push( new Vector3() );\n\t\t\tgeometry.colors.push( new Color( hex ) );\n\n\t\t\tif ( pointMap[ id ] === undefined ) {\n\n\t\t\t\tpointMap[ id ] = [];\n\n\t\t\t}\n\n\t\t\tpointMap[ id ].push( geometry.vertices.length - 1 );\n\n\t\t}\n\n\t\tLineSegments.call( this, geometry, material );\n\n\t\tthis.camera = camera;\n\t\tif( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix();\n\n\t\tthis.matrix = camera.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.pointMap = pointMap;\n\n\t\tthis.update();\n\n\t}\n\n\tCameraHelper.prototype = Object.create( LineSegments.prototype );\n\tCameraHelper.prototype.constructor = CameraHelper;\n\n\tCameraHelper.prototype.update = function () {\n\n\t\tvar geometry, pointMap;\n\n\t\tvar vector = new Vector3();\n\t\tvar camera = new Camera();\n\n\t\tfunction setPoint( point, x, y, z ) {\n\n\t\t\tvector.set( x, y, z ).unproject( camera );\n\n\t\t\tvar points = pointMap[ point ];\n\n\t\t\tif ( points !== undefined ) {\n\n\t\t\t\tfor ( var i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\t\t\tgeometry.vertices[ points[ i ] ].copy( vector );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn function update() {\n\n\t\t\tgeometry = this.geometry;\n\t\t\tpointMap = this.pointMap;\n\n\t\t\tvar w = 1, h = 1;\n\n\t\t\t// we need just camera projection matrix\n\t\t\t// world matrix must be identity\n\n\t\t\tcamera.projectionMatrix.copy( this.camera.projectionMatrix );\n\n\t\t\t// center / target\n\n\t\t\tsetPoint( \"c\", 0, 0, - 1 );\n\t\t\tsetPoint( \"t\", 0, 0, 1 );\n\n\t\t\t// near\n\n\t\t\tsetPoint( \"n1\", - w, - h, - 1 );\n\t\t\tsetPoint( \"n2\", w, - h, - 1 );\n\t\t\tsetPoint( \"n3\", - w, h, - 1 );\n\t\t\tsetPoint( \"n4\", w, h, - 1 );\n\n\t\t\t// far\n\n\t\t\tsetPoint( \"f1\", - w, - h, 1 );\n\t\t\tsetPoint( \"f2\", w, - h, 1 );\n\t\t\tsetPoint( \"f3\", - w, h, 1 );\n\t\t\tsetPoint( \"f4\", w, h, 1 );\n\n\t\t\t// up\n\n\t\t\tsetPoint( \"u1\", w * 0.7, h * 1.1, - 1 );\n\t\t\tsetPoint( \"u2\", - w * 0.7, h * 1.1, - 1 );\n\t\t\tsetPoint( \"u3\", 0, h * 2, - 1 );\n\n\t\t\t// cross\n\n\t\t\tsetPoint( \"cf1\", - w, 0, 1 );\n\t\t\tsetPoint( \"cf2\", w, 0, 1 );\n\t\t\tsetPoint( \"cf3\", 0, - h, 1 );\n\t\t\tsetPoint( \"cf4\", 0, h, 1 );\n\n\t\t\tsetPoint( \"cn1\", - w, 0, - 1 );\n\t\t\tsetPoint( \"cn2\", w, 0, - 1 );\n\t\t\tsetPoint( \"cn3\", 0, - h, - 1 );\n\t\t\tsetPoint( \"cn4\", 0, h, - 1 );\n\n\t\t\tgeometry.verticesNeedUpdate = true;\n\n\t\t};\n\n\t}();\n\n\t/**\n\t * @author WestLangley / http://github.com/WestLangley\n\t */\n\n\t// a helper to show the world-axis-aligned bounding box for an object\n\n\tfunction BoundingBoxHelper( object, hex ) {\n\n\t\tvar color = ( hex !== undefined ) ? hex : 0x888888;\n\n\t\tthis.object = object;\n\n\t\tthis.box = new Box3();\n\n\t\tMesh.call( this, new BoxGeometry( 1, 1, 1 ), new MeshBasicMaterial( { color: color, wireframe: true } ) );\n\n\t}\n\n\tBoundingBoxHelper.prototype = Object.create( Mesh.prototype );\n\tBoundingBoxHelper.prototype.constructor = BoundingBoxHelper;\n\n\tBoundingBoxHelper.prototype.update = function () {\n\n\t\tthis.box.setFromObject( this.object );\n\n\t\tthis.box.getSize( this.scale );\n\n\t\tthis.box.getCenter( this.position );\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction BoxHelper( object, color ) {\n\n\t\tif ( color === undefined ) color = 0xffff00;\n\n\t\tvar indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\t\tvar positions = new Float32Array( 8 * 3 );\n\n\t\tvar geometry = new BufferGeometry();\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tgeometry.addAttribute( 'position', new BufferAttribute( positions, 3 ) );\n\n\t\tLineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) );\n\n\t\tif ( object !== undefined ) {\n\n\t\t\tthis.update( object );\n\n\t\t}\n\n\t}\n\n\tBoxHelper.prototype = Object.create( LineSegments.prototype );\n\tBoxHelper.prototype.constructor = BoxHelper;\n\n\tBoxHelper.prototype.update = ( function () {\n\n\t\tvar box = new Box3();\n\n\t\treturn function update( object ) {\n\n\t\t\tif ( (object && object.isBox3) ) {\n\n\t\t\t\tbox.copy( object );\n\n\t\t\t} else {\n\n\t\t\t\tbox.setFromObject( object );\n\n\t\t\t}\n\n\t\t\tif ( box.isEmpty() ) return;\n\n\t\t\tvar min = box.min;\n\t\t\tvar max = box.max;\n\n\t\t\t/*\n\t\t\t 5____4\n\t\t\t1/___0/|\n\t\t\t| 6__|_7\n\t\t\t2/___3/\n\n\t\t\t0: max.x, max.y, max.z\n\t\t\t1: min.x, max.y, max.z\n\t\t\t2: min.x, min.y, max.z\n\t\t\t3: max.x, min.y, max.z\n\t\t\t4: max.x, max.y, min.z\n\t\t\t5: min.x, max.y, min.z\n\t\t\t6: min.x, min.y, min.z\n\t\t\t7: max.x, min.y, min.z\n\t\t\t*/\n\n\t\t\tvar position = this.geometry.attributes.position;\n\t\t\tvar array = position.array;\n\n\t\t\tarray[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z;\n\t\t\tarray[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z;\n\t\t\tarray[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z;\n\t\t\tarray[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z;\n\t\t\tarray[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z;\n\t\t\tarray[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z;\n\t\t\tarray[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z;\n\t\t\tarray[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z;\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t\tthis.geometry.computeBoundingSphere();\n\n\t\t};\n\n\t} )();\n\n\t/**\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author zz85 / http://github.com/zz85\n\t * @author bhouston / http://clara.io\n\t *\n\t * Creates an arrow for visualizing directions\n\t *\n\t * Parameters:\n\t * dir - Vector3\n\t * origin - Vector3\n\t * length - Number\n\t * color - color in hex value\n\t * headLength - Number\n\t * headWidth - Number\n\t */\n\n\tvar lineGeometry = new BufferGeometry();\n\tlineGeometry.addAttribute( 'position', new Float32Attribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );\n\n\tvar coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );\n\tconeGeometry.translate( 0, - 0.5, 0 );\n\n\tfunction ArrowHelper( dir, origin, length, color, headLength, headWidth ) {\n\n\t\t// dir is assumed to be normalized\n\n\t\tObject3D.call( this );\n\n\t\tif ( color === undefined ) color = 0xffff00;\n\t\tif ( length === undefined ) length = 1;\n\t\tif ( headLength === undefined ) headLength = 0.2 * length;\n\t\tif ( headWidth === undefined ) headWidth = 0.2 * headLength;\n\n\t\tthis.position.copy( origin );\n\n\t\tthis.line = new Line( lineGeometry, new LineBasicMaterial( { color: color } ) );\n\t\tthis.line.matrixAutoUpdate = false;\n\t\tthis.add( this.line );\n\n\t\tthis.cone = new Mesh( coneGeometry, new MeshBasicMaterial( { color: color } ) );\n\t\tthis.cone.matrixAutoUpdate = false;\n\t\tthis.add( this.cone );\n\n\t\tthis.setDirection( dir );\n\t\tthis.setLength( length, headLength, headWidth );\n\n\t}\n\n\tArrowHelper.prototype = Object.create( Object3D.prototype );\n\tArrowHelper.prototype.constructor = ArrowHelper;\n\n\tArrowHelper.prototype.setDirection = ( function () {\n\n\t\tvar axis = new Vector3();\n\t\tvar radians;\n\n\t\treturn function setDirection( dir ) {\n\n\t\t\t// dir is assumed to be normalized\n\n\t\t\tif ( dir.y > 0.99999 ) {\n\n\t\t\t\tthis.quaternion.set( 0, 0, 0, 1 );\n\n\t\t\t} else if ( dir.y < - 0.99999 ) {\n\n\t\t\t\tthis.quaternion.set( 1, 0, 0, 0 );\n\n\t\t\t} else {\n\n\t\t\t\taxis.set( dir.z, 0, - dir.x ).normalize();\n\n\t\t\t\tradians = Math.acos( dir.y );\n\n\t\t\t\tthis.quaternion.setFromAxisAngle( axis, radians );\n\n\t\t\t}\n\n\t\t};\n\n\t}() );\n\n\tArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) {\n\n\t\tif ( headLength === undefined ) headLength = 0.2 * length;\n\t\tif ( headWidth === undefined ) headWidth = 0.2 * headLength;\n\n\t\tthis.line.scale.set( 1, Math.max( 0, length - headLength ), 1 );\n\t\tthis.line.updateMatrix();\n\n\t\tthis.cone.scale.set( headWidth, headLength, headWidth );\n\t\tthis.cone.position.y = length;\n\t\tthis.cone.updateMatrix();\n\n\t};\n\n\tArrowHelper.prototype.setColor = function ( color ) {\n\n\t\tthis.line.material.color.copy( color );\n\t\tthis.cone.material.color.copy( color );\n\n\t};\n\n\t/**\n\t * @author sroucheray / http://sroucheray.org/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction AxisHelper( size ) {\n\n\t\tsize = size || 1;\n\n\t\tvar vertices = new Float32Array( [\n\t\t\t0, 0, 0, size, 0, 0,\n\t\t\t0, 0, 0, 0, size, 0,\n\t\t\t0, 0, 0, 0, 0, size\n\t\t] );\n\n\t\tvar colors = new Float32Array( [\n\t\t\t1, 0, 0, 1, 0.6, 0,\n\t\t\t0, 1, 0, 0.6, 1, 0,\n\t\t\t0, 0, 1, 0, 0.6, 1\n\t\t] );\n\n\t\tvar geometry = new BufferGeometry();\n\t\tgeometry.addAttribute( 'position', new BufferAttribute( vertices, 3 ) );\n\t\tgeometry.addAttribute( 'color', new BufferAttribute( colors, 3 ) );\n\n\t\tvar material = new LineBasicMaterial( { vertexColors: VertexColors } );\n\n\t\tLineSegments.call( this, geometry, material );\n\n\t}\n\n\tAxisHelper.prototype = Object.create( LineSegments.prototype );\n\tAxisHelper.prototype.constructor = AxisHelper;\n\n\t/**\n\t * @author zz85 https://github.com/zz85\n\t *\n\t * Centripetal CatmullRom Curve - which is useful for avoiding\n\t * cusps and self-intersections in non-uniform catmull rom curves.\n\t * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n\t *\n\t * curve.type accepts centripetal(default), chordal and catmullrom\n\t * curve.tension is used for catmullrom which defaults to 0.5\n\t */\n\n\tvar CatmullRomCurve3 = ( function() {\n\n\t\tvar\n\t\t\ttmp = new Vector3(),\n\t\t\tpx = new CubicPoly(),\n\t\t\tpy = new CubicPoly(),\n\t\t\tpz = new CubicPoly();\n\n\t\t/*\n\t\tBased on an optimized c++ solution in\n\t\t - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n\t\t - http://ideone.com/NoEbVM\n\n\t\tThis CubicPoly class could be used for reusing some variables and calculations,\n\t\tbut for three.js curve use, it could be possible inlined and flatten into a single function call\n\t\twhich can be placed in CurveUtils.\n\t\t*/\n\n\t\tfunction CubicPoly() {}\n\n\t\t/*\n\t\t * Compute coefficients for a cubic polynomial\n\t\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t\t * such that\n\t\t * p(0) = x0, p(1) = x1\n\t\t * and\n\t\t * p'(0) = t0, p'(1) = t1.\n\t\t */\n\t\tCubicPoly.prototype.init = function( x0, x1, t0, t1 ) {\n\n\t\t\tthis.c0 = x0;\n\t\t\tthis.c1 = t0;\n\t\t\tthis.c2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\t\tthis.c3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t\t};\n\n\t\tCubicPoly.prototype.initNonuniformCatmullRom = function( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tvar t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tvar t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\t// initCubicPoly\n\t\t\tthis.init( x1, x2, t1, t2 );\n\n\t\t};\n\n\t\t// standard Catmull-Rom spline: interpolate between x1 and x2 with previous/following points x1/x4\n\t\tCubicPoly.prototype.initCatmullRom = function( x0, x1, x2, x3, tension ) {\n\n\t\t\tthis.init( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t};\n\n\t\tCubicPoly.prototype.calc = function( t ) {\n\n\t\t\tvar t2 = t * t;\n\t\t\tvar t3 = t2 * t;\n\t\t\treturn this.c0 + this.c1 * t + this.c2 * t2 + this.c3 * t3;\n\n\t\t};\n\n\t\t// Subclass Three.js curve\n\t\treturn Curve.create(\n\n\t\t\tfunction ( p /* array of Vector3 */ ) {\n\n\t\t\t\tthis.points = p || [];\n\t\t\t\tthis.closed = false;\n\n\t\t\t},\n\n\t\t\tfunction ( t ) {\n\n\t\t\t\tvar points = this.points,\n\t\t\t\t\tpoint, intPoint, weight, l;\n\n\t\t\t\tl = points.length;\n\n\t\t\t\tif ( l < 2 ) console.log( 'duh, you need at least 2 points' );\n\n\t\t\t\tpoint = ( l - ( this.closed ? 0 : 1 ) ) * t;\n\t\t\t\tintPoint = Math.floor( point );\n\t\t\t\tweight = point - intPoint;\n\n\t\t\t\tif ( this.closed ) {\n\n\t\t\t\t\tintPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / points.length ) + 1 ) * points.length;\n\n\t\t\t\t} else if ( weight === 0 && intPoint === l - 1 ) {\n\n\t\t\t\t\tintPoint = l - 2;\n\t\t\t\t\tweight = 1;\n\n\t\t\t\t}\n\n\t\t\t\tvar p0, p1, p2, p3; // 4 points\n\n\t\t\t\tif ( this.closed || intPoint > 0 ) {\n\n\t\t\t\t\tp0 = points[ ( intPoint - 1 ) % l ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// extrapolate first point\n\t\t\t\t\ttmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] );\n\t\t\t\t\tp0 = tmp;\n\n\t\t\t\t}\n\n\t\t\t\tp1 = points[ intPoint % l ];\n\t\t\t\tp2 = points[ ( intPoint + 1 ) % l ];\n\n\t\t\t\tif ( this.closed || intPoint + 2 < l ) {\n\n\t\t\t\t\tp3 = points[ ( intPoint + 2 ) % l ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// extrapolate last point\n\t\t\t\t\ttmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] );\n\t\t\t\t\tp3 = tmp;\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.type === undefined || this.type === 'centripetal' || this.type === 'chordal' ) {\n\n\t\t\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\t\t\tvar pow = this.type === 'chordal' ? 0.5 : 0.25;\n\t\t\t\t\tvar dt0 = Math.pow( p0.distanceToSquared( p1 ), pow );\n\t\t\t\t\tvar dt1 = Math.pow( p1.distanceToSquared( p2 ), pow );\n\t\t\t\t\tvar dt2 = Math.pow( p2.distanceToSquared( p3 ), pow );\n\n\t\t\t\t\t// safety check for repeated points\n\t\t\t\t\tif ( dt1 < 1e-4 ) dt1 = 1.0;\n\t\t\t\t\tif ( dt0 < 1e-4 ) dt0 = dt1;\n\t\t\t\t\tif ( dt2 < 1e-4 ) dt2 = dt1;\n\n\t\t\t\t\tpx.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 );\n\t\t\t\t\tpy.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 );\n\t\t\t\t\tpz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 );\n\n\t\t\t\t} else if ( this.type === 'catmullrom' ) {\n\n\t\t\t\t\tvar tension = this.tension !== undefined ? this.tension : 0.5;\n\t\t\t\t\tpx.initCatmullRom( p0.x, p1.x, p2.x, p3.x, tension );\n\t\t\t\t\tpy.initCatmullRom( p0.y, p1.y, p2.y, p3.y, tension );\n\t\t\t\t\tpz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, tension );\n\n\t\t\t\t}\n\n\t\t\t\tvar v = new Vector3(\n\t\t\t\t\tpx.calc( weight ),\n\t\t\t\t\tpy.calc( weight ),\n\t\t\t\t\tpz.calc( weight )\n\t\t\t\t);\n\n\t\t\t\treturn v;\n\n\t\t\t}\n\n\t\t);\n\n\t} )();\n\n\t/**************************************************************\n\t *\tClosed Spline 3D curve\n\t **************************************************************/\n\n\n\tfunction ClosedSplineCurve3( points ) {\n\n\t\tconsole.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.' );\n\n\t\tCatmullRomCurve3.call( this, points );\n\t\tthis.type = 'catmullrom';\n\t\tthis.closed = true;\n\n\t}\n\n\tClosedSplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype );\n\n\t/**************************************************************\n\t *\tSpline 3D curve\n\t **************************************************************/\n\n\n\tvar SplineCurve3 = Curve.create(\n\n\t\tfunction ( points /* array of Vector3 */ ) {\n\n\t\t\tconsole.warn( 'THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3' );\n\t\t\tthis.points = ( points === undefined ) ? [] : points;\n\n\t\t},\n\n\t\tfunction ( t ) {\n\n\t\t\tvar points = this.points;\n\t\t\tvar point = ( points.length - 1 ) * t;\n\n\t\t\tvar intPoint = Math.floor( point );\n\t\t\tvar weight = point - intPoint;\n\n\t\t\tvar point0 = points[ intPoint == 0 ? intPoint : intPoint - 1 ];\n\t\t\tvar point1 = points[ intPoint ];\n\t\t\tvar point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];\n\t\t\tvar point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];\n\n\t\t\tvar interpolate = CurveUtils.interpolate;\n\n\t\t\treturn new Vector3(\n\t\t\t\tinterpolate( point0.x, point1.x, point2.x, point3.x, weight ),\n\t\t\t\tinterpolate( point0.y, point1.y, point2.y, point3.y, weight ),\n\t\t\t\tinterpolate( point0.z, point1.z, point2.z, point3.z, weight )\n\t\t\t);\n\n\t\t}\n\n\t);\n\n\t/**************************************************************\n\t *\tCubic Bezier 3D curve\n\t **************************************************************/\n\n\tvar CubicBezierCurve3 = Curve.create(\n\n\t\tfunction ( v0, v1, v2, v3 ) {\n\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t\tthis.v3 = v3;\n\n\t\t},\n\n\t\tfunction ( t ) {\n\n\t\t\tvar b3 = ShapeUtils.b3;\n\n\t\t\treturn new Vector3(\n\t\t\t\tb3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ),\n\t\t\t\tb3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ),\n\t\t\t\tb3( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z )\n\t\t\t);\n\n\t\t}\n\n\t);\n\n\t/**************************************************************\n\t *\tQuadratic Bezier 3D curve\n\t **************************************************************/\n\n\tvar QuadraticBezierCurve3 = Curve.create(\n\n\t\tfunction ( v0, v1, v2 ) {\n\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\n\t\t},\n\n\t\tfunction ( t ) {\n\n\t\t\tvar b2 = ShapeUtils.b2;\n\n\t\t\treturn new Vector3(\n\t\t\t\tb2( t, this.v0.x, this.v1.x, this.v2.x ),\n\t\t\t\tb2( t, this.v0.y, this.v1.y, this.v2.y ),\n\t\t\t\tb2( t, this.v0.z, this.v1.z, this.v2.z )\n\t\t\t);\n\n\t\t}\n\n\t);\n\n\t/**************************************************************\n\t *\tLine3D\n\t **************************************************************/\n\n\tvar LineCurve3 = Curve.create(\n\n\t\tfunction ( v1, v2 ) {\n\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\n\t\t},\n\n\t\tfunction ( t ) {\n\n\t\t\tif ( t === 1 ) {\n\n\t\t\t\treturn this.v2.clone();\n\n\t\t\t}\n\n\t\t\tvar vector = new Vector3();\n\n\t\t\tvector.subVectors( this.v2, this.v1 ); // diff\n\t\t\tvector.multiplyScalar( t );\n\t\t\tvector.add( this.v1 );\n\n\t\t\treturn vector;\n\n\t\t}\n\n\t);\n\n\t/**************************************************************\n\t *\tArc curve\n\t **************************************************************/\n\n\tfunction ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tEllipseCurve.call( this, aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t}\n\n\tArcCurve.prototype = Object.create( EllipseCurve.prototype );\n\tArcCurve.prototype.constructor = ArcCurve;\n\n\t/**\n\t * @author alteredq / http://alteredqualia.com/\n\t */\n\n\tvar SceneUtils = {\n\n\t\tcreateMultiMaterialObject: function ( geometry, materials ) {\n\n\t\t\tvar group = new Group();\n\n\t\t\tfor ( var i = 0, l = materials.length; i < l; i ++ ) {\n\n\t\t\t\tgroup.add( new Mesh( geometry, materials[ i ] ) );\n\n\t\t\t}\n\n\t\t\treturn group;\n\n\t\t},\n\n\t\tdetach: function ( child, parent, scene ) {\n\n\t\t\tchild.applyMatrix( parent.matrixWorld );\n\t\t\tparent.remove( child );\n\t\t\tscene.add( child );\n\n\t\t},\n\n\t\tattach: function ( child, scene, parent ) {\n\n\t\t\tvar matrixWorldInverse = new Matrix4();\n\t\t\tmatrixWorldInverse.getInverse( parent.matrixWorld );\n\t\t\tchild.applyMatrix( matrixWorldInverse );\n\n\t\t\tscene.remove( child );\n\t\t\tparent.add( child );\n\n\t\t}\n\n\t};\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction Face4 ( a, b, c, d, normal, color, materialIndex ) {\n\t\tconsole.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' );\n\t\treturn new Face3( a, b, c, normal, color, materialIndex );\n\t}\n\n\tvar LineStrip = 0;\n\n\tvar LinePieces = 1;\n\n\tfunction PointCloud ( geometry, material ) {\n\t\tconsole.warn( 'THREE.PointCloud has been renamed to THREE.Points.' );\n\t\treturn new Points( geometry, material );\n\t}\n\n\tfunction ParticleSystem ( geometry, material ) {\n\t\tconsole.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' );\n\t\treturn new Points( geometry, material );\n\t}\n\n\tfunction PointCloudMaterial ( parameters ) {\n\t\tconsole.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' );\n\t\treturn new PointsMaterial( parameters );\n\t}\n\n\tfunction ParticleBasicMaterial ( parameters ) {\n\t\tconsole.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' );\n\t\treturn new PointsMaterial( parameters );\n\t}\n\n\tfunction ParticleSystemMaterial ( parameters ) {\n\t\tconsole.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' );\n\t\treturn new PointsMaterial( parameters );\n\t}\n\n\tfunction Vertex ( x, y, z ) {\n\t\tconsole.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' );\n\t\treturn new Vector3( x, y, z );\n\t}\n\n\t//\n\n\tfunction EdgesHelper( object, hex ) {\n\t\tconsole.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' );\n\t\treturn new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );\n\t}\n\n\tfunction WireframeHelper( object, hex ) {\n\t\tconsole.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' );\n\t\treturn new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) );\n\t}\n\n\t//\n\n\tObject.assign( Box2.prototype, {\n\t\tcenter: function ( optionalTarget ) {\n\t\t\tconsole.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' );\n\t\t\treturn this.getCenter( optionalTarget );\n\t\t},\n\t\tempty: function () {\n\t\t\tconsole.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' );\n\t\t\treturn this.isEmpty();\n\t\t},\n\t\tisIntersectionBox: function ( box ) {\n\t\t\tconsole.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' );\n\t\t\treturn this.intersectsBox( box );\n\t\t},\n\t\tsize: function ( optionalTarget ) {\n\t\t\tconsole.warn( 'THREE.Box2: .size() has been renamed to .getSize().' );\n\t\t\treturn this.getSize( optionalTarget );\n\t\t}\n\t} );\n\n\tObject.assign( Box3.prototype, {\n\t\tcenter: function ( optionalTarget ) {\n\t\t\tconsole.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' );\n\t\t\treturn this.getCenter( optionalTarget );\n\t\t},\n\t\tempty: function () {\n\t\t\tconsole.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' );\n\t\t\treturn this.isEmpty();\n\t\t},\n\t\tisIntersectionBox: function ( box ) {\n\t\t\tconsole.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' );\n\t\t\treturn this.intersectsBox( box );\n\t\t},\n\t\tisIntersectionSphere: function ( sphere ) {\n\t\t\tconsole.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' );\n\t\t\treturn this.intersectsSphere( sphere );\n\t\t},\n\t\tsize: function ( optionalTarget ) {\n\t\t\tconsole.warn( 'THREE.Box3: .size() has been renamed to .getSize().' );\n\t\t\treturn this.getSize( optionalTarget );\n\t\t}\n\t} );\n\n\tObject.assign( Line3.prototype, {\n\t\tcenter: function ( optionalTarget ) {\n\t\t\tconsole.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' );\n\t\t\treturn this.getCenter( optionalTarget );\n\t\t}\n\t} );\n\n\tObject.assign( Matrix3.prototype, {\n\t\tmultiplyVector3: function ( vector ) {\n\t\t\tconsole.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' );\n\t\t\treturn vector.applyMatrix3( this );\n\t\t},\n\t\tmultiplyVector3Array: function ( a ) {\n\t\t\tconsole.warn( 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );\n\t\t\treturn this.applyToVector3Array( a );\n\t\t}\n\t} );\n\n\tObject.assign( Matrix4.prototype, {\n\t\textractPosition: function ( m ) {\n\t\t\tconsole.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' );\n\t\t\treturn this.copyPosition( m );\n\t\t},\n\t\tsetRotationFromQuaternion: function ( q ) {\n\t\t\tconsole.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );\n\t\t\treturn this.makeRotationFromQuaternion( q );\n\t\t},\n\t\tmultiplyVector3: function ( vector ) {\n\t\t\tconsole.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.' );\n\t\t\treturn vector.applyProjection( this );\n\t\t},\n\t\tmultiplyVector4: function ( vector ) {\n\t\t\tconsole.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' );\n\t\t\treturn vector.applyMatrix4( this );\n\t\t},\n\t\tmultiplyVector3Array: function ( a ) {\n\t\t\tconsole.warn( 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.' );\n\t\t\treturn this.applyToVector3Array( a );\n\t\t},\n\t\trotateAxis: function ( v ) {\n\t\t\tconsole.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' );\n\t\t\tv.transformDirection( this );\n\t\t},\n\t\tcrossVector: function ( vector ) {\n\t\t\tconsole.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' );\n\t\t\treturn vector.applyMatrix4( this );\n\t\t},\n\t\ttranslate: function ( v ) {\n\t\t\tconsole.error( 'THREE.Matrix4: .translate() has been removed.' );\n\t\t},\n\t\trotateX: function ( angle ) {\n\t\t\tconsole.error( 'THREE.Matrix4: .rotateX() has been removed.' );\n\t\t},\n\t\trotateY: function ( angle ) {\n\t\t\tconsole.error( 'THREE.Matrix4: .rotateY() has been removed.' );\n\t\t},\n\t\trotateZ: function ( angle ) {\n\t\t\tconsole.error( 'THREE.Matrix4: .rotateZ() has been removed.' );\n\t\t},\n\t\trotateByAxis: function ( axis, angle ) {\n\t\t\tconsole.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' );\n\t\t}\n\t} );\n\n\tObject.assign( Plane.prototype, {\n\t\tisIntersectionLine: function ( line ) {\n\t\t\tconsole.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' );\n\t\t\treturn this.intersectsLine( line );\n\t\t}\n\t} );\n\n\tObject.assign( Quaternion.prototype, {\n\t\tmultiplyVector3: function ( vector ) {\n\t\t\tconsole.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' );\n\t\t\treturn vector.applyQuaternion( this );\n\t\t}\n\t} );\n\n\tObject.assign( Ray.prototype, {\n\t\tisIntersectionBox: function ( box ) {\n\t\t\tconsole.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' );\n\t\t\treturn this.intersectsBox( box );\n\t\t},\n\t\tisIntersectionPlane: function ( plane ) {\n\t\t\tconsole.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' );\n\t\t\treturn this.intersectsPlane( plane );\n\t\t},\n\t\tisIntersectionSphere: function ( sphere ) {\n\t\t\tconsole.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' );\n\t\t\treturn this.intersectsSphere( sphere );\n\t\t}\n\t} );\n\n\tObject.assign( Shape.prototype, {\n\t\textrude: function ( options ) {\n\t\t\tconsole.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' );\n\t\t\treturn new ExtrudeGeometry( this, options );\n\t\t},\n\t\tmakeGeometry: function ( options ) {\n\t\t\tconsole.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' );\n\t\t\treturn new ShapeGeometry( this, options );\n\t\t}\n\t} );\n\n\tObject.assign( Vector3.prototype, {\n\t\tsetEulerFromRotationMatrix: function () {\n\t\t\tconsole.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' );\n\t\t},\n\t\tsetEulerFromQuaternion: function () {\n\t\t\tconsole.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' );\n\t\t},\n\t\tgetPositionFromMatrix: function ( m ) {\n\t\t\tconsole.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' );\n\t\t\treturn this.setFromMatrixPosition( m );\n\t\t},\n\t\tgetScaleFromMatrix: function ( m ) {\n\t\t\tconsole.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' );\n\t\t\treturn this.setFromMatrixScale( m );\n\t\t},\n\t\tgetColumnFromMatrix: function ( index, matrix ) {\n\t\t\tconsole.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' );\n\t\t\treturn this.setFromMatrixColumn( matrix, index );\n\t\t}\n\t} );\n\n\t//\n\n\tObject.assign( Object3D.prototype, {\n\t\tgetChildByName: function ( name ) {\n\t\t\tconsole.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );\n\t\t\treturn this.getObjectByName( name );\n\t\t},\n\t\trenderDepth: function ( value ) {\n\t\t\tconsole.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' );\n\t\t},\n\t\ttranslate: function ( distance, axis ) {\n\t\t\tconsole.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );\n\t\t\treturn this.translateOnAxis( axis, distance );\n\t\t}\n\t} );\n\n\tObject.defineProperties( Object3D.prototype, {\n\t\teulerOrder: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );\n\t\t\t\treturn this.rotation.order;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' );\n\t\t\t\tthis.rotation.order = value;\n\t\t\t}\n\t\t},\n\t\tuseQuaternion: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );\n\t\t\t}\n\t\t}\n\t} );\n\n\tObject.defineProperties( LOD.prototype, {\n\t\tobjects: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.LOD: .objects has been renamed to .levels.' );\n\t\t\t\treturn this.levels;\n\t\t\t}\n\t\t}\n\t} );\n\n\t//\n\n\tPerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) {\n\n\t\tconsole.warn( \"THREE.PerspectiveCamera.setLens is deprecated. \" +\n\t\t\t\t\"Use .setFocalLength and .filmGauge for a photographic setup.\" );\n\n\t\tif ( filmGauge !== undefined ) this.filmGauge = filmGauge;\n\t\tthis.setFocalLength( focalLength );\n\n\t};\n\n\t//\n\n\tObject.defineProperties( Light.prototype, {\n\t\tonlyShadow: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .onlyShadow has been removed.' );\n\t\t\t}\n\t\t},\n\t\tshadowCameraFov: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' );\n\t\t\t\tthis.shadow.camera.fov = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraLeft: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' );\n\t\t\t\tthis.shadow.camera.left = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraRight: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' );\n\t\t\t\tthis.shadow.camera.right = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraTop: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' );\n\t\t\t\tthis.shadow.camera.top = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraBottom: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' );\n\t\t\t\tthis.shadow.camera.bottom = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraNear: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' );\n\t\t\t\tthis.shadow.camera.near = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraFar: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' );\n\t\t\t\tthis.shadow.camera.far = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraVisible: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' );\n\t\t\t}\n\t\t},\n\t\tshadowBias: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' );\n\t\t\t\tthis.shadow.bias = value;\n\t\t\t}\n\t\t},\n\t\tshadowDarkness: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowDarkness has been removed.' );\n\t\t\t}\n\t\t},\n\t\tshadowMapWidth: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' );\n\t\t\t\tthis.shadow.mapSize.width = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapHeight: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' );\n\t\t\t\tthis.shadow.mapSize.height = value;\n\t\t\t}\n\t\t}\n\t} );\n\n\t//\n\n\tObject.defineProperties( BufferAttribute.prototype, {\n\t\tlength: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.BufferAttribute: .length has been deprecated. Please use .count.' );\n\t\t\t\treturn this.array.length;\n\t\t\t}\n\t\t}\n\t} );\n\n\tObject.assign( BufferGeometry.prototype, {\n\t\taddIndex: function ( index ) {\n\t\t\tconsole.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );\n\t\t\tthis.setIndex( index );\n\t\t},\n\t\taddDrawCall: function ( start, count, indexOffset ) {\n\t\t\tif ( indexOffset !== undefined ) {\n\t\t\t\tconsole.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' );\n\t\t\t}\n\t\t\tconsole.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' );\n\t\t\tthis.addGroup( start, count );\n\t\t},\n\t\tclearDrawCalls: function () {\n\t\t\tconsole.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' );\n\t\t\tthis.clearGroups();\n\t\t},\n\t\tcomputeTangents: function () {\n\t\t\tconsole.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' );\n\t\t},\n\t\tcomputeOffsets: function () {\n\t\t\tconsole.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );\n\t\t}\n\t} );\n\n\tObject.defineProperties( BufferGeometry.prototype, {\n\t\tdrawcalls: {\n\t\t\tget: function () {\n\t\t\t\tconsole.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' );\n\t\t\t\treturn this.groups;\n\t\t\t}\n\t\t},\n\t\toffsets: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' );\n\t\t\t\treturn this.groups;\n\t\t\t}\n\t\t}\n\t} );\n\n\t//\n\n\tObject.defineProperties( Material.prototype, {\n\t\twrapAround: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' );\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.' + this.type + ': .wrapAround has been removed.' );\n\t\t\t}\n\t\t},\n\t\twrapRGB: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.' + this.type + ': .wrapRGB has been removed.' );\n\t\t\t\treturn new Color();\n\t\t\t}\n\t\t}\n\t} );\n\n\tObject.defineProperties( MeshPhongMaterial.prototype, {\n\t\tmetal: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' );\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' );\n\t\t\t}\n\t\t}\n\t} );\n\n\tObject.defineProperties( ShaderMaterial.prototype, {\n\t\tderivatives: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );\n\t\t\t\treturn this.extensions.derivatives;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' );\n\t\t\t\tthis.extensions.derivatives = value;\n\t\t\t}\n\t\t}\n\t} );\n\n\t//\n\n\tEventDispatcher.prototype = Object.assign( Object.create( {\n\n\t\t// Note: Extra base ensures these properties are not 'assign'ed.\n\n\t\tconstructor: EventDispatcher,\n\n\t\tapply: function ( target ) {\n\n\t\t\tconsole.warn( \"THREE.EventDispatcher: .apply is deprecated, \" +\n\t\t\t\t\t\"just inherit or Object.assign the prototype to mix-in.\" );\n\n\t\t\tObject.assign( target, this );\n\n\t\t}\n\n\t} ), EventDispatcher.prototype );\n\n\t//\n\n\tObject.defineProperties( Uniform.prototype, {\n\t\tdynamic: {\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.' );\n\t\t\t}\n\t\t},\n\t\tonUpdate: {\n\t\t\tvalue: function () {\n\t\t\t\tconsole.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' );\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t} );\n\n\t//\n\n\tObject.assign( WebGLRenderer.prototype, {\n\t\tsupportsFloatTextures: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \\'OES_texture_float\\' ).' );\n\t\t\treturn this.extensions.get( 'OES_texture_float' );\n\t\t},\n\t\tsupportsHalfFloatTextures: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \\'OES_texture_half_float\\' ).' );\n\t\t\treturn this.extensions.get( 'OES_texture_half_float' );\n\t\t},\n\t\tsupportsStandardDerivatives: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \\'OES_standard_derivatives\\' ).' );\n\t\t\treturn this.extensions.get( 'OES_standard_derivatives' );\n\t\t},\n\t\tsupportsCompressedTextureS3TC: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \\'WEBGL_compressed_texture_s3tc\\' ).' );\n\t\t\treturn this.extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\t\t},\n\t\tsupportsCompressedTexturePVRTC: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \\'WEBGL_compressed_texture_pvrtc\\' ).' );\n\t\t\treturn this.extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\t\t},\n\t\tsupportsBlendMinMax: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \\'EXT_blend_minmax\\' ).' );\n\t\t\treturn this.extensions.get( 'EXT_blend_minmax' );\n\t\t},\n\t\tsupportsVertexTextures: function () {\n\t\t\treturn this.capabilities.vertexTextures;\n\t\t},\n\t\tsupportsInstancedArrays: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \\'ANGLE_instanced_arrays\\' ).' );\n\t\t\treturn this.extensions.get( 'ANGLE_instanced_arrays' );\n\t\t},\n\t\tenableScissorTest: function ( boolean ) {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' );\n\t\t\tthis.setScissorTest( boolean );\n\t\t},\n\t\tinitMaterial: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' );\n\t\t},\n\t\taddPrePlugin: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' );\n\t\t},\n\t\taddPostPlugin: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' );\n\t\t},\n\t\tupdateShadowMap: function () {\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );\n\t\t}\n\t} );\n\n\tObject.defineProperties( WebGLRenderer.prototype, {\n\t\tshadowMapEnabled: {\n\t\t\tget: function () {\n\t\t\t\treturn this.shadowMap.enabled;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' );\n\t\t\t\tthis.shadowMap.enabled = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapType: {\n\t\t\tget: function () {\n\t\t\t\treturn this.shadowMap.type;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' );\n\t\t\t\tthis.shadowMap.type = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapCullFace: {\n\t\t\tget: function () {\n\t\t\t\treturn this.shadowMap.cullFace;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.' );\n\t\t\t\tthis.shadowMap.cullFace = value;\n\t\t\t}\n\t\t}\n\t} );\n\n\tObject.defineProperties( WebGLShadowMap.prototype, {\n\t\tcullFace: {\n\t\t\tget: function () {\n\t\t\t\treturn this.renderReverseSided ? CullFaceFront : CullFaceBack;\n\t\t\t},\n\t\t\tset: function ( cullFace ) {\n\t\t\t\tvar value = ( cullFace !== CullFaceBack );\n\t\t\t\tconsole.warn( \"WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to \" + value + \".\" );\n\t\t\t\tthis.renderReverseSided = value;\n\t\t\t}\n\t\t}\n\t} );\n\n\t//\n\n\tObject.defineProperties( WebGLRenderTarget.prototype, {\n\t\twrapS: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );\n\t\t\t\treturn this.texture.wrapS;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' );\n\t\t\t\tthis.texture.wrapS = value;\n\t\t\t}\n\t\t},\n\t\twrapT: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );\n\t\t\t\treturn this.texture.wrapT;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' );\n\t\t\t\tthis.texture.wrapT = value;\n\t\t\t}\n\t\t},\n\t\tmagFilter: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );\n\t\t\t\treturn this.texture.magFilter;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' );\n\t\t\t\tthis.texture.magFilter = value;\n\t\t\t}\n\t\t},\n\t\tminFilter: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );\n\t\t\t\treturn this.texture.minFilter;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' );\n\t\t\t\tthis.texture.minFilter = value;\n\t\t\t}\n\t\t},\n\t\tanisotropy: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );\n\t\t\t\treturn this.texture.anisotropy;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' );\n\t\t\t\tthis.texture.anisotropy = value;\n\t\t\t}\n\t\t},\n\t\toffset: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );\n\t\t\t\treturn this.texture.offset;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' );\n\t\t\t\tthis.texture.offset = value;\n\t\t\t}\n\t\t},\n\t\trepeat: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );\n\t\t\t\treturn this.texture.repeat;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' );\n\t\t\t\tthis.texture.repeat = value;\n\t\t\t}\n\t\t},\n\t\tformat: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );\n\t\t\t\treturn this.texture.format;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' );\n\t\t\t\tthis.texture.format = value;\n\t\t\t}\n\t\t},\n\t\ttype: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );\n\t\t\t\treturn this.texture.type;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' );\n\t\t\t\tthis.texture.type = value;\n\t\t\t}\n\t\t},\n\t\tgenerateMipmaps: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );\n\t\t\t\treturn this.texture.generateMipmaps;\n\t\t\t},\n\t\t\tset: function ( value ) {\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' );\n\t\t\t\tthis.texture.generateMipmaps = value;\n\t\t\t}\n\t\t}\n\t} );\n\n\t//\n\n\tObject.assign( Audio.prototype, {\n\t\tload: function ( file ) {\n\t\t\tconsole.warn( 'THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.' );\n\t\t\tvar scope = this;\n\t\t\tvar audioLoader = new AudioLoader();\n\t\t\taudioLoader.load( file, function ( buffer ) {\n\t\t\t\tscope.setBuffer( buffer );\n\t\t\t} );\n\t\t\treturn this;\n\t\t}\n\t} );\n\n\tObject.assign( AudioAnalyser.prototype, {\n\t\tgetData: function ( file ) {\n\t\t\tconsole.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' );\n\t\t\treturn this.getFrequencyData();\n\t\t}\n\t} );\n\n\t//\n\n\tvar GeometryUtils = {\n\n\t\tmerge: function ( geometry1, geometry2, materialIndexOffset ) {\n\n\t\t\tconsole.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );\n\n\t\t\tvar matrix;\n\n\t\t\tif ( geometry2.isMesh ) {\n\n\t\t\t\tgeometry2.matrixAutoUpdate && geometry2.updateMatrix();\n\n\t\t\t\tmatrix = geometry2.matrix;\n\t\t\t\tgeometry2 = geometry2.geometry;\n\n\t\t\t}\n\n\t\t\tgeometry1.merge( geometry2, matrix, materialIndexOffset );\n\n\t\t},\n\n\t\tcenter: function ( geometry ) {\n\n\t\t\tconsole.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );\n\t\t\treturn geometry.center();\n\n\t\t}\n\n\t};\n\n\tvar ImageUtils = {\n\n\t\tcrossOrigin: undefined,\n\n\t\tloadTexture: function ( url, mapping, onLoad, onError ) {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' );\n\n\t\t\tvar loader = new TextureLoader();\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tvar texture = loader.load( url, onLoad, undefined, onError );\n\n\t\t\tif ( mapping ) texture.mapping = mapping;\n\n\t\t\treturn texture;\n\n\t\t},\n\n\t\tloadTextureCube: function ( urls, mapping, onLoad, onError ) {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' );\n\n\t\t\tvar loader = new CubeTextureLoader();\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tvar texture = loader.load( urls, onLoad, undefined, onError );\n\n\t\t\tif ( mapping ) texture.mapping = mapping;\n\n\t\t\treturn texture;\n\n\t\t},\n\n\t\tloadCompressedTexture: function () {\n\n\t\t\tconsole.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' );\n\n\t\t},\n\n\t\tloadCompressedTextureCube: function () {\n\n\t\t\tconsole.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' );\n\n\t\t}\n\n\t};\n\n\t//\n\n\tfunction Projector () {\n\n\t\tconsole.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );\n\n\t\tthis.projectVector = function ( vector, camera ) {\n\n\t\t\tconsole.warn( 'THREE.Projector: .projectVector() is now vector.project().' );\n\t\t\tvector.project( camera );\n\n\t\t};\n\n\t\tthis.unprojectVector = function ( vector, camera ) {\n\n\t\t\tconsole.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );\n\t\t\tvector.unproject( camera );\n\n\t\t};\n\n\t\tthis.pickingRay = function ( vector, camera ) {\n\n\t\t\tconsole.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );\n\n\t\t};\n\n\t}\n\n\t//\n\n\tfunction CanvasRenderer () {\n\n\t\tconsole.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );\n\n\t\tthis.domElement = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );\n\t\tthis.clear = function () {};\n\t\tthis.render = function () {};\n\t\tthis.setClearColor = function () {};\n\t\tthis.setSize = function () {};\n\n\t}\n\n\texports.WebGLRenderTargetCube = WebGLRenderTargetCube;\n\texports.WebGLRenderTarget = WebGLRenderTarget;\n\texports.WebGLRenderer = WebGLRenderer;\n\texports.ShaderLib = ShaderLib;\n\texports.UniformsLib = UniformsLib;\n\texports.UniformsUtils = UniformsUtils;\n\texports.ShaderChunk = ShaderChunk;\n\texports.FogExp2 = FogExp2;\n\texports.Fog = Fog;\n\texports.Scene = Scene;\n\texports.LensFlare = LensFlare;\n\texports.Sprite = Sprite;\n\texports.LOD = LOD;\n\texports.SkinnedMesh = SkinnedMesh;\n\texports.Skeleton = Skeleton;\n\texports.Bone = Bone;\n\texports.Mesh = Mesh;\n\texports.LineSegments = LineSegments;\n\texports.Line = Line;\n\texports.Points = Points;\n\texports.Group = Group;\n\texports.VideoTexture = VideoTexture;\n\texports.DataTexture = DataTexture;\n\texports.CompressedTexture = CompressedTexture;\n\texports.CubeTexture = CubeTexture;\n\texports.CanvasTexture = CanvasTexture;\n\texports.DepthTexture = DepthTexture;\n\texports.TextureIdCount = TextureIdCount;\n\texports.Texture = Texture;\n\texports.MaterialIdCount = MaterialIdCount;\n\texports.CompressedTextureLoader = CompressedTextureLoader;\n\texports.BinaryTextureLoader = BinaryTextureLoader;\n\texports.DataTextureLoader = DataTextureLoader;\n\texports.CubeTextureLoader = CubeTextureLoader;\n\texports.TextureLoader = TextureLoader;\n\texports.ObjectLoader = ObjectLoader;\n\texports.MaterialLoader = MaterialLoader;\n\texports.BufferGeometryLoader = BufferGeometryLoader;\n\texports.DefaultLoadingManager = DefaultLoadingManager;\n\texports.LoadingManager = LoadingManager;\n\texports.JSONLoader = JSONLoader;\n\texports.ImageLoader = ImageLoader;\n\texports.FontLoader = FontLoader;\n\texports.XHRLoader = XHRLoader;\n\texports.Loader = Loader;\n\texports.Cache = Cache;\n\texports.AudioLoader = AudioLoader;\n\texports.SpotLightShadow = SpotLightShadow;\n\texports.SpotLight = SpotLight;\n\texports.PointLight = PointLight;\n\texports.HemisphereLight = HemisphereLight;\n\texports.DirectionalLightShadow = DirectionalLightShadow;\n\texports.DirectionalLight = DirectionalLight;\n\texports.AmbientLight = AmbientLight;\n\texports.LightShadow = LightShadow;\n\texports.Light = Light;\n\texports.StereoCamera = StereoCamera;\n\texports.PerspectiveCamera = PerspectiveCamera;\n\texports.OrthographicCamera = OrthographicCamera;\n\texports.CubeCamera = CubeCamera;\n\texports.Camera = Camera;\n\texports.AudioListener = AudioListener;\n\texports.PositionalAudio = PositionalAudio;\n\texports.getAudioContext = getAudioContext;\n\texports.AudioAnalyser = AudioAnalyser;\n\texports.Audio = Audio;\n\texports.VectorKeyframeTrack = VectorKeyframeTrack;\n\texports.StringKeyframeTrack = StringKeyframeTrack;\n\texports.QuaternionKeyframeTrack = QuaternionKeyframeTrack;\n\texports.NumberKeyframeTrack = NumberKeyframeTrack;\n\texports.ColorKeyframeTrack = ColorKeyframeTrack;\n\texports.BooleanKeyframeTrack = BooleanKeyframeTrack;\n\texports.PropertyMixer = PropertyMixer;\n\texports.PropertyBinding = PropertyBinding;\n\texports.KeyframeTrack = KeyframeTrack;\n\texports.AnimationUtils = AnimationUtils;\n\texports.AnimationObjectGroup = AnimationObjectGroup;\n\texports.AnimationMixer = AnimationMixer;\n\texports.AnimationClip = AnimationClip;\n\texports.Uniform = Uniform;\n\texports.InstancedBufferGeometry = InstancedBufferGeometry;\n\texports.BufferGeometry = BufferGeometry;\n\texports.GeometryIdCount = GeometryIdCount;\n\texports.Geometry = Geometry;\n\texports.InterleavedBufferAttribute = InterleavedBufferAttribute;\n\texports.InstancedInterleavedBuffer = InstancedInterleavedBuffer;\n\texports.InterleavedBuffer = InterleavedBuffer;\n\texports.InstancedBufferAttribute = InstancedBufferAttribute;\n\texports.DynamicBufferAttribute = DynamicBufferAttribute;\n\texports.Float64Attribute = Float64Attribute;\n\texports.Float32Attribute = Float32Attribute;\n\texports.Uint32Attribute = Uint32Attribute;\n\texports.Int32Attribute = Int32Attribute;\n\texports.Uint16Attribute = Uint16Attribute;\n\texports.Int16Attribute = Int16Attribute;\n\texports.Uint8ClampedAttribute = Uint8ClampedAttribute;\n\texports.Uint8Attribute = Uint8Attribute;\n\texports.Int8Attribute = Int8Attribute;\n\texports.BufferAttribute = BufferAttribute;\n\texports.Face3 = Face3;\n\texports.Object3DIdCount = Object3DIdCount;\n\texports.Object3D = Object3D;\n\texports.Raycaster = Raycaster;\n\texports.Layers = Layers;\n\texports.EventDispatcher = EventDispatcher;\n\texports.Clock = Clock;\n\texports.QuaternionLinearInterpolant = QuaternionLinearInterpolant;\n\texports.LinearInterpolant = LinearInterpolant;\n\texports.DiscreteInterpolant = DiscreteInterpolant;\n\texports.CubicInterpolant = CubicInterpolant;\n\texports.Interpolant = Interpolant;\n\texports.Triangle = Triangle;\n\texports.Spline = Spline;\n\texports.Math = _Math;\n\texports.Spherical = Spherical;\n\texports.Plane = Plane;\n\texports.Frustum = Frustum;\n\texports.Sphere = Sphere;\n\texports.Ray = Ray;\n\texports.Matrix4 = Matrix4;\n\texports.Matrix3 = Matrix3;\n\texports.Box3 = Box3;\n\texports.Box2 = Box2;\n\texports.Line3 = Line3;\n\texports.Euler = Euler;\n\texports.Vector4 = Vector4;\n\texports.Vector3 = Vector3;\n\texports.Vector2 = Vector2;\n\texports.Quaternion = Quaternion;\n\texports.ColorKeywords = ColorKeywords;\n\texports.Color = Color;\n\texports.MorphBlendMesh = MorphBlendMesh;\n\texports.ImmediateRenderObject = ImmediateRenderObject;\n\texports.VertexNormalsHelper = VertexNormalsHelper;\n\texports.SpotLightHelper = SpotLightHelper;\n\texports.SkeletonHelper = SkeletonHelper;\n\texports.PointLightHelper = PointLightHelper;\n\texports.HemisphereLightHelper = HemisphereLightHelper;\n\texports.GridHelper = GridHelper;\n\texports.FaceNormalsHelper = FaceNormalsHelper;\n\texports.DirectionalLightHelper = DirectionalLightHelper;\n\texports.CameraHelper = CameraHelper;\n\texports.BoundingBoxHelper = BoundingBoxHelper;\n\texports.BoxHelper = BoxHelper;\n\texports.ArrowHelper = ArrowHelper;\n\texports.AxisHelper = AxisHelper;\n\texports.ClosedSplineCurve3 = ClosedSplineCurve3;\n\texports.CatmullRomCurve3 = CatmullRomCurve3;\n\texports.SplineCurve3 = SplineCurve3;\n\texports.CubicBezierCurve3 = CubicBezierCurve3;\n\texports.QuadraticBezierCurve3 = QuadraticBezierCurve3;\n\texports.LineCurve3 = LineCurve3;\n\texports.ArcCurve = ArcCurve;\n\texports.EllipseCurve = EllipseCurve;\n\texports.SplineCurve = SplineCurve;\n\texports.CubicBezierCurve = CubicBezierCurve;\n\texports.QuadraticBezierCurve = QuadraticBezierCurve;\n\texports.LineCurve = LineCurve;\n\texports.Shape = Shape;\n\texports.ShapePath = ShapePath;\n\texports.Path = Path;\n\texports.Font = Font;\n\texports.CurvePath = CurvePath;\n\texports.Curve = Curve;\n\texports.ShapeUtils = ShapeUtils;\n\texports.SceneUtils = SceneUtils;\n\texports.CurveUtils = CurveUtils;\n\texports.WireframeGeometry = WireframeGeometry;\n\texports.ParametricGeometry = ParametricGeometry;\n\texports.ParametricBufferGeometry = ParametricBufferGeometry;\n\texports.TetrahedronGeometry = TetrahedronGeometry;\n\texports.TetrahedronBufferGeometry = TetrahedronBufferGeometry;\n\texports.OctahedronGeometry = OctahedronGeometry;\n\texports.OctahedronBufferGeometry = OctahedronBufferGeometry;\n\texports.IcosahedronGeometry = IcosahedronGeometry;\n\texports.IcosahedronBufferGeometry = IcosahedronBufferGeometry;\n\texports.DodecahedronGeometry = DodecahedronGeometry;\n\texports.DodecahedronBufferGeometry = DodecahedronBufferGeometry;\n\texports.PolyhedronGeometry = PolyhedronGeometry;\n\texports.PolyhedronBufferGeometry = PolyhedronBufferGeometry;\n\texports.TubeGeometry = TubeGeometry;\n\texports.TubeBufferGeometry = TubeBufferGeometry;\n\texports.TorusKnotGeometry = TorusKnotGeometry;\n\texports.TorusKnotBufferGeometry = TorusKnotBufferGeometry;\n\texports.TorusGeometry = TorusGeometry;\n\texports.TorusBufferGeometry = TorusBufferGeometry;\n\texports.TextGeometry = TextGeometry;\n\texports.SphereBufferGeometry = SphereBufferGeometry;\n\texports.SphereGeometry = SphereGeometry;\n\texports.RingGeometry = RingGeometry;\n\texports.RingBufferGeometry = RingBufferGeometry;\n\texports.PlaneBufferGeometry = PlaneBufferGeometry;\n\texports.PlaneGeometry = PlaneGeometry;\n\texports.LatheGeometry = LatheGeometry;\n\texports.LatheBufferGeometry = LatheBufferGeometry;\n\texports.ShapeGeometry = ShapeGeometry;\n\texports.ExtrudeGeometry = ExtrudeGeometry;\n\texports.EdgesGeometry = EdgesGeometry;\n\texports.ConeGeometry = ConeGeometry;\n\texports.ConeBufferGeometry = ConeBufferGeometry;\n\texports.CylinderGeometry = CylinderGeometry;\n\texports.CylinderBufferGeometry = CylinderBufferGeometry;\n\texports.CircleBufferGeometry = CircleBufferGeometry;\n\texports.CircleGeometry = CircleGeometry;\n\texports.BoxBufferGeometry = BoxBufferGeometry;\n\texports.BoxGeometry = BoxGeometry;\n\texports.ShadowMaterial = ShadowMaterial;\n\texports.SpriteMaterial = SpriteMaterial;\n\texports.RawShaderMaterial = RawShaderMaterial;\n\texports.ShaderMaterial = ShaderMaterial;\n\texports.PointsMaterial = PointsMaterial;\n\texports.MultiMaterial = MultiMaterial;\n\texports.MeshPhysicalMaterial = MeshPhysicalMaterial;\n\texports.MeshStandardMaterial = MeshStandardMaterial;\n\texports.MeshPhongMaterial = MeshPhongMaterial;\n\texports.MeshNormalMaterial = MeshNormalMaterial;\n\texports.MeshLambertMaterial = MeshLambertMaterial;\n\texports.MeshDepthMaterial = MeshDepthMaterial;\n\texports.MeshBasicMaterial = MeshBasicMaterial;\n\texports.LineDashedMaterial = LineDashedMaterial;\n\texports.LineBasicMaterial = LineBasicMaterial;\n\texports.Material = Material;\n\texports.REVISION = REVISION;\n\texports.MOUSE = MOUSE;\n\texports.CullFaceNone = CullFaceNone;\n\texports.CullFaceBack = CullFaceBack;\n\texports.CullFaceFront = CullFaceFront;\n\texports.CullFaceFrontBack = CullFaceFrontBack;\n\texports.FrontFaceDirectionCW = FrontFaceDirectionCW;\n\texports.FrontFaceDirectionCCW = FrontFaceDirectionCCW;\n\texports.BasicShadowMap = BasicShadowMap;\n\texports.PCFShadowMap = PCFShadowMap;\n\texports.PCFSoftShadowMap = PCFSoftShadowMap;\n\texports.FrontSide = FrontSide;\n\texports.BackSide = BackSide;\n\texports.DoubleSide = DoubleSide;\n\texports.FlatShading = FlatShading;\n\texports.SmoothShading = SmoothShading;\n\texports.NoColors = NoColors;\n\texports.FaceColors = FaceColors;\n\texports.VertexColors = VertexColors;\n\texports.NoBlending = NoBlending;\n\texports.NormalBlending = NormalBlending;\n\texports.AdditiveBlending = AdditiveBlending;\n\texports.SubtractiveBlending = SubtractiveBlending;\n\texports.MultiplyBlending = MultiplyBlending;\n\texports.CustomBlending = CustomBlending;\n\texports.BlendingMode = BlendingMode;\n\texports.AddEquation = AddEquation;\n\texports.SubtractEquation = SubtractEquation;\n\texports.ReverseSubtractEquation = ReverseSubtractEquation;\n\texports.MinEquation = MinEquation;\n\texports.MaxEquation = MaxEquation;\n\texports.ZeroFactor = ZeroFactor;\n\texports.OneFactor = OneFactor;\n\texports.SrcColorFactor = SrcColorFactor;\n\texports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\n\texports.SrcAlphaFactor = SrcAlphaFactor;\n\texports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\n\texports.DstAlphaFactor = DstAlphaFactor;\n\texports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\n\texports.DstColorFactor = DstColorFactor;\n\texports.OneMinusDstColorFactor = OneMinusDstColorFactor;\n\texports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\n\texports.NeverDepth = NeverDepth;\n\texports.AlwaysDepth = AlwaysDepth;\n\texports.LessDepth = LessDepth;\n\texports.LessEqualDepth = LessEqualDepth;\n\texports.EqualDepth = EqualDepth;\n\texports.GreaterEqualDepth = GreaterEqualDepth;\n\texports.GreaterDepth = GreaterDepth;\n\texports.NotEqualDepth = NotEqualDepth;\n\texports.MultiplyOperation = MultiplyOperation;\n\texports.MixOperation = MixOperation;\n\texports.AddOperation = AddOperation;\n\texports.NoToneMapping = NoToneMapping;\n\texports.LinearToneMapping = LinearToneMapping;\n\texports.ReinhardToneMapping = ReinhardToneMapping;\n\texports.Uncharted2ToneMapping = Uncharted2ToneMapping;\n\texports.CineonToneMapping = CineonToneMapping;\n\texports.UVMapping = UVMapping;\n\texports.CubeReflectionMapping = CubeReflectionMapping;\n\texports.CubeRefractionMapping = CubeRefractionMapping;\n\texports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\n\texports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\n\texports.SphericalReflectionMapping = SphericalReflectionMapping;\n\texports.CubeUVReflectionMapping = CubeUVReflectionMapping;\n\texports.CubeUVRefractionMapping = CubeUVRefractionMapping;\n\texports.TextureMapping = TextureMapping;\n\texports.RepeatWrapping = RepeatWrapping;\n\texports.ClampToEdgeWrapping = ClampToEdgeWrapping;\n\texports.MirroredRepeatWrapping = MirroredRepeatWrapping;\n\texports.TextureWrapping = TextureWrapping;\n\texports.NearestFilter = NearestFilter;\n\texports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\n\texports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\n\texports.LinearFilter = LinearFilter;\n\texports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\n\texports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\n\texports.TextureFilter = TextureFilter;\n\texports.UnsignedByteType = UnsignedByteType;\n\texports.ByteType = ByteType;\n\texports.ShortType = ShortType;\n\texports.UnsignedShortType = UnsignedShortType;\n\texports.IntType = IntType;\n\texports.UnsignedIntType = UnsignedIntType;\n\texports.FloatType = FloatType;\n\texports.HalfFloatType = HalfFloatType;\n\texports.UnsignedShort4444Type = UnsignedShort4444Type;\n\texports.UnsignedShort5551Type = UnsignedShort5551Type;\n\texports.UnsignedShort565Type = UnsignedShort565Type;\n\texports.UnsignedInt248Type = UnsignedInt248Type;\n\texports.AlphaFormat = AlphaFormat;\n\texports.RGBFormat = RGBFormat;\n\texports.RGBAFormat = RGBAFormat;\n\texports.LuminanceFormat = LuminanceFormat;\n\texports.LuminanceAlphaFormat = LuminanceAlphaFormat;\n\texports.RGBEFormat = RGBEFormat;\n\texports.DepthFormat = DepthFormat;\n\texports.DepthStencilFormat = DepthStencilFormat;\n\texports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\n\texports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\n\texports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\n\texports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\n\texports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\n\texports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\n\texports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\n\texports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\n\texports.RGB_ETC1_Format = RGB_ETC1_Format;\n\texports.LoopOnce = LoopOnce;\n\texports.LoopRepeat = LoopRepeat;\n\texports.LoopPingPong = LoopPingPong;\n\texports.InterpolateDiscrete = InterpolateDiscrete;\n\texports.InterpolateLinear = InterpolateLinear;\n\texports.InterpolateSmooth = InterpolateSmooth;\n\texports.ZeroCurvatureEnding = ZeroCurvatureEnding;\n\texports.ZeroSlopeEnding = ZeroSlopeEnding;\n\texports.WrapAroundEnding = WrapAroundEnding;\n\texports.TrianglesDrawMode = TrianglesDrawMode;\n\texports.TriangleStripDrawMode = TriangleStripDrawMode;\n\texports.TriangleFanDrawMode = TriangleFanDrawMode;\n\texports.LinearEncoding = LinearEncoding;\n\texports.sRGBEncoding = sRGBEncoding;\n\texports.GammaEncoding = GammaEncoding;\n\texports.RGBEEncoding = RGBEEncoding;\n\texports.LogLuvEncoding = LogLuvEncoding;\n\texports.RGBM7Encoding = RGBM7Encoding;\n\texports.RGBM16Encoding = RGBM16Encoding;\n\texports.RGBDEncoding = RGBDEncoding;\n\texports.BasicDepthPacking = BasicDepthPacking;\n\texports.RGBADepthPacking = RGBADepthPacking;\n\texports.CubeGeometry = BoxGeometry;\n\texports.Face4 = Face4;\n\texports.LineStrip = LineStrip;\n\texports.LinePieces = LinePieces;\n\texports.MeshFaceMaterial = MultiMaterial;\n\texports.PointCloud = PointCloud;\n\texports.Particle = Sprite;\n\texports.ParticleSystem = ParticleSystem;\n\texports.PointCloudMaterial = PointCloudMaterial;\n\texports.ParticleBasicMaterial = ParticleBasicMaterial;\n\texports.ParticleSystemMaterial = ParticleSystemMaterial;\n\texports.Vertex = Vertex;\n\texports.EdgesHelper = EdgesHelper;\n\texports.WireframeHelper = WireframeHelper;\n\texports.GeometryUtils = GeometryUtils;\n\texports.ImageUtils = ImageUtils;\n\texports.Projector = Projector;\n\texports.CanvasRenderer = CanvasRenderer;\n\n\tObject.defineProperty(exports, '__esModule', { value: true });\n\n\tObject.defineProperty( exports, 'AudioContext', {\n\t\tget: function () {\n\t\t\treturn exports.getAudioContext();\n\t\t}\n\t});\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/three/build/three.js\n// module id = 6\n// module chunks = 0","module.exports = function( THREE ) {\n\t/**\n\t * @author qiao / https://github.com/qiao\n\t * @author mrdoob / http://mrdoob.com\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author erich666 / http://erichaines.com\n\t */\n\n// This set of controls performs orbiting, dollying (zooming), and panning.\n// Unlike TrackballControls, it maintains the \"up\" direction object.up (+Y by default).\n//\n// Orbit - left mouse / touch: one finger move\n// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n// Pan - right mouse, or arrow keys / touch: three finter swipe\n\n\tfunction OrbitControls( object, domElement ) {\n\n\t\tthis.object = object;\n\n\t\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t\t// Set to false to disable this control\n\t\tthis.enabled = true;\n\n\t\t// \"target\" sets the location of focus, where the object orbits around\n\t\tthis.target = new THREE.Vector3();\n\n\t\t// How far you can dolly in and out ( PerspectiveCamera only )\n\t\tthis.minDistance = 0;\n\t\tthis.maxDistance = Infinity;\n\n\t\t// How far you can zoom in and out ( OrthographicCamera only )\n\t\tthis.minZoom = 0;\n\t\tthis.maxZoom = Infinity;\n\n\t\t// How far you can orbit vertically, upper and lower limits.\n\t\t// Range is 0 to Math.PI radians.\n\t\tthis.minPolarAngle = 0; // radians\n\t\tthis.maxPolarAngle = Math.PI; // radians\n\n\t\t// How far you can orbit horizontally, upper and lower limits.\n\t\t// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n\t\tthis.minAzimuthAngle = - Infinity; // radians\n\t\tthis.maxAzimuthAngle = Infinity; // radians\n\n\t\t// Set to true to enable damping (inertia)\n\t\t// If damping is enabled, you must call controls.update() in your animation loop\n\t\tthis.enableDamping = false;\n\t\tthis.dampingFactor = 0.25;\n\n\t\t// This option actually enables dollying in and out; left as \"zoom\" for backwards compatibility.\n\t\t// Set to false to disable zooming\n\t\tthis.enableZoom = true;\n\t\tthis.zoomSpeed = 1.0;\n\n\t\t// Set to false to disable rotating\n\t\tthis.enableRotate = true;\n\t\tthis.rotateSpeed = 1.0;\n\n\t\t// Set to false to disable panning\n\t\tthis.enablePan = true;\n\t\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n\t\t// Set to true to automatically rotate around the target\n\t\t// If auto-rotate is enabled, you must call controls.update() in your animation loop\n\t\tthis.autoRotate = false;\n\t\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n\t\t// Set to false to disable use of the keys\n\t\tthis.enableKeys = true;\n\n\t\t// The four arrow keys\n\t\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n\t\t// Mouse buttons\n\t\tthis.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };\n\n\t\t// for reset\n\t\tthis.target0 = this.target.clone();\n\t\tthis.position0 = this.object.position.clone();\n\t\tthis.zoom0 = this.object.zoom;\n\n\t\t//\n\t\t// public methods\n\t\t//\n\n\t\tthis.getPolarAngle = function () {\n\n\t\t\treturn spherical.phi;\n\n\t\t};\n\n\t\tthis.getAzimuthalAngle = function () {\n\n\t\t\treturn spherical.theta;\n\n\t\t};\n\n\t\tthis.reset = function () {\n\n\t\t\tscope.target.copy( scope.target0 );\n\t\t\tscope.object.position.copy( scope.position0 );\n\t\t\tscope.object.zoom = scope.zoom0;\n\n\t\t\tscope.object.updateProjectionMatrix();\n\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\tscope.update();\n\n\t\t\tstate = STATE.NONE;\n\n\t\t};\n\n\t\t// this method is exposed, but perhaps it would be better if we can make it private...\n\t\tthis.update = function() {\n\n\t\t\tvar offset = new THREE.Vector3();\n\n\t\t\t// so camera.up is the orbit axis\n\t\t\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n\t\t\tvar quatInverse = quat.clone().inverse();\n\n\t\t\tvar lastPosition = new THREE.Vector3();\n\t\t\tvar lastQuaternion = new THREE.Quaternion();\n\n\t\t\treturn function update () {\n\n\t\t\t\tvar position = scope.object.position;\n\n\t\t\t\toffset.copy( position ).sub( scope.target );\n\n\t\t\t\t// rotate offset to \"y-axis-is-up\" space\n\t\t\t\toffset.applyQuaternion( quat );\n\n\t\t\t\t// angle from z-axis around y-axis\n\t\t\t\tspherical.setFromVector3( offset );\n\n\t\t\t\tif ( scope.autoRotate && state === STATE.NONE ) {\n\n\t\t\t\t\trotateLeft( getAutoRotationAngle() );\n\n\t\t\t\t}\n\n\t\t\t\tspherical.theta += sphericalDelta.theta;\n\t\t\t\tspherical.phi += sphericalDelta.phi;\n\n\t\t\t\t// restrict theta to be between desired limits\n\t\t\t\tspherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) );\n\n\t\t\t\t// restrict phi to be between desired limits\n\t\t\t\tspherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) );\n\n\t\t\t\tspherical.makeSafe();\n\n\n\t\t\t\tspherical.radius *= scale;\n\n\t\t\t\t// restrict radius to be between desired limits\n\t\t\t\tspherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) );\n\n\t\t\t\t// move target to panned location\n\t\t\t\tscope.target.add( panOffset );\n\n\t\t\t\toffset.setFromSpherical( spherical );\n\n\t\t\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\t\t\toffset.applyQuaternion( quatInverse );\n\n\t\t\t\tposition.copy( scope.target ).add( offset );\n\n\t\t\t\tscope.object.lookAt( scope.target );\n\n\t\t\t\tif ( scope.enableDamping === true ) {\n\n\t\t\t\t\tsphericalDelta.theta *= ( 1 - scope.dampingFactor );\n\t\t\t\t\tsphericalDelta.phi *= ( 1 - scope.dampingFactor );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tsphericalDelta.set( 0, 0, 0 );\n\n\t\t\t\t}\n\n\t\t\t\tscale = 1;\n\t\t\t\tpanOffset.set( 0, 0, 0 );\n\n\t\t\t\t// update condition is:\n\t\t\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\t\t\tif ( zoomChanged ||\n\t\t\t\t\tlastPosition.distanceToSquared( scope.object.position ) > EPS ||\n\t\t\t\t\t8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) {\n\n\t\t\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\t\t\tlastPosition.copy( scope.object.position );\n\t\t\t\t\tlastQuaternion.copy( scope.object.quaternion );\n\t\t\t\t\tzoomChanged = false;\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\t};\n\n\t\t}();\n\n\t\tthis.dispose = function() {\n\n\t\t\tscope.domElement.removeEventListener( 'contextmenu', onContextMenu, false );\n\t\t\tscope.domElement.removeEventListener( 'mousedown', onMouseDown, false );\n\t\t\tscope.domElement.removeEventListener( 'wheel', onMouseWheel, false );\n\n\t\t\tscope.domElement.removeEventListener( 'touchstart', onTouchStart, false );\n\t\t\tscope.domElement.removeEventListener( 'touchend', onTouchEnd, false );\n\t\t\tscope.domElement.removeEventListener( 'touchmove', onTouchMove, false );\n\n\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\n\t\t\twindow.removeEventListener( 'keydown', onKeyDown, false );\n\n\t\t\t//scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?\n\n\t\t};\n\n\t\t//\n\t\t// internals\n\t\t//\n\n\t\tvar scope = this;\n\n\t\tvar changeEvent = { type: 'change' };\n\t\tvar startEvent = { type: 'start' };\n\t\tvar endEvent = { type: 'end' };\n\n\t\tvar STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n\t\tvar state = STATE.NONE;\n\n\t\tvar EPS = 0.000001;\n\n\t\t// current position in spherical coordinates\n\t\tvar spherical = new THREE.Spherical();\n\t\tvar sphericalDelta = new THREE.Spherical();\n\n\t\tvar scale = 1;\n\t\tvar panOffset = new THREE.Vector3();\n\t\tvar zoomChanged = false;\n\n\t\tvar rotateStart = new THREE.Vector2();\n\t\tvar rotateEnd = new THREE.Vector2();\n\t\tvar rotateDelta = new THREE.Vector2();\n\n\t\tvar panStart = new THREE.Vector2();\n\t\tvar panEnd = new THREE.Vector2();\n\t\tvar panDelta = new THREE.Vector2();\n\n\t\tvar dollyStart = new THREE.Vector2();\n\t\tvar dollyEnd = new THREE.Vector2();\n\t\tvar dollyDelta = new THREE.Vector2();\n\n\t\tfunction getAutoRotationAngle() {\n\n\t\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n\t\t}\n\n\t\tfunction getZoomScale() {\n\n\t\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\n\t\t}\n\n\t\tfunction rotateLeft( angle ) {\n\n\t\t\tsphericalDelta.theta -= angle;\n\n\t\t}\n\n\t\tfunction rotateUp( angle ) {\n\n\t\t\tsphericalDelta.phi -= angle;\n\n\t\t}\n\n\t\tvar panLeft = function() {\n\n\t\t\tvar v = new THREE.Vector3();\n\n\t\t\treturn function panLeft( distance, objectMatrix ) {\n\n\t\t\t\tv.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix\n\t\t\t\tv.multiplyScalar( - distance );\n\n\t\t\t\tpanOffset.add( v );\n\n\t\t\t};\n\n\t\t}();\n\n\t\tvar panUp = function() {\n\n\t\t\tvar v = new THREE.Vector3();\n\n\t\t\treturn function panUp( distance, objectMatrix ) {\n\n\t\t\t\tv.setFromMatrixColumn( objectMatrix, 1 ); // get Y column of objectMatrix\n\t\t\t\tv.multiplyScalar( distance );\n\n\t\t\t\tpanOffset.add( v );\n\n\t\t\t};\n\n\t\t}();\n\n\t\t// deltaX and deltaY are in pixels; right and down are positive\n\t\tvar pan = function() {\n\n\t\t\tvar offset = new THREE.Vector3();\n\n\t\t\treturn function pan ( deltaX, deltaY ) {\n\n\t\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\t\t// perspective\n\t\t\t\t\tvar position = scope.object.position;\n\t\t\t\t\toffset.copy( position ).sub( scope.target );\n\t\t\t\t\tvar targetDistance = offset.length();\n\n\t\t\t\t\t// half of the fov is center to top of screen\n\t\t\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\t\t\tpanLeft( 2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix );\n\t\t\t\t\tpanUp( 2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix );\n\n\t\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\t\t// orthographic\n\t\t\t\t\tpanLeft( deltaX * ( scope.object.right - scope.object.left ) / scope.object.zoom / element.clientWidth, scope.object.matrix );\n\t\t\t\t\tpanUp( deltaY * ( scope.object.top - scope.object.bottom ) / scope.object.zoom / element.clientHeight, scope.object.matrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// camera neither orthographic nor perspective\n\t\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\t\t\t\t\tscope.enablePan = false;\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t}();\n\n\t\tfunction dollyIn( dollyScale ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tscale /= dollyScale;\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tscope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom * dollyScale ) );\n\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\t\t\tscope.enableZoom = false;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction dollyOut( dollyScale ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tscale *= dollyScale;\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tscope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / dollyScale ) );\n\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\t\t\tscope.enableZoom = false;\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\t\t// event callbacks - update the object state\n\t\t//\n\n\t\tfunction handleMouseDownRotate( event ) {\n\n\t\t\t//console.log( 'handleMouseDownRotate' );\n\n\t\t\trotateStart.set( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tfunction handleMouseDownDolly( event ) {\n\n\t\t\t//console.log( 'handleMouseDownDolly' );\n\n\t\t\tdollyStart.set( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tfunction handleMouseDownPan( event ) {\n\n\t\t\t//console.log( 'handleMouseDownPan' );\n\n\t\t\tpanStart.set( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tfunction handleMouseMoveRotate( event ) {\n\n\t\t\t//console.log( 'handleMouseMoveRotate' );\n\n\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\trotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\trotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\tscope.update();\n\n\t\t}\n\n\t\tfunction handleMouseMoveDolly( event ) {\n\n\t\t\t//console.log( 'handleMouseMoveDolly' );\n\n\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\n\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\tdollyIn( getZoomScale() );\n\n\t\t\t} else if ( dollyDelta.y < 0 ) {\n\n\t\t\t\tdollyOut( getZoomScale() );\n\n\t\t\t}\n\n\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\tscope.update();\n\n\t\t}\n\n\t\tfunction handleMouseMovePan( event ) {\n\n\t\t\t//console.log( 'handleMouseMovePan' );\n\n\t\t\tpanEnd.set( event.clientX, event.clientY );\n\n\t\t\tpanDelta.subVectors( panEnd, panStart );\n\n\t\t\tpan( panDelta.x, panDelta.y );\n\n\t\t\tpanStart.copy( panEnd );\n\n\t\t\tscope.update();\n\n\t\t}\n\n\t\tfunction handleMouseUp( event ) {\n\n\t\t\t//console.log( 'handleMouseUp' );\n\n\t\t}\n\n\t\tfunction handleMouseWheel( event ) {\n\n\t\t\t//console.log( 'handleMouseWheel' );\n\n\t\t\tif ( event.deltaY < 0 ) {\n\n\t\t\t\tdollyOut( getZoomScale() );\n\n\t\t\t} else if ( event.deltaY > 0 ) {\n\n\t\t\t\tdollyIn( getZoomScale() );\n\n\t\t\t}\n\n\t\t\tscope.update();\n\n\t\t}\n\n\t\tfunction handleKeyDown( event ) {\n\n\t\t\t//console.log( 'handleKeyDown' );\n\n\t\t\tswitch ( event.keyCode ) {\n\n\t\t\t\tcase scope.keys.UP:\n\t\t\t\t\tpan( 0, scope.keyPanSpeed );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\t\tpan( 0, - scope.keyPanSpeed );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.LEFT:\n\t\t\t\t\tpan( scope.keyPanSpeed, 0 );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.RIGHT:\n\t\t\t\t\tpan( - scope.keyPanSpeed, 0 );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction handleTouchStartRotate( event ) {\n\n\t\t\t//console.log( 'handleTouchStartRotate' );\n\n\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\n\t\t}\n\n\t\tfunction handleTouchStartDolly( event ) {\n\n\t\t\t//console.log( 'handleTouchStartDolly' );\n\n\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\n\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\tdollyStart.set( 0, distance );\n\n\t\t}\n\n\t\tfunction handleTouchStartPan( event ) {\n\n\t\t\t//console.log( 'handleTouchStartPan' );\n\n\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\n\t\t}\n\n\t\tfunction handleTouchMoveRotate( event ) {\n\n\t\t\t//console.log( 'handleTouchMoveRotate' );\n\n\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\trotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\trotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\tscope.update();\n\n\t\t}\n\n\t\tfunction handleTouchMoveDolly( event ) {\n\n\t\t\t//console.log( 'handleTouchMoveDolly' );\n\n\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\n\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\tdollyEnd.set( 0, distance );\n\n\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\tdollyOut( getZoomScale() );\n\n\t\t\t} else if ( dollyDelta.y < 0 ) {\n\n\t\t\t\tdollyIn( getZoomScale() );\n\n\t\t\t}\n\n\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\tscope.update();\n\n\t\t}\n\n\t\tfunction handleTouchMovePan( event ) {\n\n\t\t\t//console.log( 'handleTouchMovePan' );\n\n\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\n\t\t\tpanDelta.subVectors( panEnd, panStart );\n\n\t\t\tpan( panDelta.x, panDelta.y );\n\n\t\t\tpanStart.copy( panEnd );\n\n\t\t\tscope.update();\n\n\t\t}\n\n\t\tfunction handleTouchEnd( event ) {\n\n\t\t\t//console.log( 'handleTouchEnd' );\n\n\t\t}\n\n\t\t//\n\t\t// event handlers - FSM: listen for events and reset state\n\t\t//\n\n\t\tfunction onMouseDown( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif ( event.button === scope.mouseButtons.ORBIT ) {\n\n\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\thandleMouseDownRotate( event );\n\n\t\t\t\tstate = STATE.ROTATE;\n\n\t\t\t} else if ( event.button === scope.mouseButtons.ZOOM ) {\n\n\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\thandleMouseDownDolly( event );\n\n\t\t\t\tstate = STATE.DOLLY;\n\n\t\t\t} else if ( event.button === scope.mouseButtons.PAN ) {\n\n\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\thandleMouseDownPan( event );\n\n\t\t\t\tstate = STATE.PAN;\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) {\n\n\t\t\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\n\t\t\t\tscope.dispatchEvent( startEvent );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onMouseMove( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\thandleMouseMoveRotate( event );\n\n\t\t\t} else if ( state === STATE.DOLLY ) {\n\n\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\thandleMouseMoveDolly( event );\n\n\t\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\thandleMouseMovePan( event );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onMouseUp( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\thandleMouseUp( event );\n\n\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\n\t\t\tscope.dispatchEvent( endEvent );\n\n\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tfunction onMouseWheel( event ) {\n\n\t\t\tif ( scope.enabled === false || scope.enableZoom === false || ( state !== STATE.NONE && state !== STATE.ROTATE ) ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\thandleMouseWheel( event );\n\n\t\t\tscope.dispatchEvent( startEvent ); // not sure why these are here...\n\t\t\tscope.dispatchEvent( endEvent );\n\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\n\t\t\tif ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;\n\n\t\t\thandleKeyDown( event );\n\n\t\t}\n\n\t\tfunction onTouchStart( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tswitch ( event.touches.length ) {\n\n\t\t\t\tcase 1:\t// one-fingered touch: rotate\n\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\t\thandleTouchStartRotate( event );\n\n\t\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\t// two-fingered touch: dolly\n\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\t\thandleTouchStartDolly( event );\n\n\t\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\t\thandleTouchStartPan( event );\n\n\t\t\t\t\tstate = STATE.TOUCH_PAN;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tstate = STATE.NONE;\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) {\n\n\t\t\t\tscope.dispatchEvent( startEvent );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onTouchMove( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tswitch ( event.touches.length ) {\n\n\t\t\t\tcase 1: // one-fingered touch: rotate\n\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return; // is this needed?...\n\n\t\t\t\t\thandleTouchMoveRotate( event );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2: // two-fingered touch: dolly\n\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return; // is this needed?...\n\n\t\t\t\t\thandleTouchMoveDolly( event );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return; // is this needed?...\n\n\t\t\t\t\thandleTouchMovePan( event );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tstate = STATE.NONE;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onTouchEnd( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\thandleTouchEnd( event );\n\n\t\t\tscope.dispatchEvent( endEvent );\n\n\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tfunction onContextMenu( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t}\n\n\t\t//\n\n\t\tscope.domElement.addEventListener( 'contextmenu', onContextMenu, false );\n\n\t\tscope.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\t\tscope.domElement.addEventListener( 'wheel', onMouseWheel, false );\n\n\t\tscope.domElement.addEventListener( 'touchstart', onTouchStart, false );\n\t\tscope.domElement.addEventListener( 'touchend', onTouchEnd, false );\n\t\tscope.domElement.addEventListener( 'touchmove', onTouchMove, false );\n\n\t\twindow.addEventListener( 'keydown', onKeyDown, false );\n\n\t\t// force an update at start\n\n\t\tthis.update();\n\n\t};\n\n\tOrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n\tOrbitControls.prototype.constructor = OrbitControls;\n\n\tObject.defineProperties( OrbitControls.prototype, {\n\n\t\tcenter: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .center has been renamed to .target' );\n\t\t\t\treturn this.target;\n\n\t\t\t}\n\n\t\t},\n\n\t\t// backward compatibility\n\n\t\tnoZoom: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\treturn ! this.enableZoom;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\tthis.enableZoom = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoRotate: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\treturn ! this.enableRotate;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\tthis.enableRotate = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoPan: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\treturn ! this.enablePan;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\tthis.enablePan = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoKeys: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\treturn ! this.enableKeys;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\tthis.enableKeys = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tstaticMoving : {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\treturn ! this.enableDamping;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\tthis.enableDamping = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdynamicDampingFactor : {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\treturn this.dampingFactor;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\tthis.dampingFactor = value;\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\treturn OrbitControls;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/three-orbit-controls/index.js\n// module id = 7\n// module chunks = 0","const THREE = require('three')\nimport House, {linkedListToString} from './house-lsystem.js'\n\nvar ParserState = function(pos, dir, r) {\n return {\n pos: new THREE.Vector3(pos.x, pos.y, pos.z),\n dir: new THREE.Vector3(dir.x, dir.y, dir.z),\n radius: r\n }\n}\n \nexport default class Parser {\n \n constructor(position, direction, scene, iterations, radius) {\n this.initPos = position;\n this.initDir = direction;\n\n this.state = new ParserState(this.initPos, this.initDir, radius);\n this.stack = [];\n\n this.scene = scene;\n this.totalIter = iterations;\n\n this.renderGrammar = {\n 'L' : this.addLevel.bind(this),\n '[' : this.saveState.bind(this),\n ']' : this.applyState.bind(this),\n '0' : this.shiftState.bind(this, 0),\n '1' : this.shiftState.bind(this, 1),\n '2' : this.shiftState.bind(this, 2),\n '3' : this.shiftState.bind(this, 3),\n '4' : this.shiftState.bind(this, 4),\n '5' : this.shiftState.bind(this, 5),\n '6' : this.shiftState.bind(this, 6),\n '7' : this.shiftState.bind(this, 7),\n 'r' : this.decreaseRadius.bind(this)\n };\n\n this.stdDir = [ \n new THREE.Vector3(-1, 0, 1).normalize(),\n new THREE.Vector3(0, 0, 1),\n new THREE.Vector3(1, 0, 1).normalize(),\n new THREE.Vector3(1, 0, 0),\n new THREE.Vector3(1, 0, -1).normalize(),\n new THREE.Vector3(0, 0, -1),\n new THREE.Vector3(-1, 0, -1).normalize(),\n new THREE.Vector3(-1, 0, 0) \n ];\n }\n\n saveState() {\n var newState = new ParserState(this.state.pos, this.state.dir, this.state.radius);\n this.stack.push(newState);\n }\n\n applyState() {\n this.state = this.stack.pop();\n }\n\n shiftState(posNum) {\n \n var currR = this.state.radius;\n\n var pos = this.state.pos;\n var newP = new THREE.Vector3(pos.x, pos.y, pos.z).addScaledVector(this.stdDir[posNum], 3 * currR / 4);\n \n this.state.radius = currR / 4;\n this.state.pos = newP;\n }\n\n decreaseRadius() {\n this.state.radius *= 0.7;\n }\n\n addLevel() {\n if (Math.random() > 0.5) {\n this.addCylinder();\n\n } else {\n this.addBox();\n }\n }\n\n addCylinder() {\n var currR = this.state.radius;\n var outerR = currR - (Math.random() * currR / 2);\n var innerR = outerR - (Math.random() * outerR / 2);\n this.state.radius = innerR;\n\n var height = (currR * 0.1) + Math.random() * Math.pow(this.currIdx, 0.25);\n\n var color = new THREE.Color(Math.random(), Math.random(), Math.random());\n\n var geom = new THREE.CylinderGeometry(innerR, outerR, height, 16);\n var material = new THREE.MeshLambertMaterial({color: color});\n var cyl = new THREE.Mesh(geom, material);\n\n var pos = this.state.pos;\n var dir = this.state.dir;\n \n pos.addScaledVector(dir, height / 2);\n cyl.position.set(pos.x, pos.y, pos.z);\n\n cyl.lookAt(pos.addScaledVector(dir, height / 2));\n cyl.rotateX(Math.PI / 2);\n\n this.scene.add(cyl);\n }\n\n addBox() {\n var currR = this.state.radius;\n var width = currR - (Math.random() * currR / 2); \n var depth = currR - (Math.random() * currR / 2);\n this.state.radius = Math.min(width, depth) / 2;\n\n var height = (currR * 0.1) + Math.random() * Math.pow(this.currIdx, 0.25);\n\n var color = new THREE.Color(Math.random(), Math.random(), Math.random());\n\n var geom = new THREE.BoxGeometry(width, height, depth);\n var material = new THREE.MeshLambertMaterial({color: color});\n var box = new THREE.Mesh(geom, material);\n\n var pos = this.state.pos;\n var dir = this.state.dir;\n \n pos.addScaledVector(dir, height / 2);\n box.position.set(pos.x, pos.y, pos.z);\n\n box.lookAt(pos.addScaledVector(dir, height / 2));\n box.rotateX(Math.PI / 2);\n\n this.scene.add(box);\n }\n\n renderSymbol(symbolNode) {\n var func = this.renderGrammar[symbolNode.symbol];\n if (func) {\n func();\n }\n };\n\n renderSymbols(linkedList) {\n if (!linkedList) {\n console.log(\"Cant find house\");\n return;\n }\n this.currIdx = 0;\n for(var currentNode = linkedList.head; currentNode != null; currentNode = currentNode.next) \n {\n this.renderSymbol(currentNode);\n this.currIdx++;\n }\n }\n\n render() {\n var house = new House();\n this.renderSymbols(house.doIterations(this.totalIter));\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/house-parser.js","const THREE = require('three')\nfunction Rule(prob, str) {\n this.probability = prob;\n this.successorString = str;\n}\n\nfunction Node(symbol, iter) {\n this.next = null;\n this.prev = null;\n this.symbol = symbol;\n this.iter = iter;\n}\n\nfunction LinkedList(pos) {\n this.head = null;\n this.length = 0;\n this.scale = new THREE.Vector3(1.0, 1.0, 1.0);\n this.position = new THREE.Vector3(0, 0, 0);\n if (pos)\n {\n this.position = pos;\n }\n}\n\nLinkedList.prototype.getTailNode = function() {\n var currentNode = this.head;\n while (currentNode.next != null) {\n currentNode = currentNode.next;\n }\n return currentNode;\n}\n\nLinkedList.prototype.add = function(symbol, iter) {\n var node = new Node(symbol, iter);\n var currentNode = this.head;\n if (currentNode == null) {\n this.head = node;\n this.length = 1;\n return;\n }\n var tail = this.getTailNode();\n this.link(tail, node);\n this.length++;\n}\n\nLinkedList.prototype.link = function(first, second) {\n if (first != null)\n {\n first.next = second;\n if (second != null)\n {\n second.prev = first;\n }\n }\n}\n\nexport function stringToLinkedList(input_string, iter) {\n var ll = new LinkedList();\n for (var i = 0; i < input_string.length; i++) {\n ll.add(input_string[i], iter);\n }\n return ll;\n}\n\nexport function linkedListToString(linkedList) {\n var result = \"\";\n var currentNode = linkedList.head;\n while (currentNode != null) {\n result += currentNode.symbol;\n currentNode = currentNode.next;\n }\n return result;\n}\n\nfunction replaceNode(linkedList, node, replacementString, iter) {\n \n var nodeBefore = node.prev;\n var nodeAfter = node.next;\n\n var stringList = stringToLinkedList(replacementString, iter);\n var tail = stringList.getTailNode();\n\n if (nodeBefore == null && nodeAfter == null) {\n linkedList.head = stringList.head;\n }\n else if (nodeBefore == null)\n {\n linkedList.head = stringList.head;\n linkedList.link(tail, nodeAfter);\n }\n else if (nodeAfter == null) {\n linkedList.link(nodeBefore, stringList.head);\n }\n else {\n linkedList.link(nodeBefore, stringList.head);\n linkedList.link(tail, nodeAfter);\n }\n\n linkedList.length+= replacementString.length - 1;\n return linkedList;\n}\n\nexport default function House() {\n this.axiom = \"X\";\n this.grammar = {};\n this.grammar['X'] = [\n new Rule(0.5, 'LX'),\n new Rule(0.25, 'LS'),\n new Rule(0.25, 'LSrX')\n ];\n this.grammar['S'] = [\n new Rule(0.35, 'D'),\n new Rule(0.25, 'T'),\n new Rule(0.25, 'Q'),\n new Rule(0.15, '[0LX][1LX][2LX][3LX][4LX][5LX][6LX][7LX]')\n ];\n this.grammar['D'] = [\n new Rule(0.04, '[0LX][1LX]'), new Rule(0.04, '[0LX][2LX]'), new Rule(0.04, '[0LX][3LX]'), new Rule(0.04, '[0LX][4LX]'), new Rule(0.04, '[0LX][5LX]'), new Rule(0.04, '[0LX][6LX]'), new Rule(0.04, '[0LX][7LX]'),\n new Rule(0.04, '[1LX][2LX]'), new Rule(0.04, '[1LX][3LX]'), new Rule(0.04, '[1LX][4LX]'), new Rule(0.04, '[1LX][5LX]'), new Rule(0.04, '[1LX][6LX]'), new Rule(0.04, '[1LX][7LX]'),\n new Rule(0.04, '[2LX][3LX]'), new Rule(0.04, '[2LX][4LX]'), new Rule(0.04, '[2LX][5LX]'), new Rule(0.04, '[2LX][6LX]'), new Rule(0.04, '[2LX][7LX]'),\n new Rule(0.04, '[3LX][4LX]'), new Rule(0.04, '[3LX][5LX]'), new Rule(0.04, '[3LX][6LX]'), new Rule(0.04, '[3LX][7LX]'),\n new Rule(0.04, '[4LX][5LX]'), new Rule(0.04, '[4LX][6LX]'), new Rule(0.04, '[4LX][7LX]'),\n new Rule(0.04, '[5LX][6LX]'), new Rule(0.04, '[5LX][7LX]'),\n new Rule(0.04, '[6LX][7LX]')\n ];\n this.grammar['T'] = [\n new Rule(0.028, '[0LX][1LX][2LX]'), new Rule(0.028, '[0LX][1LX][3LX]'), new Rule(0.028, '[0LX][1LX][4LX]'), new Rule(0.028, '[0LX][1LX][5LX]'), new Rule(0.028, '[0LX][1LX][6LX]'), new Rule(0.028, '[0LX][1LX][7LX]'), new Rule(0.028, '[0LX][2LX][3LX]'), new Rule(0.028, '[0LX][2LX][4LX]'), new Rule(0.028, '[0LX][2LX][5LX]'), new Rule(0.028, '[0LX][2LX][6LX]'), new Rule(0.028, '[0LX][2LX][7LX]'), new Rule(0.028, '[0LX][3LX][4LX]'), new Rule(0.028, '[0LX][3LX][5LX]'), new Rule(0.028, '[0LX][3LX][6LX]'), new Rule(0.028, '[0LX][3LX][7LX]'), new Rule(0.028, '[0LX][4LX][5LX]'), new Rule(0.028, '[0LX][4LX][6LX]'), new Rule(0.028, '[0LX][4LX][7LX]'), new Rule(0.028, '[0LX][5LX][6LX]'), new Rule(0.028, '[0LX][5LX][7LX]'), new Rule(0.028, '[0LX][6LX][7LX]'),\n new Rule(0.028, '[1LX][2LX][3LX]'), new Rule(0.028, '[1LX][2LX][4LX]'), new Rule(0.028, '[1LX][2LX][5LX]'), new Rule(0.028, '[1LX][2LX][6LX]'), new Rule(0.028, '[1LX][2LX][7LX]'), new Rule(0.028, '[1LX][3LX][4LX]'), new Rule(0.028, '[1LX][3LX][5LX]'), new Rule(0.028, '[1LX][3LX][6LX]'), new Rule(0.028, '[1LX][3LX][7LX]'), new Rule(0.028, '[1LX][4LX][5LX]'), new Rule(0.028, '[1LX][4LX][6LX]'), new Rule(0.028, '[1LX][4LX][7LX]'), new Rule(0.028, '[1LX][5LX][6LX]'), new Rule(0.028, '[1LX][5LX][7LX]'), new Rule(0.028, '[1LX][6LX][7LX]'),\n new Rule(0.028, '[2LX][3LX][4LX]'), new Rule(0.028, '[2LX][3LX][5LX]'), new Rule(0.028, '[2LX][3LX][6LX]'), new Rule(0.028, '[2LX][3LX][7LX]'), new Rule(0.028, '[2LX][4LX][5LX]'), new Rule(0.028, '[2LX][4LX][6LX]'), new Rule(0.028, '[2LX][4LX][7LX]'), new Rule(0.028, '[2LX][5LX][6LX]'), new Rule(0.028, '[2LX][5LX][7LX]'), new Rule(0.028, '[2LX][6LX][7LX]'),\n new Rule(0.028, '[3LX][4LX][5LX]'), new Rule(0.028, '[3LX][4LX][6LX]'), new Rule(0.028, '[3LX][4LX][7LX]'), new Rule(0.028, '[3LX][5LX][6LX]'), new Rule(0.028, '[3LX][5LX][7LX]'), new Rule(0.028, '[3LX][6LX][7LX]'),\n new Rule(0.028, '[4LX][5LX][6LX]'), new Rule(0.028, '[4LX][5LX][7LX]'), new Rule(0.028, '[4LX][6LX][7LX]'),\n new Rule(0.028, '[5LX][6LX][7LX]'),\n ];\n this.grammar['Q'] = [\n new Rule(0.028, '[0LX][1LX][2LX][3LX]'), new Rule(0.028, '[0LX][1LX][2LX][4LX]'), new Rule(0.028, '[0LX][1LX][2LX][5LX]'), new Rule(0.028, '[0LX][1LX][2LX][6LX]'), new Rule(0.028, '[0LX][1LX][2LX][7LX]'), new Rule(0.028, '[0LX][1LX][3LX][4LX]'), new Rule(0.028, '[0LX][1LX][3LX][5LX]'), new Rule(0.028, '[0LX][1LX][3LX][6LX]'), new Rule(0.028, '[0LX][1LX][3LX][7LX]'), new Rule(0.028, '[0LX][1LX][4LX][5LX]'), new Rule(0.028, '[0LX][1LX][5LX][6LX]'), new Rule(0.028, '[0LX][1LX][5LX][7LX]'), new Rule(0.028, '[0LX][1LX][6LX][7LX]'), new Rule(0.028, '[0LX][2LX][3LX][4LX]'), new Rule(0.028, '[0LX][2LX][3LX][5LX]'), new Rule(0.028, '[0LX][2LX][3LX][6LX]'), new Rule(0.028, '[0LX][2LX][3LX][7LX]'), new Rule(0.028, '[0LX][2LX][4LX][5LX]'), new Rule(0.028, '[0LX][2LX][4LX][6LX]'), new Rule(0.028, '[0LX][2LX][4LX][7LX]'), new Rule(0.028, '[0LX][2LX][5LX][6LX]'), new Rule(0.028, '[0LX][2LX][5LX][7LX]'), new Rule(0.028, '[0LX][2LX][6LX][7LX]'), new Rule(0.028, '[0LX][3LX][4LX][5LX]'), new Rule(0.028, '[0LX][3LX][4LX][6LX]'), new Rule(0.028, '[0LX][3LX][4LX][7LX]'), new Rule(0.028, '[0LX][3LX][5LX][6LX]'), new Rule(0.028, '[0LX][3LX][5LX][7LX]'), new Rule(0.028, '[0LX][3LX][6LX][7LX]'), new Rule(0.028, '[0LX][4LX][5LX][6LX]'), new Rule(0.028, '[0LX][4LX][5LX][7LX]'), new Rule(0.028, '[0LX][4LX][6LX][7LX]'), new Rule(0.028, '[0LX][5LX][6LX][7LX]'), \n new Rule(0.028, '[1LX][2LX][3LX][4LX]'), new Rule(0.028, '[1LX][2LX][3LX][5LX]'), new Rule(0.028, '[1LX][2LX][3LX][6LX]'), new Rule(0.028, '[1LX][2LX][3LX][7LX]'), new Rule(0.028, '[1LX][2LX][4LX][5LX]'), new Rule(0.028, '[1LX][2LX][4LX][6LX]'), new Rule(0.028, '[1LX][2LX][4LX][7LX]'), new Rule(0.028, '[1LX][2LX][5LX][6LX]'), new Rule(0.028, '[1LX][2LX][5LX][7LX]'), new Rule(0.028, '[1LX][2LX][6LX][7LX]'), new Rule(0.028, '[1LX][3LX][4LX][5LX]'), new Rule(0.028, '[1LX][3LX][4LX][6LX]'), new Rule(0.028, '[1LX][3LX][4LX][7LX]'), new Rule(0.028, '[1LX][3LX][5LX][6LX]'), new Rule(0.028, '[1LX][3LX][5LX][7LX]'), new Rule(0.028, '[1LX][3LX][6LX][7LX]'), new Rule(0.028, '[1LX][4LX][5LX][6LX]'), new Rule(0.028, '[1LX][4LX][5LX][7LX]'), new Rule(0.028, '[1LX][4LX][6LX][7LX]'), new Rule(0.028, '[1LX][5LX][6LX][7LX]'), \n new Rule(0.028, '[2LX][3LX][4LX][5LX]'), new Rule(0.028, '[2LX][3LX][4LX][6LX]'), new Rule(0.028, '[2LX][3LX][4LX][7LX]'), new Rule(0.028, '[2LX][3LX][5LX][6LX]'), new Rule(0.028, '[2LX][3LX][5LX][7LX]'), new Rule(0.028, '[2LX][3LX][6LX][7LX]'), new Rule(0.028, '[2LX][4LX][5LX][6LX]'), new Rule(0.028, '[2LX][4LX][5LX][7LX]'), new Rule(0.028, '[2LX][4LX][6LX][7LX]'), new Rule(0.028, '[2LX][5LX][6LX][7LX]'), \n new Rule(0.028, '[3LX][4LX][5LX][6LX]'), new Rule(0.028, '[3LX][4LX][5LX][7LX]'), new Rule(0.028, '[3LX][4LX][6LX][7LX]'),\n new Rule(0.028, '[4LX][5LX][6LX][7LX]')\n ];\n\n this.updateAxiom = function(axiom) {\n if (typeof axiom !== \"undefined\") {\n this.axiom = axiom;\n }\n }\n\n this.updateGrammar = function(rule) {\n if (typeof axiom !== \"undefined\") {\n this.axiom = axiom;\n }\n }\n\n this.doIterations = function(n) {\n var lSystemLL = stringToLinkedList(this.axiom, 0);\n lSystemLL.position = this.position;\n for (var i = 0; i < n; i++) {\n var currentNode = lSystemLL.head;\n \n while (currentNode != null) {\n var next = currentNode.next;\n var symbol = currentNode.symbol;\n var iter = currentNode.iter;\n\n if (this.grammar[symbol])\n {\n var rand = Math.random();\n var sum = 0.0;\n var rules = this.grammar[symbol];\n for (var j = 0; j < rules.length; j++)\n {\n sum += rules[j].probability;\n if (rand <= sum)\n {\n replaceNode(lSystemLL, currentNode, rules[j].successorString, i + 1);\n break;\n }\n }\n }\n currentNode = next;\n }\n }\n return lSystemLL;\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/house-lsystem.js"],"sourceRoot":""} \ No newline at end of file diff --git a/cameraBulge.gif b/cameraBulge.gif new file mode 100644 index 00000000..0f3d571c Binary files /dev/null and b/cameraBulge.gif differ diff --git a/changeColor.gif b/changeColor.gif new file mode 100644 index 00000000..6a697f12 Binary files /dev/null and b/changeColor.gif differ diff --git a/colors.jpg b/colors.jpg new file mode 100644 index 00000000..22ea7ddb Binary files /dev/null and b/colors.jpg differ diff --git a/framework.png b/framework.png new file mode 100644 index 00000000..4c1a6190 Binary files /dev/null and b/framework.png differ diff --git a/index.html b/index.html new file mode 100755 index 00000000..3ee251a2 --- /dev/null +++ b/index.html @@ -0,0 +1,19 @@ + + + + Final Project + + + + + + \ No newline at end of file diff --git a/jbl.png b/jbl.png new file mode 100644 index 00000000..57e9116b Binary files /dev/null and b/jbl.png differ diff --git a/lay1.png b/lay1.png new file mode 100644 index 00000000..c7c26806 Binary files /dev/null and b/lay1.png differ diff --git a/lay2.png b/lay2.png new file mode 100644 index 00000000..0bd5f5f6 Binary files /dev/null and b/lay2.png differ diff --git a/lay3.png b/lay3.png new file mode 100644 index 00000000..f0e8e132 Binary files /dev/null and b/lay3.png differ diff --git a/music.mp3 b/music.mp3 new file mode 100644 index 00000000..6ee565b5 Binary files /dev/null and b/music.mp3 differ diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 00000000..cf767603 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/babylon b/node_modules/.bin/babylon new file mode 120000 index 00000000..c2adc01b --- /dev/null +++ b/node_modules/.bin/babylon @@ -0,0 +1 @@ +../babylon/bin/babylon.js \ No newline at end of file diff --git a/node_modules/.bin/errno b/node_modules/.bin/errno new file mode 120000 index 00000000..5a98e539 --- /dev/null +++ b/node_modules/.bin/errno @@ -0,0 +1 @@ +../errno/cli.js \ No newline at end of file diff --git a/node_modules/.bin/gasket b/node_modules/.bin/gasket new file mode 120000 index 00000000..e9a96b9d --- /dev/null +++ b/node_modules/.bin/gasket @@ -0,0 +1 @@ +../gasket/bin.js \ No newline at end of file diff --git a/node_modules/.bin/gh-pages-deploy b/node_modules/.bin/gh-pages-deploy new file mode 120000 index 00000000..c7f6f8f5 --- /dev/null +++ b/node_modules/.bin/gh-pages-deploy @@ -0,0 +1 @@ +../gh-pages-deploy/bin/gh-pages-deploy \ No newline at end of file diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc new file mode 120000 index 00000000..7237604c --- /dev/null +++ b/node_modules/.bin/jsesc @@ -0,0 +1 @@ +../jsesc/bin/jsesc \ No newline at end of file diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 120000 index 00000000..217f3798 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify new file mode 120000 index 00000000..ed9009c5 --- /dev/null +++ b/node_modules/.bin/loose-envify @@ -0,0 +1 @@ +../loose-envify/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 120000 index 00000000..fbb7ee0e --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1 @@ +../mime/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 120000 index 00000000..017896ce --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/ncp b/node_modules/.bin/ncp new file mode 120000 index 00000000..1c026480 --- /dev/null +++ b/node_modules/.bin/ncp @@ -0,0 +1 @@ +../ncp/bin/ncp \ No newline at end of file diff --git a/node_modules/.bin/ndjson b/node_modules/.bin/ndjson new file mode 120000 index 00000000..88b0e189 --- /dev/null +++ b/node_modules/.bin/ndjson @@ -0,0 +1 @@ +../ndjson/cli.js \ No newline at end of file diff --git a/node_modules/.bin/npm-execspawn b/node_modules/.bin/npm-execspawn new file mode 120000 index 00000000..1198974f --- /dev/null +++ b/node_modules/.bin/npm-execspawn @@ -0,0 +1 @@ +../npm-execspawn/bin.js \ No newline at end of file diff --git a/node_modules/.bin/regjsparser b/node_modules/.bin/regjsparser new file mode 120000 index 00000000..91cec777 --- /dev/null +++ b/node_modules/.bin/regjsparser @@ -0,0 +1 @@ +../regjsparser/bin/parser \ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 120000 index 00000000..4cd49a49 --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/.bin/sha.js b/node_modules/.bin/sha.js new file mode 120000 index 00000000..3c761051 --- /dev/null +++ b/node_modules/.bin/sha.js @@ -0,0 +1 @@ +../sha.js/bin.js \ No newline at end of file diff --git a/node_modules/.bin/uglifyjs b/node_modules/.bin/uglifyjs new file mode 120000 index 00000000..fef3468b --- /dev/null +++ b/node_modules/.bin/uglifyjs @@ -0,0 +1 @@ +../uglify-js/bin/uglifyjs \ No newline at end of file diff --git a/node_modules/.bin/webpack b/node_modules/.bin/webpack new file mode 120000 index 00000000..d462c1d1 --- /dev/null +++ b/node_modules/.bin/webpack @@ -0,0 +1 @@ +../webpack/bin/webpack.js \ No newline at end of file diff --git a/node_modules/.bin/webpack-dev-server b/node_modules/.bin/webpack-dev-server new file mode 120000 index 00000000..242fe0a6 --- /dev/null +++ b/node_modules/.bin/webpack-dev-server @@ -0,0 +1 @@ +../webpack-dev-server/bin/webpack-dev-server.js \ No newline at end of file diff --git a/node_modules/accepts/HISTORY.md b/node_modules/accepts/HISTORY.md new file mode 100755 index 00000000..0477ed71 --- /dev/null +++ b/node_modules/accepts/HISTORY.md @@ -0,0 +1,212 @@ +1.3.3 / 2016-05-02 +================== + + * deps: mime-types@~2.1.11 + - deps: mime-db@~1.23.0 + * deps: negotiator@0.6.1 + - perf: improve `Accept` parsing speed + - perf: improve `Accept-Charset` parsing speed + - perf: improve `Accept-Encoding` parsing speed + - perf: improve `Accept-Language` parsing speed + +1.3.2 / 2016-03-08 +================== + + * deps: mime-types@~2.1.10 + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + - deps: mime-db@~1.22.0 + +1.3.1 / 2016-01-19 +================== + + * deps: mime-types@~2.1.9 + - deps: mime-db@~1.21.0 + +1.3.0 / 2015-09-29 +================== + + * deps: mime-types@~2.1.7 + - deps: mime-db@~1.19.0 + * deps: negotiator@0.6.0 + - Fix including type extensions in parameters in `Accept` parsing + - Fix parsing `Accept` parameters with quoted equals + - Fix parsing `Accept` parameters with quoted semicolons + - Lazy-load modules from main entry point + - perf: delay type concatenation until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove closures getting spec properties + - perf: remove a closure from media type parsing + - perf: remove property delete from media type parsing + +1.2.13 / 2015-09-06 +=================== + + * deps: mime-types@~2.1.6 + - deps: mime-db@~1.18.0 + +1.2.12 / 2015-07-30 +=================== + + * deps: mime-types@~2.1.4 + - deps: mime-db@~1.16.0 + +1.2.11 / 2015-07-16 +=================== + + * deps: mime-types@~2.1.3 + - deps: mime-db@~1.15.0 + +1.2.10 / 2015-07-01 +=================== + + * deps: mime-types@~2.1.2 + - deps: mime-db@~1.14.0 + +1.2.9 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - perf: fix deopt during mapping + +1.2.8 / 2015-06-07 +================== + + * deps: mime-types@~2.1.0 + - deps: mime-db@~1.13.0 + * perf: avoid argument reassignment & argument slice + * perf: avoid negotiator recursive construction + * perf: enable strict mode + * perf: remove unnecessary bitwise operator + +1.2.7 / 2015-05-10 +================== + + * deps: negotiator@0.5.3 + - Fix media type parameter matching to be case-insensitive + +1.2.6 / 2015-05-07 +================== + + * deps: mime-types@~2.0.11 + - deps: mime-db@~1.9.1 + * deps: negotiator@0.5.2 + - Fix comparing media types with quoted values + - Fix splitting media types with quoted commas + +1.2.5 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - deps: mime-db@~1.8.0 + +1.2.4 / 2015-02-14 +================== + + * Support Node.js 0.6 + * deps: mime-types@~2.0.9 + - deps: mime-db@~1.7.0 + * deps: negotiator@0.5.1 + - Fix preference sorting to be stable for long acceptable lists + +1.2.3 / 2015-01-31 +================== + + * deps: mime-types@~2.0.8 + - deps: mime-db@~1.6.0 + +1.2.2 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - deps: mime-db@~1.5.0 + +1.2.1 / 2014-12-30 +================== + + * deps: mime-types@~2.0.5 + - deps: mime-db@~1.3.1 + +1.2.0 / 2014-12-19 +================== + + * deps: negotiator@0.5.0 + - Fix list return order when large accepted list + - Fix missing identity encoding when q=0 exists + - Remove dynamic building of Negotiator class + +1.1.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - deps: mime-db@~1.3.0 + +1.1.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - deps: mime-db@~1.2.0 + +1.1.2 / 2014-10-14 +================== + + * deps: negotiator@0.4.9 + - Fix error when media type has invalid parameter + +1.1.1 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - deps: mime-db@~1.1.0 + * deps: negotiator@0.4.8 + - Fix all negotiations to be case-insensitive + - Stable sort preferences of same quality according to client order + +1.1.0 / 2014-09-02 +================== + + * update `mime-types` + +1.0.7 / 2014-07-04 +================== + + * Fix wrong type returned from `type` when match after unknown extension + +1.0.6 / 2014-06-24 +================== + + * deps: negotiator@0.4.7 + +1.0.5 / 2014-06-20 +================== + + * fix crash when unknown extension given + +1.0.4 / 2014-06-19 +================== + + * use `mime-types` + +1.0.3 / 2014-06-11 +================== + + * deps: negotiator@0.4.6 + - Order by specificity when quality is the same + +1.0.2 / 2014-05-29 +================== + + * Fix interpretation when header not in request + * deps: pin negotiator@0.4.5 + +1.0.1 / 2014-01-18 +================== + + * Identity encoding isn't always acceptable + * deps: negotiator@~0.4.0 + +1.0.0 / 2013-12-27 +================== + + * Genesis diff --git a/node_modules/accepts/LICENSE b/node_modules/accepts/LICENSE new file mode 100755 index 00000000..06166077 --- /dev/null +++ b/node_modules/accepts/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/accepts/README.md b/node_modules/accepts/README.md new file mode 100755 index 00000000..ae36676f --- /dev/null +++ b/node_modules/accepts/README.md @@ -0,0 +1,135 @@ +# accepts + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). Extracted from [koa](https://www.npmjs.com/package/koa) for general use. + +In addition to negotiator, it allows: + +- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`. +- Allows type shorthands such as `json`. +- Returns `false` when no types match +- Treats non-existent headers as `*` + +## Installation + +```sh +npm install accepts +``` + +## API + +```js +var accepts = require('accepts') +``` + +### accepts(req) + +Create a new `Accepts` object for the given `req`. + +#### .charset(charsets) + +Return the first accepted charset. If nothing in `charsets` is accepted, +then `false` is returned. + +#### .charsets() + +Return the charsets that the request accepts, in the order of the client's +preference (most preferred first). + +#### .encoding(encodings) + +Return the first accepted encoding. If nothing in `encodings` is accepted, +then `false` is returned. + +#### .encodings() + +Return the encodings that the request accepts, in the order of the client's +preference (most preferred first). + +#### .language(languages) + +Return the first accepted language. If nothing in `languages` is accepted, +then `false` is returned. + +#### .languages() + +Return the languages that the request accepts, in the order of the client's +preference (most preferred first). + +#### .type(types) + +Return the first accepted type (and it is returned as the same text as what +appears in the `types` array). If nothing in `types` is accepted, then `false` +is returned. + +The `types` array can contain full MIME types or file extensions. Any value +that is not a full MIME types is passed to `require('mime-types').lookup`. + +#### .types() + +Return the types that the request accepts, in the order of the client's +preference (most preferred first). + +## Examples + +### Simple type negotiation + +This simple example shows how to use `accepts` to return a different typed +respond body based on what the client wants to accept. The server lists it's +preferences in order and will get back the best match between the client and +server. + +```js +var accepts = require('accepts') +var http = require('http') + +function app(req, res) { + var accept = accepts(req) + + // the order of this list is significant; should be server preferred order + switch(accept.type(['json', 'html'])) { + case 'json': + res.setHeader('Content-Type', 'application/json') + res.write('{"hello":"world!"}') + break + case 'html': + res.setHeader('Content-Type', 'text/html') + res.write('hello, world!') + break + default: + // the fallback is text/plain, so no need to specify it above + res.setHeader('Content-Type', 'text/plain') + res.write('hello, world!') + break + } + + res.end() +} + +http.createServer(app).listen(3000) +``` + +You can test this out with the cURL program: +```sh +curl -I -H'Accept: text/html' http://localhost:3000/ +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/accepts.svg +[npm-url]: https://npmjs.org/package/accepts +[node-version-image]: https://img.shields.io/node/v/accepts.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg +[travis-url]: https://travis-ci.org/jshttp/accepts +[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/accepts +[downloads-image]: https://img.shields.io/npm/dm/accepts.svg +[downloads-url]: https://npmjs.org/package/accepts diff --git a/node_modules/accepts/index.js b/node_modules/accepts/index.js new file mode 100755 index 00000000..e80192ab --- /dev/null +++ b/node_modules/accepts/index.js @@ -0,0 +1,231 @@ +/*! + * accepts + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var Negotiator = require('negotiator') +var mime = require('mime-types') + +/** + * Module exports. + * @public + */ + +module.exports = Accepts + +/** + * Create a new Accepts object for the given req. + * + * @param {object} req + * @public + */ + +function Accepts(req) { + if (!(this instanceof Accepts)) + return new Accepts(req) + + this.headers = req.headers + this.negotiator = new Negotiator(req) +} + +/** + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single mime type string + * such as "application/json", the extension name + * such as "json" or an array `["json", "html", "text/plain"]`. When a list + * or array is given the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * this.types('html'); + * // => "html" + * + * // Accept: text/*, application/json + * this.types('html'); + * // => "html" + * this.types('text/html'); + * // => "text/html" + * this.types('json', 'text'); + * // => "json" + * this.types('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * this.types('image/png'); + * this.types('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * this.types(['html', 'json']); + * this.types('html', 'json'); + * // => "json" + * + * @param {String|Array} types... + * @return {String|Array|Boolean} + * @public + */ + +Accepts.prototype.type = +Accepts.prototype.types = function (types_) { + var types = types_ + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length) + for (var i = 0; i < types.length; i++) { + types[i] = arguments[i] + } + } + + // no types, return all requested types + if (!types || types.length === 0) { + return this.negotiator.mediaTypes() + } + + if (!this.headers.accept) return types[0]; + var mimes = types.map(extToMime); + var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)); + var first = accepts[0]; + if (!first) return false; + return types[mimes.indexOf(first)]; +} + +/** + * Return accepted encodings or best fit based on `encodings`. + * + * Given `Accept-Encoding: gzip, deflate` + * an array sorted by quality is returned: + * + * ['gzip', 'deflate'] + * + * @param {String|Array} encodings... + * @return {String|Array} + * @public + */ + +Accepts.prototype.encoding = +Accepts.prototype.encodings = function (encodings_) { + var encodings = encodings_ + + // support flattened arguments + if (encodings && !Array.isArray(encodings)) { + encodings = new Array(arguments.length) + for (var i = 0; i < encodings.length; i++) { + encodings[i] = arguments[i] + } + } + + // no encodings, return all requested encodings + if (!encodings || encodings.length === 0) { + return this.negotiator.encodings() + } + + return this.negotiator.encodings(encodings)[0] || false +} + +/** + * Return accepted charsets or best fit based on `charsets`. + * + * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` + * an array sorted by quality is returned: + * + * ['utf-8', 'utf-7', 'iso-8859-1'] + * + * @param {String|Array} charsets... + * @return {String|Array} + * @public + */ + +Accepts.prototype.charset = +Accepts.prototype.charsets = function (charsets_) { + var charsets = charsets_ + + // support flattened arguments + if (charsets && !Array.isArray(charsets)) { + charsets = new Array(arguments.length) + for (var i = 0; i < charsets.length; i++) { + charsets[i] = arguments[i] + } + } + + // no charsets, return all requested charsets + if (!charsets || charsets.length === 0) { + return this.negotiator.charsets() + } + + return this.negotiator.charsets(charsets)[0] || false +} + +/** + * Return accepted languages or best fit based on `langs`. + * + * Given `Accept-Language: en;q=0.8, es, pt` + * an array sorted by quality is returned: + * + * ['es', 'pt', 'en'] + * + * @param {String|Array} langs... + * @return {Array|String} + * @public + */ + +Accepts.prototype.lang = +Accepts.prototype.langs = +Accepts.prototype.language = +Accepts.prototype.languages = function (languages_) { + var languages = languages_ + + // support flattened arguments + if (languages && !Array.isArray(languages)) { + languages = new Array(arguments.length) + for (var i = 0; i < languages.length; i++) { + languages[i] = arguments[i] + } + } + + // no languages, return all requested languages + if (!languages || languages.length === 0) { + return this.negotiator.languages() + } + + return this.negotiator.languages(languages)[0] || false +} + +/** + * Convert extnames to mime. + * + * @param {String} type + * @return {String} + * @private + */ + +function extToMime(type) { + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if mime is valid. + * + * @param {String} type + * @return {String} + * @private + */ + +function validMime(type) { + return typeof type === 'string'; +} diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json new file mode 100755 index 00000000..d3d1af53 --- /dev/null +++ b/node_modules/accepts/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + { + "raw": "accepts@~1.3.3", + "scope": null, + "escapedName": "accepts", + "name": "accepts", + "rawSpec": "~1.3.3", + "spec": ">=1.3.3 <1.4.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression" + ] + ], + "_from": "accepts@>=1.3.3 <1.4.0", + "_id": "accepts@1.3.3", + "_inCache": true, + "_location": "/accepts", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/accepts-1.3.3.tgz_1462251932032_0.7092335098423064" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "raw": "accepts@~1.3.3", + "scope": null, + "escapedName": "accepts", + "name": "accepts", + "rawSpec": "~1.3.3", + "spec": ">=1.3.3 <1.4.0", + "type": "range" + }, + "_requiredBy": [ + "/compression", + "/express", + "/serve-index" + ], + "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "_shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca", + "_shrinkwrap": null, + "_spec": "accepts@~1.3.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression", + "bugs": { + "url": "https://github.com/jshttp/accepts/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "dependencies": { + "mime-types": "~2.1.11", + "negotiator": "0.6.1" + }, + "description": "Higher-level content negotiation", + "devDependencies": { + "istanbul": "0.4.3", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca", + "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "gitHead": "3e925b1e65ed7da2798849683d49814680dfa426", + "homepage": "https://github.com/jshttp/accepts#readme", + "keywords": [ + "content", + "negotiation", + "accept", + "accepts" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "accepts", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/accepts.git" + }, + "scripts": { + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.3.3" +} diff --git a/node_modules/acorn/.editorconfig b/node_modules/acorn/.editorconfig new file mode 100755 index 00000000..c14d5c67 --- /dev/null +++ b/node_modules/acorn/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true diff --git a/node_modules/acorn/.gitattributes b/node_modules/acorn/.gitattributes new file mode 100755 index 00000000..fcadb2cf --- /dev/null +++ b/node_modules/acorn/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/node_modules/acorn/.npmignore b/node_modules/acorn/.npmignore new file mode 100755 index 00000000..ecba2911 --- /dev/null +++ b/node_modules/acorn/.npmignore @@ -0,0 +1,3 @@ +/.tern-port +/test +/local diff --git a/node_modules/acorn/.tern-project b/node_modules/acorn/.tern-project new file mode 100755 index 00000000..6718ce07 --- /dev/null +++ b/node_modules/acorn/.tern-project @@ -0,0 +1,6 @@ +{ + "plugins": { + "node": true, + "es_modules": true + } +} \ No newline at end of file diff --git a/node_modules/acorn/.travis.yml b/node_modules/acorn/.travis.yml new file mode 100755 index 00000000..d9ee88ba --- /dev/null +++ b/node_modules/acorn/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +sudo: false +node_js: + - '0.12' + - '4' + - '5' + - '6' diff --git a/node_modules/acorn/AUTHORS b/node_modules/acorn/AUTHORS new file mode 100755 index 00000000..1b2061cd --- /dev/null +++ b/node_modules/acorn/AUTHORS @@ -0,0 +1,59 @@ +List of Acorn contributors. Updated before every release. + +Adrian Rakovsky +Alistair Braidwood +Amila Welihinda +Andres Suarez +Angelo +Aparajita Fishman +Arian Stolwijk +Artem Govorov +Brandon Mills +Charles Hughes +Conrad Irwin +Daniel Tschinder +David Bonnet +Domenico Matteo +ForbesLindesay +Forbes Lindesay +Gilad Peleg +impinball +Ingvar Stepanyan +Jackson Ray Hamilton +Jesse McCarthy +Jiaxing Wang +Joel Kemp +Johannes Herr +Jordan Klassen +Jürg Lehni +keeyipchan +Keheliya Gallaba +Kevin Irish +Kevin Kwok +krator +Marijn Haverbeke +Martin Carlberg +Mathias Bynens +Mathieu 'p01' Henri +Matthew Bastien +Max Schaefer +Max Zerzouri +Mihai Bazon +Mike Rennie +Nicholas C. Zakas +Nick Fitzgerald +Olivier Thomann +Oskar Schöldström +Paul Harper +Peter Rust +PlNG +Prayag Verma +ReadmeCritic +r-e-d +Richard Gibson +Rich Harris +Rich-Harris +Sebastian McKenzie +Timothy Gu +Toru Nagashima +zsjforcn diff --git a/node_modules/acorn/CHANGELOG.md b/node_modules/acorn/CHANGELOG.md new file mode 100755 index 00000000..16b8212e --- /dev/null +++ b/node_modules/acorn/CHANGELOG.md @@ -0,0 +1,159 @@ +## 3.3.0 (2016-07-25) + +### Bug fixes + +Fix bug in tokenizing of regexp operator after a function declaration. + +Fix parser crash when parsing an array pattern with a hole. + +### New features + +Implement check against complex argument lists in functions that +enable strict mode in ES7. + +## 3.2.0 (2016-06-07) + +### Bug fixes + +Improve handling of lack of unicode regexp support in host +environment. + +Properly reject shorthand properties whose name is a keyword. + +Don't crash when the loose parser is called without options object. + +### New features + +Visitors created with `visit.make` now have their base as _prototype_, +rather than copying properties into a fresh object. + +Make it possible to use `visit.ancestor` with a walk state. + +## 3.1.0 (2016-04-18) + +### Bug fixes + +Fix issue where the loose parser created invalid TemplateElement nodes +for unclosed template literals. + +Properly tokenize the division operator directly after a function +expression. + +Allow trailing comma in destructuring arrays. + +### New features + +The walker now allows defining handlers for `CatchClause` nodes. + +## 3.0.4 (2016-02-25) + +### Fixes + +Allow update expressions as left-hand-side of the ES7 exponential +operator. + +## 3.0.2 (2016-02-10) + +### Fixes + +Fix bug that accidentally made `undefined` a reserved word when +parsing ES7. + +## 3.0.0 (2016-02-10) + +### Breaking changes + +The default value of the `ecmaVersion` option is now 6 (used to be 5). + +Support for comprehension syntax (which was dropped from the draft +spec) has been removed. + +### Fixes + +`let` and `yield` are now “contextual keywords”, meaning you can +mostly use them as identifiers in ES5 non-strict code. + +A parenthesized class or function expression after `export default` is +now parsed correctly. + +### New features + +When `ecmaVersion` is set to 7, Acorn will parse the exponentiation +operator (`**`). + +The identifier character ranges are now based on Unicode 8.0.0. + +Plugins can now override the `raiseRecoverable` method to override the +way non-critical errors are handled. + +## 2.7.0 (2016-01-04) + +### Fixes + +Stop allowing rest parameters in setters. + +Make sure the loose parser always attaches a `local` property to +`ImportNamespaceSpecifier` nodes. + +Disallow `y` rexexp flag in ES5. + +Disallow `\00` and `\000` escapes in strict mode. + +Raise an error when an import name is a reserved word. + +## 2.6.4 (2015-11-12) + +### Fixes + +Fix crash in loose parser when parsing invalid object pattern. + +### New features + +Support plugins in the loose parser. + +## 2.6.2 (2015-11-10) + +### Fixes + +Don't crash when no options object is passed. + +## 2.6.0 (2015-11-09) + +### Fixes + +Add `await` as a reserved word in module sources. + +Disallow `yield` in a parameter default value for a generator. + +Forbid using a comma after a rest pattern in an array destructuring. + +### New features + +Support parsing stdin in command-line tool. + +## 2.5.2 (2015-10-27) + +### Fixes + +Fix bug where the walker walked an exported `let` statement as an +expression. + +## 2.5.0 (2015-10-27) + +### Fixes + +Fix tokenizer support in the command-line tool. + +In the loose parser, don't allow non-string-literals as import +sources. + +Stop allowing `new.target` outside of functions. + +Remove legacy `guard` and `guardedHandler` properties from try nodes. + +Stop allowing multiple `__proto__` properties on an object literal in +strict mode. + +Don't allow rest parameters to be non-identifier patterns. + +Check for duplicate paramter names in arrow functions. diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE new file mode 100755 index 00000000..a35ebf44 --- /dev/null +++ b/node_modules/acorn/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2016 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/acorn/README.md b/node_modules/acorn/README.md new file mode 100755 index 00000000..0c514d5e --- /dev/null +++ b/node_modules/acorn/README.md @@ -0,0 +1,407 @@ +# Acorn + +[![Build Status](https://travis-ci.org/ternjs/acorn.svg?branch=master)](https://travis-ci.org/ternjs/acorn) +[![NPM version](https://img.shields.io/npm/v/acorn.svg)](https://www.npmjs.com/package/acorn) +[Author funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?force)](https://marijnhaverbeke.nl/fund/) + +A tiny, fast JavaScript parser, written completely in JavaScript. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/ternjs/acorn/blob/master/LICENSE). + +You are welcome to +[report bugs](https://github.com/ternjs/acorn/issues) or create pull +requests on [github](https://github.com/ternjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.ternjs.net). + +## Installation + +The easiest way to install acorn is with [`npm`][npm]. + +[npm]: https://www.npmjs.com/ + +```sh +npm install acorn +``` + +Alternately, download the source. + +```sh +git clone https://github.com/ternjs/acorn.git +``` + +## Components + +When run in a CommonJS (node.js) or AMD environment, exported values +appear in the interfaces exposed by the individual files, as usual. +When loaded in the browser (Acorn works in any JS-enabled browser more +recent than IE5) without any kind of module management, a single +global object `acorn` will be defined, and all the exported properties +will be added to that. + +### Main parser + +This is implemented in `dist/acorn.js`, and is what you get when you +`require("acorn")` in node.js. + +**parse**`(input, options)` is used to parse a JavaScript program. +The `input` parameter is a string, `options` can be undefined or an +object setting some of the options listed below. The return value will +be an abstract syntax tree object as specified by the +[ESTree spec][estree]. + +When encountering a syntax error, the parser will raise a +`SyntaxError` object with a meaningful message. The error object will +have a `pos` property that indicates the character offset at which the +error occurred, and a `loc` object that contains a `{line, column}` +object referring to that same position. + +[estree]: https://github.com/estree/estree + +- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be + either 3, 5, 6, or 7. This influences support for strict mode, the set + of reserved words, and support for new syntax features. Default is 6. + + **NOTE**: Only 'stage 4' (finalized) ECMAScript 7 features are being + implemented by Acorn. That means that most of the draft standard is + not yet being parsed. + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. + +- **onInsertedSemicolon**: If given a callback, that callback will be + called whenever a missing semicolon is inserted by the parser. The + callback will be given the character offset of the point where the + semicolon is inserted as argument, and if `locations` is on, also a + `{line, column}` object representing this position. + +- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing + commas. + +- **allowReserved**: If `false`, using a reserved word will generate + an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher + versions. When given the value `"never"`, reserved words and + keywords can also not be used as property names (as in Internet + Explorer's old parser). + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed. + +- **allowHashBang**: When this is enabled (off by default), if the + code starts with the characters `#!` (as in a shellscript), the + first line will be treated as a comment. + +- **locations**: When `true`, each node has a `loc` object attached + with `start` and `end` subobjects, each of which contains the + one-based line and zero-based column numbers in `{line, column}` + form. Default is `false`. + +- **onToken**: If a function is passed for this option, each found + token will be passed in same format as tokens returned from + `tokenizer().getToken()`. + + If array is passed, each found token is pushed to it. + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **onComment**: If a function is passed for this option, whenever a + comment is encountered the function will be called with the + following parameters: + + - `block`: `true` if the comment is a block comment, false if it + is a line comment. + - `text`: The content of the comment. + - `start`: Character offset of the start of the comment. + - `end`: Character offset of the end of the comment. + + When the `locations` options is on, the `{line, column}` locations + of the comment’s start and end are passed as two additional + parameters. + + If array is passed for this option, each found comment is pushed + to it as object in Esprima format: + + ```javascript + { + "type": "Line" | "Block", + "value": "comment text", + "start": Number, + "end": Number, + // If `locations` option is on: + "loc": { + "start": {line: Number, column: Number} + "end": {line: Number, column: Number} + }, + // If `ranges` option is on: + "range": [Number, Number] + } + ``` + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **ranges**: Nodes have their start and end characters offsets + recorded in `start` and `end` properties (directly on the node, + rather than the `loc` object, which holds line/column data. To also + add a [semi-standardized][range] `range` property holding a + `[start, end]` array with the same numbers, set the `ranges` option + to `true`. + +- **program**: It is possible to parse multiple files into a single + AST by passing the tree produced by parsing the first file as the + `program` option in subsequent parses. This will add the toplevel + forms of the parsed file to the "Program" (top) node of an existing + parse tree. + +- **sourceFile**: When the `locations` option is `true`, you can pass + this option to add a `source` attribute in every node’s `loc` + object. Note that the contents of this option are not examined or + processed in any way; you are free to use whatever format you + choose. + +- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property + will be added (regardless of the `location` option) directly to the + nodes, rather than the `loc` object. + +- **preserveParens**: If this option is `true`, parenthesized expressions + are represented by (non-standard) `ParenthesizedExpression` nodes + that have a single `expression` property containing the expression + inside parentheses. + +[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + +**parseExpressionAt**`(input, offset, options)` will parse a single +expression in a string, and return its AST. It will not complain if +there is more of the string left after the expression. + +**getLineInfo**`(input, offset)` can be used to get a `{line, +column}` object for a given program string and character offset. + +**tokenizer**`(input, options)` returns an object with a `getToken` +method that can be called repeatedly to get the next token, a `{start, +end, type, value}` object (with added `loc` property when the +`locations` option is enabled and `range` property when the `ranges` +option is enabled). When the token's type is `tokTypes.eof`, you +should stop calling the method, since it will keep returning that same +token forever. + +In ES6 environment, returned result can be used as any other +protocol-compliant iterable: + +```javascript +for (let token of acorn.tokenizer(str)) { + // iterate over the tokens +} + +// transform code to array of tokens: +var tokens = [...acorn.tokenizer(str)]; +``` + +**tokTypes** holds an object mapping names to the token type objects +that end up in the `type` properties of tokens. + +#### Note on using with [Escodegen][escodegen] + +Escodegen supports generating comments from AST, attached in +Esprima-specific format. In order to simulate same format in +Acorn, consider following example: + +```javascript +var comments = [], tokens = []; + +var ast = acorn.parse('var x = 42; // answer', { + // collect ranges for each node + ranges: true, + // collect comments in Esprima's format + onComment: comments, + // collect token ranges + onToken: tokens +}); + +// attach comments using collected information +escodegen.attachComments(ast, comments, tokens); + +// generate code +console.log(escodegen.generate(ast, {comment: true})); +// > 'var x = 42; // answer' +``` + +[escodegen]: https://github.com/estools/escodegen + +### dist/acorn_loose.js ### + +This file implements an error-tolerant parser. It exposes a single +function. The loose parser is accessible in node.js via `require("acorn/dist/acorn_loose")`. + +**parse_dammit**`(input, options)` takes the same arguments and +returns the same syntax tree as the `parse` function in `acorn.js`, +but never raises an error, and will do its best to parse syntactically +invalid code in as meaningful a way as it can. It'll insert identifier +nodes with name `"✖"` as placeholders in places where it can't make +sense of the input. Depends on `acorn.js`, because it uses the same +tokenizer. + +### dist/walk.js ### + +Implements an abstract syntax tree walker. Will store its interface in +`acorn.walk` when loaded without a module system. + +**simple**`(node, visitors, base, state)` does a 'simple' walk over +a tree. `node` should be the AST node to walk, and `visitors` an +object with properties whose names correspond to node types in the +[ESTree spec][estree]. The properties should contain functions +that will be called with the node object and, if applicable the state +at that point. The last two arguments are optional. `base` is a walker +algorithm, and `state` is a start state. The default walker will +simply visit all statements and expressions and not produce a +meaningful state. (An example of a use of state is to track scope at +each point in the tree.) + +**ancestor**`(node, visitors, base, state)` does a 'simple' walk over +a tree, building up an array of ancestor nodes (including the current node) +and passing the array to the callbacks as a third parameter. + +**recursive**`(node, state, functions, base)` does a 'recursive' +walk, where the walker functions are responsible for continuing the +walk on the child nodes of their target node. `state` is the start +state, and `functions` should contain an object that maps node types +to walker functions. Such functions are called with `(node, state, c)` +arguments, and can cause the walk to continue on a sub-node by calling +the `c` argument on it with `(node, state)` arguments. The optional +`base` argument provides the fallback walker functions for node types +that aren't handled in the `functions` object. If not given, the +default walkers will be used. + +**make**`(functions, base)` builds a new walker object by using the +walker functions in `functions` and filling in the missing ones by +taking defaults from `base`. + +**findNodeAt**`(node, start, end, test, base, state)` tries to +locate a node in a tree at the given start and/or end offsets, which +satisfies the predicate `test`. `start` and `end` can be either `null` +(as wildcard) or a number. `test` may be a string (indicating a node +type) or a function that takes `(nodeType, node)` arguments and +returns a boolean indicating whether this node is interesting. `base` +and `state` are optional, and can be used to specify a custom walker. +Nodes are tested from inner to outer, so if two nodes match the +boundaries, the inner one will be preferred. + +**findNodeAround**`(node, pos, test, base, state)` is a lot like +`findNodeAt`, but will match any node that exists 'around' (spanning) +the given position. + +**findNodeAfter**`(node, pos, test, base, state)` is similar to +`findNodeAround`, but will match all nodes *after* the given position +(testing outer nodes before inner nodes). + +## Command line interface + +The `bin/acorn` utility can be used to parse a file from the command +line. It accepts as arguments its input file and the following +options: + +- `--ecma3|--ecma5|--ecma6|--ecma7`: Sets the ECMAScript version to parse. Default is + version 5. + +- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. + +- `--locations`: Attaches a "loc" object to each node with "start" and + "end" subobjects, each of which contains the one-based line and + zero-based column numbers in `{line, column}` form. + +- `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment. + +- `--compact`: No whitespace is used in the AST output. + +- `--silent`: Do not output the AST, just return the exit status. + +- `--help`: Print the usage information and quit. + +The utility spits out the syntax tree as JSON data. + +## Build system + +Acorn is written in ECMAScript 6, as a set of small modules, in the +project's `src` directory, and compiled down to bigger ECMAScript 3 +files in `dist` using [Browserify](http://browserify.org) and +[Babel](http://babeljs.io/). If you are already using Babel, you can +consider including the modules directly. + +The command-line test runner (`npm test`) uses the ES6 modules. The +browser-based test page (`test/index.html`) uses the compiled modules. +The `bin/build-acorn.js` script builds the latter from the former. + +If you are working on Acorn, you'll probably want to try the code out +directly, without an intermediate build step. In your scripts, you can +register the Babel require shim like this: + + require("babel-core/register") + +That will allow you to directly `require` the ES6 modules. + +## Plugins + +Acorn is designed support allow plugins which, within reasonable +bounds, redefine the way the parser works. Plugins can add new token +types and new tokenizer contexts (if necessary), and extend methods in +the parser object. This is not a clean, elegant API—using it requires +an understanding of Acorn's internals, and plugins are likely to break +whenever those internals are significantly changed. But still, it is +_possible_, in this way, to create parsers for JavaScript dialects +without forking all of Acorn. And in principle it is even possible to +combine such plugins, so that if you have, for example, a plugin for +parsing types and a plugin for parsing JSX-style XML literals, you +could load them both and parse code with both JSX tags and types. + +A plugin should register itself by adding a property to +`acorn.plugins`, which holds a function. Calling `acorn.parse`, a +`plugins` option can be passed, holding an object mapping plugin names +to configuration values (or just `true` for plugins that don't take +options). After the parser object has been created, the initialization +functions for the chosen plugins are called with `(parser, +configValue)` arguments. They are expected to use the `parser.extend` +method to extend parser methods. For example, the `readToken` method +could be extended like this: + +```javascript +parser.extend("readToken", function(nextMethod) { + return function(code) { + console.log("Reading a token!") + return nextMethod.call(this, code) + } +}) +``` + +The `nextMethod` argument passed to `extend`'s second argument is the +previous value of this method, and should usually be called through to +whenever the extended method does not handle the call itself. + +Similarly, the loose parser allows plugins to register themselves via +`acorn.pluginsLoose`. The extension mechanism is the same as for the +normal parser: + +```javascript +looseParser.extend("readToken", function(nextMethod) { + return function() { + console.log("Reading a token in the loose parser!") + return nextMethod.call(this) + } +}) +``` + +### Existing plugins + + - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) + - [`acorn-es7-plugin`](https://github.com/MatAtBread/acorn-es7-plugin/): Parse [async/await syntax proposal](https://github.com/tc39/ecmascript-asyncawait) + - [`acorn-object-spread`](https://github.com/UXtemple/acorn-object-spread): Parse [object spread syntax proposal](https://github.com/sebmarkbage/ecmascript-rest-spread) + - [`acorn-es7`](https://www.npmjs.com/package/acorn-es7): Parse [decorator syntax proposal](https://github.com/wycats/javascript-decorators) + - [`acorn-objj`](https://www.npmjs.com/package/acorn-objj): [Objective-J](http://www.cappuccino-project.org/learn/objective-j.html) language parser built as Acorn plugin diff --git a/node_modules/acorn/bin/acorn b/node_modules/acorn/bin/acorn new file mode 100755 index 00000000..cf4acd56 --- /dev/null +++ b/node_modules/acorn/bin/acorn @@ -0,0 +1,65 @@ +#!/usr/bin/env node +'use strict'; + +var path = require('path'); +var fs = require('fs'); +var acorn = require('../dist/acorn.js'); + +var infile; +var forceFile; +var silent = false; +var compact = false; +var tokenize = false; +var options = {} + +function help(status) { + var print = (status == 0) ? console.log : console.error + print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7]") + print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]") + process.exit(status) +} + +for (var i = 2; i < process.argv.length; ++i) { + var arg = process.argv[i] + if ((arg == "-" || arg[0] != "-") && !infile) infile = arg + else if (arg == "--" && !infile && i + 2 == process.argv.length) forceFile = infile = process.argv[++i] + else if (arg == "--ecma3") options.ecmaVersion = 3 + else if (arg == "--ecma5") options.ecmaVersion = 5 + else if (arg == "--ecma6") options.ecmaVersion = 6 + else if (arg == "--ecma7") options.ecmaVersion = 7 + else if (arg == "--locations") options.locations = true + else if (arg == "--allow-hash-bang") options.allowHashBang = true + else if (arg == "--silent") silent = true + else if (arg == "--compact") compact = true + else if (arg == "--help") help(0) + else if (arg == "--tokenize") tokenize = true + else if (arg == "--module") options.sourceType = 'module' + else help(1) +} + +function run(code) { + var result + if (!tokenize) { + try { result = acorn.parse(code, options) } + catch(e) { console.error(e.message); process.exit(1) } + } else { + result = [] + var tokenizer = acorn.tokenizer(code, options), token + while (true) { + try { token = tokenizer.getToken() } + catch(e) { console.error(e.message); process.exit(1) } + result.push(token) + if (token.type == acorn.tokTypes.eof) break + } + } + if (!silent) console.log(JSON.stringify(result, null, compact ? null : 2)) +} + +if (forceFile || infile && infile != "-") { + run(fs.readFileSync(infile, "utf8")) +} else { + var code = "" + process.stdin.resume() + process.stdin.on("data", function (chunk) { return code += chunk; }) + process.stdin.on("end", function () { return run(code); }) +} \ No newline at end of file diff --git a/node_modules/acorn/bin/generate-identifier-regex.js b/node_modules/acorn/bin/generate-identifier-regex.js new file mode 100755 index 00000000..100e8cf2 --- /dev/null +++ b/node_modules/acorn/bin/generate-identifier-regex.js @@ -0,0 +1,55 @@ +'use strict'; + +// Which Unicode version should be used? +var version = '9.0.0'; + +var start = require('unicode-' + version + '/Binary_Property/ID_Start/code-points.js') + .filter(function(ch) { return ch > 0x7f; }); +var last = -1; +var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/Binary_Property/ID_Continue/code-points.js') + .filter(function(ch) { return ch > 0x7f && search(start, ch, last + 1) == -1; })); + +function search(arr, ch, starting) { + for (var i = starting; arr[i] <= ch && i < arr.length; last = i++) + if (arr[i] === ch) + return i; + return -1; +} + +function pad(str, width) { + while (str.length < width) str = "0" + str; + return str; +} + +function esc(code) { + var hex = code.toString(16); + if (hex.length <= 2) return "\\x" + pad(hex, 2); + else return "\\u" + pad(hex, 4); +} + +function generate(chars) { + var astral = [], re = ""; + for (var i = 0, at = 0x10000; i < chars.length; i++) { + var from = chars[i], to = from; + while (i < chars.length - 1 && chars[i + 1] == to + 1) { + i++; + to++; + } + if (to <= 0xffff) { + if (from == to) re += esc(from); + else if (from + 1 == to) re += esc(from) + esc(to); + else re += esc(from) + "-" + esc(to); + } else { + astral.push(from - at, to - from); + at = to; + } + } + return {nonASCII: re, astral: astral}; +} + +var startData = generate(start), contData = generate(cont); + +console.log("let nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\""); +console.log("let nonASCIIidentifierChars = \"" + contData.nonASCII + "\""); +console.log("const astralIdentifierStartCodes = " + JSON.stringify(startData.astral)); +console.log("const astralIdentifierCodes = " + JSON.stringify(contData.astral)); diff --git a/node_modules/acorn/bin/update_authors.sh b/node_modules/acorn/bin/update_authors.sh new file mode 100755 index 00000000..466c8db5 --- /dev/null +++ b/node_modules/acorn/bin/update_authors.sh @@ -0,0 +1,6 @@ +# Combine existing list of authors with everyone known in git, sort, add header. +tail --lines=+3 AUTHORS > AUTHORS.tmp +git log --format='%aN' | grep -v abraidwood >> AUTHORS.tmp +echo -e "List of Acorn contributors. Updated before every release.\n" > AUTHORS +sort -u AUTHORS.tmp >> AUTHORS +rm -f AUTHORS.tmp diff --git a/node_modules/acorn/dist/.keep b/node_modules/acorn/dist/.keep new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/acorn/dist/acorn.es.js b/node_modules/acorn/dist/acorn.es.js new file mode 100755 index 00000000..4460957f --- /dev/null +++ b/node_modules/acorn/dist/acorn.es.js @@ -0,0 +1,3112 @@ +// Reserved word lists for various dialects of the language + +var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + 7: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" +} + +// And the keywords + +var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this" + +var keywords = { + 5: ecma5AndLessKeywords, + 6: ecma5AndLessKeywords + " const class extends export import super" +} + +// ## Character categories + +// Big ugly regular expressions that match characters in the +// whitespace, identifier, and identifier-start categories. These +// are only applied when a character is found to actually have a +// code point above 128. +// Generated by `bin/generate-identifier-regex.js`. + +var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fd5\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ae\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc" +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d4-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f" + +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]") +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]") + +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null + +// These are a run-length and offset encoded representation of the +// >0xffff code points that are a valid part of identifiers. The +// offset starts at 0x10000, and each pair of numbers represents an +// offset to the next range, and then a size of the range. They were +// generated by bin/generate-identifier-regex.js +var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541] +var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239] + +// This has a complexity linear to the value of the code. The +// assumption is that looking up astral identifier characters is +// rare. +function isInAstralSet(code, set) { + var pos = 0x10000 + for (var i = 0; i < set.length; i += 2) { + pos += set[i] + if (pos > code) return false + pos += set[i + 1] + if (pos >= code) return true + } +} + +// Test whether a given character code starts an identifier. + +function isIdentifierStart(code, astral) { + if (code < 65) return code === 36 + if (code < 91) return true + if (code < 97) return code === 95 + if (code < 123) return true + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) + if (astral === false) return false + return isInAstralSet(code, astralIdentifierStartCodes) +} + +// Test whether a given character is part of an identifier. + +function isIdentifierChar(code, astral) { + if (code < 48) return code === 36 + if (code < 58) return true + if (code < 65) return false + if (code < 91) return true + if (code < 97) return code === 95 + if (code < 123) return true + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) + if (astral === false) return false + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) +} + +// ## Token types + +// The assignment of fine-grained, information-carrying type objects +// allows the tokenizer to store the information it has about a +// token in a way that is very cheap for the parser to look up. + +// All token type variables start with an underscore, to make them +// easy to recognize. + +// The `beforeExpr` property is used to disambiguate between regular +// expressions and divisions. It is set on all token types that can +// be followed by an expression (thus, a slash after them would be a +// regular expression). +// +// The `startsExpr` property is used to check if the token ends a +// `yield` expression. It is set on all token types that either can +// directly start an expression (like a quotation mark) or can +// continue an expression (like the body of a string). +// +// `isLoop` marks a keyword as starting a loop, which is important +// to know when parsing a label, in order to allow or disallow +// continue jumps to that label. + +var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label + this.keyword = conf.keyword + this.beforeExpr = !!conf.beforeExpr + this.startsExpr = !!conf.startsExpr + this.isLoop = !!conf.isLoop + this.isAssign = !!conf.isAssign + this.prefix = !!conf.prefix + this.postfix = !!conf.postfix + this.binop = conf.binop || null + this.updateContext = null +}; + +function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) +} +var beforeExpr = {beforeExpr: true}; +var startsExpr = {startsExpr: true}; +// Map keyword names to token types. + +var keywordTypes = {} + +// Succinct definitions of keyword token types +function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name + return keywordTypes[name] = new TokenType(name, options) +} + +var tt = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("prefix", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=", 6), + relational: binop("", 7), + bitShift: binop("<>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class"), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import"), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) +} + +// Matches a whole line break (where CRLF is considered a single +// line break). Used to count lines. + +var lineBreak = /\r\n?|\n|\u2028|\u2029/ +var lineBreakG = new RegExp(lineBreak.source, "g") + +function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code == 0x2029 +} + +var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/ + +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g + +function isArray(obj) { + return Object.prototype.toString.call(obj) === "[object Array]" +} + +// Checks if an object has a property. + +function has(obj, propName) { + return Object.prototype.hasOwnProperty.call(obj, propName) +} + +// These are used when `options.locations` is on, for the +// `startLoc` and `endLoc` properties. + +var Position = function Position(line, col) { + this.line = line + this.column = col +}; + +Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) +}; + +var SourceLocation = function SourceLocation(p, start, end) { + this.start = start + this.end = end + if (p.sourceFile !== null) this.source = p.sourceFile +}; + +// The `getLineInfo` function is mostly useful when the +// `locations` option is off (for performance reasons) and you +// want to find the line/column position for a given character +// offset. `input` should be the code string that the offset refers +// into. + +function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur + var match = lineBreakG.exec(input) + if (match && match.index < offset) { + ++line + cur = match.index + match[0].length + } else { + return new Position(line, offset - cur) + } + } +} + +// A second optional argument can be given to further configure +// the parser process. These options are recognized: + +var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must + // be either 3, or 5, or 6. This influences support for strict + // mode, the set of reserved words, support for getters and + // setters and other features. The default is 6. + ecmaVersion: 6, + // Source type ("script" or "module") for different semantics + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // th position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false, + plugins: {} +} + +// Interpret and default an options object + +function getOptions(opts) { + var options = {} + for (var opt in defaultOptions) + options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt] + if (options.allowReserved == null) + options.allowReserved = options.ecmaVersion < 5 + + if (isArray(options.onToken)) { + var tokens = options.onToken + options.onToken = function (token) { return tokens.push(token); } + } + if (isArray(options.onComment)) + options.onComment = pushComment(options, options.onComment) + + return options +} + +function pushComment(options, array) { + return function (block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? 'Block' : 'Line', + value: text, + start: start, + end: end + } + if (options.locations) + comment.loc = new SourceLocation(this, startLoc, endLoc) + if (options.ranges) + comment.range = [start, end] + array.push(comment) + } +} + +// Registered plugins +var plugins = {} + +function keywordRegexp(words) { + return new RegExp("^(" + words.replace(/ /g, "|") + ")$") +} + +var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options) + this.sourceFile = options.sourceFile + this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]) + var reserved = options.allowReserved ? "" : + reservedWords[options.ecmaVersion] + (options.sourceType == "module" ? " await" : "") + this.reservedWords = keywordRegexp(reserved) + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict + this.reservedWordsStrict = keywordRegexp(reservedStrict) + this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + reservedWords.strictBind) + this.input = String(input) + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false + + // Load plugins + this.loadPlugins(options.plugins) + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos + this.lineStart = Math.max(0, this.input.lastIndexOf("\n", startPos)) + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length + } else { + this.pos = this.lineStart = 0 + this.curLine = 1 + } + + // Properties of the current token: + // Its type + this.type = tt.eof + // For tokens that include more information than their type, the value + this.value = null + // Its start and end offset + this.start = this.end = this.pos + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition() + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null + this.lastTokStart = this.lastTokEnd = this.pos + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext() + this.exprAllowed = true + + // Figure out if it's a module code. + this.strict = this.inModule = options.sourceType === "module" + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1 + + // Flags to track whether we are in a function, a generator. + this.inFunction = this.inGenerator = false + // Labels in scope. + this.labels = [] + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === '#!') + this.skipLineComment(2) +}; + +// DEPRECATED Kept for backwards compatibility until 3.0 in case a plugin uses them +Parser.prototype.isKeyword = function isKeyword (word) { return this.keywords.test(word) }; +Parser.prototype.isReservedWord = function isReservedWord (word) { return this.reservedWords.test(word) }; + +Parser.prototype.extend = function extend (name, f) { + this[name] = f(this[name]) +}; + +Parser.prototype.loadPlugins = function loadPlugins (pluginConfigs) { + var this$1 = this; + + for (var name in pluginConfigs) { + var plugin = plugins[name] + if (!plugin) throw new Error("Plugin '" + name + "' not found") + plugin(this$1, pluginConfigs[name]) + } +}; + +Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode() + this.nextToken() + return this.parseTopLevel(node) +}; + +var pp = Parser.prototype + +// ## Parser utilities + +// Test whether a statement node is the string literal `"use strict"`. + +pp.isUseStrict = function(stmt) { + return this.options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && + stmt.expression.type === "Literal" && + stmt.expression.raw.slice(1, -1) === "use strict" +} + +// Predicate that tests whether the next token is of the given +// type, and if yes, consumes it as a side effect. + +pp.eat = function(type) { + if (this.type === type) { + this.next() + return true + } else { + return false + } +} + +// Tests whether parsed token is a contextual keyword. + +pp.isContextual = function(name) { + return this.type === tt.name && this.value === name +} + +// Consumes contextual keyword if possible. + +pp.eatContextual = function(name) { + return this.value === name && this.eat(tt.name) +} + +// Asserts that following token is given contextual keyword. + +pp.expectContextual = function(name) { + if (!this.eatContextual(name)) this.unexpected() +} + +// Test whether a semicolon can be inserted at the current position. + +pp.canInsertSemicolon = function() { + return this.type === tt.eof || + this.type === tt.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) +} + +pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc) + return true + } +} + +// Consume a semicolon, or, failing that, see if we are allowed to +// pretend that there is a semicolon at this position. + +pp.semicolon = function() { + if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected() +} + +pp.afterTrailingComma = function(tokType) { + if (this.type == tokType) { + if (this.options.onTrailingComma) + this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc) + this.next() + return true + } +} + +// Expect a token of a given type. If found, consume it, otherwise, +// raise an unexpected token error. + +pp.expect = function(type) { + this.eat(type) || this.unexpected() +} + +// Raise an unexpected token error. + +pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token") +} + +var DestructuringErrors = function DestructuringErrors() { + this.shorthandAssign = 0 + this.trailingComma = 0 +}; + +pp.checkPatternErrors = function(refDestructuringErrors, andThrow) { + var trailing = refDestructuringErrors && refDestructuringErrors.trailingComma + if (!andThrow) return !!trailing + if (trailing) this.raise(trailing, "Comma is not permitted after the rest element") +} + +pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + var pos = refDestructuringErrors && refDestructuringErrors.shorthandAssign + if (!andThrow) return !!pos + if (pos) this.raise(pos, "Shorthand property assignments are valid only in destructuring patterns") +} + +var pp$1 = Parser.prototype + +// ### Statement parsing + +// Parse a program. Initializes the parser, reads any number of +// statements, and wraps them in a Program node. Optionally takes a +// `program` argument. If present, the statements will be appended +// to its body instead of creating a new node. + +pp$1.parseTopLevel = function(node) { + var this$1 = this; + + var first = true + if (!node.body) node.body = [] + while (this.type !== tt.eof) { + var stmt = this$1.parseStatement(true, true) + node.body.push(stmt) + if (first) { + if (this$1.isUseStrict(stmt)) this$1.setStrict(true) + first = false + } + } + this.next() + if (this.options.ecmaVersion >= 6) { + node.sourceType = this.options.sourceType + } + return this.finishNode(node, "Program") +} + +var loopLabel = {kind: "loop"}; +var switchLabel = {kind: "switch"}; +pp$1.isLet = function() { + if (this.type !== tt.name || this.options.ecmaVersion < 6 || this.value != "let") return false + skipWhiteSpace.lastIndex = this.pos + var skip = skipWhiteSpace.exec(this.input) + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next) + if (nextCh === 91 || nextCh == 123) return true // '{' and '[' + if (isIdentifierStart(nextCh, true)) { + for (var pos = next + 1; isIdentifierChar(this.input.charCodeAt(pos), true); ++pos) {} + var ident = this.input.slice(next, pos) + if (!this.isKeyword(ident)) return true + } + return false +} + +// Parse a single statement. +// +// If expecting a statement and finding a slash operator, parse a +// regular expression literal. This is to handle cases like +// `if (foo) /blah/.exec(foo)`, where looking at the previous token +// does not help. + +pp$1.parseStatement = function(declaration, topLevel) { + var starttype = this.type, node = this.startNode(), kind + + if (this.isLet()) { + starttype = tt._var + kind = "let" + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case tt._debugger: return this.parseDebuggerStatement(node) + case tt._do: return this.parseDoStatement(node) + case tt._for: return this.parseForStatement(node) + case tt._function: + if (!declaration && this.options.ecmaVersion >= 6) this.unexpected() + return this.parseFunctionStatement(node) + case tt._class: + if (!declaration) this.unexpected() + return this.parseClass(node, true) + case tt._if: return this.parseIfStatement(node) + case tt._return: return this.parseReturnStatement(node) + case tt._switch: return this.parseSwitchStatement(node) + case tt._throw: return this.parseThrowStatement(node) + case tt._try: return this.parseTryStatement(node) + case tt._const: case tt._var: + kind = kind || this.value + if (!declaration && kind != "var") this.unexpected() + return this.parseVarStatement(node, kind) + case tt._while: return this.parseWhileStatement(node) + case tt._with: return this.parseWithStatement(node) + case tt.braceL: return this.parseBlock() + case tt.semi: return this.parseEmptyStatement(node) + case tt._export: + case tt._import: + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + this.raise(this.start, "'import' and 'export' may only appear at the top level") + if (!this.inModule) + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'") + } + return starttype === tt._import ? this.parseImport(node) : this.parseExport(node) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + var maybeName = this.value, expr = this.parseExpression() + if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) + return this.parseLabeledStatement(node, maybeName, expr) + else return this.parseExpressionStatement(node, expr) + } +} + +pp$1.parseBreakContinueStatement = function(node, keyword) { + var this$1 = this; + + var isBreak = keyword == "break" + this.next() + if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null + else if (this.type !== tt.name) this.unexpected() + else { + node.label = this.parseIdent() + this.semicolon() + } + + // Verify that there is an actual destination to break or + // continue to. + for (var i = 0; i < this.labels.length; ++i) { + var lab = this$1.labels[i] + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) break + if (node.label && isBreak) break + } + } + if (i === this.labels.length) this.raise(node.start, "Unsyntactic " + keyword) + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") +} + +pp$1.parseDebuggerStatement = function(node) { + this.next() + this.semicolon() + return this.finishNode(node, "DebuggerStatement") +} + +pp$1.parseDoStatement = function(node) { + this.next() + this.labels.push(loopLabel) + node.body = this.parseStatement(false) + this.labels.pop() + this.expect(tt._while) + node.test = this.parseParenExpression() + if (this.options.ecmaVersion >= 6) + this.eat(tt.semi) + else + this.semicolon() + return this.finishNode(node, "DoWhileStatement") +} + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. + +pp$1.parseForStatement = function(node) { + this.next() + this.labels.push(loopLabel) + this.expect(tt.parenL) + if (this.type === tt.semi) return this.parseFor(node, null) + var isLet = this.isLet() + if (this.type === tt._var || this.type === tt._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value + this.next() + this.parseVar(init$1, true, kind) + this.finishNode(init$1, "VariableDeclaration") + if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 && + !(kind !== "var" && init$1.declarations[0].init)) + return this.parseForIn(node, init$1) + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors + var init = this.parseExpression(true, refDestructuringErrors) + if (this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.checkPatternErrors(refDestructuringErrors, true) + this.toAssignable(init) + this.checkLVal(init) + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true) + } + return this.parseFor(node, init) +} + +pp$1.parseFunctionStatement = function(node) { + this.next() + return this.parseFunction(node, true) +} + +pp$1.parseIfStatement = function(node) { + this.next() + node.test = this.parseParenExpression() + node.consequent = this.parseStatement(false) + node.alternate = this.eat(tt._else) ? this.parseStatement(false) : null + return this.finishNode(node, "IfStatement") +} + +pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + this.raise(this.start, "'return' outside of function") + this.next() + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null + else { node.argument = this.parseExpression(); this.semicolon() } + return this.finishNode(node, "ReturnStatement") +} + +pp$1.parseSwitchStatement = function(node) { + var this$1 = this; + + this.next() + node.discriminant = this.parseParenExpression() + node.cases = [] + this.expect(tt.braceL) + this.labels.push(switchLabel) + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + for (var cur, sawDefault = false; this.type != tt.braceR;) { + if (this$1.type === tt._case || this$1.type === tt._default) { + var isCase = this$1.type === tt._case + if (cur) this$1.finishNode(cur, "SwitchCase") + node.cases.push(cur = this$1.startNode()) + cur.consequent = [] + this$1.next() + if (isCase) { + cur.test = this$1.parseExpression() + } else { + if (sawDefault) this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses") + sawDefault = true + cur.test = null + } + this$1.expect(tt.colon) + } else { + if (!cur) this$1.unexpected() + cur.consequent.push(this$1.parseStatement(true)) + } + } + if (cur) this.finishNode(cur, "SwitchCase") + this.next() // Closing brace + this.labels.pop() + return this.finishNode(node, "SwitchStatement") +} + +pp$1.parseThrowStatement = function(node) { + this.next() + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + this.raise(this.lastTokEnd, "Illegal newline after throw") + node.argument = this.parseExpression() + this.semicolon() + return this.finishNode(node, "ThrowStatement") +} + +// Reused empty array added for node fields that are always empty. + +var empty = [] + +pp$1.parseTryStatement = function(node) { + this.next() + node.block = this.parseBlock() + node.handler = null + if (this.type === tt._catch) { + var clause = this.startNode() + this.next() + this.expect(tt.parenL) + clause.param = this.parseBindingAtom() + this.checkLVal(clause.param, true) + this.expect(tt.parenR) + clause.body = this.parseBlock() + node.handler = this.finishNode(clause, "CatchClause") + } + node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null + if (!node.handler && !node.finalizer) + this.raise(node.start, "Missing catch or finally clause") + return this.finishNode(node, "TryStatement") +} + +pp$1.parseVarStatement = function(node, kind) { + this.next() + this.parseVar(node, false, kind) + this.semicolon() + return this.finishNode(node, "VariableDeclaration") +} + +pp$1.parseWhileStatement = function(node) { + this.next() + node.test = this.parseParenExpression() + this.labels.push(loopLabel) + node.body = this.parseStatement(false) + this.labels.pop() + return this.finishNode(node, "WhileStatement") +} + +pp$1.parseWithStatement = function(node) { + if (this.strict) this.raise(this.start, "'with' in strict mode") + this.next() + node.object = this.parseParenExpression() + node.body = this.parseStatement(false) + return this.finishNode(node, "WithStatement") +} + +pp$1.parseEmptyStatement = function(node) { + this.next() + return this.finishNode(node, "EmptyStatement") +} + +pp$1.parseLabeledStatement = function(node, maybeName, expr) { + var this$1 = this; + + for (var i = 0; i < this.labels.length; ++i) + if (this$1.labels[i].name === maybeName) this$1.raise(expr.start, "Label '" + maybeName + "' is already declared") + var kind = this.type.isLoop ? "loop" : this.type === tt._switch ? "switch" : null + for (var i$1 = this.labels.length - 1; i$1 >= 0; i$1--) { + var label = this$1.labels[i$1] + if (label.statementStart == node.start) { + label.statementStart = this$1.start + label.kind = kind + } else break + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}) + node.body = this.parseStatement(true) + this.labels.pop() + node.label = expr + return this.finishNode(node, "LabeledStatement") +} + +pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr + this.semicolon() + return this.finishNode(node, "ExpressionStatement") +} + +// Parse a semicolon-enclosed block of statements, handling `"use +// strict"` declarations when `allowStrict` is true (used for +// function bodies). + +pp$1.parseBlock = function(allowStrict) { + var this$1 = this; + + var node = this.startNode(), first = true, oldStrict + node.body = [] + this.expect(tt.braceL) + while (!this.eat(tt.braceR)) { + var stmt = this$1.parseStatement(true) + node.body.push(stmt) + if (first && allowStrict && this$1.isUseStrict(stmt)) { + oldStrict = this$1.strict + this$1.setStrict(this$1.strict = true) + } + first = false + } + if (oldStrict === false) this.setStrict(false) + return this.finishNode(node, "BlockStatement") +} + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +pp$1.parseFor = function(node, init) { + node.init = init + this.expect(tt.semi) + node.test = this.type === tt.semi ? null : this.parseExpression() + this.expect(tt.semi) + node.update = this.type === tt.parenR ? null : this.parseExpression() + this.expect(tt.parenR) + node.body = this.parseStatement(false) + this.labels.pop() + return this.finishNode(node, "ForStatement") +} + +// Parse a `for`/`in` and `for`/`of` loop, which are almost +// same from parser's perspective. + +pp$1.parseForIn = function(node, init) { + var type = this.type === tt._in ? "ForInStatement" : "ForOfStatement" + this.next() + node.left = init + node.right = this.parseExpression() + this.expect(tt.parenR) + node.body = this.parseStatement(false) + this.labels.pop() + return this.finishNode(node, type) +} + +// Parse a list of variable declarations. + +pp$1.parseVar = function(node, isFor, kind) { + var this$1 = this; + + node.declarations = [] + node.kind = kind + for (;;) { + var decl = this$1.startNode() + this$1.parseVarId(decl) + if (this$1.eat(tt.eq)) { + decl.init = this$1.parseMaybeAssign(isFor) + } else if (kind === "const" && !(this$1.type === tt._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) { + this$1.unexpected() + } else if (decl.id.type != "Identifier" && !(isFor && (this$1.type === tt._in || this$1.isContextual("of")))) { + this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value") + } else { + decl.init = null + } + node.declarations.push(this$1.finishNode(decl, "VariableDeclarator")) + if (!this$1.eat(tt.comma)) break + } + return node +} + +pp$1.parseVarId = function(decl) { + decl.id = this.parseBindingAtom() + this.checkLVal(decl.id, true) +} + +// Parse a function declaration or literal (depending on the +// `isStatement` parameter). + +pp$1.parseFunction = function(node, isStatement, allowExpressionBody) { + this.initFunction(node) + if (this.options.ecmaVersion >= 6) + node.generator = this.eat(tt.star) + var oldInGen = this.inGenerator + this.inGenerator = node.generator + if (isStatement || this.type === tt.name) + node.id = this.parseIdent() + this.parseFunctionParams(node) + this.parseFunctionBody(node, allowExpressionBody) + this.inGenerator = oldInGen + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression") +} + +pp$1.parseFunctionParams = function(node) { + this.expect(tt.parenL) + node.params = this.parseBindingList(tt.parenR, false, false, true) +} + +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). + +pp$1.parseClass = function(node, isStatement) { + var this$1 = this; + + this.next() + this.parseClassId(node, isStatement) + this.parseClassSuper(node) + var classBody = this.startNode() + var hadConstructor = false + classBody.body = [] + this.expect(tt.braceL) + while (!this.eat(tt.braceR)) { + if (this$1.eat(tt.semi)) continue + var method = this$1.startNode() + var isGenerator = this$1.eat(tt.star) + var isMaybeStatic = this$1.type === tt.name && this$1.value === "static" + this$1.parsePropertyName(method) + method.static = isMaybeStatic && this$1.type !== tt.parenL + if (method.static) { + if (isGenerator) this$1.unexpected() + isGenerator = this$1.eat(tt.star) + this$1.parsePropertyName(method) + } + method.kind = "method" + var isGetSet = false + if (!method.computed) { + var key = method.key; + if (!isGenerator && key.type === "Identifier" && this$1.type !== tt.parenL && (key.name === "get" || key.name === "set")) { + isGetSet = true + method.kind = key.name + key = this$1.parsePropertyName(method) + } + if (!method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (hadConstructor) this$1.raise(key.start, "Duplicate constructor in the same class") + if (isGetSet) this$1.raise(key.start, "Constructor can't have get/set modifier") + if (isGenerator) this$1.raise(key.start, "Constructor can't be a generator") + method.kind = "constructor" + hadConstructor = true + } + } + this$1.parseClassMethod(classBody, method, isGenerator) + if (isGetSet) { + var paramCount = method.kind === "get" ? 0 : 1 + if (method.value.params.length !== paramCount) { + var start = method.value.start + if (method.kind === "get") + this$1.raiseRecoverable(start, "getter should have no params") + else + this$1.raiseRecoverable(start, "setter should have exactly one param") + } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + this$1.raise(method.value.params[0].start, "Setter cannot use rest params") + } + } + node.body = this.finishNode(classBody, "ClassBody") + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") +} + +pp$1.parseClassMethod = function(classBody, method, isGenerator) { + method.value = this.parseMethod(isGenerator) + classBody.body.push(this.finishNode(method, "MethodDefinition")) +} + +pp$1.parseClassId = function(node, isStatement) { + node.id = this.type === tt.name ? this.parseIdent() : isStatement ? this.unexpected() : null +} + +pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null +} + +// Parses module export declaration. + +pp$1.parseExport = function(node) { + var this$1 = this; + + this.next() + // export * from '...' + if (this.eat(tt.star)) { + this.expectContextual("from") + node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected() + this.semicolon() + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(tt._default)) { // export default ... + var parens = this.type == tt.parenL + var expr = this.parseMaybeAssign() + var needsSemi = true + if (!parens && (expr.type == "FunctionExpression" || + expr.type == "ClassExpression")) { + needsSemi = false + if (expr.id) { + expr.type = expr.type == "FunctionExpression" + ? "FunctionDeclaration" + : "ClassDeclaration" + } + } + node.declaration = expr + if (needsSemi) this.semicolon() + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(true) + node.specifiers = [] + node.source = null + } else { // export { x, y as z } [from '...'] + node.declaration = null + node.specifiers = this.parseExportSpecifiers() + if (this.eatContextual("from")) { + node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected() + } else { + // check for keywords used as local names + for (var i = 0; i < node.specifiers.length; i++) { + if (this$1.keywords.test(node.specifiers[i].local.name) || this$1.reservedWords.test(node.specifiers[i].local.name)) { + this$1.unexpected(node.specifiers[i].local.start) + } + } + + node.source = null + } + this.semicolon() + } + return this.finishNode(node, "ExportNamedDeclaration") +} + +pp$1.shouldParseExportStatement = function() { + return this.type.keyword || this.isLet() +} + +// Parses a comma-separated list of module exports. + +pp$1.parseExportSpecifiers = function() { + var this$1 = this; + + var nodes = [], first = true + // export { x, y as z } [from '...'] + this.expect(tt.braceL) + while (!this.eat(tt.braceR)) { + if (!first) { + this$1.expect(tt.comma) + if (this$1.afterTrailingComma(tt.braceR)) break + } else first = false + + var node = this$1.startNode() + node.local = this$1.parseIdent(this$1.type === tt._default) + node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local + nodes.push(this$1.finishNode(node, "ExportSpecifier")) + } + return nodes +} + +// Parses import declaration. + +pp$1.parseImport = function(node) { + this.next() + // import '...' + if (this.type === tt.string) { + node.specifiers = empty + node.source = this.parseExprAtom() + } else { + node.specifiers = this.parseImportSpecifiers() + this.expectContextual("from") + node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected() + } + this.semicolon() + return this.finishNode(node, "ImportDeclaration") +} + +// Parses a comma-separated list of module imports. + +pp$1.parseImportSpecifiers = function() { + var this$1 = this; + + var nodes = [], first = true + if (this.type === tt.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode() + node.local = this.parseIdent() + this.checkLVal(node.local, true) + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")) + if (!this.eat(tt.comma)) return nodes + } + if (this.type === tt.star) { + var node$1 = this.startNode() + this.next() + this.expectContextual("as") + node$1.local = this.parseIdent() + this.checkLVal(node$1.local, true) + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")) + return nodes + } + this.expect(tt.braceL) + while (!this.eat(tt.braceR)) { + if (!first) { + this$1.expect(tt.comma) + if (this$1.afterTrailingComma(tt.braceR)) break + } else first = false + + var node$2 = this$1.startNode() + node$2.imported = this$1.parseIdent(true) + if (this$1.eatContextual("as")) { + node$2.local = this$1.parseIdent() + } else { + node$2.local = node$2.imported + if (this$1.isKeyword(node$2.local.name)) this$1.unexpected(node$2.local.start) + if (this$1.reservedWordsStrict.test(node$2.local.name)) this$1.raise(node$2.local.start, "The keyword '" + node$2.local.name + "' is reserved") + } + this$1.checkLVal(node$2.local, true) + nodes.push(this$1.finishNode(node$2, "ImportSpecifier")) + } + return nodes +} + +var pp$2 = Parser.prototype + +// Convert existing expression atom to assignable pattern +// if possible. + +pp$2.toAssignable = function(node, isBinding) { + var this$1 = this; + + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + break + + case "ObjectExpression": + node.type = "ObjectPattern" + for (var i = 0; i < node.properties.length; i++) { + var prop = node.properties[i] + if (prop.kind !== "init") this$1.raise(prop.key.start, "Object pattern can't contain getter or setter") + this$1.toAssignable(prop.value, isBinding) + } + break + + case "ArrayExpression": + node.type = "ArrayPattern" + this.toAssignableList(node.elements, isBinding) + break + + case "AssignmentExpression": + if (node.operator === "=") { + node.type = "AssignmentPattern" + delete node.operator + // falls through to AssignmentPattern + } else { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value.") + break + } + + case "AssignmentPattern": + if (node.right.type === "YieldExpression") + this.raise(node.right.start, "Yield expression cannot be a default value") + break + + case "ParenthesizedExpression": + node.expression = this.toAssignable(node.expression, isBinding) + break + + case "MemberExpression": + if (!isBinding) break + + default: + this.raise(node.start, "Assigning to rvalue") + } + } + return node +} + +// Convert list of expression atoms to binding list. + +pp$2.toAssignableList = function(exprList, isBinding) { + var this$1 = this; + + var end = exprList.length + if (end) { + var last = exprList[end - 1] + if (last && last.type == "RestElement") { + --end + } else if (last && last.type == "SpreadElement") { + last.type = "RestElement" + var arg = last.argument + this.toAssignable(arg, isBinding) + if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") + this.unexpected(arg.start) + --end + } + + if (isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + this.unexpected(last.argument.start) + } + for (var i = 0; i < end; i++) { + var elt = exprList[i] + if (elt) this$1.toAssignable(elt, isBinding) + } + return exprList +} + +// Parses spread element. + +pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode() + this.next() + node.argument = this.parseMaybeAssign(false, refDestructuringErrors) + return this.finishNode(node, "SpreadElement") +} + +pp$2.parseRest = function(allowNonIdent) { + var node = this.startNode() + this.next() + + // RestElement inside of a function parameter must be an identifier + if (allowNonIdent) node.argument = this.type === tt.name ? this.parseIdent() : this.unexpected() + else node.argument = this.type === tt.name || this.type === tt.bracketL ? this.parseBindingAtom() : this.unexpected() + + return this.finishNode(node, "RestElement") +} + +// Parses lvalue (assignable) atom. + +pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion < 6) return this.parseIdent() + switch (this.type) { + case tt.name: + return this.parseIdent() + + case tt.bracketL: + var node = this.startNode() + this.next() + node.elements = this.parseBindingList(tt.bracketR, true, true) + return this.finishNode(node, "ArrayPattern") + + case tt.braceL: + return this.parseObj(true) + + default: + this.unexpected() + } +} + +pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowNonIdent) { + var this$1 = this; + + var elts = [], first = true + while (!this.eat(close)) { + if (first) first = false + else this$1.expect(tt.comma) + if (allowEmpty && this$1.type === tt.comma) { + elts.push(null) + } else if (allowTrailingComma && this$1.afterTrailingComma(close)) { + break + } else if (this$1.type === tt.ellipsis) { + var rest = this$1.parseRest(allowNonIdent) + this$1.parseBindingListItem(rest) + elts.push(rest) + if (this$1.type === tt.comma) this$1.raise(this$1.start, "Comma is not permitted after the rest element") + this$1.expect(close) + break + } else { + var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc) + this$1.parseBindingListItem(elem) + elts.push(elem) + } + } + return elts +} + +pp$2.parseBindingListItem = function(param) { + return param +} + +// Parses assignment pattern around given atom if possible. + +pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom() + if (this.options.ecmaVersion < 6 || !this.eat(tt.eq)) return left + var node = this.startNodeAt(startPos, startLoc) + node.left = left + node.right = this.parseMaybeAssign() + return this.finishNode(node, "AssignmentPattern") +} + +// Verify that a node is an lval — something that can be assigned +// to. + +pp$2.checkLVal = function(expr, isBinding, checkClashes) { + var this$1 = this; + + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + this.raiseRecoverable(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode") + if (checkClashes) { + if (has(checkClashes, expr.name)) + this.raiseRecoverable(expr.start, "Argument name clash") + checkClashes[expr.name] = true + } + break + + case "MemberExpression": + if (isBinding) this.raiseRecoverable(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression") + break + + case "ObjectPattern": + for (var i = 0; i < expr.properties.length; i++) + this$1.checkLVal(expr.properties[i].value, isBinding, checkClashes) + break + + case "ArrayPattern": + for (var i$1 = 0; i$1 < expr.elements.length; i$1++) { + var elem = expr.elements[i$1] + if (elem) this$1.checkLVal(elem, isBinding, checkClashes) + } + break + + case "AssignmentPattern": + this.checkLVal(expr.left, isBinding, checkClashes) + break + + case "RestElement": + this.checkLVal(expr.argument, isBinding, checkClashes) + break + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, isBinding, checkClashes) + break + + default: + this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue") + } +} + +var pp$3 = Parser.prototype + +// Check if property name clashes with already added. +// Object/class getters and setters are not allowed to clash — +// either with each other or with an init property — and in +// strict mode, init properties are also not allowed to be repeated. + +pp$3.checkPropClash = function(prop, propHash) { + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + return + var key = prop.key; + var name + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) this.raiseRecoverable(key.start, "Redefinition of __proto__ property") + propHash.proto = true + } + return + } + name = "$" + name + var other = propHash[name] + if (other) { + var isGetSet = kind !== "init" + if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) + this.raiseRecoverable(key.start, "Redefinition of property") + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + } + } + other[kind] = true +} + +// ### Expression parsing + +// These nest, from the most general expression type at the top to +// 'atomic', nondivisible expression types at the bottom. Most of +// the functions will simply let the function(s) below them parse, +// and, *if* the syntactic construct they handle is present, wrap +// the AST node that the inner parser gave them in another node. + +// Parse a full expression. The optional arguments are used to +// forbid the `in` operator (in for loops initalization expressions) +// and provide reference for storing '=' operator inside shorthand +// property assignment in contexts where both object expression +// and object pattern might appear (so it's possible to raise +// delayed syntax error at correct position). + +pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors) + if (this.type === tt.comma) { + var node = this.startNodeAt(startPos, startLoc) + node.expressions = [expr] + while (this.eat(tt.comma)) node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors)) + return this.finishNode(node, "SequenceExpression") + } + return expr +} + +// Parse an assignment expression. This includes applications of +// operators like `+=`. + +pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.inGenerator && this.isContextual("yield")) return this.parseYield() + + var ownDestructuringErrors = false + if (!refDestructuringErrors) { + refDestructuringErrors = new DestructuringErrors + ownDestructuringErrors = true + } + var startPos = this.start, startLoc = this.startLoc + if (this.type == tt.parenL || this.type == tt.name) + this.potentialArrowAt = this.start + var left = this.parseMaybeConditional(noIn, refDestructuringErrors) + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc) + if (this.type.isAssign) { + this.checkPatternErrors(refDestructuringErrors, true) + if (!ownDestructuringErrors) DestructuringErrors.call(refDestructuringErrors) + var node = this.startNodeAt(startPos, startLoc) + node.operator = this.value + node.left = this.type === tt.eq ? this.toAssignable(left) : left + refDestructuringErrors.shorthandAssign = 0 // reset because shorthand default was used correctly + this.checkLVal(left) + this.next() + node.right = this.parseMaybeAssign(noIn) + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true) + } + return left +} + +// Parse a ternary conditional (`?:`) operator. + +pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc + var expr = this.parseExprOps(noIn, refDestructuringErrors) + if (this.checkExpressionErrors(refDestructuringErrors)) return expr + if (this.eat(tt.question)) { + var node = this.startNodeAt(startPos, startLoc) + node.test = expr + node.consequent = this.parseMaybeAssign() + this.expect(tt.colon) + node.alternate = this.parseMaybeAssign(noIn) + return this.finishNode(node, "ConditionalExpression") + } + return expr +} + +// Start the precedence parser. + +pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc + var expr = this.parseMaybeUnary(refDestructuringErrors, false) + if (this.checkExpressionErrors(refDestructuringErrors)) return expr + return this.parseExprOp(expr, startPos, startLoc, -1, noIn) +} + +// Parse binary operators with the operator precedence parsing +// algorithm. `left` is the left-hand side of the operator. +// `minPrec` provides context that allows the function to stop and +// defer further parser to one of its callers when it encounters an +// operator that has a lower precedence than the set it is parsing. + +pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop + if (prec != null && (!noIn || this.type !== tt._in)) { + if (prec > minPrec) { + var logical = this.type === tt.logicalOR || this.type === tt.logicalAND + var op = this.value + this.next() + var startPos = this.start, startLoc = this.startLoc + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn) + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical) + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left +} + +pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc) + node.left = left + node.operator = op + node.right = right + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") +} + +// Parse unary operators, both prefix and postfix. + +pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, expr + if (this.type.prefix) { + var node = this.startNode(), update = this.type === tt.incDec + node.operator = this.value + node.prefix = true + this.next() + node.argument = this.parseMaybeUnary(null, true) + this.checkExpressionErrors(refDestructuringErrors, true) + if (update) this.checkLVal(node.argument) + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + this.raiseRecoverable(node.start, "Deleting local variable in strict mode") + else sawUnary = true + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression") + } else { + expr = this.parseExprSubscripts(refDestructuringErrors) + if (this.checkExpressionErrors(refDestructuringErrors)) return expr + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this$1.startNodeAt(startPos, startLoc) + node$1.operator = this$1.value + node$1.prefix = false + node$1.argument = expr + this$1.checkLVal(expr) + this$1.next() + expr = this$1.finishNode(node$1, "UpdateExpression") + } + } + + if (!sawUnary && this.eat(tt.starstar)) + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) + else + return expr +} + +// Parse call, dot, and `[]`-subscript expressions. + +pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc + var expr = this.parseExprAtom(refDestructuringErrors) + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")" + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr + return this.parseSubscripts(expr, startPos, startLoc) +} + +pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var this$1 = this; + + for (;;) { + if (this$1.eat(tt.dot)) { + var node = this$1.startNodeAt(startPos, startLoc) + node.object = base + node.property = this$1.parseIdent(true) + node.computed = false + base = this$1.finishNode(node, "MemberExpression") + } else if (this$1.eat(tt.bracketL)) { + var node$1 = this$1.startNodeAt(startPos, startLoc) + node$1.object = base + node$1.property = this$1.parseExpression() + node$1.computed = true + this$1.expect(tt.bracketR) + base = this$1.finishNode(node$1, "MemberExpression") + } else if (!noCalls && this$1.eat(tt.parenL)) { + var node$2 = this$1.startNodeAt(startPos, startLoc) + node$2.callee = base + node$2.arguments = this$1.parseExprList(tt.parenR, false) + base = this$1.finishNode(node$2, "CallExpression") + } else if (this$1.type === tt.backQuote) { + var node$3 = this$1.startNodeAt(startPos, startLoc) + node$3.tag = base + node$3.quasi = this$1.parseTemplate() + base = this$1.finishNode(node$3, "TaggedTemplateExpression") + } else { + return base + } + } +} + +// Parse an atomic expression — either a single token that is an +// expression, an expression started by a keyword like `function` or +// `new`, or an expression wrapped in punctuation like `()`, `[]`, +// or `{}`. + +pp$3.parseExprAtom = function(refDestructuringErrors) { + var node, canBeArrow = this.potentialArrowAt == this.start + switch (this.type) { + case tt._super: + if (!this.inFunction) + this.raise(this.start, "'super' outside of function or class") + + case tt._this: + var type = this.type === tt._this ? "ThisExpression" : "Super" + node = this.startNode() + this.next() + return this.finishNode(node, type) + + case tt.name: + var startPos = this.start, startLoc = this.startLoc + var id = this.parseIdent(this.type !== tt.name) + if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id]) + return id + + case tt.regexp: + var value = this.value + node = this.parseLiteral(value.value) + node.regex = {pattern: value.pattern, flags: value.flags} + return node + + case tt.num: case tt.string: + return this.parseLiteral(this.value) + + case tt._null: case tt._true: case tt._false: + node = this.startNode() + node.value = this.type === tt._null ? null : this.type === tt._true + node.raw = this.type.keyword + this.next() + return this.finishNode(node, "Literal") + + case tt.parenL: + return this.parseParenAndDistinguishExpression(canBeArrow) + + case tt.bracketL: + node = this.startNode() + this.next() + node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors) + return this.finishNode(node, "ArrayExpression") + + case tt.braceL: + return this.parseObj(false, refDestructuringErrors) + + case tt._function: + node = this.startNode() + this.next() + return this.parseFunction(node, false) + + case tt._class: + return this.parseClass(this.startNode(), false) + + case tt._new: + return this.parseNew() + + case tt.backQuote: + return this.parseTemplate() + + default: + this.unexpected() + } +} + +pp$3.parseLiteral = function(value) { + var node = this.startNode() + node.value = value + node.raw = this.input.slice(this.start, this.end) + this.next() + return this.finishNode(node, "Literal") +} + +pp$3.parseParenExpression = function() { + this.expect(tt.parenL) + var val = this.parseExpression() + this.expect(tt.parenR) + return val +} + +pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, val + if (this.options.ecmaVersion >= 6) { + this.next() + + var innerStartPos = this.start, innerStartLoc = this.startLoc + var exprList = [], first = true + var refDestructuringErrors = new DestructuringErrors, spreadStart, innerParenStart + while (this.type !== tt.parenR) { + first ? first = false : this$1.expect(tt.comma) + if (this$1.type === tt.ellipsis) { + spreadStart = this$1.start + exprList.push(this$1.parseParenItem(this$1.parseRest())) + break + } else { + if (this$1.type === tt.parenL && !innerParenStart) { + innerParenStart = this$1.start + } + exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem)) + } + } + var innerEndPos = this.start, innerEndLoc = this.startLoc + this.expect(tt.parenR) + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { + this.checkPatternErrors(refDestructuringErrors, true) + if (innerParenStart) this.unexpected(innerParenStart) + return this.parseParenArrowList(startPos, startLoc, exprList) + } + + if (!exprList.length) this.unexpected(this.lastTokStart) + if (spreadStart) this.unexpected(spreadStart) + this.checkExpressionErrors(refDestructuringErrors, true) + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc) + val.expressions = exprList + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc) + } else { + val = exprList[0] + } + } else { + val = this.parseParenExpression() + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc) + par.expression = val + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } +} + +pp$3.parseParenItem = function(item) { + return item +} + +pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) +} + +// New's precedence is slightly tricky. It must allow its argument to +// be a `[]` or dot subscript expression, but not a call — at least, +// not without wrapping it in parentheses. Thus, it uses the noCalls +// argument to parseSubscripts to prevent it from consuming the +// argument list. + +var empty$1 = [] + +pp$3.parseNew = function() { + var node = this.startNode() + var meta = this.parseIdent(true) + if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) { + node.meta = meta + node.property = this.parseIdent(true) + if (node.property.name !== "target") + this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target") + if (!this.inFunction) + this.raiseRecoverable(node.start, "new.target can only be used in functions") + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true) + if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, false) + else node.arguments = empty$1 + return this.finishNode(node, "NewExpression") +} + +// Parse template expression. + +pp$3.parseTemplateElement = function() { + var elem = this.startNode() + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'), + cooked: this.value + } + this.next() + elem.tail = this.type === tt.backQuote + return this.finishNode(elem, "TemplateElement") +} + +pp$3.parseTemplate = function() { + var this$1 = this; + + var node = this.startNode() + this.next() + node.expressions = [] + var curElt = this.parseTemplateElement() + node.quasis = [curElt] + while (!curElt.tail) { + this$1.expect(tt.dollarBraceL) + node.expressions.push(this$1.parseExpression()) + this$1.expect(tt.braceR) + node.quasis.push(curElt = this$1.parseTemplateElement()) + } + this.next() + return this.finishNode(node, "TemplateLiteral") +} + +// Parse an object literal or binding pattern. + +pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var this$1 = this; + + var node = this.startNode(), first = true, propHash = {} + node.properties = [] + this.next() + while (!this.eat(tt.braceR)) { + if (!first) { + this$1.expect(tt.comma) + if (this$1.afterTrailingComma(tt.braceR)) break + } else first = false + + var prop = this$1.startNode(), isGenerator, startPos, startLoc + if (this$1.options.ecmaVersion >= 6) { + prop.method = false + prop.shorthand = false + if (isPattern || refDestructuringErrors) { + startPos = this$1.start + startLoc = this$1.startLoc + } + if (!isPattern) + isGenerator = this$1.eat(tt.star) + } + this$1.parsePropertyName(prop) + this$1.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors) + this$1.checkPropClash(prop, propHash) + node.properties.push(this$1.finishNode(prop, "Property")) + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") +} + +pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors) { + if (this.eat(tt.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors) + prop.kind = "init" + } else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) { + if (isPattern) this.unexpected() + prop.kind = "init" + prop.method = true + prop.value = this.parseMethod(isGenerator) + } else if (this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type != tt.comma && this.type != tt.braceR)) { + if (isGenerator || isPattern) this.unexpected() + prop.kind = prop.key.name + this.parsePropertyName(prop) + prop.value = this.parseMethod(false) + var paramCount = prop.kind === "get" ? 0 : 1 + if (prop.value.params.length !== paramCount) { + var start = prop.value.start + if (prop.kind === "get") + this.raiseRecoverable(start, "getter should have no params") + else + this.raiseRecoverable(start, "setter should have exactly one param") + } + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params") + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (this.keywords.test(prop.key.name) || + (this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name) || + (this.inGenerator && prop.key.name == "yield")) + this.raiseRecoverable(prop.key.start, "'" + prop.key.name + "' can not be used as shorthand property") + prop.kind = "init" + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key) + } else if (this.type === tt.eq && refDestructuringErrors) { + if (!refDestructuringErrors.shorthandAssign) + refDestructuringErrors.shorthandAssign = this.start + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key) + } else { + prop.value = prop.key + } + prop.shorthand = true + } else this.unexpected() +} + +pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(tt.bracketL)) { + prop.computed = true + prop.key = this.parseMaybeAssign() + this.expect(tt.bracketR) + return prop.key + } else { + prop.computed = false + } + } + return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(true) +} + +// Initialize empty function node. + +pp$3.initFunction = function(node) { + node.id = null + if (this.options.ecmaVersion >= 6) { + node.generator = false + node.expression = false + } +} + +// Parse object or class method. + +pp$3.parseMethod = function(isGenerator) { + var node = this.startNode(), oldInGen = this.inGenerator + this.inGenerator = isGenerator + this.initFunction(node) + this.expect(tt.parenL) + node.params = this.parseBindingList(tt.parenR, false, false) + if (this.options.ecmaVersion >= 6) + node.generator = isGenerator + this.parseFunctionBody(node, false) + this.inGenerator = oldInGen + return this.finishNode(node, "FunctionExpression") +} + +// Parse arrow function expression with given parameters. + +pp$3.parseArrowExpression = function(node, params) { + var oldInGen = this.inGenerator + this.inGenerator = false + this.initFunction(node) + node.params = this.toAssignableList(params, true) + this.parseFunctionBody(node, true) + this.inGenerator = oldInGen + return this.finishNode(node, "ArrowFunctionExpression") +} + +// Parse function body and check parameters. + +pp$3.parseFunctionBody = function(node, isArrowFunction) { + var isExpression = isArrowFunction && this.type !== tt.braceL + + if (isExpression) { + node.body = this.parseMaybeAssign() + node.expression = true + } else { + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldInFunc = this.inFunction, oldLabels = this.labels + this.inFunction = true; this.labels = [] + node.body = this.parseBlock(true) + node.expression = false + this.inFunction = oldInFunc; this.labels = oldLabels + } + + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + var useStrict = (!isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) ? node.body.body[0] : null; + if (this.strict || useStrict) { + var oldStrict = this.strict + this.strict = true + if (node.id) + this.checkLVal(node.id, true) + this.checkParams(node, useStrict) + this.strict = oldStrict + } else if (isArrowFunction) { + this.checkParams(node, useStrict) + } +} + +// Checks function params for various disallowed patterns such as using "eval" +// or "arguments" and duplicate parameters. + +pp$3.checkParams = function(node, useStrict) { + var this$1 = this; + + var nameHash = {} + for (var i = 0; i < node.params.length; i++) { + if (useStrict && this$1.options.ecmaVersion >= 7 && node.params[i].type !== "Identifier") + this$1.raiseRecoverable(useStrict.start, "Illegal 'use strict' directive in function with non-simple parameter list"); + this$1.checkLVal(node.params[i], true, nameHash) + } +} + +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). + +pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var this$1 = this; + + var elts = [], first = true + while (!this.eat(close)) { + if (!first) { + this$1.expect(tt.comma) + if (allowTrailingComma && this$1.afterTrailingComma(close)) break + } else first = false + + var elt + if (allowEmpty && this$1.type === tt.comma) + elt = null + else if (this$1.type === tt.ellipsis) { + elt = this$1.parseSpread(refDestructuringErrors) + if (this$1.type === tt.comma && refDestructuringErrors && !refDestructuringErrors.trailingComma) { + refDestructuringErrors.trailingComma = this$1.lastTokStart + } + } else + elt = this$1.parseMaybeAssign(false, refDestructuringErrors) + elts.push(elt) + } + return elts +} + +// Parse the next token as an identifier. If `liberal` is true (used +// when parsing properties), it will also convert keywords into +// identifiers. + +pp$3.parseIdent = function(liberal) { + var node = this.startNode() + if (liberal && this.options.allowReserved == "never") liberal = false + if (this.type === tt.name) { + if (!liberal && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(this.value) && + (this.options.ecmaVersion >= 6 || + this.input.slice(this.start, this.end).indexOf("\\") == -1)) + this.raiseRecoverable(this.start, "The keyword '" + this.value + "' is reserved") + if (!liberal && this.inGenerator && this.value === "yield") + this.raiseRecoverable(this.start, "Can not use 'yield' as identifier inside a generator") + node.name = this.value + } else if (liberal && this.type.keyword) { + node.name = this.type.keyword + } else { + this.unexpected() + } + this.next() + return this.finishNode(node, "Identifier") +} + +// Parses yield expression inside generator. + +pp$3.parseYield = function() { + var node = this.startNode() + this.next() + if (this.type == tt.semi || this.canInsertSemicolon() || (this.type != tt.star && !this.type.startsExpr)) { + node.delegate = false + node.argument = null + } else { + node.delegate = this.eat(tt.star) + node.argument = this.parseMaybeAssign() + } + return this.finishNode(node, "YieldExpression") +} + +var pp$4 = Parser.prototype + +// This function is used to raise exceptions on parse errors. It +// takes an offset integer (into the current `input`) to indicate +// the location of the error, attaches the position to the end +// of the error message, and then raises a `SyntaxError` with that +// message. + +pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos) + message += " (" + loc.line + ":" + loc.column + ")" + var err = new SyntaxError(message) + err.pos = pos; err.loc = loc; err.raisedAt = this.pos + throw err +} + +pp$4.raiseRecoverable = pp$4.raise + +pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } +} + +var Node = function Node(parser, pos, loc) { + this.type = "" + this.start = pos + this.end = 0 + if (parser.options.locations) + this.loc = new SourceLocation(parser, loc) + if (parser.options.directSourceFile) + this.sourceFile = parser.options.directSourceFile + if (parser.options.ranges) + this.range = [pos, 0] +}; + +// Start an AST node, attaching a start offset. + +var pp$5 = Parser.prototype + +pp$5.startNode = function() { + return new Node(this, this.start, this.startLoc) +} + +pp$5.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) +} + +// Finish an AST node, adding `type` and `end` properties. + +function finishNodeAt(node, type, pos, loc) { + node.type = type + node.end = pos + if (this.options.locations) + node.loc.end = loc + if (this.options.ranges) + node.range[1] = pos + return node +} + +pp$5.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) +} + +// Finish node at given position + +pp$5.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) +} + +var TokContext = function TokContext(token, isExpr, preserveSpace, override) { + this.token = token + this.isExpr = !!isExpr + this.preserveSpace = !!preserveSpace + this.override = override +}; + +var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", true), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.readTmplToken(); }), + f_expr: new TokContext("function", true) +} + +var pp$6 = Parser.prototype + +pp$6.initialContext = function() { + return [types.b_stat] +} + +pp$6.braceIsBlock = function(prevType) { + if (prevType === tt.colon) { + var parent = this.curContext() + if (parent === types.b_stat || parent === types.b_expr) + return !parent.isExpr + } + if (prevType === tt._return) + return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR) + return true + if (prevType == tt.braceL) + return this.curContext() === types.b_stat + return !this.exprAllowed +} + +pp$6.updateContext = function(prevType) { + var update, type = this.type + if (type.keyword && prevType == tt.dot) + this.exprAllowed = false + else if (update = type.updateContext) + update.call(this, prevType) + else + this.exprAllowed = type.beforeExpr +} + +// Token-specific context update code + +tt.parenR.updateContext = tt.braceR.updateContext = function() { + if (this.context.length == 1) { + this.exprAllowed = true + return + } + var out = this.context.pop() + if (out === types.b_stat && this.curContext() === types.f_expr) { + this.context.pop() + this.exprAllowed = false + } else if (out === types.b_tmpl) { + this.exprAllowed = true + } else { + this.exprAllowed = !out.isExpr + } +} + +tt.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr) + this.exprAllowed = true +} + +tt.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl) + this.exprAllowed = true +} + +tt.parenL.updateContext = function(prevType) { + var statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while + this.context.push(statementParens ? types.p_stat : types.p_expr) + this.exprAllowed = true +} + +tt.incDec.updateContext = function() { + // tokExprAllowed stays unchanged +} + +tt._function.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== tt.semi && prevType !== tt._else && + !((prevType === tt.colon || prevType === tt.braceL) && this.curContext() === types.b_stat)) + this.context.push(types.f_expr) + this.exprAllowed = false +} + +tt.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) + this.context.pop() + else + this.context.push(types.q_tmpl) + this.exprAllowed = false +} + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + +var Token = function Token(p) { + this.type = p.type + this.value = p.value + this.start = p.start + this.end = p.end + if (p.options.locations) + this.loc = new SourceLocation(p, p.startLoc, p.endLoc) + if (p.options.ranges) + this.range = [p.start, p.end] +}; + +// ## Tokenizer + +var pp$7 = Parser.prototype + +// Are we running under Rhino? +var isRhino = typeof Packages == "object" && Object.prototype.toString.call(Packages) == "[object JavaPackage]" + +// Move to the next token + +pp$7.next = function() { + if (this.options.onToken) + this.options.onToken(new Token(this)) + + this.lastTokEnd = this.end + this.lastTokStart = this.start + this.lastTokEndLoc = this.endLoc + this.lastTokStartLoc = this.startLoc + this.nextToken() +} + +pp$7.getToken = function() { + this.next() + return new Token(this) +} + +// If we're in an ES6 environment, make parsers iterable +if (typeof Symbol !== "undefined") + pp$7[Symbol.iterator] = function () { + var self = this + return {next: function () { + var token = self.getToken() + return { + done: token.type === tt.eof, + value: token + } + }} + } + +// Toggle strict mode. Re-reads the next number or string to please +// pedantic tests (`"use strict"; 010;` should fail). + +pp$7.setStrict = function(strict) { + var this$1 = this; + + this.strict = strict + if (this.type !== tt.num && this.type !== tt.string) return + this.pos = this.start + if (this.options.locations) { + while (this.pos < this.lineStart) { + this$1.lineStart = this$1.input.lastIndexOf("\n", this$1.lineStart - 2) + 1 + --this$1.curLine + } + } + this.nextToken() +} + +pp$7.curContext = function() { + return this.context[this.context.length - 1] +} + +// Read a single token, updating the parser object's token-related +// properties. + +pp$7.nextToken = function() { + var curContext = this.curContext() + if (!curContext || !curContext.preserveSpace) this.skipSpace() + + this.start = this.pos + if (this.options.locations) this.startLoc = this.curPosition() + if (this.pos >= this.input.length) return this.finishToken(tt.eof) + + if (curContext.override) return curContext.override(this) + else this.readToken(this.fullCharCodeAtPos()) +} + +pp$7.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + return this.readWord() + + return this.getTokenFromCode(code) +} + +pp$7.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos) + if (code <= 0xd7ff || code >= 0xe000) return code + var next = this.input.charCodeAt(this.pos + 1) + return (code << 10) + next - 0x35fdc00 +} + +pp$7.skipBlockComment = function() { + var this$1 = this; + + var startLoc = this.options.onComment && this.curPosition() + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2) + if (end === -1) this.raise(this.pos - 2, "Unterminated comment") + this.pos = end + 2 + if (this.options.locations) { + lineBreakG.lastIndex = start + var match + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this$1.curLine + this$1.lineStart = match.index + match[0].length + } + } + if (this.options.onComment) + this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()) +} + +pp$7.skipLineComment = function(startSkip) { + var this$1 = this; + + var start = this.pos + var startLoc = this.options.onComment && this.curPosition() + var ch = this.input.charCodeAt(this.pos+=startSkip) + while (this.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { + ++this$1.pos + ch = this$1.input.charCodeAt(this$1.pos) + } + if (this.options.onComment) + this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()) +} + +// Called at the start of the parse and after every token. Skips +// whitespace and comments, and. + +pp$7.skipSpace = function() { + var this$1 = this; + + loop: while (this.pos < this.input.length) { + var ch = this$1.input.charCodeAt(this$1.pos) + switch (ch) { + case 32: case 160: // ' ' + ++this$1.pos + break + case 13: + if (this$1.input.charCodeAt(this$1.pos + 1) === 10) { + ++this$1.pos + } + case 10: case 8232: case 8233: + ++this$1.pos + if (this$1.options.locations) { + ++this$1.curLine + this$1.lineStart = this$1.pos + } + break + case 47: // '/' + switch (this$1.input.charCodeAt(this$1.pos + 1)) { + case 42: // '*' + this$1.skipBlockComment() + break + case 47: + this$1.skipLineComment(2) + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this$1.pos + } else { + break loop + } + } + } +} + +// Called at the end of every token. Sets `end`, `val`, and +// maintains `context` and `exprAllowed`, and skips the space after +// the token, so that the next one's `start` will point at the +// right position. + +pp$7.finishToken = function(type, val) { + this.end = this.pos + if (this.options.locations) this.endLoc = this.curPosition() + var prevType = this.type + this.type = type + this.value = val + + this.updateContext(prevType) +} + +// ### Token reading + +// This is the function that is called to fetch the next token. It +// is somewhat obscure, because it works in character codes rather +// than characters, and because operator parsing has been inlined +// into it. +// +// All in the name of speed. +// +pp$7.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1) + if (next >= 48 && next <= 57) return this.readNumber(true) + var next2 = this.input.charCodeAt(this.pos + 2) + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3 + return this.finishToken(tt.ellipsis) + } else { + ++this.pos + return this.finishToken(tt.dot) + } +} + +pp$7.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1) + if (this.exprAllowed) {++this.pos; return this.readRegexp()} + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.slash, 1) +} + +pp$7.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1) + var size = 1 + var tokentype = code === 42 ? tt.star : tt.modulo + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && next === 42) { + ++size + tokentype = tt.starstar + next = this.input.charCodeAt(this.pos + 2) + } + + if (next === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tokentype, size) +} + +pp$7.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1) + if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2) + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1) +} + +pp$7.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1) + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.bitwiseXOR, 1) +} + +pp$7.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1) + if (next === code) { + if (next == 45 && this.input.charCodeAt(this.pos + 2) == 62 && + lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) { + // A `-->` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) +} + +pp$7.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1) + var size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // `` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) + } + + pp$7.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1) + var size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // `` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) +} + +pp.readToken_lt_gt = function(code) { // '<>' + let next = this.input.charCodeAt(this.pos + 1) + let size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // ` + +### anyTypeAnnotation +```javascript +t.anyTypeAnnotation() +``` + +See also `t.isAnyTypeAnnotation(node, opts)` and `t.assertAnyTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### arrayExpression +```javascript +t.arrayExpression(elements) +``` + +See also `t.isArrayExpression(node, opts)` and `t.assertArrayExpression(node, opts)`. + +Aliases: `Expression` + + - `elements`: `Array` (default: `[]`) + +--- + +### arrayPattern +```javascript +t.arrayPattern(elements, typeAnnotation) +``` + +See also `t.isArrayPattern(node, opts)` and `t.assertArrayPattern(node, opts)`. + +Aliases: `Pattern`, `LVal` + + - `elements`: `Array` (required) + - `typeAnnotation` (required) + - `decorators`: `Array` (default: `null`) + +--- + +### arrayTypeAnnotation +```javascript +t.arrayTypeAnnotation(elementType) +``` + +See also `t.isArrayTypeAnnotation(node, opts)` and `t.assertArrayTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `elementType` (required) + +--- + +### arrowFunctionExpression +```javascript +t.arrowFunctionExpression(params, body, async) +``` + +See also `t.isArrowFunctionExpression(node, opts)` and `t.assertArrowFunctionExpression(node, opts)`. + +Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish` + + - `params`: `Array` (required) + - `body`: `BlockStatement | Expression` (required) + - `async`: `boolean` (default: `false`) + - `returnType` (default: `null`) + - `typeParameters` (default: `null`) + +--- + +### assignmentExpression +```javascript +t.assignmentExpression(operator, left, right) +``` + +See also `t.isAssignmentExpression(node, opts)` and `t.assertAssignmentExpression(node, opts)`. + +Aliases: `Expression` + + - `operator`: `string` (required) + - `left`: `LVal` (required) + - `right`: `Expression` (required) + +--- + +### assignmentPattern +```javascript +t.assignmentPattern(left, right) +``` + +See also `t.isAssignmentPattern(node, opts)` and `t.assertAssignmentPattern(node, opts)`. + +Aliases: `Pattern`, `LVal` + + - `left`: `Identifier` (required) + - `right`: `Expression` (required) + - `decorators`: `Array` (default: `null`) + +--- + +### awaitExpression +```javascript +t.awaitExpression(argument) +``` + +See also `t.isAwaitExpression(node, opts)` and `t.assertAwaitExpression(node, opts)`. + +Aliases: `Expression`, `Terminatorless` + + - `argument`: `Expression` (required) + +--- + +### binaryExpression +```javascript +t.binaryExpression(operator, left, right) +``` + +See also `t.isBinaryExpression(node, opts)` and `t.assertBinaryExpression(node, opts)`. + +Aliases: `Binary`, `Expression` + + - `operator`: `'+' | '-' | '/' | '%' | '*' | '**' | '&' | '|' | '>>' | '>>>' | '<<' | '^' | '==' | '===' | '!=' | '!==' | 'in' | 'instanceof' | '>' | '<' | '>=' | '<='` (required) + - `left`: `Expression` (required) + - `right`: `Expression` (required) + +--- + +### bindExpression +```javascript +t.bindExpression(object, callee) +``` + +See also `t.isBindExpression(node, opts)` and `t.assertBindExpression(node, opts)`. + +Aliases: `Expression` + + - `object` (required) + - `callee` (required) + +--- + +### blockStatement +```javascript +t.blockStatement(body, directives) +``` + +See also `t.isBlockStatement(node, opts)` and `t.assertBlockStatement(node, opts)`. + +Aliases: `Scopable`, `BlockParent`, `Block`, `Statement` + + - `body`: `Array` (required) + - `directives`: `Array` (default: `[]`) + +--- + +### booleanLiteral +```javascript +t.booleanLiteral(value) +``` + +See also `t.isBooleanLiteral(node, opts)` and `t.assertBooleanLiteral(node, opts)`. + +Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` + + - `value`: `boolean` (required) + +--- + +### booleanLiteralTypeAnnotation +```javascript +t.booleanLiteralTypeAnnotation() +``` + +See also `t.isBooleanLiteralTypeAnnotation(node, opts)` and `t.assertBooleanLiteralTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + +--- + +### booleanTypeAnnotation +```javascript +t.booleanTypeAnnotation() +``` + +See also `t.isBooleanTypeAnnotation(node, opts)` and `t.assertBooleanTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### breakStatement +```javascript +t.breakStatement(label) +``` + +See also `t.isBreakStatement(node, opts)` and `t.assertBreakStatement(node, opts)`. + +Aliases: `Statement`, `Terminatorless`, `CompletionStatement` + + - `label`: `Identifier` (default: `null`) + +--- + +### callExpression +```javascript +t.callExpression(callee, arguments) +``` + +See also `t.isCallExpression(node, opts)` and `t.assertCallExpression(node, opts)`. + +Aliases: `Expression` + + - `callee`: `Expression` (required) + - `arguments`: `Array` (required) + +--- + +### catchClause +```javascript +t.catchClause(param, body) +``` + +See also `t.isCatchClause(node, opts)` and `t.assertCatchClause(node, opts)`. + +Aliases: `Scopable` + + - `param`: `Identifier` (required) + - `body`: `BlockStatement` (required) + +--- + +### classBody +```javascript +t.classBody(body) +``` + +See also `t.isClassBody(node, opts)` and `t.assertClassBody(node, opts)`. + + - `body`: `Array` (required) + +--- + +### classDeclaration +```javascript +t.classDeclaration(id, superClass, body, decorators) +``` + +See also `t.isClassDeclaration(node, opts)` and `t.assertClassDeclaration(node, opts)`. + +Aliases: `Scopable`, `Class`, `Statement`, `Declaration`, `Pureish` + + - `id`: `Identifier` (required) + - `superClass`: `Expression` (default: `null`) + - `body`: `ClassBody` (required) + - `decorators`: `Array` (required) + - `implements` (default: `null`) + - `mixins` (default: `null`) + - `superTypeParameters` (default: `null`) + - `typeParameters` (default: `null`) + +--- + +### classExpression +```javascript +t.classExpression(id, superClass, body, decorators) +``` + +See also `t.isClassExpression(node, opts)` and `t.assertClassExpression(node, opts)`. + +Aliases: `Scopable`, `Class`, `Expression`, `Pureish` + + - `id`: `Identifier` (default: `null`) + - `superClass`: `Expression` (default: `null`) + - `body`: `ClassBody` (required) + - `decorators`: `Array` (required) + - `implements` (default: `null`) + - `mixins` (default: `null`) + - `superTypeParameters` (default: `null`) + - `typeParameters` (default: `null`) + +--- + +### classImplements +```javascript +t.classImplements(id, typeParameters) +``` + +See also `t.isClassImplements(node, opts)` and `t.assertClassImplements(node, opts)`. + +Aliases: `Flow` + + - `id` (required) + - `typeParameters` (required) + +--- + +### classMethod +```javascript +t.classMethod(kind, key, params, body, computed, static) +``` + +See also `t.isClassMethod(node, opts)` and `t.assertClassMethod(node, opts)`. + +Aliases: `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method` + + - `kind`: `"get" | "set" | "method" | "constructor"` (default: `'method'`) + - `key`if computed then `Expression` else `Identifier | Literal` (required) + - `params`: `Array` (required) + - `body`: `BlockStatement` (required) + - `computed`: `boolean` (default: `false`) + - `static`: `boolean` (default: `false`) + - `async`: `boolean` (default: `false`) + - `decorators` (default: `null`) + - `generator`: `boolean` (default: `false`) + - `returnType` (default: `null`) + - `typeParameters` (default: `null`) + +--- + +### classProperty +```javascript +t.classProperty(key, value, typeAnnotation, decorators, computed) +``` + +See also `t.isClassProperty(node, opts)` and `t.assertClassProperty(node, opts)`. + +Aliases: `Property` + + - `key` (required) + - `value` (required) + - `typeAnnotation` (required) + - `decorators` (required) + - `computed`: `boolean` (default: `false`) + +--- + +### conditionalExpression +```javascript +t.conditionalExpression(test, consequent, alternate) +``` + +See also `t.isConditionalExpression(node, opts)` and `t.assertConditionalExpression(node, opts)`. + +Aliases: `Expression`, `Conditional` + + - `test`: `Expression` (required) + - `consequent`: `Expression` (required) + - `alternate`: `Expression` (required) + +--- + +### continueStatement +```javascript +t.continueStatement(label) +``` + +See also `t.isContinueStatement(node, opts)` and `t.assertContinueStatement(node, opts)`. + +Aliases: `Statement`, `Terminatorless`, `CompletionStatement` + + - `label`: `Identifier` (default: `null`) + +--- + +### debuggerStatement +```javascript +t.debuggerStatement() +``` + +See also `t.isDebuggerStatement(node, opts)` and `t.assertDebuggerStatement(node, opts)`. + +Aliases: `Statement` + + +--- + +### declareClass +```javascript +t.declareClass(id, typeParameters, extends, body) +``` + +See also `t.isDeclareClass(node, opts)` and `t.assertDeclareClass(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + - `typeParameters` (required) + - `extends` (required) + - `body` (required) + +--- + +### declareFunction +```javascript +t.declareFunction(id) +``` + +See also `t.isDeclareFunction(node, opts)` and `t.assertDeclareFunction(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + +--- + +### declareInterface +```javascript +t.declareInterface(id, typeParameters, extends, body) +``` + +See also `t.isDeclareInterface(node, opts)` and `t.assertDeclareInterface(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + - `typeParameters` (required) + - `extends` (required) + - `body` (required) + +--- + +### declareModule +```javascript +t.declareModule(id, body) +``` + +See also `t.isDeclareModule(node, opts)` and `t.assertDeclareModule(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + - `body` (required) + +--- + +### declareModuleExports +```javascript +t.declareModuleExports(typeAnnotation) +``` + +See also `t.isDeclareModuleExports(node, opts)` and `t.assertDeclareModuleExports(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `typeAnnotation` (required) + +--- + +### declareTypeAlias +```javascript +t.declareTypeAlias(id, typeParameters, right) +``` + +See also `t.isDeclareTypeAlias(node, opts)` and `t.assertDeclareTypeAlias(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + - `typeParameters` (required) + - `right` (required) + +--- + +### declareVariable +```javascript +t.declareVariable(id) +``` + +See also `t.isDeclareVariable(node, opts)` and `t.assertDeclareVariable(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + +--- + +### decorator +```javascript +t.decorator(expression) +``` + +See also `t.isDecorator(node, opts)` and `t.assertDecorator(node, opts)`. + + - `expression`: `Expression` (required) + +--- + +### directive +```javascript +t.directive(value) +``` + +See also `t.isDirective(node, opts)` and `t.assertDirective(node, opts)`. + + - `value`: `DirectiveLiteral` (required) + +--- + +### directiveLiteral +```javascript +t.directiveLiteral(value) +``` + +See also `t.isDirectiveLiteral(node, opts)` and `t.assertDirectiveLiteral(node, opts)`. + + - `value`: `string` (required) + +--- + +### doExpression +```javascript +t.doExpression(body) +``` + +See also `t.isDoExpression(node, opts)` and `t.assertDoExpression(node, opts)`. + +Aliases: `Expression` + + - `body`: `BlockStatement` (required) + +--- + +### doWhileStatement +```javascript +t.doWhileStatement(test, body) +``` + +See also `t.isDoWhileStatement(node, opts)` and `t.assertDoWhileStatement(node, opts)`. + +Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable` + + - `test`: `Expression` (required) + - `body`: `Statement` (required) + +--- + +### emptyStatement +```javascript +t.emptyStatement() +``` + +See also `t.isEmptyStatement(node, opts)` and `t.assertEmptyStatement(node, opts)`. + +Aliases: `Statement` + + +--- + +### emptyTypeAnnotation +```javascript +t.emptyTypeAnnotation() +``` + +See also `t.isEmptyTypeAnnotation(node, opts)` and `t.assertEmptyTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### existentialTypeParam +```javascript +t.existentialTypeParam() +``` + +See also `t.isExistentialTypeParam(node, opts)` and `t.assertExistentialTypeParam(node, opts)`. + +Aliases: `Flow` + + +--- + +### exportAllDeclaration +```javascript +t.exportAllDeclaration(source) +``` + +See also `t.isExportAllDeclaration(node, opts)` and `t.assertExportAllDeclaration(node, opts)`. + +Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` + + - `source`: `StringLiteral` (required) + +--- + +### exportDefaultDeclaration +```javascript +t.exportDefaultDeclaration(declaration) +``` + +See also `t.isExportDefaultDeclaration(node, opts)` and `t.assertExportDefaultDeclaration(node, opts)`. + +Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` + + - `declaration`: `FunctionDeclaration | ClassDeclaration | Expression` (required) + +--- + +### exportDefaultSpecifier +```javascript +t.exportDefaultSpecifier(exported) +``` + +See also `t.isExportDefaultSpecifier(node, opts)` and `t.assertExportDefaultSpecifier(node, opts)`. + +Aliases: `ModuleSpecifier` + + - `exported`: `Identifier` (required) + +--- + +### exportNamedDeclaration +```javascript +t.exportNamedDeclaration(declaration, specifiers, source) +``` + +See also `t.isExportNamedDeclaration(node, opts)` and `t.assertExportNamedDeclaration(node, opts)`. + +Aliases: `Statement`, `Declaration`, `ModuleDeclaration`, `ExportDeclaration` + + - `declaration`: `Declaration` (default: `null`) + - `specifiers`: `Array` (required) + - `source`: `StringLiteral` (default: `null`) + +--- + +### exportNamespaceSpecifier +```javascript +t.exportNamespaceSpecifier(exported) +``` + +See also `t.isExportNamespaceSpecifier(node, opts)` and `t.assertExportNamespaceSpecifier(node, opts)`. + +Aliases: `ModuleSpecifier` + + - `exported`: `Identifier` (required) + +--- + +### exportSpecifier +```javascript +t.exportSpecifier(local, exported) +``` + +See also `t.isExportSpecifier(node, opts)` and `t.assertExportSpecifier(node, opts)`. + +Aliases: `ModuleSpecifier` + + - `local`: `Identifier` (required) + - `exported`: `Identifier` (required) + +--- + +### expressionStatement +```javascript +t.expressionStatement(expression) +``` + +See also `t.isExpressionStatement(node, opts)` and `t.assertExpressionStatement(node, opts)`. + +Aliases: `Statement`, `ExpressionWrapper` + + - `expression`: `Expression` (required) + +--- + +### file +```javascript +t.file(program, comments, tokens) +``` + +See also `t.isFile(node, opts)` and `t.assertFile(node, opts)`. + + - `program`: `Program` (required) + - `comments` (required) + - `tokens` (required) + +--- + +### forAwaitStatement +```javascript +t.forAwaitStatement(left, right, body) +``` + +See also `t.isForAwaitStatement(node, opts)` and `t.assertForAwaitStatement(node, opts)`. + +Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` + + - `left`: `VariableDeclaration | LVal` (required) + - `right`: `Expression` (required) + - `body`: `Statement` (required) + +--- + +### forInStatement +```javascript +t.forInStatement(left, right, body) +``` + +See also `t.isForInStatement(node, opts)` and `t.assertForInStatement(node, opts)`. + +Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` + + - `left`: `VariableDeclaration | LVal` (required) + - `right`: `Expression` (required) + - `body`: `Statement` (required) + +--- + +### forOfStatement +```javascript +t.forOfStatement(left, right, body) +``` + +See also `t.isForOfStatement(node, opts)` and `t.assertForOfStatement(node, opts)`. + +Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop`, `ForXStatement` + + - `left`: `VariableDeclaration | LVal` (required) + - `right`: `Expression` (required) + - `body`: `Statement` (required) + +--- + +### forStatement +```javascript +t.forStatement(init, test, update, body) +``` + +See also `t.isForStatement(node, opts)` and `t.assertForStatement(node, opts)`. + +Aliases: `Scopable`, `Statement`, `For`, `BlockParent`, `Loop` + + - `init`: `VariableDeclaration | Expression` (default: `null`) + - `test`: `Expression` (default: `null`) + - `update`: `Expression` (default: `null`) + - `body`: `Statement` (required) + +--- + +### functionDeclaration +```javascript +t.functionDeclaration(id, params, body, generator, async) +``` + +See also `t.isFunctionDeclaration(node, opts)` and `t.assertFunctionDeclaration(node, opts)`. + +Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Statement`, `Pureish`, `Declaration` + + - `id`: `Identifier` (required) + - `params`: `Array` (required) + - `body`: `BlockStatement` (required) + - `generator`: `boolean` (default: `false`) + - `async`: `boolean` (default: `false`) + - `returnType` (default: `null`) + - `typeParameters` (default: `null`) + +--- + +### functionExpression +```javascript +t.functionExpression(id, params, body, generator, async) +``` + +See also `t.isFunctionExpression(node, opts)` and `t.assertFunctionExpression(node, opts)`. + +Aliases: `Scopable`, `Function`, `BlockParent`, `FunctionParent`, `Expression`, `Pureish` + + - `id`: `Identifier` (default: `null`) + - `params`: `Array` (required) + - `body`: `BlockStatement` (required) + - `generator`: `boolean` (default: `false`) + - `async`: `boolean` (default: `false`) + - `returnType` (default: `null`) + - `typeParameters` (default: `null`) + +--- + +### functionTypeAnnotation +```javascript +t.functionTypeAnnotation(typeParameters, params, rest, returnType) +``` + +See also `t.isFunctionTypeAnnotation(node, opts)` and `t.assertFunctionTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `typeParameters` (required) + - `params` (required) + - `rest` (required) + - `returnType` (required) + +--- + +### functionTypeParam +```javascript +t.functionTypeParam(name, typeAnnotation) +``` + +See also `t.isFunctionTypeParam(node, opts)` and `t.assertFunctionTypeParam(node, opts)`. + +Aliases: `Flow` + + - `name` (required) + - `typeAnnotation` (required) + +--- + +### genericTypeAnnotation +```javascript +t.genericTypeAnnotation(id, typeParameters) +``` + +See also `t.isGenericTypeAnnotation(node, opts)` and `t.assertGenericTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `id` (required) + - `typeParameters` (required) + +--- + +### identifier +```javascript +t.identifier(name) +``` + +See also `t.isIdentifier(node, opts)` and `t.assertIdentifier(node, opts)`. + +Aliases: `Expression`, `LVal` + + - `name``string` (required) + - `decorators`: `Array` (default: `null`) + - `typeAnnotation` (default: `null`) + +--- + +### ifStatement +```javascript +t.ifStatement(test, consequent, alternate) +``` + +See also `t.isIfStatement(node, opts)` and `t.assertIfStatement(node, opts)`. + +Aliases: `Statement`, `Conditional` + + - `test`: `Expression` (required) + - `consequent`: `Statement` (required) + - `alternate`: `Statement` (default: `null`) + +--- + +### import +```javascript +t.import() +``` + +See also `t.isImport(node, opts)` and `t.assertImport(node, opts)`. + +Aliases: `Expression` + + +--- + +### importDeclaration +```javascript +t.importDeclaration(specifiers, source) +``` + +See also `t.isImportDeclaration(node, opts)` and `t.assertImportDeclaration(node, opts)`. + +Aliases: `Statement`, `Declaration`, `ModuleDeclaration` + + - `specifiers`: `Array` (required) + - `source`: `StringLiteral` (required) + +--- + +### importDefaultSpecifier +```javascript +t.importDefaultSpecifier(local) +``` + +See also `t.isImportDefaultSpecifier(node, opts)` and `t.assertImportDefaultSpecifier(node, opts)`. + +Aliases: `ModuleSpecifier` + + - `local`: `Identifier` (required) + +--- + +### importNamespaceSpecifier +```javascript +t.importNamespaceSpecifier(local) +``` + +See also `t.isImportNamespaceSpecifier(node, opts)` and `t.assertImportNamespaceSpecifier(node, opts)`. + +Aliases: `ModuleSpecifier` + + - `local`: `Identifier` (required) + +--- + +### importSpecifier +```javascript +t.importSpecifier(local, imported) +``` + +See also `t.isImportSpecifier(node, opts)` and `t.assertImportSpecifier(node, opts)`. + +Aliases: `ModuleSpecifier` + + - `local`: `Identifier` (required) + - `imported`: `Identifier` (required) + - `importKind`: `null | 'type' | 'typeof'` (default: `null`) + +--- + +### interfaceDeclaration +```javascript +t.interfaceDeclaration(id, typeParameters, extends, body) +``` + +See also `t.isInterfaceDeclaration(node, opts)` and `t.assertInterfaceDeclaration(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + - `typeParameters` (required) + - `extends` (required) + - `body` (required) + +--- + +### interfaceExtends +```javascript +t.interfaceExtends(id, typeParameters) +``` + +See also `t.isInterfaceExtends(node, opts)` and `t.assertInterfaceExtends(node, opts)`. + +Aliases: `Flow` + + - `id` (required) + - `typeParameters` (required) + +--- + +### intersectionTypeAnnotation +```javascript +t.intersectionTypeAnnotation(types) +``` + +See also `t.isIntersectionTypeAnnotation(node, opts)` and `t.assertIntersectionTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `types` (required) + +--- + +### jSXAttribute +```javascript +t.jSXAttribute(name, value) +``` + +See also `t.isJSXAttribute(node, opts)` and `t.assertJSXAttribute(node, opts)`. + +Aliases: `JSX`, `Immutable` + + - `name`: `JSXIdentifier | JSXNamespacedName` (required) + - `value`: `JSXElement | StringLiteral | JSXExpressionContainer` (default: `null`) + +--- + +### jSXClosingElement +```javascript +t.jSXClosingElement(name) +``` + +See also `t.isJSXClosingElement(node, opts)` and `t.assertJSXClosingElement(node, opts)`. + +Aliases: `JSX`, `Immutable` + + - `name`: `JSXIdentifier | JSXMemberExpression` (required) + +--- + +### jSXElement +```javascript +t.jSXElement(openingElement, closingElement, children, selfClosing) +``` + +See also `t.isJSXElement(node, opts)` and `t.assertJSXElement(node, opts)`. + +Aliases: `JSX`, `Immutable`, `Expression` + + - `openingElement`: `JSXOpeningElement` (required) + - `closingElement`: `JSXClosingElement` (default: `null`) + - `children`: `Array` (required) + - `selfClosing` (required) + +--- + +### jSXEmptyExpression +```javascript +t.jSXEmptyExpression() +``` + +See also `t.isJSXEmptyExpression(node, opts)` and `t.assertJSXEmptyExpression(node, opts)`. + +Aliases: `JSX`, `Expression` + + +--- + +### jSXExpressionContainer +```javascript +t.jSXExpressionContainer(expression) +``` + +See also `t.isJSXExpressionContainer(node, opts)` and `t.assertJSXExpressionContainer(node, opts)`. + +Aliases: `JSX`, `Immutable` + + - `expression`: `Expression` (required) + +--- + +### jSXIdentifier +```javascript +t.jSXIdentifier(name) +``` + +See also `t.isJSXIdentifier(node, opts)` and `t.assertJSXIdentifier(node, opts)`. + +Aliases: `JSX`, `Expression` + + - `name`: `string` (required) + +--- + +### jSXMemberExpression +```javascript +t.jSXMemberExpression(object, property) +``` + +See also `t.isJSXMemberExpression(node, opts)` and `t.assertJSXMemberExpression(node, opts)`. + +Aliases: `JSX`, `Expression` + + - `object`: `JSXMemberExpression | JSXIdentifier` (required) + - `property`: `JSXIdentifier` (required) + +--- + +### jSXNamespacedName +```javascript +t.jSXNamespacedName(namespace, name) +``` + +See also `t.isJSXNamespacedName(node, opts)` and `t.assertJSXNamespacedName(node, opts)`. + +Aliases: `JSX` + + - `namespace`: `JSXIdentifier` (required) + - `name`: `JSXIdentifier` (required) + +--- + +### jSXOpeningElement +```javascript +t.jSXOpeningElement(name, attributes, selfClosing) +``` + +See also `t.isJSXOpeningElement(node, opts)` and `t.assertJSXOpeningElement(node, opts)`. + +Aliases: `JSX`, `Immutable` + + - `name`: `JSXIdentifier | JSXMemberExpression` (required) + - `attributes`: `Array` (required) + - `selfClosing`: `boolean` (default: `false`) + +--- + +### jSXSpreadAttribute +```javascript +t.jSXSpreadAttribute(argument) +``` + +See also `t.isJSXSpreadAttribute(node, opts)` and `t.assertJSXSpreadAttribute(node, opts)`. + +Aliases: `JSX` + + - `argument`: `Expression` (required) + +--- + +### jSXSpreadChild +```javascript +t.jSXSpreadChild(expression) +``` + +See also `t.isJSXSpreadChild(node, opts)` and `t.assertJSXSpreadChild(node, opts)`. + +Aliases: `JSX`, `Immutable` + + - `expression`: `Expression` (required) + +--- + +### jSXText +```javascript +t.jSXText(value) +``` + +See also `t.isJSXText(node, opts)` and `t.assertJSXText(node, opts)`. + +Aliases: `JSX`, `Immutable` + + - `value`: `string` (required) + +--- + +### labeledStatement +```javascript +t.labeledStatement(label, body) +``` + +See also `t.isLabeledStatement(node, opts)` and `t.assertLabeledStatement(node, opts)`. + +Aliases: `Statement` + + - `label`: `Identifier` (required) + - `body`: `Statement` (required) + +--- + +### logicalExpression +```javascript +t.logicalExpression(operator, left, right) +``` + +See also `t.isLogicalExpression(node, opts)` and `t.assertLogicalExpression(node, opts)`. + +Aliases: `Binary`, `Expression` + + - `operator`: `'||' | '&&'` (required) + - `left`: `Expression` (required) + - `right`: `Expression` (required) + +--- + +### memberExpression +```javascript +t.memberExpression(object, property, computed) +``` + +See also `t.isMemberExpression(node, opts)` and `t.assertMemberExpression(node, opts)`. + +Aliases: `Expression`, `LVal` + + - `object`: `Expression` (required) + - `property`if computed then `Expression` else `Identifier` (required) + - `computed`: `boolean` (default: `false`) + +--- + +### metaProperty +```javascript +t.metaProperty(meta, property) +``` + +See also `t.isMetaProperty(node, opts)` and `t.assertMetaProperty(node, opts)`. + +Aliases: `Expression` + + - `meta`: `string` (required) + - `property`: `string` (required) + +--- + +### mixedTypeAnnotation +```javascript +t.mixedTypeAnnotation() +``` + +See also `t.isMixedTypeAnnotation(node, opts)` and `t.assertMixedTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### newExpression +```javascript +t.newExpression(callee, arguments) +``` + +See also `t.isNewExpression(node, opts)` and `t.assertNewExpression(node, opts)`. + +Aliases: `Expression` + + - `callee`: `Expression` (required) + - `arguments`: `Array` (required) + +--- + +### noop +```javascript +t.noop() +``` + +See also `t.isNoop(node, opts)` and `t.assertNoop(node, opts)`. + + +--- + +### nullLiteral +```javascript +t.nullLiteral() +``` + +See also `t.isNullLiteral(node, opts)` and `t.assertNullLiteral(node, opts)`. + +Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` + + +--- + +### nullLiteralTypeAnnotation +```javascript +t.nullLiteralTypeAnnotation() +``` + +See also `t.isNullLiteralTypeAnnotation(node, opts)` and `t.assertNullLiteralTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### nullableTypeAnnotation +```javascript +t.nullableTypeAnnotation(typeAnnotation) +``` + +See also `t.isNullableTypeAnnotation(node, opts)` and `t.assertNullableTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `typeAnnotation` (required) + +--- + +### numberTypeAnnotation +```javascript +t.numberTypeAnnotation() +``` + +See also `t.isNumberTypeAnnotation(node, opts)` and `t.assertNumberTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### numericLiteral +```javascript +t.numericLiteral(value) +``` + +See also `t.isNumericLiteral(node, opts)` and `t.assertNumericLiteral(node, opts)`. + +Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` + + - `value`: `number` (required) + +--- + +### numericLiteralTypeAnnotation +```javascript +t.numericLiteralTypeAnnotation() +``` + +See also `t.isNumericLiteralTypeAnnotation(node, opts)` and `t.assertNumericLiteralTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + +--- + +### objectExpression +```javascript +t.objectExpression(properties) +``` + +See also `t.isObjectExpression(node, opts)` and `t.assertObjectExpression(node, opts)`. + +Aliases: `Expression` + + - `properties`: `Array` (required) + +--- + +### objectMethod +```javascript +t.objectMethod(kind, key, params, body, computed) +``` + +See also `t.isObjectMethod(node, opts)` and `t.assertObjectMethod(node, opts)`. + +Aliases: `UserWhitespacable`, `Function`, `Scopable`, `BlockParent`, `FunctionParent`, `Method`, `ObjectMember` + + - `kind`: `"method" | "get" | "set"` (default: `'method'`) + - `key`if computed then `Expression` else `Identifier | Literal` (required) + - `params` (required) + - `body`: `BlockStatement` (required) + - `computed`: `boolean` (default: `false`) + - `async`: `boolean` (default: `false`) + - `decorators`: `Array` (default: `null`) + - `generator`: `boolean` (default: `false`) + - `returnType` (default: `null`) + - `typeParameters` (default: `null`) + +--- + +### objectPattern +```javascript +t.objectPattern(properties, typeAnnotation) +``` + +See also `t.isObjectPattern(node, opts)` and `t.assertObjectPattern(node, opts)`. + +Aliases: `Pattern`, `LVal` + + - `properties`: `Array` (required) + - `typeAnnotation` (required) + - `decorators`: `Array` (default: `null`) + +--- + +### objectProperty +```javascript +t.objectProperty(key, value, computed, shorthand, decorators) +``` + +See also `t.isObjectProperty(node, opts)` and `t.assertObjectProperty(node, opts)`. + +Aliases: `UserWhitespacable`, `Property`, `ObjectMember` + + - `key`if computed then `Expression` else `Identifier | Literal` (required) + - `value`: `Expression` (required) + - `computed`: `boolean` (default: `false`) + - `shorthand`: `boolean` (default: `false`) + - `decorators`: `Array` (default: `null`) + +--- + +### objectTypeAnnotation +```javascript +t.objectTypeAnnotation(properties, indexers, callProperties) +``` + +See also `t.isObjectTypeAnnotation(node, opts)` and `t.assertObjectTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `properties` (required) + - `indexers` (required) + - `callProperties` (required) + +--- + +### objectTypeCallProperty +```javascript +t.objectTypeCallProperty(value) +``` + +See also `t.isObjectTypeCallProperty(node, opts)` and `t.assertObjectTypeCallProperty(node, opts)`. + +Aliases: `Flow`, `UserWhitespacable` + + - `value` (required) + +--- + +### objectTypeIndexer +```javascript +t.objectTypeIndexer(id, key, value) +``` + +See also `t.isObjectTypeIndexer(node, opts)` and `t.assertObjectTypeIndexer(node, opts)`. + +Aliases: `Flow`, `UserWhitespacable` + + - `id` (required) + - `key` (required) + - `value` (required) + +--- + +### objectTypeProperty +```javascript +t.objectTypeProperty(key, value) +``` + +See also `t.isObjectTypeProperty(node, opts)` and `t.assertObjectTypeProperty(node, opts)`. + +Aliases: `Flow`, `UserWhitespacable` + + - `key` (required) + - `value` (required) + +--- + +### parenthesizedExpression +```javascript +t.parenthesizedExpression(expression) +``` + +See also `t.isParenthesizedExpression(node, opts)` and `t.assertParenthesizedExpression(node, opts)`. + +Aliases: `Expression`, `ExpressionWrapper` + + - `expression`: `Expression` (required) + +--- + +### program +```javascript +t.program(body, directives) +``` + +See also `t.isProgram(node, opts)` and `t.assertProgram(node, opts)`. + +Aliases: `Scopable`, `BlockParent`, `Block`, `FunctionParent` + + - `body`: `Array` (required) + - `directives`: `Array` (default: `[]`) + +--- + +### qualifiedTypeIdentifier +```javascript +t.qualifiedTypeIdentifier(id, qualification) +``` + +See also `t.isQualifiedTypeIdentifier(node, opts)` and `t.assertQualifiedTypeIdentifier(node, opts)`. + +Aliases: `Flow` + + - `id` (required) + - `qualification` (required) + +--- + +### regExpLiteral +```javascript +t.regExpLiteral(pattern, flags) +``` + +See also `t.isRegExpLiteral(node, opts)` and `t.assertRegExpLiteral(node, opts)`. + +Aliases: `Expression`, `Literal` + + - `pattern`: `string` (required) + - `flags`: `string` (default: `''`) + +--- + +### restElement +```javascript +t.restElement(argument, typeAnnotation) +``` + +See also `t.isRestElement(node, opts)` and `t.assertRestElement(node, opts)`. + +Aliases: `LVal` + + - `argument`: `LVal` (required) + - `typeAnnotation` (required) + - `decorators`: `Array` (default: `null`) + +--- + +### restProperty +```javascript +t.restProperty(argument) +``` + +See also `t.isRestProperty(node, opts)` and `t.assertRestProperty(node, opts)`. + +Aliases: `UnaryLike` + + - `argument`: `LVal` (required) + +--- + +### returnStatement +```javascript +t.returnStatement(argument) +``` + +See also `t.isReturnStatement(node, opts)` and `t.assertReturnStatement(node, opts)`. + +Aliases: `Statement`, `Terminatorless`, `CompletionStatement` + + - `argument`: `Expression` (default: `null`) + +--- + +### sequenceExpression +```javascript +t.sequenceExpression(expressions) +``` + +See also `t.isSequenceExpression(node, opts)` and `t.assertSequenceExpression(node, opts)`. + +Aliases: `Expression` + + - `expressions`: `Array` (required) + +--- + +### spreadElement +```javascript +t.spreadElement(argument) +``` + +See also `t.isSpreadElement(node, opts)` and `t.assertSpreadElement(node, opts)`. + +Aliases: `UnaryLike` + + - `argument`: `Expression` (required) + +--- + +### spreadProperty +```javascript +t.spreadProperty(argument) +``` + +See also `t.isSpreadProperty(node, opts)` and `t.assertSpreadProperty(node, opts)`. + +Aliases: `UnaryLike` + + - `argument`: `Expression` (required) + +--- + +### stringLiteral +```javascript +t.stringLiteral(value) +``` + +See also `t.isStringLiteral(node, opts)` and `t.assertStringLiteral(node, opts)`. + +Aliases: `Expression`, `Pureish`, `Literal`, `Immutable` + + - `value`: `string` (required) + +--- + +### stringLiteralTypeAnnotation +```javascript +t.stringLiteralTypeAnnotation() +``` + +See also `t.isStringLiteralTypeAnnotation(node, opts)` and `t.assertStringLiteralTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + +--- + +### stringTypeAnnotation +```javascript +t.stringTypeAnnotation() +``` + +See also `t.isStringTypeAnnotation(node, opts)` and `t.assertStringTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### super +```javascript +t.super() +``` + +See also `t.isSuper(node, opts)` and `t.assertSuper(node, opts)`. + +Aliases: `Expression` + + +--- + +### switchCase +```javascript +t.switchCase(test, consequent) +``` + +See also `t.isSwitchCase(node, opts)` and `t.assertSwitchCase(node, opts)`. + + - `test`: `Expression` (default: `null`) + - `consequent`: `Array` (required) + +--- + +### switchStatement +```javascript +t.switchStatement(discriminant, cases) +``` + +See also `t.isSwitchStatement(node, opts)` and `t.assertSwitchStatement(node, opts)`. + +Aliases: `Statement`, `BlockParent`, `Scopable` + + - `discriminant`: `Expression` (required) + - `cases`: `Array` (required) + +--- + +### taggedTemplateExpression +```javascript +t.taggedTemplateExpression(tag, quasi) +``` + +See also `t.isTaggedTemplateExpression(node, opts)` and `t.assertTaggedTemplateExpression(node, opts)`. + +Aliases: `Expression` + + - `tag`: `Expression` (required) + - `quasi`: `TemplateLiteral` (required) + +--- + +### templateElement +```javascript +t.templateElement(value, tail) +``` + +See also `t.isTemplateElement(node, opts)` and `t.assertTemplateElement(node, opts)`. + + - `value` (required) + - `tail`: `boolean` (default: `false`) + +--- + +### templateLiteral +```javascript +t.templateLiteral(quasis, expressions) +``` + +See also `t.isTemplateLiteral(node, opts)` and `t.assertTemplateLiteral(node, opts)`. + +Aliases: `Expression`, `Literal` + + - `quasis`: `Array` (required) + - `expressions`: `Array` (required) + +--- + +### thisExpression +```javascript +t.thisExpression() +``` + +See also `t.isThisExpression(node, opts)` and `t.assertThisExpression(node, opts)`. + +Aliases: `Expression` + + +--- + +### thisTypeAnnotation +```javascript +t.thisTypeAnnotation() +``` + +See also `t.isThisTypeAnnotation(node, opts)` and `t.assertThisTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### throwStatement +```javascript +t.throwStatement(argument) +``` + +See also `t.isThrowStatement(node, opts)` and `t.assertThrowStatement(node, opts)`. + +Aliases: `Statement`, `Terminatorless`, `CompletionStatement` + + - `argument`: `Expression` (required) + +--- + +### tryStatement +```javascript +t.tryStatement(block, handler, finalizer) +``` + +See also `t.isTryStatement(node, opts)` and `t.assertTryStatement(node, opts)`. + +Aliases: `Statement` + + - `block` (required) + - `handler` (default: `null`) + - `finalizer`: `BlockStatement` (default: `null`) + - `body`: `BlockStatement` (default: `null`) + +--- + +### tupleTypeAnnotation +```javascript +t.tupleTypeAnnotation(types) +``` + +See also `t.isTupleTypeAnnotation(node, opts)` and `t.assertTupleTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `types` (required) + +--- + +### typeAlias +```javascript +t.typeAlias(id, typeParameters, right) +``` + +See also `t.isTypeAlias(node, opts)` and `t.assertTypeAlias(node, opts)`. + +Aliases: `Flow`, `FlowDeclaration`, `Statement`, `Declaration` + + - `id` (required) + - `typeParameters` (required) + - `right` (required) + +--- + +### typeAnnotation +```javascript +t.typeAnnotation(typeAnnotation) +``` + +See also `t.isTypeAnnotation(node, opts)` and `t.assertTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `typeAnnotation` (required) + +--- + +### typeCastExpression +```javascript +t.typeCastExpression(expression, typeAnnotation) +``` + +See also `t.isTypeCastExpression(node, opts)` and `t.assertTypeCastExpression(node, opts)`. + +Aliases: `Flow`, `ExpressionWrapper`, `Expression` + + - `expression` (required) + - `typeAnnotation` (required) + +--- + +### typeParameter +```javascript +t.typeParameter(bound) +``` + +See also `t.isTypeParameter(node, opts)` and `t.assertTypeParameter(node, opts)`. + +Aliases: `Flow` + + - `bound` (required) + +--- + +### typeParameterDeclaration +```javascript +t.typeParameterDeclaration(params) +``` + +See also `t.isTypeParameterDeclaration(node, opts)` and `t.assertTypeParameterDeclaration(node, opts)`. + +Aliases: `Flow` + + - `params` (required) + +--- + +### typeParameterInstantiation +```javascript +t.typeParameterInstantiation(params) +``` + +See also `t.isTypeParameterInstantiation(node, opts)` and `t.assertTypeParameterInstantiation(node, opts)`. + +Aliases: `Flow` + + - `params` (required) + +--- + +### typeofTypeAnnotation +```javascript +t.typeofTypeAnnotation(argument) +``` + +See also `t.isTypeofTypeAnnotation(node, opts)` and `t.assertTypeofTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `argument` (required) + +--- + +### unaryExpression +```javascript +t.unaryExpression(operator, argument, prefix) +``` + +See also `t.isUnaryExpression(node, opts)` and `t.assertUnaryExpression(node, opts)`. + +Aliases: `UnaryLike`, `Expression` + + - `operator`: `'void' | 'delete' | '!' | '+' | '-' | '++' | '--' | '~' | 'typeof'` (required) + - `argument`: `Expression` (required) + - `prefix`: `boolean` (default: `true`) + +--- + +### unionTypeAnnotation +```javascript +t.unionTypeAnnotation(types) +``` + +See also `t.isUnionTypeAnnotation(node, opts)` and `t.assertUnionTypeAnnotation(node, opts)`. + +Aliases: `Flow` + + - `types` (required) + +--- + +### updateExpression +```javascript +t.updateExpression(operator, argument, prefix) +``` + +See also `t.isUpdateExpression(node, opts)` and `t.assertUpdateExpression(node, opts)`. + +Aliases: `Expression` + + - `operator`: `'++' | '--'` (required) + - `argument`: `Expression` (required) + - `prefix`: `boolean` (default: `false`) + +--- + +### variableDeclaration +```javascript +t.variableDeclaration(kind, declarations) +``` + +See also `t.isVariableDeclaration(node, opts)` and `t.assertVariableDeclaration(node, opts)`. + +Aliases: `Statement`, `Declaration` + + - `kind`: `"var" | "let" | "const"` (required) + - `declarations`: `Array` (required) + +--- + +### variableDeclarator +```javascript +t.variableDeclarator(id, init) +``` + +See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(node, opts)`. + + - `id`: `LVal` (required) + - `init`: `Expression` (default: `null`) + +--- + +### voidTypeAnnotation +```javascript +t.voidTypeAnnotation() +``` + +See also `t.isVoidTypeAnnotation(node, opts)` and `t.assertVoidTypeAnnotation(node, opts)`. + +Aliases: `Flow`, `FlowBaseAnnotation` + + +--- + +### whileStatement +```javascript +t.whileStatement(test, body) +``` + +See also `t.isWhileStatement(node, opts)` and `t.assertWhileStatement(node, opts)`. + +Aliases: `Statement`, `BlockParent`, `Loop`, `While`, `Scopable` + + - `test`: `Expression` (required) + - `body`: `BlockStatement | Statement` (required) + +--- + +### withStatement +```javascript +t.withStatement(object, body) +``` + +See also `t.isWithStatement(node, opts)` and `t.assertWithStatement(node, opts)`. + +Aliases: `Statement` + + - `object` (required) + - `body`: `BlockStatement | Statement` (required) + +--- + +### yieldExpression +```javascript +t.yieldExpression(argument, delegate) +``` + +See also `t.isYieldExpression(node, opts)` and `t.assertYieldExpression(node, opts)`. + +Aliases: `Expression`, `Terminatorless` + + - `argument`: `Expression` (default: `null`) + - `delegate`: `boolean` (default: `false`) + +--- + + + + diff --git a/node_modules/babel-types/lib/constants.js b/node_modules/babel-types/lib/constants.js new file mode 100755 index 00000000..ba15090b --- /dev/null +++ b/node_modules/babel-types/lib/constants.js @@ -0,0 +1,38 @@ +"use strict"; + +exports.__esModule = true; +exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined; + +var _for = require("babel-runtime/core-js/symbol/for"); + +var _for2 = _interopRequireDefault(_for); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var STATEMENT_OR_BLOCK_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; +var FLATTENABLE_KEYS = exports.FLATTENABLE_KEYS = ["body", "expressions"]; +var FOR_INIT_KEYS = exports.FOR_INIT_KEYS = ["left", "init"]; +var COMMENT_KEYS = exports.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; + +var LOGICAL_OPERATORS = exports.LOGICAL_OPERATORS = ["||", "&&"]; +var UPDATE_OPERATORS = exports.UPDATE_OPERATORS = ["++", "--"]; + +var BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; +var EQUALITY_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; +var COMPARISON_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = [].concat(EQUALITY_BINARY_OPERATORS, ["in", "instanceof"]); +var BOOLEAN_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = [].concat(COMPARISON_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS); +var NUMBER_BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; +var BINARY_OPERATORS = exports.BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS); + +var BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; +var NUMBER_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = ["+", "-", "++", "--", "~"]; +var STRING_UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = ["typeof"]; +var UNARY_OPERATORS = exports.UNARY_OPERATORS = ["void"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS); + +var INHERIT_KEYS = exports.INHERIT_KEYS = { + optional: ["typeAnnotation", "typeParameters", "returnType"], + force: ["start", "loc", "end"] +}; + +var BLOCK_SCOPED_SYMBOL = exports.BLOCK_SCOPED_SYMBOL = (0, _for2.default)("var used to be block scoped"); +var NOT_LOCAL_BINDING = exports.NOT_LOCAL_BINDING = (0, _for2.default)("should not be considered a local binding"); \ No newline at end of file diff --git a/node_modules/babel-types/lib/converters.js b/node_modules/babel-types/lib/converters.js new file mode 100755 index 00000000..94db954b --- /dev/null +++ b/node_modules/babel-types/lib/converters.js @@ -0,0 +1,338 @@ +"use strict"; + +exports.__esModule = true; + +var _maxSafeInteger = require("babel-runtime/core-js/number/max-safe-integer"); + +var _maxSafeInteger2 = _interopRequireDefault(_maxSafeInteger); + +var _stringify = require("babel-runtime/core-js/json/stringify"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _getIterator2 = require("babel-runtime/core-js/get-iterator"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.toComputedKey = toComputedKey; +exports.toSequenceExpression = toSequenceExpression; +exports.toKeyAlias = toKeyAlias; +exports.toIdentifier = toIdentifier; +exports.toBindingIdentifierName = toBindingIdentifierName; +exports.toStatement = toStatement; +exports.toExpression = toExpression; +exports.toBlock = toBlock; +exports.valueToNode = valueToNode; + +var _isPlainObject = require("lodash/isPlainObject"); + +var _isPlainObject2 = _interopRequireDefault(_isPlainObject); + +var _isRegExp = require("lodash/isRegExp"); + +var _isRegExp2 = _interopRequireDefault(_isRegExp); + +var _index = require("./index"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function toComputedKey(node) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key || node.property; + + if (!node.computed) { + if (t.isIdentifier(key)) key = t.stringLiteral(key.name); + } + return key; +} + +function toSequenceExpression(nodes, scope) { + if (!nodes || !nodes.length) return; + + var declars = []; + var bailed = false; + + var result = convert(nodes); + if (bailed) return; + + for (var i = 0; i < declars.length; i++) { + scope.push(declars[i]); + } + + return result; + + function convert(nodes) { + var ensureLastUndefined = false; + var exprs = []; + + for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var node = _ref; + + if (t.isExpression(node)) { + exprs.push(node); + } else if (t.isExpressionStatement(node)) { + exprs.push(node.expression); + } else if (t.isVariableDeclaration(node)) { + if (node.kind !== "var") return bailed = true; + + for (var _iterator2 = node.declarations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var declar = _ref2; + + var bindings = t.getBindingIdentifiers(declar); + for (var key in bindings) { + declars.push({ + kind: node.kind, + id: bindings[key] + }); + } + + if (declar.init) { + exprs.push(t.assignmentExpression("=", declar.id, declar.init)); + } + } + + ensureLastUndefined = true; + continue; + } else if (t.isIfStatement(node)) { + var consequent = node.consequent ? convert([node.consequent]) : scope.buildUndefinedNode(); + var alternate = node.alternate ? convert([node.alternate]) : scope.buildUndefinedNode(); + if (!consequent || !alternate) return bailed = true; + + exprs.push(t.conditionalExpression(node.test, consequent, alternate)); + } else if (t.isBlockStatement(node)) { + exprs.push(convert(node.body)); + } else if (t.isEmptyStatement(node)) { + ensureLastUndefined = true; + continue; + } else { + return bailed = true; + } + + ensureLastUndefined = false; + } + + if (ensureLastUndefined || exprs.length === 0) { + exprs.push(scope.buildUndefinedNode()); + } + + if (exprs.length === 1) { + return exprs[0]; + } else { + return t.sequenceExpression(exprs); + } + } +} + +function toKeyAlias(node) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key; + + var alias = void 0; + + if (node.kind === "method") { + return toKeyAlias.increment() + ""; + } else if (t.isIdentifier(key)) { + alias = key.name; + } else if (t.isStringLiteral(key)) { + alias = (0, _stringify2.default)(key.value); + } else { + alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key))); + } + + if (node.computed) { + alias = "[" + alias + "]"; + } + + if (node.static) { + alias = "static:" + alias; + } + + return alias; +} + +toKeyAlias.uid = 0; + +toKeyAlias.increment = function () { + if (toKeyAlias.uid >= _maxSafeInteger2.default) { + return toKeyAlias.uid = 0; + } else { + return toKeyAlias.uid++; + } +}; + +function toIdentifier(name) { + name = name + ""; + + name = name.replace(/[^a-zA-Z0-9$_]/g, "-"); + + name = name.replace(/^[-0-9]+/, ""); + + name = name.replace(/[-\s]+(.)?/g, function (match, c) { + return c ? c.toUpperCase() : ""; + }); + + if (!t.isValidIdentifier(name)) { + name = "_" + name; + } + + return name || "_"; +} + +function toBindingIdentifierName(name) { + name = toIdentifier(name); + if (name === "eval" || name === "arguments") name = "_" + name; + return name; +} + +function toStatement(node, ignore) { + if (t.isStatement(node)) { + return node; + } + + var mustHaveId = false; + var newType = void 0; + + if (t.isClass(node)) { + mustHaveId = true; + newType = "ClassDeclaration"; + } else if (t.isFunction(node)) { + mustHaveId = true; + newType = "FunctionDeclaration"; + } else if (t.isAssignmentExpression(node)) { + return t.expressionStatement(node); + } + + if (mustHaveId && !node.id) { + newType = false; + } + + if (!newType) { + if (ignore) { + return false; + } else { + throw new Error("cannot turn " + node.type + " to a statement"); + } + } + + node.type = newType; + + return node; +} + +function toExpression(node) { + if (t.isExpressionStatement(node)) { + node = node.expression; + } + + if (t.isExpression(node)) { + return node; + } + + if (t.isClass(node)) { + node.type = "ClassExpression"; + } else if (t.isFunction(node)) { + node.type = "FunctionExpression"; + } + + if (!t.isExpression(node)) { + throw new Error("cannot turn " + node.type + " to an expression"); + } + + return node; +} + +function toBlock(node, parent) { + if (t.isBlockStatement(node)) { + return node; + } + + if (t.isEmptyStatement(node)) { + node = []; + } + + if (!Array.isArray(node)) { + if (!t.isStatement(node)) { + if (t.isFunction(parent)) { + node = t.returnStatement(node); + } else { + node = t.expressionStatement(node); + } + } + + node = [node]; + } + + return t.blockStatement(node); +} + +function valueToNode(value) { + if (value === undefined) { + return t.identifier("undefined"); + } + + if (value === true || value === false) { + return t.booleanLiteral(value); + } + + if (value === null) { + return t.nullLiteral(); + } + + if (typeof value === "string") { + return t.stringLiteral(value); + } + + if (typeof value === "number") { + return t.numericLiteral(value); + } + + if ((0, _isRegExp2.default)(value)) { + var pattern = value.source; + var flags = value.toString().match(/\/([a-z]+|)$/)[1]; + return t.regExpLiteral(pattern, flags); + } + + if (Array.isArray(value)) { + return t.arrayExpression(value.map(t.valueToNode)); + } + + if ((0, _isPlainObject2.default)(value)) { + var props = []; + for (var key in value) { + var nodeKey = void 0; + if (t.isValidIdentifier(key)) { + nodeKey = t.identifier(key); + } else { + nodeKey = t.stringLiteral(key); + } + props.push(t.objectProperty(nodeKey, t.valueToNode(value[key]))); + } + return t.objectExpression(props); + } + + throw new Error("don't know how to turn this value into a node"); +} \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/core.js b/node_modules/babel-types/lib/definitions/core.js new file mode 100755 index 00000000..3b03262f --- /dev/null +++ b/node_modules/babel-types/lib/definitions/core.js @@ -0,0 +1,701 @@ +"use strict"; + +var _index = require("../index"); + +var t = _interopRequireWildcard(_index); + +var _constants = require("../constants"); + +var _index2 = require("./index"); + +var _index3 = _interopRequireDefault(_index2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +(0, _index3.default)("ArrayExpression", { + fields: { + elements: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeOrValueType)("null", "Expression", "SpreadElement"))), + default: [] + } + }, + visitor: ["elements"], + aliases: ["Expression"] +}); + +(0, _index3.default)("AssignmentExpression", { + fields: { + operator: { + validate: (0, _index2.assertValueType)("string") + }, + left: { + validate: (0, _index2.assertNodeType)("LVal") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + builder: ["operator", "left", "right"], + visitor: ["left", "right"], + aliases: ["Expression"] +}); + +(0, _index3.default)("BinaryExpression", { + builder: ["operator", "left", "right"], + fields: { + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.BINARY_OPERATORS) + }, + left: { + validate: (0, _index2.assertNodeType)("Expression") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + visitor: ["left", "right"], + aliases: ["Binary", "Expression"] +}); + +(0, _index3.default)("Directive", { + visitor: ["value"], + fields: { + value: { + validate: (0, _index2.assertNodeType)("DirectiveLiteral") + } + } +}); + +(0, _index3.default)("DirectiveLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _index2.assertValueType)("string") + } + } +}); + +(0, _index3.default)("BlockStatement", { + builder: ["body", "directives"], + visitor: ["directives", "body"], + fields: { + directives: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))), + default: [] + }, + body: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) + } + }, + aliases: ["Scopable", "BlockParent", "Block", "Statement"] +}); + +(0, _index3.default)("BreakStatement", { + visitor: ["label"], + fields: { + label: { + validate: (0, _index2.assertNodeType)("Identifier"), + optional: true + } + }, + aliases: ["Statement", "Terminatorless", "CompletionStatement"] +}); + +(0, _index3.default)("CallExpression", { + visitor: ["callee", "arguments"], + fields: { + callee: { + validate: (0, _index2.assertNodeType)("Expression") + }, + arguments: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement"))) + } + }, + aliases: ["Expression"] +}); + +(0, _index3.default)("CatchClause", { + visitor: ["param", "body"], + fields: { + param: { + validate: (0, _index2.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + } + }, + aliases: ["Scopable"] +}); + +(0, _index3.default)("ConditionalExpression", { + visitor: ["test", "consequent", "alternate"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + consequent: { + validate: (0, _index2.assertNodeType)("Expression") + }, + alternate: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + aliases: ["Expression", "Conditional"] +}); + +(0, _index3.default)("ContinueStatement", { + visitor: ["label"], + fields: { + label: { + validate: (0, _index2.assertNodeType)("Identifier"), + optional: true + } + }, + aliases: ["Statement", "Terminatorless", "CompletionStatement"] +}); + +(0, _index3.default)("DebuggerStatement", { + aliases: ["Statement"] +}); + +(0, _index3.default)("DoWhileStatement", { + visitor: ["test", "body"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + }, + aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] +}); + +(0, _index3.default)("EmptyStatement", { + aliases: ["Statement"] +}); + +(0, _index3.default)("ExpressionStatement", { + visitor: ["expression"], + fields: { + expression: { + validate: (0, _index2.assertNodeType)("Expression") + } + }, + aliases: ["Statement", "ExpressionWrapper"] +}); + +(0, _index3.default)("File", { + builder: ["program", "comments", "tokens"], + visitor: ["program"], + fields: { + program: { + validate: (0, _index2.assertNodeType)("Program") + } + } +}); + +(0, _index3.default)("ForInStatement", { + visitor: ["left", "right", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: (0, _index2.assertNodeType)("VariableDeclaration", "LVal") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); + +(0, _index3.default)("ForStatement", { + visitor: ["init", "test", "update", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], + fields: { + init: { + validate: (0, _index2.assertNodeType)("VariableDeclaration", "Expression"), + optional: true + }, + test: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + }, + update: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); + +(0, _index3.default)("FunctionDeclaration", { + builder: ["id", "params", "body", "generator", "async"], + visitor: ["id", "params", "body", "returnType", "typeParameters"], + fields: { + id: { + validate: (0, _index2.assertNodeType)("Identifier") + }, + params: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + } + }, + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"] +}); + +(0, _index3.default)("FunctionExpression", { + inherits: "FunctionDeclaration", + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], + fields: { + id: { + validate: (0, _index2.assertNodeType)("Identifier"), + optional: true + }, + params: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + } + } +}); + +(0, _index3.default)("Identifier", { + builder: ["name"], + visitor: ["typeAnnotation"], + aliases: ["Expression", "LVal"], + fields: { + name: { + validate: function validate(node, key, val) { + if (!t.isValidIdentifier(val)) {} + } + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) + } + } +}); + +(0, _index3.default)("IfStatement", { + visitor: ["test", "consequent", "alternate"], + aliases: ["Statement", "Conditional"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + consequent: { + validate: (0, _index2.assertNodeType)("Statement") + }, + alternate: { + optional: true, + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); + +(0, _index3.default)("LabeledStatement", { + visitor: ["label", "body"], + aliases: ["Statement"], + fields: { + label: { + validate: (0, _index2.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index2.assertNodeType)("Statement") + } + } +}); + +(0, _index3.default)("StringLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _index2.assertValueType)("string") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); + +(0, _index3.default)("NumericLiteral", { + builder: ["value"], + deprecatedAlias: "NumberLiteral", + fields: { + value: { + validate: (0, _index2.assertValueType)("number") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); + +(0, _index3.default)("NullLiteral", { + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); + +(0, _index3.default)("BooleanLiteral", { + builder: ["value"], + fields: { + value: { + validate: (0, _index2.assertValueType)("boolean") + } + }, + aliases: ["Expression", "Pureish", "Literal", "Immutable"] +}); + +(0, _index3.default)("RegExpLiteral", { + builder: ["pattern", "flags"], + deprecatedAlias: "RegexLiteral", + aliases: ["Expression", "Literal"], + fields: { + pattern: { + validate: (0, _index2.assertValueType)("string") + }, + flags: { + validate: (0, _index2.assertValueType)("string"), + default: "" + } + } +}); + +(0, _index3.default)("LogicalExpression", { + builder: ["operator", "left", "right"], + visitor: ["left", "right"], + aliases: ["Binary", "Expression"], + fields: { + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.LOGICAL_OPERATORS) + }, + left: { + validate: (0, _index2.assertNodeType)("Expression") + }, + right: { + validate: (0, _index2.assertNodeType)("Expression") + } + } +}); + +(0, _index3.default)("MemberExpression", { + builder: ["object", "property", "computed"], + visitor: ["object", "property"], + aliases: ["Expression", "LVal"], + fields: { + object: { + validate: (0, _index2.assertNodeType)("Expression") + }, + property: { + validate: function validate(node, key, val) { + var expectedType = node.computed ? "Expression" : "Identifier"; + (0, _index2.assertNodeType)(expectedType)(node, key, val); + } + }, + computed: { + default: false + } + } +}); + +(0, _index3.default)("NewExpression", { + visitor: ["callee", "arguments"], + aliases: ["Expression"], + fields: { + callee: { + validate: (0, _index2.assertNodeType)("Expression") + }, + arguments: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement"))) + } + } +}); + +(0, _index3.default)("Program", { + visitor: ["directives", "body"], + builder: ["body", "directives"], + fields: { + directives: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))), + default: [] + }, + body: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) + } + }, + aliases: ["Scopable", "BlockParent", "Block", "FunctionParent"] +}); + +(0, _index3.default)("ObjectExpression", { + visitor: ["properties"], + aliases: ["Expression"], + fields: { + properties: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadProperty"))) + } + } +}); + +(0, _index3.default)("ObjectMethod", { + builder: ["kind", "key", "params", "body", "computed"], + fields: { + kind: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("method", "get", "set")), + default: "method" + }, + computed: { + validate: (0, _index2.assertValueType)("boolean"), + default: false + }, + key: { + validate: function validate(node, key, val) { + var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; + _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val); + } + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index2.assertValueType)("boolean") + } + }, + visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], + aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] +}); + +(0, _index3.default)("ObjectProperty", { + builder: ["key", "value", "computed", "shorthand", "decorators"], + fields: { + computed: { + validate: (0, _index2.assertValueType)("boolean"), + default: false + }, + key: { + validate: function validate(node, key, val) { + var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; + _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val); + } + }, + value: { + validate: (0, _index2.assertNodeType)("Expression") + }, + shorthand: { + validate: (0, _index2.assertValueType)("boolean"), + default: false + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))), + optional: true + } + }, + visitor: ["key", "value", "decorators"], + aliases: ["UserWhitespacable", "Property", "ObjectMember"] +}); + +(0, _index3.default)("RestElement", { + visitor: ["argument", "typeAnnotation"], + aliases: ["LVal"], + fields: { + argument: { + validate: (0, _index2.assertNodeType)("LVal") + }, + decorators: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))) + } + } +}); + +(0, _index3.default)("ReturnStatement", { + visitor: ["argument"], + aliases: ["Statement", "Terminatorless", "CompletionStatement"], + fields: { + argument: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + } + } +}); + +(0, _index3.default)("SequenceExpression", { + visitor: ["expressions"], + fields: { + expressions: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression"))) + } + }, + aliases: ["Expression"] +}); + +(0, _index3.default)("SwitchCase", { + visitor: ["test", "consequent"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression"), + optional: true + }, + consequent: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement"))) + } + } +}); + +(0, _index3.default)("SwitchStatement", { + visitor: ["discriminant", "cases"], + aliases: ["Statement", "BlockParent", "Scopable"], + fields: { + discriminant: { + validate: (0, _index2.assertNodeType)("Expression") + }, + cases: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("SwitchCase"))) + } + } +}); + +(0, _index3.default)("ThisExpression", { + aliases: ["Expression"] +}); + +(0, _index3.default)("ThrowStatement", { + visitor: ["argument"], + aliases: ["Statement", "Terminatorless", "CompletionStatement"], + fields: { + argument: { + validate: (0, _index2.assertNodeType)("Expression") + } + } +}); + +(0, _index3.default)("TryStatement", { + visitor: ["block", "handler", "finalizer"], + aliases: ["Statement"], + fields: { + body: { + validate: (0, _index2.assertNodeType)("BlockStatement") + }, + handler: { + optional: true, + handler: (0, _index2.assertNodeType)("BlockStatement") + }, + finalizer: { + optional: true, + validate: (0, _index2.assertNodeType)("BlockStatement") + } + } +}); + +(0, _index3.default)("UnaryExpression", { + builder: ["operator", "argument", "prefix"], + fields: { + prefix: { + default: true + }, + argument: { + validate: (0, _index2.assertNodeType)("Expression") + }, + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.UNARY_OPERATORS) + } + }, + visitor: ["argument"], + aliases: ["UnaryLike", "Expression"] +}); + +(0, _index3.default)("UpdateExpression", { + builder: ["operator", "argument", "prefix"], + fields: { + prefix: { + default: false + }, + argument: { + validate: (0, _index2.assertNodeType)("Expression") + }, + operator: { + validate: _index2.assertOneOf.apply(undefined, _constants.UPDATE_OPERATORS) + } + }, + visitor: ["argument"], + aliases: ["Expression"] +}); + +(0, _index3.default)("VariableDeclaration", { + builder: ["kind", "declarations"], + visitor: ["declarations"], + aliases: ["Statement", "Declaration"], + fields: { + kind: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("var", "let", "const")) + }, + declarations: { + validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("VariableDeclarator"))) + } + } +}); + +(0, _index3.default)("VariableDeclarator", { + visitor: ["id", "init"], + fields: { + id: { + validate: (0, _index2.assertNodeType)("LVal") + }, + init: { + optional: true, + validate: (0, _index2.assertNodeType)("Expression") + } + } +}); + +(0, _index3.default)("WhileStatement", { + visitor: ["test", "body"], + aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], + fields: { + test: { + validate: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement", "Statement") + } + } +}); + +(0, _index3.default)("WithStatement", { + visitor: ["object", "body"], + aliases: ["Statement"], + fields: { + object: { + object: (0, _index2.assertNodeType)("Expression") + }, + body: { + validate: (0, _index2.assertNodeType)("BlockStatement", "Statement") + } + } +}); \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/es2015.js b/node_modules/babel-types/lib/definitions/es2015.js new file mode 100755 index 00000000..a823aa22 --- /dev/null +++ b/node_modules/babel-types/lib/definitions/es2015.js @@ -0,0 +1,354 @@ +"use strict"; + +var _index = require("./index"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _index2.default)("AssignmentPattern", { + visitor: ["left", "right"], + aliases: ["Pattern", "LVal"], + fields: { + left: { + validate: (0, _index.assertNodeType)("Identifier") + }, + right: { + validate: (0, _index.assertNodeType)("Expression") + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); + +(0, _index2.default)("ArrayPattern", { + visitor: ["elements", "typeAnnotation"], + aliases: ["Pattern", "LVal"], + fields: { + elements: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression"))) + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); + +(0, _index2.default)("ArrowFunctionExpression", { + builder: ["params", "body", "async"], + visitor: ["params", "body", "returnType", "typeParameters"], + aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], + fields: { + params: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index.assertNodeType)("BlockStatement", "Expression") + }, + async: { + validate: (0, _index.assertValueType)("boolean"), + default: false + } + } +}); + +(0, _index2.default)("ClassBody", { + visitor: ["body"], + fields: { + body: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ClassMethod", "ClassProperty"))) + } + } +}); + +(0, _index2.default)("ClassDeclaration", { + builder: ["id", "superClass", "body", "decorators"], + visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"], + aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], + fields: { + id: { + validate: (0, _index.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index.assertNodeType)("ClassBody") + }, + superClass: { + optional: true, + validate: (0, _index.assertNodeType)("Expression") + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); + +(0, _index2.default)("ClassExpression", { + inherits: "ClassDeclaration", + aliases: ["Scopable", "Class", "Expression", "Pureish"], + fields: { + id: { + optional: true, + validate: (0, _index.assertNodeType)("Identifier") + }, + body: { + validate: (0, _index.assertNodeType)("ClassBody") + }, + superClass: { + optional: true, + validate: (0, _index.assertNodeType)("Expression") + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); + +(0, _index2.default)("ExportAllDeclaration", { + visitor: ["source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + source: { + validate: (0, _index.assertNodeType)("StringLiteral") + } + } +}); + +(0, _index2.default)("ExportDefaultDeclaration", { + visitor: ["declaration"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + declaration: { + validate: (0, _index.assertNodeType)("FunctionDeclaration", "ClassDeclaration", "Expression") + } + } +}); + +(0, _index2.default)("ExportNamedDeclaration", { + visitor: ["declaration", "specifiers", "source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"], + fields: { + declaration: { + validate: (0, _index.assertNodeType)("Declaration"), + optional: true + }, + specifiers: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ExportSpecifier"))) + }, + source: { + validate: (0, _index.assertNodeType)("StringLiteral"), + optional: true + } + } +}); + +(0, _index2.default)("ExportSpecifier", { + visitor: ["local", "exported"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + }, + exported: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); + +(0, _index2.default)("ForOfStatement", { + visitor: ["left", "right", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal") + }, + right: { + validate: (0, _index.assertNodeType)("Expression") + }, + body: { + validate: (0, _index.assertNodeType)("Statement") + } + } +}); + +(0, _index2.default)("ImportDeclaration", { + visitor: ["specifiers", "source"], + aliases: ["Statement", "Declaration", "ModuleDeclaration"], + fields: { + specifiers: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"))) + }, + source: { + validate: (0, _index.assertNodeType)("StringLiteral") + } + } +}); + +(0, _index2.default)("ImportDefaultSpecifier", { + visitor: ["local"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); + +(0, _index2.default)("ImportNamespaceSpecifier", { + visitor: ["local"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); + +(0, _index2.default)("ImportSpecifier", { + visitor: ["local", "imported"], + aliases: ["ModuleSpecifier"], + fields: { + local: { + validate: (0, _index.assertNodeType)("Identifier") + }, + imported: { + validate: (0, _index.assertNodeType)("Identifier") + }, + importKind: { + validate: (0, _index.assertOneOf)(null, "type", "typeof") + } + } +}); + +(0, _index2.default)("MetaProperty", { + visitor: ["meta", "property"], + aliases: ["Expression"], + fields: { + meta: { + validate: (0, _index.assertValueType)("string") + }, + property: { + validate: (0, _index.assertValueType)("string") + } + } +}); + +(0, _index2.default)("ClassMethod", { + aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], + builder: ["kind", "key", "params", "body", "computed", "static"], + visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"], + fields: { + kind: { + validate: (0, _index.chain)((0, _index.assertValueType)("string"), (0, _index.assertOneOf)("get", "set", "method", "constructor")), + default: "method" + }, + computed: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + static: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + key: { + validate: function validate(node, key, val) { + var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"]; + _index.assertNodeType.apply(undefined, expectedTypes)(node, key, val); + } + }, + params: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal"))) + }, + body: { + validate: (0, _index.assertNodeType)("BlockStatement") + }, + generator: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + async: { + default: false, + validate: (0, _index.assertValueType)("boolean") + } + } +}); + +(0, _index2.default)("ObjectPattern", { + visitor: ["properties", "typeAnnotation"], + aliases: ["Pattern", "LVal"], + fields: { + properties: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("RestProperty", "Property"))) + }, + decorators: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator"))) + } + } +}); + +(0, _index2.default)("SpreadElement", { + visitor: ["argument"], + aliases: ["UnaryLike"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +(0, _index2.default)("Super", { + aliases: ["Expression"] +}); + +(0, _index2.default)("TaggedTemplateExpression", { + visitor: ["tag", "quasi"], + aliases: ["Expression"], + fields: { + tag: { + validate: (0, _index.assertNodeType)("Expression") + }, + quasi: { + validate: (0, _index.assertNodeType)("TemplateLiteral") + } + } +}); + +(0, _index2.default)("TemplateElement", { + builder: ["value", "tail"], + fields: { + value: {}, + tail: { + validate: (0, _index.assertValueType)("boolean"), + default: false + } + } +}); + +(0, _index2.default)("TemplateLiteral", { + visitor: ["quasis", "expressions"], + aliases: ["Expression", "Literal"], + fields: { + quasis: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("TemplateElement"))) + }, + expressions: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression"))) + } + } +}); + +(0, _index2.default)("YieldExpression", { + builder: ["argument", "delegate"], + visitor: ["argument"], + aliases: ["Expression", "Terminatorless"], + fields: { + delegate: { + validate: (0, _index.assertValueType)("boolean"), + default: false + }, + argument: { + optional: true, + validate: (0, _index.assertNodeType)("Expression") + } + } +}); \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/experimental.js b/node_modules/babel-types/lib/definitions/experimental.js new file mode 100755 index 00000000..d65d6096 --- /dev/null +++ b/node_modules/babel-types/lib/definitions/experimental.js @@ -0,0 +1,103 @@ +"use strict"; + +var _index = require("./index"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _index2.default)("AwaitExpression", { + builder: ["argument"], + visitor: ["argument"], + aliases: ["Expression", "Terminatorless"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +(0, _index2.default)("ForAwaitStatement", { + visitor: ["left", "right", "body"], + aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], + fields: { + left: { + validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal") + }, + right: { + validate: (0, _index.assertNodeType)("Expression") + }, + body: { + validate: (0, _index.assertNodeType)("Statement") + } + } +}); + +(0, _index2.default)("BindExpression", { + visitor: ["object", "callee"], + aliases: ["Expression"], + fields: {} +}); + +(0, _index2.default)("Import", { + aliases: ["Expression"] +}); + +(0, _index2.default)("Decorator", { + visitor: ["expression"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +(0, _index2.default)("DoExpression", { + visitor: ["body"], + aliases: ["Expression"], + fields: { + body: { + validate: (0, _index.assertNodeType)("BlockStatement") + } + } +}); + +(0, _index2.default)("ExportDefaultSpecifier", { + visitor: ["exported"], + aliases: ["ModuleSpecifier"], + fields: { + exported: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); + +(0, _index2.default)("ExportNamespaceSpecifier", { + visitor: ["exported"], + aliases: ["ModuleSpecifier"], + fields: { + exported: { + validate: (0, _index.assertNodeType)("Identifier") + } + } +}); + +(0, _index2.default)("RestProperty", { + visitor: ["argument"], + aliases: ["UnaryLike"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("LVal") + } + } +}); + +(0, _index2.default)("SpreadProperty", { + visitor: ["argument"], + aliases: ["UnaryLike"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/flow.js b/node_modules/babel-types/lib/definitions/flow.js new file mode 100755 index 00000000..dca21ec1 --- /dev/null +++ b/node_modules/babel-types/lib/definitions/flow.js @@ -0,0 +1,261 @@ +"use strict"; + +var _index = require("./index"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _index2.default)("AnyTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); + +(0, _index2.default)("ArrayTypeAnnotation", { + visitor: ["elementType"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("BooleanTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); + +(0, _index2.default)("BooleanLiteralTypeAnnotation", { + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("NullLiteralTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); + +(0, _index2.default)("ClassImplements", { + visitor: ["id", "typeParameters"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("ClassProperty", { + visitor: ["key", "value", "typeAnnotation", "decorators"], + builder: ["key", "value", "typeAnnotation", "decorators", "computed"], + aliases: ["Property"], + fields: { + computed: { + validate: (0, _index.assertValueType)("boolean"), + default: false + } + } +}); + +(0, _index2.default)("DeclareClass", { + visitor: ["id", "typeParameters", "extends", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("DeclareFunction", { + visitor: ["id"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("DeclareInterface", { + visitor: ["id", "typeParameters", "extends", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("DeclareModule", { + visitor: ["id", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("DeclareModuleExports", { + visitor: ["typeAnnotation"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("DeclareTypeAlias", { + visitor: ["id", "typeParameters", "right"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("DeclareVariable", { + visitor: ["id"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("ExistentialTypeParam", { + aliases: ["Flow"] +}); + +(0, _index2.default)("FunctionTypeAnnotation", { + visitor: ["typeParameters", "params", "rest", "returnType"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("FunctionTypeParam", { + visitor: ["name", "typeAnnotation"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("GenericTypeAnnotation", { + visitor: ["id", "typeParameters"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("InterfaceExtends", { + visitor: ["id", "typeParameters"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("InterfaceDeclaration", { + visitor: ["id", "typeParameters", "extends", "body"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("IntersectionTypeAnnotation", { + visitor: ["types"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("MixedTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"] +}); + +(0, _index2.default)("EmptyTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"] +}); + +(0, _index2.default)("NullableTypeAnnotation", { + visitor: ["typeAnnotation"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("NumericLiteralTypeAnnotation", { + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("NumberTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); + +(0, _index2.default)("StringLiteralTypeAnnotation", { + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("StringTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); + +(0, _index2.default)("ThisTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); + +(0, _index2.default)("TupleTypeAnnotation", { + visitor: ["types"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("TypeofTypeAnnotation", { + visitor: ["argument"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("TypeAlias", { + visitor: ["id", "typeParameters", "right"], + aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], + fields: {} +}); + +(0, _index2.default)("TypeAnnotation", { + visitor: ["typeAnnotation"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("TypeCastExpression", { + visitor: ["expression", "typeAnnotation"], + aliases: ["Flow", "ExpressionWrapper", "Expression"], + fields: {} +}); + +(0, _index2.default)("TypeParameter", { + visitor: ["bound"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("TypeParameterDeclaration", { + visitor: ["params"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("TypeParameterInstantiation", { + visitor: ["params"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("ObjectTypeAnnotation", { + visitor: ["properties", "indexers", "callProperties"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("ObjectTypeCallProperty", { + visitor: ["value"], + aliases: ["Flow", "UserWhitespacable"], + fields: {} +}); + +(0, _index2.default)("ObjectTypeIndexer", { + visitor: ["id", "key", "value"], + aliases: ["Flow", "UserWhitespacable"], + fields: {} +}); + +(0, _index2.default)("ObjectTypeProperty", { + visitor: ["key", "value"], + aliases: ["Flow", "UserWhitespacable"], + fields: {} +}); + +(0, _index2.default)("QualifiedTypeIdentifier", { + visitor: ["id", "qualification"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("UnionTypeAnnotation", { + visitor: ["types"], + aliases: ["Flow"], + fields: {} +}); + +(0, _index2.default)("VoidTypeAnnotation", { + aliases: ["Flow", "FlowBaseAnnotation"], + fields: {} +}); \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/index.js b/node_modules/babel-types/lib/definitions/index.js new file mode 100755 index 00000000..d5121144 --- /dev/null +++ b/node_modules/babel-types/lib/definitions/index.js @@ -0,0 +1,249 @@ +"use strict"; + +exports.__esModule = true; +exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = undefined; + +var _getIterator2 = require("babel-runtime/core-js/get-iterator"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _stringify = require("babel-runtime/core-js/json/stringify"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _typeof2 = require("babel-runtime/helpers/typeof"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +exports.assertEach = assertEach; +exports.assertOneOf = assertOneOf; +exports.assertNodeType = assertNodeType; +exports.assertNodeOrValueType = assertNodeOrValueType; +exports.assertValueType = assertValueType; +exports.chain = chain; +exports.default = defineType; + +var _index = require("../index"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var VISITOR_KEYS = exports.VISITOR_KEYS = {}; +var ALIAS_KEYS = exports.ALIAS_KEYS = {}; +var NODE_FIELDS = exports.NODE_FIELDS = {}; +var BUILDER_KEYS = exports.BUILDER_KEYS = {}; +var DEPRECATED_KEYS = exports.DEPRECATED_KEYS = {}; + +function getType(val) { + if (Array.isArray(val)) { + return "array"; + } else if (val === null) { + return "null"; + } else if (val === undefined) { + return "undefined"; + } else { + return typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val); + } +} + +function assertEach(callback) { + function validator(node, key, val) { + if (!Array.isArray(val)) return; + + for (var i = 0; i < val.length; i++) { + callback(node, key + "[" + i + "]", val[i]); + } + } + validator.each = callback; + return validator; +} + +function assertOneOf() { + for (var _len = arguments.length, vals = Array(_len), _key = 0; _key < _len; _key++) { + vals[_key] = arguments[_key]; + } + + function validate(node, key, val) { + if (vals.indexOf(val) < 0) { + throw new TypeError("Property " + key + " expected value to be one of " + (0, _stringify2.default)(vals) + " but got " + (0, _stringify2.default)(val)); + } + } + + validate.oneOf = vals; + + return validate; +} + +function assertNodeType() { + for (var _len2 = arguments.length, types = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + types[_key2] = arguments[_key2]; + } + + function validate(node, key, val) { + var valid = false; + + for (var _iterator = types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var type = _ref; + + if (t.is(type, val)) { + valid = true; + break; + } + } + + if (!valid) { + throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type))); + } + } + + validate.oneOfNodeTypes = types; + + return validate; +} + +function assertNodeOrValueType() { + for (var _len3 = arguments.length, types = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + types[_key3] = arguments[_key3]; + } + + function validate(node, key, val) { + var valid = false; + + for (var _iterator2 = types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var type = _ref2; + + if (getType(val) === type || t.is(type, val)) { + valid = true; + break; + } + } + + if (!valid) { + throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type))); + } + } + + validate.oneOfNodeOrValueTypes = types; + + return validate; +} + +function assertValueType(type) { + function validate(node, key, val) { + var valid = getType(val) === type; + + if (!valid) { + throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val)); + } + } + + validate.type = type; + + return validate; +} + +function chain() { + for (var _len4 = arguments.length, fns = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + fns[_key4] = arguments[_key4]; + } + + function validate() { + for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var fn = _ref3; + + fn.apply(undefined, arguments); + } + } + validate.chainOf = fns; + return validate; +} + +function defineType(type) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var inherits = opts.inherits && store[opts.inherits] || {}; + + opts.fields = opts.fields || inherits.fields || {}; + opts.visitor = opts.visitor || inherits.visitor || []; + opts.aliases = opts.aliases || inherits.aliases || []; + opts.builder = opts.builder || inherits.builder || opts.visitor || []; + + if (opts.deprecatedAlias) { + DEPRECATED_KEYS[opts.deprecatedAlias] = type; + } + + for (var _iterator4 = opts.visitor.concat(opts.builder), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var _key5 = _ref4; + + opts.fields[_key5] = opts.fields[_key5] || {}; + } + + for (var key in opts.fields) { + var field = opts.fields[key]; + + if (opts.builder.indexOf(key) === -1) { + field.optional = true; + } + if (field.default === undefined) { + field.default = null; + } else if (!field.validate) { + field.validate = assertValueType(getType(field.default)); + } + } + + VISITOR_KEYS[type] = opts.visitor; + BUILDER_KEYS[type] = opts.builder; + NODE_FIELDS[type] = opts.fields; + ALIAS_KEYS[type] = opts.aliases; + + store[type] = opts; +} + +var store = {}; \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/init.js b/node_modules/babel-types/lib/definitions/init.js new file mode 100755 index 00000000..a3334fed --- /dev/null +++ b/node_modules/babel-types/lib/definitions/init.js @@ -0,0 +1,15 @@ +"use strict"; + +require("./index"); + +require("./core"); + +require("./es2015"); + +require("./flow"); + +require("./jsx"); + +require("./misc"); + +require("./experimental"); \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/jsx.js b/node_modules/babel-types/lib/definitions/jsx.js new file mode 100755 index 00000000..1c0c0665 --- /dev/null +++ b/node_modules/babel-types/lib/definitions/jsx.js @@ -0,0 +1,147 @@ +"use strict"; + +var _index = require("./index"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _index2.default)("JSXAttribute", { + visitor: ["name", "value"], + aliases: ["JSX", "Immutable"], + fields: { + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXNamespacedName") + }, + value: { + optional: true, + validate: (0, _index.assertNodeType)("JSXElement", "StringLiteral", "JSXExpressionContainer") + } + } +}); + +(0, _index2.default)("JSXClosingElement", { + visitor: ["name"], + aliases: ["JSX", "Immutable"], + fields: { + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression") + } + } +}); + +(0, _index2.default)("JSXElement", { + builder: ["openingElement", "closingElement", "children", "selfClosing"], + visitor: ["openingElement", "children", "closingElement"], + aliases: ["JSX", "Immutable", "Expression"], + fields: { + openingElement: { + validate: (0, _index.assertNodeType)("JSXOpeningElement") + }, + closingElement: { + optional: true, + validate: (0, _index.assertNodeType)("JSXClosingElement") + }, + children: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement"))) + } + } +}); + +(0, _index2.default)("JSXEmptyExpression", { + aliases: ["JSX", "Expression"] +}); + +(0, _index2.default)("JSXExpressionContainer", { + visitor: ["expression"], + aliases: ["JSX", "Immutable"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +(0, _index2.default)("JSXSpreadChild", { + visitor: ["expression"], + aliases: ["JSX", "Immutable"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +(0, _index2.default)("JSXIdentifier", { + builder: ["name"], + aliases: ["JSX", "Expression"], + fields: { + name: { + validate: (0, _index.assertValueType)("string") + } + } +}); + +(0, _index2.default)("JSXMemberExpression", { + visitor: ["object", "property"], + aliases: ["JSX", "Expression"], + fields: { + object: { + validate: (0, _index.assertNodeType)("JSXMemberExpression", "JSXIdentifier") + }, + property: { + validate: (0, _index.assertNodeType)("JSXIdentifier") + } + } +}); + +(0, _index2.default)("JSXNamespacedName", { + visitor: ["namespace", "name"], + aliases: ["JSX"], + fields: { + namespace: { + validate: (0, _index.assertNodeType)("JSXIdentifier") + }, + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier") + } + } +}); + +(0, _index2.default)("JSXOpeningElement", { + builder: ["name", "attributes", "selfClosing"], + visitor: ["name", "attributes"], + aliases: ["JSX", "Immutable"], + fields: { + name: { + validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression") + }, + selfClosing: { + default: false, + validate: (0, _index.assertValueType)("boolean") + }, + attributes: { + validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXAttribute", "JSXSpreadAttribute"))) + } + } +}); + +(0, _index2.default)("JSXSpreadAttribute", { + visitor: ["argument"], + aliases: ["JSX"], + fields: { + argument: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); + +(0, _index2.default)("JSXText", { + aliases: ["JSX", "Immutable"], + builder: ["value"], + fields: { + value: { + validate: (0, _index.assertValueType)("string") + } + } +}); \ No newline at end of file diff --git a/node_modules/babel-types/lib/definitions/misc.js b/node_modules/babel-types/lib/definitions/misc.js new file mode 100755 index 00000000..f982b9a8 --- /dev/null +++ b/node_modules/babel-types/lib/definitions/misc.js @@ -0,0 +1,21 @@ +"use strict"; + +var _index = require("./index"); + +var _index2 = _interopRequireDefault(_index); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _index2.default)("Noop", { + visitor: [] +}); + +(0, _index2.default)("ParenthesizedExpression", { + visitor: ["expression"], + aliases: ["Expression", "ExpressionWrapper"], + fields: { + expression: { + validate: (0, _index.assertNodeType)("Expression") + } + } +}); \ No newline at end of file diff --git a/node_modules/babel-types/lib/flow.js b/node_modules/babel-types/lib/flow.js new file mode 100755 index 00000000..28579157 --- /dev/null +++ b/node_modules/babel-types/lib/flow.js @@ -0,0 +1,108 @@ +"use strict"; + +exports.__esModule = true; +exports.createUnionTypeAnnotation = createUnionTypeAnnotation; +exports.removeTypeDuplicates = removeTypeDuplicates; +exports.createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof; + +var _index = require("./index"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function createUnionTypeAnnotation(types) { + var flattened = removeTypeDuplicates(types); + + if (flattened.length === 1) { + return flattened[0]; + } else { + return t.unionTypeAnnotation(flattened); + } +} + +function removeTypeDuplicates(nodes) { + var generics = {}; + var bases = {}; + + var typeGroups = []; + + var types = []; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + if (!node) continue; + + if (types.indexOf(node) >= 0) { + continue; + } + + if (t.isAnyTypeAnnotation(node)) { + return [node]; + } + + if (t.isFlowBaseAnnotation(node)) { + bases[node.type] = node; + continue; + } + + if (t.isUnionTypeAnnotation(node)) { + if (typeGroups.indexOf(node.types) < 0) { + nodes = nodes.concat(node.types); + typeGroups.push(node.types); + } + continue; + } + + if (t.isGenericTypeAnnotation(node)) { + var name = node.id.name; + + if (generics[name]) { + var existing = generics[name]; + if (existing.typeParameters) { + if (node.typeParameters) { + existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params)); + } + } else { + existing = node.typeParameters; + } + } else { + generics[name] = node; + } + + continue; + } + + types.push(node); + } + + for (var type in bases) { + types.push(bases[type]); + } + + for (var _name in generics) { + types.push(generics[_name]); + } + + return types; +} + +function createTypeAnnotationBasedOnTypeof(type) { + if (type === "string") { + return t.stringTypeAnnotation(); + } else if (type === "number") { + return t.numberTypeAnnotation(); + } else if (type === "undefined") { + return t.voidTypeAnnotation(); + } else if (type === "boolean") { + return t.booleanTypeAnnotation(); + } else if (type === "function") { + return t.genericTypeAnnotation(t.identifier("Function")); + } else if (type === "object") { + return t.genericTypeAnnotation(t.identifier("Object")); + } else if (type === "symbol") { + return t.genericTypeAnnotation(t.identifier("Symbol")); + } else { + throw new Error("Invalid typeof value"); + } +} \ No newline at end of file diff --git a/node_modules/babel-types/lib/index.js b/node_modules/babel-types/lib/index.js new file mode 100755 index 00000000..4c007030 --- /dev/null +++ b/node_modules/babel-types/lib/index.js @@ -0,0 +1,835 @@ +"use strict"; + +exports.__esModule = true; +exports.createTypeAnnotationBasedOnTypeof = exports.removeTypeDuplicates = exports.createUnionTypeAnnotation = exports.valueToNode = exports.toBlock = exports.toExpression = exports.toStatement = exports.toBindingIdentifierName = exports.toIdentifier = exports.toKeyAlias = exports.toSequenceExpression = exports.toComputedKey = exports.isNodesEquivalent = exports.isImmutable = exports.isScope = exports.isSpecifierDefault = exports.isVar = exports.isBlockScoped = exports.isLet = exports.isValidIdentifier = exports.isReferenced = exports.isBinding = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.TYPES = exports.react = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined; + +var _getOwnPropertySymbols = require("babel-runtime/core-js/object/get-own-property-symbols"); + +var _getOwnPropertySymbols2 = _interopRequireDefault(_getOwnPropertySymbols); + +var _getIterator2 = require("babel-runtime/core-js/get-iterator"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _keys = require("babel-runtime/core-js/object/keys"); + +var _keys2 = _interopRequireDefault(_keys); + +var _stringify = require("babel-runtime/core-js/json/stringify"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _constants = require("./constants"); + +Object.defineProperty(exports, "STATEMENT_OR_BLOCK_KEYS", { + enumerable: true, + get: function get() { + return _constants.STATEMENT_OR_BLOCK_KEYS; + } +}); +Object.defineProperty(exports, "FLATTENABLE_KEYS", { + enumerable: true, + get: function get() { + return _constants.FLATTENABLE_KEYS; + } +}); +Object.defineProperty(exports, "FOR_INIT_KEYS", { + enumerable: true, + get: function get() { + return _constants.FOR_INIT_KEYS; + } +}); +Object.defineProperty(exports, "COMMENT_KEYS", { + enumerable: true, + get: function get() { + return _constants.COMMENT_KEYS; + } +}); +Object.defineProperty(exports, "LOGICAL_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.LOGICAL_OPERATORS; + } +}); +Object.defineProperty(exports, "UPDATE_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.UPDATE_OPERATORS; + } +}); +Object.defineProperty(exports, "BOOLEAN_NUMBER_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BOOLEAN_NUMBER_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "EQUALITY_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.EQUALITY_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "COMPARISON_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.COMPARISON_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "BOOLEAN_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BOOLEAN_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "NUMBER_BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.NUMBER_BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "BINARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BINARY_OPERATORS; + } +}); +Object.defineProperty(exports, "BOOLEAN_UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.BOOLEAN_UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "NUMBER_UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.NUMBER_UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "STRING_UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.STRING_UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "UNARY_OPERATORS", { + enumerable: true, + get: function get() { + return _constants.UNARY_OPERATORS; + } +}); +Object.defineProperty(exports, "INHERIT_KEYS", { + enumerable: true, + get: function get() { + return _constants.INHERIT_KEYS; + } +}); +Object.defineProperty(exports, "BLOCK_SCOPED_SYMBOL", { + enumerable: true, + get: function get() { + return _constants.BLOCK_SCOPED_SYMBOL; + } +}); +Object.defineProperty(exports, "NOT_LOCAL_BINDING", { + enumerable: true, + get: function get() { + return _constants.NOT_LOCAL_BINDING; + } +}); +exports.is = is; +exports.isType = isType; +exports.validate = validate; +exports.shallowEqual = shallowEqual; +exports.appendToMemberExpression = appendToMemberExpression; +exports.prependToMemberExpression = prependToMemberExpression; +exports.ensureBlock = ensureBlock; +exports.clone = clone; +exports.cloneWithoutLoc = cloneWithoutLoc; +exports.cloneDeep = cloneDeep; +exports.buildMatchMemberExpression = buildMatchMemberExpression; +exports.removeComments = removeComments; +exports.inheritsComments = inheritsComments; +exports.inheritTrailingComments = inheritTrailingComments; +exports.inheritLeadingComments = inheritLeadingComments; +exports.inheritInnerComments = inheritInnerComments; +exports.inherits = inherits; +exports.assertNode = assertNode; +exports.isNode = isNode; +exports.traverseFast = traverseFast; +exports.removeProperties = removeProperties; +exports.removePropertiesDeep = removePropertiesDeep; + +var _retrievers = require("./retrievers"); + +Object.defineProperty(exports, "getBindingIdentifiers", { + enumerable: true, + get: function get() { + return _retrievers.getBindingIdentifiers; + } +}); +Object.defineProperty(exports, "getOuterBindingIdentifiers", { + enumerable: true, + get: function get() { + return _retrievers.getOuterBindingIdentifiers; + } +}); + +var _validators = require("./validators"); + +Object.defineProperty(exports, "isBinding", { + enumerable: true, + get: function get() { + return _validators.isBinding; + } +}); +Object.defineProperty(exports, "isReferenced", { + enumerable: true, + get: function get() { + return _validators.isReferenced; + } +}); +Object.defineProperty(exports, "isValidIdentifier", { + enumerable: true, + get: function get() { + return _validators.isValidIdentifier; + } +}); +Object.defineProperty(exports, "isLet", { + enumerable: true, + get: function get() { + return _validators.isLet; + } +}); +Object.defineProperty(exports, "isBlockScoped", { + enumerable: true, + get: function get() { + return _validators.isBlockScoped; + } +}); +Object.defineProperty(exports, "isVar", { + enumerable: true, + get: function get() { + return _validators.isVar; + } +}); +Object.defineProperty(exports, "isSpecifierDefault", { + enumerable: true, + get: function get() { + return _validators.isSpecifierDefault; + } +}); +Object.defineProperty(exports, "isScope", { + enumerable: true, + get: function get() { + return _validators.isScope; + } +}); +Object.defineProperty(exports, "isImmutable", { + enumerable: true, + get: function get() { + return _validators.isImmutable; + } +}); +Object.defineProperty(exports, "isNodesEquivalent", { + enumerable: true, + get: function get() { + return _validators.isNodesEquivalent; + } +}); + +var _converters = require("./converters"); + +Object.defineProperty(exports, "toComputedKey", { + enumerable: true, + get: function get() { + return _converters.toComputedKey; + } +}); +Object.defineProperty(exports, "toSequenceExpression", { + enumerable: true, + get: function get() { + return _converters.toSequenceExpression; + } +}); +Object.defineProperty(exports, "toKeyAlias", { + enumerable: true, + get: function get() { + return _converters.toKeyAlias; + } +}); +Object.defineProperty(exports, "toIdentifier", { + enumerable: true, + get: function get() { + return _converters.toIdentifier; + } +}); +Object.defineProperty(exports, "toBindingIdentifierName", { + enumerable: true, + get: function get() { + return _converters.toBindingIdentifierName; + } +}); +Object.defineProperty(exports, "toStatement", { + enumerable: true, + get: function get() { + return _converters.toStatement; + } +}); +Object.defineProperty(exports, "toExpression", { + enumerable: true, + get: function get() { + return _converters.toExpression; + } +}); +Object.defineProperty(exports, "toBlock", { + enumerable: true, + get: function get() { + return _converters.toBlock; + } +}); +Object.defineProperty(exports, "valueToNode", { + enumerable: true, + get: function get() { + return _converters.valueToNode; + } +}); + +var _flow = require("./flow"); + +Object.defineProperty(exports, "createUnionTypeAnnotation", { + enumerable: true, + get: function get() { + return _flow.createUnionTypeAnnotation; + } +}); +Object.defineProperty(exports, "removeTypeDuplicates", { + enumerable: true, + get: function get() { + return _flow.removeTypeDuplicates; + } +}); +Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", { + enumerable: true, + get: function get() { + return _flow.createTypeAnnotationBasedOnTypeof; + } +}); + +var _toFastProperties = require("to-fast-properties"); + +var _toFastProperties2 = _interopRequireDefault(_toFastProperties); + +var _clone = require("lodash/clone"); + +var _clone2 = _interopRequireDefault(_clone); + +var _uniq = require("lodash/uniq"); + +var _uniq2 = _interopRequireDefault(_uniq); + +require("./definitions/init"); + +var _definitions = require("./definitions"); + +var _react2 = require("./react"); + +var _react = _interopRequireWildcard(_react2); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var t = exports; + +function registerType(type) { + var is = t["is" + type]; + if (!is) { + is = t["is" + type] = function (node, opts) { + return t.is(type, node, opts); + }; + } + + t["assert" + type] = function (node, opts) { + opts = opts || {}; + if (!is(node, opts)) { + throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); + } + }; +} + +exports.VISITOR_KEYS = _definitions.VISITOR_KEYS; +exports.ALIAS_KEYS = _definitions.ALIAS_KEYS; +exports.NODE_FIELDS = _definitions.NODE_FIELDS; +exports.BUILDER_KEYS = _definitions.BUILDER_KEYS; +exports.DEPRECATED_KEYS = _definitions.DEPRECATED_KEYS; +exports.react = _react; + + +for (var type in t.VISITOR_KEYS) { + registerType(type); +} + +t.FLIPPED_ALIAS_KEYS = {}; + +(0, _keys2.default)(t.ALIAS_KEYS).forEach(function (type) { + t.ALIAS_KEYS[type].forEach(function (alias) { + var types = t.FLIPPED_ALIAS_KEYS[alias] = t.FLIPPED_ALIAS_KEYS[alias] || []; + types.push(type); + }); +}); + +(0, _keys2.default)(t.FLIPPED_ALIAS_KEYS).forEach(function (type) { + t[type.toUpperCase() + "_TYPES"] = t.FLIPPED_ALIAS_KEYS[type]; + registerType(type); +}); + +var TYPES = exports.TYPES = (0, _keys2.default)(t.VISITOR_KEYS).concat((0, _keys2.default)(t.FLIPPED_ALIAS_KEYS)).concat((0, _keys2.default)(t.DEPRECATED_KEYS)); + +function is(type, node, opts) { + if (!node) return false; + + var matches = isType(node.type, type); + if (!matches) return false; + + if (typeof opts === "undefined") { + return true; + } else { + return t.shallowEqual(node, opts); + } +} + +function isType(nodeType, targetType) { + if (nodeType === targetType) return true; + + if (t.ALIAS_KEYS[targetType]) return false; + + var aliases = t.FLIPPED_ALIAS_KEYS[targetType]; + if (aliases) { + if (aliases[0] === nodeType) return true; + + for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var alias = _ref; + + if (nodeType === alias) return true; + } + } + + return false; +} + +(0, _keys2.default)(t.BUILDER_KEYS).forEach(function (type) { + var keys = t.BUILDER_KEYS[type]; + + function builder() { + if (arguments.length > keys.length) { + throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); + } + + var node = {}; + node.type = type; + + var i = 0; + + for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _key = _ref2; + + var field = t.NODE_FIELDS[type][_key]; + + var arg = arguments[i++]; + if (arg === undefined) arg = (0, _clone2.default)(field.default); + + node[_key] = arg; + } + + for (var key in node) { + validate(node, key, node[key]); + } + + return node; + } + + t[type] = builder; + t[type[0].toLowerCase() + type.slice(1)] = builder; +}); + +var _loop = function _loop(_type) { + var newType = t.DEPRECATED_KEYS[_type]; + + function proxy(fn) { + return function () { + console.trace("The node type " + _type + " has been renamed to " + newType); + return fn.apply(this, arguments); + }; + } + + t[_type] = t[_type[0].toLowerCase() + _type.slice(1)] = proxy(t[newType]); + t["is" + _type] = proxy(t["is" + newType]); + t["assert" + _type] = proxy(t["assert" + newType]); +}; + +for (var _type in t.DEPRECATED_KEYS) { + _loop(_type); +} + +function validate(node, key, val) { + if (!node) return; + + var fields = t.NODE_FIELDS[node.type]; + if (!fields) return; + + var field = fields[key]; + if (!field || !field.validate) return; + if (field.optional && val == null) return; + + field.validate(node, key, val); +} + +function shallowEqual(actual, expected) { + var keys = (0, _keys2.default)(expected); + + for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var key = _ref3; + + if (actual[key] !== expected[key]) { + return false; + } + } + + return true; +} + +function appendToMemberExpression(member, append, computed) { + member.object = t.memberExpression(member.object, member.property, member.computed); + member.property = append; + member.computed = !!computed; + return member; +} + +function prependToMemberExpression(member, prepend) { + member.object = t.memberExpression(prepend, member.object); + return member; +} + +function ensureBlock(node) { + var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "body"; + + return node[key] = t.toBlock(node[key], node); +} + +function clone(node) { + if (!node) return node; + var newNode = {}; + for (var key in node) { + if (key[0] === "_") continue; + newNode[key] = node[key]; + } + return newNode; +} + +function cloneWithoutLoc(node) { + var newNode = clone(node); + delete newNode.loc; + return newNode; +} + +function cloneDeep(node) { + if (!node) return node; + var newNode = {}; + + for (var key in node) { + if (key[0] === "_") continue; + + var val = node[key]; + + if (val) { + if (val.type) { + val = t.cloneDeep(val); + } else if (Array.isArray(val)) { + val = val.map(t.cloneDeep); + } + } + + newNode[key] = val; + } + + return newNode; +} + +function buildMatchMemberExpression(match, allowPartial) { + var parts = match.split("."); + + return function (member) { + if (!t.isMemberExpression(member)) return false; + + var search = [member]; + var i = 0; + + while (search.length) { + var node = search.shift(); + + if (allowPartial && i === parts.length) { + return true; + } + + if (t.isIdentifier(node)) { + if (parts[i] !== node.name) return false; + } else if (t.isStringLiteral(node)) { + if (parts[i] !== node.value) return false; + } else if (t.isMemberExpression(node)) { + if (node.computed && !t.isStringLiteral(node.property)) { + return false; + } else { + search.push(node.object); + search.push(node.property); + continue; + } + } else { + return false; + } + + if (++i > parts.length) { + return false; + } + } + + return true; + }; +} + +function removeComments(node) { + for (var _iterator4 = t.COMMENT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + var key = _ref4; + + delete node[key]; + } + return node; +} + +function inheritsComments(child, parent) { + inheritTrailingComments(child, parent); + inheritLeadingComments(child, parent); + inheritInnerComments(child, parent); + return child; +} + +function inheritTrailingComments(child, parent) { + _inheritComments("trailingComments", child, parent); +} + +function inheritLeadingComments(child, parent) { + _inheritComments("leadingComments", child, parent); +} + +function inheritInnerComments(child, parent) { + _inheritComments("innerComments", child, parent); +} + +function _inheritComments(key, child, parent) { + if (child && parent) { + child[key] = (0, _uniq2.default)([].concat(child[key], parent[key]).filter(Boolean)); + } +} + +function inherits(child, parent) { + if (!child || !parent) return child; + + for (var _iterator5 = t.INHERIT_KEYS.optional, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + var _key2 = _ref5; + + if (child[_key2] == null) { + child[_key2] = parent[_key2]; + } + } + + for (var key in parent) { + if (key[0] === "_") child[key] = parent[key]; + } + + for (var _iterator6 = t.INHERIT_KEYS.force, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + var _key3 = _ref6; + + child[_key3] = parent[_key3]; + } + + t.inheritsComments(child, parent); + + return child; +} + +function assertNode(node) { + if (!isNode(node)) { + throw new TypeError("Not a valid node " + (node && node.type)); + } +} + +function isNode(node) { + return !!(node && _definitions.VISITOR_KEYS[node.type]); +} + +(0, _toFastProperties2.default)(t); +(0, _toFastProperties2.default)(t.VISITOR_KEYS); + +function traverseFast(node, enter, opts) { + if (!node) return; + + var keys = t.VISITOR_KEYS[node.type]; + if (!keys) return; + + opts = opts || {}; + enter(node, opts); + + for (var _iterator7 = keys, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { + var _ref7; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref7 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref7 = _i7.value; + } + + var key = _ref7; + + var subNode = node[key]; + + if (Array.isArray(subNode)) { + for (var _iterator8 = subNode, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) { + var _ref8; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref8 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref8 = _i8.value; + } + + var _node = _ref8; + + traverseFast(_node, enter, opts); + } + } else { + traverseFast(subNode, enter, opts); + } + } +} + +var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; + +var CLEAR_KEYS_PLUS_COMMENTS = t.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS); + +function removeProperties(node, opts) { + opts = opts || {}; + var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; + for (var _iterator9 = map, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) { + var _ref9; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref9 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref9 = _i9.value; + } + + var _key4 = _ref9; + + if (node[_key4] != null) node[_key4] = undefined; + } + + for (var key in node) { + if (key[0] === "_" && node[key] != null) node[key] = undefined; + } + + var syms = (0, _getOwnPropertySymbols2.default)(node); + for (var _iterator10 = syms, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) { + var _ref10; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref10 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref10 = _i10.value; + } + + var sym = _ref10; + + node[sym] = null; + } +} + +function removePropertiesDeep(tree, opts) { + traverseFast(tree, removeProperties, opts); + return tree; +} \ No newline at end of file diff --git a/node_modules/babel-types/lib/react.js b/node_modules/babel-types/lib/react.js new file mode 100755 index 00000000..923ee123 --- /dev/null +++ b/node_modules/babel-types/lib/react.js @@ -0,0 +1,80 @@ +"use strict"; + +exports.__esModule = true; +exports.isReactComponent = undefined; +exports.isCompatTag = isCompatTag; +exports.buildChildren = buildChildren; + +var _index = require("./index"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +var isReactComponent = exports.isReactComponent = t.buildMatchMemberExpression("React.Component"); + +function isCompatTag(tagName) { + return !!tagName && /^[a-z]|\-/.test(tagName); +} + +function cleanJSXElementLiteralChild(child, args) { + var lines = child.value.split(/\r\n|\n|\r/); + + var lastNonEmptyLine = 0; + + for (var i = 0; i < lines.length; i++) { + if (lines[i].match(/[^ \t]/)) { + lastNonEmptyLine = i; + } + } + + var str = ""; + + for (var _i = 0; _i < lines.length; _i++) { + var line = lines[_i]; + + var isFirstLine = _i === 0; + var isLastLine = _i === lines.length - 1; + var isLastNonEmptyLine = _i === lastNonEmptyLine; + + var trimmedLine = line.replace(/\t/g, " "); + + if (!isFirstLine) { + trimmedLine = trimmedLine.replace(/^[ ]+/, ""); + } + + if (!isLastLine) { + trimmedLine = trimmedLine.replace(/[ ]+$/, ""); + } + + if (trimmedLine) { + if (!isLastNonEmptyLine) { + trimmedLine += " "; + } + + str += trimmedLine; + } + } + + if (str) args.push(t.stringLiteral(str)); +} + +function buildChildren(node) { + var elems = []; + + for (var i = 0; i < node.children.length; i++) { + var child = node.children[i]; + + if (t.isJSXText(child)) { + cleanJSXElementLiteralChild(child, elems); + continue; + } + + if (t.isJSXExpressionContainer(child)) child = child.expression; + if (t.isJSXEmptyExpression(child)) continue; + + elems.push(child); + } + + return elems; +} \ No newline at end of file diff --git a/node_modules/babel-types/lib/retrievers.js b/node_modules/babel-types/lib/retrievers.js new file mode 100755 index 00000000..e5782e08 --- /dev/null +++ b/node_modules/babel-types/lib/retrievers.js @@ -0,0 +1,115 @@ +"use strict"; + +exports.__esModule = true; + +var _create = require("babel-runtime/core-js/object/create"); + +var _create2 = _interopRequireDefault(_create); + +exports.getBindingIdentifiers = getBindingIdentifiers; +exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; + +var _index = require("./index"); + +var t = _interopRequireWildcard(_index); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function getBindingIdentifiers(node, duplicates, outerOnly) { + var search = [].concat(node); + var ids = (0, _create2.default)(null); + + while (search.length) { + var id = search.shift(); + if (!id) continue; + + var keys = t.getBindingIdentifiers.keys[id.type]; + + if (t.isIdentifier(id)) { + if (duplicates) { + var _ids = ids[id.name] = ids[id.name] || []; + _ids.push(id); + } else { + ids[id.name] = id; + } + continue; + } + + if (t.isExportDeclaration(id)) { + if (t.isDeclaration(id.declaration)) { + search.push(id.declaration); + } + continue; + } + + if (outerOnly) { + if (t.isFunctionDeclaration(id)) { + search.push(id.id); + continue; + } + + if (t.isFunctionExpression(id)) { + continue; + } + } + + if (keys) { + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (id[key]) { + search = search.concat(id[key]); + } + } + } + } + + return ids; +} + +getBindingIdentifiers.keys = { + DeclareClass: ["id"], + DeclareFunction: ["id"], + DeclareModule: ["id"], + DeclareVariable: ["id"], + InterfaceDeclaration: ["id"], + TypeAlias: ["id"], + + CatchClause: ["param"], + LabeledStatement: ["label"], + UnaryExpression: ["argument"], + AssignmentExpression: ["left"], + + ImportSpecifier: ["local"], + ImportNamespaceSpecifier: ["local"], + ImportDefaultSpecifier: ["local"], + ImportDeclaration: ["specifiers"], + + ExportSpecifier: ["exported"], + ExportNamespaceSpecifier: ["exported"], + ExportDefaultSpecifier: ["exported"], + + FunctionDeclaration: ["id", "params"], + FunctionExpression: ["id", "params"], + + ClassDeclaration: ["id"], + ClassExpression: ["id"], + + RestElement: ["argument"], + UpdateExpression: ["argument"], + + RestProperty: ["argument"], + ObjectProperty: ["value"], + + AssignmentPattern: ["left"], + ArrayPattern: ["elements"], + ObjectPattern: ["properties"], + + VariableDeclaration: ["declarations"], + VariableDeclarator: ["id"] +}; + +function getOuterBindingIdentifiers(node, duplicates) { + return getBindingIdentifiers(node, duplicates, true); +} \ No newline at end of file diff --git a/node_modules/babel-types/lib/validators.js b/node_modules/babel-types/lib/validators.js new file mode 100755 index 00000000..ec30e55b --- /dev/null +++ b/node_modules/babel-types/lib/validators.js @@ -0,0 +1,265 @@ +"use strict"; + +exports.__esModule = true; + +var _keys = require("babel-runtime/core-js/object/keys"); + +var _keys2 = _interopRequireDefault(_keys); + +var _typeof2 = require("babel-runtime/helpers/typeof"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +var _getIterator2 = require("babel-runtime/core-js/get-iterator"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +exports.isBinding = isBinding; +exports.isReferenced = isReferenced; +exports.isValidIdentifier = isValidIdentifier; +exports.isLet = isLet; +exports.isBlockScoped = isBlockScoped; +exports.isVar = isVar; +exports.isSpecifierDefault = isSpecifierDefault; +exports.isScope = isScope; +exports.isImmutable = isImmutable; +exports.isNodesEquivalent = isNodesEquivalent; + +var _retrievers = require("./retrievers"); + +var _esutils = require("esutils"); + +var _esutils2 = _interopRequireDefault(_esutils); + +var _index = require("./index"); + +var t = _interopRequireWildcard(_index); + +var _constants = require("./constants"); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function isBinding(node, parent) { + var keys = _retrievers.getBindingIdentifiers.keys[parent.type]; + if (keys) { + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var val = parent[key]; + if (Array.isArray(val)) { + if (val.indexOf(node) >= 0) return true; + } else { + if (val === node) return true; + } + } + } + + return false; +} + +function isReferenced(node, parent) { + switch (parent.type) { + case "BindExpression": + return parent.object === node || parent.callee === node; + + case "MemberExpression": + case "JSXMemberExpression": + if (parent.property === node && parent.computed) { + return true; + } else if (parent.object === node) { + return true; + } else { + return false; + } + + case "MetaProperty": + return false; + + case "ObjectProperty": + if (parent.key === node) { + return parent.computed; + } + + case "VariableDeclarator": + return parent.id !== node; + + case "ArrowFunctionExpression": + case "FunctionDeclaration": + case "FunctionExpression": + for (var _iterator = parent.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var param = _ref; + + if (param === node) return false; + } + + return parent.id !== node; + + case "ExportSpecifier": + if (parent.source) { + return false; + } else { + return parent.local === node; + } + + case "ExportNamespaceSpecifier": + case "ExportDefaultSpecifier": + return false; + + case "JSXAttribute": + return parent.name !== node; + + case "ClassProperty": + if (parent.key === node) { + return parent.computed; + } else { + return parent.value === node; + } + + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "ImportSpecifier": + return false; + + case "ClassDeclaration": + case "ClassExpression": + return parent.id !== node; + + case "ClassMethod": + case "ObjectMethod": + return parent.key === node && parent.computed; + + case "LabeledStatement": + return false; + + case "CatchClause": + return parent.param !== node; + + case "RestElement": + return false; + + case "AssignmentExpression": + return parent.right === node; + + case "AssignmentPattern": + return parent.right === node; + + case "ObjectPattern": + case "ArrayPattern": + return false; + } + + return true; +} + +function isValidIdentifier(name) { + if (typeof name !== "string" || _esutils2.default.keyword.isReservedWordES6(name, true)) { + return false; + } else if (name === "await") { + return false; + } else { + return _esutils2.default.keyword.isIdentifierNameES6(name); + } +} + +function isLet(node) { + return t.isVariableDeclaration(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]); +} + +function isBlockScoped(node) { + return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node); +} + +function isVar(node) { + return t.isVariableDeclaration(node, { kind: "var" }) && !node[_constants.BLOCK_SCOPED_SYMBOL]; +} + +function isSpecifierDefault(specifier) { + return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" }); +} + +function isScope(node, parent) { + if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) { + return false; + } + + return t.isScopable(node); +} + +function isImmutable(node) { + if (t.isType(node.type, "Immutable")) return true; + + if (t.isIdentifier(node)) { + if (node.name === "undefined") { + return true; + } else { + return false; + } + } + + return false; +} + +function isNodesEquivalent(a, b) { + if ((typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || (typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || a == null || b == null) { + return a === b; + } + + if (a.type !== b.type) { + return false; + } + + var fields = (0, _keys2.default)(t.NODE_FIELDS[a.type] || a.type); + + for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var field = _ref2; + + if ((0, _typeof3.default)(a[field]) !== (0, _typeof3.default)(b[field])) { + return false; + } + + if (Array.isArray(a[field])) { + if (!Array.isArray(b[field])) { + return false; + } + if (a[field].length !== b[field].length) { + return false; + } + + for (var i = 0; i < a[field].length; i++) { + if (!isNodesEquivalent(a[field][i], b[field][i])) { + return false; + } + } + continue; + } + + if (!isNodesEquivalent(a[field], b[field])) { + return false; + } + } + + return true; +} \ No newline at end of file diff --git a/node_modules/babel-types/package.json b/node_modules/babel-types/package.json new file mode 100755 index 00000000..fee4063c --- /dev/null +++ b/node_modules/babel-types/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "babel-types@^6.24.1", + "scope": null, + "escapedName": "babel-types", + "name": "babel-types", + "rawSpec": "^6.24.1", + "spec": ">=6.24.1 <7.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core" + ] + ], + "_from": "babel-types@>=6.24.1 <7.0.0", + "_id": "babel-types@6.24.1", + "_inCache": true, + "_location": "/babel-types", + "_nodeVersion": "6.9.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/babel-types-6.24.1.tgz_1491578343925_0.5827958500012755" + }, + "_npmUser": { + "name": "hzoo", + "email": "hi@henryzoo.com" + }, + "_npmVersion": "3.10.10", + "_phantomChildren": {}, + "_requested": { + "raw": "babel-types@^6.24.1", + "scope": null, + "escapedName": "babel-types", + "name": "babel-types", + "rawSpec": "^6.24.1", + "spec": ">=6.24.1 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-core", + "/babel-generator", + "/babel-helper-call-delegate", + "/babel-helper-define-map", + "/babel-helper-function-name", + "/babel-helper-get-function-arity", + "/babel-helper-hoist-variables", + "/babel-helper-optimise-call-expression", + "/babel-helper-regex", + "/babel-helper-replace-supers", + "/babel-plugin-transform-es2015-block-scoping", + "/babel-plugin-transform-es2015-classes", + "/babel-plugin-transform-es2015-duplicate-keys", + "/babel-plugin-transform-es2015-function-name", + "/babel-plugin-transform-es2015-modules-commonjs", + "/babel-plugin-transform-es2015-parameters", + "/babel-plugin-transform-es2015-shorthand-properties", + "/babel-plugin-transform-es2015-sticky-regex", + "/babel-plugin-transform-strict-mode", + "/babel-template", + "/babel-traverse", + "/regenerator-transform" + ], + "_resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.24.1.tgz", + "_shasum": "a136879dc15b3606bda0d90c1fc74304c2ff0975", + "_shrinkwrap": null, + "_spec": "babel-types@^6.24.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "dependencies": { + "babel-runtime": "^6.22.0", + "esutils": "^2.0.2", + "lodash": "^4.2.0", + "to-fast-properties": "^1.0.1" + }, + "description": "Babel Types is a Lodash-esque utility library for AST nodes", + "devDependencies": { + "babylon": "^6.8.2" + }, + "directories": {}, + "dist": { + "shasum": "a136879dc15b3606bda0d90c1fc74304c2ff0975", + "tarball": "https://registry.npmjs.org/babel-types/-/babel-types-6.24.1.tgz" + }, + "homepage": "https://babeljs.io/", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "amasad", + "email": "amjad.masad@gmail.com" + }, + { + "name": "hzoo", + "email": "hi@henryzoo.com" + }, + { + "name": "jmm", + "email": "npm-public@jessemccarthy.net" + }, + { + "name": "loganfsmyth", + "email": "loganfsmyth@gmail.com" + }, + { + "name": "sebmck", + "email": "sebmck@gmail.com" + }, + { + "name": "thejameskyle", + "email": "me@thejameskyle.com" + } + ], + "name": "babel-types", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-types" + }, + "scripts": {}, + "version": "6.24.1" +} diff --git a/node_modules/babylon/CHANGELOG.md b/node_modules/babylon/CHANGELOG.md new file mode 100755 index 00000000..bb482fc5 --- /dev/null +++ b/node_modules/babylon/CHANGELOG.md @@ -0,0 +1,943 @@ +# Changelog + +> **Tags:** +> - :boom: [Breaking Change] +> - :eyeglasses: [Spec Compliancy] +> - :rocket: [New Feature] +> - :bug: [Bug Fix] +> - :memo: [Documentation] +> - :house: [Internal] +> - :nail_care: [Polish] + +> Semver Policy: https://github.com/babel/babylon#semver + +_Note: Gaps between patch versions are faulty, broken or test releases._ + +See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog. + +## 6.16.0 (2017-02-23) + +### :rocket: New Feature + +***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) + +We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) + +We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. + +To enable `estree` mode simply add the plugin in the config: +```json +{ + "plugins": [ "estree" ] +} +``` + +If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. + +Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) + +Babylon exports a new function to parse a single expression + +```js +import { parseExpression } from 'babylon'; + +const ast = parseExpression('x || y && z', options); +``` + +The returned AST will only consist of the expression. The options are the same as for `parse()` + +Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) + +A new option was added to babylon allowing to change the intial linenumber for the first line which is usually `1`. +Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... + +Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) + +Added support for function predicates which flow introduced in version 0.33.0 + +```js +declare function is_number(x: mixed): boolean %checks(typeof x === "number"); +``` + +Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) + +Added support for imports within module declarations which flow introduced in version 0.37.0 + +```js +declare module "C" { + import type { DT } from "D"; + declare export type CT = { D: DT }; +} +``` + +### :eyeglasses: Spec Compliancy + +Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) + +This example now correctly throws an error when there is a semicolon after the decorator: + +```js +class A { +@a; +foo(){} +} +``` + +Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) + +Using keywords in imports is not allowed anymore: + +```js +import { default } from "foo"; +import { a as debugger } from "foo"; +``` + +Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) + +In flow it is now forbidden to overwrite the primitve types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. + +Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) + +The following code now correctly throws an error + +```js +import type { type a } from "foo"; +``` + +Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) + +Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. + +If you enable the flow plugin you can only define the type of the class properties, but not initialize them. + +Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) + +Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. + +```js +export default async function bar() {}; +``` + +### :nail_care: Polish + +Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) + +### :bug: Bug Fix + +Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) + +Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) + +ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) + +Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) + +Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) + +Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) + +Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) + +Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) + + +### :house: Internal + +Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) + +Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) + +Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) + +chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) + +Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) + +Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) + +Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) + +devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) + +Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) + +Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) + +### :memo: Documentation + +Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) + +Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) + +Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) + +AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) + +## 6.15.0 (2017-01-10) + +### :eyeglasses: Spec Compliancy + +Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) + +This change implements flows new shorthand import syntax +and where previously you had to write this code: + +```js +import {someValue} from "blah"; +import type {someType} from "blah"; +import typeof {someOtherValue} from "blah"; +``` + +you can now write it like this: + +```js +import { + someValue, + type someType, + typeof someOtherValue, +} from "blah"; +``` + +For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. + +flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) + +This change now allows a leading pipe everywhere types can be used: +```js +var f = (x): | 1 | 2 => 1; +``` + +Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) + +Previously babylon parsed the following exports, although they are not valid: +```js +export typeof foo; +export new Foo(); +export function() {}; +export for (;;); +export while(foo); +``` + +### :bug: Bug Fix + +Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) + +This fixes parsing of this case: + +```js +const map = { + [age <= 17] : 'Too young' +}; +``` + +Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) + +The following case produced an invalid AST +```js +
{/* foo */}
+``` + +Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) + +When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. + +Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) + +Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) + +### :house: Internal + +User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) + +Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) + +Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) + +Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) + +Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) + +Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) + +Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) + +chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) + +chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) + +## 6.14.1 (2016-11-17) + +### :bug: Bug Fix + +Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) + +```js +{ + "plugins": ["*"] +} +``` + +Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. + +## 6.14.0 (2016-11-16) + +### :eyeglasses: Spec Compliancy + +Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) + +[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) + +Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). + +``` +class enum {} // throws +class await {} // throws in strict mode (module) +``` + +Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) + +So where you used to have to write + +```js +type A = (x: string, y: boolean) => number; +type B = (z: string) => number; +type C = { [key: string]: number }; +``` + +you can now write (with flow 0.34.0) + +```js +type A = (string, boolean) => number; +type B = string => number; +type C = { [string]: number }; +``` + +Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) + +Supports these form now of specifying array types: + +```js +var a: number[][][][]; +var b: string[][]; +``` + +### :bug: Bug Fix + +Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) + +``` +declare module "foo" { declare module.exports: number } +declare module "foo" { declare module.exports: number; } // also allowed now +``` + +### :house: Internal + + * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) + * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) + * Add node 7 (Daniel Tschinder) + * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) + +## v6.13.1 (2016-10-26) + +### :nail_care: Polish + +- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) + +```js +const babylon = require('babylon'); +const ast = babylon.parse('var foo = "lol";'); +``` + +With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. + +**Without bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png) + +**With bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png) + +- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) +- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) + +## v6.13.0 (2016-10-21) + +### :eyeglasses: Spec Compliancy + +Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) + +> See https://flowtype.org/docs/variance.html for more information + +```js +type T = { +p: T }; +interface T { -p: T }; +declare class T { +[k:K]: V }; +class T { -[k:K]: V }; +class C2 { +p: T = e }; +``` + +Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) + +```js +({ __proto__: 1, __proto__: 2 }) // Throws an error now +``` + +### :bug: Bug Fix + +Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) + +```js +declare class A { + static: T; +} +``` + +Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) + +```js +var foo = { async, bar }; +``` + +### :nail_care: Polish + +Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) + +> This improves the performance slightly (because of hidden classes) + +### :house: Internal + +Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) + +Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) + +Readd missin .eslinignore for IDEs (Daniel Tschinder) + +Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) + +Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) + +Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) + +## v6.12.0 (2016-10-14) + +### :eyeglasses: Spec Compliancy + +Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) + +#### Dynamic Import + +- Proposal Repo: https://github.com/domenic/proposal-dynamic-import +- Championed by [@domenic](https://github.com/domenic) +- stage-2 +- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) + +> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript + +```js +import(`./section-modules/${link.dataset.entryModule}.js`) +.then(module => { + module.loadPageInto(main); +}) +``` + +Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) + +#### EmptyTypeAnnotation + +Just wasn't covered before. + +```js +type T = empty; +``` + +### :bug: Bug Fix + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing due to sparse array +export const { foo: [ ,, qux7 ] } = bar; +``` + +Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) + +```js +declare class X { + foobar(): void; + static foobar(): void; +} +``` + +Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) + +```js +class Foo { + delete(item: T): T { + return item; + } +} +``` + +Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) + +```js +function *foo() { + const x = (yield 5: any); +} +``` + +### :nail_care: Polish + +Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) + +```js +// Unexpected token, expected ; (1:6) +{ set 1 } +``` + +### :house: Internal + +Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) + +Also run flow, linting, babel tests on seperate instances (add back node 0.10) + +## v6.11.6 (2016-10-12) + +### :bug: Bug Fix/Regression + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing with `Cannot read property 'type' of null` because of null identifiers +export const { foo: [ ,, qux7 ] } = bar; +``` + +## v6.11.5 (2016-10-12) + +### :eyeglasses: Spec Compliancy + +Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:20) +export function foo() {}; +export const { a: [{foo}] } = bar; +``` + +Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:22) +export const foo = 1; +export const [bar, ...foo] = baz; +``` + +### :bug: Bug Fix + +Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) + +```js +// this is ok now +const test = ({async = true}) => {}; +``` + +### :nail_care: Polish + +Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) + +```bash +# So in the case of a missing ending curly (`}`) +Module build failed: SyntaxError: Unexpected token, expected } (30:0) + 28 | } + 29 | +> 30 | + | ^ +``` + +## v6.11.4 (2016-10-03) + +Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) + +## v6.11.3 (2016-10-01) + +### :eyeglasses: Spec Compliancy + +Add static errors for object rest (#149) ([@danez](https://github.com/danez)) + +> https://github.com/sebmarkbage/ecmascript-rest-spread + +Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. + +```js +let { x, y, ...z } = { x: 1, y: 2, z: 3 }; +// x = 1 +// y = 2 +// z = { z: 3 } +``` + +#### New Syntax Errors: + +**SyntaxError**: The rest element has to be the last element when destructuring (1:10) +```bash +> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = { x: 1, y: 2, z: 3 } +# y = 2 +# z = 3 +``` + +Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. + +**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) + +```bash +> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = 1 +# y = { y: 2, z: 3 } +# z = { y: 2, z: 3 } +``` + +Before y and z would just be the same value anyway so there is no reason to need to have both. + +**SyntaxError**: A trailing comma is not permitted after the rest element (1:16) + +```js +let { x, y, ...z, } = obj; +``` + +The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. + +--- + +get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) + +```js +// valid +function something({ set = null, get = null }) {} +``` + +## v6.11.2 (2016-09-23) + +### Bug Fix + +- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo + +```js +// regression with duplicate export check +SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) + 20 | + 21 | export const { rhythm } = typography; +> 22 | export const { TypographyStyle } = typography +``` + +Bail out for now, and make a change to account for destructuring in the next release. + +## 6.11.1 (2016-09-22) + +### Bug Fix +- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez + +```javascript +export toString from './toString'; +``` + +```bash +`toString` has already been exported. Exported identifiers must be unique. (1:7) +> 1 | export toString from './toString'; + | ^ + 2 | +``` + +## 6.11.0 (2016-09-22) + +### Spec Compliancy (will break CI) + +- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo + +```js +// Only one default export allowed per module. (2:9) +export default function() {}; +export { foo as default }; + +// Only one default export allowed per module. (2:0) +export default {}; +export default function() {}; + +// `Foo` has already been exported. Exported identifiers must be unique. (2:0) +export { Foo }; +export class Foo {}; +``` + +### New Feature (Syntax) + +- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 + +```js +// AST +interface ClassProperty <: Node { + type: "ClassProperty"; + key: Identifier; + value: Expression; + computed: boolean; // added +} +``` + +```js +// with "plugins": ["classProperties"] +class Foo { + [x] + ['y'] +} + +class Bar { + [p] + [m] () {} +} + ``` + +### Bug Fix + +- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper + +```js +declare class X { + a: number; + static b: number; // static + c: number; // this was being marked as static in the AST as well +} +``` + +### Polish + +- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 + +```js +// Used to error with: +// SyntaxError: Assigning to rvalue (1:0) + +// Now: +// Invalid left-hand side in assignment expression (1:0) +3 = 4 + +// Invalid left-hand side in for-in statement (1:5) +for (+i in {}); +``` + +### Internal + +- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez +- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo + +## 6.10.0 (2016-09-19) + +> We plan to include some spec compliancy bugs in patch versions. An example was the multiple default exports issue. + +### Spec Compliancy + +* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) + +> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors + +More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) + +For example: + +```js +// this errors because it uses destructuring and default parameters +// in a function with a "use strict" directive +function a([ option1, option2 ] = []) { + "use strict"; +} + ``` + +The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. + +### New Feature + +* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) + +Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 + +Looks like: + +```js +var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; +``` + +### Bug Fixes + +* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) +* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) +* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) + +### Misc + +* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) +* Fix Contributing guidelines [skip ci] (Daniel Tschinder) + +## 6.9.2 (2016-09-09) + +The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. + +## 6.9.1 (2016-08-23) + +This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. + +### Bug Fixes + +- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez +- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez +- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper +- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez +- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez + +## 6.9.0 (2016-08-16) + +### New syntax support + +- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer + +(Be aware that React is not going to support this syntax) + +```js +
+ {...todos.map(todo => )} +
+``` + +- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez + +```js +declare module "foo" { + declare module.exports: {} +} +``` + +### New Features + +- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain +- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens + +### Bug Fixes + +- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez +- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez +- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi +- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez +- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi +- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez +- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez + +### Internal + +- Add codecoverage to tests @danez +- Fix tests to not save expected output if we expect the test to fail @danez +- Make a shallow clone of babel for testing @danez +- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot +- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot +- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot +- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot + +## 6.8.4 (2016-07-06) + +### Bug Fixes + +- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez + +## 6.8.3 (2016-07-02) + +### Bug Fixes + +- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez + +## 6.8.2 (2016-06-24) + +### Bug Fixes + +- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal +- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez +- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez +- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez +- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez +- Support negative numeric type literals @kittens +- Remove line terminator restriction after await keyword @kittens +- Remove grouped type arrow restriction as it seems flow no longer has it @kittens +- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin +- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi + +### Documentation + +- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene +- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo + +### Internal + +- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez +- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez +- Upgrade test runner ava @kittens +- Add missing generate-identifier-regex script @kittens +- Rename parser context types @kittens +- Add node v6 to travis testing @hzoo +- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens + +## 6.8.1 (2016-06-06) + +### New Feature + +- Parse type parameter declarations with defaults like `type Foo = T` + +### Bug Fixes +- Type parameter declarations need 1 or more type parameters. +- The existential type `*` is not a valid type parameter. +- The existential type `*` is a primary type + +### Spec Compliancy +- The param list for type parameter declarations now consists of `TypeParameter` nodes +- New `TypeParameter` AST Node (replaces using the `Identifier` node before) + +``` +interface TypeParameter <: Node { + bound: TypeAnnotation; + default: TypeAnnotation; + name: string; + variance: "plus" | "minus"; +} +``` + +## 6.8.0 (2016-05-02) + +#### New Feature + +##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) + +> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). + +Examples: + +```js +class Foo { + constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} +} + +export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} + +var obj = { + method(@foo() x, @bar({ a: 123 }) @baz() y) {} +}; +``` + +##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) + +There is also a new node type, `ForAwaitStatement`. + +> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). + +Example: + +```js +async function f() { + for await (let x of y); +} +``` diff --git a/node_modules/babylon/LICENSE b/node_modules/babylon/LICENSE new file mode 100755 index 00000000..d4c7fc58 --- /dev/null +++ b/node_modules/babylon/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2014 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/babylon/README.md b/node_modules/babylon/README.md new file mode 100755 index 00000000..cbe52888 --- /dev/null +++ b/node_modules/babylon/README.md @@ -0,0 +1,130 @@ +

+ babylon +

+ +

+ Babylon is a JavaScript parser used in Babel. +

+ +

+ Travis Status + Codecov Status +

+ + - The latest ECMAScript version enabled by default (ES2017). + - Comment attachment. + - Support for JSX and Flow. + - Support for experimental language proposals (accepting PRs for anything at least [stage-0](https://github.com/tc39/proposals/blob/master/stage-0-proposals.md)). + +## Credits + +Heavily based on [acorn](https://github.com/marijnh/acorn) and [acorn-jsx](https://github.com/RReverser/acorn-jsx), +thanks to the awesome work of [@RReverser](https://github.com/RReverser) and [@marijnh](https://github.com/marijnh). + +Significant diversions are expected to occur in the future such as streaming, EBNF definitions, sweet.js integration, interspatial parsing and more. + +## API + +### `babylon.parse(code, [options])` + +### `babylon.parseExpression(code, [options])` + +`parse()` parses the provided `code` as an entire ECMAScript program, while +`parseExpression()` tries to parse a single Expression with performance in +mind. When in doubt, use `.parse()`. + +### Options + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed. + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowSuperOutsideMethod**: TODO + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. + +- **sourceFilename**: Correlate output AST nodes with their source filename. Useful when generating code and source maps from the ASTs of multiple input files. + +- **startLine**: By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful for integration with other source tools. + +- **plugins**: Array containing the plugins that you want to enable. + +- **strictMode**: TODO + +### Output + +Babylon generates AST according to [Babel AST format][]. +It is based on [ESTree spec][] with the following deviations: + +- [Literal][] token is replaced with [StringLiteral][], [NumericLiteral][], [BooleanLiteral][], [NullLiteral][], [RegExpLiteral][] +- [Property][] token is replaced with [ObjectProperty][] and [ObjectMethod][] +- [MethodDefinition][] is replaced with [ClassMethod][] +- [Program][] and [BlockStatement][] contain additional `directives` field with [Directive][] and [DirectiveLiteral][] +- [ClassMethod][], [ObjectProperty][], and [ObjectMethod][] value property's properties in [FunctionExpression][] is coerced/brought into the main method node. + +AST for JSX code is based on [Facebook JSX AST][] with the addition of one node type: + +- `JSXText` + +[Babel AST format]: https://github.com/babel/babylon/blob/master/ast/spec.md +[ESTree spec]: https://github.com/estree/estree + +[Literal]: https://github.com/estree/estree/blob/master/es5.md#literal +[Property]: https://github.com/estree/estree/blob/master/es5.md#property +[MethodDefinition]: https://github.com/estree/estree/blob/master/es2015.md#methoddefinition + +[StringLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#stringliteral +[NumericLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#numericliteral +[BooleanLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#booleanliteral +[NullLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#nullliteral +[RegExpLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#regexpliteral +[ObjectProperty]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectproperty +[ObjectMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectmethod +[ClassMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#classmethod +[Program]: https://github.com/babel/babylon/blob/master/ast/spec.md#programs +[BlockStatement]: https://github.com/babel/babylon/blob/master/ast/spec.md#blockstatement +[Directive]: https://github.com/babel/babylon/blob/master/ast/spec.md#directive +[DirectiveLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#directiveliteral +[FunctionExpression]: https://github.com/babel/babylon/blob/master/ast/spec.md#functionexpression + +[Facebook JSX AST]: https://github.com/facebook/jsx/blob/master/AST.md + +### Semver + +Babylon follows semver in most situations. The only thing to note is that some spec-compliancy bug fixes may be released under patch versions. + +For example: We push a fix to early error on something like [#107](https://github.com/babel/babylon/pull/107) - multiple default exports per file. That would be considered a bug fix even though it would cause a build to fail. + +### Example + +```javascript +require("babylon").parse("code", { + // parse in strict mode and allow module declarations + sourceType: "module", + + plugins: [ + // enable jsx and flow syntax + "jsx", + "flow" + ] +}); +``` + +### Plugins + + - `jsx` + - `flow` + - `doExpressions` + - `objectRestSpread` + - `decorators` (Based on an outdated version of the Decorators proposal. Will be removed in a future version of `Babylon`) + - `classProperties` + - `exportExtensions` + - `asyncGenerators` + - `functionBind` + - `functionSent` + - `dynamicImport` diff --git a/node_modules/babylon/bin/babylon.js b/node_modules/babylon/bin/babylon.js new file mode 100755 index 00000000..449ddfed --- /dev/null +++ b/node_modules/babylon/bin/babylon.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +/* eslint no-var: 0 */ + +var babylon = require(".."); +var fs = require("fs"); + +var filename = process.argv[2]; +if (!filename) { + console.error("no filename specified"); + process.exit(0); +} + +var file = fs.readFileSync(filename, "utf8"); +var ast = babylon.parse(file); + +console.log(JSON.stringify(ast, null, " ")); diff --git a/node_modules/babylon/bin/generate-identifier-regex.js b/node_modules/babylon/bin/generate-identifier-regex.js new file mode 100755 index 00000000..9b0ae7d6 --- /dev/null +++ b/node_modules/babylon/bin/generate-identifier-regex.js @@ -0,0 +1,62 @@ +"use strict"; + +// Which Unicode version should be used? +const version = "9.0.0"; + +const start = require("unicode-" + version + "/Binary_Property/ID_Start/code-points.js") + .filter(function(ch) { return ch > 0x7f; }); +let last = -1; +const cont = [0x200c, 0x200d].concat( + require("unicode-" + version + "/Binary_Property/ID_Continue/code-points.js") + .filter(function(ch) { + return ch > 0x7f && search(start, ch, last + 1) == -1; + }) + ); + +function search(arr, ch, starting) { + for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) + if (arr[i] === ch) + return i; + return -1; +} + +function pad(str, width) { + while (str.length < width) str = "0" + str; + return str; +} + +function esc(code) { + const hex = code.toString(16); + if (hex.length <= 2) return "\\x" + pad(hex, 2); + else return "\\u" + pad(hex, 4); +} + +function generate(chars) { + const astral = []; + let re = ""; + for (let i = 0, at = 0x10000; i < chars.length; i++) { + const from = chars[i]; + let to = from; + while (i < chars.length - 1 && chars[i + 1] == to + 1) { + i++; + to++; + } + if (to <= 0xffff) { + if (from == to) re += esc(from); + else if (from + 1 == to) re += esc(from) + esc(to); + else re += esc(from) + "-" + esc(to); + } else { + astral.push(from - at, to - from); + at = to; + } + } + return { nonASCII: re, astral: astral }; +} + +const startData = generate(start); +const contData = generate(cont); + +console.log("let nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\";"); +console.log("let nonASCIIidentifierChars = \"" + contData.nonASCII + "\";"); +console.log("const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"); +console.log("const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"); diff --git a/node_modules/babylon/lib/index.js b/node_modules/babylon/lib/index.js new file mode 100755 index 00000000..f64e4b11 --- /dev/null +++ b/node_modules/babylon/lib/index.js @@ -0,0 +1,7096 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +/* eslint max-len: 0 */ + +// This is a trick taken from Esprima. It turns out that, on +// non-Chrome browsers, to check whether a string is in a set, a +// predicate containing a big ugly `switch` statement is faster than +// a regular expression, and on Chrome the two are about on par. +// This function uses `eval` (non-lexical) to produce such a +// predicate from a space-separated string of words. +// +// It starts by sorting the words by length. + +function makePredicate(words) { + words = words.split(" "); + return function (str) { + return words.indexOf(str) >= 0; + }; +} + +// Reserved word lists for various dialects of the language + +var reservedWords = { + 6: makePredicate("enum await"), + strict: makePredicate("implements interface let package private protected public static yield"), + strictBind: makePredicate("eval arguments") +}; + +// And the keywords + +var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"); + +// ## Character categories + +// Big ugly regular expressions that match characters in the +// whitespace, identifier, and identifier-start categories. These +// are only applied when a character is found to actually have a +// code point above 128. +// Generated by `bin/generate-identifier-regex.js`. + +var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; +var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA900-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F"; + +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + +// These are a run-length and offset encoded representation of the +// >0xffff code points that are a valid part of identifiers. The +// offset starts at 0x10000, and each pair of numbers represents an +// offset to the next range, and then a size of the range. They were +// generated by `bin/generate-identifier-regex.js`. +// eslint-disable-next-line comma-spacing +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 54, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 25, 391, 63, 32, 0, 449, 56, 264, 8, 2, 36, 18, 0, 50, 29, 881, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 65, 0, 32, 6124, 20, 754, 9486, 1, 3071, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 4149, 196, 60, 67, 1213, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 10591, 541]; +// eslint-disable-next-line comma-spacing +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 838, 7, 2, 7, 17, 9, 57, 21, 2, 13, 19882, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 2214, 6, 110, 6, 6, 9, 792487, 239]; + +// This has a complexity linear to the value of the code. The +// assumption is that looking up astral identifier characters is +// rare. +function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) return false; + + pos += set[i + 1]; + if (pos >= code) return true; + } +} + +// Test whether a given character code starts an identifier. + +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + return isInAstralSet(code, astralIdentifierStartCodes); +} + +// Test whether a given character is part of an identifier. + +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} + +// A second optional argument can be given to further configure +var defaultOptions = { + // Source type ("script" or "module") for different semantics + sourceType: "script", + // Source filename. + sourceFilename: undefined, + // Line from which to start counting source. Useful for + // integration with other tools. + startLine: 1, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // TODO + allowSuperOutsideMethod: false, + // An array of plugins to enable + plugins: [], + // TODO + strictMode: null +}; + +// Interpret and default an options object + +function getOptions(opts) { + var options = {}; + for (var key in defaultOptions) { + options[key] = opts && key in opts ? opts[key] : defaultOptions[key]; + } + return options; +} + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + + + + + + + + + + + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + + + + + + + + + + + +var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + + + + + + + + + + + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +// ## Token types + +// The assignment of fine-grained, information-carrying type objects +// allows the tokenizer to store the information it has about a +// token in a way that is very cheap for the parser to look up. + +// All token type variables start with an underscore, to make them +// easy to recognize. + +// The `beforeExpr` property is used to disambiguate between regular +// expressions and divisions. It is set on all token types that can +// be followed by an expression (thus, a slash after them would be a +// regular expression). +// +// `isLoop` marks a keyword as starting a loop, which is important +// to know when parsing a label, in order to allow or disallow +// continue jumps to that label. + +var beforeExpr = true; +var startsExpr = true; +var isLoop = true; +var isAssign = true; +var prefix = true; +var postfix = true; + +var TokenType = function TokenType(label) { + var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + classCallCheck(this, TokenType); + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; +}; + +var KeywordTokenType = function (_TokenType) { + inherits(KeywordTokenType, _TokenType); + + function KeywordTokenType(name) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + classCallCheck(this, KeywordTokenType); + + options.keyword = name; + + return possibleConstructorReturn(this, _TokenType.call(this, name, options)); + } + + return KeywordTokenType; +}(TokenType); + +var BinopTokenType = function (_TokenType2) { + inherits(BinopTokenType, _TokenType2); + + function BinopTokenType(name, prec) { + classCallCheck(this, BinopTokenType); + return possibleConstructorReturn(this, _TokenType2.call(this, name, { beforeExpr: beforeExpr, binop: prec })); + } + + return BinopTokenType; +}(TokenType); + +var types = { + num: new TokenType("num", { startsExpr: startsExpr }), + regexp: new TokenType("regexp", { startsExpr: startsExpr }), + string: new TokenType("string", { startsExpr: startsExpr }), + name: new TokenType("name", { startsExpr: startsExpr }), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", { beforeExpr: beforeExpr, startsExpr: startsExpr }), + bracketR: new TokenType("]"), + braceL: new TokenType("{", { beforeExpr: beforeExpr, startsExpr: startsExpr }), + braceBarL: new TokenType("{|", { beforeExpr: beforeExpr, startsExpr: startsExpr }), + braceR: new TokenType("}"), + braceBarR: new TokenType("|}"), + parenL: new TokenType("(", { beforeExpr: beforeExpr, startsExpr: startsExpr }), + parenR: new TokenType(")"), + comma: new TokenType(",", { beforeExpr: beforeExpr }), + semi: new TokenType(";", { beforeExpr: beforeExpr }), + colon: new TokenType(":", { beforeExpr: beforeExpr }), + doubleColon: new TokenType("::", { beforeExpr: beforeExpr }), + dot: new TokenType("."), + question: new TokenType("?", { beforeExpr: beforeExpr }), + arrow: new TokenType("=>", { beforeExpr: beforeExpr }), + template: new TokenType("template"), + ellipsis: new TokenType("...", { beforeExpr: beforeExpr }), + backQuote: new TokenType("`", { startsExpr: startsExpr }), + dollarBraceL: new TokenType("${", { beforeExpr: beforeExpr, startsExpr: startsExpr }), + at: new TokenType("@"), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", { beforeExpr: beforeExpr, isAssign: isAssign }), + assign: new TokenType("_=", { beforeExpr: beforeExpr, isAssign: isAssign }), + incDec: new TokenType("++/--", { prefix: prefix, postfix: postfix, startsExpr: startsExpr }), + prefix: new TokenType("prefix", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }), + logicalOR: new BinopTokenType("||", 1), + logicalAND: new BinopTokenType("&&", 2), + bitwiseOR: new BinopTokenType("|", 3), + bitwiseXOR: new BinopTokenType("^", 4), + bitwiseAND: new BinopTokenType("&", 5), + equality: new BinopTokenType("==/!=", 6), + relational: new BinopTokenType("", 7), + bitShift: new BinopTokenType("<>", 8), + plusMin: new TokenType("+/-", { beforeExpr: beforeExpr, binop: 9, prefix: prefix, startsExpr: startsExpr }), + modulo: new BinopTokenType("%", 10), + star: new BinopTokenType("*", 10), + slash: new BinopTokenType("/", 10), + exponent: new TokenType("**", { beforeExpr: beforeExpr, binop: 11, rightAssociative: true }) +}; + +var keywords = { + "break": new KeywordTokenType("break"), + "case": new KeywordTokenType("case", { beforeExpr: beforeExpr }), + "catch": new KeywordTokenType("catch"), + "continue": new KeywordTokenType("continue"), + "debugger": new KeywordTokenType("debugger"), + "default": new KeywordTokenType("default", { beforeExpr: beforeExpr }), + "do": new KeywordTokenType("do", { isLoop: isLoop, beforeExpr: beforeExpr }), + "else": new KeywordTokenType("else", { beforeExpr: beforeExpr }), + "finally": new KeywordTokenType("finally"), + "for": new KeywordTokenType("for", { isLoop: isLoop }), + "function": new KeywordTokenType("function", { startsExpr: startsExpr }), + "if": new KeywordTokenType("if"), + "return": new KeywordTokenType("return", { beforeExpr: beforeExpr }), + "switch": new KeywordTokenType("switch"), + "throw": new KeywordTokenType("throw", { beforeExpr: beforeExpr }), + "try": new KeywordTokenType("try"), + "var": new KeywordTokenType("var"), + "let": new KeywordTokenType("let"), + "const": new KeywordTokenType("const"), + "while": new KeywordTokenType("while", { isLoop: isLoop }), + "with": new KeywordTokenType("with"), + "new": new KeywordTokenType("new", { beforeExpr: beforeExpr, startsExpr: startsExpr }), + "this": new KeywordTokenType("this", { startsExpr: startsExpr }), + "super": new KeywordTokenType("super", { startsExpr: startsExpr }), + "class": new KeywordTokenType("class"), + "extends": new KeywordTokenType("extends", { beforeExpr: beforeExpr }), + "export": new KeywordTokenType("export"), + "import": new KeywordTokenType("import"), + "yield": new KeywordTokenType("yield", { beforeExpr: beforeExpr, startsExpr: startsExpr }), + "null": new KeywordTokenType("null", { startsExpr: startsExpr }), + "true": new KeywordTokenType("true", { startsExpr: startsExpr }), + "false": new KeywordTokenType("false", { startsExpr: startsExpr }), + "in": new KeywordTokenType("in", { beforeExpr: beforeExpr, binop: 7 }), + "instanceof": new KeywordTokenType("instanceof", { beforeExpr: beforeExpr, binop: 7 }), + "typeof": new KeywordTokenType("typeof", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }), + "void": new KeywordTokenType("void", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }), + "delete": new KeywordTokenType("delete", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }) +}; + +// Map keyword names to token types. +Object.keys(keywords).forEach(function (name) { + types["_" + name] = keywords[name]; +}); + +// Matches a whole line break (where CRLF is considered a single +// line break). Used to count lines. + +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); + +function isNewLine(code) { + return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; +} + +var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + +// The algorithm used to determine whether a regexp can appear at a +// given point in the program is loosely based on sweet.js' approach. +// See https://github.com/mozilla/sweet.js/wiki/design + +var TokContext = function TokContext(token, isExpr, preserveSpace, override) { + classCallCheck(this, TokContext); + + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; +}; + +var types$1 = { + braceStatement: new TokContext("{", false), + braceExpression: new TokContext("{", true), + templateQuasi: new TokContext("${", true), + parenStatement: new TokContext("(", false), + parenExpression: new TokContext("(", true), + template: new TokContext("`", true, true, function (p) { + return p.readTmplToken(); + }), + functionExpression: new TokContext("function", true) +}; + +// Token-specific context update code + +types.parenR.updateContext = types.braceR.updateContext = function () { + if (this.state.context.length === 1) { + this.state.exprAllowed = true; + return; + } + + var out = this.state.context.pop(); + if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) { + this.state.context.pop(); + this.state.exprAllowed = false; + } else if (out === types$1.templateQuasi) { + this.state.exprAllowed = true; + } else { + this.state.exprAllowed = !out.isExpr; + } +}; + +types.name.updateContext = function (prevType) { + this.state.exprAllowed = false; + + if (prevType === types._let || prevType === types._const || prevType === types._var) { + if (lineBreak.test(this.input.slice(this.state.end))) { + this.state.exprAllowed = true; + } + } +}; + +types.braceL.updateContext = function (prevType) { + this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression); + this.state.exprAllowed = true; +}; + +types.dollarBraceL.updateContext = function () { + this.state.context.push(types$1.templateQuasi); + this.state.exprAllowed = true; +}; + +types.parenL.updateContext = function (prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression); + this.state.exprAllowed = true; +}; + +types.incDec.updateContext = function () { + // tokExprAllowed stays unchanged +}; + +types._function.updateContext = function () { + if (this.curContext() !== types$1.braceStatement) { + this.state.context.push(types$1.functionExpression); + } + + this.state.exprAllowed = false; +}; + +types.backQuote.updateContext = function () { + if (this.curContext() === types$1.template) { + this.state.context.pop(); + } else { + this.state.context.push(types$1.template); + } + this.state.exprAllowed = false; +}; + +// These are used when `options.locations` is on, for the +// `startLoc` and `endLoc` properties. + +var Position = function Position(line, col) { + classCallCheck(this, Position); + + this.line = line; + this.column = col; +}; + +var SourceLocation = function SourceLocation(start, end) { + classCallCheck(this, SourceLocation); + + this.start = start; + this.end = end; +}; + +// The `getLineInfo` function is mostly useful when the +// `locations` option is off (for performance reasons) and you +// want to find the line/column position for a given character +// offset. `input` should be the code string that the offset refers +// into. + +function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur); + } + } +} + +var State = function () { + function State() { + classCallCheck(this, State); + } + + State.prototype.init = function init(options, input) { + this.strict = options.strictMode === false ? false : options.sourceType === "module"; + + this.input = input; + + this.potentialArrowAt = -1; + + this.inMethod = this.inFunction = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.noAnonFunctionType = false; + + this.labels = []; + + this.decorators = []; + + this.tokens = []; + + this.comments = []; + + this.trailingComments = []; + this.leadingComments = []; + this.commentStack = []; + + this.pos = this.lineStart = 0; + this.curLine = options.startLine; + + this.type = types.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); + + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + this.context = [types$1.braceStatement]; + this.exprAllowed = true; + + this.containsEsc = this.containsOctal = false; + this.octalPosition = null; + + this.exportedIdentifiers = []; + + return this; + }; + + // TODO + + + // TODO + + + // Used to signify the start of a potential arrow function + + + // Flags to track whether we are in a function, a generator. + + + // Labels in scope. + + + // Leading decorators. + + + // Token store. + + + // Comment store. + + + // Comment attachment store + + + // The current position of the tokenizer in the input. + + + // Properties of the current token: + // Its type + + + // For tokens that include more information than their type, the value + + + // Its start and end offset + + + // And, if locations are used, the {line, column} object + // corresponding to those offsets + + + // Position information for the previous token + + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + + + // TODO + + + // Names of exports store. `default` is stored as a name for both + // `export default foo;` and `export { foo as default };`. + + + State.prototype.curPosition = function curPosition() { + return new Position(this.curLine, this.pos - this.lineStart); + }; + + State.prototype.clone = function clone(skipArrays) { + var state = new State(); + for (var key in this) { + var val = this[key]; + + if ((!skipArrays || key === "context") && Array.isArray(val)) { + val = val.slice(); + } + + state[key] = val; + } + return state; + }; + + return State; +}(); + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + +var Token = function Token(state) { + classCallCheck(this, Token); + + this.type = state.type; + this.value = state.value; + this.start = state.start; + this.end = state.end; + this.loc = new SourceLocation(state.startLoc, state.endLoc); +}; + +// ## Tokenizer + +function codePointToString(code) { + // UTF-16 Decoding + if (code <= 0xFFFF) { + return String.fromCharCode(code); + } else { + return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00); + } +} + +var Tokenizer = function () { + function Tokenizer(options, input) { + classCallCheck(this, Tokenizer); + + this.state = new State(); + this.state.init(options, input); + } + + // Move to the next token + + Tokenizer.prototype.next = function next() { + if (!this.isLookahead) { + this.state.tokens.push(new Token(this.state)); + } + + this.state.lastTokEnd = this.state.end; + this.state.lastTokStart = this.state.start; + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + }; + + // TODO + + Tokenizer.prototype.eat = function eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + }; + + // TODO + + Tokenizer.prototype.match = function match(type) { + return this.state.type === type; + }; + + // TODO + + Tokenizer.prototype.isKeyword = function isKeyword$$1(word) { + return isKeyword(word); + }; + + // TODO + + Tokenizer.prototype.lookahead = function lookahead() { + var old = this.state; + this.state = old.clone(true); + + this.isLookahead = true; + this.next(); + this.isLookahead = false; + + var curr = this.state.clone(true); + this.state = old; + return curr; + }; + + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + Tokenizer.prototype.setStrict = function setStrict(strict) { + this.state.strict = strict; + if (!this.match(types.num) && !this.match(types.string)) return; + this.state.pos = this.state.start; + while (this.state.pos < this.state.lineStart) { + this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; + --this.state.curLine; + } + this.nextToken(); + }; + + Tokenizer.prototype.curContext = function curContext() { + return this.state.context[this.state.context.length - 1]; + }; + + // Read a single token, updating the parser object's token-related + // properties. + + Tokenizer.prototype.nextToken = function nextToken() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) this.skipSpace(); + + this.state.containsOctal = false; + this.state.octalPosition = null; + this.state.start = this.state.pos; + this.state.startLoc = this.state.curPosition(); + if (this.state.pos >= this.input.length) return this.finishToken(types.eof); + + if (curContext.override) { + return curContext.override(this); + } else { + return this.readToken(this.fullCharCodeAtPos()); + } + }; + + Tokenizer.prototype.readToken = function readToken(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code) || code === 92 /* '\' */) { + return this.readWord(); + } else { + return this.getTokenFromCode(code); + } + }; + + Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() { + var code = this.input.charCodeAt(this.state.pos); + if (code <= 0xd7ff || code >= 0xe000) return code; + + var next = this.input.charCodeAt(this.state.pos + 1); + return (code << 10) + next - 0x35fdc00; + }; + + Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "CommentBlock" : "CommentLine", + value: text, + start: start, + end: end, + loc: new SourceLocation(startLoc, endLoc) + }; + + if (!this.isLookahead) { + this.state.tokens.push(comment); + this.state.comments.push(comment); + this.addComment(comment); + } + }; + + Tokenizer.prototype.skipBlockComment = function skipBlockComment() { + var startLoc = this.state.curPosition(); + var start = this.state.pos; + var end = this.input.indexOf("*/", this.state.pos += 2); + if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); + + this.state.pos = end + 2; + lineBreakG.lastIndex = start; + var match = void 0; + while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) { + ++this.state.curLine; + this.state.lineStart = match.index + match[0].length; + } + + this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); + }; + + Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) { + var start = this.state.pos; + var startLoc = this.state.curPosition(); + var ch = this.input.charCodeAt(this.state.pos += startSkip); + while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { + ++this.state.pos; + ch = this.input.charCodeAt(this.state.pos); + } + + this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); + }; + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + Tokenizer.prototype.skipSpace = function skipSpace() { + loop: while (this.state.pos < this.input.length) { + var ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 32:case 160: + // ' ' + ++this.state.pos; + break; + + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + + case 10:case 8232:case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + + case 47: + // '/' + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + // '*' + this.skipBlockComment(); + break; + + case 47: + this.skipLineComment(2); + break; + + default: + break loop; + } + break; + + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.state.pos; + } else { + break loop; + } + } + } + }; + + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + Tokenizer.prototype.finishToken = function finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + var prevType = this.state.type; + this.state.type = type; + this.state.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + + + Tokenizer.prototype.readToken_dot = function readToken_dot() { + var next = this.input.charCodeAt(this.state.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + + var next2 = this.input.charCodeAt(this.state.pos + 2); + if (next === 46 && next2 === 46) { + // 46 = dot '.' + this.state.pos += 3; + return this.finishToken(types.ellipsis); + } else { + ++this.state.pos; + return this.finishToken(types.dot); + } + }; + + Tokenizer.prototype.readToken_slash = function readToken_slash() { + // '/' + if (this.state.exprAllowed) { + ++this.state.pos; + return this.readRegexp(); + } + + var next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + return this.finishOp(types.assign, 2); + } else { + return this.finishOp(types.slash, 1); + } + }; + + Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) { + // '%*' + var type = code === 42 ? types.star : types.modulo; + var width = 1; + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 42) { + // '*' + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = types.exponent; + } + + if (next === 61) { + width++; + type = types.assign; + } + + return this.finishOp(type, width); + }; + + Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) { + // '|&' + var next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); + if (next === 61) return this.finishOp(types.assign, 2); + if (code === 124 && next === 125 && this.hasPlugin("flow")) return this.finishOp(types.braceBarR, 2); + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); + }; + + Tokenizer.prototype.readToken_caret = function readToken_caret() { + // '^' + var next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + return this.finishOp(types.assign, 2); + } else { + return this.finishOp(types.bitwiseXOR, 1); + } + }; + + Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) { + // '+-' + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === code) { + if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(types.incDec, 2); + } + + if (next === 61) { + return this.finishOp(types.assign, 2); + } else { + return this.finishOp(types.plusMin, 1); + } + }; + + Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) { + // '<>' + var next = this.input.charCodeAt(this.state.pos + 1); + var size = 1; + + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(types.assign, size + 1); + return this.finishOp(types.bitShift, size); + } + + if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { + if (this.inModule) this.unexpected(); + // ` + +```js +var compressible = require('compressible') +``` + +### compressible(type) + +Checks if the given `Content-Type` is compressible. The `type` argument is expected +to be a value MIME type or `Content-Type` string, though no validation is performed. + +The MIME is looked up in the [`mime-db`](https://www.npmjs.com/package/mime-db) and +if there is compressible information in the database entry, that is returned. Otherwise, +this module will fallback to `true` for the following types: + + * `text/*` + * `*/*+json` + * `*/*+text` + * `*/*+xml` + +If this module is not sure if a type is specifically compressible or specifically +uncompressible, `undefined` is returned. + + + +```js +compressible('text/html') // => true +compressible('image/png') // => false +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/compressible.svg +[npm-url]: https://npmjs.org/package/compressible +[node-version-image]: https://img.shields.io/node/v/compressible.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/compressible/master.svg +[travis-url]: https://travis-ci.org/jshttp/compressible +[coveralls-image]: https://img.shields.io/coveralls/jshttp/compressible/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/compressible?branch=master +[downloads-image]: https://img.shields.io/npm/dm/compressible.svg +[downloads-url]: https://npmjs.org/package/compressible diff --git a/node_modules/compressible/index.js b/node_modules/compressible/index.js new file mode 100755 index 00000000..bf14ad72 --- /dev/null +++ b/node_modules/compressible/index.js @@ -0,0 +1,58 @@ +/*! + * compressible + * Copyright(c) 2013 Jonathan Ong + * Copyright(c) 2014 Jeremiah Senkpiel + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var db = require('mime-db') + +/** + * Module variables. + * @private + */ + +var compressibleTypeRegExp = /^text\/|\+json$|\+text$|\+xml$/i +var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/ + +/** + * Module exports. + * @public + */ + +module.exports = compressible + +/** + * Checks if a type is compressible. + * + * @param {string} type + * @return {Boolean} compressible + * @public + */ + +function compressible (type) { + if (!type || typeof type !== 'string') { + return false + } + + // strip parameters + var match = extractTypeRegExp.exec(type) + var mime = match && match[1].toLowerCase() + var data = db[mime] + + // return database information + if (data && data.compressible !== undefined) { + return data.compressible + } + + // fallback to regexp or unknown + return compressibleTypeRegExp.test(mime) || undefined +} diff --git a/node_modules/compressible/package.json b/node_modules/compressible/package.json new file mode 100755 index 00000000..e1274182 --- /dev/null +++ b/node_modules/compressible/package.json @@ -0,0 +1,147 @@ +{ + "_args": [ + [ + { + "raw": "compressible@~2.0.8", + "scope": null, + "escapedName": "compressible", + "name": "compressible", + "rawSpec": "~2.0.8", + "spec": ">=2.0.8 <2.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression" + ] + ], + "_from": "compressible@>=2.0.8 <2.1.0", + "_id": "compressible@2.0.10", + "_inCache": true, + "_location": "/compressible", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/compressible-2.0.10.tgz_1490330888540_0.3248714415822178" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "compressible@~2.0.8", + "scope": null, + "escapedName": "compressible", + "name": "compressible", + "rawSpec": "~2.0.8", + "spec": ">=2.0.8 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/compression" + ], + "_resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.10.tgz", + "_shasum": "feda1c7f7617912732b29bf8cf26252a20b9eecd", + "_shrinkwrap": null, + "_spec": "compressible@~2.0.8", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression", + "bugs": { + "url": "https://github.com/jshttp/compressible/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + { + "name": "Jeremiah Senkpiel", + "email": "fishrock123@rocketmail.com", + "url": "https://searchbeam.jit.su" + } + ], + "dependencies": { + "mime-db": ">= 1.27.0 < 2" + }, + "description": "Compressible Content-Type / mime checking", + "devDependencies": { + "eslint": "3.18.0", + "eslint-config-standard": "7.1.0", + "eslint-plugin-markdown": "1.0.0-beta.4", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "2.1.1", + "istanbul": "0.4.5", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "feda1c7f7617912732b29bf8cf26252a20b9eecd", + "tarball": "https://registry.npmjs.org/compressible/-/compressible-2.0.10.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "gitHead": "235bc74b36aa7fe854df88ce2c68242c0a4ca938", + "homepage": "https://github.com/jshttp/compressible#readme", + "keywords": [ + "compress", + "gzip", + "mime", + "content-type" + ], + "license": "MIT", + "maintainers": [ + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "federomero", + "email": "federomero@gmail.com" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "mscdex", + "email": "mscdex@mscdex.net" + }, + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "name": "compressible", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/compressible.git" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --check-leaks" + }, + "version": "2.0.10" +} diff --git a/node_modules/compression/HISTORY.md b/node_modules/compression/HISTORY.md new file mode 100755 index 00000000..663f0de0 --- /dev/null +++ b/node_modules/compression/HISTORY.md @@ -0,0 +1,251 @@ +1.6.2 / 2016-05-12 +================== + + * deps: accepts@~1.3.3 + - deps: mime-types@~2.1.11 + - deps: negotiator@0.6.1 + * deps: bytes@2.3.0 + - Drop partial bytes on all parsed units + - Fix parsing byte string that looks like hex + - perf: hoist regular expressions + * deps: compressible@~2.0.8 + - deps: mime-db@'>= 1.23.0 < 2' + +1.6.1 / 2016-01-19 +================== + + * deps: bytes@2.2.0 + * deps: compressible@~2.0.7 + - deps: mime-db@'>= 1.21.0 < 2' + * deps: accepts@~1.3.1 + - deps: mime-types@~2.1.9 + +1.6.0 / 2015-09-29 +================== + + * Skip compression when response has `Cache-Control: no-transform` + * deps: accepts@~1.3.0 + - deps: mime-types@~2.1.7 + - deps: negotiator@0.6.0 + * deps: compressible@~2.0.6 + - deps: mime-db@'>= 1.19.0 < 2' + * deps: on-headers@~1.0.1 + - perf: enable strict mode + * deps: vary@~1.1.0 + - Only accept valid field names in the `field` argument + +1.5.2 / 2015-07-30 +================== + + * deps: accepts@~1.2.12 + - deps: mime-types@~2.1.4 + * deps: compressible@~2.0.5 + - deps: mime-db@'>= 1.16.0 < 2' + * deps: vary@~1.0.1 + - Fix setting empty header from empty `field` + - perf: enable strict mode + - perf: remove argument reassignments + +1.5.1 / 2015-07-05 +================== + + * deps: accepts@~1.2.10 + - deps: mime-types@~2.1.2 + * deps: compressible@~2.0.4 + - deps: mime-db@'>= 1.14.0 < 2' + - perf: enable strict mode + +1.5.0 / 2015-06-09 +================== + + * Fix return value from `.end` and `.write` after end + * Improve detection of zero-length body without `Content-Length` + * deps: accepts@~1.2.9 + - deps: mime-types@~2.1.1 + - perf: avoid argument reassignment & argument slice + - perf: avoid negotiator recursive construction + - perf: enable strict mode + - perf: remove unnecessary bitwise operator + * deps: bytes@2.1.0 + - Slight optimizations + - Units no longer case sensitive when parsing + * deps: compressible@~2.0.3 + - Fix regex fallback to work if type exists, but is undefined + - deps: mime-db@'>= 1.13.0 < 2' + - perf: hoist regex declaration + - perf: use regex to extract mime + * perf: enable strict mode + * perf: remove flush reassignment + * perf: simplify threshold detection + +1.4.4 / 2015-05-11 +================== + + * deps: accepts@~1.2.7 + - deps: mime-types@~2.0.11 + - deps: negotiator@0.5.3 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +1.4.3 / 2015-03-14 +================== + + * deps: accepts@~1.2.5 + - deps: mime-types@~2.0.10 + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +1.4.2 / 2015-03-11 +================== + + * Fix error when code calls `res.end(str, encoding)` + - Specific to Node.js 0.8 + * deps: debug@~2.1.2 + - deps: ms@0.7.0 + +1.4.1 / 2015-02-15 +================== + + * deps: accepts@~1.2.4 + - deps: mime-types@~2.0.9 + - deps: negotiator@0.5.1 + +1.4.0 / 2015-02-01 +================== + + * Prefer `gzip` over `deflate` on the server + - Not all clients agree on what "deflate" coding means + +1.3.1 / 2015-01-31 +================== + + * deps: accepts@~1.2.3 + - deps: mime-types@~2.0.8 + * deps: compressible@~2.0.2 + - deps: mime-db@'>= 1.1.2 < 2' + +1.3.0 / 2014-12-30 +================== + + * Export the default `filter` function for wrapping + * deps: accepts@~1.2.2 + - deps: mime-types@~2.0.7 + - deps: negotiator@0.5.0 + * deps: debug@~2.1.1 + +1.2.2 / 2014-12-10 +================== + + * Fix `.end` to only proxy to `.end` + - Fixes an issue with Node.js 0.11.14 + * deps: accepts@~1.1.4 + - deps: mime-types@~2.0.4 + +1.2.1 / 2014-11-23 +================== + + * deps: accepts@~1.1.3 + - deps: mime-types@~2.0.3 + +1.2.0 / 2014-10-16 +================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + +1.1.2 / 2014-10-15 +================== + + * deps: accepts@~1.1.2 + - Fix error when media type has invalid parameter + - deps: negotiator@0.4.9 + +1.1.1 / 2014-10-12 +================== + + * deps: accepts@~1.1.1 + - deps: mime-types@~2.0.2 + - deps: negotiator@0.4.8 + * deps: compressible@~2.0.1 + - deps: mime-db@1.x + +1.1.0 / 2014-09-07 +================== + + * deps: accepts@~1.1.0 + * deps: compressible@~2.0.0 + * deps: debug@~2.0.0 + +1.0.11 / 2014-08-10 +=================== + + * deps: on-headers@~1.0.0 + * deps: vary@~1.0.0 + +1.0.10 / 2014-08-05 +=================== + + * deps: compressible@~1.1.1 + - Fix upper-case Content-Type characters prevent compression + +1.0.9 / 2014-07-20 +================== + + * Add `debug` messages + * deps: accepts@~1.0.7 + - deps: negotiator@0.4.7 + +1.0.8 / 2014-06-20 +================== + + * deps: accepts@~1.0.5 + - use `mime-types` + +1.0.7 / 2014-06-11 +================== + + * use vary module for better `Vary` behavior + * deps: accepts@1.0.3 + * deps: compressible@1.1.0 + +1.0.6 / 2014-06-03 +================== + + * fix regression when negotiation fails + +1.0.5 / 2014-06-03 +================== + + * fix listeners for delayed stream creation + - fixes regression for certain `stream.pipe(res)` situations + +1.0.4 / 2014-06-03 +================== + + * fix adding `Vary` when value stored as array + * fix back-pressure behavior + * fix length check for `res.end` + +1.0.3 / 2014-05-29 +================== + + * use `accepts` for negotiation + * use `on-headers` to handle header checking + * deps: bytes@1.0.0 + +1.0.2 / 2014-04-29 +================== + + * only version compatible with node.js 0.8 + * support headers given to `res.writeHead` + * deps: bytes@0.3.0 + * deps: negotiator@0.4.3 + +1.0.1 / 2014-03-08 +================== + + * bump negotiator + * use compressible + * use .headersSent (drops 0.8 support) + * handle identity;q=0 case diff --git a/node_modules/compression/LICENSE b/node_modules/compression/LICENSE new file mode 100755 index 00000000..386b7b69 --- /dev/null +++ b/node_modules/compression/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/compression/README.md b/node_modules/compression/README.md new file mode 100755 index 00000000..a5d599db --- /dev/null +++ b/node_modules/compression/README.md @@ -0,0 +1,233 @@ +# compression + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![Gratipay][gratipay-image]][gratipay-url] + +Node.js compression middleware. + +The following compression codings are supported: + + - deflate + - gzip + +## Install + +```bash +$ npm install compression +``` + +## API + +```js +var compression = require('compression') +``` + +### compression([options]) + +Returns the compression middleware using the given `options`. The middleware +will attempt to compress response bodies for all request that traverse through +the middleware, based on the given `options`. + +This middleware will never compress responses that include a `Cache-Control` +header with the [`no-transform` directive](https://tools.ietf.org/html/rfc7234#section-5.2.2.4), +as compressing will transform the body. + +#### Options + +`compression()` accepts these properties in the options object. In addition to +those listed below, [zlib](http://nodejs.org/api/zlib.html) options may be +passed in to the options object. + +##### chunkSize + +The default value is `zlib.Z_DEFAULT_CHUNK`, or `16384`. + +See [Node.js documentation](http://nodejs.org/api/zlib.html#zlib_memory_usage_tuning) +regarding the usage. + +##### filter + +A function to decide if the response should be considered for compression. +This function is called as `filter(req, res)` and is expected to return +`true` to consider the response for compression, or `false` to not compress +the response. + +The default filter function uses the [compressible](https://www.npmjs.com/package/compressible) +module to determine if `res.getHeader('Content-Type')` is compressible. + +##### level + +The level of zlib compression to apply to responses. A higher level will result +in better compression, but will take longer to complete. A lower level will +result in less compression, but will be much faster. + +This is an integer in the range of `0` (no compression) to `9` (maximum +compression). The special value `-1` can be used to mean the "default +compression level", which is a default compromise between speed and +compression (currently equivalent to level 6). + + - `-1` Default compression level (also `zlib.Z_DEFAULT_COMPRESSION`). + - `0` No compression (also `zlib.Z_NO_COMPRESSION`). + - `1` Fastest compression (also `zlib.Z_BEST_SPEED`). + - `2` + - `3` + - `4` + - `5` + - `6` (currently what `zlib.Z_DEFAULT_COMPRESSION` points to). + - `7` + - `8` + - `9` Best compression (also `zlib.Z_BEST_COMPRESSION`). + +The default value is `zlib.Z_DEFAULT_COMPRESSION`, or `-1`. + +**Note** in the list above, `zlib` is from `zlib = require('zlib')`. + +##### memLevel + +This specifies how much memory should be allocated for the internal compression +state and is an integer in the range of `1` (minimum level) and `9` (maximum +level). + +The default value is `zlib.Z_DEFAULT_MEMLEVEL`, or `8`. + +See [Node.js documentation](http://nodejs.org/api/zlib.html#zlib_memory_usage_tuning) +regarding the usage. + +##### strategy + +This is used to tune the compression algorithm. This value only affects the +compression ratio, not the correctness of the compressed output, even if it +is not set appropriately. + + - `zlib.Z_DEFAULT_STRATEGY` Use for normal data. + - `zlib.Z_FILTERED` Use for data produced by a filter (or predictor). + Filtered data consists mostly of small values with a somewhat random + distribution. In this case, the compression algorithm is tuned to + compress them better. The effect is to force more Huffman coding and less + string matching; it is somewhat intermediate between `zlib.Z_DEFAULT_STRATEGY` + and `zlib.Z_HUFFMAN_ONLY`. + - `zlib.Z_FIXED` Use to prevent the use of dynamic Huffman codes, allowing + for a simpler decoder for special applications. + - `zlib.Z_HUFFMAN_ONLY` Use to force Huffman encoding only (no string match). + - `zlib.Z_RLE` Use to limit match distances to one (run-length encoding). + This is designed to be almost as fast as `zlib.Z_HUFFMAN_ONLY`, but give + better compression for PNG image data. + +**Note** in the list above, `zlib` is from `zlib = require('zlib')`. + +##### threshold + +The byte threshold for the response body size before compression is considered +for the response, defaults to `1kb`. This is a number of bytes, any string +accepted by the [bytes](https://www.npmjs.com/package/bytes) module, or `false`. + +**Note** this is only an advisory setting; if the response size cannot be determined +at the time the response headers are written, then it is assumed the response is +_over_ the threshold. To guarantee the response size can be determined, be sure +set a `Content-Length` response header. + +##### windowBits + +The default value is `zlib.Z_DEFAULT_WINDOWBITS`, or `15`. + +See [Node.js documentation](http://nodejs.org/api/zlib.html#zlib_memory_usage_tuning) +regarding the usage. + +#### .filter + +The default `filter` function. This is used to construct a custom filter +function that is an extension of the default function. + +```js +app.use(compression({filter: shouldCompress})) + +function shouldCompress(req, res) { + if (req.headers['x-no-compression']) { + // don't compress responses with this request header + return false + } + + // fallback to standard filter function + return compression.filter(req, res) +} +``` + +### res.flush + +This module adds a `res.flush()` method to force the partially-compressed +response to be flushed to the client. + +## Examples + +### express/connect + +When using this module with express or connect, simply `app.use` the module as +high as you like. Requests that pass through the middleware will be compressed. + +```js +var compression = require('compression') +var express = require('express') + +var app = express() + +// compress all requests +app.use(compression()) + +// add all routes +``` + +### Server-Sent Events + +Because of the nature of compression this module does not work out of the box +with server-sent events. To compress content, a window of the output needs to +be buffered up in order to get good compression. Typically when using server-sent +events, there are certain block of data that need to reach the client. + +You can achieve this by calling `res.flush()` when you need the data written to +actually make it to the client. + +```js +var compression = require('compression') +var express = require('express') + +var app = express() + +// compress responses +app.use(compression()) + +// server-sent event stream +app.get('/events', function (req, res) { + res.setHeader('Content-Type', 'text/event-stream') + res.setHeader('Cache-Control', 'no-cache') + + // send a ping approx every 2 seconds + var timer = setInterval(function () { + res.write('data: ping\n\n') + + // !!! this is the important part + res.flush() + }, 2000) + + res.on('close', function () { + clearInterval(timer) + }) +}) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/compression.svg +[npm-url]: https://npmjs.org/package/compression +[travis-image]: https://img.shields.io/travis/expressjs/compression/master.svg +[travis-url]: https://travis-ci.org/expressjs/compression +[coveralls-image]: https://img.shields.io/coveralls/expressjs/compression/master.svg +[coveralls-url]: https://coveralls.io/r/expressjs/compression?branch=master +[downloads-image]: https://img.shields.io/npm/dm/compression.svg +[downloads-url]: https://npmjs.org/package/compression +[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg +[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/node_modules/compression/index.js b/node_modules/compression/index.js new file mode 100755 index 00000000..c0e801e7 --- /dev/null +++ b/node_modules/compression/index.js @@ -0,0 +1,276 @@ +/*! + * compression + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var accepts = require('accepts') +var bytes = require('bytes') +var compressible = require('compressible') +var debug = require('debug')('compression') +var onHeaders = require('on-headers') +var vary = require('vary') +var zlib = require('zlib') + +/** + * Module exports. + */ + +module.exports = compression +module.exports.filter = shouldCompress + +/** + * Module variables. + * @private + */ + +var cacheControlNoTransformRegExp = /(?:^|,)\s*?no-transform\s*?(?:,|$)/ + +/** + * Compress response data with gzip / deflate. + * + * @param {Object} [options] + * @return {Function} middleware + * @public + */ + +function compression (options) { + var opts = options || {} + + // options + var filter = opts.filter || shouldCompress + var threshold = bytes.parse(opts.threshold) + + if (threshold == null) { + threshold = 1024 + } + + return function compression (req, res, next) { + var ended = false + var length + var listeners = [] + var stream + + var _end = res.end + var _on = res.on + var _write = res.write + + // flush + res.flush = function flush () { + if (stream) { + stream.flush() + } + } + + // proxy + + res.write = function write (chunk, encoding) { + if (ended) { + return false + } + + if (!this._header) { + this._implicitHeader() + } + + return stream + ? stream.write(new Buffer(chunk, encoding)) + : _write.call(this, chunk, encoding) + } + + res.end = function end (chunk, encoding) { + if (ended) { + return false + } + + if (!this._header) { + // estimate the length + if (!this.getHeader('Content-Length')) { + length = chunkLength(chunk, encoding) + } + + this._implicitHeader() + } + + if (!stream) { + return _end.call(this, chunk, encoding) + } + + // mark ended + ended = true + + // write Buffer for Node.js 0.8 + return chunk + ? stream.end(new Buffer(chunk, encoding)) + : stream.end() + } + + res.on = function on (type, listener) { + if (!listeners || type !== 'drain') { + return _on.call(this, type, listener) + } + + if (stream) { + return stream.on(type, listener) + } + + // buffer listeners for future stream + listeners.push([type, listener]) + + return this + } + + function nocompress (msg) { + debug('no compression: %s', msg) + addListeners(res, _on, listeners) + listeners = null + } + + onHeaders(res, function onResponseHeaders () { + // determine if request is filtered + if (!filter(req, res)) { + nocompress('filtered') + return + } + + // determine if the entity should be transformed + if (!shouldTransform(req, res)) { + nocompress('no transform') + return + } + + // vary + vary(res, 'Accept-Encoding') + + // content-length below threshold + if (Number(res.getHeader('Content-Length')) < threshold || length < threshold) { + nocompress('size below threshold') + return + } + + var encoding = res.getHeader('Content-Encoding') || 'identity' + + // already encoded + if (encoding !== 'identity') { + nocompress('already encoded') + return + } + + // head + if (req.method === 'HEAD') { + nocompress('HEAD request') + return + } + + // compression method + var accept = accepts(req) + var method = accept.encoding(['gzip', 'deflate', 'identity']) + + // we really don't prefer deflate + if (method === 'deflate' && accept.encoding(['gzip'])) { + method = accept.encoding(['gzip', 'identity']) + } + + // negotiation failed + if (!method || method === 'identity') { + nocompress('not acceptable') + return + } + + // compression stream + debug('%s compression', method) + stream = method === 'gzip' + ? zlib.createGzip(opts) + : zlib.createDeflate(opts) + + // add buffered listeners to stream + addListeners(stream, stream.on, listeners) + + // header fields + res.setHeader('Content-Encoding', method) + res.removeHeader('Content-Length') + + // compression + stream.on('data', function onStreamData (chunk) { + if (_write.call(res, chunk) === false) { + stream.pause() + } + }) + + stream.on('end', function onStreamEnd () { + _end.call(res) + }) + + _on.call(res, 'drain', function onResponseDrain () { + stream.resume() + }) + }) + + next() + } +} + +/** + * Add bufferred listeners to stream + * @private + */ + +function addListeners (stream, on, listeners) { + for (var i = 0; i < listeners.length; i++) { + on.apply(stream, listeners[i]) + } +} + +/** + * Get the length of a given chunk + */ + +function chunkLength (chunk, encoding) { + if (!chunk) { + return 0 + } + + return !Buffer.isBuffer(chunk) + ? Buffer.byteLength(chunk, encoding) + : chunk.length +} + +/** + * Default filter function. + * @private + */ + +function shouldCompress (req, res) { + var type = res.getHeader('Content-Type') + + if (type === undefined || !compressible(type)) { + debug('%s not compressible', type) + return false + } + + return true +} + +/** + * Determine if the entity should be transformed. + * @private + */ + +function shouldTransform (req, res) { + var cacheControl = res.getHeader('Cache-Control') + + // Don't compress for Cache-Control: no-transform + // https://tools.ietf.org/html/rfc7234#section-5.2.2.4 + return !cacheControl || + !cacheControlNoTransformRegExp.test(cacheControl) +} diff --git a/node_modules/compression/node_modules/debug/.jshintrc b/node_modules/compression/node_modules/debug/.jshintrc new file mode 100755 index 00000000..299877f2 --- /dev/null +++ b/node_modules/compression/node_modules/debug/.jshintrc @@ -0,0 +1,3 @@ +{ + "laxbreak": true +} diff --git a/node_modules/compression/node_modules/debug/.npmignore b/node_modules/compression/node_modules/debug/.npmignore new file mode 100755 index 00000000..7e6163db --- /dev/null +++ b/node_modules/compression/node_modules/debug/.npmignore @@ -0,0 +1,6 @@ +support +test +examples +example +*.sock +dist diff --git a/node_modules/compression/node_modules/debug/History.md b/node_modules/compression/node_modules/debug/History.md new file mode 100755 index 00000000..854c9711 --- /dev/null +++ b/node_modules/compression/node_modules/debug/History.md @@ -0,0 +1,195 @@ + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/compression/node_modules/debug/Makefile b/node_modules/compression/node_modules/debug/Makefile new file mode 100755 index 00000000..5cf4a596 --- /dev/null +++ b/node_modules/compression/node_modules/debug/Makefile @@ -0,0 +1,36 @@ + +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# applications +NODE ?= $(shell which node) +NPM ?= $(NODE) $(shell which npm) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +all: dist/debug.js + +install: node_modules + +clean: + @rm -rf dist + +dist: + @mkdir -p $@ + +dist/debug.js: node_modules browser.js debug.js dist + @$(BROWSERIFY) \ + --standalone debug \ + . > $@ + +distclean: clean + @rm -rf node_modules + +node_modules: package.json + @NODE_ENV= $(NPM) install + @touch node_modules + +.PHONY: all install clean distclean diff --git a/node_modules/compression/node_modules/debug/Readme.md b/node_modules/compression/node_modules/debug/Readme.md new file mode 100755 index 00000000..b4f45e3c --- /dev/null +++ b/node_modules/compression/node_modules/debug/Readme.md @@ -0,0 +1,188 @@ +# debug + + tiny node.js debugging utility modelled after node core's debugging technique. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + + With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Browser support + + Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: + +```js +window.myDebug = require("debug"); +``` + + ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: + +```js +myDebug.enable("worker:*") +``` + + Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + +### stderr vs stdout + +You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +### Save debug output to a file + +You can save all debug statements to a file by piping them. + +Example: + +```bash +$ DEBUG_FD=3 node your-app.js 3> whatever.log +``` + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + +## License + +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/compression/node_modules/debug/bower.json b/node_modules/compression/node_modules/debug/bower.json new file mode 100755 index 00000000..6af573ff --- /dev/null +++ b/node_modules/compression/node_modules/debug/bower.json @@ -0,0 +1,28 @@ +{ + "name": "visionmedia-debug", + "main": "dist/debug.js", + "version": "2.2.0", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/compression/node_modules/debug/browser.js b/node_modules/compression/node_modules/debug/browser.js new file mode 100755 index 00000000..7c764522 --- /dev/null +++ b/node_modules/compression/node_modules/debug/browser.js @@ -0,0 +1,168 @@ + +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + return ('WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + return JSON.stringify(v); +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage(){ + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/compression/node_modules/debug/component.json b/node_modules/compression/node_modules/debug/component.json new file mode 100755 index 00000000..ca106372 --- /dev/null +++ b/node_modules/compression/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.2.0", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "browser.js", + "scripts": [ + "browser.js", + "debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/compression/node_modules/debug/debug.js b/node_modules/compression/node_modules/debug/debug.js new file mode 100755 index 00000000..7571a860 --- /dev/null +++ b/node_modules/compression/node_modules/debug/debug.js @@ -0,0 +1,197 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = debug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + +exports.formatters = {}; + +/** + * Previously assigned color. + */ + +var prevColor = 0; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * + * @return {Number} + * @api private + */ + +function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = Array.prototype.slice.call(arguments); + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + if ('function' === typeof exports.formatArgs) { + args = exports.formatArgs.apply(self, args); + } + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/compression/node_modules/debug/node.js b/node_modules/compression/node_modules/debug/node.js new file mode 100755 index 00000000..1d392a81 --- /dev/null +++ b/node_modules/compression/node_modules/debug/node.js @@ -0,0 +1,209 @@ + +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); + if (0 === debugColors.length) { + return tty.isatty(fd); + } else { + return '0' !== debugColors + && 'no' !== debugColors + && 'false' !== debugColors + && 'disabled' !== debugColors; + } +} + +/** + * Map %o to `util.inspect()`, since Node doesn't do that out of the box. + */ + +var inspect = (4 === util.inspect.length ? + // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } : + // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + } +); + +exports.formatters.o = function(v) { + return inspect(v, this.useColors) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + var name = this.namespace; + + if (useColors) { + var c = this.color; + + args[0] = ' \u001b[3' + c + ';1m' + name + ' ' + + '\u001b[0m' + + args[0] + '\u001b[3' + c + 'm' + + ' +' + exports.humanize(this.diff) + '\u001b[0m'; + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } + return args; +} + +/** + * Invokes `console.error()` with the specified arguments. + */ + +function log() { + return stream.write(util.format.apply(this, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/compression/node_modules/debug/package.json b/node_modules/compression/node_modules/debug/package.json new file mode 100755 index 00000000..0abc9868 --- /dev/null +++ b/node_modules/compression/node_modules/debug/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "debug@~2.2.0", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "~2.2.0", + "spec": ">=2.2.0 <2.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression" + ] + ], + "_from": "debug@>=2.2.0 <2.3.0", + "_id": "debug@2.2.0", + "_inCache": true, + "_location": "/compression/debug", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "_npmVersion": "2.7.4", + "_phantomChildren": {}, + "_requested": { + "raw": "debug@~2.2.0", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "~2.2.0", + "spec": ">=2.2.0 <2.3.0", + "type": "range" + }, + "_requiredBy": [ + "/compression" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "_shrinkwrap": null, + "_spec": "debug@~2.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + } + ], + "dependencies": { + "ms": "0.7.1" + }, + "description": "small debugging utility", + "devDependencies": { + "browserify": "9.0.3", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "tarball": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + }, + "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", + "homepage": "https://github.com/visionmedia/debug", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./node.js", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "debug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "scripts": {}, + "version": "2.2.0" +} diff --git a/node_modules/compression/node_modules/ms/.npmignore b/node_modules/compression/node_modules/ms/.npmignore new file mode 100755 index 00000000..d1aa0ce4 --- /dev/null +++ b/node_modules/compression/node_modules/ms/.npmignore @@ -0,0 +1,5 @@ +node_modules +test +History.md +Makefile +component.json diff --git a/node_modules/compression/node_modules/ms/History.md b/node_modules/compression/node_modules/ms/History.md new file mode 100755 index 00000000..32fdfc17 --- /dev/null +++ b/node_modules/compression/node_modules/ms/History.md @@ -0,0 +1,66 @@ + +0.7.1 / 2015-04-20 +================== + + * prevent extraordinary long inputs (@evilpacket) + * Fixed broken readme link + +0.7.0 / 2014-11-24 +================== + + * add time abbreviations, updated tests and readme for the new units + * fix example in the readme. + * add LICENSE file + +0.6.2 / 2013-12-05 +================== + + * Adding repository section to package.json to suppress warning from NPM. + +0.6.1 / 2013-05-10 +================== + + * fix singularization [visionmedia] + +0.6.0 / 2013-03-15 +================== + + * fix minutes + +0.5.1 / 2013-02-24 +================== + + * add component namespace + +0.5.0 / 2012-11-09 +================== + + * add short formatting as default and .long option + * add .license property to component.json + * add version to component.json + +0.4.0 / 2012-10-22 +================== + + * add rounding to fix crazy decimals + +0.3.0 / 2012-09-07 +================== + + * fix `ms()` [visionmedia] + +0.2.0 / 2012-09-03 +================== + + * add component.json [visionmedia] + * add days support [visionmedia] + * add hours support [visionmedia] + * add minutes support [visionmedia] + * add seconds support [visionmedia] + * add ms string support [visionmedia] + * refactor tests to facilitate ms(number) [visionmedia] + +0.1.0 / 2012-03-07 +================== + + * Initial release diff --git a/node_modules/compression/node_modules/ms/LICENSE b/node_modules/compression/node_modules/ms/LICENSE new file mode 100755 index 00000000..6c07561b --- /dev/null +++ b/node_modules/compression/node_modules/ms/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014 Guillermo Rauch + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/compression/node_modules/ms/README.md b/node_modules/compression/node_modules/ms/README.md new file mode 100755 index 00000000..9b4fd035 --- /dev/null +++ b/node_modules/compression/node_modules/ms/README.md @@ -0,0 +1,35 @@ +# ms.js: miliseconds conversion utility + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('100') // 100 +``` + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as +a number (e.g: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of +equivalent ms is returned. + +## License + +MIT diff --git a/node_modules/compression/node_modules/ms/index.js b/node_modules/compression/node_modules/ms/index.js new file mode 100755 index 00000000..4f927716 --- /dev/null +++ b/node_modules/compression/node_modules/ms/index.js @@ -0,0 +1,125 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options){ + options = options || {}; + if ('string' == typeof val) return parse(val); + return options.long + ? long(val) + : short(val); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = '' + str; + if (str.length > 10000) return; + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); + if (!match) return; + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function short(ms) { + if (ms >= d) return Math.round(ms / d) + 'd'; + if (ms >= h) return Math.round(ms / h) + 'h'; + if (ms >= m) return Math.round(ms / m) + 'm'; + if (ms >= s) return Math.round(ms / s) + 's'; + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function long(ms) { + return plural(ms, d, 'day') + || plural(ms, h, 'hour') + || plural(ms, m, 'minute') + || plural(ms, s, 'second') + || ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) return; + if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/node_modules/compression/node_modules/ms/package.json b/node_modules/compression/node_modules/ms/package.json new file mode 100755 index 00000000..4f2e92cd --- /dev/null +++ b/node_modules/compression/node_modules/ms/package.json @@ -0,0 +1,82 @@ +{ + "_args": [ + [ + { + "raw": "ms@0.7.1", + "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.7.1", + "spec": "0.7.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression/node_modules/debug" + ] + ], + "_from": "ms@0.7.1", + "_id": "ms@0.7.1", + "_inCache": true, + "_location": "/compression/ms", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + "_npmVersion": "2.7.5", + "_phantomChildren": {}, + "_requested": { + "raw": "ms@0.7.1", + "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.7.1", + "spec": "0.7.1", + "type": "version" + }, + "_requiredBy": [ + "/compression/debug" + ], + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "_shrinkwrap": null, + "_spec": "ms@0.7.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression/node_modules/debug", + "bugs": { + "url": "https://github.com/guille/ms.js/issues" + }, + "component": { + "scripts": { + "ms/index.js": "index.js" + } + }, + "dependencies": {}, + "description": "Tiny ms conversion utility", + "devDependencies": { + "expect.js": "*", + "mocha": "*", + "serve": "*" + }, + "directories": {}, + "dist": { + "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "tarball": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + }, + "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", + "homepage": "https://github.com/guille/ms.js", + "main": "./index", + "maintainers": [ + { + "name": "rauchg", + "email": "rauchg@gmail.com" + } + ], + "name": "ms", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/guille/ms.js.git" + }, + "scripts": {}, + "version": "0.7.1" +} diff --git a/node_modules/compression/package.json b/node_modules/compression/package.json new file mode 100755 index 00000000..d638775d --- /dev/null +++ b/node_modules/compression/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "compression@^1.5.2", + "scope": null, + "escapedName": "compression", + "name": "compression", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server" + ] + ], + "_from": "compression@>=1.5.2 <2.0.0", + "_id": "compression@1.6.2", + "_inCache": true, + "_location": "/compression", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/compression-1.6.2.tgz_1463095977791_0.03453603922389448" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "raw": "compression@^1.5.2", + "scope": null, + "escapedName": "compression", + "name": "compression", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack-dev-server" + ], + "_resolved": "https://registry.npmjs.org/compression/-/compression-1.6.2.tgz", + "_shasum": "cceb121ecc9d09c52d7ad0c3350ea93ddd402bc3", + "_shrinkwrap": null, + "_spec": "compression@^1.5.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server", + "bugs": { + "url": "https://github.com/expressjs/compression/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "dependencies": { + "accepts": "~1.3.3", + "bytes": "2.3.0", + "compressible": "~2.0.8", + "debug": "~2.2.0", + "on-headers": "~1.0.1", + "vary": "~1.1.0" + }, + "description": "Node.js compression middleware", + "devDependencies": { + "eslint": "2.9.0", + "eslint-config-standard": "5.3.1", + "eslint-plugin-promise": "1.1.0", + "eslint-plugin-standard": "1.3.2", + "istanbul": "0.4.3", + "mocha": "2.4.5", + "supertest": "1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "cceb121ecc9d09c52d7ad0c3350ea93ddd402bc3", + "tarball": "https://registry.npmjs.org/compression/-/compression-1.6.2.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "gitHead": "b9c63ced82b9f719cd5d9fd250c8432b00752d89", + "homepage": "https://github.com/expressjs/compression#readme", + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "compression", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/expressjs/compression.git" + }, + "scripts": { + "lint": "eslint **/*.js", + "test": "mocha --check-leaks --reporter spec --bail", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec" + }, + "version": "1.6.2" +} diff --git a/node_modules/concat-map/.travis.yml b/node_modules/concat-map/.travis.yml new file mode 100755 index 00000000..f1d0f13c --- /dev/null +++ b/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/node_modules/concat-map/LICENSE b/node_modules/concat-map/LICENSE new file mode 100755 index 00000000..ee27ba4b --- /dev/null +++ b/node_modules/concat-map/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/concat-map/README.markdown b/node_modules/concat-map/README.markdown new file mode 100755 index 00000000..408f70a1 --- /dev/null +++ b/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/node_modules/concat-map/example/map.js b/node_modules/concat-map/example/map.js new file mode 100755 index 00000000..33656217 --- /dev/null +++ b/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/node_modules/concat-map/index.js b/node_modules/concat-map/index.js new file mode 100755 index 00000000..b29a7812 --- /dev/null +++ b/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/node_modules/concat-map/package.json b/node_modules/concat-map/package.json new file mode 100755 index 00000000..ef414a74 --- /dev/null +++ b/node_modules/concat-map/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "concat-map@0.0.1", + "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/brace-expansion" + ] + ], + "_from": "concat-map@0.0.1", + "_id": "concat-map@0.0.1", + "_inCache": true, + "_location": "/concat-map", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "raw": "concat-map@0.0.1", + "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_shrinkwrap": null, + "_spec": "concat-map@0.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/brace-expansion", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "dependencies": {}, + "description": "concatenative mapdashery", + "devDependencies": { + "tape": "~2.4.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "homepage": "https://github.com/substack/node-concat-map", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "concat-map", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.0.1" +} diff --git a/node_modules/concat-map/test/map.js b/node_modules/concat-map/test/map.js new file mode 100755 index 00000000..fdbd7022 --- /dev/null +++ b/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/node_modules/connect-history-api-fallback/.eslintrc b/node_modules/connect-history-api-fallback/.eslintrc new file mode 100755 index 00000000..e11bdbaf --- /dev/null +++ b/node_modules/connect-history-api-fallback/.eslintrc @@ -0,0 +1,10 @@ +--- + env: + node: true + + rules: + brace-style: [2, '1tbs', { 'allowSingleLine': true }] + strict: [2, 'global'] + max-len: [2, 80, 4] + no-use-before-define: [2, 'nofunc'] + quotes: [2, 'single', 'avoid-escape'] diff --git a/node_modules/connect-history-api-fallback/.npmignore b/node_modules/connect-history-api-fallback/.npmignore new file mode 100755 index 00000000..0d7b8eb9 --- /dev/null +++ b/node_modules/connect-history-api-fallback/.npmignore @@ -0,0 +1,18 @@ +node_modules + +### Node.gitignore + +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log diff --git a/node_modules/connect-history-api-fallback/.travis.yml b/node_modules/connect-history-api-fallback/.travis.yml new file mode 100755 index 00000000..aa450705 --- /dev/null +++ b/node_modules/connect-history-api-fallback/.travis.yml @@ -0,0 +1,9 @@ +sudo: false +language: node_js +node_js: + - "6" + - "5" + - "4" + - "iojs" + - "0.12" + - "0.10" diff --git a/node_modules/connect-history-api-fallback/CHANGELOG.md b/node_modules/connect-history-api-fallback/CHANGELOG.md new file mode 100755 index 00000000..81dc56c3 --- /dev/null +++ b/node_modules/connect-history-api-fallback/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog + +## v1.3.0 + - Allow disabling of the `.` (DOT) rule via the `disableDotRule` option. + +## v1.2.0 + - Support definition of custom HTML `Accept` header values. Contributed by @cgmartin. + +## v1.1.0 + - Rewrite rules are now applied before the request URL is checked for dots. + - Rewrite rules can be defined as functions to have greater control over the `dot rule`. + +## v1.0.0 +This version introduces a fair amount of breaking changes. Specifically, instances of the historyApiFallback need to be created via the exported function. Previously, this was not necessary. + + - **Breaking:** Support multiple instances of the historyApiFallback middleware with different configurations. + - **Breaking:** Loggers are configured per historyApiFallback middleware instance (see `README.md`). + - The fallback index HTML file can be configured. Default is `/index.html`. + - Additional rewrite rules can be defined via regular expressions. diff --git a/node_modules/connect-history-api-fallback/LICENSE b/node_modules/connect-history-api-fallback/LICENSE new file mode 100755 index 00000000..85308202 --- /dev/null +++ b/node_modules/connect-history-api-fallback/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2012 Ben Ripkens http://bripkens.de + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/connect-history-api-fallback/README.md b/node_modules/connect-history-api-fallback/README.md new file mode 100755 index 00000000..7da0dd5e --- /dev/null +++ b/node_modules/connect-history-api-fallback/README.md @@ -0,0 +1,147 @@ +

connect-history-api-fallback

+

Middleware to proxy requests through a specified index page, useful for Single Page Applications that utilise the HTML5 History API.

+ +[![Build Status](https://travis-ci.org/bripkens/connect-history-api-fallback.svg?branch=master)](https://travis-ci.org/bripkens/connect-history-api-fallback) +[![Dependency Status](https://david-dm.org/bripkens/connect-history-api-fallback/master.svg)](https://david-dm.org/bripkens/connect-history-api-fallback/master) + +[![NPM](https://nodei.co/npm/connect-history-api-fallback.png?downloads=true&downloadRank=true)](https://nodei.co/npm/connect-history-api-fallback/) + +## Introduction + +Single Page Applications (SPA) typically only utilise one index file that is +accessible by web browsers: usually `index.html`. Navigation in the application +is then commonly handled using JavaScript with the help of the +[HTML5 History API](http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-history-interface). +This results in issues when the user hits the refresh button or is directly +accessing a page other than the landing page, e.g. `/help` or `/help/online` +as the web server bypasses the index file to locate the file at this location. +As your application is a SPA, the web server will fail trying to retrieve the file and return a *404 - Not Found* +message to the user. + +This tiny middleware addresses some of the issues. Specifically, it will change +the requested location to the index you specify (default being `/index.html`) +whenever there is a request which fulfills the following criteria: + + 1. The request is a GET request + 2. which accepts `text/html`, + 3. is not a direct file request, i.e. the requested path does not contain a + `.` (DOT) character and + 4. does not match a pattern provided in options.rewrites (see options below) + +## Usage + +The middleware is available through NPM and can easily be added. + +``` +npm install --save connect-history-api-fallback +``` + +Import the library + +```javascript +var history = require('connect-history-api-fallback'); +``` + +Now you only need to add the middleware to your application like so + +```javascript +var connect = require('connect'); + +var app = connect() + .use(history()) + .listen(3000); +``` + +Of course you can also use this piece of middleware with express: + +```javascript +var express = require('express'); + +var app = express(); +app.use(history()); +``` + +## Options +You can optionally pass options to the library when obtaining the middleware + +```javascript +var middleware = history({}); +``` + +### index +Override the index (default `/index.html`) + +```javascript +history({ + index: '/default.html' +}); +``` + +### rewrites +Override the index when the request url matches a regex pattern. You can either rewrite to a static string or use a function to transform the incoming request. + +The following will rewrite a request that matches the `/\/soccer/` pattern to `/soccer.html`. +```javascript +history({ + rewrites: [ + { from: /\/soccer/, to: '/soccer.html'} + ] +}); +``` + +Alternatively functions can be used to have more control over the rewrite process. For instance, the following listing shows how requests to `/libs/jquery/jquery.1.12.0.min.js` and the like can be routed to `./bower_components/libs/jquery/jquery.1.12.0.min.js`. You can also make use of this if you have an API version in the URL path. +```javascript +history({ + rewrites: [ + { + from: /^\/libs\/.*$/, + to: function(context) { + return '/bower_components' + context.parsedUrl.pathname; + } + } + ] +}); +``` + +The function will always be called with a context object that has the following properties: + + - **parsedUrl**: Information about the URL as provided by the [URL module's](https://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost) `url.parse`. + - **match**: An Array of matched results as provided by `String.match(...)`. + + +### verbose +This middleware does not log any information by default. If you wish to activate logging, then you can do so via the `verbose` option or by specifying a logger function. + +```javascript +history({ + verbose: true +}); +``` + +Alternatively use your own logger + +```javascript +history({ + logger: console.log.bind(console) +}); +``` + +### htmlAcceptHeaders +Override the default `Accepts:` headers that are queried when matching HTML content requests (Default: `['text/html', '*/*']`). + +```javascript +history({ + htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'] +}) +``` + +### disableDotRule +Disables the dot rule mentioned above: + +> […] is not a direct file request, i.e. the requested path does not contain a `.` (DOT) character […] + +```javascript +history({ + disableDotRule: true +}) +``` diff --git a/node_modules/connect-history-api-fallback/lib/index.js b/node_modules/connect-history-api-fallback/lib/index.js new file mode 100755 index 00000000..ae1355ff --- /dev/null +++ b/node_modules/connect-history-api-fallback/lib/index.js @@ -0,0 +1,107 @@ +'use strict'; + +var url = require('url'); + +exports = module.exports = function historyApiFallback(options) { + options = options || {}; + var logger = getLogger(options); + + return function(req, res, next) { + var headers = req.headers; + if (req.method !== 'GET') { + logger( + 'Not rewriting', + req.method, + req.url, + 'because the method is not GET.' + ); + return next(); + } else if (!headers || typeof headers.accept !== 'string') { + logger( + 'Not rewriting', + req.method, + req.url, + 'because the client did not send an HTTP accept header.' + ); + return next(); + } else if (headers.accept.indexOf('application/json') === 0) { + logger( + 'Not rewriting', + req.method, + req.url, + 'because the client prefers JSON.' + ); + return next(); + } else if (!acceptsHtml(headers.accept, options)) { + logger( + 'Not rewriting', + req.method, + req.url, + 'because the client does not accept HTML.' + ); + return next(); + } + + var parsedUrl = url.parse(req.url); + var rewriteTarget; + options.rewrites = options.rewrites || []; + for (var i = 0; i < options.rewrites.length; i++) { + var rewrite = options.rewrites[i]; + var match = parsedUrl.pathname.match(rewrite.from); + if (match !== null) { + rewriteTarget = evaluateRewriteRule(parsedUrl, match, rewrite.to); + logger('Rewriting', req.method, req.url, 'to', rewriteTarget); + req.url = rewriteTarget; + return next(); + } + } + + if (parsedUrl.pathname.indexOf('.') !== -1 && + options.disableDotRule !== true) { + logger( + 'Not rewriting', + req.method, + req.url, + 'because the path includes a dot (.) character.' + ); + return next(); + } + + rewriteTarget = options.index || '/index.html'; + logger('Rewriting', req.method, req.url, 'to', rewriteTarget); + req.url = rewriteTarget; + next(); + }; +}; + +function evaluateRewriteRule(parsedUrl, match, rule) { + if (typeof rule === 'string') { + return rule; + } else if (typeof rule !== 'function') { + throw new Error('Rewrite rule can only be of type string of function.'); + } + + return rule({ + parsedUrl: parsedUrl, + match: match + }); +} + +function acceptsHtml(header, options) { + options.htmlAcceptHeaders = options.htmlAcceptHeaders || ['text/html', '*/*']; + for (var i = 0; i < options.htmlAcceptHeaders.length; i++) { + if (header.indexOf(options.htmlAcceptHeaders[i]) !== -1) { + return true; + } + } + return false; +} + +function getLogger(options) { + if (options && options.logger) { + return options.logger; + } else if (options && options.verbose) { + return console.log.bind(console); + } + return function(){}; +} diff --git a/node_modules/connect-history-api-fallback/package.json b/node_modules/connect-history-api-fallback/package.json new file mode 100755 index 00000000..f72570cd --- /dev/null +++ b/node_modules/connect-history-api-fallback/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "connect-history-api-fallback@^1.3.0", + "scope": null, + "escapedName": "connect-history-api-fallback", + "name": "connect-history-api-fallback", + "rawSpec": "^1.3.0", + "spec": ">=1.3.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server" + ] + ], + "_from": "connect-history-api-fallback@>=1.3.0 <2.0.0", + "_id": "connect-history-api-fallback@1.3.0", + "_inCache": true, + "_location": "/connect-history-api-fallback", + "_nodeVersion": "6.2.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/connect-history-api-fallback-1.3.0.tgz_1470552836120_0.7486736204009503" + }, + "_npmUser": { + "name": "bripkens", + "email": "bripkens.dev@gmail.com" + }, + "_npmVersion": "3.8.9", + "_phantomChildren": {}, + "_requested": { + "raw": "connect-history-api-fallback@^1.3.0", + "scope": null, + "escapedName": "connect-history-api-fallback", + "name": "connect-history-api-fallback", + "rawSpec": "^1.3.0", + "spec": ">=1.3.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack-dev-server" + ], + "_resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.3.0.tgz", + "_shasum": "e51d17f8f0ef0db90a64fdb47de3051556e9f169", + "_shrinkwrap": null, + "_spec": "connect-history-api-fallback@^1.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server", + "author": { + "name": "Ben Ripkens", + "email": "bripkens.dev@gmail.com", + "url": "http://bripkens.de" + }, + "bugs": { + "url": "https://github.com/bripkens/connect-history-api-fallback/issues" + }, + "contributors": [ + { + "name": "Craig Myles", + "email": "cr@igmyles.com", + "url": "http://www.craigmyles.com" + } + ], + "dependencies": {}, + "description": "Provides a fallback for non-existing directories so that the HTML 5 history API can be used.", + "devDependencies": { + "eslint": "^0.18.0", + "nodeunit": "^0.9.1", + "sinon": "^1.14.1" + }, + "directories": {}, + "dist": { + "shasum": "e51d17f8f0ef0db90a64fdb47de3051556e9f169", + "tarball": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.3.0.tgz" + }, + "engines": { + "node": ">=0.8" + }, + "gitHead": "709252d1b7afbf4b29748ec9a881684603d01f97", + "homepage": "https://github.com/bripkens/connect-history-api-fallback#readme", + "keyswords": [ + "connect", + "html5", + "history api", + "fallback", + "spa" + ], + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "bripkens", + "email": "bripkens.dev@gmail.com" + } + ], + "name": "connect-history-api-fallback", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/bripkens/connect-history-api-fallback.git" + }, + "scripts": { + "test": "eslint lib/index.js test/index_test.js && nodeunit test/index_test.js" + }, + "version": "1.3.0" +} diff --git a/node_modules/connect-history-api-fallback/test/index_test.js b/node_modules/connect-history-api-fallback/test/index_test.js new file mode 100755 index 00000000..a67e34d1 --- /dev/null +++ b/node_modules/connect-history-api-fallback/test/index_test.js @@ -0,0 +1,250 @@ +'use strict'; + +var sinon = require('sinon'); +var historyApiFallback = require('../lib'); + +var tests = module.exports = {}; + +var middleware; +var req = null; +var requestedUrl; +var next; + +tests.setUp = function(done) { + middleware = historyApiFallback(); + requestedUrl = '/foo'; + req = { + method: 'GET', + url: requestedUrl, + headers: { + accept: 'text/html, */*' + } + }; + next = sinon.stub(); + + done(); +}; + + +['POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'].forEach(function(method) { + tests['should ignore ' + method + ' requests'] = function(test) { + req.method = method; + + middleware(req, null, next); + + test.equal(req.url, requestedUrl); + test.ok(next.called); + test.done(); + }; +}); + + +tests['should ignore requests that do not accept html'] = function(test) { + req.headers.accept = 'application/json'; + + middleware(req, null, next); + + test.equal(req.url, requestedUrl); + test.ok(next.called); + test.done(); +}; + + +tests['should ignore file requests'] = function(test) { + var expected = req.url = 'js/app.js'; + + middleware(req, null, next); + + test.equal(req.url, expected); + test.ok(next.called); + test.done(); +}; + + +tests['should rewrite requests when the . rule is disabled'] = function(test) { + req.url = 'js/app.js'; + middleware = historyApiFallback({ + disableDotRule: true + }); + middleware(req, null, next); + + test.equal(req.url, '/index.html'); + test.ok(next.called); + test.done(); +}; + + +tests['should take JSON preference into account'] = function(test) { + req.headers.accept = 'application/json, text/plain, */*'; + + middleware(req, null, next); + + test.equal(req.url, requestedUrl); + test.ok(next.called); + test.done(); +}; + + +tests['should rewrite valid requests'] = function(test) { + middleware(req, null, next); + + test.equal(req.url, '/index.html'); + test.ok(next.called); + test.done(); +}; + +tests['should not fail for missing HTTP accept header'] = function(test) { + delete req.headers.accept; + + middleware(req, null, next); + + test.equal(req.url, requestedUrl); + test.ok(next.called); + test.done(); +}; + +tests['should not fail for missing headers object'] = function(test) { + delete req.headers; + + middleware(req, null, next); + + test.equal(req.url, requestedUrl); + test.ok(next.called); + test.done(); +}; + +tests['should work in verbose mode'] = function(test) { + var expected = req.url = 'js/app.js'; + middleware = historyApiFallback({ + verbose: true + }); + + middleware(req, null, next); + + test.equal(req.url, expected); + test.ok(next.called); + test.done(); +}; + +tests['should work with a custom logger'] = function(test) { + var expected = req.url = 'js/app.js'; + var logger = sinon.stub(); + middleware = historyApiFallback({ + logger: logger + }); + + middleware(req, null, next); + + test.equal(req.url, expected); + test.ok(next.called); + test.ok(logger.calledOnce); + test.done(); +}; + +tests['should rewrite requested path according to rules'] = function(test) { + req.url = '/soccer'; + middleware = historyApiFallback({ + rewrites: [ + {from: /\/soccer/, to: '/soccer.html'} + ] + }); + + middleware(req, null, next); + + test.equal(req.url, '/soccer.html'); + test.ok(next.called); + test.done(); +}; + +tests['should support functions as rewrite rule'] = function(test) { + middleware = historyApiFallback({ + rewrites: [ + { + from: /^\/libs\/(.*)$/, + to: function(context) { + return './bower_components' + context.parsedUrl.pathname; + } + } + ] + }); + + req.url = '/libs/jquery/jquery.1.12.0.min.js'; + middleware(req, null, next); + test.equal(req.url, './bower_components/libs/jquery/jquery.1.12.0.min.js'); + test.ok(next.called); + + next = sinon.stub(); + var expected = req.url = '/js/main.js'; + middleware(req, null, next); + test.equal(req.url, expected); + test.ok(next.called); + + test.done(); +}; + +tests['should test rewrite rules'] = function(test) { + req.url = '/socer'; + middleware = historyApiFallback({ + rewrites: [ + {from: /\/soccer/, to: '/soccer.html'} + ] + }); + + middleware(req, null, next); + + test.equal(req.url, '/index.html'); + test.ok(next.called); + test.done(); +}; + +tests['should support custom index file'] = function(test) { + var index = 'default.html'; + req.url = '/socer'; + middleware = historyApiFallback({ + index: index + }); + + middleware(req, null, next); + + test.equal(req.url, index); + test.ok(next.called); + test.done(); +}; + +tests['should accept html requests based on headers option'] = function(test) { + req.headers.accept = '*/*'; + middleware = historyApiFallback({ + htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'] + }); + + middleware(req, null, next); + + test.equal(req.url, requestedUrl); + test.ok(next.called); + test.done(); +}; + +tests['should support custom rewrite rules'] = function(test) { + req.headers.accept = '*/*'; + var url = '/app/login/app.js'; + req.url = url; + middleware = historyApiFallback({ + rewrites: [ + { + from: /\/app\/login/, + to: function onMatch(ctx) { + if (ctx.parsedUrl.path.indexOf('.js')) { + return ctx.parsedUrl.href; + } + return '/app/login/index.html'; + } + } + ] + }); + + middleware(req, null, next); + + test.equal(req.url, url); + test.ok(next.called); + test.done(); +}; diff --git a/node_modules/console-browserify/.npmignore b/node_modules/console-browserify/.npmignore new file mode 100755 index 00000000..aa3fd4b8 --- /dev/null +++ b/node_modules/console-browserify/.npmignore @@ -0,0 +1,14 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript diff --git a/node_modules/console-browserify/.testem.json b/node_modules/console-browserify/.testem.json new file mode 100755 index 00000000..633c2ba8 --- /dev/null +++ b/node_modules/console-browserify/.testem.json @@ -0,0 +1,14 @@ +{ + "launchers": { + "node": { + "command": "npm test" + } + }, + "src_files": [ + "./**/*.js" + ], + "before_tests": "npm run build", + "on_exit": "rm test/static/bundle.js", + "test_page": "test/static/index.html", + "launch_in_dev": ["node", "phantomjs"] +} diff --git a/node_modules/console-browserify/.travis.yml b/node_modules/console-browserify/.travis.yml new file mode 100755 index 00000000..ed178f63 --- /dev/null +++ b/node_modules/console-browserify/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.9 diff --git a/node_modules/console-browserify/LICENCE b/node_modules/console-browserify/LICENCE new file mode 100755 index 00000000..a23e08a8 --- /dev/null +++ b/node_modules/console-browserify/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/console-browserify/README.md b/node_modules/console-browserify/README.md new file mode 100755 index 00000000..572615eb --- /dev/null +++ b/node_modules/console-browserify/README.md @@ -0,0 +1,33 @@ +# console-browserify + +[![build status][1]][2] + +[![browser support][3]][4] + + +Emulate console for all the browsers + +## Example + +```js +var console = require("console-browserify") + +console.log("hello world!") +``` + +## Installation + +`npm install console-browserify` + +## Contributors + + - Raynos + +## MIT Licenced + + + + [1]: https://secure.travis-ci.org/Raynos/console-browserify.png + [2]: http://travis-ci.org/Raynos/console-browserify + [3]: http://ci.testling.com/Raynos/console-browserify.png + [4]: http://ci.testling.com/Raynos/console-browserify diff --git a/node_modules/console-browserify/index.js b/node_modules/console-browserify/index.js new file mode 100755 index 00000000..af433ce8 --- /dev/null +++ b/node_modules/console-browserify/index.js @@ -0,0 +1,86 @@ +/*global window, global*/ +var util = require("util") +var assert = require("assert") +var now = require("date-now") + +var slice = Array.prototype.slice +var console +var times = {} + +if (typeof global !== "undefined" && global.console) { + console = global.console +} else if (typeof window !== "undefined" && window.console) { + console = window.console +} else { + console = {} +} + +var functions = [ + [log, "log"], + [info, "info"], + [warn, "warn"], + [error, "error"], + [time, "time"], + [timeEnd, "timeEnd"], + [trace, "trace"], + [dir, "dir"], + [consoleAssert, "assert"] +] + +for (var i = 0; i < functions.length; i++) { + var tuple = functions[i] + var f = tuple[0] + var name = tuple[1] + + if (!console[name]) { + console[name] = f + } +} + +module.exports = console + +function log() {} + +function info() { + console.log.apply(console, arguments) +} + +function warn() { + console.log.apply(console, arguments) +} + +function error() { + console.warn.apply(console, arguments) +} + +function time(label) { + times[label] = now() +} + +function timeEnd(label) { + var time = times[label] + if (!time) { + throw new Error("No such label: " + label) + } + + var duration = now() - time + console.log(label + ": " + duration + "ms") +} + +function trace() { + var err = new Error() + err.name = "Trace" + err.message = util.format.apply(null, arguments) + console.error(err.stack) +} + +function dir(object) { + console.log(util.inspect(object) + "\n") +} + +function consoleAssert(expression) { + if (!expression) { + var arr = slice.call(arguments, 1) + assert.ok(false, util.format.apply(null, arr)) + } +} diff --git a/node_modules/console-browserify/package.json b/node_modules/console-browserify/package.json new file mode 100755 index 00000000..9de34d9d --- /dev/null +++ b/node_modules/console-browserify/package.json @@ -0,0 +1,122 @@ +{ + "_args": [ + [ + { + "raw": "console-browserify@^1.1.0", + "scope": null, + "escapedName": "console-browserify", + "name": "console-browserify", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "console-browserify@>=1.1.0 <2.0.0", + "_id": "console-browserify@1.1.0", + "_inCache": true, + "_location": "/console-browserify", + "_npmUser": { + "name": "raynos", + "email": "raynos2@gmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "console-browserify@^1.1.0", + "scope": null, + "escapedName": "console-browserify", + "name": "console-browserify", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "_shasum": "f0241c45730a9fc6323b206dbf38edc741d0bb10", + "_shrinkwrap": null, + "_spec": "console-browserify@^1.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/console-browserify/issues", + "email": "raynos2@gmail.com" + }, + "contributors": [ + { + "name": "Raynos" + } + ], + "dependencies": { + "date-now": "^0.1.4" + }, + "description": "Emulate console for all the browsers", + "devDependencies": { + "jsonify": "0.0.0", + "run-browser": "^1.3.0", + "tap-dot": "^0.2.1", + "tap-spec": "^0.1.8", + "tape": "^2.12.3" + }, + "directories": {}, + "dist": { + "shasum": "f0241c45730a9fc6323b206dbf38edc741d0bb10", + "tarball": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz" + }, + "homepage": "https://github.com/Raynos/console-browserify", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Raynos/console-browserify/raw/master/LICENSE" + } + ], + "main": "index", + "maintainers": [ + { + "name": "raynos", + "email": "raynos2@gmail.com" + } + ], + "name": "console-browserify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/console-browserify.git" + }, + "scripts": { + "browser": "run-browser test/index.js", + "build": "browserify test/index.js -o test/static/bundle.js", + "cover": "istanbul cover --report none --print detail ./test/index.js", + "dot": "node ./test/index.js | tap-dot", + "phantom": "run-browser test/index.js -b | tap-spec", + "start": "node ./index.js", + "test": "node ./test/index.js | tap-spec", + "testem": "testem", + "view-cover": "istanbul report html && google-chrome ./coverage/index.html" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.0" +} diff --git a/node_modules/console-browserify/test/index.js b/node_modules/console-browserify/test/index.js new file mode 100755 index 00000000..26dfaad6 --- /dev/null +++ b/node_modules/console-browserify/test/index.js @@ -0,0 +1,67 @@ +var console = require("../index") +var test = require("tape") + +if (typeof window !== "undefined" && !window.JSON) { + window.JSON = require("jsonify") +} + +test("console has expected methods", function (assert) { + assert.ok(console.log) + assert.ok(console.info) + assert.ok(console.warn) + assert.ok(console.dir) + assert.ok(console.time, "time") + assert.ok(console.timeEnd, "timeEnd") + assert.ok(console.trace, "trace") + assert.ok(console.assert) + + assert.end() +}) + +test("invoke console.log", function (assert) { + console.log("test-log") + + assert.end() +}) + +test("invoke console.info", function (assert) { + console.info("test-info") + + assert.end() +}) + +test("invoke console.warn", function (assert) { + console.warn("test-warn") + + assert.end() +}) + +test("invoke console.time", function (assert) { + console.time("label") + + assert.end() +}) + +test("invoke console.trace", function (assert) { + console.trace("test-trace") + + assert.end() +}) + +test("invoke console.assert", function (assert) { + console.assert(true) + + assert.end() +}) + +test("invoke console.dir", function (assert) { + console.dir("test-dir") + + assert.end() +}) + +test("invoke console.timeEnd", function (assert) { + console.timeEnd("label") + + assert.end() +}) diff --git a/node_modules/console-browserify/test/static/index.html b/node_modules/console-browserify/test/static/index.html new file mode 100755 index 00000000..dd55012f --- /dev/null +++ b/node_modules/console-browserify/test/static/index.html @@ -0,0 +1,12 @@ + + + + + TAPE Example + + + + + + + diff --git a/node_modules/console-browserify/test/static/test-adapter.js b/node_modules/console-browserify/test/static/test-adapter.js new file mode 100755 index 00000000..8b4c12dc --- /dev/null +++ b/node_modules/console-browserify/test/static/test-adapter.js @@ -0,0 +1,53 @@ +(function () { + var Testem = window.Testem + var regex = /^((?:not )?ok) (\d+) (.+)$/ + + Testem.useCustomAdapter(tapAdapter) + + function tapAdapter(socket){ + var results = { + failed: 0 + , passed: 0 + , total: 0 + , tests: [] + } + + socket.emit('tests-start') + + Testem.handleConsoleMessage = function(msg){ + var m = msg.match(regex) + if (m) { + var passed = m[1] === 'ok' + var test = { + passed: passed ? 1 : 0, + failed: passed ? 0 : 1, + total: 1, + id: m[2], + name: m[3], + items: [] + } + + if (passed) { + results.passed++ + } else { + console.error("failure", m) + + results.failed++ + } + + results.total++ + + // console.log("emitted test", test) + socket.emit('test-result', test) + results.tests.push(test) + } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ + // console.log("emitted all test") + socket.emit('all-test-results', results) + } + + // return false if you want to prevent the console message from + // going to the console + // return false + } + } +}()) diff --git a/node_modules/constants-browserify/README.md b/node_modules/constants-browserify/README.md new file mode 100755 index 00000000..9dd5a46f --- /dev/null +++ b/node_modules/constants-browserify/README.md @@ -0,0 +1,54 @@ + +# constants-browserify + +Node's `constants` module for the browser. + +[![downloads](https://img.shields.io/npm/dm/constants-browserify.svg)](https://www.npmjs.org/package/constants-browserify) + +## Usage + +To use with browserify cli: + +```bash +$ browserify -r constants:constants-browserify script.js +``` + +To use with browserify api: + +```js +browserify() + .require('constants-browserify', { expose: 'constants' }) + .add(__dirname + '/script.js') + .bundle() + // ... +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install constants-browserify +``` + +## License + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/constants-browserify/build.sh b/node_modules/constants-browserify/build.sh new file mode 100755 index 00000000..60012d66 --- /dev/null +++ b/node_modules/constants-browserify/build.sh @@ -0,0 +1 @@ +node -pe 'JSON.stringify(require("constants"), null, " ")' > constants.json diff --git a/node_modules/constants-browserify/constants.json b/node_modules/constants-browserify/constants.json new file mode 100755 index 00000000..9a69b858 --- /dev/null +++ b/node_modules/constants-browserify/constants.json @@ -0,0 +1,209 @@ +{ + "O_RDONLY": 0, + "O_WRONLY": 1, + "O_RDWR": 2, + "S_IFMT": 61440, + "S_IFREG": 32768, + "S_IFDIR": 16384, + "S_IFCHR": 8192, + "S_IFBLK": 24576, + "S_IFIFO": 4096, + "S_IFLNK": 40960, + "S_IFSOCK": 49152, + "O_CREAT": 512, + "O_EXCL": 2048, + "O_NOCTTY": 131072, + "O_TRUNC": 1024, + "O_APPEND": 8, + "O_DIRECTORY": 1048576, + "O_NOFOLLOW": 256, + "O_SYNC": 128, + "O_SYMLINK": 2097152, + "O_NONBLOCK": 4, + "S_IRWXU": 448, + "S_IRUSR": 256, + "S_IWUSR": 128, + "S_IXUSR": 64, + "S_IRWXG": 56, + "S_IRGRP": 32, + "S_IWGRP": 16, + "S_IXGRP": 8, + "S_IRWXO": 7, + "S_IROTH": 4, + "S_IWOTH": 2, + "S_IXOTH": 1, + "E2BIG": 7, + "EACCES": 13, + "EADDRINUSE": 48, + "EADDRNOTAVAIL": 49, + "EAFNOSUPPORT": 47, + "EAGAIN": 35, + "EALREADY": 37, + "EBADF": 9, + "EBADMSG": 94, + "EBUSY": 16, + "ECANCELED": 89, + "ECHILD": 10, + "ECONNABORTED": 53, + "ECONNREFUSED": 61, + "ECONNRESET": 54, + "EDEADLK": 11, + "EDESTADDRREQ": 39, + "EDOM": 33, + "EDQUOT": 69, + "EEXIST": 17, + "EFAULT": 14, + "EFBIG": 27, + "EHOSTUNREACH": 65, + "EIDRM": 90, + "EILSEQ": 92, + "EINPROGRESS": 36, + "EINTR": 4, + "EINVAL": 22, + "EIO": 5, + "EISCONN": 56, + "EISDIR": 21, + "ELOOP": 62, + "EMFILE": 24, + "EMLINK": 31, + "EMSGSIZE": 40, + "EMULTIHOP": 95, + "ENAMETOOLONG": 63, + "ENETDOWN": 50, + "ENETRESET": 52, + "ENETUNREACH": 51, + "ENFILE": 23, + "ENOBUFS": 55, + "ENODATA": 96, + "ENODEV": 19, + "ENOENT": 2, + "ENOEXEC": 8, + "ENOLCK": 77, + "ENOLINK": 97, + "ENOMEM": 12, + "ENOMSG": 91, + "ENOPROTOOPT": 42, + "ENOSPC": 28, + "ENOSR": 98, + "ENOSTR": 99, + "ENOSYS": 78, + "ENOTCONN": 57, + "ENOTDIR": 20, + "ENOTEMPTY": 66, + "ENOTSOCK": 38, + "ENOTSUP": 45, + "ENOTTY": 25, + "ENXIO": 6, + "EOPNOTSUPP": 102, + "EOVERFLOW": 84, + "EPERM": 1, + "EPIPE": 32, + "EPROTO": 100, + "EPROTONOSUPPORT": 43, + "EPROTOTYPE": 41, + "ERANGE": 34, + "EROFS": 30, + "ESPIPE": 29, + "ESRCH": 3, + "ESTALE": 70, + "ETIME": 101, + "ETIMEDOUT": 60, + "ETXTBSY": 26, + "EWOULDBLOCK": 35, + "EXDEV": 18, + "SIGHUP": 1, + "SIGINT": 2, + "SIGQUIT": 3, + "SIGILL": 4, + "SIGTRAP": 5, + "SIGABRT": 6, + "SIGIOT": 6, + "SIGBUS": 10, + "SIGFPE": 8, + "SIGKILL": 9, + "SIGUSR1": 30, + "SIGSEGV": 11, + "SIGUSR2": 31, + "SIGPIPE": 13, + "SIGALRM": 14, + "SIGTERM": 15, + "SIGCHLD": 20, + "SIGCONT": 19, + "SIGSTOP": 17, + "SIGTSTP": 18, + "SIGTTIN": 21, + "SIGTTOU": 22, + "SIGURG": 16, + "SIGXCPU": 24, + "SIGXFSZ": 25, + "SIGVTALRM": 26, + "SIGPROF": 27, + "SIGWINCH": 28, + "SIGIO": 23, + "SIGSYS": 12, + "SSL_OP_ALL": 2147486719, + "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION": 262144, + "SSL_OP_CIPHER_SERVER_PREFERENCE": 4194304, + "SSL_OP_CISCO_ANYCONNECT": 32768, + "SSL_OP_COOKIE_EXCHANGE": 8192, + "SSL_OP_CRYPTOPRO_TLSEXT_BUG": 2147483648, + "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS": 2048, + "SSL_OP_EPHEMERAL_RSA": 0, + "SSL_OP_LEGACY_SERVER_CONNECT": 4, + "SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER": 32, + "SSL_OP_MICROSOFT_SESS_ID_BUG": 1, + "SSL_OP_MSIE_SSLV2_RSA_PADDING": 0, + "SSL_OP_NETSCAPE_CA_DN_BUG": 536870912, + "SSL_OP_NETSCAPE_CHALLENGE_BUG": 2, + "SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG": 1073741824, + "SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG": 8, + "SSL_OP_NO_COMPRESSION": 131072, + "SSL_OP_NO_QUERY_MTU": 4096, + "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION": 65536, + "SSL_OP_NO_SSLv2": 16777216, + "SSL_OP_NO_SSLv3": 33554432, + "SSL_OP_NO_TICKET": 16384, + "SSL_OP_NO_TLSv1": 67108864, + "SSL_OP_NO_TLSv1_1": 268435456, + "SSL_OP_NO_TLSv1_2": 134217728, + "SSL_OP_PKCS1_CHECK_1": 0, + "SSL_OP_PKCS1_CHECK_2": 0, + "SSL_OP_SINGLE_DH_USE": 1048576, + "SSL_OP_SINGLE_ECDH_USE": 524288, + "SSL_OP_SSLEAY_080_CLIENT_DH_BUG": 128, + "SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG": 0, + "SSL_OP_TLS_BLOCK_PADDING_BUG": 512, + "SSL_OP_TLS_D5_BUG": 256, + "SSL_OP_TLS_ROLLBACK_BUG": 8388608, + "ENGINE_METHOD_DSA": 2, + "ENGINE_METHOD_DH": 4, + "ENGINE_METHOD_RAND": 8, + "ENGINE_METHOD_ECDH": 16, + "ENGINE_METHOD_ECDSA": 32, + "ENGINE_METHOD_CIPHERS": 64, + "ENGINE_METHOD_DIGESTS": 128, + "ENGINE_METHOD_STORE": 256, + "ENGINE_METHOD_PKEY_METHS": 512, + "ENGINE_METHOD_PKEY_ASN1_METHS": 1024, + "ENGINE_METHOD_ALL": 65535, + "ENGINE_METHOD_NONE": 0, + "DH_CHECK_P_NOT_SAFE_PRIME": 2, + "DH_CHECK_P_NOT_PRIME": 1, + "DH_UNABLE_TO_CHECK_GENERATOR": 4, + "DH_NOT_SUITABLE_GENERATOR": 8, + "NPN_ENABLED": 1, + "RSA_PKCS1_PADDING": 1, + "RSA_SSLV23_PADDING": 2, + "RSA_NO_PADDING": 3, + "RSA_PKCS1_OAEP_PADDING": 4, + "RSA_X931_PADDING": 5, + "RSA_PKCS1_PSS_PADDING": 6, + "POINT_CONVERSION_COMPRESSED": 2, + "POINT_CONVERSION_UNCOMPRESSED": 4, + "POINT_CONVERSION_HYBRID": 6, + "F_OK": 0, + "R_OK": 4, + "W_OK": 2, + "X_OK": 1, + "UV_UDP_REUSEADDR": 4 +} diff --git a/node_modules/constants-browserify/package.json b/node_modules/constants-browserify/package.json new file mode 100755 index 00000000..f829c75c --- /dev/null +++ b/node_modules/constants-browserify/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "constants-browserify@^1.0.0", + "scope": null, + "escapedName": "constants-browserify", + "name": "constants-browserify", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "constants-browserify@>=1.0.0 <2.0.0", + "_id": "constants-browserify@1.0.0", + "_inCache": true, + "_location": "/constants-browserify", + "_nodeVersion": "2.3.4", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "2.12.1", + "_phantomChildren": {}, + "_requested": { + "raw": "constants-browserify@^1.0.0", + "scope": null, + "escapedName": "constants-browserify", + "name": "constants-browserify", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "_shasum": "c20b96d8c617748aaf1c16021760cd27fcb8cb75", + "_shrinkwrap": null, + "_spec": "constants-browserify@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "Julian Gruber", + "email": "julian@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/constants-browserify/issues" + }, + "contributors": [ + { + "name": "James J. Womack", + "email": "james@womack.io", + "url": "http://netflix.com" + } + ], + "dependencies": {}, + "description": "node's constants module for the browser", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "c20b96d8c617748aaf1c16021760cd27fcb8cb75", + "tarball": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz" + }, + "gitHead": "e0ee990c75f3a0b3275e6bb2e3ff4d5d169d1b9d", + "homepage": "https://github.com/juliangruber/constants-browserify", + "keywords": [ + "constants", + "node", + "browser", + "browserify" + ], + "license": "MIT", + "main": "constants.json", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "constants-browserify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/constants-browserify.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/constants-browserify/test.js b/node_modules/constants-browserify/test.js new file mode 100755 index 00000000..58cc3019 --- /dev/null +++ b/node_modules/constants-browserify/test.js @@ -0,0 +1,18 @@ +'use strict'; + +var Assert = require('assert') +var Constants = require('./') + +try { + var nodeConstants = require('constants') + + Assert.deepEqual(nodeConstants, Constants, 'The constants file was not equal') +} + +catch (e) { + console.error(e) + console.error('\nTests failed!') + process.exit(1) +} + +console.info('Tests passed!') diff --git a/node_modules/content-disposition/HISTORY.md b/node_modules/content-disposition/HISTORY.md new file mode 100755 index 00000000..53849b61 --- /dev/null +++ b/node_modules/content-disposition/HISTORY.md @@ -0,0 +1,50 @@ +0.5.2 / 2016-12-08 +================== + + * Fix `parse` to accept any linear whitespace character + +0.5.1 / 2016-01-17 +================== + + * perf: enable strict mode + +0.5.0 / 2014-10-11 +================== + + * Add `parse` function + +0.4.0 / 2014-09-21 +================== + + * Expand non-Unicode `filename` to the full ISO-8859-1 charset + +0.3.0 / 2014-09-20 +================== + + * Add `fallback` option + * Add `type` option + +0.2.0 / 2014-09-19 +================== + + * Reduce ambiguity of file names with hex escape in buggy browsers + +0.1.2 / 2014-09-19 +================== + + * Fix periodic invalid Unicode filename header + +0.1.1 / 2014-09-19 +================== + + * Fix invalid characters appearing in `filename*` parameter + +0.1.0 / 2014-09-18 +================== + + * Make the `filename` argument optional + +0.0.0 / 2014-09-18 +================== + + * Initial release diff --git a/node_modules/content-disposition/LICENSE b/node_modules/content-disposition/LICENSE new file mode 100755 index 00000000..b7dce6cf --- /dev/null +++ b/node_modules/content-disposition/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/content-disposition/README.md b/node_modules/content-disposition/README.md new file mode 100755 index 00000000..992d19a6 --- /dev/null +++ b/node_modules/content-disposition/README.md @@ -0,0 +1,141 @@ +# content-disposition + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create and parse HTTP `Content-Disposition` header + +## Installation + +```sh +$ npm install content-disposition +``` + +## API + +```js +var contentDisposition = require('content-disposition') +``` + +### contentDisposition(filename, options) + +Create an attachment `Content-Disposition` header value using the given file name, +if supplied. The `filename` is optional and if no file name is desired, but you +want to specify `options`, set `filename` to `undefined`. + +```js +res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf')) +``` + +**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this +header through a means different from `setHeader` in Node.js, you'll want to specify +the `'binary'` encoding in Node.js. + +#### Options + +`contentDisposition` accepts these properties in the options object. + +##### fallback + +If the `filename` option is outside ISO-8859-1, then the file name is actually +stored in a supplemental field for clients that support Unicode file names and +a ISO-8859-1 version of the file name is automatically generated. + +This specifies the ISO-8859-1 file name to override the automatic generation or +disables the generation all together, defaults to `true`. + + - A string will specify the ISO-8859-1 file name to use in place of automatic + generation. + - `false` will disable including a ISO-8859-1 file name and only include the + Unicode version (unless the file name is already ISO-8859-1). + - `true` will enable automatic generation if the file name is outside ISO-8859-1. + +If the `filename` option is ISO-8859-1 and this option is specified and has a +different value, then the `filename` option is encoded in the extended field +and this set as the fallback field, even though they are both ISO-8859-1. + +##### type + +Specifies the disposition type, defaults to `"attachment"`. This can also be +`"inline"`, or any other value (all values except inline are treated like +`attachment`, but can convey additional information if both parties agree to +it). The type is normalized to lower-case. + +### contentDisposition.parse(string) + +```js +var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'); +``` + +Parse a `Content-Disposition` header string. This automatically handles extended +("Unicode") parameters by decoding them and providing them under the standard +parameter name. This will return an object with the following properties (examples +are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`): + + - `type`: The disposition type (always lower case). Example: `'attachment'` + + - `parameters`: An object of the parameters in the disposition (name of parameter + always lower case and extended versions replace non-extended versions). Example: + `{filename: "€ rates.txt"}` + +## Examples + +### Send a file for download + +```js +var contentDisposition = require('content-disposition') +var destroy = require('destroy') +var http = require('http') +var onFinished = require('on-finished') + +var filePath = '/path/to/public/plans.pdf' + +http.createServer(function onRequest(req, res) { + // set headers + res.setHeader('Content-Type', 'application/pdf') + res.setHeader('Content-Disposition', contentDisposition(filePath)) + + // send file + var stream = fs.createReadStream(filePath) + stream.pipe(res) + onFinished(res, function (err) { + destroy(stream) + }) +}) +``` + +## Testing + +```sh +$ npm test +``` + +## References + +- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616] +- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987] +- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266] +- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231] + +[rfc-2616]: https://tools.ietf.org/html/rfc2616 +[rfc-5987]: https://tools.ietf.org/html/rfc5987 +[rfc-6266]: https://tools.ietf.org/html/rfc6266 +[tc-2231]: http://greenbytes.de/tech/tc2231/ + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-disposition.svg?style=flat +[npm-url]: https://npmjs.org/package/content-disposition +[node-version-image]: https://img.shields.io/node/v/content-disposition.svg?style=flat +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/content-disposition +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master +[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg?style=flat +[downloads-url]: https://npmjs.org/package/content-disposition diff --git a/node_modules/content-disposition/index.js b/node_modules/content-disposition/index.js new file mode 100755 index 00000000..88a0d0a2 --- /dev/null +++ b/node_modules/content-disposition/index.js @@ -0,0 +1,445 @@ +/*! + * content-disposition + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = contentDisposition +module.exports.parse = parse + +/** + * Module dependencies. + */ + +var basename = require('path').basename + +/** + * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") + */ + +var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex + +/** + * RegExp to match percent encoding escape. + */ + +var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/ +var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g + +/** + * RegExp to match non-latin1 characters. + */ + +var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g + +/** + * RegExp to match quoted-pair in RFC 2616 + * + * quoted-pair = "\" CHAR + * CHAR = + */ + +var QESC_REGEXP = /\\([\u0000-\u007f])/g + +/** + * RegExp to match chars that must be quoted-pair in RFC 2616 + */ + +var QUOTE_REGEXP = /([\\"])/g + +/** + * RegExp for various RFC 2616 grammar + * + * parameter = token "=" ( token | quoted-string ) + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) + * qdtext = > + * quoted-pair = "\" CHAR + * CHAR = + * TEXT = + * LWS = [CRLF] 1*( SP | HT ) + * CRLF = CR LF + * CR = + * LF = + * SP = + * HT = + * CTL = + * OCTET = + */ + +var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex +var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/ +var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/ + +/** + * RegExp for various RFC 5987 grammar + * + * ext-value = charset "'" [ language ] "'" value-chars + * charset = "UTF-8" / "ISO-8859-1" / mime-charset + * mime-charset = 1*mime-charsetc + * mime-charsetc = ALPHA / DIGIT + * / "!" / "#" / "$" / "%" / "&" + * / "+" / "-" / "^" / "_" / "`" + * / "{" / "}" / "~" + * language = ( 2*3ALPHA [ extlang ] ) + * / 4ALPHA + * / 5*8ALPHA + * extlang = *3( "-" 3ALPHA ) + * value-chars = *( pct-encoded / attr-char ) + * pct-encoded = "%" HEXDIG HEXDIG + * attr-char = ALPHA / DIGIT + * / "!" / "#" / "$" / "&" / "+" / "-" / "." + * / "^" / "_" / "`" / "|" / "~" + */ + +var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/ + +/** + * RegExp for various RFC 6266 grammar + * + * disposition-type = "inline" | "attachment" | disp-ext-type + * disp-ext-type = token + * disposition-parm = filename-parm | disp-ext-parm + * filename-parm = "filename" "=" value + * | "filename*" "=" ext-value + * disp-ext-parm = token "=" value + * | ext-token "=" ext-value + * ext-token = + */ + +var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex + +/** + * Create an attachment Content-Disposition header. + * + * @param {string} [filename] + * @param {object} [options] + * @param {string} [options.type=attachment] + * @param {string|boolean} [options.fallback=true] + * @return {string} + * @api public + */ + +function contentDisposition (filename, options) { + var opts = options || {} + + // get type + var type = opts.type || 'attachment' + + // get parameters + var params = createparams(filename, opts.fallback) + + // format into string + return format(new ContentDisposition(type, params)) +} + +/** + * Create parameters object from filename and fallback. + * + * @param {string} [filename] + * @param {string|boolean} [fallback=true] + * @return {object} + * @api private + */ + +function createparams (filename, fallback) { + if (filename === undefined) { + return + } + + var params = {} + + if (typeof filename !== 'string') { + throw new TypeError('filename must be a string') + } + + // fallback defaults to true + if (fallback === undefined) { + fallback = true + } + + if (typeof fallback !== 'string' && typeof fallback !== 'boolean') { + throw new TypeError('fallback must be a string or boolean') + } + + if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) { + throw new TypeError('fallback must be ISO-8859-1 string') + } + + // restrict to file base name + var name = basename(filename) + + // determine if name is suitable for quoted string + var isQuotedString = TEXT_REGEXP.test(name) + + // generate fallback name + var fallbackName = typeof fallback !== 'string' + ? fallback && getlatin1(name) + : basename(fallback) + var hasFallback = typeof fallbackName === 'string' && fallbackName !== name + + // set extended filename parameter + if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) { + params['filename*'] = name + } + + // set filename parameter + if (isQuotedString || hasFallback) { + params.filename = hasFallback + ? fallbackName + : name + } + + return params +} + +/** + * Format object to Content-Disposition header. + * + * @param {object} obj + * @param {string} obj.type + * @param {object} [obj.parameters] + * @return {string} + * @api private + */ + +function format (obj) { + var parameters = obj.parameters + var type = obj.type + + if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) { + throw new TypeError('invalid type') + } + + // start with normalized type + var string = String(type).toLowerCase() + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + var val = param.substr(-1) === '*' + ? ustring(parameters[param]) + : qstring(parameters[param]) + + string += '; ' + param + '=' + val + } + } + + return string +} + +/** + * Decode a RFC 6987 field value (gracefully). + * + * @param {string} str + * @return {string} + * @api private + */ + +function decodefield (str) { + var match = EXT_VALUE_REGEXP.exec(str) + + if (!match) { + throw new TypeError('invalid extended field value') + } + + var charset = match[1].toLowerCase() + var encoded = match[2] + var value + + // to binary string + var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode) + + switch (charset) { + case 'iso-8859-1': + value = getlatin1(binary) + break + case 'utf-8': + value = new Buffer(binary, 'binary').toString('utf8') + break + default: + throw new TypeError('unsupported charset in extended field') + } + + return value +} + +/** + * Get ISO-8859-1 version of string. + * + * @param {string} val + * @return {string} + * @api private + */ + +function getlatin1 (val) { + // simple Unicode -> ISO-8859-1 transformation + return String(val).replace(NON_LATIN1_REGEXP, '?') +} + +/** + * Parse Content-Disposition header string. + * + * @param {string} string + * @return {object} + * @api private + */ + +function parse (string) { + if (!string || typeof string !== 'string') { + throw new TypeError('argument string is required') + } + + var match = DISPOSITION_TYPE_REGEXP.exec(string) + + if (!match) { + throw new TypeError('invalid type format') + } + + // normalize type + var index = match[0].length + var type = match[1].toLowerCase() + + var key + var names = [] + var params = {} + var value + + // calculate index to start at + index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';' + ? index - 1 + : index + + // match parameters + while ((match = PARAM_REGEXP.exec(string))) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (names.indexOf(key) !== -1) { + throw new TypeError('invalid duplicate parameter') + } + + names.push(key) + + if (key.indexOf('*') + 1 === key.length) { + // decode extended value + key = key.slice(0, -1) + value = decodefield(value) + + // overwrite existing value + params[key] = value + continue + } + + if (typeof params[key] === 'string') { + continue + } + + if (value[0] === '"') { + // remove quotes and escapes + value = value + .substr(1, value.length - 2) + .replace(QESC_REGEXP, '$1') + } + + params[key] = value + } + + if (index !== -1 && index !== string.length) { + throw new TypeError('invalid parameter format') + } + + return new ContentDisposition(type, params) +} + +/** + * Percent decode a single character. + * + * @param {string} str + * @param {string} hex + * @return {string} + * @api private + */ + +function pdecode (str, hex) { + return String.fromCharCode(parseInt(hex, 16)) +} + +/** + * Percent encode a single character. + * + * @param {string} char + * @return {string} + * @api private + */ + +function pencode (char) { + var hex = String(char) + .charCodeAt(0) + .toString(16) + .toUpperCase() + return hex.length === 1 + ? '%0' + hex + : '%' + hex +} + +/** + * Quote a string for HTTP. + * + * @param {string} val + * @return {string} + * @api private + */ + +function qstring (val) { + var str = String(val) + + return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' +} + +/** + * Encode a Unicode string for HTTP (RFC 5987). + * + * @param {string} val + * @return {string} + * @api private + */ + +function ustring (val) { + var str = String(val) + + // percent encode as UTF-8 + var encoded = encodeURIComponent(str) + .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode) + + return 'UTF-8\'\'' + encoded +} + +/** + * Class for parsed Content-Disposition header for v8 optimization + */ + +function ContentDisposition (type, parameters) { + this.type = type + this.parameters = parameters +} diff --git a/node_modules/content-disposition/package.json b/node_modules/content-disposition/package.json new file mode 100755 index 00000000..87e09884 --- /dev/null +++ b/node_modules/content-disposition/package.json @@ -0,0 +1,110 @@ +{ + "_args": [ + [ + { + "raw": "content-disposition@0.5.2", + "scope": null, + "escapedName": "content-disposition", + "name": "content-disposition", + "rawSpec": "0.5.2", + "spec": "0.5.2", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "content-disposition@0.5.2", + "_id": "content-disposition@0.5.2", + "_inCache": true, + "_location": "/content-disposition", + "_nodeVersion": "4.6.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/content-disposition-0.5.2.tgz_1481246224565_0.35659545403905213" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "content-disposition@0.5.2", + "scope": null, + "escapedName": "content-disposition", + "name": "content-disposition", + "rawSpec": "0.5.2", + "spec": "0.5.2", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "_shasum": "0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4", + "_shrinkwrap": null, + "_spec": "content-disposition@0.5.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "bugs": { + "url": "https://github.com/jshttp/content-disposition/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "Create and parse Content-Disposition header", + "devDependencies": { + "eslint": "3.11.1", + "eslint-config-standard": "6.2.1", + "eslint-plugin-promise": "3.3.0", + "eslint-plugin-standard": "2.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4", + "tarball": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "2a08417377cf55678c9f870b305f3c6c088920f3", + "homepage": "https://github.com/jshttp/content-disposition#readme", + "keywords": [ + "content-disposition", + "http", + "rfc6266", + "res" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "content-disposition", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/content-disposition.git" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "0.5.2" +} diff --git a/node_modules/content-type/HISTORY.md b/node_modules/content-type/HISTORY.md new file mode 100755 index 00000000..01652ff4 --- /dev/null +++ b/node_modules/content-type/HISTORY.md @@ -0,0 +1,14 @@ +1.0.2 / 2016-05-09 +================== + + * perf: enable strict mode + +1.0.1 / 2015-02-13 +================== + + * Improve missing `Content-Type` header error message + +1.0.0 / 2015-02-01 +================== + + * Initial implementation, derived from `media-typer@0.3.0` diff --git a/node_modules/content-type/LICENSE b/node_modules/content-type/LICENSE new file mode 100755 index 00000000..34b1a2de --- /dev/null +++ b/node_modules/content-type/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/content-type/README.md b/node_modules/content-type/README.md new file mode 100755 index 00000000..3ed67413 --- /dev/null +++ b/node_modules/content-type/README.md @@ -0,0 +1,92 @@ +# content-type + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create and parse HTTP Content-Type header according to RFC 7231 + +## Installation + +```sh +$ npm install content-type +``` + +## API + +```js +var contentType = require('content-type') +``` + +### contentType.parse(string) + +```js +var obj = contentType.parse('image/svg+xml; charset=utf-8') +``` + +Parse a content type string. This will return an object with the following +properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The media type (the type and subtype, always lower case). + Example: `'image/svg+xml'` + + - `parameters`: An object of the parameters in the media type (name of parameter + always lower case). Example: `{charset: 'utf-8'}` + +Throws a `TypeError` if the string is missing or invalid. + +### contentType.parse(req) + +```js +var obj = contentType.parse(req) +``` + +Parse the `content-type` header from the given `req`. Short-cut for +`contentType.parse(req.headers['content-type'])`. + +Throws a `TypeError` if the `Content-Type` header is missing or invalid. + +### contentType.parse(res) + +```js +var obj = contentType.parse(res) +``` + +Parse the `content-type` header set on the given `res`. Short-cut for +`contentType.parse(res.getHeader('content-type'))`. + +Throws a `TypeError` if the `Content-Type` header is missing or invalid. + +### contentType.format(obj) + +```js +var str = contentType.format({type: 'image/svg+xml'}) +``` + +Format an object into a content type string. This will return a string of the +content type for the given object with the following properties (examples are +shown that produce the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'` + + - `parameters`: An object of the parameters in the media type (name of the + parameter will be lower-cased). Example: `{charset: 'utf-8'}` + +Throws a `TypeError` if the object contains an invalid type or parameter names. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-type.svg +[npm-url]: https://npmjs.org/package/content-type +[node-version-image]: https://img.shields.io/node/v/content-type.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg +[travis-url]: https://travis-ci.org/jshttp/content-type +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/content-type +[downloads-image]: https://img.shields.io/npm/dm/content-type.svg +[downloads-url]: https://npmjs.org/package/content-type diff --git a/node_modules/content-type/index.js b/node_modules/content-type/index.js new file mode 100755 index 00000000..61ba6b5a --- /dev/null +++ b/node_modules/content-type/index.js @@ -0,0 +1,216 @@ +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 + * + * parameter = token "=" ( token / quoted-string ) + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE + * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text + * obs-text = %x80-FF + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + */ +var paramRegExp = /; *([!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+) */g +var textRegExp = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ +var tokenRegExp = /^[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+$/ + +/** + * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 + * + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + * obs-text = %x80-FF + */ +var qescRegExp = /\\([\u000b\u0020-\u00ff])/g + +/** + * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6 + */ +var quoteRegExp = /([\\"])/g + +/** + * RegExp to match type in RFC 6838 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ +var typeRegExp = /^[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+\/[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+$/ + +/** + * Module exports. + * @public + */ + +exports.format = format +exports.parse = parse + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format(obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var parameters = obj.parameters + var type = obj.type + + if (!type || !typeRegExp.test(type)) { + throw new TypeError('invalid type') + } + + var string = type + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + if (!tokenRegExp.test(param)) { + throw new TypeError('invalid parameter name') + } + + string += '; ' + param + '=' + qstring(parameters[param]) + } + } + + return string +} + +/** + * Parse media type to object. + * + * @param {string|object} string + * @return {Object} + * @public + */ + +function parse(string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string === 'object') { + // support req/res-like objects as argument + string = getcontenttype(string) + + if (typeof string !== 'string') { + throw new TypeError('content-type header is missing from object'); + } + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var index = string.indexOf(';') + var type = index !== -1 + ? string.substr(0, index).trim() + : string.trim() + + if (!typeRegExp.test(type)) { + throw new TypeError('invalid media type') + } + + var key + var match + var obj = new ContentType(type.toLowerCase()) + var value + + paramRegExp.lastIndex = index + + while (match = paramRegExp.exec(string)) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (value[0] === '"') { + // remove quotes and escapes + value = value + .substr(1, value.length - 2) + .replace(qescRegExp, '$1') + } + + obj.parameters[key] = value + } + + if (index !== -1 && index !== string.length) { + throw new TypeError('invalid parameter format') + } + + return obj +} + +/** + * Get content-type from req/res objects. + * + * @param {object} + * @return {Object} + * @private + */ + +function getcontenttype(obj) { + if (typeof obj.getHeader === 'function') { + // res-like + return obj.getHeader('content-type') + } + + if (typeof obj.headers === 'object') { + // req-like + return obj.headers && obj.headers['content-type'] + } +} + +/** + * Quote a string if necessary. + * + * @param {string} val + * @return {string} + * @private + */ + +function qstring(val) { + var str = String(val) + + // no need to quote tokens + if (tokenRegExp.test(str)) { + return str + } + + if (str.length > 0 && !textRegExp.test(str)) { + throw new TypeError('invalid parameter value') + } + + return '"' + str.replace(quoteRegExp, '\\$1') + '"' +} + +/** + * Class to represent a content type. + * @private + */ +function ContentType(type) { + this.parameters = Object.create(null) + this.type = type +} diff --git a/node_modules/content-type/package.json b/node_modules/content-type/package.json new file mode 100755 index 00000000..60daeda7 --- /dev/null +++ b/node_modules/content-type/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + { + "raw": "content-type@~1.0.2", + "scope": null, + "escapedName": "content-type", + "name": "content-type", + "rawSpec": "~1.0.2", + "spec": ">=1.0.2 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "content-type@>=1.0.2 <1.1.0", + "_id": "content-type@1.0.2", + "_inCache": true, + "_location": "/content-type", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/content-type-1.0.2.tgz_1462852785748_0.5491233412176371" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "raw": "content-type@~1.0.2", + "scope": null, + "escapedName": "content-type", + "name": "content-type", + "rawSpec": "~1.0.2", + "spec": ">=1.0.2 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", + "_shasum": "b7d113aee7a8dd27bd21133c4dc2529df1721eed", + "_shrinkwrap": null, + "_spec": "content-type@~1.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "bugs": { + "url": "https://github.com/jshttp/content-type/issues" + }, + "dependencies": {}, + "description": "Create and parse HTTP Content-Type header", + "devDependencies": { + "istanbul": "0.4.3", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "b7d113aee7a8dd27bd21133c4dc2529df1721eed", + "tarball": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "8118763adfbbac80cf1254191889330aec8b8be7", + "homepage": "https://github.com/jshttp/content-type#readme", + "keywords": [ + "content-type", + "http", + "req", + "res", + "rfc7231" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "content-type", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/content-type.git" + }, + "scripts": { + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + }, + "version": "1.0.2" +} diff --git a/node_modules/convert-source-map/.npmignore b/node_modules/convert-source-map/.npmignore new file mode 100755 index 00000000..de78e273 --- /dev/null +++ b/node_modules/convert-source-map/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log +tmp diff --git a/node_modules/convert-source-map/.travis.yml b/node_modules/convert-source-map/.travis.yml new file mode 100755 index 00000000..86bd2006 --- /dev/null +++ b/node_modules/convert-source-map/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4" + - "6" + - "node" diff --git a/node_modules/convert-source-map/LICENSE b/node_modules/convert-source-map/LICENSE new file mode 100755 index 00000000..41702c50 --- /dev/null +++ b/node_modules/convert-source-map/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/convert-source-map/README.md b/node_modules/convert-source-map/README.md new file mode 100755 index 00000000..2a2b6e7a --- /dev/null +++ b/node_modules/convert-source-map/README.md @@ -0,0 +1,125 @@ +# convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.png)](http://travis-ci.org/thlorenz/convert-source-map) + +[![NPM](https://nodei.co/npm/convert-source-map.png?downloads=true&stars=true)](https://nodei.co/npm/convert-source-map/) + +Converts a source-map from/to different formats and allows adding/changing properties. + +```js +var convert = require('convert-source-map'); + +var json = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .toJSON(); + +var modified = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .setProperty('sources', [ 'SRC/FOO.JS' ]) + .toJSON(); + +console.log(json); +console.log(modified); +``` + +```json +{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +``` + +## API + +### fromObject(obj) + +Returns source map converter from given object. + +### fromJSON(json) + +Returns source map converter from given json string. + +### fromBase64(base64) + +Returns source map converter from given base64 encoded json string. + +### fromComment(comment) + +Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`. + +### fromMapFileComment(comment, mapFileDir) + +Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. + +`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the +generated file, i.e. the one containing the source map. + +### fromSource(source) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. + +### fromMapFileSource(source, mapFileDir) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was +found. + +The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see +fromMapFileComment. + +### toObject() + +Returns a copy of the underlying source map. + +### toJSON([space]) + +Converts source map to json string. If `space` is given (optional), this will be passed to +[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the +JSON string is generated. + +### toBase64() + +Converts source map to base64 encoded json string. + +### toComment([options]) + +Converts source map to an inline comment that can be appended to the source-file. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would +normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + +### addProperty(key, value) + +Adds given property to the source map. Throws an error if property already exists. + +### setProperty(key, value) + +Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. + +### getProperty(key) + +Gets given property of the source map. + +### removeComments(src) + +Returns `src` with all source map comments removed + +### removeMapFileComments(src) + +Returns `src` with all source map comments pointing to map files removed. + +### commentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments. + +### mapFileCommentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files. + +### generateMapFileComment(file, [options]) + +Returns a comment that links to an external source map via `file`. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/node_modules/convert-source-map/example/comment-to-json.js b/node_modules/convert-source-map/example/comment-to-json.js new file mode 100755 index 00000000..a9bc2f12 --- /dev/null +++ b/node_modules/convert-source-map/example/comment-to-json.js @@ -0,0 +1,15 @@ +'use strict'; + +var convert = require('..'); + +var json = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .toJSON(); + +var modified = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .setProperty('sources', [ 'SRC/FOO.JS' ]) + .toJSON(); + +console.log(json); +console.log(modified); diff --git a/node_modules/convert-source-map/index.js b/node_modules/convert-source-map/index.js new file mode 100755 index 00000000..e171a673 --- /dev/null +++ b/node_modules/convert-source-map/index.js @@ -0,0 +1,136 @@ +'use strict'; +var fs = require('fs'); +var path = require('path'); + +Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg; + } +}); + +Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + //Example (Extra space between slashes added to solve Safari bug. Exclude space in production): + // / /# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */ + return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg; + } +}); + + +function decodeBase64(base64) { + return new Buffer(base64, 'base64').toString(); +} + +function stripComment(sm) { + return sm.split(',').pop(); +} + +function readFromFileMap(sm, dir) { + // NOTE: this will only work on the server since it attempts to read the map file + + var r = exports.mapFileCommentRegex.exec(sm); + + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + var filepath = path.resolve(dir, filename); + + try { + return fs.readFileSync(filepath, 'utf8'); + } catch (e) { + throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); + } +} + +function Converter (sm, opts) { + opts = opts || {}; + + if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); + if (opts.hasComment) sm = stripComment(sm); + if (opts.isEncoded) sm = decodeBase64(sm); + if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); + + this.sourcemap = sm; +} + +Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); +}; + +Converter.prototype.toBase64 = function () { + var json = this.toJSON(); + return new Buffer(json).toString('base64'); +}; + +Converter.prototype.toComment = function (options) { + var base64 = this.toBase64(); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; + +// returns copy instead of original +Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); +}; + +Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); +}; + +Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; +}; + +Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; +}; + +exports.fromObject = function (obj) { + return new Converter(obj); +}; + +exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); +}; + +exports.fromBase64 = function (base64) { + return new Converter(base64, { isEncoded: true }); +}; + +exports.fromComment = function (comment) { + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + + return new Converter(comment, { isEncoded: true, hasComment: true }); +}; + +exports.fromMapFileComment = function (comment, dir) { + return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromMapFileSource = function (content, dir) { + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), dir) : null; +}; + +exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); +}; + +exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); +}; + +exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; diff --git a/node_modules/convert-source-map/package.json b/node_modules/convert-source-map/package.json new file mode 100755 index 00000000..51780cbc --- /dev/null +++ b/node_modules/convert-source-map/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "convert-source-map@^1.1.0", + "scope": null, + "escapedName": "convert-source-map", + "name": "convert-source-map", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core" + ] + ], + "_from": "convert-source-map@>=1.1.0 <2.0.0", + "_id": "convert-source-map@1.5.0", + "_inCache": true, + "_location": "/convert-source-map", + "_nodeVersion": "6.7.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/convert-source-map-1.5.0.tgz_1490692105417_0.5890450305305421" + }, + "_npmUser": { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "convert-source-map@^1.1.0", + "scope": null, + "escapedName": "convert-source-map", + "name": "convert-source-map", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-core" + ], + "_resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", + "_shasum": "9acd70851c6d5dfdd93d9282e5edf94a03ff46b5", + "_shrinkwrap": null, + "_spec": "convert-source-map@^1.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core", + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, + "bugs": { + "url": "https://github.com/thlorenz/convert-source-map/issues" + }, + "dependencies": {}, + "description": "Converts a source-map from/to different formats and allows adding/changing properties.", + "devDependencies": { + "inline-source-map": "~0.6.2", + "tap": "~9.0.0" + }, + "directories": {}, + "dist": { + "shasum": "9acd70851c6d5dfdd93d9282e5edf94a03ff46b5", + "tarball": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz" + }, + "engine": { + "node": ">=0.6" + }, + "gitHead": "0d7a26b124913e29f073c18253942a7429608e8e", + "homepage": "https://github.com/thlorenz/convert-source-map", + "keywords": [ + "convert", + "sourcemap", + "source", + "map", + "browser", + "debug" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + } + ], + "name": "convert-source-map", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/convert-source-map.git" + }, + "scripts": { + "test": "tap test/*.js --color" + }, + "version": "1.5.0" +} diff --git a/node_modules/convert-source-map/test/comment-regex.js b/node_modules/convert-source-map/test/comment-regex.js new file mode 100755 index 00000000..7e588dad --- /dev/null +++ b/node_modules/convert-source-map/test/comment-regex.js @@ -0,0 +1,137 @@ +'use strict'; +/*jshint asi: true */ + +var test = require('tap').test + , generator = require('inline-source-map') + , convert = require('..') + +function comment(prefix, suffix) { + var rx = convert.commentRegex; + return rx.test(prefix + 'sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + suffix) +} + +function commentWithCharSet(prefix, suffix, sep) { + sep = sep || ':'; + var rx = convert.commentRegex; + return rx.test(prefix + 'sourceMappingURL=data:application/json;charset' + sep +'utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + suffix) +} + +// Source Map v2 Tests +test('comment regex old spec - @', function (t) { + [ + '//@ ', + ' //@ ', // with leading space + '\t//@ ', // with leading tab + '//@ ', // with leading text + '/*@ ', // multi line style + ' /*@ ', // multi line style with leading spaces + '\t/*@ ', // multi line style with leading tab + '/*@ ', // multi line style with leading text + ].forEach(function (x) { + t.ok(comment(x, ''), 'matches ' + x) + t.ok(commentWithCharSet(x, ''), 'matches ' + x + ' with charset') + t.ok(commentWithCharSet(x, '', '='), 'matches ' + x + ' with charset') + }); + + [ + ' @// @', + ' @/* @', + ].forEach(function (x) { t.ok(!comment(x, ''), 'should not match ' + x) }) + + t.end() +}) + +test('comment regex new spec - #', function (t) { + [ + ' //# ', // with leading spaces + '\t//# ', // with leading tab + '//# ', // with leading text + '/*# ', // multi line style + ' /*# ', // multi line style with leading spaces + '\t/*# ', // multi line style with leading tab + '/*# ', // multi line style with leading text + ].forEach(function (x) { + t.ok(comment(x, ''), 'matches ' + x) + t.ok(commentWithCharSet(x, ''), 'matches ' + x + ' with charset') + t.ok(commentWithCharSet(x, '', '='), 'matches ' + x + ' with charset') + }); + + [ + ' #// #', + ' #/* #', + ].forEach(function (x) { t.ok(!comment(x, ''), 'should not match ' + x) }) + + t.end() +}) + +function mapFileCommentWrap(s1, s2) { + var mapFileRx = convert.mapFileCommentRegex; + return mapFileRx.test(s1 + 'sourceMappingURL=foo.js.map' + s2) +} + +test('mapFileComment regex old spec - @', function (t) { + + [ + ['//@ ', ''], + [' //@ ', ''], // with leading spaces + ['\t//@ ', ''], // with a leading tab + ['///@ ', ''], // with a leading text + [';//@ ', ''], // with a leading text + ['return//@ ', ''], // with a leading text + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ + [' @// @', ''], + ['var sm = "//@ ', '"'], // not inside a string + ['var sm = \'//@ ', '\''], // not inside a string + ['var sm = \' //@ ', '\''], // not inside a string + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }) + t.end() +}) + +test('mapFileComment regex new spec - #', function (t) { + [ + ['//# ', ''], + [' //# ', ''], // with leading space + ['\t//# ', ''], // with leading tab + ['///# ', ''], // with leading text + [';//# ', ''], // with leading text + ['return//# ', ''], // with leading text + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ + [' #// #', ''], + ['var sm = "//# ', '"'], // not inside a string + ['var sm = \'//# ', '\''], // not inside a string + ['var sm = \' //# ', '\''], // not inside a string + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }) + t.end() +}) + +test('mapFileComment regex /* */ old spec - @', function (t) { + [ [ '/*@ ', '*/' ] + , [' /*@ ', ' */ ' ] // with leading spaces + , [ '\t/*@ ', ' \t*/\t '] // with a leading tab + , [ 'leading string/*@ ', '*/' ] // with a leading string + , [ '/*@ ', ' \t*/\t '] // with trailing whitespace + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ ['/*@ ', ' */ */ ' ], // not the last thing on its line + ['/*@ ', ' */ more text ' ] // not the last thing on its line + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); + t.end() +}) + +test('mapFileComment regex /* */ new spec - #', function (t) { + [ [ '/*# ', '*/' ] + , [' /*# ', ' */ ' ] // with leading spaces + , [ '\t/*# ', ' \t*/\t '] // with a leading tab + , [ 'leading string/*# ', '*/' ] // with a leading string + , [ '/*# ', ' \t*/\t '] // with trailing whitespace + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ ['/*# ', ' */ */ ' ], // not the last thing on its line + ['/*# ', ' */ more text ' ] // not the last thing on its line + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); + t.end() +}) diff --git a/node_modules/convert-source-map/test/convert-source-map.js b/node_modules/convert-source-map/test/convert-source-map.js new file mode 100755 index 00000000..d57d69d1 --- /dev/null +++ b/node_modules/convert-source-map/test/convert-source-map.js @@ -0,0 +1,255 @@ +'use strict'; +/*jshint asi: true */ + +var test = require('tap').test + , generator = require('inline-source-map') + , convert = require('..') + +var gen = generator({charset:"utf-8"}) + .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) + .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }) + + , base64 = gen.base64Encode() + , comment = gen.inlineMappingUrl() + , json = gen.toString() + , obj = JSON.parse(json) + +test('different formats', function (t) { + + t.equal(convert.fromComment(comment).toComment(), comment, 'comment -> comment') + t.equal(convert.fromComment(comment).toBase64(), base64, 'comment -> base64') + t.equal(convert.fromComment(comment).toJSON(), json, 'comment -> json') + t.deepEqual(convert.fromComment(comment).toObject(), obj, 'comment -> object') + + t.equal(convert.fromBase64(base64).toBase64(), base64, 'base64 -> base64') + t.equal(convert.fromBase64(base64).toComment(), comment, 'base64 -> comment') + t.equal(convert.fromBase64(base64).toJSON(), json, 'base64 -> json') + t.deepEqual(convert.fromBase64(base64).toObject(), obj, 'base64 -> object') + + t.equal(convert.fromJSON(json).toJSON(), json, 'json -> json') + t.equal(convert.fromJSON(json).toBase64(), base64, 'json -> base64') + t.equal(convert.fromJSON(json).toComment(), comment, 'json -> comment') + t.deepEqual(convert.fromJSON(json).toObject(), obj, 'json -> object') + t.end() +}) + +test('to object returns a copy', function (t) { + var c = convert.fromJSON(json) + var o = c.toObject() + o.version = '99'; + t.equal(c.toObject().version, 3, 'setting property on returned object does not affect original') + t.end() +}) + +test('to multi-line map', function (t) { + var c = convert.fromObject(obj); + var s = c.toComment({ multiline: true }); + t.similar(s, /^\/\*# sourceMappingURL=.+ \*\/$/); + t.end(); +}) + +test('to map file comment', function (t) { + t.equal(convert.generateMapFileComment('index.js.map'), '//# sourceMappingURL=index.js.map'); + t.equal(convert.generateMapFileComment('index.css.map', { multiline: true }), '/*# sourceMappingURL=index.css.map */'); + t.end(); +}) + +test('from source', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , map = '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , otherMap = '//# sourceMappingURL=data:application/json;charset=utf-8;base64,otherZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + + function getComment(src) { + var map = convert.fromSource(src); + return map ? map.toComment() : null; + } + + t.equal(getComment(foo), null, 'no comment returns null') + t.equal(getComment(foo + map), map, 'beginning of last line') + t.equal(getComment(foo + ' ' + map), map, 'indented of last line') + t.equal(getComment(foo + ' ' + map + '\n\n'), map, 'indented on last non empty line') + t.equal(getComment(foo + map + '\nconsole.log("more code");\nfoo()\n'), map, 'in the middle of code') + t.equal(getComment(foo + otherMap + '\n' + map), map, 'finds last map in source') + t.end() +}) + +test('from source with a large source', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , map = '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , otherMap = '//# sourceMappingURL=data:application/json;charset=utf-8;base64,otherZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + + function getComment(src) { + var map = convert.fromSource(src, true); + return map ? map.toComment() : null; + } + + t.equal(getComment(foo), null, 'no comment returns null') + t.equal(getComment(foo + map), map, 'beginning of last line') + t.equal(getComment(foo + ' ' + map), map, 'indented of last line') + t.equal(getComment(foo + ' ' + map + '\n\n'), map, 'indented on last non empty line') + t.equal(getComment(foo + map + '\nconsole.log("more code");\nfoo()\n'), map, 'in the middle of code') + t.equal(getComment(foo + otherMap + '\n' + map), map, 'finds last map in source') + t.end() +}) + +test('remove comments', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + // this one is old spec on purpose + , map = '//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , otherMap = '//# sourceMappingURL=data:application/json;base64,ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , extraCode = '\nconsole.log("more code");\nfoo()\n' + + t.equal(convert.removeComments(foo + map), foo, 'from last line') + t.equal(convert.removeComments(foo + map + extraCode), foo + extraCode, 'from the middle of code') + t.equal(convert.removeComments(foo + otherMap + extraCode + map), foo + extraCode, 'multiple comments from the middle of code') + t.end() +}) + +test('remove map file comments', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , fileMap1 = '//# sourceMappingURL=foo.js.map' + , fileMap2 = '/*# sourceMappingURL=foo.js.map */'; + + t.equal(convert.removeMapFileComments(foo + fileMap1), foo, '// style filemap comment') + t.equal(convert.removeMapFileComments(foo + fileMap2), foo, '/* */ style filemap comment') + t.end() +}) + +test('pretty json', function (t) { + var mod = convert.fromJSON(json).toJSON(2) + , expected = JSON.stringify(obj, null, 2); + + t.equal( + mod + , expected + , 'pretty prints json when space is given') + t.end() +}) + +test('adding properties', function (t) { + var mod = convert + .fromJSON(json) + .addProperty('foo', 'bar') + .toJSON() + , expected = JSON.parse(json); + expected.foo = 'bar'; + t.equal( + mod + , JSON.stringify(expected) + , 'includes added property' + ) + t.end() +}) + +test('setting properties', function (t) { + var mod = convert + .fromJSON(json) + .setProperty('version', '2') + .setProperty('mappings', ';;;UACG') + .setProperty('should add', 'this') + .toJSON() + , expected = JSON.parse(json); + expected.version = '2'; + expected.mappings = ';;;UACG'; + expected['should add'] = 'this'; + t.equal( + mod + , JSON.stringify(expected) + , 'includes new property and changes existing properties' + ) + t.end() +}) + +test('getting properties', function (t) { + var sm = convert.fromJSON(json) + + t.equal(sm.getProperty('version'), 3, 'gets version') + t.deepEqual(sm.getProperty('sources'), ['foo.js', 'bar.js'], 'gets sources') + t.end() +}) + +test('return null fromSource when largeSource is true', function(t) { + var mod = convert.fromSource('', true) + , expected = null; + + t.equal( + mod + , expected + , 'return value should be null' + ) + t.end() +}) + +test('commentRegex returns new RegExp on each get', function(t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , map = '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , re = convert.commentRegex + + re.exec(foo + map) + + t.equal(re.lastIndex, 372, 'has an updated lastIndex') + t.equal(convert.commentRegex.lastIndex, 0, 'a fresh RegExp has lastIndex of 0') + + t.end() +}) + +test('mapFileCommentRegex returns new RegExp on each get', function(t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , map = '//# sourceMappingURL=foo.js.map' + , re = convert.mapFileCommentRegex + + re.exec(foo + map) + + t.equal(re.lastIndex, 119, 'has an updated lastIndex') + t.equal(convert.mapFileCommentRegex.lastIndex, 0, 'a fresh RegExp has lastIndex of 0') + + t.end() +}) diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css b/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css new file mode 100755 index 00000000..e7779916 --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css @@ -0,0 +1,14 @@ +.header { + background: #444; + border: solid; + padding: 10px; + border-radius: 10px 5px 10px 5px; + color: #b4b472; } + +#main li { + color: green; + margin: 10px; + padding: 10px; + font-size: 18px; } + +//# sourceMappingURL=map-file-comment.css.map diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css b/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css new file mode 100755 index 00000000..1e61b241 --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css @@ -0,0 +1,14 @@ +.header { + background: #444; + border: solid; + padding: 10px; + border-radius: 10px 5px 10px 5px; + color: #b4b472; } + +#main li { + color: green; + margin: 10px; + padding: 10px; + font-size: 18px; } + +/*# sourceMappingURL=data:application/json;base64,ewoidmVyc2lvbiI6ICIzIiwKIm1hcHBpbmdzIjogIkFBQUEsd0JBQXlCO0VBQ3ZCLFVBQVUsRUFBRSxJQUFJO0VBQ2hCLE1BQU0sRUFBRSxLQUFLO0VBQ2IsT0FBTyxFQUFFLElBQUk7RUFDYixhQUFhLEVBQUUsaUJBQWlCO0VBQ2hDLEtBQUssRUFBRSxPQUFrQjs7QUFHM0Isd0JBQXlCO0VBQ3ZCLE9BQU8sRUFBRSxJQUFJOztBQ1RmLGdCQUFpQjtFQUNmLFVBQVUsRUFBRSxJQUFJO0VBQ2hCLEtBQUssRUFBRSxNQUFNOztBQUdmLGtCQUFtQjtFQUNqQixNQUFNLEVBQUUsSUFBSTtFQUNaLE9BQU8sRUFBRSxJQUFJO0VBQ2IsVUFBVSxFQUFFLEtBQUs7RUFDakIsYUFBYSxFQUFFLEdBQUc7RUFDbEIsS0FBSyxFQUFFLEtBQUs7O0FBRWQsa0JBQW1CO0VBQ2pCLEtBQUssRUFBRSxLQUFLOztBQUdkLG1CQUFvQjtFQUNsQixLQUFLLEVBQUUsS0FBSztFQUNaLE1BQU0sRUFBRSxJQUFJO0VBQ1osT0FBTyxFQUFFLElBQUk7RUFDYixTQUFTLEVBQUUsSUFBSSIsCiJzb3VyY2VzIjogWyIuL2NsaWVudC9zYXNzL2NvcmUuc2NzcyIsIi4vY2xpZW50L3Nhc3MvbWFpbi5zY3NzIl0sCiJmaWxlIjogIm1hcC1maWxlLWNvbW1lbnQuY3NzIgp9 */ diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment.css b/node_modules/convert-source-map/test/fixtures/map-file-comment.css new file mode 100755 index 00000000..8b282680 --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment.css @@ -0,0 +1,14 @@ +.header { + background: #444; + border: solid; + padding: 10px; + border-radius: 10px 5px 10px 5px; + color: #b4b472; } + +#main li { + color: green; + margin: 10px; + padding: 10px; + font-size: 18px; } + +/*# sourceMappingURL=map-file-comment.css.map */ diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map b/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map new file mode 100755 index 00000000..25950ea2 --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map @@ -0,0 +1,6 @@ +{ +"version": "3", +"mappings": "AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI", +"sources": ["./client/sass/core.scss","./client/sass/main.scss"], +"file": "map-file-comment.css" +} diff --git a/node_modules/convert-source-map/test/map-file-comment.js b/node_modules/convert-source-map/test/map-file-comment.js new file mode 100755 index 00000000..b4167877 --- /dev/null +++ b/node_modules/convert-source-map/test/map-file-comment.js @@ -0,0 +1,70 @@ +'use strict'; +/*jshint asi: true */ + +var test = require('tap').test + , rx = require('..') + , fs = require('fs') + , convert = require('..') + +test('\nresolving a "/*# sourceMappingURL=map-file-comment.css.map*/" style comment inside a given css content', function (t) { + var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment.css', 'utf8') + var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); + var sm = conv.toObject(); + + t.deepEqual( + sm.sources + , [ './client/sass/core.scss', + './client/sass/main.scss' ] + , 'resolves paths of original sources' + ) + + t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') + t.equal( + sm.mappings + , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' + , 'includes mappings' + ) + t.end() +}) + +test('\nresolving a "//# sourceMappingURL=map-file-comment.css.map" style comment inside a given css content', function (t) { + var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-double-slash.css', 'utf8') + var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); + var sm = conv.toObject(); + + t.deepEqual( + sm.sources + , [ './client/sass/core.scss', + './client/sass/main.scss' ] + , 'resolves paths of original sources' + ) + + t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') + t.equal( + sm.mappings + , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' + , 'includes mappings' + ) + t.end() +}) + +test('\nresolving a /*# sourceMappingURL=data:application/json;base64,... */ style comment inside a given css content', function(t) { + var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-inline.css', 'utf8') + var conv = convert.fromSource(css, __dirname + '/fixtures') + var sm = conv.toObject() + + t.deepEqual( + sm.sources + , [ './client/sass/core.scss', + './client/sass/main.scss' ] + , 'resolves paths of original sources' + ) + + t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') + t.equal( + sm.mappings + , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' + , 'includes mappings' + ) + t.end() +}) diff --git a/node_modules/cookie-signature/.npmignore b/node_modules/cookie-signature/.npmignore new file mode 100755 index 00000000..f1250e58 --- /dev/null +++ b/node_modules/cookie-signature/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/node_modules/cookie-signature/History.md b/node_modules/cookie-signature/History.md new file mode 100755 index 00000000..78513cc3 --- /dev/null +++ b/node_modules/cookie-signature/History.md @@ -0,0 +1,38 @@ +1.0.6 / 2015-02-03 +================== + +* use `npm test` instead of `make test` to run tests +* clearer assertion messages when checking input + + +1.0.5 / 2014-09-05 +================== + +* add license to package.json + +1.0.4 / 2014-06-25 +================== + + * corrected avoidance of timing attacks (thanks @tenbits!) + +1.0.3 / 2014-01-28 +================== + + * [incorrect] fix for timing attacks + +1.0.2 / 2014-01-28 +================== + + * fix missing repository warning + * fix typo in test + +1.0.1 / 2013-04-15 +================== + + * Revert "Changed underlying HMAC algo. to sha512." + * Revert "Fix for timing attacks on MAC verification." + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/cookie-signature/Readme.md b/node_modules/cookie-signature/Readme.md new file mode 100755 index 00000000..2559e841 --- /dev/null +++ b/node_modules/cookie-signature/Readme.md @@ -0,0 +1,42 @@ + +# cookie-signature + + Sign and unsign cookies. + +## Example + +```js +var cookie = require('cookie-signature'); + +var val = cookie.sign('hello', 'tobiiscool'); +val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI'); + +var val = cookie.sign('hello', 'tobiiscool'); +cookie.unsign(val, 'tobiiscool').should.equal('hello'); +cookie.unsign(val, 'luna').should.be.false; +``` + +## License + +(The MIT License) + +Copyright (c) 2012 LearnBoost <tj@learnboost.com> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/cookie-signature/index.js b/node_modules/cookie-signature/index.js new file mode 100755 index 00000000..b8c9463a --- /dev/null +++ b/node_modules/cookie-signature/index.js @@ -0,0 +1,51 @@ +/** + * Module dependencies. + */ + +var crypto = require('crypto'); + +/** + * Sign the given `val` with `secret`. + * + * @param {String} val + * @param {String} secret + * @return {String} + * @api private + */ + +exports.sign = function(val, secret){ + if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); + return val + '.' + crypto + .createHmac('sha256', secret) + .update(val) + .digest('base64') + .replace(/\=+$/, ''); +}; + +/** + * Unsign and decode the given `val` with `secret`, + * returning `false` if the signature is invalid. + * + * @param {String} val + * @param {String} secret + * @return {String|Boolean} + * @api private + */ + +exports.unsign = function(val, secret){ + if ('string' != typeof val) throw new TypeError("Signed cookie string must be provided."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); + var str = val.slice(0, val.lastIndexOf('.')) + , mac = exports.sign(str, secret); + + return sha1(mac) == sha1(val) ? str : false; +}; + +/** + * Private + */ + +function sha1(str){ + return crypto.createHash('sha1').update(str).digest('hex'); +} diff --git a/node_modules/cookie-signature/package.json b/node_modules/cookie-signature/package.json new file mode 100755 index 00000000..b7a68505 --- /dev/null +++ b/node_modules/cookie-signature/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + { + "raw": "cookie-signature@1.0.6", + "scope": null, + "escapedName": "cookie-signature", + "name": "cookie-signature", + "rawSpec": "1.0.6", + "spec": "1.0.6", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "cookie-signature@1.0.6", + "_id": "cookie-signature@1.0.6", + "_inCache": true, + "_location": "/cookie-signature", + "_nodeVersion": "0.10.36", + "_npmUser": { + "name": "natevw", + "email": "natevw@yahoo.com" + }, + "_npmVersion": "2.3.0", + "_phantomChildren": {}, + "_requested": { + "raw": "cookie-signature@1.0.6", + "scope": null, + "escapedName": "cookie-signature", + "name": "cookie-signature", + "rawSpec": "1.0.6", + "spec": "1.0.6", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "_shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c", + "_shrinkwrap": null, + "_spec": "cookie-signature@1.0.6", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@learnboost.com" + }, + "bugs": { + "url": "https://github.com/visionmedia/node-cookie-signature/issues" + }, + "dependencies": {}, + "description": "Sign and unsign cookies", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c", + "tarball": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" + }, + "gitHead": "391b56cf44d88c493491b7e3fc53208cfb976d2a", + "homepage": "https://github.com/visionmedia/node-cookie-signature", + "keywords": [ + "cookie", + "sign", + "unsign" + ], + "license": "MIT", + "main": "index", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "natevw", + "email": "natevw@yahoo.com" + } + ], + "name": "cookie-signature", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-cookie-signature.git" + }, + "scripts": { + "test": "mocha --require should --reporter spec" + }, + "version": "1.0.6" +} diff --git a/node_modules/cookie/HISTORY.md b/node_modules/cookie/HISTORY.md new file mode 100755 index 00000000..5bd64854 --- /dev/null +++ b/node_modules/cookie/HISTORY.md @@ -0,0 +1,118 @@ +0.3.1 / 2016-05-26 +================== + + * Fix `sameSite: true` to work with draft-7 clients + - `true` now sends `SameSite=Strict` instead of `SameSite` + +0.3.0 / 2016-05-26 +================== + + * Add `sameSite` option + - Replaces `firstPartyOnly` option, never implemented by browsers + * Improve error message when `encode` is not a function + * Improve error message when `expires` is not a `Date` + +0.2.4 / 2016-05-20 +================== + + * perf: enable strict mode + * perf: use for loop in parse + * perf: use string concatination for serialization + +0.2.3 / 2015-10-25 +================== + + * Fix cookie `Max-Age` to never be a floating point number + +0.2.2 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.2.1 / 2015-09-17 +================== + + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.2.0 / 2015-08-13 +================== + + * Add `firstPartyOnly` option + * Throw better error for invalid argument to parse + * perf: hoist regular expression + +0.1.5 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.1.4 / 2015-09-17 +================== + + * Throw better error for invalid argument to parse + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.1.3 / 2015-05-19 +================== + + * Reduce the scope of try-catch deopt + * Remove argument reassignments + +0.1.2 / 2014-04-16 +================== + + * Remove unnecessary files from npm package + +0.1.1 / 2014-02-23 +================== + + * Fix bad parse when cookie value contained a comma + * Fix support for `maxAge` of `0` + +0.1.0 / 2013-05-01 +================== + + * Add `decode` option + * Add `encode` option + +0.0.6 / 2013-04-08 +================== + + * Ignore cookie parts missing `=` + +0.0.5 / 2012-10-29 +================== + + * Return raw cookie value if value unescape errors + +0.0.4 / 2012-06-21 +================== + + * Use encode/decodeURIComponent for cookie encoding/decoding + - Improve server/client interoperability + +0.0.3 / 2012-06-06 +================== + + * Only escape special characters per the cookie RFC + +0.0.2 / 2012-06-01 +================== + + * Fix `maxAge` option to not throw error + +0.0.1 / 2012-05-28 +================== + + * Add more tests + +0.0.0 / 2012-05-28 +================== + + * Initial release diff --git a/node_modules/cookie/LICENSE b/node_modules/cookie/LICENSE new file mode 100755 index 00000000..058b6b4e --- /dev/null +++ b/node_modules/cookie/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Roman Shtylman +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/cookie/README.md b/node_modules/cookie/README.md new file mode 100755 index 00000000..db0d0782 --- /dev/null +++ b/node_modules/cookie/README.md @@ -0,0 +1,220 @@ +# cookie + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Basic HTTP cookie parser and serializer for HTTP servers. + +## Installation + +```sh +$ npm install cookie +``` + +## API + +```js +var cookie = require('cookie'); +``` + +### cookie.parse(str, options) + +Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs. +The `str` argument is the string representing a `Cookie` header value and `options` is an +optional object containing additional parsing options. + +```js +var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2'); +// { foo: 'bar', equation: 'E=mc^2' } +``` + +#### Options + +`cookie.parse` accepts these properties in the options object. + +##### decode + +Specifies a function that will be used to decode a cookie's value. Since the value of a cookie +has a limited character set (and must be a simple string), this function can be used to decode +a previously-encoded cookie value into a JavaScript string or other object. + +The default function is the global `decodeURIComponent`, which will decode any URL-encoded +sequences into their byte representations. + +**note** if an error is thrown from this function, the original, non-decoded cookie value will +be returned as the cookie's value. + +### cookie.serialize(name, value, options) + +Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the +name for the cookie, the `value` argument is the value to set the cookie to, and the `options` +argument is an optional object containing additional serialization options. + +```js +var setCookie = cookie.serialize('foo', 'bar'); +// foo=bar +``` + +#### Options + +`cookie.serialize` accepts these properties in the options object. + +##### domain + +Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6266-5.2.3]. By default, no +domain is set, and most clients will consider the cookie to apply to only the current domain. + +##### encode + +Specifies a function that will be used to encode a cookie's value. Since value of a cookie +has a limited character set (and must be a simple string), this function can be used to encode +a value into a string suited for a cookie's value. + +The default function is the global `ecodeURIComponent`, which will encode a JavaScript string +into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range. + +##### expires + +Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6266-5.2.1]. +By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and +will delete it on a condition like exiting a web browser application. + +**note** the [cookie storage model specification][rfc-6266-5.3] states that if both `expires` and +`magAge` are set, then `maxAge` takes precedence, but it is possiblke not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### httpOnly + +Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6266-5.2.6]. When truthy, +the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not allow client-side +JavaScript to see the cookie in `document.cookie`. + +##### maxAge + +Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6266-5.2.2]. +The given number will be converted to an integer by rounding down. By default, no maximum age is set. + +**note** the [cookie storage model specification][rfc-6266-5.3] states that if both `expires` and +`magAge` are set, then `maxAge` takes precedence, but it is possiblke not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### path + +Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6266-5.2.4]. By default, the path +is considered the ["default path"][rfc-6266-5.1.4]. By default, no maximum age is set, and most +clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting +a web browser application. + +##### sameSite + +Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][draft-west-first-party-cookies-07]. + + - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + - `false` will not set the `SameSite` attribute. + - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement. + - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + +More information about the different enforcement levels can be found in the specification +https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1.1 + +**note** This is an attribute that has not yet been fully standardized, and may change in the future. +This also means many clients may ignore this attribute until they understand it. + +##### secure + +Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6266-5.2.5]. When truthy, +the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to +the server in the future if the browser does not have an HTTPS connection. + +## Example + +The following example uses this module in conjunction with the Node.js core HTTP server +to prompt a user for their name and display it back on future visits. + +```js +var cookie = require('cookie'); +var escapeHtml = require('escape-html'); +var http = require('http'); +var url = require('url'); + +function onRequest(req, res) { + // Parse the query string + var query = url.parse(req.url, true, true).query; + + if (query && query.name) { + // Set a new cookie with the name + res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), { + httpOnly: true, + maxAge: 60 * 60 * 24 * 7 // 1 week + })); + + // Redirect back after setting cookie + res.statusCode = 302; + res.setHeader('Location', req.headers.referer || '/'); + res.end(); + return; + } + + // Parse the cookies on the request + var cookies = cookie.parse(req.headers.cookie || ''); + + // Get the visitor name set in the cookie + var name = cookies.name; + + res.setHeader('Content-Type', 'text/html; charset=UTF-8'); + + if (name) { + res.write('

Welcome back, ' + escapeHtml(name) + '!

'); + } else { + res.write('

Hello, new visitor!

'); + } + + res.write('
'); + res.write(' '); + res.end(' values + * + * @param {string} str + * @param {object} [options] + * @return {object} + * @public + */ + +function parse(str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string'); + } + + var obj = {} + var opt = options || {}; + var pairs = str.split(pairSplitRegExp); + var dec = opt.decode || decode; + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + var eq_idx = pair.indexOf('='); + + // skip things that don't look like key=value + if (eq_idx < 0) { + continue; + } + + var key = pair.substr(0, eq_idx).trim() + var val = pair.substr(++eq_idx, pair.length).trim(); + + // quoted values + if ('"' == val[0]) { + val = val.slice(1, -1); + } + + // only assign once + if (undefined == obj[key]) { + obj[key] = tryDecode(val, dec); + } + } + + return obj; +} + +/** + * Serialize data into a cookie header. + * + * Serialize the a name value pair into a cookie string suitable for + * http headers. An optional options object specified cookie parameters. + * + * serialize('foo', 'bar', { httpOnly: true }) + * => "foo=bar; httpOnly" + * + * @param {string} name + * @param {string} val + * @param {object} [options] + * @return {string} + * @public + */ + +function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode; + + if (typeof enc !== 'function') { + throw new TypeError('option encode is invalid'); + } + + if (!fieldContentRegExp.test(name)) { + throw new TypeError('argument name is invalid'); + } + + var value = enc(val); + + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError('argument val is invalid'); + } + + var str = name + '=' + value; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + if (isNaN(maxAge)) throw new Error('maxAge should be a Number'); + str += '; Max-Age=' + Math.floor(maxAge); + } + + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError('option domain is invalid'); + } + + str += '; Domain=' + opt.domain; + } + + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError('option path is invalid'); + } + + str += '; Path=' + opt.path; + } + + if (opt.expires) { + if (typeof opt.expires.toUTCString !== 'function') { + throw new TypeError('option expires is invalid'); + } + + str += '; Expires=' + opt.expires.toUTCString(); + } + + if (opt.httpOnly) { + str += '; HttpOnly'; + } + + if (opt.secure) { + str += '; Secure'; + } + + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === 'string' + ? opt.sameSite.toLowerCase() : opt.sameSite; + + switch (sameSite) { + case true: + str += '; SameSite=Strict'; + break; + case 'lax': + str += '; SameSite=Lax'; + break; + case 'strict': + str += '; SameSite=Strict'; + break; + default: + throw new TypeError('option sameSite is invalid'); + } + } + + return str; +} + +/** + * Try decoding a string using a decoding function. + * + * @param {string} str + * @param {function} decode + * @private + */ + +function tryDecode(str, decode) { + try { + return decode(str); + } catch (e) { + return str; + } +} diff --git a/node_modules/cookie/package.json b/node_modules/cookie/package.json new file mode 100755 index 00000000..3700d21f --- /dev/null +++ b/node_modules/cookie/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "cookie@0.3.1", + "scope": null, + "escapedName": "cookie", + "name": "cookie", + "rawSpec": "0.3.1", + "spec": "0.3.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "cookie@0.3.1", + "_id": "cookie@0.3.1", + "_inCache": true, + "_location": "/cookie", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/cookie-0.3.1.tgz_1464323556714_0.6435900838114321" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "cookie@0.3.1", + "scope": null, + "escapedName": "cookie", + "name": "cookie", + "rawSpec": "0.3.1", + "spec": "0.3.1", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "_shasum": "e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb", + "_shrinkwrap": null, + "_spec": "cookie@0.3.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "Roman Shtylman", + "email": "shtylman@gmail.com" + }, + "bugs": { + "url": "https://github.com/jshttp/cookie/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "HTTP server cookie parsing and serialization", + "devDependencies": { + "istanbul": "0.4.3", + "mocha": "1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb", + "tarball": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "gitHead": "e3c77d497d66c8b8d4b677b8954c1b192a09f0b3", + "homepage": "https://github.com/jshttp/cookie", + "keywords": [ + "cookie", + "cookies" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "cookie", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/cookie.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + }, + "version": "0.3.1" +} diff --git a/node_modules/core-js/CHANGELOG.md b/node_modules/core-js/CHANGELOG.md new file mode 100755 index 00000000..b597d55d --- /dev/null +++ b/node_modules/core-js/CHANGELOG.md @@ -0,0 +1,561 @@ +## Changelog +##### 2.4.1 - 2016.07.18 +- fixed `script` tag for some parsers, [#204](https://github.com/zloirock/core-js/issues/204), [#216](https://github.com/zloirock/core-js/issues/216) +- removed some unused variables, [#217](https://github.com/zloirock/core-js/issues/217), [#218](https://github.com/zloirock/core-js/issues/218) +- fixed MS Edge `Reflect.construct` and `Reflect.apply` - they should not allow primitive as `argumentsList` argument + +##### 1.2.7 [LEGACY] - 2016.07.18 +- some fixes for issues like [#159](https://github.com/zloirock/core-js/issues/159), [#186](https://github.com/zloirock/core-js/issues/186), [#194](https://github.com/zloirock/core-js/issues/194), [#207](https://github.com/zloirock/core-js/issues/207) + +##### 2.4.0 - 2016.05.08 +- Added `Observable`, [stage 1 proposal](https://github.com/zenparsing/es-observable) +- Fixed behavior `Object.{getOwnPropertySymbols, getOwnPropertyDescriptor}` and `Object#propertyIsEnumerable` on `Object.prototype` +- `Reflect.construct` and `Reflect.apply` should throw an error if `argumentsList` argument is not an object, [#194](https://github.com/zloirock/core-js/issues/194) + +##### 2.3.0 - 2016.04.24 +- Added `asap` for enqueuing microtasks, [stage 0 proposal](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask) +- Added well-known symbol `Symbol.asyncIterator` for [stage 2 async iteration proposal](https://github.com/tc39/proposal-async-iteration) +- Added well-known symbol `Symbol.observable` for [stage 1 observables proposal](https://github.com/zenparsing/es-observable) +- `String#{padStart, padEnd}` returns original string if filler is empty string, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#stringprototypepadstartpadend) +- `Object.values` and `Object.entries` moved to stage 4 from 3, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#objectvalues--objectentries) +- `System.global` moved to stage 2 from 1, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#systemglobal) +- `Map#toJSON` and `Set#toJSON` rejected and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-31.md#mapprototypetojsonsetprototypetojson) +- `Error.isError` withdrawn and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#erroriserror) +- Added fallback for `Function#name` on non-extensible functions and functions with broken `toString` conversion, [#193](https://github.com/zloirock/core-js/issues/193) + +##### 2.2.2 - 2016.04.06 +- Added conversion `-0` to `+0` to `Array#{indexOf, lastIndexOf}`, [ES2016 fix](https://github.com/tc39/ecma262/pull/316) +- Added fixes for some `Math` methods in Tor Browser +- `Array.{from, of}` no longer calls prototype setters +- Added workaround over Chrome DevTools strange behavior, [#186](https://github.com/zloirock/core-js/issues/186) + +##### 2.2.1 - 2016.03.19 +- Fixed `Object.getOwnPropertyNames(window)` `2.1+` versions bug, [#181](https://github.com/zloirock/core-js/issues/181) + +##### 2.2.0 - 2016.03.15 +- Added `String#matchAll`, [proposal](https://github.com/tc39/String.prototype.matchAll) +- Added `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381) +- Added `@@toPrimitive` methods to `Date` and `Symbol` +- Fixed `%TypedArray%#slice` in Edge ~ 13 (throws with `@@species` and wrapped / inherited constructor) +- Some other minor fixes + +##### 2.1.5 - 2016.03.12 +- Improved support NodeJS domains in `Promise#then`, [#180](https://github.com/zloirock/core-js/issues/180) +- Added fallback for `Date#toJSON` bug in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173#issuecomment-193972502) + +##### 2.1.4 - 2016.03.08 +- Added fallback for `Symbol` polyfill in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173) +- Added one more fallback for IE11 `Script Access Denied` error with iframes, [#165](https://github.com/zloirock/core-js/issues/165) + +##### 2.1.3 - 2016.02.29 +- Added fallback for [`es6-promise` package bug](https://github.com/stefanpenner/es6-promise/issues/169), [#176](https://github.com/zloirock/core-js/issues/176) + +##### 2.1.2 - 2016.02.29 +- Some minor `Promise` fixes: + - Browsers `rejectionhandled` event better HTML spec complaint + - Errors in unhandled rejection handlers should not cause any problems + - Fixed typo in feature detection + +##### 2.1.1 - 2016.02.22 +- Some `Promise` improvements: + - Feature detection: + - **Added detection unhandled rejection tracking support - now it's available everywhere**, [#140](https://github.com/zloirock/core-js/issues/140) + - Added detection `@@species` pattern support for completely correct subclassing + - Removed usage `Object.setPrototypeOf` from feature detection and noisy console message about it in FF + - `Promise.all` fixed for some very specific cases + +##### 2.1.0 - 2016.02.09 +- **API**: + - ES5 polyfills are split and logic, used in other polyfills, moved to internal modules + - **All entry point works in ES3 environment like IE8- without `core-js/(library/)es5`** + - **Added all missed single entry points for ES5 polyfills** + - Separated ES5 polyfills moved to the ES6 namespace. Why? + - Mainly, for prevent duplication features in different namespaces - logic of most required ES5 polyfills changed in ES6+: + - Already added changes for: `Object` statics - should accept primitives, new whitespaces lists in `String#trim`, `parse(Int|float)`, `RegExp#toString` logic, `String#split`, etc + - Should be changed in the future: `@@species` and `ToLength` logic in `Array` methods, `Date` parsing, `Function#bind`, etc + - Should not be changed only several features like `Array.isArray` and `Date.now` + - Some ES5 polyfills required for modern engines + - All old entry points should work fine, but in the next major release API can be changed + - `Object.getOwnPropertyDescriptors` moved to the stage 3, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#objectgetownpropertydescriptors-to-stage-3-jordan-harband-low-priority-but-super-quick) + - Added `umd` option for [custom build process](https://github.com/zloirock/core-js#custom-build-from-external-scripts), [#169](https://github.com/zloirock/core-js/issues/169) + - Returned entry points for `Array` statics, removed in `2.0`, for compatibility with `babel` `6` and for future fixes +- **Deprecated**: + - `Reflect.enumerate` deprecated and will be removed from the next major release, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#5xix-revisit-proxy-enumerate---revisit-decision-to-exhaust-iterator) +- **New Features**: + - Added [`Reflect` metadata API](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) as a pre-strawman feature, [#152](https://github.com/zloirock/core-js/issues/152): + - `Reflect.defineMetadata` + - `Reflect.deleteMetadata` + - `Reflect.getMetadata` + - `Reflect.getMetadataKeys` + - `Reflect.getOwnMetadata` + - `Reflect.getOwnMetadataKeys` + - `Reflect.hasMetadata` + - `Reflect.hasOwnMetadata` + - `Reflect.metadata` + - Implementation / fixes `Date#toJSON` + - Fixes for `parseInt` and `Number.parseInt` + - Fixes for `parseFloat` and `Number.parseFloat` + - Fixes for `RegExp#toString` + - Fixes for `Array#sort` + - Fixes for `Number#toFixed` + - Fixes for `Number#toPrecision` + - Additional fixes for `String#split` (`RegExp#@@split`) +- **Improvements**: + - Correct subclassing wrapped collections, `Number` and `RegExp` constructors with native class syntax + - Correct support `SharedArrayBuffer` and buffers from other realms in typed arrays wrappers + - Additional validations for `Object.{defineProperty, getOwnPropertyDescriptor}` and `Reflect.defineProperty` +- **Bug Fixes**: + - Fixed some cases `Array#lastIndexOf` with negative second argument + +##### 2.0.3 - 2016.01.11 +- Added fallback for V8 ~ Chrome 49 `Promise` subclassing bug causes unhandled rejection on feature detection, [#159](https://github.com/zloirock/core-js/issues/159) +- Added fix for very specific environments with global `window === null` + +##### 2.0.2 - 2016.01.04 +- Temporarily removed `length` validation from `Uint8Array` constructor wrapper. Reason - [bug in `ws` module](https://github.com/websockets/ws/pull/645) (-> `socket.io`) which passes to `Buffer` constructor -> `Uint8Array` float and uses [the `V8` bug](https://code.google.com/p/v8/issues/detail?id=4552) for conversion to int (by the spec should be thrown an error). [It creates problems for many people.](https://github.com/karma-runner/karma/issues/1768) I hope, it will be returned after fixing this bug in `V8`. + +##### 2.0.1 - 2015.12.31 +- forced usage `Promise.resolve` polyfill in the `library` version for correct work with wrapper +- `Object.assign` should be defined in the strict mode -> throw an error on extension non-extensible objects, [#154](https://github.com/zloirock/core-js/issues/154) + +##### 2.0.0 - 2015.12.24 +- added implementations and fixes [Typed Arrays](https://github.com/zloirock/core-js#ecmascript-6-typed-arrays)-related features + - `ArrayBuffer`, `ArrayBuffer.isView`, `ArrayBuffer#slice` + - `DataView` with all getter / setter methods + - `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array` and `Float64Array` constructors + - `%TypedArray%.{for, of}`, `%TypedArray%#{copyWithin, every, fill, filter, find, findIndex, forEach, indexOf, includes, join, lastIndexOf, map, reduce, reduceRight, reverse, set, slice, some, sort, subarray, values, keys, entries, @@iterator, ...}` +- added [`System.global`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-global), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#systemglobal-jhd) +- added [`Error.isError`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/ljharb/proposal-is-error), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#jhd-erroriserror) +- added [`Math.{iaddh, isubh, imulh, umulh}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) +- `RegExp.escape` moved from the `es7` to the non-standard `core` namespace, [July TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-28.md#62-regexpescape) - too slow, but it's condition of stability, [#116](https://github.com/zloirock/core-js/issues/116) +- [`Promise`](https://github.com/zloirock/core-js#ecmascript-6-promise) + - some performance optimisations + - added basic support [`rejectionHandled` event / `onrejectionhandled` handler](https://github.com/zloirock/core-js#unhandled-rejection-tracking) to the polyfill + - removed usage `@@species` from `Promise.{all, race}`, [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-18.md#conclusionresolution-2) +- some improvements [collections polyfills](https://github.com/zloirock/core-js#ecmascript-6-collections) + - `O(1)` and preventing possible leaks with frozen keys, [#134](https://github.com/zloirock/core-js/issues/134) + - correct observable state object keys +- renamed `String#{padLeft, padRight}` -> [`String#{padStart, padEnd}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-string-pad-start-end), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) (they want to rename it on each meeting?O_o), [#132](https://github.com/zloirock/core-js/issues/132) +- added [`String#{trimStart, trimEnd}` as aliases for `String#{trimLeft, trimRight}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) +- added [annex B HTML methods](https://github.com/zloirock/core-js#ecmascript-6-string) - ugly, but also [the part of the spec](http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.anchor) +- added little fix for [`Date#toString`](https://github.com/zloirock/core-js#ecmascript-6-date) - `new Date(NaN).toString()` [should be `'Invalid Date'`](http://www.ecma-international.org/ecma-262/6.0/#sec-todatestring) +- added [`{keys, values, entries, @@iterator}` methods to DOM collections](https://github.com/zloirock/core-js#iterable-dom-collections) which should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass) - `NodeList`, `DOMTokenList`, `MediaList`, `StyleSheetList`, `CSSRuleList`. +- removed Mozilla `Array` generics - [deprecated and will be removed from FF](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Array_generic_methods), [looks like strawman is dead](http://wiki.ecmascript.org/doku.php?id=strawman:array_statics), available [alternative shim](https://github.com/plusdude/array-generics) +- removed `core.log` module +- CommonJS API + - added entry points for [virtual methods](https://github.com/zloirock/core-js#commonjs-and-prototype-methods-without-global-namespace-pollution) + - added entry points for [stages proposals](https://github.com/zloirock/core-js#ecmascript-7-proposals) + - some other minor changes +- [custom build from external scripts](https://github.com/zloirock/core-js#custom-build-from-external-scripts) moved to the separate package for preventing problems with dependencies +- changed `$` prefix for internal modules file names because Team Foundation Server does not support it, [#129](https://github.com/zloirock/core-js/issues/129) +- additional fix for `SameValueZero` in V8 ~ Chromium 39-42 collections +- additional fix for FF27 `Array` iterator +- removed usage shortcuts for `arguments` object - old WebKit bug, [#150](https://github.com/zloirock/core-js/issues/150) +- `{Map, Set}#forEach` non-generic, [#144](https://github.com/zloirock/core-js/issues/144) +- many other improvements + +##### 1.2.6 - 2015.11.09 +* reject with `TypeError` on attempt resolve promise itself +* correct behavior with broken `Promise` subclass constructors / methods +* added `Promise`-based fallback for microtask +* fixed V8 and FF `Array#{values, @@iterator}.name` +* fixed IE7- `[1, 2].join(undefined) -> '1,2'` +* some other fixes / improvements / optimizations + +##### 1.2.5 - 2015.11.02 +* some more `Number` constructor fixes: + * fixed V8 ~ Node 0.8 bug: `Number('+0x1')` should be `NaN` + * fixed `Number(' 0b1\n')` case, should be `1` + * fixed `Number()` case, should be `0` + +##### 1.2.4 - 2015.11.01 +* fixed `Number('0b12') -> NaN` case in the shim +* fixed V8 ~ Chromium 40- bug - `Weak(Map|Set)#{delete, get, has}` should not throw errors [#124](https://github.com/zloirock/core-js/issues/124) +* some other fixes and optimizations + +##### 1.2.3 - 2015.10.23 +* fixed some problems related old V8 bug `Object('a').propertyIsEnumerable(0) // => false`, for example, `Object.assign({}, 'qwe')` from the last release +* fixed `.name` property and `Function#toString` conversion some polyfilled methods +* fixed `Math.imul` arity in Safari 8- + +##### 1.2.2 - 2015.10.18 +* improved optimisations for V8 +* fixed build process from external packages, [#120](https://github.com/zloirock/core-js/pull/120) +* one more `Object.{assign, values, entries}` fix for [**very** specific case](https://github.com/ljharb/proposal-object-values-entries/issues/5) + +##### 1.2.1 - 2015.10.02 +* replaced fix `JSON.stringify` + `Symbol` behavior from `.toJSON` method to wrapping `JSON.stringify` - little more correct, [compat-table/642](https://github.com/kangax/compat-table/pull/642) +* fixed typo which broke tasks scheduler in WebWorkers in old FF, [#114](https://github.com/zloirock/core-js/pull/114) + +##### 1.2.0 - 2015.09.27 +* added browser [`Promise` rejection hook](#unhandled-rejection-tracking), [#106](https://github.com/zloirock/core-js/issues/106) +* added correct [`IsRegExp`](http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp) logic to [`String#{includes, startsWith, endsWith}`](https://github.com/zloirock/core-js/#ecmascript-6-string) and [`RegExp` constructor](https://github.com/zloirock/core-js/#ecmascript-6-regexp), `@@match` case, [example](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match#Disabling_the_isRegExp_check) +* updated [`String#leftPad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) [with proposal](https://github.com/ljharb/proposal-string-pad-left-right/issues/6): string filler truncated from the right side +* replaced V8 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) - its properties order not only [incorrect](https://github.com/sindresorhus/object-assign/issues/22), it is non-deterministic and it causes some problems +* fixed behavior with deleted in getters properties for `Object.{`[`assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)`, `[`entries, values`](https://github.com/zloirock/core-js/#ecmascript-7-proposals)`}`, [example](http://goo.gl/iQE01c) +* fixed [`Math.sinh`](https://github.com/zloirock/core-js/#ecmascript-6-math) with very small numbers in V8 near Chromium 38 +* some other fixes and optimizations + +##### 1.1.4 - 2015.09.05 +* fixed support symbols in FF34-35 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* fixed [collections iterators](https://github.com/zloirock/core-js/#ecmascript-6-iterators) in FF25-26 +* fixed non-generic WebKit [`Array.of`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* some other fixes and optimizations + +##### 1.1.3 - 2015.08.29 +* fixed support Node.js domains in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise), [#103](https://github.com/zloirock/core-js/issues/103) + +##### 1.1.2 - 2015.08.28 +* added `toJSON` method to [`Symbol`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill and to MS Edge implementation for expected `JSON.stringify` result w/o patching this method +* replaced [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) implementations w/o correct support third argument +* fixed `global` detection with changed `document.domain` in ~IE8, [#100](https://github.com/zloirock/core-js/issues/100) + +##### 1.1.1 - 2015.08.20 +* added more correct microtask implementation for [`Promise`](#ecmascript-6-promise) + +##### 1.1.0 - 2015.08.17 +* updated [string padding](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to [actual proposal](https://github.com/ljharb/proposal-string-pad-left-right) - renamed, minor internal changes: + * `String#lpad` -> `String#padLeft` + * `String#rpad` -> `String#padRight` +* added [string trim functions](#ecmascript-7-proposals) - [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), defacto standard - required only for IE11- and fixed for some old engines: + * `String#trimLeft` + * `String#trimRight` +* [`String#trim`](https://github.com/zloirock/core-js/#ecmascript-6-string) fixed for some engines by es6 spec and moved from `es5` to single `es6` module +* splitted [`es6.object.statics-accept-primitives`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* caps for `freeze`-family `Object` methods moved from `es5` to `es6` namespace and joined with [es6 wrappers](https://github.com/zloirock/core-js/#ecmascript-6-object) +* `es5` [namespace](https://github.com/zloirock/core-js/#commonjs) also includes modules, moved to `es6` namespace - you can use it as before +* increased `MessageChannel` priority in `$.task`, [#95](https://github.com/zloirock/core-js/issues/95) +* does not get `global.Symbol` on each getting iterator, if you wanna use alternative `Symbol` shim - add it before `core-js` +* [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) optimized and fixed for some cases +* simplified [`Reflect.enumerate`](https://github.com/zloirock/core-js/#ecmascript-6-reflect), see [this question](https://esdiscuss.org/topic/question-about-enumerate-and-property-decision-timing) +* some corrections in [`Math.acosh`](https://github.com/zloirock/core-js/#ecmascript-6-math) +* fixed [`Math.imul`](https://github.com/zloirock/core-js/#ecmascript-6-math) for old WebKit +* some fixes in string / RegExp [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp) logic +* some other fixes and optimizations + +##### 1.0.1 - 2015.07.31 +* some fixes for final MS Edge, replaced broken native `Reflect.defineProperty` +* some minor fixes and optimizations +* changed compression `client/*.min.js` options for safe `Function#name` and `Function#length`, should be fixed [#92](https://github.com/zloirock/core-js/issues/92) + +##### 1.0.0 - 2015.07.22 +* added logic for [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp): + * `Symbol.match` + * `Symbol.replace` + * `Symbol.split` + * `Symbol.search` +* actualized and optimized work with iterables: + * optimized [`Map`, `Set`, `WeakMap`, `WeakSet` constructors](https://github.com/zloirock/core-js/#ecmascript-6-collections), [`Promise.all`, `Promise.race`](https://github.com/zloirock/core-js/#ecmascript-6-promise) for default `Array Iterator` + * optimized [`Array.from`](https://github.com/zloirock/core-js/#ecmascript-6-array) for default `Array Iterator` + * added [`core.getIteratorMethod`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) helper +* uses enumerable properties in shimmed instances - collections, iterators, etc for optimize performance +* added support native constructors to [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) with 2 arguments +* added support native constructors to [`Function#bind`](https://github.com/zloirock/core-js/#ecmascript-5) shim with `new` +* removed obsolete `.clear` methods native [`Weak`-collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) +* maximum modularity, reduced minimal custom build size, separated into submodules: + * [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) + * [`es6.regexp`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) + * [`es6.math`](https://github.com/zloirock/core-js/#ecmascript-6-math) + * [`es6.number`](https://github.com/zloirock/core-js/#ecmascript-6-number) + * [`es7.object.to-array`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + * [`core.object`](https://github.com/zloirock/core-js/#object) + * [`core.string`](https://github.com/zloirock/core-js/#escaping-strings) + * [`core.iter-helpers`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) + * internal modules (`$`, `$.iter`, etc) +* many other optimizations +* final cleaning non-standard features + * moved `$for` to [separate library](https://github.com/zloirock/forof). This work for syntax - `for-of` loop and comprehensions + * moved `Date#{format, formatUTC}` to [separate library](https://github.com/zloirock/dtf). Standard way for this - `ECMA-402` + * removed `Math` methods from `Number.prototype`. Slight sugar for simple `Math` methods calling + * removed `{Array#, Array, Dict}.turn` + * removed `core.global` +* uses `ToNumber` instead of `ToLength` in [`Number Iterator`](https://github.com/zloirock/core-js/#number-iterator), `Array.from(2.5)` will be `[0, 1, 2]` instead of `[0, 1]` +* fixed [#85](https://github.com/zloirock/core-js/issues/85) - invalid `Promise` unhandled rejection message in nested `setTimeout` +* fixed [#86](https://github.com/zloirock/core-js/issues/86) - support FF extensions +* fixed [#89](https://github.com/zloirock/core-js/issues/89) - behavior `Number` constructor in strange case + +##### 0.9.18 - 2015.06.17 +* removed `/` from [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) escaped characters + +##### 0.9.17 - 2015.06.14 +* updated [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to the [latest proposal](https://github.com/benjamingr/RexExp.escape) +* fixed conflict with webpack dev server + IE buggy behavior + +##### 0.9.16 - 2015.06.11 +* more correct order resolving thenable in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) polyfill +* uses polyfill instead of [buggy V8 `Promise`](https://github.com/zloirock/core-js/issues/78) + +##### 0.9.15 - 2015.06.09 +* [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) from `library` version return wrapped native instances +* fixed collections prototype methods in `library` version +* optimized [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) + +##### 0.9.14 - 2015.06.04 +* updated [`Promise.resolve` behavior](https://esdiscuss.org/topic/fixing-promise-resolve) +* added fallback for IE11 buggy `Object.getOwnPropertyNames` + iframe +* some other fixes + +##### 0.9.13 - 2015.05.25 +* added fallback for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) for old Android +* some other fixes + +##### 0.9.12 - 2015.05.24 +* different instances `core-js` should use / recognize the same symbols +* some fixes + +##### 0.9.11 - 2015.05.18 +* simplified [custom build](https://github.com/zloirock/core-js/#custom-build) + * add custom build js api + * added `grunt-cli` to `devDependencies` for `npm run grunt` +* some fixes + +##### 0.9.10 - 2015.05.16 +* wrapped `Function#toString` for correct work wrapped methods / constructors with methods similar to the [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) +* added proto versions of methods to export object in `default` version for consistency with `library` version + +##### 0.9.9 - 2015.05.14 +* wrapped `Object#propertyIsEnumerable` for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* [added proto versions of methods to `library` for ES7 bind syntax](https://github.com/zloirock/core-js/issues/65) +* some other fixes + +##### 0.9.8 - 2015.05.12 +* fixed [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) with negative arguments +* added `Object#toString.toString` as fallback for [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) + +##### 0.9.7 - 2015.05.07 +* added [support DOM collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior) to IE8- `Array#slice` + +##### 0.9.6 - 2015.05.01 +* added [`String#lpad`, `String#rpad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + +##### 0.9.5 - 2015.04.30 +* added cap for `Function#@@hasInstance` +* some fixes and optimizations + +##### 0.9.4 - 2015.04.27 +* fixed `RegExp` constructor + +##### 0.9.3 - 2015.04.26 +* some fixes and optimizations + +##### 0.9.2 - 2015.04.25 +* more correct [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking and resolving / rejection priority + +##### 0.9.1 - 2015.04.25 +* fixed `__proto__`-based [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) subclassing in some environments + +##### 0.9.0 - 2015.04.24 +* added correct [symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol) descriptors + * fixed behavior `Object.{assign, create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}` with symbols + * added [single entry points](https://github.com/zloirock/core-js/#commonjs) for `Object.{create, defineProperty, defineProperties}` +* added [`Map#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* removed non-standard methods `Object#[_]` and `Function#only` - they solves syntax problems, but now in compilers available arrows and ~~in near future will be available~~ [available](http://babeljs.io/blog/2015/05/14/function-bind/) [bind syntax](https://github.com/zenparsing/es-function-bind) +* removed non-standard undocumented methods `Symbol.{pure, set}` +* some fixes and internal changes + +##### 0.8.4 - 2015.04.18 +* uses `webpack` instead of `browserify` for browser builds - more compression-friendly result + +##### 0.8.3 - 2015.04.14 +* fixed `Array` statics with single entry points + +##### 0.8.2 - 2015.04.13 +* [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) now also works in IE9- +* added [`Set#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* some optimizations and fixes + +##### 0.8.1 - 2015.04.03 +* fixed `Symbol.keyFor` + +##### 0.8.0 - 2015.04.02 +* changed [CommonJS API](https://github.com/zloirock/core-js/#commonjs) +* splitted and renamed some modules +* added support ES3 environment (ES5 polyfill) to **all** default versions - size increases slightly (+ ~4kb w/o gzip), many issues disappear, if you don't need it - [simply include only required namespaces / features / modules](https://github.com/zloirock/core-js/#commonjs) +* removed [abstract references](https://github.com/zenparsing/es-abstract-refs) support - proposal has been superseded =\ +* [`$for.isIterable` -> `core.isIterable`, `$for.getIterator` -> `core.getIterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), temporary available in old namespace +* fixed iterators support in v8 `Promise.all` and `Promise.race` +* many other fixes + +##### 0.7.2 - 2015.03.09 +* some fixes + +##### 0.7.1 - 2015.03.07 +* some fixes + +##### 0.7.0 - 2015.03.06 +* rewritten and splitted into [CommonJS modules](https://github.com/zloirock/core-js/#commonjs) + +##### 0.6.1 - 2015.02.24 +* fixed support [`Object.defineProperty`](https://github.com/zloirock/core-js/#ecmascript-5) with accessors on DOM elements on IE8 + +##### 0.6.0 - 2015.02.23 +* added support safe closing iteration - calling `iterator.return` on abort iteration, if it exists +* added basic support [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking in shim +* added [`Object.getOwnPropertyDescriptors`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* removed `console` cap - creates too many problems +* restructuring [namespaces](https://github.com/zloirock/core-js/#custom-build) +* some fixes + +##### 0.5.4 - 2015.02.15 +* some fixes + +##### 0.5.3 - 2015.02.14 +* added [support binary and octal literals](https://github.com/zloirock/core-js/#ecmascript-6-number) to `Number` constructor +* added [`Date#toISOString`](https://github.com/zloirock/core-js/#ecmascript-5) + +##### 0.5.2 - 2015.02.10 +* some fixes + +##### 0.5.1 - 2015.02.09 +* some fixes + +##### 0.5.0 - 2015.02.08 +* systematization of modules +* splitted [`es6` module](https://github.com/zloirock/core-js/#ecmascript-6) +* splitted `console` module: `web.console` - only cap for missing methods, `core.log` - bound methods & additional features +* added [`delay` method](https://github.com/zloirock/core-js/#delay) +* some fixes + +##### 0.4.10 - 2015.01.28 +* [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill returns array of wrapped keys + +##### 0.4.9 - 2015.01.27 +* FF20-24 fix + +##### 0.4.8 - 2015.01.25 +* some [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) fixes + +##### 0.4.7 - 2015.01.25 +* added support frozen objects as [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) keys + +##### 0.4.6 - 2015.01.21 +* added [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* added [`NodeList.prototype[@@iterator]`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) +* added basic `@@species` logic - getter in native constructors +* removed `Function#by` +* some fixes + +##### 0.4.5 - 2015.01.16 +* some fixes + +##### 0.4.4 - 2015.01.11 +* enabled CSP support + +##### 0.4.3 - 2015.01.10 +* added `Function` instances `name` property for IE9+ + +##### 0.4.2 - 2015.01.10 +* `Object` static methods accept primitives +* `RegExp` constructor can alter flags (IE9+) +* added `Array.prototype[Symbol.unscopables]` + +##### 0.4.1 - 2015.01.05 +* some fixes + +##### 0.4.0 - 2015.01.03 +* added [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) module: + * added `Reflect.apply` + * added `Reflect.construct` + * added `Reflect.defineProperty` + * added `Reflect.deleteProperty` + * added `Reflect.enumerate` + * added `Reflect.get` + * added `Reflect.getOwnPropertyDescriptor` + * added `Reflect.getPrototypeOf` + * added `Reflect.has` + * added `Reflect.isExtensible` + * added `Reflect.preventExtensions` + * added `Reflect.set` + * added `Reflect.setPrototypeOf` +* `core-js` methods now can use external `Symbol.iterator` polyfill +* some fixes + +##### 0.3.3 - 2014.12.28 +* [console cap](https://github.com/zloirock/core-js/#console) excluded from node.js default builds + +##### 0.3.2 - 2014.12.25 +* added cap for [ES5](https://github.com/zloirock/core-js/#ecmascript-5) freeze-family methods +* fixed `console` bug + +##### 0.3.1 - 2014.12.23 +* some fixes + +##### 0.3.0 - 2014.12.23 +* Optimize [`Map` & `Set`](https://github.com/zloirock/core-js/#ecmascript-6-collections): + * use entries chain on hash table + * fast & correct iteration + * iterators moved to [`es6`](https://github.com/zloirock/core-js/#ecmascript-6) and [`es6.collections`](https://github.com/zloirock/core-js/#ecmascript-6-collections) modules + +##### 0.2.5 - 2014.12.20 +* `console` no longer shortcut for `console.log` (compatibility problems) +* some fixes + +##### 0.2.4 - 2014.12.17 +* better compliance of ES6 +* added [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) (IE10+) +* some fixes + +##### 0.2.3 - 2014.12.15 +* [Symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol): + * added option to disable addition setter to `Object.prototype` for Symbol polyfill: + * added `Symbol.useSimple` + * added `Symbol.useSetter` + * added cap for well-known Symbols: + * added `Symbol.hasInstance` + * added `Symbol.isConcatSpreadable` + * added `Symbol.match` + * added `Symbol.replace` + * added `Symbol.search` + * added `Symbol.species` + * added `Symbol.split` + * added `Symbol.toPrimitive` + * added `Symbol.unscopables` + +##### 0.2.2 - 2014.12.13 +* added [`RegExp#flags`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) ([December 2014 Draft Rev 29](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#december_6_2014_draft_rev_29)) +* added [`String.raw`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.2.1 - 2014.12.12 +* repair converting -0 to +0 in [native collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) + +##### 0.2.0 - 2014.12.06 +* added [`es7.proposals`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) and [`es7.abstract-refs`](https://github.com/zenparsing/es-abstract-refs) modules +* added [`String#at`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* added real [`String Iterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), older versions used Array Iterator +* added abstract references support: + * added `Symbol.referenceGet` + * added `Symbol.referenceSet` + * added `Symbol.referenceDelete` + * added `Function#@@referenceGet` + * added `Map#@@referenceGet` + * added `Map#@@referenceSet` + * added `Map#@@referenceDelete` + * added `WeakMap#@@referenceGet` + * added `WeakMap#@@referenceSet` + * added `WeakMap#@@referenceDelete` + * added `Dict.{...methods}[@@referenceGet]` +* removed deprecated `.contains` methods +* some fixes + +##### 0.1.5 - 2014.12.01 +* added [`Array#copyWithin`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* added [`String#codePointAt`](https://github.com/zloirock/core-js/#ecmascript-6-string) +* added [`String.fromCodePoint`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.1.4 - 2014.11.27 +* added [`Dict.mapPairs`](https://github.com/zloirock/core-js/#dict) + +##### 0.1.3 - 2014.11.20 +* [TC39 November meeting](https://github.com/rwaldron/tc39-notes/tree/master/es6/2014-11): + * [`.contains` -> `.includes`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains) + * `String#contains` -> [`String#includes`](https://github.com/zloirock/core-js/#ecmascript-6-string) + * `Array#contains` -> [`Array#includes`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + * `Dict.contains` -> [`Dict.includes`](https://github.com/zloirock/core-js/#dict) + * [removed `WeakMap#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + * [removed `WeakSet#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + +##### 0.1.2 - 2014.11.19 +* `Map` & `Set` bug fix + +##### 0.1.1 - 2014.11.18 +* public release \ No newline at end of file diff --git a/node_modules/core-js/Gruntfile.js b/node_modules/core-js/Gruntfile.js new file mode 100755 index 00000000..afbcd948 --- /dev/null +++ b/node_modules/core-js/Gruntfile.js @@ -0,0 +1,2 @@ +require('LiveScript'); +module.exports = require('./build/Gruntfile'); \ No newline at end of file diff --git a/node_modules/core-js/LICENSE b/node_modules/core-js/LICENSE new file mode 100755 index 00000000..c99b842d --- /dev/null +++ b/node_modules/core-js/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-2016 Denis Pushkarev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/core-js/bower.json b/node_modules/core-js/bower.json new file mode 100755 index 00000000..f6eb784b --- /dev/null +++ b/node_modules/core-js/bower.json @@ -0,0 +1,47 @@ +{ + "name": "core.js", + "main": "client/core.js", + "version": "2.4.1", + "description": "Standard Library", + "keywords": [ + "ES3", + "ECMAScript 3", + "ES5", + "ECMAScript 5", + "ES6", + "ES2015", + "ECMAScript 6", + "ECMAScript 2015", + "ES7", + "ES2016", + "ECMAScript 7", + "ECMAScript 2016", + "Harmony", + "Strawman", + "Map", + "Set", + "WeakMap", + "WeakSet", + "Promise", + "Symbol", + "TypedArray", + "setImmediate", + "Dict", + "polyfill", + "shim" + ], + "authors": [ + "Denis Pushkarev (http://zloirock.ru/)" + ], + "license": "MIT", + "homepage": "https://github.com/zloirock/core-js", + "repository": { + "type": "git", + "url": "https://github.com/zloirock/core-js.git" + }, + "ignore": [ + "build", + "node_modules", + "tests" + ] +} diff --git a/node_modules/core-js/build/Gruntfile.ls b/node_modules/core-js/build/Gruntfile.ls new file mode 100755 index 00000000..f4b53809 --- /dev/null +++ b/node_modules/core-js/build/Gruntfile.ls @@ -0,0 +1,84 @@ +require! <[./build fs ./config]> +module.exports = (grunt)-> + grunt.loadNpmTasks \grunt-contrib-clean + grunt.loadNpmTasks \grunt-contrib-copy + grunt.loadNpmTasks \grunt-contrib-uglify + grunt.loadNpmTasks \grunt-contrib-watch + grunt.loadNpmTasks \grunt-livescript + grunt.loadNpmTasks \grunt-karma + grunt.initConfig do + pkg: grunt.file.readJSON './package.json' + uglify: build: + files: '<%=grunt.option("path")%>.min.js': '<%=grunt.option("path")%>.js' + options: + mangle: {+sort, +keep_fnames} + compress: {+pure_getters, +keep_fargs, +keep_fnames} + sourceMap: on + banner: config.banner + livescript: src: files: + './tests/helpers.js': './tests/helpers/*' + './tests/tests.js': './tests/tests/*' + './tests/library.js': './tests/library/*' + './tests/es.js': './tests/tests/es*' + './tests/experimental.js': './tests/experimental/*' + './build/index.js': './build/build.ls*' + clean: <[./library]> + copy: lib: files: + * expand: on + cwd: './' + src: <[es5/** es6/** es7/** stage/** web/** core/** fn/** index.js shim.js]> + dest: './library/' + * expand: on + cwd: './' + src: <[modules/*]> + dest: './library/' + filter: \isFile + * expand: on + cwd: './modules/library/' + src: '*' + dest: './library/modules/' + watch: + core: + files: './modules/*' + tasks: \default + tests: + files: './tests/tests/*' + tasks: \livescript + karma: + 'options': + configFile: './tests/karma.conf.js' + browsers: <[PhantomJS]> + singleRun: on + 'default': {} + 'library': files: <[client/library.js tests/helpers.js tests/library.js]>map -> src: it + grunt.registerTask \build (options)-> + done = @async! + build { + modules: (options || 'es5,es6,es7,js,web,core')split \, + blacklist: (grunt.option(\blacklist) || '')split \, + library: grunt.option(\library) in <[yes on true]> + umd: grunt.option(\umd) not in <[no off false]> + } + .then !-> + grunt.option(\path) || grunt.option(\path, './custom') + fs.writeFile grunt.option(\path) + '.js', it, done + .catch !-> + console.error it + process.exit 1 + grunt.registerTask \client -> + grunt.option \library '' + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \library -> + grunt.option \library 'true' + grunt.option \path './client/library' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \shim -> + grunt.option \library '' + grunt.option \path './client/shim' + grunt.task.run <[build:es5,es6,es7,js,web uglify]> + grunt.registerTask \e -> + grunt.option \library ''> + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core,exp uglify]> + grunt.registerTask \default <[clean copy client library shim]> \ No newline at end of file diff --git a/node_modules/core-js/build/build.ls b/node_modules/core-js/build/build.ls new file mode 100755 index 00000000..0cf210de --- /dev/null +++ b/node_modules/core-js/build/build.ls @@ -0,0 +1,62 @@ +require! { + '../library/fn/promise': Promise + './config': {list, experimental, libraryBlacklist, es5SpecialCase, banner} + fs: {readFile, writeFile, unlink} + path: {join} + webpack, temp +} + +module.exports = ({modules = [], blacklist = [], library = no, umd = on})-> + resolve, reject <~! new Promise _ + let @ = modules.reduce ((memo, it)-> memo[it] = on; memo), {} + if @exp => for experimental => @[..] = on + if @es5 => for es5SpecialCase => @[..] = on + for ns of @ + if @[ns] + for name in list + if name.indexOf("#ns.") is 0 and name not in experimental + @[name] = on + + if library => blacklist ++= libraryBlacklist + for ns in blacklist + for name in list + if name is ns or name.indexOf("#ns.") is 0 + @[name] = no + + TARGET = temp.path {suffix: '.js'} + + err, info <~! webpack do + entry: list.filter(~> @[it]).map ~> + if library => join __dirname, '..', 'library', 'modules', it + else join __dirname, '..', 'modules', it + output: + path: '' + filename: TARGET + if err => return reject err + + err, script <~! readFile TARGET + if err => return reject err + + err <~! unlink TARGET + if err => return reject err + + if umd + exportScript = """ + // CommonJS export + if(typeof module != 'undefined' && module.exports)module.exports = __e; + // RequireJS export + else if(typeof define == 'function' && define.amd)define(function(){return __e}); + // Export to global object + else __g.core = __e; + """ + else + exportScript = "" + + resolve """ + #banner + !function(__e, __g, undefined){ + 'use strict'; + #script + #exportScript + }(1, 1); + """ \ No newline at end of file diff --git a/node_modules/core-js/build/config.js b/node_modules/core-js/build/config.js new file mode 100755 index 00000000..df09eb12 --- /dev/null +++ b/node_modules/core-js/build/config.js @@ -0,0 +1,259 @@ +module.exports = { + list: [ + 'es6.symbol', + 'es6.object.define-property', + 'es6.object.define-properties', + 'es6.object.get-own-property-descriptor', + 'es6.object.create', + 'es6.object.get-prototype-of', + 'es6.object.keys', + 'es6.object.get-own-property-names', + 'es6.object.freeze', + 'es6.object.seal', + 'es6.object.prevent-extensions', + 'es6.object.is-frozen', + 'es6.object.is-sealed', + 'es6.object.is-extensible', + 'es6.object.assign', + 'es6.object.is', + 'es6.object.set-prototype-of', + 'es6.object.to-string', + 'es6.function.bind', + 'es6.function.name', + 'es6.function.has-instance', + 'es6.number.constructor', + 'es6.number.to-fixed', + 'es6.number.to-precision', + 'es6.number.epsilon', + 'es6.number.is-finite', + 'es6.number.is-integer', + 'es6.number.is-nan', + 'es6.number.is-safe-integer', + 'es6.number.max-safe-integer', + 'es6.number.min-safe-integer', + 'es6.number.parse-float', + 'es6.number.parse-int', + 'es6.parse-int', + 'es6.parse-float', + 'es6.math.acosh', + 'es6.math.asinh', + 'es6.math.atanh', + 'es6.math.cbrt', + 'es6.math.clz32', + 'es6.math.cosh', + 'es6.math.expm1', + 'es6.math.fround', + 'es6.math.hypot', + 'es6.math.imul', + 'es6.math.log10', + 'es6.math.log1p', + 'es6.math.log2', + 'es6.math.sign', + 'es6.math.sinh', + 'es6.math.tanh', + 'es6.math.trunc', + 'es6.string.from-code-point', + 'es6.string.raw', + 'es6.string.trim', + 'es6.string.code-point-at', + 'es6.string.ends-with', + 'es6.string.includes', + 'es6.string.repeat', + 'es6.string.starts-with', + 'es6.string.iterator', + 'es6.string.anchor', + 'es6.string.big', + 'es6.string.blink', + 'es6.string.bold', + 'es6.string.fixed', + 'es6.string.fontcolor', + 'es6.string.fontsize', + 'es6.string.italics', + 'es6.string.link', + 'es6.string.small', + 'es6.string.strike', + 'es6.string.sub', + 'es6.string.sup', + 'es6.array.is-array', + 'es6.array.from', + 'es6.array.of', + 'es6.array.join', + 'es6.array.slice', + 'es6.array.sort', + 'es6.array.for-each', + 'es6.array.map', + 'es6.array.filter', + 'es6.array.some', + 'es6.array.every', + 'es6.array.reduce', + 'es6.array.reduce-right', + 'es6.array.index-of', + 'es6.array.last-index-of', + 'es6.array.copy-within', + 'es6.array.fill', + 'es6.array.find', + 'es6.array.find-index', + 'es6.array.iterator', + 'es6.array.species', + 'es6.regexp.constructor', + 'es6.regexp.to-string', + 'es6.regexp.flags', + 'es6.regexp.match', + 'es6.regexp.replace', + 'es6.regexp.search', + 'es6.regexp.split', + 'es6.promise', + 'es6.map', + 'es6.set', + 'es6.weak-map', + 'es6.weak-set', + 'es6.reflect.apply', + 'es6.reflect.construct', + 'es6.reflect.define-property', + 'es6.reflect.delete-property', + 'es6.reflect.enumerate', + 'es6.reflect.get', + 'es6.reflect.get-own-property-descriptor', + 'es6.reflect.get-prototype-of', + 'es6.reflect.has', + 'es6.reflect.is-extensible', + 'es6.reflect.own-keys', + 'es6.reflect.prevent-extensions', + 'es6.reflect.set', + 'es6.reflect.set-prototype-of', + 'es6.date.now', + 'es6.date.to-json', + 'es6.date.to-iso-string', + 'es6.date.to-string', + 'es6.date.to-primitive', + 'es6.typed.array-buffer', + 'es6.typed.data-view', + 'es6.typed.int8-array', + 'es6.typed.uint8-array', + 'es6.typed.uint8-clamped-array', + 'es6.typed.int16-array', + 'es6.typed.uint16-array', + 'es6.typed.int32-array', + 'es6.typed.uint32-array', + 'es6.typed.float32-array', + 'es6.typed.float64-array', + 'es7.array.includes', + 'es7.string.at', + 'es7.string.pad-start', + 'es7.string.pad-end', + 'es7.string.trim-left', + 'es7.string.trim-right', + 'es7.string.match-all', + 'es7.symbol.async-iterator', + 'es7.symbol.observable', + 'es7.object.get-own-property-descriptors', + 'es7.object.values', + 'es7.object.entries', + 'es7.object.enumerable-keys', + 'es7.object.enumerable-values', + 'es7.object.enumerable-entries', + 'es7.object.define-getter', + 'es7.object.define-setter', + 'es7.object.lookup-getter', + 'es7.object.lookup-setter', + 'es7.map.to-json', + 'es7.set.to-json', + 'es7.system.global', + 'es7.error.is-error', + 'es7.math.iaddh', + 'es7.math.isubh', + 'es7.math.imulh', + 'es7.math.umulh', + 'es7.reflect.define-metadata', + 'es7.reflect.delete-metadata', + 'es7.reflect.get-metadata', + 'es7.reflect.get-metadata-keys', + 'es7.reflect.get-own-metadata', + 'es7.reflect.get-own-metadata-keys', + 'es7.reflect.has-metadata', + 'es7.reflect.has-own-metadata', + 'es7.reflect.metadata', + 'es7.asap', + 'es7.observable', + 'web.immediate', + 'web.dom.iterable', + 'web.timers', + 'core.dict', + 'core.get-iterator-method', + 'core.get-iterator', + 'core.is-iterable', + 'core.delay', + 'core.function.part', + 'core.object.is-object', + 'core.object.classof', + 'core.object.define', + 'core.object.make', + 'core.number.iterator', + 'core.regexp.escape', + 'core.string.escape-html', + 'core.string.unescape-html', + ], + experimental: [ + 'es7.object.enumerable-keys', + 'es7.object.enumerable-values', + 'es7.object.enumerable-entries', + ], + libraryBlacklist: [ + 'es6.object.to-string', + 'es6.function.name', + 'es6.regexp.constructor', + 'es6.regexp.to-string', + 'es6.regexp.flags', + 'es6.regexp.match', + 'es6.regexp.replace', + 'es6.regexp.search', + 'es6.regexp.split', + 'es6.number.constructor', + 'es6.date.to-string', + 'es6.date.to-primitive', + ], + es5SpecialCase: [ + 'es6.object.create', + 'es6.object.define-property', + 'es6.object.define-properties', + 'es6.object.get-own-property-descriptor', + 'es6.object.get-prototype-of', + 'es6.object.keys', + 'es6.object.get-own-property-names', + 'es6.object.freeze', + 'es6.object.seal', + 'es6.object.prevent-extensions', + 'es6.object.is-frozen', + 'es6.object.is-sealed', + 'es6.object.is-extensible', + 'es6.function.bind', + 'es6.array.is-array', + 'es6.array.join', + 'es6.array.slice', + 'es6.array.sort', + 'es6.array.for-each', + 'es6.array.map', + 'es6.array.filter', + 'es6.array.some', + 'es6.array.every', + 'es6.array.reduce', + 'es6.array.reduce-right', + 'es6.array.index-of', + 'es6.array.last-index-of', + 'es6.number.to-fixed', + 'es6.number.to-precision', + 'es6.date.now', + 'es6.date.to-iso-string', + 'es6.date.to-json', + 'es6.string.trim', + 'es6.regexp.to-string', + 'es6.parse-int', + 'es6.parse-float', + ], + banner: '/**\n' + + ' * core-js ' + require('../package').version + '\n' + + ' * https://github.com/zloirock/core-js\n' + + ' * License: http://rock.mit-license.org\n' + + ' * © ' + new Date().getFullYear() + ' Denis Pushkarev\n' + + ' */' +}; \ No newline at end of file diff --git a/node_modules/core-js/build/index.js b/node_modules/core-js/build/index.js new file mode 100755 index 00000000..26bdec41 --- /dev/null +++ b/node_modules/core-js/build/index.js @@ -0,0 +1,104 @@ +// Generated by LiveScript 1.4.0 +(function(){ + var Promise, ref$, list, experimental, libraryBlacklist, es5SpecialCase, banner, readFile, writeFile, unlink, join, webpack, temp; + Promise = require('../library/fn/promise'); + ref$ = require('./config'), list = ref$.list, experimental = ref$.experimental, libraryBlacklist = ref$.libraryBlacklist, es5SpecialCase = ref$.es5SpecialCase, banner = ref$.banner; + ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink; + join = require('path').join; + webpack = require('webpack'); + temp = require('temp'); + module.exports = function(arg$){ + var modules, ref$, blacklist, library, umd, this$ = this; + modules = (ref$ = arg$.modules) != null + ? ref$ + : [], blacklist = (ref$ = arg$.blacklist) != null + ? ref$ + : [], library = (ref$ = arg$.library) != null ? ref$ : false, umd = (ref$ = arg$.umd) != null ? ref$ : true; + return new Promise(function(resolve, reject){ + (function(){ + var i$, x$, ref$, len$, y$, ns, name, j$, len1$, TARGET, this$ = this; + if (this.exp) { + for (i$ = 0, len$ = (ref$ = experimental).length; i$ < len$; ++i$) { + x$ = ref$[i$]; + this[x$] = true; + } + } + if (this.es5) { + for (i$ = 0, len$ = (ref$ = es5SpecialCase).length; i$ < len$; ++i$) { + y$ = ref$[i$]; + this[y$] = true; + } + } + for (ns in this) { + if (this[ns]) { + for (i$ = 0, len$ = (ref$ = list).length; i$ < len$; ++i$) { + name = ref$[i$]; + if (name.indexOf(ns + ".") === 0 && !in$(name, experimental)) { + this[name] = true; + } + } + } + } + if (library) { + blacklist = blacklist.concat(libraryBlacklist); + } + for (i$ = 0, len$ = blacklist.length; i$ < len$; ++i$) { + ns = blacklist[i$]; + for (j$ = 0, len1$ = (ref$ = list).length; j$ < len1$; ++j$) { + name = ref$[j$]; + if (name === ns || name.indexOf(ns + ".") === 0) { + this[name] = false; + } + } + } + TARGET = temp.path({ + suffix: '.js' + }); + webpack({ + entry: list.filter(function(it){ + return this$[it]; + }).map(function(it){ + if (library) { + return join(__dirname, '..', 'library', 'modules', it); + } else { + return join(__dirname, '..', 'modules', it); + } + }), + output: { + path: '', + filename: TARGET + } + }, function(err, info){ + if (err) { + return reject(err); + } + readFile(TARGET, function(err, script){ + if (err) { + return reject(err); + } + unlink(TARGET, function(err){ + var exportScript; + if (err) { + return reject(err); + } + if (umd) { + exportScript = "// CommonJS export\nif(typeof module != 'undefined' && module.exports)module.exports = __e;\n// RequireJS export\nelse if(typeof define == 'function' && define.amd)define(function(){return __e});\n// Export to global object\nelse __g.core = __e;"; + } else { + exportScript = ""; + } + resolve("" + banner + "\n!function(__e, __g, undefined){\n'use strict';\n" + script + "\n" + exportScript + "\n}(1, 1);"); + }); + }); + }); + }.call(modules.reduce(function(memo, it){ + memo[it] = true; + return memo; + }, {}))); + }); + }; + function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; + } +}).call(this); diff --git a/node_modules/core-js/client/core.js b/node_modules/core-js/client/core.js new file mode 100755 index 00000000..1e470de7 --- /dev/null +++ b/node_modules/core-js/client/core.js @@ -0,0 +1,7613 @@ +/** + * core-js 2.4.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(1); + __webpack_require__(50); + __webpack_require__(51); + __webpack_require__(52); + __webpack_require__(54); + __webpack_require__(55); + __webpack_require__(58); + __webpack_require__(59); + __webpack_require__(60); + __webpack_require__(61); + __webpack_require__(62); + __webpack_require__(63); + __webpack_require__(64); + __webpack_require__(65); + __webpack_require__(66); + __webpack_require__(68); + __webpack_require__(70); + __webpack_require__(72); + __webpack_require__(74); + __webpack_require__(77); + __webpack_require__(78); + __webpack_require__(79); + __webpack_require__(83); + __webpack_require__(86); + __webpack_require__(87); + __webpack_require__(88); + __webpack_require__(89); + __webpack_require__(91); + __webpack_require__(92); + __webpack_require__(93); + __webpack_require__(94); + __webpack_require__(95); + __webpack_require__(97); + __webpack_require__(99); + __webpack_require__(100); + __webpack_require__(101); + __webpack_require__(103); + __webpack_require__(104); + __webpack_require__(105); + __webpack_require__(107); + __webpack_require__(108); + __webpack_require__(109); + __webpack_require__(111); + __webpack_require__(112); + __webpack_require__(113); + __webpack_require__(114); + __webpack_require__(115); + __webpack_require__(116); + __webpack_require__(117); + __webpack_require__(118); + __webpack_require__(119); + __webpack_require__(120); + __webpack_require__(121); + __webpack_require__(122); + __webpack_require__(123); + __webpack_require__(124); + __webpack_require__(126); + __webpack_require__(130); + __webpack_require__(131); + __webpack_require__(132); + __webpack_require__(133); + __webpack_require__(137); + __webpack_require__(139); + __webpack_require__(140); + __webpack_require__(141); + __webpack_require__(142); + __webpack_require__(143); + __webpack_require__(144); + __webpack_require__(145); + __webpack_require__(146); + __webpack_require__(147); + __webpack_require__(148); + __webpack_require__(149); + __webpack_require__(150); + __webpack_require__(151); + __webpack_require__(152); + __webpack_require__(158); + __webpack_require__(159); + __webpack_require__(161); + __webpack_require__(162); + __webpack_require__(163); + __webpack_require__(167); + __webpack_require__(168); + __webpack_require__(169); + __webpack_require__(170); + __webpack_require__(171); + __webpack_require__(173); + __webpack_require__(174); + __webpack_require__(175); + __webpack_require__(176); + __webpack_require__(179); + __webpack_require__(181); + __webpack_require__(182); + __webpack_require__(183); + __webpack_require__(185); + __webpack_require__(187); + __webpack_require__(189); + __webpack_require__(190); + __webpack_require__(191); + __webpack_require__(193); + __webpack_require__(194); + __webpack_require__(195); + __webpack_require__(196); + __webpack_require__(203); + __webpack_require__(206); + __webpack_require__(207); + __webpack_require__(209); + __webpack_require__(210); + __webpack_require__(211); + __webpack_require__(212); + __webpack_require__(213); + __webpack_require__(214); + __webpack_require__(215); + __webpack_require__(216); + __webpack_require__(217); + __webpack_require__(218); + __webpack_require__(219); + __webpack_require__(220); + __webpack_require__(222); + __webpack_require__(223); + __webpack_require__(224); + __webpack_require__(225); + __webpack_require__(226); + __webpack_require__(227); + __webpack_require__(228); + __webpack_require__(229); + __webpack_require__(231); + __webpack_require__(234); + __webpack_require__(235); + __webpack_require__(237); + __webpack_require__(238); + __webpack_require__(239); + __webpack_require__(240); + __webpack_require__(241); + __webpack_require__(242); + __webpack_require__(243); + __webpack_require__(244); + __webpack_require__(245); + __webpack_require__(246); + __webpack_require__(247); + __webpack_require__(249); + __webpack_require__(250); + __webpack_require__(251); + __webpack_require__(252); + __webpack_require__(253); + __webpack_require__(254); + __webpack_require__(255); + __webpack_require__(256); + __webpack_require__(258); + __webpack_require__(259); + __webpack_require__(261); + __webpack_require__(262); + __webpack_require__(263); + __webpack_require__(264); + __webpack_require__(267); + __webpack_require__(268); + __webpack_require__(269); + __webpack_require__(270); + __webpack_require__(271); + __webpack_require__(272); + __webpack_require__(273); + __webpack_require__(274); + __webpack_require__(276); + __webpack_require__(277); + __webpack_require__(278); + __webpack_require__(279); + __webpack_require__(280); + __webpack_require__(281); + __webpack_require__(282); + __webpack_require__(283); + __webpack_require__(284); + __webpack_require__(285); + __webpack_require__(286); + __webpack_require__(287); + __webpack_require__(288); + __webpack_require__(291); + __webpack_require__(156); + __webpack_require__(293); + __webpack_require__(292); + __webpack_require__(294); + __webpack_require__(295); + __webpack_require__(296); + __webpack_require__(297); + __webpack_require__(298); + __webpack_require__(300); + __webpack_require__(301); + __webpack_require__(302); + __webpack_require__(304); + module.exports = __webpack_require__(305); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // ECMAScript 6 symbols shim + var global = __webpack_require__(2) + , has = __webpack_require__(3) + , DESCRIPTORS = __webpack_require__(4) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(16) + , META = __webpack_require__(20).KEY + , $fails = __webpack_require__(5) + , shared = __webpack_require__(21) + , setToStringTag = __webpack_require__(22) + , uid = __webpack_require__(17) + , wks = __webpack_require__(23) + , wksExt = __webpack_require__(24) + , wksDefine = __webpack_require__(25) + , keyOf = __webpack_require__(27) + , enumKeys = __webpack_require__(40) + , isArray = __webpack_require__(43) + , anObject = __webpack_require__(10) + , toIObject = __webpack_require__(30) + , toPrimitive = __webpack_require__(14) + , createDesc = __webpack_require__(15) + , _create = __webpack_require__(44) + , gOPNExt = __webpack_require__(47) + , $GOPD = __webpack_require__(49) + , $DP = __webpack_require__(9) + , $keys = __webpack_require__(28) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; + }) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); + } : dP; + + var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; + }; + + var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; + } : function(it){ + return it instanceof $Symbol; + }; + + var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); + }; + var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; + }; + + // 19.4.1.1 Symbol([description]) + if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(48).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(42).f = $propertyIsEnumerable; + __webpack_require__(41).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !__webpack_require__(26)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + + for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' + ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + + for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + + $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } + }); + + $export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; + })), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } + }); + + // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(8)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); + // 19.4.3.5 Symbol.prototype[@@toStringTag] + setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + setToStringTag(global.JSON, 'JSON', true); + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); + if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef + +/***/ }, +/* 3 */ +/***/ function(module, exports) { + + var hasOwnProperty = {}.hasOwnProperty; + module.exports = function(it, key){ + return hasOwnProperty.call(it, key); + }; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + // Thank's IE8 for his funny defineProperty + module.exports = !__webpack_require__(5)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; + }); + +/***/ }, +/* 5 */ +/***/ function(module, exports) { + + module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } + }; + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , hide = __webpack_require__(8) + , redefine = __webpack_require__(16) + , ctx = __webpack_require__(18) + , PROTOTYPE = 'prototype'; + + var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target)redefine(target, key, out, type & $export.U); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } + }; + global.core = core; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + module.exports = $export; + +/***/ }, +/* 7 */ +/***/ function(module, exports) { + + var core = module.exports = {version: '2.4.0'}; + if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(9) + , createDesc = __webpack_require__(15); + module.exports = __webpack_require__(4) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); + } : function(object, key, value){ + object[key] = value; + return object; + }; + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + var anObject = __webpack_require__(10) + , IE8_DOM_DEFINE = __webpack_require__(12) + , toPrimitive = __webpack_require__(14) + , dP = Object.defineProperty; + + exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; + }; + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11); + module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; + }; + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = !__webpack_require__(4) && !__webpack_require__(5)(function(){ + return Object.defineProperty(__webpack_require__(13)('div'), 'a', {get: function(){ return 7; }}).a != 7; + }); + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11) + , document = __webpack_require__(2).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); + module.exports = function(it){ + return is ? document.createElement(it) : {}; + }; + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.1 ToPrimitive(input [, PreferredType]) + var isObject = __webpack_require__(11); + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); + }; + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; + }; + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , hide = __webpack_require__(8) + , has = __webpack_require__(3) + , SRC = __webpack_require__(17)('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + + __webpack_require__(7).inspectSource = function(it){ + return $toString.call(it); + }; + + (module.exports = function(O, key, val, safe){ + var isFunction = typeof val == 'function'; + if(isFunction)has(val, 'name') || hide(val, 'name', key); + if(O[key] === val)return; + if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if(O === global){ + O[key] = val; + } else { + if(!safe){ + delete O[key]; + hide(O, key, val); + } else { + if(O[key])O[key] = val; + else hide(O, key, val); + } + } + // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + })(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); + }); + +/***/ }, +/* 17 */ +/***/ function(module, exports) { + + var id = 0 + , px = Math.random(); + module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + // optional / simple context binding + var aFunction = __webpack_require__(19); + module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; + }; + +/***/ }, +/* 19 */ +/***/ function(module, exports) { + + module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; + }; + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + var META = __webpack_require__(17)('meta') + , isObject = __webpack_require__(11) + , has = __webpack_require__(3) + , setDesc = __webpack_require__(9).f + , id = 0; + var isExtensible = Object.isExtensible || function(){ + return true; + }; + var FREEZE = !__webpack_require__(5)(function(){ + return isExtensible(Object.preventExtensions({})); + }); + var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); + }; + var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; + }; + var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; + }; + // add metadata on freeze-family methods calling + var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; + }; + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + }; + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); + module.exports = function(key){ + return store[key] || (store[key] = {}); + }; + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + var def = __webpack_require__(9).f + , has = __webpack_require__(3) + , TAG = __webpack_require__(23)('toStringTag'); + + module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); + }; + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + var store = __webpack_require__(21)('wks') + , uid = __webpack_require__(17) + , Symbol = __webpack_require__(2).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + + var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); + }; + + $exports.store = store; + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + exports.f = __webpack_require__(23); + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , LIBRARY = __webpack_require__(26) + , wksExt = __webpack_require__(24) + , defineProperty = __webpack_require__(9).f; + module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); + }; + +/***/ }, +/* 26 */ +/***/ function(module, exports) { + + module.exports = false; + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + var getKeys = __webpack_require__(28) + , toIObject = __webpack_require__(30); + module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; + }; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + var $keys = __webpack_require__(29) + , enumBugKeys = __webpack_require__(39); + + module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); + }; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + var has = __webpack_require__(3) + , toIObject = __webpack_require__(30) + , arrayIndexOf = __webpack_require__(34)(false) + , IE_PROTO = __webpack_require__(38)('IE_PROTO'); + + module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + // to indexed object, toObject with fallback for non-array-like ES3 strings + var IObject = __webpack_require__(31) + , defined = __webpack_require__(33); + module.exports = function(it){ + return IObject(defined(it)); + }; + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for non-array-like ES3 and non-enumerable old V8 strings + var cof = __webpack_require__(32); + module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); + }; + +/***/ }, +/* 32 */ +/***/ function(module, exports) { + + var toString = {}.toString; + + module.exports = function(it){ + return toString.call(it).slice(8, -1); + }; + +/***/ }, +/* 33 */ +/***/ function(module, exports) { + + // 7.2.1 RequireObjectCoercible(argument) + module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; + }; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + // false -> Array#indexOf + // true -> Array#includes + var toIObject = __webpack_require__(30) + , toLength = __webpack_require__(35) + , toIndex = __webpack_require__(37); + module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.15 ToLength + var toInteger = __webpack_require__(36) + , min = Math.min; + module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + +/***/ }, +/* 36 */ +/***/ function(module, exports) { + + // 7.1.4 ToInteger + var ceil = Math.ceil + , floor = Math.floor; + module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(36) + , max = Math.max + , min = Math.min; + module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); + }; + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + var shared = __webpack_require__(21)('keys') + , uid = __webpack_require__(17); + module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); + }; + +/***/ }, +/* 39 */ +/***/ function(module, exports) { + + // IE 8- don't enum bug keys + module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' + ).split(','); + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + // all enumerable object keys, includes symbols + var getKeys = __webpack_require__(28) + , gOPS = __webpack_require__(41) + , pIE = __webpack_require__(42); + module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; + }; + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + exports.f = Object.getOwnPropertySymbols; + +/***/ }, +/* 42 */ +/***/ function(module, exports) { + + exports.f = {}.propertyIsEnumerable; + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.2 IsArray(argument) + var cof = __webpack_require__(32); + module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; + }; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + var anObject = __webpack_require__(10) + , dPs = __webpack_require__(45) + , enumBugKeys = __webpack_require__(39) + , IE_PROTO = __webpack_require__(38)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(13)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(46).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); + }; + + module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); + }; + + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(9) + , anObject = __webpack_require__(10) + , getKeys = __webpack_require__(28); + + module.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; + }; + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(2).document && document.documentElement; + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + var toIObject = __webpack_require__(30) + , gOPN = __webpack_require__(48).f + , toString = {}.toString; + + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } + }; + + module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); + }; + + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + var $keys = __webpack_require__(29) + , hiddenKeys = __webpack_require__(39).concat('length', 'prototype'); + + exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); + }; + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + var pIE = __webpack_require__(42) + , createDesc = __webpack_require__(15) + , toIObject = __webpack_require__(30) + , toPrimitive = __webpack_require__(14) + , has = __webpack_require__(3) + , IE8_DOM_DEFINE = __webpack_require__(12) + , gOPD = Object.getOwnPropertyDescriptor; + + exports.f = __webpack_require__(4) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); + }; + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + $export($export.S + $export.F * !__webpack_require__(4), 'Object', {defineProperty: __webpack_require__(9).f}); + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) + $export($export.S + $export.F * !__webpack_require__(4), 'Object', {defineProperties: __webpack_require__(45)}); + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + var toIObject = __webpack_require__(30) + , $getOwnPropertyDescriptor = __webpack_require__(49).f; + + __webpack_require__(53)('getOwnPropertyDescriptor', function(){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; + }); + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + // most Object methods by ES6 should accept primitives + var $export = __webpack_require__(6) + , core = __webpack_require__(7) + , fails = __webpack_require__(5); + module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); + }; + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + $export($export.S, 'Object', {create: __webpack_require__(44)}); + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 Object.getPrototypeOf(O) + var toObject = __webpack_require__(56) + , $getPrototypeOf = __webpack_require__(57); + + __webpack_require__(53)('getPrototypeOf', function(){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; + }); + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.13 ToObject(argument) + var defined = __webpack_require__(33); + module.exports = function(it){ + return Object(defined(it)); + }; + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + var has = __webpack_require__(3) + , toObject = __webpack_require__(56) + , IE_PROTO = __webpack_require__(38)('IE_PROTO') + , ObjectProto = Object.prototype; + + module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }; + +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.14 Object.keys(O) + var toObject = __webpack_require__(56) + , $keys = __webpack_require__(28); + + __webpack_require__(53)('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; + }); + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 Object.getOwnPropertyNames(O) + __webpack_require__(53)('getOwnPropertyNames', function(){ + return __webpack_require__(47).f; + }); + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.5 Object.freeze(O) + var isObject = __webpack_require__(11) + , meta = __webpack_require__(20).onFreeze; + + __webpack_require__(53)('freeze', function($freeze){ + return function freeze(it){ + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; + }); + +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.17 Object.seal(O) + var isObject = __webpack_require__(11) + , meta = __webpack_require__(20).onFreeze; + + __webpack_require__(53)('seal', function($seal){ + return function seal(it){ + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; + }); + +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.15 Object.preventExtensions(O) + var isObject = __webpack_require__(11) + , meta = __webpack_require__(20).onFreeze; + + __webpack_require__(53)('preventExtensions', function($preventExtensions){ + return function preventExtensions(it){ + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; + }); + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.12 Object.isFrozen(O) + var isObject = __webpack_require__(11); + + __webpack_require__(53)('isFrozen', function($isFrozen){ + return function isFrozen(it){ + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; + }); + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.13 Object.isSealed(O) + var isObject = __webpack_require__(11); + + __webpack_require__(53)('isSealed', function($isSealed){ + return function isSealed(it){ + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; + }); + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.11 Object.isExtensible(O) + var isObject = __webpack_require__(11); + + __webpack_require__(53)('isExtensible', function($isExtensible){ + return function isExtensible(it){ + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; + }); + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.1 Object.assign(target, source) + var $export = __webpack_require__(6); + + $export($export.S + $export.F, 'Object', {assign: __webpack_require__(67)}); + +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 19.1.2.1 Object.assign(target, source, ...) + var getKeys = __webpack_require__(28) + , gOPS = __webpack_require__(41) + , pIE = __webpack_require__(42) + , toObject = __webpack_require__(56) + , IObject = __webpack_require__(31) + , $assign = Object.assign; + + // should work with symbols and should have deterministic property order (V8 bug) + module.exports = !$assign || __webpack_require__(5)(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; + }) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; + } : $assign; + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.10 Object.is(value1, value2) + var $export = __webpack_require__(6); + $export($export.S, 'Object', {is: __webpack_require__(69)}); + +/***/ }, +/* 69 */ +/***/ function(module, exports) { + + // 7.2.9 SameValue(x, y) + module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; + }; + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + var $export = __webpack_require__(6); + $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(71).set}); + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + var isObject = __webpack_require__(11) + , anObject = __webpack_require__(10); + var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); + }; + module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = __webpack_require__(18)(Function.call, __webpack_require__(49).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 19.1.3.6 Object.prototype.toString() + var classof = __webpack_require__(73) + , test = {}; + test[__webpack_require__(23)('toStringTag')] = 'z'; + if(test + '' != '[object z]'){ + __webpack_require__(16)(Object.prototype, 'toString', function toString(){ + return '[object ' + classof(this) + ']'; + }, true); + } + +/***/ }, +/* 73 */ +/***/ function(module, exports, __webpack_require__) { + + // getting tag from 19.1.3.6 Object.prototype.toString() + var cof = __webpack_require__(32) + , TAG = __webpack_require__(23)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } + }; + + module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + +/***/ }, +/* 74 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) + var $export = __webpack_require__(6); + + $export($export.P, 'Function', {bind: __webpack_require__(75)}); + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var aFunction = __webpack_require__(19) + , isObject = __webpack_require__(11) + , invoke = __webpack_require__(76) + , arraySlice = [].slice + , factories = {}; + + var construct = function(F, len, args){ + if(!(len in factories)){ + for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); + }; + + module.exports = Function.bind || function bind(that /*, args... */){ + var fn = aFunction(this) + , partArgs = arraySlice.call(arguments, 1); + var bound = function(/* args... */){ + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if(isObject(fn.prototype))bound.prototype = fn.prototype; + return bound; + }; + +/***/ }, +/* 76 */ +/***/ function(module, exports) { + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(9).f + , createDesc = __webpack_require__(15) + , has = __webpack_require__(3) + , FProto = Function.prototype + , nameRE = /^\s*function ([^ (]*)/ + , NAME = 'name'; + + var isExtensible = Object.isExtensible || function(){ + return true; + }; + + // 19.2.4.2 name + NAME in FProto || __webpack_require__(4) && dP(FProto, NAME, { + configurable: true, + get: function(){ + try { + var that = this + , name = ('' + that).match(nameRE)[1]; + has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name)); + return name; + } catch(e){ + return ''; + } + } + }); + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var isObject = __webpack_require__(11) + , getPrototypeOf = __webpack_require__(57) + , HAS_INSTANCE = __webpack_require__(23)('hasInstance') + , FunctionProto = Function.prototype; + // 19.2.3.6 Function.prototype[@@hasInstance](V) + if(!(HAS_INSTANCE in FunctionProto))__webpack_require__(9).f(FunctionProto, HAS_INSTANCE, {value: function(O){ + if(typeof this != 'function' || !isObject(O))return false; + if(!isObject(this.prototype))return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while(O = getPrototypeOf(O))if(this.prototype === O)return true; + return false; + }}); + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , has = __webpack_require__(3) + , cof = __webpack_require__(32) + , inheritIfRequired = __webpack_require__(80) + , toPrimitive = __webpack_require__(14) + , fails = __webpack_require__(5) + , gOPN = __webpack_require__(48).f + , gOPD = __webpack_require__(49).f + , dP = __webpack_require__(9).f + , $trim = __webpack_require__(81).trim + , NUMBER = 'Number' + , $Number = global[NUMBER] + , Base = $Number + , proto = $Number.prototype + // Opera ~12 has broken Object#toString + , BROKEN_COF = cof(__webpack_require__(44)(proto)) == NUMBER + , TRIM = 'trim' in String.prototype; + + // 7.1.3 ToNumber(argument) + var toNumber = function(argument){ + var it = toPrimitive(argument, false); + if(typeof it == 'string' && it.length > 2){ + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0) + , third, radix, maxCode; + if(first === 43 || first === 45){ + third = it.charCodeAt(2); + if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if(first === 48){ + switch(it.charCodeAt(1)){ + case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default : return +it; + } + for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){ + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if(code < 48 || code > maxCode)return NaN; + } return parseInt(digits, radix); + } + } return +it; + }; + + if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ + $Number = function Number(value){ + var it = arguments.length < 1 ? 0 : value + , that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for(var keys = __webpack_require__(4) ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++){ + if(has(Base, key = keys[j]) && !has($Number, key)){ + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + __webpack_require__(16)(global, NUMBER, $Number); + } + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11) + , setPrototypeOf = __webpack_require__(71).set; + module.exports = function(that, target, C){ + var P, S = target.constructor; + if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){ + setPrototypeOf(that, P); + } return that; + }; + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , defined = __webpack_require__(33) + , fails = __webpack_require__(5) + , spaces = __webpack_require__(82) + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + + var exporter = function(KEY, exec, ALIAS){ + var exp = {}; + var FORCE = fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if(ALIAS)exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); + }; + + // 1 -> String#trimLeft + // 2 -> String#trimRight + // 3 -> String#trim + var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; + }; + + module.exports = exporter; + +/***/ }, +/* 82 */ +/***/ function(module, exports) { + + module.exports = '\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'; + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toInteger = __webpack_require__(36) + , aNumberValue = __webpack_require__(84) + , repeat = __webpack_require__(85) + , $toFixed = 1..toFixed + , floor = Math.floor + , data = [0, 0, 0, 0, 0, 0] + , ERROR = 'Number.toFixed: incorrect invocation!' + , ZERO = '0'; + + var multiply = function(n, c){ + var i = -1 + , c2 = c; + while(++i < 6){ + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } + }; + var divide = function(n){ + var i = 6 + , c = 0; + while(--i >= 0){ + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } + }; + var numToString = function(){ + var i = 6 + , s = ''; + while(--i >= 0){ + if(s !== '' || i === 0 || data[i] !== 0){ + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; + }; + var pow = function(x, n, acc){ + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); + }; + var log = function(x){ + var n = 0 + , x2 = x; + while(x2 >= 4096){ + n += 12; + x2 /= 4096; + } + while(x2 >= 2){ + n += 1; + x2 /= 2; + } return n; + }; + + $export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128..toFixed(0) !== '1000000000000000128' + ) || !__webpack_require__(5)(function(){ + // V8 ~ Android 4.3- + $toFixed.call({}); + })), 'Number', { + toFixed: function toFixed(fractionDigits){ + var x = aNumberValue(this, ERROR) + , f = toInteger(fractionDigits) + , s = '' + , m = ZERO + , e, z, j, k; + if(f < 0 || f > 20)throw RangeError(ERROR); + if(x != x)return 'NaN'; + if(x <= -1e21 || x >= 1e21)return String(x); + if(x < 0){ + s = '-'; + x = -x; + } + if(x > 1e-21){ + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if(e > 0){ + multiply(0, z); + j = f; + while(j >= 7){ + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while(j >= 23){ + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if(f > 0){ + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } + }); + +/***/ }, +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + var cof = __webpack_require__(32); + module.exports = function(it, msg){ + if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); + return +it; + }; + +/***/ }, +/* 85 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var toInteger = __webpack_require__(36) + , defined = __webpack_require__(33); + + module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; + }; + +/***/ }, +/* 86 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $fails = __webpack_require__(5) + , aNumberValue = __webpack_require__(84) + , $toPrecision = 1..toPrecision; + + $export($export.P + $export.F * ($fails(function(){ + // IE7- + return $toPrecision.call(1, undefined) !== '1'; + }) || !$fails(function(){ + // V8 ~ Android 4.3- + $toPrecision.call({}); + })), 'Number', { + toPrecision: function toPrecision(precision){ + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } + }); + +/***/ }, +/* 87 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.1 Number.EPSILON + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); + +/***/ }, +/* 88 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.2 Number.isFinite(number) + var $export = __webpack_require__(6) + , _isFinite = __webpack_require__(2).isFinite; + + $export($export.S, 'Number', { + isFinite: function isFinite(it){ + return typeof it == 'number' && _isFinite(it); + } + }); + +/***/ }, +/* 89 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {isInteger: __webpack_require__(90)}); + +/***/ }, +/* 90 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var isObject = __webpack_require__(11) + , floor = Math.floor; + module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; + }; + +/***/ }, +/* 91 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.4 Number.isNaN(number) + var $export = __webpack_require__(6); + + $export($export.S, 'Number', { + isNaN: function isNaN(number){ + return number != number; + } + }); + +/***/ }, +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.5 Number.isSafeInteger(number) + var $export = __webpack_require__(6) + , isInteger = __webpack_require__(90) + , abs = Math.abs; + + $export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number){ + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } + }); + +/***/ }, +/* 93 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.6 Number.MAX_SAFE_INTEGER + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.10 Number.MIN_SAFE_INTEGER + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); + +/***/ }, +/* 95 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseFloat = __webpack_require__(96); + // 20.1.2.12 Number.parseFloat(string) + $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); + +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { + + var $parseFloat = __webpack_require__(2).parseFloat + , $trim = __webpack_require__(81).trim; + + module.exports = 1 / $parseFloat(__webpack_require__(82) + '-0') !== -Infinity ? function parseFloat(str){ + var string = $trim(String(str), 3) + , result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; + } : $parseFloat; + +/***/ }, +/* 97 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseInt = __webpack_require__(98); + // 20.1.2.13 Number.parseInt(string, radix) + $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); + +/***/ }, +/* 98 */ +/***/ function(module, exports, __webpack_require__) { + + var $parseInt = __webpack_require__(2).parseInt + , $trim = __webpack_require__(81).trim + , ws = __webpack_require__(82) + , hex = /^[\-+]?0[xX]/; + + module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){ + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); + } : $parseInt; + +/***/ }, +/* 99 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseInt = __webpack_require__(98); + // 18.2.5 parseInt(string, radix) + $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseFloat = __webpack_require__(96); + // 18.2.4 parseFloat(string) + $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); + +/***/ }, +/* 101 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.3 Math.acosh(x) + var $export = __webpack_require__(6) + , log1p = __webpack_require__(102) + , sqrt = Math.sqrt + , $acosh = Math.acosh; + + $export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity + ), 'Math', { + acosh: function acosh(x){ + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } + }); + +/***/ }, +/* 102 */ +/***/ function(module, exports) { + + // 20.2.2.20 Math.log1p(x) + module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); + }; + +/***/ }, +/* 103 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.5 Math.asinh(x) + var $export = __webpack_require__(6) + , $asinh = Math.asinh; + + function asinh(x){ + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); + } + + // Tor Browser bug: Math.asinh(0) -> -0 + $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); + +/***/ }, +/* 104 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.7 Math.atanh(x) + var $export = __webpack_require__(6) + , $atanh = Math.atanh; + + // Tor Browser bug: Math.atanh(-0) -> 0 + $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x){ + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } + }); + +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.9 Math.cbrt(x) + var $export = __webpack_require__(6) + , sign = __webpack_require__(106); + + $export($export.S, 'Math', { + cbrt: function cbrt(x){ + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } + }); + +/***/ }, +/* 106 */ +/***/ function(module, exports) { + + // 20.2.2.28 Math.sign(x) + module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; + }; + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.11 Math.clz32(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + clz32: function clz32(x){ + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } + }); + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.12 Math.cosh(x) + var $export = __webpack_require__(6) + , exp = Math.exp; + + $export($export.S, 'Math', { + cosh: function cosh(x){ + return (exp(x = +x) + exp(-x)) / 2; + } + }); + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.14 Math.expm1(x) + var $export = __webpack_require__(6) + , $expm1 = __webpack_require__(110); + + $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); + +/***/ }, +/* 110 */ +/***/ function(module, exports) { + + // 20.2.2.14 Math.expm1(x) + var $expm1 = Math.expm1; + module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 + ) ? function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; + } : $expm1; + +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.16 Math.fround(x) + var $export = __webpack_require__(6) + , sign = __webpack_require__(106) + , pow = Math.pow + , EPSILON = pow(2, -52) + , EPSILON32 = pow(2, -23) + , MAX32 = pow(2, 127) * (2 - EPSILON32) + , MIN32 = pow(2, -126); + + var roundTiesToEven = function(n){ + return n + 1 / EPSILON - 1 / EPSILON; + }; + + + $export($export.S, 'Math', { + fround: function fround(x){ + var $abs = Math.abs(x) + , $sign = sign(x) + , a, result; + if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + if(result > MAX32 || result != result)return $sign * Infinity; + return $sign * result; + } + }); + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) + var $export = __webpack_require__(6) + , abs = Math.abs; + + $export($export.S, 'Math', { + hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars + var sum = 0 + , i = 0 + , aLen = arguments.length + , larg = 0 + , arg, div; + while(i < aLen){ + arg = abs(arguments[i++]); + if(larg < arg){ + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if(arg > 0){ + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } + }); + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.18 Math.imul(x, y) + var $export = __webpack_require__(6) + , $imul = Math.imul; + + // some WebKit versions fails with big numbers, some has wrong arity + $export($export.S + $export.F * __webpack_require__(5)(function(){ + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; + }), 'Math', { + imul: function imul(x, y){ + var UINT16 = 0xffff + , xn = +x + , yn = +y + , xl = UINT16 & xn + , yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } + }); + +/***/ }, +/* 114 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.21 Math.log10(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + log10: function log10(x){ + return Math.log(x) / Math.LN10; + } + }); + +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.20 Math.log1p(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', {log1p: __webpack_require__(102)}); + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.22 Math.log2(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + log2: function log2(x){ + return Math.log(x) / Math.LN2; + } + }); + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.28 Math.sign(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', {sign: __webpack_require__(106)}); + +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.30 Math.sinh(x) + var $export = __webpack_require__(6) + , expm1 = __webpack_require__(110) + , exp = Math.exp; + + // V8 near Chromium 38 has a problem with very small numbers + $export($export.S + $export.F * __webpack_require__(5)(function(){ + return !Math.sinh(-2e-17) != -2e-17; + }), 'Math', { + sinh: function sinh(x){ + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } + }); + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.33 Math.tanh(x) + var $export = __webpack_require__(6) + , expm1 = __webpack_require__(110) + , exp = Math.exp; + + $export($export.S, 'Math', { + tanh: function tanh(x){ + var a = expm1(x = +x) + , b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } + }); + +/***/ }, +/* 120 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.34 Math.trunc(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + trunc: function trunc(it){ + return (it > 0 ? Math.floor : Math.ceil)(it); + } + }); + +/***/ }, +/* 121 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , toIndex = __webpack_require__(37) + , fromCharCode = String.fromCharCode + , $fromCodePoint = String.fromCodePoint; + + // length should be 1, old FF problem + $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars + var res = [] + , aLen = arguments.length + , i = 0 + , code; + while(aLen > i){ + code = +arguments[i++]; + if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } + }); + +/***/ }, +/* 122 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , toLength = __webpack_require__(35); + + $export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite){ + var tpl = toIObject(callSite.raw) + , len = toLength(tpl.length) + , aLen = arguments.length + , res = [] + , i = 0; + while(len > i){ + res.push(String(tpl[i++])); + if(i < aLen)res.push(String(arguments[i])); + } return res.join(''); + } + }); + +/***/ }, +/* 123 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.1.3.25 String.prototype.trim() + __webpack_require__(81)('trim', function($trim){ + return function trim(){ + return $trim(this, 3); + }; + }); + +/***/ }, +/* 124 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $at = __webpack_require__(125)(false); + $export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 125 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(36) + , defined = __webpack_require__(33); + // true -> String#at + // false -> String#codePointAt + module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + +/***/ }, +/* 126 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + 'use strict'; + var $export = __webpack_require__(6) + , toLength = __webpack_require__(35) + , context = __webpack_require__(127) + , ENDS_WITH = 'endsWith' + , $endsWith = ''[ENDS_WITH]; + + $export($export.P + $export.F * __webpack_require__(129)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /*, endPosition = @length */){ + var that = context(this, searchString, ENDS_WITH) + , endPosition = arguments.length > 1 ? arguments[1] : undefined + , len = toLength(that.length) + , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) + , search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } + }); + +/***/ }, +/* 127 */ +/***/ function(module, exports, __webpack_require__) { + + // helper for String#{startsWith, endsWith, includes} + var isRegExp = __webpack_require__(128) + , defined = __webpack_require__(33); + + module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); + }; + +/***/ }, +/* 128 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.8 IsRegExp(argument) + var isObject = __webpack_require__(11) + , cof = __webpack_require__(32) + , MATCH = __webpack_require__(23)('match'); + module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); + }; + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + var MATCH = __webpack_require__(23)('match'); + module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; + }; + +/***/ }, +/* 130 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.7 String.prototype.includes(searchString, position = 0) + 'use strict'; + var $export = __webpack_require__(6) + , context = __webpack_require__(127) + , INCLUDES = 'includes'; + + $export($export.P + $export.F * __webpack_require__(129)(INCLUDES), 'String', { + includes: function includes(searchString /*, position = 0 */){ + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } + }); + +/***/ }, +/* 131 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + + $export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(85) + }); + +/***/ }, +/* 132 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + 'use strict'; + var $export = __webpack_require__(6) + , toLength = __webpack_require__(35) + , context = __webpack_require__(127) + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + + $export($export.P + $export.F * __webpack_require__(129)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } + }); + +/***/ }, +/* 133 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $at = __webpack_require__(125)(true); + + // 21.1.3.27 String.prototype[@@iterator]() + __webpack_require__(134)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; + }); + +/***/ }, +/* 134 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var LIBRARY = __webpack_require__(26) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(16) + , hide = __webpack_require__(8) + , has = __webpack_require__(3) + , Iterators = __webpack_require__(135) + , $iterCreate = __webpack_require__(136) + , setToStringTag = __webpack_require__(22) + , getPrototypeOf = __webpack_require__(57) + , ITERATOR = __webpack_require__(23)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + + var returnThis = function(){ return this; }; + + module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; + +/***/ }, +/* 135 */ +/***/ function(module, exports) { + + module.exports = {}; + +/***/ }, +/* 136 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var create = __webpack_require__(44) + , descriptor = __webpack_require__(15) + , setToStringTag = __webpack_require__(22) + , IteratorPrototype = {}; + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + __webpack_require__(8)(IteratorPrototype, __webpack_require__(23)('iterator'), function(){ return this; }); + + module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); + }; + +/***/ }, +/* 137 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.2 String.prototype.anchor(name) + __webpack_require__(138)('anchor', function(createHTML){ + return function anchor(name){ + return createHTML(this, 'a', 'name', name); + } + }); + +/***/ }, +/* 138 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , fails = __webpack_require__(5) + , defined = __webpack_require__(33) + , quot = /"/g; + // B.2.3.2.1 CreateHTML(string, tag, attribute, value) + var createHTML = function(string, tag, attribute, value) { + var S = String(defined(string)) + , p1 = '<' + tag; + if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; + }; + module.exports = function(NAME, exec){ + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function(){ + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); + }; + +/***/ }, +/* 139 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.3 String.prototype.big() + __webpack_require__(138)('big', function(createHTML){ + return function big(){ + return createHTML(this, 'big', '', ''); + } + }); + +/***/ }, +/* 140 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.4 String.prototype.blink() + __webpack_require__(138)('blink', function(createHTML){ + return function blink(){ + return createHTML(this, 'blink', '', ''); + } + }); + +/***/ }, +/* 141 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.5 String.prototype.bold() + __webpack_require__(138)('bold', function(createHTML){ + return function bold(){ + return createHTML(this, 'b', '', ''); + } + }); + +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.6 String.prototype.fixed() + __webpack_require__(138)('fixed', function(createHTML){ + return function fixed(){ + return createHTML(this, 'tt', '', ''); + } + }); + +/***/ }, +/* 143 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.7 String.prototype.fontcolor(color) + __webpack_require__(138)('fontcolor', function(createHTML){ + return function fontcolor(color){ + return createHTML(this, 'font', 'color', color); + } + }); + +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.8 String.prototype.fontsize(size) + __webpack_require__(138)('fontsize', function(createHTML){ + return function fontsize(size){ + return createHTML(this, 'font', 'size', size); + } + }); + +/***/ }, +/* 145 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.9 String.prototype.italics() + __webpack_require__(138)('italics', function(createHTML){ + return function italics(){ + return createHTML(this, 'i', '', ''); + } + }); + +/***/ }, +/* 146 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.10 String.prototype.link(url) + __webpack_require__(138)('link', function(createHTML){ + return function link(url){ + return createHTML(this, 'a', 'href', url); + } + }); + +/***/ }, +/* 147 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.11 String.prototype.small() + __webpack_require__(138)('small', function(createHTML){ + return function small(){ + return createHTML(this, 'small', '', ''); + } + }); + +/***/ }, +/* 148 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.12 String.prototype.strike() + __webpack_require__(138)('strike', function(createHTML){ + return function strike(){ + return createHTML(this, 'strike', '', ''); + } + }); + +/***/ }, +/* 149 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.13 String.prototype.sub() + __webpack_require__(138)('sub', function(createHTML){ + return function sub(){ + return createHTML(this, 'sub', '', ''); + } + }); + +/***/ }, +/* 150 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.14 String.prototype.sup() + __webpack_require__(138)('sup', function(createHTML){ + return function sup(){ + return createHTML(this, 'sup', '', ''); + } + }); + +/***/ }, +/* 151 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) + var $export = __webpack_require__(6); + + $export($export.S, 'Array', {isArray: __webpack_require__(43)}); + +/***/ }, +/* 152 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var ctx = __webpack_require__(18) + , $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , call = __webpack_require__(153) + , isArrayIter = __webpack_require__(154) + , toLength = __webpack_require__(35) + , createProperty = __webpack_require__(155) + , getIterFn = __webpack_require__(156); + + $export($export.S + $export.F * !__webpack_require__(157)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } + }); + + +/***/ }, +/* 153 */ +/***/ function(module, exports, __webpack_require__) { + + // call something on iterator step with safe closing on error + var anObject = __webpack_require__(10); + module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } + }; + +/***/ }, +/* 154 */ +/***/ function(module, exports, __webpack_require__) { + + // check on default Array iterator + var Iterators = __webpack_require__(135) + , ITERATOR = __webpack_require__(23)('iterator') + , ArrayProto = Array.prototype; + + module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); + }; + +/***/ }, +/* 155 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $defineProperty = __webpack_require__(9) + , createDesc = __webpack_require__(15); + + module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; + }; + +/***/ }, +/* 156 */ +/***/ function(module, exports, __webpack_require__) { + + var classof = __webpack_require__(73) + , ITERATOR = __webpack_require__(23)('iterator') + , Iterators = __webpack_require__(135); + module.exports = __webpack_require__(7).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; + }; + +/***/ }, +/* 157 */ +/***/ function(module, exports, __webpack_require__) { + + var ITERATOR = __webpack_require__(23)('iterator') + , SAFE_CLOSING = false; + + try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); + } catch(e){ /* empty */ } + + module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; + }; + +/***/ }, +/* 158 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , createProperty = __webpack_require__(155); + + // WebKit Array.of isn't generic + $export($export.S + $export.F * __webpack_require__(5)(function(){ + function F(){} + return !(Array.of.call(F) instanceof F); + }), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */){ + var index = 0 + , aLen = arguments.length + , result = new (typeof this == 'function' ? this : Array)(aLen); + while(aLen > index)createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } + }); + +/***/ }, +/* 159 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.13 Array.prototype.join(separator) + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , arrayJoin = [].join; + + // fallback for not array-like strings + $export($export.P + $export.F * (__webpack_require__(31) != Object || !__webpack_require__(160)(arrayJoin)), 'Array', { + join: function join(separator){ + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } + }); + +/***/ }, +/* 160 */ +/***/ function(module, exports, __webpack_require__) { + + var fails = __webpack_require__(5); + + module.exports = function(method, arg){ + return !!method && fails(function(){ + arg ? method.call(null, function(){}, 1) : method.call(null); + }); + }; + +/***/ }, +/* 161 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , html = __webpack_require__(46) + , cof = __webpack_require__(32) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35) + , arraySlice = [].slice; + + // fallback for not array-like ES3 strings and DOM objects + $export($export.P + $export.F * __webpack_require__(5)(function(){ + if(html)arraySlice.call(html); + }), 'Array', { + slice: function slice(begin, end){ + var len = toLength(this.length) + , klass = cof(this); + end = end === undefined ? len : end; + if(klass == 'Array')return arraySlice.call(this, begin, end); + var start = toIndex(begin, len) + , upTo = toIndex(end, len) + , size = toLength(upTo - start) + , cloned = Array(size) + , i = 0; + for(; i < size; i++)cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } + }); + +/***/ }, +/* 162 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , aFunction = __webpack_require__(19) + , toObject = __webpack_require__(56) + , fails = __webpack_require__(5) + , $sort = [].sort + , test = [1, 2, 3]; + + $export($export.P + $export.F * (fails(function(){ + // IE8- + test.sort(undefined); + }) || !fails(function(){ + // V8 bug + test.sort(null); + // Old WebKit + }) || !__webpack_require__(160)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn){ + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } + }); + +/***/ }, +/* 163 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $forEach = __webpack_require__(164)(0) + , STRICT = __webpack_require__(160)([].forEach, true); + + $export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */){ + return $forEach(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 164 */ +/***/ function(module, exports, __webpack_require__) { + + // 0 -> Array#forEach + // 1 -> Array#map + // 2 -> Array#filter + // 3 -> Array#some + // 4 -> Array#every + // 5 -> Array#find + // 6 -> Array#findIndex + var ctx = __webpack_require__(18) + , IObject = __webpack_require__(31) + , toObject = __webpack_require__(56) + , toLength = __webpack_require__(35) + , asc = __webpack_require__(165); + module.exports = function(TYPE, $create){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX + , create = $create || asc; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; + }; + +/***/ }, +/* 165 */ +/***/ function(module, exports, __webpack_require__) { + + // 9.4.2.3 ArraySpeciesCreate(originalArray, length) + var speciesConstructor = __webpack_require__(166); + + module.exports = function(original, length){ + return new (speciesConstructor(original))(length); + }; + +/***/ }, +/* 166 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11) + , isArray = __webpack_require__(43) + , SPECIES = __webpack_require__(23)('species'); + + module.exports = function(original){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return C === undefined ? Array : C; + }; + +/***/ }, +/* 167 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $map = __webpack_require__(164)(1); + + $export($export.P + $export.F * !__webpack_require__(160)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */){ + return $map(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 168 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $filter = __webpack_require__(164)(2); + + $export($export.P + $export.F * !__webpack_require__(160)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */){ + return $filter(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 169 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $some = __webpack_require__(164)(3); + + $export($export.P + $export.F * !__webpack_require__(160)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */){ + return $some(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 170 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $every = __webpack_require__(164)(4); + + $export($export.P + $export.F * !__webpack_require__(160)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */){ + return $every(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 171 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $reduce = __webpack_require__(172); + + $export($export.P + $export.F * !__webpack_require__(160)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } + }); + +/***/ }, +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + var aFunction = __webpack_require__(19) + , toObject = __webpack_require__(56) + , IObject = __webpack_require__(31) + , toLength = __webpack_require__(35); + + module.exports = function(that, callbackfn, aLen, memo, isRight){ + aFunction(callbackfn); + var O = toObject(that) + , self = IObject(O) + , length = toLength(O.length) + , index = isRight ? length - 1 : 0 + , i = isRight ? -1 : 1; + if(aLen < 2)for(;;){ + if(index in self){ + memo = self[index]; + index += i; + break; + } + index += i; + if(isRight ? index < 0 : length <= index){ + throw TypeError('Reduce of empty array with no initial value'); + } + } + for(;isRight ? index >= 0 : length > index; index += i)if(index in self){ + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; + +/***/ }, +/* 173 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $reduce = __webpack_require__(172); + + $export($export.P + $export.F * !__webpack_require__(160)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } + }); + +/***/ }, +/* 174 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $indexOf = __webpack_require__(34)(false) + , $native = [].indexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + + $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(160)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /*, fromIndex = 0 */){ + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } + }); + +/***/ }, +/* 175 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , $native = [].lastIndexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + + $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(160)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){ + // convert -0 to +0 + if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0; + var O = toIObject(this) + , length = toLength(O.length) + , index = length - 1; + if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1])); + if(index < 0)index = length + index; + for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0; + return -1; + } + }); + +/***/ }, +/* 176 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + var $export = __webpack_require__(6); + + $export($export.P, 'Array', {copyWithin: __webpack_require__(177)}); + + __webpack_require__(178)('copyWithin'); + +/***/ }, +/* 177 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + 'use strict'; + var toObject = __webpack_require__(56) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35); + + module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){ + var O = toObject(this) + , len = toLength(O.length) + , to = toIndex(target, len) + , from = toIndex(start, len) + , end = arguments.length > 2 ? arguments[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; + }; + +/***/ }, +/* 178 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.31 Array.prototype[@@unscopables] + var UNSCOPABLES = __webpack_require__(23)('unscopables') + , ArrayProto = Array.prototype; + if(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(8)(ArrayProto, UNSCOPABLES, {}); + module.exports = function(key){ + ArrayProto[UNSCOPABLES][key] = true; + }; + +/***/ }, +/* 179 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + var $export = __webpack_require__(6); + + $export($export.P, 'Array', {fill: __webpack_require__(180)}); + + __webpack_require__(178)('fill'); + +/***/ }, +/* 180 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + 'use strict'; + var toObject = __webpack_require__(56) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35); + module.exports = function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , aLen = arguments.length + , index = toIndex(aLen > 1 ? arguments[1] : undefined, length) + , end = aLen > 2 ? arguments[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; + }; + +/***/ }, +/* 181 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) + var $export = __webpack_require__(6) + , $find = __webpack_require__(164)(5) + , KEY = 'find' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(178)(KEY); + +/***/ }, +/* 182 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) + var $export = __webpack_require__(6) + , $find = __webpack_require__(164)(6) + , KEY = 'findIndex' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(178)(KEY); + +/***/ }, +/* 183 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var addToUnscopables = __webpack_require__(178) + , step = __webpack_require__(184) + , Iterators = __webpack_require__(135) + , toIObject = __webpack_require__(30); + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + module.exports = __webpack_require__(134)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + Iterators.Arguments = Iterators.Array; + + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); + +/***/ }, +/* 184 */ +/***/ function(module, exports) { + + module.exports = function(done, value){ + return {value: value, done: !!done}; + }; + +/***/ }, +/* 185 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(186)('Array'); + +/***/ }, +/* 186 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , dP = __webpack_require__(9) + , DESCRIPTORS = __webpack_require__(4) + , SPECIES = __webpack_require__(23)('species'); + + module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); + }; + +/***/ }, +/* 187 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , inheritIfRequired = __webpack_require__(80) + , dP = __webpack_require__(9).f + , gOPN = __webpack_require__(48).f + , isRegExp = __webpack_require__(128) + , $flags = __webpack_require__(188) + , $RegExp = global.RegExp + , Base = $RegExp + , proto = $RegExp.prototype + , re1 = /a/g + , re2 = /a/g + // "new" creates a new object, old webkit buggy here + , CORRECT_NEW = new $RegExp(re1) !== re1; + + if(__webpack_require__(4) && (!CORRECT_NEW || __webpack_require__(5)(function(){ + re2[__webpack_require__(23)('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; + }))){ + $RegExp = function RegExp(p, f){ + var tiRE = this instanceof $RegExp + , piRE = isRegExp(p) + , fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function(key){ + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function(){ return Base[key]; }, + set: function(it){ Base[key] = it; } + }); + }; + for(var keys = gOPN(Base), i = 0; keys.length > i; )proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __webpack_require__(16)(global, 'RegExp', $RegExp); + } + + __webpack_require__(186)('RegExp'); + +/***/ }, +/* 188 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.2.5.3 get RegExp.prototype.flags + var anObject = __webpack_require__(10); + module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; + }; + +/***/ }, +/* 189 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + __webpack_require__(190); + var anObject = __webpack_require__(10) + , $flags = __webpack_require__(188) + , DESCRIPTORS = __webpack_require__(4) + , TO_STRING = 'toString' + , $toString = /./[TO_STRING]; + + var define = function(fn){ + __webpack_require__(16)(RegExp.prototype, TO_STRING, fn, true); + }; + + // 21.2.5.14 RegExp.prototype.toString() + if(__webpack_require__(5)(function(){ return $toString.call({source: 'a', flags: 'b'}) != '/a/b'; })){ + define(function toString(){ + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); + // FF44- RegExp#toString has a wrong name + } else if($toString.name != TO_STRING){ + define(function toString(){ + return $toString.call(this); + }); + } + +/***/ }, +/* 190 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.2.5.3 get RegExp.prototype.flags() + if(__webpack_require__(4) && /./g.flags != 'g')__webpack_require__(9).f(RegExp.prototype, 'flags', { + configurable: true, + get: __webpack_require__(188) + }); + +/***/ }, +/* 191 */ +/***/ function(module, exports, __webpack_require__) { + + // @@match logic + __webpack_require__(192)('match', 1, function(defined, MATCH, $match){ + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; + }); + +/***/ }, +/* 192 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var hide = __webpack_require__(8) + , redefine = __webpack_require__(16) + , fails = __webpack_require__(5) + , defined = __webpack_require__(33) + , wks = __webpack_require__(23); + + module.exports = function(KEY, length, exec){ + var SYMBOL = wks(KEY) + , fns = exec(defined, SYMBOL, ''[KEY]) + , strfn = fns[0] + , rxfn = fns[1]; + if(fails(function(){ + var O = {}; + O[SYMBOL] = function(){ return 7; }; + return ''[KEY](O) != 7; + })){ + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function(string, arg){ return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function(string){ return rxfn.call(string, this); } + ); + } + }; + +/***/ }, +/* 193 */ +/***/ function(module, exports, __webpack_require__) { + + // @@replace logic + __webpack_require__(192)('replace', 2, function(defined, REPLACE, $replace){ + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue){ + 'use strict'; + var O = defined(this) + , fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; + }); + +/***/ }, +/* 194 */ +/***/ function(module, exports, __webpack_require__) { + + // @@search logic + __webpack_require__(192)('search', 1, function(defined, SEARCH, $search){ + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; + }); + +/***/ }, +/* 195 */ +/***/ function(module, exports, __webpack_require__) { + + // @@split logic + __webpack_require__(192)('split', 2, function(defined, SPLIT, $split){ + 'use strict'; + var isRegExp = __webpack_require__(128) + , _split = $split + , $push = [].push + , $SPLIT = 'split' + , LENGTH = 'length' + , LAST_INDEX = 'lastIndex'; + if( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ){ + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function(separator, limit){ + var string = String(this); + if(separator === undefined && limit === 0)return []; + // If `separator` is not a regex, use native split + if(!isRegExp(separator))return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while(match = separatorCopy.exec(string)){ + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if(lastIndex > lastLastIndex){ + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){ + for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined; + }); + if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if(output[LENGTH] >= splitLimit)break; + } + if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if(lastLastIndex === string[LENGTH]){ + if(lastLength || !separatorCopy.test(''))output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if('0'[$SPLIT](undefined, 0)[LENGTH]){ + $split = function(separator, limit){ + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit){ + var O = defined(this) + , fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; + }); + +/***/ }, +/* 196 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var LIBRARY = __webpack_require__(26) + , global = __webpack_require__(2) + , ctx = __webpack_require__(18) + , classof = __webpack_require__(73) + , $export = __webpack_require__(6) + , isObject = __webpack_require__(11) + , aFunction = __webpack_require__(19) + , anInstance = __webpack_require__(197) + , forOf = __webpack_require__(198) + , speciesConstructor = __webpack_require__(199) + , task = __webpack_require__(200).set + , microtask = __webpack_require__(201)() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + + var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[__webpack_require__(23)('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } + }(); + + // helpers + var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; + }; + var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); + }; + var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); + }; + var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } + }; + var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); + }; + var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); + }; + var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; + }; + var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); + }; + var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); + }; + var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } + }; + + // constructor polyfill + if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(202)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); + __webpack_require__(22)($Promise, PROMISE); + __webpack_require__(186)(PROMISE); + Wrapper = __webpack_require__(7)[PROMISE]; + + // statics + $export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } + }); + $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(157)(function(iter){ + $Promise.all(iter)['catch'](empty); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } + }); + +/***/ }, +/* 197 */ +/***/ function(module, exports) { + + module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; + }; + +/***/ }, +/* 198 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(18) + , call = __webpack_require__(153) + , isArrayIter = __webpack_require__(154) + , anObject = __webpack_require__(10) + , toLength = __webpack_require__(35) + , getIterFn = __webpack_require__(156) + , BREAK = {} + , RETURN = {}; + var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } + }; + exports.BREAK = BREAK; + exports.RETURN = RETURN; + +/***/ }, +/* 199 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + var anObject = __webpack_require__(10) + , aFunction = __webpack_require__(19) + , SPECIES = __webpack_require__(23)('species'); + module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); + }; + +/***/ }, +/* 200 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(18) + , invoke = __webpack_require__(76) + , html = __webpack_require__(46) + , cel = __webpack_require__(13) + , global = __webpack_require__(2) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; + var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listener = function(event){ + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(__webpack_require__(32)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } + } + module.exports = { + set: setTask, + clear: clearTask + }; + +/***/ }, +/* 201 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , macrotask = __webpack_require__(200).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = __webpack_require__(32)(process) == 'process'; + + module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; + }; + +/***/ }, +/* 202 */ +/***/ function(module, exports, __webpack_require__) { + + var redefine = __webpack_require__(16); + module.exports = function(target, src, safe){ + for(var key in src)redefine(target, key, src[key], safe); + return target; + }; + +/***/ }, +/* 203 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(204); + + // 23.1 Map Objects + module.exports = __webpack_require__(205)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } + }, strong, true); + +/***/ }, +/* 204 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var dP = __webpack_require__(9).f + , create = __webpack_require__(44) + , redefineAll = __webpack_require__(202) + , ctx = __webpack_require__(18) + , anInstance = __webpack_require__(197) + , defined = __webpack_require__(33) + , forOf = __webpack_require__(198) + , $iterDefine = __webpack_require__(134) + , step = __webpack_require__(184) + , setSpecies = __webpack_require__(186) + , DESCRIPTORS = __webpack_require__(4) + , fastKey = __webpack_require__(20).fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + + var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } + }; + +/***/ }, +/* 205 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(16) + , redefineAll = __webpack_require__(202) + , meta = __webpack_require__(20) + , forOf = __webpack_require__(198) + , anInstance = __webpack_require__(197) + , isObject = __webpack_require__(11) + , fails = __webpack_require__(5) + , $iterDetect = __webpack_require__(157) + , setToStringTag = __webpack_require__(22) + , inheritIfRequired = __webpack_require__(80); + + module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO = !IS_WEAK && fails(function(){ + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C() + , index = 5; + while(index--)$instance[ADDER](index, index); + return !$instance.has(-0); + }); + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base, target, C); + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; + }; + +/***/ }, +/* 206 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(204); + + // 23.2 Set Objects + module.exports = __webpack_require__(205)('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } + }, strong); + +/***/ }, +/* 207 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var each = __webpack_require__(164)(0) + , redefine = __webpack_require__(16) + , meta = __webpack_require__(20) + , assign = __webpack_require__(67) + , weak = __webpack_require__(208) + , isObject = __webpack_require__(11) + , getWeak = meta.getWeak + , isExtensible = Object.isExtensible + , uncaughtFrozenStore = weak.ufstore + , tmp = {} + , InternalMap; + + var wrapper = function(get){ + return function WeakMap(){ + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; + }; + + var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key){ + if(isObject(key)){ + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value){ + return weak.def(this, key, value); + } + }; + + // 23.3 WeakMap Objects + var $WeakMap = module.exports = __webpack_require__(205)('WeakMap', wrapper, methods, weak, true, true); + + // IE11 WeakMap frozen keys fix + if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ + InternalMap = weak.getConstructor(wrapper); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function(key){ + var proto = $WeakMap.prototype + , method = proto[key]; + redefine(proto, key, function(a, b){ + // store frozen objects on internal weakmap shim + if(isObject(a) && !isExtensible(a)){ + if(!this._f)this._f = new InternalMap; + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); + } + +/***/ }, +/* 208 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var redefineAll = __webpack_require__(202) + , getWeak = __webpack_require__(20).getWeak + , anObject = __webpack_require__(10) + , isObject = __webpack_require__(11) + , anInstance = __webpack_require__(197) + , forOf = __webpack_require__(198) + , createArrayMethod = __webpack_require__(164) + , $has = __webpack_require__(3) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function(that){ + return that._l || (that._l = new UncaughtFrozenStore); + }; + var UncaughtFrozenStore = function(){ + this.a = []; + }; + var findUncaughtFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function(key){ + var entry = findUncaughtFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findUncaughtFrozen(this, key); + }, + set: function(key, value){ + var entry = findUncaughtFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this)['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function(that, key, value){ + var data = getWeak(anObject(key), true); + if(data === true)uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore + }; + +/***/ }, +/* 209 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var weak = __webpack_require__(208); + + // 23.4 WeakSet Objects + __webpack_require__(205)('WeakSet', function(get){ + return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value){ + return weak.def(this, value, true); + } + }, weak, false, true); + +/***/ }, +/* 210 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) + var $export = __webpack_require__(6) + , aFunction = __webpack_require__(19) + , anObject = __webpack_require__(10) + , rApply = (__webpack_require__(2).Reflect || {}).apply + , fApply = Function.apply; + // MS Edge argumentsList argument is optional + $export($export.S + $export.F * !__webpack_require__(5)(function(){ + rApply(function(){}); + }), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList){ + var T = aFunction(target) + , L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } + }); + +/***/ }, +/* 211 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) + var $export = __webpack_require__(6) + , create = __webpack_require__(44) + , aFunction = __webpack_require__(19) + , anObject = __webpack_require__(10) + , isObject = __webpack_require__(11) + , fails = __webpack_require__(5) + , bind = __webpack_require__(75) + , rConstruct = (__webpack_require__(2).Reflect || {}).construct; + + // MS Edge supports only 2 arguments and argumentsList argument is optional + // FF Nightly sets third argument as `new.target`, but does not create `this` from it + var NEW_TARGET_BUG = fails(function(){ + function F(){} + return !(rConstruct(function(){}, [], F) instanceof F); + }); + var ARGS_BUG = !fails(function(){ + rConstruct(function(){}); + }); + + $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /*, newTarget*/){ + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget); + if(Target == newTarget){ + // w/o altered newTarget, optimization for 0-4 arguments + switch(args.length){ + case 0: return new Target; + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype + , instance = create(isObject(proto) ? proto : Object.prototype) + , result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } + }); + +/***/ }, +/* 212 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) + var dP = __webpack_require__(9) + , $export = __webpack_require__(6) + , anObject = __webpack_require__(10) + , toPrimitive = __webpack_require__(14); + + // MS Edge has broken Reflect.defineProperty - throwing instead of returning false + $export($export.S + $export.F * __webpack_require__(5)(function(){ + Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2}); + }), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes){ + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 213 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.4 Reflect.deleteProperty(target, propertyKey) + var $export = __webpack_require__(6) + , gOPD = __webpack_require__(49).f + , anObject = __webpack_require__(10); + + $export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey){ + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } + }); + +/***/ }, +/* 214 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 26.1.5 Reflect.enumerate(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(10); + var Enumerate = function(iterated){ + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = [] // keys + , key; + for(key in iterated)keys.push(key); + }; + __webpack_require__(136)(Enumerate, 'Object', function(){ + var that = this + , keys = that._k + , key; + do { + if(that._i >= keys.length)return {value: undefined, done: true}; + } while(!((key = keys[that._i++]) in that._t)); + return {value: key, done: false}; + }); + + $export($export.S, 'Reflect', { + enumerate: function enumerate(target){ + return new Enumerate(target); + } + }); + +/***/ }, +/* 215 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.6 Reflect.get(target, propertyKey [, receiver]) + var gOPD = __webpack_require__(49) + , getPrototypeOf = __webpack_require__(57) + , has = __webpack_require__(3) + , $export = __webpack_require__(6) + , isObject = __webpack_require__(11) + , anObject = __webpack_require__(10); + + function get(target, propertyKey/*, receiver*/){ + var receiver = arguments.length < 3 ? target : arguments[2] + , desc, proto; + if(anObject(target) === receiver)return target[propertyKey]; + if(desc = gOPD.f(target, propertyKey))return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver); + } + + $export($export.S, 'Reflect', {get: get}); + +/***/ }, +/* 216 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) + var gOPD = __webpack_require__(49) + , $export = __webpack_require__(6) + , anObject = __webpack_require__(10); + + $export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ + return gOPD.f(anObject(target), propertyKey); + } + }); + +/***/ }, +/* 217 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.8 Reflect.getPrototypeOf(target) + var $export = __webpack_require__(6) + , getProto = __webpack_require__(57) + , anObject = __webpack_require__(10); + + $export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target){ + return getProto(anObject(target)); + } + }); + +/***/ }, +/* 218 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.9 Reflect.has(target, propertyKey) + var $export = __webpack_require__(6); + + $export($export.S, 'Reflect', { + has: function has(target, propertyKey){ + return propertyKey in target; + } + }); + +/***/ }, +/* 219 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.10 Reflect.isExtensible(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(10) + , $isExtensible = Object.isExtensible; + + $export($export.S, 'Reflect', { + isExtensible: function isExtensible(target){ + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } + }); + +/***/ }, +/* 220 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.11 Reflect.ownKeys(target) + var $export = __webpack_require__(6); + + $export($export.S, 'Reflect', {ownKeys: __webpack_require__(221)}); + +/***/ }, +/* 221 */ +/***/ function(module, exports, __webpack_require__) { + + // all object keys, includes non-enumerable and symbols + var gOPN = __webpack_require__(48) + , gOPS = __webpack_require__(41) + , anObject = __webpack_require__(10) + , Reflect = __webpack_require__(2).Reflect; + module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = gOPN.f(anObject(it)) + , getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; + }; + +/***/ }, +/* 222 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.12 Reflect.preventExtensions(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(10) + , $preventExtensions = Object.preventExtensions; + + $export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target){ + anObject(target); + try { + if($preventExtensions)$preventExtensions(target); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 223 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) + var dP = __webpack_require__(9) + , gOPD = __webpack_require__(49) + , getPrototypeOf = __webpack_require__(57) + , has = __webpack_require__(3) + , $export = __webpack_require__(6) + , createDesc = __webpack_require__(15) + , anObject = __webpack_require__(10) + , isObject = __webpack_require__(11); + + function set(target, propertyKey, V/*, receiver*/){ + var receiver = arguments.length < 4 ? target : arguments[3] + , ownDesc = gOPD.f(anObject(target), propertyKey) + , existingDescriptor, proto; + if(!ownDesc){ + if(isObject(proto = getPrototypeOf(target))){ + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if(has(ownDesc, 'value')){ + if(ownDesc.writable === false || !isObject(receiver))return false; + existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); + } + + $export($export.S, 'Reflect', {set: set}); + +/***/ }, +/* 224 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.14 Reflect.setPrototypeOf(target, proto) + var $export = __webpack_require__(6) + , setProto = __webpack_require__(71); + + if(setProto)$export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto){ + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 225 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.3.3.1 / 15.9.4.4 Date.now() + var $export = __webpack_require__(6); + + $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); + +/***/ }, +/* 226 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(14); + + $export($export.P + $export.F * __webpack_require__(5)(function(){ + return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1; + }), 'Date', { + toJSON: function toJSON(key){ + var O = toObject(this) + , pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } + }); + +/***/ }, +/* 227 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() + var $export = __webpack_require__(6) + , fails = __webpack_require__(5) + , getTime = Date.prototype.getTime; + + var lz = function(num){ + return num > 9 ? num : '0' + num; + }; + + // PhantomJS / old WebKit has a broken implementations + $export($export.P + $export.F * (fails(function(){ + return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z'; + }) || !fails(function(){ + new Date(NaN).toISOString(); + })), 'Date', { + toISOString: function toISOString(){ + if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value'); + var d = this + , y = d.getUTCFullYear() + , m = d.getUTCMilliseconds() + , s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; + } + }); + +/***/ }, +/* 228 */ +/***/ function(module, exports, __webpack_require__) { + + var DateProto = Date.prototype + , INVALID_DATE = 'Invalid Date' + , TO_STRING = 'toString' + , $toString = DateProto[TO_STRING] + , getTime = DateProto.getTime; + if(new Date(NaN) + '' != INVALID_DATE){ + __webpack_require__(16)(DateProto, TO_STRING, function toString(){ + var value = getTime.call(this); + return value === value ? $toString.call(this) : INVALID_DATE; + }); + } + +/***/ }, +/* 229 */ +/***/ function(module, exports, __webpack_require__) { + + var TO_PRIMITIVE = __webpack_require__(23)('toPrimitive') + , proto = Date.prototype; + + if(!(TO_PRIMITIVE in proto))__webpack_require__(8)(proto, TO_PRIMITIVE, __webpack_require__(230)); + +/***/ }, +/* 230 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var anObject = __webpack_require__(10) + , toPrimitive = __webpack_require__(14) + , NUMBER = 'number'; + + module.exports = function(hint){ + if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); + }; + +/***/ }, +/* 231 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $typed = __webpack_require__(232) + , buffer = __webpack_require__(233) + , anObject = __webpack_require__(10) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35) + , isObject = __webpack_require__(11) + , ArrayBuffer = __webpack_require__(2).ArrayBuffer + , speciesConstructor = __webpack_require__(199) + , $ArrayBuffer = buffer.ArrayBuffer + , $DataView = buffer.DataView + , $isView = $typed.ABV && ArrayBuffer.isView + , $slice = $ArrayBuffer.prototype.slice + , VIEW = $typed.VIEW + , ARRAY_BUFFER = 'ArrayBuffer'; + + $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer}); + + $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it){ + return $isView && $isView(it) || isObject(it) && VIEW in it; + } + }); + + $export($export.P + $export.U + $export.F * __webpack_require__(5)(function(){ + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; + }), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end){ + if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength + , first = toIndex(start, len) + , final = toIndex(end === undefined ? len : end, len) + , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first)) + , viewS = new $DataView(this) + , viewT = new $DataView(result) + , index = 0; + while(first < final){ + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } + }); + + __webpack_require__(186)(ARRAY_BUFFER); + +/***/ }, +/* 232 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , hide = __webpack_require__(8) + , uid = __webpack_require__(17) + , TYPED = uid('typed_array') + , VIEW = uid('view') + , ABV = !!(global.ArrayBuffer && global.DataView) + , CONSTR = ABV + , i = 0, l = 9, Typed; + + var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' + ).split(','); + + while(i < l){ + if(Typed = global[TypedArrayConstructors[i++]]){ + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; + } + + module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW + }; + +/***/ }, +/* 233 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , DESCRIPTORS = __webpack_require__(4) + , LIBRARY = __webpack_require__(26) + , $typed = __webpack_require__(232) + , hide = __webpack_require__(8) + , redefineAll = __webpack_require__(202) + , fails = __webpack_require__(5) + , anInstance = __webpack_require__(197) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , gOPN = __webpack_require__(48).f + , dP = __webpack_require__(9).f + , arrayFill = __webpack_require__(180) + , setToStringTag = __webpack_require__(22) + , ARRAY_BUFFER = 'ArrayBuffer' + , DATA_VIEW = 'DataView' + , PROTOTYPE = 'prototype' + , WRONG_LENGTH = 'Wrong length!' + , WRONG_INDEX = 'Wrong index!' + , $ArrayBuffer = global[ARRAY_BUFFER] + , $DataView = global[DATA_VIEW] + , Math = global.Math + , RangeError = global.RangeError + , Infinity = global.Infinity + , BaseBuffer = $ArrayBuffer + , abs = Math.abs + , pow = Math.pow + , floor = Math.floor + , log = Math.log + , LN2 = Math.LN2 + , BUFFER = 'buffer' + , BYTE_LENGTH = 'byteLength' + , BYTE_OFFSET = 'byteOffset' + , $BUFFER = DESCRIPTORS ? '_b' : BUFFER + , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH + , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + + // IEEE754 conversions based on https://github.com/feross/ieee754 + var packIEEE754 = function(value, mLen, nBytes){ + var buffer = Array(nBytes) + , eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0 + , i = 0 + , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0 + , e, m, c; + value = abs(value) + if(value != value || value === Infinity){ + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if(value * (c = pow(2, -e)) < 1){ + e--; + c *= 2; + } + if(e + eBias >= 1){ + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if(value * c >= 2){ + e++; + c /= 2; + } + if(e + eBias >= eMax){ + m = 0; + e = eMax; + } else if(e + eBias >= 1){ + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; + }; + var unpackIEEE754 = function(buffer, mLen, nBytes){ + var eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , nBits = eLen - 7 + , i = nBytes - 1 + , s = buffer[i--] + , e = s & 127 + , m; + s >>= 7; + for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if(e === 0){ + e = 1 - eBias; + } else if(e === eMax){ + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); + }; + + var unpackI32 = function(bytes){ + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; + }; + var packI8 = function(it){ + return [it & 0xff]; + }; + var packI16 = function(it){ + return [it & 0xff, it >> 8 & 0xff]; + }; + var packI32 = function(it){ + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; + }; + var packF64 = function(it){ + return packIEEE754(it, 52, 8); + }; + var packF32 = function(it){ + return packIEEE754(it, 23, 4); + }; + + var addGetter = function(C, key, internal){ + dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }}); + }; + + var get = function(view, bytes, index, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); + }; + var set = function(view, bytes, index, conversion, value, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = conversion(+value); + for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; + }; + + var validateArrayBufferArguments = function(that, length){ + anInstance(that, $ArrayBuffer, ARRAY_BUFFER); + var numberLength = +length + , byteLength = toLength(numberLength); + if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); + return byteLength; + }; + + if(!$typed.ABV){ + $ArrayBuffer = function ArrayBuffer(length){ + var byteLength = validateArrayBufferArguments(this, length); + this._b = arrayFill.call(Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength){ + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH] + , offset = toInteger(byteOffset); + if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if(DESCRIPTORS){ + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset){ + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset){ + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){ + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); + } else { + if(!fails(function(){ + new $ArrayBuffer; // eslint-disable-line no-new + }) || !fails(function(){ + new $ArrayBuffer(.5); // eslint-disable-line no-new + })){ + $ArrayBuffer = function ArrayBuffer(length){ + return new BaseBuffer(validateArrayBufferArguments(this, length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){ + if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]); + }; + if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)) + , $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); + } + setToStringTag($ArrayBuffer, ARRAY_BUFFER); + setToStringTag($DataView, DATA_VIEW); + hide($DataView[PROTOTYPE], $typed.VIEW, true); + exports[ARRAY_BUFFER] = $ArrayBuffer; + exports[DATA_VIEW] = $DataView; + +/***/ }, +/* 234 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + $export($export.G + $export.W + $export.F * !__webpack_require__(232).ABV, { + DataView: __webpack_require__(233).DataView + }); + +/***/ }, +/* 235 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Int8', 1, function(init){ + return function Int8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 236 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + if(__webpack_require__(4)){ + var LIBRARY = __webpack_require__(26) + , global = __webpack_require__(2) + , fails = __webpack_require__(5) + , $export = __webpack_require__(6) + , $typed = __webpack_require__(232) + , $buffer = __webpack_require__(233) + , ctx = __webpack_require__(18) + , anInstance = __webpack_require__(197) + , propertyDesc = __webpack_require__(15) + , hide = __webpack_require__(8) + , redefineAll = __webpack_require__(202) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , toIndex = __webpack_require__(37) + , toPrimitive = __webpack_require__(14) + , has = __webpack_require__(3) + , same = __webpack_require__(69) + , classof = __webpack_require__(73) + , isObject = __webpack_require__(11) + , toObject = __webpack_require__(56) + , isArrayIter = __webpack_require__(154) + , create = __webpack_require__(44) + , getPrototypeOf = __webpack_require__(57) + , gOPN = __webpack_require__(48).f + , getIterFn = __webpack_require__(156) + , uid = __webpack_require__(17) + , wks = __webpack_require__(23) + , createArrayMethod = __webpack_require__(164) + , createArrayIncludes = __webpack_require__(34) + , speciesConstructor = __webpack_require__(199) + , ArrayIterators = __webpack_require__(183) + , Iterators = __webpack_require__(135) + , $iterDetect = __webpack_require__(157) + , setSpecies = __webpack_require__(186) + , arrayFill = __webpack_require__(180) + , arrayCopyWithin = __webpack_require__(177) + , $DP = __webpack_require__(9) + , $GOPD = __webpack_require__(49) + , dP = $DP.f + , gOPD = $GOPD.f + , RangeError = global.RangeError + , TypeError = global.TypeError + , Uint8Array = global.Uint8Array + , ARRAY_BUFFER = 'ArrayBuffer' + , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER + , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' + , PROTOTYPE = 'prototype' + , ArrayProto = Array[PROTOTYPE] + , $ArrayBuffer = $buffer.ArrayBuffer + , $DataView = $buffer.DataView + , arrayForEach = createArrayMethod(0) + , arrayFilter = createArrayMethod(2) + , arraySome = createArrayMethod(3) + , arrayEvery = createArrayMethod(4) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , arrayIncludes = createArrayIncludes(true) + , arrayIndexOf = createArrayIncludes(false) + , arrayValues = ArrayIterators.values + , arrayKeys = ArrayIterators.keys + , arrayEntries = ArrayIterators.entries + , arrayLastIndexOf = ArrayProto.lastIndexOf + , arrayReduce = ArrayProto.reduce + , arrayReduceRight = ArrayProto.reduceRight + , arrayJoin = ArrayProto.join + , arraySort = ArrayProto.sort + , arraySlice = ArrayProto.slice + , arrayToString = ArrayProto.toString + , arrayToLocaleString = ArrayProto.toLocaleString + , ITERATOR = wks('iterator') + , TAG = wks('toStringTag') + , TYPED_CONSTRUCTOR = uid('typed_constructor') + , DEF_CONSTRUCTOR = uid('def_constructor') + , ALL_CONSTRUCTORS = $typed.CONSTR + , TYPED_ARRAY = $typed.TYPED + , VIEW = $typed.VIEW + , WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function(O, length){ + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function(){ + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){ + new Uint8Array(1).set({}); + }); + + var strictToLength = function(it, SAME){ + if(it === undefined)throw TypeError(WRONG_LENGTH); + var number = +it + , length = toLength(it); + if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH); + return length; + }; + + var toOffset = function(it, BYTES){ + var offset = toInteger(it); + if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function(it){ + if(isObject(it) && TYPED_ARRAY in it)return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function(C, length){ + if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){ + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function(O, list){ + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function(C, list){ + var index = 0 + , length = list.length + , result = allocate(C, length); + while(length > index)result[index] = list[index++]; + return result; + }; + + var addGetter = function(it, key, internal){ + dP(it, key, {get: function(){ return this._d[internal]; }}); + }; + + var $from = function from(source /*, mapfn, thisArg */){ + var O = toObject(source) + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , iterFn = getIterFn(O) + , i, length, values, result, step, iterator; + if(iterFn != undefined && !isArrayIter(iterFn)){ + for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){ + values.push(step.value); + } O = values; + } + if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2); + for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){ + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/*...items*/){ + var index = 0 + , length = arguments.length + , result = allocate(this, length); + while(length > index)result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString(){ + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /*, end */){ + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /*, thisArg */){ + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /*, thisArg */){ + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /*, thisArg */){ + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /*, thisArg */){ + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /*, thisArg */){ + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /*, fromIndex */){ + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /*, fromIndex */){ + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator){ // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /*, thisArg */){ + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse(){ + var that = this + , length = validate(that).length + , middle = Math.floor(length / 2) + , index = 0 + , value; + while(index < middle){ + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /*, thisArg */){ + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn){ + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end){ + var O = validate(this) + , length = O.length + , $begin = toIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end){ + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /*, offset */){ + validate(this); + var offset = toOffset(arguments[1], 1) + , length = this.length + , src = toObject(arrayLike) + , len = toLength(src.length) + , index = 0; + if(len + offset > length)throw RangeError(WRONG_LENGTH); + while(index < len)this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries(){ + return arrayEntries.call(validate(this)); + }, + keys: function keys(){ + return arrayKeys.call(validate(this)); + }, + values: function values(){ + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function(target, key){ + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key){ + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc){ + if(isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ){ + target[key] = desc.value; + return target; + } else return dP(target, key, desc); + }; + + if(!ALL_CONSTRUCTORS){ + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if(fails(function(){ arrayToString.call({}); })){ + arrayToString = arrayToLocaleString = function toString(){ + return arrayJoin.call(this); + } + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function(){ /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function(){ return this[TYPED_ARRAY]; } + }); + + module.exports = function(KEY, BYTES, wrapper, CLAMPED){ + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array' + , ISNT_UINT8 = NAME != 'Uint8Array' + , GETTER = 'get' + KEY + , SETTER = 'set' + KEY + , TypedArray = global[NAME] + , Base = TypedArray || {} + , TAC = TypedArray && getPrototypeOf(TypedArray) + , FORCED = !TypedArray || !$typed.ABV + , O = {} + , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function(that, index){ + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function(that, index, value){ + var data = that._d; + if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function(that, index){ + dP(that, index, { + get: function(){ + return getter(this, index); + }, + set: function(value){ + return setter(this, index, value); + }, + enumerable: true + }); + }; + if(FORCED){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME, '_d'); + var index = 0 + , offset = 0 + , buffer, byteLength, length, klass; + if(!isObject(data)){ + length = strictToLength(data, true) + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if($length === undefined){ + if($len % BYTES)throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if(byteLength < 0)throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if(TYPED_ARRAY in data){ + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while(index < length)addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if(!$iterDetect(function(iter){ + // V8 works with iterators, but fails in many other cases + // https://code.google.com/p/v8/issues/detail?id=4552 + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8)); + if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if(TYPED_ARRAY in data)return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){ + if(!(key in TypedArray))hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR] + , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined) + , $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){ + dP(TypedArrayPrototype, TAG, { + get: function(){ return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES, + from: $from, + of: $of + }); + + if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, {set: $set}); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString}); + + $export($export.P + $export.F * fails(function(){ + new TypedArray(1).slice(); + }), NAME, {slice: $slice}); + + $export($export.P + $export.F * (fails(function(){ + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString() + }) || !fails(function(){ + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, {toLocaleString: $toLocaleString}); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); + }; + } else module.exports = function(){ /* empty */ }; + +/***/ }, +/* 237 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint8', 1, function(init){ + return function Uint8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 238 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint8', 1, function(init){ + return function Uint8ClampedArray(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }, true); + +/***/ }, +/* 239 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Int16', 2, function(init){ + return function Int16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 240 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint16', 2, function(init){ + return function Uint16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 241 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Int32', 4, function(init){ + return function Int32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 242 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint32', 4, function(init){ + return function Uint32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 243 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Float32', 4, function(init){ + return function Float32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 244 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Float64', 8, function(init){ + return function Float64Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 245 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/Array.prototype.includes + var $export = __webpack_require__(6) + , $includes = __webpack_require__(34)(true); + + $export($export.P, 'Array', { + includes: function includes(el /*, fromIndex = 0 */){ + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + __webpack_require__(178)('includes'); + +/***/ }, +/* 246 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/mathiasbynens/String.prototype.at + var $export = __webpack_require__(6) + , $at = __webpack_require__(125)(true); + + $export($export.P, 'String', { + at: function at(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 247 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/proposal-string-pad-start-end + var $export = __webpack_require__(6) + , $pad = __webpack_require__(248); + + $export($export.P, 'String', { + padStart: function padStart(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } + }); + +/***/ }, +/* 248 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-string-pad-start-end + var toLength = __webpack_require__(35) + , repeat = __webpack_require__(85) + , defined = __webpack_require__(33); + + module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength || fillStr == '')return S; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; + }; + + +/***/ }, +/* 249 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/proposal-string-pad-start-end + var $export = __webpack_require__(6) + , $pad = __webpack_require__(248); + + $export($export.P, 'String', { + padEnd: function padEnd(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } + }); + +/***/ }, +/* 250 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(81)('trimLeft', function($trim){ + return function trimLeft(){ + return $trim(this, 1); + }; + }, 'trimStart'); + +/***/ }, +/* 251 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(81)('trimRight', function($trim){ + return function trimRight(){ + return $trim(this, 2); + }; + }, 'trimEnd'); + +/***/ }, +/* 252 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://tc39.github.io/String.prototype.matchAll/ + var $export = __webpack_require__(6) + , defined = __webpack_require__(33) + , toLength = __webpack_require__(35) + , isRegExp = __webpack_require__(128) + , getFlags = __webpack_require__(188) + , RegExpProto = RegExp.prototype; + + var $RegExpStringIterator = function(regexp, string){ + this._r = regexp; + this._s = string; + }; + + __webpack_require__(136)($RegExpStringIterator, 'RegExp String', function next(){ + var match = this._r.exec(this._s); + return {value: match, done: match === null}; + }); + + $export($export.P, 'String', { + matchAll: function matchAll(regexp){ + defined(this); + if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!'); + var S = String(this) + , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp) + , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } + }); + +/***/ }, +/* 253 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(25)('asyncIterator'); + +/***/ }, +/* 254 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(25)('observable'); + +/***/ }, +/* 255 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-getownpropertydescriptors + var $export = __webpack_require__(6) + , ownKeys = __webpack_require__(221) + , toIObject = __webpack_require__(30) + , gOPD = __webpack_require__(49) + , createProperty = __webpack_require__(155); + + $export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ + var O = toIObject(object) + , getDesc = gOPD.f + , keys = ownKeys(O) + , result = {} + , i = 0 + , key; + while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key)); + return result; + } + }); + +/***/ }, +/* 256 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-values-entries + var $export = __webpack_require__(6) + , $values = __webpack_require__(257)(false); + + $export($export.S, 'Object', { + values: function values(it){ + return $values(it); + } + }); + +/***/ }, +/* 257 */ +/***/ function(module, exports, __webpack_require__) { + + var getKeys = __webpack_require__(28) + , toIObject = __webpack_require__(30) + , isEnum = __webpack_require__(42).f; + module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; + }; + +/***/ }, +/* 258 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-values-entries + var $export = __webpack_require__(6) + , $entries = __webpack_require__(257)(true); + + $export($export.S, 'Object', { + entries: function entries(it){ + return $entries(it); + } + }); + +/***/ }, +/* 259 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , aFunction = __webpack_require__(19) + , $defineProperty = __webpack_require__(9); + + // B.2.2.2 Object.prototype.__defineGetter__(P, getter) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __defineGetter__: function __defineGetter__(P, getter){ + $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); + } + }); + +/***/ }, +/* 260 */ +/***/ function(module, exports, __webpack_require__) { + + // Forced replacement prototype accessors methods + module.exports = __webpack_require__(26)|| !__webpack_require__(5)(function(){ + var K = Math.random(); + // In FF throws only define methods + __defineSetter__.call(null, K, function(){ /* empty */}); + delete __webpack_require__(2)[K]; + }); + +/***/ }, +/* 261 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , aFunction = __webpack_require__(19) + , $defineProperty = __webpack_require__(9); + + // B.2.2.3 Object.prototype.__defineSetter__(P, setter) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __defineSetter__: function __defineSetter__(P, setter){ + $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); + } + }); + +/***/ }, +/* 262 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(14) + , getPrototypeOf = __webpack_require__(57) + , getOwnPropertyDescriptor = __webpack_require__(49).f; + + // B.2.2.4 Object.prototype.__lookupGetter__(P) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __lookupGetter__: function __lookupGetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.get; + } while(O = getPrototypeOf(O)); + } + }); + +/***/ }, +/* 263 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(14) + , getPrototypeOf = __webpack_require__(57) + , getOwnPropertyDescriptor = __webpack_require__(49).f; + + // B.2.2.5 Object.prototype.__lookupSetter__(P) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __lookupSetter__: function __lookupSetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.set; + } while(O = getPrototypeOf(O)); + } + }); + +/***/ }, +/* 264 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(6); + + $export($export.P + $export.R, 'Map', {toJSON: __webpack_require__(265)('Map')}); + +/***/ }, +/* 265 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var classof = __webpack_require__(73) + , from = __webpack_require__(266); + module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; + }; + +/***/ }, +/* 266 */ +/***/ function(module, exports, __webpack_require__) { + + var forOf = __webpack_require__(198); + + module.exports = function(iter, ITERATOR){ + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; + }; + + +/***/ }, +/* 267 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(6); + + $export($export.P + $export.R, 'Set', {toJSON: __webpack_require__(265)('Set')}); + +/***/ }, +/* 268 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/ljharb/proposal-global + var $export = __webpack_require__(6); + + $export($export.S, 'System', {global: __webpack_require__(2)}); + +/***/ }, +/* 269 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/ljharb/proposal-is-error + var $export = __webpack_require__(6) + , cof = __webpack_require__(32); + + $export($export.S, 'Error', { + isError: function isError(it){ + return cof(it) === 'Error'; + } + }); + +/***/ }, +/* 270 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } + }); + +/***/ }, +/* 271 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } + }); + +/***/ }, +/* 272 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + imulh: function imulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >> 16 + , v1 = $v >> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } + }); + +/***/ }, +/* 273 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + umulh: function umulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >>> 16 + , v1 = $v >>> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } + }); + +/***/ }, +/* 274 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + + metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); + }}); + +/***/ }, +/* 275 */ +/***/ function(module, exports, __webpack_require__) { + + var Map = __webpack_require__(203) + , $export = __webpack_require__(6) + , shared = __webpack_require__(21)('metadata') + , store = shared.store || (shared.store = new (__webpack_require__(207))); + + var getOrCreateMetadataMap = function(target, targetKey, create){ + var targetMetadata = store.get(target); + if(!targetMetadata){ + if(!create)return undefined; + store.set(target, targetMetadata = new Map); + } + var keyMetadata = targetMetadata.get(targetKey); + if(!keyMetadata){ + if(!create)return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map); + } return keyMetadata; + }; + var ordinaryHasOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); + }; + var ordinaryGetOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); + }; + var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){ + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); + }; + var ordinaryOwnMetadataKeys = function(target, targetKey){ + var metadataMap = getOrCreateMetadataMap(target, targetKey, false) + , keys = []; + if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); }); + return keys; + }; + var toMetaKey = function(it){ + return it === undefined || typeof it == 'symbol' ? it : String(it); + }; + var exp = function(O){ + $export($export.S, 'Reflect', O); + }; + + module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp + }; + +/***/ }, +/* 276 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , toMetaKey = metadata.key + , getOrCreateMetadataMap = metadata.map + , store = metadata.store; + + metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){ + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]) + , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false; + if(metadataMap.size)return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); + }}); + +/***/ }, +/* 277 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , getPrototypeOf = __webpack_require__(57) + , ordinaryHasOwnMetadata = metadata.has + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + + var ordinaryGetMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; + }; + + metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 278 */ +/***/ function(module, exports, __webpack_require__) { + + var Set = __webpack_require__(206) + , from = __webpack_require__(266) + , metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , getPrototypeOf = __webpack_require__(57) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + + var ordinaryMetadataKeys = function(O, P){ + var oKeys = ordinaryOwnMetadataKeys(O, P) + , parent = getPrototypeOf(O); + if(parent === null)return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; + }; + + metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); + }}); + +/***/ }, +/* 279 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + + metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 280 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + + metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); + }}); + +/***/ }, +/* 281 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , getPrototypeOf = __webpack_require__(57) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + + var ordinaryHasMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; + }; + + metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 282 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + + metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 283 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , aFunction = __webpack_require__(19) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + + metadata.exp({metadata: function metadata(metadataKey, metadataValue){ + return function decorator(target, targetKey){ + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; + }}); + +/***/ }, +/* 284 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask + var $export = __webpack_require__(6) + , microtask = __webpack_require__(201)() + , process = __webpack_require__(2).process + , isNode = __webpack_require__(32)(process) == 'process'; + + $export($export.G, { + asap: function asap(fn){ + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } + }); + +/***/ }, +/* 285 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/zenparsing/es-observable + var $export = __webpack_require__(6) + , global = __webpack_require__(2) + , core = __webpack_require__(7) + , microtask = __webpack_require__(201)() + , OBSERVABLE = __webpack_require__(23)('observable') + , aFunction = __webpack_require__(19) + , anObject = __webpack_require__(10) + , anInstance = __webpack_require__(197) + , redefineAll = __webpack_require__(202) + , hide = __webpack_require__(8) + , forOf = __webpack_require__(198) + , RETURN = forOf.RETURN; + + var getMethod = function(fn){ + return fn == null ? undefined : aFunction(fn); + }; + + var cleanupSubscription = function(subscription){ + var cleanup = subscription._c; + if(cleanup){ + subscription._c = undefined; + cleanup(); + } + }; + + var subscriptionClosed = function(subscription){ + return subscription._o === undefined; + }; + + var closeSubscription = function(subscription){ + if(!subscriptionClosed(subscription)){ + subscription._o = undefined; + cleanupSubscription(subscription); + } + }; + + var Subscription = function(observer, subscriber){ + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer) + , subscription = cleanup; + if(cleanup != null){ + if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch(e){ + observer.error(e); + return; + } if(subscriptionClosed(this))cleanupSubscription(this); + }; + + Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe(){ closeSubscription(this); } + }); + + var SubscriptionObserver = function(subscription){ + this._s = subscription; + }; + + SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if(m)return m.call(observer, value); + } catch(e){ + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value){ + var subscription = this._s; + if(subscriptionClosed(subscription))throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if(!m)throw value; + value = m.call(observer, value); + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } + }); + + var $Observable = function Observable(subscriber){ + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); + }; + + redefineAll($Observable.prototype, { + subscribe: function subscribe(observer){ + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn){ + var that = this; + return new (core.Promise || global.Promise)(function(resolve, reject){ + aFunction(fn); + var subscription = that.subscribe({ + next : function(value){ + try { + return fn(value); + } catch(e){ + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } + }); + + redefineAll($Observable, { + from: function from(x){ + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if(method){ + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function(observer){ + return observable.subscribe(observer); + }); + } + return new C(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + try { + if(forOf(x, false, function(it){ + observer.next(it); + if(done)return RETURN; + }) === RETURN)return; + } catch(e){ + if(done)throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + }, + of: function of(){ + for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + for(var i = 0; i < items.length; ++i){ + observer.next(items[i]); + if(done)return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + } + }); + + hide($Observable.prototype, OBSERVABLE, function(){ return this; }); + + $export($export.G, {Observable: $Observable}); + + __webpack_require__(186)('Observable'); + +/***/ }, +/* 286 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $task = __webpack_require__(200); + $export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear + }); + +/***/ }, +/* 287 */ +/***/ function(module, exports, __webpack_require__) { + + var $iterators = __webpack_require__(183) + , redefine = __webpack_require__(16) + , global = __webpack_require__(2) + , hide = __webpack_require__(8) + , Iterators = __webpack_require__(135) + , wks = __webpack_require__(23) + , ITERATOR = wks('iterator') + , TO_STRING_TAG = wks('toStringTag') + , ArrayValues = Iterators.Array; + + for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype + , key; + if(proto){ + if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues); + if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); + } + } + +/***/ }, +/* 288 */ +/***/ function(module, exports, __webpack_require__) { + + // ie9- setTimeout & setInterval additional parameters fix + var global = __webpack_require__(2) + , $export = __webpack_require__(6) + , invoke = __webpack_require__(76) + , partial = __webpack_require__(289) + , navigator = global.navigator + , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check + var wrap = function(set){ + return MSIE ? function(fn, time /*, ...args */){ + return set(invoke( + partial, + [].slice.call(arguments, 2), + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; + }; + $export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) + }); + +/***/ }, +/* 289 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var path = __webpack_require__(290) + , invoke = __webpack_require__(76) + , aFunction = __webpack_require__(19); + module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , aLen = arguments.length + , j = 0, k = 0, args; + if(!holder && !aLen)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; + while(aLen > k)args.push(arguments[k++]); + return invoke(fn, args, that); + }; + }; + +/***/ }, +/* 290 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(2); + +/***/ }, +/* 291 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var ctx = __webpack_require__(18) + , $export = __webpack_require__(6) + , createDesc = __webpack_require__(15) + , assign = __webpack_require__(67) + , create = __webpack_require__(44) + , getPrototypeOf = __webpack_require__(57) + , getKeys = __webpack_require__(28) + , dP = __webpack_require__(9) + , keyOf = __webpack_require__(27) + , aFunction = __webpack_require__(19) + , forOf = __webpack_require__(198) + , isIterable = __webpack_require__(292) + , $iterCreate = __webpack_require__(136) + , step = __webpack_require__(184) + , isObject = __webpack_require__(11) + , toIObject = __webpack_require__(30) + , DESCRIPTORS = __webpack_require__(4) + , has = __webpack_require__(3); + + // 0 -> Dict.forEach + // 1 -> Dict.map + // 2 -> Dict.filter + // 3 -> Dict.some + // 4 -> Dict.every + // 5 -> Dict.find + // 6 -> Dict.findKey + // 7 -> Dict.mapPairs + var createDictMethod = function(TYPE){ + var IS_MAP = TYPE == 1 + , IS_EVERY = TYPE == 4; + return function(object, callbackfn, that /* = undefined */){ + var f = ctx(callbackfn, that, 3) + , O = toIObject(object) + , result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict) : undefined + , key, val, res; + for(key in O)if(has(O, key)){ + val = O[key]; + res = f(val, key, object); + if(TYPE){ + if(IS_MAP)result[key] = res; // map + else if(res)switch(TYPE){ + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if(IS_EVERY)return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; + }; + var findKey = createDictMethod(6); + + var createDictIter = function(kind){ + return function(it){ + return new DictIterator(it, kind); + }; + }; + var DictIterator = function(iterated, kind){ + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind + }; + $iterCreate(DictIterator, 'Dict', function(){ + var that = this + , O = that._t + , keys = that._a + , kind = that._k + , key; + do { + if(that._i >= keys.length){ + that._t = undefined; + return step(1); + } + } while(!has(O, key = keys[that._i++])); + if(kind == 'keys' )return step(0, key); + if(kind == 'values')return step(0, O[key]); + return step(0, [key, O[key]]); + }); + + function Dict(iterable){ + var dict = create(null); + if(iterable != undefined){ + if(isIterable(iterable)){ + forOf(iterable, true, function(key, value){ + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; + } + Dict.prototype = null; + + function reduce(object, mapfn, init){ + aFunction(mapfn); + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , memo, key; + if(arguments.length < 3){ + if(!length)throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while(length > i)if(has(O, key = keys[i++])){ + memo = mapfn(memo, O[key], key, object); + } + return memo; + } + + function includes(object, el){ + return (el == el ? keyOf(object, el) : findKey(object, function(it){ + return it != it; + })) !== undefined; + } + + function get(object, key){ + if(has(object, key))return object[key]; + } + function set(object, key, value){ + if(DESCRIPTORS && key in Object)dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; + } + + function isDict(it){ + return isObject(it) && getPrototypeOf(it) === Dict.prototype; + } + + $export($export.G + $export.F, {Dict: Dict}); + + $export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict + }); + +/***/ }, +/* 292 */ +/***/ function(module, exports, __webpack_require__) { + + var classof = __webpack_require__(73) + , ITERATOR = __webpack_require__(23)('iterator') + , Iterators = __webpack_require__(135); + module.exports = __webpack_require__(7).isIterable = function(it){ + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + || Iterators.hasOwnProperty(classof(O)); + }; + +/***/ }, +/* 293 */ +/***/ function(module, exports, __webpack_require__) { + + var anObject = __webpack_require__(10) + , get = __webpack_require__(156); + module.exports = __webpack_require__(7).getIterator = function(it){ + var iterFn = get(it); + if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); + }; + +/***/ }, +/* 294 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , $export = __webpack_require__(6) + , partial = __webpack_require__(289); + // https://esdiscuss.org/topic/promise-returning-delay-function + $export($export.G + $export.F, { + delay: function delay(time){ + return new (core.Promise || global.Promise)(function(resolve){ + setTimeout(partial.call(resolve, true), time); + }); + } + }); + +/***/ }, +/* 295 */ +/***/ function(module, exports, __webpack_require__) { + + var path = __webpack_require__(290) + , $export = __webpack_require__(6); + + // Placeholder + __webpack_require__(7)._ = path._ = path._ || {}; + + $export($export.P + $export.F, 'Function', {part: __webpack_require__(289)}); + +/***/ }, +/* 296 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + + $export($export.S + $export.F, 'Object', {isObject: __webpack_require__(11)}); + +/***/ }, +/* 297 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + + $export($export.S + $export.F, 'Object', {classof: __webpack_require__(73)}); + +/***/ }, +/* 298 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , define = __webpack_require__(299); + + $export($export.S + $export.F, 'Object', {define: define}); + +/***/ }, +/* 299 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(9) + , gOPD = __webpack_require__(49) + , ownKeys = __webpack_require__(221) + , toIObject = __webpack_require__(30); + + module.exports = function define(target, mixin){ + var keys = ownKeys(toIObject(mixin)) + , length = keys.length + , i = 0, key; + while(length > i)dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; + }; + +/***/ }, +/* 300 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , define = __webpack_require__(299) + , create = __webpack_require__(44); + + $export($export.S + $export.F, 'Object', { + make: function(proto, mixin){ + return define(create(proto), mixin); + } + }); + +/***/ }, +/* 301 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + __webpack_require__(134)(Number, 'Number', function(iterated){ + this._l = +iterated; + this._i = 0; + }, function(){ + var i = this._i++ + , done = !(i < this._l); + return {done: done, value: done ? undefined : i}; + }); + +/***/ }, +/* 302 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/benjamingr/RexExp.escape + var $export = __webpack_require__(6) + , $re = __webpack_require__(303)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + + $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); + + +/***/ }, +/* 303 */ +/***/ function(module, exports) { + + module.exports = function(regExp, replace){ + var replacer = replace === Object(replace) ? function(part){ + return replace[part]; + } : replace; + return function(it){ + return String(it).replace(regExp, replacer); + }; + }; + +/***/ }, +/* 304 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6); + var $re = __webpack_require__(303)(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }); + + $export($export.P + $export.F, 'String', {escapeHTML: function escapeHTML(){ return $re(this); }}); + +/***/ }, +/* 305 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6); + var $re = __webpack_require__(303)(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }); + + $export($export.P + $export.F, 'String', {unescapeHTML: function unescapeHTML(){ return $re(this); }}); + +/***/ } +/******/ ]); +// CommonJS export +if(typeof module != 'undefined' && module.exports)module.exports = __e; +// RequireJS export +else if(typeof define == 'function' && define.amd)define(function(){return __e}); +// Export to global object +else __g.core = __e; +}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/core.min.js b/node_modules/core-js/client/core.min.js new file mode 100755 index 00000000..4c43b467 --- /dev/null +++ b/node_modules/core-js/client/core.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.4.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(a,b,c){"use strict";!function(a){function __webpack_require__(c){if(b[c])return b[c].exports;var d=b[c]={exports:{},id:c,loaded:!1};return a[c].call(d.exports,d,d.exports,__webpack_require__),d.loaded=!0,d.exports}var b={};return __webpack_require__.m=a,__webpack_require__.c=b,__webpack_require__.p="",__webpack_require__(0)}([function(a,b,c){c(1),c(50),c(51),c(52),c(54),c(55),c(58),c(59),c(60),c(61),c(62),c(63),c(64),c(65),c(66),c(68),c(70),c(72),c(74),c(77),c(78),c(79),c(83),c(86),c(87),c(88),c(89),c(91),c(92),c(93),c(94),c(95),c(97),c(99),c(100),c(101),c(103),c(104),c(105),c(107),c(108),c(109),c(111),c(112),c(113),c(114),c(115),c(116),c(117),c(118),c(119),c(120),c(121),c(122),c(123),c(124),c(126),c(130),c(131),c(132),c(133),c(137),c(139),c(140),c(141),c(142),c(143),c(144),c(145),c(146),c(147),c(148),c(149),c(150),c(151),c(152),c(158),c(159),c(161),c(162),c(163),c(167),c(168),c(169),c(170),c(171),c(173),c(174),c(175),c(176),c(179),c(181),c(182),c(183),c(185),c(187),c(189),c(190),c(191),c(193),c(194),c(195),c(196),c(203),c(206),c(207),c(209),c(210),c(211),c(212),c(213),c(214),c(215),c(216),c(217),c(218),c(219),c(220),c(222),c(223),c(224),c(225),c(226),c(227),c(228),c(229),c(231),c(234),c(235),c(237),c(238),c(239),c(240),c(241),c(242),c(243),c(244),c(245),c(246),c(247),c(249),c(250),c(251),c(252),c(253),c(254),c(255),c(256),c(258),c(259),c(261),c(262),c(263),c(264),c(267),c(268),c(269),c(270),c(271),c(272),c(273),c(274),c(276),c(277),c(278),c(279),c(280),c(281),c(282),c(283),c(284),c(285),c(286),c(287),c(288),c(291),c(156),c(293),c(292),c(294),c(295),c(296),c(297),c(298),c(300),c(301),c(302),c(304),a.exports=c(305)},function(a,b,d){var e=d(2),f=d(3),g=d(4),h=d(6),i=d(16),j=d(20).KEY,k=d(5),l=d(21),m=d(22),n=d(17),o=d(23),p=d(24),q=d(25),r=d(27),s=d(40),t=d(43),u=d(10),v=d(30),w=d(14),x=d(15),y=d(44),z=d(47),A=d(49),B=d(9),C=d(28),D=A.f,E=B.f,F=z.f,G=e.Symbol,H=e.JSON,I=H&&H.stringify,J="prototype",K=o("_hidden"),L=o("toPrimitive"),M={}.propertyIsEnumerable,N=l("symbol-registry"),O=l("symbols"),P=l("op-symbols"),Q=Object[J],R="function"==typeof G,S=e.QObject,T=!S||!S[J]||!S[J].findChild,U=g&&k(function(){return 7!=y(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=D(Q,b);d&&delete Q[b],E(a,b,c),d&&a!==Q&&E(Q,b,d)}:E,V=function(a){var b=O[a]=y(G[J]);return b._k=a,b},W=R&&"symbol"==typeof G.iterator?function(a){return"symbol"==typeof a}:function(a){return a instanceof G},X=function defineProperty(a,b,c){return a===Q&&X(P,b,c),u(a),b=w(b,!0),u(c),f(O,b)?(c.enumerable?(f(a,K)&&a[K][b]&&(a[K][b]=!1),c=y(c,{enumerable:x(0,!1)})):(f(a,K)||E(a,K,x(1,{})),a[K][b]=!0),U(a,b,c)):E(a,b,c)},Y=function defineProperties(a,b){u(a);for(var c,d=s(b=v(b)),e=0,f=d.length;f>e;)X(a,c=d[e++],b[c]);return a},Z=function create(a,b){return b===c?y(a):Y(y(a),b)},$=function propertyIsEnumerable(a){var b=M.call(this,a=w(a,!0));return!(this===Q&&f(O,a)&&!f(P,a))&&(!(b||!f(this,a)||!f(O,a)||f(this,K)&&this[K][a])||b)},_=function getOwnPropertyDescriptor(a,b){if(a=v(a),b=w(b,!0),a!==Q||!f(O,b)||f(P,b)){var c=D(a,b);return!c||!f(O,b)||f(a,K)&&a[K][b]||(c.enumerable=!0),c}},aa=function getOwnPropertyNames(a){for(var b,c=F(v(a)),d=[],e=0;c.length>e;)f(O,b=c[e++])||b==K||b==j||d.push(b);return d},ba=function getOwnPropertySymbols(a){for(var b,c=a===Q,d=F(c?P:v(a)),e=[],g=0;d.length>g;)!f(O,b=d[g++])||c&&!f(Q,b)||e.push(O[b]);return e};R||(G=function Symbol(){if(this instanceof G)throw TypeError("Symbol is not a constructor!");var a=n(arguments.length>0?arguments[0]:c),b=function(c){this===Q&&b.call(P,c),f(this,K)&&f(this[K],a)&&(this[K][a]=!1),U(this,a,x(1,c))};return g&&T&&U(Q,a,{configurable:!0,set:b}),V(a)},i(G[J],"toString",function toString(){return this._k}),A.f=_,B.f=X,d(48).f=z.f=aa,d(42).f=$,d(41).f=ba,g&&!d(26)&&i(Q,"propertyIsEnumerable",$,!0),p.f=function(a){return V(o(a))}),h(h.G+h.W+h.F*!R,{Symbol:G});for(var ca="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),da=0;ca.length>da;)o(ca[da++]);for(var ca=C(o.store),da=0;ca.length>da;)q(ca[da++]);h(h.S+h.F*!R,"Symbol",{"for":function(a){return f(N,a+="")?N[a]:N[a]=G(a)},keyFor:function keyFor(a){if(W(a))return r(N,a);throw TypeError(a+" is not a symbol!")},useSetter:function(){T=!0},useSimple:function(){T=!1}}),h(h.S+h.F*!R,"Object",{create:Z,defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:_,getOwnPropertyNames:aa,getOwnPropertySymbols:ba}),H&&h(h.S+h.F*(!R||k(function(){var a=G();return"[null]"!=I([a])||"{}"!=I({a:a})||"{}"!=I(Object(a))})),"JSON",{stringify:function stringify(a){if(a!==c&&!W(a)){for(var b,d,e=[a],f=1;arguments.length>f;)e.push(arguments[f++]);return b=e[1],"function"==typeof b&&(d=b),!d&&t(b)||(b=function(a,b){if(d&&(b=d.call(this,a,b)),!W(b))return b}),e[1]=b,I.apply(H,e)}}}),G[J][L]||d(8)(G[J],L,G[J].valueOf),m(G,"Symbol"),m(Math,"Math",!0),m(e.JSON,"JSON",!0)},function(a,c){var d=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof b&&(b=d)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){a.exports=!c(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,d){var e=d(2),f=d(7),g=d(8),h=d(16),i=d(18),j="prototype",k=function(a,b,d){var l,m,n,o,p=a&k.F,q=a&k.G,r=a&k.S,s=a&k.P,t=a&k.B,u=q?e:r?e[b]||(e[b]={}):(e[b]||{})[j],v=q?f:f[b]||(f[b]={}),w=v[j]||(v[j]={});q&&(d=b);for(l in d)m=!p&&u&&u[l]!==c,n=(m?u:d)[l],o=t&&m?i(n,e):s&&"function"==typeof n?i(Function.call,n):n,u&&h(u,l,n,a&k.U),v[l]!=n&&g(v,l,o),s&&w[l]!=n&&(w[l]=n)};e.core=f,k.F=1,k.G=2,k.S=4,k.P=8,k.B=16,k.W=32,k.U=64,k.R=128,a.exports=k},function(b,c){var d=b.exports={version:"2.4.0"};"number"==typeof a&&(a=d)},function(a,b,c){var d=c(9),e=c(15);a.exports=c(4)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b,c){var d=c(10),e=c(12),f=c(14),g=Object.defineProperty;b.f=c(4)?Object.defineProperty:function defineProperty(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(h){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},function(a,b,c){var d=c(11);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){a.exports=!c(4)&&!c(5)(function(){return 7!=Object.defineProperty(c(13)("div"),"a",{get:function(){return 7}}).a})},function(a,b,c){var d=c(11),e=c(2).document,f=d(e)&&d(e.createElement);a.exports=function(a){return f?e.createElement(a):{}}},function(a,b,c){var d=c(11);a.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(2),e=c(8),f=c(3),g=c(17)("src"),h="toString",i=Function[h],j=(""+i).split(h);c(7).inspectSource=function(a){return i.call(a)},(a.exports=function(a,b,c,h){var i="function"==typeof c;i&&(f(c,"name")||e(c,"name",b)),a[b]!==c&&(i&&(f(c,g)||e(c,g,a[b]?""+a[b]:j.join(String(b)))),a===d?a[b]=c:h?a[b]?a[b]=c:e(a,b,c):(delete a[b],e(a,b,c)))})(Function.prototype,h,function toString(){return"function"==typeof this&&this[g]||i.call(this)})},function(a,b){var d=0,e=Math.random();a.exports=function(a){return"Symbol(".concat(a===c?"":a,")_",(++d+e).toString(36))}},function(a,b,d){var e=d(19);a.exports=function(a,b,d){if(e(a),b===c)return a;switch(d){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){var d=c(17)("meta"),e=c(11),f=c(3),g=c(9).f,h=0,i=Object.isExtensible||function(){return!0},j=!c(5)(function(){return i(Object.preventExtensions({}))}),k=function(a){g(a,d,{value:{i:"O"+ ++h,w:{}}})},l=function(a,b){if(!e(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!f(a,d)){if(!i(a))return"F";if(!b)return"E";k(a)}return a[d].i},m=function(a,b){if(!f(a,d)){if(!i(a))return!0;if(!b)return!1;k(a)}return a[d].w},n=function(a){return j&&o.NEED&&i(a)&&!f(a,d)&&k(a),a},o=a.exports={KEY:d,NEED:!1,fastKey:l,getWeak:m,onFreeze:n}},function(a,b,c){var d=c(2),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d=c(9).f,e=c(3),f=c(23)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(21)("wks"),e=c(17),f=c(2).Symbol,g="function"==typeof f,h=a.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))};h.store=d},function(a,b,c){b.f=c(23)},function(a,b,c){var d=c(2),e=c(7),f=c(26),g=c(24),h=c(9).f;a.exports=function(a){var b=e.Symbol||(e.Symbol=f?{}:d.Symbol||{});"_"==a.charAt(0)||a in b||h(b,a,{value:g.f(a)})}},function(a,b){a.exports=!1},function(a,b,c){var d=c(28),e=c(30);a.exports=function(a,b){for(var c,f=e(a),g=d(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},function(a,b,c){var d=c(29),e=c(39);a.exports=Object.keys||function keys(a){return d(a,e)}},function(a,b,c){var d=c(3),e=c(30),f=c(34)(!1),g=c(38)("IE_PROTO");a.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},function(a,b,c){var d=c(31),e=c(33);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(32);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(a==c)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(30),e=c(35),f=c(37);a.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if(h=i[k++],h!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},function(a,b,c){var d=c(36),e=Math.min;a.exports=function(a){return a>0?e(d(a),9007199254740991):0}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){var d=c(36),e=Math.max,f=Math.min;a.exports=function(a,b){return a=d(a),a<0?e(a+b,0):f(a,b)}},function(a,b,c){var d=c(21)("keys"),e=c(17);a.exports=function(a){return d[a]||(d[a]=e(a))}},function(a,b){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,b,c){var d=c(28),e=c(41),f=c(42);a.exports=function(a){var b=d(a),c=e.f;if(c)for(var g,h=c(a),i=f.f,j=0;h.length>j;)i.call(a,g=h[j++])&&b.push(g);return b}},function(a,b){b.f=Object.getOwnPropertySymbols},function(a,b){b.f={}.propertyIsEnumerable},function(a,b,c){var d=c(32);a.exports=Array.isArray||function isArray(a){return"Array"==d(a)}},function(a,b,d){var e=d(10),f=d(45),g=d(39),h=d(38)("IE_PROTO"),i=function(){},j="prototype",k=function(){var a,b=d(13)("iframe"),c=g.length,e="<",f=">";for(b.style.display="none",d(46).appendChild(b),b.src="javascript:",a=b.contentWindow.document,a.open(),a.write(e+"script"+f+"document.F=Object"+e+"/script"+f),a.close(),k=a.F;c--;)delete k[j][g[c]];return k()};a.exports=Object.create||function create(a,b){var d;return null!==a?(i[j]=e(a),d=new i,i[j]=null,d[h]=a):d=k(),b===c?d:f(d,b)}},function(a,b,c){var d=c(9),e=c(10),f=c(28);a.exports=c(4)?Object.defineProperties:function defineProperties(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},function(a,b,c){a.exports=c(2).document&&document.documentElement},function(a,b,c){var d=c(30),e=c(48).f,f={}.toString,g="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(b){return g.slice()}};a.exports.f=function getOwnPropertyNames(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},function(a,b,c){var d=c(29),e=c(39).concat("length","prototype");b.f=Object.getOwnPropertyNames||function getOwnPropertyNames(a){return d(a,e)}},function(a,b,c){var d=c(42),e=c(15),f=c(30),g=c(14),h=c(3),i=c(12),j=Object.getOwnPropertyDescriptor;b.f=c(4)?j:function getOwnPropertyDescriptor(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(c){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperty:c(9).f})},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperties:c(45)})},function(a,b,c){var d=c(30),e=c(49).f;c(53)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(a,b){return e(d(a),b)}})},function(a,b,c){var d=c(6),e=c(7),f=c(5);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(6);d(d.S,"Object",{create:c(44)})},function(a,b,c){var d=c(56),e=c(57);c(53)("getPrototypeOf",function(){return function getPrototypeOf(a){return e(d(a))}})},function(a,b,c){var d=c(33);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(3),e=c(56),f=c(38)("IE_PROTO"),g=Object.prototype;a.exports=Object.getPrototypeOf||function(a){return a=e(a),d(a,f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},function(a,b,c){var d=c(56),e=c(28);c(53)("keys",function(){return function keys(a){return e(d(a))}})},function(a,b,c){c(53)("getOwnPropertyNames",function(){return c(47).f})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("freeze",function(a){return function freeze(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("seal",function(a){return function seal(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("preventExtensions",function(a){return function preventExtensions(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11);c(53)("isFrozen",function(a){return function isFrozen(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(11);c(53)("isSealed",function(a){return function isSealed(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(11);c(53)("isExtensible",function(a){return function isExtensible(b){return!!d(b)&&(!a||a(b))}})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{assign:c(67)})},function(a,b,c){var d=c(28),e=c(41),f=c(42),g=c(56),h=c(31),i=Object.assign;a.exports=!i||c(5)(function(){var a={},b={},c=Symbol(),d="abcdefghijklmnopqrst";return a[c]=7,d.split("").forEach(function(a){b[a]=a}),7!=i({},a)[c]||Object.keys(i({},b)).join("")!=d})?function assign(a,b){for(var c=g(a),i=arguments.length,j=1,k=e.f,l=f.f;i>j;)for(var m,n=h(arguments[j++]),o=k?d(n).concat(k(n)):d(n),p=o.length,q=0;p>q;)l.call(n,m=o[q++])&&(c[m]=n[m]);return c}:i},function(a,b,c){var d=c(6);d(d.S,"Object",{is:c(69)})},function(a,b){a.exports=Object.is||function is(a,b){return a===b?0!==a||1/a===1/b:a!=a&&b!=b}},function(a,b,c){var d=c(6);d(d.S,"Object",{setPrototypeOf:c(71).set})},function(a,b,d){var e=d(11),f=d(10),g=function(a,b){if(f(a),!e(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};a.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(a,b,c){try{c=d(18)(Function.call,d(49).f(Object.prototype,"__proto__").set,2),c(a,[]),b=!(a instanceof Array)}catch(e){b=!0}return function setPrototypeOf(a,d){return g(a,d),b?a.__proto__=d:c(a,d),a}}({},!1):c),check:g}},function(a,b,c){var d=c(73),e={};e[c(23)("toStringTag")]="z",e+""!="[object z]"&&c(16)(Object.prototype,"toString",function toString(){return"[object "+d(this)+"]"},!0)},function(a,b,d){var e=d(32),f=d(23)("toStringTag"),g="Arguments"==e(function(){return arguments}()),h=function(a,b){try{return a[b]}catch(c){}};a.exports=function(a){var b,d,i;return a===c?"Undefined":null===a?"Null":"string"==typeof(d=h(b=Object(a),f))?d:g?e(b):"Object"==(i=e(b))&&"function"==typeof b.callee?"Arguments":i}},function(a,b,c){var d=c(6);d(d.P,"Function",{bind:c(75)})},function(a,b,c){var d=c(19),e=c(11),f=c(76),g=[].slice,h={},i=function(a,b,c){if(!(b in h)){for(var d=[],e=0;e2){b=s?b.trim():m(b,3);var c,d,e,f=b.charCodeAt(0);if(43===f||45===f){if(c=b.charCodeAt(2),88===c||120===c)return NaN}else if(48===f){switch(b.charCodeAt(1)){case 66:case 98:d=2,e=49;break;case 79:case 111:d=8,e=55;break;default:return+b}for(var g,i=b.slice(2),j=0,k=i.length;je)return NaN;return parseInt(i,d)}}return+b};if(!o(" 0o1")||!o("0b1")||o("+0x1")){o=function Number(a){var b=arguments.length<1?0:a,c=this;return c instanceof o&&(r?i(function(){q.valueOf.call(c)}):f(c)!=n)?g(new p(t(b)),c,o):t(b)};for(var u,v=c(4)?j(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;v.length>w;w++)e(p,u=v[w])&&!e(o,u)&&l(o,u,k(p,u));o.prototype=q,q.constructor=o,c(16)(d,n,o)}},function(a,b,c){var d=c(11),e=c(71).set;a.exports=function(a,b,c){var f,g=b.constructor;return g!==c&&"function"==typeof g&&(f=g.prototype)!==c.prototype&&d(f)&&e&&e(a,f),a}},function(a,b,c){var d=c(6),e=c(33),f=c(5),g=c(82),h="["+g+"]",i="​…",j=RegExp("^"+h+h+"*"),k=RegExp(h+h+"*$"),l=function(a,b,c){var e={},h=f(function(){return!!g[a]()||i[a]()!=i}),j=e[a]=h?b(m):g[a];c&&(e[c]=j),d(d.P+d.F*h,"String",e)},m=l.trim=function(a,b){return a=String(e(a)),1&b&&(a=a.replace(j,"")),2&b&&(a=a.replace(k,"")),a};a.exports=l},function(a,b){a.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},function(a,b,c){var d=c(6),e=c(36),f=c(84),g=c(85),h=1..toFixed,i=Math.floor,j=[0,0,0,0,0,0],k="Number.toFixed: incorrect invocation!",l="0",m=function(a,b){for(var c=-1,d=b;++c<6;)d+=a*j[c],j[c]=d%1e7,d=i(d/1e7)},n=function(a){for(var b=6,c=0;--b>=0;)c+=j[b],j[b]=i(c/a),c=c%a*1e7},o=function(){for(var a=6,b="";--a>=0;)if(""!==b||0===a||0!==j[a]){var c=String(j[a]);b=""===b?c:b+g.call(l,7-c.length)+c}return b},p=function(a,b,c){return 0===b?c:b%2===1?p(a,b-1,c*a):p(a*a,b/2,c)},q=function(a){for(var b=0,c=a;c>=4096;)b+=12,c/=4096;for(;c>=2;)b+=1,c/=2;return b};d(d.P+d.F*(!!h&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!c(5)(function(){h.call({})})),"Number",{toFixed:function toFixed(a){var b,c,d,h,i=f(this,k),j=e(a),r="",s=l;if(j<0||j>20)throw RangeError(k);if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return String(i);if(i<0&&(r="-",i=-i),i>1e-21)if(b=q(i*p(2,69,1))-69,c=b<0?i*p(2,-b,1):i/p(2,b,1),c*=4503599627370496,b=52-b,b>0){for(m(0,c),d=j;d>=7;)m(1e7,0),d-=7;for(m(p(10,d,1),0),d=b-1;d>=23;)n(1<<23),d-=23;n(1<0?(h=s.length,s=r+(h<=j?"0."+g.call(l,j-h)+s:s.slice(0,h-j)+"."+s.slice(h-j))):s=r+s,s}})},function(a,b,c){var d=c(32);a.exports=function(a,b){if("number"!=typeof a&&"Number"!=d(a))throw TypeError(b);return+a}},function(a,b,c){var d=c(36),e=c(33);a.exports=function repeat(a){var b=String(e(this)),c="",f=d(a);if(f<0||f==1/0)throw RangeError("Count can't be negative");for(;f>0;(f>>>=1)&&(b+=b))1&f&&(c+=b);return c}},function(a,b,d){var e=d(6),f=d(5),g=d(84),h=1..toPrecision;e(e.P+e.F*(f(function(){return"1"!==h.call(1,c)})||!f(function(){h.call({})})),"Number",{toPrecision:function toPrecision(a){var b=g(this,"Number#toPrecision: incorrect invocation!");return a===c?h.call(b):h.call(b,a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{EPSILON:Math.pow(2,-52)})},function(a,b,c){var d=c(6),e=c(2).isFinite;d(d.S,"Number",{isFinite:function isFinite(a){return"number"==typeof a&&e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{isInteger:c(90)})},function(a,b,c){var d=c(11),e=Math.floor;a.exports=function isInteger(a){return!d(a)&&isFinite(a)&&e(a)===a}},function(a,b,c){var d=c(6);d(d.S,"Number",{isNaN:function isNaN(a){return a!=a}})},function(a,b,c){var d=c(6),e=c(90),f=Math.abs;d(d.S,"Number",{isSafeInteger:function isSafeInteger(a){return e(a)&&f(a)<=9007199254740991}})},function(a,b,c){var d=c(6);d(d.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(a,b,c){var d=c(6);d(d.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(a,b,c){var d=c(6),e=c(96);d(d.S+d.F*(Number.parseFloat!=e),"Number",{parseFloat:e})},function(a,b,c){var d=c(2).parseFloat,e=c(81).trim;a.exports=1/d(c(82)+"-0")!==-(1/0)?function parseFloat(a){var b=e(String(a),3),c=d(b);return 0===c&&"-"==b.charAt(0)?-0:c}:d},function(a,b,c){var d=c(6),e=c(98);d(d.S+d.F*(Number.parseInt!=e),"Number",{parseInt:e})},function(a,b,c){var d=c(2).parseInt,e=c(81).trim,f=c(82),g=/^[\-+]?0[xX]/;a.exports=8!==d(f+"08")||22!==d(f+"0x16")?function parseInt(a,b){var c=e(String(a),3);return d(c,b>>>0||(g.test(c)?16:10))}:d},function(a,b,c){var d=c(6),e=c(98);d(d.G+d.F*(parseInt!=e),{parseInt:e})},function(a,b,c){var d=c(6),e=c(96);d(d.G+d.F*(parseFloat!=e),{parseFloat:e})},function(a,b,c){var d=c(6),e=c(102),f=Math.sqrt,g=Math.acosh;d(d.S+d.F*!(g&&710==Math.floor(g(Number.MAX_VALUE))&&g(1/0)==1/0),"Math",{acosh:function acosh(a){return(a=+a)<1?NaN:a>94906265.62425156?Math.log(a)+Math.LN2:e(a-1+f(a-1)*f(a+1))}})},function(a,b){a.exports=Math.log1p||function log1p(a){return(a=+a)>-1e-8&&a<1e-8?a-a*a/2:Math.log(1+a)}},function(a,b,c){function asinh(a){return isFinite(a=+a)&&0!=a?a<0?-asinh(-a):Math.log(a+Math.sqrt(a*a+1)):a}var d=c(6),e=Math.asinh;d(d.S+d.F*!(e&&1/e(0)>0),"Math",{asinh:asinh})},function(a,b,c){var d=c(6),e=Math.atanh;d(d.S+d.F*!(e&&1/e(-0)<0),"Math",{atanh:function atanh(a){return 0==(a=+a)?a:Math.log((1+a)/(1-a))/2}})},function(a,b,c){var d=c(6),e=c(106);d(d.S,"Math",{cbrt:function cbrt(a){return e(a=+a)*Math.pow(Math.abs(a),1/3)}})},function(a,b){a.exports=Math.sign||function sign(a){return 0==(a=+a)||a!=a?a:a<0?-1:1}},function(a,b,c){var d=c(6);d(d.S,"Math",{clz32:function clz32(a){return(a>>>=0)?31-Math.floor(Math.log(a+.5)*Math.LOG2E):32}})},function(a,b,c){var d=c(6),e=Math.exp;d(d.S,"Math",{cosh:function cosh(a){return(e(a=+a)+e(-a))/2}})},function(a,b,c){var d=c(6),e=c(110);d(d.S+d.F*(e!=Math.expm1),"Math",{expm1:e})},function(a,b){var c=Math.expm1;a.exports=!c||c(10)>22025.465794806718||c(10)<22025.465794806718||c(-2e-17)!=-2e-17?function expm1(a){return 0==(a=+a)?a:a>-1e-6&&a<1e-6?a+a*a/2:Math.exp(a)-1}:c},function(a,b,c){var d=c(6),e=c(106),f=Math.pow,g=f(2,-52),h=f(2,-23),i=f(2,127)*(2-h),j=f(2,-126),k=function(a){return a+1/g-1/g};d(d.S,"Math",{fround:function fround(a){var b,c,d=Math.abs(a),f=e(a);return di||c!=c?f*(1/0):f*c)}})},function(a,b,c){var d=c(6),e=Math.abs;d(d.S,"Math",{hypot:function hypot(a,b){for(var c,d,f=0,g=0,h=arguments.length,i=0;g0?(d=c/i,f+=d*d):f+=c;return i===1/0?1/0:i*Math.sqrt(f)}})},function(a,b,c){var d=c(6),e=Math.imul;d(d.S+d.F*c(5)(function(){return e(4294967295,5)!=-5||2!=e.length}),"Math",{imul:function imul(a,b){var c=65535,d=+a,e=+b,f=c&d,g=c&e;return 0|f*g+((c&d>>>16)*g+f*(c&e>>>16)<<16>>>0)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log10:function log10(a){return Math.log(a)/Math.LN10}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log1p:c(102)})},function(a,b,c){var d=c(6);d(d.S,"Math",{log2:function log2(a){return Math.log(a)/Math.LN2}})},function(a,b,c){var d=c(6);d(d.S,"Math",{sign:c(106)})},function(a,b,c){var d=c(6),e=c(110),f=Math.exp;d(d.S+d.F*c(5)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function sinh(a){return Math.abs(a=+a)<1?(e(a)-e(-a))/2:(f(a-1)-f(-a-1))*(Math.E/2)}})},function(a,b,c){var d=c(6),e=c(110),f=Math.exp;d(d.S,"Math",{tanh:function tanh(a){var b=e(a=+a),c=e(-a);return b==1/0?1:c==1/0?-1:(b-c)/(f(a)+f(-a))}})},function(a,b,c){var d=c(6);d(d.S,"Math",{trunc:function trunc(a){return(a>0?Math.floor:Math.ceil)(a)}})},function(a,b,c){var d=c(6),e=c(37),f=String.fromCharCode,g=String.fromCodePoint;d(d.S+d.F*(!!g&&1!=g.length),"String",{fromCodePoint:function fromCodePoint(a){for(var b,c=[],d=arguments.length,g=0;d>g;){if(b=+arguments[g++],e(b,1114111)!==b)throw RangeError(b+" is not a valid code point");c.push(b<65536?f(b):f(((b-=65536)>>10)+55296,b%1024+56320))}return c.join("")}})},function(a,b,c){var d=c(6),e=c(30),f=c(35);d(d.S,"String",{raw:function raw(a){for(var b=e(a.raw),c=f(b.length),d=arguments.length,g=[],h=0;c>h;)g.push(String(b[h++])),h=k?a?"":c:(g=i.charCodeAt(j),g<55296||g>56319||j+1===k||(h=i.charCodeAt(j+1))<56320||h>57343?a?i.charAt(j):g:a?i.slice(j,j+2):(g-55296<<10)+(h-56320)+65536)}}},function(a,b,d){var e=d(6),f=d(35),g=d(127),h="endsWith",i=""[h];e(e.P+e.F*d(129)(h),"String",{endsWith:function endsWith(a){var b=g(this,a,h),d=arguments.length>1?arguments[1]:c,e=f(b.length),j=d===c?e:Math.min(f(d),e),k=String(a);return i?i.call(b,k,j):b.slice(j-k.length,j)===k}})},function(a,b,c){var d=c(128),e=c(33);a.exports=function(a,b,c){if(d(b))throw TypeError("String#"+c+" doesn't accept regex!");return String(e(a))}},function(a,b,d){var e=d(11),f=d(32),g=d(23)("match");a.exports=function(a){var b;return e(a)&&((b=a[g])!==c?!!b:"RegExp"==f(a))}},function(a,b,c){var d=c(23)("match");a.exports=function(a){var b=/./;try{"/./"[a](b)}catch(c){try{return b[d]=!1,!"/./"[a](b)}catch(e){}}return!0}},function(a,b,d){var e=d(6),f=d(127),g="includes";e(e.P+e.F*d(129)(g),"String",{includes:function includes(a){return!!~f(this,a,g).indexOf(a,arguments.length>1?arguments[1]:c)}})},function(a,b,c){var d=c(6);d(d.P,"String",{repeat:c(85)})},function(a,b,d){var e=d(6),f=d(35),g=d(127),h="startsWith",i=""[h];e(e.P+e.F*d(129)(h),"String",{startsWith:function startsWith(a){var b=g(this,a,h),d=f(Math.min(arguments.length>1?arguments[1]:c,b.length)),e=String(a);return i?i.call(b,e,d):b.slice(d,d+e.length)===e}})},function(a,b,d){var e=d(125)(!0);d(134)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,d=this._i;return d>=b.length?{value:c,done:!0}:(a=e(b,d),this._i+=a.length,{value:a,done:!1})})},function(a,b,d){var e=d(26),f=d(6),g=d(16),h=d(8),i=d(3),j=d(135),k=d(136),l=d(22),m=d(57),n=d(23)("iterator"),o=!([].keys&&"next"in[].keys()),p="@@iterator",q="keys",r="values",s=function(){return this};a.exports=function(a,b,d,t,u,v,w){k(d,b,t);var x,y,z,A=function(a){if(!o&&a in E)return E[a];switch(a){case q:return function keys(){return new d(this,a)};case r:return function values(){return new d(this,a)}}return function entries(){return new d(this,a)}},B=b+" Iterator",C=u==r,D=!1,E=a.prototype,F=E[n]||E[p]||u&&E[u],G=F||A(u),H=u?C?A("entries"):G:c,I="Array"==b?E.entries||F:F;if(I&&(z=m(I.call(new a)),z!==Object.prototype&&(l(z,B,!0),e||i(z,n)||h(z,n,s))),C&&F&&F.name!==r&&(D=!0,G=function values(){return F.call(this)}),e&&!w||!o&&!D&&E[n]||h(E,n,G),j[b]=G,j[B]=s,u)if(x={values:C?G:A(r),keys:v?G:A(q),entries:H},w)for(y in x)y in E||g(E,y,x[y]);else f(f.P+f.F*(o||D),b,x);return x}},function(a,b){a.exports={}},function(a,b,c){var d=c(44),e=c(15),f=c(22),g={};c(8)(g,c(23)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){c(138)("anchor",function(a){return function anchor(b){return a(this,"a","name",b)}})},function(a,b,c){var d=c(6),e=c(5),f=c(33),g=/"/g,h=function(a,b,c,d){var e=String(f(a)),h="<"+b;return""!==c&&(h+=" "+c+'="'+String(d).replace(g,""")+'"'),h+">"+e+""};a.exports=function(a,b){var c={};c[a]=b(h),d(d.P+d.F*e(function(){var b=""[a]('"');return b!==b.toLowerCase()||b.split('"').length>3}),"String",c)}},function(a,b,c){c(138)("big",function(a){return function big(){return a(this,"big","","")}})},function(a,b,c){c(138)("blink",function(a){return function blink(){return a(this,"blink","","")}})},function(a,b,c){c(138)("bold",function(a){return function bold(){return a(this,"b","","")}})},function(a,b,c){c(138)("fixed",function(a){return function fixed(){return a(this,"tt","","")}})},function(a,b,c){c(138)("fontcolor",function(a){return function fontcolor(b){return a(this,"font","color",b)}})},function(a,b,c){c(138)("fontsize",function(a){return function fontsize(b){return a(this,"font","size",b)}})},function(a,b,c){c(138)("italics",function(a){return function italics(){return a(this,"i","","")}})},function(a,b,c){c(138)("link",function(a){return function link(b){return a(this,"a","href",b)}})},function(a,b,c){c(138)("small",function(a){return function small(){return a(this,"small","","")}})},function(a,b,c){c(138)("strike",function(a){return function strike(){return a(this,"strike","","")}})},function(a,b,c){c(138)("sub",function(a){return function sub(){return a(this,"sub","","")}})},function(a,b,c){c(138)("sup",function(a){return function sup(){return a(this,"sup","","")}})},function(a,b,c){var d=c(6);d(d.S,"Array",{isArray:c(43)})},function(a,b,d){var e=d(18),f=d(6),g=d(56),h=d(153),i=d(154),j=d(35),k=d(155),l=d(156);f(f.S+f.F*!d(157)(function(a){Array.from(a)}),"Array",{from:function from(a){var b,d,f,m,n=g(a),o="function"==typeof this?this:Array,p=arguments.length,q=p>1?arguments[1]:c,r=q!==c,s=0,t=l(n);if(r&&(q=e(q,p>2?arguments[2]:c,2)),t==c||o==Array&&i(t))for(b=j(n.length),d=new o(b);b>s;s++)k(d,s,r?q(n[s],s):n[s]);else for(m=t.call(n),d=new o;!(f=m.next()).done;s++)k(d,s,r?h(m,q,[f.value,s],!0):f.value);return d.length=s,d}})},function(a,b,d){var e=d(10);a.exports=function(a,b,d,f){try{return f?b(e(d)[0],d[1]):b(d)}catch(g){var h=a["return"];throw h!==c&&e(h.call(a)),g}}},function(a,b,d){var e=d(135),f=d(23)("iterator"),g=Array.prototype;a.exports=function(a){return a!==c&&(e.Array===a||g[f]===a)}},function(a,b,c){var d=c(9),e=c(15);a.exports=function(a,b,c){b in a?d.f(a,b,e(0,c)):a[b]=c}},function(a,b,d){var e=d(73),f=d(23)("iterator"),g=d(135);a.exports=d(7).getIteratorMethod=function(a){ +if(a!=c)return a[f]||a["@@iterator"]||g[e(a)]}},function(a,b,c){var d=c(23)("iterator"),e=!1;try{var f=[7][d]();f["return"]=function(){e=!0},Array.from(f,function(){throw 2})}catch(g){}a.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(h){}return c}},function(a,b,c){var d=c(6),e=c(155);d(d.S+d.F*c(5)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var a=0,b=arguments.length,c=new("function"==typeof this?this:Array)(b);b>a;)e(c,a,arguments[a++]);return c.length=b,c}})},function(a,b,d){var e=d(6),f=d(30),g=[].join;e(e.P+e.F*(d(31)!=Object||!d(160)(g)),"Array",{join:function join(a){return g.call(f(this),a===c?",":a)}})},function(a,b,c){var d=c(5);a.exports=function(a,b){return!!a&&d(function(){b?a.call(null,function(){},1):a.call(null)})}},function(a,b,d){var e=d(6),f=d(46),g=d(32),h=d(37),i=d(35),j=[].slice;e(e.P+e.F*d(5)(function(){f&&j.call(f)}),"Array",{slice:function slice(a,b){var d=i(this.length),e=g(this);if(b=b===c?d:b,"Array"==e)return j.call(this,a,b);for(var f=h(a,d),k=h(b,d),l=i(k-f),m=Array(l),n=0;nw;w++)if((n||w in t)&&(q=t[w],r=u(q,w,s),a))if(d)x[w]=r;else if(r)switch(a){case 3:return!0;case 5:return q;case 6:return w;case 2:x.push(q)}else if(l)return!1;return m?-1:k||l?l:x}}},function(a,b,c){var d=c(166);a.exports=function(a,b){return new(d(a))(b)}},function(a,b,d){var e=d(11),f=d(43),g=d(23)("species");a.exports=function(a){var b;return f(a)&&(b=a.constructor,"function"!=typeof b||b!==Array&&!f(b.prototype)||(b=c),e(b)&&(b=b[g],null===b&&(b=c))),b===c?Array:b}},function(a,b,c){var d=c(6),e=c(164)(1);d(d.P+d.F*!c(160)([].map,!0),"Array",{map:function map(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(2);d(d.P+d.F*!c(160)([].filter,!0),"Array",{filter:function filter(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(3);d(d.P+d.F*!c(160)([].some,!0),"Array",{some:function some(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(4);d(d.P+d.F*!c(160)([].every,!0),"Array",{every:function every(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(172);d(d.P+d.F*!c(160)([].reduce,!0),"Array",{reduce:function reduce(a){return e(this,a,arguments.length,arguments[1],!1)}})},function(a,b,c){var d=c(19),e=c(56),f=c(31),g=c(35);a.exports=function(a,b,c,h,i){d(b);var j=e(a),k=f(j),l=g(j.length),m=i?l-1:0,n=i?-1:1;if(c<2)for(;;){if(m in k){h=k[m],m+=n;break}if(m+=n,i?m<0:l<=m)throw TypeError("Reduce of empty array with no initial value")}for(;i?m>=0:l>m;m+=n)m in k&&(h=b(h,k[m],m,j));return h}},function(a,b,c){var d=c(6),e=c(172);d(d.P+d.F*!c(160)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(a){return e(this,a,arguments.length,arguments[1],!0)}})},function(a,b,c){var d=c(6),e=c(34)(!1),f=[].indexOf,g=!!f&&1/[1].indexOf(1,-0)<0;d(d.P+d.F*(g||!c(160)(f)),"Array",{indexOf:function indexOf(a){return g?f.apply(this,arguments)||0:e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(30),f=c(36),g=c(35),h=[].lastIndexOf,i=!!h&&1/[1].lastIndexOf(1,-0)<0;d(d.P+d.F*(i||!c(160)(h)),"Array",{lastIndexOf:function lastIndexOf(a){if(i)return h.apply(this,arguments)||0;var b=e(this),c=g(b.length),d=c-1;for(arguments.length>1&&(d=Math.min(d,f(arguments[1]))),d<0&&(d=c+d);d>=0;d--)if(d in b&&b[d]===a)return d||0;return-1}})},function(a,b,c){var d=c(6);d(d.P,"Array",{copyWithin:c(177)}),c(178)("copyWithin")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=[].copyWithin||function copyWithin(a,b){var d=e(this),h=g(d.length),i=f(a,h),j=f(b,h),k=arguments.length>2?arguments[2]:c,l=Math.min((k===c?h:f(k,h))-j,h-i),m=1;for(j0;)j in d?d[i]=d[j]:delete d[i],i+=m,j+=m;return d}},function(a,b,d){var e=d(23)("unscopables"),f=Array.prototype;f[e]==c&&d(8)(f,e,{}),a.exports=function(a){f[e][a]=!0}},function(a,b,c){var d=c(6);d(d.P,"Array",{fill:c(180)}),c(178)("fill")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=function fill(a){for(var b=e(this),d=g(b.length),h=arguments.length,i=f(h>1?arguments[1]:c,d),j=h>2?arguments[2]:c,k=j===c?d:f(j,d);k>i;)b[i++]=a;return b}},function(a,b,d){var e=d(6),f=d(164)(5),g="find",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{find:function find(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(178)(g)},function(a,b,d){var e=d(6),f=d(164)(6),g="findIndex",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{findIndex:function findIndex(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(178)(g)},function(a,b,d){var e=d(178),f=d(184),g=d(135),h=d(30);a.exports=d(134)(Array,"Array",function(a,b){this._t=h(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,d=this._i++;return!a||d>=a.length?(this._t=c,f(1)):"keys"==b?f(0,d):"values"==b?f(0,a[d]):f(0,[d,a[d]])},"values"),g.Arguments=g.Array,e("keys"),e("values"),e("entries")},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){c(186)("Array")},function(a,b,c){var d=c(2),e=c(9),f=c(4),g=c(23)("species");a.exports=function(a){var b=d[a];f&&b&&!b[g]&&e.f(b,g,{configurable:!0,get:function(){return this}})}},function(a,b,d){var e=d(2),f=d(80),g=d(9).f,h=d(48).f,i=d(128),j=d(188),k=e.RegExp,l=k,m=k.prototype,n=/a/g,o=/a/g,p=new k(n)!==n;if(d(4)&&(!p||d(5)(function(){return o[d(23)("match")]=!1,k(n)!=n||k(o)==o||"/a/i"!=k(n,"i")}))){k=function RegExp(a,b){var d=this instanceof k,e=i(a),g=b===c;return!d&&e&&a.constructor===k&&g?a:f(p?new l(e&&!g?a.source:a,b):l((e=a instanceof k)?a.source:a,e&&g?j.call(a):b),d?this:m,k)};for(var q=(function(a){a in k||g(k,a,{configurable:!0,get:function(){return l[a]},set:function(b){l[a]=b}})}),r=h(l),s=0;r.length>s;)q(r[s++]);m.constructor=k,k.prototype=m,d(16)(e,"RegExp",k)}d(186)("RegExp")},function(a,b,c){var d=c(10);a.exports=function(){var a=d(this),b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),a.unicode&&(b+="u"),a.sticky&&(b+="y"),b}},function(a,b,d){d(190);var e=d(10),f=d(188),g=d(4),h="toString",i=/./[h],j=function(a){d(16)(RegExp.prototype,h,a,!0)};d(5)(function(){return"/a/b"!=i.call({source:"a",flags:"b"})})?j(function toString(){var a=e(this);return"/".concat(a.source,"/","flags"in a?a.flags:!g&&a instanceof RegExp?f.call(a):c)}):i.name!=h&&j(function toString(){return i.call(this)})},function(a,b,c){c(4)&&"g"!=/./g.flags&&c(9).f(RegExp.prototype,"flags",{configurable:!0,get:c(188)})},function(a,b,d){d(192)("match",1,function(a,b,d){return[function match(d){var e=a(this),f=d==c?c:d[b];return f!==c?f.call(d,e):new RegExp(d)[b](String(e))},d]})},function(a,b,c){var d=c(8),e=c(16),f=c(5),g=c(33),h=c(23);a.exports=function(a,b,c){var i=h(a),j=c(g,i,""[a]),k=j[0],l=j[1];f(function(){var b={};return b[i]=function(){return 7},7!=""[a](b)})&&(e(String.prototype,a,k),d(RegExp.prototype,i,2==b?function(a,b){return l.call(a,this,b)}:function(a){return l.call(a,this)}))}},function(a,b,d){d(192)("replace",2,function(a,b,d){return[function replace(e,f){var g=a(this),h=e==c?c:e[b];return h!==c?h.call(e,g,f):d.call(String(g),e,f)},d]})},function(a,b,d){d(192)("search",1,function(a,b,d){return[function search(d){var e=a(this),f=d==c?c:d[b];return f!==c?f.call(d,e):new RegExp(d)[b](String(e))},d]})},function(a,b,d){d(192)("split",2,function(a,b,e){var f=d(128),g=e,h=[].push,i="split",j="length",k="lastIndex";if("c"=="abbc"[i](/(b)*/)[1]||4!="test"[i](/(?:)/,-1)[j]||2!="ab"[i](/(?:ab)*/)[j]||4!="."[i](/(.?)(.?)/)[j]||"."[i](/()()/)[j]>1||""[i](/.?/)[j]){var l=/()??/.exec("")[1]===c;e=function(a,b){var d=String(this);if(a===c&&0===b)return[];if(!f(a))return g.call(d,a,b);var e,i,m,n,o,p=[],q=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(a.sticky?"y":""),r=0,s=b===c?4294967295:b>>>0,t=new RegExp(a.source,q+"g");for(l||(e=new RegExp("^"+t.source+"$(?!\\s)",q));(i=t.exec(d))&&(m=i.index+i[0][j],!(m>r&&(p.push(d.slice(r,i.index)),!l&&i[j]>1&&i[0].replace(e,function(){for(o=1;o1&&i.index=s)));)t[k]===i.index&&t[k]++;return r===d[j]?!n&&t.test("")||p.push(""):p.push(d.slice(r)),p[j]>s?p.slice(0,s):p}}else"0"[i](c,0)[j]&&(e=function(a,b){return a===c&&0===b?[]:g.call(this,a,b)});return[function split(d,f){var g=a(this),h=d==c?c:d[b];return h!==c?h.call(d,g,f):e.call(String(g),d,f)},e]})},function(a,b,d){var e,f,g,h=d(26),i=d(2),j=d(18),k=d(73),l=d(6),m=d(11),n=d(19),o=d(197),p=d(198),q=d(199),r=d(200).set,s=d(201)(),t="Promise",u=i.TypeError,v=i.process,w=i[t],v=i.process,x="process"==k(v),y=function(){},z=!!function(){try{var a=w.resolve(1),b=(a.constructor={})[d(23)("species")]=function(a){a(y,y)};return(x||"function"==typeof PromiseRejectionEvent)&&a.then(y)instanceof b}catch(c){}}(),A=function(a,b){return a===b||a===w&&b===g},B=function(a){var b;return!(!m(a)||"function"!=typeof(b=a.then))&&b},C=function(a){return A(w,a)?new D(a):new f(a)},D=f=function(a){var b,d;this.promise=new a(function(a,e){if(b!==c||d!==c)throw u("Bad Promise constructor");b=a,d=e}),this.resolve=n(b),this.reject=n(d)},E=function(a){try{a()}catch(b){return{error:b}}},F=function(a,b){if(!a._n){a._n=!0;var c=a._c;s(function(){for(var d=a._v,e=1==a._s,f=0,g=function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&I(a),a._h=1),g===!0?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(u("Promise-chain cycle")):(f=B(c))?f.call(c,h,i):h(c)):i(d)}catch(k){i(k)}};c.length>f;)g(c[f++]);a._c=[],a._n=!1,b&&!a._h&&G(a)})}},G=function(a){r.call(i,function(){var b,d,e,f=a._v;if(H(a)&&(b=E(function(){x?v.emit("unhandledRejection",f,a):(d=i.onunhandledrejection)?d({promise:a,reason:f}):(e=i.console)&&e.error&&e.error("Unhandled promise rejection",f)}),a._h=x||H(a)?2:1),a._a=c,b)throw b.error})},H=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if(b=c[d++],b.fail||!H(b.promise))return!1;return!0},I=function(a){r.call(i,function(){var b;x?v.emit("rejectionHandled",a):(b=i.onrejectionhandled)&&b({promise:a,reason:a._v})})},J=function(a){var b=this;b._d||(b._d=!0,b=b._w||b,b._v=a,b._s=2,b._a||(b._a=b._c.slice()),F(b,!0))},K=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw u("Promise can't be resolved itself");(b=B(a))?s(function(){var d={_w:c,_d:!1};try{b.call(a,j(K,d,1),j(J,d,1))}catch(e){J.call(d,e)}}):(c._v=a,c._s=1,F(c,!1))}catch(d){J.call({_w:c,_d:!1},d)}}};z||(w=function Promise(a){o(this,w,t,"_h"),n(a),e.call(this);try{a(j(K,this,1),j(J,this,1))}catch(b){J.call(this,b)}},e=function Promise(a){this._c=[],this._a=c,this._s=0,this._d=!1,this._v=c,this._h=0,this._n=!1},e.prototype=d(202)(w.prototype,{then:function then(a,b){var d=C(q(this,w));return d.ok="function"!=typeof a||a,d.fail="function"==typeof b&&b,d.domain=x?v.domain:c,this._c.push(d),this._a&&this._a.push(d),this._s&&F(this,!1),d.promise},"catch":function(a){return this.then(c,a)}}),D=function(){var a=new e;this.promise=a,this.resolve=j(K,a,1),this.reject=j(J,a,1)}),l(l.G+l.W+l.F*!z,{Promise:w}),d(22)(w,t),d(186)(t),g=d(7)[t],l(l.S+l.F*!z,t,{reject:function reject(a){var b=C(this),c=b.reject;return c(a),b.promise}}),l(l.S+l.F*(h||!z),t,{resolve:function resolve(a){if(a instanceof w&&A(a.constructor,this))return a;var b=C(this),c=b.resolve;return c(a),b.promise}}),l(l.S+l.F*!(z&&d(157)(function(a){w.all(a)["catch"](y)})),t,{all:function all(a){var b=this,d=C(b),e=d.resolve,f=d.reject,g=E(function(){var d=[],g=0,h=1;p(a,!1,function(a){var i=g++,j=!1;d.push(c),h++,b.resolve(a).then(function(a){j||(j=!0,d[i]=a,--h||e(d))},f)}),--h||e(d)});return g&&f(g.error),d.promise},race:function race(a){var b=this,c=C(b),d=c.reject,e=E(function(){p(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},function(a,b){a.exports=function(a,b,d,e){if(!(a instanceof b)||e!==c&&e in a)throw TypeError(d+": incorrect invocation!");return a}},function(a,b,c){var d=c(18),e=c(153),f=c(154),g=c(10),h=c(35),i=c(156),j={},k={},b=a.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if(q=b?s(g(o=a[t])[0],o[1]):s(a[t]),q===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if(q=e(p,s,o.value,b),q===j||q===k)return q};b.BREAK=j,b.RETURN=k},function(a,b,d){var e=d(10),f=d(19),g=d(23)("species");a.exports=function(a,b){var d,h=e(a).constructor;return h===c||(d=e(h)[g])==c?b:f(d)}},function(a,b,c){var d,e,f,g=c(18),h=c(76),i=c(46),j=c(13),k=c(2),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function setImmediate(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function clearImmediate(a){delete q[a]},"process"==c(32)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),a.exports={set:m,clear:n}},function(a,b,d){var e=d(2),f=d(200).set,g=e.MutationObserver||e.WebKitMutationObserver,h=e.process,i=e.Promise,j="process"==d(32)(h);a.exports=function(){var a,b,d,k=function(){var e,f;for(j&&(e=h.domain)&&e.exit();a;){f=a.fn,a=a.next;try{f()}catch(g){throw a?d():b=c,g}}b=c,e&&e.enter()};if(j)d=function(){h.nextTick(k)};else if(g){var l=!0,m=document.createTextNode("");new g(k).observe(m,{characterData:!0}),d=function(){m.data=l=!l}}else if(i&&i.resolve){var n=i.resolve();d=function(){n.then(k)}}else d=function(){f.call(e,k)};return function(e){var f={fn:e,next:c};b&&(b.next=f),a||(a=f,d()),b=f}}},function(a,b,c){var d=c(16);a.exports=function(a,b,c){for(var e in b)d(a,e,b[e],c);return a}},function(a,b,d){var e=d(204);a.exports=d(205)("Map",function(a){return function Map(){return a(this,arguments.length>0?arguments[0]:c)}},{get:function get(a){var b=e.getEntry(this,a);return b&&b.v},set:function set(a,b){return e.def(this,0===a?0:a,b)}},e,!0)},function(a,b,d){var e=d(9).f,f=d(44),g=d(202),h=d(18),i=d(197),j=d(33),k=d(198),l=d(134),m=d(184),n=d(186),o=d(4),p=d(20).fastKey,q=o?"_s":"size",r=function(a,b){var c,d=p(b);if("F"!==d)return a._i[d];for(c=a._f;c;c=c.n)if(c.k==b)return c};a.exports={getConstructor:function(a,b,d,l){var m=a(function(a,e){i(a,m,b,"_i"),a._i=f(null),a._f=c,a._l=c,a[q]=0,e!=c&&k(e,d,a[l],a)});return g(m.prototype,{clear:function clear(){for(var a=this,b=a._i,d=a._f;d;d=d.n)d.r=!0,d.p&&(d.p=d.p.n=c),delete b[d.i];a._f=a._l=c,a[q]=0},"delete":function(a){var b=this,c=r(b,a);if(c){var d=c.n,e=c.p;delete b._i[c.i],c.r=!0,e&&(e.n=d),d&&(d.p=e),b._f==c&&(b._f=d),b._l==c&&(b._l=e),b[q]--}return!!c},forEach:function forEach(a){i(this,m,"forEach");for(var b,d=h(a,arguments.length>1?arguments[1]:c,3);b=b?b.n:this._f;)for(d(b.v,b.k,this);b&&b.r;)b=b.p},has:function has(a){return!!r(this,a)}}),o&&e(m.prototype,"size",{get:function(){return j(this[q])}}),m},def:function(a,b,d){var e,f,g=r(a,b);return g?g.v=d:(a._l=g={i:f=p(b,!0),k:b,v:d,p:e=a._l,n:c,r:!1},a._f||(a._f=g),e&&(e.n=g),a[q]++,"F"!==f&&(a._i[f]=g)),a},getEntry:r,setStrong:function(a,b,d){l(a,b,function(a,b){this._t=a,this._k=b,this._l=c},function(){for(var a=this,b=a._k,d=a._l;d&&d.r;)d=d.p;return a._t&&(a._l=d=d?d.n:a._t._f)?"keys"==b?m(0,d.k):"values"==b?m(0,d.v):m(0,[d.k,d.v]):(a._t=c,m(1))},d?"entries":"values",!d,!0),n(b)}}},function(a,b,d){var e=d(2),f=d(6),g=d(16),h=d(202),i=d(20),j=d(198),k=d(197),l=d(11),m=d(5),n=d(157),o=d(22),p=d(80);a.exports=function(a,b,d,q,r,s){var t=e[a],u=t,v=r?"set":"add",w=u&&u.prototype,x={},y=function(a){var b=w[a];g(w,a,"delete"==a?function(a){return!(s&&!l(a))&&b.call(this,0===a?0:a)}:"has"==a?function has(a){return!(s&&!l(a))&&b.call(this,0===a?0:a)}:"get"==a?function get(a){return s&&!l(a)?c:b.call(this,0===a?0:a)}:"add"==a?function add(a){return b.call(this,0===a?0:a),this}:function set(a,c){return b.call(this,0===a?0:a,c),this})};if("function"==typeof u&&(s||w.forEach&&!m(function(){(new u).entries().next()}))){var z=new u,A=z[v](s?{}:-0,1)!=z,B=m(function(){z.has(1)}),C=n(function(a){new u(a)}),D=!s&&m(function(){for(var a=new u,b=5;b--;)a[v](b,b);return!a.has(-0)});C||(u=b(function(b,d){k(b,u,a);var e=p(new t,b,u);return d!=c&&j(d,r,e[v],e),e}),u.prototype=w,w.constructor=u),(B||D)&&(y("delete"),y("has"),r&&y("get")),(D||A)&&y(v),s&&w.clear&&delete w.clear}else u=q.getConstructor(b,a,r,v),h(u.prototype,d),i.NEED=!0;return o(u,a),x[a]=u,f(f.G+f.W+f.F*(u!=t),x),s||q.setStrong(u,a,r),u}},function(a,b,d){var e=d(204);a.exports=d(205)("Set",function(a){return function Set(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a=0===a?0:a,a)}},e)},function(a,b,d){var e,f=d(164)(0),g=d(16),h=d(20),i=d(67),j=d(208),k=d(11),l=h.getWeak,m=Object.isExtensible,n=j.ufstore,o={},p=function(a){return function WeakMap(){return a(this,arguments.length>0?arguments[0]:c)}},q={get:function get(a){if(k(a)){var b=l(a);return b===!0?n(this).get(a):b?b[this._i]:c}},set:function set(a,b){return j.def(this,a,b)}},r=a.exports=d(205)("WeakMap",p,q,j,!0,!0);7!=(new r).set((Object.freeze||Object)(o),7).get(o)&&(e=j.getConstructor(p),i(e.prototype,q),h.NEED=!0,f(["delete","has","get","set"],function(a){var b=r.prototype,c=b[a];g(b,a,function(b,d){if(k(b)&&!m(b)){this._f||(this._f=new e);var f=this._f[a](b,d);return"set"==a?this:f}return c.call(this,b,d)})}))},function(a,b,d){var e=d(202),f=d(20).getWeak,g=d(10),h=d(11),i=d(197),j=d(198),k=d(164),l=d(3),m=k(5),n=k(6),o=0,p=function(a){return a._l||(a._l=new q)},q=function(){this.a=[]},r=function(a,b){return m(a.a,function(a){return a[0]===b})};q.prototype={get:function(a){var b=r(this,a);if(b)return b[1]},has:function(a){return!!r(this,a)},set:function(a,b){var c=r(this,a);c?c[1]=b:this.a.push([a,b])},"delete":function(a){var b=n(this.a,function(b){return b[0]===a});return~b&&this.a.splice(b,1),!!~b}},a.exports={getConstructor:function(a,b,d,g){var k=a(function(a,e){i(a,k,b,"_i"),a._i=o++,a._l=c,e!=c&&j(e,d,a[g],a)});return e(k.prototype,{"delete":function(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this)["delete"](a):b&&l(b,this._i)&&delete b[this._i]},has:function has(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this).has(a):b&&l(b,this._i)}}),k},def:function(a,b,c){var d=f(g(b),!0);return d===!0?p(a).set(b,c):d[a._i]=c,a},ufstore:p}},function(a,b,d){var e=d(208);d(205)("WeakSet",function(a){return function WeakSet(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a,!0)}},e,!1,!0)},function(a,b,c){var d=c(6),e=c(19),f=c(10),g=(c(2).Reflect||{}).apply,h=Function.apply;d(d.S+d.F*!c(5)(function(){g(function(){})}),"Reflect",{apply:function apply(a,b,c){var d=e(a),i=f(c);return g?g(d,b,i):h.call(d,b,i)}})},function(a,b,c){var d=c(6),e=c(44),f=c(19),g=c(10),h=c(11),i=c(5),j=c(75),k=(c(2).Reflect||{}).construct,l=i(function(){function F(){}return!(k(function(){},[],F)instanceof F)}),m=!i(function(){k(function(){})});d(d.S+d.F*(l||m),"Reflect",{construct:function construct(a,b){f(a),g(b);var c=arguments.length<3?a:f(arguments[2]);if(m&&!l)return k(a,b,c);if(a==c){switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3])}var d=[null];return d.push.apply(d,b),new(j.apply(a,d))}var i=c.prototype,n=e(h(i)?i:Object.prototype),o=Function.apply.call(a,n,b);return h(o)?o:n}})},function(a,b,c){var d=c(9),e=c(6),f=c(10),g=c(14);e(e.S+e.F*c(5)(function(){Reflect.defineProperty(d.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(a,b,c){f(a),b=g(b,!0),f(c);try{return d.f(a,b,c),!0}catch(e){return!1}}})},function(a,b,c){var d=c(6),e=c(49).f,f=c(10);d(d.S,"Reflect",{deleteProperty:function deleteProperty(a,b){var c=e(f(a),b);return!(c&&!c.configurable)&&delete a[b]}})},function(a,b,d){var e=d(6),f=d(10),g=function(a){this._t=f(a),this._i=0;var b,c=this._k=[];for(b in a)c.push(b)};d(136)(g,"Object",function(){var a,b=this,d=b._k;do if(b._i>=d.length)return{value:c,done:!0};while(!((a=d[b._i++])in b._t));return{value:a,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(a){return new g(a)}})},function(a,b,d){function get(a,b){var d,h,k=arguments.length<3?a:arguments[2];return j(a)===k?a[b]:(d=e.f(a,b))?g(d,"value")?d.value:d.get!==c?d.get.call(k):c:i(h=f(a))?get(h,b,k):void 0}var e=d(49),f=d(57),g=d(3),h=d(6),i=d(11),j=d(10);h(h.S,"Reflect",{get:get})},function(a,b,c){var d=c(49),e=c(6),f=c(10);e(e.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(a,b){return d.f(f(a),b)}})},function(a,b,c){var d=c(6),e=c(57),f=c(10);d(d.S,"Reflect",{getPrototypeOf:function getPrototypeOf(a){return e(f(a))}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{has:function has(a,b){return b in a}})},function(a,b,c){var d=c(6),e=c(10),f=Object.isExtensible;d(d.S,"Reflect",{isExtensible:function isExtensible(a){return e(a),!f||f(a)}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{ownKeys:c(221)})},function(a,b,c){var d=c(48),e=c(41),f=c(10),g=c(2).Reflect;a.exports=g&&g.ownKeys||function ownKeys(a){var b=d.f(f(a)),c=e.f;return c?b.concat(c(a)):b}},function(a,b,c){var d=c(6),e=c(10),f=Object.preventExtensions;d(d.S,"Reflect",{preventExtensions:function preventExtensions(a){e(a);try{return f&&f(a),!0}catch(b){return!1}}})},function(a,b,d){function set(a,b,d){var i,m,n=arguments.length<4?a:arguments[3],o=f.f(k(a),b);if(!o){if(l(m=g(a)))return set(m,b,d,n);o=j(0)}return h(o,"value")?!(o.writable===!1||!l(n))&&(i=f.f(n,b)||j(0),i.value=d,e.f(n,b,i),!0):o.set!==c&&(o.set.call(n,d),!0)}var e=d(9),f=d(49),g=d(57),h=d(3),i=d(6),j=d(15),k=d(10),l=d(11);i(i.S,"Reflect",{set:set})},function(a,b,c){var d=c(6),e=c(71);e&&d(d.S,"Reflect",{setPrototypeOf:function setPrototypeOf(a,b){e.check(a,b);try{return e.set(a,b),!0}catch(c){return!1}}})},function(a,b,c){var d=c(6);d(d.S,"Date",{now:function(){return(new Date).getTime()}})},function(a,b,c){var d=c(6),e=c(56),f=c(14);d(d.P+d.F*c(5)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(a){var b=e(this),c=f(b);return"number"!=typeof c||isFinite(c)?b.toISOString():null}})},function(a,b,c){var d=c(6),e=c(5),f=Date.prototype.getTime,g=function(a){return a>9?a:"0"+a};d(d.P+d.F*(e(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!e(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function toISOString(){if(!isFinite(f.call(this)))throw RangeError("Invalid time value");var a=this,b=a.getUTCFullYear(),c=a.getUTCMilliseconds(),d=b<0?"-":b>9999?"+":"";return d+("00000"+Math.abs(b)).slice(d?-6:-4)+"-"+g(a.getUTCMonth()+1)+"-"+g(a.getUTCDate())+"T"+g(a.getUTCHours())+":"+g(a.getUTCMinutes())+":"+g(a.getUTCSeconds())+"."+(c>99?c:"0"+g(c))+"Z"}})},function(a,b,c){var d=Date.prototype,e="Invalid Date",f="toString",g=d[f],h=d.getTime;new Date(NaN)+""!=e&&c(16)(d,f,function toString(){var a=h.call(this);return a===a?g.call(this):e})},function(a,b,c){var d=c(23)("toPrimitive"),e=Date.prototype;d in e||c(8)(e,d,c(230))},function(a,b,c){var d=c(10),e=c(14),f="number";a.exports=function(a){if("string"!==a&&a!==f&&"default"!==a)throw TypeError("Incorrect hint");return e(d(this),a!=f)}},function(a,b,d){var e=d(6),f=d(232),g=d(233),h=d(10),i=d(37),j=d(35),k=d(11),l=d(2).ArrayBuffer,m=d(199),n=g.ArrayBuffer,o=g.DataView,p=f.ABV&&l.isView,q=n.prototype.slice,r=f.VIEW,s="ArrayBuffer";e(e.G+e.W+e.F*(l!==n),{ArrayBuffer:n}),e(e.S+e.F*!f.CONSTR,s,{isView:function isView(a){return p&&p(a)||k(a)&&r in a}}),e(e.P+e.U+e.F*d(5)(function(){return!new n(2).slice(1,c).byteLength}),s,{slice:function slice(a,b){if(q!==c&&b===c)return q.call(h(this),a);for(var d=h(this).byteLength,e=i(a,d),f=i(b===c?d:b,d),g=new(m(this,n))(j(f-e)),k=new o(this),l=new o(g),p=0;e>1,k=23===b?E(2,-24)-E(2,-77):0,l=0,m=a<0||0===a&&1/a<0?1:0;for(a=D(a),a!=a||a===B?(e=a!=a?1:0,d=i):(d=F(G(a)/H),a*(f=E(2,-d))<1&&(d--,f*=2),a+=d+j>=1?k/f:k*E(2,1-j),a*f>=2&&(d++,f/=2),d+j>=i?(e=0,d=i):d+j>=1?(e=(a*f-1)*E(2,b),d+=j):(e=a*E(2,j-1)*E(2,b),d=0));b>=8;g[l++]=255&e,e/=256,b-=8);for(d=d<0;g[l++]=255&d,d/=256,h-=8);return g[--l]|=128*m,g},P=function(a,b,c){var d,e=8*c-b-1,f=(1<>1,h=e-7,i=c-1,j=a[i--],k=127&j;for(j>>=7;h>0;k=256*k+a[i],i--,h-=8);for(d=k&(1<<-h)-1,k>>=-h,h+=b;h>0;d=256*d+a[i],i--,h-=8);if(0===k)k=1-g;else{if(k===f)return d?NaN:j?-B:B;d+=E(2,b),k-=g}return(j?-1:1)*d*E(2,k-b)},Q=function(a){return a[3]<<24|a[2]<<16|a[1]<<8|a[0]},R=function(a){return[255&a]},S=function(a){return[255&a,a>>8&255]},T=function(a){return[255&a,a>>8&255,a>>16&255,a>>24&255]},U=function(a){return O(a,52,8)},V=function(a){return O(a,23,4)},W=function(a,b,c){p(a[u],b,{get:function(){return this[c]}})},X=function(a,b,c,d){var e=+c,f=m(e);if(e!=f||f<0||f+b>a[M])throw A(w);var g=a[L]._b,h=f+a[N],i=g.slice(h,h+b);return d?i:i.reverse()},Y=function(a,b,c,d,e,f){var g=+c,h=m(g);if(g!=h||h<0||h+b>a[M])throw A(w);for(var i=a[L]._b,j=h+a[N],k=d(+e),l=0;lba;)($=aa[ba++])in x||i(x,$,C[$]);g||(_.constructor=x)}var ca=new y(new x(2)),da=y[u].setInt8;ca.setInt8(0,2147483648),ca.setInt8(1,2147483649),!ca.getInt8(0)&&ca.getInt8(1)||j(y[u],{setInt8:function setInt8(a,b){da.call(this,a,b<<24>>24)},setUint8:function setUint8(a,b){da.call(this,a,b<<24>>24)}},!0)}else x=function ArrayBuffer(a){var b=Z(this,a);this._b=q.call(Array(b),0),this[M]=b},y=function DataView(a,b,d){l(this,y,t),l(a,x,t);var e=a[M],f=m(b);if(f<0||f>e)throw A("Wrong offset!");if(d=d===c?e-f:n(d),f+d>e)throw A(v);this[L]=a,this[N]=f,this[M]=d},f&&(W(x,J,"_l"),W(y,I,"_b"),W(y,J,"_l"),W(y,K,"_o")),j(y[u],{getInt8:function getInt8(a){return X(this,1,a)[0]<<24>>24},getUint8:function getUint8(a){return X(this,1,a)[0]},getInt16:function getInt16(a){var b=X(this,2,a,arguments[1]);return(b[1]<<8|b[0])<<16>>16},getUint16:function getUint16(a){var b=X(this,2,a,arguments[1]);return b[1]<<8|b[0]},getInt32:function getInt32(a){return Q(X(this,4,a,arguments[1]))},getUint32:function getUint32(a){return Q(X(this,4,a,arguments[1]))>>>0},getFloat32:function getFloat32(a){return P(X(this,4,a,arguments[1]),23,4)},getFloat64:function getFloat64(a){return P(X(this,8,a,arguments[1]),52,8)},setInt8:function setInt8(a,b){Y(this,1,a,R,b)},setUint8:function setUint8(a,b){Y(this,1,a,R,b)},setInt16:function setInt16(a,b){Y(this,2,a,S,b,arguments[2])},setUint16:function setUint16(a,b){Y(this,2,a,S,b,arguments[2])},setInt32:function setInt32(a,b){Y(this,4,a,T,b,arguments[2])},setUint32:function setUint32(a,b){Y(this,4,a,T,b,arguments[2])},setFloat32:function setFloat32(a,b){Y(this,4,a,V,b,arguments[2])},setFloat64:function setFloat64(a,b){Y(this,8,a,U,b,arguments[2])}});r(x,s),r(y,t),i(y[u],h.VIEW,!0),b[s]=x,b[t]=y},function(a,b,c){var d=c(6);d(d.G+d.W+d.F*!c(232).ABV,{DataView:c(233).DataView})},function(a,b,c){c(236)("Int8",1,function(a){return function Int8Array(b,c,d){return a(this,b,c,d)}})},function(a,b,d){if(d(4)){var e=d(26),f=d(2),g=d(5),h=d(6),i=d(232),j=d(233),k=d(18),l=d(197),m=d(15),n=d(8),o=d(202),p=d(36),q=d(35),r=d(37),s=d(14),t=d(3),u=d(69),v=d(73),w=d(11),x=d(56),y=d(154),z=d(44),A=d(57),B=d(48).f,C=d(156),D=d(17),E=d(23),F=d(164),G=d(34),H=d(199),I=d(183),J=d(135),K=d(157),L=d(186),M=d(180),N=d(177),O=d(9),P=d(49),Q=O.f,R=P.f,S=f.RangeError,T=f.TypeError,U=f.Uint8Array,V="ArrayBuffer",W="Shared"+V,X="BYTES_PER_ELEMENT",Y="prototype",Z=Array[Y],$=j.ArrayBuffer,_=j.DataView,aa=F(0),ba=F(2),ca=F(3),da=F(4),ea=F(5),fa=F(6),ga=G(!0),ha=G(!1),ia=I.values,ja=I.keys,ka=I.entries,la=Z.lastIndexOf,ma=Z.reduce,na=Z.reduceRight,oa=Z.join,pa=Z.sort,qa=Z.slice,ra=Z.toString,sa=Z.toLocaleString,ta=E("iterator"),ua=E("toStringTag"),va=D("typed_constructor"),wa=D("def_constructor"),xa=i.CONSTR,ya=i.TYPED,za=i.VIEW,Aa="Wrong length!",Ba=F(1,function(a,b){return Ha(H(a,a[wa]),b)}),Ca=g(function(){return 1===new U(new Uint16Array([1]).buffer)[0]}),Da=!!U&&!!U[Y].set&&g(function(){new U(1).set({})}),Ea=function(a,b){if(a===c)throw T(Aa);var d=+a,e=q(a);if(b&&!u(d,e))throw S(Aa);return e},Fa=function(a,b){var c=p(a);if(c<0||c%b)throw S("Wrong offset!");return c},Ga=function(a){if(w(a)&&ya in a)return a;throw T(a+" is not a typed array!")},Ha=function(a,b){if(!(w(a)&&va in a))throw T("It is not a typed array constructor!");return new a(b)},Ia=function(a,b){return Ja(H(a,a[wa]),b)},Ja=function(a,b){for(var c=0,d=b.length,e=Ha(a,d);d>c;)e[c]=b[c++];return e},Ka=function(a,b,c){Q(a,b,{get:function(){return this._d[c]}})},La=function from(a){var b,d,e,f,g,h,i=x(a),j=arguments.length,l=j>1?arguments[1]:c,m=l!==c,n=C(i);if(n!=c&&!y(n)){for(h=n.call(i),e=[],b=0;!(g=h.next()).done;b++)e.push(g.value);i=e}for(m&&j>2&&(l=k(l,arguments[2],2)),b=0,d=q(i.length),f=Ha(this,d);d>b;b++)f[b]=m?l(i[b],b):i[b];return f},Ma=function of(){for(var a=0,b=arguments.length,c=Ha(this,b);b>a;)c[a]=arguments[a++];return c},Na=!!U&&g(function(){sa.call(new U(1))}),Oa=function toLocaleString(){return sa.apply(Na?qa.call(Ga(this)):Ga(this),arguments)},Pa={copyWithin:function copyWithin(a,b){return N.call(Ga(this),a,b,arguments.length>2?arguments[2]:c)},every:function every(a){return da(Ga(this),a,arguments.length>1?arguments[1]:c)},fill:function fill(a){return M.apply(Ga(this),arguments)},filter:function filter(a){return Ia(this,ba(Ga(this),a,arguments.length>1?arguments[1]:c))},find:function find(a){return ea(Ga(this),a,arguments.length>1?arguments[1]:c)},findIndex:function findIndex(a){return fa(Ga(this),a,arguments.length>1?arguments[1]:c)},forEach:function forEach(a){aa(Ga(this),a,arguments.length>1?arguments[1]:c)},indexOf:function indexOf(a){return ha(Ga(this),a,arguments.length>1?arguments[1]:c)},includes:function includes(a){return ga(Ga(this),a,arguments.length>1?arguments[1]:c); +},join:function join(a){return oa.apply(Ga(this),arguments)},lastIndexOf:function lastIndexOf(a){return la.apply(Ga(this),arguments)},map:function map(a){return Ba(Ga(this),a,arguments.length>1?arguments[1]:c)},reduce:function reduce(a){return ma.apply(Ga(this),arguments)},reduceRight:function reduceRight(a){return na.apply(Ga(this),arguments)},reverse:function reverse(){for(var a,b=this,c=Ga(b).length,d=Math.floor(c/2),e=0;e1?arguments[1]:c)},sort:function sort(a){return pa.call(Ga(this),a)},subarray:function subarray(a,b){var d=Ga(this),e=d.length,f=r(a,e);return new(H(d,d[wa]))(d.buffer,d.byteOffset+f*d.BYTES_PER_ELEMENT,q((b===c?e:r(b,e))-f))}},Qa=function slice(a,b){return Ia(this,qa.call(Ga(this),a,b))},Ra=function set(a){Ga(this);var b=Fa(arguments[1],1),c=this.length,d=x(a),e=q(d.length),f=0;if(e+b>c)throw S(Aa);for(;f255?255:255&d),e.v[p](c*b+e.o,d,Ca)},E=function(a,b){Q(a,b,{get:function(){return C(this,b)},set:function(a){return D(this,b,a)},enumerable:!0})};u?(r=d(function(a,d,e,f){l(a,r,k,"_d");var g,h,i,j,m=0,o=0;if(w(d)){if(!(d instanceof $||(j=v(d))==V||j==W))return ya in d?Ja(r,d):La.call(r,d);g=d,o=Fa(e,b);var p=d.byteLength;if(f===c){if(p%b)throw S(Aa);if(h=p-o,h<0)throw S(Aa)}else if(h=q(f)*b,h+o>p)throw S(Aa);i=h/b}else i=Ea(d,!0),h=i*b,g=new $(h);for(n(a,"_d",{b:g,o:o,l:h,e:i,v:new _(g)});m1?arguments[1]:c)}}),d(178)("includes")},function(a,b,c){var d=c(6),e=c(125)(!0);d(d.P,"String",{at:function at(a){return e(this,a)}})},function(a,b,d){var e=d(6),f=d(248);e(e.P,"String",{padStart:function padStart(a){return f(this,a,arguments.length>1?arguments[1]:c,!0)}})},function(a,b,d){var e=d(35),f=d(85),g=d(33);a.exports=function(a,b,d,h){var i=String(g(a)),j=i.length,k=d===c?" ":String(d),l=e(b);if(l<=j||""==k)return i;var m=l-j,n=f.call(k,Math.ceil(m/k.length));return n.length>m&&(n=n.slice(0,m)),h?n+i:i+n}},function(a,b,d){var e=d(6),f=d(248);e(e.P,"String",{padEnd:function padEnd(a){return f(this,a,arguments.length>1?arguments[1]:c,!1)}})},function(a,b,c){c(81)("trimLeft",function(a){return function trimLeft(){return a(this,1)}},"trimStart")},function(a,b,c){c(81)("trimRight",function(a){return function trimRight(){return a(this,2)}},"trimEnd")},function(a,b,c){var d=c(6),e=c(33),f=c(35),g=c(128),h=c(188),i=RegExp.prototype,j=function(a,b){this._r=a,this._s=b};c(136)(j,"RegExp String",function next(){var a=this._r.exec(this._s);return{value:a,done:null===a}}),d(d.P,"String",{matchAll:function matchAll(a){if(e(this),!g(a))throw TypeError(a+" is not a regexp!");var b=String(this),c="flags"in i?String(a.flags):h.call(a),d=new RegExp(a.source,~c.indexOf("g")?c:"g"+c);return d.lastIndex=f(a.lastIndex),new j(d,b)}})},function(a,b,c){c(25)("asyncIterator")},function(a,b,c){c(25)("observable")},function(a,b,c){var d=c(6),e=c(221),f=c(30),g=c(49),h=c(155);d(d.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(a){for(var b,c=f(a),d=g.f,i=e(c),j={},k=0;i.length>k;)h(j,b=i[k++],d(c,b));return j}})},function(a,b,c){var d=c(6),e=c(257)(!1);d(d.S,"Object",{values:function values(a){return e(a)}})},function(a,b,c){var d=c(28),e=c(30),f=c(42).f;a.exports=function(a){return function(b){for(var c,g=e(b),h=d(g),i=h.length,j=0,k=[];i>j;)f.call(g,c=h[j++])&&k.push(a?[c,g[c]]:g[c]);return k}}},function(a,b,c){var d=c(6),e=c(257)(!0);d(d.S,"Object",{entries:function entries(a){return e(a)}})},function(a,b,c){var d=c(6),e=c(56),f=c(19),g=c(9);c(4)&&d(d.P+c(260),"Object",{__defineGetter__:function __defineGetter__(a,b){g.f(e(this),a,{get:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){a.exports=c(26)||!c(5)(function(){var a=Math.random();__defineSetter__.call(null,a,function(){}),delete c(2)[a]})},function(a,b,c){var d=c(6),e=c(56),f=c(19),g=c(9);c(4)&&d(d.P+c(260),"Object",{__defineSetter__:function __defineSetter__(a,b){g.f(e(this),a,{set:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){var d=c(6),e=c(56),f=c(14),g=c(57),h=c(49).f;c(4)&&d(d.P+c(260),"Object",{__lookupGetter__:function __lookupGetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.get;while(c=g(c))}})},function(a,b,c){var d=c(6),e=c(56),f=c(14),g=c(57),h=c(49).f;c(4)&&d(d.P+c(260),"Object",{__lookupSetter__:function __lookupSetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.set;while(c=g(c))}})},function(a,b,c){var d=c(6);d(d.P+d.R,"Map",{toJSON:c(265)("Map")})},function(a,b,c){var d=c(73),e=c(266);a.exports=function(a){return function toJSON(){if(d(this)!=a)throw TypeError(a+"#toJSON isn't generic");return e(this)}}},function(a,b,c){var d=c(198);a.exports=function(a,b){var c=[];return d(a,!1,c.push,c,b),c}},function(a,b,c){var d=c(6);d(d.P+d.R,"Set",{toJSON:c(265)("Set")})},function(a,b,c){var d=c(6);d(d.S,"System",{global:c(2)})},function(a,b,c){var d=c(6),e=c(32);d(d.S,"Error",{isError:function isError(a){return"Error"===e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{iaddh:function iaddh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f+(d>>>0)+((e&g|(e|g)&~(e+g>>>0))>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{isubh:function isubh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f-(d>>>0)-((~e&g|~(e^g)&e-g>>>0)>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{imulh:function imulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>16,i=e>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>16)+((f*i>>>0)+(j&c)>>16)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{umulh:function umulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>>16,i=e>>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>>16)+((f*i>>>0)+(j&c)>>>16)}})},function(a,b,c){var d=c(275),e=c(10),f=d.key,g=d.set;d.exp({defineMetadata:function defineMetadata(a,b,c,d){g(a,b,e(c),f(d))}})},function(a,b,d){var e=d(203),f=d(6),g=d(21)("metadata"),h=g.store||(g.store=new(d(207))),i=function(a,b,d){var f=h.get(a);if(!f){if(!d)return c;h.set(a,f=new e)}var g=f.get(b);if(!g){if(!d)return c;f.set(b,g=new e)}return g},j=function(a,b,d){var e=i(b,d,!1);return e!==c&&e.has(a)},k=function(a,b,d){var e=i(b,d,!1);return e===c?c:e.get(a)},l=function(a,b,c,d){i(c,d,!0).set(a,b)},m=function(a,b){var c=i(a,b,!1),d=[];return c&&c.forEach(function(a,b){d.push(b)}),d},n=function(a){return a===c||"symbol"==typeof a?a:String(a)},o=function(a){f(f.S,"Reflect",a)};a.exports={store:h,map:i,has:j,get:k,set:l,keys:m,key:n,exp:o}},function(a,b,d){var e=d(275),f=d(10),g=e.key,h=e.map,i=e.store;e.exp({deleteMetadata:function deleteMetadata(a,b){var d=arguments.length<3?c:g(arguments[2]),e=h(f(b),d,!1);if(e===c||!e["delete"](a))return!1;if(e.size)return!0;var j=i.get(b);return j["delete"](d),!!j.size||i["delete"](b)}})},function(a,b,d){var e=d(275),f=d(10),g=d(57),h=e.has,i=e.get,j=e.key,k=function(a,b,d){var e=h(a,b,d);if(e)return i(a,b,d);var f=g(b);return null!==f?k(a,f,d):c};e.exp({getMetadata:function getMetadata(a,b){return k(a,f(b),arguments.length<3?c:j(arguments[2]))}})},function(a,b,d){var e=d(206),f=d(266),g=d(275),h=d(10),i=d(57),j=g.keys,k=g.key,l=function(a,b){var c=j(a,b),d=i(a);if(null===d)return c;var g=l(d,b);return g.length?c.length?f(new e(c.concat(g))):g:c};g.exp({getMetadataKeys:function getMetadataKeys(a){return l(h(a),arguments.length<2?c:k(arguments[1]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.get,h=e.key;e.exp({getOwnMetadata:function getOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.keys,h=e.key;e.exp({getOwnMetadataKeys:function getOwnMetadataKeys(a){return g(f(a),arguments.length<2?c:h(arguments[1]))}})},function(a,b,d){var e=d(275),f=d(10),g=d(57),h=e.has,i=e.key,j=function(a,b,c){var d=h(a,b,c);if(d)return!0;var e=g(b);return null!==e&&j(a,e,c)};e.exp({hasMetadata:function hasMetadata(a,b){return j(a,f(b),arguments.length<3?c:i(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.has,h=e.key;e.exp({hasOwnMetadata:function hasOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=d(19),h=e.key,i=e.set;e.exp({metadata:function metadata(a,b){return function decorator(d,e){i(a,b,(e!==c?f:g)(d),h(e))}}})},function(a,b,c){var d=c(6),e=c(201)(),f=c(2).process,g="process"==c(32)(f);d(d.G,{asap:function asap(a){var b=g&&f.domain;e(b?b.bind(a):a)}})},function(a,b,d){var e=d(6),f=d(2),g=d(7),h=d(201)(),i=d(23)("observable"),j=d(19),k=d(10),l=d(197),m=d(202),n=d(8),o=d(198),p=o.RETURN,q=function(a){return null==a?c:j(a)},r=function(a){var b=a._c;b&&(a._c=c,b())},s=function(a){return a._o===c},t=function(a){s(a)||(a._o=c,r(a))},u=function(a,b){k(a),this._c=c,this._o=a,a=new v(this);try{var d=b(a),e=d;null!=d&&("function"==typeof d.unsubscribe?d=function(){e.unsubscribe()}:j(d),this._c=d)}catch(f){return void a.error(f)}s(this)&&r(this)};u.prototype=m({},{unsubscribe:function unsubscribe(){t(this)}});var v=function(a){this._s=a};v.prototype=m({},{next:function next(a){var b=this._s;if(!s(b)){var c=b._o;try{var d=q(c.next);if(d)return d.call(c,a)}catch(e){try{t(b)}finally{throw e}}}},error:function error(a){var b=this._s;if(s(b))throw a;var d=b._o;b._o=c;try{var e=q(d.error);if(!e)throw a;a=e.call(d,a)}catch(f){try{r(b)}finally{throw f}}return r(b),a},complete:function complete(a){var b=this._s;if(!s(b)){var d=b._o;b._o=c;try{var e=q(d.complete);a=e?e.call(d,a):c}catch(f){try{r(b)}finally{throw f}}return r(b),a}}});var w=function Observable(a){l(this,w,"Observable","_f")._f=j(a)};m(w.prototype,{subscribe:function subscribe(a){return new u(a,this._f)},forEach:function forEach(a){var b=this;return new(g.Promise||f.Promise)(function(c,d){j(a);var e=b.subscribe({next:function(b){try{return a(b)}catch(c){d(c),e.unsubscribe()}},error:d,complete:c})})}}),m(w,{from:function from(a){var b="function"==typeof this?this:w,c=q(k(a)[i]);if(c){var d=k(c.call(a));return d.constructor===b?d:new b(function(a){return d.subscribe(a)})}return new b(function(b){var c=!1;return h(function(){if(!c){try{if(o(a,!1,function(a){if(b.next(a),c)return p})===p)return}catch(d){if(c)throw d;return void b.error(d)}b.complete()}}),function(){c=!0}})},of:function of(){for(var a=0,b=arguments.length,c=Array(b);ag;)(c[g]=arguments[g++])===h&&(i=!0);return function(){var d,f=this,g=arguments.length,j=0,k=0;if(!i&&!g)return e(a,c,f);if(d=c.slice(),i)for(;b>j;j++)d[j]===h&&(d[j]=arguments[k++]);for(;g>k;)d.push(arguments[k++]);return e(a,d,f)}}},function(a,b,c){a.exports=c(2)},function(a,b,d){function Dict(a){var b=i(null);return a!=c&&(p(a)?o(a,!0,function(a,c){b[a]=c}):h(b,a)),b}function reduce(a,b,c){n(b);var d,e,f=t(a),g=k(f),h=g.length,i=0;if(arguments.length<3){if(!h)throw TypeError("Reduce of empty object with no initial value");d=f[g[i++]]}else d=Object(c);for(;h>i;)v(f,e=g[i++])&&(d=b(d,f[e],e,a));return d}function includes(a,b){return(b==b?m(a,b):x(a,function(a){return a!=a}))!==c}function get(a,b){if(v(a,b))return a[b]}function set(a,b,c){return u&&b in Object?l.f(a,b,g(0,c)):a[b]=c,a}function isDict(a){return s(a)&&j(a)===Dict.prototype}var e=d(18),f=d(6),g=d(15),h=d(67),i=d(44),j=d(57),k=d(28),l=d(9),m=d(27),n=d(19),o=d(198),p=d(292),q=d(136),r=d(184),s=d(11),t=d(30),u=d(4),v=d(3),w=function(a){var b=1==a,d=4==a;return function(f,g,h){var i,j,k,l=e(g,h,3),m=t(f),n=b||7==a||2==a?new("function"==typeof this?this:Dict):c;for(i in m)if(v(m,i)&&(j=m[i],k=l(j,i,f),a))if(b)n[i]=k;else if(k)switch(a){case 2:n[i]=j;break;case 3:return!0;case 5:return j;case 6:return i;case 7:n[k[0]]=k[1]}else if(d)return!1;return 3==a||d?d:n}},x=w(6),y=function(a){return function(b){return new z(b,a)}},z=function(a,b){this._t=t(a),this._a=k(a),this._i=0,this._k=b};q(z,"Dict",function(){var a,b=this,d=b._t,e=b._a,f=b._k;do if(b._i>=e.length)return b._t=c,r(1);while(!v(d,a=e[b._i++]));return"keys"==f?r(0,a):"values"==f?r(0,d[a]):r(0,[a,d[a]])}),Dict.prototype=null,f(f.G+f.F,{Dict:Dict}),f(f.S,"Dict",{keys:y("keys"),values:y("values"),entries:y("entries"),forEach:w(0),map:w(1),filter:w(2),some:w(3),every:w(4),find:w(5),findKey:x,mapPairs:w(7),reduce:reduce,keyOf:m,includes:includes,has:v,get:get,set:set,isDict:isDict})},function(a,b,d){var e=d(73),f=d(23)("iterator"),g=d(135);a.exports=d(7).isIterable=function(a){var b=Object(a);return b[f]!==c||"@@iterator"in b||g.hasOwnProperty(e(b))}},function(a,b,c){var d=c(10),e=c(156);a.exports=c(7).getIterator=function(a){var b=e(a);if("function"!=typeof b)throw TypeError(a+" is not iterable!");return d(b.call(a))}},function(a,b,c){var d=c(2),e=c(7),f=c(6),g=c(289);f(f.G+f.F,{delay:function delay(a){return new(e.Promise||d.Promise)(function(b){setTimeout(g.call(b,!0),a)})}})},function(a,b,c){var d=c(290),e=c(6);c(7)._=d._=d._||{},e(e.P+e.F,"Function",{part:c(289)})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{isObject:c(11)})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{classof:c(73)})},function(a,b,c){var d=c(6),e=c(299);d(d.S+d.F,"Object",{define:e})},function(a,b,c){var d=c(9),e=c(49),f=c(221),g=c(30);a.exports=function define(a,b){for(var c,h=f(g(b)),i=h.length,j=0;i>j;)d.f(a,c=h[j++],e.f(b,c));return a}},function(a,b,c){var d=c(6),e=c(299),f=c(44);d(d.S+d.F,"Object",{make:function(a,b){return e(f(a),b)}})},function(a,b,d){d(134)(Number,"Number",function(a){this._l=+a,this._i=0},function(){var a=this._i++,b=!(a"']/g,{"&":"&","<":"<",">":">",'"':""","'":"'"});d(d.P+d.F,"String",{escapeHTML:function escapeHTML(){return e(this)}})},function(a,b,c){var d=c(6),e=c(303)(/&(?:amp|lt|gt|quot|apos);/g,{"&":"&","<":"<",">":">",""":'"',"'":"'"});d(d.P+d.F,"String",{unescapeHTML:function unescapeHTML(){return e(this)}})}]),"undefined"!=typeof module&&module.exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):b.core=a}(1,1); +//# sourceMappingURL=core.min.js.map \ No newline at end of file diff --git a/node_modules/core-js/client/core.min.js.map b/node_modules/core-js/client/core.min.js.map new file mode 100755 index 00000000..bc3ffc58 --- /dev/null +++ b/node_modules/core-js/client/core.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["core.js"],"names":["__e","__g","undefined","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","global","has","DESCRIPTORS","$export","redefine","META","KEY","$fails","shared","setToStringTag","uid","wks","wksExt","wksDefine","keyOf","enumKeys","isArray","anObject","toIObject","toPrimitive","createDesc","_create","gOPNExt","$GOPD","$DP","$keys","gOPD","f","dP","gOPN","$Symbol","Symbol","$JSON","JSON","_stringify","stringify","PROTOTYPE","HIDDEN","TO_PRIMITIVE","isEnum","propertyIsEnumerable","SymbolRegistry","AllSymbols","OPSymbols","ObjectProto","Object","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","get","this","value","a","it","key","D","protoDesc","wrap","tag","sym","_k","isSymbol","iterator","$defineProperty","defineProperty","enumerable","$defineProperties","defineProperties","P","keys","i","l","length","$create","create","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","getOwnPropertyDescriptor","$getOwnPropertyNames","getOwnPropertyNames","names","result","push","$getOwnPropertySymbols","getOwnPropertySymbols","IS_OP","TypeError","arguments","$set","configurable","set","toString","name","G","W","F","symbols","split","store","S","for","keyFor","useSetter","useSimple","replacer","$replacer","args","apply","valueOf","Math","window","self","Function","hasOwnProperty","exec","e","core","hide","ctx","type","source","own","out","exp","IS_FORCED","IS_GLOBAL","IS_STATIC","IS_PROTO","IS_BIND","B","target","expProto","U","R","version","object","IE8_DOM_DEFINE","O","Attributes","isObject","document","is","createElement","fn","val","bitmap","writable","SRC","TO_STRING","$toString","TPL","inspectSource","safe","isFunction","join","String","prototype","px","random","concat","aFunction","that","b","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","fastKey","getWeak","onFreeze","meta","NEED","SHARED","def","TAG","stat","USE_SYMBOL","$exports","LIBRARY","charAt","getKeys","el","index","enumBugKeys","arrayIndexOf","IE_PROTO","IObject","defined","cof","slice","toLength","toIndex","IS_INCLUDES","$this","fromIndex","toInteger","min","ceil","floor","isNaN","max","gOPS","pIE","getSymbols","Array","arg","dPs","Empty","createDict","iframeDocument","iframe","lt","gt","style","display","appendChild","src","contentWindow","open","write","close","Properties","documentElement","windowNames","getWindowNames","hiddenKeys","fails","toObject","$getPrototypeOf","getPrototypeOf","constructor","$freeze","freeze","$seal","seal","$preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","assign","$assign","A","K","forEach","k","T","aLen","j","x","y","setPrototypeOf","check","proto","test","buggy","__proto__","classof","ARG","tryGet","callee","bind","invoke","arraySlice","factories","construct","len","n","partArgs","bound","un","FProto","nameRE","NAME","match","HAS_INSTANCE","FunctionProto","inheritIfRequired","$trim","trim","NUMBER","$Number","Base","BROKEN_COF","TRIM","toNumber","argument","third","radix","maxCode","first","charCodeAt","NaN","code","digits","parseInt","Number","C","spaces","space","non","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","string","TYPE","replace","aNumberValue","repeat","$toFixed","toFixed","data","ERROR","ZERO","multiply","c2","divide","numToString","s","t","pow","acc","log","x2","fractionDigits","z","RangeError","msg","count","str","res","Infinity","$toPrecision","toPrecision","precision","EPSILON","_isFinite","isFinite","isInteger","number","abs","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","$parseFloat","parseFloat","$parseInt","ws","hex","log1p","sqrt","$acosh","acosh","MAX_VALUE","LN2","asinh","$asinh","$atanh","atanh","sign","cbrt","clz32","LOG2E","cosh","$expm1","expm1","EPSILON32","MAX32","MIN32","roundTiesToEven","fround","$abs","$sign","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LN10","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","raw","callSite","tpl","$at","codePointAt","pos","context","ENDS_WITH","$endsWith","endsWith","searchString","endPosition","end","search","isRegExp","MATCH","re","INCLUDES","includes","indexOf","STARTS_WITH","$startsWith","startsWith","iterated","_t","_i","point","done","Iterators","$iterCreate","ITERATOR","BUGGY","FF_ITERATOR","KEYS","VALUES","returnThis","Constructor","next","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","kind","values","entries","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","descriptor","createHTML","anchor","quot","attribute","p1","toLowerCase","big","blink","bold","fixed","fontcolor","color","fontsize","size","italics","link","url","small","strike","sub","sup","isArrayIter","createProperty","getIterFn","iter","from","arrayLike","step","mapfn","mapping","iterFn","ret","ArrayProto","getIteratorMethod","SAFE_CLOSING","riter","skipClosing","arr","of","arrayJoin","separator","method","html","begin","klass","start","upTo","cloned","$sort","sort","comparefn","$forEach","STRICT","callbackfn","asc","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","speciesConstructor","original","SPECIES","$map","map","$filter","filter","$some","some","$every","every","$reduce","reduce","memo","isRight","reduceRight","$indexOf","NEGATIVE_ZERO","searchElement","lastIndexOf","copyWithin","to","inc","UNSCOPABLES","fill","endPos","$find","forced","find","findIndex","addToUnscopables","Arguments","$flags","$RegExp","re1","re2","CORRECT_NEW","tiRE","piRE","fiU","proxy","ignoreCase","multiline","unicode","sticky","define","flags","$match","regexp","SYMBOL","fns","strfn","rxfn","REPLACE","$replace","searchValue","replaceValue","SEARCH","$search","SPLIT","$split","_split","$push","$SPLIT","LENGTH","LAST_INDEX","NPCG","limit","separator2","lastIndex","lastLength","output","lastLastIndex","splitLimit","separatorCopy","Internal","GenericPromiseCapability","Wrapper","anInstance","forOf","task","microtask","PROMISE","process","$Promise","isNode","empty","promise","resolve","FakePromise","PromiseRejectionEvent","then","sameConstructor","isThenable","newPromiseCapability","PromiseCapability","reject","$$resolve","$$reject","perform","error","notify","isReject","_n","chain","_c","_v","ok","_s","run","reaction","handler","fail","domain","_h","onHandleUnhandled","enter","exit","onUnhandled","abrupt","console","isUnhandled","emit","onunhandledrejection","reason","_a","onrejectionhandled","$reject","_d","_w","$resolve","wrapper","Promise","executor","err","onFulfilled","onRejected","catch","r","capability","all","iterable","remaining","$index","alreadyCalled","race","forbiddenField","BREAK","RETURN","defer","channel","port","cel","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","counter","queue","ONREADYSTATECHANGE","listener","event","nextTick","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","setTimeout","clear","macrotask","Observer","MutationObserver","WebKitMutationObserver","head","last","flush","parent","toggle","node","createTextNode","observe","characterData","strong","Map","entry","getEntry","v","redefineAll","$iterDefine","setSpecies","SIZE","_f","getConstructor","ADDER","_l","delete","prev","setStrong","$iterDetect","common","IS_WEAK","fixMethod","add","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","Set","InternalMap","each","weak","uncaughtFrozenStore","ufstore","tmp","WeakMap","$WeakMap","createArrayMethod","$has","arrayFind","arrayFindIndex","UncaughtFrozenStore","findUncaughtFrozen","splice","WeakSet","rApply","Reflect","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","propertyKey","attributes","deleteProperty","desc","Enumerate","enumerate","receiver","getProto","ownKeys","V","existingDescriptor","ownDesc","setProto","now","Date","getTime","toJSON","toISOString","pv","lz","num","d","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","DateProto","INVALID_DATE","hint","$typed","buffer","ArrayBuffer","$ArrayBuffer","$DataView","DataView","$isView","ABV","isView","$slice","VIEW","ARRAY_BUFFER","CONSTR","byteLength","final","viewS","viewT","setUint8","getUint8","Typed","TYPED","TypedArrayConstructors","arrayFill","DATA_VIEW","WRONG_LENGTH","WRONG_INDEX","BaseBuffer","BUFFER","BYTE_LENGTH","BYTE_OFFSET","$BUFFER","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","unpackIEEE754","nBits","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","addGetter","internal","view","isLittleEndian","numIndex","intIndex","_b","pack","reverse","conversion","validateArrayBufferArguments","numberLength","ArrayBufferProto","$setInt8","setInt8","getInt8","byteOffset","bufferLength","offset","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","init","Int8Array","$buffer","propertyDesc","same","createArrayIncludes","ArrayIterators","arrayCopyWithin","Uint8Array","SHARED_BUFFER","BYTES_PER_ELEMENT","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayIncludes","arrayValues","arrayKeys","arrayEntries","arrayLastIndexOf","arrayReduce","arrayReduceRight","arraySort","arrayToString","arrayToLocaleString","toLocaleString","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","TYPED_ARRAY","allocate","LITTLE_ENDIAN","Uint16Array","FORCED_SET","strictToLength","SAME","toOffset","BYTES","validate","speciesFromList","list","fromList","$from","$of","TO_LOCALE_BUG","$toLocaleString","predicate","middle","subarray","$begin","$iterators","isTAIndex","$getDesc","$setDesc","$TypedArrayPrototype$","CLAMPED","ISNT_UINT8","GETTER","SETTER","TypedArray","TAC","TypedArrayPrototype","getter","o","round","addElement","$offset","$length","$len","$nativeIterator","CORRECT_ITER_NAME","$iterator","Uint8ClampedArray","Int16Array","Int32Array","Uint32Array","Float32Array","Float64Array","$includes","at","$pad","padStart","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padEnd","trimLeft","trimRight","getFlags","RegExpProto","$RegExpStringIterator","_r","matchAll","rx","getOwnPropertyDescriptors","getDesc","$values","isEntries","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","isError","iaddh","x0","x1","y0","y1","$x0","$x1","$y0","isubh","imulh","u","$u","$v","u0","v0","u1","v1","umulh","metadata","toMetaKey","ordinaryDefineOwnMetadata","defineMetadata","metadataKey","metadataValue","targetKey","getOrCreateMetadataMap","targetMetadata","keyMetadata","ordinaryHasOwnMetadata","MetadataKey","metadataMap","ordinaryGetOwnMetadata","MetadataValue","ordinaryOwnMetadataKeys","_","deleteMetadata","ordinaryGetMetadata","hasOwn","getMetadata","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","decorator","asap","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","Observable","subscribe","observable","items","$task","TO_STRING_TAG","ArrayValues","collections","Collection","partial","navigator","MSIE","userAgent","time","setInterval","path","pargs","holder","Dict","dict","isIterable","findKey","isDict","createDictMethod","createDictIter","DictIterator","mapPairs","getIterator","delay","part","mixin","make","$re","escape","regExp","&","<",">","\"","'","escapeHTML","&","<",">",""","'","unescapeHTML","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,GACpB,cACS,SAAUC,GAKT,QAASC,qBAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUE,OAGnC,IAAIC,GAASF,EAAiBD,IAC7BE,WACAE,GAAIJ,EACJK,QAAQ,EAUT,OANAP,GAAQE,GAAUM,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASH,qBAG/DI,EAAOE,QAAS,EAGTF,EAAOD,QAvBf,GAAID,KAqCJ,OATAF,qBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAIP,EAGxBF,oBAAoBU,EAAI,GAGjBV,oBAAoB,KAK/B,SAASI,EAAQD,EAASH,GAE/BA,EAAoB,GACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBI,EAAOD,QAAUH,EAAoB,MAKhC,SAASI,EAAQD,EAASH,GAI/B,GAAIW,GAAiBX,EAAoB,GACrCY,EAAiBZ,EAAoB,GACrCa,EAAiBb,EAAoB,GACrCc,EAAiBd,EAAoB,GACrCe,EAAiBf,EAAoB,IACrCgB,EAAiBhB,EAAoB,IAAIiB,IACzCC,EAAiBlB,EAAoB,GACrCmB,EAAiBnB,EAAoB,IACrCoB,EAAiBpB,EAAoB,IACrCqB,EAAiBrB,EAAoB,IACrCsB,EAAiBtB,EAAoB,IACrCuB,EAAiBvB,EAAoB,IACrCwB,EAAiBxB,EAAoB,IACrCyB,EAAiBzB,EAAoB,IACrC0B,EAAiB1B,EAAoB,IACrC2B,EAAiB3B,EAAoB,IACrC4B,EAAiB5B,EAAoB,IACrC6B,EAAiB7B,EAAoB,IACrC8B,EAAiB9B,EAAoB,IACrC+B,EAAiB/B,EAAoB,IACrCgC,EAAiBhC,EAAoB,IACrCiC,EAAiBjC,EAAoB,IACrCkC,EAAiBlC,EAAoB,IACrCmC,EAAiBnC,EAAoB,GACrCoC,EAAiBpC,EAAoB,IACrCqC,EAAiBH,EAAMI,EACvBC,EAAiBJ,EAAIG,EACrBE,EAAiBP,EAAQK,EACzBG,EAAiB9B,EAAO+B,OACxBC,EAAiBhC,EAAOiC,KACxBC,EAAiBF,GAASA,EAAMG,UAChCC,EAAiB,YACjBC,EAAiB1B,EAAI,WACrB2B,EAAiB3B,EAAI,eACrB4B,KAAoBC,qBACpBC,EAAiBjC,EAAO,mBACxBkC,EAAiBlC,EAAO,WACxBmC,EAAiBnC,EAAO,cACxBoC,EAAiBC,OAAOT,GACxBU,EAAmC,kBAAXhB,GACxBiB,EAAiB/C,EAAO+C,QAExBC,GAAUD,IAAYA,EAAQX,KAAeW,EAAQX,GAAWa,UAGhEC,EAAgBhD,GAAeK,EAAO,WACxC,MAES,IAFFc,EAAQO,KAAO,KACpBuB,IAAK,WAAY,MAAOvB,GAAGwB,KAAM,KAAMC,MAAO,IAAIC,MAChDA,IACD,SAASC,EAAIC,EAAKC,GACrB,GAAIC,GAAYhC,EAAKkB,EAAaY,EAC/BE,UAAiBd,GAAYY,GAChC5B,EAAG2B,EAAIC,EAAKC,GACTC,GAAaH,IAAOX,GAAYhB,EAAGgB,EAAaY,EAAKE,IACtD9B,EAEA+B,EAAO,SAASC,GAClB,GAAIC,GAAMnB,EAAWkB,GAAOvC,EAAQS,EAAQM,GAE5C,OADAyB,GAAIC,GAAKF,EACFC,GAGLE,EAAWjB,GAAyC,gBAApBhB,GAAQkC,SAAuB,SAAST,GAC1E,MAAoB,gBAANA,IACZ,SAASA,GACX,MAAOA,aAAczB,IAGnBmC,EAAkB,QAASC,gBAAeX,EAAIC,EAAKC,GAKrD,MAJGF,KAAOX,GAAYqB,EAAgBtB,EAAWa,EAAKC,GACtDxC,EAASsC,GACTC,EAAMrC,EAAYqC,GAAK,GACvBvC,EAASwC,GACNxD,EAAIyC,EAAYc,IACbC,EAAEU,YAIDlE,EAAIsD,EAAIlB,IAAWkB,EAAGlB,GAAQmB,KAAKD,EAAGlB,GAAQmB,IAAO,GACxDC,EAAIpC,EAAQoC,GAAIU,WAAY/C,EAAW,GAAG,OAJtCnB,EAAIsD,EAAIlB,IAAQT,EAAG2B,EAAIlB,EAAQjB,EAAW,OAC9CmC,EAAGlB,GAAQmB,IAAO,GAIXN,EAAcK,EAAIC,EAAKC,IACzB7B,EAAG2B,EAAIC,EAAKC,IAEnBW,EAAoB,QAASC,kBAAiBd,EAAIe,GACpDrD,EAASsC,EAKT,KAJA,GAGIC,GAHAe,EAAOxD,EAASuD,EAAIpD,EAAUoD,IAC9BE,EAAO,EACPC,EAAIF,EAAKG,OAEPD,EAAID,GAAEP,EAAgBV,EAAIC,EAAMe,EAAKC,KAAMF,EAAEd,GACnD,OAAOD,IAELoB,EAAU,QAASC,QAAOrB,EAAIe,GAChC,MAAOA,KAAMnF,EAAYkC,EAAQkC,GAAMa,EAAkB/C,EAAQkC,GAAKe,IAEpEO,EAAwB,QAASrC,sBAAqBgB,GACxD,GAAIsB,GAAIvC,EAAO3C,KAAKwD,KAAMI,EAAMrC,EAAYqC,GAAK,GACjD,SAAGJ,OAASR,GAAe3C,EAAIyC,EAAYc,KAASvD,EAAI0C,EAAWa,QAC5DsB,IAAM7E,EAAImD,KAAMI,KAASvD,EAAIyC,EAAYc,IAAQvD,EAAImD,KAAMf,IAAWe,KAAKf,GAAQmB,KAAOsB,IAE/FC,EAA4B,QAASC,0BAAyBzB,EAAIC,GAGpE,GAFAD,EAAMrC,EAAUqC,GAChBC,EAAMrC,EAAYqC,GAAK,GACpBD,IAAOX,IAAe3C,EAAIyC,EAAYc,IAASvD,EAAI0C,EAAWa,GAAjE,CACA,GAAIC,GAAI/B,EAAK6B,EAAIC,EAEjB,QADGC,IAAKxD,EAAIyC,EAAYc,IAAUvD,EAAIsD,EAAIlB,IAAWkB,EAAGlB,GAAQmB,KAAMC,EAAEU,YAAa,GAC9EV,IAELwB,GAAuB,QAASC,qBAAoB3B,GAKtD,IAJA,GAGIC,GAHA2B,EAAStD,EAAKX,EAAUqC,IACxB6B,KACAZ,EAAS,EAEPW,EAAMT,OAASF,GACfvE,EAAIyC,EAAYc,EAAM2B,EAAMX,OAAShB,GAAOnB,GAAUmB,GAAOnD,GAAK+E,EAAOC,KAAK7B,EAClF,OAAO4B,IAEPE,GAAyB,QAASC,uBAAsBhC,GAM1D,IALA,GAIIC,GAJAgC,EAASjC,IAAOX,EAChBuC,EAAStD,EAAK2D,EAAQ7C,EAAYzB,EAAUqC,IAC5C6B,KACAZ,EAAS,EAEPW,EAAMT,OAASF,IAChBvE,EAAIyC,EAAYc,EAAM2B,EAAMX,OAAUgB,IAAQvF,EAAI2C,EAAaY,IAAa4B,EAAOC,KAAK3C,EAAWc,GACtG,OAAO4B,GAIPtC,KACFhB,EAAU,QAASC,UACjB,GAAGqB,eAAgBtB,GAAQ,KAAM2D,WAAU,+BAC3C,IAAI7B,GAAMlD,EAAIgF,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,GAChDwG,EAAO,SAAStC,GACfD,OAASR,GAAY+C,EAAK/F,KAAK+C,EAAWU,GAC1CpD,EAAImD,KAAMf,IAAWpC,EAAImD,KAAKf,GAASuB,KAAKR,KAAKf,GAAQuB,IAAO,GACnEV,EAAcE,KAAMQ,EAAKxC,EAAW,EAAGiC,IAGzC,OADGnD,IAAe8C,GAAOE,EAAcN,EAAagB,GAAMgC,cAAc,EAAMC,IAAKF,IAC5EhC,EAAKC,IAEdxD,EAAS0B,EAAQM,GAAY,WAAY,QAAS0D,YAChD,MAAO1C,MAAKU,KAGdvC,EAAMI,EAAIoD,EACVvD,EAAIG,EAAMsC,EACV5E,EAAoB,IAAIsC,EAAIL,EAAQK,EAAIsD,GACxC5F,EAAoB,IAAIsC,EAAKkD,EAC7BxF,EAAoB,IAAIsC,EAAI2D,GAEzBpF,IAAgBb,EAAoB,KACrCe,EAASwC,EAAa,uBAAwBiC,GAAuB,GAGvEjE,EAAOe,EAAI,SAASoE,GAClB,MAAOpC,GAAKhD,EAAIoF,MAIpB5F,EAAQA,EAAQ6F,EAAI7F,EAAQ8F,EAAI9F,EAAQ+F,GAAKpD,GAAaf,OAAQD,GAElE,KAAI,GAAIqE,IAAU,iHAGhBC,MAAM,KAAM5B,GAAI,EAAG2B,GAAQzB,OAASF,IAAI7D,EAAIwF,GAAQ3B,MAEtD,KAAI,GAAI2B,IAAU1E,EAAMd,EAAI0F,OAAQ7B,GAAI,EAAG2B,GAAQzB,OAASF,IAAI3D,EAAUsF,GAAQ3B,MAElFrE,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKpD,EAAY,UAE3CyD,MAAO,SAAS/C,GACd,MAAOvD,GAAIwC,EAAgBe,GAAO,IAC9Bf,EAAee,GACff,EAAee,GAAO1B,EAAQ0B,IAGpCgD,OAAQ,QAASA,QAAOhD,GACtB,GAAGO,EAASP,GAAK,MAAO1C,GAAM2B,EAAgBe,EAC9C,MAAMiC,WAAUjC,EAAM,sBAExBiD,UAAW,WAAYzD,GAAS,GAChC0D,UAAW,WAAY1D,GAAS,KAGlC7C,EAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKpD,EAAY,UAE3C8B,OAAQD,EAERT,eAAgBD,EAEhBI,iBAAkBD,EAElBY,yBAA0BD,EAE1BG,oBAAqBD,GAErBM,sBAAuBD,KAIzBtD,GAAS7B,EAAQA,EAAQmG,EAAInG,EAAQ+F,IAAMpD,GAAcvC,EAAO,WAC9D,GAAI+F,GAAIxE,GAIR,OAA0B,UAAnBI,GAAYoE,KAAyC,MAAtBpE,GAAYoB,EAAGgD,KAAwC,MAAzBpE,EAAWW,OAAOyD,OACnF,QACHnE,UAAW,QAASA,WAAUoB,GAC5B,GAAGA,IAAOpE,IAAa4E,EAASR,GAAhC,CAIA,IAHA,GAEIoD,GAAUC,EAFVC,GAAQtD,GACRiB,EAAO,EAELkB,UAAUhB,OAASF,GAAEqC,EAAKxB,KAAKK,UAAUlB,KAQ/C,OAPAmC,GAAWE,EAAK,GACM,kBAAZF,KAAuBC,EAAYD,IAC1CC,GAAc5F,EAAQ2F,KAAUA,EAAW,SAASnD,EAAKH,GAE1D,GADGuD,IAAUvD,EAAQuD,EAAUhH,KAAKwD,KAAMI,EAAKH,KAC3CU,EAASV,GAAO,MAAOA,KAE7BwD,EAAK,GAAKF,EACHzE,EAAW4E,MAAM9E,EAAO6E,OAKnC/E,EAAQM,GAAWE,IAAiBjD,EAAoB,GAAGyC,EAAQM,GAAYE,EAAcR,EAAQM,GAAW2E,SAEhHtG,EAAeqB,EAAS,UAExBrB,EAAeuG,KAAM,QAAQ,GAE7BvG,EAAeT,EAAOiC,KAAM,QAAQ,IAI/B,SAASxC,EAAQD,GAGtB,GAAIQ,GAASP,EAAOD,QAA2B,mBAAVyH,SAAyBA,OAAOD,MAAQA,KACzEC,OAAwB,mBAARC,OAAuBA,KAAKF,MAAQA,KAAOE,KAAOC,SAAS,gBAC9D,iBAAPjI,KAAgBA,EAAMc,IAI3B,SAASP,EAAQD,GAEtB,GAAI4H,MAAoBA,cACxB3H,GAAOD,QAAU,SAAS+D,EAAIC,GAC5B,MAAO4D,GAAexH,KAAK2D,EAAIC,KAK5B,SAAS/D,EAAQD,EAASH,GAG/BI,EAAOD,SAAWH,EAAoB,GAAG,WACvC,MAA2E,IAApEwD,OAAOqB,kBAAmB,KAAMf,IAAK,WAAY,MAAO,MAAOG,KAKnE,SAAS7D,EAAQD,GAEtBC,EAAOD,QAAU,SAAS6H,GACxB,IACE,QAASA,IACT,MAAMC,GACN,OAAO,KAMN,SAAS7H,EAAQD,EAASH,GAE/B,GAAIW,GAAYX,EAAoB,GAChCkI,EAAYlI,EAAoB,GAChCmI,EAAYnI,EAAoB,GAChCe,EAAYf,EAAoB,IAChCoI,EAAYpI,EAAoB,IAChC+C,EAAY,YAEZjC,EAAU,SAASuH,EAAM3B,EAAM4B,GACjC,GAQInE,GAAKoE,EAAKC,EAAKC,EARfC,EAAYL,EAAOvH,EAAQ+F,EAC3B8B,EAAYN,EAAOvH,EAAQ6F,EAC3BiC,EAAYP,EAAOvH,EAAQmG,EAC3B4B,EAAYR,EAAOvH,EAAQmE,EAC3B6D,EAAYT,EAAOvH,EAAQiI,EAC3BC,EAAYL,EAAYhI,EAASiI,EAAYjI,EAAO+F,KAAU/F,EAAO+F,QAAe/F,EAAO+F,QAAa3D,GACxG5C,EAAYwI,EAAYT,EAAOA,EAAKxB,KAAUwB,EAAKxB,OACnDuC,EAAY9I,EAAQ4C,KAAe5C,EAAQ4C,MAE5C4F,KAAUL,EAAS5B,EACtB,KAAIvC,IAAOmE,GAETC,GAAOG,GAAaM,GAAUA,EAAO7E,KAASrE,EAE9C0I,GAAOD,EAAMS,EAASV,GAAQnE,GAE9BsE,EAAMK,GAAWP,EAAMH,EAAII,EAAK7H,GAAUkI,GAA0B,kBAAPL,GAAoBJ,EAAIN,SAASvH,KAAMiI,GAAOA,EAExGQ,GAAOjI,EAASiI,EAAQ7E,EAAKqE,EAAKH,EAAOvH,EAAQoI,GAEjD/I,EAAQgE,IAAQqE,GAAIL,EAAKhI,EAASgE,EAAKsE,GACvCI,GAAYI,EAAS9E,IAAQqE,IAAIS,EAAS9E,GAAOqE,GAGxD7H,GAAOuH,KAAOA,EAEdpH,EAAQ+F,EAAI,EACZ/F,EAAQ6F,EAAI,EACZ7F,EAAQmG,EAAI,EACZnG,EAAQmE,EAAI,EACZnE,EAAQiI,EAAI,GACZjI,EAAQ8F,EAAI,GACZ9F,EAAQoI,EAAI,GACZpI,EAAQqI,EAAI,IACZ/I,EAAOD,QAAUW,GAIZ,SAASV,EAAQD,GAEtB,GAAI+H,GAAO9H,EAAOD,SAAWiJ,QAAS,QACrB,iBAAPxJ,KAAgBA,EAAMsI,IAI3B,SAAS9H,EAAQD,EAASH,GAE/B,GAAIuC,GAAavC,EAAoB,GACjC+B,EAAa/B,EAAoB,GACrCI,GAAOD,QAAUH,EAAoB,GAAK,SAASqJ,EAAQlF,EAAKH,GAC9D,MAAOzB,GAAGD,EAAE+G,EAAQlF,EAAKpC,EAAW,EAAGiC,KACrC,SAASqF,EAAQlF,EAAKH,GAExB,MADAqF,GAAOlF,GAAOH,EACPqF,IAKJ,SAASjJ,EAAQD,EAASH,GAE/B,GAAI4B,GAAiB5B,EAAoB,IACrCsJ,EAAiBtJ,EAAoB,IACrC8B,EAAiB9B,EAAoB,IACrCuC,EAAiBiB,OAAOqB,cAE5B1E,GAAQmC,EAAItC,EAAoB,GAAKwD,OAAOqB,eAAiB,QAASA,gBAAe0E,EAAGtE,EAAGuE,GAIzF,GAHA5H,EAAS2H,GACTtE,EAAInD,EAAYmD,GAAG,GACnBrD,EAAS4H,GACNF,EAAe,IAChB,MAAO/G,GAAGgH,EAAGtE,EAAGuE,GAChB,MAAMvB,IACR,GAAG,OAASuB,IAAc,OAASA,GAAW,KAAMpD,WAAU,2BAE9D,OADG,SAAWoD,KAAWD,EAAEtE,GAAKuE,EAAWxF,OACpCuF,IAKJ,SAASnJ,EAAQD,EAASH,GAE/B,GAAIyJ,GAAWzJ,EAAoB,GACnCI,GAAOD,QAAU,SAAS+D,GACxB,IAAIuF,EAASvF,GAAI,KAAMkC,WAAUlC,EAAK,qBACtC,OAAOA,KAKJ,SAAS9D,EAAQD,GAEtBC,EAAOD,QAAU,SAAS+D,GACxB,MAAqB,gBAAPA,GAAyB,OAAPA,EAA4B,kBAAPA,KAKlD,SAAS9D,EAAQD,EAASH,GAE/BI,EAAOD,SAAWH,EAAoB,KAAOA,EAAoB,GAAG,WAClE,MAAuG,IAAhGwD,OAAOqB,eAAe7E,EAAoB,IAAI,OAAQ,KAAM8D,IAAK,WAAY,MAAO,MAAOG,KAK/F,SAAS7D,EAAQD,EAASH,GAE/B,GAAIyJ,GAAWzJ,EAAoB,IAC/B0J,EAAW1J,EAAoB,GAAG0J,SAElCC,EAAKF,EAASC,IAAaD,EAASC,EAASE,cACjDxJ,GAAOD,QAAU,SAAS+D,GACxB,MAAOyF,GAAKD,EAASE,cAAc1F,QAKhC,SAAS9D,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,GAGnCI,GAAOD,QAAU,SAAS+D,EAAI+C,GAC5B,IAAIwC,EAASvF,GAAI,MAAOA,EACxB,IAAI2F,GAAIC,CACR,IAAG7C,GAAkC,mBAArB4C,EAAK3F,EAAGuC,YAA4BgD,EAASK,EAAMD,EAAGtJ,KAAK2D,IAAK,MAAO4F,EACvF,IAA+B,mBAApBD,EAAK3F,EAAGwD,WAA2B+B,EAASK,EAAMD,EAAGtJ,KAAK2D,IAAK,MAAO4F,EACjF,KAAI7C,GAAkC,mBAArB4C,EAAK3F,EAAGuC,YAA4BgD,EAASK,EAAMD,EAAGtJ,KAAK2D,IAAK,MAAO4F,EACxF,MAAM1D,WAAU,6CAKb,SAAShG,EAAQD,GAEtBC,EAAOD,QAAU,SAAS4J,EAAQ/F,GAChC,OACEc,aAAyB,EAATiF,GAChBxD,eAAyB,EAATwD,GAChBC,WAAyB,EAATD,GAChB/F,MAAcA,KAMb,SAAS5D,EAAQD,EAASH,GAE/B,GAAIW,GAAYX,EAAoB,GAChCmI,EAAYnI,EAAoB,GAChCY,EAAYZ,EAAoB,GAChCiK,EAAYjK,EAAoB,IAAI,OACpCkK,EAAY,WACZC,EAAYrC,SAASoC,GACrBE,GAAa,GAAKD,GAAWpD,MAAMmD,EAEvClK,GAAoB,GAAGqK,cAAgB,SAASnG,GAC9C,MAAOiG,GAAU5J,KAAK2D,KAGvB9D,EAAOD,QAAU,SAASoJ,EAAGpF,EAAK2F,EAAKQ,GACtC,GAAIC,GAA2B,kBAAPT,EACrBS,KAAW3J,EAAIkJ,EAAK,SAAW3B,EAAK2B,EAAK,OAAQ3F,IACjDoF,EAAEpF,KAAS2F,IACXS,IAAW3J,EAAIkJ,EAAKG,IAAQ9B,EAAK2B,EAAKG,EAAKV,EAAEpF,GAAO,GAAKoF,EAAEpF,GAAOiG,EAAII,KAAKC,OAAOtG,MAClFoF,IAAM5I,EACP4I,EAAEpF,GAAO2F,EAELQ,EAICf,EAAEpF,GAAKoF,EAAEpF,GAAO2F,EACd3B,EAAKoB,EAAGpF,EAAK2F,UAJXP,GAAEpF,GACTgE,EAAKoB,EAAGpF,EAAK2F,OAOhBhC,SAAS4C,UAAWR,EAAW,QAASzD,YACzC,MAAsB,kBAAR1C,OAAsBA,KAAKkG,IAAQE,EAAU5J,KAAKwD,SAK7D,SAAS3D,EAAQD,GAEtB,GAAIE,GAAK,EACLsK,EAAKhD,KAAKiD,QACdxK,GAAOD,QAAU,SAASgE,GACxB,MAAO,UAAU0G,OAAO1G,IAAQrE,EAAY,GAAKqE,EAAK,QAAS9D,EAAKsK,GAAIlE,SAAS,OAK9E,SAASrG,EAAQD,EAASH,GAG/B,GAAI8K,GAAY9K,EAAoB,GACpCI,GAAOD,QAAU,SAAS0J,EAAIkB,EAAM1F,GAElC,GADAyF,EAAUjB,GACPkB,IAASjL,EAAU,MAAO+J,EAC7B,QAAOxE,GACL,IAAK,GAAG,MAAO,UAASpB,GACtB,MAAO4F,GAAGtJ,KAAKwK,EAAM9G,GAEvB,KAAK,GAAG,MAAO,UAASA,EAAG+G,GACzB,MAAOnB,GAAGtJ,KAAKwK,EAAM9G,EAAG+G,GAE1B,KAAK,GAAG,MAAO,UAAS/G,EAAG+G,EAAGvK,GAC5B,MAAOoJ,GAAGtJ,KAAKwK,EAAM9G,EAAG+G,EAAGvK,IAG/B,MAAO,YACL,MAAOoJ,GAAGpC,MAAMsD,EAAM1E,cAMrB,SAASjG,EAAQD,GAEtBC,EAAOD,QAAU,SAAS+D,GACxB,GAAgB,kBAANA,GAAiB,KAAMkC,WAAUlC,EAAK,sBAChD,OAAOA,KAKJ,SAAS9D,EAAQD,EAASH,GAE/B,GAAIgB,GAAWhB,EAAoB,IAAI,QACnCyJ,EAAWzJ,EAAoB,IAC/BY,EAAWZ,EAAoB,GAC/BiL,EAAWjL,EAAoB,GAAGsC,EAClCjC,EAAW,EACX6K,EAAe1H,OAAO0H,cAAgB,WACxC,OAAO,GAELC,GAAUnL,EAAoB,GAAG,WACnC,MAAOkL,GAAa1H,OAAO4H,yBAEzBC,EAAU,SAASnH,GACrB+G,EAAQ/G,EAAIlD,GAAOgD,OACjBmB,EAAG,OAAQ9E,EACXiL,SAGAC,EAAU,SAASrH,EAAIqB,GAEzB,IAAIkE,EAASvF,GAAI,MAAoB,gBAANA,GAAiBA,GAAmB,gBAANA,GAAiB,IAAM,KAAOA,CAC3F,KAAItD,EAAIsD,EAAIlD,GAAM,CAEhB,IAAIkK,EAAahH,GAAI,MAAO,GAE5B,KAAIqB,EAAO,MAAO,GAElB8F,GAAQnH,GAER,MAAOA,GAAGlD,GAAMmE,GAEhBqG,EAAU,SAAStH,EAAIqB,GACzB,IAAI3E,EAAIsD,EAAIlD,GAAM,CAEhB,IAAIkK,EAAahH,GAAI,OAAO,CAE5B,KAAIqB,EAAO,OAAO,CAElB8F,GAAQnH,GAER,MAAOA,GAAGlD,GAAMsK,GAGhBG,EAAW,SAASvH,GAEtB,MADGiH,IAAUO,EAAKC,MAAQT,EAAahH,KAAQtD,EAAIsD,EAAIlD,IAAMqK,EAAQnH,GAC9DA,GAELwH,EAAOtL,EAAOD,SAChBc,IAAUD,EACV2K,MAAU,EACVJ,QAAUA,EACVC,QAAUA,EACVC,SAAUA,IAKP,SAASrL,EAAQD,EAASH,GAE/B,GAAIW,GAASX,EAAoB,GAC7B4L,EAAS,qBACT5E,EAASrG,EAAOiL,KAAYjL,EAAOiL,MACvCxL,GAAOD,QAAU,SAASgE,GACxB,MAAO6C,GAAM7C,KAAS6C,EAAM7C,SAKzB,SAAS/D,EAAQD,EAASH,GAE/B,GAAI6L,GAAM7L,EAAoB,GAAGsC,EAC7B1B,EAAMZ,EAAoB,GAC1B8L,EAAM9L,EAAoB,IAAI,cAElCI,GAAOD,QAAU,SAAS+D,EAAIK,EAAKwH,GAC9B7H,IAAOtD,EAAIsD,EAAK6H,EAAO7H,EAAKA,EAAGwG,UAAWoB,IAAKD,EAAI3H,EAAI4H,GAAMvF,cAAc,EAAMvC,MAAOO,MAKxF,SAASnE,EAAQD,EAASH,GAE/B,GAAIgH,GAAahH,EAAoB,IAAI,OACrCqB,EAAarB,EAAoB,IACjC0C,EAAa1C,EAAoB,GAAG0C,OACpCsJ,EAA8B,kBAAVtJ,GAEpBuJ,EAAW7L,EAAOD,QAAU,SAASuG,GACvC,MAAOM,GAAMN,KAAUM,EAAMN,GAC3BsF,GAActJ,EAAOgE,KAAUsF,EAAatJ,EAASrB,GAAK,UAAYqF,IAG1EuF,GAASjF,MAAQA,GAIZ,SAAS5G,EAAQD,EAASH,GAE/BG,EAAQmC,EAAItC,EAAoB,KAI3B,SAASI,EAAQD,EAASH,GAE/B,GAAIW,GAAiBX,EAAoB,GACrCkI,EAAiBlI,EAAoB,GACrCkM,EAAiBlM,EAAoB,IACrCuB,EAAiBvB,EAAoB,IACrC6E,EAAiB7E,EAAoB,GAAGsC,CAC5ClC,GAAOD,QAAU,SAASuG,GACxB,GAAIjE,GAAUyF,EAAKxF,SAAWwF,EAAKxF,OAASwJ,KAAevL,EAAO+B,WAC7C,MAAlBgE,EAAKyF,OAAO,IAAezF,IAAQjE,IAASoC,EAAepC,EAASiE,GAAO1C,MAAOzC,EAAOe,EAAEoE,OAK3F,SAAStG,EAAQD,GAEtBC,EAAOD,SAAU,GAIZ,SAASC,EAAQD,EAASH,GAE/B,GAAIoM,GAAYpM,EAAoB,IAChC6B,EAAY7B,EAAoB,GACpCI,GAAOD,QAAU,SAASkJ,EAAQgD,GAMhC,IALA,GAIIlI,GAJAoF,EAAS1H,EAAUwH,GACnBnE,EAASkH,EAAQ7C,GACjBlE,EAASH,EAAKG,OACdiH,EAAS,EAEPjH,EAASiH,GAAM,GAAG/C,EAAEpF,EAAMe,EAAKoH,QAAcD,EAAG,MAAOlI,KAK1D,SAAS/D,EAAQD,EAASH,GAG/B,GAAIoC,GAAcpC,EAAoB,IAClCuM,EAAcvM,EAAoB,GAEtCI,GAAOD,QAAUqD,OAAO0B,MAAQ,QAASA,MAAKqE,GAC5C,MAAOnH,GAAMmH,EAAGgD,KAKb,SAASnM,EAAQD,EAASH,GAE/B,GAAIY,GAAeZ,EAAoB,GACnC6B,EAAe7B,EAAoB,IACnCwM,EAAexM,EAAoB,KAAI,GACvCyM,EAAezM,EAAoB,IAAI,WAE3CI,GAAOD,QAAU,SAASkJ,EAAQvD,GAChC,GAGI3B,GAHAoF,EAAS1H,EAAUwH,GACnBlE,EAAS,EACTY,IAEJ,KAAI5B,IAAOoF,GAAKpF,GAAOsI,GAAS7L,EAAI2I,EAAGpF,IAAQ4B,EAAOC,KAAK7B,EAE3D,MAAM2B,EAAMT,OAASF,GAAKvE,EAAI2I,EAAGpF,EAAM2B,EAAMX,SAC1CqH,EAAazG,EAAQ5B,IAAQ4B,EAAOC,KAAK7B,GAE5C,OAAO4B,KAKJ,SAAS3F,EAAQD,EAASH,GAG/B,GAAI0M,GAAU1M,EAAoB,IAC9B2M,EAAU3M,EAAoB,GAClCI,GAAOD,QAAU,SAAS+D,GACxB,MAAOwI,GAAQC,EAAQzI,MAKpB,SAAS9D,EAAQD,EAASH,GAG/B,GAAI4M,GAAM5M,EAAoB,GAC9BI,GAAOD,QAAUqD,OAAO,KAAKL,qBAAqB,GAAKK,OAAS,SAASU,GACvE,MAAkB,UAAX0I,EAAI1I,GAAkBA,EAAG6C,MAAM,IAAMvD,OAAOU,KAKhD,SAAS9D,EAAQD,GAEtB,GAAIsG,MAAcA,QAElBrG,GAAOD,QAAU,SAAS+D,GACxB,MAAOuC,GAASlG,KAAK2D,GAAI2I,MAAM,QAK5B,SAASzM,EAAQD,GAGtBC,EAAOD,QAAU,SAAS+D,GACxB,GAAGA,GAAMpE,EAAU,KAAMsG,WAAU,yBAA2BlC,EAC9D,OAAOA,KAKJ,SAAS9D,EAAQD,EAASH,GAI/B,GAAI6B,GAAY7B,EAAoB,IAChC8M,EAAY9M,EAAoB,IAChC+M,EAAY/M,EAAoB,GACpCI,GAAOD,QAAU,SAAS6M,GACxB,MAAO,UAASC,EAAOZ,EAAIa,GACzB,GAGIlJ,GAHAuF,EAAS1H,EAAUoL,GACnB5H,EAASyH,EAASvD,EAAElE,QACpBiH,EAASS,EAAQG,EAAW7H,EAGhC,IAAG2H,GAAeX,GAAMA,GAAG,KAAMhH,EAASiH,GAExC,GADAtI,EAAQuF,EAAE+C,KACPtI,GAASA,EAAM,OAAO,MAEpB,MAAKqB,EAASiH,EAAOA,IAAQ,IAAGU,GAAeV,IAAS/C,KAC1DA,EAAE+C,KAAWD,EAAG,MAAOW,IAAeV,GAAS,CAClD,QAAQU,SAMT,SAAS5M,EAAQD,EAASH,GAG/B,GAAImN,GAAYnN,EAAoB,IAChCoN,EAAYzF,KAAKyF,GACrBhN,GAAOD,QAAU,SAAS+D,GACxB,MAAOA,GAAK,EAAIkJ,EAAID,EAAUjJ,GAAK,kBAAoB,IAKpD,SAAS9D,EAAQD,GAGtB,GAAIkN,GAAQ1F,KAAK0F,KACbC,EAAQ3F,KAAK2F,KACjBlN,GAAOD,QAAU,SAAS+D,GACxB,MAAOqJ,OAAMrJ,GAAMA,GAAM,GAAKA,EAAK,EAAIoJ,EAAQD,GAAMnJ,KAKlD,SAAS9D,EAAQD,EAASH,GAE/B,GAAImN,GAAYnN,EAAoB,IAChCwN,EAAY7F,KAAK6F,IACjBJ,EAAYzF,KAAKyF,GACrBhN,GAAOD,QAAU,SAASmM,EAAOjH,GAE/B,MADAiH,GAAQa,EAAUb,GACXA,EAAQ,EAAIkB,EAAIlB,EAAQjH,EAAQ,GAAK+H,EAAId,EAAOjH,KAKpD,SAASjF,EAAQD,EAASH,GAE/B,GAAImB,GAASnB,EAAoB,IAAI,QACjCqB,EAASrB,EAAoB,GACjCI,GAAOD,QAAU,SAASgE,GACxB,MAAOhD,GAAOgD,KAAShD,EAAOgD,GAAO9C,EAAI8C,MAKtC,SAAS/D,EAAQD,GAGtBC,EAAOD,QAAU,gGAEf4G,MAAM,MAIH,SAAS3G,EAAQD,EAASH,GAG/B,GAAIoM,GAAUpM,EAAoB,IAC9ByN,EAAUzN,EAAoB,IAC9B0N,EAAU1N,EAAoB,GAClCI,GAAOD,QAAU,SAAS+D,GACxB,GAAI6B,GAAaqG,EAAQlI,GACrByJ,EAAaF,EAAKnL,CACtB,IAAGqL,EAKD,IAJA,GAGIxJ,GAHA2C,EAAU6G,EAAWzJ,GACrBhB,EAAUwK,EAAIpL,EACd6C,EAAU,EAER2B,EAAQzB,OAASF,GAAKjC,EAAO3C,KAAK2D,EAAIC,EAAM2C,EAAQ3B,OAAMY,EAAOC,KAAK7B,EAC5E,OAAO4B,KAKN,SAAS3F,EAAQD,GAEtBA,EAAQmC,EAAIkB,OAAO0C,uBAId,SAAS9F,EAAQD,GAEtBA,EAAQmC,KAAOa,sBAIV,SAAS/C,EAAQD,EAASH,GAG/B,GAAI4M,GAAM5M,EAAoB,GAC9BI,GAAOD,QAAUyN,MAAMjM,SAAW,QAASA,SAAQkM,GACjD,MAAmB,SAAZjB,EAAIiB,KAKR,SAASzN,EAAQD,EAASH,GAG/B,GAAI4B,GAAc5B,EAAoB,IAClC8N,EAAc9N,EAAoB,IAClCuM,EAAcvM,EAAoB,IAClCyM,EAAczM,EAAoB,IAAI,YACtC+N,EAAc,aACdhL,EAAc,YAGdiL,EAAa,WAEf,GAIIC,GAJAC,EAASlO,EAAoB,IAAI,UACjCmF,EAASoH,EAAYlH,OACrB8I,EAAS,IACTC,EAAS,GAYb,KAVAF,EAAOG,MAAMC,QAAU,OACvBtO,EAAoB,IAAIuO,YAAYL,GACpCA,EAAOM,IAAM,cAGbP,EAAiBC,EAAOO,cAAc/E,SACtCuE,EAAeS,OACfT,EAAeU,MAAMR,EAAK,SAAWC,EAAK,oBAAsBD,EAAK,UAAYC,GACjFH,EAAeW,QACfZ,EAAaC,EAAepH,EACtB1B,WAAW6I,GAAWjL,GAAWwJ,EAAYpH,GACnD,OAAO6I,KAGT5N,GAAOD,QAAUqD,OAAO+B,QAAU,QAASA,QAAOgE,EAAGsF,GACnD,GAAI9I,EAQJ,OAPS,QAANwD,GACDwE,EAAMhL,GAAanB,EAAS2H,GAC5BxD,EAAS,GAAIgI,GACbA,EAAMhL,GAAa,KAEnBgD,EAAO0G,GAAYlD,GACdxD,EAASiI,IACTa,IAAe/O,EAAYiG,EAAS+H,EAAI/H,EAAQ8I,KAMpD,SAASzO,EAAQD,EAASH,GAE/B,GAAIuC,GAAWvC,EAAoB,GAC/B4B,EAAW5B,EAAoB,IAC/BoM,EAAWpM,EAAoB,GAEnCI,GAAOD,QAAUH,EAAoB,GAAKwD,OAAOwB,iBAAmB,QAASA,kBAAiBuE,EAAGsF,GAC/FjN,EAAS2H,EAKT,KAJA,GAGItE,GAHAC,EAASkH,EAAQyC,GACjBxJ,EAASH,EAAKG,OACdF,EAAI,EAEFE,EAASF,GAAE5C,EAAGD,EAAEiH,EAAGtE,EAAIC,EAAKC,KAAM0J,EAAW5J,GACnD,OAAOsE,KAKJ,SAASnJ,EAAQD,EAASH,GAE/BI,EAAOD,QAAUH,EAAoB,GAAG0J,UAAYA,SAASoF,iBAIxD,SAAS1O,EAAQD,EAASH,GAG/B,GAAI6B,GAAY7B,EAAoB,IAChCwC,EAAYxC,EAAoB,IAAIsC,EACpCmE,KAAeA,SAEfsI,EAA+B,gBAAVnH,SAAsBA,QAAUpE,OAAOqC,oBAC5DrC,OAAOqC,oBAAoB+B,WAE3BoH,EAAiB,SAAS9K,GAC5B,IACE,MAAO1B,GAAK0B,GACZ,MAAM+D,GACN,MAAO8G,GAAYlC,SAIvBzM,GAAOD,QAAQmC,EAAI,QAASuD,qBAAoB3B,GAC9C,MAAO6K,IAAoC,mBAArBtI,EAASlG,KAAK2D,GAA2B8K,EAAe9K,GAAM1B,EAAKX,EAAUqC,MAMhG,SAAS9D,EAAQD,EAASH,GAG/B,GAAIoC,GAAapC,EAAoB,IACjCiP,EAAajP,EAAoB,IAAI6K,OAAO,SAAU,YAE1D1K,GAAQmC,EAAIkB,OAAOqC,qBAAuB,QAASA,qBAAoB0D,GACrE,MAAOnH,GAAMmH,EAAG0F,KAKb,SAAS7O,EAAQD,EAASH,GAE/B,GAAI0N,GAAiB1N,EAAoB,IACrC+B,EAAiB/B,EAAoB,IACrC6B,EAAiB7B,EAAoB,IACrC8B,EAAiB9B,EAAoB,IACrCY,EAAiBZ,EAAoB,GACrCsJ,EAAiBtJ,EAAoB,IACrCqC,EAAiBmB,OAAOmC,wBAE5BxF,GAAQmC,EAAItC,EAAoB,GAAKqC,EAAO,QAASsD,0BAAyB4D,EAAGtE,GAG/E,GAFAsE,EAAI1H,EAAU0H,GACdtE,EAAInD,EAAYmD,GAAG,GAChBqE,EAAe,IAChB,MAAOjH,GAAKkH,EAAGtE,GACf,MAAMgD,IACR,GAAGrH,EAAI2I,EAAGtE,GAAG,MAAOlD,IAAY2L,EAAIpL,EAAE/B,KAAKgJ,EAAGtE,GAAIsE,EAAEtE,MAKjD,SAAS7E,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAK7G,EAAoB,GAAI,UAAW6E,eAAgB7E,EAAoB,GAAGsC,KAItG,SAASlC,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAK7G,EAAoB,GAAI,UAAWgF,iBAAkBhF,EAAoB,OAIrG,SAASI,EAAQD,EAASH,GAG/B,GAAI6B,GAA4B7B,EAAoB,IAChD0F,EAA4B1F,EAAoB,IAAIsC,CAExDtC,GAAoB,IAAI,2BAA4B,WAClD,MAAO,SAAS2F,0BAAyBzB,EAAIC,GAC3C,MAAOuB,GAA0B7D,EAAUqC,GAAKC,OAM/C,SAAS/D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BkI,EAAUlI,EAAoB,GAC9BkP,EAAUlP,EAAoB,EAClCI,GAAOD,QAAU,SAASc,EAAK+G,GAC7B,GAAI6B,IAAO3B,EAAK1E,YAAcvC,IAAQuC,OAAOvC,GACzCwH,IACJA,GAAIxH,GAAO+G,EAAK6B,GAChB/I,EAAQA,EAAQmG,EAAInG,EAAQ+F,EAAIqI,EAAM,WAAYrF,EAAG,KAAQ,SAAUpB,KAKpE,SAASrI,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,UAAW1B,OAAQvF,EAAoB,OAIrD,SAASI,EAAQD,EAASH,GAG/B,GAAImP,GAAkBnP,EAAoB,IACtCoP,EAAkBpP,EAAoB,GAE1CA,GAAoB,IAAI,iBAAkB,WACxC,MAAO,SAASqP,gBAAenL,GAC7B,MAAOkL,GAAgBD,EAASjL,QAM/B,SAAS9D,EAAQD,EAASH,GAG/B,GAAI2M,GAAU3M,EAAoB,GAClCI,GAAOD,QAAU,SAAS+D,GACxB,MAAOV,QAAOmJ,EAAQzI,MAKnB,SAAS9D,EAAQD,EAASH,GAG/B,GAAIY,GAAcZ,EAAoB,GAClCmP,EAAcnP,EAAoB,IAClCyM,EAAczM,EAAoB,IAAI,YACtCuD,EAAcC,OAAOkH,SAEzBtK,GAAOD,QAAUqD,OAAO6L,gBAAkB,SAAS9F,GAEjD,MADAA,GAAI4F,EAAS5F,GACV3I,EAAI2I,EAAGkD,GAAiBlD,EAAEkD,GACF,kBAAjBlD,GAAE+F,aAA6B/F,YAAaA,GAAE+F,YAC/C/F,EAAE+F,YAAY5E,UACdnB,YAAa/F,QAASD,EAAc,OAK1C,SAASnD,EAAQD,EAASH,GAG/B,GAAImP,GAAWnP,EAAoB,IAC/BoC,EAAWpC,EAAoB,GAEnCA,GAAoB,IAAI,OAAQ,WAC9B,MAAO,SAASkF,MAAKhB,GACnB,MAAO9B,GAAM+M,EAASjL,QAMrB,SAAS9D,EAAQD,EAASH,GAG/BA,EAAoB,IAAI,sBAAuB,WAC7C,MAAOA,GAAoB,IAAIsC,KAK5B,SAASlC,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,IAC/B0L,EAAW1L,EAAoB,IAAIyL,QAEvCzL,GAAoB,IAAI,SAAU,SAASuP,GACzC,MAAO,SAASC,QAAOtL,GACrB,MAAOqL,IAAW9F,EAASvF,GAAMqL,EAAQ7D,EAAKxH,IAAOA,MAMpD,SAAS9D,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,IAC/B0L,EAAW1L,EAAoB,IAAIyL,QAEvCzL,GAAoB,IAAI,OAAQ,SAASyP,GACvC,MAAO,SAASC,MAAKxL,GACnB,MAAOuL,IAAShG,EAASvF,GAAMuL,EAAM/D,EAAKxH,IAAOA,MAMhD,SAAS9D,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,IAC/B0L,EAAW1L,EAAoB,IAAIyL,QAEvCzL,GAAoB,IAAI,oBAAqB,SAAS2P,GACpD,MAAO,SAASvE,mBAAkBlH,GAChC,MAAOyL,IAAsBlG,EAASvF,GAAMyL,EAAmBjE,EAAKxH,IAAOA,MAM1E,SAAS9D,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,GAEnCA,GAAoB,IAAI,WAAY,SAAS4P,GAC3C,MAAO,SAASC,UAAS3L,GACvB,OAAOuF,EAASvF,MAAM0L,GAAYA,EAAU1L,OAM3C,SAAS9D,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,GAEnCA,GAAoB,IAAI,WAAY,SAAS8P,GAC3C,MAAO,SAASC,UAAS7L,GACvB,OAAOuF,EAASvF,MAAM4L,GAAYA,EAAU5L,OAM3C,SAAS9D,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,GAEnCA,GAAoB,IAAI,eAAgB,SAASgQ,GAC/C,MAAO,SAAS9E,cAAahH,GAC3B,QAAOuF,EAASvF,MAAM8L,GAAgBA,EAAc9L,QAMnD,SAAS9D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAG,UAAWoJ,OAAQjQ,EAAoB,OAIjE,SAASI,EAAQD,EAASH,GAI/B,GAAIoM,GAAWpM,EAAoB,IAC/ByN,EAAWzN,EAAoB,IAC/B0N,EAAW1N,EAAoB,IAC/BmP,EAAWnP,EAAoB,IAC/B0M,EAAW1M,EAAoB,IAC/BkQ,EAAW1M,OAAOyM,MAGtB7P,GAAOD,SAAW+P,GAAWlQ,EAAoB,GAAG,WAClD,GAAImQ,MACApH,KACA9B,EAAIvE,SACJ0N,EAAI,sBAGR,OAFAD,GAAElJ,GAAK,EACPmJ,EAAErJ,MAAM,IAAIsJ,QAAQ,SAASC,GAAIvH,EAAEuH,GAAKA,IACZ,GAArBJ,KAAYC,GAAGlJ,IAAWzD,OAAO0B,KAAKgL,KAAYnH,IAAIyB,KAAK,KAAO4F,IACtE,QAASH,QAAOjH,EAAQV,GAM3B,IALA,GAAIiI,GAAQpB,EAASnG,GACjBwH,EAAQnK,UAAUhB,OAClBiH,EAAQ,EACRqB,EAAaF,EAAKnL,EAClBY,EAAawK,EAAIpL,EACfkO,EAAOlE,GAMX,IALA,GAIInI,GAJA8C,EAASyF,EAAQrG,UAAUiG,MAC3BpH,EAASyI,EAAavB,EAAQnF,GAAG4D,OAAO8C,EAAW1G,IAAMmF,EAAQnF,GACjE5B,EAASH,EAAKG,OACdoL,EAAS,EAEPpL,EAASoL,GAAKvN,EAAO3C,KAAK0G,EAAG9C,EAAMe,EAAKuL,QAAMF,EAAEpM,GAAO8C,EAAE9C,GAC/D,OAAOoM,IACPL,GAIC,SAAS9P,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAClCc,GAAQA,EAAQmG,EAAG,UAAW0C,GAAI3J,EAAoB,OAIjD,SAASI,EAAQD,GAGtBC,EAAOD,QAAUqD,OAAOmG,IAAM,QAASA,IAAG+G,EAAGC,GAC3C,MAAOD,KAAMC,EAAU,IAAND,GAAW,EAAIA,IAAM,EAAIC,EAAID,GAAKA,GAAKC,GAAKA,IAK1D,SAASvQ,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAClCc,GAAQA,EAAQmG,EAAG,UAAW2J,eAAgB5Q,EAAoB,IAAIwG,OAIjE,SAASpG,EAAQD,EAASH,GAI/B,GAAIyJ,GAAWzJ,EAAoB,IAC/B4B,EAAW5B,EAAoB,IAC/B6Q,EAAQ,SAAStH,EAAGuH,GAEtB,GADAlP,EAAS2H,IACLE,EAASqH,IAAoB,OAAVA,EAAe,KAAM1K,WAAU0K,EAAQ,6BAEhE1Q,GAAOD,SACLqG,IAAKhD,OAAOoN,iBAAmB,gBAC7B,SAASG,EAAMC,EAAOxK,GACpB,IACEA,EAAMxG,EAAoB,IAAI8H,SAASvH,KAAMP,EAAoB,IAAIsC,EAAEkB,OAAOkH,UAAW,aAAalE,IAAK,GAC3GA,EAAIuK,MACJC,IAAUD,YAAgBnD,QAC1B,MAAM3F,GAAI+I,GAAQ,EACpB,MAAO,SAASJ,gBAAerH,EAAGuH,GAIhC,MAHAD,GAAMtH,EAAGuH,GACNE,EAAMzH,EAAE0H,UAAYH,EAClBtK,EAAI+C,EAAGuH,GACLvH,QAEL,GAASzJ,GACjB+Q,MAAOA,IAKJ,SAASzQ,EAAQD,EAASH,GAI/B,GAAIkR,GAAUlR,EAAoB,IAC9B+Q,IACJA,GAAK/Q,EAAoB,IAAI,gBAAkB,IAC5C+Q,EAAO,IAAM,cACd/Q,EAAoB,IAAIwD,OAAOkH,UAAW,WAAY,QAASjE,YAC7D,MAAO,WAAayK,EAAQnN,MAAQ,MACnC,IAKA,SAAS3D,EAAQD,EAASH,GAG/B,GAAI4M,GAAM5M,EAAoB,IAC1B8L,EAAM9L,EAAoB,IAAI,eAE9BmR,EAAgD,aAA1CvE,EAAI,WAAY,MAAOvG,eAG7B+K,EAAS,SAASlN,EAAIC,GACxB,IACE,MAAOD,GAAGC,GACV,MAAM8D,KAGV7H,GAAOD,QAAU,SAAS+D,GACxB,GAAIqF,GAAGgH,EAAGxH,CACV,OAAO7E,KAAOpE,EAAY,YAAqB,OAAPoE,EAAc,OAEN,iBAApCqM,EAAIa,EAAO7H,EAAI/F,OAAOU,GAAK4H,IAAoByE,EAEvDY,EAAMvE,EAAIrD,GAEM,WAAfR,EAAI6D,EAAIrD,KAAsC,kBAAZA,GAAE8H,OAAuB,YAActI,IAK3E,SAAS3I,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmE,EAAG,YAAaqM,KAAMtR,EAAoB,OAIrD,SAASI,EAAQD,EAASH,GAG/B,GAAI8K,GAAa9K,EAAoB,IACjCyJ,EAAazJ,EAAoB,IACjCuR,EAAavR,EAAoB,IACjCwR,KAAgB3E,MAChB4E,KAEAC,EAAY,SAAS7K,EAAG8K,EAAKnK,GAC/B,KAAKmK,IAAOF,IAAW,CACrB,IAAI,GAAIG,MAAQzM,EAAI,EAAGA,EAAIwM,EAAKxM,IAAIyM,EAAEzM,GAAK,KAAOA,EAAI,GACtDsM,GAAUE,GAAO7J,SAAS,MAAO,gBAAkB8J,EAAEpH,KAAK,KAAO,KACjE,MAAOiH,GAAUE,GAAK9K,EAAGW,GAG7BpH,GAAOD,QAAU2H,SAASwJ,MAAQ,QAASA,MAAKvG,GAC9C,GAAIlB,GAAWiB,EAAU/G,MACrB8N,EAAWL,EAAWjR,KAAK8F,UAAW,GACtCyL,EAAQ,WACV,GAAItK,GAAOqK,EAAShH,OAAO2G,EAAWjR,KAAK8F,WAC3C,OAAOtC,gBAAgB+N,GAAQJ,EAAU7H,EAAIrC,EAAKnC,OAAQmC,GAAQ+J,EAAO1H,EAAIrC,EAAMuD,GAGrF,OADGtB,GAASI,EAAGa,aAAWoH,EAAMpH,UAAYb,EAAGa,WACxCoH,IAKJ,SAAS1R,EAAQD,GAGtBC,EAAOD,QAAU,SAAS0J,EAAIrC,EAAMuD,GAClC,GAAIgH,GAAKhH,IAASjL,CAClB,QAAO0H,EAAKnC,QACV,IAAK,GAAG,MAAO0M,GAAKlI,IACAA,EAAGtJ,KAAKwK,EAC5B,KAAK,GAAG,MAAOgH,GAAKlI,EAAGrC,EAAK,IACRqC,EAAGtJ,KAAKwK,EAAMvD,EAAK,GACvC,KAAK,GAAG,MAAOuK,GAAKlI,EAAGrC,EAAK,GAAIA,EAAK,IACjBqC,EAAGtJ,KAAKwK,EAAMvD,EAAK,GAAIA,EAAK,GAChD,KAAK,GAAG,MAAOuK,GAAKlI,EAAGrC,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAC1BqC,EAAGtJ,KAAKwK,EAAMvD,EAAK,GAAIA,EAAK,GAAIA,EAAK,GACzD,KAAK,GAAG,MAAOuK,GAAKlI,EAAGrC,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACnCqC,EAAGtJ,KAAKwK,EAAMvD,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAClE,MAAoBqC,GAAGpC,MAAMsD,EAAMvD,KAKlC,SAASpH,EAAQD,EAASH,GAE/B,GAAIuC,GAAavC,EAAoB,GAAGsC,EACpCP,EAAa/B,EAAoB,IACjCY,EAAaZ,EAAoB,GACjCgS,EAAalK,SAAS4C,UACtBuH,EAAa,wBACbC,EAAa,OAEbhH,EAAe1H,OAAO0H,cAAgB,WACxC,OAAO,EAITgH,KAAQF,IAAUhS,EAAoB,IAAMuC,EAAGyP,EAAQE,GACrD3L,cAAc,EACdzC,IAAK,WACH,IACE,GAAIiH,GAAOhH,KACP2C,GAAQ,GAAKqE,GAAMoH,MAAMF,GAAQ,EAErC,OADArR,GAAImK,EAAMmH,KAAUhH,EAAaH,IAASxI,EAAGwI,EAAMmH,EAAMnQ,EAAW,EAAG2E,IAChEA,EACP,MAAMuB,GACN,MAAO,QAOR,SAAS7H,EAAQD,EAASH,GAG/B,GAAIyJ,GAAiBzJ,EAAoB,IACrCqP,EAAiBrP,EAAoB,IACrCoS,EAAiBpS,EAAoB,IAAI,eACzCqS,EAAiBvK,SAAS4C,SAEzB0H,KAAgBC,IAAerS,EAAoB,GAAGsC,EAAE+P,EAAeD,GAAepO,MAAO,SAASuF,GACzG,GAAkB,kBAARxF,QAAuB0F,EAASF,GAAG,OAAO,CACpD,KAAIE,EAAS1F,KAAK2G,WAAW,MAAOnB,aAAaxF,KAEjD,MAAMwF,EAAI8F,EAAe9F,IAAG,GAAGxF,KAAK2G,YAAcnB,EAAE,OAAO,CAC3D,QAAO,MAKJ,SAASnJ,EAAQD,EAASH,GAG/B,GAAIW,GAAoBX,EAAoB,GACxCY,EAAoBZ,EAAoB,GACxC4M,EAAoB5M,EAAoB,IACxCsS,EAAoBtS,EAAoB,IACxC8B,EAAoB9B,EAAoB,IACxCkP,EAAoBlP,EAAoB,GACxCwC,EAAoBxC,EAAoB,IAAIsC,EAC5CD,EAAoBrC,EAAoB,IAAIsC,EAC5CC,EAAoBvC,EAAoB,GAAGsC,EAC3CiQ,EAAoBvS,EAAoB,IAAIwS,KAC5CC,EAAoB,SACpBC,EAAoB/R,EAAO8R,GAC3BE,EAAoBD,EACpB5B,EAAoB4B,EAAQhI,UAE5BkI,EAAoBhG,EAAI5M,EAAoB,IAAI8Q,KAAW2B,EAC3DI,EAAoB,QAAUpI,QAAOC,UAGrCoI,EAAW,SAASC,GACtB,GAAI7O,GAAKpC,EAAYiR,GAAU,EAC/B,IAAgB,gBAAN7O,IAAkBA,EAAGmB,OAAS,EAAE,CACxCnB,EAAK2O,EAAO3O,EAAGsO,OAASD,EAAMrO,EAAI,EAClC,IACI8O,GAAOC,EAAOC,EADdC,EAAQjP,EAAGkP,WAAW,EAE1B,IAAa,KAAVD,GAA0B,KAAVA,GAEjB,GADAH,EAAQ9O,EAAGkP,WAAW,GACT,KAAVJ,GAA0B,MAAVA,EAAc,MAAOK,SACnC,IAAa,KAAVF,EAAa,CACrB,OAAOjP,EAAGkP,WAAW,IACnB,IAAK,IAAK,IAAK,IAAMH,EAAQ,EAAGC,EAAU,EAAI,MAC9C,KAAK,IAAK,IAAK,KAAMD,EAAQ,EAAGC,EAAU,EAAI,MAC9C,SAAU,OAAQhP,EAEpB,IAAI,GAAoDoP,GAAhDC,EAASrP,EAAG2I,MAAM,GAAI1H,EAAI,EAAGC,EAAImO,EAAOlO,OAAcF,EAAIC,EAAGD,IAInE,GAHAmO,EAAOC,EAAOH,WAAWjO,GAGtBmO,EAAO,IAAMA,EAAOJ,EAAQ,MAAOG,IACtC,OAAOG,UAASD,EAAQN,IAE5B,OAAQ/O,EAGZ,KAAIwO,EAAQ,UAAYA,EAAQ,QAAUA,EAAQ,QAAQ,CACxDA,EAAU,QAASe,QAAOzP,GACxB,GAAIE,GAAKmC,UAAUhB,OAAS,EAAI,EAAIrB,EAChC+G,EAAOhH,IACX,OAAOgH,aAAgB2H,KAEjBE,EAAa1D,EAAM,WAAY4B,EAAMpJ,QAAQnH,KAAKwK,KAAY6B,EAAI7B,IAAS0H,GAC3EH,EAAkB,GAAIK,GAAKG,EAAS5O,IAAM6G,EAAM2H,GAAWI,EAAS5O,GAE5E,KAAI,GAMiBC,GANbe,EAAOlF,EAAoB,GAAKwC,EAAKmQ,GAAQ,6KAMnD5L,MAAM,KAAM0J,EAAI,EAAQvL,EAAKG,OAASoL,EAAGA,IACtC7P,EAAI+R,EAAMxO,EAAMe,EAAKuL,MAAQ7P,EAAI8R,EAASvO,IAC3C5B,EAAGmQ,EAASvO,EAAK9B,EAAKsQ,EAAMxO,GAGhCuO,GAAQhI,UAAYoG,EACpBA,EAAMxB,YAAcoD,EACpB1S,EAAoB,IAAIW,EAAQ8R,EAAQC,KAKrC,SAAStS,EAAQD,EAASH,GAE/B,GAAIyJ,GAAiBzJ,EAAoB,IACrC4Q,EAAiB5Q,EAAoB,IAAIwG,GAC7CpG,GAAOD,QAAU,SAAS4K,EAAM/B,EAAQ0K,GACtC,GAAIzO,GAAGgC,EAAI+B,EAAOsG,WAGhB,OAFCrI,KAAMyM,GAAiB,kBAALzM,KAAoBhC,EAAIgC,EAAEyD,aAAegJ,EAAEhJ,WAAajB,EAASxE,IAAM2L,GAC1FA,EAAe7F,EAAM9F,GACd8F,IAKN,SAAS3K,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,GAC9B2M,EAAU3M,EAAoB,IAC9BkP,EAAUlP,EAAoB,GAC9B2T,EAAU3T,EAAoB,IAC9B4T,EAAU,IAAMD,EAAS,IACzBE,EAAU,KACVC,EAAUC,OAAO,IAAMH,EAAQA,EAAQ,KACvCI,EAAUD,OAAOH,EAAQA,EAAQ,MAEjCK,EAAW,SAAShT,EAAK+G,EAAMkM,GACjC,GAAIzL,MACA0L,EAAQjF,EAAM,WAChB,QAASyE,EAAO1S,MAAU4S,EAAI5S,MAAU4S,IAEtChK,EAAKpB,EAAIxH,GAAOkT,EAAQnM,EAAKwK,GAAQmB,EAAO1S,EAC7CiT,KAAMzL,EAAIyL,GAASrK,GACtB/I,EAAQA,EAAQmE,EAAInE,EAAQ+F,EAAIsN,EAAO,SAAU1L,IAM/C+J,EAAOyB,EAASzB,KAAO,SAAS4B,EAAQC,GAI1C,MAHAD,GAAS3J,OAAOkC,EAAQyH,IACd,EAAPC,IAASD,EAASA,EAAOE,QAAQR,EAAO,KACjC,EAAPO,IAASD,EAASA,EAAOE,QAAQN,EAAO,KACpCI,EAGThU,GAAOD,QAAU8T,GAIZ,SAAS7T,EAAQD,GAEtBC,EAAOD,QAAU,oDAKZ,SAASC,EAAQD,EAASH,GAG/B,GAAIc,GAAed,EAAoB,GACnCmN,EAAenN,EAAoB,IACnCuU,EAAevU,EAAoB,IACnCwU,EAAexU,EAAoB,IACnCyU,EAAe,GAAGC,QAClBpH,EAAe3F,KAAK2F,MACpBqH,GAAgB,EAAG,EAAG,EAAG,EAAG,EAAG,GAC/BC,EAAe,wCACfC,EAAe,IAEfC,EAAW,SAASlD,EAAGnR,GAGzB,IAFA,GAAI0E,MACA4P,EAAKtU,IACD0E,EAAI,GACV4P,GAAMnD,EAAI+C,EAAKxP,GACfwP,EAAKxP,GAAK4P,EAAK,IACfA,EAAKzH,EAAMyH,EAAK,MAGhBC,EAAS,SAASpD,GAGpB,IAFA,GAAIzM,GAAI,EACJ1E,EAAI,IACA0E,GAAK,GACX1E,GAAKkU,EAAKxP,GACVwP,EAAKxP,GAAKmI,EAAM7M,EAAImR,GACpBnR,EAAKA,EAAImR,EAAK,KAGdqD,EAAc,WAGhB,IAFA,GAAI9P,GAAI,EACJ+P,EAAI,KACA/P,GAAK,GACX,GAAS,KAAN+P,GAAkB,IAAN/P,GAAuB,IAAZwP,EAAKxP,GAAS,CACtC,GAAIgQ,GAAI1K,OAAOkK,EAAKxP,GACpB+P,GAAU,KAANA,EAAWC,EAAID,EAAIV,EAAOjU,KAAKsU,EAAM,EAAIM,EAAE9P,QAAU8P,EAE3D,MAAOD,IAEPE,EAAM,SAAS1E,EAAGkB,EAAGyD,GACvB,MAAa,KAANzD,EAAUyD,EAAMzD,EAAI,IAAM,EAAIwD,EAAI1E,EAAGkB,EAAI,EAAGyD,EAAM3E,GAAK0E,EAAI1E,EAAIA,EAAGkB,EAAI,EAAGyD,IAE9EC,EAAM,SAAS5E,GAGjB,IAFA,GAAIkB,GAAK,EACL2D,EAAK7E,EACH6E,GAAM,MACV3D,GAAK,GACL2D,GAAM,IAER,MAAMA,GAAM,GACV3D,GAAM,EACN2D,GAAM,CACN,OAAO3D,GAGX9Q,GAAQA,EAAQmE,EAAInE,EAAQ+F,KAAO4N,IACV,UAAvB,KAAQC,QAAQ,IACG,MAAnB,GAAIA,QAAQ,IACS,SAArB,MAAMA,QAAQ,IACsB,yBAApC,mBAAqBA,QAAQ,MACzB1U,EAAoB,GAAG,WAE3ByU,EAASlU,YACN,UACHmU,QAAS,QAASA,SAAQc,GACxB,GAIIvN,GAAGwN,EAAGhF,EAAGH,EAJTI,EAAI6D,EAAaxQ,KAAM6Q,GACvBtS,EAAI6K,EAAUqI,GACdN,EAAI,GACJ1U,EAAIqU,CAER,IAAGvS,EAAI,GAAKA,EAAI,GAAG,KAAMoT,YAAWd,EACpC,IAAGlE,GAAKA,EAAE,MAAO,KACjB,IAAGA,UAAcA,GAAK,KAAK,MAAOjG,QAAOiG,EAKzC,IAJGA,EAAI,IACLwE,EAAI,IACJxE,GAAKA,GAEJA,EAAI,MAKL,GAJAzI,EAAIqN,EAAI5E,EAAI0E,EAAI,EAAG,GAAI,IAAM,GAC7BK,EAAIxN,EAAI,EAAIyI,EAAI0E,EAAI,GAAInN,EAAG,GAAKyI,EAAI0E,EAAI,EAAGnN,EAAG,GAC9CwN,GAAK,iBACLxN,EAAI,GAAKA,EACNA,EAAI,EAAE,CAGP,IAFA6M,EAAS,EAAGW,GACZhF,EAAInO,EACEmO,GAAK,GACTqE,EAAS,IAAK,GACdrE,GAAK,CAIP,KAFAqE,EAASM,EAAI,GAAI3E,EAAG,GAAI,GACxBA,EAAIxI,EAAI,EACFwI,GAAK,IACTuE,EAAO,GAAK,IACZvE,GAAK,EAEPuE,GAAO,GAAKvE,GACZqE,EAAS,EAAG,GACZE,EAAO,GACPxU,EAAIyU,QAEJH,GAAS,EAAGW,GACZX,EAAS,IAAM7M,EAAG,GAClBzH,EAAIyU,IAAgBT,EAAOjU,KAAKsU,EAAMvS,EAQxC,OALCA,GAAI,GACLgO,EAAI9P,EAAE6E,OACN7E,EAAI0U,GAAK5E,GAAKhO,EAAI,KAAOkS,EAAOjU,KAAKsU,EAAMvS,EAAIgO,GAAK9P,EAAIA,EAAEqM,MAAM,EAAGyD,EAAIhO,GAAK,IAAM9B,EAAEqM,MAAMyD,EAAIhO,KAE9F9B,EAAI0U,EAAI1U,EACDA,MAMR,SAASJ,EAAQD,EAASH,GAE/B,GAAI4M,GAAM5M,EAAoB,GAC9BI,GAAOD,QAAU,SAAS+D,EAAIyR,GAC5B,GAAgB,gBAANzR,IAA6B,UAAX0I,EAAI1I,GAAgB,KAAMkC,WAAUuP,EAChE,QAAQzR,IAKL,SAAS9D,EAAQD,EAASH,GAG/B,GAAImN,GAAYnN,EAAoB,IAChC2M,EAAY3M,EAAoB,GAEpCI,GAAOD,QAAU,QAASqU,QAAOoB,GAC/B,GAAIC,GAAMpL,OAAOkC,EAAQ5I,OACrB+R,EAAM,GACNlE,EAAMzE,EAAUyI,EACpB,IAAGhE,EAAI,GAAKA,GAAKmE,EAAAA,EAAS,KAAML,YAAW,0BAC3C,MAAK9D,EAAI,GAAIA,KAAO,KAAOiE,GAAOA,GAAY,EAAJjE,IAAMkE,GAAOD,EACvD,OAAOC,KAKJ,SAAS1V,EAAQD,EAASH,GAG/B,GAAIc,GAAed,EAAoB,GACnCkB,EAAelB,EAAoB,GACnCuU,EAAevU,EAAoB,IACnCgW,EAAe,GAAGC,WAEtBnV,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK3F,EAAO,WAEtC,MAA2C,MAApC8U,EAAazV,KAAK,EAAGT,OACvBoB,EAAO,WAEZ8U,EAAazV,YACV,UACH0V,YAAa,QAASA,aAAYC,GAChC,GAAInL,GAAOwJ,EAAaxQ,KAAM,4CAC9B,OAAOmS,KAAcpW,EAAYkW,EAAazV,KAAKwK,GAAQiL,EAAazV,KAAKwK,EAAMmL,OAMlF,SAAS9V,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,UAAWkP,QAASxO,KAAKyN,IAAI,UAI3C,SAAShV,EAAQD,EAASH,GAG/B,GAAIc,GAAYd,EAAoB,GAChCoW,EAAYpW,EAAoB,GAAGqW,QAEvCvV,GAAQA,EAAQmG,EAAG,UACjBoP,SAAU,QAASA,UAASnS,GAC1B,MAAoB,gBAANA,IAAkBkS,EAAUlS,OAMzC,SAAS9D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,UAAWqP,UAAWtW,EAAoB,OAIxD,SAASI,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,IAC/BsN,EAAW3F,KAAK2F,KACpBlN,GAAOD,QAAU,QAASmW,WAAUpS,GAClC,OAAQuF,EAASvF,IAAOmS,SAASnS,IAAOoJ,EAAMpJ,KAAQA,IAKnD,SAAS9D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,UACjBsG,MAAO,QAASA,OAAMgJ,GACpB,MAAOA,IAAUA,MAMhB,SAASnW,EAAQD,EAASH,GAG/B,GAAIc,GAAYd,EAAoB,GAChCsW,EAAYtW,EAAoB,IAChCwW,EAAY7O,KAAK6O,GAErB1V,GAAQA,EAAQmG,EAAG,UACjBwP,cAAe,QAASA,eAAcF,GACpC,MAAOD,GAAUC,IAAWC,EAAID,IAAW,qBAM1C,SAASnW,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,UAAWyP,iBAAkB,oBAI3C,SAAStW,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,UAAW0P,sCAIzB,SAASvW,EAAQD,EAASH,GAE/B,GAAIc,GAAcd,EAAoB,GAClC4W,EAAc5W,EAAoB,GAEtCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAK4M,OAAOoD,YAAcD,GAAc,UAAWC,WAAYD,KAItF,SAASxW,EAAQD,EAASH,GAE/B,GAAI4W,GAAc5W,EAAoB,GAAG6W,WACrCtE,EAAcvS,EAAoB,IAAIwS,IAE1CpS,GAAOD,QAAU,EAAIyW,EAAY5W,EAAoB,IAAM,UAAW+V,EAAAA,GAAW,QAASc,YAAWhB,GACnG,GAAIzB,GAAS7B,EAAM9H,OAAOoL,GAAM,GAC5B9P,EAAS6Q,EAAYxC,EACzB,OAAkB,KAAXrO,GAAoC,KAApBqO,EAAOjI,OAAO,MAAiBpG,GACpD6Q,GAIC,SAASxW,EAAQD,EAASH,GAE/B,GAAIc,GAAYd,EAAoB,GAChC8W,EAAY9W,EAAoB,GAEpCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAK4M,OAAOD,UAAYsD,GAAY,UAAWtD,SAAUsD,KAIhF,SAAS1W,EAAQD,EAASH,GAE/B,GAAI8W,GAAY9W,EAAoB,GAAGwT,SACnCjB,EAAYvS,EAAoB,IAAIwS,KACpCuE,EAAY/W,EAAoB,IAChCgX,EAAY,cAEhB5W,GAAOD,QAAmC,IAAzB2W,EAAUC,EAAK,OAA0C,KAA3BD,EAAUC,EAAK,QAAiB,QAASvD,UAASqC,EAAK5C,GACpG,GAAImB,GAAS7B,EAAM9H,OAAOoL,GAAM,EAChC,OAAOiB,GAAU1C,EAASnB,IAAU,IAAO+D,EAAIjG,KAAKqD,GAAU,GAAK,MACjE0C,GAIC,SAAS1W,EAAQD,EAASH,GAE/B,GAAIc,GAAYd,EAAoB,GAChC8W,EAAY9W,EAAoB,GAEpCc,GAAQA,EAAQ6F,EAAI7F,EAAQ+F,GAAK2M,UAAYsD,IAAatD,SAAUsD,KAI/D,SAAS1W,EAAQD,EAASH,GAE/B,GAAIc,GAAcd,EAAoB,GAClC4W,EAAc5W,EAAoB,GAEtCc,GAAQA,EAAQ6F,EAAI7F,EAAQ+F,GAAKgQ,YAAcD,IAAeC,WAAYD,KAIrE,SAASxW,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BiX,EAAUjX,EAAoB,KAC9BkX,EAAUvP,KAAKuP,KACfC,EAAUxP,KAAKyP,KAEnBtW,GAAQA,EAAQmG,EAAInG,EAAQ+F,IAAMsQ,GAEW,KAAxCxP,KAAK2F,MAAM6J,EAAO1D,OAAO4D,aAEzBF,EAAOpB,EAAAA,IAAaA,EAAAA,GACtB,QACDqB,MAAO,QAASA,OAAM1G,GACpB,OAAQA,GAAKA,GAAK,EAAI2C,IAAM3C,EAAI,kBAC5B/I,KAAK2N,IAAI5E,GAAK/I,KAAK2P,IACnBL,EAAMvG,EAAI,EAAIwG,EAAKxG,EAAI,GAAKwG,EAAKxG,EAAI,QAMxC,SAAStQ,EAAQD,GAGtBC,EAAOD,QAAUwH,KAAKsP,OAAS,QAASA,OAAMvG,GAC5C,OAAQA,GAAKA,UAAcA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAI/I,KAAK2N,IAAI,EAAI5E,KAKhE,SAAStQ,EAAQD,EAASH,GAM/B,QAASuX,OAAM7G,GACb,MAAQ2F,UAAS3F,GAAKA,IAAW,GAALA,EAAaA,EAAI,GAAK6G,OAAO7G,GAAK/I,KAAK2N,IAAI5E,EAAI/I,KAAKuP,KAAKxG,EAAIA,EAAI,IAAxDA,EAJvC,GAAI5P,GAAUd,EAAoB,GAC9BwX,EAAU7P,KAAK4P,KAOnBzW,GAAQA,EAAQmG,EAAInG,EAAQ+F,IAAM2Q,GAAU,EAAIA,EAAO,GAAK,GAAI,QAASD,MAAOA,SAI3E,SAASnX,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9ByX,EAAU9P,KAAK+P,KAGnB5W,GAAQA,EAAQmG,EAAInG,EAAQ+F,IAAM4Q,GAAU,EAAIA,MAAa,GAAI,QAC/DC,MAAO,QAASA,OAAMhH,GACpB,MAAmB,KAAXA,GAAKA,GAAUA,EAAI/I,KAAK2N,KAAK,EAAI5E,IAAM,EAAIA,IAAM,MAMxD,SAAStQ,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9B2X,EAAU3X,EAAoB,IAElCc,GAAQA,EAAQmG,EAAG,QACjB2Q,KAAM,QAASA,MAAKlH,GAClB,MAAOiH,GAAKjH,GAAKA,GAAK/I,KAAKyN,IAAIzN,KAAK6O,IAAI9F,GAAI,EAAI,OAM/C,SAAStQ,EAAQD,GAGtBC,EAAOD,QAAUwH,KAAKgQ,MAAQ,QAASA,MAAKjH,GAC1C,MAAmB,KAAXA,GAAKA,IAAWA,GAAKA,EAAIA,EAAIA,EAAI,KAAS,IAK/C,SAAStQ,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjB4Q,MAAO,QAASA,OAAMnH,GACpB,OAAQA,KAAO,GAAK,GAAK/I,KAAK2F,MAAM3F,KAAK2N,IAAI5E,EAAI,IAAO/I,KAAKmQ,OAAS,OAMrE,SAAS1X,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9ByI,EAAUd,KAAKc,GAEnB3H,GAAQA,EAAQmG,EAAG,QACjB8Q,KAAM,QAASA,MAAKrH,GAClB,OAAQjI,EAAIiI,GAAKA,GAAKjI,GAAKiI,IAAM,MAMhC,SAAStQ,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BgY,EAAUhY,EAAoB,IAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKmR,GAAUrQ,KAAKsQ,OAAQ,QAASA,MAAOD,KAInE,SAAS5X,EAAQD,GAGtB,GAAI6X,GAASrQ,KAAKsQ,KAClB7X,GAAOD,SAAY6X,GAEdA,EAAO,IAAM,oBAAsBA,EAAO,IAAM,oBAEhDA,kBACD,QAASC,OAAMvH,GACjB,MAAmB,KAAXA,GAAKA,GAAUA,EAAIA,SAAaA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAI/I,KAAKc,IAAIiI,GAAK,GAC/EsH,GAIC,SAAS5X,EAAQD,EAASH,GAG/B,GAAIc,GAAYd,EAAoB,GAChC2X,EAAY3X,EAAoB,KAChCoV,EAAYzN,KAAKyN,IACjBe,EAAYf,EAAI,OAChB8C,EAAY9C,EAAI,OAChB+C,EAAY/C,EAAI,EAAG,MAAQ,EAAI8C,GAC/BE,EAAYhD,EAAI,QAEhBiD,EAAkB,SAASzG,GAC7B,MAAOA,GAAI,EAAIuE,EAAU,EAAIA,EAI/BrV,GAAQA,EAAQmG,EAAG,QACjBqR,OAAQ,QAASA,QAAO5H,GACtB,GAEIzM,GAAG8B,EAFHwS,EAAQ5Q,KAAK6O,IAAI9F,GACjB8H,EAAQb,EAAKjH,EAEjB,OAAG6H,GAAOH,EAAaI,EAAQH,EAAgBE,EAAOH,EAAQF,GAAaE,EAAQF,GACnFjU,GAAK,EAAIiU,EAAY/B,GAAWoC,EAChCxS,EAAS9B,GAAKA,EAAIsU,GACfxS,EAASoS,GAASpS,GAAUA,EAAcyS,GAAQzC,EAAAA,GAC9CyC,EAAQzS,OAMd,SAAS3F,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BwW,EAAU7O,KAAK6O,GAEnB1V,GAAQA,EAAQmG,EAAG,QACjBwR,MAAO,QAASA,OAAMC,EAAQC,GAM5B,IALA,GAII9K,GAAK+K,EAJLC,EAAO,EACP1T,EAAO,EACPqL,EAAOnK,UAAUhB,OACjByT,EAAO,EAEL3T,EAAIqL,GACR3C,EAAM2I,EAAInQ,UAAUlB,MACjB2T,EAAOjL,GACR+K,EAAOE,EAAOjL,EACdgL,EAAOA,EAAMD,EAAMA,EAAM,EACzBE,EAAOjL,GACCA,EAAM,GACd+K,EAAO/K,EAAMiL,EACbD,GAAOD,EAAMA,GACRC,GAAOhL,CAEhB,OAAOiL,KAAS/C,EAAAA,EAAWA,EAAAA,EAAW+C,EAAOnR,KAAKuP,KAAK2B,OAMtD,SAASzY,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9B+Y,EAAUpR,KAAKqR,IAGnBlY,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAI7G,EAAoB,GAAG,WACrD,MAAO+Y,GAAM,WAAY,QAA4B,GAAhBA,EAAM1T,SACzC,QACF2T,KAAM,QAASA,MAAKtI,EAAGC,GACrB,GAAIsI,GAAS,MACTC,GAAMxI,EACNyI,GAAMxI,EACNyI,EAAKH,EAASC,EACdG,EAAKJ,EAASE,CAClB,OAAO,GAAIC,EAAKC,IAAOJ,EAASC,IAAO,IAAMG,EAAKD,GAAMH,EAASE,IAAO,KAAO,KAAO,OAMrF,SAAS/Y,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjBqS,MAAO,QAASA,OAAM5I,GACpB,MAAO/I,MAAK2N,IAAI5E,GAAK/I,KAAK4R,SAMzB,SAASnZ,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QAASgQ,MAAOjX,EAAoB,QAIlD,SAASI,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjBuS,KAAM,QAASA,MAAK9I,GAClB,MAAO/I,MAAK2N,IAAI5E,GAAK/I,KAAK2P,QAMzB,SAASlX,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QAAS0Q,KAAM3X,EAAoB,QAIjD,SAASI,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BiY,EAAUjY,EAAoB,KAC9ByI,EAAUd,KAAKc,GAGnB3H,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAI7G,EAAoB,GAAG,WACrD,OAAQ2H,KAAK8R,uBACX,QACFA,KAAM,QAASA,MAAK/I,GAClB,MAAO/I,MAAK6O,IAAI9F,GAAKA,GAAK,GACrBuH,EAAMvH,GAAKuH,GAAOvH,IAAM,GACxBjI,EAAIiI,EAAI,GAAKjI,GAAKiI,EAAI,KAAO/I,KAAKlC,EAAI,OAM1C,SAASrF,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BiY,EAAUjY,EAAoB,KAC9ByI,EAAUd,KAAKc,GAEnB3H,GAAQA,EAAQmG,EAAG,QACjByS,KAAM,QAASA,MAAKhJ,GAClB,GAAIzM,GAAIgU,EAAMvH,GAAKA,GACf1F,EAAIiN,GAAOvH,EACf,OAAOzM,IAAK8R,EAAAA,EAAW,EAAI/K,GAAK+K,EAAAA,MAAiB9R,EAAI+G,IAAMvC,EAAIiI,GAAKjI,GAAKiI,QAMxE,SAAStQ,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjB0S,MAAO,QAASA,OAAMzV,GACpB,OAAQA,EAAK,EAAIyD,KAAK2F,MAAQ3F,KAAK0F,MAAMnJ,OAMxC,SAAS9D,EAAQD,EAASH,GAE/B,GAAIc,GAAiBd,EAAoB,GACrC+M,EAAiB/M,EAAoB,IACrC4Z,EAAiBnP,OAAOmP,aACxBC,EAAiBpP,OAAOqP,aAG5BhZ,GAAQA,EAAQmG,EAAInG,EAAQ+F,KAAOgT,GAA2C,GAAzBA,EAAexU,QAAc,UAEhFyU,cAAe,QAASA,eAAcpJ,GAKpC,IAJA,GAGI4C,GAHAwC,KACAtF,EAAOnK,UAAUhB,OACjBF,EAAO,EAELqL,EAAOrL,GAAE,CAEb,GADAmO,GAAQjN,UAAUlB,KACf4H,EAAQuG,EAAM,WAAcA,EAAK,KAAMoC,YAAWpC,EAAO,6BAC5DwC,GAAI9P,KAAKsN,EAAO,MACZsG,EAAatG,GACbsG,IAAetG,GAAQ,QAAY,IAAM,MAAQA,EAAO,KAAQ,QAEpE,MAAOwC,GAAItL,KAAK,QAMjB,SAASpK,EAAQD,EAASH,GAE/B,GAAIc,GAAYd,EAAoB,GAChC6B,EAAY7B,EAAoB,IAChC8M,EAAY9M,EAAoB,GAEpCc,GAAQA,EAAQmG,EAAG,UAEjB8S,IAAK,QAASA,KAAIC,GAMhB,IALA,GAAIC,GAAOpY,EAAUmY,EAASD,KAC1BpI,EAAO7E,EAASmN,EAAI5U,QACpBmL,EAAOnK,UAAUhB,OACjByQ,KACA3Q,EAAO,EACLwM,EAAMxM,GACV2Q,EAAI9P,KAAKyE,OAAOwP,EAAI9U,OACjBA,EAAIqL,GAAKsF,EAAI9P,KAAKyE,OAAOpE,UAAUlB,IACtC,OAAO2Q,GAAItL,KAAK,QAMjB,SAASpK,EAAQD,EAASH,GAI/BA,EAAoB,IAAI,OAAQ,SAASuS,GACvC,MAAO,SAASC,QACd,MAAOD,GAAMxO,KAAM,OAMlB,SAAS3D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9Bka,EAAUla,EAAoB,MAAK,EACvCc,GAAQA,EAAQmE,EAAG,UAEjBkV,YAAa,QAASA,aAAYC,GAChC,MAAOF,GAAInW,KAAMqW,OAMhB,SAASha,EAAQD,EAASH,GAE/B,GAAImN,GAAYnN,EAAoB,IAChC2M,EAAY3M,EAAoB,GAGpCI,GAAOD,QAAU,SAAS+J,GACxB,MAAO,UAASa,EAAMqP,GACpB,GAGInW,GAAG+G,EAHHkK,EAAIzK,OAAOkC,EAAQ5B,IACnB5F,EAAIgI,EAAUiN,GACdhV,EAAI8P,EAAE7P,MAEV,OAAGF,GAAI,GAAKA,GAAKC,EAAS8E,EAAY,GAAKpK,GAC3CmE,EAAIiR,EAAE9B,WAAWjO,GACVlB,EAAI,OAAUA,EAAI,OAAUkB,EAAI,IAAMC,IAAM4F,EAAIkK,EAAE9B,WAAWjO,EAAI,IAAM,OAAU6F,EAAI,MACxFd,EAAYgL,EAAE/I,OAAOhH,GAAKlB,EAC1BiG,EAAYgL,EAAErI,MAAM1H,EAAGA,EAAI,IAAMlB,EAAI,OAAU,KAAO+G,EAAI,OAAU,UAMvE,SAAS5K,EAAQD,EAASH,GAI/B,GAAIc,GAAYd,EAAoB,GAChC8M,EAAY9M,EAAoB,IAChCqa,EAAYra,EAAoB,KAChCsa,EAAY,WACZC,EAAY,GAAGD,EAEnBxZ,GAAQA,EAAQmE,EAAInE,EAAQ+F,EAAI7G,EAAoB,KAAKsa,GAAY,UACnEE,SAAU,QAASA,UAASC,GAC1B,GAAI1P,GAAOsP,EAAQtW,KAAM0W,EAAcH,GACnCI,EAAcrU,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,EACpD6R,EAAS7E,EAAS/B,EAAK1F,QACvBsV,EAASD,IAAgB5a,EAAY6R,EAAMhK,KAAKyF,IAAIN,EAAS4N,GAAc/I,GAC3EiJ,EAASnQ,OAAOgQ,EACpB,OAAOF,GACHA,EAAUha,KAAKwK,EAAM6P,EAAQD,GAC7B5P,EAAK8B,MAAM8N,EAAMC,EAAOvV,OAAQsV,KAASC,MAM5C,SAASxa,EAAQD,EAASH,GAG/B,GAAI6a,GAAW7a,EAAoB,KAC/B2M,EAAW3M,EAAoB,GAEnCI,GAAOD,QAAU,SAAS4K,EAAM0P,EAAcvI,GAC5C,GAAG2I,EAASJ,GAAc,KAAMrU,WAAU,UAAY8L,EAAO,yBAC7D,OAAOzH,QAAOkC,EAAQ5B,MAKnB,SAAS3K,EAAQD,EAASH,GAG/B,GAAIyJ,GAAWzJ,EAAoB,IAC/B4M,EAAW5M,EAAoB,IAC/B8a,EAAW9a,EAAoB,IAAI,QACvCI,GAAOD,QAAU,SAAS+D,GACxB,GAAI2W,EACJ,OAAOpR,GAASvF,MAAS2W,EAAW3W,EAAG4W,MAAYhb,IAAc+a,EAAsB,UAAXjO,EAAI1I,MAK7E,SAAS9D,EAAQD,EAASH,GAE/B,GAAI8a,GAAQ9a,EAAoB,IAAI,QACpCI,GAAOD,QAAU,SAASc,GACxB,GAAI8Z,GAAK,GACT,KACE,MAAM9Z,GAAK8Z,GACX,MAAM9S,GACN,IAEE,MADA8S,GAAGD,IAAS,GACJ,MAAM7Z,GAAK8Z,GACnB,MAAMzY,KACR,OAAO,IAKN,SAASlC,EAAQD,EAASH,GAI/B,GAAIc,GAAWd,EAAoB,GAC/Bqa,EAAWra,EAAoB,KAC/Bgb,EAAW,UAEfla,GAAQA,EAAQmE,EAAInE,EAAQ+F,EAAI7G,EAAoB,KAAKgb,GAAW,UAClEC,SAAU,QAASA,UAASR,GAC1B,SAAUJ,EAAQtW,KAAM0W,EAAcO,GACnCE,QAAQT,EAAcpU,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,OAM9D,SAASM,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmE,EAAG,UAEjBuP,OAAQxU,EAAoB,OAKzB,SAASI,EAAQD,EAASH,GAI/B,GAAIc,GAAcd,EAAoB,GAClC8M,EAAc9M,EAAoB,IAClCqa,EAAcra,EAAoB,KAClCmb,EAAc,aACdC,EAAc,GAAGD,EAErBra,GAAQA,EAAQmE,EAAInE,EAAQ+F,EAAI7G,EAAoB,KAAKmb,GAAc,UACrEE,WAAY,QAASA,YAAWZ,GAC9B,GAAI1P,GAASsP,EAAQtW,KAAM0W,EAAcU,GACrC7O,EAASQ,EAASnF,KAAKyF,IAAI/G,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,EAAWiL,EAAK1F,SACjFuV,EAASnQ,OAAOgQ,EACpB,OAAOW,GACHA,EAAY7a,KAAKwK,EAAM6P,EAAQtO,GAC/BvB,EAAK8B,MAAMP,EAAOA,EAAQsO,EAAOvV,UAAYuV,MAMhD,SAASxa,EAAQD,EAASH,GAG/B,GAAIka,GAAOla,EAAoB,MAAK,EAGpCA,GAAoB,KAAKyK,OAAQ,SAAU,SAAS6Q,GAClDvX,KAAKwX,GAAK9Q,OAAO6Q,GACjBvX,KAAKyX,GAAK,GAET,WACD,GAEIC,GAFAlS,EAAQxF,KAAKwX,GACbjP,EAAQvI,KAAKyX,EAEjB,OAAGlP,IAAS/C,EAAElE,QAAerB,MAAOlE,EAAW4b,MAAM,IACrDD,EAAQvB,EAAI3Q,EAAG+C,GACfvI,KAAKyX,IAAMC,EAAMpW,QACTrB,MAAOyX,EAAOC,MAAM,OAKzB,SAAStb,EAAQD,EAASH,GAG/B,GAAIkM,GAAiBlM,EAAoB,IACrCc,EAAiBd,EAAoB,GACrCe,EAAiBf,EAAoB,IACrCmI,EAAiBnI,EAAoB,GACrCY,EAAiBZ,EAAoB,GACrC2b,EAAiB3b,EAAoB,KACrC4b,EAAiB5b,EAAoB,KACrCoB,EAAiBpB,EAAoB,IACrCqP,EAAiBrP,EAAoB,IACrC6b,EAAiB7b,EAAoB,IAAI,YACzC8b,OAAsB5W,MAAQ,WAAaA,QAC3C6W,EAAiB,aACjBC,EAAiB,OACjBC,EAAiB,SAEjBC,EAAa,WAAY,MAAOnY,MAEpC3D,GAAOD,QAAU,SAASwS,EAAMT,EAAMiK,EAAaC,EAAMC,EAASC,EAAQC,GACxEX,EAAYO,EAAajK,EAAMkK,EAC/B,IAeII,GAASrY,EAAKsY,EAfdC,EAAY,SAASC,GACvB,IAAIb,GAASa,IAAQ7L,GAAM,MAAOA,GAAM6L,EACxC,QAAOA,GACL,IAAKX,GAAM,MAAO,SAAS9W,QAAQ,MAAO,IAAIiX,GAAYpY,KAAM4Y,GAChE,KAAKV,GAAQ,MAAO,SAASW,UAAU,MAAO,IAAIT,GAAYpY,KAAM4Y,IACpE,MAAO,SAASE,WAAW,MAAO,IAAIV,GAAYpY,KAAM4Y,KAExD7Q,EAAaoG,EAAO,YACpB4K,EAAaT,GAAWJ,EACxBc,GAAa,EACbjM,EAAa6B,EAAKjI,UAClBsS,EAAalM,EAAM+K,IAAa/K,EAAMiL,IAAgBM,GAAWvL,EAAMuL,GACvEY,EAAaD,GAAWN,EAAUL,GAClCa,EAAab,EAAWS,EAAwBJ,EAAU,WAArBO,EAAkCnd,EACvEqd,EAAqB,SAARjL,EAAkBpB,EAAM+L,SAAWG,EAAUA,CAwB9D,IArBGG,IACDV,EAAoBpN,EAAe8N,EAAW5c,KAAK,GAAIoS,KACpD8J,IAAsBjZ,OAAOkH,YAE9BtJ,EAAeqb,EAAmB3Q,GAAK,GAEnCI,GAAYtL,EAAI6b,EAAmBZ,IAAU1T,EAAKsU,EAAmBZ,EAAUK,KAIpFY,GAAcE,GAAWA,EAAQtW,OAASuV,IAC3Cc,GAAa,EACbE,EAAW,QAASL,UAAU,MAAOI,GAAQzc,KAAKwD,QAG/CmI,IAAWqQ,IAAYT,IAASiB,GAAejM,EAAM+K,IACxD1T,EAAK2I,EAAO+K,EAAUoB,GAGxBtB,EAAUzJ,GAAQ+K,EAClBtB,EAAU7P,GAAQoQ,EACfG,EAMD,GALAG,GACEI,OAASE,EAAaG,EAAWP,EAAUT,GAC3C/W,KAASoX,EAAaW,EAAWP,EAAUV,GAC3Ca,QAASK,GAERX,EAAO,IAAIpY,IAAOqY,GACdrY,IAAO2M,IAAO/P,EAAS+P,EAAO3M,EAAKqY,EAAQrY,QAC3CrD,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAKiV,GAASiB,GAAa7K,EAAMsK,EAEtE,OAAOA,KAKJ,SAASpc,EAAQD,GAEtBC,EAAOD,YAIF,SAASC,EAAQD,EAASH,GAG/B,GAAIuF,GAAiBvF,EAAoB,IACrCod,EAAiBpd,EAAoB,IACrCoB,EAAiBpB,EAAoB,IACrCyc,IAGJzc,GAAoB,GAAGyc,EAAmBzc,EAAoB,IAAI,YAAa,WAAY,MAAO+D,QAElG3D,EAAOD,QAAU,SAASgc,EAAajK,EAAMkK,GAC3CD,EAAYzR,UAAYnF,EAAOkX,GAAoBL,KAAMgB,EAAW,EAAGhB,KACvEhb,EAAe+a,EAAajK,EAAO,eAKhC,SAAS9R,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,SAAU,SAASqd,GAC1C,MAAO,SAASC,QAAO5W,GACrB,MAAO2W,GAAWtZ,KAAM,IAAK,OAAQ2C,OAMpC,SAAStG,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,GAC9BkP,EAAUlP,EAAoB,GAC9B2M,EAAU3M,EAAoB,IAC9Bud,EAAU,KAEVF,EAAa,SAASjJ,EAAQ7P,EAAKiZ,EAAWxZ,GAChD,GAAIiD,GAAKwD,OAAOkC,EAAQyH,IACpBqJ,EAAK,IAAMlZ,CAEf,OADiB,KAAdiZ,IAAiBC,GAAM,IAAMD,EAAY,KAAO/S,OAAOzG,GAAOsQ,QAAQiJ,EAAM,UAAY,KACpFE,EAAK,IAAMxW,EAAI,KAAO1C,EAAM,IAErCnE,GAAOD,QAAU,SAAS+R,EAAMlK,GAC9B,GAAIuB,KACJA,GAAE2I,GAAQlK,EAAKqV,GACfvc,EAAQA,EAAQmE,EAAInE,EAAQ+F,EAAIqI,EAAM,WACpC,GAAI6B,GAAO,GAAGmB,GAAM,IACpB,OAAOnB,KAASA,EAAK2M,eAAiB3M,EAAKhK,MAAM,KAAK1B,OAAS,IAC7D,SAAUkE,KAKX,SAASnJ,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,MAAO,SAASqd,GACvC,MAAO,SAASM,OACd,MAAON,GAAWtZ,KAAM,MAAO,GAAI,QAMlC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,QAAS,SAASqd,GACzC,MAAO,SAASO,SACd,MAAOP,GAAWtZ,KAAM,QAAS,GAAI,QAMpC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,OAAQ,SAASqd,GACxC,MAAO,SAASQ,QACd,MAAOR,GAAWtZ,KAAM,IAAK,GAAI,QAMhC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,QAAS,SAASqd,GACzC,MAAO,SAASS,SACd,MAAOT,GAAWtZ,KAAM,KAAM,GAAI,QAMjC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,YAAa,SAASqd,GAC7C,MAAO,SAASU,WAAUC,GACxB,MAAOX,GAAWtZ,KAAM,OAAQ,QAASia,OAMxC,SAAS5d,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,WAAY,SAASqd,GAC5C,MAAO,SAASY,UAASC,GACvB,MAAOb,GAAWtZ,KAAM,OAAQ,OAAQma,OAMvC,SAAS9d,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,UAAW,SAASqd,GAC3C,MAAO,SAASc,WACd,MAAOd,GAAWtZ,KAAM,IAAK,GAAI,QAMhC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,OAAQ,SAASqd,GACxC,MAAO,SAASe,MAAKC,GACnB,MAAOhB,GAAWtZ,KAAM,IAAK,OAAQsa,OAMpC,SAASje,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,QAAS,SAASqd,GACzC,MAAO,SAASiB,SACd,MAAOjB,GAAWtZ,KAAM,QAAS,GAAI,QAMpC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,SAAU,SAASqd,GAC1C,MAAO,SAASkB,UACd,MAAOlB,GAAWtZ,KAAM,SAAU,GAAI,QAMrC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,MAAO,SAASqd,GACvC,MAAO,SAASmB,OACd,MAAOnB,GAAWtZ,KAAM,MAAO,GAAI,QAMlC,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,KAAK,MAAO,SAASqd,GACvC,MAAO,SAASoB,OACd,MAAOpB,GAAWtZ,KAAM,MAAO,GAAI,QAMlC,SAAS3D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,SAAUtF,QAAS3B,EAAoB,OAIrD,SAASI,EAAQD,EAASH,GAG/B,GAAIoI,GAAiBpI,EAAoB,IACrCc,EAAiBd,EAAoB,GACrCmP,EAAiBnP,EAAoB,IACrCO,EAAiBP,EAAoB,KACrC0e,EAAiB1e,EAAoB,KACrC8M,EAAiB9M,EAAoB,IACrC2e,EAAiB3e,EAAoB,KACrC4e,EAAiB5e,EAAoB,IAEzCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAK7G,EAAoB,KAAK,SAAS6e,GAAOjR,MAAMkR,KAAKD,KAAW,SAE9FC,KAAM,QAASA,MAAKC,GAClB,GAOI1Z,GAAQU,EAAQiZ,EAAMra,EAPtB4E,EAAU4F,EAAS4P,GACnBrL,EAAyB,kBAAR3P,MAAqBA,KAAO6J,MAC7C4C,EAAUnK,UAAUhB,OACpB4Z,EAAUzO,EAAO,EAAInK,UAAU,GAAKvG,EACpCof,EAAUD,IAAUnf,EACpBwM,EAAU,EACV6S,EAAUP,EAAUrV,EAIxB,IAFG2V,IAAQD,EAAQ7W,EAAI6W,EAAOzO,EAAO,EAAInK,UAAU,GAAKvG,EAAW,IAEhEqf,GAAUrf,GAAe4T,GAAK9F,OAAS8Q,EAAYS,GAMpD,IADA9Z,EAASyH,EAASvD,EAAElE,QAChBU,EAAS,GAAI2N,GAAErO,GAASA,EAASiH,EAAOA,IAC1CqS,EAAe5Y,EAAQuG,EAAO4S,EAAUD,EAAM1V,EAAE+C,GAAQA,GAAS/C,EAAE+C,QANrE,KAAI3H,EAAWwa,EAAO5e,KAAKgJ,GAAIxD,EAAS,GAAI2N,KAAKsL,EAAOra,EAASyX,QAAQV,KAAMpP,IAC7EqS,EAAe5Y,EAAQuG,EAAO4S,EAAU3e,EAAKoE,EAAUsa,GAAQD,EAAKhb,MAAOsI,IAAQ,GAAQ0S,EAAKhb,MASpG,OADA+B,GAAOV,OAASiH,EACTvG,MAON,SAAS3F,EAAQD,EAASH,GAG/B,GAAI4B,GAAW5B,EAAoB,GACnCI,GAAOD,QAAU,SAASwE,EAAUkF,EAAI7F,EAAO6Y,GAC7C,IACE,MAAOA,GAAUhT,EAAGjI,EAASoC,GAAO,GAAIA,EAAM,IAAM6F,EAAG7F,GAEvD,MAAMiE,GACN,GAAImX,GAAMza,EAAS,SAEnB,MADGya,KAAQtf,GAAU8B,EAASwd,EAAI7e,KAAKoE,IACjCsD,KAML,SAAS7H,EAAQD,EAASH,GAG/B,GAAI2b,GAAa3b,EAAoB,KACjC6b,EAAa7b,EAAoB,IAAI,YACrCqf,EAAazR,MAAMlD,SAEvBtK,GAAOD,QAAU,SAAS+D,GACxB,MAAOA,KAAOpE,IAAc6b,EAAU/N,QAAU1J,GAAMmb,EAAWxD,KAAc3X,KAK5E,SAAS9D,EAAQD,EAASH,GAG/B,GAAI4E,GAAkB5E,EAAoB,GACtC+B,EAAkB/B,EAAoB,GAE1CI,GAAOD,QAAU,SAASkJ,EAAQiD,EAAOtI,GACpCsI,IAASjD,GAAOzE,EAAgBtC,EAAE+G,EAAQiD,EAAOvK,EAAW,EAAGiC,IAC7DqF,EAAOiD,GAAStI,IAKlB,SAAS5D,EAAQD,EAASH,GAE/B,GAAIkR,GAAYlR,EAAoB,IAChC6b,EAAY7b,EAAoB,IAAI,YACpC2b,EAAY3b,EAAoB,IACpCI,GAAOD,QAAUH,EAAoB,GAAGsf,kBAAoB,SAASpb;AACnE,GAAGA,GAAMpE,EAAU,MAAOoE,GAAG2X,IACxB3X,EAAG,eACHyX,EAAUzK,EAAQhN,MAKpB,SAAS9D,EAAQD,EAASH,GAE/B,GAAI6b,GAAe7b,EAAoB,IAAI,YACvCuf,GAAe,CAEnB,KACE,GAAIC,IAAS,GAAG3D,IAChB2D,GAAM,UAAY,WAAYD,GAAe,GAC7C3R,MAAMkR,KAAKU,EAAO,WAAY,KAAM,KACpC,MAAMvX,IAER7H,EAAOD,QAAU,SAAS6H,EAAMyX,GAC9B,IAAIA,IAAgBF,EAAa,OAAO,CACxC,IAAIjV,IAAO,CACX,KACE,GAAIoV,IAAQ,GACRb,EAAOa,EAAI7D,IACfgD,GAAKzC,KAAO,WAAY,OAAQV,KAAMpR,GAAO,IAC7CoV,EAAI7D,GAAY,WAAY,MAAOgD,IACnC7W,EAAK0X,GACL,MAAMzX,IACR,MAAOqC,KAKJ,SAASlK,EAAQD,EAASH,GAG/B,GAAIc,GAAiBd,EAAoB,GACrC2e,EAAiB3e,EAAoB,IAGzCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAI7G,EAAoB,GAAG,WACrD,QAAS6G,MACT,QAAS+G,MAAM+R,GAAGpf,KAAKsG,YAAcA,MACnC,SAEF8Y,GAAI,QAASA,MAIX,IAHA,GAAIrT,GAAS,EACTkE,EAASnK,UAAUhB,OACnBU,EAAS,IAAoB,kBAARhC,MAAqBA,KAAO6J,OAAO4C,GACtDA,EAAOlE,GAAMqS,EAAe5Y,EAAQuG,EAAOjG,UAAUiG,KAE3D,OADAvG,GAAOV,OAASmL,EACTzK,MAMN,SAAS3F,EAAQD,EAASH,GAI/B,GAAIc,GAAYd,EAAoB,GAChC6B,EAAY7B,EAAoB,IAChC4f,KAAepV,IAGnB1J,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK7G,EAAoB,KAAOwD,SAAWxD,EAAoB,KAAK4f,IAAa,SAC3GpV,KAAM,QAASA,MAAKqV,GAClB,MAAOD,GAAUrf,KAAKsB,EAAUkC,MAAO8b,IAAc/f,EAAY,IAAM+f,OAMtE,SAASzf,EAAQD,EAASH,GAE/B,GAAIkP,GAAQlP,EAAoB,EAEhCI,GAAOD,QAAU,SAAS2f,EAAQjS,GAChC,QAASiS,GAAU5Q,EAAM,WACvBrB,EAAMiS,EAAOvf,KAAK,KAAM,aAAc,GAAKuf,EAAOvf,KAAK,UAMtD,SAASH,EAAQD,EAASH,GAG/B,GAAIc,GAAad,EAAoB,GACjC+f,EAAa/f,EAAoB,IACjC4M,EAAa5M,EAAoB,IACjC+M,EAAa/M,EAAoB,IACjC8M,EAAa9M,EAAoB,IACjCwR,KAAgB3E,KAGpB/L,GAAQA,EAAQmE,EAAInE,EAAQ+F,EAAI7G,EAAoB,GAAG,WAClD+f,GAAKvO,EAAWjR,KAAKwf,KACtB,SACFlT,MAAO,QAASA,OAAMmT,EAAOrF,GAC3B,GAAIhJ,GAAQ7E,EAAS/I,KAAKsB,QACtB4a,EAAQrT,EAAI7I,KAEhB,IADA4W,EAAMA,IAAQ7a,EAAY6R,EAAMgJ,EACpB,SAATsF,EAAiB,MAAOzO,GAAWjR,KAAKwD,KAAMic,EAAOrF,EAMxD,KALA,GAAIuF,GAASnT,EAAQiT,EAAOrO,GACxBwO,EAASpT,EAAQ4N,EAAKhJ,GACtBuM,EAASpR,EAASqT,EAAOD,GACzBE,EAASxS,MAAMsQ,GACf/Y,EAAS,EACPA,EAAI+Y,EAAM/Y,IAAIib,EAAOjb,GAAc,UAAT8a,EAC5Blc,KAAKoI,OAAO+T,EAAQ/a,GACpBpB,KAAKmc,EAAQ/a,EACjB,OAAOib,OAMN,SAAShgB,EAAQD,EAASH,GAG/B,GAAIc,GAAYd,EAAoB,GAChC8K,EAAY9K,EAAoB,IAChCmP,EAAYnP,EAAoB,IAChCkP,EAAYlP,EAAoB,GAChCqgB,KAAeC,KACfvP,GAAa,EAAG,EAAG,EAEvBjQ,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAKqI,EAAM,WAErC6B,EAAKuP,KAAKxgB,OACLoP,EAAM,WAEX6B,EAAKuP,KAAK,UAELtgB,EAAoB,KAAKqgB,IAAS,SAEvCC,KAAM,QAASA,MAAKC,GAClB,MAAOA,KAAczgB,EACjBugB,EAAM9f,KAAK4O,EAASpL,OACpBsc,EAAM9f,KAAK4O,EAASpL,MAAO+G,EAAUyV,QAMxC,SAASngB,EAAQD,EAASH,GAG/B,GAAIc,GAAWd,EAAoB,GAC/BwgB,EAAWxgB,EAAoB,KAAK,GACpCygB,EAAWzgB,EAAoB,QAAQqQ,SAAS,EAEpDvP,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK4Z,EAAQ,SAEvCpQ,QAAS,QAASA,SAAQqQ,GACxB,MAAOF,GAASzc,KAAM2c,EAAYra,UAAU,QAM3C,SAASjG,EAAQD,EAASH,GAS/B,GAAIoI,GAAWpI,EAAoB,IAC/B0M,EAAW1M,EAAoB,IAC/BmP,EAAWnP,EAAoB,IAC/B8M,EAAW9M,EAAoB,IAC/B2gB,EAAW3gB,EAAoB,IACnCI,GAAOD,QAAU,SAASkU,EAAM/O,GAC9B,GAAIsb,GAAwB,GAARvM,EAChBwM,EAAwB,GAARxM,EAChByM,EAAwB,GAARzM,EAChB0M,EAAwB,GAAR1M,EAChB2M,EAAwB,GAAR3M,EAChB4M,EAAwB,GAAR5M,GAAa2M,EAC7Bzb,EAAgBD,GAAWqb,CAC/B,OAAO,UAAS1T,EAAOyT,EAAY3V,GAQjC,IAPA,GAMIjB,GAAKgM,EANLvM,EAAS4F,EAASlC,GAClBpF,EAAS6E,EAAQnD,GACjBjH,EAAS8F,EAAIsY,EAAY3V,EAAM,GAC/B1F,EAASyH,EAASjF,EAAKxC,QACvBiH,EAAS,EACTvG,EAAS6a,EAASrb,EAAO0H,EAAO5H,GAAUwb,EAAYtb,EAAO0H,EAAO,GAAKnN,EAExEuF,EAASiH,EAAOA,IAAQ,IAAG2U,GAAY3U,IAASzE,MACnDiC,EAAMjC,EAAKyE,GACXwJ,EAAMxT,EAAEwH,EAAKwC,EAAO/C,GACjB8K,GACD,GAAGuM,EAAO7a,EAAOuG,GAASwJ,MACrB,IAAGA,EAAI,OAAOzB,GACjB,IAAK,GAAG,OAAO,CACf,KAAK,GAAG,MAAOvK,EACf,KAAK,GAAG,MAAOwC,EACf,KAAK,GAAGvG,EAAOC,KAAK8D,OACf,IAAGiX,EAAS,OAAO,CAG9B,OAAOC,MAAqBF,GAAWC,EAAWA,EAAWhb,KAM5D,SAAS3F,EAAQD,EAASH,GAG/B,GAAIkhB,GAAqBlhB,EAAoB,IAE7CI,GAAOD,QAAU,SAASghB,EAAU9b,GAClC,MAAO,KAAK6b,EAAmBC,IAAW9b,KAKvC,SAASjF,EAAQD,EAASH,GAE/B,GAAIyJ,GAAWzJ,EAAoB,IAC/B2B,EAAW3B,EAAoB,IAC/BohB,EAAWphB,EAAoB,IAAI,UAEvCI,GAAOD,QAAU,SAASghB,GACxB,GAAIzN,EASF,OARC/R,GAAQwf,KACTzN,EAAIyN,EAAS7R,YAEE,kBAALoE,IAAoBA,IAAM9F,QAASjM,EAAQ+R,EAAEhJ,aAAYgJ,EAAI5T,GACpE2J,EAASiK,KACVA,EAAIA,EAAE0N,GACG,OAAN1N,IAAWA,EAAI5T,KAEb4T,IAAM5T,EAAY8N,MAAQ8F,IAKhC,SAAStT,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BqhB,EAAUrhB,EAAoB,KAAK,EAEvCc,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK7G,EAAoB,QAAQshB,KAAK,GAAO,SAEvEA,IAAK,QAASA,KAAIZ,GAChB,MAAOW,GAAKtd,KAAM2c,EAAYra,UAAU,QAMvC,SAASjG,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BuhB,EAAUvhB,EAAoB,KAAK,EAEvCc,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK7G,EAAoB,QAAQwhB,QAAQ,GAAO,SAE1EA,OAAQ,QAASA,QAAOd,GACtB,MAAOa,GAAQxd,KAAM2c,EAAYra,UAAU,QAM1C,SAASjG,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9ByhB,EAAUzhB,EAAoB,KAAK,EAEvCc,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK7G,EAAoB,QAAQ0hB,MAAM,GAAO,SAExEA,KAAM,QAASA,MAAKhB,GAClB,MAAOe,GAAM1d,KAAM2c,EAAYra,UAAU,QAMxC,SAASjG,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9B2hB,EAAU3hB,EAAoB,KAAK,EAEvCc,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK7G,EAAoB,QAAQ4hB,OAAO,GAAO,SAEzEA,MAAO,QAASA,OAAMlB,GACpB,MAAOiB,GAAO5d,KAAM2c,EAAYra,UAAU,QAMzC,SAASjG,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9B6hB,EAAU7hB,EAAoB,IAElCc,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK7G,EAAoB,QAAQ8hB,QAAQ,GAAO,SAE1EA,OAAQ,QAASA,QAAOpB,GACtB,MAAOmB,GAAQ9d,KAAM2c,EAAYra,UAAUhB,OAAQgB,UAAU,IAAI,OAMhE,SAASjG,EAAQD,EAASH,GAE/B,GAAI8K,GAAY9K,EAAoB,IAChCmP,EAAYnP,EAAoB,IAChC0M,EAAY1M,EAAoB,IAChC8M,EAAY9M,EAAoB,GAEpCI,GAAOD,QAAU,SAAS4K,EAAM2V,EAAYlQ,EAAMuR,EAAMC,GACtDlX,EAAU4V,EACV,IAAInX,GAAS4F,EAASpE,GAClBlD,EAAS6E,EAAQnD,GACjBlE,EAASyH,EAASvD,EAAElE,QACpBiH,EAAS0V,EAAU3c,EAAS,EAAI,EAChCF,EAAS6c,KAAe,CAC5B,IAAGxR,EAAO,EAAE,OAAO,CACjB,GAAGlE,IAASzE,GAAK,CACfka,EAAOla,EAAKyE,GACZA,GAASnH,CACT,OAGF,GADAmH,GAASnH,EACN6c,EAAU1V,EAAQ,EAAIjH,GAAUiH,EACjC,KAAMlG,WAAU,+CAGpB,KAAK4b,EAAU1V,GAAS,EAAIjH,EAASiH,EAAOA,GAASnH,EAAKmH,IAASzE,KACjEka,EAAOrB,EAAWqB,EAAMla,EAAKyE,GAAQA,EAAO/C,GAE9C,OAAOwY,KAKJ,SAAS3hB,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9B6hB,EAAU7hB,EAAoB,IAElCc,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK7G,EAAoB,QAAQiiB,aAAa,GAAO,SAE/EA,YAAa,QAASA,aAAYvB,GAChC,MAAOmB,GAAQ9d,KAAM2c,EAAYra,UAAUhB,OAAQgB,UAAU,IAAI,OAMhE,SAASjG,EAAQD,EAASH,GAG/B,GAAIc,GAAgBd,EAAoB,GACpCkiB,EAAgBliB,EAAoB,KAAI,GACxCgd,KAAmB9B,QACnBiH,IAAkBnF,GAAW,GAAK,GAAG9B,QAAQ,MAAS,CAE1Dpa,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAKsb,IAAkBniB,EAAoB,KAAKgd,IAAW,SAErF9B,QAAS,QAASA,SAAQkH,GACxB,MAAOD,GAEHnF,EAAQvV,MAAM1D,KAAMsC,YAAc,EAClC6b,EAASne,KAAMqe,EAAe/b,UAAU,QAM3C,SAASjG,EAAQD,EAASH,GAG/B,GAAIc,GAAgBd,EAAoB,GACpC6B,EAAgB7B,EAAoB,IACpCmN,EAAgBnN,EAAoB,IACpC8M,EAAgB9M,EAAoB,IACpCgd,KAAmBqF,YACnBF,IAAkBnF,GAAW,GAAK,GAAGqF,YAAY,MAAS,CAE9DvhB,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAKsb,IAAkBniB,EAAoB,KAAKgd,IAAW,SAErFqF,YAAa,QAASA,aAAYD,GAEhC,GAAGD,EAAc,MAAOnF,GAAQvV,MAAM1D,KAAMsC,YAAc,CAC1D,IAAIkD,GAAS1H,EAAUkC,MACnBsB,EAASyH,EAASvD,EAAElE,QACpBiH,EAASjH,EAAS,CAGtB,KAFGgB,UAAUhB,OAAS,IAAEiH,EAAQ3E,KAAKyF,IAAId,EAAOa,EAAU9G,UAAU,MACjEiG,EAAQ,IAAEA,EAAQjH,EAASiH,GACzBA,GAAS,EAAGA,IAAQ,GAAGA,IAAS/C,IAAKA,EAAE+C,KAAW8V,EAAc,MAAO9V,IAAS,CACrF,cAMC,SAASlM,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmE,EAAG,SAAUqd,WAAYtiB,EAAoB,OAE7DA,EAAoB,KAAK,eAIpB,SAASI,EAAQD,EAASH,GAI/B,GAAImP,GAAWnP,EAAoB,IAC/B+M,EAAW/M,EAAoB,IAC/B8M,EAAW9M,EAAoB,GAEnCI,GAAOD,WAAamiB,YAAc,QAASA,YAAWtZ,EAAekX,GACnE,GAAI3W,GAAQ4F,EAASpL,MACjB4N,EAAQ7E,EAASvD,EAAElE,QACnBkd,EAAQxV,EAAQ/D,EAAQ2I,GACxBmN,EAAQ/R,EAAQmT,EAAOvO,GACvBgJ,EAAQtU,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,EAC9C8V,EAAQjO,KAAKyF,KAAKuN,IAAQ7a,EAAY6R,EAAM5E,EAAQ4N,EAAKhJ,IAAQmN,EAAMnN,EAAM4Q,GAC7EC,EAAQ,CAMZ,KALG1D,EAAOyD,GAAMA,EAAKzD,EAAOlJ,IAC1B4M,KACA1D,GAAQlJ,EAAQ,EAChB2M,GAAQ3M,EAAQ,GAEZA,KAAU,GACXkJ,IAAQvV,GAAEA,EAAEgZ,GAAMhZ,EAAEuV,SACXvV,GAAEgZ,GACdA,GAAQC,EACR1D,GAAQ0D,CACR,OAAOjZ,KAKN,SAASnJ,EAAQD,EAASH,GAG/B,GAAIyiB,GAAcziB,EAAoB,IAAI,eACtCqf,EAAczR,MAAMlD,SACrB2U,GAAWoD,IAAgB3iB,GAAUE,EAAoB,GAAGqf,EAAYoD,MAC3EriB,EAAOD,QAAU,SAASgE,GACxBkb,EAAWoD,GAAate,IAAO,IAK5B,SAAS/D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmE,EAAG,SAAUyd,KAAM1iB,EAAoB,OAEvDA,EAAoB,KAAK,SAIpB,SAASI,EAAQD,EAASH,GAI/B,GAAImP,GAAWnP,EAAoB,IAC/B+M,EAAW/M,EAAoB,IAC/B8M,EAAW9M,EAAoB,GACnCI,GAAOD,QAAU,QAASuiB,MAAK1e,GAO7B,IANA,GAAIuF,GAAS4F,EAASpL,MAClBsB,EAASyH,EAASvD,EAAElE,QACpBmL,EAASnK,UAAUhB,OACnBiH,EAASS,EAAQyD,EAAO,EAAInK,UAAU,GAAKvG,EAAWuF,GACtDsV,EAASnK,EAAO,EAAInK,UAAU,GAAKvG,EACnC6iB,EAAShI,IAAQ7a,EAAYuF,EAAS0H,EAAQ4N,EAAKtV,GACjDsd,EAASrW,GAAM/C,EAAE+C,KAAWtI,CAClC,OAAOuF,KAKJ,SAASnJ,EAAQD,EAASH,GAI/B,GAAIc,GAAUd,EAAoB,GAC9B4iB,EAAU5iB,EAAoB,KAAK,GACnCiB,EAAU,OACV4hB,GAAU,CAEX5hB,SAAU2M,MAAM,GAAG3M,GAAK,WAAY4hB,GAAS,IAChD/hB,EAAQA,EAAQmE,EAAInE,EAAQ+F,EAAIgc,EAAQ,SACtCC,KAAM,QAASA,MAAKpC,GAClB,MAAOkC,GAAM7e,KAAM2c,EAAYra,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,MAGzEE,EAAoB,KAAKiB,IAIpB,SAASb,EAAQD,EAASH,GAI/B,GAAIc,GAAUd,EAAoB,GAC9B4iB,EAAU5iB,EAAoB,KAAK,GACnCiB,EAAU,YACV4hB,GAAU,CAEX5hB,SAAU2M,MAAM,GAAG3M,GAAK,WAAY4hB,GAAS,IAChD/hB,EAAQA,EAAQmE,EAAInE,EAAQ+F,EAAIgc,EAAQ,SACtCE,UAAW,QAASA,WAAUrC,GAC5B,MAAOkC,GAAM7e,KAAM2c,EAAYra,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,MAGzEE,EAAoB,KAAKiB,IAIpB,SAASb,EAAQD,EAASH,GAG/B,GAAIgjB,GAAmBhjB,EAAoB,KACvCgf,EAAmBhf,EAAoB,KACvC2b,EAAmB3b,EAAoB,KACvC6B,EAAmB7B,EAAoB,GAM3CI,GAAOD,QAAUH,EAAoB,KAAK4N,MAAO,QAAS,SAAS0N,EAAUqB,GAC3E5Y,KAAKwX,GAAK1Z,EAAUyZ,GACpBvX,KAAKyX,GAAK,EACVzX,KAAKU,GAAKkY,GAET,WACD,GAAIpT,GAAQxF,KAAKwX,GACboB,EAAQ5Y,KAAKU,GACb6H,EAAQvI,KAAKyX,IACjB,QAAIjS,GAAK+C,GAAS/C,EAAElE,QAClBtB,KAAKwX,GAAKzb,EACHkf,EAAK,IAEH,QAARrC,EAAwBqC,EAAK,EAAG1S,GACxB,UAARqQ,EAAwBqC,EAAK,EAAGzV,EAAE+C,IAC9B0S,EAAK,GAAI1S,EAAO/C,EAAE+C,MACxB,UAGHqP,EAAUsH,UAAYtH,EAAU/N,MAEhCoV,EAAiB,QACjBA,EAAiB,UACjBA,EAAiB,YAIZ,SAAS5iB,EAAQD,GAEtBC,EAAOD,QAAU,SAASub,EAAM1X,GAC9B,OAAQA,MAAOA,EAAO0X,OAAQA,KAK3B,SAAStb,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,UAIpB,SAASI,EAAQD,EAASH,GAG/B,GAAIW,GAAcX,EAAoB,GAClCuC,EAAcvC,EAAoB,GAClCa,EAAcb,EAAoB,GAClCohB,EAAcphB,EAAoB,IAAI,UAE1CI,GAAOD,QAAU,SAASc,GACxB,GAAIyS,GAAI/S,EAAOM,EACZJ,IAAe6S,IAAMA,EAAE0N,IAAS7e,EAAGD,EAAEoR,EAAG0N,GACzC7a,cAAc,EACdzC,IAAK,WAAY,MAAOC,WAMvB,SAAS3D,EAAQD,EAASH,GAE/B,GAAIW,GAAoBX,EAAoB,GACxCsS,EAAoBtS,EAAoB,IACxCuC,EAAoBvC,EAAoB,GAAGsC,EAC3CE,EAAoBxC,EAAoB,IAAIsC,EAC5CuY,EAAoB7a,EAAoB,KACxCkjB,EAAoBljB,EAAoB,KACxCmjB,EAAoBxiB,EAAOoT,OAC3BpB,EAAoBwQ,EACpBrS,EAAoBqS,EAAQzY,UAC5B0Y,EAAoB,KACpBC,EAAoB,KAEpBC,EAAoB,GAAIH,GAAQC,KAASA,CAE7C,IAAGpjB,EAAoB,MAAQsjB,GAAetjB,EAAoB,GAAG,WAGnE,MAFAqjB,GAAIrjB,EAAoB,IAAI,WAAY,EAEjCmjB,EAAQC,IAAQA,GAAOD,EAAQE,IAAQA,GAA4B,QAArBF,EAAQC,EAAK,QAChE,CACFD,EAAU,QAASpP,QAAOrT,EAAG4B,GAC3B,GAAIihB,GAAOxf,eAAgBof,GACvBK,EAAO3I,EAASna,GAChB+iB,EAAOnhB,IAAMxC,CACjB,QAAQyjB,GAAQC,GAAQ9iB,EAAE4O,cAAgB6T,GAAWM,EAAM/iB,EACvD4R,EAAkBgR,EAChB,GAAI3Q,GAAK6Q,IAASC,EAAM/iB,EAAE4H,OAAS5H,EAAG4B,GACtCqQ,GAAM6Q,EAAO9iB,YAAayiB,IAAWziB,EAAE4H,OAAS5H,EAAG8iB,GAAQC,EAAMP,EAAO3iB,KAAKG,GAAK4B,GACpFihB,EAAOxf,KAAO+M,EAAOqS,GAS3B,KAAI,GAPAO,IAAQ,SAASvf,GACnBA,IAAOgf,IAAW5gB,EAAG4gB,EAAShf,GAC5BoC,cAAc,EACdzC,IAAK,WAAY,MAAO6O,GAAKxO,IAC7BqC,IAAK,SAAStC,GAAKyO,EAAKxO,GAAOD,OAG3BgB,EAAO1C,EAAKmQ,GAAOxN,EAAI,EAAGD,EAAKG,OAASF,GAAIue,EAAMxe,EAAKC,KAC/D2L,GAAMxB,YAAc6T,EACpBA,EAAQzY,UAAYoG,EACpB9Q,EAAoB,IAAIW,EAAQ,SAAUwiB,GAG5CnjB,EAAoB,KAAK,WAIpB,SAASI,EAAQD,EAASH,GAI/B,GAAI4B,GAAW5B,EAAoB,GACnCI,GAAOD,QAAU,WACf,GAAI4K,GAASnJ,EAASmC,MAClBgC,EAAS,EAMb,OALGgF,GAAKpK,SAAYoF,GAAU,KAC3BgF,EAAK4Y,aAAY5d,GAAU,KAC3BgF,EAAK6Y,YAAY7d,GAAU,KAC3BgF,EAAK8Y,UAAY9d,GAAU,KAC3BgF,EAAK+Y,SAAY/d,GAAU,KACvBA,IAKJ,SAAS3F,EAAQD,EAASH,GAG/BA,EAAoB,IACpB,IAAI4B,GAAc5B,EAAoB,IAClCkjB,EAAcljB,EAAoB,KAClCa,EAAcb,EAAoB,GAClCkK,EAAc,WACdC,EAAc,IAAID,GAElB6Z,EAAS,SAASla,GACpB7J,EAAoB,IAAI+T,OAAOrJ,UAAWR,EAAWL,GAAI,GAIxD7J,GAAoB,GAAG,WAAY,MAAoD,QAA7CmK,EAAU5J,MAAM+H,OAAQ,IAAK0b,MAAO,QAC/ED,EAAO,QAAStd,YACd,GAAI0C,GAAIvH,EAASmC,KACjB,OAAO,IAAI8G,OAAO1B,EAAEb,OAAQ,IAC1B,SAAWa,GAAIA,EAAE6a,OAASnjB,GAAesI,YAAa4K,QAASmP,EAAO3iB,KAAK4I,GAAKrJ,KAG5EqK,EAAUzD,MAAQwD,GAC1B6Z,EAAO,QAAStd,YACd,MAAO0D,GAAU5J,KAAKwD,SAMrB,SAAS3D,EAAQD,EAASH,GAG5BA,EAAoB,IAAoB,KAAd,KAAKgkB,OAAahkB,EAAoB,GAAGsC,EAAEyR,OAAOrJ,UAAW,SACxFnE,cAAc,EACdzC,IAAK9D,EAAoB,QAKtB,SAASI,EAAQD,EAASH,GAG/BA,EAAoB,KAAK,QAAS,EAAG,SAAS2M,EAASmO,EAAOmJ,GAE5D,OAAQ,QAAS9R,OAAM+R,GAErB,GAAI3a,GAAKoD,EAAQ5I,MACb8F,EAAKqa,GAAUpkB,EAAYA,EAAYokB,EAAOpJ,EAClD,OAAOjR,KAAO/J,EAAY+J,EAAGtJ,KAAK2jB,EAAQ3a,GAAK,GAAIwK,QAAOmQ,GAAQpJ,GAAOrQ,OAAOlB,KAC/E0a,MAKA,SAAS7jB,EAAQD,EAASH,GAG/B,GAAImI,GAAWnI,EAAoB,GAC/Be,EAAWf,EAAoB,IAC/BkP,EAAWlP,EAAoB,GAC/B2M,EAAW3M,EAAoB,IAC/BsB,EAAWtB,EAAoB,GAEnCI,GAAOD,QAAU,SAASc,EAAKoE,EAAQ2C,GACrC,GAAImc,GAAW7iB,EAAIL,GACfmjB,EAAWpc,EAAK2E,EAASwX,EAAQ,GAAGljB,IACpCojB,EAAWD,EAAI,GACfE,EAAWF,EAAI,EAChBlV,GAAM,WACP,GAAI3F,KAEJ,OADAA,GAAE4a,GAAU,WAAY,MAAO,IACV,GAAd,GAAGljB,GAAKsI,OAEfxI,EAAS0J,OAAOC,UAAWzJ,EAAKojB,GAChClc,EAAK4L,OAAOrJ,UAAWyZ,EAAkB,GAAV9e,EAG3B,SAAS+O,EAAQvG,GAAM,MAAOyW,GAAK/jB,KAAK6T,EAAQrQ,KAAM8J,IAGtD,SAASuG,GAAS,MAAOkQ,GAAK/jB,KAAK6T,EAAQrQ,WAO9C,SAAS3D,EAAQD,EAASH,GAG/BA,EAAoB,KAAK,UAAW,EAAG,SAAS2M,EAAS4X,EAASC,GAEhE,OAAQ,QAASlQ,SAAQmQ,EAAaC,GAEpC,GAAInb,GAAKoD,EAAQ5I,MACb8F,EAAK4a,GAAe3kB,EAAYA,EAAY2kB,EAAYF,EAC5D,OAAO1a,KAAO/J,EACV+J,EAAGtJ,KAAKkkB,EAAalb,EAAGmb,GACxBF,EAASjkB,KAAKkK,OAAOlB,GAAIkb,EAAaC,IACzCF,MAKA,SAASpkB,EAAQD,EAASH,GAG/BA,EAAoB,KAAK,SAAU,EAAG,SAAS2M,EAASgY,EAAQC,GAE9D,OAAQ,QAAShK,QAAOsJ,GAEtB,GAAI3a,GAAKoD,EAAQ5I,MACb8F,EAAKqa,GAAUpkB,EAAYA,EAAYokB,EAAOS,EAClD,OAAO9a,KAAO/J,EAAY+J,EAAGtJ,KAAK2jB,EAAQ3a,GAAK,GAAIwK,QAAOmQ,GAAQS,GAAQla,OAAOlB,KAChFqb,MAKA,SAASxkB,EAAQD,EAASH,GAG/BA,EAAoB,KAAK,QAAS,EAAG,SAAS2M,EAASkY,EAAOC,GAE5D,GAAIjK,GAAa7a,EAAoB,KACjC+kB,EAAaD,EACbE,KAAgBhf,KAChBif,EAAa,QACbC,EAAa,SACbC,EAAa,WACjB,IAC+B,KAA7B,OAAOF,GAAQ,QAAQ,IACe,GAAtC,OAAOA,GAAQ,WAAYC,IACQ,GAAnC,KAAKD,GAAQ,WAAWC,IACW,GAAnC,IAAID,GAAQ,YAAYC,IACxB,IAAID,GAAQ,QAAQC,GAAU,GAC9B,GAAGD,GAAQ,MAAMC,GAClB,CACC,GAAIE,GAAO,OAAOpd,KAAK,IAAI,KAAOlI,CAElCglB,GAAS,SAASjF,EAAWwF,GAC3B,GAAIjR,GAAS3J,OAAO1G,KACpB,IAAG8b,IAAc/f,GAAuB,IAAVulB,EAAY,QAE1C,KAAIxK,EAASgF,GAAW,MAAOkF,GAAOxkB,KAAK6T,EAAQyL,EAAWwF,EAC9D,IASIC,GAAYnT,EAAOoT,EAAWC,EAAYrgB,EAT1CsgB,KACAzB,GAASnE,EAAU8D,WAAa,IAAM,KAC7B9D,EAAU+D,UAAY,IAAM,KAC5B/D,EAAUgE,QAAU,IAAM,KAC1BhE,EAAUiE,OAAS,IAAM,IAClC4B,EAAgB,EAChBC,EAAaN,IAAUvlB,EAAY,WAAaulB,IAAU,EAE1DO,EAAgB,GAAI7R,QAAO8L,EAAUvX,OAAQ0b,EAAQ,IAIzD,KADIoB,IAAKE,EAAa,GAAIvR,QAAO,IAAM6R,EAActd,OAAS,WAAY0b,KACpE7R,EAAQyT,EAAc5d,KAAKoM,MAE/BmR,EAAYpT,EAAM7F,MAAQ6F,EAAM,GAAG+S,KAChCK,EAAYG,IACbD,EAAOzf,KAAKoO,EAAOvH,MAAM6Y,EAAevT,EAAM7F,SAE1C8Y,GAAQjT,EAAM+S,GAAU,GAAE/S,EAAM,GAAGmC,QAAQgR,EAAY,WACzD,IAAIngB,EAAI,EAAGA,EAAIkB,UAAU6e,GAAU,EAAG/f,IAAOkB,UAAUlB,KAAOrF,IAAUqS,EAAMhN,GAAKrF,KAElFqS,EAAM+S,GAAU,GAAK/S,EAAM7F,MAAQ8H,EAAO8Q,IAAQF,EAAMvd,MAAMge,EAAQtT,EAAMtF,MAAM,IACrF2Y,EAAarT,EAAM,GAAG+S,GACtBQ,EAAgBH,EACbE,EAAOP,IAAWS,MAEpBC,EAAcT,KAAgBhT,EAAM7F,OAAMsZ,EAAcT,IAK7D,OAHGO,KAAkBtR,EAAO8Q,IACvBM,GAAeI,EAAc7U,KAAK,KAAI0U,EAAOzf,KAAK,IAChDyf,EAAOzf,KAAKoO,EAAOvH,MAAM6Y,IACzBD,EAAOP,GAAUS,EAAaF,EAAO5Y,MAAM,EAAG8Y,GAAcF,OAG7D,IAAIR,GAAQnlB,EAAW,GAAGolB,KAClCJ,EAAS,SAASjF,EAAWwF,GAC3B,MAAOxF,KAAc/f,GAAuB,IAAVulB,KAAmBN,EAAOxkB,KAAKwD,KAAM8b,EAAWwF,IAItF,QAAQ,QAASte,OAAM8Y,EAAWwF,GAChC,GAAI9b,GAAKoD,EAAQ5I,MACb8F,EAAKgW,GAAa/f,EAAYA,EAAY+f,EAAUgF,EACxD,OAAOhb,KAAO/J,EAAY+J,EAAGtJ,KAAKsf,EAAWtW,EAAG8b,GAASP,EAAOvkB,KAAKkK,OAAOlB,GAAIsW,EAAWwF,IAC1FP,MAKA,SAAS1kB,EAAQD,EAASH,GAG/B,GAmBI6lB,GAAUC,EAA0BC,EAnBpC7Z,EAAqBlM,EAAoB,IACzCW,EAAqBX,EAAoB,GACzCoI,EAAqBpI,EAAoB,IACzCkR,EAAqBlR,EAAoB,IACzCc,EAAqBd,EAAoB,GACzCyJ,EAAqBzJ,EAAoB,IACzC8K,EAAqB9K,EAAoB,IACzCgmB,EAAqBhmB,EAAoB,KACzCimB,EAAqBjmB,EAAoB,KACzCkhB,EAAqBlhB,EAAoB,KACzCkmB,EAAqBlmB,EAAoB,KAAKwG,IAC9C2f,EAAqBnmB,EAAoB,OACzComB,EAAqB,UACrBhgB,EAAqBzF,EAAOyF,UAC5BigB,EAAqB1lB,EAAO0lB,QAC5BC,EAAqB3lB,EAAOylB,GAC5BC,EAAqB1lB,EAAO0lB,QAC5BE,EAAyC,WAApBrV,EAAQmV,GAC7BG,EAAqB,aAGrB/iB,IAAe,WACjB,IAEE,GAAIgjB,GAAcH,EAASI,QAAQ,GAC/BC,GAAeF,EAAQnX,gBAAkBtP,EAAoB,IAAI,YAAc,SAASgI,GAAOA,EAAKwe,EAAOA,GAE/G,QAAQD,GAA0C,kBAAzBK,yBAAwCH,EAAQI,KAAKL,YAAkBG,GAChG,MAAM1e,QAIN6e,EAAkB,SAAS7iB,EAAG+G,GAEhC,MAAO/G,KAAM+G,GAAK/G,IAAMqiB,GAAYtb,IAAM+a,GAExCgB,EAAa,SAAS7iB,GACxB,GAAI2iB,EACJ,UAAOpd,EAASvF,IAAkC,mBAAnB2iB,EAAO3iB,EAAG2iB,QAAsBA,GAE7DG,EAAuB,SAAStT,GAClC,MAAOoT,GAAgBR,EAAU5S,GAC7B,GAAIuT,GAAkBvT,GACtB,GAAIoS,GAAyBpS,IAE/BuT,EAAoBnB,EAA2B,SAASpS,GAC1D,GAAIgT,GAASQ,CACbnjB,MAAK0iB,QAAU,GAAI/S,GAAE,SAASyT,EAAWC,GACvC,GAAGV,IAAY5mB,GAAaonB,IAAWpnB,EAAU,KAAMsG,GAAU,0BACjEsgB,GAAUS,EACVD,EAAUE,IAEZrjB,KAAK2iB,QAAU5b,EAAU4b,GACzB3iB,KAAKmjB,OAAUpc,EAAUoc,IAEvBG,EAAU,SAASrf,GACrB,IACEA,IACA,MAAMC,GACN,OAAQqf,MAAOrf,KAGfsf,EAAS,SAASd,EAASe,GAC7B,IAAGf,EAAQgB,GAAX,CACAhB,EAAQgB,IAAK,CACb,IAAIC,GAAQjB,EAAQkB,EACpBxB,GAAU,WAgCR,IA/BA,GAAIniB,GAAQyiB,EAAQmB,GAChBC,EAAsB,GAAdpB,EAAQqB,GAChB3iB,EAAQ,EACR4iB,EAAM,SAASC,GACjB,GAIIjiB,GAAQ8gB,EAJRoB,EAAUJ,EAAKG,EAASH,GAAKG,EAASE,KACtCxB,EAAUsB,EAAStB,QACnBQ,EAAUc,EAASd,OACnBiB,EAAUH,EAASG,MAEvB,KACKF,GACGJ,IACe,GAAdpB,EAAQ2B,IAAQC,EAAkB5B,GACrCA,EAAQ2B,GAAK,GAEZH,KAAY,EAAKliB,EAAS/B,GAExBmkB,GAAOA,EAAOG,QACjBviB,EAASkiB,EAAQjkB,GACdmkB,GAAOA,EAAOI,QAEhBxiB,IAAWiiB,EAASvB,QACrBS,EAAO9gB,EAAU,yBACTygB,EAAOE,EAAWhhB,IAC1B8gB,EAAKtmB,KAAKwF,EAAQ2gB,EAASQ,GACtBR,EAAQ3gB,IACVmhB,EAAOljB,GACd,MAAMiE,GACNif,EAAOjf,KAGLyf,EAAMriB,OAASF,GAAE4iB,EAAIL,EAAMviB,KACjCshB,GAAQkB,MACRlB,EAAQgB,IAAK,EACVD,IAAaf,EAAQ2B,IAAGI,EAAY/B,OAGvC+B,EAAc,SAAS/B,GACzBP,EAAK3lB,KAAKI,EAAQ,WAChB,GACI8nB,GAAQR,EAASS,EADjB1kB,EAAQyiB,EAAQmB,EAepB,IAbGe,EAAYlC,KACbgC,EAASpB,EAAQ,WACZd,EACDF,EAAQuC,KAAK,qBAAsB5kB,EAAOyiB,IAClCwB,EAAUtnB,EAAOkoB,sBACzBZ,GAASxB,QAASA,EAASqC,OAAQ9kB,KAC1B0kB,EAAU/nB,EAAO+nB,UAAYA,EAAQpB,OAC9CoB,EAAQpB,MAAM,8BAA+BtjB,KAIjDyiB,EAAQ2B,GAAK7B,GAAUoC,EAAYlC,GAAW,EAAI,GAClDA,EAAQsC,GAAKjpB,EACZ2oB,EAAO,KAAMA,GAAOnB,SAGvBqB,EAAc,SAASlC,GACzB,GAAiB,GAAdA,EAAQ2B,GAAQ,OAAO,CAI1B,KAHA,GAEIJ,GAFAN,EAAQjB,EAAQsC,IAAMtC,EAAQkB,GAC9BxiB,EAAQ,EAENuiB,EAAMriB,OAASF,GAEnB,GADA6iB,EAAWN,EAAMviB,KACd6iB,EAASE,OAASS,EAAYX,EAASvB,SAAS,OAAO,CAC1D,QAAO,GAEP4B,EAAoB,SAAS5B,GAC/BP,EAAK3lB,KAAKI,EAAQ,WAChB,GAAIsnB,EACD1B,GACDF,EAAQuC,KAAK,mBAAoBnC,IACzBwB,EAAUtnB,EAAOqoB,qBACzBf,GAASxB,QAASA,EAASqC,OAAQrC,EAAQmB,QAI7CqB,EAAU,SAASjlB,GACrB,GAAIyiB,GAAU1iB,IACX0iB,GAAQyC,KACXzC,EAAQyC,IAAK,EACbzC,EAAUA,EAAQ0C,IAAM1C,EACxBA,EAAQmB,GAAK5jB,EACbyiB,EAAQqB,GAAK,EACTrB,EAAQsC,KAAGtC,EAAQsC,GAAKtC,EAAQkB,GAAG9a,SACvC0a,EAAOd,GAAS,KAEd2C,EAAW,SAASplB,GACtB,GACI6iB,GADAJ,EAAU1iB,IAEd,KAAG0iB,EAAQyC,GAAX,CACAzC,EAAQyC,IAAK,EACbzC,EAAUA,EAAQ0C,IAAM1C,CACxB,KACE,GAAGA,IAAYziB,EAAM,KAAMoC,GAAU,qCAClCygB,EAAOE,EAAW/iB,IACnBmiB,EAAU,WACR,GAAIkD,IAAWF,GAAI1C,EAASyC,IAAI,EAChC,KACErC,EAAKtmB,KAAKyD,EAAOoE,EAAIghB,EAAUC,EAAS,GAAIjhB,EAAI6gB,EAASI,EAAS,IAClE,MAAMphB,GACNghB,EAAQ1oB,KAAK8oB,EAASphB,OAI1Bwe,EAAQmB,GAAK5jB,EACbyiB,EAAQqB,GAAK,EACbP,EAAOd,GAAS,IAElB,MAAMxe,GACNghB,EAAQ1oB,MAAM4oB,GAAI1C,EAASyC,IAAI,GAAQjhB,KAKvCxE,KAEF6iB,EAAW,QAASgD,SAAQC,GAC1BvD,EAAWjiB,KAAMuiB,EAAUF,EAAS,MACpCtb,EAAUye,GACV1D,EAAStlB,KAAKwD,KACd,KACEwlB,EAASnhB,EAAIghB,EAAUrlB,KAAM,GAAIqE,EAAI6gB,EAASllB,KAAM,IACpD,MAAMylB,GACNP,EAAQ1oB,KAAKwD,KAAMylB,KAGvB3D,EAAW,QAASyD,SAAQC,GAC1BxlB,KAAK4jB,MACL5jB,KAAKglB,GAAKjpB,EACViE,KAAK+jB,GAAK,EACV/jB,KAAKmlB,IAAK,EACVnlB,KAAK6jB,GAAK9nB,EACViE,KAAKqkB,GAAK,EACVrkB,KAAK0jB,IAAK,GAEZ5B,EAASnb,UAAY1K,EAAoB,KAAKsmB,EAAS5b,WAErDmc,KAAM,QAASA,MAAK4C,EAAaC,GAC/B,GAAI1B,GAAchB,EAAqB9F,EAAmBnd,KAAMuiB,GAOhE,OANA0B,GAASH,GAA+B,kBAAf4B,IAA4BA,EACrDzB,EAASE,KAA8B,kBAAdwB,IAA4BA,EACrD1B,EAASG,OAAS5B,EAASF,EAAQ8B,OAASroB,EAC5CiE,KAAK4jB,GAAG3hB,KAAKgiB,GACVjkB,KAAKglB,IAAGhlB,KAAKglB,GAAG/iB,KAAKgiB,GACrBjkB,KAAK+jB,IAAGP,EAAOxjB,MAAM,GACjBikB,EAASvB,SAGlBkD,QAAS,SAASD,GAChB,MAAO3lB,MAAK8iB,KAAK/mB,EAAW4pB,MAGhCzC,EAAoB,WAClB,GAAIR,GAAW,GAAIZ,EACnB9hB,MAAK0iB,QAAUA,EACf1iB,KAAK2iB,QAAUte,EAAIghB,EAAU3C,EAAS,GACtC1iB,KAAKmjB,OAAU9e,EAAI6gB,EAASxC,EAAS,KAIzC3lB,EAAQA,EAAQ6F,EAAI7F,EAAQ8F,EAAI9F,EAAQ+F,GAAKpD,GAAa6lB,QAAShD,IACnEtmB,EAAoB,IAAIsmB,EAAUF,GAClCpmB,EAAoB,KAAKomB,GACzBL,EAAU/lB,EAAoB,GAAGomB,GAGjCtlB,EAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKpD,EAAY2iB,GAE3Cc,OAAQ,QAASA,QAAO0C,GACtB,GAAIC,GAAa7C,EAAqBjjB,MAClCqjB,EAAayC,EAAW3C,MAE5B,OADAE,GAASwC,GACFC,EAAWpD,WAGtB3lB,EAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKqF,IAAYzI,GAAa2iB,GAExDM,QAAS,QAASA,SAAQhW,GAExB,GAAGA,YAAa4V,IAAYQ,EAAgBpW,EAAEpB,YAAavL,MAAM,MAAO2M,EACxE,IAAImZ,GAAa7C,EAAqBjjB,MAClCojB,EAAa0C,EAAWnD,OAE5B,OADAS,GAAUzW,GACHmZ,EAAWpD,WAGtB3lB,EAAQA,EAAQmG,EAAInG,EAAQ+F,IAAMpD,GAAczD,EAAoB,KAAK,SAAS6e,GAChFyH,EAASwD,IAAIjL,GAAM,SAAS2H,MACzBJ,GAEH0D,IAAK,QAASA,KAAIC,GAChB,GAAIrW,GAAa3P,KACb8lB,EAAa7C,EAAqBtT,GAClCgT,EAAamD,EAAWnD,QACxBQ,EAAa2C,EAAW3C,OACxBuB,EAASpB,EAAQ,WACnB,GAAIzK,MACAtQ,EAAY,EACZ0d,EAAY,CAChB/D,GAAM8D,GAAU,EAAO,SAAStD,GAC9B,GAAIwD,GAAgB3d,IAChB4d,GAAgB,CACpBtN,GAAO5W,KAAKlG,GACZkqB,IACAtW,EAAEgT,QAAQD,GAASI,KAAK,SAAS7iB,GAC5BkmB,IACHA,GAAiB,EACjBtN,EAAOqN,GAAUjmB,IACfgmB,GAAatD,EAAQ9J,KACtBsK,OAEH8C,GAAatD,EAAQ9J,IAGzB,OADG6L,IAAOvB,EAAOuB,EAAOnB,OACjBuC,EAAWpD,SAGpB0D,KAAM,QAASA,MAAKJ,GAClB,GAAIrW,GAAa3P,KACb8lB,EAAa7C,EAAqBtT,GAClCwT,EAAa2C,EAAW3C,OACxBuB,EAASpB,EAAQ,WACnBpB,EAAM8D,GAAU,EAAO,SAAStD,GAC9B/S,EAAEgT,QAAQD,GAASI,KAAKgD,EAAWnD,QAASQ,MAIhD,OADGuB,IAAOvB,EAAOuB,EAAOnB,OACjBuC,EAAWpD,YAMjB,SAASrmB,EAAQD,GAEtBC,EAAOD,QAAU,SAAS+D,EAAIiY,EAAazV,EAAM0jB,GAC/C,KAAKlmB,YAAciY,KAAiBiO,IAAmBtqB,GAAasqB,IAAkBlmB,GACpF,KAAMkC,WAAUM,EAAO,0BACvB,OAAOxC,KAKN,SAAS9D,EAAQD,EAASH,GAE/B,GAAIoI,GAAcpI,EAAoB,IAClCO,EAAcP,EAAoB,KAClC0e,EAAc1e,EAAoB,KAClC4B,EAAc5B,EAAoB,IAClC8M,EAAc9M,EAAoB,IAClC4e,EAAc5e,EAAoB,KAClCqqB,KACAC,KACAnqB,EAAUC,EAAOD,QAAU,SAAS4pB,EAAUlN,EAAShT,EAAIkB,EAAM8Q,GACnE,GAGIxW,GAAQ2Z,EAAMra,EAAUoB,EAHxBoZ,EAAStD,EAAW,WAAY,MAAOkO,IAAcnL,EAAUmL,GAC/DznB,EAAS8F,EAAIyB,EAAIkB,EAAM8R,EAAU,EAAI,GACrCvQ,EAAS,CAEb,IAAoB,kBAAV6S,GAAqB,KAAM/Y,WAAU2jB,EAAW,oBAE1D,IAAGrL,EAAYS,IAAQ,IAAI9Z,EAASyH,EAASid,EAAS1kB,QAASA,EAASiH,EAAOA,IAE7E,GADAvG,EAAS8W,EAAUva,EAAEV,EAASod,EAAO+K,EAASzd,IAAQ,GAAI0S,EAAK,IAAM1c,EAAEynB,EAASzd,IAC7EvG,IAAWskB,GAAStkB,IAAWukB,EAAO,MAAOvkB,OAC3C,KAAIpB,EAAWwa,EAAO5e,KAAKwpB,KAAa/K,EAAOra,EAASyX,QAAQV,MAErE,GADA3V,EAASxF,EAAKoE,EAAUrC,EAAG0c,EAAKhb,MAAO6Y,GACpC9W,IAAWskB,GAAStkB,IAAWukB,EAAO,MAAOvkB,GAGpD5F,GAAQkqB,MAASA,EACjBlqB,EAAQmqB,OAASA,GAIZ,SAASlqB,EAAQD,EAASH,GAG/B,GAAI4B,GAAY5B,EAAoB,IAChC8K,EAAY9K,EAAoB,IAChCohB,EAAYphB,EAAoB,IAAI,UACxCI,GAAOD,QAAU,SAASoJ,EAAGnF,GAC3B,GAAiC6C,GAA7ByM,EAAI9R,EAAS2H,GAAG+F,WACpB,OAAOoE,KAAM5T,IAAcmH,EAAIrF,EAAS8R,GAAG0N,KAAathB,EAAYsE,EAAI0G,EAAU7D,KAK/E,SAAS7G,EAAQD,EAASH,GAE/B,GAYIuqB,GAAOC,EAASC,EAZhBriB,EAAqBpI,EAAoB,IACzCuR,EAAqBvR,EAAoB,IACzC+f,EAAqB/f,EAAoB,IACzC0qB,EAAqB1qB,EAAoB,IACzCW,EAAqBX,EAAoB,GACzCqmB,EAAqB1lB,EAAO0lB,QAC5BsE,EAAqBhqB,EAAOiqB,aAC5BC,EAAqBlqB,EAAOmqB,eAC5BC,EAAqBpqB,EAAOoqB,eAC5BC,EAAqB,EACrBC,KACAC,EAAqB,qBAErBnD,EAAM,WACR,GAAI1nB,IAAM0D,IACV,IAAGknB,EAAMljB,eAAe1H,GAAI,CAC1B,GAAIwJ,GAAKohB,EAAM5qB,SACR4qB,GAAM5qB,GACbwJ,MAGAshB,EAAW,SAASC,GACtBrD,EAAIxnB,KAAK6qB,EAAMzW,MAGbgW,IAAYE,IACdF,EAAU,QAASC,cAAa/gB,GAE9B,IADA,GAAIrC,MAAWrC,EAAI,EACbkB,UAAUhB,OAASF,GAAEqC,EAAKxB,KAAKK,UAAUlB,KAK/C,OAJA8lB,KAAQD,GAAW,WACjBzZ,EAAoB,kBAAN1H,GAAmBA,EAAK/B,SAAS+B,GAAKrC,IAEtD+iB,EAAMS,GACCA,GAETH,EAAY,QAASC,gBAAezqB,SAC3B4qB,GAAM5qB,IAGwB,WAApCL,EAAoB,IAAIqmB,GACzBkE,EAAQ,SAASlqB,GACfgmB,EAAQgF,SAASjjB,EAAI2f,EAAK1nB,EAAI,KAGxB0qB,GACRP,EAAU,GAAIO,GACdN,EAAUD,EAAQc,MAClBd,EAAQe,MAAMC,UAAYL,EAC1BZ,EAAQniB,EAAIqiB,EAAKgB,YAAahB,EAAM,IAG5B9pB,EAAO+qB,kBAA0C,kBAAfD,eAA8B9qB,EAAOgrB,eAC/EpB,EAAQ,SAASlqB,GACfM,EAAO8qB,YAAYprB,EAAK,GAAI,MAE9BM,EAAO+qB,iBAAiB,UAAWP,GAAU,IAG7CZ,EADQW,IAAsBR,GAAI,UAC1B,SAASrqB,GACf0f,EAAKxR,YAAYmc,EAAI,WAAWQ,GAAsB,WACpDnL,EAAK6L,YAAY7nB,MACjBgkB,EAAIxnB,KAAKF,KAKL,SAASA,GACfwrB,WAAWzjB,EAAI2f,EAAK1nB,EAAI,GAAI,KAIlCD,EAAOD,SACLqG,IAAOmkB,EACPmB,MAAOjB,IAKJ,SAASzqB,EAAQD,EAASH,GAE/B,GAAIW,GAAYX,EAAoB,GAChC+rB,EAAY/rB,EAAoB,KAAKwG,IACrCwlB,EAAYrrB,EAAOsrB,kBAAoBtrB,EAAOurB,uBAC9C7F,EAAY1lB,EAAO0lB,QACnBiD,EAAY3oB,EAAO2oB,QACnB/C,EAAgD,WAApCvmB,EAAoB,IAAIqmB,EAExCjmB,GAAOD,QAAU,WACf,GAAIgsB,GAAMC,EAAM7E,EAEZ8E,EAAQ,WACV,GAAIC,GAAQziB,CAEZ,KADG0c,IAAW+F,EAASjG,EAAQ8B,SAAQmE,EAAO/D,OACxC4D,GAAK,CACTtiB,EAAOsiB,EAAKtiB,GACZsiB,EAAOA,EAAK/P,IACZ,KACEvS,IACA,MAAM5B,GAGN,KAFGkkB,GAAK5E,IACH6E,EAAOtsB,EACNmI,GAERmkB,EAAOtsB,EACNwsB,GAAOA,EAAOhE,QAInB,IAAG/B,EACDgB,EAAS,WACPlB,EAAQgF,SAASgB,QAGd,IAAGL,EAAS,CACjB,GAAIO,IAAS,EACTC,EAAS9iB,SAAS+iB,eAAe,GACrC,IAAIT,GAASK,GAAOK,QAAQF,GAAOG,eAAe,IAClDpF,EAAS,WACPiF,EAAK7X,KAAO4X,GAAUA,OAGnB,IAAGjD,GAAWA,EAAQ5C,QAAQ,CACnC,GAAID,GAAU6C,EAAQ5C,SACtBa,GAAS,WACPd,EAAQI,KAAKwF,QASf9E,GAAS,WAEPwE,EAAUxrB,KAAKI,EAAQ0rB,GAI3B,OAAO,UAASxiB,GACd,GAAIqc,IAAQrc,GAAIA,EAAIuS,KAAMtc,EACvBssB,KAAKA,EAAKhQ,KAAO8J,GAChBiG,IACFA,EAAOjG,EACPqB,KACA6E,EAAOlG,KAMR,SAAS9lB,EAAQD,EAASH,GAE/B,GAAIe,GAAWf,EAAoB,GACnCI,GAAOD,QAAU,SAAS6I,EAAQwF,EAAKlE,GACrC,IAAI,GAAInG,KAAOqK,GAAIzN,EAASiI,EAAQ7E,EAAKqK,EAAIrK,GAAMmG,EACnD,OAAOtB,KAKJ,SAAS5I,EAAQD,EAASH,GAG/B,GAAI4sB,GAAS5sB,EAAoB,IAGjCI,GAAOD,QAAUH,EAAoB,KAAK,MAAO,SAAS8D,GACxD,MAAO,SAAS+oB,OAAO,MAAO/oB,GAAIC,KAAMsC,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,MAG9EgE,IAAK,QAASA,KAAIK,GAChB,GAAI2oB,GAAQF,EAAOG,SAAShpB,KAAMI,EAClC,OAAO2oB,IAASA,EAAME,GAGxBxmB,IAAK,QAASA,KAAIrC,EAAKH,GACrB,MAAO4oB,GAAO/gB,IAAI9H,KAAc,IAARI,EAAY,EAAIA,EAAKH,KAE9C4oB,GAAQ,IAIN,SAASxsB,EAAQD,EAASH,GAG/B,GAAIuC,GAAcvC,EAAoB,GAAGsC,EACrCiD,EAAcvF,EAAoB,IAClCitB,EAAcjtB,EAAoB,KAClCoI,EAAcpI,EAAoB,IAClCgmB,EAAchmB,EAAoB,KAClC2M,EAAc3M,EAAoB,IAClCimB,EAAcjmB,EAAoB,KAClCktB,EAAcltB,EAAoB,KAClCgf,EAAchf,EAAoB,KAClCmtB,EAAcntB,EAAoB,KAClCa,EAAcb,EAAoB,GAClCuL,EAAcvL,EAAoB,IAAIuL,QACtC6hB,EAAcvsB,EAAc,KAAO,OAEnCksB,EAAW,SAAShiB,EAAM5G,GAE5B,GAA0B2oB,GAAtBxgB,EAAQf,EAAQpH,EACpB,IAAa,MAAVmI,EAAc,MAAOvB,GAAKyQ,GAAGlP,EAEhC,KAAIwgB,EAAQ/hB,EAAKsiB,GAAIP,EAAOA,EAAQA,EAAMlb,EACxC,GAAGkb,EAAMxc,GAAKnM,EAAI,MAAO2oB,GAI7B1sB,GAAOD,SACLmtB,eAAgB,SAASjE,EAASnX,EAAM0O,EAAQ2M,GAC9C,GAAI7Z,GAAI2V,EAAQ,SAASte,EAAMgf,GAC7B/D,EAAWjb,EAAM2I,EAAGxB,EAAM,MAC1BnH,EAAKyQ,GAAKjW,EAAO,MACjBwF,EAAKsiB,GAAKvtB,EACViL,EAAKyiB,GAAK1tB,EACViL,EAAKqiB,GAAQ,EACVrD,GAAYjqB,GAAUmmB,EAAM8D,EAAUnJ,EAAQ7V,EAAKwiB,GAAQxiB,IAsDhE,OApDAkiB,GAAYvZ,EAAEhJ,WAGZohB,MAAO,QAASA,SACd,IAAI,GAAI/gB,GAAOhH,KAAM4Q,EAAO5J,EAAKyQ,GAAIsR,EAAQ/hB,EAAKsiB,GAAIP,EAAOA,EAAQA,EAAMlb,EACzEkb,EAAMlD,GAAI,EACPkD,EAAMpsB,IAAEosB,EAAMpsB,EAAIosB,EAAMpsB,EAAEkR,EAAI9R,SAC1B6U,GAAKmY,EAAM3nB,EAEpB4F,GAAKsiB,GAAKtiB,EAAKyiB,GAAK1tB,EACpBiL,EAAKqiB,GAAQ,GAIfK,SAAU,SAAStpB,GACjB,GAAI4G,GAAQhH,KACR+oB,EAAQC,EAAShiB,EAAM5G,EAC3B,IAAG2oB,EAAM,CACP,GAAI1Q,GAAO0Q,EAAMlb,EACb8b,EAAOZ,EAAMpsB,QACVqK,GAAKyQ,GAAGsR,EAAM3nB,GACrB2nB,EAAMlD,GAAI,EACP8D,IAAKA,EAAK9b,EAAIwK,GACdA,IAAKA,EAAK1b,EAAIgtB,GACd3iB,EAAKsiB,IAAMP,IAAM/hB,EAAKsiB,GAAKjR,GAC3BrR,EAAKyiB,IAAMV,IAAM/hB,EAAKyiB,GAAKE,GAC9B3iB,EAAKqiB,KACL,QAASN,GAIbzc,QAAS,QAASA,SAAQqQ,GACxBsF,EAAWjiB,KAAM2P,EAAG,UAGpB,KAFA,GACIoZ,GADAxqB,EAAI8F,EAAIsY,EAAYra,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,EAAW,GAEnEgtB,EAAQA,EAAQA,EAAMlb,EAAI7N,KAAKspB,IAGnC,IAFA/qB,EAAEwqB,EAAME,EAAGF,EAAMxc,EAAGvM,MAEd+oB,GAASA,EAAMlD,GAAEkD,EAAQA,EAAMpsB,GAKzCE,IAAK,QAASA,KAAIuD,GAChB,QAAS4oB,EAAShpB,KAAMI,MAGzBtD,GAAY0B,EAAGmR,EAAEhJ,UAAW,QAC7B5G,IAAK,WACH,MAAO6I,GAAQ5I,KAAKqpB,OAGjB1Z,GAET7H,IAAK,SAASd,EAAM5G,EAAKH,GACvB,GACI0pB,GAAMphB,EADNwgB,EAAQC,EAAShiB,EAAM5G,EAoBzB,OAjBC2oB,GACDA,EAAME,EAAIhpB,GAGV+G,EAAKyiB,GAAKV,GACR3nB,EAAGmH,EAAQf,EAAQpH,GAAK,GACxBmM,EAAGnM,EACH6oB,EAAGhpB,EACHtD,EAAGgtB,EAAO3iB,EAAKyiB,GACf5b,EAAG9R,EACH8pB,GAAG,GAED7e,EAAKsiB,KAAGtiB,EAAKsiB,GAAKP,GACnBY,IAAKA,EAAK9b,EAAIkb,GACjB/hB,EAAKqiB,KAEQ,MAAV9gB,IAAcvB,EAAKyQ,GAAGlP,GAASwgB,IAC3B/hB,GAEXgiB,SAAUA,EACVY,UAAW,SAASja,EAAGxB,EAAM0O,GAG3BsM,EAAYxZ,EAAGxB,EAAM,SAASoJ,EAAUqB,GACtC5Y,KAAKwX,GAAKD,EACVvX,KAAKU,GAAKkY,EACV5Y,KAAKypB,GAAK1tB,GACT,WAKD,IAJA,GAAIiL,GAAQhH,KACR4Y,EAAQ5R,EAAKtG,GACbqoB,EAAQ/hB,EAAKyiB,GAEXV,GAASA,EAAMlD,GAAEkD,EAAQA,EAAMpsB,CAErC,OAAIqK,GAAKwQ,KAAQxQ,EAAKyiB,GAAKV,EAAQA,EAAQA,EAAMlb,EAAI7G,EAAKwQ,GAAG8R,IAMlD,QAAR1Q,EAAwBqC,EAAK,EAAG8N,EAAMxc,GAC9B,UAARqM,EAAwBqC,EAAK,EAAG8N,EAAME,GAClChO,EAAK,GAAI8N,EAAMxc,EAAGwc,EAAME,KAN7BjiB,EAAKwQ,GAAKzb,EACHkf,EAAK,KAMb4B,EAAS,UAAY,UAAYA,GAAQ,GAG5CuM,EAAWjb,MAMV,SAAS9R,EAAQD,EAASH,GAG/B,GAAIW,GAAoBX,EAAoB,GACxCc,EAAoBd,EAAoB,GACxCe,EAAoBf,EAAoB,IACxCitB,EAAoBjtB,EAAoB,KACxC0L,EAAoB1L,EAAoB,IACxCimB,EAAoBjmB,EAAoB,KACxCgmB,EAAoBhmB,EAAoB,KACxCyJ,EAAoBzJ,EAAoB,IACxCkP,EAAoBlP,EAAoB,GACxC4tB,EAAoB5tB,EAAoB,KACxCoB,EAAoBpB,EAAoB,IACxCsS,EAAoBtS,EAAoB,GAE5CI,GAAOD,QAAU,SAAS+R,EAAMmX,EAAS7M,EAASqR,EAAQjN,EAAQkN,GAChE,GAAInb,GAAQhS,EAAOuR,GACfwB,EAAQf,EACR4a,EAAQ3M,EAAS,MAAQ,MACzB9P,EAAQ4C,GAAKA,EAAEhJ,UACfnB,KACAwkB,EAAY,SAAS9sB,GACvB,GAAI4I,GAAKiH,EAAM7P,EACfF,GAAS+P,EAAO7P,EACP,UAAPA,EAAkB,SAASgD,GACzB,QAAO6pB,IAAYrkB,EAASxF,KAAa4F,EAAGtJ,KAAKwD,KAAY,IAANE,EAAU,EAAIA,IAC5D,OAAPhD,EAAe,QAASL,KAAIqD,GAC9B,QAAO6pB,IAAYrkB,EAASxF,KAAa4F,EAAGtJ,KAAKwD,KAAY,IAANE,EAAU,EAAIA,IAC5D,OAAPhD,EAAe,QAAS6C,KAAIG,GAC9B,MAAO6pB,KAAYrkB,EAASxF,GAAKnE,EAAY+J,EAAGtJ,KAAKwD,KAAY,IAANE,EAAU,EAAIA,IAChE,OAAPhD,EAAe,QAAS+sB,KAAI/pB,GAAoC,MAAhC4F,GAAGtJ,KAAKwD,KAAY,IAANE,EAAU,EAAIA,GAAWF,MACvE,QAASyC,KAAIvC,EAAG+G,GAAuC,MAAnCnB,GAAGtJ,KAAKwD,KAAY,IAANE,EAAU,EAAIA,EAAG+G,GAAWjH,OAGtE,IAAe,kBAAL2P,KAAqBoa,GAAWhd,EAAMT,UAAYnB,EAAM,YAChE,GAAIwE,IAAImJ,UAAUT,UAMb,CACL,GAAI6R,GAAuB,GAAIva,GAE3Bwa,EAAuBD,EAASV,GAAOO,QAAmB,IAAMG,EAEhEE,EAAuBjf,EAAM,WAAY+e,EAASrtB,IAAI,KAEtDwtB,EAAuBR,EAAY,SAAS/O,GAAO,GAAInL,GAAEmL,KAEzDwP,GAAcP,GAAW5e,EAAM,WAI/B,IAFA,GAAIof,GAAY,GAAI5a,GAChBpH,EAAY,EACVA,KAAQgiB,EAAUf,GAAOjhB,EAAOA,EACtC,QAAQgiB,EAAU1tB,SAElBwtB,KACF1a,EAAI2V,EAAQ,SAASrgB,EAAQ+gB,GAC3B/D,EAAWhd,EAAQ0K,EAAGxB,EACtB,IAAInH,GAAOuH,EAAkB,GAAIK,GAAM3J,EAAQ0K,EAE/C,OADGqW,IAAYjqB,GAAUmmB,EAAM8D,EAAUnJ,EAAQ7V,EAAKwiB,GAAQxiB,GACvDA,IAET2I,EAAEhJ,UAAYoG,EACdA,EAAMxB,YAAcoE,IAEnBya,GAAwBE,KACzBN,EAAU,UACVA,EAAU,OACVnN,GAAUmN,EAAU,SAEnBM,GAAcH,IAAeH,EAAUR,GAEvCO,GAAWhd,EAAMgb,aAAahb,GAAMgb,UApCvCpY,GAAIma,EAAOP,eAAejE,EAASnX,EAAM0O,EAAQ2M,GACjDN,EAAYvZ,EAAEhJ,UAAW8R,GACzB9Q,EAAKC,MAAO,CA4Cd,OAPAvK,GAAesS,EAAGxB,GAElB3I,EAAE2I,GAAQwB,EACV5S,EAAQA,EAAQ6F,EAAI7F,EAAQ8F,EAAI9F,EAAQ+F,GAAK6M,GAAKf,GAAOpJ,GAErDukB,GAAQD,EAAOF,UAAUja,EAAGxB,EAAM0O,GAE/BlN,IAKJ,SAAStT,EAAQD,EAASH,GAG/B,GAAI4sB,GAAS5sB,EAAoB,IAGjCI,GAAOD,QAAUH,EAAoB,KAAK,MAAO,SAAS8D,GACxD,MAAO,SAASyqB,OAAO,MAAOzqB,GAAIC,KAAMsC,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,MAG9EkuB,IAAK,QAASA,KAAIhqB,GAChB,MAAO4oB,GAAO/gB,IAAI9H,KAAMC,EAAkB,IAAVA,EAAc,EAAIA,EAAOA,KAE1D4oB,IAIE,SAASxsB,EAAQD,EAASH,GAG/B,GAUIwuB,GAVAC,EAAezuB,EAAoB,KAAK,GACxCe,EAAef,EAAoB,IACnC0L,EAAe1L,EAAoB,IACnCiQ,EAAejQ,EAAoB,IACnC0uB,EAAe1uB,EAAoB,KACnCyJ,EAAezJ,EAAoB,IACnCwL,EAAeE,EAAKF,QACpBN,EAAe1H,OAAO0H,aACtByjB,EAAsBD,EAAKE,QAC3BC,KAGAxF,EAAU,SAASvlB,GACrB,MAAO,SAASgrB,WACd,MAAOhrB,GAAIC,KAAMsC,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,KAIvD0c,GAEF1Y,IAAK,QAASA,KAAIK,GAChB,GAAGsF,EAAStF,GAAK,CACf,GAAIwQ,GAAOnJ,EAAQrH,EACnB,OAAGwQ,MAAS,EAAYga,EAAoB5qB,MAAMD,IAAIK,GAC/CwQ,EAAOA,EAAK5Q,KAAKyX,IAAM1b,IAIlC0G,IAAK,QAASA,KAAIrC,EAAKH,GACrB,MAAO0qB,GAAK7iB,IAAI9H,KAAMI,EAAKH,KAK3B+qB,EAAW3uB,EAAOD,QAAUH,EAAoB,KAAK,UAAWqpB,EAAS7M,EAASkS,GAAM,GAAM,EAG7B,KAAlE,GAAIK,IAAWvoB,KAAKhD,OAAOgM,QAAUhM,QAAQqrB,GAAM,GAAG/qB,IAAI+qB,KAC3DL,EAAcE,EAAKpB,eAAejE,GAClCpZ,EAAOue,EAAY9jB,UAAW8R,GAC9B9Q,EAAKC,MAAO,EACZ8iB,GAAM,SAAU,MAAO,MAAO,OAAQ,SAAStqB,GAC7C,GAAI2M,GAASie,EAASrkB,UAClBoV,EAAShP,EAAM3M,EACnBpD,GAAS+P,EAAO3M,EAAK,SAASF,EAAG+G,GAE/B,GAAGvB,EAASxF,KAAOiH,EAAajH,GAAG,CAC7BF,KAAKspB,KAAGtpB,KAAKspB,GAAK,GAAImB,GAC1B,IAAIzoB,GAAShC,KAAKspB,GAAGlpB,GAAKF,EAAG+G,EAC7B,OAAc,OAAP7G,EAAeJ,KAAOgC,EAE7B,MAAO+Z,GAAOvf,KAAKwD,KAAME,EAAG+G,SAO/B,SAAS5K,EAAQD,EAASH,GAG/B,GAAIitB,GAAoBjtB,EAAoB,KACxCwL,EAAoBxL,EAAoB,IAAIwL,QAC5C5J,EAAoB5B,EAAoB,IACxCyJ,EAAoBzJ,EAAoB,IACxCgmB,EAAoBhmB,EAAoB,KACxCimB,EAAoBjmB,EAAoB,KACxCgvB,EAAoBhvB,EAAoB,KACxCivB,EAAoBjvB,EAAoB,GACxCkvB,EAAoBF,EAAkB,GACtCG,EAAoBH,EAAkB,GACtC3uB,EAAoB,EAGpBsuB,EAAsB,SAAS5jB,GACjC,MAAOA,GAAKyiB,KAAOziB,EAAKyiB,GAAK,GAAI4B,KAE/BA,EAAsB,WACxBrrB,KAAKE,MAEHorB,EAAqB,SAASroB,EAAO7C,GACvC,MAAO+qB,GAAUloB,EAAM/C,EAAG,SAASC,GACjC,MAAOA,GAAG,KAAOC,IAGrBirB,GAAoB1kB,WAClB5G,IAAK,SAASK,GACZ,GAAI2oB,GAAQuC,EAAmBtrB,KAAMI,EACrC,IAAG2oB,EAAM,MAAOA,GAAM,IAExBlsB,IAAK,SAASuD,GACZ,QAASkrB,EAAmBtrB,KAAMI,IAEpCqC,IAAK,SAASrC,EAAKH,GACjB,GAAI8oB,GAAQuC,EAAmBtrB,KAAMI,EAClC2oB,GAAMA,EAAM,GAAK9oB,EACfD,KAAKE,EAAE+B,MAAM7B,EAAKH,KAEzBypB,SAAU,SAAStpB,GACjB,GAAImI,GAAQ6iB,EAAeprB,KAAKE,EAAG,SAASC,GAC1C,MAAOA,GAAG,KAAOC,GAGnB,QADImI,GAAMvI,KAAKE,EAAEqrB,OAAOhjB,EAAO,MACrBA,IAIdlM,EAAOD,SACLmtB,eAAgB,SAASjE,EAASnX,EAAM0O,EAAQ2M,GAC9C,GAAI7Z,GAAI2V,EAAQ,SAASte,EAAMgf,GAC7B/D,EAAWjb,EAAM2I,EAAGxB,EAAM,MAC1BnH,EAAKyQ,GAAKnb,IACV0K,EAAKyiB,GAAK1tB,EACPiqB,GAAYjqB,GAAUmmB,EAAM8D,EAAUnJ,EAAQ7V,EAAKwiB,GAAQxiB,IAoBhE,OAlBAkiB,GAAYvZ,EAAEhJ,WAGZ+iB,SAAU,SAAStpB,GACjB,IAAIsF,EAAStF,GAAK,OAAO,CACzB,IAAIwQ,GAAOnJ,EAAQrH,EACnB,OAAGwQ,MAAS,EAAYga,EAAoB5qB,MAAM,UAAUI,GACrDwQ,GAAQsa,EAAKta,EAAM5Q,KAAKyX,WAAc7G,GAAK5Q,KAAKyX,KAIzD5a,IAAK,QAASA,KAAIuD,GAChB,IAAIsF,EAAStF,GAAK,OAAO,CACzB,IAAIwQ,GAAOnJ,EAAQrH,EACnB,OAAGwQ,MAAS,EAAYga,EAAoB5qB,MAAMnD,IAAIuD,GAC/CwQ,GAAQsa,EAAKta,EAAM5Q,KAAKyX,OAG5B9H,GAET7H,IAAK,SAASd,EAAM5G,EAAKH,GACvB,GAAI2Q,GAAOnJ,EAAQ5J,EAASuC,IAAM,EAGlC,OAFGwQ,MAAS,EAAKga,EAAoB5jB,GAAMvE,IAAIrC,EAAKH,GAC/C2Q,EAAK5J,EAAKyQ,IAAMxX,EACd+G,GAET6jB,QAASD,IAKN,SAASvuB,EAAQD,EAASH,GAG/B,GAAI0uB,GAAO1uB,EAAoB,IAG/BA,GAAoB,KAAK,UAAW,SAAS8D,GAC3C,MAAO,SAASyrB,WAAW,MAAOzrB,GAAIC,KAAMsC,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,MAGlFkuB,IAAK,QAASA,KAAIhqB,GAChB,MAAO0qB,GAAK7iB,IAAI9H,KAAMC,GAAO,KAE9B0qB,GAAM,GAAO,IAIX,SAAStuB,EAAQD,EAASH,GAG/B,GAAIc,GAAYd,EAAoB,GAChC8K,EAAY9K,EAAoB,IAChC4B,EAAY5B,EAAoB,IAChCwvB,GAAaxvB,EAAoB,GAAGyvB,aAAehoB,MACnDioB,EAAY5nB,SAASL,KAEzB3G,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAK7G,EAAoB,GAAG,WACtDwvB,EAAO,gBACL,WACF/nB,MAAO,QAASA,OAAMuB,EAAQ2mB,EAAcC,GAC1C,GAAIrf,GAAIzF,EAAU9B,GACd6mB,EAAIjuB,EAASguB,EACjB,OAAOJ,GAASA,EAAOjf,EAAGof,EAAcE,GAAKH,EAAOnvB,KAAKgQ,EAAGof,EAAcE,OAMzE,SAASzvB,EAAQD,EAASH,GAG/B,GAAIc,GAAad,EAAoB,GACjCuF,EAAavF,EAAoB,IACjC8K,EAAa9K,EAAoB,IACjC4B,EAAa5B,EAAoB,IACjCyJ,EAAazJ,EAAoB,IACjCkP,EAAalP,EAAoB,GACjCsR,EAAatR,EAAoB,IACjC8vB,GAAc9vB,EAAoB,GAAGyvB,aAAe/d,UAIpDqe,EAAiB7gB,EAAM,WACzB,QAASrI,MACT,QAASipB,EAAW,gBAAkBjpB,YAAcA,MAElDmpB,GAAY9gB,EAAM,WACpB4gB,EAAW,eAGbhvB,GAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKkpB,GAAkBC,GAAW,WAC5Dte,UAAW,QAASA,WAAUue,EAAQzoB,GACpCsD,EAAUmlB,GACVruB,EAAS4F,EACT,IAAI0oB,GAAY7pB,UAAUhB,OAAS,EAAI4qB,EAASnlB,EAAUzE,UAAU,GACpE,IAAG2pB,IAAaD,EAAe,MAAOD,GAAWG,EAAQzoB,EAAM0oB,EAC/D,IAAGD,GAAUC,EAAU,CAErB,OAAO1oB,EAAKnC,QACV,IAAK,GAAG,MAAO,IAAI4qB,EACnB,KAAK,GAAG,MAAO,IAAIA,GAAOzoB,EAAK,GAC/B,KAAK,GAAG,MAAO,IAAIyoB,GAAOzoB,EAAK,GAAIA,EAAK,GACxC,KAAK,GAAG,MAAO,IAAIyoB,GAAOzoB,EAAK,GAAIA,EAAK,GAAIA,EAAK,GACjD,KAAK,GAAG,MAAO,IAAIyoB,GAAOzoB,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAG5D,GAAI2oB,IAAS,KAEb,OADAA,GAAMnqB,KAAKyB,MAAM0oB,EAAO3oB,GACjB,IAAK8J,EAAK7J,MAAMwoB,EAAQE,IAGjC,GAAIrf,GAAWof,EAAUxlB,UACrBujB,EAAW1oB,EAAOkE,EAASqH,GAASA,EAAQtN,OAAOkH,WACnD3E,EAAW+B,SAASL,MAAMlH,KAAK0vB,EAAQhC,EAAUzmB,EACrD,OAAOiC,GAAS1D,GAAUA,EAASkoB,MAMlC,SAAS7tB,EAAQD,EAASH,GAG/B,GAAIuC,GAAcvC,EAAoB,GAClCc,EAAcd,EAAoB,GAClC4B,EAAc5B,EAAoB,IAClC8B,EAAc9B,EAAoB,GAGtCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAI7G,EAAoB,GAAG,WACrDyvB,QAAQ5qB,eAAetC,EAAGD,KAAM,GAAI0B,MAAO,IAAK,GAAIA,MAAO,MACzD,WACFa,eAAgB,QAASA,gBAAemE,EAAQonB,EAAaC,GAC3DzuB,EAASoH,GACTonB,EAActuB,EAAYsuB,GAAa,GACvCxuB,EAASyuB,EACT,KAEE,MADA9tB,GAAGD,EAAE0G,EAAQonB,EAAaC,IACnB,EACP,MAAMpoB,GACN,OAAO,OAOR,SAAS7H,EAAQD,EAASH,GAG/B,GAAIc,GAAWd,EAAoB,GAC/BqC,EAAWrC,EAAoB,IAAIsC,EACnCV,EAAW5B,EAAoB,GAEnCc,GAAQA,EAAQmG,EAAG,WACjBqpB,eAAgB,QAASA,gBAAetnB,EAAQonB,GAC9C,GAAIG,GAAOluB,EAAKT,EAASoH,GAASonB,EAClC,SAAOG,IAASA,EAAKhqB,qBAA8ByC,GAAOonB,OAMzD,SAAShwB,EAAQD,EAASH,GAI/B,GAAIc,GAAWd,EAAoB,GAC/B4B,EAAW5B,EAAoB,IAC/BwwB,EAAY,SAASlV,GACvBvX,KAAKwX,GAAK3Z,EAAS0Z,GACnBvX,KAAKyX,GAAK,CACV,IACIrX,GADAe,EAAOnB,KAAKU,KAEhB,KAAIN,IAAOmX,GAASpW,EAAKc,KAAK7B,GAEhCnE,GAAoB,KAAKwwB,EAAW,SAAU,WAC5C,GAEIrsB,GAFA4G,EAAOhH,KACPmB,EAAO6F,EAAKtG,EAEhB,GACE,IAAGsG,EAAKyQ,IAAMtW,EAAKG,OAAO,OAAQrB,MAAOlE,EAAW4b,MAAM,YACjDvX,EAAMe,EAAK6F,EAAKyQ,QAAUzQ,GAAKwQ,IAC1C,QAAQvX,MAAOG,EAAKuX,MAAM,KAG5B5a,EAAQA,EAAQmG,EAAG,WACjBwpB,UAAW,QAASA,WAAUznB,GAC5B,MAAO,IAAIwnB,GAAUxnB,OAMpB,SAAS5I,EAAQD,EAASH,GAU/B,QAAS8D,KAAIkF,EAAQonB,GACnB,GACIG,GAAMzf,EADN4f,EAAWrqB,UAAUhB,OAAS,EAAI2D,EAAS3C,UAAU,EAEzD,OAAGzE,GAASoH,KAAY0nB,EAAgB1nB,EAAOonB,IAC5CG,EAAOluB,EAAKC,EAAE0G,EAAQonB,IAAoBxvB,EAAI2vB,EAAM,SACnDA,EAAKvsB,MACLusB,EAAKzsB,MAAQhE,EACXywB,EAAKzsB,IAAIvD,KAAKmwB,GACd5wB,EACH2J,EAASqH,EAAQzB,EAAerG,IAAgBlF,IAAIgN,EAAOsf,EAAaM,GAA3E,OAhBF,GAAIruB,GAAiBrC,EAAoB,IACrCqP,EAAiBrP,EAAoB,IACrCY,EAAiBZ,EAAoB,GACrCc,EAAiBd,EAAoB,GACrCyJ,EAAiBzJ,EAAoB,IACrC4B,EAAiB5B,EAAoB,GAczCc,GAAQA,EAAQmG,EAAG,WAAYnD,IAAKA,OAI/B,SAAS1D,EAAQD,EAASH,GAG/B,GAAIqC,GAAWrC,EAAoB,IAC/Bc,EAAWd,EAAoB,GAC/B4B,EAAW5B,EAAoB,GAEnCc,GAAQA,EAAQmG,EAAG,WACjBtB,yBAA0B,QAASA,0BAAyBqD,EAAQonB,GAClE,MAAO/tB,GAAKC,EAAEV,EAASoH,GAASonB,OAM/B,SAAShwB,EAAQD,EAASH,GAG/B,GAAIc,GAAWd,EAAoB,GAC/B2wB,EAAW3wB,EAAoB,IAC/B4B,EAAW5B,EAAoB,GAEnCc,GAAQA,EAAQmG,EAAG,WACjBoI,eAAgB,QAASA,gBAAerG,GACtC,MAAO2nB,GAAS/uB,EAASoH,QAMxB,SAAS5I,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,WACjBrG,IAAK,QAASA,KAAIoI,EAAQonB,GACxB,MAAOA,KAAepnB,OAMrB,SAAS5I,EAAQD,EAASH,GAG/B,GAAIc,GAAgBd,EAAoB,GACpC4B,EAAgB5B,EAAoB,IACpCgQ,EAAgBxM,OAAO0H,YAE3BpK,GAAQA,EAAQmG,EAAG,WACjBiE,aAAc,QAASA,cAAalC,GAElC,MADApH,GAASoH,IACFgH,GAAgBA,EAAchH,OAMpC,SAAS5I,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,WAAY2pB,QAAS5wB,EAAoB,QAIvD,SAASI,EAAQD,EAASH,GAG/B,GAAIwC,GAAWxC,EAAoB,IAC/ByN,EAAWzN,EAAoB,IAC/B4B,EAAW5B,EAAoB,IAC/ByvB,EAAWzvB,EAAoB,GAAGyvB,OACtCrvB,GAAOD,QAAUsvB,GAAWA,EAAQmB,SAAW,QAASA,SAAQ1sB,GAC9D,GAAIgB,GAAa1C,EAAKF,EAAEV,EAASsC,IAC7ByJ,EAAaF,EAAKnL,CACtB,OAAOqL,GAAazI,EAAK2F,OAAO8C,EAAWzJ,IAAOgB,IAK/C,SAAS9E,EAAQD,EAASH,GAG/B,GAAIc,GAAqBd,EAAoB,GACzC4B,EAAqB5B,EAAoB,IACzC2P,EAAqBnM,OAAO4H,iBAEhCtK,GAAQA,EAAQmG,EAAG,WACjBmE,kBAAmB,QAASA,mBAAkBpC,GAC5CpH,EAASoH,EACT,KAEE,MADG2G,IAAmBA,EAAmB3G,IAClC,EACP,MAAMf,GACN,OAAO,OAOR,SAAS7H,EAAQD,EAASH,GAY/B,QAASwG,KAAIwC,EAAQonB,EAAaS,GAChC,GAEIC,GAAoBhgB,EAFpB4f,EAAWrqB,UAAUhB,OAAS,EAAI2D,EAAS3C,UAAU,GACrD0qB,EAAW1uB,EAAKC,EAAEV,EAASoH,GAASonB,EAExC,KAAIW,EAAQ,CACV,GAAGtnB,EAASqH,EAAQzB,EAAerG,IACjC,MAAOxC,KAAIsK,EAAOsf,EAAaS,EAAGH,EAEpCK,GAAUhvB,EAAW,GAEvB,MAAGnB,GAAImwB,EAAS,WACXA,EAAQ/mB,YAAa,IAAUP,EAASinB,MAC3CI,EAAqBzuB,EAAKC,EAAEouB,EAAUN,IAAgBruB,EAAW,GACjE+uB,EAAmB9sB,MAAQ6sB,EAC3BtuB,EAAGD,EAAEouB,EAAUN,EAAaU,IACrB,GAEFC,EAAQvqB,MAAQ1G,IAAqBixB,EAAQvqB,IAAIjG,KAAKmwB,EAAUG,IAAI,GA1B7E,GAAItuB,GAAiBvC,EAAoB,GACrCqC,EAAiBrC,EAAoB,IACrCqP,EAAiBrP,EAAoB,IACrCY,EAAiBZ,EAAoB,GACrCc,EAAiBd,EAAoB,GACrC+B,EAAiB/B,EAAoB,IACrC4B,EAAiB5B,EAAoB,IACrCyJ,EAAiBzJ,EAAoB,GAsBzCc,GAAQA,EAAQmG,EAAG,WAAYT,IAAKA,OAI/B,SAASpG,EAAQD,EAASH,GAG/B,GAAIc,GAAWd,EAAoB,GAC/BgxB,EAAWhxB,EAAoB,GAEhCgxB,IAASlwB,EAAQA,EAAQmG,EAAG,WAC7B2J,eAAgB,QAASA,gBAAe5H,EAAQ8H,GAC9CkgB,EAASngB,MAAM7H,EAAQ8H,EACvB,KAEE,MADAkgB,GAASxqB,IAAIwC,EAAQ8H,IACd,EACP,MAAM7I,GACN,OAAO,OAOR,SAAS7H,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QAASgqB,IAAK,WAAY,OAAO,GAAIC,OAAOC,cAI1D,SAAS/wB,EAAQD,EAASH,GAG/B,GAAIc,GAAcd,EAAoB,GAClCmP,EAAcnP,EAAoB,IAClC8B,EAAc9B,EAAoB,GAEtCc,GAAQA,EAAQmE,EAAInE,EAAQ+F,EAAI7G,EAAoB,GAAG,WACrD,MAAkC,QAA3B,GAAIkxB,MAAK7d,KAAK+d,UAA4F,IAAvEF,KAAKxmB,UAAU0mB,OAAO7wB,MAAM8wB,YAAa,WAAY,MAAO,QACpG,QACFD,OAAQ,QAASA,QAAOjtB,GACtB,GAAIoF,GAAK4F,EAASpL,MACdutB,EAAKxvB,EAAYyH,EACrB,OAAoB,gBAAN+nB,IAAmBjb,SAASib,GAAa/nB,EAAE8nB,cAAT,SAM/C,SAASjxB,EAAQD,EAASH,GAI/B,GAAIc,GAAUd,EAAoB,GAC9BkP,EAAUlP,EAAoB,GAC9BmxB,EAAUD,KAAKxmB,UAAUymB,QAEzBI,EAAK,SAASC,GAChB,MAAOA,GAAM,EAAIA,EAAM,IAAMA,EAI/B1wB,GAAQA,EAAQmE,EAAInE,EAAQ+F,GAAKqI,EAAM,WACrC,MAA4C,4BAArC,GAAIgiB,YAAa,GAAGG,kBACtBniB,EAAM,WACX,GAAIgiB,MAAK7d,KAAKge,iBACX,QACHA,YAAa,QAASA,eACpB,IAAIhb,SAAS8a,EAAQ5wB,KAAKwD,OAAO,KAAM2R,YAAW,qBAClD,IAAI+b,GAAI1tB,KACJ4M,EAAI8gB,EAAEC,iBACNlxB,EAAIixB,EAAEE,qBACNzc,EAAIvE,EAAI,EAAI,IAAMA,EAAI,KAAO,IAAM,EACvC,OAAOuE,IAAK,QAAUvN,KAAK6O,IAAI7F,IAAI9D,MAAMqI,SACvC,IAAMqc,EAAGE,EAAEG,cAAgB,GAAK,IAAML,EAAGE,EAAEI,cAC3C,IAAMN,EAAGE,EAAEK,eAAiB,IAAMP,EAAGE,EAAEM,iBACvC,IAAMR,EAAGE,EAAEO,iBAAmB,KAAOxxB,EAAI,GAAKA,EAAI,IAAM+wB,EAAG/wB,IAAM,QAMlE,SAASJ,EAAQD,EAASH,GAE/B,GAAIiyB,GAAef,KAAKxmB,UACpBwnB,EAAe,eACfhoB,EAAe,WACfC,EAAe8nB,EAAU/nB,GACzBinB,EAAec,EAAUd,OAC1B,IAAID,MAAK7d,KAAO,IAAM6e,GACvBlyB,EAAoB,IAAIiyB,EAAW/nB,EAAW,QAASzD,YACrD,GAAIzC,GAAQmtB,EAAQ5wB,KAAKwD,KACzB,OAAOC,KAAUA,EAAQmG,EAAU5J,KAAKwD,MAAQmuB,KAM/C,SAAS9xB,EAAQD,EAASH,GAE/B,GAAIiD,GAAejD,EAAoB,IAAI,eACvC8Q,EAAeogB,KAAKxmB,SAEnBzH,KAAgB6N,IAAO9Q,EAAoB,GAAG8Q,EAAO7N,EAAcjD,EAAoB,OAIvF,SAASI,EAAQD,EAASH,GAG/B,GAAI4B,GAAc5B,EAAoB,IAClC8B,EAAc9B,EAAoB,IAClCyS,EAAc,QAElBrS,GAAOD,QAAU,SAASgyB,GACxB,GAAY,WAATA,GAAqBA,IAAS1f,GAAmB,YAAT0f,EAAmB,KAAM/rB,WAAU,iBAC9E,OAAOtE,GAAYF,EAASmC,MAAOouB,GAAQ1f,KAKxC,SAASrS,EAAQD,EAASH,GAG/B,GAAIc,GAAed,EAAoB,GACnCoyB,EAAepyB,EAAoB,KACnCqyB,EAAeryB,EAAoB,KACnC4B,EAAe5B,EAAoB,IACnC+M,EAAe/M,EAAoB,IACnC8M,EAAe9M,EAAoB,IACnCyJ,EAAezJ,EAAoB,IACnCsyB,EAAetyB,EAAoB,GAAGsyB,YACtCpR,EAAqBlhB,EAAoB,KACzCuyB,EAAeF,EAAOC,YACtBE,EAAeH,EAAOI,SACtBC,EAAeN,EAAOO,KAAOL,EAAYM,OACzCC,EAAeN,EAAa7nB,UAAUmC,MACtCimB,EAAeV,EAAOU,KACtBC,EAAe,aAEnBjyB,GAAQA,EAAQ6F,EAAI7F,EAAQ8F,EAAI9F,EAAQ+F,GAAKyrB,IAAgBC,IAAgBD,YAAaC,IAE1FzxB,EAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKurB,EAAOY,OAAQD,GAE9CH,OAAQ,QAASA,QAAO1uB,GACtB,MAAOwuB,IAAWA,EAAQxuB,IAAOuF,EAASvF,IAAO4uB,IAAQ5uB,MAI7DpD,EAAQA,EAAQmE,EAAInE,EAAQoI,EAAIpI,EAAQ+F,EAAI7G,EAAoB,GAAG,WACjE,OAAQ,GAAIuyB,GAAa,GAAG1lB,MAAM,EAAG/M,GAAWmzB,aAC9CF,GAEFlmB,MAAO,QAASA,OAAMqT,EAAOvF,GAC3B,GAAGkY,IAAW/yB,GAAa6a,IAAQ7a,EAAU,MAAO+yB,GAAOtyB,KAAKqB,EAASmC,MAAOmc,EAQhF,KAPA,GAAIvO,GAAS/P,EAASmC,MAAMkvB,WACxB9f,EAASpG,EAAQmT,EAAOvO,GACxBuhB,EAASnmB,EAAQ4N,IAAQ7a,EAAY6R,EAAMgJ,EAAKhJ,GAChD5L,EAAS,IAAKmb,EAAmBnd,KAAMwuB,IAAezlB,EAASomB,EAAQ/f,IACvEggB,EAAS,GAAIX,GAAUzuB,MACvBqvB,EAAS,GAAIZ,GAAUzsB,GACvBuG,EAAS,EACP6G,EAAQ+f,GACZE,EAAMC,SAAS/mB,IAAS6mB,EAAMG,SAASngB,KACvC,OAAOpN,MAIb/F,EAAoB,KAAK+yB,IAIpB,SAAS3yB,EAAQD,EAASH,GAe/B,IAbA,GAOkBuzB,GAPd5yB,EAASX,EAAoB,GAC7BmI,EAASnI,EAAoB,GAC7BqB,EAASrB,EAAoB,IAC7BwzB,EAASnyB,EAAI,eACbyxB,EAASzxB,EAAI,QACbsxB,KAAYhyB,EAAO2xB,cAAe3xB,EAAO8xB,UACzCO,EAASL,EACTxtB,EAAI,EAAGC,EAAI,EAEXquB,EAAyB,iHAE3B1sB,MAAM,KAEF5B,EAAIC,IACLmuB,EAAQ5yB,EAAO8yB,EAAuBtuB,QACvCgD,EAAKorB,EAAM7oB,UAAW8oB,GAAO,GAC7BrrB,EAAKorB,EAAM7oB,UAAWooB,GAAM,IACvBE,GAAS,CAGlB5yB,GAAOD,SACLwyB,IAAQA,EACRK,OAAQA,EACRQ,MAAQA,EACRV,KAAQA,IAKL,SAAS1yB,EAAQD,EAASH,GAG/B,GAAIW,GAAiBX,EAAoB,GACrCa,EAAiBb,EAAoB,GACrCkM,EAAiBlM,EAAoB,IACrCoyB,EAAiBpyB,EAAoB,KACrCmI,EAAiBnI,EAAoB,GACrCitB,EAAiBjtB,EAAoB,KACrCkP,EAAiBlP,EAAoB,GACrCgmB,EAAiBhmB,EAAoB,KACrCmN,EAAiBnN,EAAoB,IACrC8M,EAAiB9M,EAAoB,IACrCwC,EAAiBxC,EAAoB,IAAIsC,EACzCC,EAAiBvC,EAAoB,GAAGsC,EACxCoxB,EAAiB1zB,EAAoB,KACrCoB,EAAiBpB,EAAoB,IACrC+yB,EAAiB,cACjBY,EAAiB,WACjB5wB,EAAiB,YACjB6wB,EAAiB,gBACjBC,EAAiB,eACjBtB,EAAiB5xB,EAAOoyB,GACxBP,EAAiB7xB,EAAOgzB,GACxBhsB,EAAiBhH,EAAOgH,KACxB+N,EAAiB/U,EAAO+U,WACxBK,EAAiBpV,EAAOoV,SACxB+d,EAAiBvB,EACjB/b,EAAiB7O,EAAK6O,IACtBpB,EAAiBzN,EAAKyN,IACtB9H,EAAiB3F,EAAK2F,MACtBgI,EAAiB3N,EAAK2N,IACtBgC,EAAiB3P,EAAK2P,IACtByc,EAAiB,SACjBC,EAAiB,aACjBC,EAAiB,aACjBC,EAAiBrzB,EAAc,KAAOkzB,EACtCI,EAAiBtzB,EAAc,KAAOmzB,EACtCI,EAAiBvzB,EAAc,KAAOozB,EAGtCI,EAAc,SAASrwB,EAAOswB,EAAMC,GACtC,GAOItsB,GAAGzH,EAAGC,EAPN4xB,EAASzkB,MAAM2mB,GACfC,EAAkB,EAATD,EAAaD,EAAO,EAC7BG,GAAU,GAAKD,GAAQ,EACvBE,EAASD,GAAQ,EACjBE,EAAkB,KAATL,EAAclf,EAAI,OAAUA,EAAI,OAAU,EACnDjQ,EAAS,EACT+P,EAASlR,EAAQ,GAAe,IAAVA,GAAe,EAAIA,EAAQ,EAAI,EAAI,CAgC7D,KA9BAA,EAAQwS,EAAIxS,GACTA,GAASA,GAASA,IAAU+R,GAC7BvV,EAAIwD,GAASA,EAAQ,EAAI,EACzBiE,EAAIwsB,IAEJxsB,EAAIqF,EAAMgI,EAAItR,GAASsT,GACpBtT,GAASvD,EAAI2U,EAAI,GAAInN,IAAM,IAC5BA,IACAxH,GAAK,GAGLuD,GADCiE,EAAIysB,GAAS,EACLC,EAAKl0B,EAELk0B,EAAKvf,EAAI,EAAG,EAAIsf,GAExB1wB,EAAQvD,GAAK,IACdwH,IACAxH,GAAK,GAEJwH,EAAIysB,GAASD,GACdj0B,EAAI,EACJyH,EAAIwsB,GACIxsB,EAAIysB,GAAS,GACrBl0B,GAAKwD,EAAQvD,EAAI,GAAK2U,EAAI,EAAGkf,GAC7BrsB,GAAQysB,IAERl0B,EAAIwD,EAAQoR,EAAI,EAAGsf,EAAQ,GAAKtf,EAAI,EAAGkf,GACvCrsB,EAAI,IAGFqsB,GAAQ,EAAGjC,EAAOltB,KAAW,IAAJ3E,EAASA,GAAK,IAAK8zB,GAAQ,GAG1D,IAFArsB,EAAIA,GAAKqsB,EAAO9zB,EAChBg0B,GAAQF,EACFE,EAAO,EAAGnC,EAAOltB,KAAW,IAAJ8C,EAASA,GAAK,IAAKusB,GAAQ,GAEzD,MADAnC,KAASltB,IAAU,IAAJ+P,EACRmd,GAELuC,EAAgB,SAASvC,EAAQiC,EAAMC,GACzC,GAOI/zB,GAPAg0B,EAAiB,EAATD,EAAaD,EAAO,EAC5BG,GAAS,GAAKD,GAAQ,EACtBE,EAAQD,GAAQ,EAChBI,EAAQL,EAAO,EACfrvB,EAAQovB,EAAS,EACjBrf,EAAQmd,EAAOltB,KACf8C,EAAY,IAAJiN,CAGZ,KADAA,IAAM,EACA2f,EAAQ,EAAG5sB,EAAQ,IAAJA,EAAUoqB,EAAOltB,GAAIA,IAAK0vB,GAAS,GAIxD,IAHAr0B,EAAIyH,GAAK,IAAM4sB,GAAS,EACxB5sB,KAAO4sB,EACPA,GAASP,EACHO,EAAQ,EAAGr0B,EAAQ,IAAJA,EAAU6xB,EAAOltB,GAAIA,IAAK0vB,GAAS,GACxD,GAAS,IAAN5sB,EACDA,EAAI,EAAIysB,MACH,CAAA,GAAGzsB,IAAMwsB,EACd,MAAOj0B,GAAI6S,IAAM6B,GAAKa,EAAWA,CAEjCvV,IAAQ4U,EAAI,EAAGkf,GACfrsB,GAAQysB,EACR,OAAQxf,KAAS,GAAK1U,EAAI4U,EAAI,EAAGnN,EAAIqsB,IAGrCQ,EAAY,SAASC,GACvB,MAAOA,GAAM,IAAM,GAAKA,EAAM,IAAM,GAAKA,EAAM,IAAM,EAAIA,EAAM,IAE7DC,EAAS,SAAS9wB,GACpB,OAAa,IAALA,IAEN+wB,EAAU,SAAS/wB,GACrB,OAAa,IAALA,EAAWA,GAAM,EAAI,MAE3BgxB,EAAU,SAAShxB,GACrB,OAAa,IAALA,EAAWA,GAAM,EAAI,IAAMA,GAAM,GAAK,IAAMA,GAAM,GAAK,MAE7DixB,EAAU,SAASjxB,GACrB,MAAOmwB,GAAYnwB,EAAI,GAAI,IAEzBkxB,EAAU,SAASlxB,GACrB,MAAOmwB,GAAYnwB,EAAI,GAAI,IAGzBmxB,EAAY,SAAS3hB,EAAGvP,EAAKmxB,GAC/B/yB,EAAGmR,EAAE3Q,GAAYoB,GAAML,IAAK,WAAY,MAAOC,MAAKuxB,OAGlDxxB,EAAM,SAASyxB,EAAMR,EAAOzoB,EAAOkpB,GACrC,GAAIC,IAAYnpB,EACZopB,EAAWvoB,EAAUsoB,EACzB,IAAGA,GAAYC,GAAYA,EAAW,GAAKA,EAAWX,EAAQQ,EAAKpB,GAAS,KAAMze,GAAWme,EAC7F,IAAI7sB,GAAQuuB,EAAKrB,GAASyB,GACtBzV,EAAQwV,EAAWH,EAAKnB,GACxBwB,EAAQ5uB,EAAM6F,MAAMqT,EAAOA,EAAQ6U,EACvC,OAAOS,GAAiBI,EAAOA,EAAKC,WAElCrvB,EAAM,SAAS+uB,EAAMR,EAAOzoB,EAAOwpB,EAAY9xB,EAAOwxB,GACxD,GAAIC,IAAYnpB,EACZopB,EAAWvoB,EAAUsoB,EACzB,IAAGA,GAAYC,GAAYA,EAAW,GAAKA,EAAWX,EAAQQ,EAAKpB,GAAS,KAAMze,GAAWme,EAI7F,KAAI,GAHA7sB,GAAQuuB,EAAKrB,GAASyB,GACtBzV,EAAQwV,EAAWH,EAAKnB,GACxBwB,EAAQE,GAAY9xB,GAChBmB,EAAI,EAAGA,EAAI4vB,EAAO5vB,IAAI6B,EAAMkZ,EAAQ/a,GAAKywB,EAAKJ,EAAiBrwB,EAAI4vB,EAAQ5vB,EAAI,IAGrF4wB,EAA+B,SAAShrB,EAAM1F,GAChD2gB,EAAWjb,EAAMwnB,EAAcQ,EAC/B,IAAIiD,IAAgB3wB,EAChB4tB,EAAenmB,EAASkpB,EAC5B,IAAGA,GAAgB/C,EAAW,KAAMvd,GAAWke,EAC/C,OAAOX,GAGT,IAAIb,EAAOO,IA+EJ,CACL,IAAIzjB,EAAM,WACR,GAAIqjB,OACCrjB,EAAM,WACX,GAAIqjB,GAAa,MAChB,CACDA,EAAe,QAASD,aAAYjtB,GAClC,MAAO,IAAIyuB,GAAWiC,EAA6BhyB,KAAMsB,IAG3D,KAAI,GAAoClB,GADpC8xB,EAAmB1D,EAAaxvB,GAAa+wB,EAAW/wB,GACpDmC,GAAO1C,EAAKsxB,GAAarjB,GAAI,EAAQvL,GAAKG,OAASoL,KACnDtM,EAAMe,GAAKuL,QAAS8hB,IAAcpqB,EAAKoqB,EAAcpuB,EAAK2vB,EAAW3vB,GAEzE+H,KAAQ+pB,EAAiB3mB,YAAcijB,GAG7C,GAAIgD,IAAO,GAAI/C,GAAU,GAAID,GAAa,IACtC2D,GAAW1D,EAAUzvB,GAAWozB,OACpCZ,IAAKY,QAAQ,EAAG,YAChBZ,GAAKY,QAAQ,EAAG,aACbZ,GAAKa,QAAQ,IAAOb,GAAKa,QAAQ,IAAGnJ,EAAYuF,EAAUzvB,IAC3DozB,QAAS,QAASA,SAAQE,EAAYryB,GACpCkyB,GAAS31B,KAAKwD,KAAMsyB,EAAYryB,GAAS,IAAM,KAEjDqvB,SAAU,QAASA,UAASgD,EAAYryB,GACtCkyB,GAAS31B,KAAKwD,KAAMsyB,EAAYryB,GAAS,IAAM,OAEhD,OAzGHuuB,GAAe,QAASD,aAAYjtB,GAClC,GAAI4tB,GAAa8C,EAA6BhyB,KAAMsB,EACpDtB,MAAK4xB,GAAWjC,EAAUnzB,KAAKqN,MAAMqlB,GAAa,GAClDlvB,KAAKowB,GAAWlB,GAGlBT,EAAY,QAASC,UAASJ,EAAQgE,EAAYpD,GAChDjN,EAAWjiB,KAAMyuB,EAAWmB,GAC5B3N,EAAWqM,EAAQE,EAAcoB,EACjC,IAAI2C,GAAejE,EAAO8B,GACtBoC,EAAeppB,EAAUkpB,EAC7B,IAAGE,EAAS,GAAKA,EAASD,EAAa,KAAM5gB,GAAW,gBAExD,IADAud,EAAaA,IAAenzB,EAAYw2B,EAAeC,EAASzpB,EAASmmB,GACtEsD,EAAStD,EAAaqD,EAAa,KAAM5gB,GAAWke,EACvD7vB,MAAKmwB,GAAW7B,EAChBtuB,KAAKqwB,GAAWmC,EAChBxyB,KAAKowB,GAAWlB,GAGfpyB,IACDw0B,EAAU9C,EAAcyB,EAAa,MACrCqB,EAAU7C,EAAWuB,EAAQ,MAC7BsB,EAAU7C,EAAWwB,EAAa,MAClCqB,EAAU7C,EAAWyB,EAAa,OAGpChH,EAAYuF,EAAUzvB,IACpBqzB,QAAS,QAASA,SAAQC,GACxB,MAAOvyB,GAAIC,KAAM,EAAGsyB,GAAY,IAAM,IAAM,IAE9C/C,SAAU,QAASA,UAAS+C,GAC1B,MAAOvyB,GAAIC,KAAM,EAAGsyB,GAAY,IAElCG,SAAU,QAASA,UAASH,GAC1B,GAAItB,GAAQjxB,EAAIC,KAAM,EAAGsyB,EAAYhwB,UAAU,GAC/C,QAAQ0uB,EAAM,IAAM,EAAIA,EAAM,KAAO,IAAM,IAE7C0B,UAAW,QAASA,WAAUJ,GAC5B,GAAItB,GAAQjxB,EAAIC,KAAM,EAAGsyB,EAAYhwB,UAAU,GAC/C,OAAO0uB,GAAM,IAAM,EAAIA,EAAM,IAE/B2B,SAAU,QAASA,UAASL,GAC1B,MAAOvB,GAAUhxB,EAAIC,KAAM,EAAGsyB,EAAYhwB,UAAU,MAEtDswB,UAAW,QAASA,WAAUN,GAC5B,MAAOvB,GAAUhxB,EAAIC,KAAM,EAAGsyB,EAAYhwB,UAAU,OAAS,GAE/DuwB,WAAY,QAASA,YAAWP,GAC9B,MAAOzB,GAAc9wB,EAAIC,KAAM,EAAGsyB,EAAYhwB,UAAU,IAAK,GAAI,IAEnEwwB,WAAY,QAASA,YAAWR,GAC9B,MAAOzB,GAAc9wB,EAAIC,KAAM,EAAGsyB,EAAYhwB,UAAU,IAAK,GAAI,IAEnE8vB,QAAS,QAASA,SAAQE,EAAYryB,GACpCwC,EAAIzC,KAAM,EAAGsyB,EAAYrB,EAAQhxB,IAEnCqvB,SAAU,QAASA,UAASgD,EAAYryB,GACtCwC,EAAIzC,KAAM,EAAGsyB,EAAYrB,EAAQhxB,IAEnC8yB,SAAU,QAASA,UAAST,EAAYryB,GACtCwC,EAAIzC,KAAM,EAAGsyB,EAAYpB,EAASjxB,EAAOqC,UAAU,KAErD0wB,UAAW,QAASA,WAAUV,EAAYryB,GACxCwC,EAAIzC,KAAM,EAAGsyB,EAAYpB,EAASjxB,EAAOqC,UAAU,KAErD2wB,SAAU,QAASA,UAASX,EAAYryB,GACtCwC,EAAIzC,KAAM,EAAGsyB,EAAYnB,EAASlxB,EAAOqC,UAAU,KAErD4wB,UAAW,QAASA,WAAUZ,EAAYryB,GACxCwC,EAAIzC,KAAM,EAAGsyB,EAAYnB,EAASlxB,EAAOqC,UAAU,KAErD6wB,WAAY,QAASA,YAAWb,EAAYryB,GAC1CwC,EAAIzC,KAAM,EAAGsyB,EAAYjB,EAASpxB,EAAOqC,UAAU,KAErD8wB,WAAY,QAASA,YAAWd,EAAYryB,GAC1CwC,EAAIzC,KAAM,EAAGsyB,EAAYlB,EAASnxB,EAAOqC,UAAU,MAgCzDjF,GAAemxB,EAAcQ,GAC7B3xB,EAAeoxB,EAAWmB,GAC1BxrB,EAAKqqB,EAAUzvB,GAAYqvB,EAAOU,MAAM,GACxC3yB,EAAQ4yB,GAAgBR,EACxBpyB,EAAQwzB,GAAanB,GAIhB,SAASpyB,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,EAClCc,GAAQA,EAAQ6F,EAAI7F,EAAQ8F,EAAI9F,EAAQ+F,GAAK7G,EAAoB,KAAK2yB,KACpEF,SAAUzyB,EAAoB,KAAKyyB,YAKhC,SAASryB,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,OAAQ,EAAG,SAASo3B,GAC3C,MAAO,SAASC,WAAU1iB,EAAM0hB,EAAYhxB,GAC1C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAG/B,GAAGA,EAAoB,GAAG,CACxB,GAAIkM,GAAsBlM,EAAoB,IAC1CW,EAAsBX,EAAoB,GAC1CkP,EAAsBlP,EAAoB,GAC1Cc,EAAsBd,EAAoB,GAC1CoyB,EAAsBpyB,EAAoB,KAC1Cs3B,EAAsBt3B,EAAoB,KAC1CoI,EAAsBpI,EAAoB,IAC1CgmB,EAAsBhmB,EAAoB,KAC1Cu3B,EAAsBv3B,EAAoB,IAC1CmI,EAAsBnI,EAAoB,GAC1CitB,EAAsBjtB,EAAoB,KAC1CmN,EAAsBnN,EAAoB,IAC1C8M,EAAsB9M,EAAoB,IAC1C+M,EAAsB/M,EAAoB,IAC1C8B,EAAsB9B,EAAoB,IAC1CY,EAAsBZ,EAAoB,GAC1Cw3B,EAAsBx3B,EAAoB,IAC1CkR,EAAsBlR,EAAoB,IAC1CyJ,EAAsBzJ,EAAoB,IAC1CmP,EAAsBnP,EAAoB,IAC1C0e,EAAsB1e,EAAoB,KAC1CuF,EAAsBvF,EAAoB,IAC1CqP,EAAsBrP,EAAoB,IAC1CwC,EAAsBxC,EAAoB,IAAIsC,EAC9Csc,EAAsB5e,EAAoB,KAC1CqB,EAAsBrB,EAAoB,IAC1CsB,EAAsBtB,EAAoB,IAC1CgvB,EAAsBhvB,EAAoB,KAC1Cy3B,EAAsBz3B,EAAoB,IAC1CkhB,EAAsBlhB,EAAoB,KAC1C03B,EAAsB13B,EAAoB,KAC1C2b,EAAsB3b,EAAoB,KAC1C4tB,EAAsB5tB,EAAoB,KAC1CmtB,EAAsBntB,EAAoB,KAC1C0zB,EAAsB1zB,EAAoB,KAC1C23B,EAAsB33B,EAAoB,KAC1CmC,EAAsBnC,EAAoB,GAC1CkC,EAAsBlC,EAAoB,IAC1CuC,EAAsBJ,EAAIG,EAC1BD,EAAsBH,EAAMI,EAC5BoT,EAAsB/U,EAAO+U,WAC7BtP,EAAsBzF,EAAOyF,UAC7BwxB,EAAsBj3B,EAAOi3B,WAC7B7E,EAAsB,cACtB8E,EAAsB,SAAW9E,EACjC+E,EAAsB,oBACtB/0B,EAAsB,YACtBsc,EAAsBzR,MAAM7K,GAC5BwvB,EAAsB+E,EAAQhF,YAC9BE,EAAsB8E,EAAQ7E,SAC9BsF,GAAsB/I,EAAkB,GACxCgJ,GAAsBhJ,EAAkB,GACxCiJ,GAAsBjJ,EAAkB,GACxCkJ,GAAsBlJ,EAAkB,GACxCE,GAAsBF,EAAkB,GACxCG,GAAsBH,EAAkB,GACxCmJ,GAAsBV,GAAoB,GAC1CjrB,GAAsBirB,GAAoB,GAC1CW,GAAsBV,EAAe9a,OACrCyb,GAAsBX,EAAexyB,KACrCozB,GAAsBZ,EAAe7a,QACrC0b,GAAsBlZ,EAAWgD,YACjCmW,GAAsBnZ,EAAWyC,OACjC2W,GAAsBpZ,EAAW4C,YACjCrC,GAAsBP,EAAW7U,KACjCkuB,GAAsBrZ,EAAWiB,KACjC9O,GAAsB6N,EAAWxS,MACjC8rB,GAAsBtZ,EAAW5Y,SACjCmyB,GAAsBvZ,EAAWwZ,eACjChd,GAAsBva,EAAI,YAC1BwK,GAAsBxK,EAAI,eAC1Bw3B,GAAsBz3B,EAAI,qBAC1B03B,GAAsB13B,EAAI,mBAC1B23B,GAAsB5G,EAAOY,OAC7BiG,GAAsB7G,EAAOoB,MAC7BV,GAAsBV,EAAOU,KAC7Bc,GAAsB,gBAEtBvS,GAAO2N,EAAkB,EAAG,SAASzlB,EAAGlE,GAC1C,MAAO6zB,IAAShY,EAAmB3X,EAAGA,EAAEwvB,KAAmB1zB,KAGzD8zB,GAAgBjqB,EAAM,WACxB,MAA0D,KAAnD,GAAI0oB,GAAW,GAAIwB,cAAa,IAAI/G,QAAQ,KAGjDgH,KAAezB,KAAgBA,EAAW70B,GAAWyD,KAAO0I,EAAM,WACpE,GAAI0oB,GAAW,GAAGpxB,UAGhB8yB,GAAiB,SAASp1B,EAAIq1B,GAChC,GAAGr1B,IAAOpE,EAAU,KAAMsG,GAAUwtB,GACpC,IAAIrd,IAAUrS,EACVmB,EAASyH,EAAS5I,EACtB,IAAGq1B,IAAS/B,EAAKjhB,EAAQlR,GAAQ,KAAMqQ,GAAWke,GAClD,OAAOvuB,IAGLm0B,GAAW,SAASt1B,EAAIu1B,GAC1B,GAAIlD,GAASppB,EAAUjJ,EACvB,IAAGqyB,EAAS,GAAKA,EAASkD,EAAM,KAAM/jB,GAAW,gBACjD,OAAO6gB,IAGLmD,GAAW,SAASx1B,GACtB,GAAGuF,EAASvF,IAAO+0B,KAAe/0B,GAAG,MAAOA,EAC5C,MAAMkC,GAAUlC,EAAK,2BAGnBg1B,GAAW,SAASxlB,EAAGrO,GACzB,KAAKoE,EAASiK,IAAMolB,KAAqBplB,IACvC,KAAMtN,GAAU,uCAChB,OAAO,IAAIsN,GAAErO,IAGbs0B,GAAkB,SAASpwB,EAAGqwB,GAChC,MAAOC,IAAS3Y,EAAmB3X,EAAGA,EAAEwvB,KAAmBa,IAGzDC,GAAW,SAASnmB,EAAGkmB,GAIzB,IAHA,GAAIttB,GAAS,EACTjH,EAASu0B,EAAKv0B,OACdU,EAASmzB,GAASxlB,EAAGrO,GACnBA,EAASiH,GAAMvG,EAAOuG,GAASstB,EAAKttB,IAC1C,OAAOvG,IAGLsvB,GAAY,SAASnxB,EAAIC,EAAKmxB,GAChC/yB,EAAG2B,EAAIC,GAAML,IAAK,WAAY,MAAOC,MAAKmlB,GAAGoM,OAG3CwE,GAAQ,QAAShb,MAAKxW,GACxB,GAKInD,GAAGE,EAAQuX,EAAQ7W,EAAQiZ,EAAMra,EALjC4E,EAAU4F,EAAS7G,GACnBkI,EAAUnK,UAAUhB,OACpB4Z,EAAUzO,EAAO,EAAInK,UAAU,GAAKvG,EACpCof,EAAUD,IAAUnf,EACpBqf,EAAUP,EAAUrV,EAExB,IAAG4V,GAAUrf,IAAc4e,EAAYS,GAAQ,CAC7C,IAAIxa,EAAWwa,EAAO5e,KAAKgJ,GAAIqT,KAAazX,EAAI,IAAK6Z,EAAOra,EAASyX,QAAQV,KAAMvW,IACjFyX,EAAO5W,KAAKgZ,EAAKhb,MACjBuF,GAAIqT,EAGR,IADGsC,GAAW1O,EAAO,IAAEyO,EAAQ7W,EAAI6W,EAAO5Y,UAAU,GAAI,IACpDlB,EAAI,EAAGE,EAASyH,EAASvD,EAAElE,QAASU,EAASmzB,GAASn1B,KAAMsB,GAASA,EAASF,EAAGA,IACnFY,EAAOZ,GAAK+Z,EAAUD,EAAM1V,EAAEpE,GAAIA,GAAKoE,EAAEpE,EAE3C,OAAOY,IAGLg0B,GAAM,QAASpa,MAIjB,IAHA,GAAIrT,GAAS,EACTjH,EAASgB,UAAUhB,OACnBU,EAASmzB,GAASn1B,KAAMsB,GACtBA,EAASiH,GAAMvG,EAAOuG,GAASjG,UAAUiG,IAC/C,OAAOvG,IAILi0B,KAAkBpC,GAAc1oB,EAAM,WAAY0pB,GAAoBr4B,KAAK,GAAIq3B,GAAW,MAE1FqC,GAAkB,QAASpB,kBAC7B,MAAOD,IAAoBnxB,MAAMuyB,GAAgBxoB,GAAWjR,KAAKm5B,GAAS31B,OAAS21B,GAAS31B,MAAOsC,YAGjGyK,IACFwR,WAAY,QAASA,YAAWtZ,EAAQkX,GACtC,MAAOyX,GAAgBp3B,KAAKm5B,GAAS31B,MAAOiF,EAAQkX,EAAO7Z,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAEnG8hB,MAAO,QAASA,OAAMlB,GACpB,MAAOwX,IAAWwB,GAAS31B,MAAO2c,EAAYra,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAEtF4iB,KAAM,QAASA,MAAK1e,GAClB,MAAO0vB,GAAUjsB,MAAMiyB,GAAS31B,MAAOsC,YAEzCmb,OAAQ,QAASA,QAAOd,GACtB,MAAOiZ,IAAgB51B,KAAMi0B,GAAY0B,GAAS31B,MAAO2c,EACvDra,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,KAE1CgjB,KAAM,QAASA,MAAKoX,GAClB,MAAOhL,IAAUwK,GAAS31B,MAAOm2B,EAAW7zB,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAEpFijB,UAAW,QAASA,WAAUmX,GAC5B,MAAO/K,IAAeuK,GAAS31B,MAAOm2B,EAAW7zB,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAEzFuQ,QAAS,QAASA,SAAQqQ,GACxBqX,GAAa2B,GAAS31B,MAAO2c,EAAYra,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAEjFob,QAAS,QAASA,SAAQkH,GACxB,MAAO5V,IAAaktB,GAAS31B,MAAOqe,EAAe/b,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAE3Fmb,SAAU,QAASA,UAASmH,GAC1B,MAAO+V,IAAcuB,GAAS31B,MAAOqe,EAAe/b,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG;EAE5F0K,KAAM,QAASA,MAAKqV,GAClB,MAAOD,IAAUnY,MAAMiyB,GAAS31B,MAAOsC,YAEzCgc,YAAa,QAASA,aAAYD,GAChC,MAAOmW,IAAiB9wB,MAAMiyB,GAAS31B,MAAOsC,YAEhDib,IAAK,QAASA,KAAIrC,GAChB,MAAOoC,IAAKqY,GAAS31B,MAAOkb,EAAO5Y,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAE3EgiB,OAAQ,QAASA,QAAOpB,GACtB,MAAO8X,IAAY/wB,MAAMiyB,GAAS31B,MAAOsC,YAE3C4b,YAAa,QAASA,aAAYvB,GAChC,MAAO+X,IAAiBhxB,MAAMiyB,GAAS31B,MAAOsC,YAEhDwvB,QAAS,QAASA,WAMhB,IALA,GAII7xB,GAJA+G,EAAShH,KACTsB,EAASq0B,GAAS3uB,GAAM1F,OACxB80B,EAASxyB,KAAK2F,MAAMjI,EAAS,GAC7BiH,EAAS,EAEPA,EAAQ6tB,GACZn2B,EAAgB+G,EAAKuB,GACrBvB,EAAKuB,KAAWvB,IAAO1F,GACvB0F,EAAK1F,GAAWrB,CAChB,OAAO+G,IAEX2W,KAAM,QAASA,MAAKhB,GAClB,MAAOuX,IAAUyB,GAAS31B,MAAO2c,EAAYra,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,IAErFwgB,KAAM,QAASA,MAAKC,GAClB,MAAOmY,IAAUn4B,KAAKm5B,GAAS31B,MAAOwc,IAExC6Z,SAAU,QAASA,UAASpa,EAAOrF,GACjC,GAAIpR,GAASmwB,GAAS31B,MAClBsB,EAASkE,EAAElE,OACXg1B,EAASttB,EAAQiT,EAAO3a,EAC5B,OAAO,KAAK6b,EAAmB3X,EAAGA,EAAEwvB,MAClCxvB,EAAE8oB,OACF9oB,EAAE8sB,WAAagE,EAAS9wB,EAAEuuB,kBAC1BhrB,GAAU6N,IAAQ7a,EAAYuF,EAAS0H,EAAQ4N,EAAKtV,IAAWg1B,MAKjExH,GAAS,QAAShmB,OAAMqT,EAAOvF,GACjC,MAAOgf,IAAgB51B,KAAMyN,GAAWjR,KAAKm5B,GAAS31B,MAAOmc,EAAOvF,KAGlErU,GAAO,QAASE,KAAIuY,GACtB2a,GAAS31B,KACT,IAAIwyB,GAASiD,GAASnzB,UAAU,GAAI,GAChChB,EAAStB,KAAKsB,OACdmJ,EAASW,EAAS4P,GAClBpN,EAAS7E,EAAS0B,EAAInJ,QACtBiH,EAAS,CACb,IAAGqF,EAAM4kB,EAASlxB,EAAO,KAAMqQ,GAAWke,GAC1C,MAAMtnB,EAAQqF,GAAI5N,KAAKwyB,EAASjqB,GAASkC,EAAIlC,MAG3CguB,IACFzd,QAAS,QAASA,WAChB,MAAOyb,IAAa/3B,KAAKm5B,GAAS31B,QAEpCmB,KAAM,QAASA,QACb,MAAOmzB,IAAU93B,KAAKm5B,GAAS31B,QAEjC6Y,OAAQ,QAASA,UACf,MAAOwb,IAAY73B,KAAKm5B,GAAS31B,SAIjCw2B,GAAY,SAASvxB,EAAQ7E,GAC/B,MAAOsF,GAAST,IACXA,EAAOiwB,KACO,gBAAP90B,IACPA,IAAO6E,IACPyB,QAAQtG,IAAQsG,OAAOtG,IAE1Bq2B,GAAW,QAAS70B,0BAAyBqD,EAAQ7E,GACvD,MAAOo2B,IAAUvxB,EAAQ7E,EAAMrC,EAAYqC,GAAK,IAC5CozB,EAAa,EAAGvuB,EAAO7E,IACvB9B,EAAK2G,EAAQ7E,IAEfs2B,GAAW,QAAS51B,gBAAemE,EAAQ7E,EAAKosB,GAClD,QAAGgK,GAAUvxB,EAAQ7E,EAAMrC,EAAYqC,GAAK,KACvCsF,EAAS8mB,IACT3vB,EAAI2vB,EAAM,WACT3vB,EAAI2vB,EAAM,QACV3vB,EAAI2vB,EAAM,QAEVA,EAAKhqB,cACJ3F,EAAI2vB,EAAM,cAAeA,EAAKvmB,UAC9BpJ,EAAI2vB,EAAM,gBAAiBA,EAAKzrB,WAIzBvC,EAAGyG,EAAQ7E,EAAKosB,IAF5BvnB,EAAO7E,GAAOosB,EAAKvsB,MACZgF,GAIPgwB,MACF92B,EAAMI,EAAIk4B,GACVr4B,EAAIG,EAAMm4B,IAGZ35B,EAAQA,EAAQmG,EAAInG,EAAQ+F,GAAKmyB,GAAkB,UACjDrzB,yBAA0B60B,GAC1B31B,eAA0B41B,KAGzBvrB,EAAM,WAAYypB,GAAcp4B,aACjCo4B,GAAgBC,GAAsB,QAASnyB,YAC7C,MAAOmZ,IAAUrf,KAAKwD,OAI1B,IAAI22B,IAAwBzN,KAAgBnc,GAC5Cmc,GAAYyN,GAAuBJ,IACnCnyB,EAAKuyB,GAAuB7e,GAAUye,GAAW1d,QACjDqQ,EAAYyN,IACV7tB,MAAgBgmB,GAChBrsB,IAAgBF,GAChBgJ,YAAgB,aAChB7I,SAAgBkyB,GAChBE,eAAgBoB,KAElB5E,GAAUqF,GAAuB,SAAU,KAC3CrF,GAAUqF,GAAuB,aAAc,KAC/CrF,GAAUqF,GAAuB,aAAc,KAC/CrF,GAAUqF,GAAuB,SAAU,KAC3Cn4B,EAAGm4B,GAAuB5uB,IACxBhI,IAAK,WAAY,MAAOC,MAAKk1B,OAG/B74B,EAAOD,QAAU,SAASc,EAAKw4B,EAAOpQ,EAASsR,GAC7CA,IAAYA,CACZ,IAAIzoB,GAAajR,GAAO05B,EAAU,UAAY,IAAM,QAChDC,EAAqB,cAAR1oB,EACb2oB,EAAa,MAAQ55B,EACrB65B,EAAa,MAAQ75B,EACrB85B,EAAap6B,EAAOuR,GACpBS,EAAaooB,MACbC,EAAaD,GAAc1rB,EAAe0rB,GAC1Cxe,GAAcwe,IAAe3I,EAAOO,IACpCppB,KACA0xB,EAAsBF,GAAcA,EAAWh4B,GAC/Cm4B,EAAS,SAASnwB,EAAMuB,GAC1B,GAAIqI,GAAO5J,EAAKme,EAChB,OAAOvU,GAAKqY,EAAE6N,GAAQvuB,EAAQmtB,EAAQ9kB,EAAKwmB,EAAGhC,KAE5Cx1B,EAAS,SAASoH,EAAMuB,EAAOtI,GACjC,GAAI2Q,GAAO5J,EAAKme,EACbyR,KAAQ32B,GAASA,EAAQ2D,KAAKyzB,MAAMp3B,IAAU,EAAI,EAAIA,EAAQ,IAAO,IAAe,IAARA,GAC/E2Q,EAAKqY,EAAE8N,GAAQxuB,EAAQmtB,EAAQ9kB,EAAKwmB,EAAGn3B,EAAOm1B,KAE5CkC,EAAa,SAAStwB,EAAMuB,GAC9B/J,EAAGwI,EAAMuB,GACPxI,IAAK,WACH,MAAOo3B,GAAOn3B,KAAMuI,IAEtB9F,IAAK,SAASxC,GACZ,MAAOL,GAAOI,KAAMuI,EAAOtI,IAE7Bc,YAAY,IAGbyX,IACDwe,EAAa1R,EAAQ,SAASte,EAAM4J,EAAM2mB,EAASC,GACjDvV,EAAWjb,EAAMgwB,EAAY7oB,EAAM,KACnC,IAEImgB,GAAQY,EAAY5tB,EAAQ4a,EAF5B3T,EAAS,EACTiqB,EAAS,CAEb,IAAI9sB,EAASkL,GAIN,CAAA,KAAGA,YAAgB4d,KAAiBtS,EAAQ/O,EAAQyD,KAAUoe,GAAgB9S,GAAS4X,GAavF,MAAGoB,MAAetkB,GAChBklB,GAASkB,EAAYpmB,GAErBmlB,GAAMv5B,KAAKw6B,EAAYpmB,EAf9B0d,GAAS1d,EACT4hB,EAASiD,GAAS8B,EAAS7B,EAC3B,IAAI+B,GAAO7mB,EAAKse,UAChB,IAAGsI,IAAYz7B,EAAU,CACvB,GAAG07B,EAAO/B,EAAM,KAAM/jB,GAAWke,GAEjC,IADAX,EAAauI,EAAOjF,EACjBtD,EAAa,EAAE,KAAMvd,GAAWke,QAGnC,IADAX,EAAanmB,EAASyuB,GAAW9B,EAC9BxG,EAAasD,EAASiF,EAAK,KAAM9lB,GAAWke,GAEjDvuB,GAAS4tB,EAAawG,MAftBp0B,GAAai0B,GAAe3kB,GAAM,GAClCse,EAAa5tB,EAASo0B,EACtBpH,EAAa,GAAIE,GAAaU,EA0BhC,KAPA9qB,EAAK4C,EAAM,MACTC,EAAGqnB,EACH8I,EAAG5E,EACHnxB,EAAG6tB,EACHhrB,EAAG5C,EACH2nB,EAAG,GAAIwF,GAAUH,KAEb/lB,EAAQjH,GAAOg2B,EAAWtwB,EAAMuB,OAExC2uB,EAAsBF,EAAWh4B,GAAawC,EAAOm1B,IACrDvyB,EAAK8yB,EAAqB,cAAeF,IAChCnN,EAAY,SAAS/O,GAG9B,GAAIkc,GAAW,MACf,GAAIA,GAAWlc,KACd,KACDkc,EAAa1R,EAAQ,SAASte,EAAM4J,EAAM2mB,EAASC,GACjDvV,EAAWjb,EAAMgwB,EAAY7oB,EAC7B,IAAI+N,EAGJ,OAAIxW,GAASkL,GACVA,YAAgB4d,KAAiBtS,EAAQ/O,EAAQyD,KAAUoe,GAAgB9S,GAAS4X,EAC9E0D,IAAYz7B,EACf,GAAI6S,GAAKgC,EAAM6kB,GAAS8B,EAAS7B,GAAQ8B,GACzCD,IAAYx7B,EACV,GAAI6S,GAAKgC,EAAM6kB,GAAS8B,EAAS7B,IACjC,GAAI9mB,GAAKgC,GAEdskB,KAAetkB,GAAYklB,GAASkB,EAAYpmB,GAC5CmlB,GAAMv5B,KAAKw6B,EAAYpmB,GATJ,GAAIhC,GAAK2mB,GAAe3kB,EAAMimB,MAW1D7C,GAAaiD,IAAQlzB,SAAS4C,UAAYlI,EAAKmQ,GAAM9H,OAAOrI,EAAKw4B,IAAQx4B,EAAKmQ,GAAO,SAASxO,GACvFA,IAAO42B,IAAY5yB,EAAK4yB,EAAY52B,EAAKwO,EAAKxO,MAErD42B,EAAWh4B,GAAak4B,EACpB/uB,IAAQ+uB,EAAoB3rB,YAAcyrB,GAEhD,IAAIU,GAAoBR,EAAoBpf,IACxC6f,IAAsBD,IAA4C,UAAxBA,EAAgB/0B,MAAoB+0B,EAAgB/0B,MAAQ5G,GACtG67B,EAAoBrB,GAAW1d,MACnCzU,GAAK4yB,EAAYjC,IAAmB,GACpC3wB,EAAK8yB,EAAqBhC,GAAa/mB,GACvC/J,EAAK8yB,EAAqBnI,IAAM,GAChC3qB,EAAK8yB,EAAqBlC,GAAiBgC,IAExCJ,EAAU,GAAII,GAAW,GAAGjvB,KAAQoG,EAASpG,KAAOmvB,KACrD14B,EAAG04B,EAAqBnvB,IACtBhI,IAAK,WAAY,MAAOoO,MAI5B3I,EAAE2I,GAAQ6oB,EAEVj6B,EAAQA,EAAQ6F,EAAI7F,EAAQ8F,EAAI9F,EAAQ+F,GAAKk0B,GAAcpoB,GAAOpJ,GAElEzI,EAAQA,EAAQmG,EAAGiL,GACjB4lB,kBAAmB2B,EACnB3a,KAAMgb,GACNna,GAAIoa,KAGDjC,IAAqBmD,IAAqB9yB,EAAK8yB,EAAqBnD,EAAmB2B,GAE5F34B,EAAQA,EAAQmE,EAAGiN,EAAMpB,IAEzBqc,EAAWjb,GAEXpR,EAAQA,EAAQmE,EAAInE,EAAQ+F,EAAIwyB,GAAYnnB,GAAO1L,IAAKF,KAExDxF,EAAQA,EAAQmE,EAAInE,EAAQ+F,GAAK60B,EAAmBxpB,EAAMooB,IAE1Dx5B,EAAQA,EAAQmE,EAAInE,EAAQ+F,GAAKo0B,EAAoBx0B,UAAYkyB,IAAgBzmB,GAAOzL,SAAUkyB,KAElG73B,EAAQA,EAAQmE,EAAInE,EAAQ+F,EAAIqI,EAAM,WACpC,GAAI6rB,GAAW,GAAGluB,UAChBqF,GAAOrF,MAAOgmB,KAElB/xB,EAAQA,EAAQmE,EAAInE,EAAQ+F,GAAKqI,EAAM,WACrC,OAAQ,EAAG,GAAG2pB,kBAAoB,GAAIkC,IAAY,EAAG,IAAIlC,qBACpD3pB,EAAM,WACX+rB,EAAoBpC,eAAet4B,MAAM,EAAG,OACzC2R,GAAO2mB,eAAgBoB,KAE5Bte,EAAUzJ,GAAQwpB,EAAoBD,EAAkBE,EACpDzvB,GAAYwvB,GAAkBvzB,EAAK8yB,EAAqBpf,GAAU8f,QAEnEv7B,GAAOD,QAAU,cAInB,SAASC,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,QAAS,EAAG,SAASo3B,GAC5C,MAAO,SAASQ,YAAWjjB,EAAM0hB,EAAYhxB,GAC3C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,QAAS,EAAG,SAASo3B,GAC5C,MAAO,SAASwE,mBAAkBjnB,EAAM0hB,EAAYhxB,GAClD,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,MAErC,IAIE,SAASjF,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,QAAS,EAAG,SAASo3B,GAC5C,MAAO,SAASyE,YAAWlnB,EAAM0hB,EAAYhxB,GAC3C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,SAAU,EAAG,SAASo3B,GAC7C,MAAO,SAASgC,aAAYzkB,EAAM0hB,EAAYhxB,GAC5C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,QAAS,EAAG,SAASo3B,GAC5C,MAAO,SAAS0E,YAAWnnB,EAAM0hB,EAAYhxB,GAC3C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,SAAU,EAAG,SAASo3B,GAC7C,MAAO,SAAS2E,aAAYpnB,EAAM0hB,EAAYhxB,GAC5C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,UAAW,EAAG,SAASo3B,GAC9C,MAAO,SAAS4E,cAAarnB,EAAM0hB,EAAYhxB,GAC7C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAE/BA,EAAoB,KAAK,UAAW,EAAG,SAASo3B,GAC9C,MAAO,SAAS6E,cAAatnB,EAAM0hB,EAAYhxB,GAC7C,MAAO+xB,GAAKrzB,KAAM4Q,EAAM0hB,EAAYhxB,OAMnC,SAASjF,EAAQD,EAASH,GAI/B,GAAIc,GAAYd,EAAoB,GAChCk8B,EAAYl8B,EAAoB,KAAI,EAExCc,GAAQA,EAAQmE,EAAG,SACjBgW,SAAU,QAASA,UAAS5O,GAC1B,MAAO6vB,GAAUn4B,KAAMsI,EAAIhG,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,MAIrEE,EAAoB,KAAK,aAIpB,SAASI,EAAQD,EAASH,GAI/B,GAAIc,GAAUd,EAAoB,GAC9Bka,EAAUla,EAAoB,MAAK,EAEvCc,GAAQA,EAAQmE,EAAG,UACjBk3B,GAAI,QAASA,IAAG/hB,GACd,MAAOF,GAAInW,KAAMqW,OAMhB,SAASha,EAAQD,EAASH,GAI/B,GAAIc,GAAUd,EAAoB,GAC9Bo8B,EAAUp8B,EAAoB,IAElCc,GAAQA,EAAQmE,EAAG,UACjBo3B,SAAU,QAASA,UAASC,GAC1B,MAAOF,GAAKr4B,KAAMu4B,EAAWj2B,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,GAAW,OAM7E,SAASM,EAAQD,EAASH,GAG/B,GAAI8M,GAAW9M,EAAoB,IAC/BwU,EAAWxU,EAAoB,IAC/B2M,EAAW3M,EAAoB,GAEnCI,GAAOD,QAAU,SAAS4K,EAAMuxB,EAAWC,EAAYC,GACrD,GAAIv1B,GAAewD,OAAOkC,EAAQ5B,IAC9B0xB,EAAex1B,EAAE5B,OACjBq3B,EAAeH,IAAez8B,EAAY,IAAM2K,OAAO8xB,GACvDI,EAAe7vB,EAASwvB,EAC5B,IAAGK,GAAgBF,GAA2B,IAAXC,EAAc,MAAOz1B,EACxD,IAAI21B,GAAUD,EAAeF,EACzBI,EAAeroB,EAAOjU,KAAKm8B,EAAS/0B,KAAK0F,KAAKuvB,EAAUF,EAAQr3B,QAEpE,OADGw3B,GAAax3B,OAASu3B,IAAQC,EAAeA,EAAahwB,MAAM,EAAG+vB,IAC/DJ,EAAOK,EAAe51B,EAAIA,EAAI41B,IAMlC,SAASz8B,EAAQD,EAASH,GAI/B,GAAIc,GAAUd,EAAoB,GAC9Bo8B,EAAUp8B,EAAoB,IAElCc,GAAQA,EAAQmE,EAAG,UACjB63B,OAAQ,QAASA,QAAOR,GACtB,MAAOF,GAAKr4B,KAAMu4B,EAAWj2B,UAAUhB,OAAS,EAAIgB,UAAU,GAAKvG,GAAW,OAM7E,SAASM,EAAQD,EAASH,GAI/BA,EAAoB,IAAI,WAAY,SAASuS,GAC3C,MAAO,SAASwqB,YACd,MAAOxqB,GAAMxO,KAAM,KAEpB,cAIE,SAAS3D,EAAQD,EAASH,GAI/BA,EAAoB,IAAI,YAAa,SAASuS,GAC5C,MAAO,SAASyqB,aACd,MAAOzqB,GAAMxO,KAAM,KAEpB,YAIE,SAAS3D,EAAQD,EAASH,GAI/B,GAAIc,GAAcd,EAAoB,GAClC2M,EAAc3M,EAAoB,IAClC8M,EAAc9M,EAAoB,IAClC6a,EAAc7a,EAAoB,KAClCi9B,EAAcj9B,EAAoB,KAClCk9B,EAAcnpB,OAAOrJ,UAErByyB,EAAwB,SAASjZ,EAAQ9P,GAC3CrQ,KAAKq5B,GAAKlZ,EACVngB,KAAK+jB,GAAK1T,EAGZpU,GAAoB,KAAKm9B,EAAuB,gBAAiB,QAAS/gB,QACxE,GAAIjK,GAAQpO,KAAKq5B,GAAGp1B,KAAKjE,KAAK+jB,GAC9B,QAAQ9jB,MAAOmO,EAAOuJ,KAAgB,OAAVvJ,KAG9BrR,EAAQA,EAAQmE,EAAG,UACjBo4B,SAAU,QAASA,UAASnZ,GAE1B,GADAvX,EAAQ5I,OACJ8W,EAASqJ,GAAQ,KAAM9d,WAAU8d,EAAS,oBAC9C,IAAIjd,GAAQwD,OAAO1G,MACfigB,EAAQ,SAAWkZ,GAAczyB,OAAOyZ,EAAOF,OAASiZ,EAAS18B,KAAK2jB,GACtEoZ,EAAQ,GAAIvpB,QAAOmQ,EAAO5b,QAAS0b,EAAM9I,QAAQ,KAAO8I,EAAQ,IAAMA,EAE1E,OADAsZ,GAAG/X,UAAYzY,EAASoX,EAAOqB,WACxB,GAAI4X,GAAsBG,EAAIr2B,OAMpC,SAAS7G,EAAQD,EAASH,GAE/BA,EAAoB,IAAI,kBAInB,SAASI,EAAQD,EAASH,GAE/BA,EAAoB,IAAI,eAInB,SAASI,EAAQD,EAASH,GAG/B,GAAIc,GAAiBd,EAAoB,GACrC4wB,EAAiB5wB,EAAoB,KACrC6B,EAAiB7B,EAAoB,IACrCqC,EAAiBrC,EAAoB,IACrC2e,EAAiB3e,EAAoB,IAEzCc,GAAQA,EAAQmG,EAAG,UACjBs2B,0BAA2B,QAASA,2BAA0Bl0B,GAO5D,IANA,GAKIlF,GALAoF,EAAU1H,EAAUwH,GACpBm0B,EAAUn7B,EAAKC,EACf4C,EAAU0rB,EAAQrnB,GAClBxD,KACAZ,EAAU,EAERD,EAAKG,OAASF,GAAEwZ,EAAe5Y,EAAQ5B,EAAMe,EAAKC,KAAMq4B,EAAQj0B,EAAGpF,GACzE,OAAO4B,OAMN,SAAS3F,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9By9B,EAAUz9B,EAAoB,MAAK,EAEvCc,GAAQA,EAAQmG,EAAG,UACjB2V,OAAQ,QAASA,QAAO1Y,GACtB,MAAOu5B,GAAQv5B,OAMd,SAAS9D,EAAQD,EAASH,GAE/B,GAAIoM,GAAYpM,EAAoB,IAChC6B,EAAY7B,EAAoB,IAChCkD,EAAYlD,EAAoB,IAAIsC,CACxClC,GAAOD,QAAU,SAASu9B,GACxB,MAAO,UAASx5B,GAOd,IANA,GAKIC,GALAoF,EAAS1H,EAAUqC,GACnBgB,EAASkH,EAAQ7C,GACjBlE,EAASH,EAAKG,OACdF,EAAS,EACTY,KAEEV,EAASF,GAAKjC,EAAO3C,KAAKgJ,EAAGpF,EAAMe,EAAKC,OAC5CY,EAAOC,KAAK03B,GAAav5B,EAAKoF,EAAEpF,IAAQoF,EAAEpF,GAC1C,OAAO4B,MAMR,SAAS3F,EAAQD,EAASH,GAG/B,GAAIc,GAAWd,EAAoB,GAC/Bkd,EAAWld,EAAoB,MAAK,EAExCc,GAAQA,EAAQmG,EAAG,UACjB4V,QAAS,QAASA,SAAQ3Y,GACxB,MAAOgZ,GAAShZ,OAMf,SAAS9D,EAAQD,EAASH,GAG/B,GAAIc,GAAkBd,EAAoB,GACtCmP,EAAkBnP,EAAoB,IACtC8K,EAAkB9K,EAAoB,IACtC4E,EAAkB5E,EAAoB,EAG1CA,GAAoB,IAAMc,EAAQA,EAAQmE,EAAIjF,EAAoB,KAAM,UACtE29B,iBAAkB,QAASA,kBAAiB14B,EAAGi2B,GAC7Ct2B,EAAgBtC,EAAE6M,EAASpL,MAAOkB,GAAInB,IAAKgH,EAAUowB,GAASp2B,YAAY,EAAMyB,cAAc,QAM7F,SAASnG,EAAQD,EAASH,GAG/BI,EAAOD,QAAUH,EAAoB,MAAOA,EAAoB,GAAG,WACjE,GAAIoQ,GAAIzI,KAAKiD,QAEbgzB,kBAAiBr9B,KAAK,KAAM6P,EAAG,oBACxBpQ,GAAoB,GAAGoQ,MAK3B,SAAShQ,EAAQD,EAASH,GAG/B,GAAIc,GAAkBd,EAAoB,GACtCmP,EAAkBnP,EAAoB,IACtC8K,EAAkB9K,EAAoB,IACtC4E,EAAkB5E,EAAoB,EAG1CA,GAAoB,IAAMc,EAAQA,EAAQmE,EAAIjF,EAAoB,KAAM,UACtE49B,iBAAkB,QAASA,kBAAiB34B,EAAGtB,GAC7CiB,EAAgBtC,EAAE6M,EAASpL,MAAOkB,GAAIuB,IAAKsE,EAAUnH,GAASmB,YAAY,EAAMyB,cAAc,QAM7F,SAASnG,EAAQD,EAASH,GAG/B,GAAIc,GAA2Bd,EAAoB,GAC/CmP,EAA2BnP,EAAoB,IAC/C8B,EAA2B9B,EAAoB,IAC/CqP,EAA2BrP,EAAoB,IAC/C2F,EAA2B3F,EAAoB,IAAIsC,CAGvDtC,GAAoB,IAAMc,EAAQA,EAAQmE,EAAIjF,EAAoB,KAAM,UACtE69B,iBAAkB,QAASA,kBAAiB54B,GAC1C,GAEIb,GAFAmF,EAAI4F,EAASpL,MACbqM,EAAItO,EAAYmD,GAAG,EAEvB,GACE,IAAGb,EAAIuB,EAAyB4D,EAAG6G,GAAG,MAAOhM,GAAEN,UACzCyF,EAAI8F,EAAe9F,QAM1B,SAASnJ,EAAQD,EAASH,GAG/B,GAAIc,GAA2Bd,EAAoB,GAC/CmP,EAA2BnP,EAAoB,IAC/C8B,EAA2B9B,EAAoB,IAC/CqP,EAA2BrP,EAAoB,IAC/C2F,EAA2B3F,EAAoB,IAAIsC,CAGvDtC,GAAoB,IAAMc,EAAQA,EAAQmE,EAAIjF,EAAoB,KAAM,UACtE89B,iBAAkB,QAASA,kBAAiB74B,GAC1C,GAEIb,GAFAmF,EAAI4F,EAASpL,MACbqM,EAAItO,EAAYmD,GAAG,EAEvB,GACE,IAAGb,EAAIuB,EAAyB4D,EAAG6G,GAAG,MAAOhM,GAAEoC,UACzC+C,EAAI8F,EAAe9F,QAM1B,SAASnJ,EAAQD,EAASH,GAG/B,GAAIc,GAAWd,EAAoB,EAEnCc,GAAQA,EAAQmE,EAAInE,EAAQqI,EAAG,OAAQioB,OAAQpxB,EAAoB,KAAK,UAInE,SAASI,EAAQD,EAASH,GAG/B,GAAIkR,GAAUlR,EAAoB,IAC9B8e,EAAU9e,EAAoB,IAClCI,GAAOD,QAAU,SAAS+R,GACxB,MAAO,SAASkf,UACd,GAAGlgB,EAAQnN,OAASmO,EAAK,KAAM9L,WAAU8L,EAAO,wBAChD,OAAO4M,GAAK/a,SAMX,SAAS3D,EAAQD,EAASH,GAE/B,GAAIimB,GAAQjmB,EAAoB,IAEhCI,GAAOD,QAAU,SAAS0e,EAAMhD,GAC9B,GAAI9V,KAEJ,OADAkgB,GAAMpH,GAAM,EAAO9Y,EAAOC,KAAMD,EAAQ8V,GACjC9V,IAMJ,SAAS3F,EAAQD,EAASH,GAG/B,GAAIc,GAAWd,EAAoB,EAEnCc,GAAQA,EAAQmE,EAAInE,EAAQqI,EAAG,OAAQioB,OAAQpxB,EAAoB,KAAK,UAInE,SAASI,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,UAAWtG,OAAQX,EAAoB,MAIrD,SAASI,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9B4M,EAAU5M,EAAoB,GAElCc,GAAQA,EAAQmG,EAAG,SACjB82B,QAAS,QAASA,SAAQ75B,GACxB,MAAmB,UAAZ0I,EAAI1I,OAMV,SAAS9D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjB+2B,MAAO,QAASA,OAAMC,EAAIC,EAAIC,EAAIC,GAChC,GAAIC,GAAMJ,IAAO,EACbK,EAAMJ,IAAO,EACbK,EAAMJ,IAAO,CACjB,OAAOG,IAAOF,IAAO,KAAOC,EAAME,GAAOF,EAAME,KAASF,EAAME,IAAQ,MAAQ,IAAM,MAMnF,SAASn+B,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjBu3B,MAAO,QAASA,OAAMP,EAAIC,EAAIC,EAAIC,GAChC,GAAIC,GAAMJ,IAAO,EACbK,EAAMJ,IAAO,EACbK,EAAMJ,IAAO,CACjB,OAAOG,IAAOF,IAAO,MAAQC,EAAME,IAAQF,EAAME,GAAOF,EAAME,IAAQ,KAAO,IAAM,MAMlF,SAASn+B,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjBw3B,MAAO,QAASA,OAAMC,EAAG1R,GACvB,GAAI/T,GAAS,MACT0lB,GAAMD,EACNE,GAAM5R,EACN6R,EAAKF,EAAK1lB,EACV6lB,EAAKF,EAAK3lB,EACV8lB,EAAKJ,GAAM,GACXK,EAAKJ,GAAM,GACXzpB,GAAM4pB,EAAKD,IAAO,IAAMD,EAAKC,IAAO,GACxC,OAAOC,GAAKC,GAAM7pB,GAAK,MAAQ0pB,EAAKG,IAAO,IAAM7pB,EAAI8D,IAAW,QAM/D,SAAS7Y,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAG,QACjBg4B,MAAO,QAASA,OAAMP,EAAG1R,GACvB,GAAI/T,GAAS,MACT0lB,GAAMD,EACNE,GAAM5R,EACN6R,EAAKF,EAAK1lB,EACV6lB,EAAKF,EAAK3lB,EACV8lB,EAAKJ,IAAO,GACZK,EAAKJ,IAAO,GACZzpB,GAAM4pB,EAAKD,IAAO,IAAMD,EAAKC,IAAO,GACxC,OAAOC,GAAKC,GAAM7pB,IAAM,MAAQ0pB,EAAKG,IAAO,IAAM7pB,EAAI8D,KAAY,QAMjE,SAAS7Y,EAAQD,EAASH,GAE/B,GAAIk/B,GAA4Bl/B,EAAoB,KAChD4B,EAA4B5B,EAAoB,IAChDm/B,EAA4BD,EAAS/6B,IACrCi7B,EAA4BF,EAAS14B,GAEzC04B,GAASz2B,KAAK42B,eAAgB,QAASA,gBAAeC,EAAaC,EAAev2B,EAAQw2B,GACxFJ,EAA0BE,EAAaC,EAAe39B,EAASoH,GAASm2B,EAAUK,QAK/E,SAASp/B,EAAQD,EAASH,GAE/B,GAAI6sB,GAAU7sB,EAAoB,KAC9Bc,EAAUd,EAAoB,GAC9BmB,EAAUnB,EAAoB,IAAI,YAClCgH,EAAU7F,EAAO6F,QAAU7F,EAAO6F,MAAQ,IAAKhH,EAAoB,OAEnEy/B,EAAyB,SAASz2B,EAAQw2B,EAAWj6B,GACvD,GAAIm6B,GAAiB14B,EAAMlD,IAAIkF,EAC/B,KAAI02B,EAAe,CACjB,IAAIn6B,EAAO,MAAOzF,EAClBkH,GAAMR,IAAIwC,EAAQ02B,EAAiB,GAAI7S,IAEzC,GAAI8S,GAAcD,EAAe57B,IAAI07B,EACrC,KAAIG,EAAY,CACd,IAAIp6B,EAAO,MAAOzF,EAClB4/B,GAAel5B,IAAIg5B,EAAWG,EAAc,GAAI9S,IAChD,MAAO8S,IAEPC,EAAyB,SAASC,EAAat2B,EAAGtE,GACpD,GAAI66B,GAAcL,EAAuBl2B,EAAGtE,GAAG,EAC/C,OAAO66B,KAAgBhgC,GAAoBggC,EAAYl/B,IAAIi/B,IAEzDE,EAAyB,SAASF,EAAat2B,EAAGtE,GACpD,GAAI66B,GAAcL,EAAuBl2B,EAAGtE,GAAG,EAC/C,OAAO66B,KAAgBhgC,EAAYA,EAAYggC,EAAYh8B,IAAI+7B,IAE7DT,EAA4B,SAASS,EAAaG,EAAez2B,EAAGtE,GACtEw6B,EAAuBl2B,EAAGtE,GAAG,GAAMuB,IAAIq5B,EAAaG,IAElDC,EAA0B,SAASj3B,EAAQw2B,GAC7C,GAAIM,GAAcL,EAAuBz2B,EAAQw2B,GAAW,GACxDt6B,IAEJ,OADG46B,IAAYA,EAAYzvB,QAAQ,SAAS6vB,EAAG/7B,GAAMe,EAAKc,KAAK7B,KACxDe,GAELi6B,EAAY,SAASj7B,GACvB,MAAOA,KAAOpE,GAA0B,gBAANoE,GAAiBA,EAAKuG,OAAOvG,IAE7DuE,EAAM,SAASc,GACjBzI,EAAQA,EAAQmG,EAAG,UAAWsC,GAGhCnJ,GAAOD,SACL6G,MAAOA,EACPsa,IAAKme,EACL7+B,IAAKg/B,EACL97B,IAAKi8B,EACLv5B,IAAK44B,EACLl6B,KAAM+6B,EACN97B,IAAKg7B,EACL12B,IAAKA,IAKF,SAASrI,EAAQD,EAASH,GAE/B,GAAIk/B,GAAyBl/B,EAAoB,KAC7C4B,EAAyB5B,EAAoB,IAC7Cm/B,EAAyBD,EAAS/6B,IAClCs7B,EAAyBP,EAAS5d,IAClCta,EAAyBk4B,EAASl4B,KAEtCk4B,GAASz2B,KAAK03B,eAAgB,QAASA,gBAAeb,EAAat2B,GACjE,GAAIw2B,GAAcn5B,UAAUhB,OAAS,EAAIvF,EAAYq/B,EAAU94B,UAAU,IACrEy5B,EAAcL,EAAuB79B,EAASoH,GAASw2B,GAAW,EACtE,IAAGM,IAAgBhgC,IAAcggC,EAAY,UAAUR,GAAa,OAAO,CAC3E,IAAGQ,EAAY5hB,KAAK,OAAO,CAC3B,IAAIwhB,GAAiB14B,EAAMlD,IAAIkF,EAE/B,OADA02B,GAAe,UAAUF,KAChBE,EAAexhB,MAAQlX,EAAM,UAAUgC,OAK7C,SAAS5I,EAAQD,EAASH,GAE/B,GAAIk/B,GAAyBl/B,EAAoB,KAC7C4B,EAAyB5B,EAAoB,IAC7CqP,EAAyBrP,EAAoB,IAC7C4/B,EAAyBV,EAASt+B,IAClCm/B,EAAyBb,EAASp7B,IAClCq7B,EAAyBD,EAAS/6B,IAElCi8B,EAAsB,SAASP,EAAat2B,EAAGtE,GACjD,GAAIo7B,GAAST,EAAuBC,EAAat2B,EAAGtE,EACpD,IAAGo7B,EAAO,MAAON,GAAuBF,EAAat2B,EAAGtE,EACxD,IAAIqnB,GAASjd,EAAe9F,EAC5B,OAAkB,QAAX+iB,EAAkB8T,EAAoBP,EAAavT,EAAQrnB,GAAKnF,EAGzEo/B,GAASz2B,KAAK63B,YAAa,QAASA,aAAYhB,EAAat2B,GAC3D,MAAOo3B,GAAoBd,EAAa19B,EAASoH,GAAS3C,UAAUhB,OAAS,EAAIvF,EAAYq/B,EAAU94B,UAAU,SAK9G,SAASjG,EAAQD,EAASH,GAE/B,GAAIuuB,GAA0BvuB,EAAoB,KAC9C8e,EAA0B9e,EAAoB,KAC9Ck/B,EAA0Bl/B,EAAoB,KAC9C4B,EAA0B5B,EAAoB,IAC9CqP,EAA0BrP,EAAoB,IAC9CigC,EAA0Bf,EAASh6B,KACnCi6B,EAA0BD,EAAS/6B,IAEnCo8B,EAAuB,SAASh3B,EAAGtE,GACrC,GAAIu7B,GAASP,EAAwB12B,EAAGtE,GACpCqnB,EAASjd,EAAe9F,EAC5B,IAAc,OAAX+iB,EAAgB,MAAOkU,EAC1B,IAAIC,GAASF,EAAqBjU,EAAQrnB,EAC1C,OAAOw7B,GAAMp7B,OAASm7B,EAAMn7B,OAASyZ,EAAK,GAAIyP,GAAIiS,EAAM31B,OAAO41B,KAAWA,EAAQD,EAGpFtB,GAASz2B,KAAKi4B,gBAAiB,QAASA,iBAAgB13B,GACtD,MAAOu3B,GAAqB3+B,EAASoH,GAAS3C,UAAUhB,OAAS,EAAIvF,EAAYq/B,EAAU94B,UAAU,SAKlG,SAASjG,EAAQD,EAASH,GAE/B,GAAIk/B,GAAyBl/B,EAAoB,KAC7C4B,EAAyB5B,EAAoB,IAC7C+/B,EAAyBb,EAASp7B,IAClCq7B,EAAyBD,EAAS/6B,GAEtC+6B,GAASz2B,KAAKk4B,eAAgB,QAASA,gBAAerB,EAAat2B,GACjE,MAAO+2B,GAAuBT,EAAa19B,EAASoH,GAChD3C,UAAUhB,OAAS,EAAIvF,EAAYq/B,EAAU94B,UAAU,SAKxD,SAASjG,EAAQD,EAASH,GAE/B,GAAIk/B,GAA0Bl/B,EAAoB,KAC9C4B,EAA0B5B,EAAoB,IAC9CigC,EAA0Bf,EAASh6B,KACnCi6B,EAA0BD,EAAS/6B,GAEvC+6B,GAASz2B,KAAKm4B,mBAAoB,QAASA,oBAAmB53B,GAC5D,MAAOi3B,GAAwBr+B,EAASoH,GAAS3C,UAAUhB,OAAS,EAAIvF,EAAYq/B,EAAU94B,UAAU,SAKrG,SAASjG,EAAQD,EAASH,GAE/B,GAAIk/B,GAAyBl/B,EAAoB,KAC7C4B,EAAyB5B,EAAoB,IAC7CqP,EAAyBrP,EAAoB,IAC7C4/B,EAAyBV,EAASt+B,IAClCu+B,EAAyBD,EAAS/6B,IAElC08B,EAAsB,SAAShB,EAAat2B,EAAGtE,GACjD,GAAIo7B,GAAST,EAAuBC,EAAat2B,EAAGtE,EACpD,IAAGo7B,EAAO,OAAO,CACjB,IAAI/T,GAASjd,EAAe9F,EAC5B,OAAkB,QAAX+iB,GAAkBuU,EAAoBhB,EAAavT,EAAQrnB,GAGpEi6B,GAASz2B,KAAKq4B,YAAa,QAASA,aAAYxB,EAAat2B,GAC3D,MAAO63B,GAAoBvB,EAAa19B,EAASoH,GAAS3C,UAAUhB,OAAS,EAAIvF,EAAYq/B,EAAU94B,UAAU,SAK9G,SAASjG,EAAQD,EAASH,GAE/B,GAAIk/B,GAAyBl/B,EAAoB,KAC7C4B,EAAyB5B,EAAoB,IAC7C4/B,EAAyBV,EAASt+B,IAClCu+B,EAAyBD,EAAS/6B,GAEtC+6B,GAASz2B,KAAKs4B,eAAgB,QAASA,gBAAezB,EAAat2B,GACjE,MAAO42B,GAAuBN,EAAa19B,EAASoH,GAChD3C,UAAUhB,OAAS,EAAIvF,EAAYq/B,EAAU94B,UAAU,SAKxD,SAASjG,EAAQD,EAASH,GAE/B,GAAIk/B,GAA4Bl/B,EAAoB,KAChD4B,EAA4B5B,EAAoB,IAChD8K,EAA4B9K,EAAoB,IAChDm/B,EAA4BD,EAAS/6B,IACrCi7B,EAA4BF,EAAS14B,GAEzC04B,GAASz2B,KAAKy2B,SAAU,QAASA,UAASI,EAAaC,GACrD,MAAO,SAASyB,WAAUh4B,EAAQw2B,GAChCJ,EACEE,EAAaC,GACZC,IAAc1/B,EAAY8B,EAAWkJ,GAAW9B,GACjDm2B,EAAUK,SAOX,SAASp/B,EAAQD,EAASH,GAG/B,GAAIc,GAAYd,EAAoB,GAChCmmB,EAAYnmB,EAAoB,OAChCqmB,EAAYrmB,EAAoB,GAAGqmB,QACnCE,EAAgD,WAApCvmB,EAAoB,IAAIqmB,EAExCvlB,GAAQA,EAAQ6F,GACds6B,KAAM,QAASA,MAAKp3B,GAClB,GAAIse,GAAS5B,GAAUF,EAAQ8B,MAC/BhC,GAAUgC,EAASA,EAAO7W,KAAKzH,GAAMA,OAMpC,SAASzJ,EAAQD,EAASH,GAI/B,GAAIc,GAAcd,EAAoB,GAClCW,EAAcX,EAAoB,GAClCkI,EAAclI,EAAoB,GAClCmmB,EAAcnmB,EAAoB,OAClCkhC,EAAclhC,EAAoB,IAAI,cACtC8K,EAAc9K,EAAoB,IAClC4B,EAAc5B,EAAoB,IAClCgmB,EAAchmB,EAAoB,KAClCitB,EAAcjtB,EAAoB,KAClCmI,EAAcnI,EAAoB,GAClCimB,EAAcjmB,EAAoB,KAClCsqB,EAAcrE,EAAMqE,OAEpB5N,EAAY,SAAS7S,GACvB,MAAa,OAANA,EAAa/J,EAAYgL,EAAUjB,IAGxCs3B,EAAsB,SAASC,GACjC,GAAIC,GAAUD,EAAazZ,EACxB0Z,KACDD,EAAazZ,GAAK7nB,EAClBuhC,MAIAC,EAAqB,SAASF,GAChC,MAAOA,GAAaG,KAAOzhC,GAGzB0hC,EAAoB,SAASJ,GAC3BE,EAAmBF,KACrBA,EAAaG,GAAKzhC,EAClBqhC,EAAoBC,KAIpBK,EAAe,SAASC,EAAUC,GACpC//B,EAAS8/B,GACT39B,KAAK4jB,GAAK7nB,EACViE,KAAKw9B,GAAKG,EACVA,EAAW,GAAIE,GAAqB79B,KACpC,KACE,GAAIs9B,GAAeM,EAAWD,GAC1BN,EAAeC,CACL,OAAXA,IACiC,kBAAxBA,GAAQQ,YAA2BR,EAAU,WAAYD,EAAaS,eAC3E/2B,EAAUu2B,GACft9B,KAAK4jB,GAAK0Z,GAEZ,MAAMp5B,GAEN,WADAy5B,GAASpa,MAAMrf,GAEZq5B,EAAmBv9B,OAAMo9B,EAAoBp9B,MAGpD09B,GAAa/2B,UAAYuiB,MACvB4U,YAAa,QAASA,eAAeL,EAAkBz9B,QAGzD,IAAI69B,GAAuB,SAASR,GAClCr9B,KAAK+jB,GAAKsZ,EAGZQ,GAAqBl3B,UAAYuiB,MAC/B7Q,KAAM,QAASA,MAAKpY,GAClB,GAAIo9B,GAAer9B,KAAK+jB,EACxB,KAAIwZ,EAAmBF,GAAc,CACnC,GAAIM,GAAWN,EAAaG,EAC5B,KACE,GAAI/gC,GAAIkc,EAAUglB,EAAStlB,KAC3B,IAAG5b,EAAE,MAAOA,GAAED,KAAKmhC,EAAU19B,GAC7B,MAAMiE,GACN,IACEu5B,EAAkBJ,GAClB,QACA,KAAMn5B,OAKdqf,MAAO,QAASA,OAAMtjB,GACpB,GAAIo9B,GAAer9B,KAAK+jB,EACxB,IAAGwZ,EAAmBF,GAAc,KAAMp9B,EAC1C,IAAI09B,GAAWN,EAAaG,EAC5BH,GAAaG,GAAKzhC,CAClB,KACE,GAAIU,GAAIkc,EAAUglB,EAASpa,MAC3B,KAAI9mB,EAAE,KAAMwD,EACZA,GAAQxD,EAAED,KAAKmhC,EAAU19B,GACzB,MAAMiE,GACN,IACEk5B,EAAoBC,GACpB,QACA,KAAMn5B,IAGV,MADEk5B,GAAoBC,GACfp9B,GAET89B,SAAU,QAASA,UAAS99B,GAC1B,GAAIo9B,GAAer9B,KAAK+jB,EACxB,KAAIwZ,EAAmBF,GAAc,CACnC,GAAIM,GAAWN,EAAaG,EAC5BH,GAAaG,GAAKzhC,CAClB,KACE,GAAIU,GAAIkc,EAAUglB,EAASI,SAC3B99B,GAAQxD,EAAIA,EAAED,KAAKmhC,EAAU19B,GAASlE,EACtC,MAAMmI,GACN,IACEk5B,EAAoBC,GACpB,QACA,KAAMn5B,IAGV,MADEk5B,GAAoBC,GACfp9B,KAKb,IAAI+9B,GAAc,QAASC,YAAWL,GACpC3b,EAAWjiB,KAAMg+B,EAAa,aAAc,MAAM1U,GAAKviB,EAAU62B,GAGnE1U,GAAY8U,EAAYr3B,WACtBu3B,UAAW,QAASA,WAAUP,GAC5B,MAAO,IAAID,GAAaC,EAAU39B,KAAKspB,KAEzChd,QAAS,QAASA,SAAQxG,GACxB,GAAIkB,GAAOhH,IACX,OAAO,KAAKmE,EAAKohB,SAAW3oB,EAAO2oB,SAAS,SAAS5C,EAASQ,GAC5Dpc,EAAUjB,EACV,IAAIu3B,GAAer2B,EAAKk3B,WACtB7lB,KAAO,SAASpY,GACd,IACE,MAAO6F,GAAG7F,GACV,MAAMiE,GACNif,EAAOjf,GACPm5B,EAAaS,gBAGjBva,MAAOJ,EACP4a,SAAUpb,SAMlBuG,EAAY8U,GACVjjB,KAAM,QAASA,MAAKpO,GAClB,GAAIgD,GAAoB,kBAAT3P,MAAsBA,KAAOg+B,EACxCjiB,EAASpD,EAAU9a,EAAS8O,GAAGwwB,GACnC,IAAGphB,EAAO,CACR,GAAIoiB,GAAatgC,EAASke,EAAOvf,KAAKmQ,GACtC,OAAOwxB,GAAW5yB,cAAgBoE,EAAIwuB,EAAa,GAAIxuB,GAAE,SAASguB,GAChE,MAAOQ,GAAWD,UAAUP,KAGhC,MAAO,IAAIhuB,GAAE,SAASguB,GACpB,GAAIhmB,IAAO,CAeX,OAdAyK,GAAU,WACR,IAAIzK,EAAK,CACP,IACE,GAAGuK,EAAMvV,GAAG,EAAO,SAASxM,GAE1B,GADAw9B,EAAStlB,KAAKlY,GACXwX,EAAK,MAAO4O,OACVA,EAAO,OACd,MAAMriB,GACN,GAAGyT,EAAK,KAAMzT,EAEd,YADAy5B,GAASpa,MAAMrf,GAEfy5B,EAASI,cAGR,WAAYpmB,GAAO,MAG9BiE,GAAI,QAASA,MACX,IAAI,GAAIxa,GAAI,EAAGC,EAAIiB,UAAUhB,OAAQ88B,EAAQv0B,MAAMxI,GAAID,EAAIC,GAAG+8B,EAAMh9B,GAAKkB,UAAUlB,IACnF,OAAO,KAAqB,kBAATpB,MAAsBA,KAAOg+B,GAAa,SAASL,GACpE,GAAIhmB,IAAO,CASX,OARAyK,GAAU,WACR,IAAIzK,EAAK,CACP,IAAI,GAAIvW,GAAI,EAAGA,EAAIg9B,EAAM98B,SAAUF,EAEjC,GADAu8B,EAAStlB,KAAK+lB,EAAMh9B,IACjBuW,EAAK,MACRgmB,GAASI,cAGR,WAAYpmB,GAAO,QAKhCvT,EAAK45B,EAAYr3B,UAAWw2B,EAAY,WAAY,MAAOn9B,QAE3DjD,EAAQA,EAAQ6F,GAAIq7B,WAAYD,IAEhC/hC,EAAoB,KAAK,eAIpB,SAASI,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,GAC9BoiC,EAAUpiC,EAAoB,IAClCc,GAAQA,EAAQ6F,EAAI7F,EAAQiI,GAC1B6hB,aAAgBwX,EAAM57B,IACtBskB,eAAgBsX,EAAMtW,SAKnB,SAAS1rB,EAAQD,EAASH,GAY/B,IAAI,GAVAs6B,GAAgBt6B,EAAoB,KACpCe,EAAgBf,EAAoB,IACpCW,EAAgBX,EAAoB,GACpCmI,EAAgBnI,EAAoB,GACpC2b,EAAgB3b,EAAoB,KACpCsB,EAAgBtB,EAAoB,IACpC6b,EAAgBva,EAAI,YACpB+gC,EAAgB/gC,EAAI,eACpBghC,EAAgB3mB,EAAU/N,MAEtB20B,GAAe,WAAY,eAAgB,YAAa,iBAAkB,eAAgBp9B,EAAI,EAAGA,EAAI,EAAGA,IAAI,CAClH,GAGIhB,GAHA+N,EAAaqwB,EAAYp9B,GACzBq9B,EAAa7hC,EAAOuR,GACpBpB,EAAa0xB,GAAcA,EAAW93B,SAE1C,IAAGoG,EAAM,CACHA,EAAM+K,IAAU1T,EAAK2I,EAAO+K,EAAUymB,GACtCxxB,EAAMuxB,IAAel6B,EAAK2I,EAAOuxB,EAAenwB,GACpDyJ,EAAUzJ,GAAQowB,CAClB,KAAIn+B,IAAOm2B,GAAexpB,EAAM3M,IAAKpD,EAAS+P,EAAO3M,EAAKm2B,EAAWn2B,IAAM,MAM1E,SAAS/D,EAAQD,EAASH,GAG/B,GAAIW,GAAaX,EAAoB,GACjCc,EAAad,EAAoB,GACjCuR,EAAavR,EAAoB,IACjCyiC,EAAaziC,EAAoB,KACjC0iC,EAAa/hC,EAAO+hC,UACpBC,IAAeD,GAAa,WAAW3xB,KAAK2xB,EAAUE,WACtDt+B,EAAO,SAASkC,GAClB,MAAOm8B,GAAO,SAAS94B,EAAIg5B,GACzB,MAAOr8B,GAAI+K,EACTkxB,KACG51B,MAAMtM,KAAK8F,UAAW,GACZ,kBAANwD,GAAmBA,EAAK/B,SAAS+B,IACvCg5B,IACDr8B,EAEN1F,GAAQA,EAAQ6F,EAAI7F,EAAQiI,EAAIjI,EAAQ+F,EAAI87B,GAC1C9W,WAAavnB,EAAK3D,EAAOkrB,YACzBiX,YAAax+B,EAAK3D,EAAOmiC,gBAKtB,SAAS1iC,EAAQD,EAASH,GAG/B,GAAI+iC,GAAY/iC,EAAoB,KAChCuR,EAAYvR,EAAoB,IAChC8K,EAAY9K,EAAoB,GACpCI,GAAOD,QAAU,WAOf,IANA,GAAI0J,GAASiB,EAAU/G,MACnBsB,EAASgB,UAAUhB,OACnB29B,EAASp1B,MAAMvI,GACfF,EAAS,EACT+6B,EAAS6C,EAAK7C,EACd+C,GAAS,EACP59B,EAASF,IAAM69B,EAAM79B,GAAKkB,UAAUlB,QAAU+6B,IAAE+C,GAAS,EAC/D,OAAO,YACL,GAEkBz7B,GAFduD,EAAOhH,KACPyM,EAAOnK,UAAUhB,OACjBoL,EAAI,EAAGH,EAAI,CACf,KAAI2yB,IAAWzyB,EAAK,MAAOe,GAAO1H,EAAIm5B,EAAOj4B,EAE7C,IADAvD,EAAOw7B,EAAMn2B,QACVo2B,EAAO,KAAK59B,EAASoL,EAAGA,IAAOjJ,EAAKiJ,KAAOyvB,IAAE14B,EAAKiJ,GAAKpK,UAAUiK,KACpE,MAAME,EAAOF,GAAE9I,EAAKxB,KAAKK,UAAUiK,KACnC,OAAOiB,GAAO1H,EAAIrC,EAAMuD,MAMvB,SAAS3K,EAAQD,EAASH,GAE/BI,EAAOD,QAAUH,EAAoB,IAIhC,SAASI,EAAQD,EAASH,GAsF/B,QAASkjC,MAAKnZ,GACZ,GAAIoZ,GAAO59B,EAAO,KAQlB,OAPGwkB,IAAYjqB,IACVsjC,EAAWrZ,GACZ9D,EAAM8D,GAAU,EAAM,SAAS5lB,EAAKH,GAClCm/B,EAAKh/B,GAAOH,IAETiM,EAAOkzB,EAAMpZ,IAEfoZ,EAIT,QAASrhB,QAAOzY,EAAQ4V,EAAOmY,GAC7BtsB,EAAUmU,EACV,IAII8C,GAAM5d,EAJNoF,EAAS1H,EAAUwH,GACnBnE,EAASkH,EAAQ7C,GACjBlE,EAASH,EAAKG,OACdF,EAAS,CAEb,IAAGkB,UAAUhB,OAAS,EAAE,CACtB,IAAIA,EAAO,KAAMe,WAAU,+CAC3B2b,GAAOxY,EAAErE,EAAKC,UACT4c,GAAOve,OAAO4zB,EACrB,MAAM/xB,EAASF,GAAKvE,EAAI2I,EAAGpF,EAAMe,EAAKC,QACpC4c,EAAO9C,EAAM8C,EAAMxY,EAAEpF,GAAMA,EAAKkF,GAElC,OAAO0Y,GAGT,QAAS9G,UAAS5R,EAAQgD,GACxB,OAAQA,GAAMA,EAAK5K,EAAM4H,EAAQgD,GAAMg3B,EAAQh6B,EAAQ,SAASnF,GAC9D,MAAOA,IAAMA,OACPpE,EAGV,QAASgE,KAAIuF,EAAQlF,GACnB,GAAGvD,EAAIyI,EAAQlF,GAAK,MAAOkF,GAAOlF,GAEpC,QAASqC,KAAI6C,EAAQlF,EAAKH,GAGxB,MAFGnD,IAAesD,IAAOX,QAAOjB,EAAGD,EAAE+G,EAAQlF,EAAKpC,EAAW,EAAGiC,IAC3DqF,EAAOlF,GAAOH,EACZqF,EAGT,QAASi6B,QAAOp/B,GACd,MAAOuF,GAASvF,IAAOmL,EAAenL,KAAQg/B,KAAKx4B,UAjIrD,GAAItC,GAAiBpI,EAAoB,IACrCc,EAAiBd,EAAoB,GACrC+B,EAAiB/B,EAAoB,IACrCiQ,EAAiBjQ,EAAoB,IACrCuF,EAAiBvF,EAAoB,IACrCqP,EAAiBrP,EAAoB,IACrCoM,EAAiBpM,EAAoB,IACrCuC,EAAiBvC,EAAoB,GACrCyB,EAAiBzB,EAAoB,IACrC8K,EAAiB9K,EAAoB,IACrCimB,EAAiBjmB,EAAoB,KACrCojC,EAAiBpjC,EAAoB,KACrC4b,EAAiB5b,EAAoB,KACrCgf,EAAiBhf,EAAoB,KACrCyJ,EAAiBzJ,EAAoB,IACrC6B,EAAiB7B,EAAoB,IACrCa,EAAiBb,EAAoB,GACrCY,EAAiBZ,EAAoB,GAUrCujC,EAAmB,SAASlvB,GAC9B,GAAIuM,GAAmB,GAARvM,EACX0M,EAAmB,GAAR1M,CACf,OAAO,UAAShL,EAAQqX,EAAY3V,GAClC,GAII5G,GAAK2F,EAAKgM,EAJVxT,EAAS8F,EAAIsY,EAAY3V,EAAM,GAC/BxB,EAAS1H,EAAUwH,GACnBtD,EAAS6a,GAAkB,GAARvM,GAAqB,GAARA,EAC5B,IAAoB,kBAARtQ,MAAqBA,KAAOm/B,MAAQpjC,CAExD,KAAIqE,IAAOoF,GAAE,GAAG3I,EAAI2I,EAAGpF,KACrB2F,EAAMP,EAAEpF,GACR2R,EAAMxT,EAAEwH,EAAK3F,EAAKkF,GACfgL,GACD,GAAGuM,EAAO7a,EAAO5B,GAAO2R,MACnB,IAAGA,EAAI,OAAOzB,GACjB,IAAK,GAAGtO,EAAO5B,GAAO2F,CAAK,MAC3B,KAAK,GAAG,OAAO,CACf,KAAK,GAAG,MAAOA,EACf,KAAK,GAAG,MAAO3F,EACf,KAAK,GAAG4B,EAAO+P,EAAI,IAAMA,EAAI,OACxB,IAAGiL,EAAS,OAAO,CAG9B,OAAe,IAAR1M,GAAa0M,EAAWA,EAAWhb,IAG1Cs9B,EAAUE,EAAiB,GAE3BC,EAAiB,SAAS7mB,GAC5B,MAAO,UAASzY,GACd,MAAO,IAAIu/B,GAAav/B,EAAIyY,KAG5B8mB,EAAe,SAASnoB,EAAUqB,GACpC5Y,KAAKwX,GAAK1Z,EAAUyZ,GACpBvX,KAAKglB,GAAK3c,EAAQkP,GAClBvX,KAAKyX,GAAK,EACVzX,KAAKU,GAAKkY,EAEZf,GAAY6nB,EAAc,OAAQ,WAChC,GAIIt/B,GAJA4G,EAAOhH,KACPwF,EAAOwB,EAAKwQ,GACZrW,EAAO6F,EAAKge,GACZpM,EAAO5R,EAAKtG,EAEhB,GACE,IAAGsG,EAAKyQ,IAAMtW,EAAKG,OAEjB,MADA0F,GAAKwQ,GAAKzb,EACHkf,EAAK,UAEPpe,EAAI2I,EAAGpF,EAAMe,EAAK6F,EAAKyQ,OAChC,OAAW,QAARmB,EAAwBqC,EAAK,EAAG7a,GACxB,UAARwY,EAAwBqC,EAAK,EAAGzV,EAAEpF,IAC9B6a,EAAK,GAAI7a,EAAKoF,EAAEpF,OAczB++B,KAAKx4B,UAAY,KAsCjB5J,EAAQA,EAAQ6F,EAAI7F,EAAQ+F,GAAIq8B,KAAMA,OAEtCpiC,EAAQA,EAAQmG,EAAG,QACjB/B,KAAUs+B,EAAe,QACzB5mB,OAAU4mB,EAAe,UACzB3mB,QAAU2mB,EAAe,WACzBnzB,QAAUkzB,EAAiB,GAC3BjiB,IAAUiiB,EAAiB,GAC3B/hB,OAAU+hB,EAAiB,GAC3B7hB,KAAU6hB,EAAiB,GAC3B3hB,MAAU2hB,EAAiB,GAC3BzgB,KAAUygB,EAAiB,GAC3BF,QAAUA,EACVK,SAAUH,EAAiB,GAC3BzhB,OAAUA,OACVrgB,MAAUA,EACVwZ,SAAUA,SACVra,IAAUA,EACVkD,IAAUA,IACV0C,IAAUA,IACV88B,OAAUA,UAKP,SAASljC,EAAQD,EAASH,GAE/B,GAAIkR,GAAYlR,EAAoB,IAChC6b,EAAY7b,EAAoB,IAAI,YACpC2b,EAAY3b,EAAoB,IACpCI,GAAOD,QAAUH,EAAoB,GAAGojC,WAAa,SAASl/B,GAC5D,GAAIqF,GAAI/F,OAAOU,EACf,OAAOqF,GAAEsS,KAAc/b,GAClB,cAAgByJ,IAChBoS,EAAU5T,eAAemJ,EAAQ3H,MAKnC,SAASnJ,EAAQD,EAASH,GAE/B,GAAI4B,GAAW5B,EAAoB,IAC/B8D,EAAW9D,EAAoB,IACnCI,GAAOD,QAAUH,EAAoB,GAAG2jC,YAAc,SAASz/B,GAC7D,GAAIib,GAASrb,EAAII,EACjB,IAAoB,kBAAVib,GAAqB,KAAM/Y,WAAUlC,EAAK,oBACpD,OAAOtC,GAASud,EAAO5e,KAAK2D,MAKzB,SAAS9D,EAAQD,EAASH,GAE/B,GAAIW,GAAUX,EAAoB,GAC9BkI,EAAUlI,EAAoB,GAC9Bc,EAAUd,EAAoB,GAC9ByiC,EAAUziC,EAAoB,IAElCc,GAAQA,EAAQ6F,EAAI7F,EAAQ+F,GAC1B+8B,MAAO,QAASA,OAAMf,GACpB,MAAO,KAAK36B,EAAKohB,SAAW3oB,EAAO2oB,SAAS,SAAS5C,GACnDmF,WAAW4W,EAAQliC,KAAKmmB,GAAS,GAAOmc,SAOzC,SAASziC,EAAQD,EAASH,GAE/B,GAAI+iC,GAAU/iC,EAAoB,KAC9Bc,EAAUd,EAAoB,EAGlCA,GAAoB,GAAGkgC,EAAI6C,EAAK7C,EAAI6C,EAAK7C,MAEzCp/B,EAAQA,EAAQmE,EAAInE,EAAQ+F,EAAG,YAAag9B,KAAM7jC,EAAoB,QAIjE,SAASI,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAG,UAAW4C,SAAUzJ,EAAoB,OAInE,SAASI,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,EAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAG,UAAWqK,QAASlR,EAAoB,OAIlE,SAASI,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,GAC9B+jB,EAAU/jB,EAAoB,IAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAG,UAAWkd,OAAQA,KAI7C,SAAS3jB,EAAQD,EAASH,GAE/B,GAAIuC,GAAYvC,EAAoB,GAChCqC,EAAYrC,EAAoB,IAChC4wB,EAAY5wB,EAAoB,KAChC6B,EAAY7B,EAAoB,GAEpCI,GAAOD,QAAU,QAAS4jB,QAAO/a,EAAQ86B,GAIvC,IAHA,GAEW3/B,GAFPe,EAAS0rB,EAAQ/uB,EAAUiiC,IAC3Bz+B,EAASH,EAAKG,OACdF,EAAI,EACFE,EAASF,GAAE5C,EAAGD,EAAE0G,EAAQ7E,EAAMe,EAAKC,KAAM9C,EAAKC,EAAEwhC,EAAO3/B,GAC7D,OAAO6E,KAKJ,SAAS5I,EAAQD,EAASH,GAE/B,GAAIc,GAAUd,EAAoB,GAC9B+jB,EAAU/jB,EAAoB,KAC9BuF,EAAUvF,EAAoB,GAElCc,GAAQA,EAAQmG,EAAInG,EAAQ+F,EAAG,UAC7Bk9B,KAAM,SAASjzB,EAAOgzB,GACpB,MAAO/f,GAAOxe,EAAOuL,GAAQgzB,OAM5B,SAAS1jC,EAAQD,EAASH,GAG/BA,EAAoB,KAAKyT,OAAQ,SAAU,SAAS6H,GAClDvX,KAAKypB,IAAMlS,EACXvX,KAAKyX,GAAK,GACT,WACD,GAAIrW,GAAOpB,KAAKyX,KACZE,IAASvW,EAAIpB,KAAKypB,GACtB,QAAQ9R,KAAMA,EAAM1X,MAAO0X,EAAO5b,EAAYqF,MAK3C,SAAS/E,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BgkC,EAAUhkC,EAAoB,KAAK,sBAAuB,OAE9Dc,GAAQA,EAAQmG,EAAG,UAAWg9B,OAAQ,QAASA,QAAO//B,GAAK,MAAO8/B,GAAI9/B,OAKjE,SAAS9D,EAAQD,GAEtBC,EAAOD,QAAU,SAAS+jC,EAAQ5vB,GAChC,GAAIhN,GAAWgN,IAAY9Q,OAAO8Q,GAAW,SAASuvB,GACpD,MAAOvvB,GAAQuvB,IACbvvB,CACJ,OAAO,UAASpQ,GACd,MAAOuG,QAAOvG,GAAIoQ,QAAQ4vB,EAAQ58B,MAMjC,SAASlH,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BgkC,EAAMhkC,EAAoB,KAAK,YACjCmkC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,UAGPzjC,GAAQA,EAAQmE,EAAInE,EAAQ+F,EAAG,UAAW29B,WAAY,QAASA,cAAc,MAAOR,GAAIjgC,UAInF,SAAS3D,EAAQD,EAASH,GAG/B,GAAIc,GAAUd,EAAoB,GAC9BgkC,EAAMhkC,EAAoB,KAAK,8BACjCykC,QAAU,IACVC,OAAU,IACVC,OAAU,IACVC,SAAU,IACVC,SAAU,KAGZ/jC,GAAQA,EAAQmE,EAAInE,EAAQ+F,EAAG,UAAWi+B,aAAe,QAASA,gBAAgB,MAAOd,GAAIjgC,YAK1E,mBAAV3D,SAAyBA,OAAOD,QAAQC,OAAOD,QAAUP,EAE1C,kBAAVmkB,SAAwBA,OAAOghB,IAAIhhB,OAAO,WAAW,MAAOnkB,KAEtEC,EAAIqI,KAAOtI,GACd,EAAG","file":"core.min.js"} \ No newline at end of file diff --git a/node_modules/core-js/client/library.js b/node_modules/core-js/client/library.js new file mode 100755 index 00000000..b332abde --- /dev/null +++ b/node_modules/core-js/client/library.js @@ -0,0 +1,7136 @@ +/** + * core-js 2.4.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(1); + __webpack_require__(50); + __webpack_require__(51); + __webpack_require__(52); + __webpack_require__(54); + __webpack_require__(55); + __webpack_require__(58); + __webpack_require__(59); + __webpack_require__(60); + __webpack_require__(61); + __webpack_require__(62); + __webpack_require__(63); + __webpack_require__(64); + __webpack_require__(65); + __webpack_require__(66); + __webpack_require__(68); + __webpack_require__(70); + __webpack_require__(72); + __webpack_require__(75); + __webpack_require__(76); + __webpack_require__(79); + __webpack_require__(80); + __webpack_require__(81); + __webpack_require__(82); + __webpack_require__(84); + __webpack_require__(85); + __webpack_require__(86); + __webpack_require__(87); + __webpack_require__(88); + __webpack_require__(92); + __webpack_require__(94); + __webpack_require__(95); + __webpack_require__(96); + __webpack_require__(98); + __webpack_require__(99); + __webpack_require__(100); + __webpack_require__(102); + __webpack_require__(103); + __webpack_require__(104); + __webpack_require__(106); + __webpack_require__(107); + __webpack_require__(108); + __webpack_require__(109); + __webpack_require__(110); + __webpack_require__(111); + __webpack_require__(112); + __webpack_require__(113); + __webpack_require__(114); + __webpack_require__(115); + __webpack_require__(116); + __webpack_require__(117); + __webpack_require__(118); + __webpack_require__(119); + __webpack_require__(121); + __webpack_require__(125); + __webpack_require__(126); + __webpack_require__(127); + __webpack_require__(128); + __webpack_require__(132); + __webpack_require__(134); + __webpack_require__(135); + __webpack_require__(136); + __webpack_require__(137); + __webpack_require__(138); + __webpack_require__(139); + __webpack_require__(140); + __webpack_require__(141); + __webpack_require__(142); + __webpack_require__(143); + __webpack_require__(144); + __webpack_require__(145); + __webpack_require__(146); + __webpack_require__(147); + __webpack_require__(154); + __webpack_require__(155); + __webpack_require__(157); + __webpack_require__(158); + __webpack_require__(159); + __webpack_require__(163); + __webpack_require__(164); + __webpack_require__(165); + __webpack_require__(166); + __webpack_require__(167); + __webpack_require__(169); + __webpack_require__(170); + __webpack_require__(171); + __webpack_require__(172); + __webpack_require__(175); + __webpack_require__(177); + __webpack_require__(178); + __webpack_require__(179); + __webpack_require__(181); + __webpack_require__(183); + __webpack_require__(190); + __webpack_require__(193); + __webpack_require__(194); + __webpack_require__(196); + __webpack_require__(197); + __webpack_require__(198); + __webpack_require__(199); + __webpack_require__(200); + __webpack_require__(201); + __webpack_require__(202); + __webpack_require__(203); + __webpack_require__(204); + __webpack_require__(205); + __webpack_require__(206); + __webpack_require__(207); + __webpack_require__(209); + __webpack_require__(210); + __webpack_require__(211); + __webpack_require__(212); + __webpack_require__(213); + __webpack_require__(214); + __webpack_require__(215); + __webpack_require__(218); + __webpack_require__(219); + __webpack_require__(221); + __webpack_require__(222); + __webpack_require__(223); + __webpack_require__(224); + __webpack_require__(225); + __webpack_require__(226); + __webpack_require__(227); + __webpack_require__(228); + __webpack_require__(229); + __webpack_require__(230); + __webpack_require__(231); + __webpack_require__(233); + __webpack_require__(234); + __webpack_require__(235); + __webpack_require__(236); + __webpack_require__(238); + __webpack_require__(239); + __webpack_require__(240); + __webpack_require__(241); + __webpack_require__(243); + __webpack_require__(244); + __webpack_require__(246); + __webpack_require__(247); + __webpack_require__(248); + __webpack_require__(249); + __webpack_require__(252); + __webpack_require__(253); + __webpack_require__(254); + __webpack_require__(255); + __webpack_require__(256); + __webpack_require__(257); + __webpack_require__(258); + __webpack_require__(259); + __webpack_require__(261); + __webpack_require__(262); + __webpack_require__(263); + __webpack_require__(264); + __webpack_require__(265); + __webpack_require__(266); + __webpack_require__(267); + __webpack_require__(268); + __webpack_require__(269); + __webpack_require__(270); + __webpack_require__(271); + __webpack_require__(272); + __webpack_require__(273); + __webpack_require__(276); + __webpack_require__(151); + __webpack_require__(278); + __webpack_require__(277); + __webpack_require__(279); + __webpack_require__(280); + __webpack_require__(281); + __webpack_require__(282); + __webpack_require__(283); + __webpack_require__(285); + __webpack_require__(286); + __webpack_require__(287); + __webpack_require__(289); + module.exports = __webpack_require__(290); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // ECMAScript 6 symbols shim + var global = __webpack_require__(2) + , has = __webpack_require__(3) + , DESCRIPTORS = __webpack_require__(4) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(18) + , META = __webpack_require__(19).KEY + , $fails = __webpack_require__(5) + , shared = __webpack_require__(21) + , setToStringTag = __webpack_require__(22) + , uid = __webpack_require__(20) + , wks = __webpack_require__(23) + , wksExt = __webpack_require__(24) + , wksDefine = __webpack_require__(25) + , keyOf = __webpack_require__(27) + , enumKeys = __webpack_require__(40) + , isArray = __webpack_require__(43) + , anObject = __webpack_require__(12) + , toIObject = __webpack_require__(30) + , toPrimitive = __webpack_require__(16) + , createDesc = __webpack_require__(17) + , _create = __webpack_require__(44) + , gOPNExt = __webpack_require__(47) + , $GOPD = __webpack_require__(49) + , $DP = __webpack_require__(11) + , $keys = __webpack_require__(28) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; + }) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); + } : dP; + + var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; + }; + + var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; + } : function(it){ + return it instanceof $Symbol; + }; + + var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); + }; + var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; + }; + + // 19.4.1.1 Symbol([description]) + if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(48).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(42).f = $propertyIsEnumerable; + __webpack_require__(41).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !__webpack_require__(26)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + + for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' + ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + + for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + + $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } + }); + + $export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; + })), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } + }); + + // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); + // 19.4.3.5 Symbol.prototype[@@toStringTag] + setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + setToStringTag(global.JSON, 'JSON', true); + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); + if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef + +/***/ }, +/* 3 */ +/***/ function(module, exports) { + + var hasOwnProperty = {}.hasOwnProperty; + module.exports = function(it, key){ + return hasOwnProperty.call(it, key); + }; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + // Thank's IE8 for his funny defineProperty + module.exports = !__webpack_require__(5)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; + }); + +/***/ }, +/* 5 */ +/***/ function(module, exports) { + + module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } + }; + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , ctx = __webpack_require__(8) + , hide = __webpack_require__(10) + , PROTOTYPE = 'prototype'; + + var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + } + } + }; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + module.exports = $export; + +/***/ }, +/* 7 */ +/***/ function(module, exports) { + + var core = module.exports = {version: '2.4.0'}; + if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + // optional / simple context binding + var aFunction = __webpack_require__(9); + module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; + }; + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; + }; + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(11) + , createDesc = __webpack_require__(17); + module.exports = __webpack_require__(4) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); + } : function(object, key, value){ + object[key] = value; + return object; + }; + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + var anObject = __webpack_require__(12) + , IE8_DOM_DEFINE = __webpack_require__(14) + , toPrimitive = __webpack_require__(16) + , dP = Object.defineProperty; + + exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; + }; + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(13); + module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; + }; + +/***/ }, +/* 13 */ +/***/ function(module, exports) { + + module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = !__webpack_require__(4) && !__webpack_require__(5)(function(){ + return Object.defineProperty(__webpack_require__(15)('div'), 'a', {get: function(){ return 7; }}).a != 7; + }); + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(13) + , document = __webpack_require__(2).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); + module.exports = function(it){ + return is ? document.createElement(it) : {}; + }; + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.1 ToPrimitive(input [, PreferredType]) + var isObject = __webpack_require__(13); + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); + }; + +/***/ }, +/* 17 */ +/***/ function(module, exports) { + + module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; + }; + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(10); + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + var META = __webpack_require__(20)('meta') + , isObject = __webpack_require__(13) + , has = __webpack_require__(3) + , setDesc = __webpack_require__(11).f + , id = 0; + var isExtensible = Object.isExtensible || function(){ + return true; + }; + var FREEZE = !__webpack_require__(5)(function(){ + return isExtensible(Object.preventExtensions({})); + }); + var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); + }; + var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; + }; + var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; + }; + // add metadata on freeze-family methods calling + var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; + }; + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + }; + +/***/ }, +/* 20 */ +/***/ function(module, exports) { + + var id = 0 + , px = Math.random(); + module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); + module.exports = function(key){ + return store[key] || (store[key] = {}); + }; + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + var def = __webpack_require__(11).f + , has = __webpack_require__(3) + , TAG = __webpack_require__(23)('toStringTag'); + + module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); + }; + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + var store = __webpack_require__(21)('wks') + , uid = __webpack_require__(20) + , Symbol = __webpack_require__(2).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + + var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); + }; + + $exports.store = store; + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + exports.f = __webpack_require__(23); + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , LIBRARY = __webpack_require__(26) + , wksExt = __webpack_require__(24) + , defineProperty = __webpack_require__(11).f; + module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); + }; + +/***/ }, +/* 26 */ +/***/ function(module, exports) { + + module.exports = true; + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + var getKeys = __webpack_require__(28) + , toIObject = __webpack_require__(30); + module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; + }; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + var $keys = __webpack_require__(29) + , enumBugKeys = __webpack_require__(39); + + module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); + }; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + var has = __webpack_require__(3) + , toIObject = __webpack_require__(30) + , arrayIndexOf = __webpack_require__(34)(false) + , IE_PROTO = __webpack_require__(38)('IE_PROTO'); + + module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + // to indexed object, toObject with fallback for non-array-like ES3 strings + var IObject = __webpack_require__(31) + , defined = __webpack_require__(33); + module.exports = function(it){ + return IObject(defined(it)); + }; + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for non-array-like ES3 and non-enumerable old V8 strings + var cof = __webpack_require__(32); + module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); + }; + +/***/ }, +/* 32 */ +/***/ function(module, exports) { + + var toString = {}.toString; + + module.exports = function(it){ + return toString.call(it).slice(8, -1); + }; + +/***/ }, +/* 33 */ +/***/ function(module, exports) { + + // 7.2.1 RequireObjectCoercible(argument) + module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; + }; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + // false -> Array#indexOf + // true -> Array#includes + var toIObject = __webpack_require__(30) + , toLength = __webpack_require__(35) + , toIndex = __webpack_require__(37); + module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.15 ToLength + var toInteger = __webpack_require__(36) + , min = Math.min; + module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + +/***/ }, +/* 36 */ +/***/ function(module, exports) { + + // 7.1.4 ToInteger + var ceil = Math.ceil + , floor = Math.floor; + module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(36) + , max = Math.max + , min = Math.min; + module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); + }; + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + var shared = __webpack_require__(21)('keys') + , uid = __webpack_require__(20); + module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); + }; + +/***/ }, +/* 39 */ +/***/ function(module, exports) { + + // IE 8- don't enum bug keys + module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' + ).split(','); + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + // all enumerable object keys, includes symbols + var getKeys = __webpack_require__(28) + , gOPS = __webpack_require__(41) + , pIE = __webpack_require__(42); + module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; + }; + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + exports.f = Object.getOwnPropertySymbols; + +/***/ }, +/* 42 */ +/***/ function(module, exports) { + + exports.f = {}.propertyIsEnumerable; + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.2 IsArray(argument) + var cof = __webpack_require__(32); + module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; + }; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + var anObject = __webpack_require__(12) + , dPs = __webpack_require__(45) + , enumBugKeys = __webpack_require__(39) + , IE_PROTO = __webpack_require__(38)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(15)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(46).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); + }; + + module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); + }; + + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(11) + , anObject = __webpack_require__(12) + , getKeys = __webpack_require__(28); + + module.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; + }; + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(2).document && document.documentElement; + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + var toIObject = __webpack_require__(30) + , gOPN = __webpack_require__(48).f + , toString = {}.toString; + + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } + }; + + module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); + }; + + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + var $keys = __webpack_require__(29) + , hiddenKeys = __webpack_require__(39).concat('length', 'prototype'); + + exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); + }; + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + var pIE = __webpack_require__(42) + , createDesc = __webpack_require__(17) + , toIObject = __webpack_require__(30) + , toPrimitive = __webpack_require__(16) + , has = __webpack_require__(3) + , IE8_DOM_DEFINE = __webpack_require__(14) + , gOPD = Object.getOwnPropertyDescriptor; + + exports.f = __webpack_require__(4) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); + }; + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + $export($export.S + $export.F * !__webpack_require__(4), 'Object', {defineProperty: __webpack_require__(11).f}); + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) + $export($export.S + $export.F * !__webpack_require__(4), 'Object', {defineProperties: __webpack_require__(45)}); + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + var toIObject = __webpack_require__(30) + , $getOwnPropertyDescriptor = __webpack_require__(49).f; + + __webpack_require__(53)('getOwnPropertyDescriptor', function(){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; + }); + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + // most Object methods by ES6 should accept primitives + var $export = __webpack_require__(6) + , core = __webpack_require__(7) + , fails = __webpack_require__(5); + module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); + }; + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + $export($export.S, 'Object', {create: __webpack_require__(44)}); + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 Object.getPrototypeOf(O) + var toObject = __webpack_require__(56) + , $getPrototypeOf = __webpack_require__(57); + + __webpack_require__(53)('getPrototypeOf', function(){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; + }); + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.13 ToObject(argument) + var defined = __webpack_require__(33); + module.exports = function(it){ + return Object(defined(it)); + }; + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + var has = __webpack_require__(3) + , toObject = __webpack_require__(56) + , IE_PROTO = __webpack_require__(38)('IE_PROTO') + , ObjectProto = Object.prototype; + + module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }; + +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.14 Object.keys(O) + var toObject = __webpack_require__(56) + , $keys = __webpack_require__(28); + + __webpack_require__(53)('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; + }); + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 Object.getOwnPropertyNames(O) + __webpack_require__(53)('getOwnPropertyNames', function(){ + return __webpack_require__(47).f; + }); + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.5 Object.freeze(O) + var isObject = __webpack_require__(13) + , meta = __webpack_require__(19).onFreeze; + + __webpack_require__(53)('freeze', function($freeze){ + return function freeze(it){ + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; + }); + +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.17 Object.seal(O) + var isObject = __webpack_require__(13) + , meta = __webpack_require__(19).onFreeze; + + __webpack_require__(53)('seal', function($seal){ + return function seal(it){ + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; + }); + +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.15 Object.preventExtensions(O) + var isObject = __webpack_require__(13) + , meta = __webpack_require__(19).onFreeze; + + __webpack_require__(53)('preventExtensions', function($preventExtensions){ + return function preventExtensions(it){ + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; + }); + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.12 Object.isFrozen(O) + var isObject = __webpack_require__(13); + + __webpack_require__(53)('isFrozen', function($isFrozen){ + return function isFrozen(it){ + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; + }); + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.13 Object.isSealed(O) + var isObject = __webpack_require__(13); + + __webpack_require__(53)('isSealed', function($isSealed){ + return function isSealed(it){ + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; + }); + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.11 Object.isExtensible(O) + var isObject = __webpack_require__(13); + + __webpack_require__(53)('isExtensible', function($isExtensible){ + return function isExtensible(it){ + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; + }); + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.1 Object.assign(target, source) + var $export = __webpack_require__(6); + + $export($export.S + $export.F, 'Object', {assign: __webpack_require__(67)}); + +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 19.1.2.1 Object.assign(target, source, ...) + var getKeys = __webpack_require__(28) + , gOPS = __webpack_require__(41) + , pIE = __webpack_require__(42) + , toObject = __webpack_require__(56) + , IObject = __webpack_require__(31) + , $assign = Object.assign; + + // should work with symbols and should have deterministic property order (V8 bug) + module.exports = !$assign || __webpack_require__(5)(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; + }) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; + } : $assign; + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.10 Object.is(value1, value2) + var $export = __webpack_require__(6); + $export($export.S, 'Object', {is: __webpack_require__(69)}); + +/***/ }, +/* 69 */ +/***/ function(module, exports) { + + // 7.2.9 SameValue(x, y) + module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; + }; + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + var $export = __webpack_require__(6); + $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(71).set}); + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + var isObject = __webpack_require__(13) + , anObject = __webpack_require__(12); + var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); + }; + module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = __webpack_require__(8)(Function.call, __webpack_require__(49).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) + var $export = __webpack_require__(6); + + $export($export.P, 'Function', {bind: __webpack_require__(73)}); + +/***/ }, +/* 73 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var aFunction = __webpack_require__(9) + , isObject = __webpack_require__(13) + , invoke = __webpack_require__(74) + , arraySlice = [].slice + , factories = {}; + + var construct = function(F, len, args){ + if(!(len in factories)){ + for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); + }; + + module.exports = Function.bind || function bind(that /*, args... */){ + var fn = aFunction(this) + , partArgs = arraySlice.call(arguments, 1); + var bound = function(/* args... */){ + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if(isObject(fn.prototype))bound.prototype = fn.prototype; + return bound; + }; + +/***/ }, +/* 74 */ +/***/ function(module, exports) { + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var isObject = __webpack_require__(13) + , getPrototypeOf = __webpack_require__(57) + , HAS_INSTANCE = __webpack_require__(23)('hasInstance') + , FunctionProto = Function.prototype; + // 19.2.3.6 Function.prototype[@@hasInstance](V) + if(!(HAS_INSTANCE in FunctionProto))__webpack_require__(11).f(FunctionProto, HAS_INSTANCE, {value: function(O){ + if(typeof this != 'function' || !isObject(O))return false; + if(!isObject(this.prototype))return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while(O = getPrototypeOf(O))if(this.prototype === O)return true; + return false; + }}); + +/***/ }, +/* 76 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toInteger = __webpack_require__(36) + , aNumberValue = __webpack_require__(77) + , repeat = __webpack_require__(78) + , $toFixed = 1..toFixed + , floor = Math.floor + , data = [0, 0, 0, 0, 0, 0] + , ERROR = 'Number.toFixed: incorrect invocation!' + , ZERO = '0'; + + var multiply = function(n, c){ + var i = -1 + , c2 = c; + while(++i < 6){ + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } + }; + var divide = function(n){ + var i = 6 + , c = 0; + while(--i >= 0){ + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } + }; + var numToString = function(){ + var i = 6 + , s = ''; + while(--i >= 0){ + if(s !== '' || i === 0 || data[i] !== 0){ + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; + }; + var pow = function(x, n, acc){ + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); + }; + var log = function(x){ + var n = 0 + , x2 = x; + while(x2 >= 4096){ + n += 12; + x2 /= 4096; + } + while(x2 >= 2){ + n += 1; + x2 /= 2; + } return n; + }; + + $export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128..toFixed(0) !== '1000000000000000128' + ) || !__webpack_require__(5)(function(){ + // V8 ~ Android 4.3- + $toFixed.call({}); + })), 'Number', { + toFixed: function toFixed(fractionDigits){ + var x = aNumberValue(this, ERROR) + , f = toInteger(fractionDigits) + , s = '' + , m = ZERO + , e, z, j, k; + if(f < 0 || f > 20)throw RangeError(ERROR); + if(x != x)return 'NaN'; + if(x <= -1e21 || x >= 1e21)return String(x); + if(x < 0){ + s = '-'; + x = -x; + } + if(x > 1e-21){ + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if(e > 0){ + multiply(0, z); + j = f; + while(j >= 7){ + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while(j >= 23){ + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if(f > 0){ + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } + }); + +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { + + var cof = __webpack_require__(32); + module.exports = function(it, msg){ + if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); + return +it; + }; + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var toInteger = __webpack_require__(36) + , defined = __webpack_require__(33); + + module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; + }; + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $fails = __webpack_require__(5) + , aNumberValue = __webpack_require__(77) + , $toPrecision = 1..toPrecision; + + $export($export.P + $export.F * ($fails(function(){ + // IE7- + return $toPrecision.call(1, undefined) !== '1'; + }) || !$fails(function(){ + // V8 ~ Android 4.3- + $toPrecision.call({}); + })), 'Number', { + toPrecision: function toPrecision(precision){ + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } + }); + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.1 Number.EPSILON + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.2 Number.isFinite(number) + var $export = __webpack_require__(6) + , _isFinite = __webpack_require__(2).isFinite; + + $export($export.S, 'Number', { + isFinite: function isFinite(it){ + return typeof it == 'number' && _isFinite(it); + } + }); + +/***/ }, +/* 82 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {isInteger: __webpack_require__(83)}); + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var isObject = __webpack_require__(13) + , floor = Math.floor; + module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; + }; + +/***/ }, +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.4 Number.isNaN(number) + var $export = __webpack_require__(6); + + $export($export.S, 'Number', { + isNaN: function isNaN(number){ + return number != number; + } + }); + +/***/ }, +/* 85 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.5 Number.isSafeInteger(number) + var $export = __webpack_require__(6) + , isInteger = __webpack_require__(83) + , abs = Math.abs; + + $export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number){ + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } + }); + +/***/ }, +/* 86 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.6 Number.MAX_SAFE_INTEGER + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); + +/***/ }, +/* 87 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.10 Number.MIN_SAFE_INTEGER + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); + +/***/ }, +/* 88 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseFloat = __webpack_require__(89); + // 20.1.2.12 Number.parseFloat(string) + $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); + +/***/ }, +/* 89 */ +/***/ function(module, exports, __webpack_require__) { + + var $parseFloat = __webpack_require__(2).parseFloat + , $trim = __webpack_require__(90).trim; + + module.exports = 1 / $parseFloat(__webpack_require__(91) + '-0') !== -Infinity ? function parseFloat(str){ + var string = $trim(String(str), 3) + , result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; + } : $parseFloat; + +/***/ }, +/* 90 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , defined = __webpack_require__(33) + , fails = __webpack_require__(5) + , spaces = __webpack_require__(91) + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + + var exporter = function(KEY, exec, ALIAS){ + var exp = {}; + var FORCE = fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if(ALIAS)exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); + }; + + // 1 -> String#trimLeft + // 2 -> String#trimRight + // 3 -> String#trim + var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; + }; + + module.exports = exporter; + +/***/ }, +/* 91 */ +/***/ function(module, exports) { + + module.exports = '\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'; + +/***/ }, +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseInt = __webpack_require__(93); + // 20.1.2.13 Number.parseInt(string, radix) + $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); + +/***/ }, +/* 93 */ +/***/ function(module, exports, __webpack_require__) { + + var $parseInt = __webpack_require__(2).parseInt + , $trim = __webpack_require__(90).trim + , ws = __webpack_require__(91) + , hex = /^[\-+]?0[xX]/; + + module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){ + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); + } : $parseInt; + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseInt = __webpack_require__(93); + // 18.2.5 parseInt(string, radix) + $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); + +/***/ }, +/* 95 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseFloat = __webpack_require__(89); + // 18.2.4 parseFloat(string) + $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); + +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.3 Math.acosh(x) + var $export = __webpack_require__(6) + , log1p = __webpack_require__(97) + , sqrt = Math.sqrt + , $acosh = Math.acosh; + + $export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity + ), 'Math', { + acosh: function acosh(x){ + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } + }); + +/***/ }, +/* 97 */ +/***/ function(module, exports) { + + // 20.2.2.20 Math.log1p(x) + module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); + }; + +/***/ }, +/* 98 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.5 Math.asinh(x) + var $export = __webpack_require__(6) + , $asinh = Math.asinh; + + function asinh(x){ + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); + } + + // Tor Browser bug: Math.asinh(0) -> -0 + $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); + +/***/ }, +/* 99 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.7 Math.atanh(x) + var $export = __webpack_require__(6) + , $atanh = Math.atanh; + + // Tor Browser bug: Math.atanh(-0) -> 0 + $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x){ + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } + }); + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.9 Math.cbrt(x) + var $export = __webpack_require__(6) + , sign = __webpack_require__(101); + + $export($export.S, 'Math', { + cbrt: function cbrt(x){ + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } + }); + +/***/ }, +/* 101 */ +/***/ function(module, exports) { + + // 20.2.2.28 Math.sign(x) + module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; + }; + +/***/ }, +/* 102 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.11 Math.clz32(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + clz32: function clz32(x){ + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } + }); + +/***/ }, +/* 103 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.12 Math.cosh(x) + var $export = __webpack_require__(6) + , exp = Math.exp; + + $export($export.S, 'Math', { + cosh: function cosh(x){ + return (exp(x = +x) + exp(-x)) / 2; + } + }); + +/***/ }, +/* 104 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.14 Math.expm1(x) + var $export = __webpack_require__(6) + , $expm1 = __webpack_require__(105); + + $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); + +/***/ }, +/* 105 */ +/***/ function(module, exports) { + + // 20.2.2.14 Math.expm1(x) + var $expm1 = Math.expm1; + module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 + ) ? function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; + } : $expm1; + +/***/ }, +/* 106 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.16 Math.fround(x) + var $export = __webpack_require__(6) + , sign = __webpack_require__(101) + , pow = Math.pow + , EPSILON = pow(2, -52) + , EPSILON32 = pow(2, -23) + , MAX32 = pow(2, 127) * (2 - EPSILON32) + , MIN32 = pow(2, -126); + + var roundTiesToEven = function(n){ + return n + 1 / EPSILON - 1 / EPSILON; + }; + + + $export($export.S, 'Math', { + fround: function fround(x){ + var $abs = Math.abs(x) + , $sign = sign(x) + , a, result; + if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + if(result > MAX32 || result != result)return $sign * Infinity; + return $sign * result; + } + }); + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) + var $export = __webpack_require__(6) + , abs = Math.abs; + + $export($export.S, 'Math', { + hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars + var sum = 0 + , i = 0 + , aLen = arguments.length + , larg = 0 + , arg, div; + while(i < aLen){ + arg = abs(arguments[i++]); + if(larg < arg){ + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if(arg > 0){ + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } + }); + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.18 Math.imul(x, y) + var $export = __webpack_require__(6) + , $imul = Math.imul; + + // some WebKit versions fails with big numbers, some has wrong arity + $export($export.S + $export.F * __webpack_require__(5)(function(){ + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; + }), 'Math', { + imul: function imul(x, y){ + var UINT16 = 0xffff + , xn = +x + , yn = +y + , xl = UINT16 & xn + , yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } + }); + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.21 Math.log10(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + log10: function log10(x){ + return Math.log(x) / Math.LN10; + } + }); + +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.20 Math.log1p(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', {log1p: __webpack_require__(97)}); + +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.22 Math.log2(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + log2: function log2(x){ + return Math.log(x) / Math.LN2; + } + }); + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.28 Math.sign(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', {sign: __webpack_require__(101)}); + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.30 Math.sinh(x) + var $export = __webpack_require__(6) + , expm1 = __webpack_require__(105) + , exp = Math.exp; + + // V8 near Chromium 38 has a problem with very small numbers + $export($export.S + $export.F * __webpack_require__(5)(function(){ + return !Math.sinh(-2e-17) != -2e-17; + }), 'Math', { + sinh: function sinh(x){ + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } + }); + +/***/ }, +/* 114 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.33 Math.tanh(x) + var $export = __webpack_require__(6) + , expm1 = __webpack_require__(105) + , exp = Math.exp; + + $export($export.S, 'Math', { + tanh: function tanh(x){ + var a = expm1(x = +x) + , b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } + }); + +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.34 Math.trunc(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + trunc: function trunc(it){ + return (it > 0 ? Math.floor : Math.ceil)(it); + } + }); + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , toIndex = __webpack_require__(37) + , fromCharCode = String.fromCharCode + , $fromCodePoint = String.fromCodePoint; + + // length should be 1, old FF problem + $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars + var res = [] + , aLen = arguments.length + , i = 0 + , code; + while(aLen > i){ + code = +arguments[i++]; + if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } + }); + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , toLength = __webpack_require__(35); + + $export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite){ + var tpl = toIObject(callSite.raw) + , len = toLength(tpl.length) + , aLen = arguments.length + , res = [] + , i = 0; + while(len > i){ + res.push(String(tpl[i++])); + if(i < aLen)res.push(String(arguments[i])); + } return res.join(''); + } + }); + +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.1.3.25 String.prototype.trim() + __webpack_require__(90)('trim', function($trim){ + return function trim(){ + return $trim(this, 3); + }; + }); + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $at = __webpack_require__(120)(false); + $export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 120 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(36) + , defined = __webpack_require__(33); + // true -> String#at + // false -> String#codePointAt + module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + +/***/ }, +/* 121 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + 'use strict'; + var $export = __webpack_require__(6) + , toLength = __webpack_require__(35) + , context = __webpack_require__(122) + , ENDS_WITH = 'endsWith' + , $endsWith = ''[ENDS_WITH]; + + $export($export.P + $export.F * __webpack_require__(124)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /*, endPosition = @length */){ + var that = context(this, searchString, ENDS_WITH) + , endPosition = arguments.length > 1 ? arguments[1] : undefined + , len = toLength(that.length) + , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) + , search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } + }); + +/***/ }, +/* 122 */ +/***/ function(module, exports, __webpack_require__) { + + // helper for String#{startsWith, endsWith, includes} + var isRegExp = __webpack_require__(123) + , defined = __webpack_require__(33); + + module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); + }; + +/***/ }, +/* 123 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.8 IsRegExp(argument) + var isObject = __webpack_require__(13) + , cof = __webpack_require__(32) + , MATCH = __webpack_require__(23)('match'); + module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); + }; + +/***/ }, +/* 124 */ +/***/ function(module, exports, __webpack_require__) { + + var MATCH = __webpack_require__(23)('match'); + module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; + }; + +/***/ }, +/* 125 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.7 String.prototype.includes(searchString, position = 0) + 'use strict'; + var $export = __webpack_require__(6) + , context = __webpack_require__(122) + , INCLUDES = 'includes'; + + $export($export.P + $export.F * __webpack_require__(124)(INCLUDES), 'String', { + includes: function includes(searchString /*, position = 0 */){ + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } + }); + +/***/ }, +/* 126 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + + $export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(78) + }); + +/***/ }, +/* 127 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + 'use strict'; + var $export = __webpack_require__(6) + , toLength = __webpack_require__(35) + , context = __webpack_require__(122) + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + + $export($export.P + $export.F * __webpack_require__(124)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } + }); + +/***/ }, +/* 128 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $at = __webpack_require__(120)(true); + + // 21.1.3.27 String.prototype[@@iterator]() + __webpack_require__(129)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; + }); + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var LIBRARY = __webpack_require__(26) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(18) + , hide = __webpack_require__(10) + , has = __webpack_require__(3) + , Iterators = __webpack_require__(130) + , $iterCreate = __webpack_require__(131) + , setToStringTag = __webpack_require__(22) + , getPrototypeOf = __webpack_require__(57) + , ITERATOR = __webpack_require__(23)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + + var returnThis = function(){ return this; }; + + module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; + +/***/ }, +/* 130 */ +/***/ function(module, exports) { + + module.exports = {}; + +/***/ }, +/* 131 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var create = __webpack_require__(44) + , descriptor = __webpack_require__(17) + , setToStringTag = __webpack_require__(22) + , IteratorPrototype = {}; + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + __webpack_require__(10)(IteratorPrototype, __webpack_require__(23)('iterator'), function(){ return this; }); + + module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); + }; + +/***/ }, +/* 132 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.2 String.prototype.anchor(name) + __webpack_require__(133)('anchor', function(createHTML){ + return function anchor(name){ + return createHTML(this, 'a', 'name', name); + } + }); + +/***/ }, +/* 133 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , fails = __webpack_require__(5) + , defined = __webpack_require__(33) + , quot = /"/g; + // B.2.3.2.1 CreateHTML(string, tag, attribute, value) + var createHTML = function(string, tag, attribute, value) { + var S = String(defined(string)) + , p1 = '<' + tag; + if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; + }; + module.exports = function(NAME, exec){ + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function(){ + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); + }; + +/***/ }, +/* 134 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.3 String.prototype.big() + __webpack_require__(133)('big', function(createHTML){ + return function big(){ + return createHTML(this, 'big', '', ''); + } + }); + +/***/ }, +/* 135 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.4 String.prototype.blink() + __webpack_require__(133)('blink', function(createHTML){ + return function blink(){ + return createHTML(this, 'blink', '', ''); + } + }); + +/***/ }, +/* 136 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.5 String.prototype.bold() + __webpack_require__(133)('bold', function(createHTML){ + return function bold(){ + return createHTML(this, 'b', '', ''); + } + }); + +/***/ }, +/* 137 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.6 String.prototype.fixed() + __webpack_require__(133)('fixed', function(createHTML){ + return function fixed(){ + return createHTML(this, 'tt', '', ''); + } + }); + +/***/ }, +/* 138 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.7 String.prototype.fontcolor(color) + __webpack_require__(133)('fontcolor', function(createHTML){ + return function fontcolor(color){ + return createHTML(this, 'font', 'color', color); + } + }); + +/***/ }, +/* 139 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.8 String.prototype.fontsize(size) + __webpack_require__(133)('fontsize', function(createHTML){ + return function fontsize(size){ + return createHTML(this, 'font', 'size', size); + } + }); + +/***/ }, +/* 140 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.9 String.prototype.italics() + __webpack_require__(133)('italics', function(createHTML){ + return function italics(){ + return createHTML(this, 'i', '', ''); + } + }); + +/***/ }, +/* 141 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.10 String.prototype.link(url) + __webpack_require__(133)('link', function(createHTML){ + return function link(url){ + return createHTML(this, 'a', 'href', url); + } + }); + +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.11 String.prototype.small() + __webpack_require__(133)('small', function(createHTML){ + return function small(){ + return createHTML(this, 'small', '', ''); + } + }); + +/***/ }, +/* 143 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.12 String.prototype.strike() + __webpack_require__(133)('strike', function(createHTML){ + return function strike(){ + return createHTML(this, 'strike', '', ''); + } + }); + +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.13 String.prototype.sub() + __webpack_require__(133)('sub', function(createHTML){ + return function sub(){ + return createHTML(this, 'sub', '', ''); + } + }); + +/***/ }, +/* 145 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.14 String.prototype.sup() + __webpack_require__(133)('sup', function(createHTML){ + return function sup(){ + return createHTML(this, 'sup', '', ''); + } + }); + +/***/ }, +/* 146 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) + var $export = __webpack_require__(6); + + $export($export.S, 'Array', {isArray: __webpack_require__(43)}); + +/***/ }, +/* 147 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var ctx = __webpack_require__(8) + , $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , call = __webpack_require__(148) + , isArrayIter = __webpack_require__(149) + , toLength = __webpack_require__(35) + , createProperty = __webpack_require__(150) + , getIterFn = __webpack_require__(151); + + $export($export.S + $export.F * !__webpack_require__(153)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } + }); + + +/***/ }, +/* 148 */ +/***/ function(module, exports, __webpack_require__) { + + // call something on iterator step with safe closing on error + var anObject = __webpack_require__(12); + module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } + }; + +/***/ }, +/* 149 */ +/***/ function(module, exports, __webpack_require__) { + + // check on default Array iterator + var Iterators = __webpack_require__(130) + , ITERATOR = __webpack_require__(23)('iterator') + , ArrayProto = Array.prototype; + + module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); + }; + +/***/ }, +/* 150 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $defineProperty = __webpack_require__(11) + , createDesc = __webpack_require__(17); + + module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; + }; + +/***/ }, +/* 151 */ +/***/ function(module, exports, __webpack_require__) { + + var classof = __webpack_require__(152) + , ITERATOR = __webpack_require__(23)('iterator') + , Iterators = __webpack_require__(130); + module.exports = __webpack_require__(7).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; + }; + +/***/ }, +/* 152 */ +/***/ function(module, exports, __webpack_require__) { + + // getting tag from 19.1.3.6 Object.prototype.toString() + var cof = __webpack_require__(32) + , TAG = __webpack_require__(23)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } + }; + + module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + +/***/ }, +/* 153 */ +/***/ function(module, exports, __webpack_require__) { + + var ITERATOR = __webpack_require__(23)('iterator') + , SAFE_CLOSING = false; + + try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); + } catch(e){ /* empty */ } + + module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; + }; + +/***/ }, +/* 154 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , createProperty = __webpack_require__(150); + + // WebKit Array.of isn't generic + $export($export.S + $export.F * __webpack_require__(5)(function(){ + function F(){} + return !(Array.of.call(F) instanceof F); + }), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */){ + var index = 0 + , aLen = arguments.length + , result = new (typeof this == 'function' ? this : Array)(aLen); + while(aLen > index)createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } + }); + +/***/ }, +/* 155 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.13 Array.prototype.join(separator) + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , arrayJoin = [].join; + + // fallback for not array-like strings + $export($export.P + $export.F * (__webpack_require__(31) != Object || !__webpack_require__(156)(arrayJoin)), 'Array', { + join: function join(separator){ + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } + }); + +/***/ }, +/* 156 */ +/***/ function(module, exports, __webpack_require__) { + + var fails = __webpack_require__(5); + + module.exports = function(method, arg){ + return !!method && fails(function(){ + arg ? method.call(null, function(){}, 1) : method.call(null); + }); + }; + +/***/ }, +/* 157 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , html = __webpack_require__(46) + , cof = __webpack_require__(32) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35) + , arraySlice = [].slice; + + // fallback for not array-like ES3 strings and DOM objects + $export($export.P + $export.F * __webpack_require__(5)(function(){ + if(html)arraySlice.call(html); + }), 'Array', { + slice: function slice(begin, end){ + var len = toLength(this.length) + , klass = cof(this); + end = end === undefined ? len : end; + if(klass == 'Array')return arraySlice.call(this, begin, end); + var start = toIndex(begin, len) + , upTo = toIndex(end, len) + , size = toLength(upTo - start) + , cloned = Array(size) + , i = 0; + for(; i < size; i++)cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } + }); + +/***/ }, +/* 158 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , aFunction = __webpack_require__(9) + , toObject = __webpack_require__(56) + , fails = __webpack_require__(5) + , $sort = [].sort + , test = [1, 2, 3]; + + $export($export.P + $export.F * (fails(function(){ + // IE8- + test.sort(undefined); + }) || !fails(function(){ + // V8 bug + test.sort(null); + // Old WebKit + }) || !__webpack_require__(156)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn){ + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } + }); + +/***/ }, +/* 159 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $forEach = __webpack_require__(160)(0) + , STRICT = __webpack_require__(156)([].forEach, true); + + $export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */){ + return $forEach(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 160 */ +/***/ function(module, exports, __webpack_require__) { + + // 0 -> Array#forEach + // 1 -> Array#map + // 2 -> Array#filter + // 3 -> Array#some + // 4 -> Array#every + // 5 -> Array#find + // 6 -> Array#findIndex + var ctx = __webpack_require__(8) + , IObject = __webpack_require__(31) + , toObject = __webpack_require__(56) + , toLength = __webpack_require__(35) + , asc = __webpack_require__(161); + module.exports = function(TYPE, $create){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX + , create = $create || asc; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; + }; + +/***/ }, +/* 161 */ +/***/ function(module, exports, __webpack_require__) { + + // 9.4.2.3 ArraySpeciesCreate(originalArray, length) + var speciesConstructor = __webpack_require__(162); + + module.exports = function(original, length){ + return new (speciesConstructor(original))(length); + }; + +/***/ }, +/* 162 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(13) + , isArray = __webpack_require__(43) + , SPECIES = __webpack_require__(23)('species'); + + module.exports = function(original){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return C === undefined ? Array : C; + }; + +/***/ }, +/* 163 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $map = __webpack_require__(160)(1); + + $export($export.P + $export.F * !__webpack_require__(156)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */){ + return $map(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 164 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $filter = __webpack_require__(160)(2); + + $export($export.P + $export.F * !__webpack_require__(156)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */){ + return $filter(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 165 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $some = __webpack_require__(160)(3); + + $export($export.P + $export.F * !__webpack_require__(156)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */){ + return $some(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 166 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $every = __webpack_require__(160)(4); + + $export($export.P + $export.F * !__webpack_require__(156)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */){ + return $every(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 167 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $reduce = __webpack_require__(168); + + $export($export.P + $export.F * !__webpack_require__(156)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } + }); + +/***/ }, +/* 168 */ +/***/ function(module, exports, __webpack_require__) { + + var aFunction = __webpack_require__(9) + , toObject = __webpack_require__(56) + , IObject = __webpack_require__(31) + , toLength = __webpack_require__(35); + + module.exports = function(that, callbackfn, aLen, memo, isRight){ + aFunction(callbackfn); + var O = toObject(that) + , self = IObject(O) + , length = toLength(O.length) + , index = isRight ? length - 1 : 0 + , i = isRight ? -1 : 1; + if(aLen < 2)for(;;){ + if(index in self){ + memo = self[index]; + index += i; + break; + } + index += i; + if(isRight ? index < 0 : length <= index){ + throw TypeError('Reduce of empty array with no initial value'); + } + } + for(;isRight ? index >= 0 : length > index; index += i)if(index in self){ + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; + +/***/ }, +/* 169 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $reduce = __webpack_require__(168); + + $export($export.P + $export.F * !__webpack_require__(156)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } + }); + +/***/ }, +/* 170 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $indexOf = __webpack_require__(34)(false) + , $native = [].indexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + + $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(156)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /*, fromIndex = 0 */){ + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } + }); + +/***/ }, +/* 171 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , $native = [].lastIndexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + + $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(156)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){ + // convert -0 to +0 + if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0; + var O = toIObject(this) + , length = toLength(O.length) + , index = length - 1; + if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1])); + if(index < 0)index = length + index; + for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0; + return -1; + } + }); + +/***/ }, +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + var $export = __webpack_require__(6); + + $export($export.P, 'Array', {copyWithin: __webpack_require__(173)}); + + __webpack_require__(174)('copyWithin'); + +/***/ }, +/* 173 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + 'use strict'; + var toObject = __webpack_require__(56) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35); + + module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){ + var O = toObject(this) + , len = toLength(O.length) + , to = toIndex(target, len) + , from = toIndex(start, len) + , end = arguments.length > 2 ? arguments[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; + }; + +/***/ }, +/* 174 */ +/***/ function(module, exports) { + + module.exports = function(){ /* empty */ }; + +/***/ }, +/* 175 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + var $export = __webpack_require__(6); + + $export($export.P, 'Array', {fill: __webpack_require__(176)}); + + __webpack_require__(174)('fill'); + +/***/ }, +/* 176 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + 'use strict'; + var toObject = __webpack_require__(56) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35); + module.exports = function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , aLen = arguments.length + , index = toIndex(aLen > 1 ? arguments[1] : undefined, length) + , end = aLen > 2 ? arguments[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; + }; + +/***/ }, +/* 177 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) + var $export = __webpack_require__(6) + , $find = __webpack_require__(160)(5) + , KEY = 'find' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(174)(KEY); + +/***/ }, +/* 178 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) + var $export = __webpack_require__(6) + , $find = __webpack_require__(160)(6) + , KEY = 'findIndex' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(174)(KEY); + +/***/ }, +/* 179 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var addToUnscopables = __webpack_require__(174) + , step = __webpack_require__(180) + , Iterators = __webpack_require__(130) + , toIObject = __webpack_require__(30); + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + module.exports = __webpack_require__(129)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + Iterators.Arguments = Iterators.Array; + + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); + +/***/ }, +/* 180 */ +/***/ function(module, exports) { + + module.exports = function(done, value){ + return {value: value, done: !!done}; + }; + +/***/ }, +/* 181 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(182)('Array'); + +/***/ }, +/* 182 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , dP = __webpack_require__(11) + , DESCRIPTORS = __webpack_require__(4) + , SPECIES = __webpack_require__(23)('species'); + + module.exports = function(KEY){ + var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); + }; + +/***/ }, +/* 183 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var LIBRARY = __webpack_require__(26) + , global = __webpack_require__(2) + , ctx = __webpack_require__(8) + , classof = __webpack_require__(152) + , $export = __webpack_require__(6) + , isObject = __webpack_require__(13) + , aFunction = __webpack_require__(9) + , anInstance = __webpack_require__(184) + , forOf = __webpack_require__(185) + , speciesConstructor = __webpack_require__(186) + , task = __webpack_require__(187).set + , microtask = __webpack_require__(188)() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + + var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[__webpack_require__(23)('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } + }(); + + // helpers + var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; + }; + var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); + }; + var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); + }; + var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } + }; + var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); + }; + var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); + }; + var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; + }; + var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); + }; + var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); + }; + var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } + }; + + // constructor polyfill + if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(189)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); + __webpack_require__(22)($Promise, PROMISE); + __webpack_require__(182)(PROMISE); + Wrapper = __webpack_require__(7)[PROMISE]; + + // statics + $export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } + }); + $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(153)(function(iter){ + $Promise.all(iter)['catch'](empty); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } + }); + +/***/ }, +/* 184 */ +/***/ function(module, exports) { + + module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; + }; + +/***/ }, +/* 185 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(8) + , call = __webpack_require__(148) + , isArrayIter = __webpack_require__(149) + , anObject = __webpack_require__(12) + , toLength = __webpack_require__(35) + , getIterFn = __webpack_require__(151) + , BREAK = {} + , RETURN = {}; + var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } + }; + exports.BREAK = BREAK; + exports.RETURN = RETURN; + +/***/ }, +/* 186 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + var anObject = __webpack_require__(12) + , aFunction = __webpack_require__(9) + , SPECIES = __webpack_require__(23)('species'); + module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); + }; + +/***/ }, +/* 187 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(8) + , invoke = __webpack_require__(74) + , html = __webpack_require__(46) + , cel = __webpack_require__(15) + , global = __webpack_require__(2) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; + var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listener = function(event){ + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(__webpack_require__(32)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } + } + module.exports = { + set: setTask, + clear: clearTask + }; + +/***/ }, +/* 188 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , macrotask = __webpack_require__(187).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = __webpack_require__(32)(process) == 'process'; + + module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; + }; + +/***/ }, +/* 189 */ +/***/ function(module, exports, __webpack_require__) { + + var hide = __webpack_require__(10); + module.exports = function(target, src, safe){ + for(var key in src){ + if(safe && target[key])target[key] = src[key]; + else hide(target, key, src[key]); + } return target; + }; + +/***/ }, +/* 190 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(191); + + // 23.1 Map Objects + module.exports = __webpack_require__(192)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } + }, strong, true); + +/***/ }, +/* 191 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var dP = __webpack_require__(11).f + , create = __webpack_require__(44) + , redefineAll = __webpack_require__(189) + , ctx = __webpack_require__(8) + , anInstance = __webpack_require__(184) + , defined = __webpack_require__(33) + , forOf = __webpack_require__(185) + , $iterDefine = __webpack_require__(129) + , step = __webpack_require__(180) + , setSpecies = __webpack_require__(182) + , DESCRIPTORS = __webpack_require__(4) + , fastKey = __webpack_require__(19).fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + + var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } + }; + +/***/ }, +/* 192 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , $export = __webpack_require__(6) + , meta = __webpack_require__(19) + , fails = __webpack_require__(5) + , hide = __webpack_require__(10) + , redefineAll = __webpack_require__(189) + , forOf = __webpack_require__(185) + , anInstance = __webpack_require__(184) + , isObject = __webpack_require__(13) + , setToStringTag = __webpack_require__(22) + , dP = __webpack_require__(11).f + , each = __webpack_require__(160)(0) + , DESCRIPTORS = __webpack_require__(4); + + module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + if(!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME, '_c'); + target._c = new Base; + if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','),function(KEY){ + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){ + anInstance(this, C, KEY); + if(!IS_ADDER && IS_WEAK && !isObject(a))return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + if('size' in proto)dP(C.prototype, 'size', { + get: function(){ + return this._c.size; + } + }); + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F, O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; + }; + +/***/ }, +/* 193 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(191); + + // 23.2 Set Objects + module.exports = __webpack_require__(192)('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } + }, strong); + +/***/ }, +/* 194 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var each = __webpack_require__(160)(0) + , redefine = __webpack_require__(18) + , meta = __webpack_require__(19) + , assign = __webpack_require__(67) + , weak = __webpack_require__(195) + , isObject = __webpack_require__(13) + , getWeak = meta.getWeak + , isExtensible = Object.isExtensible + , uncaughtFrozenStore = weak.ufstore + , tmp = {} + , InternalMap; + + var wrapper = function(get){ + return function WeakMap(){ + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; + }; + + var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key){ + if(isObject(key)){ + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value){ + return weak.def(this, key, value); + } + }; + + // 23.3 WeakMap Objects + var $WeakMap = module.exports = __webpack_require__(192)('WeakMap', wrapper, methods, weak, true, true); + + // IE11 WeakMap frozen keys fix + if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ + InternalMap = weak.getConstructor(wrapper); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function(key){ + var proto = $WeakMap.prototype + , method = proto[key]; + redefine(proto, key, function(a, b){ + // store frozen objects on internal weakmap shim + if(isObject(a) && !isExtensible(a)){ + if(!this._f)this._f = new InternalMap; + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); + } + +/***/ }, +/* 195 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var redefineAll = __webpack_require__(189) + , getWeak = __webpack_require__(19).getWeak + , anObject = __webpack_require__(12) + , isObject = __webpack_require__(13) + , anInstance = __webpack_require__(184) + , forOf = __webpack_require__(185) + , createArrayMethod = __webpack_require__(160) + , $has = __webpack_require__(3) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function(that){ + return that._l || (that._l = new UncaughtFrozenStore); + }; + var UncaughtFrozenStore = function(){ + this.a = []; + }; + var findUncaughtFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function(key){ + var entry = findUncaughtFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findUncaughtFrozen(this, key); + }, + set: function(key, value){ + var entry = findUncaughtFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this)['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function(that, key, value){ + var data = getWeak(anObject(key), true); + if(data === true)uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore + }; + +/***/ }, +/* 196 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var weak = __webpack_require__(195); + + // 23.4 WeakSet Objects + __webpack_require__(192)('WeakSet', function(get){ + return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value){ + return weak.def(this, value, true); + } + }, weak, false, true); + +/***/ }, +/* 197 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) + var $export = __webpack_require__(6) + , aFunction = __webpack_require__(9) + , anObject = __webpack_require__(12) + , rApply = (__webpack_require__(2).Reflect || {}).apply + , fApply = Function.apply; + // MS Edge argumentsList argument is optional + $export($export.S + $export.F * !__webpack_require__(5)(function(){ + rApply(function(){}); + }), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList){ + var T = aFunction(target) + , L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } + }); + +/***/ }, +/* 198 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) + var $export = __webpack_require__(6) + , create = __webpack_require__(44) + , aFunction = __webpack_require__(9) + , anObject = __webpack_require__(12) + , isObject = __webpack_require__(13) + , fails = __webpack_require__(5) + , bind = __webpack_require__(73) + , rConstruct = (__webpack_require__(2).Reflect || {}).construct; + + // MS Edge supports only 2 arguments and argumentsList argument is optional + // FF Nightly sets third argument as `new.target`, but does not create `this` from it + var NEW_TARGET_BUG = fails(function(){ + function F(){} + return !(rConstruct(function(){}, [], F) instanceof F); + }); + var ARGS_BUG = !fails(function(){ + rConstruct(function(){}); + }); + + $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /*, newTarget*/){ + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget); + if(Target == newTarget){ + // w/o altered newTarget, optimization for 0-4 arguments + switch(args.length){ + case 0: return new Target; + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype + , instance = create(isObject(proto) ? proto : Object.prototype) + , result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } + }); + +/***/ }, +/* 199 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) + var dP = __webpack_require__(11) + , $export = __webpack_require__(6) + , anObject = __webpack_require__(12) + , toPrimitive = __webpack_require__(16); + + // MS Edge has broken Reflect.defineProperty - throwing instead of returning false + $export($export.S + $export.F * __webpack_require__(5)(function(){ + Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2}); + }), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes){ + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 200 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.4 Reflect.deleteProperty(target, propertyKey) + var $export = __webpack_require__(6) + , gOPD = __webpack_require__(49).f + , anObject = __webpack_require__(12); + + $export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey){ + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } + }); + +/***/ }, +/* 201 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 26.1.5 Reflect.enumerate(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(12); + var Enumerate = function(iterated){ + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = [] // keys + , key; + for(key in iterated)keys.push(key); + }; + __webpack_require__(131)(Enumerate, 'Object', function(){ + var that = this + , keys = that._k + , key; + do { + if(that._i >= keys.length)return {value: undefined, done: true}; + } while(!((key = keys[that._i++]) in that._t)); + return {value: key, done: false}; + }); + + $export($export.S, 'Reflect', { + enumerate: function enumerate(target){ + return new Enumerate(target); + } + }); + +/***/ }, +/* 202 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.6 Reflect.get(target, propertyKey [, receiver]) + var gOPD = __webpack_require__(49) + , getPrototypeOf = __webpack_require__(57) + , has = __webpack_require__(3) + , $export = __webpack_require__(6) + , isObject = __webpack_require__(13) + , anObject = __webpack_require__(12); + + function get(target, propertyKey/*, receiver*/){ + var receiver = arguments.length < 3 ? target : arguments[2] + , desc, proto; + if(anObject(target) === receiver)return target[propertyKey]; + if(desc = gOPD.f(target, propertyKey))return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver); + } + + $export($export.S, 'Reflect', {get: get}); + +/***/ }, +/* 203 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) + var gOPD = __webpack_require__(49) + , $export = __webpack_require__(6) + , anObject = __webpack_require__(12); + + $export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ + return gOPD.f(anObject(target), propertyKey); + } + }); + +/***/ }, +/* 204 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.8 Reflect.getPrototypeOf(target) + var $export = __webpack_require__(6) + , getProto = __webpack_require__(57) + , anObject = __webpack_require__(12); + + $export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target){ + return getProto(anObject(target)); + } + }); + +/***/ }, +/* 205 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.9 Reflect.has(target, propertyKey) + var $export = __webpack_require__(6); + + $export($export.S, 'Reflect', { + has: function has(target, propertyKey){ + return propertyKey in target; + } + }); + +/***/ }, +/* 206 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.10 Reflect.isExtensible(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(12) + , $isExtensible = Object.isExtensible; + + $export($export.S, 'Reflect', { + isExtensible: function isExtensible(target){ + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } + }); + +/***/ }, +/* 207 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.11 Reflect.ownKeys(target) + var $export = __webpack_require__(6); + + $export($export.S, 'Reflect', {ownKeys: __webpack_require__(208)}); + +/***/ }, +/* 208 */ +/***/ function(module, exports, __webpack_require__) { + + // all object keys, includes non-enumerable and symbols + var gOPN = __webpack_require__(48) + , gOPS = __webpack_require__(41) + , anObject = __webpack_require__(12) + , Reflect = __webpack_require__(2).Reflect; + module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = gOPN.f(anObject(it)) + , getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; + }; + +/***/ }, +/* 209 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.12 Reflect.preventExtensions(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(12) + , $preventExtensions = Object.preventExtensions; + + $export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target){ + anObject(target); + try { + if($preventExtensions)$preventExtensions(target); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 210 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) + var dP = __webpack_require__(11) + , gOPD = __webpack_require__(49) + , getPrototypeOf = __webpack_require__(57) + , has = __webpack_require__(3) + , $export = __webpack_require__(6) + , createDesc = __webpack_require__(17) + , anObject = __webpack_require__(12) + , isObject = __webpack_require__(13); + + function set(target, propertyKey, V/*, receiver*/){ + var receiver = arguments.length < 4 ? target : arguments[3] + , ownDesc = gOPD.f(anObject(target), propertyKey) + , existingDescriptor, proto; + if(!ownDesc){ + if(isObject(proto = getPrototypeOf(target))){ + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if(has(ownDesc, 'value')){ + if(ownDesc.writable === false || !isObject(receiver))return false; + existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); + } + + $export($export.S, 'Reflect', {set: set}); + +/***/ }, +/* 211 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.14 Reflect.setPrototypeOf(target, proto) + var $export = __webpack_require__(6) + , setProto = __webpack_require__(71); + + if(setProto)$export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto){ + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 212 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.3.3.1 / 15.9.4.4 Date.now() + var $export = __webpack_require__(6); + + $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); + +/***/ }, +/* 213 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(16); + + $export($export.P + $export.F * __webpack_require__(5)(function(){ + return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1; + }), 'Date', { + toJSON: function toJSON(key){ + var O = toObject(this) + , pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } + }); + +/***/ }, +/* 214 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() + var $export = __webpack_require__(6) + , fails = __webpack_require__(5) + , getTime = Date.prototype.getTime; + + var lz = function(num){ + return num > 9 ? num : '0' + num; + }; + + // PhantomJS / old WebKit has a broken implementations + $export($export.P + $export.F * (fails(function(){ + return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z'; + }) || !fails(function(){ + new Date(NaN).toISOString(); + })), 'Date', { + toISOString: function toISOString(){ + if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value'); + var d = this + , y = d.getUTCFullYear() + , m = d.getUTCMilliseconds() + , s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; + } + }); + +/***/ }, +/* 215 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $typed = __webpack_require__(216) + , buffer = __webpack_require__(217) + , anObject = __webpack_require__(12) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35) + , isObject = __webpack_require__(13) + , ArrayBuffer = __webpack_require__(2).ArrayBuffer + , speciesConstructor = __webpack_require__(186) + , $ArrayBuffer = buffer.ArrayBuffer + , $DataView = buffer.DataView + , $isView = $typed.ABV && ArrayBuffer.isView + , $slice = $ArrayBuffer.prototype.slice + , VIEW = $typed.VIEW + , ARRAY_BUFFER = 'ArrayBuffer'; + + $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer}); + + $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it){ + return $isView && $isView(it) || isObject(it) && VIEW in it; + } + }); + + $export($export.P + $export.U + $export.F * __webpack_require__(5)(function(){ + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; + }), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end){ + if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength + , first = toIndex(start, len) + , final = toIndex(end === undefined ? len : end, len) + , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first)) + , viewS = new $DataView(this) + , viewT = new $DataView(result) + , index = 0; + while(first < final){ + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } + }); + + __webpack_require__(182)(ARRAY_BUFFER); + +/***/ }, +/* 216 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , hide = __webpack_require__(10) + , uid = __webpack_require__(20) + , TYPED = uid('typed_array') + , VIEW = uid('view') + , ABV = !!(global.ArrayBuffer && global.DataView) + , CONSTR = ABV + , i = 0, l = 9, Typed; + + var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' + ).split(','); + + while(i < l){ + if(Typed = global[TypedArrayConstructors[i++]]){ + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; + } + + module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW + }; + +/***/ }, +/* 217 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , DESCRIPTORS = __webpack_require__(4) + , LIBRARY = __webpack_require__(26) + , $typed = __webpack_require__(216) + , hide = __webpack_require__(10) + , redefineAll = __webpack_require__(189) + , fails = __webpack_require__(5) + , anInstance = __webpack_require__(184) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , gOPN = __webpack_require__(48).f + , dP = __webpack_require__(11).f + , arrayFill = __webpack_require__(176) + , setToStringTag = __webpack_require__(22) + , ARRAY_BUFFER = 'ArrayBuffer' + , DATA_VIEW = 'DataView' + , PROTOTYPE = 'prototype' + , WRONG_LENGTH = 'Wrong length!' + , WRONG_INDEX = 'Wrong index!' + , $ArrayBuffer = global[ARRAY_BUFFER] + , $DataView = global[DATA_VIEW] + , Math = global.Math + , RangeError = global.RangeError + , Infinity = global.Infinity + , BaseBuffer = $ArrayBuffer + , abs = Math.abs + , pow = Math.pow + , floor = Math.floor + , log = Math.log + , LN2 = Math.LN2 + , BUFFER = 'buffer' + , BYTE_LENGTH = 'byteLength' + , BYTE_OFFSET = 'byteOffset' + , $BUFFER = DESCRIPTORS ? '_b' : BUFFER + , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH + , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + + // IEEE754 conversions based on https://github.com/feross/ieee754 + var packIEEE754 = function(value, mLen, nBytes){ + var buffer = Array(nBytes) + , eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0 + , i = 0 + , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0 + , e, m, c; + value = abs(value) + if(value != value || value === Infinity){ + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if(value * (c = pow(2, -e)) < 1){ + e--; + c *= 2; + } + if(e + eBias >= 1){ + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if(value * c >= 2){ + e++; + c /= 2; + } + if(e + eBias >= eMax){ + m = 0; + e = eMax; + } else if(e + eBias >= 1){ + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; + }; + var unpackIEEE754 = function(buffer, mLen, nBytes){ + var eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , nBits = eLen - 7 + , i = nBytes - 1 + , s = buffer[i--] + , e = s & 127 + , m; + s >>= 7; + for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if(e === 0){ + e = 1 - eBias; + } else if(e === eMax){ + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); + }; + + var unpackI32 = function(bytes){ + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; + }; + var packI8 = function(it){ + return [it & 0xff]; + }; + var packI16 = function(it){ + return [it & 0xff, it >> 8 & 0xff]; + }; + var packI32 = function(it){ + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; + }; + var packF64 = function(it){ + return packIEEE754(it, 52, 8); + }; + var packF32 = function(it){ + return packIEEE754(it, 23, 4); + }; + + var addGetter = function(C, key, internal){ + dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }}); + }; + + var get = function(view, bytes, index, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); + }; + var set = function(view, bytes, index, conversion, value, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = conversion(+value); + for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; + }; + + var validateArrayBufferArguments = function(that, length){ + anInstance(that, $ArrayBuffer, ARRAY_BUFFER); + var numberLength = +length + , byteLength = toLength(numberLength); + if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); + return byteLength; + }; + + if(!$typed.ABV){ + $ArrayBuffer = function ArrayBuffer(length){ + var byteLength = validateArrayBufferArguments(this, length); + this._b = arrayFill.call(Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength){ + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH] + , offset = toInteger(byteOffset); + if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if(DESCRIPTORS){ + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset){ + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset){ + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){ + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); + } else { + if(!fails(function(){ + new $ArrayBuffer; // eslint-disable-line no-new + }) || !fails(function(){ + new $ArrayBuffer(.5); // eslint-disable-line no-new + })){ + $ArrayBuffer = function ArrayBuffer(length){ + return new BaseBuffer(validateArrayBufferArguments(this, length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){ + if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]); + }; + if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)) + , $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); + } + setToStringTag($ArrayBuffer, ARRAY_BUFFER); + setToStringTag($DataView, DATA_VIEW); + hide($DataView[PROTOTYPE], $typed.VIEW, true); + exports[ARRAY_BUFFER] = $ArrayBuffer; + exports[DATA_VIEW] = $DataView; + +/***/ }, +/* 218 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + $export($export.G + $export.W + $export.F * !__webpack_require__(216).ABV, { + DataView: __webpack_require__(217).DataView + }); + +/***/ }, +/* 219 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Int8', 1, function(init){ + return function Int8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 220 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + if(__webpack_require__(4)){ + var LIBRARY = __webpack_require__(26) + , global = __webpack_require__(2) + , fails = __webpack_require__(5) + , $export = __webpack_require__(6) + , $typed = __webpack_require__(216) + , $buffer = __webpack_require__(217) + , ctx = __webpack_require__(8) + , anInstance = __webpack_require__(184) + , propertyDesc = __webpack_require__(17) + , hide = __webpack_require__(10) + , redefineAll = __webpack_require__(189) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , toIndex = __webpack_require__(37) + , toPrimitive = __webpack_require__(16) + , has = __webpack_require__(3) + , same = __webpack_require__(69) + , classof = __webpack_require__(152) + , isObject = __webpack_require__(13) + , toObject = __webpack_require__(56) + , isArrayIter = __webpack_require__(149) + , create = __webpack_require__(44) + , getPrototypeOf = __webpack_require__(57) + , gOPN = __webpack_require__(48).f + , getIterFn = __webpack_require__(151) + , uid = __webpack_require__(20) + , wks = __webpack_require__(23) + , createArrayMethod = __webpack_require__(160) + , createArrayIncludes = __webpack_require__(34) + , speciesConstructor = __webpack_require__(186) + , ArrayIterators = __webpack_require__(179) + , Iterators = __webpack_require__(130) + , $iterDetect = __webpack_require__(153) + , setSpecies = __webpack_require__(182) + , arrayFill = __webpack_require__(176) + , arrayCopyWithin = __webpack_require__(173) + , $DP = __webpack_require__(11) + , $GOPD = __webpack_require__(49) + , dP = $DP.f + , gOPD = $GOPD.f + , RangeError = global.RangeError + , TypeError = global.TypeError + , Uint8Array = global.Uint8Array + , ARRAY_BUFFER = 'ArrayBuffer' + , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER + , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' + , PROTOTYPE = 'prototype' + , ArrayProto = Array[PROTOTYPE] + , $ArrayBuffer = $buffer.ArrayBuffer + , $DataView = $buffer.DataView + , arrayForEach = createArrayMethod(0) + , arrayFilter = createArrayMethod(2) + , arraySome = createArrayMethod(3) + , arrayEvery = createArrayMethod(4) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , arrayIncludes = createArrayIncludes(true) + , arrayIndexOf = createArrayIncludes(false) + , arrayValues = ArrayIterators.values + , arrayKeys = ArrayIterators.keys + , arrayEntries = ArrayIterators.entries + , arrayLastIndexOf = ArrayProto.lastIndexOf + , arrayReduce = ArrayProto.reduce + , arrayReduceRight = ArrayProto.reduceRight + , arrayJoin = ArrayProto.join + , arraySort = ArrayProto.sort + , arraySlice = ArrayProto.slice + , arrayToString = ArrayProto.toString + , arrayToLocaleString = ArrayProto.toLocaleString + , ITERATOR = wks('iterator') + , TAG = wks('toStringTag') + , TYPED_CONSTRUCTOR = uid('typed_constructor') + , DEF_CONSTRUCTOR = uid('def_constructor') + , ALL_CONSTRUCTORS = $typed.CONSTR + , TYPED_ARRAY = $typed.TYPED + , VIEW = $typed.VIEW + , WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function(O, length){ + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function(){ + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){ + new Uint8Array(1).set({}); + }); + + var strictToLength = function(it, SAME){ + if(it === undefined)throw TypeError(WRONG_LENGTH); + var number = +it + , length = toLength(it); + if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH); + return length; + }; + + var toOffset = function(it, BYTES){ + var offset = toInteger(it); + if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function(it){ + if(isObject(it) && TYPED_ARRAY in it)return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function(C, length){ + if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){ + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function(O, list){ + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function(C, list){ + var index = 0 + , length = list.length + , result = allocate(C, length); + while(length > index)result[index] = list[index++]; + return result; + }; + + var addGetter = function(it, key, internal){ + dP(it, key, {get: function(){ return this._d[internal]; }}); + }; + + var $from = function from(source /*, mapfn, thisArg */){ + var O = toObject(source) + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , iterFn = getIterFn(O) + , i, length, values, result, step, iterator; + if(iterFn != undefined && !isArrayIter(iterFn)){ + for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){ + values.push(step.value); + } O = values; + } + if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2); + for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){ + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/*...items*/){ + var index = 0 + , length = arguments.length + , result = allocate(this, length); + while(length > index)result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString(){ + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /*, end */){ + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /*, thisArg */){ + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /*, thisArg */){ + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /*, thisArg */){ + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /*, thisArg */){ + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /*, thisArg */){ + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /*, fromIndex */){ + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /*, fromIndex */){ + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator){ // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /*, thisArg */){ + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse(){ + var that = this + , length = validate(that).length + , middle = Math.floor(length / 2) + , index = 0 + , value; + while(index < middle){ + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /*, thisArg */){ + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn){ + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end){ + var O = validate(this) + , length = O.length + , $begin = toIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end){ + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /*, offset */){ + validate(this); + var offset = toOffset(arguments[1], 1) + , length = this.length + , src = toObject(arrayLike) + , len = toLength(src.length) + , index = 0; + if(len + offset > length)throw RangeError(WRONG_LENGTH); + while(index < len)this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries(){ + return arrayEntries.call(validate(this)); + }, + keys: function keys(){ + return arrayKeys.call(validate(this)); + }, + values: function values(){ + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function(target, key){ + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key){ + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc){ + if(isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ){ + target[key] = desc.value; + return target; + } else return dP(target, key, desc); + }; + + if(!ALL_CONSTRUCTORS){ + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if(fails(function(){ arrayToString.call({}); })){ + arrayToString = arrayToLocaleString = function toString(){ + return arrayJoin.call(this); + } + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function(){ /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function(){ return this[TYPED_ARRAY]; } + }); + + module.exports = function(KEY, BYTES, wrapper, CLAMPED){ + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array' + , ISNT_UINT8 = NAME != 'Uint8Array' + , GETTER = 'get' + KEY + , SETTER = 'set' + KEY + , TypedArray = global[NAME] + , Base = TypedArray || {} + , TAC = TypedArray && getPrototypeOf(TypedArray) + , FORCED = !TypedArray || !$typed.ABV + , O = {} + , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function(that, index){ + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function(that, index, value){ + var data = that._d; + if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function(that, index){ + dP(that, index, { + get: function(){ + return getter(this, index); + }, + set: function(value){ + return setter(this, index, value); + }, + enumerable: true + }); + }; + if(FORCED){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME, '_d'); + var index = 0 + , offset = 0 + , buffer, byteLength, length, klass; + if(!isObject(data)){ + length = strictToLength(data, true) + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if($length === undefined){ + if($len % BYTES)throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if(byteLength < 0)throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if(TYPED_ARRAY in data){ + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while(index < length)addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if(!$iterDetect(function(iter){ + // V8 works with iterators, but fails in many other cases + // https://code.google.com/p/v8/issues/detail?id=4552 + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8)); + if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if(TYPED_ARRAY in data)return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){ + if(!(key in TypedArray))hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR] + , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined) + , $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){ + dP(TypedArrayPrototype, TAG, { + get: function(){ return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES, + from: $from, + of: $of + }); + + if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, {set: $set}); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString}); + + $export($export.P + $export.F * fails(function(){ + new TypedArray(1).slice(); + }), NAME, {slice: $slice}); + + $export($export.P + $export.F * (fails(function(){ + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString() + }) || !fails(function(){ + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, {toLocaleString: $toLocaleString}); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); + }; + } else module.exports = function(){ /* empty */ }; + +/***/ }, +/* 221 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Uint8', 1, function(init){ + return function Uint8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 222 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Uint8', 1, function(init){ + return function Uint8ClampedArray(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }, true); + +/***/ }, +/* 223 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Int16', 2, function(init){ + return function Int16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 224 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Uint16', 2, function(init){ + return function Uint16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 225 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Int32', 4, function(init){ + return function Int32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 226 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Uint32', 4, function(init){ + return function Uint32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 227 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Float32', 4, function(init){ + return function Float32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 228 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(220)('Float64', 8, function(init){ + return function Float64Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 229 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/Array.prototype.includes + var $export = __webpack_require__(6) + , $includes = __webpack_require__(34)(true); + + $export($export.P, 'Array', { + includes: function includes(el /*, fromIndex = 0 */){ + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + __webpack_require__(174)('includes'); + +/***/ }, +/* 230 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/mathiasbynens/String.prototype.at + var $export = __webpack_require__(6) + , $at = __webpack_require__(120)(true); + + $export($export.P, 'String', { + at: function at(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 231 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/proposal-string-pad-start-end + var $export = __webpack_require__(6) + , $pad = __webpack_require__(232); + + $export($export.P, 'String', { + padStart: function padStart(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } + }); + +/***/ }, +/* 232 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-string-pad-start-end + var toLength = __webpack_require__(35) + , repeat = __webpack_require__(78) + , defined = __webpack_require__(33); + + module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength || fillStr == '')return S; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; + }; + + +/***/ }, +/* 233 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/proposal-string-pad-start-end + var $export = __webpack_require__(6) + , $pad = __webpack_require__(232); + + $export($export.P, 'String', { + padEnd: function padEnd(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } + }); + +/***/ }, +/* 234 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(90)('trimLeft', function($trim){ + return function trimLeft(){ + return $trim(this, 1); + }; + }, 'trimStart'); + +/***/ }, +/* 235 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(90)('trimRight', function($trim){ + return function trimRight(){ + return $trim(this, 2); + }; + }, 'trimEnd'); + +/***/ }, +/* 236 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://tc39.github.io/String.prototype.matchAll/ + var $export = __webpack_require__(6) + , defined = __webpack_require__(33) + , toLength = __webpack_require__(35) + , isRegExp = __webpack_require__(123) + , getFlags = __webpack_require__(237) + , RegExpProto = RegExp.prototype; + + var $RegExpStringIterator = function(regexp, string){ + this._r = regexp; + this._s = string; + }; + + __webpack_require__(131)($RegExpStringIterator, 'RegExp String', function next(){ + var match = this._r.exec(this._s); + return {value: match, done: match === null}; + }); + + $export($export.P, 'String', { + matchAll: function matchAll(regexp){ + defined(this); + if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!'); + var S = String(this) + , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp) + , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } + }); + +/***/ }, +/* 237 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.2.5.3 get RegExp.prototype.flags + var anObject = __webpack_require__(12); + module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; + }; + +/***/ }, +/* 238 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(25)('asyncIterator'); + +/***/ }, +/* 239 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(25)('observable'); + +/***/ }, +/* 240 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-getownpropertydescriptors + var $export = __webpack_require__(6) + , ownKeys = __webpack_require__(208) + , toIObject = __webpack_require__(30) + , gOPD = __webpack_require__(49) + , createProperty = __webpack_require__(150); + + $export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ + var O = toIObject(object) + , getDesc = gOPD.f + , keys = ownKeys(O) + , result = {} + , i = 0 + , key; + while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key)); + return result; + } + }); + +/***/ }, +/* 241 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-values-entries + var $export = __webpack_require__(6) + , $values = __webpack_require__(242)(false); + + $export($export.S, 'Object', { + values: function values(it){ + return $values(it); + } + }); + +/***/ }, +/* 242 */ +/***/ function(module, exports, __webpack_require__) { + + var getKeys = __webpack_require__(28) + , toIObject = __webpack_require__(30) + , isEnum = __webpack_require__(42).f; + module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; + }; + +/***/ }, +/* 243 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-values-entries + var $export = __webpack_require__(6) + , $entries = __webpack_require__(242)(true); + + $export($export.S, 'Object', { + entries: function entries(it){ + return $entries(it); + } + }); + +/***/ }, +/* 244 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , aFunction = __webpack_require__(9) + , $defineProperty = __webpack_require__(11); + + // B.2.2.2 Object.prototype.__defineGetter__(P, getter) + __webpack_require__(4) && $export($export.P + __webpack_require__(245), 'Object', { + __defineGetter__: function __defineGetter__(P, getter){ + $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); + } + }); + +/***/ }, +/* 245 */ +/***/ function(module, exports, __webpack_require__) { + + // Forced replacement prototype accessors methods + module.exports = __webpack_require__(26)|| !__webpack_require__(5)(function(){ + var K = Math.random(); + // In FF throws only define methods + __defineSetter__.call(null, K, function(){ /* empty */}); + delete __webpack_require__(2)[K]; + }); + +/***/ }, +/* 246 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , aFunction = __webpack_require__(9) + , $defineProperty = __webpack_require__(11); + + // B.2.2.3 Object.prototype.__defineSetter__(P, setter) + __webpack_require__(4) && $export($export.P + __webpack_require__(245), 'Object', { + __defineSetter__: function __defineSetter__(P, setter){ + $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); + } + }); + +/***/ }, +/* 247 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(16) + , getPrototypeOf = __webpack_require__(57) + , getOwnPropertyDescriptor = __webpack_require__(49).f; + + // B.2.2.4 Object.prototype.__lookupGetter__(P) + __webpack_require__(4) && $export($export.P + __webpack_require__(245), 'Object', { + __lookupGetter__: function __lookupGetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.get; + } while(O = getPrototypeOf(O)); + } + }); + +/***/ }, +/* 248 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(16) + , getPrototypeOf = __webpack_require__(57) + , getOwnPropertyDescriptor = __webpack_require__(49).f; + + // B.2.2.5 Object.prototype.__lookupSetter__(P) + __webpack_require__(4) && $export($export.P + __webpack_require__(245), 'Object', { + __lookupSetter__: function __lookupSetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.set; + } while(O = getPrototypeOf(O)); + } + }); + +/***/ }, +/* 249 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(6); + + $export($export.P + $export.R, 'Map', {toJSON: __webpack_require__(250)('Map')}); + +/***/ }, +/* 250 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var classof = __webpack_require__(152) + , from = __webpack_require__(251); + module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; + }; + +/***/ }, +/* 251 */ +/***/ function(module, exports, __webpack_require__) { + + var forOf = __webpack_require__(185); + + module.exports = function(iter, ITERATOR){ + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; + }; + + +/***/ }, +/* 252 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(6); + + $export($export.P + $export.R, 'Set', {toJSON: __webpack_require__(250)('Set')}); + +/***/ }, +/* 253 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/ljharb/proposal-global + var $export = __webpack_require__(6); + + $export($export.S, 'System', {global: __webpack_require__(2)}); + +/***/ }, +/* 254 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/ljharb/proposal-is-error + var $export = __webpack_require__(6) + , cof = __webpack_require__(32); + + $export($export.S, 'Error', { + isError: function isError(it){ + return cof(it) === 'Error'; + } + }); + +/***/ }, +/* 255 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } + }); + +/***/ }, +/* 256 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } + }); + +/***/ }, +/* 257 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + imulh: function imulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >> 16 + , v1 = $v >> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } + }); + +/***/ }, +/* 258 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + umulh: function umulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >>> 16 + , v1 = $v >>> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } + }); + +/***/ }, +/* 259 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + + metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); + }}); + +/***/ }, +/* 260 */ +/***/ function(module, exports, __webpack_require__) { + + var Map = __webpack_require__(190) + , $export = __webpack_require__(6) + , shared = __webpack_require__(21)('metadata') + , store = shared.store || (shared.store = new (__webpack_require__(194))); + + var getOrCreateMetadataMap = function(target, targetKey, create){ + var targetMetadata = store.get(target); + if(!targetMetadata){ + if(!create)return undefined; + store.set(target, targetMetadata = new Map); + } + var keyMetadata = targetMetadata.get(targetKey); + if(!keyMetadata){ + if(!create)return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map); + } return keyMetadata; + }; + var ordinaryHasOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); + }; + var ordinaryGetOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); + }; + var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){ + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); + }; + var ordinaryOwnMetadataKeys = function(target, targetKey){ + var metadataMap = getOrCreateMetadataMap(target, targetKey, false) + , keys = []; + if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); }); + return keys; + }; + var toMetaKey = function(it){ + return it === undefined || typeof it == 'symbol' ? it : String(it); + }; + var exp = function(O){ + $export($export.S, 'Reflect', O); + }; + + module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp + }; + +/***/ }, +/* 261 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , toMetaKey = metadata.key + , getOrCreateMetadataMap = metadata.map + , store = metadata.store; + + metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){ + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]) + , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false; + if(metadataMap.size)return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); + }}); + +/***/ }, +/* 262 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , getPrototypeOf = __webpack_require__(57) + , ordinaryHasOwnMetadata = metadata.has + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + + var ordinaryGetMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; + }; + + metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 263 */ +/***/ function(module, exports, __webpack_require__) { + + var Set = __webpack_require__(193) + , from = __webpack_require__(251) + , metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , getPrototypeOf = __webpack_require__(57) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + + var ordinaryMetadataKeys = function(O, P){ + var oKeys = ordinaryOwnMetadataKeys(O, P) + , parent = getPrototypeOf(O); + if(parent === null)return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; + }; + + metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); + }}); + +/***/ }, +/* 264 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + + metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 265 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + + metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); + }}); + +/***/ }, +/* 266 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , getPrototypeOf = __webpack_require__(57) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + + var ordinaryHasMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; + }; + + metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 267 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + + metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 268 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(260) + , anObject = __webpack_require__(12) + , aFunction = __webpack_require__(9) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + + metadata.exp({metadata: function metadata(metadataKey, metadataValue){ + return function decorator(target, targetKey){ + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; + }}); + +/***/ }, +/* 269 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask + var $export = __webpack_require__(6) + , microtask = __webpack_require__(188)() + , process = __webpack_require__(2).process + , isNode = __webpack_require__(32)(process) == 'process'; + + $export($export.G, { + asap: function asap(fn){ + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } + }); + +/***/ }, +/* 270 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/zenparsing/es-observable + var $export = __webpack_require__(6) + , global = __webpack_require__(2) + , core = __webpack_require__(7) + , microtask = __webpack_require__(188)() + , OBSERVABLE = __webpack_require__(23)('observable') + , aFunction = __webpack_require__(9) + , anObject = __webpack_require__(12) + , anInstance = __webpack_require__(184) + , redefineAll = __webpack_require__(189) + , hide = __webpack_require__(10) + , forOf = __webpack_require__(185) + , RETURN = forOf.RETURN; + + var getMethod = function(fn){ + return fn == null ? undefined : aFunction(fn); + }; + + var cleanupSubscription = function(subscription){ + var cleanup = subscription._c; + if(cleanup){ + subscription._c = undefined; + cleanup(); + } + }; + + var subscriptionClosed = function(subscription){ + return subscription._o === undefined; + }; + + var closeSubscription = function(subscription){ + if(!subscriptionClosed(subscription)){ + subscription._o = undefined; + cleanupSubscription(subscription); + } + }; + + var Subscription = function(observer, subscriber){ + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer) + , subscription = cleanup; + if(cleanup != null){ + if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch(e){ + observer.error(e); + return; + } if(subscriptionClosed(this))cleanupSubscription(this); + }; + + Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe(){ closeSubscription(this); } + }); + + var SubscriptionObserver = function(subscription){ + this._s = subscription; + }; + + SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if(m)return m.call(observer, value); + } catch(e){ + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value){ + var subscription = this._s; + if(subscriptionClosed(subscription))throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if(!m)throw value; + value = m.call(observer, value); + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } + }); + + var $Observable = function Observable(subscriber){ + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); + }; + + redefineAll($Observable.prototype, { + subscribe: function subscribe(observer){ + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn){ + var that = this; + return new (core.Promise || global.Promise)(function(resolve, reject){ + aFunction(fn); + var subscription = that.subscribe({ + next : function(value){ + try { + return fn(value); + } catch(e){ + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } + }); + + redefineAll($Observable, { + from: function from(x){ + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if(method){ + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function(observer){ + return observable.subscribe(observer); + }); + } + return new C(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + try { + if(forOf(x, false, function(it){ + observer.next(it); + if(done)return RETURN; + }) === RETURN)return; + } catch(e){ + if(done)throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + }, + of: function of(){ + for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + for(var i = 0; i < items.length; ++i){ + observer.next(items[i]); + if(done)return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + } + }); + + hide($Observable.prototype, OBSERVABLE, function(){ return this; }); + + $export($export.G, {Observable: $Observable}); + + __webpack_require__(182)('Observable'); + +/***/ }, +/* 271 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $task = __webpack_require__(187); + $export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear + }); + +/***/ }, +/* 272 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(179); + var global = __webpack_require__(2) + , hide = __webpack_require__(10) + , Iterators = __webpack_require__(130) + , TO_STRING_TAG = __webpack_require__(23)('toStringTag'); + + for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype; + if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; + } + +/***/ }, +/* 273 */ +/***/ function(module, exports, __webpack_require__) { + + // ie9- setTimeout & setInterval additional parameters fix + var global = __webpack_require__(2) + , $export = __webpack_require__(6) + , invoke = __webpack_require__(74) + , partial = __webpack_require__(274) + , navigator = global.navigator + , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check + var wrap = function(set){ + return MSIE ? function(fn, time /*, ...args */){ + return set(invoke( + partial, + [].slice.call(arguments, 2), + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; + }; + $export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) + }); + +/***/ }, +/* 274 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var path = __webpack_require__(275) + , invoke = __webpack_require__(74) + , aFunction = __webpack_require__(9); + module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , aLen = arguments.length + , j = 0, k = 0, args; + if(!holder && !aLen)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; + while(aLen > k)args.push(arguments[k++]); + return invoke(fn, args, that); + }; + }; + +/***/ }, +/* 275 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(7); + +/***/ }, +/* 276 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var ctx = __webpack_require__(8) + , $export = __webpack_require__(6) + , createDesc = __webpack_require__(17) + , assign = __webpack_require__(67) + , create = __webpack_require__(44) + , getPrototypeOf = __webpack_require__(57) + , getKeys = __webpack_require__(28) + , dP = __webpack_require__(11) + , keyOf = __webpack_require__(27) + , aFunction = __webpack_require__(9) + , forOf = __webpack_require__(185) + , isIterable = __webpack_require__(277) + , $iterCreate = __webpack_require__(131) + , step = __webpack_require__(180) + , isObject = __webpack_require__(13) + , toIObject = __webpack_require__(30) + , DESCRIPTORS = __webpack_require__(4) + , has = __webpack_require__(3); + + // 0 -> Dict.forEach + // 1 -> Dict.map + // 2 -> Dict.filter + // 3 -> Dict.some + // 4 -> Dict.every + // 5 -> Dict.find + // 6 -> Dict.findKey + // 7 -> Dict.mapPairs + var createDictMethod = function(TYPE){ + var IS_MAP = TYPE == 1 + , IS_EVERY = TYPE == 4; + return function(object, callbackfn, that /* = undefined */){ + var f = ctx(callbackfn, that, 3) + , O = toIObject(object) + , result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict) : undefined + , key, val, res; + for(key in O)if(has(O, key)){ + val = O[key]; + res = f(val, key, object); + if(TYPE){ + if(IS_MAP)result[key] = res; // map + else if(res)switch(TYPE){ + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if(IS_EVERY)return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; + }; + var findKey = createDictMethod(6); + + var createDictIter = function(kind){ + return function(it){ + return new DictIterator(it, kind); + }; + }; + var DictIterator = function(iterated, kind){ + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind + }; + $iterCreate(DictIterator, 'Dict', function(){ + var that = this + , O = that._t + , keys = that._a + , kind = that._k + , key; + do { + if(that._i >= keys.length){ + that._t = undefined; + return step(1); + } + } while(!has(O, key = keys[that._i++])); + if(kind == 'keys' )return step(0, key); + if(kind == 'values')return step(0, O[key]); + return step(0, [key, O[key]]); + }); + + function Dict(iterable){ + var dict = create(null); + if(iterable != undefined){ + if(isIterable(iterable)){ + forOf(iterable, true, function(key, value){ + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; + } + Dict.prototype = null; + + function reduce(object, mapfn, init){ + aFunction(mapfn); + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , memo, key; + if(arguments.length < 3){ + if(!length)throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while(length > i)if(has(O, key = keys[i++])){ + memo = mapfn(memo, O[key], key, object); + } + return memo; + } + + function includes(object, el){ + return (el == el ? keyOf(object, el) : findKey(object, function(it){ + return it != it; + })) !== undefined; + } + + function get(object, key){ + if(has(object, key))return object[key]; + } + function set(object, key, value){ + if(DESCRIPTORS && key in Object)dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; + } + + function isDict(it){ + return isObject(it) && getPrototypeOf(it) === Dict.prototype; + } + + $export($export.G + $export.F, {Dict: Dict}); + + $export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict + }); + +/***/ }, +/* 277 */ +/***/ function(module, exports, __webpack_require__) { + + var classof = __webpack_require__(152) + , ITERATOR = __webpack_require__(23)('iterator') + , Iterators = __webpack_require__(130); + module.exports = __webpack_require__(7).isIterable = function(it){ + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + || Iterators.hasOwnProperty(classof(O)); + }; + +/***/ }, +/* 278 */ +/***/ function(module, exports, __webpack_require__) { + + var anObject = __webpack_require__(12) + , get = __webpack_require__(151); + module.exports = __webpack_require__(7).getIterator = function(it){ + var iterFn = get(it); + if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); + }; + +/***/ }, +/* 279 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , $export = __webpack_require__(6) + , partial = __webpack_require__(274); + // https://esdiscuss.org/topic/promise-returning-delay-function + $export($export.G + $export.F, { + delay: function delay(time){ + return new (core.Promise || global.Promise)(function(resolve){ + setTimeout(partial.call(resolve, true), time); + }); + } + }); + +/***/ }, +/* 280 */ +/***/ function(module, exports, __webpack_require__) { + + var path = __webpack_require__(275) + , $export = __webpack_require__(6); + + // Placeholder + __webpack_require__(7)._ = path._ = path._ || {}; + + $export($export.P + $export.F, 'Function', {part: __webpack_require__(274)}); + +/***/ }, +/* 281 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + + $export($export.S + $export.F, 'Object', {isObject: __webpack_require__(13)}); + +/***/ }, +/* 282 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + + $export($export.S + $export.F, 'Object', {classof: __webpack_require__(152)}); + +/***/ }, +/* 283 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , define = __webpack_require__(284); + + $export($export.S + $export.F, 'Object', {define: define}); + +/***/ }, +/* 284 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(11) + , gOPD = __webpack_require__(49) + , ownKeys = __webpack_require__(208) + , toIObject = __webpack_require__(30); + + module.exports = function define(target, mixin){ + var keys = ownKeys(toIObject(mixin)) + , length = keys.length + , i = 0, key; + while(length > i)dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; + }; + +/***/ }, +/* 285 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , define = __webpack_require__(284) + , create = __webpack_require__(44); + + $export($export.S + $export.F, 'Object', { + make: function(proto, mixin){ + return define(create(proto), mixin); + } + }); + +/***/ }, +/* 286 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + __webpack_require__(129)(Number, 'Number', function(iterated){ + this._l = +iterated; + this._i = 0; + }, function(){ + var i = this._i++ + , done = !(i < this._l); + return {done: done, value: done ? undefined : i}; + }); + +/***/ }, +/* 287 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/benjamingr/RexExp.escape + var $export = __webpack_require__(6) + , $re = __webpack_require__(288)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + + $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); + + +/***/ }, +/* 288 */ +/***/ function(module, exports) { + + module.exports = function(regExp, replace){ + var replacer = replace === Object(replace) ? function(part){ + return replace[part]; + } : replace; + return function(it){ + return String(it).replace(regExp, replacer); + }; + }; + +/***/ }, +/* 289 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6); + var $re = __webpack_require__(288)(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }); + + $export($export.P + $export.F, 'String', {escapeHTML: function escapeHTML(){ return $re(this); }}); + +/***/ }, +/* 290 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6); + var $re = __webpack_require__(288)(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }); + + $export($export.P + $export.F, 'String', {unescapeHTML: function unescapeHTML(){ return $re(this); }}); + +/***/ } +/******/ ]); +// CommonJS export +if(typeof module != 'undefined' && module.exports)module.exports = __e; +// RequireJS export +else if(typeof define == 'function' && define.amd)define(function(){return __e}); +// Export to global object +else __g.core = __e; +}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/library.min.js b/node_modules/core-js/client/library.min.js new file mode 100755 index 00000000..d69a0de9 --- /dev/null +++ b/node_modules/core-js/client/library.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.4.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(a,b,c){"use strict";!function(a){function __webpack_require__(c){if(b[c])return b[c].exports;var d=b[c]={exports:{},id:c,loaded:!1};return a[c].call(d.exports,d,d.exports,__webpack_require__),d.loaded=!0,d.exports}var b={};return __webpack_require__.m=a,__webpack_require__.c=b,__webpack_require__.p="",__webpack_require__(0)}([function(a,b,c){c(1),c(50),c(51),c(52),c(54),c(55),c(58),c(59),c(60),c(61),c(62),c(63),c(64),c(65),c(66),c(68),c(70),c(72),c(75),c(76),c(79),c(80),c(81),c(82),c(84),c(85),c(86),c(87),c(88),c(92),c(94),c(95),c(96),c(98),c(99),c(100),c(102),c(103),c(104),c(106),c(107),c(108),c(109),c(110),c(111),c(112),c(113),c(114),c(115),c(116),c(117),c(118),c(119),c(121),c(125),c(126),c(127),c(128),c(132),c(134),c(135),c(136),c(137),c(138),c(139),c(140),c(141),c(142),c(143),c(144),c(145),c(146),c(147),c(154),c(155),c(157),c(158),c(159),c(163),c(164),c(165),c(166),c(167),c(169),c(170),c(171),c(172),c(175),c(177),c(178),c(179),c(181),c(183),c(190),c(193),c(194),c(196),c(197),c(198),c(199),c(200),c(201),c(202),c(203),c(204),c(205),c(206),c(207),c(209),c(210),c(211),c(212),c(213),c(214),c(215),c(218),c(219),c(221),c(222),c(223),c(224),c(225),c(226),c(227),c(228),c(229),c(230),c(231),c(233),c(234),c(235),c(236),c(238),c(239),c(240),c(241),c(243),c(244),c(246),c(247),c(248),c(249),c(252),c(253),c(254),c(255),c(256),c(257),c(258),c(259),c(261),c(262),c(263),c(264),c(265),c(266),c(267),c(268),c(269),c(270),c(271),c(272),c(273),c(276),c(151),c(278),c(277),c(279),c(280),c(281),c(282),c(283),c(285),c(286),c(287),c(289),a.exports=c(290)},function(a,b,d){var e=d(2),f=d(3),g=d(4),h=d(6),i=d(18),j=d(19).KEY,k=d(5),l=d(21),m=d(22),n=d(20),o=d(23),p=d(24),q=d(25),r=d(27),s=d(40),t=d(43),u=d(12),v=d(30),w=d(16),x=d(17),y=d(44),z=d(47),A=d(49),B=d(11),C=d(28),D=A.f,E=B.f,F=z.f,G=e.Symbol,H=e.JSON,I=H&&H.stringify,J="prototype",K=o("_hidden"),L=o("toPrimitive"),M={}.propertyIsEnumerable,N=l("symbol-registry"),O=l("symbols"),P=l("op-symbols"),Q=Object[J],R="function"==typeof G,S=e.QObject,T=!S||!S[J]||!S[J].findChild,U=g&&k(function(){return 7!=y(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=D(Q,b);d&&delete Q[b],E(a,b,c),d&&a!==Q&&E(Q,b,d)}:E,V=function(a){var b=O[a]=y(G[J]);return b._k=a,b},W=R&&"symbol"==typeof G.iterator?function(a){return"symbol"==typeof a}:function(a){return a instanceof G},X=function defineProperty(a,b,c){return a===Q&&X(P,b,c),u(a),b=w(b,!0),u(c),f(O,b)?(c.enumerable?(f(a,K)&&a[K][b]&&(a[K][b]=!1),c=y(c,{enumerable:x(0,!1)})):(f(a,K)||E(a,K,x(1,{})),a[K][b]=!0),U(a,b,c)):E(a,b,c)},Y=function defineProperties(a,b){u(a);for(var c,d=s(b=v(b)),e=0,f=d.length;f>e;)X(a,c=d[e++],b[c]);return a},Z=function create(a,b){return b===c?y(a):Y(y(a),b)},$=function propertyIsEnumerable(a){var b=M.call(this,a=w(a,!0));return!(this===Q&&f(O,a)&&!f(P,a))&&(!(b||!f(this,a)||!f(O,a)||f(this,K)&&this[K][a])||b)},_=function getOwnPropertyDescriptor(a,b){if(a=v(a),b=w(b,!0),a!==Q||!f(O,b)||f(P,b)){var c=D(a,b);return!c||!f(O,b)||f(a,K)&&a[K][b]||(c.enumerable=!0),c}},aa=function getOwnPropertyNames(a){for(var b,c=F(v(a)),d=[],e=0;c.length>e;)f(O,b=c[e++])||b==K||b==j||d.push(b);return d},ba=function getOwnPropertySymbols(a){for(var b,c=a===Q,d=F(c?P:v(a)),e=[],g=0;d.length>g;)!f(O,b=d[g++])||c&&!f(Q,b)||e.push(O[b]);return e};R||(G=function Symbol(){if(this instanceof G)throw TypeError("Symbol is not a constructor!");var a=n(arguments.length>0?arguments[0]:c),b=function(c){this===Q&&b.call(P,c),f(this,K)&&f(this[K],a)&&(this[K][a]=!1),U(this,a,x(1,c))};return g&&T&&U(Q,a,{configurable:!0,set:b}),V(a)},i(G[J],"toString",function toString(){return this._k}),A.f=_,B.f=X,d(48).f=z.f=aa,d(42).f=$,d(41).f=ba,g&&!d(26)&&i(Q,"propertyIsEnumerable",$,!0),p.f=function(a){return V(o(a))}),h(h.G+h.W+h.F*!R,{Symbol:G});for(var ca="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),da=0;ca.length>da;)o(ca[da++]);for(var ca=C(o.store),da=0;ca.length>da;)q(ca[da++]);h(h.S+h.F*!R,"Symbol",{"for":function(a){return f(N,a+="")?N[a]:N[a]=G(a)},keyFor:function keyFor(a){if(W(a))return r(N,a);throw TypeError(a+" is not a symbol!")},useSetter:function(){T=!0},useSimple:function(){T=!1}}),h(h.S+h.F*!R,"Object",{create:Z,defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:_,getOwnPropertyNames:aa,getOwnPropertySymbols:ba}),H&&h(h.S+h.F*(!R||k(function(){var a=G();return"[null]"!=I([a])||"{}"!=I({a:a})||"{}"!=I(Object(a))})),"JSON",{stringify:function stringify(a){if(a!==c&&!W(a)){for(var b,d,e=[a],f=1;arguments.length>f;)e.push(arguments[f++]);return b=e[1],"function"==typeof b&&(d=b),!d&&t(b)||(b=function(a,b){if(d&&(b=d.call(this,a,b)),!W(b))return b}),e[1]=b,I.apply(H,e)}}}),G[J][L]||d(10)(G[J],L,G[J].valueOf),m(G,"Symbol"),m(Math,"Math",!0),m(e.JSON,"JSON",!0)},function(a,c){var d=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof b&&(b=d)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){a.exports=!c(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,d){var e=d(2),f=d(7),g=d(8),h=d(10),i="prototype",j=function(a,b,d){var k,l,m,n=a&j.F,o=a&j.G,p=a&j.S,q=a&j.P,r=a&j.B,s=a&j.W,t=o?f:f[b]||(f[b]={}),u=t[i],v=o?e:p?e[b]:(e[b]||{})[i];o&&(d=b);for(k in d)l=!n&&v&&v[k]!==c,l&&k in t||(m=l?v[k]:d[k],t[k]=o&&"function"!=typeof v[k]?d[k]:r&&l?g(m,e):s&&v[k]==m?function(a){var b=function(b,c,d){if(this instanceof a){switch(arguments.length){case 0:return new a;case 1:return new a(b);case 2:return new a(b,c)}return new a(b,c,d)}return a.apply(this,arguments)};return b[i]=a[i],b}(m):q&&"function"==typeof m?g(Function.call,m):m,q&&((t.virtual||(t.virtual={}))[k]=m,a&j.R&&u&&!u[k]&&h(u,k,m)))};j.F=1,j.G=2,j.S=4,j.P=8,j.B=16,j.W=32,j.U=64,j.R=128,a.exports=j},function(b,c){var d=b.exports={version:"2.4.0"};"number"==typeof a&&(a=d)},function(a,b,d){var e=d(9);a.exports=function(a,b,d){if(e(a),b===c)return a;switch(d){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){var d=c(11),e=c(17);a.exports=c(4)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b,c){var d=c(12),e=c(14),f=c(16),g=Object.defineProperty;b.f=c(4)?Object.defineProperty:function defineProperty(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(h){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},function(a,b,c){var d=c(13);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){a.exports=!c(4)&&!c(5)(function(){return 7!=Object.defineProperty(c(15)("div"),"a",{get:function(){return 7}}).a})},function(a,b,c){var d=c(13),e=c(2).document,f=d(e)&&d(e.createElement);a.exports=function(a){return f?e.createElement(a):{}}},function(a,b,c){var d=c(13);a.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){a.exports=c(10)},function(a,b,c){var d=c(20)("meta"),e=c(13),f=c(3),g=c(11).f,h=0,i=Object.isExtensible||function(){return!0},j=!c(5)(function(){return i(Object.preventExtensions({}))}),k=function(a){g(a,d,{value:{i:"O"+ ++h,w:{}}})},l=function(a,b){if(!e(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!f(a,d)){if(!i(a))return"F";if(!b)return"E";k(a)}return a[d].i},m=function(a,b){if(!f(a,d)){if(!i(a))return!0;if(!b)return!1;k(a)}return a[d].w},n=function(a){return j&&o.NEED&&i(a)&&!f(a,d)&&k(a),a},o=a.exports={KEY:d,NEED:!1,fastKey:l,getWeak:m,onFreeze:n}},function(a,b){var d=0,e=Math.random();a.exports=function(a){return"Symbol(".concat(a===c?"":a,")_",(++d+e).toString(36))}},function(a,b,c){var d=c(2),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d=c(11).f,e=c(3),f=c(23)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(21)("wks"),e=c(20),f=c(2).Symbol,g="function"==typeof f,h=a.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))};h.store=d},function(a,b,c){b.f=c(23)},function(a,b,c){var d=c(2),e=c(7),f=c(26),g=c(24),h=c(11).f;a.exports=function(a){var b=e.Symbol||(e.Symbol=f?{}:d.Symbol||{});"_"==a.charAt(0)||a in b||h(b,a,{value:g.f(a)})}},function(a,b){a.exports=!0},function(a,b,c){var d=c(28),e=c(30);a.exports=function(a,b){for(var c,f=e(a),g=d(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},function(a,b,c){var d=c(29),e=c(39);a.exports=Object.keys||function keys(a){return d(a,e)}},function(a,b,c){var d=c(3),e=c(30),f=c(34)(!1),g=c(38)("IE_PROTO");a.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},function(a,b,c){var d=c(31),e=c(33);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(32);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(a==c)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(30),e=c(35),f=c(37);a.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if(h=i[k++],h!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},function(a,b,c){var d=c(36),e=Math.min;a.exports=function(a){return a>0?e(d(a),9007199254740991):0}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){var d=c(36),e=Math.max,f=Math.min;a.exports=function(a,b){return a=d(a),a<0?e(a+b,0):f(a,b)}},function(a,b,c){var d=c(21)("keys"),e=c(20);a.exports=function(a){return d[a]||(d[a]=e(a))}},function(a,b){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,b,c){var d=c(28),e=c(41),f=c(42);a.exports=function(a){var b=d(a),c=e.f;if(c)for(var g,h=c(a),i=f.f,j=0;h.length>j;)i.call(a,g=h[j++])&&b.push(g);return b}},function(a,b){b.f=Object.getOwnPropertySymbols},function(a,b){b.f={}.propertyIsEnumerable},function(a,b,c){var d=c(32);a.exports=Array.isArray||function isArray(a){return"Array"==d(a)}},function(a,b,d){var e=d(12),f=d(45),g=d(39),h=d(38)("IE_PROTO"),i=function(){},j="prototype",k=function(){var a,b=d(15)("iframe"),c=g.length,e="<",f=">";for(b.style.display="none",d(46).appendChild(b),b.src="javascript:",a=b.contentWindow.document,a.open(),a.write(e+"script"+f+"document.F=Object"+e+"/script"+f),a.close(),k=a.F;c--;)delete k[j][g[c]];return k()};a.exports=Object.create||function create(a,b){var d;return null!==a?(i[j]=e(a),d=new i,i[j]=null,d[h]=a):d=k(),b===c?d:f(d,b)}},function(a,b,c){var d=c(11),e=c(12),f=c(28);a.exports=c(4)?Object.defineProperties:function defineProperties(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},function(a,b,c){a.exports=c(2).document&&document.documentElement},function(a,b,c){var d=c(30),e=c(48).f,f={}.toString,g="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(b){return g.slice()}};a.exports.f=function getOwnPropertyNames(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},function(a,b,c){var d=c(29),e=c(39).concat("length","prototype");b.f=Object.getOwnPropertyNames||function getOwnPropertyNames(a){return d(a,e)}},function(a,b,c){var d=c(42),e=c(17),f=c(30),g=c(16),h=c(3),i=c(14),j=Object.getOwnPropertyDescriptor;b.f=c(4)?j:function getOwnPropertyDescriptor(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(c){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperty:c(11).f})},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperties:c(45)})},function(a,b,c){var d=c(30),e=c(49).f;c(53)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(a,b){return e(d(a),b)}})},function(a,b,c){var d=c(6),e=c(7),f=c(5);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(6);d(d.S,"Object",{create:c(44)})},function(a,b,c){var d=c(56),e=c(57);c(53)("getPrototypeOf",function(){return function getPrototypeOf(a){return e(d(a))}})},function(a,b,c){var d=c(33);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(3),e=c(56),f=c(38)("IE_PROTO"),g=Object.prototype;a.exports=Object.getPrototypeOf||function(a){return a=e(a),d(a,f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},function(a,b,c){var d=c(56),e=c(28);c(53)("keys",function(){return function keys(a){return e(d(a))}})},function(a,b,c){c(53)("getOwnPropertyNames",function(){return c(47).f})},function(a,b,c){var d=c(13),e=c(19).onFreeze;c(53)("freeze",function(a){return function freeze(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(13),e=c(19).onFreeze;c(53)("seal",function(a){return function seal(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(13),e=c(19).onFreeze;c(53)("preventExtensions",function(a){return function preventExtensions(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(13);c(53)("isFrozen",function(a){return function isFrozen(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(13);c(53)("isSealed",function(a){return function isSealed(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(13);c(53)("isExtensible",function(a){return function isExtensible(b){return!!d(b)&&(!a||a(b))}})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{assign:c(67)})},function(a,b,c){var d=c(28),e=c(41),f=c(42),g=c(56),h=c(31),i=Object.assign;a.exports=!i||c(5)(function(){var a={},b={},c=Symbol(),d="abcdefghijklmnopqrst";return a[c]=7,d.split("").forEach(function(a){b[a]=a}),7!=i({},a)[c]||Object.keys(i({},b)).join("")!=d})?function assign(a,b){for(var c=g(a),i=arguments.length,j=1,k=e.f,l=f.f;i>j;)for(var m,n=h(arguments[j++]),o=k?d(n).concat(k(n)):d(n),p=o.length,q=0;p>q;)l.call(n,m=o[q++])&&(c[m]=n[m]);return c}:i},function(a,b,c){var d=c(6);d(d.S,"Object",{is:c(69)})},function(a,b){a.exports=Object.is||function is(a,b){return a===b?0!==a||1/a===1/b:a!=a&&b!=b}},function(a,b,c){var d=c(6);d(d.S,"Object",{setPrototypeOf:c(71).set})},function(a,b,d){var e=d(13),f=d(12),g=function(a,b){if(f(a),!e(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};a.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(a,b,c){try{c=d(8)(Function.call,d(49).f(Object.prototype,"__proto__").set,2),c(a,[]),b=!(a instanceof Array)}catch(e){b=!0}return function setPrototypeOf(a,d){return g(a,d),b?a.__proto__=d:c(a,d),a}}({},!1):c),check:g}},function(a,b,c){var d=c(6);d(d.P,"Function",{bind:c(73)})},function(a,b,c){var d=c(9),e=c(13),f=c(74),g=[].slice,h={},i=function(a,b,c){if(!(b in h)){for(var d=[],e=0;e=0;)c+=j[b],j[b]=i(c/a),c=c%a*1e7},o=function(){for(var a=6,b="";--a>=0;)if(""!==b||0===a||0!==j[a]){var c=String(j[a]);b=""===b?c:b+g.call(l,7-c.length)+c}return b},p=function(a,b,c){return 0===b?c:b%2===1?p(a,b-1,c*a):p(a*a,b/2,c)},q=function(a){for(var b=0,c=a;c>=4096;)b+=12,c/=4096;for(;c>=2;)b+=1,c/=2;return b};d(d.P+d.F*(!!h&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!c(5)(function(){h.call({})})),"Number",{toFixed:function toFixed(a){var b,c,d,h,i=f(this,k),j=e(a),r="",s=l;if(j<0||j>20)throw RangeError(k);if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return String(i);if(i<0&&(r="-",i=-i),i>1e-21)if(b=q(i*p(2,69,1))-69,c=b<0?i*p(2,-b,1):i/p(2,b,1),c*=4503599627370496,b=52-b,b>0){for(m(0,c),d=j;d>=7;)m(1e7,0),d-=7;for(m(p(10,d,1),0),d=b-1;d>=23;)n(1<<23),d-=23;n(1<0?(h=s.length,s=r+(h<=j?"0."+g.call(l,j-h)+s:s.slice(0,h-j)+"."+s.slice(h-j))):s=r+s,s}})},function(a,b,c){var d=c(32);a.exports=function(a,b){if("number"!=typeof a&&"Number"!=d(a))throw TypeError(b);return+a}},function(a,b,c){var d=c(36),e=c(33);a.exports=function repeat(a){var b=String(e(this)),c="",f=d(a);if(f<0||f==1/0)throw RangeError("Count can't be negative");for(;f>0;(f>>>=1)&&(b+=b))1&f&&(c+=b);return c}},function(a,b,d){var e=d(6),f=d(5),g=d(77),h=1..toPrecision;e(e.P+e.F*(f(function(){return"1"!==h.call(1,c)})||!f(function(){h.call({})})),"Number",{toPrecision:function toPrecision(a){var b=g(this,"Number#toPrecision: incorrect invocation!");return a===c?h.call(b):h.call(b,a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{EPSILON:Math.pow(2,-52)})},function(a,b,c){var d=c(6),e=c(2).isFinite;d(d.S,"Number",{isFinite:function isFinite(a){return"number"==typeof a&&e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{isInteger:c(83)})},function(a,b,c){var d=c(13),e=Math.floor;a.exports=function isInteger(a){return!d(a)&&isFinite(a)&&e(a)===a}},function(a,b,c){var d=c(6);d(d.S,"Number",{isNaN:function isNaN(a){return a!=a}})},function(a,b,c){var d=c(6),e=c(83),f=Math.abs;d(d.S,"Number",{isSafeInteger:function isSafeInteger(a){return e(a)&&f(a)<=9007199254740991}})},function(a,b,c){var d=c(6);d(d.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(a,b,c){var d=c(6);d(d.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(a,b,c){var d=c(6),e=c(89);d(d.S+d.F*(Number.parseFloat!=e),"Number",{parseFloat:e})},function(a,b,c){var d=c(2).parseFloat,e=c(90).trim;a.exports=1/d(c(91)+"-0")!==-(1/0)?function parseFloat(a){var b=e(String(a),3),c=d(b);return 0===c&&"-"==b.charAt(0)?-0:c}:d},function(a,b,c){var d=c(6),e=c(33),f=c(5),g=c(91),h="["+g+"]",i="​…",j=RegExp("^"+h+h+"*"),k=RegExp(h+h+"*$"),l=function(a,b,c){var e={},h=f(function(){return!!g[a]()||i[a]()!=i}),j=e[a]=h?b(m):g[a];c&&(e[c]=j),d(d.P+d.F*h,"String",e)},m=l.trim=function(a,b){return a=String(e(a)),1&b&&(a=a.replace(j,"")),2&b&&(a=a.replace(k,"")),a};a.exports=l},function(a,b){a.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},function(a,b,c){var d=c(6),e=c(93);d(d.S+d.F*(Number.parseInt!=e),"Number",{parseInt:e})},function(a,b,c){var d=c(2).parseInt,e=c(90).trim,f=c(91),g=/^[\-+]?0[xX]/;a.exports=8!==d(f+"08")||22!==d(f+"0x16")?function parseInt(a,b){var c=e(String(a),3);return d(c,b>>>0||(g.test(c)?16:10))}:d},function(a,b,c){var d=c(6),e=c(93);d(d.G+d.F*(parseInt!=e),{parseInt:e})},function(a,b,c){var d=c(6),e=c(89);d(d.G+d.F*(parseFloat!=e),{parseFloat:e})},function(a,b,c){var d=c(6),e=c(97),f=Math.sqrt,g=Math.acosh;d(d.S+d.F*!(g&&710==Math.floor(g(Number.MAX_VALUE))&&g(1/0)==1/0),"Math",{acosh:function acosh(a){return(a=+a)<1?NaN:a>94906265.62425156?Math.log(a)+Math.LN2:e(a-1+f(a-1)*f(a+1))}})},function(a,b){a.exports=Math.log1p||function log1p(a){return(a=+a)>-1e-8&&a<1e-8?a-a*a/2:Math.log(1+a)}},function(a,b,c){function asinh(a){return isFinite(a=+a)&&0!=a?a<0?-asinh(-a):Math.log(a+Math.sqrt(a*a+1)):a}var d=c(6),e=Math.asinh;d(d.S+d.F*!(e&&1/e(0)>0),"Math",{asinh:asinh})},function(a,b,c){var d=c(6),e=Math.atanh;d(d.S+d.F*!(e&&1/e(-0)<0),"Math",{atanh:function atanh(a){return 0==(a=+a)?a:Math.log((1+a)/(1-a))/2}})},function(a,b,c){var d=c(6),e=c(101);d(d.S,"Math",{cbrt:function cbrt(a){return e(a=+a)*Math.pow(Math.abs(a),1/3)}})},function(a,b){a.exports=Math.sign||function sign(a){return 0==(a=+a)||a!=a?a:a<0?-1:1}},function(a,b,c){var d=c(6);d(d.S,"Math",{clz32:function clz32(a){return(a>>>=0)?31-Math.floor(Math.log(a+.5)*Math.LOG2E):32}})},function(a,b,c){var d=c(6),e=Math.exp;d(d.S,"Math",{cosh:function cosh(a){return(e(a=+a)+e(-a))/2}})},function(a,b,c){var d=c(6),e=c(105);d(d.S+d.F*(e!=Math.expm1),"Math",{expm1:e})},function(a,b){var c=Math.expm1;a.exports=!c||c(10)>22025.465794806718||c(10)<22025.465794806718||c(-2e-17)!=-2e-17?function expm1(a){return 0==(a=+a)?a:a>-1e-6&&a<1e-6?a+a*a/2:Math.exp(a)-1}:c},function(a,b,c){var d=c(6),e=c(101),f=Math.pow,g=f(2,-52),h=f(2,-23),i=f(2,127)*(2-h),j=f(2,-126),k=function(a){return a+1/g-1/g};d(d.S,"Math",{fround:function fround(a){var b,c,d=Math.abs(a),f=e(a);return di||c!=c?f*(1/0):f*c)}})},function(a,b,c){var d=c(6),e=Math.abs;d(d.S,"Math",{hypot:function hypot(a,b){for(var c,d,f=0,g=0,h=arguments.length,i=0;g0?(d=c/i,f+=d*d):f+=c;return i===1/0?1/0:i*Math.sqrt(f)}})},function(a,b,c){var d=c(6),e=Math.imul;d(d.S+d.F*c(5)(function(){return e(4294967295,5)!=-5||2!=e.length}),"Math",{imul:function imul(a,b){var c=65535,d=+a,e=+b,f=c&d,g=c&e;return 0|f*g+((c&d>>>16)*g+f*(c&e>>>16)<<16>>>0)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log10:function log10(a){return Math.log(a)/Math.LN10}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log1p:c(97)})},function(a,b,c){var d=c(6);d(d.S,"Math",{log2:function log2(a){return Math.log(a)/Math.LN2}})},function(a,b,c){var d=c(6);d(d.S,"Math",{sign:c(101)})},function(a,b,c){var d=c(6),e=c(105),f=Math.exp;d(d.S+d.F*c(5)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function sinh(a){return Math.abs(a=+a)<1?(e(a)-e(-a))/2:(f(a-1)-f(-a-1))*(Math.E/2)}})},function(a,b,c){var d=c(6),e=c(105),f=Math.exp;d(d.S,"Math",{tanh:function tanh(a){var b=e(a=+a),c=e(-a);return b==1/0?1:c==1/0?-1:(b-c)/(f(a)+f(-a))}})},function(a,b,c){var d=c(6);d(d.S,"Math",{trunc:function trunc(a){return(a>0?Math.floor:Math.ceil)(a)}})},function(a,b,c){var d=c(6),e=c(37),f=String.fromCharCode,g=String.fromCodePoint;d(d.S+d.F*(!!g&&1!=g.length),"String",{fromCodePoint:function fromCodePoint(a){for(var b,c=[],d=arguments.length,g=0;d>g;){if(b=+arguments[g++],e(b,1114111)!==b)throw RangeError(b+" is not a valid code point");c.push(b<65536?f(b):f(((b-=65536)>>10)+55296,b%1024+56320))}return c.join("")}})},function(a,b,c){var d=c(6),e=c(30),f=c(35);d(d.S,"String",{raw:function raw(a){for(var b=e(a.raw),c=f(b.length),d=arguments.length,g=[],h=0;c>h;)g.push(String(b[h++])),h=k?a?"":c:(g=i.charCodeAt(j),g<55296||g>56319||j+1===k||(h=i.charCodeAt(j+1))<56320||h>57343?a?i.charAt(j):g:a?i.slice(j,j+2):(g-55296<<10)+(h-56320)+65536)}}},function(a,b,d){var e=d(6),f=d(35),g=d(122),h="endsWith",i=""[h];e(e.P+e.F*d(124)(h),"String",{endsWith:function endsWith(a){var b=g(this,a,h),d=arguments.length>1?arguments[1]:c,e=f(b.length),j=d===c?e:Math.min(f(d),e),k=String(a);return i?i.call(b,k,j):b.slice(j-k.length,j)===k}})},function(a,b,c){var d=c(123),e=c(33);a.exports=function(a,b,c){if(d(b))throw TypeError("String#"+c+" doesn't accept regex!");return String(e(a))}},function(a,b,d){var e=d(13),f=d(32),g=d(23)("match");a.exports=function(a){var b;return e(a)&&((b=a[g])!==c?!!b:"RegExp"==f(a))}},function(a,b,c){var d=c(23)("match");a.exports=function(a){var b=/./;try{"/./"[a](b)}catch(c){try{return b[d]=!1,!"/./"[a](b)}catch(e){}}return!0}},function(a,b,d){var e=d(6),f=d(122),g="includes";e(e.P+e.F*d(124)(g),"String",{includes:function includes(a){return!!~f(this,a,g).indexOf(a,arguments.length>1?arguments[1]:c)}})},function(a,b,c){var d=c(6);d(d.P,"String",{repeat:c(78)})},function(a,b,d){var e=d(6),f=d(35),g=d(122),h="startsWith",i=""[h];e(e.P+e.F*d(124)(h),"String",{startsWith:function startsWith(a){var b=g(this,a,h),d=f(Math.min(arguments.length>1?arguments[1]:c,b.length)),e=String(a);return i?i.call(b,e,d):b.slice(d,d+e.length)===e}})},function(a,b,d){var e=d(120)(!0);d(129)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,d=this._i;return d>=b.length?{value:c,done:!0}:(a=e(b,d),this._i+=a.length,{value:a,done:!1})})},function(a,b,d){var e=d(26),f=d(6),g=d(18),h=d(10),i=d(3),j=d(130),k=d(131),l=d(22),m=d(57),n=d(23)("iterator"),o=!([].keys&&"next"in[].keys()),p="@@iterator",q="keys",r="values",s=function(){return this};a.exports=function(a,b,d,t,u,v,w){k(d,b,t);var x,y,z,A=function(a){if(!o&&a in E)return E[a];switch(a){case q:return function keys(){return new d(this,a)};case r:return function values(){return new d(this,a)}}return function entries(){return new d(this,a)}},B=b+" Iterator",C=u==r,D=!1,E=a.prototype,F=E[n]||E[p]||u&&E[u],G=F||A(u),H=u?C?A("entries"):G:c,I="Array"==b?E.entries||F:F;if(I&&(z=m(I.call(new a)),z!==Object.prototype&&(l(z,B,!0),e||i(z,n)||h(z,n,s))),C&&F&&F.name!==r&&(D=!0,G=function values(){return F.call(this)}),e&&!w||!o&&!D&&E[n]||h(E,n,G),j[b]=G,j[B]=s,u)if(x={values:C?G:A(r),keys:v?G:A(q),entries:H},w)for(y in x)y in E||g(E,y,x[y]);else f(f.P+f.F*(o||D),b,x);return x}},function(a,b){a.exports={}},function(a,b,c){var d=c(44),e=c(17),f=c(22),g={};c(10)(g,c(23)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){c(133)("anchor",function(a){return function anchor(b){return a(this,"a","name",b)}})},function(a,b,c){var d=c(6),e=c(5),f=c(33),g=/"/g,h=function(a,b,c,d){var e=String(f(a)),h="<"+b;return""!==c&&(h+=" "+c+'="'+String(d).replace(g,""")+'"'),h+">"+e+""};a.exports=function(a,b){var c={};c[a]=b(h),d(d.P+d.F*e(function(){var b=""[a]('"');return b!==b.toLowerCase()||b.split('"').length>3}),"String",c)}},function(a,b,c){c(133)("big",function(a){return function big(){return a(this,"big","","")}})},function(a,b,c){c(133)("blink",function(a){return function blink(){return a(this,"blink","","")}})},function(a,b,c){c(133)("bold",function(a){return function bold(){return a(this,"b","","")}})},function(a,b,c){c(133)("fixed",function(a){return function fixed(){return a(this,"tt","","")}})},function(a,b,c){c(133)("fontcolor",function(a){return function fontcolor(b){return a(this,"font","color",b)}})},function(a,b,c){c(133)("fontsize",function(a){return function fontsize(b){return a(this,"font","size",b)}})},function(a,b,c){c(133)("italics",function(a){return function italics(){return a(this,"i","","")}})},function(a,b,c){c(133)("link",function(a){return function link(b){return a(this,"a","href",b)}})},function(a,b,c){c(133)("small",function(a){return function small(){return a(this,"small","","")}})},function(a,b,c){c(133)("strike",function(a){return function strike(){return a(this,"strike","","")}})},function(a,b,c){c(133)("sub",function(a){return function sub(){return a(this,"sub","","")}})},function(a,b,c){c(133)("sup",function(a){return function sup(){return a(this,"sup","","")}})},function(a,b,c){var d=c(6);d(d.S,"Array",{isArray:c(43)})},function(a,b,d){var e=d(8),f=d(6),g=d(56),h=d(148),i=d(149),j=d(35),k=d(150),l=d(151);f(f.S+f.F*!d(153)(function(a){Array.from(a)}),"Array",{from:function from(a){var b,d,f,m,n=g(a),o="function"==typeof this?this:Array,p=arguments.length,q=p>1?arguments[1]:c,r=q!==c,s=0,t=l(n);if(r&&(q=e(q,p>2?arguments[2]:c,2)),t==c||o==Array&&i(t))for(b=j(n.length),d=new o(b);b>s;s++)k(d,s,r?q(n[s],s):n[s]);else for(m=t.call(n),d=new o;!(f=m.next()).done;s++)k(d,s,r?h(m,q,[f.value,s],!0):f.value);return d.length=s,d}})},function(a,b,d){var e=d(12);a.exports=function(a,b,d,f){try{return f?b(e(d)[0],d[1]):b(d)}catch(g){var h=a["return"];throw h!==c&&e(h.call(a)),g}}},function(a,b,d){var e=d(130),f=d(23)("iterator"),g=Array.prototype;a.exports=function(a){return a!==c&&(e.Array===a||g[f]===a)}},function(a,b,c){var d=c(11),e=c(17);a.exports=function(a,b,c){b in a?d.f(a,b,e(0,c)):a[b]=c}},function(a,b,d){var e=d(152),f=d(23)("iterator"),g=d(130);a.exports=d(7).getIteratorMethod=function(a){if(a!=c)return a[f]||a["@@iterator"]||g[e(a)]}},function(a,b,d){var e=d(32),f=d(23)("toStringTag"),g="Arguments"==e(function(){return arguments}()),h=function(a,b){try{return a[b]}catch(c){}};a.exports=function(a){var b,d,i;return a===c?"Undefined":null===a?"Null":"string"==typeof(d=h(b=Object(a),f))?d:g?e(b):"Object"==(i=e(b))&&"function"==typeof b.callee?"Arguments":i}},function(a,b,c){var d=c(23)("iterator"),e=!1;try{var f=[7][d]();f["return"]=function(){e=!0},Array.from(f,function(){throw 2})}catch(g){}a.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(h){}return c}},function(a,b,c){var d=c(6),e=c(150);d(d.S+d.F*c(5)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var a=0,b=arguments.length,c=new("function"==typeof this?this:Array)(b);b>a;)e(c,a,arguments[a++]);return c.length=b,c}})},function(a,b,d){var e=d(6),f=d(30),g=[].join;e(e.P+e.F*(d(31)!=Object||!d(156)(g)),"Array",{join:function join(a){return g.call(f(this),a===c?",":a)}})},function(a,b,c){var d=c(5);a.exports=function(a,b){return!!a&&d(function(){b?a.call(null,function(){},1):a.call(null)})}},function(a,b,d){var e=d(6),f=d(46),g=d(32),h=d(37),i=d(35),j=[].slice;e(e.P+e.F*d(5)(function(){f&&j.call(f)}),"Array",{slice:function slice(a,b){var d=i(this.length),e=g(this);if(b=b===c?d:b,"Array"==e)return j.call(this,a,b);for(var f=h(a,d),k=h(b,d),l=i(k-f),m=Array(l),n=0;nw;w++)if((n||w in t)&&(q=t[w],r=u(q,w,s),a))if(d)x[w]=r;else if(r)switch(a){case 3:return!0;case 5: +return q;case 6:return w;case 2:x.push(q)}else if(l)return!1;return m?-1:k||l?l:x}}},function(a,b,c){var d=c(162);a.exports=function(a,b){return new(d(a))(b)}},function(a,b,d){var e=d(13),f=d(43),g=d(23)("species");a.exports=function(a){var b;return f(a)&&(b=a.constructor,"function"!=typeof b||b!==Array&&!f(b.prototype)||(b=c),e(b)&&(b=b[g],null===b&&(b=c))),b===c?Array:b}},function(a,b,c){var d=c(6),e=c(160)(1);d(d.P+d.F*!c(156)([].map,!0),"Array",{map:function map(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(160)(2);d(d.P+d.F*!c(156)([].filter,!0),"Array",{filter:function filter(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(160)(3);d(d.P+d.F*!c(156)([].some,!0),"Array",{some:function some(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(160)(4);d(d.P+d.F*!c(156)([].every,!0),"Array",{every:function every(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(168);d(d.P+d.F*!c(156)([].reduce,!0),"Array",{reduce:function reduce(a){return e(this,a,arguments.length,arguments[1],!1)}})},function(a,b,c){var d=c(9),e=c(56),f=c(31),g=c(35);a.exports=function(a,b,c,h,i){d(b);var j=e(a),k=f(j),l=g(j.length),m=i?l-1:0,n=i?-1:1;if(c<2)for(;;){if(m in k){h=k[m],m+=n;break}if(m+=n,i?m<0:l<=m)throw TypeError("Reduce of empty array with no initial value")}for(;i?m>=0:l>m;m+=n)m in k&&(h=b(h,k[m],m,j));return h}},function(a,b,c){var d=c(6),e=c(168);d(d.P+d.F*!c(156)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(a){return e(this,a,arguments.length,arguments[1],!0)}})},function(a,b,c){var d=c(6),e=c(34)(!1),f=[].indexOf,g=!!f&&1/[1].indexOf(1,-0)<0;d(d.P+d.F*(g||!c(156)(f)),"Array",{indexOf:function indexOf(a){return g?f.apply(this,arguments)||0:e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(30),f=c(36),g=c(35),h=[].lastIndexOf,i=!!h&&1/[1].lastIndexOf(1,-0)<0;d(d.P+d.F*(i||!c(156)(h)),"Array",{lastIndexOf:function lastIndexOf(a){if(i)return h.apply(this,arguments)||0;var b=e(this),c=g(b.length),d=c-1;for(arguments.length>1&&(d=Math.min(d,f(arguments[1]))),d<0&&(d=c+d);d>=0;d--)if(d in b&&b[d]===a)return d||0;return-1}})},function(a,b,c){var d=c(6);d(d.P,"Array",{copyWithin:c(173)}),c(174)("copyWithin")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=[].copyWithin||function copyWithin(a,b){var d=e(this),h=g(d.length),i=f(a,h),j=f(b,h),k=arguments.length>2?arguments[2]:c,l=Math.min((k===c?h:f(k,h))-j,h-i),m=1;for(j0;)j in d?d[i]=d[j]:delete d[i],i+=m,j+=m;return d}},function(a,b){a.exports=function(){}},function(a,b,c){var d=c(6);d(d.P,"Array",{fill:c(176)}),c(174)("fill")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=function fill(a){for(var b=e(this),d=g(b.length),h=arguments.length,i=f(h>1?arguments[1]:c,d),j=h>2?arguments[2]:c,k=j===c?d:f(j,d);k>i;)b[i++]=a;return b}},function(a,b,d){var e=d(6),f=d(160)(5),g="find",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{find:function find(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(174)(g)},function(a,b,d){var e=d(6),f=d(160)(6),g="findIndex",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{findIndex:function findIndex(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(174)(g)},function(a,b,d){var e=d(174),f=d(180),g=d(130),h=d(30);a.exports=d(129)(Array,"Array",function(a,b){this._t=h(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,d=this._i++;return!a||d>=a.length?(this._t=c,f(1)):"keys"==b?f(0,d):"values"==b?f(0,a[d]):f(0,[d,a[d]])},"values"),g.Arguments=g.Array,e("keys"),e("values"),e("entries")},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){c(182)("Array")},function(a,b,c){var d=c(2),e=c(7),f=c(11),g=c(4),h=c(23)("species");a.exports=function(a){var b="function"==typeof e[a]?e[a]:d[a];g&&b&&!b[h]&&f.f(b,h,{configurable:!0,get:function(){return this}})}},function(a,b,d){var e,f,g,h=d(26),i=d(2),j=d(8),k=d(152),l=d(6),m=d(13),n=d(9),o=d(184),p=d(185),q=d(186),r=d(187).set,s=d(188)(),t="Promise",u=i.TypeError,v=i.process,w=i[t],v=i.process,x="process"==k(v),y=function(){},z=!!function(){try{var a=w.resolve(1),b=(a.constructor={})[d(23)("species")]=function(a){a(y,y)};return(x||"function"==typeof PromiseRejectionEvent)&&a.then(y)instanceof b}catch(c){}}(),A=function(a,b){return a===b||a===w&&b===g},B=function(a){var b;return!(!m(a)||"function"!=typeof(b=a.then))&&b},C=function(a){return A(w,a)?new D(a):new f(a)},D=f=function(a){var b,d;this.promise=new a(function(a,e){if(b!==c||d!==c)throw u("Bad Promise constructor");b=a,d=e}),this.resolve=n(b),this.reject=n(d)},E=function(a){try{a()}catch(b){return{error:b}}},F=function(a,b){if(!a._n){a._n=!0;var c=a._c;s(function(){for(var d=a._v,e=1==a._s,f=0,g=function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&I(a),a._h=1),g===!0?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(u("Promise-chain cycle")):(f=B(c))?f.call(c,h,i):h(c)):i(d)}catch(k){i(k)}};c.length>f;)g(c[f++]);a._c=[],a._n=!1,b&&!a._h&&G(a)})}},G=function(a){r.call(i,function(){var b,d,e,f=a._v;if(H(a)&&(b=E(function(){x?v.emit("unhandledRejection",f,a):(d=i.onunhandledrejection)?d({promise:a,reason:f}):(e=i.console)&&e.error&&e.error("Unhandled promise rejection",f)}),a._h=x||H(a)?2:1),a._a=c,b)throw b.error})},H=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if(b=c[d++],b.fail||!H(b.promise))return!1;return!0},I=function(a){r.call(i,function(){var b;x?v.emit("rejectionHandled",a):(b=i.onrejectionhandled)&&b({promise:a,reason:a._v})})},J=function(a){var b=this;b._d||(b._d=!0,b=b._w||b,b._v=a,b._s=2,b._a||(b._a=b._c.slice()),F(b,!0))},K=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw u("Promise can't be resolved itself");(b=B(a))?s(function(){var d={_w:c,_d:!1};try{b.call(a,j(K,d,1),j(J,d,1))}catch(e){J.call(d,e)}}):(c._v=a,c._s=1,F(c,!1))}catch(d){J.call({_w:c,_d:!1},d)}}};z||(w=function Promise(a){o(this,w,t,"_h"),n(a),e.call(this);try{a(j(K,this,1),j(J,this,1))}catch(b){J.call(this,b)}},e=function Promise(a){this._c=[],this._a=c,this._s=0,this._d=!1,this._v=c,this._h=0,this._n=!1},e.prototype=d(189)(w.prototype,{then:function then(a,b){var d=C(q(this,w));return d.ok="function"!=typeof a||a,d.fail="function"==typeof b&&b,d.domain=x?v.domain:c,this._c.push(d),this._a&&this._a.push(d),this._s&&F(this,!1),d.promise},"catch":function(a){return this.then(c,a)}}),D=function(){var a=new e;this.promise=a,this.resolve=j(K,a,1),this.reject=j(J,a,1)}),l(l.G+l.W+l.F*!z,{Promise:w}),d(22)(w,t),d(182)(t),g=d(7)[t],l(l.S+l.F*!z,t,{reject:function reject(a){var b=C(this),c=b.reject;return c(a),b.promise}}),l(l.S+l.F*(h||!z),t,{resolve:function resolve(a){if(a instanceof w&&A(a.constructor,this))return a;var b=C(this),c=b.resolve;return c(a),b.promise}}),l(l.S+l.F*!(z&&d(153)(function(a){w.all(a)["catch"](y)})),t,{all:function all(a){var b=this,d=C(b),e=d.resolve,f=d.reject,g=E(function(){var d=[],g=0,h=1;p(a,!1,function(a){var i=g++,j=!1;d.push(c),h++,b.resolve(a).then(function(a){j||(j=!0,d[i]=a,--h||e(d))},f)}),--h||e(d)});return g&&f(g.error),d.promise},race:function race(a){var b=this,c=C(b),d=c.reject,e=E(function(){p(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},function(a,b){a.exports=function(a,b,d,e){if(!(a instanceof b)||e!==c&&e in a)throw TypeError(d+": incorrect invocation!");return a}},function(a,b,c){var d=c(8),e=c(148),f=c(149),g=c(12),h=c(35),i=c(151),j={},k={},b=a.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if(q=b?s(g(o=a[t])[0],o[1]):s(a[t]),q===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if(q=e(p,s,o.value,b),q===j||q===k)return q};b.BREAK=j,b.RETURN=k},function(a,b,d){var e=d(12),f=d(9),g=d(23)("species");a.exports=function(a,b){var d,h=e(a).constructor;return h===c||(d=e(h)[g])==c?b:f(d)}},function(a,b,c){var d,e,f,g=c(8),h=c(74),i=c(46),j=c(15),k=c(2),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function setImmediate(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function clearImmediate(a){delete q[a]},"process"==c(32)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),a.exports={set:m,clear:n}},function(a,b,d){var e=d(2),f=d(187).set,g=e.MutationObserver||e.WebKitMutationObserver,h=e.process,i=e.Promise,j="process"==d(32)(h);a.exports=function(){var a,b,d,k=function(){var e,f;for(j&&(e=h.domain)&&e.exit();a;){f=a.fn,a=a.next;try{f()}catch(g){throw a?d():b=c,g}}b=c,e&&e.enter()};if(j)d=function(){h.nextTick(k)};else if(g){var l=!0,m=document.createTextNode("");new g(k).observe(m,{characterData:!0}),d=function(){m.data=l=!l}}else if(i&&i.resolve){var n=i.resolve();d=function(){n.then(k)}}else d=function(){f.call(e,k)};return function(e){var f={fn:e,next:c};b&&(b.next=f),a||(a=f,d()),b=f}}},function(a,b,c){var d=c(10);a.exports=function(a,b,c){for(var e in b)c&&a[e]?a[e]=b[e]:d(a,e,b[e]);return a}},function(a,b,d){var e=d(191);a.exports=d(192)("Map",function(a){return function Map(){return a(this,arguments.length>0?arguments[0]:c)}},{get:function get(a){var b=e.getEntry(this,a);return b&&b.v},set:function set(a,b){return e.def(this,0===a?0:a,b)}},e,!0)},function(a,b,d){var e=d(11).f,f=d(44),g=d(189),h=d(8),i=d(184),j=d(33),k=d(185),l=d(129),m=d(180),n=d(182),o=d(4),p=d(19).fastKey,q=o?"_s":"size",r=function(a,b){var c,d=p(b);if("F"!==d)return a._i[d];for(c=a._f;c;c=c.n)if(c.k==b)return c};a.exports={getConstructor:function(a,b,d,l){var m=a(function(a,e){i(a,m,b,"_i"),a._i=f(null),a._f=c,a._l=c,a[q]=0,e!=c&&k(e,d,a[l],a)});return g(m.prototype,{clear:function clear(){for(var a=this,b=a._i,d=a._f;d;d=d.n)d.r=!0,d.p&&(d.p=d.p.n=c),delete b[d.i];a._f=a._l=c,a[q]=0},"delete":function(a){var b=this,c=r(b,a);if(c){var d=c.n,e=c.p;delete b._i[c.i],c.r=!0,e&&(e.n=d),d&&(d.p=e),b._f==c&&(b._f=d),b._l==c&&(b._l=e),b[q]--}return!!c},forEach:function forEach(a){i(this,m,"forEach");for(var b,d=h(a,arguments.length>1?arguments[1]:c,3);b=b?b.n:this._f;)for(d(b.v,b.k,this);b&&b.r;)b=b.p},has:function has(a){return!!r(this,a)}}),o&&e(m.prototype,"size",{get:function(){return j(this[q])}}),m},def:function(a,b,d){var e,f,g=r(a,b);return g?g.v=d:(a._l=g={i:f=p(b,!0),k:b,v:d,p:e=a._l,n:c,r:!1},a._f||(a._f=g),e&&(e.n=g),a[q]++,"F"!==f&&(a._i[f]=g)),a},getEntry:r,setStrong:function(a,b,d){l(a,b,function(a,b){this._t=a,this._k=b,this._l=c},function(){for(var a=this,b=a._k,d=a._l;d&&d.r;)d=d.p;return a._t&&(a._l=d=d?d.n:a._t._f)?"keys"==b?m(0,d.k):"values"==b?m(0,d.v):m(0,[d.k,d.v]):(a._t=c,m(1))},d?"entries":"values",!d,!0),n(b)}}},function(a,b,d){var e=d(2),f=d(6),g=d(19),h=d(5),i=d(10),j=d(189),k=d(185),l=d(184),m=d(13),n=d(22),o=d(11).f,p=d(160)(0),q=d(4);a.exports=function(a,b,d,r,s,t){var u=e[a],v=u,w=s?"set":"add",x=v&&v.prototype,y={};return q&&"function"==typeof v&&(t||x.forEach&&!h(function(){(new v).entries().next()}))?(v=b(function(b,d){l(b,v,a,"_c"),b._c=new u,d!=c&&k(d,s,b[w],b)}),p("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(a){var b="add"==a||"set"==a;a in x&&(!t||"clear"!=a)&&i(v.prototype,a,function(d,e){if(l(this,v,a),!b&&t&&!m(d))return"get"==a&&c;var f=this._c[a](0===d?0:d,e);return b?this:f})}),"size"in x&&o(v.prototype,"size",{get:function(){return this._c.size}})):(v=r.getConstructor(b,a,s,w),j(v.prototype,d),g.NEED=!0),n(v,a),y[a]=v,f(f.G+f.W+f.F,y),t||r.setStrong(v,a,s),v}},function(a,b,d){var e=d(191);a.exports=d(192)("Set",function(a){return function Set(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a=0===a?0:a,a)}},e)},function(a,b,d){var e,f=d(160)(0),g=d(18),h=d(19),i=d(67),j=d(195),k=d(13),l=h.getWeak,m=Object.isExtensible,n=j.ufstore,o={},p=function(a){return function WeakMap(){return a(this,arguments.length>0?arguments[0]:c)}},q={get:function get(a){if(k(a)){var b=l(a);return b===!0?n(this).get(a):b?b[this._i]:c}},set:function set(a,b){return j.def(this,a,b)}},r=a.exports=d(192)("WeakMap",p,q,j,!0,!0);7!=(new r).set((Object.freeze||Object)(o),7).get(o)&&(e=j.getConstructor(p),i(e.prototype,q),h.NEED=!0,f(["delete","has","get","set"],function(a){var b=r.prototype,c=b[a];g(b,a,function(b,d){if(k(b)&&!m(b)){this._f||(this._f=new e);var f=this._f[a](b,d);return"set"==a?this:f}return c.call(this,b,d)})}))},function(a,b,d){var e=d(189),f=d(19).getWeak,g=d(12),h=d(13),i=d(184),j=d(185),k=d(160),l=d(3),m=k(5),n=k(6),o=0,p=function(a){return a._l||(a._l=new q)},q=function(){this.a=[]},r=function(a,b){return m(a.a,function(a){return a[0]===b})};q.prototype={get:function(a){var b=r(this,a);if(b)return b[1]},has:function(a){return!!r(this,a)},set:function(a,b){var c=r(this,a);c?c[1]=b:this.a.push([a,b])},"delete":function(a){var b=n(this.a,function(b){return b[0]===a});return~b&&this.a.splice(b,1),!!~b}},a.exports={getConstructor:function(a,b,d,g){var k=a(function(a,e){i(a,k,b,"_i"),a._i=o++,a._l=c,e!=c&&j(e,d,a[g],a)});return e(k.prototype,{"delete":function(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this)["delete"](a):b&&l(b,this._i)&&delete b[this._i]},has:function has(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this).has(a):b&&l(b,this._i)}}),k},def:function(a,b,c){var d=f(g(b),!0);return d===!0?p(a).set(b,c):d[a._i]=c,a},ufstore:p}},function(a,b,d){var e=d(195);d(192)("WeakSet",function(a){return function WeakSet(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a,!0)}},e,!1,!0)},function(a,b,c){var d=c(6),e=c(9),f=c(12),g=(c(2).Reflect||{}).apply,h=Function.apply;d(d.S+d.F*!c(5)(function(){g(function(){})}),"Reflect",{apply:function apply(a,b,c){var d=e(a),i=f(c);return g?g(d,b,i):h.call(d,b,i)}})},function(a,b,c){var d=c(6),e=c(44),f=c(9),g=c(12),h=c(13),i=c(5),j=c(73),k=(c(2).Reflect||{}).construct,l=i(function(){function F(){}return!(k(function(){},[],F)instanceof F)}),m=!i(function(){k(function(){})});d(d.S+d.F*(l||m),"Reflect",{construct:function construct(a,b){f(a),g(b);var c=arguments.length<3?a:f(arguments[2]);if(m&&!l)return k(a,b,c);if(a==c){switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3])}var d=[null];return d.push.apply(d,b),new(j.apply(a,d))}var i=c.prototype,n=e(h(i)?i:Object.prototype),o=Function.apply.call(a,n,b);return h(o)?o:n}})},function(a,b,c){var d=c(11),e=c(6),f=c(12),g=c(16);e(e.S+e.F*c(5)(function(){Reflect.defineProperty(d.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(a,b,c){f(a),b=g(b,!0),f(c);try{return d.f(a,b,c),!0}catch(e){return!1}}})},function(a,b,c){var d=c(6),e=c(49).f,f=c(12);d(d.S,"Reflect",{deleteProperty:function deleteProperty(a,b){var c=e(f(a),b);return!(c&&!c.configurable)&&delete a[b]}})},function(a,b,d){var e=d(6),f=d(12),g=function(a){this._t=f(a),this._i=0;var b,c=this._k=[];for(b in a)c.push(b)};d(131)(g,"Object",function(){var a,b=this,d=b._k;do if(b._i>=d.length)return{value:c,done:!0};while(!((a=d[b._i++])in b._t));return{value:a,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(a){return new g(a)}})},function(a,b,d){function get(a,b){var d,h,k=arguments.length<3?a:arguments[2];return j(a)===k?a[b]:(d=e.f(a,b))?g(d,"value")?d.value:d.get!==c?d.get.call(k):c:i(h=f(a))?get(h,b,k):void 0}var e=d(49),f=d(57),g=d(3),h=d(6),i=d(13),j=d(12);h(h.S,"Reflect",{get:get})},function(a,b,c){var d=c(49),e=c(6),f=c(12);e(e.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(a,b){return d.f(f(a),b)}})},function(a,b,c){var d=c(6),e=c(57),f=c(12);d(d.S,"Reflect",{getPrototypeOf:function getPrototypeOf(a){return e(f(a))}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{has:function has(a,b){return b in a}})},function(a,b,c){var d=c(6),e=c(12),f=Object.isExtensible;d(d.S,"Reflect",{isExtensible:function isExtensible(a){return e(a),!f||f(a)}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{ownKeys:c(208)})},function(a,b,c){var d=c(48),e=c(41),f=c(12),g=c(2).Reflect;a.exports=g&&g.ownKeys||function ownKeys(a){var b=d.f(f(a)),c=e.f;return c?b.concat(c(a)):b}},function(a,b,c){var d=c(6),e=c(12),f=Object.preventExtensions;d(d.S,"Reflect",{preventExtensions:function preventExtensions(a){e(a);try{return f&&f(a),!0}catch(b){return!1}}})},function(a,b,d){function set(a,b,d){var i,m,n=arguments.length<4?a:arguments[3],o=f.f(k(a),b);if(!o){if(l(m=g(a)))return set(m,b,d,n);o=j(0)}return h(o,"value")?!(o.writable===!1||!l(n))&&(i=f.f(n,b)||j(0),i.value=d,e.f(n,b,i),!0):o.set!==c&&(o.set.call(n,d),!0)}var e=d(11),f=d(49),g=d(57),h=d(3),i=d(6),j=d(17),k=d(12),l=d(13);i(i.S,"Reflect",{set:set})},function(a,b,c){var d=c(6),e=c(71);e&&d(d.S,"Reflect",{setPrototypeOf:function setPrototypeOf(a,b){e.check(a,b);try{return e.set(a,b),!0}catch(c){return!1}}})},function(a,b,c){var d=c(6);d(d.S,"Date",{now:function(){return(new Date).getTime()}})},function(a,b,c){var d=c(6),e=c(56),f=c(16);d(d.P+d.F*c(5)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(a){var b=e(this),c=f(b);return"number"!=typeof c||isFinite(c)?b.toISOString():null}})},function(a,b,c){var d=c(6),e=c(5),f=Date.prototype.getTime,g=function(a){return a>9?a:"0"+a};d(d.P+d.F*(e(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!e(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function toISOString(){if(!isFinite(f.call(this)))throw RangeError("Invalid time value");var a=this,b=a.getUTCFullYear(),c=a.getUTCMilliseconds(),d=b<0?"-":b>9999?"+":"";return d+("00000"+Math.abs(b)).slice(d?-6:-4)+"-"+g(a.getUTCMonth()+1)+"-"+g(a.getUTCDate())+"T"+g(a.getUTCHours())+":"+g(a.getUTCMinutes())+":"+g(a.getUTCSeconds())+"."+(c>99?c:"0"+g(c))+"Z"}})},function(a,b,d){var e=d(6),f=d(216),g=d(217),h=d(12),i=d(37),j=d(35),k=d(13),l=d(2).ArrayBuffer,m=d(186),n=g.ArrayBuffer,o=g.DataView,p=f.ABV&&l.isView,q=n.prototype.slice,r=f.VIEW,s="ArrayBuffer";e(e.G+e.W+e.F*(l!==n),{ArrayBuffer:n}),e(e.S+e.F*!f.CONSTR,s,{isView:function isView(a){return p&&p(a)||k(a)&&r in a}}),e(e.P+e.U+e.F*d(5)(function(){return!new n(2).slice(1,c).byteLength}),s,{slice:function slice(a,b){if(q!==c&&b===c)return q.call(h(this),a);for(var d=h(this).byteLength,e=i(a,d),f=i(b===c?d:b,d),g=new(m(this,n))(j(f-e)),k=new o(this),l=new o(g),p=0;e>1,k=23===b?E(2,-24)-E(2,-77):0,l=0,m=a<0||0===a&&1/a<0?1:0;for(a=D(a),a!=a||a===B?(e=a!=a?1:0,d=i):(d=F(G(a)/H),a*(f=E(2,-d))<1&&(d--,f*=2),a+=d+j>=1?k/f:k*E(2,1-j),a*f>=2&&(d++,f/=2),d+j>=i?(e=0,d=i):d+j>=1?(e=(a*f-1)*E(2,b),d+=j):(e=a*E(2,j-1)*E(2,b),d=0));b>=8;g[l++]=255&e,e/=256,b-=8);for(d=d<0;g[l++]=255&d,d/=256,h-=8);return g[--l]|=128*m,g},P=function(a,b,c){var d,e=8*c-b-1,f=(1<>1,h=e-7,i=c-1,j=a[i--],k=127&j;for(j>>=7;h>0;k=256*k+a[i],i--,h-=8);for(d=k&(1<<-h)-1,k>>=-h,h+=b;h>0;d=256*d+a[i],i--,h-=8);if(0===k)k=1-g;else{if(k===f)return d?NaN:j?-B:B;d+=E(2,b),k-=g}return(j?-1:1)*d*E(2,k-b)},Q=function(a){return a[3]<<24|a[2]<<16|a[1]<<8|a[0]},R=function(a){return[255&a]},S=function(a){return[255&a,a>>8&255]},T=function(a){return[255&a,a>>8&255,a>>16&255,a>>24&255]},U=function(a){return O(a,52,8)},V=function(a){return O(a,23,4)},W=function(a,b,c){p(a[u],b,{get:function(){return this[c]}})},X=function(a,b,c,d){var e=+c,f=m(e);if(e!=f||f<0||f+b>a[M])throw A(w);var g=a[L]._b,h=f+a[N],i=g.slice(h,h+b);return d?i:i.reverse()},Y=function(a,b,c,d,e,f){var g=+c,h=m(g);if(g!=h||h<0||h+b>a[M])throw A(w);for(var i=a[L]._b,j=h+a[N],k=d(+e),l=0;lba;)($=aa[ba++])in x||i(x,$,C[$]);g||(_.constructor=x)}var ca=new y(new x(2)),da=y[u].setInt8;ca.setInt8(0,2147483648),ca.setInt8(1,2147483649),!ca.getInt8(0)&&ca.getInt8(1)||j(y[u],{setInt8:function setInt8(a,b){da.call(this,a,b<<24>>24)},setUint8:function setUint8(a,b){da.call(this,a,b<<24>>24)}},!0)}else x=function ArrayBuffer(a){var b=Z(this,a);this._b=q.call(Array(b),0),this[M]=b},y=function DataView(a,b,d){l(this,y,t),l(a,x,t);var e=a[M],f=m(b);if(f<0||f>e)throw A("Wrong offset!");if(d=d===c?e-f:n(d),f+d>e)throw A(v);this[L]=a,this[N]=f,this[M]=d},f&&(W(x,J,"_l"),W(y,I,"_b"),W(y,J,"_l"),W(y,K,"_o")),j(y[u],{getInt8:function getInt8(a){return X(this,1,a)[0]<<24>>24},getUint8:function getUint8(a){return X(this,1,a)[0]},getInt16:function getInt16(a){var b=X(this,2,a,arguments[1]);return(b[1]<<8|b[0])<<16>>16},getUint16:function getUint16(a){var b=X(this,2,a,arguments[1]);return b[1]<<8|b[0]},getInt32:function getInt32(a){return Q(X(this,4,a,arguments[1]))},getUint32:function getUint32(a){return Q(X(this,4,a,arguments[1]))>>>0},getFloat32:function getFloat32(a){return P(X(this,4,a,arguments[1]),23,4)},getFloat64:function getFloat64(a){return P(X(this,8,a,arguments[1]),52,8)},setInt8:function setInt8(a,b){Y(this,1,a,R,b)},setUint8:function setUint8(a,b){Y(this,1,a,R,b)},setInt16:function setInt16(a,b){Y(this,2,a,S,b,arguments[2])},setUint16:function setUint16(a,b){Y(this,2,a,S,b,arguments[2])},setInt32:function setInt32(a,b){Y(this,4,a,T,b,arguments[2])},setUint32:function setUint32(a,b){Y(this,4,a,T,b,arguments[2])},setFloat32:function setFloat32(a,b){Y(this,4,a,V,b,arguments[2])},setFloat64:function setFloat64(a,b){Y(this,8,a,U,b,arguments[2])}});r(x,s),r(y,t),i(y[u],h.VIEW,!0),b[s]=x,b[t]=y},function(a,b,c){var d=c(6);d(d.G+d.W+d.F*!c(216).ABV,{DataView:c(217).DataView})},function(a,b,c){c(220)("Int8",1,function(a){return function Int8Array(b,c,d){return a(this,b,c,d)}})},function(a,b,d){if(d(4)){var e=d(26),f=d(2),g=d(5),h=d(6),i=d(216),j=d(217),k=d(8),l=d(184),m=d(17),n=d(10),o=d(189),p=d(36),q=d(35),r=d(37),s=d(16),t=d(3),u=d(69),v=d(152),w=d(13),x=d(56),y=d(149),z=d(44),A=d(57),B=d(48).f,C=d(151),D=d(20),E=d(23),F=d(160),G=d(34),H=d(186),I=d(179),J=d(130),K=d(153),L=d(182),M=d(176),N=d(173),O=d(11),P=d(49),Q=O.f,R=P.f,S=f.RangeError,T=f.TypeError,U=f.Uint8Array,V="ArrayBuffer",W="Shared"+V,X="BYTES_PER_ELEMENT",Y="prototype",Z=Array[Y],$=j.ArrayBuffer,_=j.DataView,aa=F(0),ba=F(2),ca=F(3),da=F(4),ea=F(5),fa=F(6),ga=G(!0),ha=G(!1),ia=I.values,ja=I.keys,ka=I.entries,la=Z.lastIndexOf,ma=Z.reduce,na=Z.reduceRight,oa=Z.join,pa=Z.sort,qa=Z.slice,ra=Z.toString,sa=Z.toLocaleString,ta=E("iterator"),ua=E("toStringTag"),va=D("typed_constructor"),wa=D("def_constructor"),xa=i.CONSTR,ya=i.TYPED,za=i.VIEW,Aa="Wrong length!",Ba=F(1,function(a,b){return Ha(H(a,a[wa]),b)}),Ca=g(function(){return 1===new U(new Uint16Array([1]).buffer)[0]}),Da=!!U&&!!U[Y].set&&g(function(){new U(1).set({})}),Ea=function(a,b){if(a===c)throw T(Aa);var d=+a,e=q(a);if(b&&!u(d,e))throw S(Aa);return e},Fa=function(a,b){var c=p(a);if(c<0||c%b)throw S("Wrong offset!");return c},Ga=function(a){if(w(a)&&ya in a)return a;throw T(a+" is not a typed array!")},Ha=function(a,b){if(!(w(a)&&va in a))throw T("It is not a typed array constructor!");return new a(b)},Ia=function(a,b){return Ja(H(a,a[wa]),b)},Ja=function(a,b){for(var c=0,d=b.length,e=Ha(a,d);d>c;)e[c]=b[c++];return e},Ka=function(a,b,c){Q(a,b,{get:function(){return this._d[c]}})},La=function from(a){var b,d,e,f,g,h,i=x(a),j=arguments.length,l=j>1?arguments[1]:c,m=l!==c,n=C(i);if(n!=c&&!y(n)){for(h=n.call(i),e=[],b=0;!(g=h.next()).done;b++)e.push(g.value);i=e}for(m&&j>2&&(l=k(l,arguments[2],2)),b=0,d=q(i.length),f=Ha(this,d);d>b;b++)f[b]=m?l(i[b],b):i[b];return f},Ma=function of(){for(var a=0,b=arguments.length,c=Ha(this,b);b>a;)c[a]=arguments[a++];return c},Na=!!U&&g(function(){sa.call(new U(1))}),Oa=function toLocaleString(){return sa.apply(Na?qa.call(Ga(this)):Ga(this),arguments)},Pa={copyWithin:function copyWithin(a,b){return N.call(Ga(this),a,b,arguments.length>2?arguments[2]:c)},every:function every(a){return da(Ga(this),a,arguments.length>1?arguments[1]:c)},fill:function fill(a){return M.apply(Ga(this),arguments)},filter:function filter(a){return Ia(this,ba(Ga(this),a,arguments.length>1?arguments[1]:c))},find:function find(a){return ea(Ga(this),a,arguments.length>1?arguments[1]:c)},findIndex:function findIndex(a){return fa(Ga(this),a,arguments.length>1?arguments[1]:c)},forEach:function forEach(a){aa(Ga(this),a,arguments.length>1?arguments[1]:c)},indexOf:function indexOf(a){return ha(Ga(this),a,arguments.length>1?arguments[1]:c)},includes:function includes(a){return ga(Ga(this),a,arguments.length>1?arguments[1]:c)},join:function join(a){return oa.apply(Ga(this),arguments)},lastIndexOf:function lastIndexOf(a){return la.apply(Ga(this),arguments)},map:function map(a){return Ba(Ga(this),a,arguments.length>1?arguments[1]:c)},reduce:function reduce(a){return ma.apply(Ga(this),arguments)},reduceRight:function reduceRight(a){return na.apply(Ga(this),arguments)},reverse:function reverse(){for(var a,b=this,c=Ga(b).length,d=Math.floor(c/2),e=0;e1?arguments[1]:c)},sort:function sort(a){return pa.call(Ga(this),a)},subarray:function subarray(a,b){var d=Ga(this),e=d.length,f=r(a,e);return new(H(d,d[wa]))(d.buffer,d.byteOffset+f*d.BYTES_PER_ELEMENT,q((b===c?e:r(b,e))-f))}},Qa=function slice(a,b){return Ia(this,qa.call(Ga(this),a,b))},Ra=function set(a){Ga(this);var b=Fa(arguments[1],1),c=this.length,d=x(a),e=q(d.length),f=0;if(e+b>c)throw S(Aa);for(;f255?255:255&d),e.v[p](c*b+e.o,d,Ca)},E=function(a,b){Q(a,b,{get:function(){return C(this,b)},set:function(a){return D(this,b,a)},enumerable:!0})};u?(r=d(function(a,d,e,f){l(a,r,k,"_d");var g,h,i,j,m=0,o=0;if(w(d)){if(!(d instanceof $||(j=v(d))==V||j==W))return ya in d?Ja(r,d):La.call(r,d);g=d,o=Fa(e,b);var p=d.byteLength;if(f===c){if(p%b)throw S(Aa);if(h=p-o,h<0)throw S(Aa)}else if(h=q(f)*b,h+o>p)throw S(Aa);i=h/b}else i=Ea(d,!0),h=i*b,g=new $(h);for(n(a,"_d",{b:g,o:o,l:h,e:i,v:new _(g)});m1?arguments[1]:c)}}),d(174)("includes")},function(a,b,c){var d=c(6),e=c(120)(!0);d(d.P,"String",{at:function at(a){return e(this,a)}})},function(a,b,d){var e=d(6),f=d(232);e(e.P,"String",{padStart:function padStart(a){return f(this,a,arguments.length>1?arguments[1]:c,!0)}})},function(a,b,d){var e=d(35),f=d(78),g=d(33);a.exports=function(a,b,d,h){var i=String(g(a)),j=i.length,k=d===c?" ":String(d),l=e(b);if(l<=j||""==k)return i;var m=l-j,n=f.call(k,Math.ceil(m/k.length));return n.length>m&&(n=n.slice(0,m)),h?n+i:i+n}},function(a,b,d){var e=d(6),f=d(232);e(e.P,"String",{padEnd:function padEnd(a){return f(this,a,arguments.length>1?arguments[1]:c,!1)}})},function(a,b,c){c(90)("trimLeft",function(a){return function trimLeft(){return a(this,1)}},"trimStart")},function(a,b,c){c(90)("trimRight",function(a){return function trimRight(){return a(this,2)}},"trimEnd")},function(a,b,c){var d=c(6),e=c(33),f=c(35),g=c(123),h=c(237),i=RegExp.prototype,j=function(a,b){this._r=a,this._s=b};c(131)(j,"RegExp String",function next(){var a=this._r.exec(this._s);return{value:a,done:null===a}}),d(d.P,"String",{matchAll:function matchAll(a){if(e(this),!g(a))throw TypeError(a+" is not a regexp!");var b=String(this),c="flags"in i?String(a.flags):h.call(a),d=new RegExp(a.source,~c.indexOf("g")?c:"g"+c); +return d.lastIndex=f(a.lastIndex),new j(d,b)}})},function(a,b,c){var d=c(12);a.exports=function(){var a=d(this),b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),a.unicode&&(b+="u"),a.sticky&&(b+="y"),b}},function(a,b,c){c(25)("asyncIterator")},function(a,b,c){c(25)("observable")},function(a,b,c){var d=c(6),e=c(208),f=c(30),g=c(49),h=c(150);d(d.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(a){for(var b,c=f(a),d=g.f,i=e(c),j={},k=0;i.length>k;)h(j,b=i[k++],d(c,b));return j}})},function(a,b,c){var d=c(6),e=c(242)(!1);d(d.S,"Object",{values:function values(a){return e(a)}})},function(a,b,c){var d=c(28),e=c(30),f=c(42).f;a.exports=function(a){return function(b){for(var c,g=e(b),h=d(g),i=h.length,j=0,k=[];i>j;)f.call(g,c=h[j++])&&k.push(a?[c,g[c]]:g[c]);return k}}},function(a,b,c){var d=c(6),e=c(242)(!0);d(d.S,"Object",{entries:function entries(a){return e(a)}})},function(a,b,c){var d=c(6),e=c(56),f=c(9),g=c(11);c(4)&&d(d.P+c(245),"Object",{__defineGetter__:function __defineGetter__(a,b){g.f(e(this),a,{get:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){a.exports=c(26)||!c(5)(function(){var a=Math.random();__defineSetter__.call(null,a,function(){}),delete c(2)[a]})},function(a,b,c){var d=c(6),e=c(56),f=c(9),g=c(11);c(4)&&d(d.P+c(245),"Object",{__defineSetter__:function __defineSetter__(a,b){g.f(e(this),a,{set:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){var d=c(6),e=c(56),f=c(16),g=c(57),h=c(49).f;c(4)&&d(d.P+c(245),"Object",{__lookupGetter__:function __lookupGetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.get;while(c=g(c))}})},function(a,b,c){var d=c(6),e=c(56),f=c(16),g=c(57),h=c(49).f;c(4)&&d(d.P+c(245),"Object",{__lookupSetter__:function __lookupSetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.set;while(c=g(c))}})},function(a,b,c){var d=c(6);d(d.P+d.R,"Map",{toJSON:c(250)("Map")})},function(a,b,c){var d=c(152),e=c(251);a.exports=function(a){return function toJSON(){if(d(this)!=a)throw TypeError(a+"#toJSON isn't generic");return e(this)}}},function(a,b,c){var d=c(185);a.exports=function(a,b){var c=[];return d(a,!1,c.push,c,b),c}},function(a,b,c){var d=c(6);d(d.P+d.R,"Set",{toJSON:c(250)("Set")})},function(a,b,c){var d=c(6);d(d.S,"System",{global:c(2)})},function(a,b,c){var d=c(6),e=c(32);d(d.S,"Error",{isError:function isError(a){return"Error"===e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{iaddh:function iaddh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f+(d>>>0)+((e&g|(e|g)&~(e+g>>>0))>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{isubh:function isubh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f-(d>>>0)-((~e&g|~(e^g)&e-g>>>0)>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{imulh:function imulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>16,i=e>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>16)+((f*i>>>0)+(j&c)>>16)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{umulh:function umulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>>16,i=e>>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>>16)+((f*i>>>0)+(j&c)>>>16)}})},function(a,b,c){var d=c(260),e=c(12),f=d.key,g=d.set;d.exp({defineMetadata:function defineMetadata(a,b,c,d){g(a,b,e(c),f(d))}})},function(a,b,d){var e=d(190),f=d(6),g=d(21)("metadata"),h=g.store||(g.store=new(d(194))),i=function(a,b,d){var f=h.get(a);if(!f){if(!d)return c;h.set(a,f=new e)}var g=f.get(b);if(!g){if(!d)return c;f.set(b,g=new e)}return g},j=function(a,b,d){var e=i(b,d,!1);return e!==c&&e.has(a)},k=function(a,b,d){var e=i(b,d,!1);return e===c?c:e.get(a)},l=function(a,b,c,d){i(c,d,!0).set(a,b)},m=function(a,b){var c=i(a,b,!1),d=[];return c&&c.forEach(function(a,b){d.push(b)}),d},n=function(a){return a===c||"symbol"==typeof a?a:String(a)},o=function(a){f(f.S,"Reflect",a)};a.exports={store:h,map:i,has:j,get:k,set:l,keys:m,key:n,exp:o}},function(a,b,d){var e=d(260),f=d(12),g=e.key,h=e.map,i=e.store;e.exp({deleteMetadata:function deleteMetadata(a,b){var d=arguments.length<3?c:g(arguments[2]),e=h(f(b),d,!1);if(e===c||!e["delete"](a))return!1;if(e.size)return!0;var j=i.get(b);return j["delete"](d),!!j.size||i["delete"](b)}})},function(a,b,d){var e=d(260),f=d(12),g=d(57),h=e.has,i=e.get,j=e.key,k=function(a,b,d){var e=h(a,b,d);if(e)return i(a,b,d);var f=g(b);return null!==f?k(a,f,d):c};e.exp({getMetadata:function getMetadata(a,b){return k(a,f(b),arguments.length<3?c:j(arguments[2]))}})},function(a,b,d){var e=d(193),f=d(251),g=d(260),h=d(12),i=d(57),j=g.keys,k=g.key,l=function(a,b){var c=j(a,b),d=i(a);if(null===d)return c;var g=l(d,b);return g.length?c.length?f(new e(c.concat(g))):g:c};g.exp({getMetadataKeys:function getMetadataKeys(a){return l(h(a),arguments.length<2?c:k(arguments[1]))}})},function(a,b,d){var e=d(260),f=d(12),g=e.get,h=e.key;e.exp({getOwnMetadata:function getOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(260),f=d(12),g=e.keys,h=e.key;e.exp({getOwnMetadataKeys:function getOwnMetadataKeys(a){return g(f(a),arguments.length<2?c:h(arguments[1]))}})},function(a,b,d){var e=d(260),f=d(12),g=d(57),h=e.has,i=e.key,j=function(a,b,c){var d=h(a,b,c);if(d)return!0;var e=g(b);return null!==e&&j(a,e,c)};e.exp({hasMetadata:function hasMetadata(a,b){return j(a,f(b),arguments.length<3?c:i(arguments[2]))}})},function(a,b,d){var e=d(260),f=d(12),g=e.has,h=e.key;e.exp({hasOwnMetadata:function hasOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(260),f=d(12),g=d(9),h=e.key,i=e.set;e.exp({metadata:function metadata(a,b){return function decorator(d,e){i(a,b,(e!==c?f:g)(d),h(e))}}})},function(a,b,c){var d=c(6),e=c(188)(),f=c(2).process,g="process"==c(32)(f);d(d.G,{asap:function asap(a){var b=g&&f.domain;e(b?b.bind(a):a)}})},function(a,b,d){var e=d(6),f=d(2),g=d(7),h=d(188)(),i=d(23)("observable"),j=d(9),k=d(12),l=d(184),m=d(189),n=d(10),o=d(185),p=o.RETURN,q=function(a){return null==a?c:j(a)},r=function(a){var b=a._c;b&&(a._c=c,b())},s=function(a){return a._o===c},t=function(a){s(a)||(a._o=c,r(a))},u=function(a,b){k(a),this._c=c,this._o=a,a=new v(this);try{var d=b(a),e=d;null!=d&&("function"==typeof d.unsubscribe?d=function(){e.unsubscribe()}:j(d),this._c=d)}catch(f){return void a.error(f)}s(this)&&r(this)};u.prototype=m({},{unsubscribe:function unsubscribe(){t(this)}});var v=function(a){this._s=a};v.prototype=m({},{next:function next(a){var b=this._s;if(!s(b)){var c=b._o;try{var d=q(c.next);if(d)return d.call(c,a)}catch(e){try{t(b)}finally{throw e}}}},error:function error(a){var b=this._s;if(s(b))throw a;var d=b._o;b._o=c;try{var e=q(d.error);if(!e)throw a;a=e.call(d,a)}catch(f){try{r(b)}finally{throw f}}return r(b),a},complete:function complete(a){var b=this._s;if(!s(b)){var d=b._o;b._o=c;try{var e=q(d.complete);a=e?e.call(d,a):c}catch(f){try{r(b)}finally{throw f}}return r(b),a}}});var w=function Observable(a){l(this,w,"Observable","_f")._f=j(a)};m(w.prototype,{subscribe:function subscribe(a){return new u(a,this._f)},forEach:function forEach(a){var b=this;return new(g.Promise||f.Promise)(function(c,d){j(a);var e=b.subscribe({next:function(b){try{return a(b)}catch(c){d(c),e.unsubscribe()}},error:d,complete:c})})}}),m(w,{from:function from(a){var b="function"==typeof this?this:w,c=q(k(a)[i]);if(c){var d=k(c.call(a));return d.constructor===b?d:new b(function(a){return d.subscribe(a)})}return new b(function(b){var c=!1;return h(function(){if(!c){try{if(o(a,!1,function(a){if(b.next(a),c)return p})===p)return}catch(d){if(c)throw d;return void b.error(d)}b.complete()}}),function(){c=!0}})},of:function of(){for(var a=0,b=arguments.length,c=Array(b);ag;)(c[g]=arguments[g++])===h&&(i=!0);return function(){var d,f=this,g=arguments.length,j=0,k=0;if(!i&&!g)return e(a,c,f);if(d=c.slice(),i)for(;b>j;j++)d[j]===h&&(d[j]=arguments[k++]);for(;g>k;)d.push(arguments[k++]);return e(a,d,f)}}},function(a,b,c){a.exports=c(7)},function(a,b,d){function Dict(a){var b=i(null);return a!=c&&(p(a)?o(a,!0,function(a,c){b[a]=c}):h(b,a)),b}function reduce(a,b,c){n(b);var d,e,f=t(a),g=k(f),h=g.length,i=0;if(arguments.length<3){if(!h)throw TypeError("Reduce of empty object with no initial value");d=f[g[i++]]}else d=Object(c);for(;h>i;)v(f,e=g[i++])&&(d=b(d,f[e],e,a));return d}function includes(a,b){return(b==b?m(a,b):x(a,function(a){return a!=a}))!==c}function get(a,b){if(v(a,b))return a[b]}function set(a,b,c){return u&&b in Object?l.f(a,b,g(0,c)):a[b]=c,a}function isDict(a){return s(a)&&j(a)===Dict.prototype}var e=d(8),f=d(6),g=d(17),h=d(67),i=d(44),j=d(57),k=d(28),l=d(11),m=d(27),n=d(9),o=d(185),p=d(277),q=d(131),r=d(180),s=d(13),t=d(30),u=d(4),v=d(3),w=function(a){var b=1==a,d=4==a;return function(f,g,h){var i,j,k,l=e(g,h,3),m=t(f),n=b||7==a||2==a?new("function"==typeof this?this:Dict):c;for(i in m)if(v(m,i)&&(j=m[i],k=l(j,i,f),a))if(b)n[i]=k;else if(k)switch(a){case 2:n[i]=j;break;case 3:return!0;case 5:return j;case 6:return i;case 7:n[k[0]]=k[1]}else if(d)return!1;return 3==a||d?d:n}},x=w(6),y=function(a){return function(b){return new z(b,a)}},z=function(a,b){this._t=t(a),this._a=k(a),this._i=0,this._k=b};q(z,"Dict",function(){var a,b=this,d=b._t,e=b._a,f=b._k;do if(b._i>=e.length)return b._t=c,r(1);while(!v(d,a=e[b._i++]));return"keys"==f?r(0,a):"values"==f?r(0,d[a]):r(0,[a,d[a]])}),Dict.prototype=null,f(f.G+f.F,{Dict:Dict}),f(f.S,"Dict",{keys:y("keys"),values:y("values"),entries:y("entries"),forEach:w(0),map:w(1),filter:w(2),some:w(3),every:w(4),find:w(5),findKey:x,mapPairs:w(7),reduce:reduce,keyOf:m,includes:includes,has:v,get:get,set:set,isDict:isDict})},function(a,b,d){var e=d(152),f=d(23)("iterator"),g=d(130);a.exports=d(7).isIterable=function(a){var b=Object(a);return b[f]!==c||"@@iterator"in b||g.hasOwnProperty(e(b))}},function(a,b,c){var d=c(12),e=c(151);a.exports=c(7).getIterator=function(a){var b=e(a);if("function"!=typeof b)throw TypeError(a+" is not iterable!");return d(b.call(a))}},function(a,b,c){var d=c(2),e=c(7),f=c(6),g=c(274);f(f.G+f.F,{delay:function delay(a){return new(e.Promise||d.Promise)(function(b){setTimeout(g.call(b,!0),a)})}})},function(a,b,c){var d=c(275),e=c(6);c(7)._=d._=d._||{},e(e.P+e.F,"Function",{part:c(274)})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{isObject:c(13)})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{classof:c(152)})},function(a,b,c){var d=c(6),e=c(284);d(d.S+d.F,"Object",{define:e})},function(a,b,c){var d=c(11),e=c(49),f=c(208),g=c(30);a.exports=function define(a,b){for(var c,h=f(g(b)),i=h.length,j=0;i>j;)d.f(a,c=h[j++],e.f(b,c));return a}},function(a,b,c){var d=c(6),e=c(284),f=c(44);d(d.S+d.F,"Object",{make:function(a,b){return e(f(a),b)}})},function(a,b,d){d(129)(Number,"Number",function(a){this._l=+a,this._i=0},function(){var a=this._i++,b=!(a"']/g,{"&":"&","<":"<",">":">",'"':""","'":"'"});d(d.P+d.F,"String",{escapeHTML:function escapeHTML(){return e(this)}})},function(a,b,c){var d=c(6),e=c(288)(/&(?:amp|lt|gt|quot|apos);/g,{"&":"&","<":"<",">":">",""":'"',"'":"'"});d(d.P+d.F,"String",{unescapeHTML:function unescapeHTML(){return e(this)}})}]),"undefined"!=typeof module&&module.exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):b.core=a}(1,1); +//# sourceMappingURL=library.min.js.map \ No newline at end of file diff --git a/node_modules/core-js/client/library.min.js.map b/node_modules/core-js/client/library.min.js.map new file mode 100755 index 00000000..d62fab82 --- /dev/null +++ b/node_modules/core-js/client/library.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["library.js"],"names":["__e","__g","undefined","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","global","has","DESCRIPTORS","$export","redefine","META","KEY","$fails","shared","setToStringTag","uid","wks","wksExt","wksDefine","keyOf","enumKeys","isArray","anObject","toIObject","toPrimitive","createDesc","_create","gOPNExt","$GOPD","$DP","$keys","gOPD","f","dP","gOPN","$Symbol","Symbol","$JSON","JSON","_stringify","stringify","PROTOTYPE","HIDDEN","TO_PRIMITIVE","isEnum","propertyIsEnumerable","SymbolRegistry","AllSymbols","OPSymbols","ObjectProto","Object","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","get","this","value","a","it","key","D","protoDesc","wrap","tag","sym","_k","isSymbol","iterator","$defineProperty","defineProperty","enumerable","$defineProperties","defineProperties","P","keys","i","l","length","$create","create","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","getOwnPropertyDescriptor","$getOwnPropertyNames","getOwnPropertyNames","names","result","push","$getOwnPropertySymbols","getOwnPropertySymbols","IS_OP","TypeError","arguments","$set","configurable","set","toString","name","G","W","F","symbols","split","store","S","for","keyFor","useSetter","useSimple","replacer","$replacer","args","apply","valueOf","Math","window","self","Function","hasOwnProperty","exec","e","core","ctx","hide","type","source","own","out","IS_FORCED","IS_GLOBAL","IS_STATIC","IS_PROTO","IS_BIND","B","IS_WRAP","expProto","target","C","b","virtual","R","U","version","aFunction","fn","that","object","IE8_DOM_DEFINE","O","Attributes","isObject","document","is","createElement","val","bitmap","writable","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","fastKey","getWeak","onFreeze","meta","NEED","px","random","concat","SHARED","def","TAG","stat","prototype","USE_SYMBOL","$exports","LIBRARY","charAt","getKeys","el","index","enumBugKeys","arrayIndexOf","IE_PROTO","IObject","defined","cof","slice","toLength","toIndex","IS_INCLUDES","$this","fromIndex","toInteger","min","ceil","floor","isNaN","max","gOPS","pIE","getSymbols","Array","arg","dPs","Empty","createDict","iframeDocument","iframe","lt","gt","style","display","appendChild","src","contentWindow","open","write","close","Properties","documentElement","windowNames","getWindowNames","hiddenKeys","fails","exp","toObject","$getPrototypeOf","getPrototypeOf","constructor","$freeze","freeze","$seal","seal","$preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","assign","$assign","A","K","forEach","k","join","T","aLen","j","x","y","setPrototypeOf","check","proto","test","buggy","__proto__","bind","invoke","arraySlice","factories","construct","len","n","partArgs","bound","un","HAS_INSTANCE","FunctionProto","aNumberValue","repeat","$toFixed","toFixed","data","ERROR","ZERO","multiply","c2","divide","numToString","s","t","String","pow","acc","log","x2","fractionDigits","z","RangeError","msg","count","str","res","Infinity","$toPrecision","toPrecision","precision","EPSILON","_isFinite","isFinite","isInteger","number","abs","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","$parseFloat","Number","parseFloat","$trim","trim","string","spaces","space","non","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","TYPE","replace","$parseInt","parseInt","ws","hex","radix","log1p","sqrt","$acosh","acosh","MAX_VALUE","NaN","LN2","asinh","$asinh","$atanh","atanh","sign","cbrt","clz32","LOG2E","cosh","$expm1","expm1","EPSILON32","MAX32","MIN32","roundTiesToEven","fround","$abs","$sign","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LN10","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","code","raw","callSite","tpl","$at","codePointAt","pos","TO_STRING","charCodeAt","context","ENDS_WITH","$endsWith","endsWith","searchString","endPosition","end","search","isRegExp","NAME","MATCH","re","INCLUDES","includes","indexOf","STARTS_WITH","$startsWith","startsWith","iterated","_t","_i","point","done","Iterators","$iterCreate","ITERATOR","BUGGY","FF_ITERATOR","KEYS","VALUES","returnThis","Base","Constructor","next","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","kind","values","entries","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","descriptor","createHTML","anchor","quot","attribute","p1","toLowerCase","big","blink","bold","fixed","fontcolor","color","fontsize","size","italics","link","url","small","strike","sub","sup","isArrayIter","createProperty","getIterFn","iter","from","arrayLike","step","mapfn","mapping","iterFn","ret","ArrayProto","classof","getIteratorMethod","ARG","tryGet","callee","SAFE_CLOSING","riter","skipClosing","safe","arr","of","arrayJoin","separator","method","html","begin","klass","start","upTo","cloned","$sort","sort","comparefn","$forEach","STRICT","callbackfn","asc","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","speciesConstructor","original","SPECIES","$map","map","$filter","filter","$some","some","$every","every","$reduce","reduce","memo","isRight","reduceRight","$indexOf","NEGATIVE_ZERO","searchElement","lastIndexOf","copyWithin","to","inc","fill","endPos","$find","forced","find","findIndex","addToUnscopables","Arguments","Internal","GenericPromiseCapability","Wrapper","anInstance","forOf","task","microtask","PROMISE","process","$Promise","isNode","empty","promise","resolve","FakePromise","PromiseRejectionEvent","then","sameConstructor","isThenable","newPromiseCapability","PromiseCapability","reject","$$resolve","$$reject","perform","error","notify","isReject","_n","chain","_c","_v","ok","_s","run","reaction","handler","fail","domain","_h","onHandleUnhandled","enter","exit","onUnhandled","abrupt","console","isUnhandled","emit","onunhandledrejection","reason","_a","onrejectionhandled","$reject","_d","_w","$resolve","wrapper","Promise","executor","err","onFulfilled","onRejected","catch","r","capability","all","iterable","remaining","$index","alreadyCalled","race","forbiddenField","BREAK","RETURN","defer","channel","port","cel","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","counter","queue","ONREADYSTATECHANGE","listener","event","nextTick","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","setTimeout","clear","macrotask","Observer","MutationObserver","WebKitMutationObserver","head","last","flush","parent","toggle","node","createTextNode","observe","characterData","strong","Map","entry","getEntry","v","redefineAll","$iterDefine","setSpecies","SIZE","_f","getConstructor","ADDER","_l","delete","prev","setStrong","each","common","IS_WEAK","IS_ADDER","Set","add","InternalMap","weak","uncaughtFrozenStore","ufstore","tmp","WeakMap","$WeakMap","createArrayMethod","$has","arrayFind","arrayFindIndex","UncaughtFrozenStore","findUncaughtFrozen","splice","WeakSet","rApply","Reflect","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","instance","propertyKey","attributes","deleteProperty","desc","Enumerate","enumerate","receiver","getProto","ownKeys","V","existingDescriptor","ownDesc","setProto","now","Date","getTime","toJSON","toISOString","pv","lz","num","d","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","$typed","buffer","ArrayBuffer","$ArrayBuffer","$DataView","DataView","$isView","ABV","isView","$slice","VIEW","ARRAY_BUFFER","CONSTR","byteLength","first","final","viewS","viewT","setUint8","getUint8","Typed","TYPED","TypedArrayConstructors","arrayFill","DATA_VIEW","WRONG_LENGTH","WRONG_INDEX","BaseBuffer","BUFFER","BYTE_LENGTH","BYTE_OFFSET","$BUFFER","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","unpackIEEE754","nBits","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","addGetter","internal","view","isLittleEndian","numIndex","intIndex","_b","pack","reverse","conversion","validateArrayBufferArguments","numberLength","ArrayBufferProto","$setInt8","setInt8","getInt8","byteOffset","bufferLength","offset","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","init","Int8Array","$buffer","propertyDesc","same","createArrayIncludes","ArrayIterators","$iterDetect","arrayCopyWithin","Uint8Array","SHARED_BUFFER","BYTES_PER_ELEMENT","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayIncludes","arrayValues","arrayKeys","arrayEntries","arrayLastIndexOf","arrayReduce","arrayReduceRight","arraySort","arrayToString","arrayToLocaleString","toLocaleString","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","TYPED_ARRAY","allocate","LITTLE_ENDIAN","Uint16Array","FORCED_SET","strictToLength","SAME","toOffset","BYTES","validate","speciesFromList","list","fromList","$from","$of","TO_LOCALE_BUG","$toLocaleString","predicate","middle","subarray","$begin","$iterators","isTAIndex","$getDesc","$setDesc","$TypedArrayPrototype$","CLAMPED","ISNT_UINT8","GETTER","SETTER","TypedArray","TAC","TypedArrayPrototype","getter","o","round","addElement","$offset","$length","$len","$nativeIterator","CORRECT_ITER_NAME","$iterator","Uint8ClampedArray","Int16Array","Int32Array","Uint32Array","Float32Array","Float64Array","$includes","at","$pad","padStart","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padEnd","trimLeft","trimRight","getFlags","RegExpProto","$RegExpStringIterator","regexp","_r","match","matchAll","flags","rx","lastIndex","ignoreCase","multiline","unicode","sticky","getOwnPropertyDescriptors","getDesc","$values","isEntries","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","isError","iaddh","x0","x1","y0","y1","$x0","$x1","$y0","isubh","imulh","u","$u","$v","u0","v0","u1","v1","umulh","metadata","toMetaKey","ordinaryDefineOwnMetadata","defineMetadata","metadataKey","metadataValue","targetKey","getOrCreateMetadataMap","targetMetadata","keyMetadata","ordinaryHasOwnMetadata","MetadataKey","metadataMap","ordinaryGetOwnMetadata","MetadataValue","ordinaryOwnMetadataKeys","_","deleteMetadata","ordinaryGetMetadata","hasOwn","getMetadata","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","decorator","asap","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","Observable","subscribe","observable","items","$task","TO_STRING_TAG","collections","Collection","partial","navigator","MSIE","userAgent","time","setInterval","path","pargs","holder","Dict","dict","isIterable","findKey","isDict","createDictMethod","createDictIter","DictIterator","mapPairs","getIterator","delay","part","define","mixin","make","$re","escape","regExp","&","<",">","\"","'","escapeHTML","&","<",">",""","'","unescapeHTML","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,GACpB,cACS,SAAUC,GAKT,QAASC,qBAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUE,OAGnC,IAAIC,GAASF,EAAiBD,IAC7BE,WACAE,GAAIJ,EACJK,QAAQ,EAUT,OANAP,GAAQE,GAAUM,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASH,qBAG/DI,EAAOE,QAAS,EAGTF,EAAOD,QAvBf,GAAID,KAqCJ,OATAF,qBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAIP,EAGxBF,oBAAoBU,EAAI,GAGjBV,oBAAoB,KAK/B,SAASI,EAAQD,EAASH,GAE/BA,EAAoB,GACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,K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","file":"library.min.js"} \ No newline at end of file diff --git a/node_modules/core-js/client/shim.js b/node_modules/core-js/client/shim.js new file mode 100755 index 00000000..2947f937 --- /dev/null +++ b/node_modules/core-js/client/shim.js @@ -0,0 +1,7258 @@ +/** + * core-js 2.4.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(1); + __webpack_require__(50); + __webpack_require__(51); + __webpack_require__(52); + __webpack_require__(54); + __webpack_require__(55); + __webpack_require__(58); + __webpack_require__(59); + __webpack_require__(60); + __webpack_require__(61); + __webpack_require__(62); + __webpack_require__(63); + __webpack_require__(64); + __webpack_require__(65); + __webpack_require__(66); + __webpack_require__(68); + __webpack_require__(70); + __webpack_require__(72); + __webpack_require__(74); + __webpack_require__(77); + __webpack_require__(78); + __webpack_require__(79); + __webpack_require__(83); + __webpack_require__(86); + __webpack_require__(87); + __webpack_require__(88); + __webpack_require__(89); + __webpack_require__(91); + __webpack_require__(92); + __webpack_require__(93); + __webpack_require__(94); + __webpack_require__(95); + __webpack_require__(97); + __webpack_require__(99); + __webpack_require__(100); + __webpack_require__(101); + __webpack_require__(103); + __webpack_require__(104); + __webpack_require__(105); + __webpack_require__(107); + __webpack_require__(108); + __webpack_require__(109); + __webpack_require__(111); + __webpack_require__(112); + __webpack_require__(113); + __webpack_require__(114); + __webpack_require__(115); + __webpack_require__(116); + __webpack_require__(117); + __webpack_require__(118); + __webpack_require__(119); + __webpack_require__(120); + __webpack_require__(121); + __webpack_require__(122); + __webpack_require__(123); + __webpack_require__(124); + __webpack_require__(126); + __webpack_require__(130); + __webpack_require__(131); + __webpack_require__(132); + __webpack_require__(133); + __webpack_require__(137); + __webpack_require__(139); + __webpack_require__(140); + __webpack_require__(141); + __webpack_require__(142); + __webpack_require__(143); + __webpack_require__(144); + __webpack_require__(145); + __webpack_require__(146); + __webpack_require__(147); + __webpack_require__(148); + __webpack_require__(149); + __webpack_require__(150); + __webpack_require__(151); + __webpack_require__(152); + __webpack_require__(158); + __webpack_require__(159); + __webpack_require__(161); + __webpack_require__(162); + __webpack_require__(163); + __webpack_require__(167); + __webpack_require__(168); + __webpack_require__(169); + __webpack_require__(170); + __webpack_require__(171); + __webpack_require__(173); + __webpack_require__(174); + __webpack_require__(175); + __webpack_require__(176); + __webpack_require__(179); + __webpack_require__(181); + __webpack_require__(182); + __webpack_require__(183); + __webpack_require__(185); + __webpack_require__(187); + __webpack_require__(189); + __webpack_require__(190); + __webpack_require__(191); + __webpack_require__(193); + __webpack_require__(194); + __webpack_require__(195); + __webpack_require__(196); + __webpack_require__(203); + __webpack_require__(206); + __webpack_require__(207); + __webpack_require__(209); + __webpack_require__(210); + __webpack_require__(211); + __webpack_require__(212); + __webpack_require__(213); + __webpack_require__(214); + __webpack_require__(215); + __webpack_require__(216); + __webpack_require__(217); + __webpack_require__(218); + __webpack_require__(219); + __webpack_require__(220); + __webpack_require__(222); + __webpack_require__(223); + __webpack_require__(224); + __webpack_require__(225); + __webpack_require__(226); + __webpack_require__(227); + __webpack_require__(228); + __webpack_require__(229); + __webpack_require__(231); + __webpack_require__(234); + __webpack_require__(235); + __webpack_require__(237); + __webpack_require__(238); + __webpack_require__(239); + __webpack_require__(240); + __webpack_require__(241); + __webpack_require__(242); + __webpack_require__(243); + __webpack_require__(244); + __webpack_require__(245); + __webpack_require__(246); + __webpack_require__(247); + __webpack_require__(249); + __webpack_require__(250); + __webpack_require__(251); + __webpack_require__(252); + __webpack_require__(253); + __webpack_require__(254); + __webpack_require__(255); + __webpack_require__(256); + __webpack_require__(258); + __webpack_require__(259); + __webpack_require__(261); + __webpack_require__(262); + __webpack_require__(263); + __webpack_require__(264); + __webpack_require__(267); + __webpack_require__(268); + __webpack_require__(269); + __webpack_require__(270); + __webpack_require__(271); + __webpack_require__(272); + __webpack_require__(273); + __webpack_require__(274); + __webpack_require__(276); + __webpack_require__(277); + __webpack_require__(278); + __webpack_require__(279); + __webpack_require__(280); + __webpack_require__(281); + __webpack_require__(282); + __webpack_require__(283); + __webpack_require__(284); + __webpack_require__(285); + __webpack_require__(286); + __webpack_require__(287); + module.exports = __webpack_require__(288); + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // ECMAScript 6 symbols shim + var global = __webpack_require__(2) + , has = __webpack_require__(3) + , DESCRIPTORS = __webpack_require__(4) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(16) + , META = __webpack_require__(20).KEY + , $fails = __webpack_require__(5) + , shared = __webpack_require__(21) + , setToStringTag = __webpack_require__(22) + , uid = __webpack_require__(17) + , wks = __webpack_require__(23) + , wksExt = __webpack_require__(24) + , wksDefine = __webpack_require__(25) + , keyOf = __webpack_require__(27) + , enumKeys = __webpack_require__(40) + , isArray = __webpack_require__(43) + , anObject = __webpack_require__(10) + , toIObject = __webpack_require__(30) + , toPrimitive = __webpack_require__(14) + , createDesc = __webpack_require__(15) + , _create = __webpack_require__(44) + , gOPNExt = __webpack_require__(47) + , $GOPD = __webpack_require__(49) + , $DP = __webpack_require__(9) + , $keys = __webpack_require__(28) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; + // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 + var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + + // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 + var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; + }) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); + } : dP; + + var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; + }; + + var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; + } : function(it){ + return it instanceof $Symbol; + }; + + var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); + }; + var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; + }; + var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); + }; + var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; + }; + var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; + }; + var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; + }; + var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; + }; + + // 19.4.1.1 Symbol([description]) + if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(48).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(42).f = $propertyIsEnumerable; + __webpack_require__(41).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !__webpack_require__(26)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + + for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' + ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + + for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + + $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } + }); + + $export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols + }); + + // 24.3.2 JSON.stringify(value [, replacer [, space]]) + $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; + })), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } + }); + + // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) + $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(8)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); + // 19.4.3.5 Symbol.prototype[@@toStringTag] + setToStringTag($Symbol, 'Symbol'); + // 20.2.1.9 Math[@@toStringTag] + setToStringTag(Math, 'Math', true); + // 24.3.3 JSON[@@toStringTag] + setToStringTag(global.JSON, 'JSON', true); + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); + if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef + +/***/ }, +/* 3 */ +/***/ function(module, exports) { + + var hasOwnProperty = {}.hasOwnProperty; + module.exports = function(it, key){ + return hasOwnProperty.call(it, key); + }; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + // Thank's IE8 for his funny defineProperty + module.exports = !__webpack_require__(5)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; + }); + +/***/ }, +/* 5 */ +/***/ function(module, exports) { + + module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } + }; + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , hide = __webpack_require__(8) + , redefine = __webpack_require__(16) + , ctx = __webpack_require__(18) + , PROTOTYPE = 'prototype'; + + var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target)redefine(target, key, out, type & $export.U); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } + }; + global.core = core; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + module.exports = $export; + +/***/ }, +/* 7 */ +/***/ function(module, exports) { + + var core = module.exports = {version: '2.4.0'}; + if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(9) + , createDesc = __webpack_require__(15); + module.exports = __webpack_require__(4) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); + } : function(object, key, value){ + object[key] = value; + return object; + }; + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + var anObject = __webpack_require__(10) + , IE8_DOM_DEFINE = __webpack_require__(12) + , toPrimitive = __webpack_require__(14) + , dP = Object.defineProperty; + + exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; + }; + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11); + module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; + }; + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = !__webpack_require__(4) && !__webpack_require__(5)(function(){ + return Object.defineProperty(__webpack_require__(13)('div'), 'a', {get: function(){ return 7; }}).a != 7; + }); + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11) + , document = __webpack_require__(2).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); + module.exports = function(it){ + return is ? document.createElement(it) : {}; + }; + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.1 ToPrimitive(input [, PreferredType]) + var isObject = __webpack_require__(11); + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); + }; + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; + }; + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , hide = __webpack_require__(8) + , has = __webpack_require__(3) + , SRC = __webpack_require__(17)('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + + __webpack_require__(7).inspectSource = function(it){ + return $toString.call(it); + }; + + (module.exports = function(O, key, val, safe){ + var isFunction = typeof val == 'function'; + if(isFunction)has(val, 'name') || hide(val, 'name', key); + if(O[key] === val)return; + if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if(O === global){ + O[key] = val; + } else { + if(!safe){ + delete O[key]; + hide(O, key, val); + } else { + if(O[key])O[key] = val; + else hide(O, key, val); + } + } + // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + })(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); + }); + +/***/ }, +/* 17 */ +/***/ function(module, exports) { + + var id = 0 + , px = Math.random(); + module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + // optional / simple context binding + var aFunction = __webpack_require__(19); + module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; + }; + +/***/ }, +/* 19 */ +/***/ function(module, exports) { + + module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; + }; + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + var META = __webpack_require__(17)('meta') + , isObject = __webpack_require__(11) + , has = __webpack_require__(3) + , setDesc = __webpack_require__(9).f + , id = 0; + var isExtensible = Object.isExtensible || function(){ + return true; + }; + var FREEZE = !__webpack_require__(5)(function(){ + return isExtensible(Object.preventExtensions({})); + }); + var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); + }; + var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; + }; + var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; + }; + // add metadata on freeze-family methods calling + var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; + }; + var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze + }; + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); + module.exports = function(key){ + return store[key] || (store[key] = {}); + }; + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + var def = __webpack_require__(9).f + , has = __webpack_require__(3) + , TAG = __webpack_require__(23)('toStringTag'); + + module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); + }; + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + var store = __webpack_require__(21)('wks') + , uid = __webpack_require__(17) + , Symbol = __webpack_require__(2).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + + var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); + }; + + $exports.store = store; + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + exports.f = __webpack_require__(23); + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , core = __webpack_require__(7) + , LIBRARY = __webpack_require__(26) + , wksExt = __webpack_require__(24) + , defineProperty = __webpack_require__(9).f; + module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); + }; + +/***/ }, +/* 26 */ +/***/ function(module, exports) { + + module.exports = false; + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + var getKeys = __webpack_require__(28) + , toIObject = __webpack_require__(30); + module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; + }; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.14 / 15.2.3.14 Object.keys(O) + var $keys = __webpack_require__(29) + , enumBugKeys = __webpack_require__(39); + + module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); + }; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + var has = __webpack_require__(3) + , toIObject = __webpack_require__(30) + , arrayIndexOf = __webpack_require__(34)(false) + , IE_PROTO = __webpack_require__(38)('IE_PROTO'); + + module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; + }; + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + // to indexed object, toObject with fallback for non-array-like ES3 strings + var IObject = __webpack_require__(31) + , defined = __webpack_require__(33); + module.exports = function(it){ + return IObject(defined(it)); + }; + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for non-array-like ES3 and non-enumerable old V8 strings + var cof = __webpack_require__(32); + module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); + }; + +/***/ }, +/* 32 */ +/***/ function(module, exports) { + + var toString = {}.toString; + + module.exports = function(it){ + return toString.call(it).slice(8, -1); + }; + +/***/ }, +/* 33 */ +/***/ function(module, exports) { + + // 7.2.1 RequireObjectCoercible(argument) + module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; + }; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + // false -> Array#indexOf + // true -> Array#includes + var toIObject = __webpack_require__(30) + , toLength = __webpack_require__(35) + , toIndex = __webpack_require__(37); + module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; + }; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.15 ToLength + var toInteger = __webpack_require__(36) + , min = Math.min; + module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 + }; + +/***/ }, +/* 36 */ +/***/ function(module, exports) { + + // 7.1.4 ToInteger + var ceil = Math.ceil + , floor = Math.floor; + module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(36) + , max = Math.max + , min = Math.min; + module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); + }; + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + var shared = __webpack_require__(21)('keys') + , uid = __webpack_require__(17); + module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); + }; + +/***/ }, +/* 39 */ +/***/ function(module, exports) { + + // IE 8- don't enum bug keys + module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' + ).split(','); + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + // all enumerable object keys, includes symbols + var getKeys = __webpack_require__(28) + , gOPS = __webpack_require__(41) + , pIE = __webpack_require__(42); + module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; + }; + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + exports.f = Object.getOwnPropertySymbols; + +/***/ }, +/* 42 */ +/***/ function(module, exports) { + + exports.f = {}.propertyIsEnumerable; + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.2 IsArray(argument) + var cof = __webpack_require__(32); + module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; + }; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + var anObject = __webpack_require__(10) + , dPs = __webpack_require__(45) + , enumBugKeys = __webpack_require__(39) + , IE_PROTO = __webpack_require__(38)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + + // Create object with fake `null` prototype: use iframe Object with cleared prototype + var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(13)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(46).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); + }; + + module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); + }; + + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(9) + , anObject = __webpack_require__(10) + , getKeys = __webpack_require__(28); + + module.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; + }; + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(2).document && document.documentElement; + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window + var toIObject = __webpack_require__(30) + , gOPN = __webpack_require__(48).f + , toString = {}.toString; + + var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + + var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } + }; + + module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); + }; + + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) + var $keys = __webpack_require__(29) + , hiddenKeys = __webpack_require__(39).concat('length', 'prototype'); + + exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); + }; + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + var pIE = __webpack_require__(42) + , createDesc = __webpack_require__(15) + , toIObject = __webpack_require__(30) + , toPrimitive = __webpack_require__(14) + , has = __webpack_require__(3) + , IE8_DOM_DEFINE = __webpack_require__(12) + , gOPD = Object.getOwnPropertyDescriptor; + + exports.f = __webpack_require__(4) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); + }; + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + $export($export.S + $export.F * !__webpack_require__(4), 'Object', {defineProperty: __webpack_require__(9).f}); + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) + $export($export.S + $export.F * !__webpack_require__(4), 'Object', {defineProperties: __webpack_require__(45)}); + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + var toIObject = __webpack_require__(30) + , $getOwnPropertyDescriptor = __webpack_require__(49).f; + + __webpack_require__(53)('getOwnPropertyDescriptor', function(){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; + }); + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + // most Object methods by ES6 should accept primitives + var $export = __webpack_require__(6) + , core = __webpack_require__(7) + , fails = __webpack_require__(5); + module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); + }; + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + $export($export.S, 'Object', {create: __webpack_require__(44)}); + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 Object.getPrototypeOf(O) + var toObject = __webpack_require__(56) + , $getPrototypeOf = __webpack_require__(57); + + __webpack_require__(53)('getPrototypeOf', function(){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; + }); + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.1.13 ToObject(argument) + var defined = __webpack_require__(33); + module.exports = function(it){ + return Object(defined(it)); + }; + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + var has = __webpack_require__(3) + , toObject = __webpack_require__(56) + , IE_PROTO = __webpack_require__(38)('IE_PROTO') + , ObjectProto = Object.prototype; + + module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; + }; + +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.14 Object.keys(O) + var toObject = __webpack_require__(56) + , $keys = __webpack_require__(28); + + __webpack_require__(53)('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; + }); + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.7 Object.getOwnPropertyNames(O) + __webpack_require__(53)('getOwnPropertyNames', function(){ + return __webpack_require__(47).f; + }); + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.5 Object.freeze(O) + var isObject = __webpack_require__(11) + , meta = __webpack_require__(20).onFreeze; + + __webpack_require__(53)('freeze', function($freeze){ + return function freeze(it){ + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; + }); + +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.17 Object.seal(O) + var isObject = __webpack_require__(11) + , meta = __webpack_require__(20).onFreeze; + + __webpack_require__(53)('seal', function($seal){ + return function seal(it){ + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; + }); + +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.15 Object.preventExtensions(O) + var isObject = __webpack_require__(11) + , meta = __webpack_require__(20).onFreeze; + + __webpack_require__(53)('preventExtensions', function($preventExtensions){ + return function preventExtensions(it){ + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; + }); + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.12 Object.isFrozen(O) + var isObject = __webpack_require__(11); + + __webpack_require__(53)('isFrozen', function($isFrozen){ + return function isFrozen(it){ + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; + }); + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.13 Object.isSealed(O) + var isObject = __webpack_require__(11); + + __webpack_require__(53)('isSealed', function($isSealed){ + return function isSealed(it){ + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; + }); + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.2.11 Object.isExtensible(O) + var isObject = __webpack_require__(11); + + __webpack_require__(53)('isExtensible', function($isExtensible){ + return function isExtensible(it){ + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; + }); + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.1 Object.assign(target, source) + var $export = __webpack_require__(6); + + $export($export.S + $export.F, 'Object', {assign: __webpack_require__(67)}); + +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 19.1.2.1 Object.assign(target, source, ...) + var getKeys = __webpack_require__(28) + , gOPS = __webpack_require__(41) + , pIE = __webpack_require__(42) + , toObject = __webpack_require__(56) + , IObject = __webpack_require__(31) + , $assign = Object.assign; + + // should work with symbols and should have deterministic property order (V8 bug) + module.exports = !$assign || __webpack_require__(5)(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; + }) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; + } : $assign; + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.10 Object.is(value1, value2) + var $export = __webpack_require__(6); + $export($export.S, 'Object', {is: __webpack_require__(69)}); + +/***/ }, +/* 69 */ +/***/ function(module, exports) { + + // 7.2.9 SameValue(x, y) + module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; + }; + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.1.3.19 Object.setPrototypeOf(O, proto) + var $export = __webpack_require__(6); + $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(71).set}); + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + // Works with __proto__ only. Old v8 can't work with null proto objects. + /* eslint-disable no-proto */ + var isObject = __webpack_require__(11) + , anObject = __webpack_require__(10); + var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); + }; + module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = __webpack_require__(18)(Function.call, __webpack_require__(49).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check + }; + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 19.1.3.6 Object.prototype.toString() + var classof = __webpack_require__(73) + , test = {}; + test[__webpack_require__(23)('toStringTag')] = 'z'; + if(test + '' != '[object z]'){ + __webpack_require__(16)(Object.prototype, 'toString', function toString(){ + return '[object ' + classof(this) + ']'; + }, true); + } + +/***/ }, +/* 73 */ +/***/ function(module, exports, __webpack_require__) { + + // getting tag from 19.1.3.6 Object.prototype.toString() + var cof = __webpack_require__(32) + , TAG = __webpack_require__(23)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } + }; + + module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; + }; + +/***/ }, +/* 74 */ +/***/ function(module, exports, __webpack_require__) { + + // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) + var $export = __webpack_require__(6); + + $export($export.P, 'Function', {bind: __webpack_require__(75)}); + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var aFunction = __webpack_require__(19) + , isObject = __webpack_require__(11) + , invoke = __webpack_require__(76) + , arraySlice = [].slice + , factories = {}; + + var construct = function(F, len, args){ + if(!(len in factories)){ + for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); + }; + + module.exports = Function.bind || function bind(that /*, args... */){ + var fn = aFunction(this) + , partArgs = arraySlice.call(arguments, 1); + var bound = function(/* args... */){ + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if(isObject(fn.prototype))bound.prototype = fn.prototype; + return bound; + }; + +/***/ }, +/* 76 */ +/***/ function(module, exports) { + + // fast apply, http://jsperf.lnkit.com/fast-apply/5 + module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); + }; + +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { + + var dP = __webpack_require__(9).f + , createDesc = __webpack_require__(15) + , has = __webpack_require__(3) + , FProto = Function.prototype + , nameRE = /^\s*function ([^ (]*)/ + , NAME = 'name'; + + var isExtensible = Object.isExtensible || function(){ + return true; + }; + + // 19.2.4.2 name + NAME in FProto || __webpack_require__(4) && dP(FProto, NAME, { + configurable: true, + get: function(){ + try { + var that = this + , name = ('' + that).match(nameRE)[1]; + has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name)); + return name; + } catch(e){ + return ''; + } + } + }); + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var isObject = __webpack_require__(11) + , getPrototypeOf = __webpack_require__(57) + , HAS_INSTANCE = __webpack_require__(23)('hasInstance') + , FunctionProto = Function.prototype; + // 19.2.3.6 Function.prototype[@@hasInstance](V) + if(!(HAS_INSTANCE in FunctionProto))__webpack_require__(9).f(FunctionProto, HAS_INSTANCE, {value: function(O){ + if(typeof this != 'function' || !isObject(O))return false; + if(!isObject(this.prototype))return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while(O = getPrototypeOf(O))if(this.prototype === O)return true; + return false; + }}); + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , has = __webpack_require__(3) + , cof = __webpack_require__(32) + , inheritIfRequired = __webpack_require__(80) + , toPrimitive = __webpack_require__(14) + , fails = __webpack_require__(5) + , gOPN = __webpack_require__(48).f + , gOPD = __webpack_require__(49).f + , dP = __webpack_require__(9).f + , $trim = __webpack_require__(81).trim + , NUMBER = 'Number' + , $Number = global[NUMBER] + , Base = $Number + , proto = $Number.prototype + // Opera ~12 has broken Object#toString + , BROKEN_COF = cof(__webpack_require__(44)(proto)) == NUMBER + , TRIM = 'trim' in String.prototype; + + // 7.1.3 ToNumber(argument) + var toNumber = function(argument){ + var it = toPrimitive(argument, false); + if(typeof it == 'string' && it.length > 2){ + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0) + , third, radix, maxCode; + if(first === 43 || first === 45){ + third = it.charCodeAt(2); + if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if(first === 48){ + switch(it.charCodeAt(1)){ + case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default : return +it; + } + for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){ + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if(code < 48 || code > maxCode)return NaN; + } return parseInt(digits, radix); + } + } return +it; + }; + + if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ + $Number = function Number(value){ + var it = arguments.length < 1 ? 0 : value + , that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for(var keys = __webpack_require__(4) ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++){ + if(has(Base, key = keys[j]) && !has($Number, key)){ + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + __webpack_require__(16)(global, NUMBER, $Number); + } + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11) + , setPrototypeOf = __webpack_require__(71).set; + module.exports = function(that, target, C){ + var P, S = target.constructor; + if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){ + setPrototypeOf(that, P); + } return that; + }; + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , defined = __webpack_require__(33) + , fails = __webpack_require__(5) + , spaces = __webpack_require__(82) + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + + var exporter = function(KEY, exec, ALIAS){ + var exp = {}; + var FORCE = fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if(ALIAS)exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); + }; + + // 1 -> String#trimLeft + // 2 -> String#trimRight + // 3 -> String#trim + var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; + }; + + module.exports = exporter; + +/***/ }, +/* 82 */ +/***/ function(module, exports) { + + module.exports = '\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'; + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toInteger = __webpack_require__(36) + , aNumberValue = __webpack_require__(84) + , repeat = __webpack_require__(85) + , $toFixed = 1..toFixed + , floor = Math.floor + , data = [0, 0, 0, 0, 0, 0] + , ERROR = 'Number.toFixed: incorrect invocation!' + , ZERO = '0'; + + var multiply = function(n, c){ + var i = -1 + , c2 = c; + while(++i < 6){ + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } + }; + var divide = function(n){ + var i = 6 + , c = 0; + while(--i >= 0){ + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } + }; + var numToString = function(){ + var i = 6 + , s = ''; + while(--i >= 0){ + if(s !== '' || i === 0 || data[i] !== 0){ + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; + }; + var pow = function(x, n, acc){ + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); + }; + var log = function(x){ + var n = 0 + , x2 = x; + while(x2 >= 4096){ + n += 12; + x2 /= 4096; + } + while(x2 >= 2){ + n += 1; + x2 /= 2; + } return n; + }; + + $export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128..toFixed(0) !== '1000000000000000128' + ) || !__webpack_require__(5)(function(){ + // V8 ~ Android 4.3- + $toFixed.call({}); + })), 'Number', { + toFixed: function toFixed(fractionDigits){ + var x = aNumberValue(this, ERROR) + , f = toInteger(fractionDigits) + , s = '' + , m = ZERO + , e, z, j, k; + if(f < 0 || f > 20)throw RangeError(ERROR); + if(x != x)return 'NaN'; + if(x <= -1e21 || x >= 1e21)return String(x); + if(x < 0){ + s = '-'; + x = -x; + } + if(x > 1e-21){ + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if(e > 0){ + multiply(0, z); + j = f; + while(j >= 7){ + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while(j >= 23){ + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if(f > 0){ + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } + }); + +/***/ }, +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + var cof = __webpack_require__(32); + module.exports = function(it, msg){ + if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); + return +it; + }; + +/***/ }, +/* 85 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var toInteger = __webpack_require__(36) + , defined = __webpack_require__(33); + + module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; + }; + +/***/ }, +/* 86 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $fails = __webpack_require__(5) + , aNumberValue = __webpack_require__(84) + , $toPrecision = 1..toPrecision; + + $export($export.P + $export.F * ($fails(function(){ + // IE7- + return $toPrecision.call(1, undefined) !== '1'; + }) || !$fails(function(){ + // V8 ~ Android 4.3- + $toPrecision.call({}); + })), 'Number', { + toPrecision: function toPrecision(precision){ + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } + }); + +/***/ }, +/* 87 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.1 Number.EPSILON + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); + +/***/ }, +/* 88 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.2 Number.isFinite(number) + var $export = __webpack_require__(6) + , _isFinite = __webpack_require__(2).isFinite; + + $export($export.S, 'Number', { + isFinite: function isFinite(it){ + return typeof it == 'number' && _isFinite(it); + } + }); + +/***/ }, +/* 89 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {isInteger: __webpack_require__(90)}); + +/***/ }, +/* 90 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.3 Number.isInteger(number) + var isObject = __webpack_require__(11) + , floor = Math.floor; + module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; + }; + +/***/ }, +/* 91 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.4 Number.isNaN(number) + var $export = __webpack_require__(6); + + $export($export.S, 'Number', { + isNaN: function isNaN(number){ + return number != number; + } + }); + +/***/ }, +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.5 Number.isSafeInteger(number) + var $export = __webpack_require__(6) + , isInteger = __webpack_require__(90) + , abs = Math.abs; + + $export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number){ + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } + }); + +/***/ }, +/* 93 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.6 Number.MAX_SAFE_INTEGER + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.1.2.10 Number.MIN_SAFE_INTEGER + var $export = __webpack_require__(6); + + $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); + +/***/ }, +/* 95 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseFloat = __webpack_require__(96); + // 20.1.2.12 Number.parseFloat(string) + $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); + +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { + + var $parseFloat = __webpack_require__(2).parseFloat + , $trim = __webpack_require__(81).trim; + + module.exports = 1 / $parseFloat(__webpack_require__(82) + '-0') !== -Infinity ? function parseFloat(str){ + var string = $trim(String(str), 3) + , result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; + } : $parseFloat; + +/***/ }, +/* 97 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseInt = __webpack_require__(98); + // 20.1.2.13 Number.parseInt(string, radix) + $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); + +/***/ }, +/* 98 */ +/***/ function(module, exports, __webpack_require__) { + + var $parseInt = __webpack_require__(2).parseInt + , $trim = __webpack_require__(81).trim + , ws = __webpack_require__(82) + , hex = /^[\-+]?0[xX]/; + + module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){ + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); + } : $parseInt; + +/***/ }, +/* 99 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseInt = __webpack_require__(98); + // 18.2.5 parseInt(string, radix) + $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $parseFloat = __webpack_require__(96); + // 18.2.4 parseFloat(string) + $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); + +/***/ }, +/* 101 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.3 Math.acosh(x) + var $export = __webpack_require__(6) + , log1p = __webpack_require__(102) + , sqrt = Math.sqrt + , $acosh = Math.acosh; + + $export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity + ), 'Math', { + acosh: function acosh(x){ + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } + }); + +/***/ }, +/* 102 */ +/***/ function(module, exports) { + + // 20.2.2.20 Math.log1p(x) + module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); + }; + +/***/ }, +/* 103 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.5 Math.asinh(x) + var $export = __webpack_require__(6) + , $asinh = Math.asinh; + + function asinh(x){ + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); + } + + // Tor Browser bug: Math.asinh(0) -> -0 + $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); + +/***/ }, +/* 104 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.7 Math.atanh(x) + var $export = __webpack_require__(6) + , $atanh = Math.atanh; + + // Tor Browser bug: Math.atanh(-0) -> 0 + $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x){ + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } + }); + +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.9 Math.cbrt(x) + var $export = __webpack_require__(6) + , sign = __webpack_require__(106); + + $export($export.S, 'Math', { + cbrt: function cbrt(x){ + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } + }); + +/***/ }, +/* 106 */ +/***/ function(module, exports) { + + // 20.2.2.28 Math.sign(x) + module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; + }; + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.11 Math.clz32(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + clz32: function clz32(x){ + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } + }); + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.12 Math.cosh(x) + var $export = __webpack_require__(6) + , exp = Math.exp; + + $export($export.S, 'Math', { + cosh: function cosh(x){ + return (exp(x = +x) + exp(-x)) / 2; + } + }); + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.14 Math.expm1(x) + var $export = __webpack_require__(6) + , $expm1 = __webpack_require__(110); + + $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); + +/***/ }, +/* 110 */ +/***/ function(module, exports) { + + // 20.2.2.14 Math.expm1(x) + var $expm1 = Math.expm1; + module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 + ) ? function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; + } : $expm1; + +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.16 Math.fround(x) + var $export = __webpack_require__(6) + , sign = __webpack_require__(106) + , pow = Math.pow + , EPSILON = pow(2, -52) + , EPSILON32 = pow(2, -23) + , MAX32 = pow(2, 127) * (2 - EPSILON32) + , MIN32 = pow(2, -126); + + var roundTiesToEven = function(n){ + return n + 1 / EPSILON - 1 / EPSILON; + }; + + + $export($export.S, 'Math', { + fround: function fround(x){ + var $abs = Math.abs(x) + , $sign = sign(x) + , a, result; + if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + if(result > MAX32 || result != result)return $sign * Infinity; + return $sign * result; + } + }); + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) + var $export = __webpack_require__(6) + , abs = Math.abs; + + $export($export.S, 'Math', { + hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars + var sum = 0 + , i = 0 + , aLen = arguments.length + , larg = 0 + , arg, div; + while(i < aLen){ + arg = abs(arguments[i++]); + if(larg < arg){ + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if(arg > 0){ + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } + }); + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.18 Math.imul(x, y) + var $export = __webpack_require__(6) + , $imul = Math.imul; + + // some WebKit versions fails with big numbers, some has wrong arity + $export($export.S + $export.F * __webpack_require__(5)(function(){ + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; + }), 'Math', { + imul: function imul(x, y){ + var UINT16 = 0xffff + , xn = +x + , yn = +y + , xl = UINT16 & xn + , yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } + }); + +/***/ }, +/* 114 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.21 Math.log10(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + log10: function log10(x){ + return Math.log(x) / Math.LN10; + } + }); + +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.20 Math.log1p(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', {log1p: __webpack_require__(102)}); + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.22 Math.log2(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + log2: function log2(x){ + return Math.log(x) / Math.LN2; + } + }); + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.28 Math.sign(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', {sign: __webpack_require__(106)}); + +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.30 Math.sinh(x) + var $export = __webpack_require__(6) + , expm1 = __webpack_require__(110) + , exp = Math.exp; + + // V8 near Chromium 38 has a problem with very small numbers + $export($export.S + $export.F * __webpack_require__(5)(function(){ + return !Math.sinh(-2e-17) != -2e-17; + }), 'Math', { + sinh: function sinh(x){ + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } + }); + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.33 Math.tanh(x) + var $export = __webpack_require__(6) + , expm1 = __webpack_require__(110) + , exp = Math.exp; + + $export($export.S, 'Math', { + tanh: function tanh(x){ + var a = expm1(x = +x) + , b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } + }); + +/***/ }, +/* 120 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.2.2.34 Math.trunc(x) + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + trunc: function trunc(it){ + return (it > 0 ? Math.floor : Math.ceil)(it); + } + }); + +/***/ }, +/* 121 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , toIndex = __webpack_require__(37) + , fromCharCode = String.fromCharCode + , $fromCodePoint = String.fromCodePoint; + + // length should be 1, old FF problem + $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars + var res = [] + , aLen = arguments.length + , i = 0 + , code; + while(aLen > i){ + code = +arguments[i++]; + if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } + }); + +/***/ }, +/* 122 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , toLength = __webpack_require__(35); + + $export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite){ + var tpl = toIObject(callSite.raw) + , len = toLength(tpl.length) + , aLen = arguments.length + , res = [] + , i = 0; + while(len > i){ + res.push(String(tpl[i++])); + if(i < aLen)res.push(String(arguments[i])); + } return res.join(''); + } + }); + +/***/ }, +/* 123 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.1.3.25 String.prototype.trim() + __webpack_require__(81)('trim', function($trim){ + return function trim(){ + return $trim(this, 3); + }; + }); + +/***/ }, +/* 124 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $at = __webpack_require__(125)(false); + $export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 125 */ +/***/ function(module, exports, __webpack_require__) { + + var toInteger = __webpack_require__(36) + , defined = __webpack_require__(33); + // true -> String#at + // false -> String#codePointAt + module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + +/***/ }, +/* 126 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + 'use strict'; + var $export = __webpack_require__(6) + , toLength = __webpack_require__(35) + , context = __webpack_require__(127) + , ENDS_WITH = 'endsWith' + , $endsWith = ''[ENDS_WITH]; + + $export($export.P + $export.F * __webpack_require__(129)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /*, endPosition = @length */){ + var that = context(this, searchString, ENDS_WITH) + , endPosition = arguments.length > 1 ? arguments[1] : undefined + , len = toLength(that.length) + , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) + , search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } + }); + +/***/ }, +/* 127 */ +/***/ function(module, exports, __webpack_require__) { + + // helper for String#{startsWith, endsWith, includes} + var isRegExp = __webpack_require__(128) + , defined = __webpack_require__(33); + + module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); + }; + +/***/ }, +/* 128 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.2.8 IsRegExp(argument) + var isObject = __webpack_require__(11) + , cof = __webpack_require__(32) + , MATCH = __webpack_require__(23)('match'); + module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); + }; + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + var MATCH = __webpack_require__(23)('match'); + module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; + }; + +/***/ }, +/* 130 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.7 String.prototype.includes(searchString, position = 0) + 'use strict'; + var $export = __webpack_require__(6) + , context = __webpack_require__(127) + , INCLUDES = 'includes'; + + $export($export.P + $export.F * __webpack_require__(129)(INCLUDES), 'String', { + includes: function includes(searchString /*, position = 0 */){ + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } + }); + +/***/ }, +/* 131 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + + $export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(85) + }); + +/***/ }, +/* 132 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + 'use strict'; + var $export = __webpack_require__(6) + , toLength = __webpack_require__(35) + , context = __webpack_require__(127) + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + + $export($export.P + $export.F * __webpack_require__(129)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } + }); + +/***/ }, +/* 133 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $at = __webpack_require__(125)(true); + + // 21.1.3.27 String.prototype[@@iterator]() + __webpack_require__(134)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index + // 21.1.5.2.1 %StringIteratorPrototype%.next() + }, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; + }); + +/***/ }, +/* 134 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var LIBRARY = __webpack_require__(26) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(16) + , hide = __webpack_require__(8) + , has = __webpack_require__(3) + , Iterators = __webpack_require__(135) + , $iterCreate = __webpack_require__(136) + , setToStringTag = __webpack_require__(22) + , getPrototypeOf = __webpack_require__(57) + , ITERATOR = __webpack_require__(23)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + + var returnThis = function(){ return this; }; + + module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; + }; + +/***/ }, +/* 135 */ +/***/ function(module, exports) { + + module.exports = {}; + +/***/ }, +/* 136 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var create = __webpack_require__(44) + , descriptor = __webpack_require__(15) + , setToStringTag = __webpack_require__(22) + , IteratorPrototype = {}; + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + __webpack_require__(8)(IteratorPrototype, __webpack_require__(23)('iterator'), function(){ return this; }); + + module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); + }; + +/***/ }, +/* 137 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.2 String.prototype.anchor(name) + __webpack_require__(138)('anchor', function(createHTML){ + return function anchor(name){ + return createHTML(this, 'a', 'name', name); + } + }); + +/***/ }, +/* 138 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , fails = __webpack_require__(5) + , defined = __webpack_require__(33) + , quot = /"/g; + // B.2.3.2.1 CreateHTML(string, tag, attribute, value) + var createHTML = function(string, tag, attribute, value) { + var S = String(defined(string)) + , p1 = '<' + tag; + if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; + }; + module.exports = function(NAME, exec){ + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function(){ + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); + }; + +/***/ }, +/* 139 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.3 String.prototype.big() + __webpack_require__(138)('big', function(createHTML){ + return function big(){ + return createHTML(this, 'big', '', ''); + } + }); + +/***/ }, +/* 140 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.4 String.prototype.blink() + __webpack_require__(138)('blink', function(createHTML){ + return function blink(){ + return createHTML(this, 'blink', '', ''); + } + }); + +/***/ }, +/* 141 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.5 String.prototype.bold() + __webpack_require__(138)('bold', function(createHTML){ + return function bold(){ + return createHTML(this, 'b', '', ''); + } + }); + +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.6 String.prototype.fixed() + __webpack_require__(138)('fixed', function(createHTML){ + return function fixed(){ + return createHTML(this, 'tt', '', ''); + } + }); + +/***/ }, +/* 143 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.7 String.prototype.fontcolor(color) + __webpack_require__(138)('fontcolor', function(createHTML){ + return function fontcolor(color){ + return createHTML(this, 'font', 'color', color); + } + }); + +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.8 String.prototype.fontsize(size) + __webpack_require__(138)('fontsize', function(createHTML){ + return function fontsize(size){ + return createHTML(this, 'font', 'size', size); + } + }); + +/***/ }, +/* 145 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.9 String.prototype.italics() + __webpack_require__(138)('italics', function(createHTML){ + return function italics(){ + return createHTML(this, 'i', '', ''); + } + }); + +/***/ }, +/* 146 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.10 String.prototype.link(url) + __webpack_require__(138)('link', function(createHTML){ + return function link(url){ + return createHTML(this, 'a', 'href', url); + } + }); + +/***/ }, +/* 147 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.11 String.prototype.small() + __webpack_require__(138)('small', function(createHTML){ + return function small(){ + return createHTML(this, 'small', '', ''); + } + }); + +/***/ }, +/* 148 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.12 String.prototype.strike() + __webpack_require__(138)('strike', function(createHTML){ + return function strike(){ + return createHTML(this, 'strike', '', ''); + } + }); + +/***/ }, +/* 149 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.13 String.prototype.sub() + __webpack_require__(138)('sub', function(createHTML){ + return function sub(){ + return createHTML(this, 'sub', '', ''); + } + }); + +/***/ }, +/* 150 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // B.2.3.14 String.prototype.sup() + __webpack_require__(138)('sup', function(createHTML){ + return function sup(){ + return createHTML(this, 'sup', '', ''); + } + }); + +/***/ }, +/* 151 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) + var $export = __webpack_require__(6); + + $export($export.S, 'Array', {isArray: __webpack_require__(43)}); + +/***/ }, +/* 152 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var ctx = __webpack_require__(18) + , $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , call = __webpack_require__(153) + , isArrayIter = __webpack_require__(154) + , toLength = __webpack_require__(35) + , createProperty = __webpack_require__(155) + , getIterFn = __webpack_require__(156); + + $export($export.S + $export.F * !__webpack_require__(157)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } + }); + + +/***/ }, +/* 153 */ +/***/ function(module, exports, __webpack_require__) { + + // call something on iterator step with safe closing on error + var anObject = __webpack_require__(10); + module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } + }; + +/***/ }, +/* 154 */ +/***/ function(module, exports, __webpack_require__) { + + // check on default Array iterator + var Iterators = __webpack_require__(135) + , ITERATOR = __webpack_require__(23)('iterator') + , ArrayProto = Array.prototype; + + module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); + }; + +/***/ }, +/* 155 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $defineProperty = __webpack_require__(9) + , createDesc = __webpack_require__(15); + + module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; + }; + +/***/ }, +/* 156 */ +/***/ function(module, exports, __webpack_require__) { + + var classof = __webpack_require__(73) + , ITERATOR = __webpack_require__(23)('iterator') + , Iterators = __webpack_require__(135); + module.exports = __webpack_require__(7).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; + }; + +/***/ }, +/* 157 */ +/***/ function(module, exports, __webpack_require__) { + + var ITERATOR = __webpack_require__(23)('iterator') + , SAFE_CLOSING = false; + + try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); + } catch(e){ /* empty */ } + + module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; + }; + +/***/ }, +/* 158 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , createProperty = __webpack_require__(155); + + // WebKit Array.of isn't generic + $export($export.S + $export.F * __webpack_require__(5)(function(){ + function F(){} + return !(Array.of.call(F) instanceof F); + }), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */){ + var index = 0 + , aLen = arguments.length + , result = new (typeof this == 'function' ? this : Array)(aLen); + while(aLen > index)createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } + }); + +/***/ }, +/* 159 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.13 Array.prototype.join(separator) + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , arrayJoin = [].join; + + // fallback for not array-like strings + $export($export.P + $export.F * (__webpack_require__(31) != Object || !__webpack_require__(160)(arrayJoin)), 'Array', { + join: function join(separator){ + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } + }); + +/***/ }, +/* 160 */ +/***/ function(module, exports, __webpack_require__) { + + var fails = __webpack_require__(5); + + module.exports = function(method, arg){ + return !!method && fails(function(){ + arg ? method.call(null, function(){}, 1) : method.call(null); + }); + }; + +/***/ }, +/* 161 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , html = __webpack_require__(46) + , cof = __webpack_require__(32) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35) + , arraySlice = [].slice; + + // fallback for not array-like ES3 strings and DOM objects + $export($export.P + $export.F * __webpack_require__(5)(function(){ + if(html)arraySlice.call(html); + }), 'Array', { + slice: function slice(begin, end){ + var len = toLength(this.length) + , klass = cof(this); + end = end === undefined ? len : end; + if(klass == 'Array')return arraySlice.call(this, begin, end); + var start = toIndex(begin, len) + , upTo = toIndex(end, len) + , size = toLength(upTo - start) + , cloned = Array(size) + , i = 0; + for(; i < size; i++)cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } + }); + +/***/ }, +/* 162 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , aFunction = __webpack_require__(19) + , toObject = __webpack_require__(56) + , fails = __webpack_require__(5) + , $sort = [].sort + , test = [1, 2, 3]; + + $export($export.P + $export.F * (fails(function(){ + // IE8- + test.sort(undefined); + }) || !fails(function(){ + // V8 bug + test.sort(null); + // Old WebKit + }) || !__webpack_require__(160)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn){ + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } + }); + +/***/ }, +/* 163 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $forEach = __webpack_require__(164)(0) + , STRICT = __webpack_require__(160)([].forEach, true); + + $export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */){ + return $forEach(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 164 */ +/***/ function(module, exports, __webpack_require__) { + + // 0 -> Array#forEach + // 1 -> Array#map + // 2 -> Array#filter + // 3 -> Array#some + // 4 -> Array#every + // 5 -> Array#find + // 6 -> Array#findIndex + var ctx = __webpack_require__(18) + , IObject = __webpack_require__(31) + , toObject = __webpack_require__(56) + , toLength = __webpack_require__(35) + , asc = __webpack_require__(165); + module.exports = function(TYPE, $create){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX + , create = $create || asc; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; + }; + +/***/ }, +/* 165 */ +/***/ function(module, exports, __webpack_require__) { + + // 9.4.2.3 ArraySpeciesCreate(originalArray, length) + var speciesConstructor = __webpack_require__(166); + + module.exports = function(original, length){ + return new (speciesConstructor(original))(length); + }; + +/***/ }, +/* 166 */ +/***/ function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(11) + , isArray = __webpack_require__(43) + , SPECIES = __webpack_require__(23)('species'); + + module.exports = function(original){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return C === undefined ? Array : C; + }; + +/***/ }, +/* 167 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $map = __webpack_require__(164)(1); + + $export($export.P + $export.F * !__webpack_require__(160)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */){ + return $map(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 168 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $filter = __webpack_require__(164)(2); + + $export($export.P + $export.F * !__webpack_require__(160)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */){ + return $filter(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 169 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $some = __webpack_require__(164)(3); + + $export($export.P + $export.F * !__webpack_require__(160)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */){ + return $some(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 170 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $every = __webpack_require__(164)(4); + + $export($export.P + $export.F * !__webpack_require__(160)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */){ + return $every(this, callbackfn, arguments[1]); + } + }); + +/***/ }, +/* 171 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $reduce = __webpack_require__(172); + + $export($export.P + $export.F * !__webpack_require__(160)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } + }); + +/***/ }, +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + var aFunction = __webpack_require__(19) + , toObject = __webpack_require__(56) + , IObject = __webpack_require__(31) + , toLength = __webpack_require__(35); + + module.exports = function(that, callbackfn, aLen, memo, isRight){ + aFunction(callbackfn); + var O = toObject(that) + , self = IObject(O) + , length = toLength(O.length) + , index = isRight ? length - 1 : 0 + , i = isRight ? -1 : 1; + if(aLen < 2)for(;;){ + if(index in self){ + memo = self[index]; + index += i; + break; + } + index += i; + if(isRight ? index < 0 : length <= index){ + throw TypeError('Reduce of empty array with no initial value'); + } + } + for(;isRight ? index >= 0 : length > index; index += i)if(index in self){ + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; + +/***/ }, +/* 173 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $reduce = __webpack_require__(172); + + $export($export.P + $export.F * !__webpack_require__(160)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } + }); + +/***/ }, +/* 174 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $indexOf = __webpack_require__(34)(false) + , $native = [].indexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + + $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(160)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /*, fromIndex = 0 */){ + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } + }); + +/***/ }, +/* 175 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toIObject = __webpack_require__(30) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , $native = [].lastIndexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + + $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(160)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){ + // convert -0 to +0 + if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0; + var O = toIObject(this) + , length = toLength(O.length) + , index = length - 1; + if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1])); + if(index < 0)index = length + index; + for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0; + return -1; + } + }); + +/***/ }, +/* 176 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + var $export = __webpack_require__(6); + + $export($export.P, 'Array', {copyWithin: __webpack_require__(177)}); + + __webpack_require__(178)('copyWithin'); + +/***/ }, +/* 177 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + 'use strict'; + var toObject = __webpack_require__(56) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35); + + module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){ + var O = toObject(this) + , len = toLength(O.length) + , to = toIndex(target, len) + , from = toIndex(start, len) + , end = arguments.length > 2 ? arguments[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; + }; + +/***/ }, +/* 178 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.31 Array.prototype[@@unscopables] + var UNSCOPABLES = __webpack_require__(23)('unscopables') + , ArrayProto = Array.prototype; + if(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(8)(ArrayProto, UNSCOPABLES, {}); + module.exports = function(key){ + ArrayProto[UNSCOPABLES][key] = true; + }; + +/***/ }, +/* 179 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + var $export = __webpack_require__(6); + + $export($export.P, 'Array', {fill: __webpack_require__(180)}); + + __webpack_require__(178)('fill'); + +/***/ }, +/* 180 */ +/***/ function(module, exports, __webpack_require__) { + + // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + 'use strict'; + var toObject = __webpack_require__(56) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35); + module.exports = function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , aLen = arguments.length + , index = toIndex(aLen > 1 ? arguments[1] : undefined, length) + , end = aLen > 2 ? arguments[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; + }; + +/***/ }, +/* 181 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) + var $export = __webpack_require__(6) + , $find = __webpack_require__(164)(5) + , KEY = 'find' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(178)(KEY); + +/***/ }, +/* 182 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) + var $export = __webpack_require__(6) + , $find = __webpack_require__(164)(6) + , KEY = 'findIndex' + , forced = true; + // Shouldn't skip holes + if(KEY in [])Array(1)[KEY](function(){ forced = false; }); + $export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + __webpack_require__(178)(KEY); + +/***/ }, +/* 183 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var addToUnscopables = __webpack_require__(178) + , step = __webpack_require__(184) + , Iterators = __webpack_require__(135) + , toIObject = __webpack_require__(30); + + // 22.1.3.4 Array.prototype.entries() + // 22.1.3.13 Array.prototype.keys() + // 22.1.3.29 Array.prototype.values() + // 22.1.3.30 Array.prototype[@@iterator]() + module.exports = __webpack_require__(134)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind + // 22.1.5.2.1 %ArrayIteratorPrototype%.next() + }, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) + Iterators.Arguments = Iterators.Array; + + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); + +/***/ }, +/* 184 */ +/***/ function(module, exports) { + + module.exports = function(done, value){ + return {value: value, done: !!done}; + }; + +/***/ }, +/* 185 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(186)('Array'); + +/***/ }, +/* 186 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , dP = __webpack_require__(9) + , DESCRIPTORS = __webpack_require__(4) + , SPECIES = __webpack_require__(23)('species'); + + module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); + }; + +/***/ }, +/* 187 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , inheritIfRequired = __webpack_require__(80) + , dP = __webpack_require__(9).f + , gOPN = __webpack_require__(48).f + , isRegExp = __webpack_require__(128) + , $flags = __webpack_require__(188) + , $RegExp = global.RegExp + , Base = $RegExp + , proto = $RegExp.prototype + , re1 = /a/g + , re2 = /a/g + // "new" creates a new object, old webkit buggy here + , CORRECT_NEW = new $RegExp(re1) !== re1; + + if(__webpack_require__(4) && (!CORRECT_NEW || __webpack_require__(5)(function(){ + re2[__webpack_require__(23)('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; + }))){ + $RegExp = function RegExp(p, f){ + var tiRE = this instanceof $RegExp + , piRE = isRegExp(p) + , fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function(key){ + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function(){ return Base[key]; }, + set: function(it){ Base[key] = it; } + }); + }; + for(var keys = gOPN(Base), i = 0; keys.length > i; )proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __webpack_require__(16)(global, 'RegExp', $RegExp); + } + + __webpack_require__(186)('RegExp'); + +/***/ }, +/* 188 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 21.2.5.3 get RegExp.prototype.flags + var anObject = __webpack_require__(10); + module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; + }; + +/***/ }, +/* 189 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + __webpack_require__(190); + var anObject = __webpack_require__(10) + , $flags = __webpack_require__(188) + , DESCRIPTORS = __webpack_require__(4) + , TO_STRING = 'toString' + , $toString = /./[TO_STRING]; + + var define = function(fn){ + __webpack_require__(16)(RegExp.prototype, TO_STRING, fn, true); + }; + + // 21.2.5.14 RegExp.prototype.toString() + if(__webpack_require__(5)(function(){ return $toString.call({source: 'a', flags: 'b'}) != '/a/b'; })){ + define(function toString(){ + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); + // FF44- RegExp#toString has a wrong name + } else if($toString.name != TO_STRING){ + define(function toString(){ + return $toString.call(this); + }); + } + +/***/ }, +/* 190 */ +/***/ function(module, exports, __webpack_require__) { + + // 21.2.5.3 get RegExp.prototype.flags() + if(__webpack_require__(4) && /./g.flags != 'g')__webpack_require__(9).f(RegExp.prototype, 'flags', { + configurable: true, + get: __webpack_require__(188) + }); + +/***/ }, +/* 191 */ +/***/ function(module, exports, __webpack_require__) { + + // @@match logic + __webpack_require__(192)('match', 1, function(defined, MATCH, $match){ + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; + }); + +/***/ }, +/* 192 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var hide = __webpack_require__(8) + , redefine = __webpack_require__(16) + , fails = __webpack_require__(5) + , defined = __webpack_require__(33) + , wks = __webpack_require__(23); + + module.exports = function(KEY, length, exec){ + var SYMBOL = wks(KEY) + , fns = exec(defined, SYMBOL, ''[KEY]) + , strfn = fns[0] + , rxfn = fns[1]; + if(fails(function(){ + var O = {}; + O[SYMBOL] = function(){ return 7; }; + return ''[KEY](O) != 7; + })){ + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function(string, arg){ return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function(string){ return rxfn.call(string, this); } + ); + } + }; + +/***/ }, +/* 193 */ +/***/ function(module, exports, __webpack_require__) { + + // @@replace logic + __webpack_require__(192)('replace', 2, function(defined, REPLACE, $replace){ + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue){ + 'use strict'; + var O = defined(this) + , fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; + }); + +/***/ }, +/* 194 */ +/***/ function(module, exports, __webpack_require__) { + + // @@search logic + __webpack_require__(192)('search', 1, function(defined, SEARCH, $search){ + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; + }); + +/***/ }, +/* 195 */ +/***/ function(module, exports, __webpack_require__) { + + // @@split logic + __webpack_require__(192)('split', 2, function(defined, SPLIT, $split){ + 'use strict'; + var isRegExp = __webpack_require__(128) + , _split = $split + , $push = [].push + , $SPLIT = 'split' + , LENGTH = 'length' + , LAST_INDEX = 'lastIndex'; + if( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ){ + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function(separator, limit){ + var string = String(this); + if(separator === undefined && limit === 0)return []; + // If `separator` is not a regex, use native split + if(!isRegExp(separator))return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while(match = separatorCopy.exec(string)){ + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if(lastIndex > lastLastIndex){ + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){ + for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined; + }); + if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if(output[LENGTH] >= splitLimit)break; + } + if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if(lastLastIndex === string[LENGTH]){ + if(lastLength || !separatorCopy.test(''))output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if('0'[$SPLIT](undefined, 0)[LENGTH]){ + $split = function(separator, limit){ + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit){ + var O = defined(this) + , fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; + }); + +/***/ }, +/* 196 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var LIBRARY = __webpack_require__(26) + , global = __webpack_require__(2) + , ctx = __webpack_require__(18) + , classof = __webpack_require__(73) + , $export = __webpack_require__(6) + , isObject = __webpack_require__(11) + , aFunction = __webpack_require__(19) + , anInstance = __webpack_require__(197) + , forOf = __webpack_require__(198) + , speciesConstructor = __webpack_require__(199) + , task = __webpack_require__(200).set + , microtask = __webpack_require__(201)() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + + var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[__webpack_require__(23)('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } + }(); + + // helpers + var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; + }; + var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; + }; + var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); + }; + var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); + }; + var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } + }; + var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); + }; + var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); + }; + var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; + }; + var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); + }; + var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); + }; + var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } + }; + + // constructor polyfill + if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(202)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + } + + $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); + __webpack_require__(22)($Promise, PROMISE); + __webpack_require__(186)(PROMISE); + Wrapper = __webpack_require__(7)[PROMISE]; + + // statics + $export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } + }); + $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } + }); + $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(157)(function(iter){ + $Promise.all(iter)['catch'](empty); + })), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } + }); + +/***/ }, +/* 197 */ +/***/ function(module, exports) { + + module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; + }; + +/***/ }, +/* 198 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(18) + , call = __webpack_require__(153) + , isArrayIter = __webpack_require__(154) + , anObject = __webpack_require__(10) + , toLength = __webpack_require__(35) + , getIterFn = __webpack_require__(156) + , BREAK = {} + , RETURN = {}; + var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } + }; + exports.BREAK = BREAK; + exports.RETURN = RETURN; + +/***/ }, +/* 199 */ +/***/ function(module, exports, __webpack_require__) { + + // 7.3.20 SpeciesConstructor(O, defaultConstructor) + var anObject = __webpack_require__(10) + , aFunction = __webpack_require__(19) + , SPECIES = __webpack_require__(23)('species'); + module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); + }; + +/***/ }, +/* 200 */ +/***/ function(module, exports, __webpack_require__) { + + var ctx = __webpack_require__(18) + , invoke = __webpack_require__(76) + , html = __webpack_require__(46) + , cel = __webpack_require__(13) + , global = __webpack_require__(2) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; + var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } + }; + var listener = function(event){ + run.call(event.data); + }; + // Node.js 0.9+ & IE10+ has setImmediate, otherwise: + if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(__webpack_require__(32)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } + } + module.exports = { + set: setTask, + clear: clearTask + }; + +/***/ }, +/* 201 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , macrotask = __webpack_require__(200).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = __webpack_require__(32)(process) == 'process'; + + module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; + }; + +/***/ }, +/* 202 */ +/***/ function(module, exports, __webpack_require__) { + + var redefine = __webpack_require__(16); + module.exports = function(target, src, safe){ + for(var key in src)redefine(target, key, src[key], safe); + return target; + }; + +/***/ }, +/* 203 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(204); + + // 23.1 Map Objects + module.exports = __webpack_require__(205)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } + }, strong, true); + +/***/ }, +/* 204 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var dP = __webpack_require__(9).f + , create = __webpack_require__(44) + , redefineAll = __webpack_require__(202) + , ctx = __webpack_require__(18) + , anInstance = __webpack_require__(197) + , defined = __webpack_require__(33) + , forOf = __webpack_require__(198) + , $iterDefine = __webpack_require__(134) + , step = __webpack_require__(184) + , setSpecies = __webpack_require__(186) + , DESCRIPTORS = __webpack_require__(4) + , fastKey = __webpack_require__(20).fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + + var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } + }; + +/***/ }, +/* 205 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , $export = __webpack_require__(6) + , redefine = __webpack_require__(16) + , redefineAll = __webpack_require__(202) + , meta = __webpack_require__(20) + , forOf = __webpack_require__(198) + , anInstance = __webpack_require__(197) + , isObject = __webpack_require__(11) + , fails = __webpack_require__(5) + , $iterDetect = __webpack_require__(157) + , setToStringTag = __webpack_require__(22) + , inheritIfRequired = __webpack_require__(80); + + module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO = !IS_WEAK && fails(function(){ + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C() + , index = 5; + while(index--)$instance[ADDER](index, index); + return !$instance.has(-0); + }); + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base, target, C); + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; + }; + +/***/ }, +/* 206 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strong = __webpack_require__(204); + + // 23.2 Set Objects + module.exports = __webpack_require__(205)('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } + }, strong); + +/***/ }, +/* 207 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var each = __webpack_require__(164)(0) + , redefine = __webpack_require__(16) + , meta = __webpack_require__(20) + , assign = __webpack_require__(67) + , weak = __webpack_require__(208) + , isObject = __webpack_require__(11) + , getWeak = meta.getWeak + , isExtensible = Object.isExtensible + , uncaughtFrozenStore = weak.ufstore + , tmp = {} + , InternalMap; + + var wrapper = function(get){ + return function WeakMap(){ + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; + }; + + var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key){ + if(isObject(key)){ + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value){ + return weak.def(this, key, value); + } + }; + + // 23.3 WeakMap Objects + var $WeakMap = module.exports = __webpack_require__(205)('WeakMap', wrapper, methods, weak, true, true); + + // IE11 WeakMap frozen keys fix + if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ + InternalMap = weak.getConstructor(wrapper); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function(key){ + var proto = $WeakMap.prototype + , method = proto[key]; + redefine(proto, key, function(a, b){ + // store frozen objects on internal weakmap shim + if(isObject(a) && !isExtensible(a)){ + if(!this._f)this._f = new InternalMap; + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); + } + +/***/ }, +/* 208 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var redefineAll = __webpack_require__(202) + , getWeak = __webpack_require__(20).getWeak + , anObject = __webpack_require__(10) + , isObject = __webpack_require__(11) + , anInstance = __webpack_require__(197) + , forOf = __webpack_require__(198) + , createArrayMethod = __webpack_require__(164) + , $has = __webpack_require__(3) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + + // fallback for uncaught frozen keys + var uncaughtFrozenStore = function(that){ + return that._l || (that._l = new UncaughtFrozenStore); + }; + var UncaughtFrozenStore = function(){ + this.a = []; + }; + var findUncaughtFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); + }; + UncaughtFrozenStore.prototype = { + get: function(key){ + var entry = findUncaughtFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findUncaughtFrozen(this, key); + }, + set: function(key, value){ + var entry = findUncaughtFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } + }; + + module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this)['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function(that, key, value){ + var data = getWeak(anObject(key), true); + if(data === true)uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore + }; + +/***/ }, +/* 209 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var weak = __webpack_require__(208); + + // 23.4 WeakSet Objects + __webpack_require__(205)('WeakSet', function(get){ + return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; + }, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value){ + return weak.def(this, value, true); + } + }, weak, false, true); + +/***/ }, +/* 210 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) + var $export = __webpack_require__(6) + , aFunction = __webpack_require__(19) + , anObject = __webpack_require__(10) + , rApply = (__webpack_require__(2).Reflect || {}).apply + , fApply = Function.apply; + // MS Edge argumentsList argument is optional + $export($export.S + $export.F * !__webpack_require__(5)(function(){ + rApply(function(){}); + }), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList){ + var T = aFunction(target) + , L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } + }); + +/***/ }, +/* 211 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) + var $export = __webpack_require__(6) + , create = __webpack_require__(44) + , aFunction = __webpack_require__(19) + , anObject = __webpack_require__(10) + , isObject = __webpack_require__(11) + , fails = __webpack_require__(5) + , bind = __webpack_require__(75) + , rConstruct = (__webpack_require__(2).Reflect || {}).construct; + + // MS Edge supports only 2 arguments and argumentsList argument is optional + // FF Nightly sets third argument as `new.target`, but does not create `this` from it + var NEW_TARGET_BUG = fails(function(){ + function F(){} + return !(rConstruct(function(){}, [], F) instanceof F); + }); + var ARGS_BUG = !fails(function(){ + rConstruct(function(){}); + }); + + $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /*, newTarget*/){ + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget); + if(Target == newTarget){ + // w/o altered newTarget, optimization for 0-4 arguments + switch(args.length){ + case 0: return new Target; + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype + , instance = create(isObject(proto) ? proto : Object.prototype) + , result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } + }); + +/***/ }, +/* 212 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) + var dP = __webpack_require__(9) + , $export = __webpack_require__(6) + , anObject = __webpack_require__(10) + , toPrimitive = __webpack_require__(14); + + // MS Edge has broken Reflect.defineProperty - throwing instead of returning false + $export($export.S + $export.F * __webpack_require__(5)(function(){ + Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2}); + }), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes){ + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 213 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.4 Reflect.deleteProperty(target, propertyKey) + var $export = __webpack_require__(6) + , gOPD = __webpack_require__(49).f + , anObject = __webpack_require__(10); + + $export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey){ + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } + }); + +/***/ }, +/* 214 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 26.1.5 Reflect.enumerate(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(10); + var Enumerate = function(iterated){ + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = [] // keys + , key; + for(key in iterated)keys.push(key); + }; + __webpack_require__(136)(Enumerate, 'Object', function(){ + var that = this + , keys = that._k + , key; + do { + if(that._i >= keys.length)return {value: undefined, done: true}; + } while(!((key = keys[that._i++]) in that._t)); + return {value: key, done: false}; + }); + + $export($export.S, 'Reflect', { + enumerate: function enumerate(target){ + return new Enumerate(target); + } + }); + +/***/ }, +/* 215 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.6 Reflect.get(target, propertyKey [, receiver]) + var gOPD = __webpack_require__(49) + , getPrototypeOf = __webpack_require__(57) + , has = __webpack_require__(3) + , $export = __webpack_require__(6) + , isObject = __webpack_require__(11) + , anObject = __webpack_require__(10); + + function get(target, propertyKey/*, receiver*/){ + var receiver = arguments.length < 3 ? target : arguments[2] + , desc, proto; + if(anObject(target) === receiver)return target[propertyKey]; + if(desc = gOPD.f(target, propertyKey))return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver); + } + + $export($export.S, 'Reflect', {get: get}); + +/***/ }, +/* 216 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) + var gOPD = __webpack_require__(49) + , $export = __webpack_require__(6) + , anObject = __webpack_require__(10); + + $export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ + return gOPD.f(anObject(target), propertyKey); + } + }); + +/***/ }, +/* 217 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.8 Reflect.getPrototypeOf(target) + var $export = __webpack_require__(6) + , getProto = __webpack_require__(57) + , anObject = __webpack_require__(10); + + $export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target){ + return getProto(anObject(target)); + } + }); + +/***/ }, +/* 218 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.9 Reflect.has(target, propertyKey) + var $export = __webpack_require__(6); + + $export($export.S, 'Reflect', { + has: function has(target, propertyKey){ + return propertyKey in target; + } + }); + +/***/ }, +/* 219 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.10 Reflect.isExtensible(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(10) + , $isExtensible = Object.isExtensible; + + $export($export.S, 'Reflect', { + isExtensible: function isExtensible(target){ + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } + }); + +/***/ }, +/* 220 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.11 Reflect.ownKeys(target) + var $export = __webpack_require__(6); + + $export($export.S, 'Reflect', {ownKeys: __webpack_require__(221)}); + +/***/ }, +/* 221 */ +/***/ function(module, exports, __webpack_require__) { + + // all object keys, includes non-enumerable and symbols + var gOPN = __webpack_require__(48) + , gOPS = __webpack_require__(41) + , anObject = __webpack_require__(10) + , Reflect = __webpack_require__(2).Reflect; + module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = gOPN.f(anObject(it)) + , getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; + }; + +/***/ }, +/* 222 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.12 Reflect.preventExtensions(target) + var $export = __webpack_require__(6) + , anObject = __webpack_require__(10) + , $preventExtensions = Object.preventExtensions; + + $export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target){ + anObject(target); + try { + if($preventExtensions)$preventExtensions(target); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 223 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) + var dP = __webpack_require__(9) + , gOPD = __webpack_require__(49) + , getPrototypeOf = __webpack_require__(57) + , has = __webpack_require__(3) + , $export = __webpack_require__(6) + , createDesc = __webpack_require__(15) + , anObject = __webpack_require__(10) + , isObject = __webpack_require__(11); + + function set(target, propertyKey, V/*, receiver*/){ + var receiver = arguments.length < 4 ? target : arguments[3] + , ownDesc = gOPD.f(anObject(target), propertyKey) + , existingDescriptor, proto; + if(!ownDesc){ + if(isObject(proto = getPrototypeOf(target))){ + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if(has(ownDesc, 'value')){ + if(ownDesc.writable === false || !isObject(receiver))return false; + existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); + } + + $export($export.S, 'Reflect', {set: set}); + +/***/ }, +/* 224 */ +/***/ function(module, exports, __webpack_require__) { + + // 26.1.14 Reflect.setPrototypeOf(target, proto) + var $export = __webpack_require__(6) + , setProto = __webpack_require__(71); + + if(setProto)$export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto){ + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch(e){ + return false; + } + } + }); + +/***/ }, +/* 225 */ +/***/ function(module, exports, __webpack_require__) { + + // 20.3.3.1 / 15.9.4.4 Date.now() + var $export = __webpack_require__(6); + + $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); + +/***/ }, +/* 226 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(14); + + $export($export.P + $export.F * __webpack_require__(5)(function(){ + return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1; + }), 'Date', { + toJSON: function toJSON(key){ + var O = toObject(this) + , pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } + }); + +/***/ }, +/* 227 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() + var $export = __webpack_require__(6) + , fails = __webpack_require__(5) + , getTime = Date.prototype.getTime; + + var lz = function(num){ + return num > 9 ? num : '0' + num; + }; + + // PhantomJS / old WebKit has a broken implementations + $export($export.P + $export.F * (fails(function(){ + return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z'; + }) || !fails(function(){ + new Date(NaN).toISOString(); + })), 'Date', { + toISOString: function toISOString(){ + if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value'); + var d = this + , y = d.getUTCFullYear() + , m = d.getUTCMilliseconds() + , s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; + } + }); + +/***/ }, +/* 228 */ +/***/ function(module, exports, __webpack_require__) { + + var DateProto = Date.prototype + , INVALID_DATE = 'Invalid Date' + , TO_STRING = 'toString' + , $toString = DateProto[TO_STRING] + , getTime = DateProto.getTime; + if(new Date(NaN) + '' != INVALID_DATE){ + __webpack_require__(16)(DateProto, TO_STRING, function toString(){ + var value = getTime.call(this); + return value === value ? $toString.call(this) : INVALID_DATE; + }); + } + +/***/ }, +/* 229 */ +/***/ function(module, exports, __webpack_require__) { + + var TO_PRIMITIVE = __webpack_require__(23)('toPrimitive') + , proto = Date.prototype; + + if(!(TO_PRIMITIVE in proto))__webpack_require__(8)(proto, TO_PRIMITIVE, __webpack_require__(230)); + +/***/ }, +/* 230 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var anObject = __webpack_require__(10) + , toPrimitive = __webpack_require__(14) + , NUMBER = 'number'; + + module.exports = function(hint){ + if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); + }; + +/***/ }, +/* 231 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , $typed = __webpack_require__(232) + , buffer = __webpack_require__(233) + , anObject = __webpack_require__(10) + , toIndex = __webpack_require__(37) + , toLength = __webpack_require__(35) + , isObject = __webpack_require__(11) + , ArrayBuffer = __webpack_require__(2).ArrayBuffer + , speciesConstructor = __webpack_require__(199) + , $ArrayBuffer = buffer.ArrayBuffer + , $DataView = buffer.DataView + , $isView = $typed.ABV && ArrayBuffer.isView + , $slice = $ArrayBuffer.prototype.slice + , VIEW = $typed.VIEW + , ARRAY_BUFFER = 'ArrayBuffer'; + + $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer}); + + $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it){ + return $isView && $isView(it) || isObject(it) && VIEW in it; + } + }); + + $export($export.P + $export.U + $export.F * __webpack_require__(5)(function(){ + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; + }), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end){ + if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength + , first = toIndex(start, len) + , final = toIndex(end === undefined ? len : end, len) + , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first)) + , viewS = new $DataView(this) + , viewT = new $DataView(result) + , index = 0; + while(first < final){ + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } + }); + + __webpack_require__(186)(ARRAY_BUFFER); + +/***/ }, +/* 232 */ +/***/ function(module, exports, __webpack_require__) { + + var global = __webpack_require__(2) + , hide = __webpack_require__(8) + , uid = __webpack_require__(17) + , TYPED = uid('typed_array') + , VIEW = uid('view') + , ABV = !!(global.ArrayBuffer && global.DataView) + , CONSTR = ABV + , i = 0, l = 9, Typed; + + var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' + ).split(','); + + while(i < l){ + if(Typed = global[TypedArrayConstructors[i++]]){ + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; + } + + module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW + }; + +/***/ }, +/* 233 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var global = __webpack_require__(2) + , DESCRIPTORS = __webpack_require__(4) + , LIBRARY = __webpack_require__(26) + , $typed = __webpack_require__(232) + , hide = __webpack_require__(8) + , redefineAll = __webpack_require__(202) + , fails = __webpack_require__(5) + , anInstance = __webpack_require__(197) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , gOPN = __webpack_require__(48).f + , dP = __webpack_require__(9).f + , arrayFill = __webpack_require__(180) + , setToStringTag = __webpack_require__(22) + , ARRAY_BUFFER = 'ArrayBuffer' + , DATA_VIEW = 'DataView' + , PROTOTYPE = 'prototype' + , WRONG_LENGTH = 'Wrong length!' + , WRONG_INDEX = 'Wrong index!' + , $ArrayBuffer = global[ARRAY_BUFFER] + , $DataView = global[DATA_VIEW] + , Math = global.Math + , RangeError = global.RangeError + , Infinity = global.Infinity + , BaseBuffer = $ArrayBuffer + , abs = Math.abs + , pow = Math.pow + , floor = Math.floor + , log = Math.log + , LN2 = Math.LN2 + , BUFFER = 'buffer' + , BYTE_LENGTH = 'byteLength' + , BYTE_OFFSET = 'byteOffset' + , $BUFFER = DESCRIPTORS ? '_b' : BUFFER + , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH + , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + + // IEEE754 conversions based on https://github.com/feross/ieee754 + var packIEEE754 = function(value, mLen, nBytes){ + var buffer = Array(nBytes) + , eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0 + , i = 0 + , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0 + , e, m, c; + value = abs(value) + if(value != value || value === Infinity){ + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if(value * (c = pow(2, -e)) < 1){ + e--; + c *= 2; + } + if(e + eBias >= 1){ + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if(value * c >= 2){ + e++; + c /= 2; + } + if(e + eBias >= eMax){ + m = 0; + e = eMax; + } else if(e + eBias >= 1){ + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; + }; + var unpackIEEE754 = function(buffer, mLen, nBytes){ + var eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , nBits = eLen - 7 + , i = nBytes - 1 + , s = buffer[i--] + , e = s & 127 + , m; + s >>= 7; + for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if(e === 0){ + e = 1 - eBias; + } else if(e === eMax){ + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); + }; + + var unpackI32 = function(bytes){ + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; + }; + var packI8 = function(it){ + return [it & 0xff]; + }; + var packI16 = function(it){ + return [it & 0xff, it >> 8 & 0xff]; + }; + var packI32 = function(it){ + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; + }; + var packF64 = function(it){ + return packIEEE754(it, 52, 8); + }; + var packF32 = function(it){ + return packIEEE754(it, 23, 4); + }; + + var addGetter = function(C, key, internal){ + dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }}); + }; + + var get = function(view, bytes, index, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); + }; + var set = function(view, bytes, index, conversion, value, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = conversion(+value); + for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; + }; + + var validateArrayBufferArguments = function(that, length){ + anInstance(that, $ArrayBuffer, ARRAY_BUFFER); + var numberLength = +length + , byteLength = toLength(numberLength); + if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); + return byteLength; + }; + + if(!$typed.ABV){ + $ArrayBuffer = function ArrayBuffer(length){ + var byteLength = validateArrayBufferArguments(this, length); + this._b = arrayFill.call(Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength){ + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH] + , offset = toInteger(byteOffset); + if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if(DESCRIPTORS){ + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset){ + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset){ + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){ + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); + } else { + if(!fails(function(){ + new $ArrayBuffer; // eslint-disable-line no-new + }) || !fails(function(){ + new $ArrayBuffer(.5); // eslint-disable-line no-new + })){ + $ArrayBuffer = function ArrayBuffer(length){ + return new BaseBuffer(validateArrayBufferArguments(this, length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){ + if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]); + }; + if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)) + , $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); + } + setToStringTag($ArrayBuffer, ARRAY_BUFFER); + setToStringTag($DataView, DATA_VIEW); + hide($DataView[PROTOTYPE], $typed.VIEW, true); + exports[ARRAY_BUFFER] = $ArrayBuffer; + exports[DATA_VIEW] = $DataView; + +/***/ }, +/* 234 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6); + $export($export.G + $export.W + $export.F * !__webpack_require__(232).ABV, { + DataView: __webpack_require__(233).DataView + }); + +/***/ }, +/* 235 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Int8', 1, function(init){ + return function Int8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 236 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + if(__webpack_require__(4)){ + var LIBRARY = __webpack_require__(26) + , global = __webpack_require__(2) + , fails = __webpack_require__(5) + , $export = __webpack_require__(6) + , $typed = __webpack_require__(232) + , $buffer = __webpack_require__(233) + , ctx = __webpack_require__(18) + , anInstance = __webpack_require__(197) + , propertyDesc = __webpack_require__(15) + , hide = __webpack_require__(8) + , redefineAll = __webpack_require__(202) + , toInteger = __webpack_require__(36) + , toLength = __webpack_require__(35) + , toIndex = __webpack_require__(37) + , toPrimitive = __webpack_require__(14) + , has = __webpack_require__(3) + , same = __webpack_require__(69) + , classof = __webpack_require__(73) + , isObject = __webpack_require__(11) + , toObject = __webpack_require__(56) + , isArrayIter = __webpack_require__(154) + , create = __webpack_require__(44) + , getPrototypeOf = __webpack_require__(57) + , gOPN = __webpack_require__(48).f + , getIterFn = __webpack_require__(156) + , uid = __webpack_require__(17) + , wks = __webpack_require__(23) + , createArrayMethod = __webpack_require__(164) + , createArrayIncludes = __webpack_require__(34) + , speciesConstructor = __webpack_require__(199) + , ArrayIterators = __webpack_require__(183) + , Iterators = __webpack_require__(135) + , $iterDetect = __webpack_require__(157) + , setSpecies = __webpack_require__(186) + , arrayFill = __webpack_require__(180) + , arrayCopyWithin = __webpack_require__(177) + , $DP = __webpack_require__(9) + , $GOPD = __webpack_require__(49) + , dP = $DP.f + , gOPD = $GOPD.f + , RangeError = global.RangeError + , TypeError = global.TypeError + , Uint8Array = global.Uint8Array + , ARRAY_BUFFER = 'ArrayBuffer' + , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER + , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' + , PROTOTYPE = 'prototype' + , ArrayProto = Array[PROTOTYPE] + , $ArrayBuffer = $buffer.ArrayBuffer + , $DataView = $buffer.DataView + , arrayForEach = createArrayMethod(0) + , arrayFilter = createArrayMethod(2) + , arraySome = createArrayMethod(3) + , arrayEvery = createArrayMethod(4) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , arrayIncludes = createArrayIncludes(true) + , arrayIndexOf = createArrayIncludes(false) + , arrayValues = ArrayIterators.values + , arrayKeys = ArrayIterators.keys + , arrayEntries = ArrayIterators.entries + , arrayLastIndexOf = ArrayProto.lastIndexOf + , arrayReduce = ArrayProto.reduce + , arrayReduceRight = ArrayProto.reduceRight + , arrayJoin = ArrayProto.join + , arraySort = ArrayProto.sort + , arraySlice = ArrayProto.slice + , arrayToString = ArrayProto.toString + , arrayToLocaleString = ArrayProto.toLocaleString + , ITERATOR = wks('iterator') + , TAG = wks('toStringTag') + , TYPED_CONSTRUCTOR = uid('typed_constructor') + , DEF_CONSTRUCTOR = uid('def_constructor') + , ALL_CONSTRUCTORS = $typed.CONSTR + , TYPED_ARRAY = $typed.TYPED + , VIEW = $typed.VIEW + , WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function(O, length){ + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function(){ + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){ + new Uint8Array(1).set({}); + }); + + var strictToLength = function(it, SAME){ + if(it === undefined)throw TypeError(WRONG_LENGTH); + var number = +it + , length = toLength(it); + if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH); + return length; + }; + + var toOffset = function(it, BYTES){ + var offset = toInteger(it); + if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function(it){ + if(isObject(it) && TYPED_ARRAY in it)return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function(C, length){ + if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){ + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function(O, list){ + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function(C, list){ + var index = 0 + , length = list.length + , result = allocate(C, length); + while(length > index)result[index] = list[index++]; + return result; + }; + + var addGetter = function(it, key, internal){ + dP(it, key, {get: function(){ return this._d[internal]; }}); + }; + + var $from = function from(source /*, mapfn, thisArg */){ + var O = toObject(source) + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , iterFn = getIterFn(O) + , i, length, values, result, step, iterator; + if(iterFn != undefined && !isArrayIter(iterFn)){ + for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){ + values.push(step.value); + } O = values; + } + if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2); + for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){ + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/*...items*/){ + var index = 0 + , length = arguments.length + , result = allocate(this, length); + while(length > index)result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString(){ + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /*, end */){ + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /*, thisArg */){ + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /*, thisArg */){ + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /*, thisArg */){ + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /*, thisArg */){ + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /*, thisArg */){ + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /*, fromIndex */){ + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /*, fromIndex */){ + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator){ // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /*, thisArg */){ + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse(){ + var that = this + , length = validate(that).length + , middle = Math.floor(length / 2) + , index = 0 + , value; + while(index < middle){ + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /*, thisArg */){ + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn){ + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end){ + var O = validate(this) + , length = O.length + , $begin = toIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end){ + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /*, offset */){ + validate(this); + var offset = toOffset(arguments[1], 1) + , length = this.length + , src = toObject(arrayLike) + , len = toLength(src.length) + , index = 0; + if(len + offset > length)throw RangeError(WRONG_LENGTH); + while(index < len)this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries(){ + return arrayEntries.call(validate(this)); + }, + keys: function keys(){ + return arrayKeys.call(validate(this)); + }, + values: function values(){ + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function(target, key){ + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key){ + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc){ + if(isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ){ + target[key] = desc.value; + return target; + } else return dP(target, key, desc); + }; + + if(!ALL_CONSTRUCTORS){ + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if(fails(function(){ arrayToString.call({}); })){ + arrayToString = arrayToLocaleString = function toString(){ + return arrayJoin.call(this); + } + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function(){ /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function(){ return this[TYPED_ARRAY]; } + }); + + module.exports = function(KEY, BYTES, wrapper, CLAMPED){ + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array' + , ISNT_UINT8 = NAME != 'Uint8Array' + , GETTER = 'get' + KEY + , SETTER = 'set' + KEY + , TypedArray = global[NAME] + , Base = TypedArray || {} + , TAC = TypedArray && getPrototypeOf(TypedArray) + , FORCED = !TypedArray || !$typed.ABV + , O = {} + , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function(that, index){ + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function(that, index, value){ + var data = that._d; + if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function(that, index){ + dP(that, index, { + get: function(){ + return getter(this, index); + }, + set: function(value){ + return setter(this, index, value); + }, + enumerable: true + }); + }; + if(FORCED){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME, '_d'); + var index = 0 + , offset = 0 + , buffer, byteLength, length, klass; + if(!isObject(data)){ + length = strictToLength(data, true) + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if($length === undefined){ + if($len % BYTES)throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if(byteLength < 0)throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if(TYPED_ARRAY in data){ + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while(index < length)addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if(!$iterDetect(function(iter){ + // V8 works with iterators, but fails in many other cases + // https://code.google.com/p/v8/issues/detail?id=4552 + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8)); + if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if(TYPED_ARRAY in data)return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){ + if(!(key in TypedArray))hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR] + , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined) + , $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){ + dP(TypedArrayPrototype, TAG, { + get: function(){ return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES, + from: $from, + of: $of + }); + + if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, {set: $set}); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString}); + + $export($export.P + $export.F * fails(function(){ + new TypedArray(1).slice(); + }), NAME, {slice: $slice}); + + $export($export.P + $export.F * (fails(function(){ + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString() + }) || !fails(function(){ + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, {toLocaleString: $toLocaleString}); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); + }; + } else module.exports = function(){ /* empty */ }; + +/***/ }, +/* 237 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint8', 1, function(init){ + return function Uint8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 238 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint8', 1, function(init){ + return function Uint8ClampedArray(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }, true); + +/***/ }, +/* 239 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Int16', 2, function(init){ + return function Int16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 240 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint16', 2, function(init){ + return function Uint16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 241 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Int32', 4, function(init){ + return function Int32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 242 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Uint32', 4, function(init){ + return function Uint32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 243 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Float32', 4, function(init){ + return function Float32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 244 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(236)('Float64', 8, function(init){ + return function Float64Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; + }); + +/***/ }, +/* 245 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/Array.prototype.includes + var $export = __webpack_require__(6) + , $includes = __webpack_require__(34)(true); + + $export($export.P, 'Array', { + includes: function includes(el /*, fromIndex = 0 */){ + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + __webpack_require__(178)('includes'); + +/***/ }, +/* 246 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/mathiasbynens/String.prototype.at + var $export = __webpack_require__(6) + , $at = __webpack_require__(125)(true); + + $export($export.P, 'String', { + at: function at(pos){ + return $at(this, pos); + } + }); + +/***/ }, +/* 247 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/proposal-string-pad-start-end + var $export = __webpack_require__(6) + , $pad = __webpack_require__(248); + + $export($export.P, 'String', { + padStart: function padStart(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } + }); + +/***/ }, +/* 248 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-string-pad-start-end + var toLength = __webpack_require__(35) + , repeat = __webpack_require__(85) + , defined = __webpack_require__(33); + + module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength || fillStr == '')return S; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; + }; + + +/***/ }, +/* 249 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/tc39/proposal-string-pad-start-end + var $export = __webpack_require__(6) + , $pad = __webpack_require__(248); + + $export($export.P, 'String', { + padEnd: function padEnd(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } + }); + +/***/ }, +/* 250 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(81)('trimLeft', function($trim){ + return function trimLeft(){ + return $trim(this, 1); + }; + }, 'trimStart'); + +/***/ }, +/* 251 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/sebmarkbage/ecmascript-string-left-right-trim + __webpack_require__(81)('trimRight', function($trim){ + return function trimRight(){ + return $trim(this, 2); + }; + }, 'trimEnd'); + +/***/ }, +/* 252 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://tc39.github.io/String.prototype.matchAll/ + var $export = __webpack_require__(6) + , defined = __webpack_require__(33) + , toLength = __webpack_require__(35) + , isRegExp = __webpack_require__(128) + , getFlags = __webpack_require__(188) + , RegExpProto = RegExp.prototype; + + var $RegExpStringIterator = function(regexp, string){ + this._r = regexp; + this._s = string; + }; + + __webpack_require__(136)($RegExpStringIterator, 'RegExp String', function next(){ + var match = this._r.exec(this._s); + return {value: match, done: match === null}; + }); + + $export($export.P, 'String', { + matchAll: function matchAll(regexp){ + defined(this); + if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!'); + var S = String(this) + , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp) + , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } + }); + +/***/ }, +/* 253 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(25)('asyncIterator'); + +/***/ }, +/* 254 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(25)('observable'); + +/***/ }, +/* 255 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-getownpropertydescriptors + var $export = __webpack_require__(6) + , ownKeys = __webpack_require__(221) + , toIObject = __webpack_require__(30) + , gOPD = __webpack_require__(49) + , createProperty = __webpack_require__(155); + + $export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ + var O = toIObject(object) + , getDesc = gOPD.f + , keys = ownKeys(O) + , result = {} + , i = 0 + , key; + while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key)); + return result; + } + }); + +/***/ }, +/* 256 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-values-entries + var $export = __webpack_require__(6) + , $values = __webpack_require__(257)(false); + + $export($export.S, 'Object', { + values: function values(it){ + return $values(it); + } + }); + +/***/ }, +/* 257 */ +/***/ function(module, exports, __webpack_require__) { + + var getKeys = __webpack_require__(28) + , toIObject = __webpack_require__(30) + , isEnum = __webpack_require__(42).f; + module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; + }; + +/***/ }, +/* 258 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/tc39/proposal-object-values-entries + var $export = __webpack_require__(6) + , $entries = __webpack_require__(257)(true); + + $export($export.S, 'Object', { + entries: function entries(it){ + return $entries(it); + } + }); + +/***/ }, +/* 259 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , aFunction = __webpack_require__(19) + , $defineProperty = __webpack_require__(9); + + // B.2.2.2 Object.prototype.__defineGetter__(P, getter) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __defineGetter__: function __defineGetter__(P, getter){ + $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); + } + }); + +/***/ }, +/* 260 */ +/***/ function(module, exports, __webpack_require__) { + + // Forced replacement prototype accessors methods + module.exports = __webpack_require__(26)|| !__webpack_require__(5)(function(){ + var K = Math.random(); + // In FF throws only define methods + __defineSetter__.call(null, K, function(){ /* empty */}); + delete __webpack_require__(2)[K]; + }); + +/***/ }, +/* 261 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , aFunction = __webpack_require__(19) + , $defineProperty = __webpack_require__(9); + + // B.2.2.3 Object.prototype.__defineSetter__(P, setter) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __defineSetter__: function __defineSetter__(P, setter){ + $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); + } + }); + +/***/ }, +/* 262 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(14) + , getPrototypeOf = __webpack_require__(57) + , getOwnPropertyDescriptor = __webpack_require__(49).f; + + // B.2.2.4 Object.prototype.__lookupGetter__(P) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __lookupGetter__: function __lookupGetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.get; + } while(O = getPrototypeOf(O)); + } + }); + +/***/ }, +/* 263 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var $export = __webpack_require__(6) + , toObject = __webpack_require__(56) + , toPrimitive = __webpack_require__(14) + , getPrototypeOf = __webpack_require__(57) + , getOwnPropertyDescriptor = __webpack_require__(49).f; + + // B.2.2.5 Object.prototype.__lookupSetter__(P) + __webpack_require__(4) && $export($export.P + __webpack_require__(260), 'Object', { + __lookupSetter__: function __lookupSetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.set; + } while(O = getPrototypeOf(O)); + } + }); + +/***/ }, +/* 264 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(6); + + $export($export.P + $export.R, 'Map', {toJSON: __webpack_require__(265)('Map')}); + +/***/ }, +/* 265 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var classof = __webpack_require__(73) + , from = __webpack_require__(266); + module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; + }; + +/***/ }, +/* 266 */ +/***/ function(module, exports, __webpack_require__) { + + var forOf = __webpack_require__(198); + + module.exports = function(iter, ITERATOR){ + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; + }; + + +/***/ }, +/* 267 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/DavidBruant/Map-Set.prototype.toJSON + var $export = __webpack_require__(6); + + $export($export.P + $export.R, 'Set', {toJSON: __webpack_require__(265)('Set')}); + +/***/ }, +/* 268 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/ljharb/proposal-global + var $export = __webpack_require__(6); + + $export($export.S, 'System', {global: __webpack_require__(2)}); + +/***/ }, +/* 269 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/ljharb/proposal-is-error + var $export = __webpack_require__(6) + , cof = __webpack_require__(32); + + $export($export.S, 'Error', { + isError: function isError(it){ + return cof(it) === 'Error'; + } + }); + +/***/ }, +/* 270 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } + }); + +/***/ }, +/* 271 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } + }); + +/***/ }, +/* 272 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + imulh: function imulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >> 16 + , v1 = $v >> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } + }); + +/***/ }, +/* 273 */ +/***/ function(module, exports, __webpack_require__) { + + // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 + var $export = __webpack_require__(6); + + $export($export.S, 'Math', { + umulh: function umulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >>> 16 + , v1 = $v >>> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } + }); + +/***/ }, +/* 274 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + + metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); + }}); + +/***/ }, +/* 275 */ +/***/ function(module, exports, __webpack_require__) { + + var Map = __webpack_require__(203) + , $export = __webpack_require__(6) + , shared = __webpack_require__(21)('metadata') + , store = shared.store || (shared.store = new (__webpack_require__(207))); + + var getOrCreateMetadataMap = function(target, targetKey, create){ + var targetMetadata = store.get(target); + if(!targetMetadata){ + if(!create)return undefined; + store.set(target, targetMetadata = new Map); + } + var keyMetadata = targetMetadata.get(targetKey); + if(!keyMetadata){ + if(!create)return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map); + } return keyMetadata; + }; + var ordinaryHasOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); + }; + var ordinaryGetOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); + }; + var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){ + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); + }; + var ordinaryOwnMetadataKeys = function(target, targetKey){ + var metadataMap = getOrCreateMetadataMap(target, targetKey, false) + , keys = []; + if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); }); + return keys; + }; + var toMetaKey = function(it){ + return it === undefined || typeof it == 'symbol' ? it : String(it); + }; + var exp = function(O){ + $export($export.S, 'Reflect', O); + }; + + module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp + }; + +/***/ }, +/* 276 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , toMetaKey = metadata.key + , getOrCreateMetadataMap = metadata.map + , store = metadata.store; + + metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){ + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]) + , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false; + if(metadataMap.size)return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); + }}); + +/***/ }, +/* 277 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , getPrototypeOf = __webpack_require__(57) + , ordinaryHasOwnMetadata = metadata.has + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + + var ordinaryGetMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; + }; + + metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 278 */ +/***/ function(module, exports, __webpack_require__) { + + var Set = __webpack_require__(206) + , from = __webpack_require__(266) + , metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , getPrototypeOf = __webpack_require__(57) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + + var ordinaryMetadataKeys = function(O, P){ + var oKeys = ordinaryOwnMetadataKeys(O, P) + , parent = getPrototypeOf(O); + if(parent === null)return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; + }; + + metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); + }}); + +/***/ }, +/* 279 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + + metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 280 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + + metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); + }}); + +/***/ }, +/* 281 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , getPrototypeOf = __webpack_require__(57) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + + var ordinaryHasMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; + }; + + metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 282 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + + metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); + }}); + +/***/ }, +/* 283 */ +/***/ function(module, exports, __webpack_require__) { + + var metadata = __webpack_require__(275) + , anObject = __webpack_require__(10) + , aFunction = __webpack_require__(19) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + + metadata.exp({metadata: function metadata(metadataKey, metadataValue){ + return function decorator(target, targetKey){ + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; + }}); + +/***/ }, +/* 284 */ +/***/ function(module, exports, __webpack_require__) { + + // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask + var $export = __webpack_require__(6) + , microtask = __webpack_require__(201)() + , process = __webpack_require__(2).process + , isNode = __webpack_require__(32)(process) == 'process'; + + $export($export.G, { + asap: function asap(fn){ + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } + }); + +/***/ }, +/* 285 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + // https://github.com/zenparsing/es-observable + var $export = __webpack_require__(6) + , global = __webpack_require__(2) + , core = __webpack_require__(7) + , microtask = __webpack_require__(201)() + , OBSERVABLE = __webpack_require__(23)('observable') + , aFunction = __webpack_require__(19) + , anObject = __webpack_require__(10) + , anInstance = __webpack_require__(197) + , redefineAll = __webpack_require__(202) + , hide = __webpack_require__(8) + , forOf = __webpack_require__(198) + , RETURN = forOf.RETURN; + + var getMethod = function(fn){ + return fn == null ? undefined : aFunction(fn); + }; + + var cleanupSubscription = function(subscription){ + var cleanup = subscription._c; + if(cleanup){ + subscription._c = undefined; + cleanup(); + } + }; + + var subscriptionClosed = function(subscription){ + return subscription._o === undefined; + }; + + var closeSubscription = function(subscription){ + if(!subscriptionClosed(subscription)){ + subscription._o = undefined; + cleanupSubscription(subscription); + } + }; + + var Subscription = function(observer, subscriber){ + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer) + , subscription = cleanup; + if(cleanup != null){ + if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch(e){ + observer.error(e); + return; + } if(subscriptionClosed(this))cleanupSubscription(this); + }; + + Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe(){ closeSubscription(this); } + }); + + var SubscriptionObserver = function(subscription){ + this._s = subscription; + }; + + SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if(m)return m.call(observer, value); + } catch(e){ + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value){ + var subscription = this._s; + if(subscriptionClosed(subscription))throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if(!m)throw value; + value = m.call(observer, value); + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } + }); + + var $Observable = function Observable(subscriber){ + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); + }; + + redefineAll($Observable.prototype, { + subscribe: function subscribe(observer){ + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn){ + var that = this; + return new (core.Promise || global.Promise)(function(resolve, reject){ + aFunction(fn); + var subscription = that.subscribe({ + next : function(value){ + try { + return fn(value); + } catch(e){ + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } + }); + + redefineAll($Observable, { + from: function from(x){ + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if(method){ + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function(observer){ + return observable.subscribe(observer); + }); + } + return new C(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + try { + if(forOf(x, false, function(it){ + observer.next(it); + if(done)return RETURN; + }) === RETURN)return; + } catch(e){ + if(done)throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + }, + of: function of(){ + for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + for(var i = 0; i < items.length; ++i){ + observer.next(items[i]); + if(done)return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + } + }); + + hide($Observable.prototype, OBSERVABLE, function(){ return this; }); + + $export($export.G, {Observable: $Observable}); + + __webpack_require__(186)('Observable'); + +/***/ }, +/* 286 */ +/***/ function(module, exports, __webpack_require__) { + + var $export = __webpack_require__(6) + , $task = __webpack_require__(200); + $export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear + }); + +/***/ }, +/* 287 */ +/***/ function(module, exports, __webpack_require__) { + + var $iterators = __webpack_require__(183) + , redefine = __webpack_require__(16) + , global = __webpack_require__(2) + , hide = __webpack_require__(8) + , Iterators = __webpack_require__(135) + , wks = __webpack_require__(23) + , ITERATOR = wks('iterator') + , TO_STRING_TAG = wks('toStringTag') + , ArrayValues = Iterators.Array; + + for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype + , key; + if(proto){ + if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues); + if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); + } + } + +/***/ }, +/* 288 */ +/***/ function(module, exports, __webpack_require__) { + + // ie9- setTimeout & setInterval additional parameters fix + var global = __webpack_require__(2) + , $export = __webpack_require__(6) + , invoke = __webpack_require__(76) + , partial = __webpack_require__(289) + , navigator = global.navigator + , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check + var wrap = function(set){ + return MSIE ? function(fn, time /*, ...args */){ + return set(invoke( + partial, + [].slice.call(arguments, 2), + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; + }; + $export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) + }); + +/***/ }, +/* 289 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var path = __webpack_require__(290) + , invoke = __webpack_require__(76) + , aFunction = __webpack_require__(19); + module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , aLen = arguments.length + , j = 0, k = 0, args; + if(!holder && !aLen)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; + while(aLen > k)args.push(arguments[k++]); + return invoke(fn, args, that); + }; + }; + +/***/ }, +/* 290 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(2); + +/***/ } +/******/ ]); +// CommonJS export +if(typeof module != 'undefined' && module.exports)module.exports = __e; +// RequireJS export +else if(typeof define == 'function' && define.amd)define(function(){return __e}); +// Export to global object +else __g.core = __e; +}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/shim.min.js b/node_modules/core-js/client/shim.min.js new file mode 100755 index 00000000..e532c683 --- /dev/null +++ b/node_modules/core-js/client/shim.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.4.1 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2016 Denis Pushkarev + */ +!function(a,b,c){"use strict";!function(a){function __webpack_require__(c){if(b[c])return b[c].exports;var d=b[c]={exports:{},id:c,loaded:!1};return a[c].call(d.exports,d,d.exports,__webpack_require__),d.loaded=!0,d.exports}var b={};return __webpack_require__.m=a,__webpack_require__.c=b,__webpack_require__.p="",__webpack_require__(0)}([function(a,b,c){c(1),c(50),c(51),c(52),c(54),c(55),c(58),c(59),c(60),c(61),c(62),c(63),c(64),c(65),c(66),c(68),c(70),c(72),c(74),c(77),c(78),c(79),c(83),c(86),c(87),c(88),c(89),c(91),c(92),c(93),c(94),c(95),c(97),c(99),c(100),c(101),c(103),c(104),c(105),c(107),c(108),c(109),c(111),c(112),c(113),c(114),c(115),c(116),c(117),c(118),c(119),c(120),c(121),c(122),c(123),c(124),c(126),c(130),c(131),c(132),c(133),c(137),c(139),c(140),c(141),c(142),c(143),c(144),c(145),c(146),c(147),c(148),c(149),c(150),c(151),c(152),c(158),c(159),c(161),c(162),c(163),c(167),c(168),c(169),c(170),c(171),c(173),c(174),c(175),c(176),c(179),c(181),c(182),c(183),c(185),c(187),c(189),c(190),c(191),c(193),c(194),c(195),c(196),c(203),c(206),c(207),c(209),c(210),c(211),c(212),c(213),c(214),c(215),c(216),c(217),c(218),c(219),c(220),c(222),c(223),c(224),c(225),c(226),c(227),c(228),c(229),c(231),c(234),c(235),c(237),c(238),c(239),c(240),c(241),c(242),c(243),c(244),c(245),c(246),c(247),c(249),c(250),c(251),c(252),c(253),c(254),c(255),c(256),c(258),c(259),c(261),c(262),c(263),c(264),c(267),c(268),c(269),c(270),c(271),c(272),c(273),c(274),c(276),c(277),c(278),c(279),c(280),c(281),c(282),c(283),c(284),c(285),c(286),c(287),a.exports=c(288)},function(a,b,d){var e=d(2),f=d(3),g=d(4),h=d(6),i=d(16),j=d(20).KEY,k=d(5),l=d(21),m=d(22),n=d(17),o=d(23),p=d(24),q=d(25),r=d(27),s=d(40),t=d(43),u=d(10),v=d(30),w=d(14),x=d(15),y=d(44),z=d(47),A=d(49),B=d(9),C=d(28),D=A.f,E=B.f,F=z.f,G=e.Symbol,H=e.JSON,I=H&&H.stringify,J="prototype",K=o("_hidden"),L=o("toPrimitive"),M={}.propertyIsEnumerable,N=l("symbol-registry"),O=l("symbols"),P=l("op-symbols"),Q=Object[J],R="function"==typeof G,S=e.QObject,T=!S||!S[J]||!S[J].findChild,U=g&&k(function(){return 7!=y(E({},"a",{get:function(){return E(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=D(Q,b);d&&delete Q[b],E(a,b,c),d&&a!==Q&&E(Q,b,d)}:E,V=function(a){var b=O[a]=y(G[J]);return b._k=a,b},W=R&&"symbol"==typeof G.iterator?function(a){return"symbol"==typeof a}:function(a){return a instanceof G},X=function defineProperty(a,b,c){return a===Q&&X(P,b,c),u(a),b=w(b,!0),u(c),f(O,b)?(c.enumerable?(f(a,K)&&a[K][b]&&(a[K][b]=!1),c=y(c,{enumerable:x(0,!1)})):(f(a,K)||E(a,K,x(1,{})),a[K][b]=!0),U(a,b,c)):E(a,b,c)},Y=function defineProperties(a,b){u(a);for(var c,d=s(b=v(b)),e=0,f=d.length;f>e;)X(a,c=d[e++],b[c]);return a},Z=function create(a,b){return b===c?y(a):Y(y(a),b)},$=function propertyIsEnumerable(a){var b=M.call(this,a=w(a,!0));return!(this===Q&&f(O,a)&&!f(P,a))&&(!(b||!f(this,a)||!f(O,a)||f(this,K)&&this[K][a])||b)},_=function getOwnPropertyDescriptor(a,b){if(a=v(a),b=w(b,!0),a!==Q||!f(O,b)||f(P,b)){var c=D(a,b);return!c||!f(O,b)||f(a,K)&&a[K][b]||(c.enumerable=!0),c}},aa=function getOwnPropertyNames(a){for(var b,c=F(v(a)),d=[],e=0;c.length>e;)f(O,b=c[e++])||b==K||b==j||d.push(b);return d},ba=function getOwnPropertySymbols(a){for(var b,c=a===Q,d=F(c?P:v(a)),e=[],g=0;d.length>g;)!f(O,b=d[g++])||c&&!f(Q,b)||e.push(O[b]);return e};R||(G=function Symbol(){if(this instanceof G)throw TypeError("Symbol is not a constructor!");var a=n(arguments.length>0?arguments[0]:c),b=function(c){this===Q&&b.call(P,c),f(this,K)&&f(this[K],a)&&(this[K][a]=!1),U(this,a,x(1,c))};return g&&T&&U(Q,a,{configurable:!0,set:b}),V(a)},i(G[J],"toString",function toString(){return this._k}),A.f=_,B.f=X,d(48).f=z.f=aa,d(42).f=$,d(41).f=ba,g&&!d(26)&&i(Q,"propertyIsEnumerable",$,!0),p.f=function(a){return V(o(a))}),h(h.G+h.W+h.F*!R,{Symbol:G});for(var ca="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),da=0;ca.length>da;)o(ca[da++]);for(var ca=C(o.store),da=0;ca.length>da;)q(ca[da++]);h(h.S+h.F*!R,"Symbol",{"for":function(a){return f(N,a+="")?N[a]:N[a]=G(a)},keyFor:function keyFor(a){if(W(a))return r(N,a);throw TypeError(a+" is not a symbol!")},useSetter:function(){T=!0},useSimple:function(){T=!1}}),h(h.S+h.F*!R,"Object",{create:Z,defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:_,getOwnPropertyNames:aa,getOwnPropertySymbols:ba}),H&&h(h.S+h.F*(!R||k(function(){var a=G();return"[null]"!=I([a])||"{}"!=I({a:a})||"{}"!=I(Object(a))})),"JSON",{stringify:function stringify(a){if(a!==c&&!W(a)){for(var b,d,e=[a],f=1;arguments.length>f;)e.push(arguments[f++]);return b=e[1],"function"==typeof b&&(d=b),!d&&t(b)||(b=function(a,b){if(d&&(b=d.call(this,a,b)),!W(b))return b}),e[1]=b,I.apply(H,e)}}}),G[J][L]||d(8)(G[J],L,G[J].valueOf),m(G,"Symbol"),m(Math,"Math",!0),m(e.JSON,"JSON",!0)},function(a,c){var d=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof b&&(b=d)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){a.exports=!c(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,d){var e=d(2),f=d(7),g=d(8),h=d(16),i=d(18),j="prototype",k=function(a,b,d){var l,m,n,o,p=a&k.F,q=a&k.G,r=a&k.S,s=a&k.P,t=a&k.B,u=q?e:r?e[b]||(e[b]={}):(e[b]||{})[j],v=q?f:f[b]||(f[b]={}),w=v[j]||(v[j]={});q&&(d=b);for(l in d)m=!p&&u&&u[l]!==c,n=(m?u:d)[l],o=t&&m?i(n,e):s&&"function"==typeof n?i(Function.call,n):n,u&&h(u,l,n,a&k.U),v[l]!=n&&g(v,l,o),s&&w[l]!=n&&(w[l]=n)};e.core=f,k.F=1,k.G=2,k.S=4,k.P=8,k.B=16,k.W=32,k.U=64,k.R=128,a.exports=k},function(b,c){var d=b.exports={version:"2.4.0"};"number"==typeof a&&(a=d)},function(a,b,c){var d=c(9),e=c(15);a.exports=c(4)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b,c){var d=c(10),e=c(12),f=c(14),g=Object.defineProperty;b.f=c(4)?Object.defineProperty:function defineProperty(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(h){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},function(a,b,c){var d=c(11);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){a.exports=!c(4)&&!c(5)(function(){return 7!=Object.defineProperty(c(13)("div"),"a",{get:function(){return 7}}).a})},function(a,b,c){var d=c(11),e=c(2).document,f=d(e)&&d(e.createElement);a.exports=function(a){return f?e.createElement(a):{}}},function(a,b,c){var d=c(11);a.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(2),e=c(8),f=c(3),g=c(17)("src"),h="toString",i=Function[h],j=(""+i).split(h);c(7).inspectSource=function(a){return i.call(a)},(a.exports=function(a,b,c,h){var i="function"==typeof c;i&&(f(c,"name")||e(c,"name",b)),a[b]!==c&&(i&&(f(c,g)||e(c,g,a[b]?""+a[b]:j.join(String(b)))),a===d?a[b]=c:h?a[b]?a[b]=c:e(a,b,c):(delete a[b],e(a,b,c)))})(Function.prototype,h,function toString(){return"function"==typeof this&&this[g]||i.call(this)})},function(a,b){var d=0,e=Math.random();a.exports=function(a){return"Symbol(".concat(a===c?"":a,")_",(++d+e).toString(36))}},function(a,b,d){var e=d(19);a.exports=function(a,b,d){if(e(a),b===c)return a;switch(d){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){var d=c(17)("meta"),e=c(11),f=c(3),g=c(9).f,h=0,i=Object.isExtensible||function(){return!0},j=!c(5)(function(){return i(Object.preventExtensions({}))}),k=function(a){g(a,d,{value:{i:"O"+ ++h,w:{}}})},l=function(a,b){if(!e(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!f(a,d)){if(!i(a))return"F";if(!b)return"E";k(a)}return a[d].i},m=function(a,b){if(!f(a,d)){if(!i(a))return!0;if(!b)return!1;k(a)}return a[d].w},n=function(a){return j&&o.NEED&&i(a)&&!f(a,d)&&k(a),a},o=a.exports={KEY:d,NEED:!1,fastKey:l,getWeak:m,onFreeze:n}},function(a,b,c){var d=c(2),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d=c(9).f,e=c(3),f=c(23)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(21)("wks"),e=c(17),f=c(2).Symbol,g="function"==typeof f,h=a.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))};h.store=d},function(a,b,c){b.f=c(23)},function(a,b,c){var d=c(2),e=c(7),f=c(26),g=c(24),h=c(9).f;a.exports=function(a){var b=e.Symbol||(e.Symbol=f?{}:d.Symbol||{});"_"==a.charAt(0)||a in b||h(b,a,{value:g.f(a)})}},function(a,b){a.exports=!1},function(a,b,c){var d=c(28),e=c(30);a.exports=function(a,b){for(var c,f=e(a),g=d(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},function(a,b,c){var d=c(29),e=c(39);a.exports=Object.keys||function keys(a){return d(a,e)}},function(a,b,c){var d=c(3),e=c(30),f=c(34)(!1),g=c(38)("IE_PROTO");a.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},function(a,b,c){var d=c(31),e=c(33);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(32);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(a==c)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(30),e=c(35),f=c(37);a.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if(h=i[k++],h!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},function(a,b,c){var d=c(36),e=Math.min;a.exports=function(a){return a>0?e(d(a),9007199254740991):0}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){var d=c(36),e=Math.max,f=Math.min;a.exports=function(a,b){return a=d(a),a<0?e(a+b,0):f(a,b)}},function(a,b,c){var d=c(21)("keys"),e=c(17);a.exports=function(a){return d[a]||(d[a]=e(a))}},function(a,b){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,b,c){var d=c(28),e=c(41),f=c(42);a.exports=function(a){var b=d(a),c=e.f;if(c)for(var g,h=c(a),i=f.f,j=0;h.length>j;)i.call(a,g=h[j++])&&b.push(g);return b}},function(a,b){b.f=Object.getOwnPropertySymbols},function(a,b){b.f={}.propertyIsEnumerable},function(a,b,c){var d=c(32);a.exports=Array.isArray||function isArray(a){return"Array"==d(a)}},function(a,b,d){var e=d(10),f=d(45),g=d(39),h=d(38)("IE_PROTO"),i=function(){},j="prototype",k=function(){var a,b=d(13)("iframe"),c=g.length,e="<",f=">";for(b.style.display="none",d(46).appendChild(b),b.src="javascript:",a=b.contentWindow.document,a.open(),a.write(e+"script"+f+"document.F=Object"+e+"/script"+f),a.close(),k=a.F;c--;)delete k[j][g[c]];return k()};a.exports=Object.create||function create(a,b){var d;return null!==a?(i[j]=e(a),d=new i,i[j]=null,d[h]=a):d=k(),b===c?d:f(d,b)}},function(a,b,c){var d=c(9),e=c(10),f=c(28);a.exports=c(4)?Object.defineProperties:function defineProperties(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},function(a,b,c){a.exports=c(2).document&&document.documentElement},function(a,b,c){var d=c(30),e=c(48).f,f={}.toString,g="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(b){return g.slice()}};a.exports.f=function getOwnPropertyNames(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},function(a,b,c){var d=c(29),e=c(39).concat("length","prototype");b.f=Object.getOwnPropertyNames||function getOwnPropertyNames(a){return d(a,e)}},function(a,b,c){var d=c(42),e=c(15),f=c(30),g=c(14),h=c(3),i=c(12),j=Object.getOwnPropertyDescriptor;b.f=c(4)?j:function getOwnPropertyDescriptor(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(c){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperty:c(9).f})},function(a,b,c){var d=c(6);d(d.S+d.F*!c(4),"Object",{defineProperties:c(45)})},function(a,b,c){var d=c(30),e=c(49).f;c(53)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(a,b){return e(d(a),b)}})},function(a,b,c){var d=c(6),e=c(7),f=c(5);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){var d=c(6);d(d.S,"Object",{create:c(44)})},function(a,b,c){var d=c(56),e=c(57);c(53)("getPrototypeOf",function(){return function getPrototypeOf(a){return e(d(a))}})},function(a,b,c){var d=c(33);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(3),e=c(56),f=c(38)("IE_PROTO"),g=Object.prototype;a.exports=Object.getPrototypeOf||function(a){return a=e(a),d(a,f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},function(a,b,c){var d=c(56),e=c(28);c(53)("keys",function(){return function keys(a){return e(d(a))}})},function(a,b,c){c(53)("getOwnPropertyNames",function(){return c(47).f})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("freeze",function(a){return function freeze(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("seal",function(a){return function seal(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11),e=c(20).onFreeze;c(53)("preventExtensions",function(a){return function preventExtensions(b){return a&&d(b)?a(e(b)):b}})},function(a,b,c){var d=c(11);c(53)("isFrozen",function(a){return function isFrozen(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(11);c(53)("isSealed",function(a){return function isSealed(b){return!d(b)||!!a&&a(b)}})},function(a,b,c){var d=c(11);c(53)("isExtensible",function(a){return function isExtensible(b){return!!d(b)&&(!a||a(b))}})},function(a,b,c){var d=c(6);d(d.S+d.F,"Object",{assign:c(67)})},function(a,b,c){var d=c(28),e=c(41),f=c(42),g=c(56),h=c(31),i=Object.assign;a.exports=!i||c(5)(function(){var a={},b={},c=Symbol(),d="abcdefghijklmnopqrst";return a[c]=7,d.split("").forEach(function(a){b[a]=a}),7!=i({},a)[c]||Object.keys(i({},b)).join("")!=d})?function assign(a,b){for(var c=g(a),i=arguments.length,j=1,k=e.f,l=f.f;i>j;)for(var m,n=h(arguments[j++]),o=k?d(n).concat(k(n)):d(n),p=o.length,q=0;p>q;)l.call(n,m=o[q++])&&(c[m]=n[m]);return c}:i},function(a,b,c){var d=c(6);d(d.S,"Object",{is:c(69)})},function(a,b){a.exports=Object.is||function is(a,b){return a===b?0!==a||1/a===1/b:a!=a&&b!=b}},function(a,b,c){var d=c(6);d(d.S,"Object",{setPrototypeOf:c(71).set})},function(a,b,d){var e=d(11),f=d(10),g=function(a,b){if(f(a),!e(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};a.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(a,b,c){try{c=d(18)(Function.call,d(49).f(Object.prototype,"__proto__").set,2),c(a,[]),b=!(a instanceof Array)}catch(e){b=!0}return function setPrototypeOf(a,d){return g(a,d),b?a.__proto__=d:c(a,d),a}}({},!1):c),check:g}},function(a,b,c){var d=c(73),e={};e[c(23)("toStringTag")]="z",e+""!="[object z]"&&c(16)(Object.prototype,"toString",function toString(){return"[object "+d(this)+"]"},!0)},function(a,b,d){var e=d(32),f=d(23)("toStringTag"),g="Arguments"==e(function(){return arguments}()),h=function(a,b){try{return a[b]}catch(c){}};a.exports=function(a){var b,d,i;return a===c?"Undefined":null===a?"Null":"string"==typeof(d=h(b=Object(a),f))?d:g?e(b):"Object"==(i=e(b))&&"function"==typeof b.callee?"Arguments":i}},function(a,b,c){var d=c(6);d(d.P,"Function",{bind:c(75)})},function(a,b,c){var d=c(19),e=c(11),f=c(76),g=[].slice,h={},i=function(a,b,c){if(!(b in h)){for(var d=[],e=0;e2){b=s?b.trim():m(b,3);var c,d,e,f=b.charCodeAt(0);if(43===f||45===f){if(c=b.charCodeAt(2),88===c||120===c)return NaN}else if(48===f){switch(b.charCodeAt(1)){case 66:case 98:d=2,e=49;break;case 79:case 111:d=8,e=55;break;default:return+b}for(var g,i=b.slice(2),j=0,k=i.length;je)return NaN;return parseInt(i,d)}}return+b};if(!o(" 0o1")||!o("0b1")||o("+0x1")){o=function Number(a){var b=arguments.length<1?0:a,c=this;return c instanceof o&&(r?i(function(){q.valueOf.call(c)}):f(c)!=n)?g(new p(t(b)),c,o):t(b)};for(var u,v=c(4)?j(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;v.length>w;w++)e(p,u=v[w])&&!e(o,u)&&l(o,u,k(p,u));o.prototype=q,q.constructor=o,c(16)(d,n,o)}},function(a,b,c){var d=c(11),e=c(71).set;a.exports=function(a,b,c){var f,g=b.constructor;return g!==c&&"function"==typeof g&&(f=g.prototype)!==c.prototype&&d(f)&&e&&e(a,f),a}},function(a,b,c){var d=c(6),e=c(33),f=c(5),g=c(82),h="["+g+"]",i="​…",j=RegExp("^"+h+h+"*"),k=RegExp(h+h+"*$"),l=function(a,b,c){var e={},h=f(function(){return!!g[a]()||i[a]()!=i}),j=e[a]=h?b(m):g[a];c&&(e[c]=j),d(d.P+d.F*h,"String",e)},m=l.trim=function(a,b){return a=String(e(a)),1&b&&(a=a.replace(j,"")),2&b&&(a=a.replace(k,"")),a};a.exports=l},function(a,b){a.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},function(a,b,c){var d=c(6),e=c(36),f=c(84),g=c(85),h=1..toFixed,i=Math.floor,j=[0,0,0,0,0,0],k="Number.toFixed: incorrect invocation!",l="0",m=function(a,b){for(var c=-1,d=b;++c<6;)d+=a*j[c],j[c]=d%1e7,d=i(d/1e7)},n=function(a){for(var b=6,c=0;--b>=0;)c+=j[b],j[b]=i(c/a),c=c%a*1e7},o=function(){for(var a=6,b="";--a>=0;)if(""!==b||0===a||0!==j[a]){var c=String(j[a]);b=""===b?c:b+g.call(l,7-c.length)+c}return b},p=function(a,b,c){return 0===b?c:b%2===1?p(a,b-1,c*a):p(a*a,b/2,c)},q=function(a){for(var b=0,c=a;c>=4096;)b+=12,c/=4096;for(;c>=2;)b+=1,c/=2;return b};d(d.P+d.F*(!!h&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!c(5)(function(){h.call({})})),"Number",{toFixed:function toFixed(a){var b,c,d,h,i=f(this,k),j=e(a),r="",s=l;if(j<0||j>20)throw RangeError(k);if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return String(i);if(i<0&&(r="-",i=-i),i>1e-21)if(b=q(i*p(2,69,1))-69,c=b<0?i*p(2,-b,1):i/p(2,b,1),c*=4503599627370496,b=52-b,b>0){for(m(0,c),d=j;d>=7;)m(1e7,0),d-=7;for(m(p(10,d,1),0),d=b-1;d>=23;)n(1<<23),d-=23;n(1<0?(h=s.length,s=r+(h<=j?"0."+g.call(l,j-h)+s:s.slice(0,h-j)+"."+s.slice(h-j))):s=r+s,s}})},function(a,b,c){var d=c(32);a.exports=function(a,b){if("number"!=typeof a&&"Number"!=d(a))throw TypeError(b);return+a}},function(a,b,c){var d=c(36),e=c(33);a.exports=function repeat(a){var b=String(e(this)),c="",f=d(a);if(f<0||f==1/0)throw RangeError("Count can't be negative");for(;f>0;(f>>>=1)&&(b+=b))1&f&&(c+=b);return c}},function(a,b,d){var e=d(6),f=d(5),g=d(84),h=1..toPrecision;e(e.P+e.F*(f(function(){return"1"!==h.call(1,c)})||!f(function(){h.call({})})),"Number",{toPrecision:function toPrecision(a){var b=g(this,"Number#toPrecision: incorrect invocation!");return a===c?h.call(b):h.call(b,a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{EPSILON:Math.pow(2,-52)})},function(a,b,c){var d=c(6),e=c(2).isFinite;d(d.S,"Number",{isFinite:function isFinite(a){return"number"==typeof a&&e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Number",{isInteger:c(90)})},function(a,b,c){var d=c(11),e=Math.floor;a.exports=function isInteger(a){return!d(a)&&isFinite(a)&&e(a)===a}},function(a,b,c){var d=c(6);d(d.S,"Number",{isNaN:function isNaN(a){return a!=a}})},function(a,b,c){var d=c(6),e=c(90),f=Math.abs;d(d.S,"Number",{isSafeInteger:function isSafeInteger(a){return e(a)&&f(a)<=9007199254740991}})},function(a,b,c){var d=c(6);d(d.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(a,b,c){var d=c(6);d(d.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(a,b,c){var d=c(6),e=c(96);d(d.S+d.F*(Number.parseFloat!=e),"Number",{parseFloat:e})},function(a,b,c){var d=c(2).parseFloat,e=c(81).trim;a.exports=1/d(c(82)+"-0")!==-(1/0)?function parseFloat(a){var b=e(String(a),3),c=d(b);return 0===c&&"-"==b.charAt(0)?-0:c}:d},function(a,b,c){var d=c(6),e=c(98);d(d.S+d.F*(Number.parseInt!=e),"Number",{parseInt:e})},function(a,b,c){var d=c(2).parseInt,e=c(81).trim,f=c(82),g=/^[\-+]?0[xX]/;a.exports=8!==d(f+"08")||22!==d(f+"0x16")?function parseInt(a,b){var c=e(String(a),3);return d(c,b>>>0||(g.test(c)?16:10))}:d},function(a,b,c){var d=c(6),e=c(98);d(d.G+d.F*(parseInt!=e),{parseInt:e})},function(a,b,c){var d=c(6),e=c(96);d(d.G+d.F*(parseFloat!=e),{parseFloat:e})},function(a,b,c){var d=c(6),e=c(102),f=Math.sqrt,g=Math.acosh;d(d.S+d.F*!(g&&710==Math.floor(g(Number.MAX_VALUE))&&g(1/0)==1/0),"Math",{acosh:function acosh(a){return(a=+a)<1?NaN:a>94906265.62425156?Math.log(a)+Math.LN2:e(a-1+f(a-1)*f(a+1))}})},function(a,b){a.exports=Math.log1p||function log1p(a){return(a=+a)>-1e-8&&a<1e-8?a-a*a/2:Math.log(1+a)}},function(a,b,c){function asinh(a){return isFinite(a=+a)&&0!=a?a<0?-asinh(-a):Math.log(a+Math.sqrt(a*a+1)):a}var d=c(6),e=Math.asinh;d(d.S+d.F*!(e&&1/e(0)>0),"Math",{asinh:asinh})},function(a,b,c){var d=c(6),e=Math.atanh;d(d.S+d.F*!(e&&1/e(-0)<0),"Math",{atanh:function atanh(a){return 0==(a=+a)?a:Math.log((1+a)/(1-a))/2}})},function(a,b,c){var d=c(6),e=c(106);d(d.S,"Math",{cbrt:function cbrt(a){return e(a=+a)*Math.pow(Math.abs(a),1/3)}})},function(a,b){a.exports=Math.sign||function sign(a){return 0==(a=+a)||a!=a?a:a<0?-1:1}},function(a,b,c){var d=c(6);d(d.S,"Math",{clz32:function clz32(a){return(a>>>=0)?31-Math.floor(Math.log(a+.5)*Math.LOG2E):32}})},function(a,b,c){var d=c(6),e=Math.exp;d(d.S,"Math",{cosh:function cosh(a){return(e(a=+a)+e(-a))/2}})},function(a,b,c){var d=c(6),e=c(110);d(d.S+d.F*(e!=Math.expm1),"Math",{expm1:e})},function(a,b){var c=Math.expm1;a.exports=!c||c(10)>22025.465794806718||c(10)<22025.465794806718||c(-2e-17)!=-2e-17?function expm1(a){return 0==(a=+a)?a:a>-1e-6&&a<1e-6?a+a*a/2:Math.exp(a)-1}:c},function(a,b,c){var d=c(6),e=c(106),f=Math.pow,g=f(2,-52),h=f(2,-23),i=f(2,127)*(2-h),j=f(2,-126),k=function(a){return a+1/g-1/g};d(d.S,"Math",{fround:function fround(a){var b,c,d=Math.abs(a),f=e(a);return di||c!=c?f*(1/0):f*c)}})},function(a,b,c){var d=c(6),e=Math.abs;d(d.S,"Math",{hypot:function hypot(a,b){for(var c,d,f=0,g=0,h=arguments.length,i=0;g0?(d=c/i,f+=d*d):f+=c;return i===1/0?1/0:i*Math.sqrt(f)}})},function(a,b,c){var d=c(6),e=Math.imul;d(d.S+d.F*c(5)(function(){return e(4294967295,5)!=-5||2!=e.length}),"Math",{imul:function imul(a,b){var c=65535,d=+a,e=+b,f=c&d,g=c&e;return 0|f*g+((c&d>>>16)*g+f*(c&e>>>16)<<16>>>0)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log10:function log10(a){return Math.log(a)/Math.LN10}})},function(a,b,c){var d=c(6);d(d.S,"Math",{log1p:c(102)})},function(a,b,c){var d=c(6);d(d.S,"Math",{log2:function log2(a){return Math.log(a)/Math.LN2}})},function(a,b,c){var d=c(6);d(d.S,"Math",{sign:c(106)})},function(a,b,c){var d=c(6),e=c(110),f=Math.exp;d(d.S+d.F*c(5)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function sinh(a){return Math.abs(a=+a)<1?(e(a)-e(-a))/2:(f(a-1)-f(-a-1))*(Math.E/2)}})},function(a,b,c){var d=c(6),e=c(110),f=Math.exp;d(d.S,"Math",{tanh:function tanh(a){var b=e(a=+a),c=e(-a);return b==1/0?1:c==1/0?-1:(b-c)/(f(a)+f(-a))}})},function(a,b,c){var d=c(6);d(d.S,"Math",{trunc:function trunc(a){return(a>0?Math.floor:Math.ceil)(a)}})},function(a,b,c){var d=c(6),e=c(37),f=String.fromCharCode,g=String.fromCodePoint;d(d.S+d.F*(!!g&&1!=g.length),"String",{fromCodePoint:function fromCodePoint(a){for(var b,c=[],d=arguments.length,g=0;d>g;){if(b=+arguments[g++],e(b,1114111)!==b)throw RangeError(b+" is not a valid code point");c.push(b<65536?f(b):f(((b-=65536)>>10)+55296,b%1024+56320))}return c.join("")}})},function(a,b,c){var d=c(6),e=c(30),f=c(35);d(d.S,"String",{raw:function raw(a){for(var b=e(a.raw),c=f(b.length),d=arguments.length,g=[],h=0;c>h;)g.push(String(b[h++])),h=k?a?"":c:(g=i.charCodeAt(j),g<55296||g>56319||j+1===k||(h=i.charCodeAt(j+1))<56320||h>57343?a?i.charAt(j):g:a?i.slice(j,j+2):(g-55296<<10)+(h-56320)+65536)}}},function(a,b,d){var e=d(6),f=d(35),g=d(127),h="endsWith",i=""[h];e(e.P+e.F*d(129)(h),"String",{endsWith:function endsWith(a){var b=g(this,a,h),d=arguments.length>1?arguments[1]:c,e=f(b.length),j=d===c?e:Math.min(f(d),e),k=String(a);return i?i.call(b,k,j):b.slice(j-k.length,j)===k}})},function(a,b,c){var d=c(128),e=c(33);a.exports=function(a,b,c){if(d(b))throw TypeError("String#"+c+" doesn't accept regex!");return String(e(a))}},function(a,b,d){var e=d(11),f=d(32),g=d(23)("match");a.exports=function(a){var b;return e(a)&&((b=a[g])!==c?!!b:"RegExp"==f(a))}},function(a,b,c){var d=c(23)("match");a.exports=function(a){var b=/./;try{"/./"[a](b)}catch(c){try{return b[d]=!1,!"/./"[a](b)}catch(e){}}return!0}},function(a,b,d){var e=d(6),f=d(127),g="includes";e(e.P+e.F*d(129)(g),"String",{includes:function includes(a){return!!~f(this,a,g).indexOf(a,arguments.length>1?arguments[1]:c)}})},function(a,b,c){var d=c(6);d(d.P,"String",{repeat:c(85)})},function(a,b,d){var e=d(6),f=d(35),g=d(127),h="startsWith",i=""[h];e(e.P+e.F*d(129)(h),"String",{startsWith:function startsWith(a){var b=g(this,a,h),d=f(Math.min(arguments.length>1?arguments[1]:c,b.length)),e=String(a);return i?i.call(b,e,d):b.slice(d,d+e.length)===e}})},function(a,b,d){var e=d(125)(!0);d(134)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,d=this._i;return d>=b.length?{value:c,done:!0}:(a=e(b,d),this._i+=a.length,{value:a,done:!1})})},function(a,b,d){var e=d(26),f=d(6),g=d(16),h=d(8),i=d(3),j=d(135),k=d(136),l=d(22),m=d(57),n=d(23)("iterator"),o=!([].keys&&"next"in[].keys()),p="@@iterator",q="keys",r="values",s=function(){return this};a.exports=function(a,b,d,t,u,v,w){k(d,b,t);var x,y,z,A=function(a){if(!o&&a in E)return E[a];switch(a){case q:return function keys(){return new d(this,a)};case r:return function values(){return new d(this,a)}}return function entries(){return new d(this,a)}},B=b+" Iterator",C=u==r,D=!1,E=a.prototype,F=E[n]||E[p]||u&&E[u],G=F||A(u),H=u?C?A("entries"):G:c,I="Array"==b?E.entries||F:F;if(I&&(z=m(I.call(new a)),z!==Object.prototype&&(l(z,B,!0),e||i(z,n)||h(z,n,s))),C&&F&&F.name!==r&&(D=!0,G=function values(){return F.call(this)}),e&&!w||!o&&!D&&E[n]||h(E,n,G),j[b]=G,j[B]=s,u)if(x={values:C?G:A(r),keys:v?G:A(q),entries:H},w)for(y in x)y in E||g(E,y,x[y]);else f(f.P+f.F*(o||D),b,x);return x}},function(a,b){a.exports={}},function(a,b,c){var d=c(44),e=c(15),f=c(22),g={};c(8)(g,c(23)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){c(138)("anchor",function(a){return function anchor(b){return a(this,"a","name",b)}})},function(a,b,c){var d=c(6),e=c(5),f=c(33),g=/"/g,h=function(a,b,c,d){var e=String(f(a)),h="<"+b;return""!==c&&(h+=" "+c+'="'+String(d).replace(g,""")+'"'),h+">"+e+""};a.exports=function(a,b){var c={};c[a]=b(h),d(d.P+d.F*e(function(){var b=""[a]('"');return b!==b.toLowerCase()||b.split('"').length>3}),"String",c)}},function(a,b,c){c(138)("big",function(a){return function big(){return a(this,"big","","")}})},function(a,b,c){c(138)("blink",function(a){return function blink(){return a(this,"blink","","")}})},function(a,b,c){c(138)("bold",function(a){return function bold(){return a(this,"b","","")}})},function(a,b,c){c(138)("fixed",function(a){return function fixed(){return a(this,"tt","","")}})},function(a,b,c){c(138)("fontcolor",function(a){return function fontcolor(b){return a(this,"font","color",b)}})},function(a,b,c){c(138)("fontsize",function(a){return function fontsize(b){return a(this,"font","size",b)}})},function(a,b,c){c(138)("italics",function(a){return function italics(){return a(this,"i","","")}})},function(a,b,c){c(138)("link",function(a){return function link(b){return a(this,"a","href",b)}})},function(a,b,c){c(138)("small",function(a){return function small(){return a(this,"small","","")}})},function(a,b,c){c(138)("strike",function(a){return function strike(){return a(this,"strike","","")}})},function(a,b,c){c(138)("sub",function(a){return function sub(){return a(this,"sub","","")}})},function(a,b,c){c(138)("sup",function(a){return function sup(){return a(this,"sup","","")}})},function(a,b,c){var d=c(6);d(d.S,"Array",{isArray:c(43)})},function(a,b,d){var e=d(18),f=d(6),g=d(56),h=d(153),i=d(154),j=d(35),k=d(155),l=d(156);f(f.S+f.F*!d(157)(function(a){Array.from(a)}),"Array",{from:function from(a){var b,d,f,m,n=g(a),o="function"==typeof this?this:Array,p=arguments.length,q=p>1?arguments[1]:c,r=q!==c,s=0,t=l(n);if(r&&(q=e(q,p>2?arguments[2]:c,2)),t==c||o==Array&&i(t))for(b=j(n.length),d=new o(b);b>s;s++)k(d,s,r?q(n[s],s):n[s]);else for(m=t.call(n),d=new o;!(f=m.next()).done;s++)k(d,s,r?h(m,q,[f.value,s],!0):f.value);return d.length=s,d}})},function(a,b,d){var e=d(10);a.exports=function(a,b,d,f){try{return f?b(e(d)[0],d[1]):b(d)}catch(g){var h=a["return"];throw h!==c&&e(h.call(a)),g}}},function(a,b,d){var e=d(135),f=d(23)("iterator"),g=Array.prototype;a.exports=function(a){return a!==c&&(e.Array===a||g[f]===a)}},function(a,b,c){var d=c(9),e=c(15);a.exports=function(a,b,c){b in a?d.f(a,b,e(0,c)):a[b]=c}},function(a,b,d){var e=d(73),f=d(23)("iterator"),g=d(135);a.exports=d(7).getIteratorMethod=function(a){if(a!=c)return a[f]||a["@@iterator"]||g[e(a)]}},function(a,b,c){var d=c(23)("iterator"),e=!1; +try{var f=[7][d]();f["return"]=function(){e=!0},Array.from(f,function(){throw 2})}catch(g){}a.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(h){}return c}},function(a,b,c){var d=c(6),e=c(155);d(d.S+d.F*c(5)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var a=0,b=arguments.length,c=new("function"==typeof this?this:Array)(b);b>a;)e(c,a,arguments[a++]);return c.length=b,c}})},function(a,b,d){var e=d(6),f=d(30),g=[].join;e(e.P+e.F*(d(31)!=Object||!d(160)(g)),"Array",{join:function join(a){return g.call(f(this),a===c?",":a)}})},function(a,b,c){var d=c(5);a.exports=function(a,b){return!!a&&d(function(){b?a.call(null,function(){},1):a.call(null)})}},function(a,b,d){var e=d(6),f=d(46),g=d(32),h=d(37),i=d(35),j=[].slice;e(e.P+e.F*d(5)(function(){f&&j.call(f)}),"Array",{slice:function slice(a,b){var d=i(this.length),e=g(this);if(b=b===c?d:b,"Array"==e)return j.call(this,a,b);for(var f=h(a,d),k=h(b,d),l=i(k-f),m=Array(l),n=0;nw;w++)if((n||w in t)&&(q=t[w],r=u(q,w,s),a))if(d)x[w]=r;else if(r)switch(a){case 3:return!0;case 5:return q;case 6:return w;case 2:x.push(q)}else if(l)return!1;return m?-1:k||l?l:x}}},function(a,b,c){var d=c(166);a.exports=function(a,b){return new(d(a))(b)}},function(a,b,d){var e=d(11),f=d(43),g=d(23)("species");a.exports=function(a){var b;return f(a)&&(b=a.constructor,"function"!=typeof b||b!==Array&&!f(b.prototype)||(b=c),e(b)&&(b=b[g],null===b&&(b=c))),b===c?Array:b}},function(a,b,c){var d=c(6),e=c(164)(1);d(d.P+d.F*!c(160)([].map,!0),"Array",{map:function map(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(2);d(d.P+d.F*!c(160)([].filter,!0),"Array",{filter:function filter(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(3);d(d.P+d.F*!c(160)([].some,!0),"Array",{some:function some(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(164)(4);d(d.P+d.F*!c(160)([].every,!0),"Array",{every:function every(a){return e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(172);d(d.P+d.F*!c(160)([].reduce,!0),"Array",{reduce:function reduce(a){return e(this,a,arguments.length,arguments[1],!1)}})},function(a,b,c){var d=c(19),e=c(56),f=c(31),g=c(35);a.exports=function(a,b,c,h,i){d(b);var j=e(a),k=f(j),l=g(j.length),m=i?l-1:0,n=i?-1:1;if(c<2)for(;;){if(m in k){h=k[m],m+=n;break}if(m+=n,i?m<0:l<=m)throw TypeError("Reduce of empty array with no initial value")}for(;i?m>=0:l>m;m+=n)m in k&&(h=b(h,k[m],m,j));return h}},function(a,b,c){var d=c(6),e=c(172);d(d.P+d.F*!c(160)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(a){return e(this,a,arguments.length,arguments[1],!0)}})},function(a,b,c){var d=c(6),e=c(34)(!1),f=[].indexOf,g=!!f&&1/[1].indexOf(1,-0)<0;d(d.P+d.F*(g||!c(160)(f)),"Array",{indexOf:function indexOf(a){return g?f.apply(this,arguments)||0:e(this,a,arguments[1])}})},function(a,b,c){var d=c(6),e=c(30),f=c(36),g=c(35),h=[].lastIndexOf,i=!!h&&1/[1].lastIndexOf(1,-0)<0;d(d.P+d.F*(i||!c(160)(h)),"Array",{lastIndexOf:function lastIndexOf(a){if(i)return h.apply(this,arguments)||0;var b=e(this),c=g(b.length),d=c-1;for(arguments.length>1&&(d=Math.min(d,f(arguments[1]))),d<0&&(d=c+d);d>=0;d--)if(d in b&&b[d]===a)return d||0;return-1}})},function(a,b,c){var d=c(6);d(d.P,"Array",{copyWithin:c(177)}),c(178)("copyWithin")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=[].copyWithin||function copyWithin(a,b){var d=e(this),h=g(d.length),i=f(a,h),j=f(b,h),k=arguments.length>2?arguments[2]:c,l=Math.min((k===c?h:f(k,h))-j,h-i),m=1;for(j0;)j in d?d[i]=d[j]:delete d[i],i+=m,j+=m;return d}},function(a,b,d){var e=d(23)("unscopables"),f=Array.prototype;f[e]==c&&d(8)(f,e,{}),a.exports=function(a){f[e][a]=!0}},function(a,b,c){var d=c(6);d(d.P,"Array",{fill:c(180)}),c(178)("fill")},function(a,b,d){var e=d(56),f=d(37),g=d(35);a.exports=function fill(a){for(var b=e(this),d=g(b.length),h=arguments.length,i=f(h>1?arguments[1]:c,d),j=h>2?arguments[2]:c,k=j===c?d:f(j,d);k>i;)b[i++]=a;return b}},function(a,b,d){var e=d(6),f=d(164)(5),g="find",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{find:function find(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(178)(g)},function(a,b,d){var e=d(6),f=d(164)(6),g="findIndex",h=!0;g in[]&&Array(1)[g](function(){h=!1}),e(e.P+e.F*h,"Array",{findIndex:function findIndex(a){return f(this,a,arguments.length>1?arguments[1]:c)}}),d(178)(g)},function(a,b,d){var e=d(178),f=d(184),g=d(135),h=d(30);a.exports=d(134)(Array,"Array",function(a,b){this._t=h(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,d=this._i++;return!a||d>=a.length?(this._t=c,f(1)):"keys"==b?f(0,d):"values"==b?f(0,a[d]):f(0,[d,a[d]])},"values"),g.Arguments=g.Array,e("keys"),e("values"),e("entries")},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){c(186)("Array")},function(a,b,c){var d=c(2),e=c(9),f=c(4),g=c(23)("species");a.exports=function(a){var b=d[a];f&&b&&!b[g]&&e.f(b,g,{configurable:!0,get:function(){return this}})}},function(a,b,d){var e=d(2),f=d(80),g=d(9).f,h=d(48).f,i=d(128),j=d(188),k=e.RegExp,l=k,m=k.prototype,n=/a/g,o=/a/g,p=new k(n)!==n;if(d(4)&&(!p||d(5)(function(){return o[d(23)("match")]=!1,k(n)!=n||k(o)==o||"/a/i"!=k(n,"i")}))){k=function RegExp(a,b){var d=this instanceof k,e=i(a),g=b===c;return!d&&e&&a.constructor===k&&g?a:f(p?new l(e&&!g?a.source:a,b):l((e=a instanceof k)?a.source:a,e&&g?j.call(a):b),d?this:m,k)};for(var q=(function(a){a in k||g(k,a,{configurable:!0,get:function(){return l[a]},set:function(b){l[a]=b}})}),r=h(l),s=0;r.length>s;)q(r[s++]);m.constructor=k,k.prototype=m,d(16)(e,"RegExp",k)}d(186)("RegExp")},function(a,b,c){var d=c(10);a.exports=function(){var a=d(this),b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),a.unicode&&(b+="u"),a.sticky&&(b+="y"),b}},function(a,b,d){d(190);var e=d(10),f=d(188),g=d(4),h="toString",i=/./[h],j=function(a){d(16)(RegExp.prototype,h,a,!0)};d(5)(function(){return"/a/b"!=i.call({source:"a",flags:"b"})})?j(function toString(){var a=e(this);return"/".concat(a.source,"/","flags"in a?a.flags:!g&&a instanceof RegExp?f.call(a):c)}):i.name!=h&&j(function toString(){return i.call(this)})},function(a,b,c){c(4)&&"g"!=/./g.flags&&c(9).f(RegExp.prototype,"flags",{configurable:!0,get:c(188)})},function(a,b,d){d(192)("match",1,function(a,b,d){return[function match(d){var e=a(this),f=d==c?c:d[b];return f!==c?f.call(d,e):new RegExp(d)[b](String(e))},d]})},function(a,b,c){var d=c(8),e=c(16),f=c(5),g=c(33),h=c(23);a.exports=function(a,b,c){var i=h(a),j=c(g,i,""[a]),k=j[0],l=j[1];f(function(){var b={};return b[i]=function(){return 7},7!=""[a](b)})&&(e(String.prototype,a,k),d(RegExp.prototype,i,2==b?function(a,b){return l.call(a,this,b)}:function(a){return l.call(a,this)}))}},function(a,b,d){d(192)("replace",2,function(a,b,d){return[function replace(e,f){var g=a(this),h=e==c?c:e[b];return h!==c?h.call(e,g,f):d.call(String(g),e,f)},d]})},function(a,b,d){d(192)("search",1,function(a,b,d){return[function search(d){var e=a(this),f=d==c?c:d[b];return f!==c?f.call(d,e):new RegExp(d)[b](String(e))},d]})},function(a,b,d){d(192)("split",2,function(a,b,e){var f=d(128),g=e,h=[].push,i="split",j="length",k="lastIndex";if("c"=="abbc"[i](/(b)*/)[1]||4!="test"[i](/(?:)/,-1)[j]||2!="ab"[i](/(?:ab)*/)[j]||4!="."[i](/(.?)(.?)/)[j]||"."[i](/()()/)[j]>1||""[i](/.?/)[j]){var l=/()??/.exec("")[1]===c;e=function(a,b){var d=String(this);if(a===c&&0===b)return[];if(!f(a))return g.call(d,a,b);var e,i,m,n,o,p=[],q=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(a.sticky?"y":""),r=0,s=b===c?4294967295:b>>>0,t=new RegExp(a.source,q+"g");for(l||(e=new RegExp("^"+t.source+"$(?!\\s)",q));(i=t.exec(d))&&(m=i.index+i[0][j],!(m>r&&(p.push(d.slice(r,i.index)),!l&&i[j]>1&&i[0].replace(e,function(){for(o=1;o1&&i.index=s)));)t[k]===i.index&&t[k]++;return r===d[j]?!n&&t.test("")||p.push(""):p.push(d.slice(r)),p[j]>s?p.slice(0,s):p}}else"0"[i](c,0)[j]&&(e=function(a,b){return a===c&&0===b?[]:g.call(this,a,b)});return[function split(d,f){var g=a(this),h=d==c?c:d[b];return h!==c?h.call(d,g,f):e.call(String(g),d,f)},e]})},function(a,b,d){var e,f,g,h=d(26),i=d(2),j=d(18),k=d(73),l=d(6),m=d(11),n=d(19),o=d(197),p=d(198),q=d(199),r=d(200).set,s=d(201)(),t="Promise",u=i.TypeError,v=i.process,w=i[t],v=i.process,x="process"==k(v),y=function(){},z=!!function(){try{var a=w.resolve(1),b=(a.constructor={})[d(23)("species")]=function(a){a(y,y)};return(x||"function"==typeof PromiseRejectionEvent)&&a.then(y)instanceof b}catch(c){}}(),A=function(a,b){return a===b||a===w&&b===g},B=function(a){var b;return!(!m(a)||"function"!=typeof(b=a.then))&&b},C=function(a){return A(w,a)?new D(a):new f(a)},D=f=function(a){var b,d;this.promise=new a(function(a,e){if(b!==c||d!==c)throw u("Bad Promise constructor");b=a,d=e}),this.resolve=n(b),this.reject=n(d)},E=function(a){try{a()}catch(b){return{error:b}}},F=function(a,b){if(!a._n){a._n=!0;var c=a._c;s(function(){for(var d=a._v,e=1==a._s,f=0,g=function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&I(a),a._h=1),g===!0?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(u("Promise-chain cycle")):(f=B(c))?f.call(c,h,i):h(c)):i(d)}catch(k){i(k)}};c.length>f;)g(c[f++]);a._c=[],a._n=!1,b&&!a._h&&G(a)})}},G=function(a){r.call(i,function(){var b,d,e,f=a._v;if(H(a)&&(b=E(function(){x?v.emit("unhandledRejection",f,a):(d=i.onunhandledrejection)?d({promise:a,reason:f}):(e=i.console)&&e.error&&e.error("Unhandled promise rejection",f)}),a._h=x||H(a)?2:1),a._a=c,b)throw b.error})},H=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if(b=c[d++],b.fail||!H(b.promise))return!1;return!0},I=function(a){r.call(i,function(){var b;x?v.emit("rejectionHandled",a):(b=i.onrejectionhandled)&&b({promise:a,reason:a._v})})},J=function(a){var b=this;b._d||(b._d=!0,b=b._w||b,b._v=a,b._s=2,b._a||(b._a=b._c.slice()),F(b,!0))},K=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw u("Promise can't be resolved itself");(b=B(a))?s(function(){var d={_w:c,_d:!1};try{b.call(a,j(K,d,1),j(J,d,1))}catch(e){J.call(d,e)}}):(c._v=a,c._s=1,F(c,!1))}catch(d){J.call({_w:c,_d:!1},d)}}};z||(w=function Promise(a){o(this,w,t,"_h"),n(a),e.call(this);try{a(j(K,this,1),j(J,this,1))}catch(b){J.call(this,b)}},e=function Promise(a){this._c=[],this._a=c,this._s=0,this._d=!1,this._v=c,this._h=0,this._n=!1},e.prototype=d(202)(w.prototype,{then:function then(a,b){var d=C(q(this,w));return d.ok="function"!=typeof a||a,d.fail="function"==typeof b&&b,d.domain=x?v.domain:c,this._c.push(d),this._a&&this._a.push(d),this._s&&F(this,!1),d.promise},"catch":function(a){return this.then(c,a)}}),D=function(){var a=new e;this.promise=a,this.resolve=j(K,a,1),this.reject=j(J,a,1)}),l(l.G+l.W+l.F*!z,{Promise:w}),d(22)(w,t),d(186)(t),g=d(7)[t],l(l.S+l.F*!z,t,{reject:function reject(a){var b=C(this),c=b.reject;return c(a),b.promise}}),l(l.S+l.F*(h||!z),t,{resolve:function resolve(a){if(a instanceof w&&A(a.constructor,this))return a;var b=C(this),c=b.resolve;return c(a),b.promise}}),l(l.S+l.F*!(z&&d(157)(function(a){w.all(a)["catch"](y)})),t,{all:function all(a){var b=this,d=C(b),e=d.resolve,f=d.reject,g=E(function(){var d=[],g=0,h=1;p(a,!1,function(a){var i=g++,j=!1;d.push(c),h++,b.resolve(a).then(function(a){j||(j=!0,d[i]=a,--h||e(d))},f)}),--h||e(d)});return g&&f(g.error),d.promise},race:function race(a){var b=this,c=C(b),d=c.reject,e=E(function(){p(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},function(a,b){a.exports=function(a,b,d,e){if(!(a instanceof b)||e!==c&&e in a)throw TypeError(d+": incorrect invocation!");return a}},function(a,b,c){var d=c(18),e=c(153),f=c(154),g=c(10),h=c(35),i=c(156),j={},k={},b=a.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if(q=b?s(g(o=a[t])[0],o[1]):s(a[t]),q===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if(q=e(p,s,o.value,b),q===j||q===k)return q};b.BREAK=j,b.RETURN=k},function(a,b,d){var e=d(10),f=d(19),g=d(23)("species");a.exports=function(a,b){var d,h=e(a).constructor;return h===c||(d=e(h)[g])==c?b:f(d)}},function(a,b,c){var d,e,f,g=c(18),h=c(76),i=c(46),j=c(13),k=c(2),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function setImmediate(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function clearImmediate(a){delete q[a]},"process"==c(32)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),a.exports={set:m,clear:n}},function(a,b,d){var e=d(2),f=d(200).set,g=e.MutationObserver||e.WebKitMutationObserver,h=e.process,i=e.Promise,j="process"==d(32)(h);a.exports=function(){var a,b,d,k=function(){var e,f;for(j&&(e=h.domain)&&e.exit();a;){f=a.fn,a=a.next;try{f()}catch(g){throw a?d():b=c,g}}b=c,e&&e.enter()};if(j)d=function(){h.nextTick(k)};else if(g){var l=!0,m=document.createTextNode("");new g(k).observe(m,{characterData:!0}),d=function(){m.data=l=!l}}else if(i&&i.resolve){var n=i.resolve();d=function(){n.then(k)}}else d=function(){f.call(e,k)};return function(e){var f={fn:e,next:c};b&&(b.next=f),a||(a=f,d()),b=f}}},function(a,b,c){var d=c(16);a.exports=function(a,b,c){for(var e in b)d(a,e,b[e],c);return a}},function(a,b,d){var e=d(204);a.exports=d(205)("Map",function(a){return function Map(){return a(this,arguments.length>0?arguments[0]:c)}},{get:function get(a){var b=e.getEntry(this,a);return b&&b.v},set:function set(a,b){return e.def(this,0===a?0:a,b)}},e,!0)},function(a,b,d){var e=d(9).f,f=d(44),g=d(202),h=d(18),i=d(197),j=d(33),k=d(198),l=d(134),m=d(184),n=d(186),o=d(4),p=d(20).fastKey,q=o?"_s":"size",r=function(a,b){var c,d=p(b);if("F"!==d)return a._i[d];for(c=a._f;c;c=c.n)if(c.k==b)return c};a.exports={getConstructor:function(a,b,d,l){var m=a(function(a,e){i(a,m,b,"_i"),a._i=f(null),a._f=c,a._l=c,a[q]=0,e!=c&&k(e,d,a[l],a)});return g(m.prototype,{clear:function clear(){for(var a=this,b=a._i,d=a._f;d;d=d.n)d.r=!0,d.p&&(d.p=d.p.n=c),delete b[d.i];a._f=a._l=c,a[q]=0},"delete":function(a){var b=this,c=r(b,a);if(c){var d=c.n,e=c.p;delete b._i[c.i],c.r=!0,e&&(e.n=d),d&&(d.p=e),b._f==c&&(b._f=d),b._l==c&&(b._l=e),b[q]--}return!!c},forEach:function forEach(a){i(this,m,"forEach");for(var b,d=h(a,arguments.length>1?arguments[1]:c,3);b=b?b.n:this._f;)for(d(b.v,b.k,this);b&&b.r;)b=b.p},has:function has(a){return!!r(this,a)}}),o&&e(m.prototype,"size",{get:function(){return j(this[q])}}),m},def:function(a,b,d){var e,f,g=r(a,b);return g?g.v=d:(a._l=g={i:f=p(b,!0),k:b,v:d,p:e=a._l,n:c,r:!1},a._f||(a._f=g),e&&(e.n=g),a[q]++,"F"!==f&&(a._i[f]=g)),a},getEntry:r,setStrong:function(a,b,d){l(a,b,function(a,b){this._t=a,this._k=b,this._l=c},function(){for(var a=this,b=a._k,d=a._l;d&&d.r;)d=d.p;return a._t&&(a._l=d=d?d.n:a._t._f)?"keys"==b?m(0,d.k):"values"==b?m(0,d.v):m(0,[d.k,d.v]):(a._t=c,m(1))},d?"entries":"values",!d,!0),n(b)}}},function(a,b,d){var e=d(2),f=d(6),g=d(16),h=d(202),i=d(20),j=d(198),k=d(197),l=d(11),m=d(5),n=d(157),o=d(22),p=d(80);a.exports=function(a,b,d,q,r,s){var t=e[a],u=t,v=r?"set":"add",w=u&&u.prototype,x={},y=function(a){var b=w[a];g(w,a,"delete"==a?function(a){return!(s&&!l(a))&&b.call(this,0===a?0:a)}:"has"==a?function has(a){return!(s&&!l(a))&&b.call(this,0===a?0:a)}:"get"==a?function get(a){return s&&!l(a)?c:b.call(this,0===a?0:a)}:"add"==a?function add(a){return b.call(this,0===a?0:a),this}:function set(a,c){return b.call(this,0===a?0:a,c),this})};if("function"==typeof u&&(s||w.forEach&&!m(function(){(new u).entries().next()}))){var z=new u,A=z[v](s?{}:-0,1)!=z,B=m(function(){z.has(1)}),C=n(function(a){new u(a)}),D=!s&&m(function(){for(var a=new u,b=5;b--;)a[v](b,b);return!a.has(-0)});C||(u=b(function(b,d){k(b,u,a);var e=p(new t,b,u);return d!=c&&j(d,r,e[v],e),e}),u.prototype=w,w.constructor=u),(B||D)&&(y("delete"),y("has"),r&&y("get")),(D||A)&&y(v),s&&w.clear&&delete w.clear}else u=q.getConstructor(b,a,r,v),h(u.prototype,d),i.NEED=!0;return o(u,a),x[a]=u,f(f.G+f.W+f.F*(u!=t),x),s||q.setStrong(u,a,r),u}},function(a,b,d){var e=d(204);a.exports=d(205)("Set",function(a){return function Set(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a=0===a?0:a,a)}},e)},function(a,b,d){var e,f=d(164)(0),g=d(16),h=d(20),i=d(67),j=d(208),k=d(11),l=h.getWeak,m=Object.isExtensible,n=j.ufstore,o={},p=function(a){return function WeakMap(){return a(this,arguments.length>0?arguments[0]:c)}},q={get:function get(a){if(k(a)){var b=l(a);return b===!0?n(this).get(a):b?b[this._i]:c}},set:function set(a,b){return j.def(this,a,b)}},r=a.exports=d(205)("WeakMap",p,q,j,!0,!0);7!=(new r).set((Object.freeze||Object)(o),7).get(o)&&(e=j.getConstructor(p),i(e.prototype,q),h.NEED=!0,f(["delete","has","get","set"],function(a){var b=r.prototype,c=b[a];g(b,a,function(b,d){if(k(b)&&!m(b)){this._f||(this._f=new e);var f=this._f[a](b,d);return"set"==a?this:f}return c.call(this,b,d)})}))},function(a,b,d){var e=d(202),f=d(20).getWeak,g=d(10),h=d(11),i=d(197),j=d(198),k=d(164),l=d(3),m=k(5),n=k(6),o=0,p=function(a){return a._l||(a._l=new q)},q=function(){this.a=[]},r=function(a,b){return m(a.a,function(a){return a[0]===b})};q.prototype={get:function(a){var b=r(this,a);if(b)return b[1]},has:function(a){return!!r(this,a)},set:function(a,b){var c=r(this,a);c?c[1]=b:this.a.push([a,b])},"delete":function(a){var b=n(this.a,function(b){return b[0]===a});return~b&&this.a.splice(b,1),!!~b}},a.exports={getConstructor:function(a,b,d,g){var k=a(function(a,e){i(a,k,b,"_i"),a._i=o++,a._l=c,e!=c&&j(e,d,a[g],a)});return e(k.prototype,{"delete":function(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this)["delete"](a):b&&l(b,this._i)&&delete b[this._i]},has:function has(a){if(!h(a))return!1;var b=f(a);return b===!0?p(this).has(a):b&&l(b,this._i)}}),k},def:function(a,b,c){var d=f(g(b),!0);return d===!0?p(a).set(b,c):d[a._i]=c,a},ufstore:p}},function(a,b,d){var e=d(208);d(205)("WeakSet",function(a){return function WeakSet(){return a(this,arguments.length>0?arguments[0]:c)}},{add:function add(a){return e.def(this,a,!0)}},e,!1,!0)},function(a,b,c){var d=c(6),e=c(19),f=c(10),g=(c(2).Reflect||{}).apply,h=Function.apply;d(d.S+d.F*!c(5)(function(){g(function(){})}),"Reflect",{apply:function apply(a,b,c){var d=e(a),i=f(c);return g?g(d,b,i):h.call(d,b,i)}})},function(a,b,c){var d=c(6),e=c(44),f=c(19),g=c(10),h=c(11),i=c(5),j=c(75),k=(c(2).Reflect||{}).construct,l=i(function(){function F(){}return!(k(function(){},[],F)instanceof F)}),m=!i(function(){k(function(){})});d(d.S+d.F*(l||m),"Reflect",{construct:function construct(a,b){f(a),g(b);var c=arguments.length<3?a:f(arguments[2]);if(m&&!l)return k(a,b,c);if(a==c){switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3])}var d=[null];return d.push.apply(d,b),new(j.apply(a,d))}var i=c.prototype,n=e(h(i)?i:Object.prototype),o=Function.apply.call(a,n,b);return h(o)?o:n}})},function(a,b,c){var d=c(9),e=c(6),f=c(10),g=c(14);e(e.S+e.F*c(5)(function(){Reflect.defineProperty(d.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(a,b,c){f(a),b=g(b,!0),f(c);try{return d.f(a,b,c),!0}catch(e){return!1}}})},function(a,b,c){var d=c(6),e=c(49).f,f=c(10);d(d.S,"Reflect",{deleteProperty:function deleteProperty(a,b){var c=e(f(a),b);return!(c&&!c.configurable)&&delete a[b]}})},function(a,b,d){var e=d(6),f=d(10),g=function(a){this._t=f(a),this._i=0;var b,c=this._k=[];for(b in a)c.push(b)};d(136)(g,"Object",function(){var a,b=this,d=b._k;do if(b._i>=d.length)return{value:c,done:!0};while(!((a=d[b._i++])in b._t));return{value:a,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(a){return new g(a)}})},function(a,b,d){function get(a,b){var d,h,k=arguments.length<3?a:arguments[2];return j(a)===k?a[b]:(d=e.f(a,b))?g(d,"value")?d.value:d.get!==c?d.get.call(k):c:i(h=f(a))?get(h,b,k):void 0}var e=d(49),f=d(57),g=d(3),h=d(6),i=d(11),j=d(10);h(h.S,"Reflect",{get:get})},function(a,b,c){var d=c(49),e=c(6),f=c(10);e(e.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(a,b){return d.f(f(a),b)}})},function(a,b,c){var d=c(6),e=c(57),f=c(10);d(d.S,"Reflect",{getPrototypeOf:function getPrototypeOf(a){return e(f(a))}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{has:function has(a,b){return b in a}})},function(a,b,c){var d=c(6),e=c(10),f=Object.isExtensible;d(d.S,"Reflect",{isExtensible:function isExtensible(a){return e(a),!f||f(a)}})},function(a,b,c){var d=c(6);d(d.S,"Reflect",{ownKeys:c(221)})},function(a,b,c){var d=c(48),e=c(41),f=c(10),g=c(2).Reflect;a.exports=g&&g.ownKeys||function ownKeys(a){var b=d.f(f(a)),c=e.f;return c?b.concat(c(a)):b}},function(a,b,c){var d=c(6),e=c(10),f=Object.preventExtensions;d(d.S,"Reflect",{preventExtensions:function preventExtensions(a){e(a);try{return f&&f(a),!0}catch(b){return!1}}})},function(a,b,d){function set(a,b,d){var i,m,n=arguments.length<4?a:arguments[3],o=f.f(k(a),b);if(!o){if(l(m=g(a)))return set(m,b,d,n);o=j(0)}return h(o,"value")?!(o.writable===!1||!l(n))&&(i=f.f(n,b)||j(0),i.value=d,e.f(n,b,i),!0):o.set!==c&&(o.set.call(n,d),!0)}var e=d(9),f=d(49),g=d(57),h=d(3),i=d(6),j=d(15),k=d(10),l=d(11);i(i.S,"Reflect",{set:set})},function(a,b,c){var d=c(6),e=c(71);e&&d(d.S,"Reflect",{setPrototypeOf:function setPrototypeOf(a,b){e.check(a,b);try{return e.set(a,b),!0}catch(c){return!1}}})},function(a,b,c){var d=c(6);d(d.S,"Date",{now:function(){return(new Date).getTime()}})},function(a,b,c){var d=c(6),e=c(56),f=c(14);d(d.P+d.F*c(5)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(a){var b=e(this),c=f(b);return"number"!=typeof c||isFinite(c)?b.toISOString():null}})},function(a,b,c){var d=c(6),e=c(5),f=Date.prototype.getTime,g=function(a){return a>9?a:"0"+a};d(d.P+d.F*(e(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!e(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function toISOString(){if(!isFinite(f.call(this)))throw RangeError("Invalid time value");var a=this,b=a.getUTCFullYear(),c=a.getUTCMilliseconds(),d=b<0?"-":b>9999?"+":"";return d+("00000"+Math.abs(b)).slice(d?-6:-4)+"-"+g(a.getUTCMonth()+1)+"-"+g(a.getUTCDate())+"T"+g(a.getUTCHours())+":"+g(a.getUTCMinutes())+":"+g(a.getUTCSeconds())+"."+(c>99?c:"0"+g(c))+"Z"}})},function(a,b,c){var d=Date.prototype,e="Invalid Date",f="toString",g=d[f],h=d.getTime;new Date(NaN)+""!=e&&c(16)(d,f,function toString(){var a=h.call(this);return a===a?g.call(this):e})},function(a,b,c){var d=c(23)("toPrimitive"),e=Date.prototype;d in e||c(8)(e,d,c(230))},function(a,b,c){var d=c(10),e=c(14),f="number";a.exports=function(a){if("string"!==a&&a!==f&&"default"!==a)throw TypeError("Incorrect hint");return e(d(this),a!=f)}},function(a,b,d){var e=d(6),f=d(232),g=d(233),h=d(10),i=d(37),j=d(35),k=d(11),l=d(2).ArrayBuffer,m=d(199),n=g.ArrayBuffer,o=g.DataView,p=f.ABV&&l.isView,q=n.prototype.slice,r=f.VIEW,s="ArrayBuffer";e(e.G+e.W+e.F*(l!==n),{ArrayBuffer:n}),e(e.S+e.F*!f.CONSTR,s,{isView:function isView(a){return p&&p(a)||k(a)&&r in a}}),e(e.P+e.U+e.F*d(5)(function(){return!new n(2).slice(1,c).byteLength}),s,{slice:function slice(a,b){if(q!==c&&b===c)return q.call(h(this),a);for(var d=h(this).byteLength,e=i(a,d),f=i(b===c?d:b,d),g=new(m(this,n))(j(f-e)),k=new o(this),l=new o(g),p=0;e>1,k=23===b?E(2,-24)-E(2,-77):0,l=0,m=a<0||0===a&&1/a<0?1:0;for(a=D(a),a!=a||a===B?(e=a!=a?1:0,d=i):(d=F(G(a)/H),a*(f=E(2,-d))<1&&(d--,f*=2),a+=d+j>=1?k/f:k*E(2,1-j),a*f>=2&&(d++,f/=2),d+j>=i?(e=0,d=i):d+j>=1?(e=(a*f-1)*E(2,b),d+=j):(e=a*E(2,j-1)*E(2,b),d=0));b>=8;g[l++]=255&e,e/=256,b-=8);for(d=d<0;g[l++]=255&d,d/=256,h-=8);return g[--l]|=128*m,g},P=function(a,b,c){var d,e=8*c-b-1,f=(1<>1,h=e-7,i=c-1,j=a[i--],k=127&j;for(j>>=7;h>0;k=256*k+a[i],i--,h-=8);for(d=k&(1<<-h)-1,k>>=-h,h+=b;h>0;d=256*d+a[i],i--,h-=8);if(0===k)k=1-g;else{if(k===f)return d?NaN:j?-B:B;d+=E(2,b),k-=g}return(j?-1:1)*d*E(2,k-b)},Q=function(a){return a[3]<<24|a[2]<<16|a[1]<<8|a[0]},R=function(a){return[255&a]},S=function(a){return[255&a,a>>8&255]},T=function(a){return[255&a,a>>8&255,a>>16&255,a>>24&255]},U=function(a){return O(a,52,8)},V=function(a){return O(a,23,4)},W=function(a,b,c){p(a[u],b,{get:function(){return this[c]}})},X=function(a,b,c,d){var e=+c,f=m(e);if(e!=f||f<0||f+b>a[M])throw A(w);var g=a[L]._b,h=f+a[N],i=g.slice(h,h+b);return d?i:i.reverse()},Y=function(a,b,c,d,e,f){var g=+c,h=m(g);if(g!=h||h<0||h+b>a[M])throw A(w);for(var i=a[L]._b,j=h+a[N],k=d(+e),l=0;lba;)($=aa[ba++])in x||i(x,$,C[$]);g||(_.constructor=x)}var ca=new y(new x(2)),da=y[u].setInt8;ca.setInt8(0,2147483648),ca.setInt8(1,2147483649),!ca.getInt8(0)&&ca.getInt8(1)||j(y[u],{setInt8:function setInt8(a,b){da.call(this,a,b<<24>>24)},setUint8:function setUint8(a,b){da.call(this,a,b<<24>>24)}},!0)}else x=function ArrayBuffer(a){var b=Z(this,a);this._b=q.call(Array(b),0),this[M]=b},y=function DataView(a,b,d){l(this,y,t),l(a,x,t);var e=a[M],f=m(b);if(f<0||f>e)throw A("Wrong offset!");if(d=d===c?e-f:n(d),f+d>e)throw A(v);this[L]=a,this[N]=f,this[M]=d},f&&(W(x,J,"_l"),W(y,I,"_b"),W(y,J,"_l"),W(y,K,"_o")),j(y[u],{getInt8:function getInt8(a){return X(this,1,a)[0]<<24>>24},getUint8:function getUint8(a){return X(this,1,a)[0]},getInt16:function getInt16(a){var b=X(this,2,a,arguments[1]);return(b[1]<<8|b[0])<<16>>16},getUint16:function getUint16(a){var b=X(this,2,a,arguments[1]);return b[1]<<8|b[0]},getInt32:function getInt32(a){return Q(X(this,4,a,arguments[1]))},getUint32:function getUint32(a){return Q(X(this,4,a,arguments[1]))>>>0},getFloat32:function getFloat32(a){return P(X(this,4,a,arguments[1]),23,4)},getFloat64:function getFloat64(a){return P(X(this,8,a,arguments[1]),52,8)},setInt8:function setInt8(a,b){Y(this,1,a,R,b)},setUint8:function setUint8(a,b){Y(this,1,a,R,b)},setInt16:function setInt16(a,b){Y(this,2,a,S,b,arguments[2])},setUint16:function setUint16(a,b){Y(this,2,a,S,b,arguments[2])},setInt32:function setInt32(a,b){Y(this,4,a,T,b,arguments[2])},setUint32:function setUint32(a,b){Y(this,4,a,T,b,arguments[2])},setFloat32:function setFloat32(a,b){Y(this,4,a,V,b,arguments[2])},setFloat64:function setFloat64(a,b){Y(this,8,a,U,b,arguments[2])}});r(x,s),r(y,t),i(y[u],h.VIEW,!0),b[s]=x,b[t]=y},function(a,b,c){var d=c(6);d(d.G+d.W+d.F*!c(232).ABV,{DataView:c(233).DataView})},function(a,b,c){c(236)("Int8",1,function(a){return function Int8Array(b,c,d){return a(this,b,c,d)}})},function(a,b,d){if(d(4)){var e=d(26),f=d(2),g=d(5),h=d(6),i=d(232),j=d(233),k=d(18),l=d(197),m=d(15),n=d(8),o=d(202),p=d(36),q=d(35),r=d(37),s=d(14),t=d(3),u=d(69),v=d(73),w=d(11),x=d(56),y=d(154),z=d(44),A=d(57),B=d(48).f,C=d(156),D=d(17),E=d(23),F=d(164),G=d(34),H=d(199),I=d(183),J=d(135),K=d(157),L=d(186),M=d(180),N=d(177),O=d(9),P=d(49),Q=O.f,R=P.f,S=f.RangeError,T=f.TypeError,U=f.Uint8Array,V="ArrayBuffer",W="Shared"+V,X="BYTES_PER_ELEMENT",Y="prototype",Z=Array[Y],$=j.ArrayBuffer,_=j.DataView,aa=F(0),ba=F(2),ca=F(3),da=F(4),ea=F(5),fa=F(6),ga=G(!0),ha=G(!1),ia=I.values,ja=I.keys,ka=I.entries,la=Z.lastIndexOf,ma=Z.reduce,na=Z.reduceRight,oa=Z.join,pa=Z.sort,qa=Z.slice,ra=Z.toString,sa=Z.toLocaleString,ta=E("iterator"),ua=E("toStringTag"),va=D("typed_constructor"),wa=D("def_constructor"),xa=i.CONSTR,ya=i.TYPED,za=i.VIEW,Aa="Wrong length!",Ba=F(1,function(a,b){return Ha(H(a,a[wa]),b)}),Ca=g(function(){return 1===new U(new Uint16Array([1]).buffer)[0]}),Da=!!U&&!!U[Y].set&&g(function(){new U(1).set({})}),Ea=function(a,b){if(a===c)throw T(Aa);var d=+a,e=q(a);if(b&&!u(d,e))throw S(Aa);return e},Fa=function(a,b){var c=p(a);if(c<0||c%b)throw S("Wrong offset!");return c},Ga=function(a){if(w(a)&&ya in a)return a;throw T(a+" is not a typed array!")},Ha=function(a,b){if(!(w(a)&&va in a))throw T("It is not a typed array constructor!");return new a(b)},Ia=function(a,b){return Ja(H(a,a[wa]),b)},Ja=function(a,b){for(var c=0,d=b.length,e=Ha(a,d);d>c;)e[c]=b[c++];return e},Ka=function(a,b,c){Q(a,b,{get:function(){return this._d[c]}})},La=function from(a){var b,d,e,f,g,h,i=x(a),j=arguments.length,l=j>1?arguments[1]:c,m=l!==c,n=C(i);if(n!=c&&!y(n)){for(h=n.call(i),e=[],b=0;!(g=h.next()).done;b++)e.push(g.value);i=e}for(m&&j>2&&(l=k(l,arguments[2],2)),b=0,d=q(i.length),f=Ha(this,d);d>b;b++)f[b]=m?l(i[b],b):i[b];return f},Ma=function of(){for(var a=0,b=arguments.length,c=Ha(this,b);b>a;)c[a]=arguments[a++];return c},Na=!!U&&g(function(){sa.call(new U(1))}),Oa=function toLocaleString(){return sa.apply(Na?qa.call(Ga(this)):Ga(this),arguments)},Pa={copyWithin:function copyWithin(a,b){return N.call(Ga(this),a,b,arguments.length>2?arguments[2]:c)},every:function every(a){return da(Ga(this),a,arguments.length>1?arguments[1]:c)},fill:function fill(a){return M.apply(Ga(this),arguments)},filter:function filter(a){return Ia(this,ba(Ga(this),a,arguments.length>1?arguments[1]:c))},find:function find(a){return ea(Ga(this),a,arguments.length>1?arguments[1]:c)},findIndex:function findIndex(a){return fa(Ga(this),a,arguments.length>1?arguments[1]:c)},forEach:function forEach(a){aa(Ga(this),a,arguments.length>1?arguments[1]:c)},indexOf:function indexOf(a){return ha(Ga(this),a,arguments.length>1?arguments[1]:c)},includes:function includes(a){return ga(Ga(this),a,arguments.length>1?arguments[1]:c)},join:function join(a){return oa.apply(Ga(this),arguments)},lastIndexOf:function lastIndexOf(a){ +return la.apply(Ga(this),arguments)},map:function map(a){return Ba(Ga(this),a,arguments.length>1?arguments[1]:c)},reduce:function reduce(a){return ma.apply(Ga(this),arguments)},reduceRight:function reduceRight(a){return na.apply(Ga(this),arguments)},reverse:function reverse(){for(var a,b=this,c=Ga(b).length,d=Math.floor(c/2),e=0;e1?arguments[1]:c)},sort:function sort(a){return pa.call(Ga(this),a)},subarray:function subarray(a,b){var d=Ga(this),e=d.length,f=r(a,e);return new(H(d,d[wa]))(d.buffer,d.byteOffset+f*d.BYTES_PER_ELEMENT,q((b===c?e:r(b,e))-f))}},Qa=function slice(a,b){return Ia(this,qa.call(Ga(this),a,b))},Ra=function set(a){Ga(this);var b=Fa(arguments[1],1),c=this.length,d=x(a),e=q(d.length),f=0;if(e+b>c)throw S(Aa);for(;f255?255:255&d),e.v[p](c*b+e.o,d,Ca)},E=function(a,b){Q(a,b,{get:function(){return C(this,b)},set:function(a){return D(this,b,a)},enumerable:!0})};u?(r=d(function(a,d,e,f){l(a,r,k,"_d");var g,h,i,j,m=0,o=0;if(w(d)){if(!(d instanceof $||(j=v(d))==V||j==W))return ya in d?Ja(r,d):La.call(r,d);g=d,o=Fa(e,b);var p=d.byteLength;if(f===c){if(p%b)throw S(Aa);if(h=p-o,h<0)throw S(Aa)}else if(h=q(f)*b,h+o>p)throw S(Aa);i=h/b}else i=Ea(d,!0),h=i*b,g=new $(h);for(n(a,"_d",{b:g,o:o,l:h,e:i,v:new _(g)});m1?arguments[1]:c)}}),d(178)("includes")},function(a,b,c){var d=c(6),e=c(125)(!0);d(d.P,"String",{at:function at(a){return e(this,a)}})},function(a,b,d){var e=d(6),f=d(248);e(e.P,"String",{padStart:function padStart(a){return f(this,a,arguments.length>1?arguments[1]:c,!0)}})},function(a,b,d){var e=d(35),f=d(85),g=d(33);a.exports=function(a,b,d,h){var i=String(g(a)),j=i.length,k=d===c?" ":String(d),l=e(b);if(l<=j||""==k)return i;var m=l-j,n=f.call(k,Math.ceil(m/k.length));return n.length>m&&(n=n.slice(0,m)),h?n+i:i+n}},function(a,b,d){var e=d(6),f=d(248);e(e.P,"String",{padEnd:function padEnd(a){return f(this,a,arguments.length>1?arguments[1]:c,!1)}})},function(a,b,c){c(81)("trimLeft",function(a){return function trimLeft(){return a(this,1)}},"trimStart")},function(a,b,c){c(81)("trimRight",function(a){return function trimRight(){return a(this,2)}},"trimEnd")},function(a,b,c){var d=c(6),e=c(33),f=c(35),g=c(128),h=c(188),i=RegExp.prototype,j=function(a,b){this._r=a,this._s=b};c(136)(j,"RegExp String",function next(){var a=this._r.exec(this._s);return{value:a,done:null===a}}),d(d.P,"String",{matchAll:function matchAll(a){if(e(this),!g(a))throw TypeError(a+" is not a regexp!");var b=String(this),c="flags"in i?String(a.flags):h.call(a),d=new RegExp(a.source,~c.indexOf("g")?c:"g"+c);return d.lastIndex=f(a.lastIndex),new j(d,b)}})},function(a,b,c){c(25)("asyncIterator")},function(a,b,c){c(25)("observable")},function(a,b,c){var d=c(6),e=c(221),f=c(30),g=c(49),h=c(155);d(d.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(a){for(var b,c=f(a),d=g.f,i=e(c),j={},k=0;i.length>k;)h(j,b=i[k++],d(c,b));return j}})},function(a,b,c){var d=c(6),e=c(257)(!1);d(d.S,"Object",{values:function values(a){return e(a)}})},function(a,b,c){var d=c(28),e=c(30),f=c(42).f;a.exports=function(a){return function(b){for(var c,g=e(b),h=d(g),i=h.length,j=0,k=[];i>j;)f.call(g,c=h[j++])&&k.push(a?[c,g[c]]:g[c]);return k}}},function(a,b,c){var d=c(6),e=c(257)(!0);d(d.S,"Object",{entries:function entries(a){return e(a)}})},function(a,b,c){var d=c(6),e=c(56),f=c(19),g=c(9);c(4)&&d(d.P+c(260),"Object",{__defineGetter__:function __defineGetter__(a,b){g.f(e(this),a,{get:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){a.exports=c(26)||!c(5)(function(){var a=Math.random();__defineSetter__.call(null,a,function(){}),delete c(2)[a]})},function(a,b,c){var d=c(6),e=c(56),f=c(19),g=c(9);c(4)&&d(d.P+c(260),"Object",{__defineSetter__:function __defineSetter__(a,b){g.f(e(this),a,{set:f(b),enumerable:!0,configurable:!0})}})},function(a,b,c){var d=c(6),e=c(56),f=c(14),g=c(57),h=c(49).f;c(4)&&d(d.P+c(260),"Object",{__lookupGetter__:function __lookupGetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.get;while(c=g(c))}})},function(a,b,c){var d=c(6),e=c(56),f=c(14),g=c(57),h=c(49).f;c(4)&&d(d.P+c(260),"Object",{__lookupSetter__:function __lookupSetter__(a){var b,c=e(this),d=f(a,!0);do if(b=h(c,d))return b.set;while(c=g(c))}})},function(a,b,c){var d=c(6);d(d.P+d.R,"Map",{toJSON:c(265)("Map")})},function(a,b,c){var d=c(73),e=c(266);a.exports=function(a){return function toJSON(){if(d(this)!=a)throw TypeError(a+"#toJSON isn't generic");return e(this)}}},function(a,b,c){var d=c(198);a.exports=function(a,b){var c=[];return d(a,!1,c.push,c,b),c}},function(a,b,c){var d=c(6);d(d.P+d.R,"Set",{toJSON:c(265)("Set")})},function(a,b,c){var d=c(6);d(d.S,"System",{global:c(2)})},function(a,b,c){var d=c(6),e=c(32);d(d.S,"Error",{isError:function isError(a){return"Error"===e(a)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{iaddh:function iaddh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f+(d>>>0)+((e&g|(e|g)&~(e+g>>>0))>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{isubh:function isubh(a,b,c,d){var e=a>>>0,f=b>>>0,g=c>>>0;return f-(d>>>0)-((~e&g|~(e^g)&e-g>>>0)>>>31)|0}})},function(a,b,c){var d=c(6);d(d.S,"Math",{imulh:function imulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>16,i=e>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>16)+((f*i>>>0)+(j&c)>>16)}})},function(a,b,c){var d=c(6);d(d.S,"Math",{umulh:function umulh(a,b){var c=65535,d=+a,e=+b,f=d&c,g=e&c,h=d>>>16,i=e>>>16,j=(h*g>>>0)+(f*g>>>16);return h*i+(j>>>16)+((f*i>>>0)+(j&c)>>>16)}})},function(a,b,c){var d=c(275),e=c(10),f=d.key,g=d.set;d.exp({defineMetadata:function defineMetadata(a,b,c,d){g(a,b,e(c),f(d))}})},function(a,b,d){var e=d(203),f=d(6),g=d(21)("metadata"),h=g.store||(g.store=new(d(207))),i=function(a,b,d){var f=h.get(a);if(!f){if(!d)return c;h.set(a,f=new e)}var g=f.get(b);if(!g){if(!d)return c;f.set(b,g=new e)}return g},j=function(a,b,d){var e=i(b,d,!1);return e!==c&&e.has(a)},k=function(a,b,d){var e=i(b,d,!1);return e===c?c:e.get(a)},l=function(a,b,c,d){i(c,d,!0).set(a,b)},m=function(a,b){var c=i(a,b,!1),d=[];return c&&c.forEach(function(a,b){d.push(b)}),d},n=function(a){return a===c||"symbol"==typeof a?a:String(a)},o=function(a){f(f.S,"Reflect",a)};a.exports={store:h,map:i,has:j,get:k,set:l,keys:m,key:n,exp:o}},function(a,b,d){var e=d(275),f=d(10),g=e.key,h=e.map,i=e.store;e.exp({deleteMetadata:function deleteMetadata(a,b){var d=arguments.length<3?c:g(arguments[2]),e=h(f(b),d,!1);if(e===c||!e["delete"](a))return!1;if(e.size)return!0;var j=i.get(b);return j["delete"](d),!!j.size||i["delete"](b)}})},function(a,b,d){var e=d(275),f=d(10),g=d(57),h=e.has,i=e.get,j=e.key,k=function(a,b,d){var e=h(a,b,d);if(e)return i(a,b,d);var f=g(b);return null!==f?k(a,f,d):c};e.exp({getMetadata:function getMetadata(a,b){return k(a,f(b),arguments.length<3?c:j(arguments[2]))}})},function(a,b,d){var e=d(206),f=d(266),g=d(275),h=d(10),i=d(57),j=g.keys,k=g.key,l=function(a,b){var c=j(a,b),d=i(a);if(null===d)return c;var g=l(d,b);return g.length?c.length?f(new e(c.concat(g))):g:c};g.exp({getMetadataKeys:function getMetadataKeys(a){return l(h(a),arguments.length<2?c:k(arguments[1]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.get,h=e.key;e.exp({getOwnMetadata:function getOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.keys,h=e.key;e.exp({getOwnMetadataKeys:function getOwnMetadataKeys(a){return g(f(a),arguments.length<2?c:h(arguments[1]))}})},function(a,b,d){var e=d(275),f=d(10),g=d(57),h=e.has,i=e.key,j=function(a,b,c){var d=h(a,b,c);if(d)return!0;var e=g(b);return null!==e&&j(a,e,c)};e.exp({hasMetadata:function hasMetadata(a,b){return j(a,f(b),arguments.length<3?c:i(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=e.has,h=e.key;e.exp({hasOwnMetadata:function hasOwnMetadata(a,b){return g(a,f(b),arguments.length<3?c:h(arguments[2]))}})},function(a,b,d){var e=d(275),f=d(10),g=d(19),h=e.key,i=e.set;e.exp({metadata:function metadata(a,b){return function decorator(d,e){i(a,b,(e!==c?f:g)(d),h(e))}}})},function(a,b,c){var d=c(6),e=c(201)(),f=c(2).process,g="process"==c(32)(f);d(d.G,{asap:function asap(a){var b=g&&f.domain;e(b?b.bind(a):a)}})},function(a,b,d){var e=d(6),f=d(2),g=d(7),h=d(201)(),i=d(23)("observable"),j=d(19),k=d(10),l=d(197),m=d(202),n=d(8),o=d(198),p=o.RETURN,q=function(a){return null==a?c:j(a)},r=function(a){var b=a._c;b&&(a._c=c,b())},s=function(a){return a._o===c},t=function(a){s(a)||(a._o=c,r(a))},u=function(a,b){k(a),this._c=c,this._o=a,a=new v(this);try{var d=b(a),e=d;null!=d&&("function"==typeof d.unsubscribe?d=function(){e.unsubscribe()}:j(d),this._c=d)}catch(f){return void a.error(f)}s(this)&&r(this)};u.prototype=m({},{unsubscribe:function unsubscribe(){t(this)}});var v=function(a){this._s=a};v.prototype=m({},{next:function next(a){var b=this._s;if(!s(b)){var c=b._o;try{var d=q(c.next);if(d)return d.call(c,a)}catch(e){try{t(b)}finally{throw e}}}},error:function error(a){var b=this._s;if(s(b))throw a;var d=b._o;b._o=c;try{var e=q(d.error);if(!e)throw a;a=e.call(d,a)}catch(f){try{r(b)}finally{throw f}}return r(b),a},complete:function complete(a){var b=this._s;if(!s(b)){var d=b._o;b._o=c;try{var e=q(d.complete);a=e?e.call(d,a):c}catch(f){try{r(b)}finally{throw f}}return r(b),a}}});var w=function Observable(a){l(this,w,"Observable","_f")._f=j(a)};m(w.prototype,{subscribe:function subscribe(a){return new u(a,this._f)},forEach:function forEach(a){var b=this;return new(g.Promise||f.Promise)(function(c,d){j(a);var e=b.subscribe({next:function(b){try{return a(b)}catch(c){d(c),e.unsubscribe()}},error:d,complete:c})})}}),m(w,{from:function from(a){var b="function"==typeof this?this:w,c=q(k(a)[i]);if(c){var d=k(c.call(a));return d.constructor===b?d:new b(function(a){return d.subscribe(a)})}return new b(function(b){var c=!1;return h(function(){if(!c){try{if(o(a,!1,function(a){if(b.next(a),c)return p})===p)return}catch(d){if(c)throw d;return void b.error(d)}b.complete()}}),function(){c=!0}})},of:function of(){for(var a=0,b=arguments.length,c=Array(b);ag;)(c[g]=arguments[g++])===h&&(i=!0);return function(){var d,f=this,g=arguments.length,j=0,k=0;if(!i&&!g)return e(a,c,f);if(d=c.slice(),i)for(;b>j;j++)d[j]===h&&(d[j]=arguments[k++]);for(;g>k;)d.push(arguments[k++]);return e(a,d,f)}}},function(a,b,c){a.exports=c(2)}]),"undefined"!=typeof module&&module.exports?module.exports=a:"function"==typeof define&&define.amd?define(function(){return a}):b.core=a}(1,1); +//# sourceMappingURL=shim.min.js.map \ No newline at end of file diff --git a/node_modules/core-js/client/shim.min.js.map b/node_modules/core-js/client/shim.min.js.map new file mode 100755 index 00000000..dc589561 --- /dev/null +++ b/node_modules/core-js/client/shim.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["shim.js"],"names":["__e","__g","undefined","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","global","has","DESCRIPTORS","$export","redefine","META","KEY","$fails","shared","setToStringTag","uid","wks","wksExt","wksDefine","keyOf","enumKeys","isArray","anObject","toIObject","toPrimitive","createDesc","_create","gOPNExt","$GOPD","$DP","$keys","gOPD","f","dP","gOPN","$Symbol","Symbol","$JSON","JSON","_stringify","stringify","PROTOTYPE","HIDDEN","TO_PRIMITIVE","isEnum","propertyIsEnumerable","SymbolRegistry","AllSymbols","OPSymbols","ObjectProto","Object","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","get","this","value","a","it","key","D","protoDesc","wrap","tag","sym","_k","isSymbol","iterator","$defineProperty","defineProperty","enumerable","$defineProperties","defineProperties","P","keys","i","l","length","$create","create","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","getOwnPropertyDescriptor","$getOwnPropertyNames","getOwnPropertyNames","names","result","push","$getOwnPropertySymbols","getOwnPropertySymbols","IS_OP","TypeError","arguments","$set","configurable","set","toString","name","G","W","F","symbols","split","store","S","for","keyFor","useSetter","useSimple","replacer","$replacer","args","apply","valueOf","Math","window","self","Function","hasOwnProperty","exec","e","core","hide","ctx","type","source","own","out","exp","IS_FORCED","IS_GLOBAL","IS_STATIC","IS_PROTO","IS_BIND","B","target","expProto","U","R","version","object","IE8_DOM_DEFINE","O","Attributes","isObject","document","is","createElement","fn","val","bitmap","writable","SRC","TO_STRING","$toString","TPL","inspectSource","safe","isFunction","join","String","prototype","px","random","concat","aFunction","that","b","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","fastKey","getWeak","onFreeze","meta","NEED","SHARED","def","TAG","stat","USE_SYMBOL","$exports","LIBRARY","charAt","getKeys","el","index","enumBugKeys","arrayIndexOf","IE_PROTO","IObject","defined","cof","slice","toLength","toIndex","IS_INCLUDES","$this","fromIndex","toInteger","min","ceil","floor","isNaN","max","gOPS","pIE","getSymbols","Array","arg","dPs","Empty","createDict","iframeDocument","iframe","lt","gt","style","display","appendChild","src","contentWindow","open","write","close","Properties","documentElement","windowNames","getWindowNames","hiddenKeys","fails","toObject","$getPrototypeOf","getPrototypeOf","constructor","$freeze","freeze","$seal","seal","$preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","assign","$assign","A","K","forEach","k","T","aLen","j","x","y","setPrototypeOf","check","proto","test","buggy","__proto__","classof","ARG","tryGet","callee","bind","invoke","arraySlice","factories","construct","len","n","partArgs","bound","un","FProto","nameRE","NAME","match","HAS_INSTANCE","FunctionProto","inheritIfRequired","$trim","trim","NUMBER","$Number","Base","BROKEN_COF","TRIM","toNumber","argument","third","radix","maxCode","first","charCodeAt","NaN","code","digits","parseInt","Number","C","spaces","space","non","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","string","TYPE","replace","aNumberValue","repeat","$toFixed","toFixed","data","ERROR","ZERO","multiply","c2","divide","numToString","s","t","pow","acc","log","x2","fractionDigits","z","RangeError","msg","count","str","res","Infinity","$toPrecision","toPrecision","precision","EPSILON","_isFinite","isFinite","isInteger","number","abs","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","$parseFloat","parseFloat","$parseInt","ws","hex","log1p","sqrt","$acosh","acosh","MAX_VALUE","LN2","asinh","$asinh","$atanh","atanh","sign","cbrt","clz32","LOG2E","cosh","$expm1","expm1","EPSILON32","MAX32","MIN32","roundTiesToEven","fround","$abs","$sign","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LN10","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","raw","callSite","tpl","$at","codePointAt","pos","context","ENDS_WITH","$endsWith","endsWith","searchString","endPosition","end","search","isRegExp","MATCH","re","INCLUDES","includes","indexOf","STARTS_WITH","$startsWith","startsWith","iterated","_t","_i","point","done","Iterators","$iterCreate","ITERATOR","BUGGY","FF_ITERATOR","KEYS","VALUES","returnThis","Constructor","next","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","kind","values","entries","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","descriptor","createHTML","anchor","quot","attribute","p1","toLowerCase","big","blink","bold","fixed","fontcolor","color","fontsize","size","italics","link","url","small","strike","sub","sup","isArrayIter","createProperty","getIterFn","iter","from","arrayLike","step","mapfn","mapping","iterFn","ret","ArrayProto","getIteratorMethod","SAFE_CLOSING","riter","skipClosing","arr","of","arrayJoin","separator","method","html","begin","klass","start","upTo","cloned","$sort","sort","comparefn","$forEach","STRICT","callbackfn","asc","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","speciesConstructor","original","SPECIES","$map","map","$filter","filter","$some","some","$every","every","$reduce","reduce","memo","isRight","reduceRight","$indexOf","NEGATIVE_ZERO","searchElement","lastIndexOf","copyWithin","to","inc","UNSCOPABLES","fill","endPos","$find","forced","find","findIndex","addToUnscopables","Arguments","$flags","$RegExp","re1","re2","CORRECT_NEW","tiRE","piRE","fiU","proxy","ignoreCase","multiline","unicode","sticky","define","flags","$match","regexp","SYMBOL","fns","strfn","rxfn","REPLACE","$replace","searchValue","replaceValue","SEARCH","$search","SPLIT","$split","_split","$push","$SPLIT","LENGTH","LAST_INDEX","NPCG","limit","separator2","lastIndex","lastLength","output","lastLastIndex","splitLimit","separatorCopy","Internal","GenericPromiseCapability","Wrapper","anInstance","forOf","task","microtask","PROMISE","process","$Promise","isNode","empty","promise","resolve","FakePromise","PromiseRejectionEvent","then","sameConstructor","isThenable","newPromiseCapability","PromiseCapability","reject","$$resolve","$$reject","perform","error","notify","isReject","_n","chain","_c","_v","ok","_s","run","reaction","handler","fail","domain","_h","onHandleUnhandled","enter","exit","onUnhandled","abrupt","console","isUnhandled","emit","onunhandledrejection","reason","_a","onrejectionhandled","$reject","_d","_w","$resolve","wrapper","Promise","executor","err","onFulfilled","onRejected","catch","r","capability","all","iterable","remaining","$index","alreadyCalled","race","forbiddenField","BREAK","RETURN","defer","channel","port","cel","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","counter","queue","ONREADYSTATECHANGE","listener","event","nextTick","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","setTimeout","clear","macrotask","Observer","MutationObserver","WebKitMutationObserver","head","last","flush","parent","toggle","node","createTextNode","observe","characterData","strong","Map","entry","getEntry","v","redefineAll","$iterDefine","setSpecies","SIZE","_f","getConstructor","ADDER","_l","delete","prev","setStrong","$iterDetect","common","IS_WEAK","fixMethod","add","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","Set","InternalMap","each","weak","uncaughtFrozenStore","ufstore","tmp","WeakMap","$WeakMap","createArrayMethod","$has","arrayFind","arrayFindIndex","UncaughtFrozenStore","findUncaughtFrozen","splice","WeakSet","rApply","Reflect","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","propertyKey","attributes","deleteProperty","desc","Enumerate","enumerate","receiver","getProto","ownKeys","V","existingDescriptor","ownDesc","setProto","now","Date","getTime","toJSON","toISOString","pv","lz","num","d","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","DateProto","INVALID_DATE","hint","$typed","buffer","ArrayBuffer","$ArrayBuffer","$DataView","DataView","$isView","ABV","isView","$slice","VIEW","ARRAY_BUFFER","CONSTR","byteLength","final","viewS","viewT","setUint8","getUint8","Typed","TYPED","TypedArrayConstructors","arrayFill","DATA_VIEW","WRONG_LENGTH","WRONG_INDEX","BaseBuffer","BUFFER","BYTE_LENGTH","BYTE_OFFSET","$BUFFER","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","unpackIEEE754","nBits","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","addGetter","internal","view","isLittleEndian","numIndex","intIndex","_b","pack","reverse","conversion","validateArrayBufferArguments","numberLength","ArrayBufferProto","$setInt8","setInt8","getInt8","byteOffset","bufferLength","offset","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","init","Int8Array","$buffer","propertyDesc","same","createArrayIncludes","ArrayIterators","arrayCopyWithin","Uint8Array","SHARED_BUFFER","BYTES_PER_ELEMENT","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayIncludes","arrayValues","arrayKeys","arrayEntries","arrayLastIndexOf","arrayReduce","arrayReduceRight","arraySort","arrayToString","arrayToLocaleString","toLocaleString","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","TYPED_ARRAY","allocate","LITTLE_ENDIAN","Uint16Array","FORCED_SET","strictToLength","SAME","toOffset","BYTES","validate","speciesFromList","list","fromList","$from","$of","TO_LOCALE_BUG","$toLocaleString","predicate","middle","subarray","$begin","$iterators","isTAIndex","$getDesc","$setDesc","$TypedArrayPrototype$","CLAMPED","ISNT_UINT8","GETTER","SETTER","TypedArray","TAC","TypedArrayPrototype","getter","o","round","addElement","$offset","$length","$len","$nativeIterator","CORRECT_ITER_NAME","$iterator","Uint8ClampedArray","Int16Array","Int32Array","Uint32Array","Float32Array","Float64Array","$includes","at","$pad","padStart","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padEnd","trimLeft","trimRight","getFlags","RegExpProto","$RegExpStringIterator","_r","matchAll","rx","getOwnPropertyDescriptors","getDesc","$values","isEntries","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","isError","iaddh","x0","x1","y0","y1","$x0","$x1","$y0","isubh","imulh","u","$u","$v","u0","v0","u1","v1","umulh","metadata","toMetaKey","ordinaryDefineOwnMetadata","defineMetadata","metadataKey","metadataValue","targetKey","getOrCreateMetadataMap","targetMetadata","keyMetadata","ordinaryHasOwnMetadata","MetadataKey","metadataMap","ordinaryGetOwnMetadata","MetadataValue","ordinaryOwnMetadataKeys","_","deleteMetadata","ordinaryGetMetadata","hasOwn","getMetadata","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","decorator","asap","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","Observable","subscribe","observable","items","$task","TO_STRING_TAG","ArrayValues","collections","Collection","partial","navigator","MSIE","userAgent","time","setInterval","path","pargs","holder","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,GACpB,cACS,SAAUC,GAKT,QAASC,qBAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUE,OAGnC,IAAIC,GAASF,EAAiBD,IAC7BE,WACAE,GAAIJ,EACJK,QAAQ,EAUT,OANAP,GAAQE,GAAUM,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASH,qBAG/DI,EAAOE,QAAS,EAGTF,EAAOD,QAvBf,GAAID,KAqCJ,OATAF,qBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAIP,EAGxBF,oBAAoBU,EAAI,GAGjBV,oBAAoB,KAK/B,SAASI,EAAQD,EAASH,GAE/BA,EAAoB,GACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,K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","file":"shim.min.js"} \ No newline at end of file diff --git a/node_modules/core-js/core/_.js b/node_modules/core-js/core/_.js new file mode 100755 index 00000000..8a99f706 --- /dev/null +++ b/node_modules/core-js/core/_.js @@ -0,0 +1,2 @@ +require('../modules/core.function.part'); +module.exports = require('../modules/_core')._; \ No newline at end of file diff --git a/node_modules/core-js/core/delay.js b/node_modules/core-js/core/delay.js new file mode 100755 index 00000000..18857388 --- /dev/null +++ b/node_modules/core-js/core/delay.js @@ -0,0 +1,2 @@ +require('../modules/core.delay'); +module.exports = require('../modules/_core').delay; diff --git a/node_modules/core-js/core/dict.js b/node_modules/core-js/core/dict.js new file mode 100755 index 00000000..da84a8d8 --- /dev/null +++ b/node_modules/core-js/core/dict.js @@ -0,0 +1,2 @@ +require('../modules/core.dict'); +module.exports = require('../modules/_core').Dict; \ No newline at end of file diff --git a/node_modules/core-js/core/function.js b/node_modules/core-js/core/function.js new file mode 100755 index 00000000..3b8d0131 --- /dev/null +++ b/node_modules/core-js/core/function.js @@ -0,0 +1,2 @@ +require('../modules/core.function.part'); +module.exports = require('../modules/_core').Function; diff --git a/node_modules/core-js/core/index.js b/node_modules/core-js/core/index.js new file mode 100755 index 00000000..2b20fd9e --- /dev/null +++ b/node_modules/core-js/core/index.js @@ -0,0 +1,15 @@ +require('../modules/core.dict'); +require('../modules/core.get-iterator-method'); +require('../modules/core.get-iterator'); +require('../modules/core.is-iterable'); +require('../modules/core.delay'); +require('../modules/core.function.part'); +require('../modules/core.object.is-object'); +require('../modules/core.object.classof'); +require('../modules/core.object.define'); +require('../modules/core.object.make'); +require('../modules/core.number.iterator'); +require('../modules/core.regexp.escape'); +require('../modules/core.string.escape-html'); +require('../modules/core.string.unescape-html'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/core/number.js b/node_modules/core-js/core/number.js new file mode 100755 index 00000000..62f632c5 --- /dev/null +++ b/node_modules/core-js/core/number.js @@ -0,0 +1,2 @@ +require('../modules/core.number.iterator'); +module.exports = require('../modules/_core').Number; \ No newline at end of file diff --git a/node_modules/core-js/core/object.js b/node_modules/core-js/core/object.js new file mode 100755 index 00000000..04e539c9 --- /dev/null +++ b/node_modules/core-js/core/object.js @@ -0,0 +1,5 @@ +require('../modules/core.object.is-object'); +require('../modules/core.object.classof'); +require('../modules/core.object.define'); +require('../modules/core.object.make'); +module.exports = require('../modules/_core').Object; diff --git a/node_modules/core-js/core/regexp.js b/node_modules/core-js/core/regexp.js new file mode 100755 index 00000000..3e04c511 --- /dev/null +++ b/node_modules/core-js/core/regexp.js @@ -0,0 +1,2 @@ +require('../modules/core.regexp.escape'); +module.exports = require('../modules/_core').RegExp; \ No newline at end of file diff --git a/node_modules/core-js/core/string.js b/node_modules/core-js/core/string.js new file mode 100755 index 00000000..8da740c6 --- /dev/null +++ b/node_modules/core-js/core/string.js @@ -0,0 +1,3 @@ +require('../modules/core.string.escape-html'); +require('../modules/core.string.unescape-html'); +module.exports = require('../modules/_core').String; \ No newline at end of file diff --git a/node_modules/core-js/es5/index.js b/node_modules/core-js/es5/index.js new file mode 100755 index 00000000..580f1a67 --- /dev/null +++ b/node_modules/core-js/es5/index.js @@ -0,0 +1,37 @@ +require('../modules/es6.object.create'); +require('../modules/es6.object.define-property'); +require('../modules/es6.object.define-properties'); +require('../modules/es6.object.get-own-property-descriptor'); +require('../modules/es6.object.get-prototype-of'); +require('../modules/es6.object.keys'); +require('../modules/es6.object.get-own-property-names'); +require('../modules/es6.object.freeze'); +require('../modules/es6.object.seal'); +require('../modules/es6.object.prevent-extensions'); +require('../modules/es6.object.is-frozen'); +require('../modules/es6.object.is-sealed'); +require('../modules/es6.object.is-extensible'); +require('../modules/es6.function.bind'); +require('../modules/es6.array.is-array'); +require('../modules/es6.array.join'); +require('../modules/es6.array.slice'); +require('../modules/es6.array.sort'); +require('../modules/es6.array.for-each'); +require('../modules/es6.array.map'); +require('../modules/es6.array.filter'); +require('../modules/es6.array.some'); +require('../modules/es6.array.every'); +require('../modules/es6.array.reduce'); +require('../modules/es6.array.reduce-right'); +require('../modules/es6.array.index-of'); +require('../modules/es6.array.last-index-of'); +require('../modules/es6.number.to-fixed'); +require('../modules/es6.number.to-precision'); +require('../modules/es6.date.now'); +require('../modules/es6.date.to-iso-string'); +require('../modules/es6.date.to-json'); +require('../modules/es6.parse-int'); +require('../modules/es6.parse-float'); +require('../modules/es6.string.trim'); +require('../modules/es6.regexp.to-string'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/es6/array.js b/node_modules/core-js/es6/array.js new file mode 100755 index 00000000..428d3e8c --- /dev/null +++ b/node_modules/core-js/es6/array.js @@ -0,0 +1,23 @@ +require('../modules/es6.string.iterator'); +require('../modules/es6.array.is-array'); +require('../modules/es6.array.from'); +require('../modules/es6.array.of'); +require('../modules/es6.array.join'); +require('../modules/es6.array.slice'); +require('../modules/es6.array.sort'); +require('../modules/es6.array.for-each'); +require('../modules/es6.array.map'); +require('../modules/es6.array.filter'); +require('../modules/es6.array.some'); +require('../modules/es6.array.every'); +require('../modules/es6.array.reduce'); +require('../modules/es6.array.reduce-right'); +require('../modules/es6.array.index-of'); +require('../modules/es6.array.last-index-of'); +require('../modules/es6.array.copy-within'); +require('../modules/es6.array.fill'); +require('../modules/es6.array.find'); +require('../modules/es6.array.find-index'); +require('../modules/es6.array.species'); +require('../modules/es6.array.iterator'); +module.exports = require('../modules/_core').Array; \ No newline at end of file diff --git a/node_modules/core-js/es6/date.js b/node_modules/core-js/es6/date.js new file mode 100755 index 00000000..dfa3be09 --- /dev/null +++ b/node_modules/core-js/es6/date.js @@ -0,0 +1,6 @@ +require('../modules/es6.date.now'); +require('../modules/es6.date.to-json'); +require('../modules/es6.date.to-iso-string'); +require('../modules/es6.date.to-string'); +require('../modules/es6.date.to-primitive'); +module.exports = Date; \ No newline at end of file diff --git a/node_modules/core-js/es6/function.js b/node_modules/core-js/es6/function.js new file mode 100755 index 00000000..ff685da2 --- /dev/null +++ b/node_modules/core-js/es6/function.js @@ -0,0 +1,4 @@ +require('../modules/es6.function.bind'); +require('../modules/es6.function.name'); +require('../modules/es6.function.has-instance'); +module.exports = require('../modules/_core').Function; \ No newline at end of file diff --git a/node_modules/core-js/es6/index.js b/node_modules/core-js/es6/index.js new file mode 100755 index 00000000..59df5092 --- /dev/null +++ b/node_modules/core-js/es6/index.js @@ -0,0 +1,138 @@ +require('../modules/es6.symbol'); +require('../modules/es6.object.create'); +require('../modules/es6.object.define-property'); +require('../modules/es6.object.define-properties'); +require('../modules/es6.object.get-own-property-descriptor'); +require('../modules/es6.object.get-prototype-of'); +require('../modules/es6.object.keys'); +require('../modules/es6.object.get-own-property-names'); +require('../modules/es6.object.freeze'); +require('../modules/es6.object.seal'); +require('../modules/es6.object.prevent-extensions'); +require('../modules/es6.object.is-frozen'); +require('../modules/es6.object.is-sealed'); +require('../modules/es6.object.is-extensible'); +require('../modules/es6.object.assign'); +require('../modules/es6.object.is'); +require('../modules/es6.object.set-prototype-of'); +require('../modules/es6.object.to-string'); +require('../modules/es6.function.bind'); +require('../modules/es6.function.name'); +require('../modules/es6.function.has-instance'); +require('../modules/es6.parse-int'); +require('../modules/es6.parse-float'); +require('../modules/es6.number.constructor'); +require('../modules/es6.number.to-fixed'); +require('../modules/es6.number.to-precision'); +require('../modules/es6.number.epsilon'); +require('../modules/es6.number.is-finite'); +require('../modules/es6.number.is-integer'); +require('../modules/es6.number.is-nan'); +require('../modules/es6.number.is-safe-integer'); +require('../modules/es6.number.max-safe-integer'); +require('../modules/es6.number.min-safe-integer'); +require('../modules/es6.number.parse-float'); +require('../modules/es6.number.parse-int'); +require('../modules/es6.math.acosh'); +require('../modules/es6.math.asinh'); +require('../modules/es6.math.atanh'); +require('../modules/es6.math.cbrt'); +require('../modules/es6.math.clz32'); +require('../modules/es6.math.cosh'); +require('../modules/es6.math.expm1'); +require('../modules/es6.math.fround'); +require('../modules/es6.math.hypot'); +require('../modules/es6.math.imul'); +require('../modules/es6.math.log10'); +require('../modules/es6.math.log1p'); +require('../modules/es6.math.log2'); +require('../modules/es6.math.sign'); +require('../modules/es6.math.sinh'); +require('../modules/es6.math.tanh'); +require('../modules/es6.math.trunc'); +require('../modules/es6.string.from-code-point'); +require('../modules/es6.string.raw'); +require('../modules/es6.string.trim'); +require('../modules/es6.string.iterator'); +require('../modules/es6.string.code-point-at'); +require('../modules/es6.string.ends-with'); +require('../modules/es6.string.includes'); +require('../modules/es6.string.repeat'); +require('../modules/es6.string.starts-with'); +require('../modules/es6.string.anchor'); +require('../modules/es6.string.big'); +require('../modules/es6.string.blink'); +require('../modules/es6.string.bold'); +require('../modules/es6.string.fixed'); +require('../modules/es6.string.fontcolor'); +require('../modules/es6.string.fontsize'); +require('../modules/es6.string.italics'); +require('../modules/es6.string.link'); +require('../modules/es6.string.small'); +require('../modules/es6.string.strike'); +require('../modules/es6.string.sub'); +require('../modules/es6.string.sup'); +require('../modules/es6.date.now'); +require('../modules/es6.date.to-json'); +require('../modules/es6.date.to-iso-string'); +require('../modules/es6.date.to-string'); +require('../modules/es6.date.to-primitive'); +require('../modules/es6.array.is-array'); +require('../modules/es6.array.from'); +require('../modules/es6.array.of'); +require('../modules/es6.array.join'); +require('../modules/es6.array.slice'); +require('../modules/es6.array.sort'); +require('../modules/es6.array.for-each'); +require('../modules/es6.array.map'); +require('../modules/es6.array.filter'); +require('../modules/es6.array.some'); +require('../modules/es6.array.every'); +require('../modules/es6.array.reduce'); +require('../modules/es6.array.reduce-right'); +require('../modules/es6.array.index-of'); +require('../modules/es6.array.last-index-of'); +require('../modules/es6.array.copy-within'); +require('../modules/es6.array.fill'); +require('../modules/es6.array.find'); +require('../modules/es6.array.find-index'); +require('../modules/es6.array.species'); +require('../modules/es6.array.iterator'); +require('../modules/es6.regexp.constructor'); +require('../modules/es6.regexp.to-string'); +require('../modules/es6.regexp.flags'); +require('../modules/es6.regexp.match'); +require('../modules/es6.regexp.replace'); +require('../modules/es6.regexp.search'); +require('../modules/es6.regexp.split'); +require('../modules/es6.promise'); +require('../modules/es6.map'); +require('../modules/es6.set'); +require('../modules/es6.weak-map'); +require('../modules/es6.weak-set'); +require('../modules/es6.typed.array-buffer'); +require('../modules/es6.typed.data-view'); +require('../modules/es6.typed.int8-array'); +require('../modules/es6.typed.uint8-array'); +require('../modules/es6.typed.uint8-clamped-array'); +require('../modules/es6.typed.int16-array'); +require('../modules/es6.typed.uint16-array'); +require('../modules/es6.typed.int32-array'); +require('../modules/es6.typed.uint32-array'); +require('../modules/es6.typed.float32-array'); +require('../modules/es6.typed.float64-array'); +require('../modules/es6.reflect.apply'); +require('../modules/es6.reflect.construct'); +require('../modules/es6.reflect.define-property'); +require('../modules/es6.reflect.delete-property'); +require('../modules/es6.reflect.enumerate'); +require('../modules/es6.reflect.get'); +require('../modules/es6.reflect.get-own-property-descriptor'); +require('../modules/es6.reflect.get-prototype-of'); +require('../modules/es6.reflect.has'); +require('../modules/es6.reflect.is-extensible'); +require('../modules/es6.reflect.own-keys'); +require('../modules/es6.reflect.prevent-extensions'); +require('../modules/es6.reflect.set'); +require('../modules/es6.reflect.set-prototype-of'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/es6/map.js b/node_modules/core-js/es6/map.js new file mode 100755 index 00000000..50f04c1f --- /dev/null +++ b/node_modules/core-js/es6/map.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.map'); +module.exports = require('../modules/_core').Map; \ No newline at end of file diff --git a/node_modules/core-js/es6/math.js b/node_modules/core-js/es6/math.js new file mode 100755 index 00000000..f26b5b29 --- /dev/null +++ b/node_modules/core-js/es6/math.js @@ -0,0 +1,18 @@ +require('../modules/es6.math.acosh'); +require('../modules/es6.math.asinh'); +require('../modules/es6.math.atanh'); +require('../modules/es6.math.cbrt'); +require('../modules/es6.math.clz32'); +require('../modules/es6.math.cosh'); +require('../modules/es6.math.expm1'); +require('../modules/es6.math.fround'); +require('../modules/es6.math.hypot'); +require('../modules/es6.math.imul'); +require('../modules/es6.math.log10'); +require('../modules/es6.math.log1p'); +require('../modules/es6.math.log2'); +require('../modules/es6.math.sign'); +require('../modules/es6.math.sinh'); +require('../modules/es6.math.tanh'); +require('../modules/es6.math.trunc'); +module.exports = require('../modules/_core').Math; \ No newline at end of file diff --git a/node_modules/core-js/es6/number.js b/node_modules/core-js/es6/number.js new file mode 100755 index 00000000..1dafcda4 --- /dev/null +++ b/node_modules/core-js/es6/number.js @@ -0,0 +1,13 @@ +require('../modules/es6.number.constructor'); +require('../modules/es6.number.to-fixed'); +require('../modules/es6.number.to-precision'); +require('../modules/es6.number.epsilon'); +require('../modules/es6.number.is-finite'); +require('../modules/es6.number.is-integer'); +require('../modules/es6.number.is-nan'); +require('../modules/es6.number.is-safe-integer'); +require('../modules/es6.number.max-safe-integer'); +require('../modules/es6.number.min-safe-integer'); +require('../modules/es6.number.parse-float'); +require('../modules/es6.number.parse-int'); +module.exports = require('../modules/_core').Number; \ No newline at end of file diff --git a/node_modules/core-js/es6/object.js b/node_modules/core-js/es6/object.js new file mode 100755 index 00000000..aada8c38 --- /dev/null +++ b/node_modules/core-js/es6/object.js @@ -0,0 +1,20 @@ +require('../modules/es6.symbol'); +require('../modules/es6.object.create'); +require('../modules/es6.object.define-property'); +require('../modules/es6.object.define-properties'); +require('../modules/es6.object.get-own-property-descriptor'); +require('../modules/es6.object.get-prototype-of'); +require('../modules/es6.object.keys'); +require('../modules/es6.object.get-own-property-names'); +require('../modules/es6.object.freeze'); +require('../modules/es6.object.seal'); +require('../modules/es6.object.prevent-extensions'); +require('../modules/es6.object.is-frozen'); +require('../modules/es6.object.is-sealed'); +require('../modules/es6.object.is-extensible'); +require('../modules/es6.object.assign'); +require('../modules/es6.object.is'); +require('../modules/es6.object.set-prototype-of'); +require('../modules/es6.object.to-string'); + +module.exports = require('../modules/_core').Object; \ No newline at end of file diff --git a/node_modules/core-js/es6/parse-float.js b/node_modules/core-js/es6/parse-float.js new file mode 100755 index 00000000..dad94ddb --- /dev/null +++ b/node_modules/core-js/es6/parse-float.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-float'); +module.exports = require('../modules/_core').parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/es6/parse-int.js b/node_modules/core-js/es6/parse-int.js new file mode 100755 index 00000000..08a20996 --- /dev/null +++ b/node_modules/core-js/es6/parse-int.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-int'); +module.exports = require('../modules/_core').parseInt; \ No newline at end of file diff --git a/node_modules/core-js/es6/promise.js b/node_modules/core-js/es6/promise.js new file mode 100755 index 00000000..c901c859 --- /dev/null +++ b/node_modules/core-js/es6/promise.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +module.exports = require('../modules/_core').Promise; \ No newline at end of file diff --git a/node_modules/core-js/es6/reflect.js b/node_modules/core-js/es6/reflect.js new file mode 100755 index 00000000..18bdb3c2 --- /dev/null +++ b/node_modules/core-js/es6/reflect.js @@ -0,0 +1,15 @@ +require('../modules/es6.reflect.apply'); +require('../modules/es6.reflect.construct'); +require('../modules/es6.reflect.define-property'); +require('../modules/es6.reflect.delete-property'); +require('../modules/es6.reflect.enumerate'); +require('../modules/es6.reflect.get'); +require('../modules/es6.reflect.get-own-property-descriptor'); +require('../modules/es6.reflect.get-prototype-of'); +require('../modules/es6.reflect.has'); +require('../modules/es6.reflect.is-extensible'); +require('../modules/es6.reflect.own-keys'); +require('../modules/es6.reflect.prevent-extensions'); +require('../modules/es6.reflect.set'); +require('../modules/es6.reflect.set-prototype-of'); +module.exports = require('../modules/_core').Reflect; \ No newline at end of file diff --git a/node_modules/core-js/es6/regexp.js b/node_modules/core-js/es6/regexp.js new file mode 100755 index 00000000..27cc827f --- /dev/null +++ b/node_modules/core-js/es6/regexp.js @@ -0,0 +1,8 @@ +require('../modules/es6.regexp.constructor'); +require('../modules/es6.regexp.to-string'); +require('../modules/es6.regexp.flags'); +require('../modules/es6.regexp.match'); +require('../modules/es6.regexp.replace'); +require('../modules/es6.regexp.search'); +require('../modules/es6.regexp.split'); +module.exports = require('../modules/_core').RegExp; \ No newline at end of file diff --git a/node_modules/core-js/es6/set.js b/node_modules/core-js/es6/set.js new file mode 100755 index 00000000..2a2557ce --- /dev/null +++ b/node_modules/core-js/es6/set.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.set'); +module.exports = require('../modules/_core').Set; \ No newline at end of file diff --git a/node_modules/core-js/es6/string.js b/node_modules/core-js/es6/string.js new file mode 100755 index 00000000..83033621 --- /dev/null +++ b/node_modules/core-js/es6/string.js @@ -0,0 +1,27 @@ +require('../modules/es6.string.from-code-point'); +require('../modules/es6.string.raw'); +require('../modules/es6.string.trim'); +require('../modules/es6.string.iterator'); +require('../modules/es6.string.code-point-at'); +require('../modules/es6.string.ends-with'); +require('../modules/es6.string.includes'); +require('../modules/es6.string.repeat'); +require('../modules/es6.string.starts-with'); +require('../modules/es6.string.anchor'); +require('../modules/es6.string.big'); +require('../modules/es6.string.blink'); +require('../modules/es6.string.bold'); +require('../modules/es6.string.fixed'); +require('../modules/es6.string.fontcolor'); +require('../modules/es6.string.fontsize'); +require('../modules/es6.string.italics'); +require('../modules/es6.string.link'); +require('../modules/es6.string.small'); +require('../modules/es6.string.strike'); +require('../modules/es6.string.sub'); +require('../modules/es6.string.sup'); +require('../modules/es6.regexp.match'); +require('../modules/es6.regexp.replace'); +require('../modules/es6.regexp.search'); +require('../modules/es6.regexp.split'); +module.exports = require('../modules/_core').String; \ No newline at end of file diff --git a/node_modules/core-js/es6/symbol.js b/node_modules/core-js/es6/symbol.js new file mode 100755 index 00000000..e578e3af --- /dev/null +++ b/node_modules/core-js/es6/symbol.js @@ -0,0 +1,3 @@ +require('../modules/es6.symbol'); +require('../modules/es6.object.to-string'); +module.exports = require('../modules/_core').Symbol; \ No newline at end of file diff --git a/node_modules/core-js/es6/typed.js b/node_modules/core-js/es6/typed.js new file mode 100755 index 00000000..e0364e6c --- /dev/null +++ b/node_modules/core-js/es6/typed.js @@ -0,0 +1,13 @@ +require('../modules/es6.typed.array-buffer'); +require('../modules/es6.typed.data-view'); +require('../modules/es6.typed.int8-array'); +require('../modules/es6.typed.uint8-array'); +require('../modules/es6.typed.uint8-clamped-array'); +require('../modules/es6.typed.int16-array'); +require('../modules/es6.typed.uint16-array'); +require('../modules/es6.typed.int32-array'); +require('../modules/es6.typed.uint32-array'); +require('../modules/es6.typed.float32-array'); +require('../modules/es6.typed.float64-array'); +require('../modules/es6.object.to-string'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/es6/weak-map.js b/node_modules/core-js/es6/weak-map.js new file mode 100755 index 00000000..655866c2 --- /dev/null +++ b/node_modules/core-js/es6/weak-map.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.array.iterator'); +require('../modules/es6.weak-map'); +module.exports = require('../modules/_core').WeakMap; \ No newline at end of file diff --git a/node_modules/core-js/es6/weak-set.js b/node_modules/core-js/es6/weak-set.js new file mode 100755 index 00000000..eef1af2a --- /dev/null +++ b/node_modules/core-js/es6/weak-set.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/web.dom.iterable'); +require('../modules/es6.weak-set'); +module.exports = require('../modules/_core').WeakSet; \ No newline at end of file diff --git a/node_modules/core-js/es7/array.js b/node_modules/core-js/es7/array.js new file mode 100755 index 00000000..9fb57fa6 --- /dev/null +++ b/node_modules/core-js/es7/array.js @@ -0,0 +1,2 @@ +require('../modules/es7.array.includes'); +module.exports = require('../modules/_core').Array; \ No newline at end of file diff --git a/node_modules/core-js/es7/asap.js b/node_modules/core-js/es7/asap.js new file mode 100755 index 00000000..cc90f7e5 --- /dev/null +++ b/node_modules/core-js/es7/asap.js @@ -0,0 +1,2 @@ +require('../modules/es7.asap'); +module.exports = require('../modules/_core').asap; diff --git a/node_modules/core-js/es7/error.js b/node_modules/core-js/es7/error.js new file mode 100755 index 00000000..f0bb260b --- /dev/null +++ b/node_modules/core-js/es7/error.js @@ -0,0 +1,2 @@ +require('../modules/es7.error.is-error'); +module.exports = require('../modules/_core').Error; \ No newline at end of file diff --git a/node_modules/core-js/es7/index.js b/node_modules/core-js/es7/index.js new file mode 100755 index 00000000..b8c90b86 --- /dev/null +++ b/node_modules/core-js/es7/index.js @@ -0,0 +1,36 @@ +require('../modules/es7.array.includes'); +require('../modules/es7.string.at'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.string.match-all'); +require('../modules/es7.symbol.async-iterator'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +require('../modules/es7.map.to-json'); +require('../modules/es7.set.to-json'); +require('../modules/es7.system.global'); +require('../modules/es7.error.is-error'); +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +require('../modules/es7.asap'); +require('../modules/es7.observable'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/es7/map.js b/node_modules/core-js/es7/map.js new file mode 100755 index 00000000..dfa32fd2 --- /dev/null +++ b/node_modules/core-js/es7/map.js @@ -0,0 +1,2 @@ +require('../modules/es7.map.to-json'); +module.exports = require('../modules/_core').Map; \ No newline at end of file diff --git a/node_modules/core-js/es7/math.js b/node_modules/core-js/es7/math.js new file mode 100755 index 00000000..bdb8a81c --- /dev/null +++ b/node_modules/core-js/es7/math.js @@ -0,0 +1,5 @@ +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +module.exports = require('../modules/_core').Math; diff --git a/node_modules/core-js/es7/object.js b/node_modules/core-js/es7/object.js new file mode 100755 index 00000000..c76b754d --- /dev/null +++ b/node_modules/core-js/es7/object.js @@ -0,0 +1,8 @@ +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +module.exports = require('../modules/_core').Object; \ No newline at end of file diff --git a/node_modules/core-js/es7/observable.js b/node_modules/core-js/es7/observable.js new file mode 100755 index 00000000..05ca51a3 --- /dev/null +++ b/node_modules/core-js/es7/observable.js @@ -0,0 +1,7 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +module.exports = require('../modules/_core').Observable; \ No newline at end of file diff --git a/node_modules/core-js/es7/reflect.js b/node_modules/core-js/es7/reflect.js new file mode 100755 index 00000000..f0b69cbb --- /dev/null +++ b/node_modules/core-js/es7/reflect.js @@ -0,0 +1,10 @@ +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +module.exports = require('../modules/_core').Reflect; diff --git a/node_modules/core-js/es7/set.js b/node_modules/core-js/es7/set.js new file mode 100755 index 00000000..b5c19c44 --- /dev/null +++ b/node_modules/core-js/es7/set.js @@ -0,0 +1,2 @@ +require('../modules/es7.set.to-json'); +module.exports = require('../modules/_core').Set; \ No newline at end of file diff --git a/node_modules/core-js/es7/string.js b/node_modules/core-js/es7/string.js new file mode 100755 index 00000000..6e413b4c --- /dev/null +++ b/node_modules/core-js/es7/string.js @@ -0,0 +1,7 @@ +require('../modules/es7.string.at'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.string.match-all'); +module.exports = require('../modules/_core').String; diff --git a/node_modules/core-js/es7/symbol.js b/node_modules/core-js/es7/symbol.js new file mode 100755 index 00000000..14d90eec --- /dev/null +++ b/node_modules/core-js/es7/symbol.js @@ -0,0 +1,3 @@ +require('../modules/es7.symbol.async-iterator'); +require('../modules/es7.symbol.observable'); +module.exports = require('../modules/_core').Symbol; \ No newline at end of file diff --git a/node_modules/core-js/es7/system.js b/node_modules/core-js/es7/system.js new file mode 100755 index 00000000..6d321c78 --- /dev/null +++ b/node_modules/core-js/es7/system.js @@ -0,0 +1,2 @@ +require('../modules/es7.system.global'); +module.exports = require('../modules/_core').System; \ No newline at end of file diff --git a/node_modules/core-js/fn/_.js b/node_modules/core-js/fn/_.js new file mode 100755 index 00000000..8a99f706 --- /dev/null +++ b/node_modules/core-js/fn/_.js @@ -0,0 +1,2 @@ +require('../modules/core.function.part'); +module.exports = require('../modules/_core')._; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/concat.js b/node_modules/core-js/fn/array/concat.js new file mode 100755 index 00000000..de4bddf9 --- /dev/null +++ b/node_modules/core-js/fn/array/concat.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.concat, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/copy-within.js b/node_modules/core-js/fn/array/copy-within.js new file mode 100755 index 00000000..89e1de4f --- /dev/null +++ b/node_modules/core-js/fn/array/copy-within.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.copy-within'); +module.exports = require('../../modules/_core').Array.copyWithin; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/entries.js b/node_modules/core-js/fn/array/entries.js new file mode 100755 index 00000000..f4feb26c --- /dev/null +++ b/node_modules/core-js/fn/array/entries.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.entries; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/every.js b/node_modules/core-js/fn/array/every.js new file mode 100755 index 00000000..168844cc --- /dev/null +++ b/node_modules/core-js/fn/array/every.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.every'); +module.exports = require('../../modules/_core').Array.every; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/fill.js b/node_modules/core-js/fn/array/fill.js new file mode 100755 index 00000000..b23ebfde --- /dev/null +++ b/node_modules/core-js/fn/array/fill.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.fill'); +module.exports = require('../../modules/_core').Array.fill; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/filter.js b/node_modules/core-js/fn/array/filter.js new file mode 100755 index 00000000..0023f0de --- /dev/null +++ b/node_modules/core-js/fn/array/filter.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.filter'); +module.exports = require('../../modules/_core').Array.filter; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/find-index.js b/node_modules/core-js/fn/array/find-index.js new file mode 100755 index 00000000..99e6bf17 --- /dev/null +++ b/node_modules/core-js/fn/array/find-index.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.find-index'); +module.exports = require('../../modules/_core').Array.findIndex; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/find.js b/node_modules/core-js/fn/array/find.js new file mode 100755 index 00000000..f146ec22 --- /dev/null +++ b/node_modules/core-js/fn/array/find.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.find'); +module.exports = require('../../modules/_core').Array.find; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/for-each.js b/node_modules/core-js/fn/array/for-each.js new file mode 100755 index 00000000..09e235f9 --- /dev/null +++ b/node_modules/core-js/fn/array/for-each.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.for-each'); +module.exports = require('../../modules/_core').Array.forEach; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/from.js b/node_modules/core-js/fn/array/from.js new file mode 100755 index 00000000..1f323fbc --- /dev/null +++ b/node_modules/core-js/fn/array/from.js @@ -0,0 +1,3 @@ +require('../../modules/es6.string.iterator'); +require('../../modules/es6.array.from'); +module.exports = require('../../modules/_core').Array.from; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/includes.js b/node_modules/core-js/fn/array/includes.js new file mode 100755 index 00000000..851d31fd --- /dev/null +++ b/node_modules/core-js/fn/array/includes.js @@ -0,0 +1,2 @@ +require('../../modules/es7.array.includes'); +module.exports = require('../../modules/_core').Array.includes; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/index-of.js b/node_modules/core-js/fn/array/index-of.js new file mode 100755 index 00000000..9ed82472 --- /dev/null +++ b/node_modules/core-js/fn/array/index-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.index-of'); +module.exports = require('../../modules/_core').Array.indexOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/index.js b/node_modules/core-js/fn/array/index.js new file mode 100755 index 00000000..85bc77bc --- /dev/null +++ b/node_modules/core-js/fn/array/index.js @@ -0,0 +1,24 @@ +require('../../modules/es6.string.iterator'); +require('../../modules/es6.array.is-array'); +require('../../modules/es6.array.from'); +require('../../modules/es6.array.of'); +require('../../modules/es6.array.join'); +require('../../modules/es6.array.slice'); +require('../../modules/es6.array.sort'); +require('../../modules/es6.array.for-each'); +require('../../modules/es6.array.map'); +require('../../modules/es6.array.filter'); +require('../../modules/es6.array.some'); +require('../../modules/es6.array.every'); +require('../../modules/es6.array.reduce'); +require('../../modules/es6.array.reduce-right'); +require('../../modules/es6.array.index-of'); +require('../../modules/es6.array.last-index-of'); +require('../../modules/es6.array.copy-within'); +require('../../modules/es6.array.fill'); +require('../../modules/es6.array.find'); +require('../../modules/es6.array.find-index'); +require('../../modules/es6.array.species'); +require('../../modules/es6.array.iterator'); +require('../../modules/es7.array.includes'); +module.exports = require('../../modules/_core').Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/is-array.js b/node_modules/core-js/fn/array/is-array.js new file mode 100755 index 00000000..bbe76719 --- /dev/null +++ b/node_modules/core-js/fn/array/is-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.is-array'); +module.exports = require('../../modules/_core').Array.isArray; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/iterator.js b/node_modules/core-js/fn/array/iterator.js new file mode 100755 index 00000000..ca93b78a --- /dev/null +++ b/node_modules/core-js/fn/array/iterator.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.values; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/join.js b/node_modules/core-js/fn/array/join.js new file mode 100755 index 00000000..9beef18d --- /dev/null +++ b/node_modules/core-js/fn/array/join.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.join'); +module.exports = require('../../modules/_core').Array.join; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/keys.js b/node_modules/core-js/fn/array/keys.js new file mode 100755 index 00000000..b44b921f --- /dev/null +++ b/node_modules/core-js/fn/array/keys.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.keys; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/last-index-of.js b/node_modules/core-js/fn/array/last-index-of.js new file mode 100755 index 00000000..6dcc98a1 --- /dev/null +++ b/node_modules/core-js/fn/array/last-index-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.last-index-of'); +module.exports = require('../../modules/_core').Array.lastIndexOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/map.js b/node_modules/core-js/fn/array/map.js new file mode 100755 index 00000000..14b0f627 --- /dev/null +++ b/node_modules/core-js/fn/array/map.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.map'); +module.exports = require('../../modules/_core').Array.map; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/of.js b/node_modules/core-js/fn/array/of.js new file mode 100755 index 00000000..652ee980 --- /dev/null +++ b/node_modules/core-js/fn/array/of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.of'); +module.exports = require('../../modules/_core').Array.of; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/pop.js b/node_modules/core-js/fn/array/pop.js new file mode 100755 index 00000000..b8414f61 --- /dev/null +++ b/node_modules/core-js/fn/array/pop.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.pop, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/push.js b/node_modules/core-js/fn/array/push.js new file mode 100755 index 00000000..03539009 --- /dev/null +++ b/node_modules/core-js/fn/array/push.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.push, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/reduce-right.js b/node_modules/core-js/fn/array/reduce-right.js new file mode 100755 index 00000000..1193ecba --- /dev/null +++ b/node_modules/core-js/fn/array/reduce-right.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.reduce-right'); +module.exports = require('../../modules/_core').Array.reduceRight; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/reduce.js b/node_modules/core-js/fn/array/reduce.js new file mode 100755 index 00000000..e2dee913 --- /dev/null +++ b/node_modules/core-js/fn/array/reduce.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.reduce'); +module.exports = require('../../modules/_core').Array.reduce; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/reverse.js b/node_modules/core-js/fn/array/reverse.js new file mode 100755 index 00000000..60734293 --- /dev/null +++ b/node_modules/core-js/fn/array/reverse.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.reverse, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/shift.js b/node_modules/core-js/fn/array/shift.js new file mode 100755 index 00000000..5002a606 --- /dev/null +++ b/node_modules/core-js/fn/array/shift.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.shift, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/slice.js b/node_modules/core-js/fn/array/slice.js new file mode 100755 index 00000000..4914c2a9 --- /dev/null +++ b/node_modules/core-js/fn/array/slice.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.slice'); +module.exports = require('../../modules/_core').Array.slice; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/some.js b/node_modules/core-js/fn/array/some.js new file mode 100755 index 00000000..de284006 --- /dev/null +++ b/node_modules/core-js/fn/array/some.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.some'); +module.exports = require('../../modules/_core').Array.some; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/sort.js b/node_modules/core-js/fn/array/sort.js new file mode 100755 index 00000000..29b6f3ae --- /dev/null +++ b/node_modules/core-js/fn/array/sort.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.sort'); +module.exports = require('../../modules/_core').Array.sort; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/splice.js b/node_modules/core-js/fn/array/splice.js new file mode 100755 index 00000000..9d0bdbed --- /dev/null +++ b/node_modules/core-js/fn/array/splice.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.splice, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/unshift.js b/node_modules/core-js/fn/array/unshift.js new file mode 100755 index 00000000..63fe2dd8 --- /dev/null +++ b/node_modules/core-js/fn/array/unshift.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.unshift, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/values.js b/node_modules/core-js/fn/array/values.js new file mode 100755 index 00000000..ca93b78a --- /dev/null +++ b/node_modules/core-js/fn/array/values.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.values; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/copy-within.js b/node_modules/core-js/fn/array/virtual/copy-within.js new file mode 100755 index 00000000..62172a9e --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/copy-within.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.copy-within'); +module.exports = require('../../../modules/_entry-virtual')('Array').copyWithin; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/entries.js b/node_modules/core-js/fn/array/virtual/entries.js new file mode 100755 index 00000000..1b198e3c --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/entries.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.iterator'); +module.exports = require('../../../modules/_entry-virtual')('Array').entries; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/every.js b/node_modules/core-js/fn/array/virtual/every.js new file mode 100755 index 00000000..a72e5851 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/every.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.every'); +module.exports = require('../../../modules/_entry-virtual')('Array').every; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/fill.js b/node_modules/core-js/fn/array/virtual/fill.js new file mode 100755 index 00000000..6018b37b --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/fill.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.fill'); +module.exports = require('../../../modules/_entry-virtual')('Array').fill; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/filter.js b/node_modules/core-js/fn/array/virtual/filter.js new file mode 100755 index 00000000..46a14f1c --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/filter.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.filter'); +module.exports = require('../../../modules/_entry-virtual')('Array').filter; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/find-index.js b/node_modules/core-js/fn/array/virtual/find-index.js new file mode 100755 index 00000000..ef96165f --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/find-index.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.find-index'); +module.exports = require('../../../modules/_entry-virtual')('Array').findIndex; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/find.js b/node_modules/core-js/fn/array/virtual/find.js new file mode 100755 index 00000000..6cffee5b --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/find.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.find'); +module.exports = require('../../../modules/_entry-virtual')('Array').find; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/for-each.js b/node_modules/core-js/fn/array/virtual/for-each.js new file mode 100755 index 00000000..0c3ed449 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/for-each.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.for-each'); +module.exports = require('../../../modules/_entry-virtual')('Array').forEach; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/includes.js b/node_modules/core-js/fn/array/virtual/includes.js new file mode 100755 index 00000000..bf9031d7 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/includes.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.array.includes'); +module.exports = require('../../../modules/_entry-virtual')('Array').includes; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/index-of.js b/node_modules/core-js/fn/array/virtual/index-of.js new file mode 100755 index 00000000..cf6f36e3 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/index-of.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.index-of'); +module.exports = require('../../../modules/_entry-virtual')('Array').indexOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/index.js b/node_modules/core-js/fn/array/virtual/index.js new file mode 100755 index 00000000..ff554a2a --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/index.js @@ -0,0 +1,20 @@ +require('../../../modules/es6.array.join'); +require('../../../modules/es6.array.slice'); +require('../../../modules/es6.array.sort'); +require('../../../modules/es6.array.for-each'); +require('../../../modules/es6.array.map'); +require('../../../modules/es6.array.filter'); +require('../../../modules/es6.array.some'); +require('../../../modules/es6.array.every'); +require('../../../modules/es6.array.reduce'); +require('../../../modules/es6.array.reduce-right'); +require('../../../modules/es6.array.index-of'); +require('../../../modules/es6.array.last-index-of'); +require('../../../modules/es6.string.iterator'); +require('../../../modules/es6.array.iterator'); +require('../../../modules/es6.array.copy-within'); +require('../../../modules/es6.array.fill'); +require('../../../modules/es6.array.find'); +require('../../../modules/es6.array.find-index'); +require('../../../modules/es7.array.includes'); +module.exports = require('../../../modules/_entry-virtual')('Array'); \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/iterator.js b/node_modules/core-js/fn/array/virtual/iterator.js new file mode 100755 index 00000000..7812b3c9 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/iterator.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/join.js b/node_modules/core-js/fn/array/virtual/join.js new file mode 100755 index 00000000..3f7d5cff --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/join.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.join'); +module.exports = require('../../../modules/_entry-virtual')('Array').join; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/keys.js b/node_modules/core-js/fn/array/virtual/keys.js new file mode 100755 index 00000000..16c09681 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/keys.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.iterator'); +module.exports = require('../../../modules/_entry-virtual')('Array').keys; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/last-index-of.js b/node_modules/core-js/fn/array/virtual/last-index-of.js new file mode 100755 index 00000000..cdd79b7d --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/last-index-of.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.last-index-of'); +module.exports = require('../../../modules/_entry-virtual')('Array').lastIndexOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/map.js b/node_modules/core-js/fn/array/virtual/map.js new file mode 100755 index 00000000..14bffdac --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/map.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.map'); +module.exports = require('../../../modules/_entry-virtual')('Array').map; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/reduce-right.js b/node_modules/core-js/fn/array/virtual/reduce-right.js new file mode 100755 index 00000000..61313e8f --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/reduce-right.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.reduce-right'); +module.exports = require('../../../modules/_entry-virtual')('Array').reduceRight; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/reduce.js b/node_modules/core-js/fn/array/virtual/reduce.js new file mode 100755 index 00000000..1b059053 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/reduce.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.reduce'); +module.exports = require('../../../modules/_entry-virtual')('Array').reduce; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/slice.js b/node_modules/core-js/fn/array/virtual/slice.js new file mode 100755 index 00000000..b28d1abc --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/slice.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.slice'); +module.exports = require('../../../modules/_entry-virtual')('Array').slice; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/some.js b/node_modules/core-js/fn/array/virtual/some.js new file mode 100755 index 00000000..58c183c5 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/some.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.some'); +module.exports = require('../../../modules/_entry-virtual')('Array').some; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/sort.js b/node_modules/core-js/fn/array/virtual/sort.js new file mode 100755 index 00000000..c8883150 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/sort.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.sort'); +module.exports = require('../../../modules/_entry-virtual')('Array').sort; \ No newline at end of file diff --git a/node_modules/core-js/fn/array/virtual/values.js b/node_modules/core-js/fn/array/virtual/values.js new file mode 100755 index 00000000..7812b3c9 --- /dev/null +++ b/node_modules/core-js/fn/array/virtual/values.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/asap.js b/node_modules/core-js/fn/asap.js new file mode 100755 index 00000000..9d9c80d1 --- /dev/null +++ b/node_modules/core-js/fn/asap.js @@ -0,0 +1,2 @@ +require('../modules/es7.asap'); +module.exports = require('../modules/_core').asap; \ No newline at end of file diff --git a/node_modules/core-js/fn/clear-immediate.js b/node_modules/core-js/fn/clear-immediate.js new file mode 100755 index 00000000..86916a06 --- /dev/null +++ b/node_modules/core-js/fn/clear-immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core').clearImmediate; \ No newline at end of file diff --git a/node_modules/core-js/fn/date/index.js b/node_modules/core-js/fn/date/index.js new file mode 100755 index 00000000..bd9ce0e2 --- /dev/null +++ b/node_modules/core-js/fn/date/index.js @@ -0,0 +1,6 @@ +require('../../modules/es6.date.now'); +require('../../modules/es6.date.to-json'); +require('../../modules/es6.date.to-iso-string'); +require('../../modules/es6.date.to-string'); +require('../../modules/es6.date.to-primitive'); +module.exports = require('../../modules/_core').Date; \ No newline at end of file diff --git a/node_modules/core-js/fn/date/now.js b/node_modules/core-js/fn/date/now.js new file mode 100755 index 00000000..c70d37ae --- /dev/null +++ b/node_modules/core-js/fn/date/now.js @@ -0,0 +1,2 @@ +require('../../modules/es6.date.now'); +module.exports = require('../../modules/_core').Date.now; \ No newline at end of file diff --git a/node_modules/core-js/fn/date/to-iso-string.js b/node_modules/core-js/fn/date/to-iso-string.js new file mode 100755 index 00000000..be4ac218 --- /dev/null +++ b/node_modules/core-js/fn/date/to-iso-string.js @@ -0,0 +1,3 @@ +require('../../modules/es6.date.to-json'); +require('../../modules/es6.date.to-iso-string'); +module.exports = require('../../modules/_core').Date.toISOString; \ No newline at end of file diff --git a/node_modules/core-js/fn/date/to-json.js b/node_modules/core-js/fn/date/to-json.js new file mode 100755 index 00000000..9dc8cc90 --- /dev/null +++ b/node_modules/core-js/fn/date/to-json.js @@ -0,0 +1,2 @@ +require('../../modules/es6.date.to-json'); +module.exports = require('../../modules/_core').Date.toJSON; \ No newline at end of file diff --git a/node_modules/core-js/fn/date/to-primitive.js b/node_modules/core-js/fn/date/to-primitive.js new file mode 100755 index 00000000..4d7471e2 --- /dev/null +++ b/node_modules/core-js/fn/date/to-primitive.js @@ -0,0 +1,5 @@ +require('../../modules/es6.date.to-primitive'); +var toPrimitive = require('../../modules/_date-to-primitive'); +module.exports = function(it, hint){ + return toPrimitive.call(it, hint); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/date/to-string.js b/node_modules/core-js/fn/date/to-string.js new file mode 100755 index 00000000..c39d5522 --- /dev/null +++ b/node_modules/core-js/fn/date/to-string.js @@ -0,0 +1,5 @@ +require('../../modules/es6.date.to-string') +var $toString = Date.prototype.toString; +module.exports = function toString(it){ + return $toString.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/delay.js b/node_modules/core-js/fn/delay.js new file mode 100755 index 00000000..18857388 --- /dev/null +++ b/node_modules/core-js/fn/delay.js @@ -0,0 +1,2 @@ +require('../modules/core.delay'); +module.exports = require('../modules/_core').delay; diff --git a/node_modules/core-js/fn/dict.js b/node_modules/core-js/fn/dict.js new file mode 100755 index 00000000..da84a8d8 --- /dev/null +++ b/node_modules/core-js/fn/dict.js @@ -0,0 +1,2 @@ +require('../modules/core.dict'); +module.exports = require('../modules/_core').Dict; \ No newline at end of file diff --git a/node_modules/core-js/fn/dom-collections/index.js b/node_modules/core-js/fn/dom-collections/index.js new file mode 100755 index 00000000..3928a09f --- /dev/null +++ b/node_modules/core-js/fn/dom-collections/index.js @@ -0,0 +1,8 @@ +require('../../modules/web.dom.iterable'); +var $iterators = require('../../modules/es6.array.iterator'); +module.exports = { + keys: $iterators.keys, + values: $iterators.values, + entries: $iterators.entries, + iterator: $iterators.values +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/dom-collections/iterator.js b/node_modules/core-js/fn/dom-collections/iterator.js new file mode 100755 index 00000000..ad983645 --- /dev/null +++ b/node_modules/core-js/fn/dom-collections/iterator.js @@ -0,0 +1,2 @@ +require('../../modules/web.dom.iterable'); +module.exports = require('../../modules/_core').Array.values; \ No newline at end of file diff --git a/node_modules/core-js/fn/error/index.js b/node_modules/core-js/fn/error/index.js new file mode 100755 index 00000000..59571ac2 --- /dev/null +++ b/node_modules/core-js/fn/error/index.js @@ -0,0 +1,2 @@ +require('../../modules/es7.error.is-error'); +module.exports = require('../../modules/_core').Error; \ No newline at end of file diff --git a/node_modules/core-js/fn/error/is-error.js b/node_modules/core-js/fn/error/is-error.js new file mode 100755 index 00000000..e15b7201 --- /dev/null +++ b/node_modules/core-js/fn/error/is-error.js @@ -0,0 +1,2 @@ +require('../../modules/es7.error.is-error'); +module.exports = require('../../modules/_core').Error.isError; \ No newline at end of file diff --git a/node_modules/core-js/fn/function/bind.js b/node_modules/core-js/fn/function/bind.js new file mode 100755 index 00000000..38e179e6 --- /dev/null +++ b/node_modules/core-js/fn/function/bind.js @@ -0,0 +1,2 @@ +require('../../modules/es6.function.bind'); +module.exports = require('../../modules/_core').Function.bind; \ No newline at end of file diff --git a/node_modules/core-js/fn/function/has-instance.js b/node_modules/core-js/fn/function/has-instance.js new file mode 100755 index 00000000..78397e5f --- /dev/null +++ b/node_modules/core-js/fn/function/has-instance.js @@ -0,0 +1,2 @@ +require('../../modules/es6.function.has-instance'); +module.exports = Function[require('../../modules/_wks')('hasInstance')]; \ No newline at end of file diff --git a/node_modules/core-js/fn/function/index.js b/node_modules/core-js/fn/function/index.js new file mode 100755 index 00000000..206324e8 --- /dev/null +++ b/node_modules/core-js/fn/function/index.js @@ -0,0 +1,5 @@ +require('../../modules/es6.function.bind'); +require('../../modules/es6.function.name'); +require('../../modules/es6.function.has-instance'); +require('../../modules/core.function.part'); +module.exports = require('../../modules/_core').Function; diff --git a/node_modules/core-js/fn/function/name.js b/node_modules/core-js/fn/function/name.js new file mode 100755 index 00000000..cb70bf15 --- /dev/null +++ b/node_modules/core-js/fn/function/name.js @@ -0,0 +1 @@ +require('../../modules/es6.function.name'); \ No newline at end of file diff --git a/node_modules/core-js/fn/function/part.js b/node_modules/core-js/fn/function/part.js new file mode 100755 index 00000000..926e2cc2 --- /dev/null +++ b/node_modules/core-js/fn/function/part.js @@ -0,0 +1,2 @@ +require('../../modules/core.function.part'); +module.exports = require('../../modules/_core').Function.part; \ No newline at end of file diff --git a/node_modules/core-js/fn/function/virtual/bind.js b/node_modules/core-js/fn/function/virtual/bind.js new file mode 100755 index 00000000..0a2f3338 --- /dev/null +++ b/node_modules/core-js/fn/function/virtual/bind.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.function.bind'); +module.exports = require('../../../modules/_entry-virtual')('Function').bind; \ No newline at end of file diff --git a/node_modules/core-js/fn/function/virtual/index.js b/node_modules/core-js/fn/function/virtual/index.js new file mode 100755 index 00000000..f64e2202 --- /dev/null +++ b/node_modules/core-js/fn/function/virtual/index.js @@ -0,0 +1,3 @@ +require('../../../modules/es6.function.bind'); +require('../../../modules/core.function.part'); +module.exports = require('../../../modules/_entry-virtual')('Function'); \ No newline at end of file diff --git a/node_modules/core-js/fn/function/virtual/part.js b/node_modules/core-js/fn/function/virtual/part.js new file mode 100755 index 00000000..a382e577 --- /dev/null +++ b/node_modules/core-js/fn/function/virtual/part.js @@ -0,0 +1,2 @@ +require('../../../modules/core.function.part'); +module.exports = require('../../../modules/_entry-virtual')('Function').part; \ No newline at end of file diff --git a/node_modules/core-js/fn/get-iterator-method.js b/node_modules/core-js/fn/get-iterator-method.js new file mode 100755 index 00000000..5543cbbf --- /dev/null +++ b/node_modules/core-js/fn/get-iterator-method.js @@ -0,0 +1,3 @@ +require('../modules/web.dom.iterable'); +require('../modules/es6.string.iterator'); +module.exports = require('../modules/core.get-iterator-method'); \ No newline at end of file diff --git a/node_modules/core-js/fn/get-iterator.js b/node_modules/core-js/fn/get-iterator.js new file mode 100755 index 00000000..762350ff --- /dev/null +++ b/node_modules/core-js/fn/get-iterator.js @@ -0,0 +1,3 @@ +require('../modules/web.dom.iterable'); +require('../modules/es6.string.iterator'); +module.exports = require('../modules/core.get-iterator'); \ No newline at end of file diff --git a/node_modules/core-js/fn/is-iterable.js b/node_modules/core-js/fn/is-iterable.js new file mode 100755 index 00000000..4c654e87 --- /dev/null +++ b/node_modules/core-js/fn/is-iterable.js @@ -0,0 +1,3 @@ +require('../modules/web.dom.iterable'); +require('../modules/es6.string.iterator'); +module.exports = require('../modules/core.is-iterable'); \ No newline at end of file diff --git a/node_modules/core-js/fn/json/index.js b/node_modules/core-js/fn/json/index.js new file mode 100755 index 00000000..a6ec3de9 --- /dev/null +++ b/node_modules/core-js/fn/json/index.js @@ -0,0 +1,2 @@ +var core = require('../../modules/_core'); +module.exports = core.JSON || (core.JSON = {stringify: JSON.stringify}); \ No newline at end of file diff --git a/node_modules/core-js/fn/json/stringify.js b/node_modules/core-js/fn/json/stringify.js new file mode 100755 index 00000000..f0cac86a --- /dev/null +++ b/node_modules/core-js/fn/json/stringify.js @@ -0,0 +1,5 @@ +var core = require('../../modules/_core') + , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify}); +module.exports = function stringify(it){ // eslint-disable-line no-unused-vars + return $JSON.stringify.apply($JSON, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/map.js b/node_modules/core-js/fn/map.js new file mode 100755 index 00000000..16784c60 --- /dev/null +++ b/node_modules/core-js/fn/map.js @@ -0,0 +1,6 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.map'); +require('../modules/es7.map.to-json'); +module.exports = require('../modules/_core').Map; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/acosh.js b/node_modules/core-js/fn/math/acosh.js new file mode 100755 index 00000000..9c904c2d --- /dev/null +++ b/node_modules/core-js/fn/math/acosh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.acosh'); +module.exports = require('../../modules/_core').Math.acosh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/asinh.js b/node_modules/core-js/fn/math/asinh.js new file mode 100755 index 00000000..9e209c9d --- /dev/null +++ b/node_modules/core-js/fn/math/asinh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.asinh'); +module.exports = require('../../modules/_core').Math.asinh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/atanh.js b/node_modules/core-js/fn/math/atanh.js new file mode 100755 index 00000000..b116296d --- /dev/null +++ b/node_modules/core-js/fn/math/atanh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.atanh'); +module.exports = require('../../modules/_core').Math.atanh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/cbrt.js b/node_modules/core-js/fn/math/cbrt.js new file mode 100755 index 00000000..6ffec33a --- /dev/null +++ b/node_modules/core-js/fn/math/cbrt.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.cbrt'); +module.exports = require('../../modules/_core').Math.cbrt; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/clz32.js b/node_modules/core-js/fn/math/clz32.js new file mode 100755 index 00000000..beeaae16 --- /dev/null +++ b/node_modules/core-js/fn/math/clz32.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.clz32'); +module.exports = require('../../modules/_core').Math.clz32; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/cosh.js b/node_modules/core-js/fn/math/cosh.js new file mode 100755 index 00000000..bf92dc13 --- /dev/null +++ b/node_modules/core-js/fn/math/cosh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.cosh'); +module.exports = require('../../modules/_core').Math.cosh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/expm1.js b/node_modules/core-js/fn/math/expm1.js new file mode 100755 index 00000000..0b30ebb1 --- /dev/null +++ b/node_modules/core-js/fn/math/expm1.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.expm1'); +module.exports = require('../../modules/_core').Math.expm1; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/fround.js b/node_modules/core-js/fn/math/fround.js new file mode 100755 index 00000000..c75a2293 --- /dev/null +++ b/node_modules/core-js/fn/math/fround.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.fround'); +module.exports = require('../../modules/_core').Math.fround; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/hypot.js b/node_modules/core-js/fn/math/hypot.js new file mode 100755 index 00000000..2126285c --- /dev/null +++ b/node_modules/core-js/fn/math/hypot.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.hypot'); +module.exports = require('../../modules/_core').Math.hypot; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/iaddh.js b/node_modules/core-js/fn/math/iaddh.js new file mode 100755 index 00000000..cae754ee --- /dev/null +++ b/node_modules/core-js/fn/math/iaddh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.iaddh'); +module.exports = require('../../modules/_core').Math.iaddh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/imul.js b/node_modules/core-js/fn/math/imul.js new file mode 100755 index 00000000..1f5ce161 --- /dev/null +++ b/node_modules/core-js/fn/math/imul.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.imul'); +module.exports = require('../../modules/_core').Math.imul; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/imulh.js b/node_modules/core-js/fn/math/imulh.js new file mode 100755 index 00000000..3b47bf8c --- /dev/null +++ b/node_modules/core-js/fn/math/imulh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.imulh'); +module.exports = require('../../modules/_core').Math.imulh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/index.js b/node_modules/core-js/fn/math/index.js new file mode 100755 index 00000000..8a2664b1 --- /dev/null +++ b/node_modules/core-js/fn/math/index.js @@ -0,0 +1,22 @@ +require('../../modules/es6.math.acosh'); +require('../../modules/es6.math.asinh'); +require('../../modules/es6.math.atanh'); +require('../../modules/es6.math.cbrt'); +require('../../modules/es6.math.clz32'); +require('../../modules/es6.math.cosh'); +require('../../modules/es6.math.expm1'); +require('../../modules/es6.math.fround'); +require('../../modules/es6.math.hypot'); +require('../../modules/es6.math.imul'); +require('../../modules/es6.math.log10'); +require('../../modules/es6.math.log1p'); +require('../../modules/es6.math.log2'); +require('../../modules/es6.math.sign'); +require('../../modules/es6.math.sinh'); +require('../../modules/es6.math.tanh'); +require('../../modules/es6.math.trunc'); +require('../../modules/es7.math.iaddh'); +require('../../modules/es7.math.isubh'); +require('../../modules/es7.math.imulh'); +require('../../modules/es7.math.umulh'); +module.exports = require('../../modules/_core').Math; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/isubh.js b/node_modules/core-js/fn/math/isubh.js new file mode 100755 index 00000000..e120e423 --- /dev/null +++ b/node_modules/core-js/fn/math/isubh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.isubh'); +module.exports = require('../../modules/_core').Math.isubh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/log10.js b/node_modules/core-js/fn/math/log10.js new file mode 100755 index 00000000..1246e0ae --- /dev/null +++ b/node_modules/core-js/fn/math/log10.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.log10'); +module.exports = require('../../modules/_core').Math.log10; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/log1p.js b/node_modules/core-js/fn/math/log1p.js new file mode 100755 index 00000000..047b84c0 --- /dev/null +++ b/node_modules/core-js/fn/math/log1p.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.log1p'); +module.exports = require('../../modules/_core').Math.log1p; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/log2.js b/node_modules/core-js/fn/math/log2.js new file mode 100755 index 00000000..ce3e99c1 --- /dev/null +++ b/node_modules/core-js/fn/math/log2.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.log2'); +module.exports = require('../../modules/_core').Math.log2; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/sign.js b/node_modules/core-js/fn/math/sign.js new file mode 100755 index 00000000..0963ecaf --- /dev/null +++ b/node_modules/core-js/fn/math/sign.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.sign'); +module.exports = require('../../modules/_core').Math.sign; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/sinh.js b/node_modules/core-js/fn/math/sinh.js new file mode 100755 index 00000000..c35cb739 --- /dev/null +++ b/node_modules/core-js/fn/math/sinh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.sinh'); +module.exports = require('../../modules/_core').Math.sinh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/tanh.js b/node_modules/core-js/fn/math/tanh.js new file mode 100755 index 00000000..3d1966db --- /dev/null +++ b/node_modules/core-js/fn/math/tanh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.tanh'); +module.exports = require('../../modules/_core').Math.tanh; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/trunc.js b/node_modules/core-js/fn/math/trunc.js new file mode 100755 index 00000000..135b7dcb --- /dev/null +++ b/node_modules/core-js/fn/math/trunc.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.trunc'); +module.exports = require('../../modules/_core').Math.trunc; \ No newline at end of file diff --git a/node_modules/core-js/fn/math/umulh.js b/node_modules/core-js/fn/math/umulh.js new file mode 100755 index 00000000..d93b9ae0 --- /dev/null +++ b/node_modules/core-js/fn/math/umulh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.umulh'); +module.exports = require('../../modules/_core').Math.umulh; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/constructor.js b/node_modules/core-js/fn/number/constructor.js new file mode 100755 index 00000000..f488331e --- /dev/null +++ b/node_modules/core-js/fn/number/constructor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.constructor'); +module.exports = Number; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/epsilon.js b/node_modules/core-js/fn/number/epsilon.js new file mode 100755 index 00000000..56c93521 --- /dev/null +++ b/node_modules/core-js/fn/number/epsilon.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.epsilon'); +module.exports = Math.pow(2, -52); \ No newline at end of file diff --git a/node_modules/core-js/fn/number/index.js b/node_modules/core-js/fn/number/index.js new file mode 100755 index 00000000..92890003 --- /dev/null +++ b/node_modules/core-js/fn/number/index.js @@ -0,0 +1,14 @@ +require('../../modules/es6.number.constructor'); +require('../../modules/es6.number.epsilon'); +require('../../modules/es6.number.is-finite'); +require('../../modules/es6.number.is-integer'); +require('../../modules/es6.number.is-nan'); +require('../../modules/es6.number.is-safe-integer'); +require('../../modules/es6.number.max-safe-integer'); +require('../../modules/es6.number.min-safe-integer'); +require('../../modules/es6.number.parse-float'); +require('../../modules/es6.number.parse-int'); +require('../../modules/es6.number.to-fixed'); +require('../../modules/es6.number.to-precision'); +require('../../modules/core.number.iterator'); +module.exports = require('../../modules/_core').Number; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/is-finite.js b/node_modules/core-js/fn/number/is-finite.js new file mode 100755 index 00000000..4ec3706b --- /dev/null +++ b/node_modules/core-js/fn/number/is-finite.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-finite'); +module.exports = require('../../modules/_core').Number.isFinite; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/is-integer.js b/node_modules/core-js/fn/number/is-integer.js new file mode 100755 index 00000000..a3013bff --- /dev/null +++ b/node_modules/core-js/fn/number/is-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-integer'); +module.exports = require('../../modules/_core').Number.isInteger; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/is-nan.js b/node_modules/core-js/fn/number/is-nan.js new file mode 100755 index 00000000..f23b0266 --- /dev/null +++ b/node_modules/core-js/fn/number/is-nan.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-nan'); +module.exports = require('../../modules/_core').Number.isNaN; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/is-safe-integer.js b/node_modules/core-js/fn/number/is-safe-integer.js new file mode 100755 index 00000000..f68732f5 --- /dev/null +++ b/node_modules/core-js/fn/number/is-safe-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-safe-integer'); +module.exports = require('../../modules/_core').Number.isSafeInteger; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/iterator.js b/node_modules/core-js/fn/number/iterator.js new file mode 100755 index 00000000..26feaa1f --- /dev/null +++ b/node_modules/core-js/fn/number/iterator.js @@ -0,0 +1,5 @@ +require('../../modules/core.number.iterator'); +var get = require('../../modules/_iterators').Number; +module.exports = function(it){ + return get.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/max-safe-integer.js b/node_modules/core-js/fn/number/max-safe-integer.js new file mode 100755 index 00000000..c9b43b04 --- /dev/null +++ b/node_modules/core-js/fn/number/max-safe-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.max-safe-integer'); +module.exports = 0x1fffffffffffff; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/min-safe-integer.js b/node_modules/core-js/fn/number/min-safe-integer.js new file mode 100755 index 00000000..8b5e0728 --- /dev/null +++ b/node_modules/core-js/fn/number/min-safe-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.min-safe-integer'); +module.exports = -0x1fffffffffffff; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/parse-float.js b/node_modules/core-js/fn/number/parse-float.js new file mode 100755 index 00000000..62f89774 --- /dev/null +++ b/node_modules/core-js/fn/number/parse-float.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.parse-float'); +module.exports = parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/parse-int.js b/node_modules/core-js/fn/number/parse-int.js new file mode 100755 index 00000000..c197da5b --- /dev/null +++ b/node_modules/core-js/fn/number/parse-int.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.parse-int'); +module.exports = parseInt; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/to-fixed.js b/node_modules/core-js/fn/number/to-fixed.js new file mode 100755 index 00000000..3a041b0e --- /dev/null +++ b/node_modules/core-js/fn/number/to-fixed.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.to-fixed'); +module.exports = require('../../modules/_core').Number.toFixed; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/to-precision.js b/node_modules/core-js/fn/number/to-precision.js new file mode 100755 index 00000000..9e85511a --- /dev/null +++ b/node_modules/core-js/fn/number/to-precision.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.to-precision'); +module.exports = require('../../modules/_core').Number.toPrecision; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/virtual/index.js b/node_modules/core-js/fn/number/virtual/index.js new file mode 100755 index 00000000..42360d32 --- /dev/null +++ b/node_modules/core-js/fn/number/virtual/index.js @@ -0,0 +1,4 @@ +require('../../../modules/core.number.iterator'); +var $Number = require('../../../modules/_entry-virtual')('Number'); +$Number.iterator = require('../../../modules/_iterators').Number; +module.exports = $Number; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/virtual/iterator.js b/node_modules/core-js/fn/number/virtual/iterator.js new file mode 100755 index 00000000..df034996 --- /dev/null +++ b/node_modules/core-js/fn/number/virtual/iterator.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').Number; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/virtual/to-fixed.js b/node_modules/core-js/fn/number/virtual/to-fixed.js new file mode 100755 index 00000000..b779f15c --- /dev/null +++ b/node_modules/core-js/fn/number/virtual/to-fixed.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.number.to-fixed'); +module.exports = require('../../../modules/_entry-virtual')('Number').toFixed; \ No newline at end of file diff --git a/node_modules/core-js/fn/number/virtual/to-precision.js b/node_modules/core-js/fn/number/virtual/to-precision.js new file mode 100755 index 00000000..0c93fa4a --- /dev/null +++ b/node_modules/core-js/fn/number/virtual/to-precision.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.number.to-precision'); +module.exports = require('../../../modules/_entry-virtual')('Number').toPrecision; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/assign.js b/node_modules/core-js/fn/object/assign.js new file mode 100755 index 00000000..97df6bf4 --- /dev/null +++ b/node_modules/core-js/fn/object/assign.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.assign'); +module.exports = require('../../modules/_core').Object.assign; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/classof.js b/node_modules/core-js/fn/object/classof.js new file mode 100755 index 00000000..993d0480 --- /dev/null +++ b/node_modules/core-js/fn/object/classof.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.classof'); +module.exports = require('../../modules/_core').Object.classof; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/create.js b/node_modules/core-js/fn/object/create.js new file mode 100755 index 00000000..a05ca2fb --- /dev/null +++ b/node_modules/core-js/fn/object/create.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.create'); +var $Object = require('../../modules/_core').Object; +module.exports = function create(P, D){ + return $Object.create(P, D); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/define-getter.js b/node_modules/core-js/fn/object/define-getter.js new file mode 100755 index 00000000..5dd26070 --- /dev/null +++ b/node_modules/core-js/fn/object/define-getter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.define-getter'); +module.exports = require('../../modules/_core').Object.__defineGetter__; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/define-properties.js b/node_modules/core-js/fn/object/define-properties.js new file mode 100755 index 00000000..04160fb3 --- /dev/null +++ b/node_modules/core-js/fn/object/define-properties.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.define-properties'); +var $Object = require('../../modules/_core').Object; +module.exports = function defineProperties(T, D){ + return $Object.defineProperties(T, D); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/define-property.js b/node_modules/core-js/fn/object/define-property.js new file mode 100755 index 00000000..078c56cb --- /dev/null +++ b/node_modules/core-js/fn/object/define-property.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.define-property'); +var $Object = require('../../modules/_core').Object; +module.exports = function defineProperty(it, key, desc){ + return $Object.defineProperty(it, key, desc); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/define-setter.js b/node_modules/core-js/fn/object/define-setter.js new file mode 100755 index 00000000..b59475f8 --- /dev/null +++ b/node_modules/core-js/fn/object/define-setter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.define-setter'); +module.exports = require('../../modules/_core').Object.__defineSetter__; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/define.js b/node_modules/core-js/fn/object/define.js new file mode 100755 index 00000000..6ec19e90 --- /dev/null +++ b/node_modules/core-js/fn/object/define.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.define'); +module.exports = require('../../modules/_core').Object.define; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/entries.js b/node_modules/core-js/fn/object/entries.js new file mode 100755 index 00000000..fca1000e --- /dev/null +++ b/node_modules/core-js/fn/object/entries.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.entries'); +module.exports = require('../../modules/_core').Object.entries; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/freeze.js b/node_modules/core-js/fn/object/freeze.js new file mode 100755 index 00000000..04eac530 --- /dev/null +++ b/node_modules/core-js/fn/object/freeze.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.freeze'); +module.exports = require('../../modules/_core').Object.freeze; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/get-own-property-descriptor.js b/node_modules/core-js/fn/object/get-own-property-descriptor.js new file mode 100755 index 00000000..7d3f03b8 --- /dev/null +++ b/node_modules/core-js/fn/object/get-own-property-descriptor.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.get-own-property-descriptor'); +var $Object = require('../../modules/_core').Object; +module.exports = function getOwnPropertyDescriptor(it, key){ + return $Object.getOwnPropertyDescriptor(it, key); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/get-own-property-descriptors.js b/node_modules/core-js/fn/object/get-own-property-descriptors.js new file mode 100755 index 00000000..dfeb547c --- /dev/null +++ b/node_modules/core-js/fn/object/get-own-property-descriptors.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.get-own-property-descriptors'); +module.exports = require('../../modules/_core').Object.getOwnPropertyDescriptors; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/get-own-property-names.js b/node_modules/core-js/fn/object/get-own-property-names.js new file mode 100755 index 00000000..c91ce430 --- /dev/null +++ b/node_modules/core-js/fn/object/get-own-property-names.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.get-own-property-names'); +var $Object = require('../../modules/_core').Object; +module.exports = function getOwnPropertyNames(it){ + return $Object.getOwnPropertyNames(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/get-own-property-symbols.js b/node_modules/core-js/fn/object/get-own-property-symbols.js new file mode 100755 index 00000000..c3f52880 --- /dev/null +++ b/node_modules/core-js/fn/object/get-own-property-symbols.js @@ -0,0 +1,2 @@ +require('../../modules/es6.symbol'); +module.exports = require('../../modules/_core').Object.getOwnPropertySymbols; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/get-prototype-of.js b/node_modules/core-js/fn/object/get-prototype-of.js new file mode 100755 index 00000000..bda93445 --- /dev/null +++ b/node_modules/core-js/fn/object/get-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.get-prototype-of'); +module.exports = require('../../modules/_core').Object.getPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/index.js b/node_modules/core-js/fn/object/index.js new file mode 100755 index 00000000..4bd9825b --- /dev/null +++ b/node_modules/core-js/fn/object/index.js @@ -0,0 +1,30 @@ +require('../../modules/es6.symbol'); +require('../../modules/es6.object.create'); +require('../../modules/es6.object.define-property'); +require('../../modules/es6.object.define-properties'); +require('../../modules/es6.object.get-own-property-descriptor'); +require('../../modules/es6.object.get-prototype-of'); +require('../../modules/es6.object.keys'); +require('../../modules/es6.object.get-own-property-names'); +require('../../modules/es6.object.freeze'); +require('../../modules/es6.object.seal'); +require('../../modules/es6.object.prevent-extensions'); +require('../../modules/es6.object.is-frozen'); +require('../../modules/es6.object.is-sealed'); +require('../../modules/es6.object.is-extensible'); +require('../../modules/es6.object.assign'); +require('../../modules/es6.object.is'); +require('../../modules/es6.object.set-prototype-of'); +require('../../modules/es6.object.to-string'); +require('../../modules/es7.object.get-own-property-descriptors'); +require('../../modules/es7.object.values'); +require('../../modules/es7.object.entries'); +require('../../modules/es7.object.define-getter'); +require('../../modules/es7.object.define-setter'); +require('../../modules/es7.object.lookup-getter'); +require('../../modules/es7.object.lookup-setter'); +require('../../modules/core.object.is-object'); +require('../../modules/core.object.classof'); +require('../../modules/core.object.define'); +require('../../modules/core.object.make'); +module.exports = require('../../modules/_core').Object; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/is-extensible.js b/node_modules/core-js/fn/object/is-extensible.js new file mode 100755 index 00000000..43fb0e78 --- /dev/null +++ b/node_modules/core-js/fn/object/is-extensible.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is-extensible'); +module.exports = require('../../modules/_core').Object.isExtensible; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/is-frozen.js b/node_modules/core-js/fn/object/is-frozen.js new file mode 100755 index 00000000..cbff2242 --- /dev/null +++ b/node_modules/core-js/fn/object/is-frozen.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is-frozen'); +module.exports = require('../../modules/_core').Object.isFrozen; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/is-object.js b/node_modules/core-js/fn/object/is-object.js new file mode 100755 index 00000000..38feeff5 --- /dev/null +++ b/node_modules/core-js/fn/object/is-object.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.is-object'); +module.exports = require('../../modules/_core').Object.isObject; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/is-sealed.js b/node_modules/core-js/fn/object/is-sealed.js new file mode 100755 index 00000000..169a8ae7 --- /dev/null +++ b/node_modules/core-js/fn/object/is-sealed.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is-sealed'); +module.exports = require('../../modules/_core').Object.isSealed; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/is.js b/node_modules/core-js/fn/object/is.js new file mode 100755 index 00000000..6ac9f19e --- /dev/null +++ b/node_modules/core-js/fn/object/is.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is'); +module.exports = require('../../modules/_core').Object.is; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/keys.js b/node_modules/core-js/fn/object/keys.js new file mode 100755 index 00000000..8eeb78eb --- /dev/null +++ b/node_modules/core-js/fn/object/keys.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.keys'); +module.exports = require('../../modules/_core').Object.keys; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/lookup-getter.js b/node_modules/core-js/fn/object/lookup-getter.js new file mode 100755 index 00000000..3f7f674d --- /dev/null +++ b/node_modules/core-js/fn/object/lookup-getter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.lookup-setter'); +module.exports = require('../../modules/_core').Object.__lookupGetter__; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/lookup-setter.js b/node_modules/core-js/fn/object/lookup-setter.js new file mode 100755 index 00000000..d18446fe --- /dev/null +++ b/node_modules/core-js/fn/object/lookup-setter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.lookup-setter'); +module.exports = require('../../modules/_core').Object.__lookupSetter__; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/make.js b/node_modules/core-js/fn/object/make.js new file mode 100755 index 00000000..f4d19d12 --- /dev/null +++ b/node_modules/core-js/fn/object/make.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.make'); +module.exports = require('../../modules/_core').Object.make; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/prevent-extensions.js b/node_modules/core-js/fn/object/prevent-extensions.js new file mode 100755 index 00000000..e43be05b --- /dev/null +++ b/node_modules/core-js/fn/object/prevent-extensions.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.prevent-extensions'); +module.exports = require('../../modules/_core').Object.preventExtensions; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/seal.js b/node_modules/core-js/fn/object/seal.js new file mode 100755 index 00000000..8a56cd7f --- /dev/null +++ b/node_modules/core-js/fn/object/seal.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.seal'); +module.exports = require('../../modules/_core').Object.seal; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/set-prototype-of.js b/node_modules/core-js/fn/object/set-prototype-of.js new file mode 100755 index 00000000..c25170db --- /dev/null +++ b/node_modules/core-js/fn/object/set-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.set-prototype-of'); +module.exports = require('../../modules/_core').Object.setPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/object/values.js b/node_modules/core-js/fn/object/values.js new file mode 100755 index 00000000..b50336cf --- /dev/null +++ b/node_modules/core-js/fn/object/values.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.values'); +module.exports = require('../../modules/_core').Object.values; \ No newline at end of file diff --git a/node_modules/core-js/fn/observable.js b/node_modules/core-js/fn/observable.js new file mode 100755 index 00000000..05ca51a3 --- /dev/null +++ b/node_modules/core-js/fn/observable.js @@ -0,0 +1,7 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +module.exports = require('../modules/_core').Observable; \ No newline at end of file diff --git a/node_modules/core-js/fn/parse-float.js b/node_modules/core-js/fn/parse-float.js new file mode 100755 index 00000000..dad94ddb --- /dev/null +++ b/node_modules/core-js/fn/parse-float.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-float'); +module.exports = require('../modules/_core').parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/fn/parse-int.js b/node_modules/core-js/fn/parse-int.js new file mode 100755 index 00000000..08a20996 --- /dev/null +++ b/node_modules/core-js/fn/parse-int.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-int'); +module.exports = require('../modules/_core').parseInt; \ No newline at end of file diff --git a/node_modules/core-js/fn/promise.js b/node_modules/core-js/fn/promise.js new file mode 100755 index 00000000..c901c859 --- /dev/null +++ b/node_modules/core-js/fn/promise.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +module.exports = require('../modules/_core').Promise; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/apply.js b/node_modules/core-js/fn/reflect/apply.js new file mode 100755 index 00000000..725b8a69 --- /dev/null +++ b/node_modules/core-js/fn/reflect/apply.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.apply'); +module.exports = require('../../modules/_core').Reflect.apply; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/construct.js b/node_modules/core-js/fn/reflect/construct.js new file mode 100755 index 00000000..587725da --- /dev/null +++ b/node_modules/core-js/fn/reflect/construct.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.construct'); +module.exports = require('../../modules/_core').Reflect.construct; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/define-metadata.js b/node_modules/core-js/fn/reflect/define-metadata.js new file mode 100755 index 00000000..c9876ed3 --- /dev/null +++ b/node_modules/core-js/fn/reflect/define-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.define-metadata'); +module.exports = require('../../modules/_core').Reflect.defineMetadata; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/define-property.js b/node_modules/core-js/fn/reflect/define-property.js new file mode 100755 index 00000000..c36b4d21 --- /dev/null +++ b/node_modules/core-js/fn/reflect/define-property.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.define-property'); +module.exports = require('../../modules/_core').Reflect.defineProperty; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/delete-metadata.js b/node_modules/core-js/fn/reflect/delete-metadata.js new file mode 100755 index 00000000..9bcc0299 --- /dev/null +++ b/node_modules/core-js/fn/reflect/delete-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.delete-metadata'); +module.exports = require('../../modules/_core').Reflect.deleteMetadata; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/delete-property.js b/node_modules/core-js/fn/reflect/delete-property.js new file mode 100755 index 00000000..10b6392f --- /dev/null +++ b/node_modules/core-js/fn/reflect/delete-property.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.delete-property'); +module.exports = require('../../modules/_core').Reflect.deleteProperty; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/enumerate.js b/node_modules/core-js/fn/reflect/enumerate.js new file mode 100755 index 00000000..257a21ee --- /dev/null +++ b/node_modules/core-js/fn/reflect/enumerate.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.enumerate'); +module.exports = require('../../modules/_core').Reflect.enumerate; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/get-metadata-keys.js b/node_modules/core-js/fn/reflect/get-metadata-keys.js new file mode 100755 index 00000000..9dbf5ee1 --- /dev/null +++ b/node_modules/core-js/fn/reflect/get-metadata-keys.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-metadata-keys'); +module.exports = require('../../modules/_core').Reflect.getMetadataKeys; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/get-metadata.js b/node_modules/core-js/fn/reflect/get-metadata.js new file mode 100755 index 00000000..3a20839e --- /dev/null +++ b/node_modules/core-js/fn/reflect/get-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-metadata'); +module.exports = require('../../modules/_core').Reflect.getMetadata; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/get-own-metadata-keys.js b/node_modules/core-js/fn/reflect/get-own-metadata-keys.js new file mode 100755 index 00000000..2f8c5759 --- /dev/null +++ b/node_modules/core-js/fn/reflect/get-own-metadata-keys.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-own-metadata-keys'); +module.exports = require('../../modules/_core').Reflect.getOwnMetadataKeys; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/get-own-metadata.js b/node_modules/core-js/fn/reflect/get-own-metadata.js new file mode 100755 index 00000000..68e288dd --- /dev/null +++ b/node_modules/core-js/fn/reflect/get-own-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-own-metadata'); +module.exports = require('../../modules/_core').Reflect.getOwnMetadata; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/get-own-property-descriptor.js b/node_modules/core-js/fn/reflect/get-own-property-descriptor.js new file mode 100755 index 00000000..9e2822fb --- /dev/null +++ b/node_modules/core-js/fn/reflect/get-own-property-descriptor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.get-own-property-descriptor'); +module.exports = require('../../modules/_core').Reflect.getOwnPropertyDescriptor; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/get-prototype-of.js b/node_modules/core-js/fn/reflect/get-prototype-of.js new file mode 100755 index 00000000..48503596 --- /dev/null +++ b/node_modules/core-js/fn/reflect/get-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.get-prototype-of'); +module.exports = require('../../modules/_core').Reflect.getPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/get.js b/node_modules/core-js/fn/reflect/get.js new file mode 100755 index 00000000..9ca903e8 --- /dev/null +++ b/node_modules/core-js/fn/reflect/get.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.get'); +module.exports = require('../../modules/_core').Reflect.get; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/has-metadata.js b/node_modules/core-js/fn/reflect/has-metadata.js new file mode 100755 index 00000000..f001f437 --- /dev/null +++ b/node_modules/core-js/fn/reflect/has-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.has-metadata'); +module.exports = require('../../modules/_core').Reflect.hasMetadata; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/has-own-metadata.js b/node_modules/core-js/fn/reflect/has-own-metadata.js new file mode 100755 index 00000000..d90935f0 --- /dev/null +++ b/node_modules/core-js/fn/reflect/has-own-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.has-own-metadata'); +module.exports = require('../../modules/_core').Reflect.hasOwnMetadata; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/has.js b/node_modules/core-js/fn/reflect/has.js new file mode 100755 index 00000000..8e34933c --- /dev/null +++ b/node_modules/core-js/fn/reflect/has.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.has'); +module.exports = require('../../modules/_core').Reflect.has; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/index.js b/node_modules/core-js/fn/reflect/index.js new file mode 100755 index 00000000..a725cef2 --- /dev/null +++ b/node_modules/core-js/fn/reflect/index.js @@ -0,0 +1,24 @@ +require('../../modules/es6.reflect.apply'); +require('../../modules/es6.reflect.construct'); +require('../../modules/es6.reflect.define-property'); +require('../../modules/es6.reflect.delete-property'); +require('../../modules/es6.reflect.enumerate'); +require('../../modules/es6.reflect.get'); +require('../../modules/es6.reflect.get-own-property-descriptor'); +require('../../modules/es6.reflect.get-prototype-of'); +require('../../modules/es6.reflect.has'); +require('../../modules/es6.reflect.is-extensible'); +require('../../modules/es6.reflect.own-keys'); +require('../../modules/es6.reflect.prevent-extensions'); +require('../../modules/es6.reflect.set'); +require('../../modules/es6.reflect.set-prototype-of'); +require('../../modules/es7.reflect.define-metadata'); +require('../../modules/es7.reflect.delete-metadata'); +require('../../modules/es7.reflect.get-metadata'); +require('../../modules/es7.reflect.get-metadata-keys'); +require('../../modules/es7.reflect.get-own-metadata'); +require('../../modules/es7.reflect.get-own-metadata-keys'); +require('../../modules/es7.reflect.has-metadata'); +require('../../modules/es7.reflect.has-own-metadata'); +require('../../modules/es7.reflect.metadata'); +module.exports = require('../../modules/_core').Reflect; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/is-extensible.js b/node_modules/core-js/fn/reflect/is-extensible.js new file mode 100755 index 00000000..de41d683 --- /dev/null +++ b/node_modules/core-js/fn/reflect/is-extensible.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.is-extensible'); +module.exports = require('../../modules/_core').Reflect.isExtensible; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/metadata.js b/node_modules/core-js/fn/reflect/metadata.js new file mode 100755 index 00000000..3f2b8ff6 --- /dev/null +++ b/node_modules/core-js/fn/reflect/metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.metadata'); +module.exports = require('../../modules/_core').Reflect.metadata; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/own-keys.js b/node_modules/core-js/fn/reflect/own-keys.js new file mode 100755 index 00000000..bfcebc74 --- /dev/null +++ b/node_modules/core-js/fn/reflect/own-keys.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.own-keys'); +module.exports = require('../../modules/_core').Reflect.ownKeys; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/prevent-extensions.js b/node_modules/core-js/fn/reflect/prevent-extensions.js new file mode 100755 index 00000000..b346da3b --- /dev/null +++ b/node_modules/core-js/fn/reflect/prevent-extensions.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.prevent-extensions'); +module.exports = require('../../modules/_core').Reflect.preventExtensions; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/set-prototype-of.js b/node_modules/core-js/fn/reflect/set-prototype-of.js new file mode 100755 index 00000000..16b74359 --- /dev/null +++ b/node_modules/core-js/fn/reflect/set-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.set-prototype-of'); +module.exports = require('../../modules/_core').Reflect.setPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/fn/reflect/set.js b/node_modules/core-js/fn/reflect/set.js new file mode 100755 index 00000000..834929ee --- /dev/null +++ b/node_modules/core-js/fn/reflect/set.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.set'); +module.exports = require('../../modules/_core').Reflect.set; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/constructor.js b/node_modules/core-js/fn/regexp/constructor.js new file mode 100755 index 00000000..90c13513 --- /dev/null +++ b/node_modules/core-js/fn/regexp/constructor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.constructor'); +module.exports = RegExp; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/escape.js b/node_modules/core-js/fn/regexp/escape.js new file mode 100755 index 00000000..d657a7d9 --- /dev/null +++ b/node_modules/core-js/fn/regexp/escape.js @@ -0,0 +1,2 @@ +require('../../modules/core.regexp.escape'); +module.exports = require('../../modules/_core').RegExp.escape; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/flags.js b/node_modules/core-js/fn/regexp/flags.js new file mode 100755 index 00000000..ef84ddbd --- /dev/null +++ b/node_modules/core-js/fn/regexp/flags.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.flags'); +var flags = require('../../modules/_flags'); +module.exports = function(it){ + return flags.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/index.js b/node_modules/core-js/fn/regexp/index.js new file mode 100755 index 00000000..61ced0b8 --- /dev/null +++ b/node_modules/core-js/fn/regexp/index.js @@ -0,0 +1,9 @@ +require('../../modules/es6.regexp.constructor'); +require('../../modules/es6.regexp.to-string'); +require('../../modules/es6.regexp.flags'); +require('../../modules/es6.regexp.match'); +require('../../modules/es6.regexp.replace'); +require('../../modules/es6.regexp.search'); +require('../../modules/es6.regexp.split'); +require('../../modules/core.regexp.escape'); +module.exports = require('../../modules/_core').RegExp; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/match.js b/node_modules/core-js/fn/regexp/match.js new file mode 100755 index 00000000..400d0921 --- /dev/null +++ b/node_modules/core-js/fn/regexp/match.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.match'); +var MATCH = require('../../modules/_wks')('match'); +module.exports = function(it, str){ + return RegExp.prototype[MATCH].call(it, str); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/replace.js b/node_modules/core-js/fn/regexp/replace.js new file mode 100755 index 00000000..adde0adf --- /dev/null +++ b/node_modules/core-js/fn/regexp/replace.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.replace'); +var REPLACE = require('../../modules/_wks')('replace'); +module.exports = function(it, str, replacer){ + return RegExp.prototype[REPLACE].call(it, str, replacer); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/search.js b/node_modules/core-js/fn/regexp/search.js new file mode 100755 index 00000000..4e149d05 --- /dev/null +++ b/node_modules/core-js/fn/regexp/search.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.search'); +var SEARCH = require('../../modules/_wks')('search'); +module.exports = function(it, str){ + return RegExp.prototype[SEARCH].call(it, str); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/split.js b/node_modules/core-js/fn/regexp/split.js new file mode 100755 index 00000000..b92d09fa --- /dev/null +++ b/node_modules/core-js/fn/regexp/split.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.split'); +var SPLIT = require('../../modules/_wks')('split'); +module.exports = function(it, str, limit){ + return RegExp.prototype[SPLIT].call(it, str, limit); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/regexp/to-string.js b/node_modules/core-js/fn/regexp/to-string.js new file mode 100755 index 00000000..29d5d037 --- /dev/null +++ b/node_modules/core-js/fn/regexp/to-string.js @@ -0,0 +1,5 @@ +'use strict'; +require('../../modules/es6.regexp.to-string'); +module.exports = function toString(it){ + return RegExp.prototype.toString.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/set-immediate.js b/node_modules/core-js/fn/set-immediate.js new file mode 100755 index 00000000..25083136 --- /dev/null +++ b/node_modules/core-js/fn/set-immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core').setImmediate; \ No newline at end of file diff --git a/node_modules/core-js/fn/set-interval.js b/node_modules/core-js/fn/set-interval.js new file mode 100755 index 00000000..484447ff --- /dev/null +++ b/node_modules/core-js/fn/set-interval.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core').setInterval; \ No newline at end of file diff --git a/node_modules/core-js/fn/set-timeout.js b/node_modules/core-js/fn/set-timeout.js new file mode 100755 index 00000000..8ebbb2e4 --- /dev/null +++ b/node_modules/core-js/fn/set-timeout.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core').setTimeout; \ No newline at end of file diff --git a/node_modules/core-js/fn/set.js b/node_modules/core-js/fn/set.js new file mode 100755 index 00000000..a8b49652 --- /dev/null +++ b/node_modules/core-js/fn/set.js @@ -0,0 +1,6 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.set'); +require('../modules/es7.set.to-json'); +module.exports = require('../modules/_core').Set; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/anchor.js b/node_modules/core-js/fn/string/anchor.js new file mode 100755 index 00000000..ba4ef813 --- /dev/null +++ b/node_modules/core-js/fn/string/anchor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.anchor'); +module.exports = require('../../modules/_core').String.anchor; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/at.js b/node_modules/core-js/fn/string/at.js new file mode 100755 index 00000000..ab6aec15 --- /dev/null +++ b/node_modules/core-js/fn/string/at.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.at'); +module.exports = require('../../modules/_core').String.at; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/big.js b/node_modules/core-js/fn/string/big.js new file mode 100755 index 00000000..ab707907 --- /dev/null +++ b/node_modules/core-js/fn/string/big.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.big'); +module.exports = require('../../modules/_core').String.big; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/blink.js b/node_modules/core-js/fn/string/blink.js new file mode 100755 index 00000000..c748079b --- /dev/null +++ b/node_modules/core-js/fn/string/blink.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.blink'); +module.exports = require('../../modules/_core').String.blink; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/bold.js b/node_modules/core-js/fn/string/bold.js new file mode 100755 index 00000000..2d36bda3 --- /dev/null +++ b/node_modules/core-js/fn/string/bold.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.bold'); +module.exports = require('../../modules/_core').String.bold; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/code-point-at.js b/node_modules/core-js/fn/string/code-point-at.js new file mode 100755 index 00000000..be141e82 --- /dev/null +++ b/node_modules/core-js/fn/string/code-point-at.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.code-point-at'); +module.exports = require('../../modules/_core').String.codePointAt; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/ends-with.js b/node_modules/core-js/fn/string/ends-with.js new file mode 100755 index 00000000..5e427753 --- /dev/null +++ b/node_modules/core-js/fn/string/ends-with.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.ends-with'); +module.exports = require('../../modules/_core').String.endsWith; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/escape-html.js b/node_modules/core-js/fn/string/escape-html.js new file mode 100755 index 00000000..49176ca6 --- /dev/null +++ b/node_modules/core-js/fn/string/escape-html.js @@ -0,0 +1,2 @@ +require('../../modules/core.string.escape-html'); +module.exports = require('../../modules/_core').String.escapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/fixed.js b/node_modules/core-js/fn/string/fixed.js new file mode 100755 index 00000000..77e233a3 --- /dev/null +++ b/node_modules/core-js/fn/string/fixed.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.fixed'); +module.exports = require('../../modules/_core').String.fixed; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/fontcolor.js b/node_modules/core-js/fn/string/fontcolor.js new file mode 100755 index 00000000..079235a1 --- /dev/null +++ b/node_modules/core-js/fn/string/fontcolor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.fontcolor'); +module.exports = require('../../modules/_core').String.fontcolor; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/fontsize.js b/node_modules/core-js/fn/string/fontsize.js new file mode 100755 index 00000000..8cb2555c --- /dev/null +++ b/node_modules/core-js/fn/string/fontsize.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.fontsize'); +module.exports = require('../../modules/_core').String.fontsize; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/from-code-point.js b/node_modules/core-js/fn/string/from-code-point.js new file mode 100755 index 00000000..93fc53ae --- /dev/null +++ b/node_modules/core-js/fn/string/from-code-point.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.from-code-point'); +module.exports = require('../../modules/_core').String.fromCodePoint; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/includes.js b/node_modules/core-js/fn/string/includes.js new file mode 100755 index 00000000..c9736404 --- /dev/null +++ b/node_modules/core-js/fn/string/includes.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.includes'); +module.exports = require('../../modules/_core').String.includes; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/index.js b/node_modules/core-js/fn/string/index.js new file mode 100755 index 00000000..6485a9b2 --- /dev/null +++ b/node_modules/core-js/fn/string/index.js @@ -0,0 +1,35 @@ +require('../../modules/es6.string.from-code-point'); +require('../../modules/es6.string.raw'); +require('../../modules/es6.string.trim'); +require('../../modules/es6.string.iterator'); +require('../../modules/es6.string.code-point-at'); +require('../../modules/es6.string.ends-with'); +require('../../modules/es6.string.includes'); +require('../../modules/es6.string.repeat'); +require('../../modules/es6.string.starts-with'); +require('../../modules/es6.regexp.match'); +require('../../modules/es6.regexp.replace'); +require('../../modules/es6.regexp.search'); +require('../../modules/es6.regexp.split'); +require('../../modules/es6.string.anchor'); +require('../../modules/es6.string.big'); +require('../../modules/es6.string.blink'); +require('../../modules/es6.string.bold'); +require('../../modules/es6.string.fixed'); +require('../../modules/es6.string.fontcolor'); +require('../../modules/es6.string.fontsize'); +require('../../modules/es6.string.italics'); +require('../../modules/es6.string.link'); +require('../../modules/es6.string.small'); +require('../../modules/es6.string.strike'); +require('../../modules/es6.string.sub'); +require('../../modules/es6.string.sup'); +require('../../modules/es7.string.at'); +require('../../modules/es7.string.pad-start'); +require('../../modules/es7.string.pad-end'); +require('../../modules/es7.string.trim-left'); +require('../../modules/es7.string.trim-right'); +require('../../modules/es7.string.match-all'); +require('../../modules/core.string.escape-html'); +require('../../modules/core.string.unescape-html'); +module.exports = require('../../modules/_core').String; diff --git a/node_modules/core-js/fn/string/italics.js b/node_modules/core-js/fn/string/italics.js new file mode 100755 index 00000000..378450eb --- /dev/null +++ b/node_modules/core-js/fn/string/italics.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.italics'); +module.exports = require('../../modules/_core').String.italics; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/iterator.js b/node_modules/core-js/fn/string/iterator.js new file mode 100755 index 00000000..947e7558 --- /dev/null +++ b/node_modules/core-js/fn/string/iterator.js @@ -0,0 +1,5 @@ +require('../../modules/es6.string.iterator'); +var get = require('../../modules/_iterators').String; +module.exports = function(it){ + return get.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/link.js b/node_modules/core-js/fn/string/link.js new file mode 100755 index 00000000..1eb2c6dd --- /dev/null +++ b/node_modules/core-js/fn/string/link.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.link'); +module.exports = require('../../modules/_core').String.link; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/match-all.js b/node_modules/core-js/fn/string/match-all.js new file mode 100755 index 00000000..1a1dfeb6 --- /dev/null +++ b/node_modules/core-js/fn/string/match-all.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.match-all'); +module.exports = require('../../modules/_core').String.matchAll; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/pad-end.js b/node_modules/core-js/fn/string/pad-end.js new file mode 100755 index 00000000..23eb9f95 --- /dev/null +++ b/node_modules/core-js/fn/string/pad-end.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.pad-end'); +module.exports = require('../../modules/_core').String.padEnd; diff --git a/node_modules/core-js/fn/string/pad-start.js b/node_modules/core-js/fn/string/pad-start.js new file mode 100755 index 00000000..ff12739f --- /dev/null +++ b/node_modules/core-js/fn/string/pad-start.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.pad-start'); +module.exports = require('../../modules/_core').String.padStart; diff --git a/node_modules/core-js/fn/string/raw.js b/node_modules/core-js/fn/string/raw.js new file mode 100755 index 00000000..713550fb --- /dev/null +++ b/node_modules/core-js/fn/string/raw.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.raw'); +module.exports = require('../../modules/_core').String.raw; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/repeat.js b/node_modules/core-js/fn/string/repeat.js new file mode 100755 index 00000000..fa75b13e --- /dev/null +++ b/node_modules/core-js/fn/string/repeat.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.repeat'); +module.exports = require('../../modules/_core').String.repeat; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/small.js b/node_modules/core-js/fn/string/small.js new file mode 100755 index 00000000..0438290d --- /dev/null +++ b/node_modules/core-js/fn/string/small.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.small'); +module.exports = require('../../modules/_core').String.small; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/starts-with.js b/node_modules/core-js/fn/string/starts-with.js new file mode 100755 index 00000000..d62512a3 --- /dev/null +++ b/node_modules/core-js/fn/string/starts-with.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.starts-with'); +module.exports = require('../../modules/_core').String.startsWith; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/strike.js b/node_modules/core-js/fn/string/strike.js new file mode 100755 index 00000000..b79946c8 --- /dev/null +++ b/node_modules/core-js/fn/string/strike.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.strike'); +module.exports = require('../../modules/_core').String.strike; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/sub.js b/node_modules/core-js/fn/string/sub.js new file mode 100755 index 00000000..54d0671e --- /dev/null +++ b/node_modules/core-js/fn/string/sub.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.sub'); +module.exports = require('../../modules/_core').String.sub; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/sup.js b/node_modules/core-js/fn/string/sup.js new file mode 100755 index 00000000..645e0372 --- /dev/null +++ b/node_modules/core-js/fn/string/sup.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.sup'); +module.exports = require('../../modules/_core').String.sup; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/trim-end.js b/node_modules/core-js/fn/string/trim-end.js new file mode 100755 index 00000000..f3bdf6fb --- /dev/null +++ b/node_modules/core-js/fn/string/trim-end.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-right'); +module.exports = require('../../modules/_core').String.trimRight; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/trim-left.js b/node_modules/core-js/fn/string/trim-left.js new file mode 100755 index 00000000..04671d36 --- /dev/null +++ b/node_modules/core-js/fn/string/trim-left.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-left'); +module.exports = require('../../modules/_core').String.trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/trim-right.js b/node_modules/core-js/fn/string/trim-right.js new file mode 100755 index 00000000..f3bdf6fb --- /dev/null +++ b/node_modules/core-js/fn/string/trim-right.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-right'); +module.exports = require('../../modules/_core').String.trimRight; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/trim-start.js b/node_modules/core-js/fn/string/trim-start.js new file mode 100755 index 00000000..04671d36 --- /dev/null +++ b/node_modules/core-js/fn/string/trim-start.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-left'); +module.exports = require('../../modules/_core').String.trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/trim.js b/node_modules/core-js/fn/string/trim.js new file mode 100755 index 00000000..c536e12e --- /dev/null +++ b/node_modules/core-js/fn/string/trim.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.trim'); +module.exports = require('../../modules/_core').String.trim; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/unescape-html.js b/node_modules/core-js/fn/string/unescape-html.js new file mode 100755 index 00000000..7c2c55c8 --- /dev/null +++ b/node_modules/core-js/fn/string/unescape-html.js @@ -0,0 +1,2 @@ +require('../../modules/core.string.unescape-html'); +module.exports = require('../../modules/_core').String.unescapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/anchor.js b/node_modules/core-js/fn/string/virtual/anchor.js new file mode 100755 index 00000000..6f74b7e8 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/anchor.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.anchor'); +module.exports = require('../../../modules/_entry-virtual')('String').anchor; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/at.js b/node_modules/core-js/fn/string/virtual/at.js new file mode 100755 index 00000000..3b961438 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/at.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.at'); +module.exports = require('../../../modules/_entry-virtual')('String').at; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/big.js b/node_modules/core-js/fn/string/virtual/big.js new file mode 100755 index 00000000..57ac7d5d --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/big.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.big'); +module.exports = require('../../../modules/_entry-virtual')('String').big; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/blink.js b/node_modules/core-js/fn/string/virtual/blink.js new file mode 100755 index 00000000..5c4cea80 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/blink.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.blink'); +module.exports = require('../../../modules/_entry-virtual')('String').blink; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/bold.js b/node_modules/core-js/fn/string/virtual/bold.js new file mode 100755 index 00000000..c566bf2d --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/bold.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.bold'); +module.exports = require('../../../modules/_entry-virtual')('String').bold; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/code-point-at.js b/node_modules/core-js/fn/string/virtual/code-point-at.js new file mode 100755 index 00000000..87375219 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/code-point-at.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.code-point-at'); +module.exports = require('../../../modules/_entry-virtual')('String').codePointAt; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/ends-with.js b/node_modules/core-js/fn/string/virtual/ends-with.js new file mode 100755 index 00000000..90bc6e79 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/ends-with.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.ends-with'); +module.exports = require('../../../modules/_entry-virtual')('String').endsWith; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/escape-html.js b/node_modules/core-js/fn/string/virtual/escape-html.js new file mode 100755 index 00000000..3342bcec --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/escape-html.js @@ -0,0 +1,2 @@ +require('../../../modules/core.string.escape-html'); +module.exports = require('../../../modules/_entry-virtual')('String').escapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/fixed.js b/node_modules/core-js/fn/string/virtual/fixed.js new file mode 100755 index 00000000..e830654f --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/fixed.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.fixed'); +module.exports = require('../../../modules/_entry-virtual')('String').fixed; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/fontcolor.js b/node_modules/core-js/fn/string/virtual/fontcolor.js new file mode 100755 index 00000000..cfb9b2c0 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/fontcolor.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.fontcolor'); +module.exports = require('../../../modules/_entry-virtual')('String').fontcolor; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/fontsize.js b/node_modules/core-js/fn/string/virtual/fontsize.js new file mode 100755 index 00000000..de8f5161 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/fontsize.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.fontsize'); +module.exports = require('../../../modules/_entry-virtual')('String').fontsize; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/includes.js b/node_modules/core-js/fn/string/virtual/includes.js new file mode 100755 index 00000000..1e4793d6 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/includes.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.includes'); +module.exports = require('../../../modules/_entry-virtual')('String').includes; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/index.js b/node_modules/core-js/fn/string/virtual/index.js new file mode 100755 index 00000000..0e65d20c --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/index.js @@ -0,0 +1,33 @@ +require('../../../modules/es6.string.trim'); +require('../../../modules/es6.string.iterator'); +require('../../../modules/es6.string.code-point-at'); +require('../../../modules/es6.string.ends-with'); +require('../../../modules/es6.string.includes'); +require('../../../modules/es6.string.repeat'); +require('../../../modules/es6.string.starts-with'); +require('../../../modules/es6.regexp.match'); +require('../../../modules/es6.regexp.replace'); +require('../../../modules/es6.regexp.search'); +require('../../../modules/es6.regexp.split'); +require('../../../modules/es6.string.anchor'); +require('../../../modules/es6.string.big'); +require('../../../modules/es6.string.blink'); +require('../../../modules/es6.string.bold'); +require('../../../modules/es6.string.fixed'); +require('../../../modules/es6.string.fontcolor'); +require('../../../modules/es6.string.fontsize'); +require('../../../modules/es6.string.italics'); +require('../../../modules/es6.string.link'); +require('../../../modules/es6.string.small'); +require('../../../modules/es6.string.strike'); +require('../../../modules/es6.string.sub'); +require('../../../modules/es6.string.sup'); +require('../../../modules/es7.string.at'); +require('../../../modules/es7.string.pad-start'); +require('../../../modules/es7.string.pad-end'); +require('../../../modules/es7.string.trim-left'); +require('../../../modules/es7.string.trim-right'); +require('../../../modules/es7.string.match-all'); +require('../../../modules/core.string.escape-html'); +require('../../../modules/core.string.unescape-html'); +module.exports = require('../../../modules/_entry-virtual')('String'); diff --git a/node_modules/core-js/fn/string/virtual/italics.js b/node_modules/core-js/fn/string/virtual/italics.js new file mode 100755 index 00000000..f8f1d338 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/italics.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.italics'); +module.exports = require('../../../modules/_entry-virtual')('String').italics; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/iterator.js b/node_modules/core-js/fn/string/virtual/iterator.js new file mode 100755 index 00000000..7efe2f93 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/iterator.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').String; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/link.js b/node_modules/core-js/fn/string/virtual/link.js new file mode 100755 index 00000000..4b2eea8a --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/link.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.link'); +module.exports = require('../../../modules/_entry-virtual')('String').link; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/match-all.js b/node_modules/core-js/fn/string/virtual/match-all.js new file mode 100755 index 00000000..9208873a --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/match-all.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.match-all'); +module.exports = require('../../../modules/_entry-virtual')('String').matchAll; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/pad-end.js b/node_modules/core-js/fn/string/virtual/pad-end.js new file mode 100755 index 00000000..81e5ac04 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/pad-end.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.pad-end'); +module.exports = require('../../../modules/_entry-virtual')('String').padEnd; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/pad-start.js b/node_modules/core-js/fn/string/virtual/pad-start.js new file mode 100755 index 00000000..54cf3a59 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/pad-start.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.pad-start'); +module.exports = require('../../../modules/_entry-virtual')('String').padStart; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/repeat.js b/node_modules/core-js/fn/string/virtual/repeat.js new file mode 100755 index 00000000..d08cf6a5 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/repeat.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.repeat'); +module.exports = require('../../../modules/_entry-virtual')('String').repeat; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/small.js b/node_modules/core-js/fn/string/virtual/small.js new file mode 100755 index 00000000..201bf9b6 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/small.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.small'); +module.exports = require('../../../modules/_entry-virtual')('String').small; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/starts-with.js b/node_modules/core-js/fn/string/virtual/starts-with.js new file mode 100755 index 00000000..f8897d15 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/starts-with.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.starts-with'); +module.exports = require('../../../modules/_entry-virtual')('String').startsWith; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/strike.js b/node_modules/core-js/fn/string/virtual/strike.js new file mode 100755 index 00000000..4572db91 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/strike.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.strike'); +module.exports = require('../../../modules/_entry-virtual')('String').strike; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/sub.js b/node_modules/core-js/fn/string/virtual/sub.js new file mode 100755 index 00000000..a13611ec --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/sub.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.sub'); +module.exports = require('../../../modules/_entry-virtual')('String').sub; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/sup.js b/node_modules/core-js/fn/string/virtual/sup.js new file mode 100755 index 00000000..07695329 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/sup.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.sup'); +module.exports = require('../../../modules/_entry-virtual')('String').sup; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/trim-end.js b/node_modules/core-js/fn/string/virtual/trim-end.js new file mode 100755 index 00000000..14c25ac8 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/trim-end.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-right'); +module.exports = require('../../../modules/_entry-virtual')('String').trimRight; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/trim-left.js b/node_modules/core-js/fn/string/virtual/trim-left.js new file mode 100755 index 00000000..aabcfb3f --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/trim-left.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-left'); +module.exports = require('../../../modules/_entry-virtual')('String').trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/trim-right.js b/node_modules/core-js/fn/string/virtual/trim-right.js new file mode 100755 index 00000000..14c25ac8 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/trim-right.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-right'); +module.exports = require('../../../modules/_entry-virtual')('String').trimRight; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/trim-start.js b/node_modules/core-js/fn/string/virtual/trim-start.js new file mode 100755 index 00000000..aabcfb3f --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/trim-start.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-left'); +module.exports = require('../../../modules/_entry-virtual')('String').trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/trim.js b/node_modules/core-js/fn/string/virtual/trim.js new file mode 100755 index 00000000..23fbcbc5 --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/trim.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.trim'); +module.exports = require('../../../modules/_entry-virtual')('String').trim; \ No newline at end of file diff --git a/node_modules/core-js/fn/string/virtual/unescape-html.js b/node_modules/core-js/fn/string/virtual/unescape-html.js new file mode 100755 index 00000000..51eb59fc --- /dev/null +++ b/node_modules/core-js/fn/string/virtual/unescape-html.js @@ -0,0 +1,2 @@ +require('../../../modules/core.string.unescape-html'); +module.exports = require('../../../modules/_entry-virtual')('String').unescapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/async-iterator.js b/node_modules/core-js/fn/symbol/async-iterator.js new file mode 100755 index 00000000..aca10f96 --- /dev/null +++ b/node_modules/core-js/fn/symbol/async-iterator.js @@ -0,0 +1,2 @@ +require('../../modules/es7.symbol.async-iterator'); +module.exports = require('../../modules/_wks-ext').f('asyncIterator'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/for.js b/node_modules/core-js/fn/symbol/for.js new file mode 100755 index 00000000..c9e93c13 --- /dev/null +++ b/node_modules/core-js/fn/symbol/for.js @@ -0,0 +1,2 @@ +require('../../modules/es6.symbol'); +module.exports = require('../../modules/_core').Symbol['for']; \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/has-instance.js b/node_modules/core-js/fn/symbol/has-instance.js new file mode 100755 index 00000000..f3ec9cf6 --- /dev/null +++ b/node_modules/core-js/fn/symbol/has-instance.js @@ -0,0 +1,2 @@ +require('../../modules/es6.function.has-instance'); +module.exports = require('../../modules/_wks-ext').f('hasInstance'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/index.js b/node_modules/core-js/fn/symbol/index.js new file mode 100755 index 00000000..64c0f5f4 --- /dev/null +++ b/node_modules/core-js/fn/symbol/index.js @@ -0,0 +1,5 @@ +require('../../modules/es6.symbol'); +require('../../modules/es6.object.to-string'); +require('../../modules/es7.symbol.async-iterator'); +require('../../modules/es7.symbol.observable'); +module.exports = require('../../modules/_core').Symbol; \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/is-concat-spreadable.js b/node_modules/core-js/fn/symbol/is-concat-spreadable.js new file mode 100755 index 00000000..49ed7a1d --- /dev/null +++ b/node_modules/core-js/fn/symbol/is-concat-spreadable.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('isConcatSpreadable'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/iterator.js b/node_modules/core-js/fn/symbol/iterator.js new file mode 100755 index 00000000..50352280 --- /dev/null +++ b/node_modules/core-js/fn/symbol/iterator.js @@ -0,0 +1,3 @@ +require('../../modules/es6.string.iterator'); +require('../../modules/web.dom.iterable'); +module.exports = require('../../modules/_wks-ext').f('iterator'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/key-for.js b/node_modules/core-js/fn/symbol/key-for.js new file mode 100755 index 00000000..d9b595ff --- /dev/null +++ b/node_modules/core-js/fn/symbol/key-for.js @@ -0,0 +1,2 @@ +require('../../modules/es6.symbol'); +module.exports = require('../../modules/_core').Symbol.keyFor; \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/match.js b/node_modules/core-js/fn/symbol/match.js new file mode 100755 index 00000000..d27db65b --- /dev/null +++ b/node_modules/core-js/fn/symbol/match.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.match'); +module.exports = require('../../modules/_wks-ext').f('match'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/observable.js b/node_modules/core-js/fn/symbol/observable.js new file mode 100755 index 00000000..884cebfd --- /dev/null +++ b/node_modules/core-js/fn/symbol/observable.js @@ -0,0 +1,2 @@ +require('../../modules/es7.symbol.observable'); +module.exports = require('../../modules/_wks-ext').f('observable'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/replace.js b/node_modules/core-js/fn/symbol/replace.js new file mode 100755 index 00000000..3ef60f5e --- /dev/null +++ b/node_modules/core-js/fn/symbol/replace.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.replace'); +module.exports = require('../../modules/_wks-ext').f('replace'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/search.js b/node_modules/core-js/fn/symbol/search.js new file mode 100755 index 00000000..aee84f9e --- /dev/null +++ b/node_modules/core-js/fn/symbol/search.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.search'); +module.exports = require('../../modules/_wks-ext').f('search'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/species.js b/node_modules/core-js/fn/symbol/species.js new file mode 100755 index 00000000..a425eb2d --- /dev/null +++ b/node_modules/core-js/fn/symbol/species.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('species'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/split.js b/node_modules/core-js/fn/symbol/split.js new file mode 100755 index 00000000..8535932f --- /dev/null +++ b/node_modules/core-js/fn/symbol/split.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.split'); +module.exports = require('../../modules/_wks-ext').f('split'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/to-primitive.js b/node_modules/core-js/fn/symbol/to-primitive.js new file mode 100755 index 00000000..20c831b8 --- /dev/null +++ b/node_modules/core-js/fn/symbol/to-primitive.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('toPrimitive'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/to-string-tag.js b/node_modules/core-js/fn/symbol/to-string-tag.js new file mode 100755 index 00000000..101baf27 --- /dev/null +++ b/node_modules/core-js/fn/symbol/to-string-tag.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_wks-ext').f('toStringTag'); \ No newline at end of file diff --git a/node_modules/core-js/fn/symbol/unscopables.js b/node_modules/core-js/fn/symbol/unscopables.js new file mode 100755 index 00000000..6c4146b2 --- /dev/null +++ b/node_modules/core-js/fn/symbol/unscopables.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('unscopables'); \ No newline at end of file diff --git a/node_modules/core-js/fn/system/global.js b/node_modules/core-js/fn/system/global.js new file mode 100755 index 00000000..c3219d6f --- /dev/null +++ b/node_modules/core-js/fn/system/global.js @@ -0,0 +1,2 @@ +require('../../modules/es7.system.global'); +module.exports = require('../../modules/_core').System.global; \ No newline at end of file diff --git a/node_modules/core-js/fn/system/index.js b/node_modules/core-js/fn/system/index.js new file mode 100755 index 00000000..eae78ddd --- /dev/null +++ b/node_modules/core-js/fn/system/index.js @@ -0,0 +1,2 @@ +require('../../modules/es7.system.global'); +module.exports = require('../../modules/_core').System; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/array-buffer.js b/node_modules/core-js/fn/typed/array-buffer.js new file mode 100755 index 00000000..fe08f7f2 --- /dev/null +++ b/node_modules/core-js/fn/typed/array-buffer.js @@ -0,0 +1,3 @@ +require('../../modules/es6.typed.array-buffer'); +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_core').ArrayBuffer; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/data-view.js b/node_modules/core-js/fn/typed/data-view.js new file mode 100755 index 00000000..09dbb38a --- /dev/null +++ b/node_modules/core-js/fn/typed/data-view.js @@ -0,0 +1,3 @@ +require('../../modules/es6.typed.data-view'); +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_core').DataView; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/float32-array.js b/node_modules/core-js/fn/typed/float32-array.js new file mode 100755 index 00000000..1191fecb --- /dev/null +++ b/node_modules/core-js/fn/typed/float32-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.float32-array'); +module.exports = require('../../modules/_core').Float32Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/float64-array.js b/node_modules/core-js/fn/typed/float64-array.js new file mode 100755 index 00000000..6073a682 --- /dev/null +++ b/node_modules/core-js/fn/typed/float64-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.float64-array'); +module.exports = require('../../modules/_core').Float64Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/index.js b/node_modules/core-js/fn/typed/index.js new file mode 100755 index 00000000..7babe09d --- /dev/null +++ b/node_modules/core-js/fn/typed/index.js @@ -0,0 +1,13 @@ +require('../../modules/es6.typed.array-buffer'); +require('../../modules/es6.typed.data-view'); +require('../../modules/es6.typed.int8-array'); +require('../../modules/es6.typed.uint8-array'); +require('../../modules/es6.typed.uint8-clamped-array'); +require('../../modules/es6.typed.int16-array'); +require('../../modules/es6.typed.uint16-array'); +require('../../modules/es6.typed.int32-array'); +require('../../modules/es6.typed.uint32-array'); +require('../../modules/es6.typed.float32-array'); +require('../../modules/es6.typed.float64-array'); +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/int16-array.js b/node_modules/core-js/fn/typed/int16-array.js new file mode 100755 index 00000000..0722549d --- /dev/null +++ b/node_modules/core-js/fn/typed/int16-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.int16-array'); +module.exports = require('../../modules/_core').Int16Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/int32-array.js b/node_modules/core-js/fn/typed/int32-array.js new file mode 100755 index 00000000..13613622 --- /dev/null +++ b/node_modules/core-js/fn/typed/int32-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.int32-array'); +module.exports = require('../../modules/_core').Int32Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/int8-array.js b/node_modules/core-js/fn/typed/int8-array.js new file mode 100755 index 00000000..edf48c79 --- /dev/null +++ b/node_modules/core-js/fn/typed/int8-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.int8-array'); +module.exports = require('../../modules/_core').Int8Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/uint16-array.js b/node_modules/core-js/fn/typed/uint16-array.js new file mode 100755 index 00000000..3ff11550 --- /dev/null +++ b/node_modules/core-js/fn/typed/uint16-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint16-array'); +module.exports = require('../../modules/_core').Uint16Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/uint32-array.js b/node_modules/core-js/fn/typed/uint32-array.js new file mode 100755 index 00000000..47bb4c21 --- /dev/null +++ b/node_modules/core-js/fn/typed/uint32-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint32-array'); +module.exports = require('../../modules/_core').Uint32Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/uint8-array.js b/node_modules/core-js/fn/typed/uint8-array.js new file mode 100755 index 00000000..fd8a4b11 --- /dev/null +++ b/node_modules/core-js/fn/typed/uint8-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint8-array'); +module.exports = require('../../modules/_core').Uint8Array; \ No newline at end of file diff --git a/node_modules/core-js/fn/typed/uint8-clamped-array.js b/node_modules/core-js/fn/typed/uint8-clamped-array.js new file mode 100755 index 00000000..c688657c --- /dev/null +++ b/node_modules/core-js/fn/typed/uint8-clamped-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint8-clamped-array'); +module.exports = require('../../modules/_core').Uint8ClampedArray; \ No newline at end of file diff --git a/node_modules/core-js/fn/weak-map.js b/node_modules/core-js/fn/weak-map.js new file mode 100755 index 00000000..00cac1ad --- /dev/null +++ b/node_modules/core-js/fn/weak-map.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/web.dom.iterable'); +require('../modules/es6.weak-map'); +module.exports = require('../modules/_core').WeakMap; \ No newline at end of file diff --git a/node_modules/core-js/fn/weak-set.js b/node_modules/core-js/fn/weak-set.js new file mode 100755 index 00000000..eef1af2a --- /dev/null +++ b/node_modules/core-js/fn/weak-set.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/web.dom.iterable'); +require('../modules/es6.weak-set'); +module.exports = require('../modules/_core').WeakSet; \ No newline at end of file diff --git a/node_modules/core-js/index.js b/node_modules/core-js/index.js new file mode 100755 index 00000000..78b9e3d4 --- /dev/null +++ b/node_modules/core-js/index.js @@ -0,0 +1,16 @@ +require('./shim'); +require('./modules/core.dict'); +require('./modules/core.get-iterator-method'); +require('./modules/core.get-iterator'); +require('./modules/core.is-iterable'); +require('./modules/core.delay'); +require('./modules/core.function.part'); +require('./modules/core.object.is-object'); +require('./modules/core.object.classof'); +require('./modules/core.object.define'); +require('./modules/core.object.make'); +require('./modules/core.number.iterator'); +require('./modules/core.regexp.escape'); +require('./modules/core.string.escape-html'); +require('./modules/core.string.unescape-html'); +module.exports = require('./modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/core/_.js b/node_modules/core-js/library/core/_.js new file mode 100755 index 00000000..8a99f706 --- /dev/null +++ b/node_modules/core-js/library/core/_.js @@ -0,0 +1,2 @@ +require('../modules/core.function.part'); +module.exports = require('../modules/_core')._; \ No newline at end of file diff --git a/node_modules/core-js/library/core/delay.js b/node_modules/core-js/library/core/delay.js new file mode 100755 index 00000000..18857388 --- /dev/null +++ b/node_modules/core-js/library/core/delay.js @@ -0,0 +1,2 @@ +require('../modules/core.delay'); +module.exports = require('../modules/_core').delay; diff --git a/node_modules/core-js/library/core/dict.js b/node_modules/core-js/library/core/dict.js new file mode 100755 index 00000000..da84a8d8 --- /dev/null +++ b/node_modules/core-js/library/core/dict.js @@ -0,0 +1,2 @@ +require('../modules/core.dict'); +module.exports = require('../modules/_core').Dict; \ No newline at end of file diff --git a/node_modules/core-js/library/core/function.js b/node_modules/core-js/library/core/function.js new file mode 100755 index 00000000..3b8d0131 --- /dev/null +++ b/node_modules/core-js/library/core/function.js @@ -0,0 +1,2 @@ +require('../modules/core.function.part'); +module.exports = require('../modules/_core').Function; diff --git a/node_modules/core-js/library/core/index.js b/node_modules/core-js/library/core/index.js new file mode 100755 index 00000000..2b20fd9e --- /dev/null +++ b/node_modules/core-js/library/core/index.js @@ -0,0 +1,15 @@ +require('../modules/core.dict'); +require('../modules/core.get-iterator-method'); +require('../modules/core.get-iterator'); +require('../modules/core.is-iterable'); +require('../modules/core.delay'); +require('../modules/core.function.part'); +require('../modules/core.object.is-object'); +require('../modules/core.object.classof'); +require('../modules/core.object.define'); +require('../modules/core.object.make'); +require('../modules/core.number.iterator'); +require('../modules/core.regexp.escape'); +require('../modules/core.string.escape-html'); +require('../modules/core.string.unescape-html'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/core/number.js b/node_modules/core-js/library/core/number.js new file mode 100755 index 00000000..62f632c5 --- /dev/null +++ b/node_modules/core-js/library/core/number.js @@ -0,0 +1,2 @@ +require('../modules/core.number.iterator'); +module.exports = require('../modules/_core').Number; \ No newline at end of file diff --git a/node_modules/core-js/library/core/object.js b/node_modules/core-js/library/core/object.js new file mode 100755 index 00000000..04e539c9 --- /dev/null +++ b/node_modules/core-js/library/core/object.js @@ -0,0 +1,5 @@ +require('../modules/core.object.is-object'); +require('../modules/core.object.classof'); +require('../modules/core.object.define'); +require('../modules/core.object.make'); +module.exports = require('../modules/_core').Object; diff --git a/node_modules/core-js/library/core/regexp.js b/node_modules/core-js/library/core/regexp.js new file mode 100755 index 00000000..3e04c511 --- /dev/null +++ b/node_modules/core-js/library/core/regexp.js @@ -0,0 +1,2 @@ +require('../modules/core.regexp.escape'); +module.exports = require('../modules/_core').RegExp; \ No newline at end of file diff --git a/node_modules/core-js/library/core/string.js b/node_modules/core-js/library/core/string.js new file mode 100755 index 00000000..8da740c6 --- /dev/null +++ b/node_modules/core-js/library/core/string.js @@ -0,0 +1,3 @@ +require('../modules/core.string.escape-html'); +require('../modules/core.string.unescape-html'); +module.exports = require('../modules/_core').String; \ No newline at end of file diff --git a/node_modules/core-js/library/es5/index.js b/node_modules/core-js/library/es5/index.js new file mode 100755 index 00000000..580f1a67 --- /dev/null +++ b/node_modules/core-js/library/es5/index.js @@ -0,0 +1,37 @@ +require('../modules/es6.object.create'); +require('../modules/es6.object.define-property'); +require('../modules/es6.object.define-properties'); +require('../modules/es6.object.get-own-property-descriptor'); +require('../modules/es6.object.get-prototype-of'); +require('../modules/es6.object.keys'); +require('../modules/es6.object.get-own-property-names'); +require('../modules/es6.object.freeze'); +require('../modules/es6.object.seal'); +require('../modules/es6.object.prevent-extensions'); +require('../modules/es6.object.is-frozen'); +require('../modules/es6.object.is-sealed'); +require('../modules/es6.object.is-extensible'); +require('../modules/es6.function.bind'); +require('../modules/es6.array.is-array'); +require('../modules/es6.array.join'); +require('../modules/es6.array.slice'); +require('../modules/es6.array.sort'); +require('../modules/es6.array.for-each'); +require('../modules/es6.array.map'); +require('../modules/es6.array.filter'); +require('../modules/es6.array.some'); +require('../modules/es6.array.every'); +require('../modules/es6.array.reduce'); +require('../modules/es6.array.reduce-right'); +require('../modules/es6.array.index-of'); +require('../modules/es6.array.last-index-of'); +require('../modules/es6.number.to-fixed'); +require('../modules/es6.number.to-precision'); +require('../modules/es6.date.now'); +require('../modules/es6.date.to-iso-string'); +require('../modules/es6.date.to-json'); +require('../modules/es6.parse-int'); +require('../modules/es6.parse-float'); +require('../modules/es6.string.trim'); +require('../modules/es6.regexp.to-string'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/es6/array.js b/node_modules/core-js/library/es6/array.js new file mode 100755 index 00000000..428d3e8c --- /dev/null +++ b/node_modules/core-js/library/es6/array.js @@ -0,0 +1,23 @@ +require('../modules/es6.string.iterator'); +require('../modules/es6.array.is-array'); +require('../modules/es6.array.from'); +require('../modules/es6.array.of'); +require('../modules/es6.array.join'); +require('../modules/es6.array.slice'); +require('../modules/es6.array.sort'); +require('../modules/es6.array.for-each'); +require('../modules/es6.array.map'); +require('../modules/es6.array.filter'); +require('../modules/es6.array.some'); +require('../modules/es6.array.every'); +require('../modules/es6.array.reduce'); +require('../modules/es6.array.reduce-right'); +require('../modules/es6.array.index-of'); +require('../modules/es6.array.last-index-of'); +require('../modules/es6.array.copy-within'); +require('../modules/es6.array.fill'); +require('../modules/es6.array.find'); +require('../modules/es6.array.find-index'); +require('../modules/es6.array.species'); +require('../modules/es6.array.iterator'); +module.exports = require('../modules/_core').Array; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/date.js b/node_modules/core-js/library/es6/date.js new file mode 100755 index 00000000..dfa3be09 --- /dev/null +++ b/node_modules/core-js/library/es6/date.js @@ -0,0 +1,6 @@ +require('../modules/es6.date.now'); +require('../modules/es6.date.to-json'); +require('../modules/es6.date.to-iso-string'); +require('../modules/es6.date.to-string'); +require('../modules/es6.date.to-primitive'); +module.exports = Date; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/function.js b/node_modules/core-js/library/es6/function.js new file mode 100755 index 00000000..ff685da2 --- /dev/null +++ b/node_modules/core-js/library/es6/function.js @@ -0,0 +1,4 @@ +require('../modules/es6.function.bind'); +require('../modules/es6.function.name'); +require('../modules/es6.function.has-instance'); +module.exports = require('../modules/_core').Function; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/index.js b/node_modules/core-js/library/es6/index.js new file mode 100755 index 00000000..59df5092 --- /dev/null +++ b/node_modules/core-js/library/es6/index.js @@ -0,0 +1,138 @@ +require('../modules/es6.symbol'); +require('../modules/es6.object.create'); +require('../modules/es6.object.define-property'); +require('../modules/es6.object.define-properties'); +require('../modules/es6.object.get-own-property-descriptor'); +require('../modules/es6.object.get-prototype-of'); +require('../modules/es6.object.keys'); +require('../modules/es6.object.get-own-property-names'); +require('../modules/es6.object.freeze'); +require('../modules/es6.object.seal'); +require('../modules/es6.object.prevent-extensions'); +require('../modules/es6.object.is-frozen'); +require('../modules/es6.object.is-sealed'); +require('../modules/es6.object.is-extensible'); +require('../modules/es6.object.assign'); +require('../modules/es6.object.is'); +require('../modules/es6.object.set-prototype-of'); +require('../modules/es6.object.to-string'); +require('../modules/es6.function.bind'); +require('../modules/es6.function.name'); +require('../modules/es6.function.has-instance'); +require('../modules/es6.parse-int'); +require('../modules/es6.parse-float'); +require('../modules/es6.number.constructor'); +require('../modules/es6.number.to-fixed'); +require('../modules/es6.number.to-precision'); +require('../modules/es6.number.epsilon'); +require('../modules/es6.number.is-finite'); +require('../modules/es6.number.is-integer'); +require('../modules/es6.number.is-nan'); +require('../modules/es6.number.is-safe-integer'); +require('../modules/es6.number.max-safe-integer'); +require('../modules/es6.number.min-safe-integer'); +require('../modules/es6.number.parse-float'); +require('../modules/es6.number.parse-int'); +require('../modules/es6.math.acosh'); +require('../modules/es6.math.asinh'); +require('../modules/es6.math.atanh'); +require('../modules/es6.math.cbrt'); +require('../modules/es6.math.clz32'); +require('../modules/es6.math.cosh'); +require('../modules/es6.math.expm1'); +require('../modules/es6.math.fround'); +require('../modules/es6.math.hypot'); +require('../modules/es6.math.imul'); +require('../modules/es6.math.log10'); +require('../modules/es6.math.log1p'); +require('../modules/es6.math.log2'); +require('../modules/es6.math.sign'); +require('../modules/es6.math.sinh'); +require('../modules/es6.math.tanh'); +require('../modules/es6.math.trunc'); +require('../modules/es6.string.from-code-point'); +require('../modules/es6.string.raw'); +require('../modules/es6.string.trim'); +require('../modules/es6.string.iterator'); +require('../modules/es6.string.code-point-at'); +require('../modules/es6.string.ends-with'); +require('../modules/es6.string.includes'); +require('../modules/es6.string.repeat'); +require('../modules/es6.string.starts-with'); +require('../modules/es6.string.anchor'); +require('../modules/es6.string.big'); +require('../modules/es6.string.blink'); +require('../modules/es6.string.bold'); +require('../modules/es6.string.fixed'); +require('../modules/es6.string.fontcolor'); +require('../modules/es6.string.fontsize'); +require('../modules/es6.string.italics'); +require('../modules/es6.string.link'); +require('../modules/es6.string.small'); +require('../modules/es6.string.strike'); +require('../modules/es6.string.sub'); +require('../modules/es6.string.sup'); +require('../modules/es6.date.now'); +require('../modules/es6.date.to-json'); +require('../modules/es6.date.to-iso-string'); +require('../modules/es6.date.to-string'); +require('../modules/es6.date.to-primitive'); +require('../modules/es6.array.is-array'); +require('../modules/es6.array.from'); +require('../modules/es6.array.of'); +require('../modules/es6.array.join'); +require('../modules/es6.array.slice'); +require('../modules/es6.array.sort'); +require('../modules/es6.array.for-each'); +require('../modules/es6.array.map'); +require('../modules/es6.array.filter'); +require('../modules/es6.array.some'); +require('../modules/es6.array.every'); +require('../modules/es6.array.reduce'); +require('../modules/es6.array.reduce-right'); +require('../modules/es6.array.index-of'); +require('../modules/es6.array.last-index-of'); +require('../modules/es6.array.copy-within'); +require('../modules/es6.array.fill'); +require('../modules/es6.array.find'); +require('../modules/es6.array.find-index'); +require('../modules/es6.array.species'); +require('../modules/es6.array.iterator'); +require('../modules/es6.regexp.constructor'); +require('../modules/es6.regexp.to-string'); +require('../modules/es6.regexp.flags'); +require('../modules/es6.regexp.match'); +require('../modules/es6.regexp.replace'); +require('../modules/es6.regexp.search'); +require('../modules/es6.regexp.split'); +require('../modules/es6.promise'); +require('../modules/es6.map'); +require('../modules/es6.set'); +require('../modules/es6.weak-map'); +require('../modules/es6.weak-set'); +require('../modules/es6.typed.array-buffer'); +require('../modules/es6.typed.data-view'); +require('../modules/es6.typed.int8-array'); +require('../modules/es6.typed.uint8-array'); +require('../modules/es6.typed.uint8-clamped-array'); +require('../modules/es6.typed.int16-array'); +require('../modules/es6.typed.uint16-array'); +require('../modules/es6.typed.int32-array'); +require('../modules/es6.typed.uint32-array'); +require('../modules/es6.typed.float32-array'); +require('../modules/es6.typed.float64-array'); +require('../modules/es6.reflect.apply'); +require('../modules/es6.reflect.construct'); +require('../modules/es6.reflect.define-property'); +require('../modules/es6.reflect.delete-property'); +require('../modules/es6.reflect.enumerate'); +require('../modules/es6.reflect.get'); +require('../modules/es6.reflect.get-own-property-descriptor'); +require('../modules/es6.reflect.get-prototype-of'); +require('../modules/es6.reflect.has'); +require('../modules/es6.reflect.is-extensible'); +require('../modules/es6.reflect.own-keys'); +require('../modules/es6.reflect.prevent-extensions'); +require('../modules/es6.reflect.set'); +require('../modules/es6.reflect.set-prototype-of'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/es6/map.js b/node_modules/core-js/library/es6/map.js new file mode 100755 index 00000000..50f04c1f --- /dev/null +++ b/node_modules/core-js/library/es6/map.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.map'); +module.exports = require('../modules/_core').Map; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/math.js b/node_modules/core-js/library/es6/math.js new file mode 100755 index 00000000..f26b5b29 --- /dev/null +++ b/node_modules/core-js/library/es6/math.js @@ -0,0 +1,18 @@ +require('../modules/es6.math.acosh'); +require('../modules/es6.math.asinh'); +require('../modules/es6.math.atanh'); +require('../modules/es6.math.cbrt'); +require('../modules/es6.math.clz32'); +require('../modules/es6.math.cosh'); +require('../modules/es6.math.expm1'); +require('../modules/es6.math.fround'); +require('../modules/es6.math.hypot'); +require('../modules/es6.math.imul'); +require('../modules/es6.math.log10'); +require('../modules/es6.math.log1p'); +require('../modules/es6.math.log2'); +require('../modules/es6.math.sign'); +require('../modules/es6.math.sinh'); +require('../modules/es6.math.tanh'); +require('../modules/es6.math.trunc'); +module.exports = require('../modules/_core').Math; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/number.js b/node_modules/core-js/library/es6/number.js new file mode 100755 index 00000000..1dafcda4 --- /dev/null +++ b/node_modules/core-js/library/es6/number.js @@ -0,0 +1,13 @@ +require('../modules/es6.number.constructor'); +require('../modules/es6.number.to-fixed'); +require('../modules/es6.number.to-precision'); +require('../modules/es6.number.epsilon'); +require('../modules/es6.number.is-finite'); +require('../modules/es6.number.is-integer'); +require('../modules/es6.number.is-nan'); +require('../modules/es6.number.is-safe-integer'); +require('../modules/es6.number.max-safe-integer'); +require('../modules/es6.number.min-safe-integer'); +require('../modules/es6.number.parse-float'); +require('../modules/es6.number.parse-int'); +module.exports = require('../modules/_core').Number; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/object.js b/node_modules/core-js/library/es6/object.js new file mode 100755 index 00000000..aada8c38 --- /dev/null +++ b/node_modules/core-js/library/es6/object.js @@ -0,0 +1,20 @@ +require('../modules/es6.symbol'); +require('../modules/es6.object.create'); +require('../modules/es6.object.define-property'); +require('../modules/es6.object.define-properties'); +require('../modules/es6.object.get-own-property-descriptor'); +require('../modules/es6.object.get-prototype-of'); +require('../modules/es6.object.keys'); +require('../modules/es6.object.get-own-property-names'); +require('../modules/es6.object.freeze'); +require('../modules/es6.object.seal'); +require('../modules/es6.object.prevent-extensions'); +require('../modules/es6.object.is-frozen'); +require('../modules/es6.object.is-sealed'); +require('../modules/es6.object.is-extensible'); +require('../modules/es6.object.assign'); +require('../modules/es6.object.is'); +require('../modules/es6.object.set-prototype-of'); +require('../modules/es6.object.to-string'); + +module.exports = require('../modules/_core').Object; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/parse-float.js b/node_modules/core-js/library/es6/parse-float.js new file mode 100755 index 00000000..dad94ddb --- /dev/null +++ b/node_modules/core-js/library/es6/parse-float.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-float'); +module.exports = require('../modules/_core').parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/parse-int.js b/node_modules/core-js/library/es6/parse-int.js new file mode 100755 index 00000000..08a20996 --- /dev/null +++ b/node_modules/core-js/library/es6/parse-int.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-int'); +module.exports = require('../modules/_core').parseInt; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/promise.js b/node_modules/core-js/library/es6/promise.js new file mode 100755 index 00000000..c901c859 --- /dev/null +++ b/node_modules/core-js/library/es6/promise.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +module.exports = require('../modules/_core').Promise; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/reflect.js b/node_modules/core-js/library/es6/reflect.js new file mode 100755 index 00000000..18bdb3c2 --- /dev/null +++ b/node_modules/core-js/library/es6/reflect.js @@ -0,0 +1,15 @@ +require('../modules/es6.reflect.apply'); +require('../modules/es6.reflect.construct'); +require('../modules/es6.reflect.define-property'); +require('../modules/es6.reflect.delete-property'); +require('../modules/es6.reflect.enumerate'); +require('../modules/es6.reflect.get'); +require('../modules/es6.reflect.get-own-property-descriptor'); +require('../modules/es6.reflect.get-prototype-of'); +require('../modules/es6.reflect.has'); +require('../modules/es6.reflect.is-extensible'); +require('../modules/es6.reflect.own-keys'); +require('../modules/es6.reflect.prevent-extensions'); +require('../modules/es6.reflect.set'); +require('../modules/es6.reflect.set-prototype-of'); +module.exports = require('../modules/_core').Reflect; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/regexp.js b/node_modules/core-js/library/es6/regexp.js new file mode 100755 index 00000000..27cc827f --- /dev/null +++ b/node_modules/core-js/library/es6/regexp.js @@ -0,0 +1,8 @@ +require('../modules/es6.regexp.constructor'); +require('../modules/es6.regexp.to-string'); +require('../modules/es6.regexp.flags'); +require('../modules/es6.regexp.match'); +require('../modules/es6.regexp.replace'); +require('../modules/es6.regexp.search'); +require('../modules/es6.regexp.split'); +module.exports = require('../modules/_core').RegExp; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/set.js b/node_modules/core-js/library/es6/set.js new file mode 100755 index 00000000..2a2557ce --- /dev/null +++ b/node_modules/core-js/library/es6/set.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.set'); +module.exports = require('../modules/_core').Set; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/string.js b/node_modules/core-js/library/es6/string.js new file mode 100755 index 00000000..83033621 --- /dev/null +++ b/node_modules/core-js/library/es6/string.js @@ -0,0 +1,27 @@ +require('../modules/es6.string.from-code-point'); +require('../modules/es6.string.raw'); +require('../modules/es6.string.trim'); +require('../modules/es6.string.iterator'); +require('../modules/es6.string.code-point-at'); +require('../modules/es6.string.ends-with'); +require('../modules/es6.string.includes'); +require('../modules/es6.string.repeat'); +require('../modules/es6.string.starts-with'); +require('../modules/es6.string.anchor'); +require('../modules/es6.string.big'); +require('../modules/es6.string.blink'); +require('../modules/es6.string.bold'); +require('../modules/es6.string.fixed'); +require('../modules/es6.string.fontcolor'); +require('../modules/es6.string.fontsize'); +require('../modules/es6.string.italics'); +require('../modules/es6.string.link'); +require('../modules/es6.string.small'); +require('../modules/es6.string.strike'); +require('../modules/es6.string.sub'); +require('../modules/es6.string.sup'); +require('../modules/es6.regexp.match'); +require('../modules/es6.regexp.replace'); +require('../modules/es6.regexp.search'); +require('../modules/es6.regexp.split'); +module.exports = require('../modules/_core').String; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/symbol.js b/node_modules/core-js/library/es6/symbol.js new file mode 100755 index 00000000..e578e3af --- /dev/null +++ b/node_modules/core-js/library/es6/symbol.js @@ -0,0 +1,3 @@ +require('../modules/es6.symbol'); +require('../modules/es6.object.to-string'); +module.exports = require('../modules/_core').Symbol; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/typed.js b/node_modules/core-js/library/es6/typed.js new file mode 100755 index 00000000..e0364e6c --- /dev/null +++ b/node_modules/core-js/library/es6/typed.js @@ -0,0 +1,13 @@ +require('../modules/es6.typed.array-buffer'); +require('../modules/es6.typed.data-view'); +require('../modules/es6.typed.int8-array'); +require('../modules/es6.typed.uint8-array'); +require('../modules/es6.typed.uint8-clamped-array'); +require('../modules/es6.typed.int16-array'); +require('../modules/es6.typed.uint16-array'); +require('../modules/es6.typed.int32-array'); +require('../modules/es6.typed.uint32-array'); +require('../modules/es6.typed.float32-array'); +require('../modules/es6.typed.float64-array'); +require('../modules/es6.object.to-string'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/es6/weak-map.js b/node_modules/core-js/library/es6/weak-map.js new file mode 100755 index 00000000..655866c2 --- /dev/null +++ b/node_modules/core-js/library/es6/weak-map.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.array.iterator'); +require('../modules/es6.weak-map'); +module.exports = require('../modules/_core').WeakMap; \ No newline at end of file diff --git a/node_modules/core-js/library/es6/weak-set.js b/node_modules/core-js/library/es6/weak-set.js new file mode 100755 index 00000000..eef1af2a --- /dev/null +++ b/node_modules/core-js/library/es6/weak-set.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/web.dom.iterable'); +require('../modules/es6.weak-set'); +module.exports = require('../modules/_core').WeakSet; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/array.js b/node_modules/core-js/library/es7/array.js new file mode 100755 index 00000000..9fb57fa6 --- /dev/null +++ b/node_modules/core-js/library/es7/array.js @@ -0,0 +1,2 @@ +require('../modules/es7.array.includes'); +module.exports = require('../modules/_core').Array; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/asap.js b/node_modules/core-js/library/es7/asap.js new file mode 100755 index 00000000..cc90f7e5 --- /dev/null +++ b/node_modules/core-js/library/es7/asap.js @@ -0,0 +1,2 @@ +require('../modules/es7.asap'); +module.exports = require('../modules/_core').asap; diff --git a/node_modules/core-js/library/es7/error.js b/node_modules/core-js/library/es7/error.js new file mode 100755 index 00000000..f0bb260b --- /dev/null +++ b/node_modules/core-js/library/es7/error.js @@ -0,0 +1,2 @@ +require('../modules/es7.error.is-error'); +module.exports = require('../modules/_core').Error; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/index.js b/node_modules/core-js/library/es7/index.js new file mode 100755 index 00000000..b8c90b86 --- /dev/null +++ b/node_modules/core-js/library/es7/index.js @@ -0,0 +1,36 @@ +require('../modules/es7.array.includes'); +require('../modules/es7.string.at'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.string.match-all'); +require('../modules/es7.symbol.async-iterator'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +require('../modules/es7.map.to-json'); +require('../modules/es7.set.to-json'); +require('../modules/es7.system.global'); +require('../modules/es7.error.is-error'); +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +require('../modules/es7.asap'); +require('../modules/es7.observable'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/es7/map.js b/node_modules/core-js/library/es7/map.js new file mode 100755 index 00000000..dfa32fd2 --- /dev/null +++ b/node_modules/core-js/library/es7/map.js @@ -0,0 +1,2 @@ +require('../modules/es7.map.to-json'); +module.exports = require('../modules/_core').Map; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/math.js b/node_modules/core-js/library/es7/math.js new file mode 100755 index 00000000..bdb8a81c --- /dev/null +++ b/node_modules/core-js/library/es7/math.js @@ -0,0 +1,5 @@ +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +module.exports = require('../modules/_core').Math; diff --git a/node_modules/core-js/library/es7/object.js b/node_modules/core-js/library/es7/object.js new file mode 100755 index 00000000..c76b754d --- /dev/null +++ b/node_modules/core-js/library/es7/object.js @@ -0,0 +1,8 @@ +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +module.exports = require('../modules/_core').Object; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/observable.js b/node_modules/core-js/library/es7/observable.js new file mode 100755 index 00000000..05ca51a3 --- /dev/null +++ b/node_modules/core-js/library/es7/observable.js @@ -0,0 +1,7 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +module.exports = require('../modules/_core').Observable; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/reflect.js b/node_modules/core-js/library/es7/reflect.js new file mode 100755 index 00000000..f0b69cbb --- /dev/null +++ b/node_modules/core-js/library/es7/reflect.js @@ -0,0 +1,10 @@ +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +module.exports = require('../modules/_core').Reflect; diff --git a/node_modules/core-js/library/es7/set.js b/node_modules/core-js/library/es7/set.js new file mode 100755 index 00000000..b5c19c44 --- /dev/null +++ b/node_modules/core-js/library/es7/set.js @@ -0,0 +1,2 @@ +require('../modules/es7.set.to-json'); +module.exports = require('../modules/_core').Set; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/string.js b/node_modules/core-js/library/es7/string.js new file mode 100755 index 00000000..6e413b4c --- /dev/null +++ b/node_modules/core-js/library/es7/string.js @@ -0,0 +1,7 @@ +require('../modules/es7.string.at'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.string.match-all'); +module.exports = require('../modules/_core').String; diff --git a/node_modules/core-js/library/es7/symbol.js b/node_modules/core-js/library/es7/symbol.js new file mode 100755 index 00000000..14d90eec --- /dev/null +++ b/node_modules/core-js/library/es7/symbol.js @@ -0,0 +1,3 @@ +require('../modules/es7.symbol.async-iterator'); +require('../modules/es7.symbol.observable'); +module.exports = require('../modules/_core').Symbol; \ No newline at end of file diff --git a/node_modules/core-js/library/es7/system.js b/node_modules/core-js/library/es7/system.js new file mode 100755 index 00000000..6d321c78 --- /dev/null +++ b/node_modules/core-js/library/es7/system.js @@ -0,0 +1,2 @@ +require('../modules/es7.system.global'); +module.exports = require('../modules/_core').System; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/_.js b/node_modules/core-js/library/fn/_.js new file mode 100755 index 00000000..8a99f706 --- /dev/null +++ b/node_modules/core-js/library/fn/_.js @@ -0,0 +1,2 @@ +require('../modules/core.function.part'); +module.exports = require('../modules/_core')._; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/concat.js b/node_modules/core-js/library/fn/array/concat.js new file mode 100755 index 00000000..de4bddf9 --- /dev/null +++ b/node_modules/core-js/library/fn/array/concat.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.concat, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/copy-within.js b/node_modules/core-js/library/fn/array/copy-within.js new file mode 100755 index 00000000..89e1de4f --- /dev/null +++ b/node_modules/core-js/library/fn/array/copy-within.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.copy-within'); +module.exports = require('../../modules/_core').Array.copyWithin; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/entries.js b/node_modules/core-js/library/fn/array/entries.js new file mode 100755 index 00000000..f4feb26c --- /dev/null +++ b/node_modules/core-js/library/fn/array/entries.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.entries; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/every.js b/node_modules/core-js/library/fn/array/every.js new file mode 100755 index 00000000..168844cc --- /dev/null +++ b/node_modules/core-js/library/fn/array/every.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.every'); +module.exports = require('../../modules/_core').Array.every; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/fill.js b/node_modules/core-js/library/fn/array/fill.js new file mode 100755 index 00000000..b23ebfde --- /dev/null +++ b/node_modules/core-js/library/fn/array/fill.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.fill'); +module.exports = require('../../modules/_core').Array.fill; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/filter.js b/node_modules/core-js/library/fn/array/filter.js new file mode 100755 index 00000000..0023f0de --- /dev/null +++ b/node_modules/core-js/library/fn/array/filter.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.filter'); +module.exports = require('../../modules/_core').Array.filter; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/find-index.js b/node_modules/core-js/library/fn/array/find-index.js new file mode 100755 index 00000000..99e6bf17 --- /dev/null +++ b/node_modules/core-js/library/fn/array/find-index.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.find-index'); +module.exports = require('../../modules/_core').Array.findIndex; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/find.js b/node_modules/core-js/library/fn/array/find.js new file mode 100755 index 00000000..f146ec22 --- /dev/null +++ b/node_modules/core-js/library/fn/array/find.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.find'); +module.exports = require('../../modules/_core').Array.find; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/for-each.js b/node_modules/core-js/library/fn/array/for-each.js new file mode 100755 index 00000000..09e235f9 --- /dev/null +++ b/node_modules/core-js/library/fn/array/for-each.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.for-each'); +module.exports = require('../../modules/_core').Array.forEach; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/from.js b/node_modules/core-js/library/fn/array/from.js new file mode 100755 index 00000000..1f323fbc --- /dev/null +++ b/node_modules/core-js/library/fn/array/from.js @@ -0,0 +1,3 @@ +require('../../modules/es6.string.iterator'); +require('../../modules/es6.array.from'); +module.exports = require('../../modules/_core').Array.from; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/includes.js b/node_modules/core-js/library/fn/array/includes.js new file mode 100755 index 00000000..851d31fd --- /dev/null +++ b/node_modules/core-js/library/fn/array/includes.js @@ -0,0 +1,2 @@ +require('../../modules/es7.array.includes'); +module.exports = require('../../modules/_core').Array.includes; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/index-of.js b/node_modules/core-js/library/fn/array/index-of.js new file mode 100755 index 00000000..9ed82472 --- /dev/null +++ b/node_modules/core-js/library/fn/array/index-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.index-of'); +module.exports = require('../../modules/_core').Array.indexOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/index.js b/node_modules/core-js/library/fn/array/index.js new file mode 100755 index 00000000..85bc77bc --- /dev/null +++ b/node_modules/core-js/library/fn/array/index.js @@ -0,0 +1,24 @@ +require('../../modules/es6.string.iterator'); +require('../../modules/es6.array.is-array'); +require('../../modules/es6.array.from'); +require('../../modules/es6.array.of'); +require('../../modules/es6.array.join'); +require('../../modules/es6.array.slice'); +require('../../modules/es6.array.sort'); +require('../../modules/es6.array.for-each'); +require('../../modules/es6.array.map'); +require('../../modules/es6.array.filter'); +require('../../modules/es6.array.some'); +require('../../modules/es6.array.every'); +require('../../modules/es6.array.reduce'); +require('../../modules/es6.array.reduce-right'); +require('../../modules/es6.array.index-of'); +require('../../modules/es6.array.last-index-of'); +require('../../modules/es6.array.copy-within'); +require('../../modules/es6.array.fill'); +require('../../modules/es6.array.find'); +require('../../modules/es6.array.find-index'); +require('../../modules/es6.array.species'); +require('../../modules/es6.array.iterator'); +require('../../modules/es7.array.includes'); +module.exports = require('../../modules/_core').Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/is-array.js b/node_modules/core-js/library/fn/array/is-array.js new file mode 100755 index 00000000..bbe76719 --- /dev/null +++ b/node_modules/core-js/library/fn/array/is-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.is-array'); +module.exports = require('../../modules/_core').Array.isArray; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/iterator.js b/node_modules/core-js/library/fn/array/iterator.js new file mode 100755 index 00000000..ca93b78a --- /dev/null +++ b/node_modules/core-js/library/fn/array/iterator.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.values; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/join.js b/node_modules/core-js/library/fn/array/join.js new file mode 100755 index 00000000..9beef18d --- /dev/null +++ b/node_modules/core-js/library/fn/array/join.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.join'); +module.exports = require('../../modules/_core').Array.join; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/keys.js b/node_modules/core-js/library/fn/array/keys.js new file mode 100755 index 00000000..b44b921f --- /dev/null +++ b/node_modules/core-js/library/fn/array/keys.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.keys; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/last-index-of.js b/node_modules/core-js/library/fn/array/last-index-of.js new file mode 100755 index 00000000..6dcc98a1 --- /dev/null +++ b/node_modules/core-js/library/fn/array/last-index-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.last-index-of'); +module.exports = require('../../modules/_core').Array.lastIndexOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/map.js b/node_modules/core-js/library/fn/array/map.js new file mode 100755 index 00000000..14b0f627 --- /dev/null +++ b/node_modules/core-js/library/fn/array/map.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.map'); +module.exports = require('../../modules/_core').Array.map; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/of.js b/node_modules/core-js/library/fn/array/of.js new file mode 100755 index 00000000..652ee980 --- /dev/null +++ b/node_modules/core-js/library/fn/array/of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.of'); +module.exports = require('../../modules/_core').Array.of; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/pop.js b/node_modules/core-js/library/fn/array/pop.js new file mode 100755 index 00000000..b8414f61 --- /dev/null +++ b/node_modules/core-js/library/fn/array/pop.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.pop, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/push.js b/node_modules/core-js/library/fn/array/push.js new file mode 100755 index 00000000..03539009 --- /dev/null +++ b/node_modules/core-js/library/fn/array/push.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.push, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/reduce-right.js b/node_modules/core-js/library/fn/array/reduce-right.js new file mode 100755 index 00000000..1193ecba --- /dev/null +++ b/node_modules/core-js/library/fn/array/reduce-right.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.reduce-right'); +module.exports = require('../../modules/_core').Array.reduceRight; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/reduce.js b/node_modules/core-js/library/fn/array/reduce.js new file mode 100755 index 00000000..e2dee913 --- /dev/null +++ b/node_modules/core-js/library/fn/array/reduce.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.reduce'); +module.exports = require('../../modules/_core').Array.reduce; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/reverse.js b/node_modules/core-js/library/fn/array/reverse.js new file mode 100755 index 00000000..60734293 --- /dev/null +++ b/node_modules/core-js/library/fn/array/reverse.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.reverse, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/shift.js b/node_modules/core-js/library/fn/array/shift.js new file mode 100755 index 00000000..5002a606 --- /dev/null +++ b/node_modules/core-js/library/fn/array/shift.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.shift, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/slice.js b/node_modules/core-js/library/fn/array/slice.js new file mode 100755 index 00000000..4914c2a9 --- /dev/null +++ b/node_modules/core-js/library/fn/array/slice.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.slice'); +module.exports = require('../../modules/_core').Array.slice; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/some.js b/node_modules/core-js/library/fn/array/some.js new file mode 100755 index 00000000..de284006 --- /dev/null +++ b/node_modules/core-js/library/fn/array/some.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.some'); +module.exports = require('../../modules/_core').Array.some; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/sort.js b/node_modules/core-js/library/fn/array/sort.js new file mode 100755 index 00000000..29b6f3ae --- /dev/null +++ b/node_modules/core-js/library/fn/array/sort.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.sort'); +module.exports = require('../../modules/_core').Array.sort; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/splice.js b/node_modules/core-js/library/fn/array/splice.js new file mode 100755 index 00000000..9d0bdbed --- /dev/null +++ b/node_modules/core-js/library/fn/array/splice.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.splice, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/unshift.js b/node_modules/core-js/library/fn/array/unshift.js new file mode 100755 index 00000000..63fe2dd8 --- /dev/null +++ b/node_modules/core-js/library/fn/array/unshift.js @@ -0,0 +1,4 @@ +// for a legacy code and future fixes +module.exports = function(){ + return Function.call.apply(Array.prototype.unshift, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/values.js b/node_modules/core-js/library/fn/array/values.js new file mode 100755 index 00000000..ca93b78a --- /dev/null +++ b/node_modules/core-js/library/fn/array/values.js @@ -0,0 +1,2 @@ +require('../../modules/es6.array.iterator'); +module.exports = require('../../modules/_core').Array.values; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/copy-within.js b/node_modules/core-js/library/fn/array/virtual/copy-within.js new file mode 100755 index 00000000..62172a9e --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/copy-within.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.copy-within'); +module.exports = require('../../../modules/_entry-virtual')('Array').copyWithin; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/entries.js b/node_modules/core-js/library/fn/array/virtual/entries.js new file mode 100755 index 00000000..1b198e3c --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/entries.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.iterator'); +module.exports = require('../../../modules/_entry-virtual')('Array').entries; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/every.js b/node_modules/core-js/library/fn/array/virtual/every.js new file mode 100755 index 00000000..a72e5851 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/every.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.every'); +module.exports = require('../../../modules/_entry-virtual')('Array').every; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/fill.js b/node_modules/core-js/library/fn/array/virtual/fill.js new file mode 100755 index 00000000..6018b37b --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/fill.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.fill'); +module.exports = require('../../../modules/_entry-virtual')('Array').fill; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/filter.js b/node_modules/core-js/library/fn/array/virtual/filter.js new file mode 100755 index 00000000..46a14f1c --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/filter.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.filter'); +module.exports = require('../../../modules/_entry-virtual')('Array').filter; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/find-index.js b/node_modules/core-js/library/fn/array/virtual/find-index.js new file mode 100755 index 00000000..ef96165f --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/find-index.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.find-index'); +module.exports = require('../../../modules/_entry-virtual')('Array').findIndex; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/find.js b/node_modules/core-js/library/fn/array/virtual/find.js new file mode 100755 index 00000000..6cffee5b --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/find.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.find'); +module.exports = require('../../../modules/_entry-virtual')('Array').find; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/for-each.js b/node_modules/core-js/library/fn/array/virtual/for-each.js new file mode 100755 index 00000000..0c3ed449 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/for-each.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.for-each'); +module.exports = require('../../../modules/_entry-virtual')('Array').forEach; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/includes.js b/node_modules/core-js/library/fn/array/virtual/includes.js new file mode 100755 index 00000000..bf9031d7 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/includes.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.array.includes'); +module.exports = require('../../../modules/_entry-virtual')('Array').includes; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/index-of.js b/node_modules/core-js/library/fn/array/virtual/index-of.js new file mode 100755 index 00000000..cf6f36e3 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/index-of.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.index-of'); +module.exports = require('../../../modules/_entry-virtual')('Array').indexOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/index.js b/node_modules/core-js/library/fn/array/virtual/index.js new file mode 100755 index 00000000..ff554a2a --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/index.js @@ -0,0 +1,20 @@ +require('../../../modules/es6.array.join'); +require('../../../modules/es6.array.slice'); +require('../../../modules/es6.array.sort'); +require('../../../modules/es6.array.for-each'); +require('../../../modules/es6.array.map'); +require('../../../modules/es6.array.filter'); +require('../../../modules/es6.array.some'); +require('../../../modules/es6.array.every'); +require('../../../modules/es6.array.reduce'); +require('../../../modules/es6.array.reduce-right'); +require('../../../modules/es6.array.index-of'); +require('../../../modules/es6.array.last-index-of'); +require('../../../modules/es6.string.iterator'); +require('../../../modules/es6.array.iterator'); +require('../../../modules/es6.array.copy-within'); +require('../../../modules/es6.array.fill'); +require('../../../modules/es6.array.find'); +require('../../../modules/es6.array.find-index'); +require('../../../modules/es7.array.includes'); +module.exports = require('../../../modules/_entry-virtual')('Array'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/iterator.js b/node_modules/core-js/library/fn/array/virtual/iterator.js new file mode 100755 index 00000000..7812b3c9 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/iterator.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/join.js b/node_modules/core-js/library/fn/array/virtual/join.js new file mode 100755 index 00000000..3f7d5cff --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/join.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.join'); +module.exports = require('../../../modules/_entry-virtual')('Array').join; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/keys.js b/node_modules/core-js/library/fn/array/virtual/keys.js new file mode 100755 index 00000000..16c09681 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/keys.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.iterator'); +module.exports = require('../../../modules/_entry-virtual')('Array').keys; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/last-index-of.js b/node_modules/core-js/library/fn/array/virtual/last-index-of.js new file mode 100755 index 00000000..cdd79b7d --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/last-index-of.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.last-index-of'); +module.exports = require('../../../modules/_entry-virtual')('Array').lastIndexOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/map.js b/node_modules/core-js/library/fn/array/virtual/map.js new file mode 100755 index 00000000..14bffdac --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/map.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.map'); +module.exports = require('../../../modules/_entry-virtual')('Array').map; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/reduce-right.js b/node_modules/core-js/library/fn/array/virtual/reduce-right.js new file mode 100755 index 00000000..61313e8f --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/reduce-right.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.reduce-right'); +module.exports = require('../../../modules/_entry-virtual')('Array').reduceRight; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/reduce.js b/node_modules/core-js/library/fn/array/virtual/reduce.js new file mode 100755 index 00000000..1b059053 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/reduce.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.reduce'); +module.exports = require('../../../modules/_entry-virtual')('Array').reduce; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/slice.js b/node_modules/core-js/library/fn/array/virtual/slice.js new file mode 100755 index 00000000..b28d1abc --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/slice.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.slice'); +module.exports = require('../../../modules/_entry-virtual')('Array').slice; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/some.js b/node_modules/core-js/library/fn/array/virtual/some.js new file mode 100755 index 00000000..58c183c5 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/some.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.some'); +module.exports = require('../../../modules/_entry-virtual')('Array').some; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/sort.js b/node_modules/core-js/library/fn/array/virtual/sort.js new file mode 100755 index 00000000..c8883150 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/sort.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.array.sort'); +module.exports = require('../../../modules/_entry-virtual')('Array').sort; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/array/virtual/values.js b/node_modules/core-js/library/fn/array/virtual/values.js new file mode 100755 index 00000000..7812b3c9 --- /dev/null +++ b/node_modules/core-js/library/fn/array/virtual/values.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/asap.js b/node_modules/core-js/library/fn/asap.js new file mode 100755 index 00000000..9d9c80d1 --- /dev/null +++ b/node_modules/core-js/library/fn/asap.js @@ -0,0 +1,2 @@ +require('../modules/es7.asap'); +module.exports = require('../modules/_core').asap; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/clear-immediate.js b/node_modules/core-js/library/fn/clear-immediate.js new file mode 100755 index 00000000..86916a06 --- /dev/null +++ b/node_modules/core-js/library/fn/clear-immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core').clearImmediate; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/date/index.js b/node_modules/core-js/library/fn/date/index.js new file mode 100755 index 00000000..bd9ce0e2 --- /dev/null +++ b/node_modules/core-js/library/fn/date/index.js @@ -0,0 +1,6 @@ +require('../../modules/es6.date.now'); +require('../../modules/es6.date.to-json'); +require('../../modules/es6.date.to-iso-string'); +require('../../modules/es6.date.to-string'); +require('../../modules/es6.date.to-primitive'); +module.exports = require('../../modules/_core').Date; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/date/now.js b/node_modules/core-js/library/fn/date/now.js new file mode 100755 index 00000000..c70d37ae --- /dev/null +++ b/node_modules/core-js/library/fn/date/now.js @@ -0,0 +1,2 @@ +require('../../modules/es6.date.now'); +module.exports = require('../../modules/_core').Date.now; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/date/to-iso-string.js b/node_modules/core-js/library/fn/date/to-iso-string.js new file mode 100755 index 00000000..be4ac218 --- /dev/null +++ b/node_modules/core-js/library/fn/date/to-iso-string.js @@ -0,0 +1,3 @@ +require('../../modules/es6.date.to-json'); +require('../../modules/es6.date.to-iso-string'); +module.exports = require('../../modules/_core').Date.toISOString; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/date/to-json.js b/node_modules/core-js/library/fn/date/to-json.js new file mode 100755 index 00000000..9dc8cc90 --- /dev/null +++ b/node_modules/core-js/library/fn/date/to-json.js @@ -0,0 +1,2 @@ +require('../../modules/es6.date.to-json'); +module.exports = require('../../modules/_core').Date.toJSON; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/date/to-primitive.js b/node_modules/core-js/library/fn/date/to-primitive.js new file mode 100755 index 00000000..4d7471e2 --- /dev/null +++ b/node_modules/core-js/library/fn/date/to-primitive.js @@ -0,0 +1,5 @@ +require('../../modules/es6.date.to-primitive'); +var toPrimitive = require('../../modules/_date-to-primitive'); +module.exports = function(it, hint){ + return toPrimitive.call(it, hint); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/date/to-string.js b/node_modules/core-js/library/fn/date/to-string.js new file mode 100755 index 00000000..c39d5522 --- /dev/null +++ b/node_modules/core-js/library/fn/date/to-string.js @@ -0,0 +1,5 @@ +require('../../modules/es6.date.to-string') +var $toString = Date.prototype.toString; +module.exports = function toString(it){ + return $toString.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/delay.js b/node_modules/core-js/library/fn/delay.js new file mode 100755 index 00000000..18857388 --- /dev/null +++ b/node_modules/core-js/library/fn/delay.js @@ -0,0 +1,2 @@ +require('../modules/core.delay'); +module.exports = require('../modules/_core').delay; diff --git a/node_modules/core-js/library/fn/dict.js b/node_modules/core-js/library/fn/dict.js new file mode 100755 index 00000000..da84a8d8 --- /dev/null +++ b/node_modules/core-js/library/fn/dict.js @@ -0,0 +1,2 @@ +require('../modules/core.dict'); +module.exports = require('../modules/_core').Dict; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/dom-collections/index.js b/node_modules/core-js/library/fn/dom-collections/index.js new file mode 100755 index 00000000..3928a09f --- /dev/null +++ b/node_modules/core-js/library/fn/dom-collections/index.js @@ -0,0 +1,8 @@ +require('../../modules/web.dom.iterable'); +var $iterators = require('../../modules/es6.array.iterator'); +module.exports = { + keys: $iterators.keys, + values: $iterators.values, + entries: $iterators.entries, + iterator: $iterators.values +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/dom-collections/iterator.js b/node_modules/core-js/library/fn/dom-collections/iterator.js new file mode 100755 index 00000000..ad983645 --- /dev/null +++ b/node_modules/core-js/library/fn/dom-collections/iterator.js @@ -0,0 +1,2 @@ +require('../../modules/web.dom.iterable'); +module.exports = require('../../modules/_core').Array.values; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/error/index.js b/node_modules/core-js/library/fn/error/index.js new file mode 100755 index 00000000..59571ac2 --- /dev/null +++ b/node_modules/core-js/library/fn/error/index.js @@ -0,0 +1,2 @@ +require('../../modules/es7.error.is-error'); +module.exports = require('../../modules/_core').Error; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/error/is-error.js b/node_modules/core-js/library/fn/error/is-error.js new file mode 100755 index 00000000..e15b7201 --- /dev/null +++ b/node_modules/core-js/library/fn/error/is-error.js @@ -0,0 +1,2 @@ +require('../../modules/es7.error.is-error'); +module.exports = require('../../modules/_core').Error.isError; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/function/bind.js b/node_modules/core-js/library/fn/function/bind.js new file mode 100755 index 00000000..38e179e6 --- /dev/null +++ b/node_modules/core-js/library/fn/function/bind.js @@ -0,0 +1,2 @@ +require('../../modules/es6.function.bind'); +module.exports = require('../../modules/_core').Function.bind; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/function/has-instance.js b/node_modules/core-js/library/fn/function/has-instance.js new file mode 100755 index 00000000..78397e5f --- /dev/null +++ b/node_modules/core-js/library/fn/function/has-instance.js @@ -0,0 +1,2 @@ +require('../../modules/es6.function.has-instance'); +module.exports = Function[require('../../modules/_wks')('hasInstance')]; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/function/index.js b/node_modules/core-js/library/fn/function/index.js new file mode 100755 index 00000000..206324e8 --- /dev/null +++ b/node_modules/core-js/library/fn/function/index.js @@ -0,0 +1,5 @@ +require('../../modules/es6.function.bind'); +require('../../modules/es6.function.name'); +require('../../modules/es6.function.has-instance'); +require('../../modules/core.function.part'); +module.exports = require('../../modules/_core').Function; diff --git a/node_modules/core-js/library/fn/function/name.js b/node_modules/core-js/library/fn/function/name.js new file mode 100755 index 00000000..cb70bf15 --- /dev/null +++ b/node_modules/core-js/library/fn/function/name.js @@ -0,0 +1 @@ +require('../../modules/es6.function.name'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/function/part.js b/node_modules/core-js/library/fn/function/part.js new file mode 100755 index 00000000..926e2cc2 --- /dev/null +++ b/node_modules/core-js/library/fn/function/part.js @@ -0,0 +1,2 @@ +require('../../modules/core.function.part'); +module.exports = require('../../modules/_core').Function.part; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/function/virtual/bind.js b/node_modules/core-js/library/fn/function/virtual/bind.js new file mode 100755 index 00000000..0a2f3338 --- /dev/null +++ b/node_modules/core-js/library/fn/function/virtual/bind.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.function.bind'); +module.exports = require('../../../modules/_entry-virtual')('Function').bind; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/function/virtual/index.js b/node_modules/core-js/library/fn/function/virtual/index.js new file mode 100755 index 00000000..f64e2202 --- /dev/null +++ b/node_modules/core-js/library/fn/function/virtual/index.js @@ -0,0 +1,3 @@ +require('../../../modules/es6.function.bind'); +require('../../../modules/core.function.part'); +module.exports = require('../../../modules/_entry-virtual')('Function'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/function/virtual/part.js b/node_modules/core-js/library/fn/function/virtual/part.js new file mode 100755 index 00000000..a382e577 --- /dev/null +++ b/node_modules/core-js/library/fn/function/virtual/part.js @@ -0,0 +1,2 @@ +require('../../../modules/core.function.part'); +module.exports = require('../../../modules/_entry-virtual')('Function').part; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/get-iterator-method.js b/node_modules/core-js/library/fn/get-iterator-method.js new file mode 100755 index 00000000..5543cbbf --- /dev/null +++ b/node_modules/core-js/library/fn/get-iterator-method.js @@ -0,0 +1,3 @@ +require('../modules/web.dom.iterable'); +require('../modules/es6.string.iterator'); +module.exports = require('../modules/core.get-iterator-method'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/get-iterator.js b/node_modules/core-js/library/fn/get-iterator.js new file mode 100755 index 00000000..762350ff --- /dev/null +++ b/node_modules/core-js/library/fn/get-iterator.js @@ -0,0 +1,3 @@ +require('../modules/web.dom.iterable'); +require('../modules/es6.string.iterator'); +module.exports = require('../modules/core.get-iterator'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/is-iterable.js b/node_modules/core-js/library/fn/is-iterable.js new file mode 100755 index 00000000..4c654e87 --- /dev/null +++ b/node_modules/core-js/library/fn/is-iterable.js @@ -0,0 +1,3 @@ +require('../modules/web.dom.iterable'); +require('../modules/es6.string.iterator'); +module.exports = require('../modules/core.is-iterable'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/json/index.js b/node_modules/core-js/library/fn/json/index.js new file mode 100755 index 00000000..a6ec3de9 --- /dev/null +++ b/node_modules/core-js/library/fn/json/index.js @@ -0,0 +1,2 @@ +var core = require('../../modules/_core'); +module.exports = core.JSON || (core.JSON = {stringify: JSON.stringify}); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/json/stringify.js b/node_modules/core-js/library/fn/json/stringify.js new file mode 100755 index 00000000..f0cac86a --- /dev/null +++ b/node_modules/core-js/library/fn/json/stringify.js @@ -0,0 +1,5 @@ +var core = require('../../modules/_core') + , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify}); +module.exports = function stringify(it){ // eslint-disable-line no-unused-vars + return $JSON.stringify.apply($JSON, arguments); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/map.js b/node_modules/core-js/library/fn/map.js new file mode 100755 index 00000000..16784c60 --- /dev/null +++ b/node_modules/core-js/library/fn/map.js @@ -0,0 +1,6 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.map'); +require('../modules/es7.map.to-json'); +module.exports = require('../modules/_core').Map; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/acosh.js b/node_modules/core-js/library/fn/math/acosh.js new file mode 100755 index 00000000..9c904c2d --- /dev/null +++ b/node_modules/core-js/library/fn/math/acosh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.acosh'); +module.exports = require('../../modules/_core').Math.acosh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/asinh.js b/node_modules/core-js/library/fn/math/asinh.js new file mode 100755 index 00000000..9e209c9d --- /dev/null +++ b/node_modules/core-js/library/fn/math/asinh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.asinh'); +module.exports = require('../../modules/_core').Math.asinh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/atanh.js b/node_modules/core-js/library/fn/math/atanh.js new file mode 100755 index 00000000..b116296d --- /dev/null +++ b/node_modules/core-js/library/fn/math/atanh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.atanh'); +module.exports = require('../../modules/_core').Math.atanh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/cbrt.js b/node_modules/core-js/library/fn/math/cbrt.js new file mode 100755 index 00000000..6ffec33a --- /dev/null +++ b/node_modules/core-js/library/fn/math/cbrt.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.cbrt'); +module.exports = require('../../modules/_core').Math.cbrt; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/clz32.js b/node_modules/core-js/library/fn/math/clz32.js new file mode 100755 index 00000000..beeaae16 --- /dev/null +++ b/node_modules/core-js/library/fn/math/clz32.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.clz32'); +module.exports = require('../../modules/_core').Math.clz32; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/cosh.js b/node_modules/core-js/library/fn/math/cosh.js new file mode 100755 index 00000000..bf92dc13 --- /dev/null +++ b/node_modules/core-js/library/fn/math/cosh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.cosh'); +module.exports = require('../../modules/_core').Math.cosh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/expm1.js b/node_modules/core-js/library/fn/math/expm1.js new file mode 100755 index 00000000..0b30ebb1 --- /dev/null +++ b/node_modules/core-js/library/fn/math/expm1.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.expm1'); +module.exports = require('../../modules/_core').Math.expm1; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/fround.js b/node_modules/core-js/library/fn/math/fround.js new file mode 100755 index 00000000..c75a2293 --- /dev/null +++ b/node_modules/core-js/library/fn/math/fround.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.fround'); +module.exports = require('../../modules/_core').Math.fround; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/hypot.js b/node_modules/core-js/library/fn/math/hypot.js new file mode 100755 index 00000000..2126285c --- /dev/null +++ b/node_modules/core-js/library/fn/math/hypot.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.hypot'); +module.exports = require('../../modules/_core').Math.hypot; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/iaddh.js b/node_modules/core-js/library/fn/math/iaddh.js new file mode 100755 index 00000000..cae754ee --- /dev/null +++ b/node_modules/core-js/library/fn/math/iaddh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.iaddh'); +module.exports = require('../../modules/_core').Math.iaddh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/imul.js b/node_modules/core-js/library/fn/math/imul.js new file mode 100755 index 00000000..1f5ce161 --- /dev/null +++ b/node_modules/core-js/library/fn/math/imul.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.imul'); +module.exports = require('../../modules/_core').Math.imul; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/imulh.js b/node_modules/core-js/library/fn/math/imulh.js new file mode 100755 index 00000000..3b47bf8c --- /dev/null +++ b/node_modules/core-js/library/fn/math/imulh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.imulh'); +module.exports = require('../../modules/_core').Math.imulh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/index.js b/node_modules/core-js/library/fn/math/index.js new file mode 100755 index 00000000..8a2664b1 --- /dev/null +++ b/node_modules/core-js/library/fn/math/index.js @@ -0,0 +1,22 @@ +require('../../modules/es6.math.acosh'); +require('../../modules/es6.math.asinh'); +require('../../modules/es6.math.atanh'); +require('../../modules/es6.math.cbrt'); +require('../../modules/es6.math.clz32'); +require('../../modules/es6.math.cosh'); +require('../../modules/es6.math.expm1'); +require('../../modules/es6.math.fround'); +require('../../modules/es6.math.hypot'); +require('../../modules/es6.math.imul'); +require('../../modules/es6.math.log10'); +require('../../modules/es6.math.log1p'); +require('../../modules/es6.math.log2'); +require('../../modules/es6.math.sign'); +require('../../modules/es6.math.sinh'); +require('../../modules/es6.math.tanh'); +require('../../modules/es6.math.trunc'); +require('../../modules/es7.math.iaddh'); +require('../../modules/es7.math.isubh'); +require('../../modules/es7.math.imulh'); +require('../../modules/es7.math.umulh'); +module.exports = require('../../modules/_core').Math; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/isubh.js b/node_modules/core-js/library/fn/math/isubh.js new file mode 100755 index 00000000..e120e423 --- /dev/null +++ b/node_modules/core-js/library/fn/math/isubh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.isubh'); +module.exports = require('../../modules/_core').Math.isubh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/log10.js b/node_modules/core-js/library/fn/math/log10.js new file mode 100755 index 00000000..1246e0ae --- /dev/null +++ b/node_modules/core-js/library/fn/math/log10.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.log10'); +module.exports = require('../../modules/_core').Math.log10; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/log1p.js b/node_modules/core-js/library/fn/math/log1p.js new file mode 100755 index 00000000..047b84c0 --- /dev/null +++ b/node_modules/core-js/library/fn/math/log1p.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.log1p'); +module.exports = require('../../modules/_core').Math.log1p; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/log2.js b/node_modules/core-js/library/fn/math/log2.js new file mode 100755 index 00000000..ce3e99c1 --- /dev/null +++ b/node_modules/core-js/library/fn/math/log2.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.log2'); +module.exports = require('../../modules/_core').Math.log2; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/sign.js b/node_modules/core-js/library/fn/math/sign.js new file mode 100755 index 00000000..0963ecaf --- /dev/null +++ b/node_modules/core-js/library/fn/math/sign.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.sign'); +module.exports = require('../../modules/_core').Math.sign; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/sinh.js b/node_modules/core-js/library/fn/math/sinh.js new file mode 100755 index 00000000..c35cb739 --- /dev/null +++ b/node_modules/core-js/library/fn/math/sinh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.sinh'); +module.exports = require('../../modules/_core').Math.sinh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/tanh.js b/node_modules/core-js/library/fn/math/tanh.js new file mode 100755 index 00000000..3d1966db --- /dev/null +++ b/node_modules/core-js/library/fn/math/tanh.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.tanh'); +module.exports = require('../../modules/_core').Math.tanh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/trunc.js b/node_modules/core-js/library/fn/math/trunc.js new file mode 100755 index 00000000..135b7dcb --- /dev/null +++ b/node_modules/core-js/library/fn/math/trunc.js @@ -0,0 +1,2 @@ +require('../../modules/es6.math.trunc'); +module.exports = require('../../modules/_core').Math.trunc; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/math/umulh.js b/node_modules/core-js/library/fn/math/umulh.js new file mode 100755 index 00000000..d93b9ae0 --- /dev/null +++ b/node_modules/core-js/library/fn/math/umulh.js @@ -0,0 +1,2 @@ +require('../../modules/es7.math.umulh'); +module.exports = require('../../modules/_core').Math.umulh; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/constructor.js b/node_modules/core-js/library/fn/number/constructor.js new file mode 100755 index 00000000..f488331e --- /dev/null +++ b/node_modules/core-js/library/fn/number/constructor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.constructor'); +module.exports = Number; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/epsilon.js b/node_modules/core-js/library/fn/number/epsilon.js new file mode 100755 index 00000000..56c93521 --- /dev/null +++ b/node_modules/core-js/library/fn/number/epsilon.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.epsilon'); +module.exports = Math.pow(2, -52); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/index.js b/node_modules/core-js/library/fn/number/index.js new file mode 100755 index 00000000..92890003 --- /dev/null +++ b/node_modules/core-js/library/fn/number/index.js @@ -0,0 +1,14 @@ +require('../../modules/es6.number.constructor'); +require('../../modules/es6.number.epsilon'); +require('../../modules/es6.number.is-finite'); +require('../../modules/es6.number.is-integer'); +require('../../modules/es6.number.is-nan'); +require('../../modules/es6.number.is-safe-integer'); +require('../../modules/es6.number.max-safe-integer'); +require('../../modules/es6.number.min-safe-integer'); +require('../../modules/es6.number.parse-float'); +require('../../modules/es6.number.parse-int'); +require('../../modules/es6.number.to-fixed'); +require('../../modules/es6.number.to-precision'); +require('../../modules/core.number.iterator'); +module.exports = require('../../modules/_core').Number; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/is-finite.js b/node_modules/core-js/library/fn/number/is-finite.js new file mode 100755 index 00000000..4ec3706b --- /dev/null +++ b/node_modules/core-js/library/fn/number/is-finite.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-finite'); +module.exports = require('../../modules/_core').Number.isFinite; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/is-integer.js b/node_modules/core-js/library/fn/number/is-integer.js new file mode 100755 index 00000000..a3013bff --- /dev/null +++ b/node_modules/core-js/library/fn/number/is-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-integer'); +module.exports = require('../../modules/_core').Number.isInteger; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/is-nan.js b/node_modules/core-js/library/fn/number/is-nan.js new file mode 100755 index 00000000..f23b0266 --- /dev/null +++ b/node_modules/core-js/library/fn/number/is-nan.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-nan'); +module.exports = require('../../modules/_core').Number.isNaN; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/is-safe-integer.js b/node_modules/core-js/library/fn/number/is-safe-integer.js new file mode 100755 index 00000000..f68732f5 --- /dev/null +++ b/node_modules/core-js/library/fn/number/is-safe-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.is-safe-integer'); +module.exports = require('../../modules/_core').Number.isSafeInteger; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/iterator.js b/node_modules/core-js/library/fn/number/iterator.js new file mode 100755 index 00000000..26feaa1f --- /dev/null +++ b/node_modules/core-js/library/fn/number/iterator.js @@ -0,0 +1,5 @@ +require('../../modules/core.number.iterator'); +var get = require('../../modules/_iterators').Number; +module.exports = function(it){ + return get.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/max-safe-integer.js b/node_modules/core-js/library/fn/number/max-safe-integer.js new file mode 100755 index 00000000..c9b43b04 --- /dev/null +++ b/node_modules/core-js/library/fn/number/max-safe-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.max-safe-integer'); +module.exports = 0x1fffffffffffff; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/min-safe-integer.js b/node_modules/core-js/library/fn/number/min-safe-integer.js new file mode 100755 index 00000000..8b5e0728 --- /dev/null +++ b/node_modules/core-js/library/fn/number/min-safe-integer.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.min-safe-integer'); +module.exports = -0x1fffffffffffff; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/parse-float.js b/node_modules/core-js/library/fn/number/parse-float.js new file mode 100755 index 00000000..62f89774 --- /dev/null +++ b/node_modules/core-js/library/fn/number/parse-float.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.parse-float'); +module.exports = parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/parse-int.js b/node_modules/core-js/library/fn/number/parse-int.js new file mode 100755 index 00000000..c197da5b --- /dev/null +++ b/node_modules/core-js/library/fn/number/parse-int.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.parse-int'); +module.exports = parseInt; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/to-fixed.js b/node_modules/core-js/library/fn/number/to-fixed.js new file mode 100755 index 00000000..3a041b0e --- /dev/null +++ b/node_modules/core-js/library/fn/number/to-fixed.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.to-fixed'); +module.exports = require('../../modules/_core').Number.toFixed; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/to-precision.js b/node_modules/core-js/library/fn/number/to-precision.js new file mode 100755 index 00000000..9e85511a --- /dev/null +++ b/node_modules/core-js/library/fn/number/to-precision.js @@ -0,0 +1,2 @@ +require('../../modules/es6.number.to-precision'); +module.exports = require('../../modules/_core').Number.toPrecision; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/virtual/index.js b/node_modules/core-js/library/fn/number/virtual/index.js new file mode 100755 index 00000000..42360d32 --- /dev/null +++ b/node_modules/core-js/library/fn/number/virtual/index.js @@ -0,0 +1,4 @@ +require('../../../modules/core.number.iterator'); +var $Number = require('../../../modules/_entry-virtual')('Number'); +$Number.iterator = require('../../../modules/_iterators').Number; +module.exports = $Number; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/virtual/iterator.js b/node_modules/core-js/library/fn/number/virtual/iterator.js new file mode 100755 index 00000000..df034996 --- /dev/null +++ b/node_modules/core-js/library/fn/number/virtual/iterator.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').Number; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/virtual/to-fixed.js b/node_modules/core-js/library/fn/number/virtual/to-fixed.js new file mode 100755 index 00000000..b779f15c --- /dev/null +++ b/node_modules/core-js/library/fn/number/virtual/to-fixed.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.number.to-fixed'); +module.exports = require('../../../modules/_entry-virtual')('Number').toFixed; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/number/virtual/to-precision.js b/node_modules/core-js/library/fn/number/virtual/to-precision.js new file mode 100755 index 00000000..0c93fa4a --- /dev/null +++ b/node_modules/core-js/library/fn/number/virtual/to-precision.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.number.to-precision'); +module.exports = require('../../../modules/_entry-virtual')('Number').toPrecision; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/assign.js b/node_modules/core-js/library/fn/object/assign.js new file mode 100755 index 00000000..97df6bf4 --- /dev/null +++ b/node_modules/core-js/library/fn/object/assign.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.assign'); +module.exports = require('../../modules/_core').Object.assign; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/classof.js b/node_modules/core-js/library/fn/object/classof.js new file mode 100755 index 00000000..993d0480 --- /dev/null +++ b/node_modules/core-js/library/fn/object/classof.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.classof'); +module.exports = require('../../modules/_core').Object.classof; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/create.js b/node_modules/core-js/library/fn/object/create.js new file mode 100755 index 00000000..a05ca2fb --- /dev/null +++ b/node_modules/core-js/library/fn/object/create.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.create'); +var $Object = require('../../modules/_core').Object; +module.exports = function create(P, D){ + return $Object.create(P, D); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/define-getter.js b/node_modules/core-js/library/fn/object/define-getter.js new file mode 100755 index 00000000..5dd26070 --- /dev/null +++ b/node_modules/core-js/library/fn/object/define-getter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.define-getter'); +module.exports = require('../../modules/_core').Object.__defineGetter__; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/define-properties.js b/node_modules/core-js/library/fn/object/define-properties.js new file mode 100755 index 00000000..04160fb3 --- /dev/null +++ b/node_modules/core-js/library/fn/object/define-properties.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.define-properties'); +var $Object = require('../../modules/_core').Object; +module.exports = function defineProperties(T, D){ + return $Object.defineProperties(T, D); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/define-property.js b/node_modules/core-js/library/fn/object/define-property.js new file mode 100755 index 00000000..078c56cb --- /dev/null +++ b/node_modules/core-js/library/fn/object/define-property.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.define-property'); +var $Object = require('../../modules/_core').Object; +module.exports = function defineProperty(it, key, desc){ + return $Object.defineProperty(it, key, desc); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/define-setter.js b/node_modules/core-js/library/fn/object/define-setter.js new file mode 100755 index 00000000..b59475f8 --- /dev/null +++ b/node_modules/core-js/library/fn/object/define-setter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.define-setter'); +module.exports = require('../../modules/_core').Object.__defineSetter__; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/define.js b/node_modules/core-js/library/fn/object/define.js new file mode 100755 index 00000000..6ec19e90 --- /dev/null +++ b/node_modules/core-js/library/fn/object/define.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.define'); +module.exports = require('../../modules/_core').Object.define; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/entries.js b/node_modules/core-js/library/fn/object/entries.js new file mode 100755 index 00000000..fca1000e --- /dev/null +++ b/node_modules/core-js/library/fn/object/entries.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.entries'); +module.exports = require('../../modules/_core').Object.entries; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/freeze.js b/node_modules/core-js/library/fn/object/freeze.js new file mode 100755 index 00000000..04eac530 --- /dev/null +++ b/node_modules/core-js/library/fn/object/freeze.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.freeze'); +module.exports = require('../../modules/_core').Object.freeze; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/get-own-property-descriptor.js b/node_modules/core-js/library/fn/object/get-own-property-descriptor.js new file mode 100755 index 00000000..7d3f03b8 --- /dev/null +++ b/node_modules/core-js/library/fn/object/get-own-property-descriptor.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.get-own-property-descriptor'); +var $Object = require('../../modules/_core').Object; +module.exports = function getOwnPropertyDescriptor(it, key){ + return $Object.getOwnPropertyDescriptor(it, key); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/get-own-property-descriptors.js b/node_modules/core-js/library/fn/object/get-own-property-descriptors.js new file mode 100755 index 00000000..dfeb547c --- /dev/null +++ b/node_modules/core-js/library/fn/object/get-own-property-descriptors.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.get-own-property-descriptors'); +module.exports = require('../../modules/_core').Object.getOwnPropertyDescriptors; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/get-own-property-names.js b/node_modules/core-js/library/fn/object/get-own-property-names.js new file mode 100755 index 00000000..c91ce430 --- /dev/null +++ b/node_modules/core-js/library/fn/object/get-own-property-names.js @@ -0,0 +1,5 @@ +require('../../modules/es6.object.get-own-property-names'); +var $Object = require('../../modules/_core').Object; +module.exports = function getOwnPropertyNames(it){ + return $Object.getOwnPropertyNames(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/get-own-property-symbols.js b/node_modules/core-js/library/fn/object/get-own-property-symbols.js new file mode 100755 index 00000000..c3f52880 --- /dev/null +++ b/node_modules/core-js/library/fn/object/get-own-property-symbols.js @@ -0,0 +1,2 @@ +require('../../modules/es6.symbol'); +module.exports = require('../../modules/_core').Object.getOwnPropertySymbols; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/get-prototype-of.js b/node_modules/core-js/library/fn/object/get-prototype-of.js new file mode 100755 index 00000000..bda93445 --- /dev/null +++ b/node_modules/core-js/library/fn/object/get-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.get-prototype-of'); +module.exports = require('../../modules/_core').Object.getPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/index.js b/node_modules/core-js/library/fn/object/index.js new file mode 100755 index 00000000..4bd9825b --- /dev/null +++ b/node_modules/core-js/library/fn/object/index.js @@ -0,0 +1,30 @@ +require('../../modules/es6.symbol'); +require('../../modules/es6.object.create'); +require('../../modules/es6.object.define-property'); +require('../../modules/es6.object.define-properties'); +require('../../modules/es6.object.get-own-property-descriptor'); +require('../../modules/es6.object.get-prototype-of'); +require('../../modules/es6.object.keys'); +require('../../modules/es6.object.get-own-property-names'); +require('../../modules/es6.object.freeze'); +require('../../modules/es6.object.seal'); +require('../../modules/es6.object.prevent-extensions'); +require('../../modules/es6.object.is-frozen'); +require('../../modules/es6.object.is-sealed'); +require('../../modules/es6.object.is-extensible'); +require('../../modules/es6.object.assign'); +require('../../modules/es6.object.is'); +require('../../modules/es6.object.set-prototype-of'); +require('../../modules/es6.object.to-string'); +require('../../modules/es7.object.get-own-property-descriptors'); +require('../../modules/es7.object.values'); +require('../../modules/es7.object.entries'); +require('../../modules/es7.object.define-getter'); +require('../../modules/es7.object.define-setter'); +require('../../modules/es7.object.lookup-getter'); +require('../../modules/es7.object.lookup-setter'); +require('../../modules/core.object.is-object'); +require('../../modules/core.object.classof'); +require('../../modules/core.object.define'); +require('../../modules/core.object.make'); +module.exports = require('../../modules/_core').Object; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/is-extensible.js b/node_modules/core-js/library/fn/object/is-extensible.js new file mode 100755 index 00000000..43fb0e78 --- /dev/null +++ b/node_modules/core-js/library/fn/object/is-extensible.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is-extensible'); +module.exports = require('../../modules/_core').Object.isExtensible; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/is-frozen.js b/node_modules/core-js/library/fn/object/is-frozen.js new file mode 100755 index 00000000..cbff2242 --- /dev/null +++ b/node_modules/core-js/library/fn/object/is-frozen.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is-frozen'); +module.exports = require('../../modules/_core').Object.isFrozen; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/is-object.js b/node_modules/core-js/library/fn/object/is-object.js new file mode 100755 index 00000000..38feeff5 --- /dev/null +++ b/node_modules/core-js/library/fn/object/is-object.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.is-object'); +module.exports = require('../../modules/_core').Object.isObject; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/is-sealed.js b/node_modules/core-js/library/fn/object/is-sealed.js new file mode 100755 index 00000000..169a8ae7 --- /dev/null +++ b/node_modules/core-js/library/fn/object/is-sealed.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is-sealed'); +module.exports = require('../../modules/_core').Object.isSealed; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/is.js b/node_modules/core-js/library/fn/object/is.js new file mode 100755 index 00000000..6ac9f19e --- /dev/null +++ b/node_modules/core-js/library/fn/object/is.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.is'); +module.exports = require('../../modules/_core').Object.is; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/keys.js b/node_modules/core-js/library/fn/object/keys.js new file mode 100755 index 00000000..8eeb78eb --- /dev/null +++ b/node_modules/core-js/library/fn/object/keys.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.keys'); +module.exports = require('../../modules/_core').Object.keys; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/lookup-getter.js b/node_modules/core-js/library/fn/object/lookup-getter.js new file mode 100755 index 00000000..3f7f674d --- /dev/null +++ b/node_modules/core-js/library/fn/object/lookup-getter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.lookup-setter'); +module.exports = require('../../modules/_core').Object.__lookupGetter__; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/lookup-setter.js b/node_modules/core-js/library/fn/object/lookup-setter.js new file mode 100755 index 00000000..d18446fe --- /dev/null +++ b/node_modules/core-js/library/fn/object/lookup-setter.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.lookup-setter'); +module.exports = require('../../modules/_core').Object.__lookupSetter__; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/make.js b/node_modules/core-js/library/fn/object/make.js new file mode 100755 index 00000000..f4d19d12 --- /dev/null +++ b/node_modules/core-js/library/fn/object/make.js @@ -0,0 +1,2 @@ +require('../../modules/core.object.make'); +module.exports = require('../../modules/_core').Object.make; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/prevent-extensions.js b/node_modules/core-js/library/fn/object/prevent-extensions.js new file mode 100755 index 00000000..e43be05b --- /dev/null +++ b/node_modules/core-js/library/fn/object/prevent-extensions.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.prevent-extensions'); +module.exports = require('../../modules/_core').Object.preventExtensions; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/seal.js b/node_modules/core-js/library/fn/object/seal.js new file mode 100755 index 00000000..8a56cd7f --- /dev/null +++ b/node_modules/core-js/library/fn/object/seal.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.seal'); +module.exports = require('../../modules/_core').Object.seal; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/set-prototype-of.js b/node_modules/core-js/library/fn/object/set-prototype-of.js new file mode 100755 index 00000000..c25170db --- /dev/null +++ b/node_modules/core-js/library/fn/object/set-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.set-prototype-of'); +module.exports = require('../../modules/_core').Object.setPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/object/values.js b/node_modules/core-js/library/fn/object/values.js new file mode 100755 index 00000000..b50336cf --- /dev/null +++ b/node_modules/core-js/library/fn/object/values.js @@ -0,0 +1,2 @@ +require('../../modules/es7.object.values'); +module.exports = require('../../modules/_core').Object.values; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/observable.js b/node_modules/core-js/library/fn/observable.js new file mode 100755 index 00000000..05ca51a3 --- /dev/null +++ b/node_modules/core-js/library/fn/observable.js @@ -0,0 +1,7 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +module.exports = require('../modules/_core').Observable; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/parse-float.js b/node_modules/core-js/library/fn/parse-float.js new file mode 100755 index 00000000..dad94ddb --- /dev/null +++ b/node_modules/core-js/library/fn/parse-float.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-float'); +module.exports = require('../modules/_core').parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/parse-int.js b/node_modules/core-js/library/fn/parse-int.js new file mode 100755 index 00000000..08a20996 --- /dev/null +++ b/node_modules/core-js/library/fn/parse-int.js @@ -0,0 +1,2 @@ +require('../modules/es6.parse-int'); +module.exports = require('../modules/_core').parseInt; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/promise.js b/node_modules/core-js/library/fn/promise.js new file mode 100755 index 00000000..c901c859 --- /dev/null +++ b/node_modules/core-js/library/fn/promise.js @@ -0,0 +1,5 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.promise'); +module.exports = require('../modules/_core').Promise; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/apply.js b/node_modules/core-js/library/fn/reflect/apply.js new file mode 100755 index 00000000..725b8a69 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/apply.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.apply'); +module.exports = require('../../modules/_core').Reflect.apply; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/construct.js b/node_modules/core-js/library/fn/reflect/construct.js new file mode 100755 index 00000000..587725da --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/construct.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.construct'); +module.exports = require('../../modules/_core').Reflect.construct; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/define-metadata.js b/node_modules/core-js/library/fn/reflect/define-metadata.js new file mode 100755 index 00000000..c9876ed3 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/define-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.define-metadata'); +module.exports = require('../../modules/_core').Reflect.defineMetadata; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/define-property.js b/node_modules/core-js/library/fn/reflect/define-property.js new file mode 100755 index 00000000..c36b4d21 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/define-property.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.define-property'); +module.exports = require('../../modules/_core').Reflect.defineProperty; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/delete-metadata.js b/node_modules/core-js/library/fn/reflect/delete-metadata.js new file mode 100755 index 00000000..9bcc0299 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/delete-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.delete-metadata'); +module.exports = require('../../modules/_core').Reflect.deleteMetadata; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/delete-property.js b/node_modules/core-js/library/fn/reflect/delete-property.js new file mode 100755 index 00000000..10b6392f --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/delete-property.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.delete-property'); +module.exports = require('../../modules/_core').Reflect.deleteProperty; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/enumerate.js b/node_modules/core-js/library/fn/reflect/enumerate.js new file mode 100755 index 00000000..257a21ee --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/enumerate.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.enumerate'); +module.exports = require('../../modules/_core').Reflect.enumerate; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/get-metadata-keys.js b/node_modules/core-js/library/fn/reflect/get-metadata-keys.js new file mode 100755 index 00000000..9dbf5ee1 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/get-metadata-keys.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-metadata-keys'); +module.exports = require('../../modules/_core').Reflect.getMetadataKeys; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/get-metadata.js b/node_modules/core-js/library/fn/reflect/get-metadata.js new file mode 100755 index 00000000..3a20839e --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/get-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-metadata'); +module.exports = require('../../modules/_core').Reflect.getMetadata; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/get-own-metadata-keys.js b/node_modules/core-js/library/fn/reflect/get-own-metadata-keys.js new file mode 100755 index 00000000..2f8c5759 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/get-own-metadata-keys.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-own-metadata-keys'); +module.exports = require('../../modules/_core').Reflect.getOwnMetadataKeys; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/get-own-metadata.js b/node_modules/core-js/library/fn/reflect/get-own-metadata.js new file mode 100755 index 00000000..68e288dd --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/get-own-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.get-own-metadata'); +module.exports = require('../../modules/_core').Reflect.getOwnMetadata; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/get-own-property-descriptor.js b/node_modules/core-js/library/fn/reflect/get-own-property-descriptor.js new file mode 100755 index 00000000..9e2822fb --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/get-own-property-descriptor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.get-own-property-descriptor'); +module.exports = require('../../modules/_core').Reflect.getOwnPropertyDescriptor; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/get-prototype-of.js b/node_modules/core-js/library/fn/reflect/get-prototype-of.js new file mode 100755 index 00000000..48503596 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/get-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.get-prototype-of'); +module.exports = require('../../modules/_core').Reflect.getPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/get.js b/node_modules/core-js/library/fn/reflect/get.js new file mode 100755 index 00000000..9ca903e8 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/get.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.get'); +module.exports = require('../../modules/_core').Reflect.get; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/has-metadata.js b/node_modules/core-js/library/fn/reflect/has-metadata.js new file mode 100755 index 00000000..f001f437 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/has-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.has-metadata'); +module.exports = require('../../modules/_core').Reflect.hasMetadata; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/has-own-metadata.js b/node_modules/core-js/library/fn/reflect/has-own-metadata.js new file mode 100755 index 00000000..d90935f0 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/has-own-metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.has-own-metadata'); +module.exports = require('../../modules/_core').Reflect.hasOwnMetadata; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/has.js b/node_modules/core-js/library/fn/reflect/has.js new file mode 100755 index 00000000..8e34933c --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/has.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.has'); +module.exports = require('../../modules/_core').Reflect.has; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/index.js b/node_modules/core-js/library/fn/reflect/index.js new file mode 100755 index 00000000..a725cef2 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/index.js @@ -0,0 +1,24 @@ +require('../../modules/es6.reflect.apply'); +require('../../modules/es6.reflect.construct'); +require('../../modules/es6.reflect.define-property'); +require('../../modules/es6.reflect.delete-property'); +require('../../modules/es6.reflect.enumerate'); +require('../../modules/es6.reflect.get'); +require('../../modules/es6.reflect.get-own-property-descriptor'); +require('../../modules/es6.reflect.get-prototype-of'); +require('../../modules/es6.reflect.has'); +require('../../modules/es6.reflect.is-extensible'); +require('../../modules/es6.reflect.own-keys'); +require('../../modules/es6.reflect.prevent-extensions'); +require('../../modules/es6.reflect.set'); +require('../../modules/es6.reflect.set-prototype-of'); +require('../../modules/es7.reflect.define-metadata'); +require('../../modules/es7.reflect.delete-metadata'); +require('../../modules/es7.reflect.get-metadata'); +require('../../modules/es7.reflect.get-metadata-keys'); +require('../../modules/es7.reflect.get-own-metadata'); +require('../../modules/es7.reflect.get-own-metadata-keys'); +require('../../modules/es7.reflect.has-metadata'); +require('../../modules/es7.reflect.has-own-metadata'); +require('../../modules/es7.reflect.metadata'); +module.exports = require('../../modules/_core').Reflect; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/is-extensible.js b/node_modules/core-js/library/fn/reflect/is-extensible.js new file mode 100755 index 00000000..de41d683 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/is-extensible.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.is-extensible'); +module.exports = require('../../modules/_core').Reflect.isExtensible; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/metadata.js b/node_modules/core-js/library/fn/reflect/metadata.js new file mode 100755 index 00000000..3f2b8ff6 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/metadata.js @@ -0,0 +1,2 @@ +require('../../modules/es7.reflect.metadata'); +module.exports = require('../../modules/_core').Reflect.metadata; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/own-keys.js b/node_modules/core-js/library/fn/reflect/own-keys.js new file mode 100755 index 00000000..bfcebc74 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/own-keys.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.own-keys'); +module.exports = require('../../modules/_core').Reflect.ownKeys; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/prevent-extensions.js b/node_modules/core-js/library/fn/reflect/prevent-extensions.js new file mode 100755 index 00000000..b346da3b --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/prevent-extensions.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.prevent-extensions'); +module.exports = require('../../modules/_core').Reflect.preventExtensions; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/set-prototype-of.js b/node_modules/core-js/library/fn/reflect/set-prototype-of.js new file mode 100755 index 00000000..16b74359 --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/set-prototype-of.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.set-prototype-of'); +module.exports = require('../../modules/_core').Reflect.setPrototypeOf; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/reflect/set.js b/node_modules/core-js/library/fn/reflect/set.js new file mode 100755 index 00000000..834929ee --- /dev/null +++ b/node_modules/core-js/library/fn/reflect/set.js @@ -0,0 +1,2 @@ +require('../../modules/es6.reflect.set'); +module.exports = require('../../modules/_core').Reflect.set; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/constructor.js b/node_modules/core-js/library/fn/regexp/constructor.js new file mode 100755 index 00000000..90c13513 --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/constructor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.constructor'); +module.exports = RegExp; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/escape.js b/node_modules/core-js/library/fn/regexp/escape.js new file mode 100755 index 00000000..d657a7d9 --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/escape.js @@ -0,0 +1,2 @@ +require('../../modules/core.regexp.escape'); +module.exports = require('../../modules/_core').RegExp.escape; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/flags.js b/node_modules/core-js/library/fn/regexp/flags.js new file mode 100755 index 00000000..ef84ddbd --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/flags.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.flags'); +var flags = require('../../modules/_flags'); +module.exports = function(it){ + return flags.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/index.js b/node_modules/core-js/library/fn/regexp/index.js new file mode 100755 index 00000000..61ced0b8 --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/index.js @@ -0,0 +1,9 @@ +require('../../modules/es6.regexp.constructor'); +require('../../modules/es6.regexp.to-string'); +require('../../modules/es6.regexp.flags'); +require('../../modules/es6.regexp.match'); +require('../../modules/es6.regexp.replace'); +require('../../modules/es6.regexp.search'); +require('../../modules/es6.regexp.split'); +require('../../modules/core.regexp.escape'); +module.exports = require('../../modules/_core').RegExp; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/match.js b/node_modules/core-js/library/fn/regexp/match.js new file mode 100755 index 00000000..400d0921 --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/match.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.match'); +var MATCH = require('../../modules/_wks')('match'); +module.exports = function(it, str){ + return RegExp.prototype[MATCH].call(it, str); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/replace.js b/node_modules/core-js/library/fn/regexp/replace.js new file mode 100755 index 00000000..adde0adf --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/replace.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.replace'); +var REPLACE = require('../../modules/_wks')('replace'); +module.exports = function(it, str, replacer){ + return RegExp.prototype[REPLACE].call(it, str, replacer); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/search.js b/node_modules/core-js/library/fn/regexp/search.js new file mode 100755 index 00000000..4e149d05 --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/search.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.search'); +var SEARCH = require('../../modules/_wks')('search'); +module.exports = function(it, str){ + return RegExp.prototype[SEARCH].call(it, str); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/split.js b/node_modules/core-js/library/fn/regexp/split.js new file mode 100755 index 00000000..b92d09fa --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/split.js @@ -0,0 +1,5 @@ +require('../../modules/es6.regexp.split'); +var SPLIT = require('../../modules/_wks')('split'); +module.exports = function(it, str, limit){ + return RegExp.prototype[SPLIT].call(it, str, limit); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/regexp/to-string.js b/node_modules/core-js/library/fn/regexp/to-string.js new file mode 100755 index 00000000..29d5d037 --- /dev/null +++ b/node_modules/core-js/library/fn/regexp/to-string.js @@ -0,0 +1,5 @@ +'use strict'; +require('../../modules/es6.regexp.to-string'); +module.exports = function toString(it){ + return RegExp.prototype.toString.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/set-immediate.js b/node_modules/core-js/library/fn/set-immediate.js new file mode 100755 index 00000000..25083136 --- /dev/null +++ b/node_modules/core-js/library/fn/set-immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core').setImmediate; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/set-interval.js b/node_modules/core-js/library/fn/set-interval.js new file mode 100755 index 00000000..484447ff --- /dev/null +++ b/node_modules/core-js/library/fn/set-interval.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core').setInterval; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/set-timeout.js b/node_modules/core-js/library/fn/set-timeout.js new file mode 100755 index 00000000..8ebbb2e4 --- /dev/null +++ b/node_modules/core-js/library/fn/set-timeout.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core').setTimeout; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/set.js b/node_modules/core-js/library/fn/set.js new file mode 100755 index 00000000..a8b49652 --- /dev/null +++ b/node_modules/core-js/library/fn/set.js @@ -0,0 +1,6 @@ +require('../modules/es6.object.to-string'); +require('../modules/es6.string.iterator'); +require('../modules/web.dom.iterable'); +require('../modules/es6.set'); +require('../modules/es7.set.to-json'); +module.exports = require('../modules/_core').Set; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/anchor.js b/node_modules/core-js/library/fn/string/anchor.js new file mode 100755 index 00000000..ba4ef813 --- /dev/null +++ b/node_modules/core-js/library/fn/string/anchor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.anchor'); +module.exports = require('../../modules/_core').String.anchor; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/at.js b/node_modules/core-js/library/fn/string/at.js new file mode 100755 index 00000000..ab6aec15 --- /dev/null +++ b/node_modules/core-js/library/fn/string/at.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.at'); +module.exports = require('../../modules/_core').String.at; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/big.js b/node_modules/core-js/library/fn/string/big.js new file mode 100755 index 00000000..ab707907 --- /dev/null +++ b/node_modules/core-js/library/fn/string/big.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.big'); +module.exports = require('../../modules/_core').String.big; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/blink.js b/node_modules/core-js/library/fn/string/blink.js new file mode 100755 index 00000000..c748079b --- /dev/null +++ b/node_modules/core-js/library/fn/string/blink.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.blink'); +module.exports = require('../../modules/_core').String.blink; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/bold.js b/node_modules/core-js/library/fn/string/bold.js new file mode 100755 index 00000000..2d36bda3 --- /dev/null +++ b/node_modules/core-js/library/fn/string/bold.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.bold'); +module.exports = require('../../modules/_core').String.bold; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/code-point-at.js b/node_modules/core-js/library/fn/string/code-point-at.js new file mode 100755 index 00000000..be141e82 --- /dev/null +++ b/node_modules/core-js/library/fn/string/code-point-at.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.code-point-at'); +module.exports = require('../../modules/_core').String.codePointAt; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/ends-with.js b/node_modules/core-js/library/fn/string/ends-with.js new file mode 100755 index 00000000..5e427753 --- /dev/null +++ b/node_modules/core-js/library/fn/string/ends-with.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.ends-with'); +module.exports = require('../../modules/_core').String.endsWith; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/escape-html.js b/node_modules/core-js/library/fn/string/escape-html.js new file mode 100755 index 00000000..49176ca6 --- /dev/null +++ b/node_modules/core-js/library/fn/string/escape-html.js @@ -0,0 +1,2 @@ +require('../../modules/core.string.escape-html'); +module.exports = require('../../modules/_core').String.escapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/fixed.js b/node_modules/core-js/library/fn/string/fixed.js new file mode 100755 index 00000000..77e233a3 --- /dev/null +++ b/node_modules/core-js/library/fn/string/fixed.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.fixed'); +module.exports = require('../../modules/_core').String.fixed; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/fontcolor.js b/node_modules/core-js/library/fn/string/fontcolor.js new file mode 100755 index 00000000..079235a1 --- /dev/null +++ b/node_modules/core-js/library/fn/string/fontcolor.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.fontcolor'); +module.exports = require('../../modules/_core').String.fontcolor; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/fontsize.js b/node_modules/core-js/library/fn/string/fontsize.js new file mode 100755 index 00000000..8cb2555c --- /dev/null +++ b/node_modules/core-js/library/fn/string/fontsize.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.fontsize'); +module.exports = require('../../modules/_core').String.fontsize; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/from-code-point.js b/node_modules/core-js/library/fn/string/from-code-point.js new file mode 100755 index 00000000..93fc53ae --- /dev/null +++ b/node_modules/core-js/library/fn/string/from-code-point.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.from-code-point'); +module.exports = require('../../modules/_core').String.fromCodePoint; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/includes.js b/node_modules/core-js/library/fn/string/includes.js new file mode 100755 index 00000000..c9736404 --- /dev/null +++ b/node_modules/core-js/library/fn/string/includes.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.includes'); +module.exports = require('../../modules/_core').String.includes; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/index.js b/node_modules/core-js/library/fn/string/index.js new file mode 100755 index 00000000..6485a9b2 --- /dev/null +++ b/node_modules/core-js/library/fn/string/index.js @@ -0,0 +1,35 @@ +require('../../modules/es6.string.from-code-point'); +require('../../modules/es6.string.raw'); +require('../../modules/es6.string.trim'); +require('../../modules/es6.string.iterator'); +require('../../modules/es6.string.code-point-at'); +require('../../modules/es6.string.ends-with'); +require('../../modules/es6.string.includes'); +require('../../modules/es6.string.repeat'); +require('../../modules/es6.string.starts-with'); +require('../../modules/es6.regexp.match'); +require('../../modules/es6.regexp.replace'); +require('../../modules/es6.regexp.search'); +require('../../modules/es6.regexp.split'); +require('../../modules/es6.string.anchor'); +require('../../modules/es6.string.big'); +require('../../modules/es6.string.blink'); +require('../../modules/es6.string.bold'); +require('../../modules/es6.string.fixed'); +require('../../modules/es6.string.fontcolor'); +require('../../modules/es6.string.fontsize'); +require('../../modules/es6.string.italics'); +require('../../modules/es6.string.link'); +require('../../modules/es6.string.small'); +require('../../modules/es6.string.strike'); +require('../../modules/es6.string.sub'); +require('../../modules/es6.string.sup'); +require('../../modules/es7.string.at'); +require('../../modules/es7.string.pad-start'); +require('../../modules/es7.string.pad-end'); +require('../../modules/es7.string.trim-left'); +require('../../modules/es7.string.trim-right'); +require('../../modules/es7.string.match-all'); +require('../../modules/core.string.escape-html'); +require('../../modules/core.string.unescape-html'); +module.exports = require('../../modules/_core').String; diff --git a/node_modules/core-js/library/fn/string/italics.js b/node_modules/core-js/library/fn/string/italics.js new file mode 100755 index 00000000..378450eb --- /dev/null +++ b/node_modules/core-js/library/fn/string/italics.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.italics'); +module.exports = require('../../modules/_core').String.italics; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/iterator.js b/node_modules/core-js/library/fn/string/iterator.js new file mode 100755 index 00000000..947e7558 --- /dev/null +++ b/node_modules/core-js/library/fn/string/iterator.js @@ -0,0 +1,5 @@ +require('../../modules/es6.string.iterator'); +var get = require('../../modules/_iterators').String; +module.exports = function(it){ + return get.call(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/link.js b/node_modules/core-js/library/fn/string/link.js new file mode 100755 index 00000000..1eb2c6dd --- /dev/null +++ b/node_modules/core-js/library/fn/string/link.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.link'); +module.exports = require('../../modules/_core').String.link; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/match-all.js b/node_modules/core-js/library/fn/string/match-all.js new file mode 100755 index 00000000..1a1dfeb6 --- /dev/null +++ b/node_modules/core-js/library/fn/string/match-all.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.match-all'); +module.exports = require('../../modules/_core').String.matchAll; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/pad-end.js b/node_modules/core-js/library/fn/string/pad-end.js new file mode 100755 index 00000000..23eb9f95 --- /dev/null +++ b/node_modules/core-js/library/fn/string/pad-end.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.pad-end'); +module.exports = require('../../modules/_core').String.padEnd; diff --git a/node_modules/core-js/library/fn/string/pad-start.js b/node_modules/core-js/library/fn/string/pad-start.js new file mode 100755 index 00000000..ff12739f --- /dev/null +++ b/node_modules/core-js/library/fn/string/pad-start.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.pad-start'); +module.exports = require('../../modules/_core').String.padStart; diff --git a/node_modules/core-js/library/fn/string/raw.js b/node_modules/core-js/library/fn/string/raw.js new file mode 100755 index 00000000..713550fb --- /dev/null +++ b/node_modules/core-js/library/fn/string/raw.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.raw'); +module.exports = require('../../modules/_core').String.raw; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/repeat.js b/node_modules/core-js/library/fn/string/repeat.js new file mode 100755 index 00000000..fa75b13e --- /dev/null +++ b/node_modules/core-js/library/fn/string/repeat.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.repeat'); +module.exports = require('../../modules/_core').String.repeat; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/small.js b/node_modules/core-js/library/fn/string/small.js new file mode 100755 index 00000000..0438290d --- /dev/null +++ b/node_modules/core-js/library/fn/string/small.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.small'); +module.exports = require('../../modules/_core').String.small; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/starts-with.js b/node_modules/core-js/library/fn/string/starts-with.js new file mode 100755 index 00000000..d62512a3 --- /dev/null +++ b/node_modules/core-js/library/fn/string/starts-with.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.starts-with'); +module.exports = require('../../modules/_core').String.startsWith; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/strike.js b/node_modules/core-js/library/fn/string/strike.js new file mode 100755 index 00000000..b79946c8 --- /dev/null +++ b/node_modules/core-js/library/fn/string/strike.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.strike'); +module.exports = require('../../modules/_core').String.strike; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/sub.js b/node_modules/core-js/library/fn/string/sub.js new file mode 100755 index 00000000..54d0671e --- /dev/null +++ b/node_modules/core-js/library/fn/string/sub.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.sub'); +module.exports = require('../../modules/_core').String.sub; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/sup.js b/node_modules/core-js/library/fn/string/sup.js new file mode 100755 index 00000000..645e0372 --- /dev/null +++ b/node_modules/core-js/library/fn/string/sup.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.sup'); +module.exports = require('../../modules/_core').String.sup; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/trim-end.js b/node_modules/core-js/library/fn/string/trim-end.js new file mode 100755 index 00000000..f3bdf6fb --- /dev/null +++ b/node_modules/core-js/library/fn/string/trim-end.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-right'); +module.exports = require('../../modules/_core').String.trimRight; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/trim-left.js b/node_modules/core-js/library/fn/string/trim-left.js new file mode 100755 index 00000000..04671d36 --- /dev/null +++ b/node_modules/core-js/library/fn/string/trim-left.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-left'); +module.exports = require('../../modules/_core').String.trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/trim-right.js b/node_modules/core-js/library/fn/string/trim-right.js new file mode 100755 index 00000000..f3bdf6fb --- /dev/null +++ b/node_modules/core-js/library/fn/string/trim-right.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-right'); +module.exports = require('../../modules/_core').String.trimRight; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/trim-start.js b/node_modules/core-js/library/fn/string/trim-start.js new file mode 100755 index 00000000..04671d36 --- /dev/null +++ b/node_modules/core-js/library/fn/string/trim-start.js @@ -0,0 +1,2 @@ +require('../../modules/es7.string.trim-left'); +module.exports = require('../../modules/_core').String.trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/trim.js b/node_modules/core-js/library/fn/string/trim.js new file mode 100755 index 00000000..c536e12e --- /dev/null +++ b/node_modules/core-js/library/fn/string/trim.js @@ -0,0 +1,2 @@ +require('../../modules/es6.string.trim'); +module.exports = require('../../modules/_core').String.trim; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/unescape-html.js b/node_modules/core-js/library/fn/string/unescape-html.js new file mode 100755 index 00000000..7c2c55c8 --- /dev/null +++ b/node_modules/core-js/library/fn/string/unescape-html.js @@ -0,0 +1,2 @@ +require('../../modules/core.string.unescape-html'); +module.exports = require('../../modules/_core').String.unescapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/anchor.js b/node_modules/core-js/library/fn/string/virtual/anchor.js new file mode 100755 index 00000000..6f74b7e8 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/anchor.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.anchor'); +module.exports = require('../../../modules/_entry-virtual')('String').anchor; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/at.js b/node_modules/core-js/library/fn/string/virtual/at.js new file mode 100755 index 00000000..3b961438 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/at.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.at'); +module.exports = require('../../../modules/_entry-virtual')('String').at; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/big.js b/node_modules/core-js/library/fn/string/virtual/big.js new file mode 100755 index 00000000..57ac7d5d --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/big.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.big'); +module.exports = require('../../../modules/_entry-virtual')('String').big; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/blink.js b/node_modules/core-js/library/fn/string/virtual/blink.js new file mode 100755 index 00000000..5c4cea80 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/blink.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.blink'); +module.exports = require('../../../modules/_entry-virtual')('String').blink; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/bold.js b/node_modules/core-js/library/fn/string/virtual/bold.js new file mode 100755 index 00000000..c566bf2d --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/bold.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.bold'); +module.exports = require('../../../modules/_entry-virtual')('String').bold; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/code-point-at.js b/node_modules/core-js/library/fn/string/virtual/code-point-at.js new file mode 100755 index 00000000..87375219 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/code-point-at.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.code-point-at'); +module.exports = require('../../../modules/_entry-virtual')('String').codePointAt; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/ends-with.js b/node_modules/core-js/library/fn/string/virtual/ends-with.js new file mode 100755 index 00000000..90bc6e79 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/ends-with.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.ends-with'); +module.exports = require('../../../modules/_entry-virtual')('String').endsWith; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/escape-html.js b/node_modules/core-js/library/fn/string/virtual/escape-html.js new file mode 100755 index 00000000..3342bcec --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/escape-html.js @@ -0,0 +1,2 @@ +require('../../../modules/core.string.escape-html'); +module.exports = require('../../../modules/_entry-virtual')('String').escapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/fixed.js b/node_modules/core-js/library/fn/string/virtual/fixed.js new file mode 100755 index 00000000..e830654f --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/fixed.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.fixed'); +module.exports = require('../../../modules/_entry-virtual')('String').fixed; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/fontcolor.js b/node_modules/core-js/library/fn/string/virtual/fontcolor.js new file mode 100755 index 00000000..cfb9b2c0 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/fontcolor.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.fontcolor'); +module.exports = require('../../../modules/_entry-virtual')('String').fontcolor; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/fontsize.js b/node_modules/core-js/library/fn/string/virtual/fontsize.js new file mode 100755 index 00000000..de8f5161 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/fontsize.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.fontsize'); +module.exports = require('../../../modules/_entry-virtual')('String').fontsize; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/includes.js b/node_modules/core-js/library/fn/string/virtual/includes.js new file mode 100755 index 00000000..1e4793d6 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/includes.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.includes'); +module.exports = require('../../../modules/_entry-virtual')('String').includes; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/index.js b/node_modules/core-js/library/fn/string/virtual/index.js new file mode 100755 index 00000000..0e65d20c --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/index.js @@ -0,0 +1,33 @@ +require('../../../modules/es6.string.trim'); +require('../../../modules/es6.string.iterator'); +require('../../../modules/es6.string.code-point-at'); +require('../../../modules/es6.string.ends-with'); +require('../../../modules/es6.string.includes'); +require('../../../modules/es6.string.repeat'); +require('../../../modules/es6.string.starts-with'); +require('../../../modules/es6.regexp.match'); +require('../../../modules/es6.regexp.replace'); +require('../../../modules/es6.regexp.search'); +require('../../../modules/es6.regexp.split'); +require('../../../modules/es6.string.anchor'); +require('../../../modules/es6.string.big'); +require('../../../modules/es6.string.blink'); +require('../../../modules/es6.string.bold'); +require('../../../modules/es6.string.fixed'); +require('../../../modules/es6.string.fontcolor'); +require('../../../modules/es6.string.fontsize'); +require('../../../modules/es6.string.italics'); +require('../../../modules/es6.string.link'); +require('../../../modules/es6.string.small'); +require('../../../modules/es6.string.strike'); +require('../../../modules/es6.string.sub'); +require('../../../modules/es6.string.sup'); +require('../../../modules/es7.string.at'); +require('../../../modules/es7.string.pad-start'); +require('../../../modules/es7.string.pad-end'); +require('../../../modules/es7.string.trim-left'); +require('../../../modules/es7.string.trim-right'); +require('../../../modules/es7.string.match-all'); +require('../../../modules/core.string.escape-html'); +require('../../../modules/core.string.unescape-html'); +module.exports = require('../../../modules/_entry-virtual')('String'); diff --git a/node_modules/core-js/library/fn/string/virtual/italics.js b/node_modules/core-js/library/fn/string/virtual/italics.js new file mode 100755 index 00000000..f8f1d338 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/italics.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.italics'); +module.exports = require('../../../modules/_entry-virtual')('String').italics; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/iterator.js b/node_modules/core-js/library/fn/string/virtual/iterator.js new file mode 100755 index 00000000..7efe2f93 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/iterator.js @@ -0,0 +1,2 @@ +require('../../../modules/core.number.iterator'); +module.exports = require('../../../modules/_iterators').String; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/link.js b/node_modules/core-js/library/fn/string/virtual/link.js new file mode 100755 index 00000000..4b2eea8a --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/link.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.link'); +module.exports = require('../../../modules/_entry-virtual')('String').link; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/match-all.js b/node_modules/core-js/library/fn/string/virtual/match-all.js new file mode 100755 index 00000000..9208873a --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/match-all.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.match-all'); +module.exports = require('../../../modules/_entry-virtual')('String').matchAll; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/pad-end.js b/node_modules/core-js/library/fn/string/virtual/pad-end.js new file mode 100755 index 00000000..81e5ac04 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/pad-end.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.pad-end'); +module.exports = require('../../../modules/_entry-virtual')('String').padEnd; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/pad-start.js b/node_modules/core-js/library/fn/string/virtual/pad-start.js new file mode 100755 index 00000000..54cf3a59 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/pad-start.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.pad-start'); +module.exports = require('../../../modules/_entry-virtual')('String').padStart; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/repeat.js b/node_modules/core-js/library/fn/string/virtual/repeat.js new file mode 100755 index 00000000..d08cf6a5 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/repeat.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.repeat'); +module.exports = require('../../../modules/_entry-virtual')('String').repeat; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/small.js b/node_modules/core-js/library/fn/string/virtual/small.js new file mode 100755 index 00000000..201bf9b6 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/small.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.small'); +module.exports = require('../../../modules/_entry-virtual')('String').small; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/starts-with.js b/node_modules/core-js/library/fn/string/virtual/starts-with.js new file mode 100755 index 00000000..f8897d15 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/starts-with.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.starts-with'); +module.exports = require('../../../modules/_entry-virtual')('String').startsWith; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/strike.js b/node_modules/core-js/library/fn/string/virtual/strike.js new file mode 100755 index 00000000..4572db91 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/strike.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.strike'); +module.exports = require('../../../modules/_entry-virtual')('String').strike; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/sub.js b/node_modules/core-js/library/fn/string/virtual/sub.js new file mode 100755 index 00000000..a13611ec --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/sub.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.sub'); +module.exports = require('../../../modules/_entry-virtual')('String').sub; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/sup.js b/node_modules/core-js/library/fn/string/virtual/sup.js new file mode 100755 index 00000000..07695329 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/sup.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.sup'); +module.exports = require('../../../modules/_entry-virtual')('String').sup; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/trim-end.js b/node_modules/core-js/library/fn/string/virtual/trim-end.js new file mode 100755 index 00000000..14c25ac8 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/trim-end.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-right'); +module.exports = require('../../../modules/_entry-virtual')('String').trimRight; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/trim-left.js b/node_modules/core-js/library/fn/string/virtual/trim-left.js new file mode 100755 index 00000000..aabcfb3f --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/trim-left.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-left'); +module.exports = require('../../../modules/_entry-virtual')('String').trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/trim-right.js b/node_modules/core-js/library/fn/string/virtual/trim-right.js new file mode 100755 index 00000000..14c25ac8 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/trim-right.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-right'); +module.exports = require('../../../modules/_entry-virtual')('String').trimRight; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/trim-start.js b/node_modules/core-js/library/fn/string/virtual/trim-start.js new file mode 100755 index 00000000..aabcfb3f --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/trim-start.js @@ -0,0 +1,2 @@ +require('../../../modules/es7.string.trim-left'); +module.exports = require('../../../modules/_entry-virtual')('String').trimLeft; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/trim.js b/node_modules/core-js/library/fn/string/virtual/trim.js new file mode 100755 index 00000000..23fbcbc5 --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/trim.js @@ -0,0 +1,2 @@ +require('../../../modules/es6.string.trim'); +module.exports = require('../../../modules/_entry-virtual')('String').trim; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/string/virtual/unescape-html.js b/node_modules/core-js/library/fn/string/virtual/unescape-html.js new file mode 100755 index 00000000..51eb59fc --- /dev/null +++ b/node_modules/core-js/library/fn/string/virtual/unescape-html.js @@ -0,0 +1,2 @@ +require('../../../modules/core.string.unescape-html'); +module.exports = require('../../../modules/_entry-virtual')('String').unescapeHTML; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/async-iterator.js b/node_modules/core-js/library/fn/symbol/async-iterator.js new file mode 100755 index 00000000..aca10f96 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/async-iterator.js @@ -0,0 +1,2 @@ +require('../../modules/es7.symbol.async-iterator'); +module.exports = require('../../modules/_wks-ext').f('asyncIterator'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/for.js b/node_modules/core-js/library/fn/symbol/for.js new file mode 100755 index 00000000..c9e93c13 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/for.js @@ -0,0 +1,2 @@ +require('../../modules/es6.symbol'); +module.exports = require('../../modules/_core').Symbol['for']; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/has-instance.js b/node_modules/core-js/library/fn/symbol/has-instance.js new file mode 100755 index 00000000..f3ec9cf6 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/has-instance.js @@ -0,0 +1,2 @@ +require('../../modules/es6.function.has-instance'); +module.exports = require('../../modules/_wks-ext').f('hasInstance'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/index.js b/node_modules/core-js/library/fn/symbol/index.js new file mode 100755 index 00000000..64c0f5f4 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/index.js @@ -0,0 +1,5 @@ +require('../../modules/es6.symbol'); +require('../../modules/es6.object.to-string'); +require('../../modules/es7.symbol.async-iterator'); +require('../../modules/es7.symbol.observable'); +module.exports = require('../../modules/_core').Symbol; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/is-concat-spreadable.js b/node_modules/core-js/library/fn/symbol/is-concat-spreadable.js new file mode 100755 index 00000000..49ed7a1d --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/is-concat-spreadable.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('isConcatSpreadable'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/iterator.js b/node_modules/core-js/library/fn/symbol/iterator.js new file mode 100755 index 00000000..50352280 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/iterator.js @@ -0,0 +1,3 @@ +require('../../modules/es6.string.iterator'); +require('../../modules/web.dom.iterable'); +module.exports = require('../../modules/_wks-ext').f('iterator'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/key-for.js b/node_modules/core-js/library/fn/symbol/key-for.js new file mode 100755 index 00000000..d9b595ff --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/key-for.js @@ -0,0 +1,2 @@ +require('../../modules/es6.symbol'); +module.exports = require('../../modules/_core').Symbol.keyFor; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/match.js b/node_modules/core-js/library/fn/symbol/match.js new file mode 100755 index 00000000..d27db65b --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/match.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.match'); +module.exports = require('../../modules/_wks-ext').f('match'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/observable.js b/node_modules/core-js/library/fn/symbol/observable.js new file mode 100755 index 00000000..884cebfd --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/observable.js @@ -0,0 +1,2 @@ +require('../../modules/es7.symbol.observable'); +module.exports = require('../../modules/_wks-ext').f('observable'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/replace.js b/node_modules/core-js/library/fn/symbol/replace.js new file mode 100755 index 00000000..3ef60f5e --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/replace.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.replace'); +module.exports = require('../../modules/_wks-ext').f('replace'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/search.js b/node_modules/core-js/library/fn/symbol/search.js new file mode 100755 index 00000000..aee84f9e --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/search.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.search'); +module.exports = require('../../modules/_wks-ext').f('search'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/species.js b/node_modules/core-js/library/fn/symbol/species.js new file mode 100755 index 00000000..a425eb2d --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/species.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('species'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/split.js b/node_modules/core-js/library/fn/symbol/split.js new file mode 100755 index 00000000..8535932f --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/split.js @@ -0,0 +1,2 @@ +require('../../modules/es6.regexp.split'); +module.exports = require('../../modules/_wks-ext').f('split'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/to-primitive.js b/node_modules/core-js/library/fn/symbol/to-primitive.js new file mode 100755 index 00000000..20c831b8 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/to-primitive.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('toPrimitive'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/to-string-tag.js b/node_modules/core-js/library/fn/symbol/to-string-tag.js new file mode 100755 index 00000000..101baf27 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/to-string-tag.js @@ -0,0 +1,2 @@ +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_wks-ext').f('toStringTag'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/symbol/unscopables.js b/node_modules/core-js/library/fn/symbol/unscopables.js new file mode 100755 index 00000000..6c4146b2 --- /dev/null +++ b/node_modules/core-js/library/fn/symbol/unscopables.js @@ -0,0 +1 @@ +module.exports = require('../../modules/_wks-ext').f('unscopables'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/system/global.js b/node_modules/core-js/library/fn/system/global.js new file mode 100755 index 00000000..c3219d6f --- /dev/null +++ b/node_modules/core-js/library/fn/system/global.js @@ -0,0 +1,2 @@ +require('../../modules/es7.system.global'); +module.exports = require('../../modules/_core').System.global; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/system/index.js b/node_modules/core-js/library/fn/system/index.js new file mode 100755 index 00000000..eae78ddd --- /dev/null +++ b/node_modules/core-js/library/fn/system/index.js @@ -0,0 +1,2 @@ +require('../../modules/es7.system.global'); +module.exports = require('../../modules/_core').System; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/array-buffer.js b/node_modules/core-js/library/fn/typed/array-buffer.js new file mode 100755 index 00000000..fe08f7f2 --- /dev/null +++ b/node_modules/core-js/library/fn/typed/array-buffer.js @@ -0,0 +1,3 @@ +require('../../modules/es6.typed.array-buffer'); +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_core').ArrayBuffer; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/data-view.js b/node_modules/core-js/library/fn/typed/data-view.js new file mode 100755 index 00000000..09dbb38a --- /dev/null +++ b/node_modules/core-js/library/fn/typed/data-view.js @@ -0,0 +1,3 @@ +require('../../modules/es6.typed.data-view'); +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_core').DataView; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/float32-array.js b/node_modules/core-js/library/fn/typed/float32-array.js new file mode 100755 index 00000000..1191fecb --- /dev/null +++ b/node_modules/core-js/library/fn/typed/float32-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.float32-array'); +module.exports = require('../../modules/_core').Float32Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/float64-array.js b/node_modules/core-js/library/fn/typed/float64-array.js new file mode 100755 index 00000000..6073a682 --- /dev/null +++ b/node_modules/core-js/library/fn/typed/float64-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.float64-array'); +module.exports = require('../../modules/_core').Float64Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/index.js b/node_modules/core-js/library/fn/typed/index.js new file mode 100755 index 00000000..7babe09d --- /dev/null +++ b/node_modules/core-js/library/fn/typed/index.js @@ -0,0 +1,13 @@ +require('../../modules/es6.typed.array-buffer'); +require('../../modules/es6.typed.data-view'); +require('../../modules/es6.typed.int8-array'); +require('../../modules/es6.typed.uint8-array'); +require('../../modules/es6.typed.uint8-clamped-array'); +require('../../modules/es6.typed.int16-array'); +require('../../modules/es6.typed.uint16-array'); +require('../../modules/es6.typed.int32-array'); +require('../../modules/es6.typed.uint32-array'); +require('../../modules/es6.typed.float32-array'); +require('../../modules/es6.typed.float64-array'); +require('../../modules/es6.object.to-string'); +module.exports = require('../../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/int16-array.js b/node_modules/core-js/library/fn/typed/int16-array.js new file mode 100755 index 00000000..0722549d --- /dev/null +++ b/node_modules/core-js/library/fn/typed/int16-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.int16-array'); +module.exports = require('../../modules/_core').Int16Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/int32-array.js b/node_modules/core-js/library/fn/typed/int32-array.js new file mode 100755 index 00000000..13613622 --- /dev/null +++ b/node_modules/core-js/library/fn/typed/int32-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.int32-array'); +module.exports = require('../../modules/_core').Int32Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/int8-array.js b/node_modules/core-js/library/fn/typed/int8-array.js new file mode 100755 index 00000000..edf48c79 --- /dev/null +++ b/node_modules/core-js/library/fn/typed/int8-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.int8-array'); +module.exports = require('../../modules/_core').Int8Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/uint16-array.js b/node_modules/core-js/library/fn/typed/uint16-array.js new file mode 100755 index 00000000..3ff11550 --- /dev/null +++ b/node_modules/core-js/library/fn/typed/uint16-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint16-array'); +module.exports = require('../../modules/_core').Uint16Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/uint32-array.js b/node_modules/core-js/library/fn/typed/uint32-array.js new file mode 100755 index 00000000..47bb4c21 --- /dev/null +++ b/node_modules/core-js/library/fn/typed/uint32-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint32-array'); +module.exports = require('../../modules/_core').Uint32Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/uint8-array.js b/node_modules/core-js/library/fn/typed/uint8-array.js new file mode 100755 index 00000000..fd8a4b11 --- /dev/null +++ b/node_modules/core-js/library/fn/typed/uint8-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint8-array'); +module.exports = require('../../modules/_core').Uint8Array; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/typed/uint8-clamped-array.js b/node_modules/core-js/library/fn/typed/uint8-clamped-array.js new file mode 100755 index 00000000..c688657c --- /dev/null +++ b/node_modules/core-js/library/fn/typed/uint8-clamped-array.js @@ -0,0 +1,2 @@ +require('../../modules/es6.typed.uint8-clamped-array'); +module.exports = require('../../modules/_core').Uint8ClampedArray; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/weak-map.js b/node_modules/core-js/library/fn/weak-map.js new file mode 100755 index 00000000..00cac1ad --- /dev/null +++ b/node_modules/core-js/library/fn/weak-map.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/web.dom.iterable'); +require('../modules/es6.weak-map'); +module.exports = require('../modules/_core').WeakMap; \ No newline at end of file diff --git a/node_modules/core-js/library/fn/weak-set.js b/node_modules/core-js/library/fn/weak-set.js new file mode 100755 index 00000000..eef1af2a --- /dev/null +++ b/node_modules/core-js/library/fn/weak-set.js @@ -0,0 +1,4 @@ +require('../modules/es6.object.to-string'); +require('../modules/web.dom.iterable'); +require('../modules/es6.weak-set'); +module.exports = require('../modules/_core').WeakSet; \ No newline at end of file diff --git a/node_modules/core-js/library/index.js b/node_modules/core-js/library/index.js new file mode 100755 index 00000000..78b9e3d4 --- /dev/null +++ b/node_modules/core-js/library/index.js @@ -0,0 +1,16 @@ +require('./shim'); +require('./modules/core.dict'); +require('./modules/core.get-iterator-method'); +require('./modules/core.get-iterator'); +require('./modules/core.is-iterable'); +require('./modules/core.delay'); +require('./modules/core.function.part'); +require('./modules/core.object.is-object'); +require('./modules/core.object.classof'); +require('./modules/core.object.define'); +require('./modules/core.object.make'); +require('./modules/core.number.iterator'); +require('./modules/core.regexp.escape'); +require('./modules/core.string.escape-html'); +require('./modules/core.string.unescape-html'); +module.exports = require('./modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_a-function.js b/node_modules/core-js/library/modules/_a-function.js new file mode 100755 index 00000000..8c35f451 --- /dev/null +++ b/node_modules/core-js/library/modules/_a-function.js @@ -0,0 +1,4 @@ +module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_a-number-value.js b/node_modules/core-js/library/modules/_a-number-value.js new file mode 100755 index 00000000..7bcbd7b7 --- /dev/null +++ b/node_modules/core-js/library/modules/_a-number-value.js @@ -0,0 +1,5 @@ +var cof = require('./_cof'); +module.exports = function(it, msg){ + if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); + return +it; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_add-to-unscopables.js b/node_modules/core-js/library/modules/_add-to-unscopables.js new file mode 100755 index 00000000..faf87af3 --- /dev/null +++ b/node_modules/core-js/library/modules/_add-to-unscopables.js @@ -0,0 +1 @@ +module.exports = function(){ /* empty */ }; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_an-instance.js b/node_modules/core-js/library/modules/_an-instance.js new file mode 100755 index 00000000..e4dfad3d --- /dev/null +++ b/node_modules/core-js/library/modules/_an-instance.js @@ -0,0 +1,5 @@ +module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_an-object.js b/node_modules/core-js/library/modules/_an-object.js new file mode 100755 index 00000000..59a8a3a3 --- /dev/null +++ b/node_modules/core-js/library/modules/_an-object.js @@ -0,0 +1,5 @@ +var isObject = require('./_is-object'); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_array-copy-within.js b/node_modules/core-js/library/modules/_array-copy-within.js new file mode 100755 index 00000000..d901a32f --- /dev/null +++ b/node_modules/core-js/library/modules/_array-copy-within.js @@ -0,0 +1,26 @@ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +'use strict'; +var toObject = require('./_to-object') + , toIndex = require('./_to-index') + , toLength = require('./_to-length'); + +module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){ + var O = toObject(this) + , len = toLength(O.length) + , to = toIndex(target, len) + , from = toIndex(start, len) + , end = arguments.length > 2 ? arguments[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_array-fill.js b/node_modules/core-js/library/modules/_array-fill.js new file mode 100755 index 00000000..b21bb7ed --- /dev/null +++ b/node_modules/core-js/library/modules/_array-fill.js @@ -0,0 +1,15 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +'use strict'; +var toObject = require('./_to-object') + , toIndex = require('./_to-index') + , toLength = require('./_to-length'); +module.exports = function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , aLen = arguments.length + , index = toIndex(aLen > 1 ? arguments[1] : undefined, length) + , end = aLen > 2 ? arguments[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_array-from-iterable.js b/node_modules/core-js/library/modules/_array-from-iterable.js new file mode 100755 index 00000000..b5c454fb --- /dev/null +++ b/node_modules/core-js/library/modules/_array-from-iterable.js @@ -0,0 +1,7 @@ +var forOf = require('./_for-of'); + +module.exports = function(iter, ITERATOR){ + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; diff --git a/node_modules/core-js/library/modules/_array-includes.js b/node_modules/core-js/library/modules/_array-includes.js new file mode 100755 index 00000000..c70b064d --- /dev/null +++ b/node_modules/core-js/library/modules/_array-includes.js @@ -0,0 +1,21 @@ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = require('./_to-iobject') + , toLength = require('./_to-length') + , toIndex = require('./_to-index'); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_array-methods.js b/node_modules/core-js/library/modules/_array-methods.js new file mode 100755 index 00000000..8ffbe116 --- /dev/null +++ b/node_modules/core-js/library/modules/_array-methods.js @@ -0,0 +1,44 @@ +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = require('./_ctx') + , IObject = require('./_iobject') + , toObject = require('./_to-object') + , toLength = require('./_to-length') + , asc = require('./_array-species-create'); +module.exports = function(TYPE, $create){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX + , create = $create || asc; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_array-reduce.js b/node_modules/core-js/library/modules/_array-reduce.js new file mode 100755 index 00000000..c807d544 --- /dev/null +++ b/node_modules/core-js/library/modules/_array-reduce.js @@ -0,0 +1,28 @@ +var aFunction = require('./_a-function') + , toObject = require('./_to-object') + , IObject = require('./_iobject') + , toLength = require('./_to-length'); + +module.exports = function(that, callbackfn, aLen, memo, isRight){ + aFunction(callbackfn); + var O = toObject(that) + , self = IObject(O) + , length = toLength(O.length) + , index = isRight ? length - 1 : 0 + , i = isRight ? -1 : 1; + if(aLen < 2)for(;;){ + if(index in self){ + memo = self[index]; + index += i; + break; + } + index += i; + if(isRight ? index < 0 : length <= index){ + throw TypeError('Reduce of empty array with no initial value'); + } + } + for(;isRight ? index >= 0 : length > index; index += i)if(index in self){ + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_array-species-constructor.js b/node_modules/core-js/library/modules/_array-species-constructor.js new file mode 100755 index 00000000..a715389f --- /dev/null +++ b/node_modules/core-js/library/modules/_array-species-constructor.js @@ -0,0 +1,16 @@ +var isObject = require('./_is-object') + , isArray = require('./_is-array') + , SPECIES = require('./_wks')('species'); + +module.exports = function(original){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return C === undefined ? Array : C; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_array-species-create.js b/node_modules/core-js/library/modules/_array-species-create.js new file mode 100755 index 00000000..cbd18bc6 --- /dev/null +++ b/node_modules/core-js/library/modules/_array-species-create.js @@ -0,0 +1,6 @@ +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = require('./_array-species-constructor'); + +module.exports = function(original, length){ + return new (speciesConstructor(original))(length); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_bind.js b/node_modules/core-js/library/modules/_bind.js new file mode 100755 index 00000000..1f7b0174 --- /dev/null +++ b/node_modules/core-js/library/modules/_bind.js @@ -0,0 +1,24 @@ +'use strict'; +var aFunction = require('./_a-function') + , isObject = require('./_is-object') + , invoke = require('./_invoke') + , arraySlice = [].slice + , factories = {}; + +var construct = function(F, len, args){ + if(!(len in factories)){ + for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /*, args... */){ + var fn = aFunction(this) + , partArgs = arraySlice.call(arguments, 1); + var bound = function(/* args... */){ + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if(isObject(fn.prototype))bound.prototype = fn.prototype; + return bound; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_classof.js b/node_modules/core-js/library/modules/_classof.js new file mode 100755 index 00000000..dab3a80f --- /dev/null +++ b/node_modules/core-js/library/modules/_classof.js @@ -0,0 +1,23 @@ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = require('./_cof') + , TAG = require('./_wks')('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } +}; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_cof.js b/node_modules/core-js/library/modules/_cof.js new file mode 100755 index 00000000..1dd2779a --- /dev/null +++ b/node_modules/core-js/library/modules/_cof.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_collection-strong.js b/node_modules/core-js/library/modules/_collection-strong.js new file mode 100755 index 00000000..55e4b615 --- /dev/null +++ b/node_modules/core-js/library/modules/_collection-strong.js @@ -0,0 +1,142 @@ +'use strict'; +var dP = require('./_object-dp').f + , create = require('./_object-create') + , redefineAll = require('./_redefine-all') + , ctx = require('./_ctx') + , anInstance = require('./_an-instance') + , defined = require('./_defined') + , forOf = require('./_for-of') + , $iterDefine = require('./_iter-define') + , step = require('./_iter-step') + , setSpecies = require('./_set-species') + , DESCRIPTORS = require('./_descriptors') + , fastKey = require('./_meta').fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_collection-to-json.js b/node_modules/core-js/library/modules/_collection-to-json.js new file mode 100755 index 00000000..ce0282f6 --- /dev/null +++ b/node_modules/core-js/library/modules/_collection-to-json.js @@ -0,0 +1,9 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = require('./_classof') + , from = require('./_array-from-iterable'); +module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_collection-weak.js b/node_modules/core-js/library/modules/_collection-weak.js new file mode 100755 index 00000000..a8597e64 --- /dev/null +++ b/node_modules/core-js/library/modules/_collection-weak.js @@ -0,0 +1,83 @@ +'use strict'; +var redefineAll = require('./_redefine-all') + , getWeak = require('./_meta').getWeak + , anObject = require('./_an-object') + , isObject = require('./_is-object') + , anInstance = require('./_an-instance') + , forOf = require('./_for-of') + , createArrayMethod = require('./_array-methods') + , $has = require('./_has') + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function(that){ + return that._l || (that._l = new UncaughtFrozenStore); +}; +var UncaughtFrozenStore = function(){ + this.a = []; +}; +var findUncaughtFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); +}; +UncaughtFrozenStore.prototype = { + get: function(key){ + var entry = findUncaughtFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findUncaughtFrozen(this, key); + }, + set: function(key, value){ + var entry = findUncaughtFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this)['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function(that, key, value){ + var data = getWeak(anObject(key), true); + if(data === true)uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_collection.js b/node_modules/core-js/library/modules/_collection.js new file mode 100755 index 00000000..0bdd7fcb --- /dev/null +++ b/node_modules/core-js/library/modules/_collection.js @@ -0,0 +1,59 @@ +'use strict'; +var global = require('./_global') + , $export = require('./_export') + , meta = require('./_meta') + , fails = require('./_fails') + , hide = require('./_hide') + , redefineAll = require('./_redefine-all') + , forOf = require('./_for-of') + , anInstance = require('./_an-instance') + , isObject = require('./_is-object') + , setToStringTag = require('./_set-to-string-tag') + , dP = require('./_object-dp').f + , each = require('./_array-methods')(0) + , DESCRIPTORS = require('./_descriptors'); + +module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + if(!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME, '_c'); + target._c = new Base; + if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','),function(KEY){ + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){ + anInstance(this, C, KEY); + if(!IS_ADDER && IS_WEAK && !isObject(a))return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + if('size' in proto)dP(C.prototype, 'size', { + get: function(){ + return this._c.size; + } + }); + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F, O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_core.js b/node_modules/core-js/library/modules/_core.js new file mode 100755 index 00000000..23d6aede --- /dev/null +++ b/node_modules/core-js/library/modules/_core.js @@ -0,0 +1,2 @@ +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_create-property.js b/node_modules/core-js/library/modules/_create-property.js new file mode 100755 index 00000000..3d1bf730 --- /dev/null +++ b/node_modules/core-js/library/modules/_create-property.js @@ -0,0 +1,8 @@ +'use strict'; +var $defineProperty = require('./_object-dp') + , createDesc = require('./_property-desc'); + +module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_ctx.js b/node_modules/core-js/library/modules/_ctx.js new file mode 100755 index 00000000..b52d85ff --- /dev/null +++ b/node_modules/core-js/library/modules/_ctx.js @@ -0,0 +1,20 @@ +// optional / simple context binding +var aFunction = require('./_a-function'); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_date-to-primitive.js b/node_modules/core-js/library/modules/_date-to-primitive.js new file mode 100755 index 00000000..561079a1 --- /dev/null +++ b/node_modules/core-js/library/modules/_date-to-primitive.js @@ -0,0 +1,9 @@ +'use strict'; +var anObject = require('./_an-object') + , toPrimitive = require('./_to-primitive') + , NUMBER = 'number'; + +module.exports = function(hint){ + if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_defined.js b/node_modules/core-js/library/modules/_defined.js new file mode 100755 index 00000000..cfa476b9 --- /dev/null +++ b/node_modules/core-js/library/modules/_defined.js @@ -0,0 +1,5 @@ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_descriptors.js b/node_modules/core-js/library/modules/_descriptors.js new file mode 100755 index 00000000..6ccb7ee2 --- /dev/null +++ b/node_modules/core-js/library/modules/_descriptors.js @@ -0,0 +1,4 @@ +// Thank's IE8 for his funny defineProperty +module.exports = !require('./_fails')(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_dom-create.js b/node_modules/core-js/library/modules/_dom-create.js new file mode 100755 index 00000000..909b5ff0 --- /dev/null +++ b/node_modules/core-js/library/modules/_dom-create.js @@ -0,0 +1,7 @@ +var isObject = require('./_is-object') + , document = require('./_global').document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_entry-virtual.js b/node_modules/core-js/library/modules/_entry-virtual.js new file mode 100755 index 00000000..0ec61272 --- /dev/null +++ b/node_modules/core-js/library/modules/_entry-virtual.js @@ -0,0 +1,5 @@ +var core = require('./_core'); +module.exports = function(CONSTRUCTOR){ + var C = core[CONSTRUCTOR]; + return (C.virtual || C.prototype); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_enum-bug-keys.js b/node_modules/core-js/library/modules/_enum-bug-keys.js new file mode 100755 index 00000000..928b9fb0 --- /dev/null +++ b/node_modules/core-js/library/modules/_enum-bug-keys.js @@ -0,0 +1,4 @@ +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_enum-keys.js b/node_modules/core-js/library/modules/_enum-keys.js new file mode 100755 index 00000000..3bf8069c --- /dev/null +++ b/node_modules/core-js/library/modules/_enum-keys.js @@ -0,0 +1,15 @@ +// all enumerable object keys, includes symbols +var getKeys = require('./_object-keys') + , gOPS = require('./_object-gops') + , pIE = require('./_object-pie'); +module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_export.js b/node_modules/core-js/library/modules/_export.js new file mode 100755 index 00000000..dc084b4c --- /dev/null +++ b/node_modules/core-js/library/modules/_export.js @@ -0,0 +1,61 @@ +var global = require('./_global') + , core = require('./_core') + , ctx = require('./_ctx') + , hide = require('./_hide') + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_fails-is-regexp.js b/node_modules/core-js/library/modules/_fails-is-regexp.js new file mode 100755 index 00000000..130436bf --- /dev/null +++ b/node_modules/core-js/library/modules/_fails-is-regexp.js @@ -0,0 +1,12 @@ +var MATCH = require('./_wks')('match'); +module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_fails.js b/node_modules/core-js/library/modules/_fails.js new file mode 100755 index 00000000..184e5ea8 --- /dev/null +++ b/node_modules/core-js/library/modules/_fails.js @@ -0,0 +1,7 @@ +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_fix-re-wks.js b/node_modules/core-js/library/modules/_fix-re-wks.js new file mode 100755 index 00000000..d29368ce --- /dev/null +++ b/node_modules/core-js/library/modules/_fix-re-wks.js @@ -0,0 +1,28 @@ +'use strict'; +var hide = require('./_hide') + , redefine = require('./_redefine') + , fails = require('./_fails') + , defined = require('./_defined') + , wks = require('./_wks'); + +module.exports = function(KEY, length, exec){ + var SYMBOL = wks(KEY) + , fns = exec(defined, SYMBOL, ''[KEY]) + , strfn = fns[0] + , rxfn = fns[1]; + if(fails(function(){ + var O = {}; + O[SYMBOL] = function(){ return 7; }; + return ''[KEY](O) != 7; + })){ + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function(string, arg){ return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function(string){ return rxfn.call(string, this); } + ); + } +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_flags.js b/node_modules/core-js/library/modules/_flags.js new file mode 100755 index 00000000..054f9088 --- /dev/null +++ b/node_modules/core-js/library/modules/_flags.js @@ -0,0 +1,13 @@ +'use strict'; +// 21.2.5.3 get RegExp.prototype.flags +var anObject = require('./_an-object'); +module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_for-of.js b/node_modules/core-js/library/modules/_for-of.js new file mode 100755 index 00000000..b4824fef --- /dev/null +++ b/node_modules/core-js/library/modules/_for-of.js @@ -0,0 +1,25 @@ +var ctx = require('./_ctx') + , call = require('./_iter-call') + , isArrayIter = require('./_is-array-iter') + , anObject = require('./_an-object') + , toLength = require('./_to-length') + , getIterFn = require('./core.get-iterator-method') + , BREAK = {} + , RETURN = {}; +var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_global.js b/node_modules/core-js/library/modules/_global.js new file mode 100755 index 00000000..df6efb47 --- /dev/null +++ b/node_modules/core-js/library/modules/_global.js @@ -0,0 +1,4 @@ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_has.js b/node_modules/core-js/library/modules/_has.js new file mode 100755 index 00000000..870b40e7 --- /dev/null +++ b/node_modules/core-js/library/modules/_has.js @@ -0,0 +1,4 @@ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_hide.js b/node_modules/core-js/library/modules/_hide.js new file mode 100755 index 00000000..4031e808 --- /dev/null +++ b/node_modules/core-js/library/modules/_hide.js @@ -0,0 +1,8 @@ +var dP = require('./_object-dp') + , createDesc = require('./_property-desc'); +module.exports = require('./_descriptors') ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_html.js b/node_modules/core-js/library/modules/_html.js new file mode 100755 index 00000000..98f5142c --- /dev/null +++ b/node_modules/core-js/library/modules/_html.js @@ -0,0 +1 @@ +module.exports = require('./_global').document && document.documentElement; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_ie8-dom-define.js b/node_modules/core-js/library/modules/_ie8-dom-define.js new file mode 100755 index 00000000..18ffd59d --- /dev/null +++ b/node_modules/core-js/library/modules/_ie8-dom-define.js @@ -0,0 +1,3 @@ +module.exports = !require('./_descriptors') && !require('./_fails')(function(){ + return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_inherit-if-required.js b/node_modules/core-js/library/modules/_inherit-if-required.js new file mode 100755 index 00000000..d3948405 --- /dev/null +++ b/node_modules/core-js/library/modules/_inherit-if-required.js @@ -0,0 +1,8 @@ +var isObject = require('./_is-object') + , setPrototypeOf = require('./_set-proto').set; +module.exports = function(that, target, C){ + var P, S = target.constructor; + if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){ + setPrototypeOf(that, P); + } return that; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_invoke.js b/node_modules/core-js/library/modules/_invoke.js new file mode 100755 index 00000000..08e307fd --- /dev/null +++ b/node_modules/core-js/library/modules/_invoke.js @@ -0,0 +1,16 @@ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_iobject.js b/node_modules/core-js/library/modules/_iobject.js new file mode 100755 index 00000000..b58db489 --- /dev/null +++ b/node_modules/core-js/library/modules/_iobject.js @@ -0,0 +1,5 @@ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = require('./_cof'); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_is-array-iter.js b/node_modules/core-js/library/modules/_is-array-iter.js new file mode 100755 index 00000000..8139d71c --- /dev/null +++ b/node_modules/core-js/library/modules/_is-array-iter.js @@ -0,0 +1,8 @@ +// check on default Array iterator +var Iterators = require('./_iterators') + , ITERATOR = require('./_wks')('iterator') + , ArrayProto = Array.prototype; + +module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_is-array.js b/node_modules/core-js/library/modules/_is-array.js new file mode 100755 index 00000000..b4a3a8ed --- /dev/null +++ b/node_modules/core-js/library/modules/_is-array.js @@ -0,0 +1,5 @@ +// 7.2.2 IsArray(argument) +var cof = require('./_cof'); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_is-integer.js b/node_modules/core-js/library/modules/_is-integer.js new file mode 100755 index 00000000..22db67ed --- /dev/null +++ b/node_modules/core-js/library/modules/_is-integer.js @@ -0,0 +1,6 @@ +// 20.1.2.3 Number.isInteger(number) +var isObject = require('./_is-object') + , floor = Math.floor; +module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_is-object.js b/node_modules/core-js/library/modules/_is-object.js new file mode 100755 index 00000000..ee694be2 --- /dev/null +++ b/node_modules/core-js/library/modules/_is-object.js @@ -0,0 +1,3 @@ +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_is-regexp.js b/node_modules/core-js/library/modules/_is-regexp.js new file mode 100755 index 00000000..55b2c629 --- /dev/null +++ b/node_modules/core-js/library/modules/_is-regexp.js @@ -0,0 +1,8 @@ +// 7.2.8 IsRegExp(argument) +var isObject = require('./_is-object') + , cof = require('./_cof') + , MATCH = require('./_wks')('match'); +module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_iter-call.js b/node_modules/core-js/library/modules/_iter-call.js new file mode 100755 index 00000000..e3565ba9 --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-call.js @@ -0,0 +1,12 @@ +// call something on iterator step with safe closing on error +var anObject = require('./_an-object'); +module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_iter-create.js b/node_modules/core-js/library/modules/_iter-create.js new file mode 100755 index 00000000..9a9aa4fb --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-create.js @@ -0,0 +1,13 @@ +'use strict'; +var create = require('./_object-create') + , descriptor = require('./_property-desc') + , setToStringTag = require('./_set-to-string-tag') + , IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function(){ return this; }); + +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_iter-define.js b/node_modules/core-js/library/modules/_iter-define.js new file mode 100755 index 00000000..f72a5021 --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-define.js @@ -0,0 +1,70 @@ +'use strict'; +var LIBRARY = require('./_library') + , $export = require('./_export') + , redefine = require('./_redefine') + , hide = require('./_hide') + , has = require('./_has') + , Iterators = require('./_iterators') + , $iterCreate = require('./_iter-create') + , setToStringTag = require('./_set-to-string-tag') + , getPrototypeOf = require('./_object-gpo') + , ITERATOR = require('./_wks')('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_iter-detect.js b/node_modules/core-js/library/modules/_iter-detect.js new file mode 100755 index 00000000..87c7aecf --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-detect.js @@ -0,0 +1,21 @@ +var ITERATOR = require('./_wks')('iterator') + , SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); +} catch(e){ /* empty */ } + +module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_iter-step.js b/node_modules/core-js/library/modules/_iter-step.js new file mode 100755 index 00000000..6ff0dc51 --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-step.js @@ -0,0 +1,3 @@ +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_iterators.js b/node_modules/core-js/library/modules/_iterators.js new file mode 100755 index 00000000..a0995453 --- /dev/null +++ b/node_modules/core-js/library/modules/_iterators.js @@ -0,0 +1 @@ +module.exports = {}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_keyof.js b/node_modules/core-js/library/modules/_keyof.js new file mode 100755 index 00000000..7b63229b --- /dev/null +++ b/node_modules/core-js/library/modules/_keyof.js @@ -0,0 +1,10 @@ +var getKeys = require('./_object-keys') + , toIObject = require('./_to-iobject'); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_library.js b/node_modules/core-js/library/modules/_library.js new file mode 100755 index 00000000..73f737c5 --- /dev/null +++ b/node_modules/core-js/library/modules/_library.js @@ -0,0 +1 @@ +module.exports = true; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_math-expm1.js b/node_modules/core-js/library/modules/_math-expm1.js new file mode 100755 index 00000000..5131aa95 --- /dev/null +++ b/node_modules/core-js/library/modules/_math-expm1.js @@ -0,0 +1,10 @@ +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_math-log1p.js b/node_modules/core-js/library/modules/_math-log1p.js new file mode 100755 index 00000000..a92bf463 --- /dev/null +++ b/node_modules/core-js/library/modules/_math-log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_math-sign.js b/node_modules/core-js/library/modules/_math-sign.js new file mode 100755 index 00000000..a4848df6 --- /dev/null +++ b/node_modules/core-js/library/modules/_math-sign.js @@ -0,0 +1,4 @@ +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_meta.js b/node_modules/core-js/library/modules/_meta.js new file mode 100755 index 00000000..7daca009 --- /dev/null +++ b/node_modules/core-js/library/modules/_meta.js @@ -0,0 +1,53 @@ +var META = require('./_uid')('meta') + , isObject = require('./_is-object') + , has = require('./_has') + , setDesc = require('./_object-dp').f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !require('./_fails')(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_metadata.js b/node_modules/core-js/library/modules/_metadata.js new file mode 100755 index 00000000..eb5a762d --- /dev/null +++ b/node_modules/core-js/library/modules/_metadata.js @@ -0,0 +1,51 @@ +var Map = require('./es6.map') + , $export = require('./_export') + , shared = require('./_shared')('metadata') + , store = shared.store || (shared.store = new (require('./es6.weak-map'))); + +var getOrCreateMetadataMap = function(target, targetKey, create){ + var targetMetadata = store.get(target); + if(!targetMetadata){ + if(!create)return undefined; + store.set(target, targetMetadata = new Map); + } + var keyMetadata = targetMetadata.get(targetKey); + if(!keyMetadata){ + if(!create)return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){ + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function(target, targetKey){ + var metadataMap = getOrCreateMetadataMap(target, targetKey, false) + , keys = []; + if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); }); + return keys; +}; +var toMetaKey = function(it){ + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function(O){ + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_microtask.js b/node_modules/core-js/library/modules/_microtask.js new file mode 100755 index 00000000..b0f2a0df --- /dev/null +++ b/node_modules/core-js/library/modules/_microtask.js @@ -0,0 +1,68 @@ +var global = require('./_global') + , macrotask = require('./_task').set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = require('./_cof')(process) == 'process'; + +module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-assign.js b/node_modules/core-js/library/modules/_object-assign.js new file mode 100755 index 00000000..c575aba2 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-assign.js @@ -0,0 +1,33 @@ +'use strict'; +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = require('./_object-keys') + , gOPS = require('./_object-gops') + , pIE = require('./_object-pie') + , toObject = require('./_to-object') + , IObject = require('./_iobject') + , $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || require('./_fails')(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; +} : $assign; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-create.js b/node_modules/core-js/library/modules/_object-create.js new file mode 100755 index 00000000..3379760f --- /dev/null +++ b/node_modules/core-js/library/modules/_object-create.js @@ -0,0 +1,41 @@ +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = require('./_an-object') + , dPs = require('./_object-dps') + , enumBugKeys = require('./_enum-bug-keys') + , IE_PROTO = require('./_shared-key')('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = require('./_dom-create')('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + require('./_html').appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; diff --git a/node_modules/core-js/library/modules/_object-define.js b/node_modules/core-js/library/modules/_object-define.js new file mode 100755 index 00000000..f246c4e3 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-define.js @@ -0,0 +1,12 @@ +var dP = require('./_object-dp') + , gOPD = require('./_object-gopd') + , ownKeys = require('./_own-keys') + , toIObject = require('./_to-iobject'); + +module.exports = function define(target, mixin){ + var keys = ownKeys(toIObject(mixin)) + , length = keys.length + , i = 0, key; + while(length > i)dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-dp.js b/node_modules/core-js/library/modules/_object-dp.js new file mode 100755 index 00000000..e7ca8a46 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-dp.js @@ -0,0 +1,16 @@ +var anObject = require('./_an-object') + , IE8_DOM_DEFINE = require('./_ie8-dom-define') + , toPrimitive = require('./_to-primitive') + , dP = Object.defineProperty; + +exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-dps.js b/node_modules/core-js/library/modules/_object-dps.js new file mode 100755 index 00000000..8cd4147a --- /dev/null +++ b/node_modules/core-js/library/modules/_object-dps.js @@ -0,0 +1,13 @@ +var dP = require('./_object-dp') + , anObject = require('./_an-object') + , getKeys = require('./_object-keys'); + +module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-forced-pam.js b/node_modules/core-js/library/modules/_object-forced-pam.js new file mode 100755 index 00000000..668a07dc --- /dev/null +++ b/node_modules/core-js/library/modules/_object-forced-pam.js @@ -0,0 +1,7 @@ +// Forced replacement prototype accessors methods +module.exports = require('./_library')|| !require('./_fails')(function(){ + var K = Math.random(); + // In FF throws only define methods + __defineSetter__.call(null, K, function(){ /* empty */}); + delete require('./_global')[K]; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-gopd.js b/node_modules/core-js/library/modules/_object-gopd.js new file mode 100755 index 00000000..756206ab --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gopd.js @@ -0,0 +1,16 @@ +var pIE = require('./_object-pie') + , createDesc = require('./_property-desc') + , toIObject = require('./_to-iobject') + , toPrimitive = require('./_to-primitive') + , has = require('./_has') + , IE8_DOM_DEFINE = require('./_ie8-dom-define') + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-gopn-ext.js b/node_modules/core-js/library/modules/_object-gopn-ext.js new file mode 100755 index 00000000..f4d10b4a --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gopn-ext.js @@ -0,0 +1,19 @@ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = require('./_to-iobject') + , gOPN = require('./_object-gopn').f + , toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; diff --git a/node_modules/core-js/library/modules/_object-gopn.js b/node_modules/core-js/library/modules/_object-gopn.js new file mode 100755 index 00000000..beebf4da --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gopn.js @@ -0,0 +1,7 @@ +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = require('./_object-keys-internal') + , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-gops.js b/node_modules/core-js/library/modules/_object-gops.js new file mode 100755 index 00000000..8f93d76b --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gops.js @@ -0,0 +1 @@ +exports.f = Object.getOwnPropertySymbols; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-gpo.js b/node_modules/core-js/library/modules/_object-gpo.js new file mode 100755 index 00000000..535dc6e9 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gpo.js @@ -0,0 +1,13 @@ +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = require('./_has') + , toObject = require('./_to-object') + , IE_PROTO = require('./_shared-key')('IE_PROTO') + , ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-keys-internal.js b/node_modules/core-js/library/modules/_object-keys-internal.js new file mode 100755 index 00000000..e23481d7 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-keys-internal.js @@ -0,0 +1,17 @@ +var has = require('./_has') + , toIObject = require('./_to-iobject') + , arrayIndexOf = require('./_array-includes')(false) + , IE_PROTO = require('./_shared-key')('IE_PROTO'); + +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-keys.js b/node_modules/core-js/library/modules/_object-keys.js new file mode 100755 index 00000000..11d4ccee --- /dev/null +++ b/node_modules/core-js/library/modules/_object-keys.js @@ -0,0 +1,7 @@ +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = require('./_object-keys-internal') + , enumBugKeys = require('./_enum-bug-keys'); + +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-pie.js b/node_modules/core-js/library/modules/_object-pie.js new file mode 100755 index 00000000..13479a17 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-pie.js @@ -0,0 +1 @@ +exports.f = {}.propertyIsEnumerable; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-sap.js b/node_modules/core-js/library/modules/_object-sap.js new file mode 100755 index 00000000..b76fec5f --- /dev/null +++ b/node_modules/core-js/library/modules/_object-sap.js @@ -0,0 +1,10 @@ +// most Object methods by ES6 should accept primitives +var $export = require('./_export') + , core = require('./_core') + , fails = require('./_fails'); +module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_object-to-array.js b/node_modules/core-js/library/modules/_object-to-array.js new file mode 100755 index 00000000..b6fdf05d --- /dev/null +++ b/node_modules/core-js/library/modules/_object-to-array.js @@ -0,0 +1,16 @@ +var getKeys = require('./_object-keys') + , toIObject = require('./_to-iobject') + , isEnum = require('./_object-pie').f; +module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_own-keys.js b/node_modules/core-js/library/modules/_own-keys.js new file mode 100755 index 00000000..045ce3d5 --- /dev/null +++ b/node_modules/core-js/library/modules/_own-keys.js @@ -0,0 +1,10 @@ +// all object keys, includes non-enumerable and symbols +var gOPN = require('./_object-gopn') + , gOPS = require('./_object-gops') + , anObject = require('./_an-object') + , Reflect = require('./_global').Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = gOPN.f(anObject(it)) + , getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_parse-float.js b/node_modules/core-js/library/modules/_parse-float.js new file mode 100755 index 00000000..3d0e6531 --- /dev/null +++ b/node_modules/core-js/library/modules/_parse-float.js @@ -0,0 +1,8 @@ +var $parseFloat = require('./_global').parseFloat + , $trim = require('./_string-trim').trim; + +module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str){ + var string = $trim(String(str), 3) + , result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_parse-int.js b/node_modules/core-js/library/modules/_parse-int.js new file mode 100755 index 00000000..c23ffc09 --- /dev/null +++ b/node_modules/core-js/library/modules/_parse-int.js @@ -0,0 +1,9 @@ +var $parseInt = require('./_global').parseInt + , $trim = require('./_string-trim').trim + , ws = require('./_string-ws') + , hex = /^[\-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){ + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_partial.js b/node_modules/core-js/library/modules/_partial.js new file mode 100755 index 00000000..3d411b70 --- /dev/null +++ b/node_modules/core-js/library/modules/_partial.js @@ -0,0 +1,23 @@ +'use strict'; +var path = require('./_path') + , invoke = require('./_invoke') + , aFunction = require('./_a-function'); +module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , aLen = arguments.length + , j = 0, k = 0, args; + if(!holder && !aLen)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; + while(aLen > k)args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_path.js b/node_modules/core-js/library/modules/_path.js new file mode 100755 index 00000000..e2b878dc --- /dev/null +++ b/node_modules/core-js/library/modules/_path.js @@ -0,0 +1 @@ +module.exports = require('./_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_property-desc.js b/node_modules/core-js/library/modules/_property-desc.js new file mode 100755 index 00000000..e3f7ab2d --- /dev/null +++ b/node_modules/core-js/library/modules/_property-desc.js @@ -0,0 +1,8 @@ +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_redefine-all.js b/node_modules/core-js/library/modules/_redefine-all.js new file mode 100755 index 00000000..beeb2eaf --- /dev/null +++ b/node_modules/core-js/library/modules/_redefine-all.js @@ -0,0 +1,7 @@ +var hide = require('./_hide'); +module.exports = function(target, src, safe){ + for(var key in src){ + if(safe && target[key])target[key] = src[key]; + else hide(target, key, src[key]); + } return target; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_redefine.js b/node_modules/core-js/library/modules/_redefine.js new file mode 100755 index 00000000..6bd64530 --- /dev/null +++ b/node_modules/core-js/library/modules/_redefine.js @@ -0,0 +1 @@ +module.exports = require('./_hide'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_replacer.js b/node_modules/core-js/library/modules/_replacer.js new file mode 100755 index 00000000..5360a3d3 --- /dev/null +++ b/node_modules/core-js/library/modules/_replacer.js @@ -0,0 +1,8 @@ +module.exports = function(regExp, replace){ + var replacer = replace === Object(replace) ? function(part){ + return replace[part]; + } : replace; + return function(it){ + return String(it).replace(regExp, replacer); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_same-value.js b/node_modules/core-js/library/modules/_same-value.js new file mode 100755 index 00000000..8c2b8c7f --- /dev/null +++ b/node_modules/core-js/library/modules/_same-value.js @@ -0,0 +1,4 @@ +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_set-proto.js b/node_modules/core-js/library/modules/_set-proto.js new file mode 100755 index 00000000..8d5dad3f --- /dev/null +++ b/node_modules/core-js/library/modules/_set-proto.js @@ -0,0 +1,25 @@ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = require('./_is-object') + , anObject = require('./_an-object'); +var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_set-species.js b/node_modules/core-js/library/modules/_set-species.js new file mode 100755 index 00000000..4320fa51 --- /dev/null +++ b/node_modules/core-js/library/modules/_set-species.js @@ -0,0 +1,14 @@ +'use strict'; +var global = require('./_global') + , core = require('./_core') + , dP = require('./_object-dp') + , DESCRIPTORS = require('./_descriptors') + , SPECIES = require('./_wks')('species'); + +module.exports = function(KEY){ + var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_set-to-string-tag.js b/node_modules/core-js/library/modules/_set-to-string-tag.js new file mode 100755 index 00000000..ffbdddab --- /dev/null +++ b/node_modules/core-js/library/modules/_set-to-string-tag.js @@ -0,0 +1,7 @@ +var def = require('./_object-dp').f + , has = require('./_has') + , TAG = require('./_wks')('toStringTag'); + +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_shared-key.js b/node_modules/core-js/library/modules/_shared-key.js new file mode 100755 index 00000000..5ed76349 --- /dev/null +++ b/node_modules/core-js/library/modules/_shared-key.js @@ -0,0 +1,5 @@ +var shared = require('./_shared')('keys') + , uid = require('./_uid'); +module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_shared.js b/node_modules/core-js/library/modules/_shared.js new file mode 100755 index 00000000..3f9e4c89 --- /dev/null +++ b/node_modules/core-js/library/modules/_shared.js @@ -0,0 +1,6 @@ +var global = require('./_global') + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_species-constructor.js b/node_modules/core-js/library/modules/_species-constructor.js new file mode 100755 index 00000000..7a4d1baf --- /dev/null +++ b/node_modules/core-js/library/modules/_species-constructor.js @@ -0,0 +1,8 @@ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = require('./_an-object') + , aFunction = require('./_a-function') + , SPECIES = require('./_wks')('species'); +module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_strict-method.js b/node_modules/core-js/library/modules/_strict-method.js new file mode 100755 index 00000000..96b6c6e8 --- /dev/null +++ b/node_modules/core-js/library/modules/_strict-method.js @@ -0,0 +1,7 @@ +var fails = require('./_fails'); + +module.exports = function(method, arg){ + return !!method && fails(function(){ + arg ? method.call(null, function(){}, 1) : method.call(null); + }); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_string-at.js b/node_modules/core-js/library/modules/_string-at.js new file mode 100755 index 00000000..ecc0d21c --- /dev/null +++ b/node_modules/core-js/library/modules/_string-at.js @@ -0,0 +1,17 @@ +var toInteger = require('./_to-integer') + , defined = require('./_defined'); +// true -> String#at +// false -> String#codePointAt +module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_string-context.js b/node_modules/core-js/library/modules/_string-context.js new file mode 100755 index 00000000..5f513483 --- /dev/null +++ b/node_modules/core-js/library/modules/_string-context.js @@ -0,0 +1,8 @@ +// helper for String#{startsWith, endsWith, includes} +var isRegExp = require('./_is-regexp') + , defined = require('./_defined'); + +module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_string-html.js b/node_modules/core-js/library/modules/_string-html.js new file mode 100755 index 00000000..95daf812 --- /dev/null +++ b/node_modules/core-js/library/modules/_string-html.js @@ -0,0 +1,19 @@ +var $export = require('./_export') + , fails = require('./_fails') + , defined = require('./_defined') + , quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function(string, tag, attribute, value) { + var S = String(defined(string)) + , p1 = '<' + tag; + if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function(NAME, exec){ + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function(){ + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_string-pad.js b/node_modules/core-js/library/modules/_string-pad.js new file mode 100755 index 00000000..dccd155e --- /dev/null +++ b/node_modules/core-js/library/modules/_string-pad.js @@ -0,0 +1,16 @@ +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = require('./_to-length') + , repeat = require('./_string-repeat') + , defined = require('./_defined'); + +module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength || fillStr == '')return S; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; diff --git a/node_modules/core-js/library/modules/_string-repeat.js b/node_modules/core-js/library/modules/_string-repeat.js new file mode 100755 index 00000000..88fd3a2d --- /dev/null +++ b/node_modules/core-js/library/modules/_string-repeat.js @@ -0,0 +1,12 @@ +'use strict'; +var toInteger = require('./_to-integer') + , defined = require('./_defined'); + +module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_string-trim.js b/node_modules/core-js/library/modules/_string-trim.js new file mode 100755 index 00000000..d12de1ce --- /dev/null +++ b/node_modules/core-js/library/modules/_string-trim.js @@ -0,0 +1,30 @@ +var $export = require('./_export') + , defined = require('./_defined') + , fails = require('./_fails') + , spaces = require('./_string-ws') + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + +var exporter = function(KEY, exec, ALIAS){ + var exp = {}; + var FORCE = fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if(ALIAS)exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_string-ws.js b/node_modules/core-js/library/modules/_string-ws.js new file mode 100755 index 00000000..9713d11d --- /dev/null +++ b/node_modules/core-js/library/modules/_string-ws.js @@ -0,0 +1,2 @@ +module.exports = '\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'; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_task.js b/node_modules/core-js/library/modules/_task.js new file mode 100755 index 00000000..06a73f40 --- /dev/null +++ b/node_modules/core-js/library/modules/_task.js @@ -0,0 +1,75 @@ +var ctx = require('./_ctx') + , invoke = require('./_invoke') + , html = require('./_html') + , cel = require('./_dom-create') + , global = require('./_global') + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(require('./_cof')(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_to-index.js b/node_modules/core-js/library/modules/_to-index.js new file mode 100755 index 00000000..4d380ce1 --- /dev/null +++ b/node_modules/core-js/library/modules/_to-index.js @@ -0,0 +1,7 @@ +var toInteger = require('./_to-integer') + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_to-integer.js b/node_modules/core-js/library/modules/_to-integer.js new file mode 100755 index 00000000..f63baaff --- /dev/null +++ b/node_modules/core-js/library/modules/_to-integer.js @@ -0,0 +1,6 @@ +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_to-iobject.js b/node_modules/core-js/library/modules/_to-iobject.js new file mode 100755 index 00000000..4eb43462 --- /dev/null +++ b/node_modules/core-js/library/modules/_to-iobject.js @@ -0,0 +1,6 @@ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = require('./_iobject') + , defined = require('./_defined'); +module.exports = function(it){ + return IObject(defined(it)); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_to-length.js b/node_modules/core-js/library/modules/_to-length.js new file mode 100755 index 00000000..4099e60b --- /dev/null +++ b/node_modules/core-js/library/modules/_to-length.js @@ -0,0 +1,6 @@ +// 7.1.15 ToLength +var toInteger = require('./_to-integer') + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_to-object.js b/node_modules/core-js/library/modules/_to-object.js new file mode 100755 index 00000000..f2c28b3f --- /dev/null +++ b/node_modules/core-js/library/modules/_to-object.js @@ -0,0 +1,5 @@ +// 7.1.13 ToObject(argument) +var defined = require('./_defined'); +module.exports = function(it){ + return Object(defined(it)); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_to-primitive.js b/node_modules/core-js/library/modules/_to-primitive.js new file mode 100755 index 00000000..16354eed --- /dev/null +++ b/node_modules/core-js/library/modules/_to-primitive.js @@ -0,0 +1,12 @@ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = require('./_is-object'); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_typed-array.js b/node_modules/core-js/library/modules/_typed-array.js new file mode 100755 index 00000000..b072b23b --- /dev/null +++ b/node_modules/core-js/library/modules/_typed-array.js @@ -0,0 +1,479 @@ +'use strict'; +if(require('./_descriptors')){ + var LIBRARY = require('./_library') + , global = require('./_global') + , fails = require('./_fails') + , $export = require('./_export') + , $typed = require('./_typed') + , $buffer = require('./_typed-buffer') + , ctx = require('./_ctx') + , anInstance = require('./_an-instance') + , propertyDesc = require('./_property-desc') + , hide = require('./_hide') + , redefineAll = require('./_redefine-all') + , toInteger = require('./_to-integer') + , toLength = require('./_to-length') + , toIndex = require('./_to-index') + , toPrimitive = require('./_to-primitive') + , has = require('./_has') + , same = require('./_same-value') + , classof = require('./_classof') + , isObject = require('./_is-object') + , toObject = require('./_to-object') + , isArrayIter = require('./_is-array-iter') + , create = require('./_object-create') + , getPrototypeOf = require('./_object-gpo') + , gOPN = require('./_object-gopn').f + , getIterFn = require('./core.get-iterator-method') + , uid = require('./_uid') + , wks = require('./_wks') + , createArrayMethod = require('./_array-methods') + , createArrayIncludes = require('./_array-includes') + , speciesConstructor = require('./_species-constructor') + , ArrayIterators = require('./es6.array.iterator') + , Iterators = require('./_iterators') + , $iterDetect = require('./_iter-detect') + , setSpecies = require('./_set-species') + , arrayFill = require('./_array-fill') + , arrayCopyWithin = require('./_array-copy-within') + , $DP = require('./_object-dp') + , $GOPD = require('./_object-gopd') + , dP = $DP.f + , gOPD = $GOPD.f + , RangeError = global.RangeError + , TypeError = global.TypeError + , Uint8Array = global.Uint8Array + , ARRAY_BUFFER = 'ArrayBuffer' + , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER + , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' + , PROTOTYPE = 'prototype' + , ArrayProto = Array[PROTOTYPE] + , $ArrayBuffer = $buffer.ArrayBuffer + , $DataView = $buffer.DataView + , arrayForEach = createArrayMethod(0) + , arrayFilter = createArrayMethod(2) + , arraySome = createArrayMethod(3) + , arrayEvery = createArrayMethod(4) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , arrayIncludes = createArrayIncludes(true) + , arrayIndexOf = createArrayIncludes(false) + , arrayValues = ArrayIterators.values + , arrayKeys = ArrayIterators.keys + , arrayEntries = ArrayIterators.entries + , arrayLastIndexOf = ArrayProto.lastIndexOf + , arrayReduce = ArrayProto.reduce + , arrayReduceRight = ArrayProto.reduceRight + , arrayJoin = ArrayProto.join + , arraySort = ArrayProto.sort + , arraySlice = ArrayProto.slice + , arrayToString = ArrayProto.toString + , arrayToLocaleString = ArrayProto.toLocaleString + , ITERATOR = wks('iterator') + , TAG = wks('toStringTag') + , TYPED_CONSTRUCTOR = uid('typed_constructor') + , DEF_CONSTRUCTOR = uid('def_constructor') + , ALL_CONSTRUCTORS = $typed.CONSTR + , TYPED_ARRAY = $typed.TYPED + , VIEW = $typed.VIEW + , WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function(O, length){ + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function(){ + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){ + new Uint8Array(1).set({}); + }); + + var strictToLength = function(it, SAME){ + if(it === undefined)throw TypeError(WRONG_LENGTH); + var number = +it + , length = toLength(it); + if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH); + return length; + }; + + var toOffset = function(it, BYTES){ + var offset = toInteger(it); + if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function(it){ + if(isObject(it) && TYPED_ARRAY in it)return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function(C, length){ + if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){ + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function(O, list){ + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function(C, list){ + var index = 0 + , length = list.length + , result = allocate(C, length); + while(length > index)result[index] = list[index++]; + return result; + }; + + var addGetter = function(it, key, internal){ + dP(it, key, {get: function(){ return this._d[internal]; }}); + }; + + var $from = function from(source /*, mapfn, thisArg */){ + var O = toObject(source) + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , iterFn = getIterFn(O) + , i, length, values, result, step, iterator; + if(iterFn != undefined && !isArrayIter(iterFn)){ + for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){ + values.push(step.value); + } O = values; + } + if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2); + for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){ + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/*...items*/){ + var index = 0 + , length = arguments.length + , result = allocate(this, length); + while(length > index)result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString(){ + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /*, end */){ + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /*, thisArg */){ + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /*, thisArg */){ + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /*, thisArg */){ + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /*, thisArg */){ + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /*, thisArg */){ + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /*, fromIndex */){ + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /*, fromIndex */){ + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator){ // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /*, thisArg */){ + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse(){ + var that = this + , length = validate(that).length + , middle = Math.floor(length / 2) + , index = 0 + , value; + while(index < middle){ + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /*, thisArg */){ + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn){ + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end){ + var O = validate(this) + , length = O.length + , $begin = toIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end){ + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /*, offset */){ + validate(this); + var offset = toOffset(arguments[1], 1) + , length = this.length + , src = toObject(arrayLike) + , len = toLength(src.length) + , index = 0; + if(len + offset > length)throw RangeError(WRONG_LENGTH); + while(index < len)this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries(){ + return arrayEntries.call(validate(this)); + }, + keys: function keys(){ + return arrayKeys.call(validate(this)); + }, + values: function values(){ + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function(target, key){ + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key){ + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc){ + if(isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ){ + target[key] = desc.value; + return target; + } else return dP(target, key, desc); + }; + + if(!ALL_CONSTRUCTORS){ + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if(fails(function(){ arrayToString.call({}); })){ + arrayToString = arrayToLocaleString = function toString(){ + return arrayJoin.call(this); + } + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function(){ /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function(){ return this[TYPED_ARRAY]; } + }); + + module.exports = function(KEY, BYTES, wrapper, CLAMPED){ + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array' + , ISNT_UINT8 = NAME != 'Uint8Array' + , GETTER = 'get' + KEY + , SETTER = 'set' + KEY + , TypedArray = global[NAME] + , Base = TypedArray || {} + , TAC = TypedArray && getPrototypeOf(TypedArray) + , FORCED = !TypedArray || !$typed.ABV + , O = {} + , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function(that, index){ + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function(that, index, value){ + var data = that._d; + if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function(that, index){ + dP(that, index, { + get: function(){ + return getter(this, index); + }, + set: function(value){ + return setter(this, index, value); + }, + enumerable: true + }); + }; + if(FORCED){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME, '_d'); + var index = 0 + , offset = 0 + , buffer, byteLength, length, klass; + if(!isObject(data)){ + length = strictToLength(data, true) + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if($length === undefined){ + if($len % BYTES)throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if(byteLength < 0)throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if(TYPED_ARRAY in data){ + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while(index < length)addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if(!$iterDetect(function(iter){ + // V8 works with iterators, but fails in many other cases + // https://code.google.com/p/v8/issues/detail?id=4552 + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8)); + if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if(TYPED_ARRAY in data)return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){ + if(!(key in TypedArray))hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR] + , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined) + , $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){ + dP(TypedArrayPrototype, TAG, { + get: function(){ return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES, + from: $from, + of: $of + }); + + if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, {set: $set}); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString}); + + $export($export.P + $export.F * fails(function(){ + new TypedArray(1).slice(); + }), NAME, {slice: $slice}); + + $export($export.P + $export.F * (fails(function(){ + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString() + }) || !fails(function(){ + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, {toLocaleString: $toLocaleString}); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function(){ /* empty */ }; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_typed-buffer.js b/node_modules/core-js/library/modules/_typed-buffer.js new file mode 100755 index 00000000..2129eea4 --- /dev/null +++ b/node_modules/core-js/library/modules/_typed-buffer.js @@ -0,0 +1,273 @@ +'use strict'; +var global = require('./_global') + , DESCRIPTORS = require('./_descriptors') + , LIBRARY = require('./_library') + , $typed = require('./_typed') + , hide = require('./_hide') + , redefineAll = require('./_redefine-all') + , fails = require('./_fails') + , anInstance = require('./_an-instance') + , toInteger = require('./_to-integer') + , toLength = require('./_to-length') + , gOPN = require('./_object-gopn').f + , dP = require('./_object-dp').f + , arrayFill = require('./_array-fill') + , setToStringTag = require('./_set-to-string-tag') + , ARRAY_BUFFER = 'ArrayBuffer' + , DATA_VIEW = 'DataView' + , PROTOTYPE = 'prototype' + , WRONG_LENGTH = 'Wrong length!' + , WRONG_INDEX = 'Wrong index!' + , $ArrayBuffer = global[ARRAY_BUFFER] + , $DataView = global[DATA_VIEW] + , Math = global.Math + , RangeError = global.RangeError + , Infinity = global.Infinity + , BaseBuffer = $ArrayBuffer + , abs = Math.abs + , pow = Math.pow + , floor = Math.floor + , log = Math.log + , LN2 = Math.LN2 + , BUFFER = 'buffer' + , BYTE_LENGTH = 'byteLength' + , BYTE_OFFSET = 'byteOffset' + , $BUFFER = DESCRIPTORS ? '_b' : BUFFER + , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH + , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +var packIEEE754 = function(value, mLen, nBytes){ + var buffer = Array(nBytes) + , eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0 + , i = 0 + , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0 + , e, m, c; + value = abs(value) + if(value != value || value === Infinity){ + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if(value * (c = pow(2, -e)) < 1){ + e--; + c *= 2; + } + if(e + eBias >= 1){ + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if(value * c >= 2){ + e++; + c /= 2; + } + if(e + eBias >= eMax){ + m = 0; + e = eMax; + } else if(e + eBias >= 1){ + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +}; +var unpackIEEE754 = function(buffer, mLen, nBytes){ + var eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , nBits = eLen - 7 + , i = nBytes - 1 + , s = buffer[i--] + , e = s & 127 + , m; + s >>= 7; + for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if(e === 0){ + e = 1 - eBias; + } else if(e === eMax){ + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +}; + +var unpackI32 = function(bytes){ + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +}; +var packI8 = function(it){ + return [it & 0xff]; +}; +var packI16 = function(it){ + return [it & 0xff, it >> 8 & 0xff]; +}; +var packI32 = function(it){ + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +}; +var packF64 = function(it){ + return packIEEE754(it, 52, 8); +}; +var packF32 = function(it){ + return packIEEE754(it, 23, 4); +}; + +var addGetter = function(C, key, internal){ + dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }}); +}; + +var get = function(view, bytes, index, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +}; +var set = function(view, bytes, index, conversion, value, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = conversion(+value); + for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +}; + +var validateArrayBufferArguments = function(that, length){ + anInstance(that, $ArrayBuffer, ARRAY_BUFFER); + var numberLength = +length + , byteLength = toLength(numberLength); + if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); + return byteLength; +}; + +if(!$typed.ABV){ + $ArrayBuffer = function ArrayBuffer(length){ + var byteLength = validateArrayBufferArguments(this, length); + this._b = arrayFill.call(Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength){ + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH] + , offset = toInteger(byteOffset); + if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if(DESCRIPTORS){ + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset){ + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset){ + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){ + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if(!fails(function(){ + new $ArrayBuffer; // eslint-disable-line no-new + }) || !fails(function(){ + new $ArrayBuffer(.5); // eslint-disable-line no-new + })){ + $ArrayBuffer = function ArrayBuffer(length){ + return new BaseBuffer(validateArrayBufferArguments(this, length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){ + if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]); + }; + if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)) + , $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_typed.js b/node_modules/core-js/library/modules/_typed.js new file mode 100755 index 00000000..6ed2ab56 --- /dev/null +++ b/node_modules/core-js/library/modules/_typed.js @@ -0,0 +1,26 @@ +var global = require('./_global') + , hide = require('./_hide') + , uid = require('./_uid') + , TYPED = uid('typed_array') + , VIEW = uid('view') + , ABV = !!(global.ArrayBuffer && global.DataView) + , CONSTR = ABV + , i = 0, l = 9, Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while(i < l){ + if(Typed = global[TypedArrayConstructors[i++]]){ + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_uid.js b/node_modules/core-js/library/modules/_uid.js new file mode 100755 index 00000000..3be4196b --- /dev/null +++ b/node_modules/core-js/library/modules/_uid.js @@ -0,0 +1,5 @@ +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_wks-define.js b/node_modules/core-js/library/modules/_wks-define.js new file mode 100755 index 00000000..e6960328 --- /dev/null +++ b/node_modules/core-js/library/modules/_wks-define.js @@ -0,0 +1,9 @@ +var global = require('./_global') + , core = require('./_core') + , LIBRARY = require('./_library') + , wksExt = require('./_wks-ext') + , defineProperty = require('./_object-dp').f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_wks-ext.js b/node_modules/core-js/library/modules/_wks-ext.js new file mode 100755 index 00000000..7901def6 --- /dev/null +++ b/node_modules/core-js/library/modules/_wks-ext.js @@ -0,0 +1 @@ +exports.f = require('./_wks'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/_wks.js b/node_modules/core-js/library/modules/_wks.js new file mode 100755 index 00000000..36f7973a --- /dev/null +++ b/node_modules/core-js/library/modules/_wks.js @@ -0,0 +1,11 @@ +var store = require('./_shared')('wks') + , uid = require('./_uid') + , Symbol = require('./_global').Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.delay.js b/node_modules/core-js/library/modules/core.delay.js new file mode 100755 index 00000000..ea031be4 --- /dev/null +++ b/node_modules/core-js/library/modules/core.delay.js @@ -0,0 +1,12 @@ +var global = require('./_global') + , core = require('./_core') + , $export = require('./_export') + , partial = require('./_partial'); +// https://esdiscuss.org/topic/promise-returning-delay-function +$export($export.G + $export.F, { + delay: function delay(time){ + return new (core.Promise || global.Promise)(function(resolve){ + setTimeout(partial.call(resolve, true), time); + }); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.dict.js b/node_modules/core-js/library/modules/core.dict.js new file mode 100755 index 00000000..88c54e3d --- /dev/null +++ b/node_modules/core-js/library/modules/core.dict.js @@ -0,0 +1,155 @@ +'use strict'; +var ctx = require('./_ctx') + , $export = require('./_export') + , createDesc = require('./_property-desc') + , assign = require('./_object-assign') + , create = require('./_object-create') + , getPrototypeOf = require('./_object-gpo') + , getKeys = require('./_object-keys') + , dP = require('./_object-dp') + , keyOf = require('./_keyof') + , aFunction = require('./_a-function') + , forOf = require('./_for-of') + , isIterable = require('./core.is-iterable') + , $iterCreate = require('./_iter-create') + , step = require('./_iter-step') + , isObject = require('./_is-object') + , toIObject = require('./_to-iobject') + , DESCRIPTORS = require('./_descriptors') + , has = require('./_has'); + +// 0 -> Dict.forEach +// 1 -> Dict.map +// 2 -> Dict.filter +// 3 -> Dict.some +// 4 -> Dict.every +// 5 -> Dict.find +// 6 -> Dict.findKey +// 7 -> Dict.mapPairs +var createDictMethod = function(TYPE){ + var IS_MAP = TYPE == 1 + , IS_EVERY = TYPE == 4; + return function(object, callbackfn, that /* = undefined */){ + var f = ctx(callbackfn, that, 3) + , O = toIObject(object) + , result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict) : undefined + , key, val, res; + for(key in O)if(has(O, key)){ + val = O[key]; + res = f(val, key, object); + if(TYPE){ + if(IS_MAP)result[key] = res; // map + else if(res)switch(TYPE){ + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if(IS_EVERY)return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; +}; +var findKey = createDictMethod(6); + +var createDictIter = function(kind){ + return function(it){ + return new DictIterator(it, kind); + }; +}; +var DictIterator = function(iterated, kind){ + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind +}; +$iterCreate(DictIterator, 'Dict', function(){ + var that = this + , O = that._t + , keys = that._a + , kind = that._k + , key; + do { + if(that._i >= keys.length){ + that._t = undefined; + return step(1); + } + } while(!has(O, key = keys[that._i++])); + if(kind == 'keys' )return step(0, key); + if(kind == 'values')return step(0, O[key]); + return step(0, [key, O[key]]); +}); + +function Dict(iterable){ + var dict = create(null); + if(iterable != undefined){ + if(isIterable(iterable)){ + forOf(iterable, true, function(key, value){ + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; +} +Dict.prototype = null; + +function reduce(object, mapfn, init){ + aFunction(mapfn); + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , memo, key; + if(arguments.length < 3){ + if(!length)throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while(length > i)if(has(O, key = keys[i++])){ + memo = mapfn(memo, O[key], key, object); + } + return memo; +} + +function includes(object, el){ + return (el == el ? keyOf(object, el) : findKey(object, function(it){ + return it != it; + })) !== undefined; +} + +function get(object, key){ + if(has(object, key))return object[key]; +} +function set(object, key, value){ + if(DESCRIPTORS && key in Object)dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; +} + +function isDict(it){ + return isObject(it) && getPrototypeOf(it) === Dict.prototype; +} + +$export($export.G + $export.F, {Dict: Dict}); + +$export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.function.part.js b/node_modules/core-js/library/modules/core.function.part.js new file mode 100755 index 00000000..ce851ff8 --- /dev/null +++ b/node_modules/core-js/library/modules/core.function.part.js @@ -0,0 +1,7 @@ +var path = require('./_path') + , $export = require('./_export'); + +// Placeholder +require('./_core')._ = path._ = path._ || {}; + +$export($export.P + $export.F, 'Function', {part: require('./_partial')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.get-iterator-method.js b/node_modules/core-js/library/modules/core.get-iterator-method.js new file mode 100755 index 00000000..e2c7ecc3 --- /dev/null +++ b/node_modules/core-js/library/modules/core.get-iterator-method.js @@ -0,0 +1,8 @@ +var classof = require('./_classof') + , ITERATOR = require('./_wks')('iterator') + , Iterators = require('./_iterators'); +module.exports = require('./_core').getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.get-iterator.js b/node_modules/core-js/library/modules/core.get-iterator.js new file mode 100755 index 00000000..c292e1ab --- /dev/null +++ b/node_modules/core-js/library/modules/core.get-iterator.js @@ -0,0 +1,7 @@ +var anObject = require('./_an-object') + , get = require('./core.get-iterator-method'); +module.exports = require('./_core').getIterator = function(it){ + var iterFn = get(it); + if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.is-iterable.js b/node_modules/core-js/library/modules/core.is-iterable.js new file mode 100755 index 00000000..b2b01b6b --- /dev/null +++ b/node_modules/core-js/library/modules/core.is-iterable.js @@ -0,0 +1,9 @@ +var classof = require('./_classof') + , ITERATOR = require('./_wks')('iterator') + , Iterators = require('./_iterators'); +module.exports = require('./_core').isIterable = function(it){ + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + || Iterators.hasOwnProperty(classof(O)); +}; \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.number.iterator.js b/node_modules/core-js/library/modules/core.number.iterator.js new file mode 100755 index 00000000..9700acba --- /dev/null +++ b/node_modules/core-js/library/modules/core.number.iterator.js @@ -0,0 +1,9 @@ +'use strict'; +require('./_iter-define')(Number, 'Number', function(iterated){ + this._l = +iterated; + this._i = 0; +}, function(){ + var i = this._i++ + , done = !(i < this._l); + return {done: done, value: done ? undefined : i}; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.object.classof.js b/node_modules/core-js/library/modules/core.object.classof.js new file mode 100755 index 00000000..342c7371 --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.classof.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', {classof: require('./_classof')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.object.define.js b/node_modules/core-js/library/modules/core.object.define.js new file mode 100755 index 00000000..d60e9a95 --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.define.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , define = require('./_object-define'); + +$export($export.S + $export.F, 'Object', {define: define}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.object.is-object.js b/node_modules/core-js/library/modules/core.object.is-object.js new file mode 100755 index 00000000..f2ba059f --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.is-object.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', {isObject: require('./_is-object')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.object.make.js b/node_modules/core-js/library/modules/core.object.make.js new file mode 100755 index 00000000..3d2a2b5f --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.make.js @@ -0,0 +1,9 @@ +var $export = require('./_export') + , define = require('./_object-define') + , create = require('./_object-create'); + +$export($export.S + $export.F, 'Object', { + make: function(proto, mixin){ + return define(create(proto), mixin); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.regexp.escape.js b/node_modules/core-js/library/modules/core.regexp.escape.js new file mode 100755 index 00000000..54f832ef --- /dev/null +++ b/node_modules/core-js/library/modules/core.regexp.escape.js @@ -0,0 +1,5 @@ +// https://github.com/benjamingr/RexExp.escape +var $export = require('./_export') + , $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); diff --git a/node_modules/core-js/library/modules/core.string.escape-html.js b/node_modules/core-js/library/modules/core.string.escape-html.js new file mode 100755 index 00000000..a4b8d2f0 --- /dev/null +++ b/node_modules/core-js/library/modules/core.string.escape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}); + +$export($export.P + $export.F, 'String', {escapeHTML: function escapeHTML(){ return $re(this); }}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/core.string.unescape-html.js b/node_modules/core-js/library/modules/core.string.unescape-html.js new file mode 100755 index 00000000..413622b9 --- /dev/null +++ b/node_modules/core-js/library/modules/core.string.unescape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}); + +$export($export.P + $export.F, 'String', {unescapeHTML: function unescapeHTML(){ return $re(this); }}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es5.js b/node_modules/core-js/library/modules/es5.js new file mode 100755 index 00000000..dd7ebadf --- /dev/null +++ b/node_modules/core-js/library/modules/es5.js @@ -0,0 +1,35 @@ +// This file still here for a legacy code and will be removed in a near time +require('./es6.object.create'); +require('./es6.object.define-property'); +require('./es6.object.define-properties'); +require('./es6.object.get-own-property-descriptor'); +require('./es6.object.get-prototype-of'); +require('./es6.object.keys'); +require('./es6.object.get-own-property-names'); +require('./es6.object.freeze'); +require('./es6.object.seal'); +require('./es6.object.prevent-extensions'); +require('./es6.object.is-frozen'); +require('./es6.object.is-sealed'); +require('./es6.object.is-extensible'); +require('./es6.function.bind'); +require('./es6.array.is-array'); +require('./es6.array.join'); +require('./es6.array.slice'); +require('./es6.array.sort'); +require('./es6.array.for-each'); +require('./es6.array.map'); +require('./es6.array.filter'); +require('./es6.array.some'); +require('./es6.array.every'); +require('./es6.array.reduce'); +require('./es6.array.reduce-right'); +require('./es6.array.index-of'); +require('./es6.array.last-index-of'); +require('./es6.date.now'); +require('./es6.date.to-iso-string'); +require('./es6.date.to-json'); +require('./es6.parse-int'); +require('./es6.parse-float'); +require('./es6.string.trim'); +require('./es6.regexp.to-string'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.copy-within.js b/node_modules/core-js/library/modules/es6.array.copy-within.js new file mode 100755 index 00000000..027f7550 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.copy-within.js @@ -0,0 +1,6 @@ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', {copyWithin: require('./_array-copy-within')}); + +require('./_add-to-unscopables')('copyWithin'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.every.js b/node_modules/core-js/library/modules/es6.array.every.js new file mode 100755 index 00000000..fb067367 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.every.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $every = require('./_array-methods')(4); + +$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */){ + return $every(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.fill.js b/node_modules/core-js/library/modules/es6.array.fill.js new file mode 100755 index 00000000..f075c001 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.fill.js @@ -0,0 +1,6 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', {fill: require('./_array-fill')}); + +require('./_add-to-unscopables')('fill'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.filter.js b/node_modules/core-js/library/modules/es6.array.filter.js new file mode 100755 index 00000000..f60951d3 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.filter.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $filter = require('./_array-methods')(2); + +$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */){ + return $filter(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.find-index.js b/node_modules/core-js/library/modules/es6.array.find-index.js new file mode 100755 index 00000000..53090741 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.find-index.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = require('./_export') + , $find = require('./_array-methods')(6) + , KEY = 'findIndex' + , forced = true; +// Shouldn't skip holes +if(KEY in [])Array(1)[KEY](function(){ forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.find.js b/node_modules/core-js/library/modules/es6.array.find.js new file mode 100755 index 00000000..90a9acfb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.find.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = require('./_export') + , $find = require('./_array-methods')(5) + , KEY = 'find' + , forced = true; +// Shouldn't skip holes +if(KEY in [])Array(1)[KEY](function(){ forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.for-each.js b/node_modules/core-js/library/modules/es6.array.for-each.js new file mode 100755 index 00000000..f814fe4e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.for-each.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export') + , $forEach = require('./_array-methods')(0) + , STRICT = require('./_strict-method')([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */){ + return $forEach(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.from.js b/node_modules/core-js/library/modules/es6.array.from.js new file mode 100755 index 00000000..69e5d4a6 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.from.js @@ -0,0 +1,37 @@ +'use strict'; +var ctx = require('./_ctx') + , $export = require('./_export') + , toObject = require('./_to-object') + , call = require('./_iter-call') + , isArrayIter = require('./_is-array-iter') + , toLength = require('./_to-length') + , createProperty = require('./_create-property') + , getIterFn = require('./core.get-iterator-method'); + +$export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.index-of.js b/node_modules/core-js/library/modules/es6.array.index-of.js new file mode 100755 index 00000000..90376315 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.index-of.js @@ -0,0 +1,15 @@ +'use strict'; +var $export = require('./_export') + , $indexOf = require('./_array-includes')(false) + , $native = [].indexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /*, fromIndex = 0 */){ + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.is-array.js b/node_modules/core-js/library/modules/es6.array.is-array.js new file mode 100755 index 00000000..cd5d8c19 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.is-array.js @@ -0,0 +1,4 @@ +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = require('./_export'); + +$export($export.S, 'Array', {isArray: require('./_is-array')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.iterator.js b/node_modules/core-js/library/modules/es6.array.iterator.js new file mode 100755 index 00000000..100b344d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.iterator.js @@ -0,0 +1,34 @@ +'use strict'; +var addToUnscopables = require('./_add-to-unscopables') + , step = require('./_iter-step') + , Iterators = require('./_iterators') + , toIObject = require('./_to-iobject'); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = require('./_iter-define')(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.join.js b/node_modules/core-js/library/modules/es6.array.join.js new file mode 100755 index 00000000..1bb65653 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.join.js @@ -0,0 +1,12 @@ +'use strict'; +// 22.1.3.13 Array.prototype.join(separator) +var $export = require('./_export') + , toIObject = require('./_to-iobject') + , arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', { + join: function join(separator){ + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.last-index-of.js b/node_modules/core-js/library/modules/es6.array.last-index-of.js new file mode 100755 index 00000000..75c1eabf --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.last-index-of.js @@ -0,0 +1,22 @@ +'use strict'; +var $export = require('./_export') + , toIObject = require('./_to-iobject') + , toInteger = require('./_to-integer') + , toLength = require('./_to-length') + , $native = [].lastIndexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){ + // convert -0 to +0 + if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0; + var O = toIObject(this) + , length = toLength(O.length) + , index = length - 1; + if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1])); + if(index < 0)index = length + index; + for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0; + return -1; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.map.js b/node_modules/core-js/library/modules/es6.array.map.js new file mode 100755 index 00000000..f70089f3 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.map.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $map = require('./_array-methods')(1); + +$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */){ + return $map(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.of.js b/node_modules/core-js/library/modules/es6.array.of.js new file mode 100755 index 00000000..dd4e1f81 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.of.js @@ -0,0 +1,19 @@ +'use strict'; +var $export = require('./_export') + , createProperty = require('./_create-property'); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * require('./_fails')(function(){ + function F(){} + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */){ + var index = 0 + , aLen = arguments.length + , result = new (typeof this == 'function' ? this : Array)(aLen); + while(aLen > index)createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.reduce-right.js b/node_modules/core-js/library/modules/es6.array.reduce-right.js new file mode 100755 index 00000000..0c64d85e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.reduce-right.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.reduce.js b/node_modules/core-js/library/modules/es6.array.reduce.js new file mode 100755 index 00000000..491f7d25 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.reduce.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.slice.js b/node_modules/core-js/library/modules/es6.array.slice.js new file mode 100755 index 00000000..610bd399 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.slice.js @@ -0,0 +1,28 @@ +'use strict'; +var $export = require('./_export') + , html = require('./_html') + , cof = require('./_cof') + , toIndex = require('./_to-index') + , toLength = require('./_to-length') + , arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * require('./_fails')(function(){ + if(html)arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end){ + var len = toLength(this.length) + , klass = cof(this); + end = end === undefined ? len : end; + if(klass == 'Array')return arraySlice.call(this, begin, end); + var start = toIndex(begin, len) + , upTo = toIndex(end, len) + , size = toLength(upTo - start) + , cloned = Array(size) + , i = 0; + for(; i < size; i++)cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.some.js b/node_modules/core-js/library/modules/es6.array.some.js new file mode 100755 index 00000000..fa1095ed --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.some.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $some = require('./_array-methods')(3); + +$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */){ + return $some(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.sort.js b/node_modules/core-js/library/modules/es6.array.sort.js new file mode 100755 index 00000000..7de1fe77 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.sort.js @@ -0,0 +1,23 @@ +'use strict'; +var $export = require('./_export') + , aFunction = require('./_a-function') + , toObject = require('./_to-object') + , fails = require('./_fails') + , $sort = [].sort + , test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function(){ + // IE8- + test.sort(undefined); +}) || !fails(function(){ + // V8 bug + test.sort(null); + // Old WebKit +}) || !require('./_strict-method')($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn){ + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.array.species.js b/node_modules/core-js/library/modules/es6.array.species.js new file mode 100755 index 00000000..d63c738f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.species.js @@ -0,0 +1 @@ +require('./_set-species')('Array'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.date.now.js b/node_modules/core-js/library/modules/es6.date.now.js new file mode 100755 index 00000000..c3ee5fd7 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.date.now.js @@ -0,0 +1,4 @@ +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = require('./_export'); + +$export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.date.to-iso-string.js b/node_modules/core-js/library/modules/es6.date.to-iso-string.js new file mode 100755 index 00000000..2426c589 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.date.to-iso-string.js @@ -0,0 +1,28 @@ +'use strict'; +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = require('./_export') + , fails = require('./_fails') + , getTime = Date.prototype.getTime; + +var lz = function(num){ + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (fails(function(){ + return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z'; +}) || !fails(function(){ + new Date(NaN).toISOString(); +})), 'Date', { + toISOString: function toISOString(){ + if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value'); + var d = this + , y = d.getUTCFullYear() + , m = d.getUTCMilliseconds() + , s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.date.to-json.js b/node_modules/core-js/library/modules/es6.date.to-json.js new file mode 100755 index 00000000..eb419d03 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.date.to-json.js @@ -0,0 +1,14 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , toPrimitive = require('./_to-primitive'); + +$export($export.P + $export.F * require('./_fails')(function(){ + return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1; +}), 'Date', { + toJSON: function toJSON(key){ + var O = toObject(this) + , pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.date.to-primitive.js b/node_modules/core-js/library/modules/es6.date.to-primitive.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.date.to-string.js b/node_modules/core-js/library/modules/es6.date.to-string.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.function.bind.js b/node_modules/core-js/library/modules/es6.function.bind.js new file mode 100755 index 00000000..85f10379 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.function.bind.js @@ -0,0 +1,4 @@ +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = require('./_export'); + +$export($export.P, 'Function', {bind: require('./_bind')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.function.has-instance.js b/node_modules/core-js/library/modules/es6.function.has-instance.js new file mode 100755 index 00000000..ae294b1f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.function.has-instance.js @@ -0,0 +1,13 @@ +'use strict'; +var isObject = require('./_is-object') + , getPrototypeOf = require('./_object-gpo') + , HAS_INSTANCE = require('./_wks')('hasInstance') + , FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if(!(HAS_INSTANCE in FunctionProto))require('./_object-dp').f(FunctionProto, HAS_INSTANCE, {value: function(O){ + if(typeof this != 'function' || !isObject(O))return false; + if(!isObject(this.prototype))return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while(O = getPrototypeOf(O))if(this.prototype === O)return true; + return false; +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.function.name.js b/node_modules/core-js/library/modules/es6.function.name.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.map.js b/node_modules/core-js/library/modules/es6.map.js new file mode 100755 index 00000000..a166430f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.map.js @@ -0,0 +1,17 @@ +'use strict'; +var strong = require('./_collection-strong'); + +// 23.1 Map Objects +module.exports = require('./_collection')('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } +}, strong, true); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.acosh.js b/node_modules/core-js/library/modules/es6.math.acosh.js new file mode 100755 index 00000000..459f1199 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.acosh.js @@ -0,0 +1,18 @@ +// 20.2.2.3 Math.acosh(x) +var $export = require('./_export') + , log1p = require('./_math-log1p') + , sqrt = Math.sqrt + , $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x){ + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.asinh.js b/node_modules/core-js/library/modules/es6.math.asinh.js new file mode 100755 index 00000000..e6a74abb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.asinh.js @@ -0,0 +1,10 @@ +// 20.2.2.5 Math.asinh(x) +var $export = require('./_export') + , $asinh = Math.asinh; + +function asinh(x){ + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.atanh.js b/node_modules/core-js/library/modules/es6.math.atanh.js new file mode 100755 index 00000000..94575d9f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.atanh.js @@ -0,0 +1,10 @@ +// 20.2.2.7 Math.atanh(x) +var $export = require('./_export') + , $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x){ + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.cbrt.js b/node_modules/core-js/library/modules/es6.math.cbrt.js new file mode 100755 index 00000000..7ca7daea --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.cbrt.js @@ -0,0 +1,9 @@ +// 20.2.2.9 Math.cbrt(x) +var $export = require('./_export') + , sign = require('./_math-sign'); + +$export($export.S, 'Math', { + cbrt: function cbrt(x){ + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.clz32.js b/node_modules/core-js/library/modules/es6.math.clz32.js new file mode 100755 index 00000000..1ec534bd --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.clz32.js @@ -0,0 +1,8 @@ +// 20.2.2.11 Math.clz32(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + clz32: function clz32(x){ + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.cosh.js b/node_modules/core-js/library/modules/es6.math.cosh.js new file mode 100755 index 00000000..4f2b2155 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.cosh.js @@ -0,0 +1,9 @@ +// 20.2.2.12 Math.cosh(x) +var $export = require('./_export') + , exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x){ + return (exp(x = +x) + exp(-x)) / 2; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.expm1.js b/node_modules/core-js/library/modules/es6.math.expm1.js new file mode 100755 index 00000000..9762b7cd --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.expm1.js @@ -0,0 +1,5 @@ +// 20.2.2.14 Math.expm1(x) +var $export = require('./_export') + , $expm1 = require('./_math-expm1'); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.fround.js b/node_modules/core-js/library/modules/es6.math.fround.js new file mode 100755 index 00000000..01a88862 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.fround.js @@ -0,0 +1,26 @@ +// 20.2.2.16 Math.fround(x) +var $export = require('./_export') + , sign = require('./_math-sign') + , pow = Math.pow + , EPSILON = pow(2, -52) + , EPSILON32 = pow(2, -23) + , MAX32 = pow(2, 127) * (2 - EPSILON32) + , MIN32 = pow(2, -126); + +var roundTiesToEven = function(n){ + return n + 1 / EPSILON - 1 / EPSILON; +}; + + +$export($export.S, 'Math', { + fround: function fround(x){ + var $abs = Math.abs(x) + , $sign = sign(x) + , a, result; + if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + if(result > MAX32 || result != result)return $sign * Infinity; + return $sign * result; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.hypot.js b/node_modules/core-js/library/modules/es6.math.hypot.js new file mode 100755 index 00000000..508521b6 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.hypot.js @@ -0,0 +1,25 @@ +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = require('./_export') + , abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars + var sum = 0 + , i = 0 + , aLen = arguments.length + , larg = 0 + , arg, div; + while(i < aLen){ + arg = abs(arguments[i++]); + if(larg < arg){ + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if(arg > 0){ + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.imul.js b/node_modules/core-js/library/modules/es6.math.imul.js new file mode 100755 index 00000000..7f4111d2 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.imul.js @@ -0,0 +1,17 @@ +// 20.2.2.18 Math.imul(x, y) +var $export = require('./_export') + , $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * require('./_fails')(function(){ + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y){ + var UINT16 = 0xffff + , xn = +x + , yn = +y + , xl = UINT16 & xn + , yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.log10.js b/node_modules/core-js/library/modules/es6.math.log10.js new file mode 100755 index 00000000..791dfc35 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.log10.js @@ -0,0 +1,8 @@ +// 20.2.2.21 Math.log10(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log10: function log10(x){ + return Math.log(x) / Math.LN10; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.log1p.js b/node_modules/core-js/library/modules/es6.math.log1p.js new file mode 100755 index 00000000..a1de0258 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +var $export = require('./_export'); + +$export($export.S, 'Math', {log1p: require('./_math-log1p')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.log2.js b/node_modules/core-js/library/modules/es6.math.log2.js new file mode 100755 index 00000000..c4ba7819 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.log2.js @@ -0,0 +1,8 @@ +// 20.2.2.22 Math.log2(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log2: function log2(x){ + return Math.log(x) / Math.LN2; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.sign.js b/node_modules/core-js/library/modules/es6.math.sign.js new file mode 100755 index 00000000..5dbee6f6 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.sign.js @@ -0,0 +1,4 @@ +// 20.2.2.28 Math.sign(x) +var $export = require('./_export'); + +$export($export.S, 'Math', {sign: require('./_math-sign')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.sinh.js b/node_modules/core-js/library/modules/es6.math.sinh.js new file mode 100755 index 00000000..5464ae3e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.sinh.js @@ -0,0 +1,15 @@ +// 20.2.2.30 Math.sinh(x) +var $export = require('./_export') + , expm1 = require('./_math-expm1') + , exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * require('./_fails')(function(){ + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x){ + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.tanh.js b/node_modules/core-js/library/modules/es6.math.tanh.js new file mode 100755 index 00000000..d2f10778 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.tanh.js @@ -0,0 +1,12 @@ +// 20.2.2.33 Math.tanh(x) +var $export = require('./_export') + , expm1 = require('./_math-expm1') + , exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x){ + var a = expm1(x = +x) + , b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.math.trunc.js b/node_modules/core-js/library/modules/es6.math.trunc.js new file mode 100755 index 00000000..2e42563b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.trunc.js @@ -0,0 +1,8 @@ +// 20.2.2.34 Math.trunc(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + trunc: function trunc(it){ + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.constructor.js b/node_modules/core-js/library/modules/es6.number.constructor.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.number.epsilon.js b/node_modules/core-js/library/modules/es6.number.epsilon.js new file mode 100755 index 00000000..d25898cc --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.epsilon.js @@ -0,0 +1,4 @@ +// 20.1.2.1 Number.EPSILON +var $export = require('./_export'); + +$export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.is-finite.js b/node_modules/core-js/library/modules/es6.number.is-finite.js new file mode 100755 index 00000000..c8c42753 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-finite.js @@ -0,0 +1,9 @@ +// 20.1.2.2 Number.isFinite(number) +var $export = require('./_export') + , _isFinite = require('./_global').isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it){ + return typeof it == 'number' && _isFinite(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.is-integer.js b/node_modules/core-js/library/modules/es6.number.is-integer.js new file mode 100755 index 00000000..dc0f8f00 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.3 Number.isInteger(number) +var $export = require('./_export'); + +$export($export.S, 'Number', {isInteger: require('./_is-integer')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.is-nan.js b/node_modules/core-js/library/modules/es6.number.is-nan.js new file mode 100755 index 00000000..5fedf825 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-nan.js @@ -0,0 +1,8 @@ +// 20.1.2.4 Number.isNaN(number) +var $export = require('./_export'); + +$export($export.S, 'Number', { + isNaN: function isNaN(number){ + return number != number; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.is-safe-integer.js b/node_modules/core-js/library/modules/es6.number.is-safe-integer.js new file mode 100755 index 00000000..92193e2e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-safe-integer.js @@ -0,0 +1,10 @@ +// 20.1.2.5 Number.isSafeInteger(number) +var $export = require('./_export') + , isInteger = require('./_is-integer') + , abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number){ + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.max-safe-integer.js b/node_modules/core-js/library/modules/es6.number.max-safe-integer.js new file mode 100755 index 00000000..b9d7f2a7 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.max-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.min-safe-integer.js b/node_modules/core-js/library/modules/es6.number.min-safe-integer.js new file mode 100755 index 00000000..9a2beeb3 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.min-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.parse-float.js b/node_modules/core-js/library/modules/es6.number.parse-float.js new file mode 100755 index 00000000..7ee14da0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseFloat = require('./_parse-float'); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.parse-int.js b/node_modules/core-js/library/modules/es6.number.parse-int.js new file mode 100755 index 00000000..59bf1445 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseInt = require('./_parse-int'); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.to-fixed.js b/node_modules/core-js/library/modules/es6.number.to-fixed.js new file mode 100755 index 00000000..c54970d6 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.to-fixed.js @@ -0,0 +1,113 @@ +'use strict'; +var $export = require('./_export') + , toInteger = require('./_to-integer') + , aNumberValue = require('./_a-number-value') + , repeat = require('./_string-repeat') + , $toFixed = 1..toFixed + , floor = Math.floor + , data = [0, 0, 0, 0, 0, 0] + , ERROR = 'Number.toFixed: incorrect invocation!' + , ZERO = '0'; + +var multiply = function(n, c){ + var i = -1 + , c2 = c; + while(++i < 6){ + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function(n){ + var i = 6 + , c = 0; + while(--i >= 0){ + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function(){ + var i = 6 + , s = ''; + while(--i >= 0){ + if(s !== '' || i === 0 || data[i] !== 0){ + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function(x, n, acc){ + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function(x){ + var n = 0 + , x2 = x; + while(x2 >= 4096){ + n += 12; + x2 /= 4096; + } + while(x2 >= 2){ + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128..toFixed(0) !== '1000000000000000128' +) || !require('./_fails')(function(){ + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits){ + var x = aNumberValue(this, ERROR) + , f = toInteger(fractionDigits) + , s = '' + , m = ZERO + , e, z, j, k; + if(f < 0 || f > 20)throw RangeError(ERROR); + if(x != x)return 'NaN'; + if(x <= -1e21 || x >= 1e21)return String(x); + if(x < 0){ + s = '-'; + x = -x; + } + if(x > 1e-21){ + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if(e > 0){ + multiply(0, z); + j = f; + while(j >= 7){ + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while(j >= 23){ + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if(f > 0){ + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.number.to-precision.js b/node_modules/core-js/library/modules/es6.number.to-precision.js new file mode 100755 index 00000000..903dacdf --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.to-precision.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export') + , $fails = require('./_fails') + , aNumberValue = require('./_a-number-value') + , $toPrecision = 1..toPrecision; + +$export($export.P + $export.F * ($fails(function(){ + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function(){ + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision){ + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.assign.js b/node_modules/core-js/library/modules/es6.object.assign.js new file mode 100755 index 00000000..13eda2cb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.assign.js @@ -0,0 +1,4 @@ +// 19.1.3.1 Object.assign(target, source) +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', {assign: require('./_object-assign')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.create.js b/node_modules/core-js/library/modules/es6.object.create.js new file mode 100755 index 00000000..17e4b284 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.create.js @@ -0,0 +1,3 @@ +var $export = require('./_export') +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', {create: require('./_object-create')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.define-properties.js b/node_modules/core-js/library/modules/es6.object.define-properties.js new file mode 100755 index 00000000..183eec6f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.define-properties.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperties: require('./_object-dps')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.define-property.js b/node_modules/core-js/library/modules/es6.object.define-property.js new file mode 100755 index 00000000..71807cc0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.define-property.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.freeze.js b/node_modules/core-js/library/modules/es6.object.freeze.js new file mode 100755 index 00000000..34b51084 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.freeze.js @@ -0,0 +1,9 @@ +// 19.1.2.5 Object.freeze(O) +var isObject = require('./_is-object') + , meta = require('./_meta').onFreeze; + +require('./_object-sap')('freeze', function($freeze){ + return function freeze(it){ + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js b/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js new file mode 100755 index 00000000..60c69913 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js @@ -0,0 +1,9 @@ +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = require('./_to-iobject') + , $getOwnPropertyDescriptor = require('./_object-gopd').f; + +require('./_object-sap')('getOwnPropertyDescriptor', function(){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.get-own-property-names.js b/node_modules/core-js/library/modules/es6.object.get-own-property-names.js new file mode 100755 index 00000000..91dd110d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.get-own-property-names.js @@ -0,0 +1,4 @@ +// 19.1.2.7 Object.getOwnPropertyNames(O) +require('./_object-sap')('getOwnPropertyNames', function(){ + return require('./_object-gopn-ext').f; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.get-prototype-of.js b/node_modules/core-js/library/modules/es6.object.get-prototype-of.js new file mode 100755 index 00000000..b124e28f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.get-prototype-of.js @@ -0,0 +1,9 @@ +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = require('./_to-object') + , $getPrototypeOf = require('./_object-gpo'); + +require('./_object-sap')('getPrototypeOf', function(){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.is-extensible.js b/node_modules/core-js/library/modules/es6.object.is-extensible.js new file mode 100755 index 00000000..94bf8a81 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is-extensible.js @@ -0,0 +1,8 @@ +// 19.1.2.11 Object.isExtensible(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isExtensible', function($isExtensible){ + return function isExtensible(it){ + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.is-frozen.js b/node_modules/core-js/library/modules/es6.object.is-frozen.js new file mode 100755 index 00000000..4bdfd11b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is-frozen.js @@ -0,0 +1,8 @@ +// 19.1.2.12 Object.isFrozen(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isFrozen', function($isFrozen){ + return function isFrozen(it){ + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.is-sealed.js b/node_modules/core-js/library/modules/es6.object.is-sealed.js new file mode 100755 index 00000000..d13aa1b0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is-sealed.js @@ -0,0 +1,8 @@ +// 19.1.2.13 Object.isSealed(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isSealed', function($isSealed){ + return function isSealed(it){ + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.is.js b/node_modules/core-js/library/modules/es6.object.is.js new file mode 100755 index 00000000..ad299425 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is.js @@ -0,0 +1,3 @@ +// 19.1.3.10 Object.is(value1, value2) +var $export = require('./_export'); +$export($export.S, 'Object', {is: require('./_same-value')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.keys.js b/node_modules/core-js/library/modules/es6.object.keys.js new file mode 100755 index 00000000..bf76c07d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.keys.js @@ -0,0 +1,9 @@ +// 19.1.2.14 Object.keys(O) +var toObject = require('./_to-object') + , $keys = require('./_object-keys'); + +require('./_object-sap')('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.prevent-extensions.js b/node_modules/core-js/library/modules/es6.object.prevent-extensions.js new file mode 100755 index 00000000..adaff7a7 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.prevent-extensions.js @@ -0,0 +1,9 @@ +// 19.1.2.15 Object.preventExtensions(O) +var isObject = require('./_is-object') + , meta = require('./_meta').onFreeze; + +require('./_object-sap')('preventExtensions', function($preventExtensions){ + return function preventExtensions(it){ + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.seal.js b/node_modules/core-js/library/modules/es6.object.seal.js new file mode 100755 index 00000000..d7e4ea95 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.seal.js @@ -0,0 +1,9 @@ +// 19.1.2.17 Object.seal(O) +var isObject = require('./_is-object') + , meta = require('./_meta').onFreeze; + +require('./_object-sap')('seal', function($seal){ + return function seal(it){ + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.set-prototype-of.js b/node_modules/core-js/library/modules/es6.object.set-prototype-of.js new file mode 100755 index 00000000..5bbe4c06 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.set-prototype-of.js @@ -0,0 +1,3 @@ +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = require('./_export'); +$export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.object.to-string.js b/node_modules/core-js/library/modules/es6.object.to-string.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.parse-float.js b/node_modules/core-js/library/modules/es6.parse-float.js new file mode 100755 index 00000000..5201712b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseFloat = require('./_parse-float'); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.parse-int.js b/node_modules/core-js/library/modules/es6.parse-int.js new file mode 100755 index 00000000..5a2bfaff --- /dev/null +++ b/node_modules/core-js/library/modules/es6.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseInt = require('./_parse-int'); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.promise.js b/node_modules/core-js/library/modules/es6.promise.js new file mode 100755 index 00000000..262a93af --- /dev/null +++ b/node_modules/core-js/library/modules/es6.promise.js @@ -0,0 +1,299 @@ +'use strict'; +var LIBRARY = require('./_library') + , global = require('./_global') + , ctx = require('./_ctx') + , classof = require('./_classof') + , $export = require('./_export') + , isObject = require('./_is-object') + , aFunction = require('./_a-function') + , anInstance = require('./_an-instance') + , forOf = require('./_for-of') + , speciesConstructor = require('./_species-constructor') + , task = require('./_task').set + , microtask = require('./_microtask')() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + +var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } +}(); + +// helpers +var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; +}; +var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); +}; +var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; +var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } +}; +var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); +}; +var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); +}; +var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; +}; +var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); +}; +var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } +}; + +// constructor polyfill +if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = require('./_redefine-all')($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); +require('./_set-to-string-tag')($Promise, PROMISE); +require('./_set-species')(PROMISE); +Wrapper = require('./_core')[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } +}); +$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function(iter){ + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.apply.js b/node_modules/core-js/library/modules/es6.reflect.apply.js new file mode 100755 index 00000000..24ea80f5 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.apply.js @@ -0,0 +1,16 @@ +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = require('./_export') + , aFunction = require('./_a-function') + , anObject = require('./_an-object') + , rApply = (require('./_global').Reflect || {}).apply + , fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !require('./_fails')(function(){ + rApply(function(){}); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList){ + var T = aFunction(target) + , L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.construct.js b/node_modules/core-js/library/modules/es6.reflect.construct.js new file mode 100755 index 00000000..96483d70 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.construct.js @@ -0,0 +1,47 @@ +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = require('./_export') + , create = require('./_object-create') + , aFunction = require('./_a-function') + , anObject = require('./_an-object') + , isObject = require('./_is-object') + , fails = require('./_fails') + , bind = require('./_bind') + , rConstruct = (require('./_global').Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function(){ + function F(){} + return !(rConstruct(function(){}, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function(){ + rConstruct(function(){}); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /*, newTarget*/){ + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget); + if(Target == newTarget){ + // w/o altered newTarget, optimization for 0-4 arguments + switch(args.length){ + case 0: return new Target; + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype + , instance = create(isObject(proto) ? proto : Object.prototype) + , result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.define-property.js b/node_modules/core-js/library/modules/es6.reflect.define-property.js new file mode 100755 index 00000000..485d43c4 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.define-property.js @@ -0,0 +1,22 @@ +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = require('./_object-dp') + , $export = require('./_export') + , anObject = require('./_an-object') + , toPrimitive = require('./_to-primitive'); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * require('./_fails')(function(){ + Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2}); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes){ + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch(e){ + return false; + } + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.delete-property.js b/node_modules/core-js/library/modules/es6.reflect.delete-property.js new file mode 100755 index 00000000..4e8ce207 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.delete-property.js @@ -0,0 +1,11 @@ +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = require('./_export') + , gOPD = require('./_object-gopd').f + , anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey){ + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.enumerate.js b/node_modules/core-js/library/modules/es6.reflect.enumerate.js new file mode 100755 index 00000000..abdb132d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.enumerate.js @@ -0,0 +1,26 @@ +'use strict'; +// 26.1.5 Reflect.enumerate(target) +var $export = require('./_export') + , anObject = require('./_an-object'); +var Enumerate = function(iterated){ + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = [] // keys + , key; + for(key in iterated)keys.push(key); +}; +require('./_iter-create')(Enumerate, 'Object', function(){ + var that = this + , keys = that._k + , key; + do { + if(that._i >= keys.length)return {value: undefined, done: true}; + } while(!((key = keys[that._i++]) in that._t)); + return {value: key, done: false}; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target){ + return new Enumerate(target); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js b/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js new file mode 100755 index 00000000..741a13eb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js @@ -0,0 +1,10 @@ +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = require('./_object-gopd') + , $export = require('./_export') + , anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ + return gOPD.f(anObject(target), propertyKey); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js b/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js new file mode 100755 index 00000000..4f912d10 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js @@ -0,0 +1,10 @@ +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = require('./_export') + , getProto = require('./_object-gpo') + , anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target){ + return getProto(anObject(target)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.get.js b/node_modules/core-js/library/modules/es6.reflect.get.js new file mode 100755 index 00000000..f8c39f50 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.get.js @@ -0,0 +1,21 @@ +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = require('./_object-gopd') + , getPrototypeOf = require('./_object-gpo') + , has = require('./_has') + , $export = require('./_export') + , isObject = require('./_is-object') + , anObject = require('./_an-object'); + +function get(target, propertyKey/*, receiver*/){ + var receiver = arguments.length < 3 ? target : arguments[2] + , desc, proto; + if(anObject(target) === receiver)return target[propertyKey]; + if(desc = gOPD.f(target, propertyKey))return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', {get: get}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.has.js b/node_modules/core-js/library/modules/es6.reflect.has.js new file mode 100755 index 00000000..bbb6dbcd --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.has.js @@ -0,0 +1,8 @@ +// 26.1.9 Reflect.has(target, propertyKey) +var $export = require('./_export'); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey){ + return propertyKey in target; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.is-extensible.js b/node_modules/core-js/library/modules/es6.reflect.is-extensible.js new file mode 100755 index 00000000..ffbc2848 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.is-extensible.js @@ -0,0 +1,11 @@ +// 26.1.10 Reflect.isExtensible(target) +var $export = require('./_export') + , anObject = require('./_an-object') + , $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target){ + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.own-keys.js b/node_modules/core-js/library/modules/es6.reflect.own-keys.js new file mode 100755 index 00000000..a1e5330c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.own-keys.js @@ -0,0 +1,4 @@ +// 26.1.11 Reflect.ownKeys(target) +var $export = require('./_export'); + +$export($export.S, 'Reflect', {ownKeys: require('./_own-keys')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js b/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js new file mode 100755 index 00000000..d3dad8ee --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js @@ -0,0 +1,16 @@ +// 26.1.12 Reflect.preventExtensions(target) +var $export = require('./_export') + , anObject = require('./_an-object') + , $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target){ + anObject(target); + try { + if($preventExtensions)$preventExtensions(target); + return true; + } catch(e){ + return false; + } + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js b/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js new file mode 100755 index 00000000..b79d9b61 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js @@ -0,0 +1,15 @@ +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = require('./_export') + , setProto = require('./_set-proto'); + +if(setProto)$export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto){ + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch(e){ + return false; + } + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.reflect.set.js b/node_modules/core-js/library/modules/es6.reflect.set.js new file mode 100755 index 00000000..c6b916a2 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.set.js @@ -0,0 +1,31 @@ +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = require('./_object-dp') + , gOPD = require('./_object-gopd') + , getPrototypeOf = require('./_object-gpo') + , has = require('./_has') + , $export = require('./_export') + , createDesc = require('./_property-desc') + , anObject = require('./_an-object') + , isObject = require('./_is-object'); + +function set(target, propertyKey, V/*, receiver*/){ + var receiver = arguments.length < 4 ? target : arguments[3] + , ownDesc = gOPD.f(anObject(target), propertyKey) + , existingDescriptor, proto; + if(!ownDesc){ + if(isObject(proto = getPrototypeOf(target))){ + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if(has(ownDesc, 'value')){ + if(ownDesc.writable === false || !isObject(receiver))return false; + existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', {set: set}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.regexp.constructor.js b/node_modules/core-js/library/modules/es6.regexp.constructor.js new file mode 100755 index 00000000..7313c52b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.regexp.constructor.js @@ -0,0 +1 @@ +require('./_set-species')('RegExp'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.regexp.flags.js b/node_modules/core-js/library/modules/es6.regexp.flags.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.regexp.match.js b/node_modules/core-js/library/modules/es6.regexp.match.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.regexp.replace.js b/node_modules/core-js/library/modules/es6.regexp.replace.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.regexp.search.js b/node_modules/core-js/library/modules/es6.regexp.search.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.regexp.split.js b/node_modules/core-js/library/modules/es6.regexp.split.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.regexp.to-string.js b/node_modules/core-js/library/modules/es6.regexp.to-string.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/library/modules/es6.set.js b/node_modules/core-js/library/modules/es6.set.js new file mode 100755 index 00000000..a1880881 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.set.js @@ -0,0 +1,12 @@ +'use strict'; +var strong = require('./_collection-strong'); + +// 23.2 Set Objects +module.exports = require('./_collection')('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } +}, strong); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.anchor.js b/node_modules/core-js/library/modules/es6.string.anchor.js new file mode 100755 index 00000000..65db2521 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.anchor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.2 String.prototype.anchor(name) +require('./_string-html')('anchor', function(createHTML){ + return function anchor(name){ + return createHTML(this, 'a', 'name', name); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.big.js b/node_modules/core-js/library/modules/es6.string.big.js new file mode 100755 index 00000000..aeeb1aba --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.big.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.3 String.prototype.big() +require('./_string-html')('big', function(createHTML){ + return function big(){ + return createHTML(this, 'big', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.blink.js b/node_modules/core-js/library/modules/es6.string.blink.js new file mode 100755 index 00000000..aef8da2e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.blink.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.4 String.prototype.blink() +require('./_string-html')('blink', function(createHTML){ + return function blink(){ + return createHTML(this, 'blink', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.bold.js b/node_modules/core-js/library/modules/es6.string.bold.js new file mode 100755 index 00000000..022cdb07 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.bold.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.5 String.prototype.bold() +require('./_string-html')('bold', function(createHTML){ + return function bold(){ + return createHTML(this, 'b', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.code-point-at.js b/node_modules/core-js/library/modules/es6.string.code-point-at.js new file mode 100755 index 00000000..cf544652 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.code-point-at.js @@ -0,0 +1,9 @@ +'use strict'; +var $export = require('./_export') + , $at = require('./_string-at')(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos){ + return $at(this, pos); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.ends-with.js b/node_modules/core-js/library/modules/es6.string.ends-with.js new file mode 100755 index 00000000..80baed9a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.ends-with.js @@ -0,0 +1,20 @@ +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) +'use strict'; +var $export = require('./_export') + , toLength = require('./_to-length') + , context = require('./_string-context') + , ENDS_WITH = 'endsWith' + , $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /*, endPosition = @length */){ + var that = context(this, searchString, ENDS_WITH) + , endPosition = arguments.length > 1 ? arguments[1] : undefined + , len = toLength(that.length) + , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) + , search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.fixed.js b/node_modules/core-js/library/modules/es6.string.fixed.js new file mode 100755 index 00000000..d017e202 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.fixed.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.6 String.prototype.fixed() +require('./_string-html')('fixed', function(createHTML){ + return function fixed(){ + return createHTML(this, 'tt', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.fontcolor.js b/node_modules/core-js/library/modules/es6.string.fontcolor.js new file mode 100755 index 00000000..d40711f0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.fontcolor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.7 String.prototype.fontcolor(color) +require('./_string-html')('fontcolor', function(createHTML){ + return function fontcolor(color){ + return createHTML(this, 'font', 'color', color); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.fontsize.js b/node_modules/core-js/library/modules/es6.string.fontsize.js new file mode 100755 index 00000000..ba3ff980 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.fontsize.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.8 String.prototype.fontsize(size) +require('./_string-html')('fontsize', function(createHTML){ + return function fontsize(size){ + return createHTML(this, 'font', 'size', size); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.from-code-point.js b/node_modules/core-js/library/modules/es6.string.from-code-point.js new file mode 100755 index 00000000..c8776d87 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.from-code-point.js @@ -0,0 +1,23 @@ +var $export = require('./_export') + , toIndex = require('./_to-index') + , fromCharCode = String.fromCharCode + , $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars + var res = [] + , aLen = arguments.length + , i = 0 + , code; + while(aLen > i){ + code = +arguments[i++]; + if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.includes.js b/node_modules/core-js/library/modules/es6.string.includes.js new file mode 100755 index 00000000..c6b4ee2f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.includes.js @@ -0,0 +1,12 @@ +// 21.1.3.7 String.prototype.includes(searchString, position = 0) +'use strict'; +var $export = require('./_export') + , context = require('./_string-context') + , INCLUDES = 'includes'; + +$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', { + includes: function includes(searchString /*, position = 0 */){ + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.italics.js b/node_modules/core-js/library/modules/es6.string.italics.js new file mode 100755 index 00000000..d33efd3c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.italics.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.9 String.prototype.italics() +require('./_string-html')('italics', function(createHTML){ + return function italics(){ + return createHTML(this, 'i', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.iterator.js b/node_modules/core-js/library/modules/es6.string.iterator.js new file mode 100755 index 00000000..ac391ee4 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.iterator.js @@ -0,0 +1,17 @@ +'use strict'; +var $at = require('./_string-at')(true); + +// 21.1.3.27 String.prototype[@@iterator]() +require('./_iter-define')(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.link.js b/node_modules/core-js/library/modules/es6.string.link.js new file mode 100755 index 00000000..6a75c18a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.link.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.10 String.prototype.link(url) +require('./_string-html')('link', function(createHTML){ + return function link(url){ + return createHTML(this, 'a', 'href', url); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.raw.js b/node_modules/core-js/library/modules/es6.string.raw.js new file mode 100755 index 00000000..1016acfa --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.raw.js @@ -0,0 +1,18 @@ +var $export = require('./_export') + , toIObject = require('./_to-iobject') + , toLength = require('./_to-length'); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite){ + var tpl = toIObject(callSite.raw) + , len = toLength(tpl.length) + , aLen = arguments.length + , res = [] + , i = 0; + while(len > i){ + res.push(String(tpl[i++])); + if(i < aLen)res.push(String(arguments[i])); + } return res.join(''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.repeat.js b/node_modules/core-js/library/modules/es6.string.repeat.js new file mode 100755 index 00000000..a054222d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.repeat.js @@ -0,0 +1,6 @@ +var $export = require('./_export'); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: require('./_string-repeat') +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.small.js b/node_modules/core-js/library/modules/es6.string.small.js new file mode 100755 index 00000000..51b1b30d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.small.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.11 String.prototype.small() +require('./_string-html')('small', function(createHTML){ + return function small(){ + return createHTML(this, 'small', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.starts-with.js b/node_modules/core-js/library/modules/es6.string.starts-with.js new file mode 100755 index 00000000..017805f0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.starts-with.js @@ -0,0 +1,18 @@ +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) +'use strict'; +var $export = require('./_export') + , toLength = require('./_to-length') + , context = require('./_string-context') + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.strike.js b/node_modules/core-js/library/modules/es6.string.strike.js new file mode 100755 index 00000000..c6287d3a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.strike.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.12 String.prototype.strike() +require('./_string-html')('strike', function(createHTML){ + return function strike(){ + return createHTML(this, 'strike', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.sub.js b/node_modules/core-js/library/modules/es6.string.sub.js new file mode 100755 index 00000000..ee18ea7a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.sub.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.13 String.prototype.sub() +require('./_string-html')('sub', function(createHTML){ + return function sub(){ + return createHTML(this, 'sub', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.sup.js b/node_modules/core-js/library/modules/es6.string.sup.js new file mode 100755 index 00000000..a3429988 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.sup.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.14 String.prototype.sup() +require('./_string-html')('sup', function(createHTML){ + return function sup(){ + return createHTML(this, 'sup', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.string.trim.js b/node_modules/core-js/library/modules/es6.string.trim.js new file mode 100755 index 00000000..35f0fb0b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.trim.js @@ -0,0 +1,7 @@ +'use strict'; +// 21.1.3.25 String.prototype.trim() +require('./_string-trim')('trim', function($trim){ + return function trim(){ + return $trim(this, 3); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.symbol.js b/node_modules/core-js/library/modules/es6.symbol.js new file mode 100755 index 00000000..eae491c5 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.symbol.js @@ -0,0 +1,235 @@ +'use strict'; +// ECMAScript 6 symbols shim +var global = require('./_global') + , has = require('./_has') + , DESCRIPTORS = require('./_descriptors') + , $export = require('./_export') + , redefine = require('./_redefine') + , META = require('./_meta').KEY + , $fails = require('./_fails') + , shared = require('./_shared') + , setToStringTag = require('./_set-to-string-tag') + , uid = require('./_uid') + , wks = require('./_wks') + , wksExt = require('./_wks-ext') + , wksDefine = require('./_wks-define') + , keyOf = require('./_keyof') + , enumKeys = require('./_enum-keys') + , isArray = require('./_is-array') + , anObject = require('./_an-object') + , toIObject = require('./_to-iobject') + , toPrimitive = require('./_to-primitive') + , createDesc = require('./_property-desc') + , _create = require('./_object-create') + , gOPNExt = require('./_object-gopn-ext') + , $GOPD = require('./_object-gopd') + , $DP = require('./_object-dp') + , $keys = require('./_object-keys') + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; +}) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; +} : function(it){ + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; + require('./_object-pie').f = $propertyIsEnumerable; + require('./_object-gops').f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !require('./_library')){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + +for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + +for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.array-buffer.js b/node_modules/core-js/library/modules/es6.typed.array-buffer.js new file mode 100755 index 00000000..9f47082c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.array-buffer.js @@ -0,0 +1,46 @@ +'use strict'; +var $export = require('./_export') + , $typed = require('./_typed') + , buffer = require('./_typed-buffer') + , anObject = require('./_an-object') + , toIndex = require('./_to-index') + , toLength = require('./_to-length') + , isObject = require('./_is-object') + , ArrayBuffer = require('./_global').ArrayBuffer + , speciesConstructor = require('./_species-constructor') + , $ArrayBuffer = buffer.ArrayBuffer + , $DataView = buffer.DataView + , $isView = $typed.ABV && ArrayBuffer.isView + , $slice = $ArrayBuffer.prototype.slice + , VIEW = $typed.VIEW + , ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer}); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it){ + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * require('./_fails')(function(){ + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end){ + if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength + , first = toIndex(start, len) + , final = toIndex(end === undefined ? len : end, len) + , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first)) + , viewS = new $DataView(this) + , viewT = new $DataView(result) + , index = 0; + while(first < final){ + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +require('./_set-species')(ARRAY_BUFFER); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.data-view.js b/node_modules/core-js/library/modules/es6.typed.data-view.js new file mode 100755 index 00000000..ee7b8812 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.data-view.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +$export($export.G + $export.W + $export.F * !require('./_typed').ABV, { + DataView: require('./_typed-buffer').DataView +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.float32-array.js b/node_modules/core-js/library/modules/es6.typed.float32-array.js new file mode 100755 index 00000000..2c4c9a69 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.float32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float32', 4, function(init){ + return function Float32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.float64-array.js b/node_modules/core-js/library/modules/es6.typed.float64-array.js new file mode 100755 index 00000000..4b20257f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.float64-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float64', 8, function(init){ + return function Float64Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.int16-array.js b/node_modules/core-js/library/modules/es6.typed.int16-array.js new file mode 100755 index 00000000..d3f61c56 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.int16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int16', 2, function(init){ + return function Int16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.int32-array.js b/node_modules/core-js/library/modules/es6.typed.int32-array.js new file mode 100755 index 00000000..df47c1bb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.int32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int32', 4, function(init){ + return function Int32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.int8-array.js b/node_modules/core-js/library/modules/es6.typed.int8-array.js new file mode 100755 index 00000000..da4dbf0a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.int8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int8', 1, function(init){ + return function Int8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.uint16-array.js b/node_modules/core-js/library/modules/es6.typed.uint16-array.js new file mode 100755 index 00000000..cb335773 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint16', 2, function(init){ + return function Uint16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.uint32-array.js b/node_modules/core-js/library/modules/es6.typed.uint32-array.js new file mode 100755 index 00000000..41c9e7b8 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint32', 4, function(init){ + return function Uint32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.uint8-array.js b/node_modules/core-js/library/modules/es6.typed.uint8-array.js new file mode 100755 index 00000000..f794f86c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function(init){ + return function Uint8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js b/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js new file mode 100755 index 00000000..b1230479 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function(init){ + return function Uint8ClampedArray(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}, true); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.weak-map.js b/node_modules/core-js/library/modules/es6.weak-map.js new file mode 100755 index 00000000..4109db33 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.weak-map.js @@ -0,0 +1,56 @@ +'use strict'; +var each = require('./_array-methods')(0) + , redefine = require('./_redefine') + , meta = require('./_meta') + , assign = require('./_object-assign') + , weak = require('./_collection-weak') + , isObject = require('./_is-object') + , getWeak = meta.getWeak + , isExtensible = Object.isExtensible + , uncaughtFrozenStore = weak.ufstore + , tmp = {} + , InternalMap; + +var wrapper = function(get){ + return function WeakMap(){ + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}; + +var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key){ + if(isObject(key)){ + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value){ + return weak.def(this, key, value); + } +}; + +// 23.3 WeakMap Objects +var $WeakMap = module.exports = require('./_collection')('WeakMap', wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ + InternalMap = weak.getConstructor(wrapper); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function(key){ + var proto = $WeakMap.prototype + , method = proto[key]; + redefine(proto, key, function(a, b){ + // store frozen objects on internal weakmap shim + if(isObject(a) && !isExtensible(a)){ + if(!this._f)this._f = new InternalMap; + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); +} \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es6.weak-set.js b/node_modules/core-js/library/modules/es6.weak-set.js new file mode 100755 index 00000000..77d01b6b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.weak-set.js @@ -0,0 +1,12 @@ +'use strict'; +var weak = require('./_collection-weak'); + +// 23.4 WeakSet Objects +require('./_collection')('WeakSet', function(get){ + return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value){ + return weak.def(this, value, true); + } +}, weak, false, true); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.array.includes.js b/node_modules/core-js/library/modules/es7.array.includes.js new file mode 100755 index 00000000..6d5b0090 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.array.includes.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/Array.prototype.includes +var $export = require('./_export') + , $includes = require('./_array-includes')(true); + +$export($export.P, 'Array', { + includes: function includes(el /*, fromIndex = 0 */){ + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +require('./_add-to-unscopables')('includes'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.asap.js b/node_modules/core-js/library/modules/es7.asap.js new file mode 100755 index 00000000..b762b49a --- /dev/null +++ b/node_modules/core-js/library/modules/es7.asap.js @@ -0,0 +1,12 @@ +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = require('./_export') + , microtask = require('./_microtask')() + , process = require('./_global').process + , isNode = require('./_cof')(process) == 'process'; + +$export($export.G, { + asap: function asap(fn){ + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.error.is-error.js b/node_modules/core-js/library/modules/es7.error.is-error.js new file mode 100755 index 00000000..d6fe29dc --- /dev/null +++ b/node_modules/core-js/library/modules/es7.error.is-error.js @@ -0,0 +1,9 @@ +// https://github.com/ljharb/proposal-is-error +var $export = require('./_export') + , cof = require('./_cof'); + +$export($export.S, 'Error', { + isError: function isError(it){ + return cof(it) === 'Error'; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.map.to-json.js b/node_modules/core-js/library/modules/es7.map.to-json.js new file mode 100755 index 00000000..19f9b6d3 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.map.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Map', {toJSON: require('./_collection-to-json')('Map')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.math.iaddh.js b/node_modules/core-js/library/modules/es7.math.iaddh.js new file mode 100755 index 00000000..bb3f3d38 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.iaddh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.math.imulh.js b/node_modules/core-js/library/modules/es7.math.imulh.js new file mode 100755 index 00000000..a25da686 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.imulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + imulh: function imulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >> 16 + , v1 = $v >> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.math.isubh.js b/node_modules/core-js/library/modules/es7.math.isubh.js new file mode 100755 index 00000000..3814dc29 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.isubh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.math.umulh.js b/node_modules/core-js/library/modules/es7.math.umulh.js new file mode 100755 index 00000000..0d22cf1b --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.umulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + umulh: function umulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >>> 16 + , v1 = $v >>> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.define-getter.js b/node_modules/core-js/library/modules/es7.object.define-getter.js new file mode 100755 index 00000000..f206e96a --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.define-getter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , aFunction = require('./_a-function') + , $defineProperty = require('./_object-dp'); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineGetter__: function __defineGetter__(P, getter){ + $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.define-setter.js b/node_modules/core-js/library/modules/es7.object.define-setter.js new file mode 100755 index 00000000..c0f7b700 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.define-setter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , aFunction = require('./_a-function') + , $defineProperty = require('./_object-dp'); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineSetter__: function __defineSetter__(P, setter){ + $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.entries.js b/node_modules/core-js/library/modules/es7.object.entries.js new file mode 100755 index 00000000..cfc049df --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.entries.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export') + , $entries = require('./_object-to-array')(true); + +$export($export.S, 'Object', { + entries: function entries(it){ + return $entries(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.enumerable-entries.js b/node_modules/core-js/library/modules/es7.object.enumerable-entries.js new file mode 100755 index 00000000..5daa803b --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.enumerable-entries.js @@ -0,0 +1,12 @@ +// https://github.com/leobalter/object-enumerables +var $export = require('./_export') + , toObject = require('./_to-object'); + +$export($export.S, 'Object', { + enumerableEntries: function enumerableEntries(O){ + var T = toObject(O) + , properties = []; + for(var key in T)properties.push([key, T[key]]); + return properties; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.enumerable-keys.js b/node_modules/core-js/library/modules/es7.object.enumerable-keys.js new file mode 100755 index 00000000..791ec184 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.enumerable-keys.js @@ -0,0 +1,12 @@ +// https://github.com/leobalter/object-enumerables +var $export = require('./_export') + , toObject = require('./_to-object'); + +$export($export.S, 'Object', { + enumerableKeys: function enumerableKeys(O){ + var T = toObject(O) + , properties = []; + for(var key in T)properties.push(key); + return properties; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.enumerable-values.js b/node_modules/core-js/library/modules/es7.object.enumerable-values.js new file mode 100755 index 00000000..1d1bfaa7 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.enumerable-values.js @@ -0,0 +1,12 @@ +// https://github.com/leobalter/object-enumerables +var $export = require('./_export') + , toObject = require('./_to-object'); + +$export($export.S, 'Object', { + enumerableValues: function enumerableValues(O){ + var T = toObject(O) + , properties = []; + for(var key in T)properties.push(T[key]); + return properties; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js b/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js new file mode 100755 index 00000000..0242b7a0 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js @@ -0,0 +1,19 @@ +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = require('./_export') + , ownKeys = require('./_own-keys') + , toIObject = require('./_to-iobject') + , gOPD = require('./_object-gopd') + , createProperty = require('./_create-property'); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ + var O = toIObject(object) + , getDesc = gOPD.f + , keys = ownKeys(O) + , result = {} + , i = 0 + , key; + while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key)); + return result; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.lookup-getter.js b/node_modules/core-js/library/modules/es7.object.lookup-getter.js new file mode 100755 index 00000000..ec140345 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.lookup-getter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , toPrimitive = require('./_to-primitive') + , getPrototypeOf = require('./_object-gpo') + , getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupGetter__: function __lookupGetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.get; + } while(O = getPrototypeOf(O)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.lookup-setter.js b/node_modules/core-js/library/modules/es7.object.lookup-setter.js new file mode 100755 index 00000000..539dda82 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.lookup-setter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , toPrimitive = require('./_to-primitive') + , getPrototypeOf = require('./_object-gpo') + , getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupSetter__: function __lookupSetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.set; + } while(O = getPrototypeOf(O)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.object.values.js b/node_modules/core-js/library/modules/es7.object.values.js new file mode 100755 index 00000000..42abd640 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.values.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export') + , $values = require('./_object-to-array')(false); + +$export($export.S, 'Object', { + values: function values(it){ + return $values(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.observable.js b/node_modules/core-js/library/modules/es7.observable.js new file mode 100755 index 00000000..e34fa4f2 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.observable.js @@ -0,0 +1,199 @@ +'use strict'; +// https://github.com/zenparsing/es-observable +var $export = require('./_export') + , global = require('./_global') + , core = require('./_core') + , microtask = require('./_microtask')() + , OBSERVABLE = require('./_wks')('observable') + , aFunction = require('./_a-function') + , anObject = require('./_an-object') + , anInstance = require('./_an-instance') + , redefineAll = require('./_redefine-all') + , hide = require('./_hide') + , forOf = require('./_for-of') + , RETURN = forOf.RETURN; + +var getMethod = function(fn){ + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function(subscription){ + var cleanup = subscription._c; + if(cleanup){ + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function(subscription){ + return subscription._o === undefined; +}; + +var closeSubscription = function(subscription){ + if(!subscriptionClosed(subscription)){ + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function(observer, subscriber){ + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer) + , subscription = cleanup; + if(cleanup != null){ + if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch(e){ + observer.error(e); + return; + } if(subscriptionClosed(this))cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe(){ closeSubscription(this); } +}); + +var SubscriptionObserver = function(subscription){ + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if(m)return m.call(observer, value); + } catch(e){ + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value){ + var subscription = this._s; + if(subscriptionClosed(subscription))throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if(!m)throw value; + value = m.call(observer, value); + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber){ + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer){ + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn){ + var that = this; + return new (core.Promise || global.Promise)(function(resolve, reject){ + aFunction(fn); + var subscription = that.subscribe({ + next : function(value){ + try { + return fn(value); + } catch(e){ + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x){ + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if(method){ + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function(observer){ + return observable.subscribe(observer); + }); + } + return new C(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + try { + if(forOf(x, false, function(it){ + observer.next(it); + if(done)return RETURN; + }) === RETURN)return; + } catch(e){ + if(done)throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + }, + of: function of(){ + for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + for(var i = 0; i < items.length; ++i){ + observer.next(items[i]); + if(done)return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function(){ return this; }); + +$export($export.G, {Observable: $Observable}); + +require('./_set-species')('Observable'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.define-metadata.js b/node_modules/core-js/library/modules/es7.reflect.define-metadata.js new file mode 100755 index 00000000..c833e431 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.define-metadata.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js b/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js new file mode 100755 index 00000000..8a8a8253 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js @@ -0,0 +1,15 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , toMetaKey = metadata.key + , getOrCreateMetadataMap = metadata.map + , store = metadata.store; + +metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){ + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]) + , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false; + if(metadataMap.size)return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js b/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js new file mode 100755 index 00000000..58c4dcc2 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js @@ -0,0 +1,19 @@ +var Set = require('./es6.set') + , from = require('./_array-from-iterable') + , metadata = require('./_metadata') + , anObject = require('./_an-object') + , getPrototypeOf = require('./_object-gpo') + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function(O, P){ + var oKeys = ordinaryOwnMetadataKeys(O, P) + , parent = getPrototypeOf(O); + if(parent === null)return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.get-metadata.js b/node_modules/core-js/library/modules/es7.reflect.get-metadata.js new file mode 100755 index 00000000..48cd9d67 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-metadata.js @@ -0,0 +1,17 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , getPrototypeOf = require('./_object-gpo') + , ordinaryHasOwnMetadata = metadata.has + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + +var ordinaryGetMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js new file mode 100755 index 00000000..93ecfbe5 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + +metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js new file mode 100755 index 00000000..f1040f91 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + +metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.has-metadata.js b/node_modules/core-js/library/modules/es7.reflect.has-metadata.js new file mode 100755 index 00000000..0ff63786 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.has-metadata.js @@ -0,0 +1,16 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , getPrototypeOf = require('./_object-gpo') + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + +var ordinaryHasMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js b/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js new file mode 100755 index 00000000..d645ea3f --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + +metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.reflect.metadata.js b/node_modules/core-js/library/modules/es7.reflect.metadata.js new file mode 100755 index 00000000..3a4e3aee --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.metadata.js @@ -0,0 +1,15 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , aFunction = require('./_a-function') + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({metadata: function metadata(metadataKey, metadataValue){ + return function decorator(target, targetKey){ + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +}}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.set.to-json.js b/node_modules/core-js/library/modules/es7.set.to-json.js new file mode 100755 index 00000000..fd68cb51 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.set.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Set', {toJSON: require('./_collection-to-json')('Set')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.string.at.js b/node_modules/core-js/library/modules/es7.string.at.js new file mode 100755 index 00000000..208654e6 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.at.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/mathiasbynens/String.prototype.at +var $export = require('./_export') + , $at = require('./_string-at')(true); + +$export($export.P, 'String', { + at: function at(pos){ + return $at(this, pos); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.string.match-all.js b/node_modules/core-js/library/modules/es7.string.match-all.js new file mode 100755 index 00000000..cb0099b3 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.match-all.js @@ -0,0 +1,30 @@ +'use strict'; +// https://tc39.github.io/String.prototype.matchAll/ +var $export = require('./_export') + , defined = require('./_defined') + , toLength = require('./_to-length') + , isRegExp = require('./_is-regexp') + , getFlags = require('./_flags') + , RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function(regexp, string){ + this._r = regexp; + this._s = string; +}; + +require('./_iter-create')($RegExpStringIterator, 'RegExp String', function next(){ + var match = this._r.exec(this._s); + return {value: match, done: match === null}; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp){ + defined(this); + if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!'); + var S = String(this) + , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp) + , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.string.pad-end.js b/node_modules/core-js/library/modules/es7.string.pad-end.js new file mode 100755 index 00000000..8483d82f --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.pad-end.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export') + , $pad = require('./_string-pad'); + +$export($export.P, 'String', { + padEnd: function padEnd(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.string.pad-start.js b/node_modules/core-js/library/modules/es7.string.pad-start.js new file mode 100755 index 00000000..b79b605d --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.pad-start.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export') + , $pad = require('./_string-pad'); + +$export($export.P, 'String', { + padStart: function padStart(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.string.trim-left.js b/node_modules/core-js/library/modules/es7.string.trim-left.js new file mode 100755 index 00000000..e5845771 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.trim-left.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimLeft', function($trim){ + return function trimLeft(){ + return $trim(this, 1); + }; +}, 'trimStart'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.string.trim-right.js b/node_modules/core-js/library/modules/es7.string.trim-right.js new file mode 100755 index 00000000..42a9ed33 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.trim-right.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimRight', function($trim){ + return function trimRight(){ + return $trim(this, 2); + }; +}, 'trimEnd'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.symbol.async-iterator.js b/node_modules/core-js/library/modules/es7.symbol.async-iterator.js new file mode 100755 index 00000000..cf9f74a5 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.symbol.async-iterator.js @@ -0,0 +1 @@ +require('./_wks-define')('asyncIterator'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.symbol.observable.js b/node_modules/core-js/library/modules/es7.symbol.observable.js new file mode 100755 index 00000000..0163bca5 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.symbol.observable.js @@ -0,0 +1 @@ +require('./_wks-define')('observable'); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/es7.system.global.js b/node_modules/core-js/library/modules/es7.system.global.js new file mode 100755 index 00000000..8c2ab82d --- /dev/null +++ b/node_modules/core-js/library/modules/es7.system.global.js @@ -0,0 +1,4 @@ +// https://github.com/ljharb/proposal-global +var $export = require('./_export'); + +$export($export.S, 'System', {global: require('./_global')}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/web.dom.iterable.js b/node_modules/core-js/library/modules/web.dom.iterable.js new file mode 100755 index 00000000..e56371a9 --- /dev/null +++ b/node_modules/core-js/library/modules/web.dom.iterable.js @@ -0,0 +1,13 @@ +require('./es6.array.iterator'); +var global = require('./_global') + , hide = require('./_hide') + , Iterators = require('./_iterators') + , TO_STRING_TAG = require('./_wks')('toStringTag'); + +for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype; + if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} \ No newline at end of file diff --git a/node_modules/core-js/library/modules/web.immediate.js b/node_modules/core-js/library/modules/web.immediate.js new file mode 100755 index 00000000..5b946377 --- /dev/null +++ b/node_modules/core-js/library/modules/web.immediate.js @@ -0,0 +1,6 @@ +var $export = require('./_export') + , $task = require('./_task'); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); \ No newline at end of file diff --git a/node_modules/core-js/library/modules/web.timers.js b/node_modules/core-js/library/modules/web.timers.js new file mode 100755 index 00000000..1a1da57f --- /dev/null +++ b/node_modules/core-js/library/modules/web.timers.js @@ -0,0 +1,20 @@ +// ie9- setTimeout & setInterval additional parameters fix +var global = require('./_global') + , $export = require('./_export') + , invoke = require('./_invoke') + , partial = require('./_partial') + , navigator = global.navigator + , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check +var wrap = function(set){ + return MSIE ? function(fn, time /*, ...args */){ + return set(invoke( + partial, + [].slice.call(arguments, 2), + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); \ No newline at end of file diff --git a/node_modules/core-js/library/shim.js b/node_modules/core-js/library/shim.js new file mode 100755 index 00000000..6db12568 --- /dev/null +++ b/node_modules/core-js/library/shim.js @@ -0,0 +1,176 @@ +require('./modules/es6.symbol'); +require('./modules/es6.object.create'); +require('./modules/es6.object.define-property'); +require('./modules/es6.object.define-properties'); +require('./modules/es6.object.get-own-property-descriptor'); +require('./modules/es6.object.get-prototype-of'); +require('./modules/es6.object.keys'); +require('./modules/es6.object.get-own-property-names'); +require('./modules/es6.object.freeze'); +require('./modules/es6.object.seal'); +require('./modules/es6.object.prevent-extensions'); +require('./modules/es6.object.is-frozen'); +require('./modules/es6.object.is-sealed'); +require('./modules/es6.object.is-extensible'); +require('./modules/es6.object.assign'); +require('./modules/es6.object.is'); +require('./modules/es6.object.set-prototype-of'); +require('./modules/es6.object.to-string'); +require('./modules/es6.function.bind'); +require('./modules/es6.function.name'); +require('./modules/es6.function.has-instance'); +require('./modules/es6.parse-int'); +require('./modules/es6.parse-float'); +require('./modules/es6.number.constructor'); +require('./modules/es6.number.to-fixed'); +require('./modules/es6.number.to-precision'); +require('./modules/es6.number.epsilon'); +require('./modules/es6.number.is-finite'); +require('./modules/es6.number.is-integer'); +require('./modules/es6.number.is-nan'); +require('./modules/es6.number.is-safe-integer'); +require('./modules/es6.number.max-safe-integer'); +require('./modules/es6.number.min-safe-integer'); +require('./modules/es6.number.parse-float'); +require('./modules/es6.number.parse-int'); +require('./modules/es6.math.acosh'); +require('./modules/es6.math.asinh'); +require('./modules/es6.math.atanh'); +require('./modules/es6.math.cbrt'); +require('./modules/es6.math.clz32'); +require('./modules/es6.math.cosh'); +require('./modules/es6.math.expm1'); +require('./modules/es6.math.fround'); +require('./modules/es6.math.hypot'); +require('./modules/es6.math.imul'); +require('./modules/es6.math.log10'); +require('./modules/es6.math.log1p'); +require('./modules/es6.math.log2'); +require('./modules/es6.math.sign'); +require('./modules/es6.math.sinh'); +require('./modules/es6.math.tanh'); +require('./modules/es6.math.trunc'); +require('./modules/es6.string.from-code-point'); +require('./modules/es6.string.raw'); +require('./modules/es6.string.trim'); +require('./modules/es6.string.iterator'); +require('./modules/es6.string.code-point-at'); +require('./modules/es6.string.ends-with'); +require('./modules/es6.string.includes'); +require('./modules/es6.string.repeat'); +require('./modules/es6.string.starts-with'); +require('./modules/es6.string.anchor'); +require('./modules/es6.string.big'); +require('./modules/es6.string.blink'); +require('./modules/es6.string.bold'); +require('./modules/es6.string.fixed'); +require('./modules/es6.string.fontcolor'); +require('./modules/es6.string.fontsize'); +require('./modules/es6.string.italics'); +require('./modules/es6.string.link'); +require('./modules/es6.string.small'); +require('./modules/es6.string.strike'); +require('./modules/es6.string.sub'); +require('./modules/es6.string.sup'); +require('./modules/es6.date.now'); +require('./modules/es6.date.to-json'); +require('./modules/es6.date.to-iso-string'); +require('./modules/es6.date.to-string'); +require('./modules/es6.date.to-primitive'); +require('./modules/es6.array.is-array'); +require('./modules/es6.array.from'); +require('./modules/es6.array.of'); +require('./modules/es6.array.join'); +require('./modules/es6.array.slice'); +require('./modules/es6.array.sort'); +require('./modules/es6.array.for-each'); +require('./modules/es6.array.map'); +require('./modules/es6.array.filter'); +require('./modules/es6.array.some'); +require('./modules/es6.array.every'); +require('./modules/es6.array.reduce'); +require('./modules/es6.array.reduce-right'); +require('./modules/es6.array.index-of'); +require('./modules/es6.array.last-index-of'); +require('./modules/es6.array.copy-within'); +require('./modules/es6.array.fill'); +require('./modules/es6.array.find'); +require('./modules/es6.array.find-index'); +require('./modules/es6.array.species'); +require('./modules/es6.array.iterator'); +require('./modules/es6.regexp.constructor'); +require('./modules/es6.regexp.to-string'); +require('./modules/es6.regexp.flags'); +require('./modules/es6.regexp.match'); +require('./modules/es6.regexp.replace'); +require('./modules/es6.regexp.search'); +require('./modules/es6.regexp.split'); +require('./modules/es6.promise'); +require('./modules/es6.map'); +require('./modules/es6.set'); +require('./modules/es6.weak-map'); +require('./modules/es6.weak-set'); +require('./modules/es6.typed.array-buffer'); +require('./modules/es6.typed.data-view'); +require('./modules/es6.typed.int8-array'); +require('./modules/es6.typed.uint8-array'); +require('./modules/es6.typed.uint8-clamped-array'); +require('./modules/es6.typed.int16-array'); +require('./modules/es6.typed.uint16-array'); +require('./modules/es6.typed.int32-array'); +require('./modules/es6.typed.uint32-array'); +require('./modules/es6.typed.float32-array'); +require('./modules/es6.typed.float64-array'); +require('./modules/es6.reflect.apply'); +require('./modules/es6.reflect.construct'); +require('./modules/es6.reflect.define-property'); +require('./modules/es6.reflect.delete-property'); +require('./modules/es6.reflect.enumerate'); +require('./modules/es6.reflect.get'); +require('./modules/es6.reflect.get-own-property-descriptor'); +require('./modules/es6.reflect.get-prototype-of'); +require('./modules/es6.reflect.has'); +require('./modules/es6.reflect.is-extensible'); +require('./modules/es6.reflect.own-keys'); +require('./modules/es6.reflect.prevent-extensions'); +require('./modules/es6.reflect.set'); +require('./modules/es6.reflect.set-prototype-of'); +require('./modules/es7.array.includes'); +require('./modules/es7.string.at'); +require('./modules/es7.string.pad-start'); +require('./modules/es7.string.pad-end'); +require('./modules/es7.string.trim-left'); +require('./modules/es7.string.trim-right'); +require('./modules/es7.string.match-all'); +require('./modules/es7.symbol.async-iterator'); +require('./modules/es7.symbol.observable'); +require('./modules/es7.object.get-own-property-descriptors'); +require('./modules/es7.object.values'); +require('./modules/es7.object.entries'); +require('./modules/es7.object.define-getter'); +require('./modules/es7.object.define-setter'); +require('./modules/es7.object.lookup-getter'); +require('./modules/es7.object.lookup-setter'); +require('./modules/es7.map.to-json'); +require('./modules/es7.set.to-json'); +require('./modules/es7.system.global'); +require('./modules/es7.error.is-error'); +require('./modules/es7.math.iaddh'); +require('./modules/es7.math.isubh'); +require('./modules/es7.math.imulh'); +require('./modules/es7.math.umulh'); +require('./modules/es7.reflect.define-metadata'); +require('./modules/es7.reflect.delete-metadata'); +require('./modules/es7.reflect.get-metadata'); +require('./modules/es7.reflect.get-metadata-keys'); +require('./modules/es7.reflect.get-own-metadata'); +require('./modules/es7.reflect.get-own-metadata-keys'); +require('./modules/es7.reflect.has-metadata'); +require('./modules/es7.reflect.has-own-metadata'); +require('./modules/es7.reflect.metadata'); +require('./modules/es7.asap'); +require('./modules/es7.observable'); +require('./modules/web.timers'); +require('./modules/web.immediate'); +require('./modules/web.dom.iterable'); +module.exports = require('./modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/stage/0.js b/node_modules/core-js/library/stage/0.js new file mode 100755 index 00000000..e89a005f --- /dev/null +++ b/node_modules/core-js/library/stage/0.js @@ -0,0 +1,10 @@ +require('../modules/es7.string.at'); +require('../modules/es7.map.to-json'); +require('../modules/es7.set.to-json'); +require('../modules/es7.error.is-error'); +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +require('../modules/es7.asap'); +module.exports = require('./1'); \ No newline at end of file diff --git a/node_modules/core-js/library/stage/1.js b/node_modules/core-js/library/stage/1.js new file mode 100755 index 00000000..230fe13a --- /dev/null +++ b/node_modules/core-js/library/stage/1.js @@ -0,0 +1,6 @@ +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.string.match-all'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +module.exports = require('./2'); diff --git a/node_modules/core-js/library/stage/2.js b/node_modules/core-js/library/stage/2.js new file mode 100755 index 00000000..ba444e1a --- /dev/null +++ b/node_modules/core-js/library/stage/2.js @@ -0,0 +1,3 @@ +require('../modules/es7.system.global'); +require('../modules/es7.symbol.async-iterator'); +module.exports = require('./3'); diff --git a/node_modules/core-js/library/stage/3.js b/node_modules/core-js/library/stage/3.js new file mode 100755 index 00000000..c1ea400a --- /dev/null +++ b/node_modules/core-js/library/stage/3.js @@ -0,0 +1,4 @@ +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +module.exports = require('./4'); diff --git a/node_modules/core-js/library/stage/4.js b/node_modules/core-js/library/stage/4.js new file mode 100755 index 00000000..0fb53ddd --- /dev/null +++ b/node_modules/core-js/library/stage/4.js @@ -0,0 +1,8 @@ +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.array.includes'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/stage/index.js b/node_modules/core-js/library/stage/index.js new file mode 100755 index 00000000..eb959140 --- /dev/null +++ b/node_modules/core-js/library/stage/index.js @@ -0,0 +1 @@ +module.exports = require('./pre'); \ No newline at end of file diff --git a/node_modules/core-js/library/stage/pre.js b/node_modules/core-js/library/stage/pre.js new file mode 100755 index 00000000..f3bc54d9 --- /dev/null +++ b/node_modules/core-js/library/stage/pre.js @@ -0,0 +1,10 @@ +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +module.exports = require('./0'); \ No newline at end of file diff --git a/node_modules/core-js/library/web/dom-collections.js b/node_modules/core-js/library/web/dom-collections.js new file mode 100755 index 00000000..2118e3fe --- /dev/null +++ b/node_modules/core-js/library/web/dom-collections.js @@ -0,0 +1,2 @@ +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/web/immediate.js b/node_modules/core-js/library/web/immediate.js new file mode 100755 index 00000000..244ebb16 --- /dev/null +++ b/node_modules/core-js/library/web/immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/web/index.js b/node_modules/core-js/library/web/index.js new file mode 100755 index 00000000..6687d571 --- /dev/null +++ b/node_modules/core-js/library/web/index.js @@ -0,0 +1,4 @@ +require('../modules/web.timers'); +require('../modules/web.immediate'); +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/library/web/timers.js b/node_modules/core-js/library/web/timers.js new file mode 100755 index 00000000..2c66f438 --- /dev/null +++ b/node_modules/core-js/library/web/timers.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/modules/_a-function.js b/node_modules/core-js/modules/_a-function.js new file mode 100755 index 00000000..8c35f451 --- /dev/null +++ b/node_modules/core-js/modules/_a-function.js @@ -0,0 +1,4 @@ +module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_a-number-value.js b/node_modules/core-js/modules/_a-number-value.js new file mode 100755 index 00000000..7bcbd7b7 --- /dev/null +++ b/node_modules/core-js/modules/_a-number-value.js @@ -0,0 +1,5 @@ +var cof = require('./_cof'); +module.exports = function(it, msg){ + if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); + return +it; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_add-to-unscopables.js b/node_modules/core-js/modules/_add-to-unscopables.js new file mode 100755 index 00000000..0a74baea --- /dev/null +++ b/node_modules/core-js/modules/_add-to-unscopables.js @@ -0,0 +1,7 @@ +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = require('./_wks')('unscopables') + , ArrayProto = Array.prototype; +if(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABLES, {}); +module.exports = function(key){ + ArrayProto[UNSCOPABLES][key] = true; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_an-instance.js b/node_modules/core-js/modules/_an-instance.js new file mode 100755 index 00000000..e4dfad3d --- /dev/null +++ b/node_modules/core-js/modules/_an-instance.js @@ -0,0 +1,5 @@ +module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_an-object.js b/node_modules/core-js/modules/_an-object.js new file mode 100755 index 00000000..59a8a3a3 --- /dev/null +++ b/node_modules/core-js/modules/_an-object.js @@ -0,0 +1,5 @@ +var isObject = require('./_is-object'); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_array-copy-within.js b/node_modules/core-js/modules/_array-copy-within.js new file mode 100755 index 00000000..d901a32f --- /dev/null +++ b/node_modules/core-js/modules/_array-copy-within.js @@ -0,0 +1,26 @@ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +'use strict'; +var toObject = require('./_to-object') + , toIndex = require('./_to-index') + , toLength = require('./_to-length'); + +module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){ + var O = toObject(this) + , len = toLength(O.length) + , to = toIndex(target, len) + , from = toIndex(start, len) + , end = arguments.length > 2 ? arguments[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_array-fill.js b/node_modules/core-js/modules/_array-fill.js new file mode 100755 index 00000000..b21bb7ed --- /dev/null +++ b/node_modules/core-js/modules/_array-fill.js @@ -0,0 +1,15 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +'use strict'; +var toObject = require('./_to-object') + , toIndex = require('./_to-index') + , toLength = require('./_to-length'); +module.exports = function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , aLen = arguments.length + , index = toIndex(aLen > 1 ? arguments[1] : undefined, length) + , end = aLen > 2 ? arguments[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_array-from-iterable.js b/node_modules/core-js/modules/_array-from-iterable.js new file mode 100755 index 00000000..b5c454fb --- /dev/null +++ b/node_modules/core-js/modules/_array-from-iterable.js @@ -0,0 +1,7 @@ +var forOf = require('./_for-of'); + +module.exports = function(iter, ITERATOR){ + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; diff --git a/node_modules/core-js/modules/_array-includes.js b/node_modules/core-js/modules/_array-includes.js new file mode 100755 index 00000000..c70b064d --- /dev/null +++ b/node_modules/core-js/modules/_array-includes.js @@ -0,0 +1,21 @@ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = require('./_to-iobject') + , toLength = require('./_to-length') + , toIndex = require('./_to-index'); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_array-methods.js b/node_modules/core-js/modules/_array-methods.js new file mode 100755 index 00000000..8ffbe116 --- /dev/null +++ b/node_modules/core-js/modules/_array-methods.js @@ -0,0 +1,44 @@ +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = require('./_ctx') + , IObject = require('./_iobject') + , toObject = require('./_to-object') + , toLength = require('./_to-length') + , asc = require('./_array-species-create'); +module.exports = function(TYPE, $create){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX + , create = $create || asc; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_array-reduce.js b/node_modules/core-js/modules/_array-reduce.js new file mode 100755 index 00000000..c807d544 --- /dev/null +++ b/node_modules/core-js/modules/_array-reduce.js @@ -0,0 +1,28 @@ +var aFunction = require('./_a-function') + , toObject = require('./_to-object') + , IObject = require('./_iobject') + , toLength = require('./_to-length'); + +module.exports = function(that, callbackfn, aLen, memo, isRight){ + aFunction(callbackfn); + var O = toObject(that) + , self = IObject(O) + , length = toLength(O.length) + , index = isRight ? length - 1 : 0 + , i = isRight ? -1 : 1; + if(aLen < 2)for(;;){ + if(index in self){ + memo = self[index]; + index += i; + break; + } + index += i; + if(isRight ? index < 0 : length <= index){ + throw TypeError('Reduce of empty array with no initial value'); + } + } + for(;isRight ? index >= 0 : length > index; index += i)if(index in self){ + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_array-species-constructor.js b/node_modules/core-js/modules/_array-species-constructor.js new file mode 100755 index 00000000..a715389f --- /dev/null +++ b/node_modules/core-js/modules/_array-species-constructor.js @@ -0,0 +1,16 @@ +var isObject = require('./_is-object') + , isArray = require('./_is-array') + , SPECIES = require('./_wks')('species'); + +module.exports = function(original){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return C === undefined ? Array : C; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_array-species-create.js b/node_modules/core-js/modules/_array-species-create.js new file mode 100755 index 00000000..cbd18bc6 --- /dev/null +++ b/node_modules/core-js/modules/_array-species-create.js @@ -0,0 +1,6 @@ +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = require('./_array-species-constructor'); + +module.exports = function(original, length){ + return new (speciesConstructor(original))(length); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_bind.js b/node_modules/core-js/modules/_bind.js new file mode 100755 index 00000000..1f7b0174 --- /dev/null +++ b/node_modules/core-js/modules/_bind.js @@ -0,0 +1,24 @@ +'use strict'; +var aFunction = require('./_a-function') + , isObject = require('./_is-object') + , invoke = require('./_invoke') + , arraySlice = [].slice + , factories = {}; + +var construct = function(F, len, args){ + if(!(len in factories)){ + for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /*, args... */){ + var fn = aFunction(this) + , partArgs = arraySlice.call(arguments, 1); + var bound = function(/* args... */){ + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if(isObject(fn.prototype))bound.prototype = fn.prototype; + return bound; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_classof.js b/node_modules/core-js/modules/_classof.js new file mode 100755 index 00000000..dab3a80f --- /dev/null +++ b/node_modules/core-js/modules/_classof.js @@ -0,0 +1,23 @@ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = require('./_cof') + , TAG = require('./_wks')('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } +}; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_cof.js b/node_modules/core-js/modules/_cof.js new file mode 100755 index 00000000..1dd2779a --- /dev/null +++ b/node_modules/core-js/modules/_cof.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_collection-strong.js b/node_modules/core-js/modules/_collection-strong.js new file mode 100755 index 00000000..55e4b615 --- /dev/null +++ b/node_modules/core-js/modules/_collection-strong.js @@ -0,0 +1,142 @@ +'use strict'; +var dP = require('./_object-dp').f + , create = require('./_object-create') + , redefineAll = require('./_redefine-all') + , ctx = require('./_ctx') + , anInstance = require('./_an-instance') + , defined = require('./_defined') + , forOf = require('./_for-of') + , $iterDefine = require('./_iter-define') + , step = require('./_iter-step') + , setSpecies = require('./_set-species') + , DESCRIPTORS = require('./_descriptors') + , fastKey = require('./_meta').fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_collection-to-json.js b/node_modules/core-js/modules/_collection-to-json.js new file mode 100755 index 00000000..ce0282f6 --- /dev/null +++ b/node_modules/core-js/modules/_collection-to-json.js @@ -0,0 +1,9 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = require('./_classof') + , from = require('./_array-from-iterable'); +module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_collection-weak.js b/node_modules/core-js/modules/_collection-weak.js new file mode 100755 index 00000000..a8597e64 --- /dev/null +++ b/node_modules/core-js/modules/_collection-weak.js @@ -0,0 +1,83 @@ +'use strict'; +var redefineAll = require('./_redefine-all') + , getWeak = require('./_meta').getWeak + , anObject = require('./_an-object') + , isObject = require('./_is-object') + , anInstance = require('./_an-instance') + , forOf = require('./_for-of') + , createArrayMethod = require('./_array-methods') + , $has = require('./_has') + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function(that){ + return that._l || (that._l = new UncaughtFrozenStore); +}; +var UncaughtFrozenStore = function(){ + this.a = []; +}; +var findUncaughtFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); +}; +UncaughtFrozenStore.prototype = { + get: function(key){ + var entry = findUncaughtFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findUncaughtFrozen(this, key); + }, + set: function(key, value){ + var entry = findUncaughtFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this)['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function(that, key, value){ + var data = getWeak(anObject(key), true); + if(data === true)uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_collection.js b/node_modules/core-js/modules/_collection.js new file mode 100755 index 00000000..2b183453 --- /dev/null +++ b/node_modules/core-js/modules/_collection.js @@ -0,0 +1,85 @@ +'use strict'; +var global = require('./_global') + , $export = require('./_export') + , redefine = require('./_redefine') + , redefineAll = require('./_redefine-all') + , meta = require('./_meta') + , forOf = require('./_for-of') + , anInstance = require('./_an-instance') + , isObject = require('./_is-object') + , fails = require('./_fails') + , $iterDetect = require('./_iter-detect') + , setToStringTag = require('./_set-to-string-tag') + , inheritIfRequired = require('./_inherit-if-required'); + +module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO = !IS_WEAK && fails(function(){ + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C() + , index = 5; + while(index--)$instance[ADDER](index, index); + return !$instance.has(-0); + }); + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base, target, C); + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_core.js b/node_modules/core-js/modules/_core.js new file mode 100755 index 00000000..23d6aede --- /dev/null +++ b/node_modules/core-js/modules/_core.js @@ -0,0 +1,2 @@ +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef \ No newline at end of file diff --git a/node_modules/core-js/modules/_create-property.js b/node_modules/core-js/modules/_create-property.js new file mode 100755 index 00000000..3d1bf730 --- /dev/null +++ b/node_modules/core-js/modules/_create-property.js @@ -0,0 +1,8 @@ +'use strict'; +var $defineProperty = require('./_object-dp') + , createDesc = require('./_property-desc'); + +module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_ctx.js b/node_modules/core-js/modules/_ctx.js new file mode 100755 index 00000000..b52d85ff --- /dev/null +++ b/node_modules/core-js/modules/_ctx.js @@ -0,0 +1,20 @@ +// optional / simple context binding +var aFunction = require('./_a-function'); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_date-to-primitive.js b/node_modules/core-js/modules/_date-to-primitive.js new file mode 100755 index 00000000..561079a1 --- /dev/null +++ b/node_modules/core-js/modules/_date-to-primitive.js @@ -0,0 +1,9 @@ +'use strict'; +var anObject = require('./_an-object') + , toPrimitive = require('./_to-primitive') + , NUMBER = 'number'; + +module.exports = function(hint){ + if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_defined.js b/node_modules/core-js/modules/_defined.js new file mode 100755 index 00000000..cfa476b9 --- /dev/null +++ b/node_modules/core-js/modules/_defined.js @@ -0,0 +1,5 @@ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_descriptors.js b/node_modules/core-js/modules/_descriptors.js new file mode 100755 index 00000000..6ccb7ee2 --- /dev/null +++ b/node_modules/core-js/modules/_descriptors.js @@ -0,0 +1,4 @@ +// Thank's IE8 for his funny defineProperty +module.exports = !require('./_fails')(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/_dom-create.js b/node_modules/core-js/modules/_dom-create.js new file mode 100755 index 00000000..909b5ff0 --- /dev/null +++ b/node_modules/core-js/modules/_dom-create.js @@ -0,0 +1,7 @@ +var isObject = require('./_is-object') + , document = require('./_global').document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_entry-virtual.js b/node_modules/core-js/modules/_entry-virtual.js new file mode 100755 index 00000000..0ec61272 --- /dev/null +++ b/node_modules/core-js/modules/_entry-virtual.js @@ -0,0 +1,5 @@ +var core = require('./_core'); +module.exports = function(CONSTRUCTOR){ + var C = core[CONSTRUCTOR]; + return (C.virtual || C.prototype); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_enum-bug-keys.js b/node_modules/core-js/modules/_enum-bug-keys.js new file mode 100755 index 00000000..928b9fb0 --- /dev/null +++ b/node_modules/core-js/modules/_enum-bug-keys.js @@ -0,0 +1,4 @@ +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); \ No newline at end of file diff --git a/node_modules/core-js/modules/_enum-keys.js b/node_modules/core-js/modules/_enum-keys.js new file mode 100755 index 00000000..3bf8069c --- /dev/null +++ b/node_modules/core-js/modules/_enum-keys.js @@ -0,0 +1,15 @@ +// all enumerable object keys, includes symbols +var getKeys = require('./_object-keys') + , gOPS = require('./_object-gops') + , pIE = require('./_object-pie'); +module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_export.js b/node_modules/core-js/modules/_export.js new file mode 100755 index 00000000..afddf352 --- /dev/null +++ b/node_modules/core-js/modules/_export.js @@ -0,0 +1,43 @@ +var global = require('./_global') + , core = require('./_core') + , hide = require('./_hide') + , redefine = require('./_redefine') + , ctx = require('./_ctx') + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target)redefine(target, key, out, type & $export.U); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; \ No newline at end of file diff --git a/node_modules/core-js/modules/_fails-is-regexp.js b/node_modules/core-js/modules/_fails-is-regexp.js new file mode 100755 index 00000000..130436bf --- /dev/null +++ b/node_modules/core-js/modules/_fails-is-regexp.js @@ -0,0 +1,12 @@ +var MATCH = require('./_wks')('match'); +module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_fails.js b/node_modules/core-js/modules/_fails.js new file mode 100755 index 00000000..184e5ea8 --- /dev/null +++ b/node_modules/core-js/modules/_fails.js @@ -0,0 +1,7 @@ +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_fix-re-wks.js b/node_modules/core-js/modules/_fix-re-wks.js new file mode 100755 index 00000000..d29368ce --- /dev/null +++ b/node_modules/core-js/modules/_fix-re-wks.js @@ -0,0 +1,28 @@ +'use strict'; +var hide = require('./_hide') + , redefine = require('./_redefine') + , fails = require('./_fails') + , defined = require('./_defined') + , wks = require('./_wks'); + +module.exports = function(KEY, length, exec){ + var SYMBOL = wks(KEY) + , fns = exec(defined, SYMBOL, ''[KEY]) + , strfn = fns[0] + , rxfn = fns[1]; + if(fails(function(){ + var O = {}; + O[SYMBOL] = function(){ return 7; }; + return ''[KEY](O) != 7; + })){ + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function(string, arg){ return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function(string){ return rxfn.call(string, this); } + ); + } +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_flags.js b/node_modules/core-js/modules/_flags.js new file mode 100755 index 00000000..054f9088 --- /dev/null +++ b/node_modules/core-js/modules/_flags.js @@ -0,0 +1,13 @@ +'use strict'; +// 21.2.5.3 get RegExp.prototype.flags +var anObject = require('./_an-object'); +module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_for-of.js b/node_modules/core-js/modules/_for-of.js new file mode 100755 index 00000000..b4824fef --- /dev/null +++ b/node_modules/core-js/modules/_for-of.js @@ -0,0 +1,25 @@ +var ctx = require('./_ctx') + , call = require('./_iter-call') + , isArrayIter = require('./_is-array-iter') + , anObject = require('./_an-object') + , toLength = require('./_to-length') + , getIterFn = require('./core.get-iterator-method') + , BREAK = {} + , RETURN = {}; +var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; \ No newline at end of file diff --git a/node_modules/core-js/modules/_global.js b/node_modules/core-js/modules/_global.js new file mode 100755 index 00000000..df6efb47 --- /dev/null +++ b/node_modules/core-js/modules/_global.js @@ -0,0 +1,4 @@ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef \ No newline at end of file diff --git a/node_modules/core-js/modules/_has.js b/node_modules/core-js/modules/_has.js new file mode 100755 index 00000000..870b40e7 --- /dev/null +++ b/node_modules/core-js/modules/_has.js @@ -0,0 +1,4 @@ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_hide.js b/node_modules/core-js/modules/_hide.js new file mode 100755 index 00000000..4031e808 --- /dev/null +++ b/node_modules/core-js/modules/_hide.js @@ -0,0 +1,8 @@ +var dP = require('./_object-dp') + , createDesc = require('./_property-desc'); +module.exports = require('./_descriptors') ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_html.js b/node_modules/core-js/modules/_html.js new file mode 100755 index 00000000..98f5142c --- /dev/null +++ b/node_modules/core-js/modules/_html.js @@ -0,0 +1 @@ +module.exports = require('./_global').document && document.documentElement; \ No newline at end of file diff --git a/node_modules/core-js/modules/_ie8-dom-define.js b/node_modules/core-js/modules/_ie8-dom-define.js new file mode 100755 index 00000000..18ffd59d --- /dev/null +++ b/node_modules/core-js/modules/_ie8-dom-define.js @@ -0,0 +1,3 @@ +module.exports = !require('./_descriptors') && !require('./_fails')(function(){ + return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/_inherit-if-required.js b/node_modules/core-js/modules/_inherit-if-required.js new file mode 100755 index 00000000..d3948405 --- /dev/null +++ b/node_modules/core-js/modules/_inherit-if-required.js @@ -0,0 +1,8 @@ +var isObject = require('./_is-object') + , setPrototypeOf = require('./_set-proto').set; +module.exports = function(that, target, C){ + var P, S = target.constructor; + if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){ + setPrototypeOf(that, P); + } return that; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_invoke.js b/node_modules/core-js/modules/_invoke.js new file mode 100755 index 00000000..08e307fd --- /dev/null +++ b/node_modules/core-js/modules/_invoke.js @@ -0,0 +1,16 @@ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_iobject.js b/node_modules/core-js/modules/_iobject.js new file mode 100755 index 00000000..b58db489 --- /dev/null +++ b/node_modules/core-js/modules/_iobject.js @@ -0,0 +1,5 @@ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = require('./_cof'); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_is-array-iter.js b/node_modules/core-js/modules/_is-array-iter.js new file mode 100755 index 00000000..8139d71c --- /dev/null +++ b/node_modules/core-js/modules/_is-array-iter.js @@ -0,0 +1,8 @@ +// check on default Array iterator +var Iterators = require('./_iterators') + , ITERATOR = require('./_wks')('iterator') + , ArrayProto = Array.prototype; + +module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_is-array.js b/node_modules/core-js/modules/_is-array.js new file mode 100755 index 00000000..b4a3a8ed --- /dev/null +++ b/node_modules/core-js/modules/_is-array.js @@ -0,0 +1,5 @@ +// 7.2.2 IsArray(argument) +var cof = require('./_cof'); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_is-integer.js b/node_modules/core-js/modules/_is-integer.js new file mode 100755 index 00000000..22db67ed --- /dev/null +++ b/node_modules/core-js/modules/_is-integer.js @@ -0,0 +1,6 @@ +// 20.1.2.3 Number.isInteger(number) +var isObject = require('./_is-object') + , floor = Math.floor; +module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_is-object.js b/node_modules/core-js/modules/_is-object.js new file mode 100755 index 00000000..ee694be2 --- /dev/null +++ b/node_modules/core-js/modules/_is-object.js @@ -0,0 +1,3 @@ +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_is-regexp.js b/node_modules/core-js/modules/_is-regexp.js new file mode 100755 index 00000000..55b2c629 --- /dev/null +++ b/node_modules/core-js/modules/_is-regexp.js @@ -0,0 +1,8 @@ +// 7.2.8 IsRegExp(argument) +var isObject = require('./_is-object') + , cof = require('./_cof') + , MATCH = require('./_wks')('match'); +module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_iter-call.js b/node_modules/core-js/modules/_iter-call.js new file mode 100755 index 00000000..e3565ba9 --- /dev/null +++ b/node_modules/core-js/modules/_iter-call.js @@ -0,0 +1,12 @@ +// call something on iterator step with safe closing on error +var anObject = require('./_an-object'); +module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_iter-create.js b/node_modules/core-js/modules/_iter-create.js new file mode 100755 index 00000000..9a9aa4fb --- /dev/null +++ b/node_modules/core-js/modules/_iter-create.js @@ -0,0 +1,13 @@ +'use strict'; +var create = require('./_object-create') + , descriptor = require('./_property-desc') + , setToStringTag = require('./_set-to-string-tag') + , IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function(){ return this; }); + +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_iter-define.js b/node_modules/core-js/modules/_iter-define.js new file mode 100755 index 00000000..f72a5021 --- /dev/null +++ b/node_modules/core-js/modules/_iter-define.js @@ -0,0 +1,70 @@ +'use strict'; +var LIBRARY = require('./_library') + , $export = require('./_export') + , redefine = require('./_redefine') + , hide = require('./_hide') + , has = require('./_has') + , Iterators = require('./_iterators') + , $iterCreate = require('./_iter-create') + , setToStringTag = require('./_set-to-string-tag') + , getPrototypeOf = require('./_object-gpo') + , ITERATOR = require('./_wks')('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_iter-detect.js b/node_modules/core-js/modules/_iter-detect.js new file mode 100755 index 00000000..87c7aecf --- /dev/null +++ b/node_modules/core-js/modules/_iter-detect.js @@ -0,0 +1,21 @@ +var ITERATOR = require('./_wks')('iterator') + , SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); +} catch(e){ /* empty */ } + +module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_iter-step.js b/node_modules/core-js/modules/_iter-step.js new file mode 100755 index 00000000..6ff0dc51 --- /dev/null +++ b/node_modules/core-js/modules/_iter-step.js @@ -0,0 +1,3 @@ +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_iterators.js b/node_modules/core-js/modules/_iterators.js new file mode 100755 index 00000000..a0995453 --- /dev/null +++ b/node_modules/core-js/modules/_iterators.js @@ -0,0 +1 @@ +module.exports = {}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_keyof.js b/node_modules/core-js/modules/_keyof.js new file mode 100755 index 00000000..7b63229b --- /dev/null +++ b/node_modules/core-js/modules/_keyof.js @@ -0,0 +1,10 @@ +var getKeys = require('./_object-keys') + , toIObject = require('./_to-iobject'); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_library.js b/node_modules/core-js/modules/_library.js new file mode 100755 index 00000000..82e47dd5 --- /dev/null +++ b/node_modules/core-js/modules/_library.js @@ -0,0 +1 @@ +module.exports = false; \ No newline at end of file diff --git a/node_modules/core-js/modules/_math-expm1.js b/node_modules/core-js/modules/_math-expm1.js new file mode 100755 index 00000000..5131aa95 --- /dev/null +++ b/node_modules/core-js/modules/_math-expm1.js @@ -0,0 +1,10 @@ +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; \ No newline at end of file diff --git a/node_modules/core-js/modules/_math-log1p.js b/node_modules/core-js/modules/_math-log1p.js new file mode 100755 index 00000000..a92bf463 --- /dev/null +++ b/node_modules/core-js/modules/_math-log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_math-sign.js b/node_modules/core-js/modules/_math-sign.js new file mode 100755 index 00000000..a4848df6 --- /dev/null +++ b/node_modules/core-js/modules/_math-sign.js @@ -0,0 +1,4 @@ +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_meta.js b/node_modules/core-js/modules/_meta.js new file mode 100755 index 00000000..7daca009 --- /dev/null +++ b/node_modules/core-js/modules/_meta.js @@ -0,0 +1,53 @@ +var META = require('./_uid')('meta') + , isObject = require('./_is-object') + , has = require('./_has') + , setDesc = require('./_object-dp').f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !require('./_fails')(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_metadata.js b/node_modules/core-js/modules/_metadata.js new file mode 100755 index 00000000..eb5a762d --- /dev/null +++ b/node_modules/core-js/modules/_metadata.js @@ -0,0 +1,51 @@ +var Map = require('./es6.map') + , $export = require('./_export') + , shared = require('./_shared')('metadata') + , store = shared.store || (shared.store = new (require('./es6.weak-map'))); + +var getOrCreateMetadataMap = function(target, targetKey, create){ + var targetMetadata = store.get(target); + if(!targetMetadata){ + if(!create)return undefined; + store.set(target, targetMetadata = new Map); + } + var keyMetadata = targetMetadata.get(targetKey); + if(!keyMetadata){ + if(!create)return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){ + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function(target, targetKey){ + var metadataMap = getOrCreateMetadataMap(target, targetKey, false) + , keys = []; + if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); }); + return keys; +}; +var toMetaKey = function(it){ + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function(O){ + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_microtask.js b/node_modules/core-js/modules/_microtask.js new file mode 100755 index 00000000..b0f2a0df --- /dev/null +++ b/node_modules/core-js/modules/_microtask.js @@ -0,0 +1,68 @@ +var global = require('./_global') + , macrotask = require('./_task').set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = require('./_cof')(process) == 'process'; + +module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-assign.js b/node_modules/core-js/modules/_object-assign.js new file mode 100755 index 00000000..c575aba2 --- /dev/null +++ b/node_modules/core-js/modules/_object-assign.js @@ -0,0 +1,33 @@ +'use strict'; +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = require('./_object-keys') + , gOPS = require('./_object-gops') + , pIE = require('./_object-pie') + , toObject = require('./_to-object') + , IObject = require('./_iobject') + , $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || require('./_fails')(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; +} : $assign; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-create.js b/node_modules/core-js/modules/_object-create.js new file mode 100755 index 00000000..3379760f --- /dev/null +++ b/node_modules/core-js/modules/_object-create.js @@ -0,0 +1,41 @@ +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = require('./_an-object') + , dPs = require('./_object-dps') + , enumBugKeys = require('./_enum-bug-keys') + , IE_PROTO = require('./_shared-key')('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = require('./_dom-create')('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + require('./_html').appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; diff --git a/node_modules/core-js/modules/_object-define.js b/node_modules/core-js/modules/_object-define.js new file mode 100755 index 00000000..f246c4e3 --- /dev/null +++ b/node_modules/core-js/modules/_object-define.js @@ -0,0 +1,12 @@ +var dP = require('./_object-dp') + , gOPD = require('./_object-gopd') + , ownKeys = require('./_own-keys') + , toIObject = require('./_to-iobject'); + +module.exports = function define(target, mixin){ + var keys = ownKeys(toIObject(mixin)) + , length = keys.length + , i = 0, key; + while(length > i)dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-dp.js b/node_modules/core-js/modules/_object-dp.js new file mode 100755 index 00000000..e7ca8a46 --- /dev/null +++ b/node_modules/core-js/modules/_object-dp.js @@ -0,0 +1,16 @@ +var anObject = require('./_an-object') + , IE8_DOM_DEFINE = require('./_ie8-dom-define') + , toPrimitive = require('./_to-primitive') + , dP = Object.defineProperty; + +exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-dps.js b/node_modules/core-js/modules/_object-dps.js new file mode 100755 index 00000000..8cd4147a --- /dev/null +++ b/node_modules/core-js/modules/_object-dps.js @@ -0,0 +1,13 @@ +var dP = require('./_object-dp') + , anObject = require('./_an-object') + , getKeys = require('./_object-keys'); + +module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-forced-pam.js b/node_modules/core-js/modules/_object-forced-pam.js new file mode 100755 index 00000000..668a07dc --- /dev/null +++ b/node_modules/core-js/modules/_object-forced-pam.js @@ -0,0 +1,7 @@ +// Forced replacement prototype accessors methods +module.exports = require('./_library')|| !require('./_fails')(function(){ + var K = Math.random(); + // In FF throws only define methods + __defineSetter__.call(null, K, function(){ /* empty */}); + delete require('./_global')[K]; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-gopd.js b/node_modules/core-js/modules/_object-gopd.js new file mode 100755 index 00000000..756206ab --- /dev/null +++ b/node_modules/core-js/modules/_object-gopd.js @@ -0,0 +1,16 @@ +var pIE = require('./_object-pie') + , createDesc = require('./_property-desc') + , toIObject = require('./_to-iobject') + , toPrimitive = require('./_to-primitive') + , has = require('./_has') + , IE8_DOM_DEFINE = require('./_ie8-dom-define') + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-gopn-ext.js b/node_modules/core-js/modules/_object-gopn-ext.js new file mode 100755 index 00000000..f4d10b4a --- /dev/null +++ b/node_modules/core-js/modules/_object-gopn-ext.js @@ -0,0 +1,19 @@ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = require('./_to-iobject') + , gOPN = require('./_object-gopn').f + , toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; diff --git a/node_modules/core-js/modules/_object-gopn.js b/node_modules/core-js/modules/_object-gopn.js new file mode 100755 index 00000000..beebf4da --- /dev/null +++ b/node_modules/core-js/modules/_object-gopn.js @@ -0,0 +1,7 @@ +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = require('./_object-keys-internal') + , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-gops.js b/node_modules/core-js/modules/_object-gops.js new file mode 100755 index 00000000..8f93d76b --- /dev/null +++ b/node_modules/core-js/modules/_object-gops.js @@ -0,0 +1 @@ +exports.f = Object.getOwnPropertySymbols; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-gpo.js b/node_modules/core-js/modules/_object-gpo.js new file mode 100755 index 00000000..535dc6e9 --- /dev/null +++ b/node_modules/core-js/modules/_object-gpo.js @@ -0,0 +1,13 @@ +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = require('./_has') + , toObject = require('./_to-object') + , IE_PROTO = require('./_shared-key')('IE_PROTO') + , ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-keys-internal.js b/node_modules/core-js/modules/_object-keys-internal.js new file mode 100755 index 00000000..e23481d7 --- /dev/null +++ b/node_modules/core-js/modules/_object-keys-internal.js @@ -0,0 +1,17 @@ +var has = require('./_has') + , toIObject = require('./_to-iobject') + , arrayIndexOf = require('./_array-includes')(false) + , IE_PROTO = require('./_shared-key')('IE_PROTO'); + +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-keys.js b/node_modules/core-js/modules/_object-keys.js new file mode 100755 index 00000000..11d4ccee --- /dev/null +++ b/node_modules/core-js/modules/_object-keys.js @@ -0,0 +1,7 @@ +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = require('./_object-keys-internal') + , enumBugKeys = require('./_enum-bug-keys'); + +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-pie.js b/node_modules/core-js/modules/_object-pie.js new file mode 100755 index 00000000..13479a17 --- /dev/null +++ b/node_modules/core-js/modules/_object-pie.js @@ -0,0 +1 @@ +exports.f = {}.propertyIsEnumerable; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-sap.js b/node_modules/core-js/modules/_object-sap.js new file mode 100755 index 00000000..b76fec5f --- /dev/null +++ b/node_modules/core-js/modules/_object-sap.js @@ -0,0 +1,10 @@ +// most Object methods by ES6 should accept primitives +var $export = require('./_export') + , core = require('./_core') + , fails = require('./_fails'); +module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_object-to-array.js b/node_modules/core-js/modules/_object-to-array.js new file mode 100755 index 00000000..b6fdf05d --- /dev/null +++ b/node_modules/core-js/modules/_object-to-array.js @@ -0,0 +1,16 @@ +var getKeys = require('./_object-keys') + , toIObject = require('./_to-iobject') + , isEnum = require('./_object-pie').f; +module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_own-keys.js b/node_modules/core-js/modules/_own-keys.js new file mode 100755 index 00000000..045ce3d5 --- /dev/null +++ b/node_modules/core-js/modules/_own-keys.js @@ -0,0 +1,10 @@ +// all object keys, includes non-enumerable and symbols +var gOPN = require('./_object-gopn') + , gOPS = require('./_object-gops') + , anObject = require('./_an-object') + , Reflect = require('./_global').Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = gOPN.f(anObject(it)) + , getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_parse-float.js b/node_modules/core-js/modules/_parse-float.js new file mode 100755 index 00000000..3d0e6531 --- /dev/null +++ b/node_modules/core-js/modules/_parse-float.js @@ -0,0 +1,8 @@ +var $parseFloat = require('./_global').parseFloat + , $trim = require('./_string-trim').trim; + +module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str){ + var string = $trim(String(str), 3) + , result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; \ No newline at end of file diff --git a/node_modules/core-js/modules/_parse-int.js b/node_modules/core-js/modules/_parse-int.js new file mode 100755 index 00000000..c23ffc09 --- /dev/null +++ b/node_modules/core-js/modules/_parse-int.js @@ -0,0 +1,9 @@ +var $parseInt = require('./_global').parseInt + , $trim = require('./_string-trim').trim + , ws = require('./_string-ws') + , hex = /^[\-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){ + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; \ No newline at end of file diff --git a/node_modules/core-js/modules/_partial.js b/node_modules/core-js/modules/_partial.js new file mode 100755 index 00000000..3d411b70 --- /dev/null +++ b/node_modules/core-js/modules/_partial.js @@ -0,0 +1,23 @@ +'use strict'; +var path = require('./_path') + , invoke = require('./_invoke') + , aFunction = require('./_a-function'); +module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , aLen = arguments.length + , j = 0, k = 0, args; + if(!holder && !aLen)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; + while(aLen > k)args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_path.js b/node_modules/core-js/modules/_path.js new file mode 100755 index 00000000..d63df9d4 --- /dev/null +++ b/node_modules/core-js/modules/_path.js @@ -0,0 +1 @@ +module.exports = require('./_global'); \ No newline at end of file diff --git a/node_modules/core-js/modules/_property-desc.js b/node_modules/core-js/modules/_property-desc.js new file mode 100755 index 00000000..e3f7ab2d --- /dev/null +++ b/node_modules/core-js/modules/_property-desc.js @@ -0,0 +1,8 @@ +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_redefine-all.js b/node_modules/core-js/modules/_redefine-all.js new file mode 100755 index 00000000..ec1c5f76 --- /dev/null +++ b/node_modules/core-js/modules/_redefine-all.js @@ -0,0 +1,5 @@ +var redefine = require('./_redefine'); +module.exports = function(target, src, safe){ + for(var key in src)redefine(target, key, src[key], safe); + return target; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_redefine.js b/node_modules/core-js/modules/_redefine.js new file mode 100755 index 00000000..8e1bfe06 --- /dev/null +++ b/node_modules/core-js/modules/_redefine.js @@ -0,0 +1,32 @@ +var global = require('./_global') + , hide = require('./_hide') + , has = require('./_has') + , SRC = require('./_uid')('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + +require('./_core').inspectSource = function(it){ + return $toString.call(it); +}; + +(module.exports = function(O, key, val, safe){ + var isFunction = typeof val == 'function'; + if(isFunction)has(val, 'name') || hide(val, 'name', key); + if(O[key] === val)return; + if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if(O === global){ + O[key] = val; + } else { + if(!safe){ + delete O[key]; + hide(O, key, val); + } else { + if(O[key])O[key] = val; + else hide(O, key, val); + } + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/_replacer.js b/node_modules/core-js/modules/_replacer.js new file mode 100755 index 00000000..5360a3d3 --- /dev/null +++ b/node_modules/core-js/modules/_replacer.js @@ -0,0 +1,8 @@ +module.exports = function(regExp, replace){ + var replacer = replace === Object(replace) ? function(part){ + return replace[part]; + } : replace; + return function(it){ + return String(it).replace(regExp, replacer); + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_same-value.js b/node_modules/core-js/modules/_same-value.js new file mode 100755 index 00000000..8c2b8c7f --- /dev/null +++ b/node_modules/core-js/modules/_same-value.js @@ -0,0 +1,4 @@ +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_set-proto.js b/node_modules/core-js/modules/_set-proto.js new file mode 100755 index 00000000..8d5dad3f --- /dev/null +++ b/node_modules/core-js/modules/_set-proto.js @@ -0,0 +1,25 @@ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = require('./_is-object') + , anObject = require('./_an-object'); +var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_set-species.js b/node_modules/core-js/modules/_set-species.js new file mode 100755 index 00000000..a21bd039 --- /dev/null +++ b/node_modules/core-js/modules/_set-species.js @@ -0,0 +1,13 @@ +'use strict'; +var global = require('./_global') + , dP = require('./_object-dp') + , DESCRIPTORS = require('./_descriptors') + , SPECIES = require('./_wks')('species'); + +module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_set-to-string-tag.js b/node_modules/core-js/modules/_set-to-string-tag.js new file mode 100755 index 00000000..ffbdddab --- /dev/null +++ b/node_modules/core-js/modules/_set-to-string-tag.js @@ -0,0 +1,7 @@ +var def = require('./_object-dp').f + , has = require('./_has') + , TAG = require('./_wks')('toStringTag'); + +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_shared-key.js b/node_modules/core-js/modules/_shared-key.js new file mode 100755 index 00000000..5ed76349 --- /dev/null +++ b/node_modules/core-js/modules/_shared-key.js @@ -0,0 +1,5 @@ +var shared = require('./_shared')('keys') + , uid = require('./_uid'); +module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_shared.js b/node_modules/core-js/modules/_shared.js new file mode 100755 index 00000000..3f9e4c89 --- /dev/null +++ b/node_modules/core-js/modules/_shared.js @@ -0,0 +1,6 @@ +var global = require('./_global') + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_species-constructor.js b/node_modules/core-js/modules/_species-constructor.js new file mode 100755 index 00000000..7a4d1baf --- /dev/null +++ b/node_modules/core-js/modules/_species-constructor.js @@ -0,0 +1,8 @@ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = require('./_an-object') + , aFunction = require('./_a-function') + , SPECIES = require('./_wks')('species'); +module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_strict-method.js b/node_modules/core-js/modules/_strict-method.js new file mode 100755 index 00000000..96b6c6e8 --- /dev/null +++ b/node_modules/core-js/modules/_strict-method.js @@ -0,0 +1,7 @@ +var fails = require('./_fails'); + +module.exports = function(method, arg){ + return !!method && fails(function(){ + arg ? method.call(null, function(){}, 1) : method.call(null); + }); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_string-at.js b/node_modules/core-js/modules/_string-at.js new file mode 100755 index 00000000..ecc0d21c --- /dev/null +++ b/node_modules/core-js/modules/_string-at.js @@ -0,0 +1,17 @@ +var toInteger = require('./_to-integer') + , defined = require('./_defined'); +// true -> String#at +// false -> String#codePointAt +module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_string-context.js b/node_modules/core-js/modules/_string-context.js new file mode 100755 index 00000000..5f513483 --- /dev/null +++ b/node_modules/core-js/modules/_string-context.js @@ -0,0 +1,8 @@ +// helper for String#{startsWith, endsWith, includes} +var isRegExp = require('./_is-regexp') + , defined = require('./_defined'); + +module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_string-html.js b/node_modules/core-js/modules/_string-html.js new file mode 100755 index 00000000..95daf812 --- /dev/null +++ b/node_modules/core-js/modules/_string-html.js @@ -0,0 +1,19 @@ +var $export = require('./_export') + , fails = require('./_fails') + , defined = require('./_defined') + , quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function(string, tag, attribute, value) { + var S = String(defined(string)) + , p1 = '<' + tag; + if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function(NAME, exec){ + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function(){ + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_string-pad.js b/node_modules/core-js/modules/_string-pad.js new file mode 100755 index 00000000..dccd155e --- /dev/null +++ b/node_modules/core-js/modules/_string-pad.js @@ -0,0 +1,16 @@ +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = require('./_to-length') + , repeat = require('./_string-repeat') + , defined = require('./_defined'); + +module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength || fillStr == '')return S; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; diff --git a/node_modules/core-js/modules/_string-repeat.js b/node_modules/core-js/modules/_string-repeat.js new file mode 100755 index 00000000..88fd3a2d --- /dev/null +++ b/node_modules/core-js/modules/_string-repeat.js @@ -0,0 +1,12 @@ +'use strict'; +var toInteger = require('./_to-integer') + , defined = require('./_defined'); + +module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_string-trim.js b/node_modules/core-js/modules/_string-trim.js new file mode 100755 index 00000000..d12de1ce --- /dev/null +++ b/node_modules/core-js/modules/_string-trim.js @@ -0,0 +1,30 @@ +var $export = require('./_export') + , defined = require('./_defined') + , fails = require('./_fails') + , spaces = require('./_string-ws') + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + +var exporter = function(KEY, exec, ALIAS){ + var exp = {}; + var FORCE = fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if(ALIAS)exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; \ No newline at end of file diff --git a/node_modules/core-js/modules/_string-ws.js b/node_modules/core-js/modules/_string-ws.js new file mode 100755 index 00000000..9713d11d --- /dev/null +++ b/node_modules/core-js/modules/_string-ws.js @@ -0,0 +1,2 @@ +module.exports = '\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'; \ No newline at end of file diff --git a/node_modules/core-js/modules/_task.js b/node_modules/core-js/modules/_task.js new file mode 100755 index 00000000..06a73f40 --- /dev/null +++ b/node_modules/core-js/modules/_task.js @@ -0,0 +1,75 @@ +var ctx = require('./_ctx') + , invoke = require('./_invoke') + , html = require('./_html') + , cel = require('./_dom-create') + , global = require('./_global') + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(require('./_cof')(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_to-index.js b/node_modules/core-js/modules/_to-index.js new file mode 100755 index 00000000..4d380ce1 --- /dev/null +++ b/node_modules/core-js/modules/_to-index.js @@ -0,0 +1,7 @@ +var toInteger = require('./_to-integer') + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_to-integer.js b/node_modules/core-js/modules/_to-integer.js new file mode 100755 index 00000000..f63baaff --- /dev/null +++ b/node_modules/core-js/modules/_to-integer.js @@ -0,0 +1,6 @@ +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_to-iobject.js b/node_modules/core-js/modules/_to-iobject.js new file mode 100755 index 00000000..4eb43462 --- /dev/null +++ b/node_modules/core-js/modules/_to-iobject.js @@ -0,0 +1,6 @@ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = require('./_iobject') + , defined = require('./_defined'); +module.exports = function(it){ + return IObject(defined(it)); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_to-length.js b/node_modules/core-js/modules/_to-length.js new file mode 100755 index 00000000..4099e60b --- /dev/null +++ b/node_modules/core-js/modules/_to-length.js @@ -0,0 +1,6 @@ +// 7.1.15 ToLength +var toInteger = require('./_to-integer') + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_to-object.js b/node_modules/core-js/modules/_to-object.js new file mode 100755 index 00000000..f2c28b3f --- /dev/null +++ b/node_modules/core-js/modules/_to-object.js @@ -0,0 +1,5 @@ +// 7.1.13 ToObject(argument) +var defined = require('./_defined'); +module.exports = function(it){ + return Object(defined(it)); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_to-primitive.js b/node_modules/core-js/modules/_to-primitive.js new file mode 100755 index 00000000..16354eed --- /dev/null +++ b/node_modules/core-js/modules/_to-primitive.js @@ -0,0 +1,12 @@ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = require('./_is-object'); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_typed-array.js b/node_modules/core-js/modules/_typed-array.js new file mode 100755 index 00000000..b072b23b --- /dev/null +++ b/node_modules/core-js/modules/_typed-array.js @@ -0,0 +1,479 @@ +'use strict'; +if(require('./_descriptors')){ + var LIBRARY = require('./_library') + , global = require('./_global') + , fails = require('./_fails') + , $export = require('./_export') + , $typed = require('./_typed') + , $buffer = require('./_typed-buffer') + , ctx = require('./_ctx') + , anInstance = require('./_an-instance') + , propertyDesc = require('./_property-desc') + , hide = require('./_hide') + , redefineAll = require('./_redefine-all') + , toInteger = require('./_to-integer') + , toLength = require('./_to-length') + , toIndex = require('./_to-index') + , toPrimitive = require('./_to-primitive') + , has = require('./_has') + , same = require('./_same-value') + , classof = require('./_classof') + , isObject = require('./_is-object') + , toObject = require('./_to-object') + , isArrayIter = require('./_is-array-iter') + , create = require('./_object-create') + , getPrototypeOf = require('./_object-gpo') + , gOPN = require('./_object-gopn').f + , getIterFn = require('./core.get-iterator-method') + , uid = require('./_uid') + , wks = require('./_wks') + , createArrayMethod = require('./_array-methods') + , createArrayIncludes = require('./_array-includes') + , speciesConstructor = require('./_species-constructor') + , ArrayIterators = require('./es6.array.iterator') + , Iterators = require('./_iterators') + , $iterDetect = require('./_iter-detect') + , setSpecies = require('./_set-species') + , arrayFill = require('./_array-fill') + , arrayCopyWithin = require('./_array-copy-within') + , $DP = require('./_object-dp') + , $GOPD = require('./_object-gopd') + , dP = $DP.f + , gOPD = $GOPD.f + , RangeError = global.RangeError + , TypeError = global.TypeError + , Uint8Array = global.Uint8Array + , ARRAY_BUFFER = 'ArrayBuffer' + , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER + , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' + , PROTOTYPE = 'prototype' + , ArrayProto = Array[PROTOTYPE] + , $ArrayBuffer = $buffer.ArrayBuffer + , $DataView = $buffer.DataView + , arrayForEach = createArrayMethod(0) + , arrayFilter = createArrayMethod(2) + , arraySome = createArrayMethod(3) + , arrayEvery = createArrayMethod(4) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , arrayIncludes = createArrayIncludes(true) + , arrayIndexOf = createArrayIncludes(false) + , arrayValues = ArrayIterators.values + , arrayKeys = ArrayIterators.keys + , arrayEntries = ArrayIterators.entries + , arrayLastIndexOf = ArrayProto.lastIndexOf + , arrayReduce = ArrayProto.reduce + , arrayReduceRight = ArrayProto.reduceRight + , arrayJoin = ArrayProto.join + , arraySort = ArrayProto.sort + , arraySlice = ArrayProto.slice + , arrayToString = ArrayProto.toString + , arrayToLocaleString = ArrayProto.toLocaleString + , ITERATOR = wks('iterator') + , TAG = wks('toStringTag') + , TYPED_CONSTRUCTOR = uid('typed_constructor') + , DEF_CONSTRUCTOR = uid('def_constructor') + , ALL_CONSTRUCTORS = $typed.CONSTR + , TYPED_ARRAY = $typed.TYPED + , VIEW = $typed.VIEW + , WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function(O, length){ + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function(){ + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){ + new Uint8Array(1).set({}); + }); + + var strictToLength = function(it, SAME){ + if(it === undefined)throw TypeError(WRONG_LENGTH); + var number = +it + , length = toLength(it); + if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH); + return length; + }; + + var toOffset = function(it, BYTES){ + var offset = toInteger(it); + if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function(it){ + if(isObject(it) && TYPED_ARRAY in it)return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function(C, length){ + if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){ + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function(O, list){ + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function(C, list){ + var index = 0 + , length = list.length + , result = allocate(C, length); + while(length > index)result[index] = list[index++]; + return result; + }; + + var addGetter = function(it, key, internal){ + dP(it, key, {get: function(){ return this._d[internal]; }}); + }; + + var $from = function from(source /*, mapfn, thisArg */){ + var O = toObject(source) + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , iterFn = getIterFn(O) + , i, length, values, result, step, iterator; + if(iterFn != undefined && !isArrayIter(iterFn)){ + for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){ + values.push(step.value); + } O = values; + } + if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2); + for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){ + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/*...items*/){ + var index = 0 + , length = arguments.length + , result = allocate(this, length); + while(length > index)result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString(){ + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /*, end */){ + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /*, thisArg */){ + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /*, thisArg */){ + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /*, thisArg */){ + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /*, thisArg */){ + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /*, thisArg */){ + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /*, fromIndex */){ + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /*, fromIndex */){ + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator){ // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /*, thisArg */){ + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse(){ + var that = this + , length = validate(that).length + , middle = Math.floor(length / 2) + , index = 0 + , value; + while(index < middle){ + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /*, thisArg */){ + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn){ + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end){ + var O = validate(this) + , length = O.length + , $begin = toIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end){ + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /*, offset */){ + validate(this); + var offset = toOffset(arguments[1], 1) + , length = this.length + , src = toObject(arrayLike) + , len = toLength(src.length) + , index = 0; + if(len + offset > length)throw RangeError(WRONG_LENGTH); + while(index < len)this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries(){ + return arrayEntries.call(validate(this)); + }, + keys: function keys(){ + return arrayKeys.call(validate(this)); + }, + values: function values(){ + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function(target, key){ + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key){ + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc){ + if(isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ){ + target[key] = desc.value; + return target; + } else return dP(target, key, desc); + }; + + if(!ALL_CONSTRUCTORS){ + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if(fails(function(){ arrayToString.call({}); })){ + arrayToString = arrayToLocaleString = function toString(){ + return arrayJoin.call(this); + } + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function(){ /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function(){ return this[TYPED_ARRAY]; } + }); + + module.exports = function(KEY, BYTES, wrapper, CLAMPED){ + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array' + , ISNT_UINT8 = NAME != 'Uint8Array' + , GETTER = 'get' + KEY + , SETTER = 'set' + KEY + , TypedArray = global[NAME] + , Base = TypedArray || {} + , TAC = TypedArray && getPrototypeOf(TypedArray) + , FORCED = !TypedArray || !$typed.ABV + , O = {} + , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function(that, index){ + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function(that, index, value){ + var data = that._d; + if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function(that, index){ + dP(that, index, { + get: function(){ + return getter(this, index); + }, + set: function(value){ + return setter(this, index, value); + }, + enumerable: true + }); + }; + if(FORCED){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME, '_d'); + var index = 0 + , offset = 0 + , buffer, byteLength, length, klass; + if(!isObject(data)){ + length = strictToLength(data, true) + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if($length === undefined){ + if($len % BYTES)throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if(byteLength < 0)throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if(TYPED_ARRAY in data){ + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while(index < length)addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if(!$iterDetect(function(iter){ + // V8 works with iterators, but fails in many other cases + // https://code.google.com/p/v8/issues/detail?id=4552 + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8)); + if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if(TYPED_ARRAY in data)return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){ + if(!(key in TypedArray))hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR] + , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined) + , $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){ + dP(TypedArrayPrototype, TAG, { + get: function(){ return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES, + from: $from, + of: $of + }); + + if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, {set: $set}); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString}); + + $export($export.P + $export.F * fails(function(){ + new TypedArray(1).slice(); + }), NAME, {slice: $slice}); + + $export($export.P + $export.F * (fails(function(){ + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString() + }) || !fails(function(){ + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, {toLocaleString: $toLocaleString}); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function(){ /* empty */ }; \ No newline at end of file diff --git a/node_modules/core-js/modules/_typed-buffer.js b/node_modules/core-js/modules/_typed-buffer.js new file mode 100755 index 00000000..2129eea4 --- /dev/null +++ b/node_modules/core-js/modules/_typed-buffer.js @@ -0,0 +1,273 @@ +'use strict'; +var global = require('./_global') + , DESCRIPTORS = require('./_descriptors') + , LIBRARY = require('./_library') + , $typed = require('./_typed') + , hide = require('./_hide') + , redefineAll = require('./_redefine-all') + , fails = require('./_fails') + , anInstance = require('./_an-instance') + , toInteger = require('./_to-integer') + , toLength = require('./_to-length') + , gOPN = require('./_object-gopn').f + , dP = require('./_object-dp').f + , arrayFill = require('./_array-fill') + , setToStringTag = require('./_set-to-string-tag') + , ARRAY_BUFFER = 'ArrayBuffer' + , DATA_VIEW = 'DataView' + , PROTOTYPE = 'prototype' + , WRONG_LENGTH = 'Wrong length!' + , WRONG_INDEX = 'Wrong index!' + , $ArrayBuffer = global[ARRAY_BUFFER] + , $DataView = global[DATA_VIEW] + , Math = global.Math + , RangeError = global.RangeError + , Infinity = global.Infinity + , BaseBuffer = $ArrayBuffer + , abs = Math.abs + , pow = Math.pow + , floor = Math.floor + , log = Math.log + , LN2 = Math.LN2 + , BUFFER = 'buffer' + , BYTE_LENGTH = 'byteLength' + , BYTE_OFFSET = 'byteOffset' + , $BUFFER = DESCRIPTORS ? '_b' : BUFFER + , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH + , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +var packIEEE754 = function(value, mLen, nBytes){ + var buffer = Array(nBytes) + , eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0 + , i = 0 + , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0 + , e, m, c; + value = abs(value) + if(value != value || value === Infinity){ + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if(value * (c = pow(2, -e)) < 1){ + e--; + c *= 2; + } + if(e + eBias >= 1){ + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if(value * c >= 2){ + e++; + c /= 2; + } + if(e + eBias >= eMax){ + m = 0; + e = eMax; + } else if(e + eBias >= 1){ + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +}; +var unpackIEEE754 = function(buffer, mLen, nBytes){ + var eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , nBits = eLen - 7 + , i = nBytes - 1 + , s = buffer[i--] + , e = s & 127 + , m; + s >>= 7; + for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if(e === 0){ + e = 1 - eBias; + } else if(e === eMax){ + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +}; + +var unpackI32 = function(bytes){ + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +}; +var packI8 = function(it){ + return [it & 0xff]; +}; +var packI16 = function(it){ + return [it & 0xff, it >> 8 & 0xff]; +}; +var packI32 = function(it){ + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +}; +var packF64 = function(it){ + return packIEEE754(it, 52, 8); +}; +var packF32 = function(it){ + return packIEEE754(it, 23, 4); +}; + +var addGetter = function(C, key, internal){ + dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }}); +}; + +var get = function(view, bytes, index, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +}; +var set = function(view, bytes, index, conversion, value, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = conversion(+value); + for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +}; + +var validateArrayBufferArguments = function(that, length){ + anInstance(that, $ArrayBuffer, ARRAY_BUFFER); + var numberLength = +length + , byteLength = toLength(numberLength); + if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); + return byteLength; +}; + +if(!$typed.ABV){ + $ArrayBuffer = function ArrayBuffer(length){ + var byteLength = validateArrayBufferArguments(this, length); + this._b = arrayFill.call(Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength){ + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH] + , offset = toInteger(byteOffset); + if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if(DESCRIPTORS){ + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset){ + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset){ + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){ + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if(!fails(function(){ + new $ArrayBuffer; // eslint-disable-line no-new + }) || !fails(function(){ + new $ArrayBuffer(.5); // eslint-disable-line no-new + })){ + $ArrayBuffer = function ArrayBuffer(length){ + return new BaseBuffer(validateArrayBufferArguments(this, length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){ + if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]); + }; + if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)) + , $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; \ No newline at end of file diff --git a/node_modules/core-js/modules/_typed.js b/node_modules/core-js/modules/_typed.js new file mode 100755 index 00000000..6ed2ab56 --- /dev/null +++ b/node_modules/core-js/modules/_typed.js @@ -0,0 +1,26 @@ +var global = require('./_global') + , hide = require('./_hide') + , uid = require('./_uid') + , TYPED = uid('typed_array') + , VIEW = uid('view') + , ABV = !!(global.ArrayBuffer && global.DataView) + , CONSTR = ABV + , i = 0, l = 9, Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while(i < l){ + if(Typed = global[TypedArrayConstructors[i++]]){ + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_uid.js b/node_modules/core-js/modules/_uid.js new file mode 100755 index 00000000..3be4196b --- /dev/null +++ b/node_modules/core-js/modules/_uid.js @@ -0,0 +1,5 @@ +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_wks-define.js b/node_modules/core-js/modules/_wks-define.js new file mode 100755 index 00000000..e6960328 --- /dev/null +++ b/node_modules/core-js/modules/_wks-define.js @@ -0,0 +1,9 @@ +var global = require('./_global') + , core = require('./_core') + , LIBRARY = require('./_library') + , wksExt = require('./_wks-ext') + , defineProperty = require('./_object-dp').f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/_wks-ext.js b/node_modules/core-js/modules/_wks-ext.js new file mode 100755 index 00000000..7901def6 --- /dev/null +++ b/node_modules/core-js/modules/_wks-ext.js @@ -0,0 +1 @@ +exports.f = require('./_wks'); \ No newline at end of file diff --git a/node_modules/core-js/modules/_wks.js b/node_modules/core-js/modules/_wks.js new file mode 100755 index 00000000..36f7973a --- /dev/null +++ b/node_modules/core-js/modules/_wks.js @@ -0,0 +1,11 @@ +var store = require('./_shared')('wks') + , uid = require('./_uid') + , Symbol = require('./_global').Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; \ No newline at end of file diff --git a/node_modules/core-js/modules/core.delay.js b/node_modules/core-js/modules/core.delay.js new file mode 100755 index 00000000..ea031be4 --- /dev/null +++ b/node_modules/core-js/modules/core.delay.js @@ -0,0 +1,12 @@ +var global = require('./_global') + , core = require('./_core') + , $export = require('./_export') + , partial = require('./_partial'); +// https://esdiscuss.org/topic/promise-returning-delay-function +$export($export.G + $export.F, { + delay: function delay(time){ + return new (core.Promise || global.Promise)(function(resolve){ + setTimeout(partial.call(resolve, true), time); + }); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.dict.js b/node_modules/core-js/modules/core.dict.js new file mode 100755 index 00000000..88c54e3d --- /dev/null +++ b/node_modules/core-js/modules/core.dict.js @@ -0,0 +1,155 @@ +'use strict'; +var ctx = require('./_ctx') + , $export = require('./_export') + , createDesc = require('./_property-desc') + , assign = require('./_object-assign') + , create = require('./_object-create') + , getPrototypeOf = require('./_object-gpo') + , getKeys = require('./_object-keys') + , dP = require('./_object-dp') + , keyOf = require('./_keyof') + , aFunction = require('./_a-function') + , forOf = require('./_for-of') + , isIterable = require('./core.is-iterable') + , $iterCreate = require('./_iter-create') + , step = require('./_iter-step') + , isObject = require('./_is-object') + , toIObject = require('./_to-iobject') + , DESCRIPTORS = require('./_descriptors') + , has = require('./_has'); + +// 0 -> Dict.forEach +// 1 -> Dict.map +// 2 -> Dict.filter +// 3 -> Dict.some +// 4 -> Dict.every +// 5 -> Dict.find +// 6 -> Dict.findKey +// 7 -> Dict.mapPairs +var createDictMethod = function(TYPE){ + var IS_MAP = TYPE == 1 + , IS_EVERY = TYPE == 4; + return function(object, callbackfn, that /* = undefined */){ + var f = ctx(callbackfn, that, 3) + , O = toIObject(object) + , result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict) : undefined + , key, val, res; + for(key in O)if(has(O, key)){ + val = O[key]; + res = f(val, key, object); + if(TYPE){ + if(IS_MAP)result[key] = res; // map + else if(res)switch(TYPE){ + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if(IS_EVERY)return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; +}; +var findKey = createDictMethod(6); + +var createDictIter = function(kind){ + return function(it){ + return new DictIterator(it, kind); + }; +}; +var DictIterator = function(iterated, kind){ + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind +}; +$iterCreate(DictIterator, 'Dict', function(){ + var that = this + , O = that._t + , keys = that._a + , kind = that._k + , key; + do { + if(that._i >= keys.length){ + that._t = undefined; + return step(1); + } + } while(!has(O, key = keys[that._i++])); + if(kind == 'keys' )return step(0, key); + if(kind == 'values')return step(0, O[key]); + return step(0, [key, O[key]]); +}); + +function Dict(iterable){ + var dict = create(null); + if(iterable != undefined){ + if(isIterable(iterable)){ + forOf(iterable, true, function(key, value){ + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; +} +Dict.prototype = null; + +function reduce(object, mapfn, init){ + aFunction(mapfn); + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , memo, key; + if(arguments.length < 3){ + if(!length)throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while(length > i)if(has(O, key = keys[i++])){ + memo = mapfn(memo, O[key], key, object); + } + return memo; +} + +function includes(object, el){ + return (el == el ? keyOf(object, el) : findKey(object, function(it){ + return it != it; + })) !== undefined; +} + +function get(object, key){ + if(has(object, key))return object[key]; +} +function set(object, key, value){ + if(DESCRIPTORS && key in Object)dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; +} + +function isDict(it){ + return isObject(it) && getPrototypeOf(it) === Dict.prototype; +} + +$export($export.G + $export.F, {Dict: Dict}); + +$export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.function.part.js b/node_modules/core-js/modules/core.function.part.js new file mode 100755 index 00000000..ce851ff8 --- /dev/null +++ b/node_modules/core-js/modules/core.function.part.js @@ -0,0 +1,7 @@ +var path = require('./_path') + , $export = require('./_export'); + +// Placeholder +require('./_core')._ = path._ = path._ || {}; + +$export($export.P + $export.F, 'Function', {part: require('./_partial')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.get-iterator-method.js b/node_modules/core-js/modules/core.get-iterator-method.js new file mode 100755 index 00000000..e2c7ecc3 --- /dev/null +++ b/node_modules/core-js/modules/core.get-iterator-method.js @@ -0,0 +1,8 @@ +var classof = require('./_classof') + , ITERATOR = require('./_wks')('iterator') + , Iterators = require('./_iterators'); +module.exports = require('./_core').getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/core.get-iterator.js b/node_modules/core-js/modules/core.get-iterator.js new file mode 100755 index 00000000..c292e1ab --- /dev/null +++ b/node_modules/core-js/modules/core.get-iterator.js @@ -0,0 +1,7 @@ +var anObject = require('./_an-object') + , get = require('./core.get-iterator-method'); +module.exports = require('./_core').getIterator = function(it){ + var iterFn = get(it); + if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/core.is-iterable.js b/node_modules/core-js/modules/core.is-iterable.js new file mode 100755 index 00000000..b2b01b6b --- /dev/null +++ b/node_modules/core-js/modules/core.is-iterable.js @@ -0,0 +1,9 @@ +var classof = require('./_classof') + , ITERATOR = require('./_wks')('iterator') + , Iterators = require('./_iterators'); +module.exports = require('./_core').isIterable = function(it){ + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + || Iterators.hasOwnProperty(classof(O)); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/core.number.iterator.js b/node_modules/core-js/modules/core.number.iterator.js new file mode 100755 index 00000000..9700acba --- /dev/null +++ b/node_modules/core-js/modules/core.number.iterator.js @@ -0,0 +1,9 @@ +'use strict'; +require('./_iter-define')(Number, 'Number', function(iterated){ + this._l = +iterated; + this._i = 0; +}, function(){ + var i = this._i++ + , done = !(i < this._l); + return {done: done, value: done ? undefined : i}; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.object.classof.js b/node_modules/core-js/modules/core.object.classof.js new file mode 100755 index 00000000..342c7371 --- /dev/null +++ b/node_modules/core-js/modules/core.object.classof.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', {classof: require('./_classof')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.object.define.js b/node_modules/core-js/modules/core.object.define.js new file mode 100755 index 00000000..d60e9a95 --- /dev/null +++ b/node_modules/core-js/modules/core.object.define.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , define = require('./_object-define'); + +$export($export.S + $export.F, 'Object', {define: define}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.object.is-object.js b/node_modules/core-js/modules/core.object.is-object.js new file mode 100755 index 00000000..f2ba059f --- /dev/null +++ b/node_modules/core-js/modules/core.object.is-object.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', {isObject: require('./_is-object')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.object.make.js b/node_modules/core-js/modules/core.object.make.js new file mode 100755 index 00000000..3d2a2b5f --- /dev/null +++ b/node_modules/core-js/modules/core.object.make.js @@ -0,0 +1,9 @@ +var $export = require('./_export') + , define = require('./_object-define') + , create = require('./_object-create'); + +$export($export.S + $export.F, 'Object', { + make: function(proto, mixin){ + return define(create(proto), mixin); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.regexp.escape.js b/node_modules/core-js/modules/core.regexp.escape.js new file mode 100755 index 00000000..54f832ef --- /dev/null +++ b/node_modules/core-js/modules/core.regexp.escape.js @@ -0,0 +1,5 @@ +// https://github.com/benjamingr/RexExp.escape +var $export = require('./_export') + , $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); diff --git a/node_modules/core-js/modules/core.string.escape-html.js b/node_modules/core-js/modules/core.string.escape-html.js new file mode 100755 index 00000000..a4b8d2f0 --- /dev/null +++ b/node_modules/core-js/modules/core.string.escape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}); + +$export($export.P + $export.F, 'String', {escapeHTML: function escapeHTML(){ return $re(this); }}); \ No newline at end of file diff --git a/node_modules/core-js/modules/core.string.unescape-html.js b/node_modules/core-js/modules/core.string.unescape-html.js new file mode 100755 index 00000000..413622b9 --- /dev/null +++ b/node_modules/core-js/modules/core.string.unescape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}); + +$export($export.P + $export.F, 'String', {unescapeHTML: function unescapeHTML(){ return $re(this); }}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es5.js b/node_modules/core-js/modules/es5.js new file mode 100755 index 00000000..dd7ebadf --- /dev/null +++ b/node_modules/core-js/modules/es5.js @@ -0,0 +1,35 @@ +// This file still here for a legacy code and will be removed in a near time +require('./es6.object.create'); +require('./es6.object.define-property'); +require('./es6.object.define-properties'); +require('./es6.object.get-own-property-descriptor'); +require('./es6.object.get-prototype-of'); +require('./es6.object.keys'); +require('./es6.object.get-own-property-names'); +require('./es6.object.freeze'); +require('./es6.object.seal'); +require('./es6.object.prevent-extensions'); +require('./es6.object.is-frozen'); +require('./es6.object.is-sealed'); +require('./es6.object.is-extensible'); +require('./es6.function.bind'); +require('./es6.array.is-array'); +require('./es6.array.join'); +require('./es6.array.slice'); +require('./es6.array.sort'); +require('./es6.array.for-each'); +require('./es6.array.map'); +require('./es6.array.filter'); +require('./es6.array.some'); +require('./es6.array.every'); +require('./es6.array.reduce'); +require('./es6.array.reduce-right'); +require('./es6.array.index-of'); +require('./es6.array.last-index-of'); +require('./es6.date.now'); +require('./es6.date.to-iso-string'); +require('./es6.date.to-json'); +require('./es6.parse-int'); +require('./es6.parse-float'); +require('./es6.string.trim'); +require('./es6.regexp.to-string'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.copy-within.js b/node_modules/core-js/modules/es6.array.copy-within.js new file mode 100755 index 00000000..027f7550 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.copy-within.js @@ -0,0 +1,6 @@ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', {copyWithin: require('./_array-copy-within')}); + +require('./_add-to-unscopables')('copyWithin'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.every.js b/node_modules/core-js/modules/es6.array.every.js new file mode 100755 index 00000000..fb067367 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.every.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $every = require('./_array-methods')(4); + +$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */){ + return $every(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.fill.js b/node_modules/core-js/modules/es6.array.fill.js new file mode 100755 index 00000000..f075c001 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.fill.js @@ -0,0 +1,6 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', {fill: require('./_array-fill')}); + +require('./_add-to-unscopables')('fill'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.filter.js b/node_modules/core-js/modules/es6.array.filter.js new file mode 100755 index 00000000..f60951d3 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.filter.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $filter = require('./_array-methods')(2); + +$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */){ + return $filter(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.find-index.js b/node_modules/core-js/modules/es6.array.find-index.js new file mode 100755 index 00000000..53090741 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.find-index.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = require('./_export') + , $find = require('./_array-methods')(6) + , KEY = 'findIndex' + , forced = true; +// Shouldn't skip holes +if(KEY in [])Array(1)[KEY](function(){ forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.find.js b/node_modules/core-js/modules/es6.array.find.js new file mode 100755 index 00000000..90a9acfb --- /dev/null +++ b/node_modules/core-js/modules/es6.array.find.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = require('./_export') + , $find = require('./_array-methods')(5) + , KEY = 'find' + , forced = true; +// Shouldn't skip holes +if(KEY in [])Array(1)[KEY](function(){ forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.for-each.js b/node_modules/core-js/modules/es6.array.for-each.js new file mode 100755 index 00000000..f814fe4e --- /dev/null +++ b/node_modules/core-js/modules/es6.array.for-each.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export') + , $forEach = require('./_array-methods')(0) + , STRICT = require('./_strict-method')([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */){ + return $forEach(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.from.js b/node_modules/core-js/modules/es6.array.from.js new file mode 100755 index 00000000..69e5d4a6 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.from.js @@ -0,0 +1,37 @@ +'use strict'; +var ctx = require('./_ctx') + , $export = require('./_export') + , toObject = require('./_to-object') + , call = require('./_iter-call') + , isArrayIter = require('./_is-array-iter') + , toLength = require('./_to-length') + , createProperty = require('./_create-property') + , getIterFn = require('./core.get-iterator-method'); + +$export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); diff --git a/node_modules/core-js/modules/es6.array.index-of.js b/node_modules/core-js/modules/es6.array.index-of.js new file mode 100755 index 00000000..90376315 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.index-of.js @@ -0,0 +1,15 @@ +'use strict'; +var $export = require('./_export') + , $indexOf = require('./_array-includes')(false) + , $native = [].indexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /*, fromIndex = 0 */){ + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.is-array.js b/node_modules/core-js/modules/es6.array.is-array.js new file mode 100755 index 00000000..cd5d8c19 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.is-array.js @@ -0,0 +1,4 @@ +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = require('./_export'); + +$export($export.S, 'Array', {isArray: require('./_is-array')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.iterator.js b/node_modules/core-js/modules/es6.array.iterator.js new file mode 100755 index 00000000..100b344d --- /dev/null +++ b/node_modules/core-js/modules/es6.array.iterator.js @@ -0,0 +1,34 @@ +'use strict'; +var addToUnscopables = require('./_add-to-unscopables') + , step = require('./_iter-step') + , Iterators = require('./_iterators') + , toIObject = require('./_to-iobject'); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = require('./_iter-define')(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.join.js b/node_modules/core-js/modules/es6.array.join.js new file mode 100755 index 00000000..1bb65653 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.join.js @@ -0,0 +1,12 @@ +'use strict'; +// 22.1.3.13 Array.prototype.join(separator) +var $export = require('./_export') + , toIObject = require('./_to-iobject') + , arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', { + join: function join(separator){ + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.last-index-of.js b/node_modules/core-js/modules/es6.array.last-index-of.js new file mode 100755 index 00000000..75c1eabf --- /dev/null +++ b/node_modules/core-js/modules/es6.array.last-index-of.js @@ -0,0 +1,22 @@ +'use strict'; +var $export = require('./_export') + , toIObject = require('./_to-iobject') + , toInteger = require('./_to-integer') + , toLength = require('./_to-length') + , $native = [].lastIndexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){ + // convert -0 to +0 + if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0; + var O = toIObject(this) + , length = toLength(O.length) + , index = length - 1; + if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1])); + if(index < 0)index = length + index; + for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0; + return -1; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.map.js b/node_modules/core-js/modules/es6.array.map.js new file mode 100755 index 00000000..f70089f3 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.map.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $map = require('./_array-methods')(1); + +$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */){ + return $map(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.of.js b/node_modules/core-js/modules/es6.array.of.js new file mode 100755 index 00000000..dd4e1f81 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.of.js @@ -0,0 +1,19 @@ +'use strict'; +var $export = require('./_export') + , createProperty = require('./_create-property'); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * require('./_fails')(function(){ + function F(){} + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */){ + var index = 0 + , aLen = arguments.length + , result = new (typeof this == 'function' ? this : Array)(aLen); + while(aLen > index)createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.reduce-right.js b/node_modules/core-js/modules/es6.array.reduce-right.js new file mode 100755 index 00000000..0c64d85e --- /dev/null +++ b/node_modules/core-js/modules/es6.array.reduce-right.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.reduce.js b/node_modules/core-js/modules/es6.array.reduce.js new file mode 100755 index 00000000..491f7d25 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.reduce.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.slice.js b/node_modules/core-js/modules/es6.array.slice.js new file mode 100755 index 00000000..610bd399 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.slice.js @@ -0,0 +1,28 @@ +'use strict'; +var $export = require('./_export') + , html = require('./_html') + , cof = require('./_cof') + , toIndex = require('./_to-index') + , toLength = require('./_to-length') + , arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * require('./_fails')(function(){ + if(html)arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end){ + var len = toLength(this.length) + , klass = cof(this); + end = end === undefined ? len : end; + if(klass == 'Array')return arraySlice.call(this, begin, end); + var start = toIndex(begin, len) + , upTo = toIndex(end, len) + , size = toLength(upTo - start) + , cloned = Array(size) + , i = 0; + for(; i < size; i++)cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.some.js b/node_modules/core-js/modules/es6.array.some.js new file mode 100755 index 00000000..fa1095ed --- /dev/null +++ b/node_modules/core-js/modules/es6.array.some.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export') + , $some = require('./_array-methods')(3); + +$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */){ + return $some(this, callbackfn, arguments[1]); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.sort.js b/node_modules/core-js/modules/es6.array.sort.js new file mode 100755 index 00000000..7de1fe77 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.sort.js @@ -0,0 +1,23 @@ +'use strict'; +var $export = require('./_export') + , aFunction = require('./_a-function') + , toObject = require('./_to-object') + , fails = require('./_fails') + , $sort = [].sort + , test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function(){ + // IE8- + test.sort(undefined); +}) || !fails(function(){ + // V8 bug + test.sort(null); + // Old WebKit +}) || !require('./_strict-method')($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn){ + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.array.species.js b/node_modules/core-js/modules/es6.array.species.js new file mode 100755 index 00000000..d63c738f --- /dev/null +++ b/node_modules/core-js/modules/es6.array.species.js @@ -0,0 +1 @@ +require('./_set-species')('Array'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.date.now.js b/node_modules/core-js/modules/es6.date.now.js new file mode 100755 index 00000000..c3ee5fd7 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.now.js @@ -0,0 +1,4 @@ +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = require('./_export'); + +$export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.date.to-iso-string.js b/node_modules/core-js/modules/es6.date.to-iso-string.js new file mode 100755 index 00000000..2426c589 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-iso-string.js @@ -0,0 +1,28 @@ +'use strict'; +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = require('./_export') + , fails = require('./_fails') + , getTime = Date.prototype.getTime; + +var lz = function(num){ + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (fails(function(){ + return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z'; +}) || !fails(function(){ + new Date(NaN).toISOString(); +})), 'Date', { + toISOString: function toISOString(){ + if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value'); + var d = this + , y = d.getUTCFullYear() + , m = d.getUTCMilliseconds() + , s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.date.to-json.js b/node_modules/core-js/modules/es6.date.to-json.js new file mode 100755 index 00000000..eb419d03 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-json.js @@ -0,0 +1,14 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , toPrimitive = require('./_to-primitive'); + +$export($export.P + $export.F * require('./_fails')(function(){ + return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1; +}), 'Date', { + toJSON: function toJSON(key){ + var O = toObject(this) + , pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.date.to-primitive.js b/node_modules/core-js/modules/es6.date.to-primitive.js new file mode 100755 index 00000000..15a823d5 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-primitive.js @@ -0,0 +1,4 @@ +var TO_PRIMITIVE = require('./_wks')('toPrimitive') + , proto = Date.prototype; + +if(!(TO_PRIMITIVE in proto))require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive')); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.date.to-string.js b/node_modules/core-js/modules/es6.date.to-string.js new file mode 100755 index 00000000..686e949e --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-string.js @@ -0,0 +1,11 @@ +var DateProto = Date.prototype + , INVALID_DATE = 'Invalid Date' + , TO_STRING = 'toString' + , $toString = DateProto[TO_STRING] + , getTime = DateProto.getTime; +if(new Date(NaN) + '' != INVALID_DATE){ + require('./_redefine')(DateProto, TO_STRING, function toString(){ + var value = getTime.call(this); + return value === value ? $toString.call(this) : INVALID_DATE; + }); +} \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.function.bind.js b/node_modules/core-js/modules/es6.function.bind.js new file mode 100755 index 00000000..85f10379 --- /dev/null +++ b/node_modules/core-js/modules/es6.function.bind.js @@ -0,0 +1,4 @@ +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = require('./_export'); + +$export($export.P, 'Function', {bind: require('./_bind')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.function.has-instance.js b/node_modules/core-js/modules/es6.function.has-instance.js new file mode 100755 index 00000000..ae294b1f --- /dev/null +++ b/node_modules/core-js/modules/es6.function.has-instance.js @@ -0,0 +1,13 @@ +'use strict'; +var isObject = require('./_is-object') + , getPrototypeOf = require('./_object-gpo') + , HAS_INSTANCE = require('./_wks')('hasInstance') + , FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if(!(HAS_INSTANCE in FunctionProto))require('./_object-dp').f(FunctionProto, HAS_INSTANCE, {value: function(O){ + if(typeof this != 'function' || !isObject(O))return false; + if(!isObject(this.prototype))return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while(O = getPrototypeOf(O))if(this.prototype === O)return true; + return false; +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.function.name.js b/node_modules/core-js/modules/es6.function.name.js new file mode 100755 index 00000000..f824d86d --- /dev/null +++ b/node_modules/core-js/modules/es6.function.name.js @@ -0,0 +1,25 @@ +var dP = require('./_object-dp').f + , createDesc = require('./_property-desc') + , has = require('./_has') + , FProto = Function.prototype + , nameRE = /^\s*function ([^ (]*)/ + , NAME = 'name'; + +var isExtensible = Object.isExtensible || function(){ + return true; +}; + +// 19.2.4.2 name +NAME in FProto || require('./_descriptors') && dP(FProto, NAME, { + configurable: true, + get: function(){ + try { + var that = this + , name = ('' + that).match(nameRE)[1]; + has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name)); + return name; + } catch(e){ + return ''; + } + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.map.js b/node_modules/core-js/modules/es6.map.js new file mode 100755 index 00000000..a166430f --- /dev/null +++ b/node_modules/core-js/modules/es6.map.js @@ -0,0 +1,17 @@ +'use strict'; +var strong = require('./_collection-strong'); + +// 23.1 Map Objects +module.exports = require('./_collection')('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } +}, strong, true); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.acosh.js b/node_modules/core-js/modules/es6.math.acosh.js new file mode 100755 index 00000000..459f1199 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.acosh.js @@ -0,0 +1,18 @@ +// 20.2.2.3 Math.acosh(x) +var $export = require('./_export') + , log1p = require('./_math-log1p') + , sqrt = Math.sqrt + , $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x){ + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.asinh.js b/node_modules/core-js/modules/es6.math.asinh.js new file mode 100755 index 00000000..e6a74abb --- /dev/null +++ b/node_modules/core-js/modules/es6.math.asinh.js @@ -0,0 +1,10 @@ +// 20.2.2.5 Math.asinh(x) +var $export = require('./_export') + , $asinh = Math.asinh; + +function asinh(x){ + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.atanh.js b/node_modules/core-js/modules/es6.math.atanh.js new file mode 100755 index 00000000..94575d9f --- /dev/null +++ b/node_modules/core-js/modules/es6.math.atanh.js @@ -0,0 +1,10 @@ +// 20.2.2.7 Math.atanh(x) +var $export = require('./_export') + , $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x){ + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.cbrt.js b/node_modules/core-js/modules/es6.math.cbrt.js new file mode 100755 index 00000000..7ca7daea --- /dev/null +++ b/node_modules/core-js/modules/es6.math.cbrt.js @@ -0,0 +1,9 @@ +// 20.2.2.9 Math.cbrt(x) +var $export = require('./_export') + , sign = require('./_math-sign'); + +$export($export.S, 'Math', { + cbrt: function cbrt(x){ + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.clz32.js b/node_modules/core-js/modules/es6.math.clz32.js new file mode 100755 index 00000000..1ec534bd --- /dev/null +++ b/node_modules/core-js/modules/es6.math.clz32.js @@ -0,0 +1,8 @@ +// 20.2.2.11 Math.clz32(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + clz32: function clz32(x){ + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.cosh.js b/node_modules/core-js/modules/es6.math.cosh.js new file mode 100755 index 00000000..4f2b2155 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.cosh.js @@ -0,0 +1,9 @@ +// 20.2.2.12 Math.cosh(x) +var $export = require('./_export') + , exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x){ + return (exp(x = +x) + exp(-x)) / 2; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.expm1.js b/node_modules/core-js/modules/es6.math.expm1.js new file mode 100755 index 00000000..9762b7cd --- /dev/null +++ b/node_modules/core-js/modules/es6.math.expm1.js @@ -0,0 +1,5 @@ +// 20.2.2.14 Math.expm1(x) +var $export = require('./_export') + , $expm1 = require('./_math-expm1'); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.fround.js b/node_modules/core-js/modules/es6.math.fround.js new file mode 100755 index 00000000..01a88862 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.fround.js @@ -0,0 +1,26 @@ +// 20.2.2.16 Math.fround(x) +var $export = require('./_export') + , sign = require('./_math-sign') + , pow = Math.pow + , EPSILON = pow(2, -52) + , EPSILON32 = pow(2, -23) + , MAX32 = pow(2, 127) * (2 - EPSILON32) + , MIN32 = pow(2, -126); + +var roundTiesToEven = function(n){ + return n + 1 / EPSILON - 1 / EPSILON; +}; + + +$export($export.S, 'Math', { + fround: function fround(x){ + var $abs = Math.abs(x) + , $sign = sign(x) + , a, result; + if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + if(result > MAX32 || result != result)return $sign * Infinity; + return $sign * result; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.hypot.js b/node_modules/core-js/modules/es6.math.hypot.js new file mode 100755 index 00000000..508521b6 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.hypot.js @@ -0,0 +1,25 @@ +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = require('./_export') + , abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars + var sum = 0 + , i = 0 + , aLen = arguments.length + , larg = 0 + , arg, div; + while(i < aLen){ + arg = abs(arguments[i++]); + if(larg < arg){ + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if(arg > 0){ + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.imul.js b/node_modules/core-js/modules/es6.math.imul.js new file mode 100755 index 00000000..7f4111d2 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.imul.js @@ -0,0 +1,17 @@ +// 20.2.2.18 Math.imul(x, y) +var $export = require('./_export') + , $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * require('./_fails')(function(){ + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y){ + var UINT16 = 0xffff + , xn = +x + , yn = +y + , xl = UINT16 & xn + , yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.log10.js b/node_modules/core-js/modules/es6.math.log10.js new file mode 100755 index 00000000..791dfc35 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.log10.js @@ -0,0 +1,8 @@ +// 20.2.2.21 Math.log10(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log10: function log10(x){ + return Math.log(x) / Math.LN10; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.log1p.js b/node_modules/core-js/modules/es6.math.log1p.js new file mode 100755 index 00000000..a1de0258 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +var $export = require('./_export'); + +$export($export.S, 'Math', {log1p: require('./_math-log1p')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.log2.js b/node_modules/core-js/modules/es6.math.log2.js new file mode 100755 index 00000000..c4ba7819 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.log2.js @@ -0,0 +1,8 @@ +// 20.2.2.22 Math.log2(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log2: function log2(x){ + return Math.log(x) / Math.LN2; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.sign.js b/node_modules/core-js/modules/es6.math.sign.js new file mode 100755 index 00000000..5dbee6f6 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.sign.js @@ -0,0 +1,4 @@ +// 20.2.2.28 Math.sign(x) +var $export = require('./_export'); + +$export($export.S, 'Math', {sign: require('./_math-sign')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.sinh.js b/node_modules/core-js/modules/es6.math.sinh.js new file mode 100755 index 00000000..5464ae3e --- /dev/null +++ b/node_modules/core-js/modules/es6.math.sinh.js @@ -0,0 +1,15 @@ +// 20.2.2.30 Math.sinh(x) +var $export = require('./_export') + , expm1 = require('./_math-expm1') + , exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * require('./_fails')(function(){ + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x){ + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.tanh.js b/node_modules/core-js/modules/es6.math.tanh.js new file mode 100755 index 00000000..d2f10778 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.tanh.js @@ -0,0 +1,12 @@ +// 20.2.2.33 Math.tanh(x) +var $export = require('./_export') + , expm1 = require('./_math-expm1') + , exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x){ + var a = expm1(x = +x) + , b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.math.trunc.js b/node_modules/core-js/modules/es6.math.trunc.js new file mode 100755 index 00000000..2e42563b --- /dev/null +++ b/node_modules/core-js/modules/es6.math.trunc.js @@ -0,0 +1,8 @@ +// 20.2.2.34 Math.trunc(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + trunc: function trunc(it){ + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.constructor.js b/node_modules/core-js/modules/es6.number.constructor.js new file mode 100755 index 00000000..d562365b --- /dev/null +++ b/node_modules/core-js/modules/es6.number.constructor.js @@ -0,0 +1,69 @@ +'use strict'; +var global = require('./_global') + , has = require('./_has') + , cof = require('./_cof') + , inheritIfRequired = require('./_inherit-if-required') + , toPrimitive = require('./_to-primitive') + , fails = require('./_fails') + , gOPN = require('./_object-gopn').f + , gOPD = require('./_object-gopd').f + , dP = require('./_object-dp').f + , $trim = require('./_string-trim').trim + , NUMBER = 'Number' + , $Number = global[NUMBER] + , Base = $Number + , proto = $Number.prototype + // Opera ~12 has broken Object#toString + , BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER + , TRIM = 'trim' in String.prototype; + +// 7.1.3 ToNumber(argument) +var toNumber = function(argument){ + var it = toPrimitive(argument, false); + if(typeof it == 'string' && it.length > 2){ + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0) + , third, radix, maxCode; + if(first === 43 || first === 45){ + third = it.charCodeAt(2); + if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if(first === 48){ + switch(it.charCodeAt(1)){ + case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default : return +it; + } + for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){ + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if(code < 48 || code > maxCode)return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ + $Number = function Number(value){ + var it = arguments.length < 1 ? 0 : value + , that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for(var keys = require('./_descriptors') ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++){ + if(has(Base, key = keys[j]) && !has($Number, key)){ + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + require('./_redefine')(global, NUMBER, $Number); +} \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.epsilon.js b/node_modules/core-js/modules/es6.number.epsilon.js new file mode 100755 index 00000000..d25898cc --- /dev/null +++ b/node_modules/core-js/modules/es6.number.epsilon.js @@ -0,0 +1,4 @@ +// 20.1.2.1 Number.EPSILON +var $export = require('./_export'); + +$export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.is-finite.js b/node_modules/core-js/modules/es6.number.is-finite.js new file mode 100755 index 00000000..c8c42753 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-finite.js @@ -0,0 +1,9 @@ +// 20.1.2.2 Number.isFinite(number) +var $export = require('./_export') + , _isFinite = require('./_global').isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it){ + return typeof it == 'number' && _isFinite(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.is-integer.js b/node_modules/core-js/modules/es6.number.is-integer.js new file mode 100755 index 00000000..dc0f8f00 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.3 Number.isInteger(number) +var $export = require('./_export'); + +$export($export.S, 'Number', {isInteger: require('./_is-integer')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.is-nan.js b/node_modules/core-js/modules/es6.number.is-nan.js new file mode 100755 index 00000000..5fedf825 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-nan.js @@ -0,0 +1,8 @@ +// 20.1.2.4 Number.isNaN(number) +var $export = require('./_export'); + +$export($export.S, 'Number', { + isNaN: function isNaN(number){ + return number != number; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.is-safe-integer.js b/node_modules/core-js/modules/es6.number.is-safe-integer.js new file mode 100755 index 00000000..92193e2e --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-safe-integer.js @@ -0,0 +1,10 @@ +// 20.1.2.5 Number.isSafeInteger(number) +var $export = require('./_export') + , isInteger = require('./_is-integer') + , abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number){ + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.max-safe-integer.js b/node_modules/core-js/modules/es6.number.max-safe-integer.js new file mode 100755 index 00000000..b9d7f2a7 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.max-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.min-safe-integer.js b/node_modules/core-js/modules/es6.number.min-safe-integer.js new file mode 100755 index 00000000..9a2beeb3 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.min-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.parse-float.js b/node_modules/core-js/modules/es6.number.parse-float.js new file mode 100755 index 00000000..7ee14da0 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseFloat = require('./_parse-float'); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.parse-int.js b/node_modules/core-js/modules/es6.number.parse-int.js new file mode 100755 index 00000000..59bf1445 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseInt = require('./_parse-int'); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.to-fixed.js b/node_modules/core-js/modules/es6.number.to-fixed.js new file mode 100755 index 00000000..c54970d6 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.to-fixed.js @@ -0,0 +1,113 @@ +'use strict'; +var $export = require('./_export') + , toInteger = require('./_to-integer') + , aNumberValue = require('./_a-number-value') + , repeat = require('./_string-repeat') + , $toFixed = 1..toFixed + , floor = Math.floor + , data = [0, 0, 0, 0, 0, 0] + , ERROR = 'Number.toFixed: incorrect invocation!' + , ZERO = '0'; + +var multiply = function(n, c){ + var i = -1 + , c2 = c; + while(++i < 6){ + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function(n){ + var i = 6 + , c = 0; + while(--i >= 0){ + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function(){ + var i = 6 + , s = ''; + while(--i >= 0){ + if(s !== '' || i === 0 || data[i] !== 0){ + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function(x, n, acc){ + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function(x){ + var n = 0 + , x2 = x; + while(x2 >= 4096){ + n += 12; + x2 /= 4096; + } + while(x2 >= 2){ + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128..toFixed(0) !== '1000000000000000128' +) || !require('./_fails')(function(){ + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits){ + var x = aNumberValue(this, ERROR) + , f = toInteger(fractionDigits) + , s = '' + , m = ZERO + , e, z, j, k; + if(f < 0 || f > 20)throw RangeError(ERROR); + if(x != x)return 'NaN'; + if(x <= -1e21 || x >= 1e21)return String(x); + if(x < 0){ + s = '-'; + x = -x; + } + if(x > 1e-21){ + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if(e > 0){ + multiply(0, z); + j = f; + while(j >= 7){ + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while(j >= 23){ + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if(f > 0){ + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.number.to-precision.js b/node_modules/core-js/modules/es6.number.to-precision.js new file mode 100755 index 00000000..903dacdf --- /dev/null +++ b/node_modules/core-js/modules/es6.number.to-precision.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export') + , $fails = require('./_fails') + , aNumberValue = require('./_a-number-value') + , $toPrecision = 1..toPrecision; + +$export($export.P + $export.F * ($fails(function(){ + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function(){ + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision){ + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.assign.js b/node_modules/core-js/modules/es6.object.assign.js new file mode 100755 index 00000000..13eda2cb --- /dev/null +++ b/node_modules/core-js/modules/es6.object.assign.js @@ -0,0 +1,4 @@ +// 19.1.3.1 Object.assign(target, source) +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', {assign: require('./_object-assign')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.create.js b/node_modules/core-js/modules/es6.object.create.js new file mode 100755 index 00000000..17e4b284 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.create.js @@ -0,0 +1,3 @@ +var $export = require('./_export') +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', {create: require('./_object-create')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.define-properties.js b/node_modules/core-js/modules/es6.object.define-properties.js new file mode 100755 index 00000000..183eec6f --- /dev/null +++ b/node_modules/core-js/modules/es6.object.define-properties.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperties: require('./_object-dps')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.define-property.js b/node_modules/core-js/modules/es6.object.define-property.js new file mode 100755 index 00000000..71807cc0 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.define-property.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.freeze.js b/node_modules/core-js/modules/es6.object.freeze.js new file mode 100755 index 00000000..34b51084 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.freeze.js @@ -0,0 +1,9 @@ +// 19.1.2.5 Object.freeze(O) +var isObject = require('./_is-object') + , meta = require('./_meta').onFreeze; + +require('./_object-sap')('freeze', function($freeze){ + return function freeze(it){ + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js b/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js new file mode 100755 index 00000000..60c69913 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js @@ -0,0 +1,9 @@ +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = require('./_to-iobject') + , $getOwnPropertyDescriptor = require('./_object-gopd').f; + +require('./_object-sap')('getOwnPropertyDescriptor', function(){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.get-own-property-names.js b/node_modules/core-js/modules/es6.object.get-own-property-names.js new file mode 100755 index 00000000..91dd110d --- /dev/null +++ b/node_modules/core-js/modules/es6.object.get-own-property-names.js @@ -0,0 +1,4 @@ +// 19.1.2.7 Object.getOwnPropertyNames(O) +require('./_object-sap')('getOwnPropertyNames', function(){ + return require('./_object-gopn-ext').f; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.get-prototype-of.js b/node_modules/core-js/modules/es6.object.get-prototype-of.js new file mode 100755 index 00000000..b124e28f --- /dev/null +++ b/node_modules/core-js/modules/es6.object.get-prototype-of.js @@ -0,0 +1,9 @@ +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = require('./_to-object') + , $getPrototypeOf = require('./_object-gpo'); + +require('./_object-sap')('getPrototypeOf', function(){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.is-extensible.js b/node_modules/core-js/modules/es6.object.is-extensible.js new file mode 100755 index 00000000..94bf8a81 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is-extensible.js @@ -0,0 +1,8 @@ +// 19.1.2.11 Object.isExtensible(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isExtensible', function($isExtensible){ + return function isExtensible(it){ + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.is-frozen.js b/node_modules/core-js/modules/es6.object.is-frozen.js new file mode 100755 index 00000000..4bdfd11b --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is-frozen.js @@ -0,0 +1,8 @@ +// 19.1.2.12 Object.isFrozen(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isFrozen', function($isFrozen){ + return function isFrozen(it){ + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.is-sealed.js b/node_modules/core-js/modules/es6.object.is-sealed.js new file mode 100755 index 00000000..d13aa1b0 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is-sealed.js @@ -0,0 +1,8 @@ +// 19.1.2.13 Object.isSealed(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isSealed', function($isSealed){ + return function isSealed(it){ + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.is.js b/node_modules/core-js/modules/es6.object.is.js new file mode 100755 index 00000000..ad299425 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is.js @@ -0,0 +1,3 @@ +// 19.1.3.10 Object.is(value1, value2) +var $export = require('./_export'); +$export($export.S, 'Object', {is: require('./_same-value')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.keys.js b/node_modules/core-js/modules/es6.object.keys.js new file mode 100755 index 00000000..bf76c07d --- /dev/null +++ b/node_modules/core-js/modules/es6.object.keys.js @@ -0,0 +1,9 @@ +// 19.1.2.14 Object.keys(O) +var toObject = require('./_to-object') + , $keys = require('./_object-keys'); + +require('./_object-sap')('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.prevent-extensions.js b/node_modules/core-js/modules/es6.object.prevent-extensions.js new file mode 100755 index 00000000..adaff7a7 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.prevent-extensions.js @@ -0,0 +1,9 @@ +// 19.1.2.15 Object.preventExtensions(O) +var isObject = require('./_is-object') + , meta = require('./_meta').onFreeze; + +require('./_object-sap')('preventExtensions', function($preventExtensions){ + return function preventExtensions(it){ + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.seal.js b/node_modules/core-js/modules/es6.object.seal.js new file mode 100755 index 00000000..d7e4ea95 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.seal.js @@ -0,0 +1,9 @@ +// 19.1.2.17 Object.seal(O) +var isObject = require('./_is-object') + , meta = require('./_meta').onFreeze; + +require('./_object-sap')('seal', function($seal){ + return function seal(it){ + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.set-prototype-of.js b/node_modules/core-js/modules/es6.object.set-prototype-of.js new file mode 100755 index 00000000..5bbe4c06 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.set-prototype-of.js @@ -0,0 +1,3 @@ +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = require('./_export'); +$export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.object.to-string.js b/node_modules/core-js/modules/es6.object.to-string.js new file mode 100755 index 00000000..e644a5d1 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.to-string.js @@ -0,0 +1,10 @@ +'use strict'; +// 19.1.3.6 Object.prototype.toString() +var classof = require('./_classof') + , test = {}; +test[require('./_wks')('toStringTag')] = 'z'; +if(test + '' != '[object z]'){ + require('./_redefine')(Object.prototype, 'toString', function toString(){ + return '[object ' + classof(this) + ']'; + }, true); +} \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.parse-float.js b/node_modules/core-js/modules/es6.parse-float.js new file mode 100755 index 00000000..5201712b --- /dev/null +++ b/node_modules/core-js/modules/es6.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseFloat = require('./_parse-float'); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.parse-int.js b/node_modules/core-js/modules/es6.parse-int.js new file mode 100755 index 00000000..5a2bfaff --- /dev/null +++ b/node_modules/core-js/modules/es6.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export') + , $parseInt = require('./_parse-int'); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.promise.js b/node_modules/core-js/modules/es6.promise.js new file mode 100755 index 00000000..262a93af --- /dev/null +++ b/node_modules/core-js/modules/es6.promise.js @@ -0,0 +1,299 @@ +'use strict'; +var LIBRARY = require('./_library') + , global = require('./_global') + , ctx = require('./_ctx') + , classof = require('./_classof') + , $export = require('./_export') + , isObject = require('./_is-object') + , aFunction = require('./_a-function') + , anInstance = require('./_an-instance') + , forOf = require('./_for-of') + , speciesConstructor = require('./_species-constructor') + , task = require('./_task').set + , microtask = require('./_microtask')() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + +var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } +}(); + +// helpers +var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; +}; +var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); +}; +var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; +var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } +}; +var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); +}; +var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); +}; +var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; +}; +var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); +}; +var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } +}; + +// constructor polyfill +if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = require('./_redefine-all')($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); +require('./_set-to-string-tag')($Promise, PROMISE); +require('./_set-species')(PROMISE); +Wrapper = require('./_core')[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } +}); +$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function(iter){ + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.apply.js b/node_modules/core-js/modules/es6.reflect.apply.js new file mode 100755 index 00000000..24ea80f5 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.apply.js @@ -0,0 +1,16 @@ +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = require('./_export') + , aFunction = require('./_a-function') + , anObject = require('./_an-object') + , rApply = (require('./_global').Reflect || {}).apply + , fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !require('./_fails')(function(){ + rApply(function(){}); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList){ + var T = aFunction(target) + , L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.construct.js b/node_modules/core-js/modules/es6.reflect.construct.js new file mode 100755 index 00000000..96483d70 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.construct.js @@ -0,0 +1,47 @@ +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = require('./_export') + , create = require('./_object-create') + , aFunction = require('./_a-function') + , anObject = require('./_an-object') + , isObject = require('./_is-object') + , fails = require('./_fails') + , bind = require('./_bind') + , rConstruct = (require('./_global').Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function(){ + function F(){} + return !(rConstruct(function(){}, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function(){ + rConstruct(function(){}); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /*, newTarget*/){ + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget); + if(Target == newTarget){ + // w/o altered newTarget, optimization for 0-4 arguments + switch(args.length){ + case 0: return new Target; + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype + , instance = create(isObject(proto) ? proto : Object.prototype) + , result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.define-property.js b/node_modules/core-js/modules/es6.reflect.define-property.js new file mode 100755 index 00000000..485d43c4 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.define-property.js @@ -0,0 +1,22 @@ +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = require('./_object-dp') + , $export = require('./_export') + , anObject = require('./_an-object') + , toPrimitive = require('./_to-primitive'); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * require('./_fails')(function(){ + Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2}); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes){ + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch(e){ + return false; + } + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.delete-property.js b/node_modules/core-js/modules/es6.reflect.delete-property.js new file mode 100755 index 00000000..4e8ce207 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.delete-property.js @@ -0,0 +1,11 @@ +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = require('./_export') + , gOPD = require('./_object-gopd').f + , anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey){ + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.enumerate.js b/node_modules/core-js/modules/es6.reflect.enumerate.js new file mode 100755 index 00000000..abdb132d --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.enumerate.js @@ -0,0 +1,26 @@ +'use strict'; +// 26.1.5 Reflect.enumerate(target) +var $export = require('./_export') + , anObject = require('./_an-object'); +var Enumerate = function(iterated){ + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = [] // keys + , key; + for(key in iterated)keys.push(key); +}; +require('./_iter-create')(Enumerate, 'Object', function(){ + var that = this + , keys = that._k + , key; + do { + if(that._i >= keys.length)return {value: undefined, done: true}; + } while(!((key = keys[that._i++]) in that._t)); + return {value: key, done: false}; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target){ + return new Enumerate(target); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js b/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js new file mode 100755 index 00000000..741a13eb --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js @@ -0,0 +1,10 @@ +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = require('./_object-gopd') + , $export = require('./_export') + , anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ + return gOPD.f(anObject(target), propertyKey); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.get-prototype-of.js b/node_modules/core-js/modules/es6.reflect.get-prototype-of.js new file mode 100755 index 00000000..4f912d10 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.get-prototype-of.js @@ -0,0 +1,10 @@ +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = require('./_export') + , getProto = require('./_object-gpo') + , anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target){ + return getProto(anObject(target)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.get.js b/node_modules/core-js/modules/es6.reflect.get.js new file mode 100755 index 00000000..f8c39f50 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.get.js @@ -0,0 +1,21 @@ +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = require('./_object-gopd') + , getPrototypeOf = require('./_object-gpo') + , has = require('./_has') + , $export = require('./_export') + , isObject = require('./_is-object') + , anObject = require('./_an-object'); + +function get(target, propertyKey/*, receiver*/){ + var receiver = arguments.length < 3 ? target : arguments[2] + , desc, proto; + if(anObject(target) === receiver)return target[propertyKey]; + if(desc = gOPD.f(target, propertyKey))return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', {get: get}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.has.js b/node_modules/core-js/modules/es6.reflect.has.js new file mode 100755 index 00000000..bbb6dbcd --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.has.js @@ -0,0 +1,8 @@ +// 26.1.9 Reflect.has(target, propertyKey) +var $export = require('./_export'); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey){ + return propertyKey in target; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.is-extensible.js b/node_modules/core-js/modules/es6.reflect.is-extensible.js new file mode 100755 index 00000000..ffbc2848 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.is-extensible.js @@ -0,0 +1,11 @@ +// 26.1.10 Reflect.isExtensible(target) +var $export = require('./_export') + , anObject = require('./_an-object') + , $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target){ + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.own-keys.js b/node_modules/core-js/modules/es6.reflect.own-keys.js new file mode 100755 index 00000000..a1e5330c --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.own-keys.js @@ -0,0 +1,4 @@ +// 26.1.11 Reflect.ownKeys(target) +var $export = require('./_export'); + +$export($export.S, 'Reflect', {ownKeys: require('./_own-keys')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.prevent-extensions.js b/node_modules/core-js/modules/es6.reflect.prevent-extensions.js new file mode 100755 index 00000000..d3dad8ee --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.prevent-extensions.js @@ -0,0 +1,16 @@ +// 26.1.12 Reflect.preventExtensions(target) +var $export = require('./_export') + , anObject = require('./_an-object') + , $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target){ + anObject(target); + try { + if($preventExtensions)$preventExtensions(target); + return true; + } catch(e){ + return false; + } + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.set-prototype-of.js b/node_modules/core-js/modules/es6.reflect.set-prototype-of.js new file mode 100755 index 00000000..b79d9b61 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.set-prototype-of.js @@ -0,0 +1,15 @@ +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = require('./_export') + , setProto = require('./_set-proto'); + +if(setProto)$export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto){ + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch(e){ + return false; + } + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.reflect.set.js b/node_modules/core-js/modules/es6.reflect.set.js new file mode 100755 index 00000000..c6b916a2 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.set.js @@ -0,0 +1,31 @@ +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = require('./_object-dp') + , gOPD = require('./_object-gopd') + , getPrototypeOf = require('./_object-gpo') + , has = require('./_has') + , $export = require('./_export') + , createDesc = require('./_property-desc') + , anObject = require('./_an-object') + , isObject = require('./_is-object'); + +function set(target, propertyKey, V/*, receiver*/){ + var receiver = arguments.length < 4 ? target : arguments[3] + , ownDesc = gOPD.f(anObject(target), propertyKey) + , existingDescriptor, proto; + if(!ownDesc){ + if(isObject(proto = getPrototypeOf(target))){ + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if(has(ownDesc, 'value')){ + if(ownDesc.writable === false || !isObject(receiver))return false; + existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', {set: set}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.regexp.constructor.js b/node_modules/core-js/modules/es6.regexp.constructor.js new file mode 100755 index 00000000..93961168 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.constructor.js @@ -0,0 +1,43 @@ +var global = require('./_global') + , inheritIfRequired = require('./_inherit-if-required') + , dP = require('./_object-dp').f + , gOPN = require('./_object-gopn').f + , isRegExp = require('./_is-regexp') + , $flags = require('./_flags') + , $RegExp = global.RegExp + , Base = $RegExp + , proto = $RegExp.prototype + , re1 = /a/g + , re2 = /a/g + // "new" creates a new object, old webkit buggy here + , CORRECT_NEW = new $RegExp(re1) !== re1; + +if(require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function(){ + re2[require('./_wks')('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))){ + $RegExp = function RegExp(p, f){ + var tiRE = this instanceof $RegExp + , piRE = isRegExp(p) + , fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function(key){ + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function(){ return Base[key]; }, + set: function(it){ Base[key] = it; } + }); + }; + for(var keys = gOPN(Base), i = 0; keys.length > i; )proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + require('./_redefine')(global, 'RegExp', $RegExp); +} + +require('./_set-species')('RegExp'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.regexp.flags.js b/node_modules/core-js/modules/es6.regexp.flags.js new file mode 100755 index 00000000..33ba86f7 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.flags.js @@ -0,0 +1,5 @@ +// 21.2.5.3 get RegExp.prototype.flags() +if(require('./_descriptors') && /./g.flags != 'g')require('./_object-dp').f(RegExp.prototype, 'flags', { + configurable: true, + get: require('./_flags') +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.regexp.match.js b/node_modules/core-js/modules/es6.regexp.match.js new file mode 100755 index 00000000..814d3719 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.match.js @@ -0,0 +1,10 @@ +// @@match logic +require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.regexp.replace.js b/node_modules/core-js/modules/es6.regexp.replace.js new file mode 100755 index 00000000..4f651af3 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.replace.js @@ -0,0 +1,12 @@ +// @@replace logic +require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue){ + 'use strict'; + var O = defined(this) + , fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.regexp.search.js b/node_modules/core-js/modules/es6.regexp.search.js new file mode 100755 index 00000000..7aac5e44 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.search.js @@ -0,0 +1,10 @@ +// @@search logic +require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.regexp.split.js b/node_modules/core-js/modules/es6.regexp.split.js new file mode 100755 index 00000000..a991a3fc --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.split.js @@ -0,0 +1,70 @@ +// @@split logic +require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ + 'use strict'; + var isRegExp = require('./_is-regexp') + , _split = $split + , $push = [].push + , $SPLIT = 'split' + , LENGTH = 'length' + , LAST_INDEX = 'lastIndex'; + if( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ){ + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function(separator, limit){ + var string = String(this); + if(separator === undefined && limit === 0)return []; + // If `separator` is not a regex, use native split + if(!isRegExp(separator))return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while(match = separatorCopy.exec(string)){ + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if(lastIndex > lastLastIndex){ + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){ + for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined; + }); + if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if(output[LENGTH] >= splitLimit)break; + } + if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if(lastLastIndex === string[LENGTH]){ + if(lastLength || !separatorCopy.test(''))output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if('0'[$SPLIT](undefined, 0)[LENGTH]){ + $split = function(separator, limit){ + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit){ + var O = defined(this) + , fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.regexp.to-string.js b/node_modules/core-js/modules/es6.regexp.to-string.js new file mode 100755 index 00000000..699aeff2 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.to-string.js @@ -0,0 +1,25 @@ +'use strict'; +require('./es6.regexp.flags'); +var anObject = require('./_an-object') + , $flags = require('./_flags') + , DESCRIPTORS = require('./_descriptors') + , TO_STRING = 'toString' + , $toString = /./[TO_STRING]; + +var define = function(fn){ + require('./_redefine')(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if(require('./_fails')(function(){ return $toString.call({source: 'a', flags: 'b'}) != '/a/b'; })){ + define(function toString(){ + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if($toString.name != TO_STRING){ + define(function toString(){ + return $toString.call(this); + }); +} \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.set.js b/node_modules/core-js/modules/es6.set.js new file mode 100755 index 00000000..a1880881 --- /dev/null +++ b/node_modules/core-js/modules/es6.set.js @@ -0,0 +1,12 @@ +'use strict'; +var strong = require('./_collection-strong'); + +// 23.2 Set Objects +module.exports = require('./_collection')('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } +}, strong); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.anchor.js b/node_modules/core-js/modules/es6.string.anchor.js new file mode 100755 index 00000000..65db2521 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.anchor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.2 String.prototype.anchor(name) +require('./_string-html')('anchor', function(createHTML){ + return function anchor(name){ + return createHTML(this, 'a', 'name', name); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.big.js b/node_modules/core-js/modules/es6.string.big.js new file mode 100755 index 00000000..aeeb1aba --- /dev/null +++ b/node_modules/core-js/modules/es6.string.big.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.3 String.prototype.big() +require('./_string-html')('big', function(createHTML){ + return function big(){ + return createHTML(this, 'big', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.blink.js b/node_modules/core-js/modules/es6.string.blink.js new file mode 100755 index 00000000..aef8da2e --- /dev/null +++ b/node_modules/core-js/modules/es6.string.blink.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.4 String.prototype.blink() +require('./_string-html')('blink', function(createHTML){ + return function blink(){ + return createHTML(this, 'blink', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.bold.js b/node_modules/core-js/modules/es6.string.bold.js new file mode 100755 index 00000000..022cdb07 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.bold.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.5 String.prototype.bold() +require('./_string-html')('bold', function(createHTML){ + return function bold(){ + return createHTML(this, 'b', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.code-point-at.js b/node_modules/core-js/modules/es6.string.code-point-at.js new file mode 100755 index 00000000..cf544652 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.code-point-at.js @@ -0,0 +1,9 @@ +'use strict'; +var $export = require('./_export') + , $at = require('./_string-at')(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos){ + return $at(this, pos); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.ends-with.js b/node_modules/core-js/modules/es6.string.ends-with.js new file mode 100755 index 00000000..80baed9a --- /dev/null +++ b/node_modules/core-js/modules/es6.string.ends-with.js @@ -0,0 +1,20 @@ +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) +'use strict'; +var $export = require('./_export') + , toLength = require('./_to-length') + , context = require('./_string-context') + , ENDS_WITH = 'endsWith' + , $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /*, endPosition = @length */){ + var that = context(this, searchString, ENDS_WITH) + , endPosition = arguments.length > 1 ? arguments[1] : undefined + , len = toLength(that.length) + , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) + , search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.fixed.js b/node_modules/core-js/modules/es6.string.fixed.js new file mode 100755 index 00000000..d017e202 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.fixed.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.6 String.prototype.fixed() +require('./_string-html')('fixed', function(createHTML){ + return function fixed(){ + return createHTML(this, 'tt', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.fontcolor.js b/node_modules/core-js/modules/es6.string.fontcolor.js new file mode 100755 index 00000000..d40711f0 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.fontcolor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.7 String.prototype.fontcolor(color) +require('./_string-html')('fontcolor', function(createHTML){ + return function fontcolor(color){ + return createHTML(this, 'font', 'color', color); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.fontsize.js b/node_modules/core-js/modules/es6.string.fontsize.js new file mode 100755 index 00000000..ba3ff980 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.fontsize.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.8 String.prototype.fontsize(size) +require('./_string-html')('fontsize', function(createHTML){ + return function fontsize(size){ + return createHTML(this, 'font', 'size', size); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.from-code-point.js b/node_modules/core-js/modules/es6.string.from-code-point.js new file mode 100755 index 00000000..c8776d87 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.from-code-point.js @@ -0,0 +1,23 @@ +var $export = require('./_export') + , toIndex = require('./_to-index') + , fromCharCode = String.fromCharCode + , $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars + var res = [] + , aLen = arguments.length + , i = 0 + , code; + while(aLen > i){ + code = +arguments[i++]; + if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.includes.js b/node_modules/core-js/modules/es6.string.includes.js new file mode 100755 index 00000000..c6b4ee2f --- /dev/null +++ b/node_modules/core-js/modules/es6.string.includes.js @@ -0,0 +1,12 @@ +// 21.1.3.7 String.prototype.includes(searchString, position = 0) +'use strict'; +var $export = require('./_export') + , context = require('./_string-context') + , INCLUDES = 'includes'; + +$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', { + includes: function includes(searchString /*, position = 0 */){ + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.italics.js b/node_modules/core-js/modules/es6.string.italics.js new file mode 100755 index 00000000..d33efd3c --- /dev/null +++ b/node_modules/core-js/modules/es6.string.italics.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.9 String.prototype.italics() +require('./_string-html')('italics', function(createHTML){ + return function italics(){ + return createHTML(this, 'i', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.iterator.js b/node_modules/core-js/modules/es6.string.iterator.js new file mode 100755 index 00000000..ac391ee4 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.iterator.js @@ -0,0 +1,17 @@ +'use strict'; +var $at = require('./_string-at')(true); + +// 21.1.3.27 String.prototype[@@iterator]() +require('./_iter-define')(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.link.js b/node_modules/core-js/modules/es6.string.link.js new file mode 100755 index 00000000..6a75c18a --- /dev/null +++ b/node_modules/core-js/modules/es6.string.link.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.10 String.prototype.link(url) +require('./_string-html')('link', function(createHTML){ + return function link(url){ + return createHTML(this, 'a', 'href', url); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.raw.js b/node_modules/core-js/modules/es6.string.raw.js new file mode 100755 index 00000000..1016acfa --- /dev/null +++ b/node_modules/core-js/modules/es6.string.raw.js @@ -0,0 +1,18 @@ +var $export = require('./_export') + , toIObject = require('./_to-iobject') + , toLength = require('./_to-length'); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite){ + var tpl = toIObject(callSite.raw) + , len = toLength(tpl.length) + , aLen = arguments.length + , res = [] + , i = 0; + while(len > i){ + res.push(String(tpl[i++])); + if(i < aLen)res.push(String(arguments[i])); + } return res.join(''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.repeat.js b/node_modules/core-js/modules/es6.string.repeat.js new file mode 100755 index 00000000..a054222d --- /dev/null +++ b/node_modules/core-js/modules/es6.string.repeat.js @@ -0,0 +1,6 @@ +var $export = require('./_export'); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: require('./_string-repeat') +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.small.js b/node_modules/core-js/modules/es6.string.small.js new file mode 100755 index 00000000..51b1b30d --- /dev/null +++ b/node_modules/core-js/modules/es6.string.small.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.11 String.prototype.small() +require('./_string-html')('small', function(createHTML){ + return function small(){ + return createHTML(this, 'small', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.starts-with.js b/node_modules/core-js/modules/es6.string.starts-with.js new file mode 100755 index 00000000..017805f0 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.starts-with.js @@ -0,0 +1,18 @@ +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) +'use strict'; +var $export = require('./_export') + , toLength = require('./_to-length') + , context = require('./_string-context') + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.strike.js b/node_modules/core-js/modules/es6.string.strike.js new file mode 100755 index 00000000..c6287d3a --- /dev/null +++ b/node_modules/core-js/modules/es6.string.strike.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.12 String.prototype.strike() +require('./_string-html')('strike', function(createHTML){ + return function strike(){ + return createHTML(this, 'strike', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.sub.js b/node_modules/core-js/modules/es6.string.sub.js new file mode 100755 index 00000000..ee18ea7a --- /dev/null +++ b/node_modules/core-js/modules/es6.string.sub.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.13 String.prototype.sub() +require('./_string-html')('sub', function(createHTML){ + return function sub(){ + return createHTML(this, 'sub', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.sup.js b/node_modules/core-js/modules/es6.string.sup.js new file mode 100755 index 00000000..a3429988 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.sup.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.14 String.prototype.sup() +require('./_string-html')('sup', function(createHTML){ + return function sup(){ + return createHTML(this, 'sup', '', ''); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.string.trim.js b/node_modules/core-js/modules/es6.string.trim.js new file mode 100755 index 00000000..35f0fb0b --- /dev/null +++ b/node_modules/core-js/modules/es6.string.trim.js @@ -0,0 +1,7 @@ +'use strict'; +// 21.1.3.25 String.prototype.trim() +require('./_string-trim')('trim', function($trim){ + return function trim(){ + return $trim(this, 3); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.symbol.js b/node_modules/core-js/modules/es6.symbol.js new file mode 100755 index 00000000..eae491c5 --- /dev/null +++ b/node_modules/core-js/modules/es6.symbol.js @@ -0,0 +1,235 @@ +'use strict'; +// ECMAScript 6 symbols shim +var global = require('./_global') + , has = require('./_has') + , DESCRIPTORS = require('./_descriptors') + , $export = require('./_export') + , redefine = require('./_redefine') + , META = require('./_meta').KEY + , $fails = require('./_fails') + , shared = require('./_shared') + , setToStringTag = require('./_set-to-string-tag') + , uid = require('./_uid') + , wks = require('./_wks') + , wksExt = require('./_wks-ext') + , wksDefine = require('./_wks-define') + , keyOf = require('./_keyof') + , enumKeys = require('./_enum-keys') + , isArray = require('./_is-array') + , anObject = require('./_an-object') + , toIObject = require('./_to-iobject') + , toPrimitive = require('./_to-primitive') + , createDesc = require('./_property-desc') + , _create = require('./_object-create') + , gOPNExt = require('./_object-gopn-ext') + , $GOPD = require('./_object-gopd') + , $DP = require('./_object-dp') + , $keys = require('./_object-keys') + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; +}) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; +} : function(it){ + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; + require('./_object-pie').f = $propertyIsEnumerable; + require('./_object-gops').f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !require('./_library')){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + +for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + +for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.array-buffer.js b/node_modules/core-js/modules/es6.typed.array-buffer.js new file mode 100755 index 00000000..9f47082c --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.array-buffer.js @@ -0,0 +1,46 @@ +'use strict'; +var $export = require('./_export') + , $typed = require('./_typed') + , buffer = require('./_typed-buffer') + , anObject = require('./_an-object') + , toIndex = require('./_to-index') + , toLength = require('./_to-length') + , isObject = require('./_is-object') + , ArrayBuffer = require('./_global').ArrayBuffer + , speciesConstructor = require('./_species-constructor') + , $ArrayBuffer = buffer.ArrayBuffer + , $DataView = buffer.DataView + , $isView = $typed.ABV && ArrayBuffer.isView + , $slice = $ArrayBuffer.prototype.slice + , VIEW = $typed.VIEW + , ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer}); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it){ + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * require('./_fails')(function(){ + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end){ + if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength + , first = toIndex(start, len) + , final = toIndex(end === undefined ? len : end, len) + , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first)) + , viewS = new $DataView(this) + , viewT = new $DataView(result) + , index = 0; + while(first < final){ + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +require('./_set-species')(ARRAY_BUFFER); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.data-view.js b/node_modules/core-js/modules/es6.typed.data-view.js new file mode 100755 index 00000000..ee7b8812 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.data-view.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +$export($export.G + $export.W + $export.F * !require('./_typed').ABV, { + DataView: require('./_typed-buffer').DataView +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.float32-array.js b/node_modules/core-js/modules/es6.typed.float32-array.js new file mode 100755 index 00000000..2c4c9a69 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.float32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float32', 4, function(init){ + return function Float32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.float64-array.js b/node_modules/core-js/modules/es6.typed.float64-array.js new file mode 100755 index 00000000..4b20257f --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.float64-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float64', 8, function(init){ + return function Float64Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.int16-array.js b/node_modules/core-js/modules/es6.typed.int16-array.js new file mode 100755 index 00000000..d3f61c56 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.int16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int16', 2, function(init){ + return function Int16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.int32-array.js b/node_modules/core-js/modules/es6.typed.int32-array.js new file mode 100755 index 00000000..df47c1bb --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.int32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int32', 4, function(init){ + return function Int32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.int8-array.js b/node_modules/core-js/modules/es6.typed.int8-array.js new file mode 100755 index 00000000..da4dbf0a --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.int8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int8', 1, function(init){ + return function Int8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.uint16-array.js b/node_modules/core-js/modules/es6.typed.uint16-array.js new file mode 100755 index 00000000..cb335773 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint16', 2, function(init){ + return function Uint16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.uint32-array.js b/node_modules/core-js/modules/es6.typed.uint32-array.js new file mode 100755 index 00000000..41c9e7b8 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint32', 4, function(init){ + return function Uint32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.uint8-array.js b/node_modules/core-js/modules/es6.typed.uint8-array.js new file mode 100755 index 00000000..f794f86c --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function(init){ + return function Uint8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js b/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js new file mode 100755 index 00000000..b1230479 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function(init){ + return function Uint8ClampedArray(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}, true); \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.weak-map.js b/node_modules/core-js/modules/es6.weak-map.js new file mode 100755 index 00000000..4109db33 --- /dev/null +++ b/node_modules/core-js/modules/es6.weak-map.js @@ -0,0 +1,56 @@ +'use strict'; +var each = require('./_array-methods')(0) + , redefine = require('./_redefine') + , meta = require('./_meta') + , assign = require('./_object-assign') + , weak = require('./_collection-weak') + , isObject = require('./_is-object') + , getWeak = meta.getWeak + , isExtensible = Object.isExtensible + , uncaughtFrozenStore = weak.ufstore + , tmp = {} + , InternalMap; + +var wrapper = function(get){ + return function WeakMap(){ + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}; + +var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key){ + if(isObject(key)){ + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value){ + return weak.def(this, key, value); + } +}; + +// 23.3 WeakMap Objects +var $WeakMap = module.exports = require('./_collection')('WeakMap', wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ + InternalMap = weak.getConstructor(wrapper); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function(key){ + var proto = $WeakMap.prototype + , method = proto[key]; + redefine(proto, key, function(a, b){ + // store frozen objects on internal weakmap shim + if(isObject(a) && !isExtensible(a)){ + if(!this._f)this._f = new InternalMap; + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); +} \ No newline at end of file diff --git a/node_modules/core-js/modules/es6.weak-set.js b/node_modules/core-js/modules/es6.weak-set.js new file mode 100755 index 00000000..77d01b6b --- /dev/null +++ b/node_modules/core-js/modules/es6.weak-set.js @@ -0,0 +1,12 @@ +'use strict'; +var weak = require('./_collection-weak'); + +// 23.4 WeakSet Objects +require('./_collection')('WeakSet', function(get){ + return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value){ + return weak.def(this, value, true); + } +}, weak, false, true); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.array.includes.js b/node_modules/core-js/modules/es7.array.includes.js new file mode 100755 index 00000000..6d5b0090 --- /dev/null +++ b/node_modules/core-js/modules/es7.array.includes.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/Array.prototype.includes +var $export = require('./_export') + , $includes = require('./_array-includes')(true); + +$export($export.P, 'Array', { + includes: function includes(el /*, fromIndex = 0 */){ + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +require('./_add-to-unscopables')('includes'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.asap.js b/node_modules/core-js/modules/es7.asap.js new file mode 100755 index 00000000..b762b49a --- /dev/null +++ b/node_modules/core-js/modules/es7.asap.js @@ -0,0 +1,12 @@ +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = require('./_export') + , microtask = require('./_microtask')() + , process = require('./_global').process + , isNode = require('./_cof')(process) == 'process'; + +$export($export.G, { + asap: function asap(fn){ + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.error.is-error.js b/node_modules/core-js/modules/es7.error.is-error.js new file mode 100755 index 00000000..d6fe29dc --- /dev/null +++ b/node_modules/core-js/modules/es7.error.is-error.js @@ -0,0 +1,9 @@ +// https://github.com/ljharb/proposal-is-error +var $export = require('./_export') + , cof = require('./_cof'); + +$export($export.S, 'Error', { + isError: function isError(it){ + return cof(it) === 'Error'; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.map.to-json.js b/node_modules/core-js/modules/es7.map.to-json.js new file mode 100755 index 00000000..19f9b6d3 --- /dev/null +++ b/node_modules/core-js/modules/es7.map.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Map', {toJSON: require('./_collection-to-json')('Map')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.math.iaddh.js b/node_modules/core-js/modules/es7.math.iaddh.js new file mode 100755 index 00000000..bb3f3d38 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.iaddh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.math.imulh.js b/node_modules/core-js/modules/es7.math.imulh.js new file mode 100755 index 00000000..a25da686 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.imulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + imulh: function imulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >> 16 + , v1 = $v >> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.math.isubh.js b/node_modules/core-js/modules/es7.math.isubh.js new file mode 100755 index 00000000..3814dc29 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.isubh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.math.umulh.js b/node_modules/core-js/modules/es7.math.umulh.js new file mode 100755 index 00000000..0d22cf1b --- /dev/null +++ b/node_modules/core-js/modules/es7.math.umulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + umulh: function umulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >>> 16 + , v1 = $v >>> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.define-getter.js b/node_modules/core-js/modules/es7.object.define-getter.js new file mode 100755 index 00000000..f206e96a --- /dev/null +++ b/node_modules/core-js/modules/es7.object.define-getter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , aFunction = require('./_a-function') + , $defineProperty = require('./_object-dp'); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineGetter__: function __defineGetter__(P, getter){ + $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.define-setter.js b/node_modules/core-js/modules/es7.object.define-setter.js new file mode 100755 index 00000000..c0f7b700 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.define-setter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , aFunction = require('./_a-function') + , $defineProperty = require('./_object-dp'); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineSetter__: function __defineSetter__(P, setter){ + $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.entries.js b/node_modules/core-js/modules/es7.object.entries.js new file mode 100755 index 00000000..cfc049df --- /dev/null +++ b/node_modules/core-js/modules/es7.object.entries.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export') + , $entries = require('./_object-to-array')(true); + +$export($export.S, 'Object', { + entries: function entries(it){ + return $entries(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.enumerable-entries.js b/node_modules/core-js/modules/es7.object.enumerable-entries.js new file mode 100755 index 00000000..5daa803b --- /dev/null +++ b/node_modules/core-js/modules/es7.object.enumerable-entries.js @@ -0,0 +1,12 @@ +// https://github.com/leobalter/object-enumerables +var $export = require('./_export') + , toObject = require('./_to-object'); + +$export($export.S, 'Object', { + enumerableEntries: function enumerableEntries(O){ + var T = toObject(O) + , properties = []; + for(var key in T)properties.push([key, T[key]]); + return properties; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.enumerable-keys.js b/node_modules/core-js/modules/es7.object.enumerable-keys.js new file mode 100755 index 00000000..791ec184 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.enumerable-keys.js @@ -0,0 +1,12 @@ +// https://github.com/leobalter/object-enumerables +var $export = require('./_export') + , toObject = require('./_to-object'); + +$export($export.S, 'Object', { + enumerableKeys: function enumerableKeys(O){ + var T = toObject(O) + , properties = []; + for(var key in T)properties.push(key); + return properties; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.enumerable-values.js b/node_modules/core-js/modules/es7.object.enumerable-values.js new file mode 100755 index 00000000..1d1bfaa7 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.enumerable-values.js @@ -0,0 +1,12 @@ +// https://github.com/leobalter/object-enumerables +var $export = require('./_export') + , toObject = require('./_to-object'); + +$export($export.S, 'Object', { + enumerableValues: function enumerableValues(O){ + var T = toObject(O) + , properties = []; + for(var key in T)properties.push(T[key]); + return properties; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js b/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js new file mode 100755 index 00000000..0242b7a0 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js @@ -0,0 +1,19 @@ +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = require('./_export') + , ownKeys = require('./_own-keys') + , toIObject = require('./_to-iobject') + , gOPD = require('./_object-gopd') + , createProperty = require('./_create-property'); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ + var O = toIObject(object) + , getDesc = gOPD.f + , keys = ownKeys(O) + , result = {} + , i = 0 + , key; + while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key)); + return result; + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.lookup-getter.js b/node_modules/core-js/modules/es7.object.lookup-getter.js new file mode 100755 index 00000000..ec140345 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.lookup-getter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , toPrimitive = require('./_to-primitive') + , getPrototypeOf = require('./_object-gpo') + , getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupGetter__: function __lookupGetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.get; + } while(O = getPrototypeOf(O)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.lookup-setter.js b/node_modules/core-js/modules/es7.object.lookup-setter.js new file mode 100755 index 00000000..539dda82 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.lookup-setter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export') + , toObject = require('./_to-object') + , toPrimitive = require('./_to-primitive') + , getPrototypeOf = require('./_object-gpo') + , getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupSetter__: function __lookupSetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.set; + } while(O = getPrototypeOf(O)); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.object.values.js b/node_modules/core-js/modules/es7.object.values.js new file mode 100755 index 00000000..42abd640 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.values.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export') + , $values = require('./_object-to-array')(false); + +$export($export.S, 'Object', { + values: function values(it){ + return $values(it); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.observable.js b/node_modules/core-js/modules/es7.observable.js new file mode 100755 index 00000000..e34fa4f2 --- /dev/null +++ b/node_modules/core-js/modules/es7.observable.js @@ -0,0 +1,199 @@ +'use strict'; +// https://github.com/zenparsing/es-observable +var $export = require('./_export') + , global = require('./_global') + , core = require('./_core') + , microtask = require('./_microtask')() + , OBSERVABLE = require('./_wks')('observable') + , aFunction = require('./_a-function') + , anObject = require('./_an-object') + , anInstance = require('./_an-instance') + , redefineAll = require('./_redefine-all') + , hide = require('./_hide') + , forOf = require('./_for-of') + , RETURN = forOf.RETURN; + +var getMethod = function(fn){ + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function(subscription){ + var cleanup = subscription._c; + if(cleanup){ + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function(subscription){ + return subscription._o === undefined; +}; + +var closeSubscription = function(subscription){ + if(!subscriptionClosed(subscription)){ + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function(observer, subscriber){ + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer) + , subscription = cleanup; + if(cleanup != null){ + if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch(e){ + observer.error(e); + return; + } if(subscriptionClosed(this))cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe(){ closeSubscription(this); } +}); + +var SubscriptionObserver = function(subscription){ + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if(m)return m.call(observer, value); + } catch(e){ + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value){ + var subscription = this._s; + if(subscriptionClosed(subscription))throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if(!m)throw value; + value = m.call(observer, value); + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber){ + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer){ + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn){ + var that = this; + return new (core.Promise || global.Promise)(function(resolve, reject){ + aFunction(fn); + var subscription = that.subscribe({ + next : function(value){ + try { + return fn(value); + } catch(e){ + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x){ + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if(method){ + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function(observer){ + return observable.subscribe(observer); + }); + } + return new C(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + try { + if(forOf(x, false, function(it){ + observer.next(it); + if(done)return RETURN; + }) === RETURN)return; + } catch(e){ + if(done)throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + }, + of: function of(){ + for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + for(var i = 0; i < items.length; ++i){ + observer.next(items[i]); + if(done)return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function(){ return this; }); + +$export($export.G, {Observable: $Observable}); + +require('./_set-species')('Observable'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.define-metadata.js b/node_modules/core-js/modules/es7.reflect.define-metadata.js new file mode 100755 index 00000000..c833e431 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.define-metadata.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.delete-metadata.js b/node_modules/core-js/modules/es7.reflect.delete-metadata.js new file mode 100755 index 00000000..8a8a8253 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.delete-metadata.js @@ -0,0 +1,15 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , toMetaKey = metadata.key + , getOrCreateMetadataMap = metadata.map + , store = metadata.store; + +metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){ + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]) + , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false; + if(metadataMap.size)return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js b/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js new file mode 100755 index 00000000..58c4dcc2 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js @@ -0,0 +1,19 @@ +var Set = require('./es6.set') + , from = require('./_array-from-iterable') + , metadata = require('./_metadata') + , anObject = require('./_an-object') + , getPrototypeOf = require('./_object-gpo') + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function(O, P){ + var oKeys = ordinaryOwnMetadataKeys(O, P) + , parent = getPrototypeOf(O); + if(parent === null)return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.get-metadata.js b/node_modules/core-js/modules/es7.reflect.get-metadata.js new file mode 100755 index 00000000..48cd9d67 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-metadata.js @@ -0,0 +1,17 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , getPrototypeOf = require('./_object-gpo') + , ordinaryHasOwnMetadata = metadata.has + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + +var ordinaryGetMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js b/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js new file mode 100755 index 00000000..93ecfbe5 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + +metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.get-own-metadata.js b/node_modules/core-js/modules/es7.reflect.get-own-metadata.js new file mode 100755 index 00000000..f1040f91 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + +metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.has-metadata.js b/node_modules/core-js/modules/es7.reflect.has-metadata.js new file mode 100755 index 00000000..0ff63786 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.has-metadata.js @@ -0,0 +1,16 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , getPrototypeOf = require('./_object-gpo') + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + +var ordinaryHasMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.has-own-metadata.js b/node_modules/core-js/modules/es7.reflect.has-own-metadata.js new file mode 100755 index 00000000..d645ea3f --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.has-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + +metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.reflect.metadata.js b/node_modules/core-js/modules/es7.reflect.metadata.js new file mode 100755 index 00000000..3a4e3aee --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.metadata.js @@ -0,0 +1,15 @@ +var metadata = require('./_metadata') + , anObject = require('./_an-object') + , aFunction = require('./_a-function') + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({metadata: function metadata(metadataKey, metadataValue){ + return function decorator(target, targetKey){ + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +}}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.set.to-json.js b/node_modules/core-js/modules/es7.set.to-json.js new file mode 100755 index 00000000..fd68cb51 --- /dev/null +++ b/node_modules/core-js/modules/es7.set.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Set', {toJSON: require('./_collection-to-json')('Set')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.string.at.js b/node_modules/core-js/modules/es7.string.at.js new file mode 100755 index 00000000..208654e6 --- /dev/null +++ b/node_modules/core-js/modules/es7.string.at.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/mathiasbynens/String.prototype.at +var $export = require('./_export') + , $at = require('./_string-at')(true); + +$export($export.P, 'String', { + at: function at(pos){ + return $at(this, pos); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.string.match-all.js b/node_modules/core-js/modules/es7.string.match-all.js new file mode 100755 index 00000000..cb0099b3 --- /dev/null +++ b/node_modules/core-js/modules/es7.string.match-all.js @@ -0,0 +1,30 @@ +'use strict'; +// https://tc39.github.io/String.prototype.matchAll/ +var $export = require('./_export') + , defined = require('./_defined') + , toLength = require('./_to-length') + , isRegExp = require('./_is-regexp') + , getFlags = require('./_flags') + , RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function(regexp, string){ + this._r = regexp; + this._s = string; +}; + +require('./_iter-create')($RegExpStringIterator, 'RegExp String', function next(){ + var match = this._r.exec(this._s); + return {value: match, done: match === null}; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp){ + defined(this); + if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!'); + var S = String(this) + , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp) + , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.string.pad-end.js b/node_modules/core-js/modules/es7.string.pad-end.js new file mode 100755 index 00000000..8483d82f --- /dev/null +++ b/node_modules/core-js/modules/es7.string.pad-end.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export') + , $pad = require('./_string-pad'); + +$export($export.P, 'String', { + padEnd: function padEnd(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.string.pad-start.js b/node_modules/core-js/modules/es7.string.pad-start.js new file mode 100755 index 00000000..b79b605d --- /dev/null +++ b/node_modules/core-js/modules/es7.string.pad-start.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export') + , $pad = require('./_string-pad'); + +$export($export.P, 'String', { + padStart: function padStart(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.string.trim-left.js b/node_modules/core-js/modules/es7.string.trim-left.js new file mode 100755 index 00000000..e5845771 --- /dev/null +++ b/node_modules/core-js/modules/es7.string.trim-left.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimLeft', function($trim){ + return function trimLeft(){ + return $trim(this, 1); + }; +}, 'trimStart'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.string.trim-right.js b/node_modules/core-js/modules/es7.string.trim-right.js new file mode 100755 index 00000000..42a9ed33 --- /dev/null +++ b/node_modules/core-js/modules/es7.string.trim-right.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimRight', function($trim){ + return function trimRight(){ + return $trim(this, 2); + }; +}, 'trimEnd'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.symbol.async-iterator.js b/node_modules/core-js/modules/es7.symbol.async-iterator.js new file mode 100755 index 00000000..cf9f74a5 --- /dev/null +++ b/node_modules/core-js/modules/es7.symbol.async-iterator.js @@ -0,0 +1 @@ +require('./_wks-define')('asyncIterator'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.symbol.observable.js b/node_modules/core-js/modules/es7.symbol.observable.js new file mode 100755 index 00000000..0163bca5 --- /dev/null +++ b/node_modules/core-js/modules/es7.symbol.observable.js @@ -0,0 +1 @@ +require('./_wks-define')('observable'); \ No newline at end of file diff --git a/node_modules/core-js/modules/es7.system.global.js b/node_modules/core-js/modules/es7.system.global.js new file mode 100755 index 00000000..8c2ab82d --- /dev/null +++ b/node_modules/core-js/modules/es7.system.global.js @@ -0,0 +1,4 @@ +// https://github.com/ljharb/proposal-global +var $export = require('./_export'); + +$export($export.S, 'System', {global: require('./_global')}); \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_add-to-unscopables.js b/node_modules/core-js/modules/library/_add-to-unscopables.js new file mode 100755 index 00000000..faf87af3 --- /dev/null +++ b/node_modules/core-js/modules/library/_add-to-unscopables.js @@ -0,0 +1 @@ +module.exports = function(){ /* empty */ }; \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_collection.js b/node_modules/core-js/modules/library/_collection.js new file mode 100755 index 00000000..0bdd7fcb --- /dev/null +++ b/node_modules/core-js/modules/library/_collection.js @@ -0,0 +1,59 @@ +'use strict'; +var global = require('./_global') + , $export = require('./_export') + , meta = require('./_meta') + , fails = require('./_fails') + , hide = require('./_hide') + , redefineAll = require('./_redefine-all') + , forOf = require('./_for-of') + , anInstance = require('./_an-instance') + , isObject = require('./_is-object') + , setToStringTag = require('./_set-to-string-tag') + , dP = require('./_object-dp').f + , each = require('./_array-methods')(0) + , DESCRIPTORS = require('./_descriptors'); + +module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + if(!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME, '_c'); + target._c = new Base; + if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','),function(KEY){ + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){ + anInstance(this, C, KEY); + if(!IS_ADDER && IS_WEAK && !isObject(a))return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + if('size' in proto)dP(C.prototype, 'size', { + get: function(){ + return this._c.size; + } + }); + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F, O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_export.js b/node_modules/core-js/modules/library/_export.js new file mode 100755 index 00000000..dc084b4c --- /dev/null +++ b/node_modules/core-js/modules/library/_export.js @@ -0,0 +1,61 @@ +var global = require('./_global') + , core = require('./_core') + , ctx = require('./_ctx') + , hide = require('./_hide') + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , IS_WRAP = type & $export.W + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] + , key, own, out; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if(own && key in exports)continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function(C){ + var F = function(a, b, c){ + if(this instanceof C){ + switch(arguments.length){ + case 0: return new C; + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if(IS_PROTO){ + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_library.js b/node_modules/core-js/modules/library/_library.js new file mode 100755 index 00000000..73f737c5 --- /dev/null +++ b/node_modules/core-js/modules/library/_library.js @@ -0,0 +1 @@ +module.exports = true; \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_path.js b/node_modules/core-js/modules/library/_path.js new file mode 100755 index 00000000..e2b878dc --- /dev/null +++ b/node_modules/core-js/modules/library/_path.js @@ -0,0 +1 @@ +module.exports = require('./_core'); \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_redefine-all.js b/node_modules/core-js/modules/library/_redefine-all.js new file mode 100755 index 00000000..beeb2eaf --- /dev/null +++ b/node_modules/core-js/modules/library/_redefine-all.js @@ -0,0 +1,7 @@ +var hide = require('./_hide'); +module.exports = function(target, src, safe){ + for(var key in src){ + if(safe && target[key])target[key] = src[key]; + else hide(target, key, src[key]); + } return target; +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_redefine.js b/node_modules/core-js/modules/library/_redefine.js new file mode 100755 index 00000000..6bd64530 --- /dev/null +++ b/node_modules/core-js/modules/library/_redefine.js @@ -0,0 +1 @@ +module.exports = require('./_hide'); \ No newline at end of file diff --git a/node_modules/core-js/modules/library/_set-species.js b/node_modules/core-js/modules/library/_set-species.js new file mode 100755 index 00000000..4320fa51 --- /dev/null +++ b/node_modules/core-js/modules/library/_set-species.js @@ -0,0 +1,14 @@ +'use strict'; +var global = require('./_global') + , core = require('./_core') + , dP = require('./_object-dp') + , DESCRIPTORS = require('./_descriptors') + , SPECIES = require('./_wks')('species'); + +module.exports = function(KEY){ + var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; \ No newline at end of file diff --git a/node_modules/core-js/modules/library/es6.date.to-primitive.js b/node_modules/core-js/modules/library/es6.date.to-primitive.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.date.to-string.js b/node_modules/core-js/modules/library/es6.date.to-string.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.function.name.js b/node_modules/core-js/modules/library/es6.function.name.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.number.constructor.js b/node_modules/core-js/modules/library/es6.number.constructor.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.object.to-string.js b/node_modules/core-js/modules/library/es6.object.to-string.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.regexp.constructor.js b/node_modules/core-js/modules/library/es6.regexp.constructor.js new file mode 100755 index 00000000..7313c52b --- /dev/null +++ b/node_modules/core-js/modules/library/es6.regexp.constructor.js @@ -0,0 +1 @@ +require('./_set-species')('RegExp'); \ No newline at end of file diff --git a/node_modules/core-js/modules/library/es6.regexp.flags.js b/node_modules/core-js/modules/library/es6.regexp.flags.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.regexp.match.js b/node_modules/core-js/modules/library/es6.regexp.match.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.regexp.replace.js b/node_modules/core-js/modules/library/es6.regexp.replace.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.regexp.search.js b/node_modules/core-js/modules/library/es6.regexp.search.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.regexp.split.js b/node_modules/core-js/modules/library/es6.regexp.split.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/es6.regexp.to-string.js b/node_modules/core-js/modules/library/es6.regexp.to-string.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/core-js/modules/library/web.dom.iterable.js b/node_modules/core-js/modules/library/web.dom.iterable.js new file mode 100755 index 00000000..e56371a9 --- /dev/null +++ b/node_modules/core-js/modules/library/web.dom.iterable.js @@ -0,0 +1,13 @@ +require('./es6.array.iterator'); +var global = require('./_global') + , hide = require('./_hide') + , Iterators = require('./_iterators') + , TO_STRING_TAG = require('./_wks')('toStringTag'); + +for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype; + if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} \ No newline at end of file diff --git a/node_modules/core-js/modules/web.dom.iterable.js b/node_modules/core-js/modules/web.dom.iterable.js new file mode 100755 index 00000000..a5a4c08e --- /dev/null +++ b/node_modules/core-js/modules/web.dom.iterable.js @@ -0,0 +1,22 @@ +var $iterators = require('./es6.array.iterator') + , redefine = require('./_redefine') + , global = require('./_global') + , hide = require('./_hide') + , Iterators = require('./_iterators') + , wks = require('./_wks') + , ITERATOR = wks('iterator') + , TO_STRING_TAG = wks('toStringTag') + , ArrayValues = Iterators.Array; + +for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype + , key; + if(proto){ + if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues); + if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); + } +} \ No newline at end of file diff --git a/node_modules/core-js/modules/web.immediate.js b/node_modules/core-js/modules/web.immediate.js new file mode 100755 index 00000000..5b946377 --- /dev/null +++ b/node_modules/core-js/modules/web.immediate.js @@ -0,0 +1,6 @@ +var $export = require('./_export') + , $task = require('./_task'); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); \ No newline at end of file diff --git a/node_modules/core-js/modules/web.timers.js b/node_modules/core-js/modules/web.timers.js new file mode 100755 index 00000000..1a1da57f --- /dev/null +++ b/node_modules/core-js/modules/web.timers.js @@ -0,0 +1,20 @@ +// ie9- setTimeout & setInterval additional parameters fix +var global = require('./_global') + , $export = require('./_export') + , invoke = require('./_invoke') + , partial = require('./_partial') + , navigator = global.navigator + , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check +var wrap = function(set){ + return MSIE ? function(fn, time /*, ...args */){ + return set(invoke( + partial, + [].slice.call(arguments, 2), + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); \ No newline at end of file diff --git a/node_modules/core-js/package.json b/node_modules/core-js/package.json new file mode 100755 index 00000000..ec2d171b --- /dev/null +++ b/node_modules/core-js/package.json @@ -0,0 +1,135 @@ +{ + "_args": [ + [ + { + "raw": "core-js@^2.4.0", + "scope": null, + "escapedName": "core-js", + "name": "core-js", + "rawSpec": "^2.4.0", + "spec": ">=2.4.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-runtime" + ] + ], + "_from": "core-js@>=2.4.0 <3.0.0", + "_id": "core-js@2.4.1", + "_inCache": true, + "_location": "/core-js", + "_nodeVersion": "6.2.2", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/core-js-2.4.1.tgz_1468791807265_0.5941079026088119" + }, + "_npmUser": { + "name": "zloirock", + "email": "zloirock@zloirock.ru" + }, + "_npmVersion": "3.9.5", + "_phantomChildren": {}, + "_requested": { + "raw": "core-js@^2.4.0", + "scope": null, + "escapedName": "core-js", + "name": "core-js", + "rawSpec": "^2.4.0", + "spec": ">=2.4.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-register", + "/babel-runtime" + ], + "_resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "_shasum": "4de911e667b0eae9124e34254b53aea6fc618d3e", + "_shrinkwrap": null, + "_spec": "core-js@^2.4.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-runtime", + "bugs": { + "url": "https://github.com/zloirock/core-js/issues" + }, + "dependencies": {}, + "description": "Standard library", + "devDependencies": { + "LiveScript": "1.3.x", + "es-observable-tests": "0.2.x", + "eslint": "3.1.x", + "grunt": "1.0.x", + "grunt-cli": "1.2.x", + "grunt-contrib-clean": "1.0.x", + "grunt-contrib-copy": "1.0.x", + "grunt-contrib-uglify": "1.0.x", + "grunt-contrib-watch": "1.0.x", + "grunt-karma": "2.0.x", + "grunt-livescript": "0.6.x", + "karma": "1.1.x", + "karma-chrome-launcher": "1.0.x", + "karma-firefox-launcher": "1.0.x", + "karma-ie-launcher": "1.0.x", + "karma-phantomjs-launcher": "1.0.x", + "karma-qunit": "1.1.x", + "phantomjs-prebuilt": "2.1.x", + "promises-aplus-tests": "2.1.x", + "qunitjs": "2.0.x", + "temp": "0.8.x", + "webpack": "1.13.x" + }, + "directories": {}, + "dist": { + "shasum": "4de911e667b0eae9124e34254b53aea6fc618d3e", + "tarball": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz" + }, + "gitHead": "5e106f64c726edf2849f0babc9096ce6664b7368", + "homepage": "https://github.com/zloirock/core-js#readme", + "keywords": [ + "ES3", + "ECMAScript 3", + "ES5", + "ECMAScript 5", + "ES6", + "ES2015", + "ECMAScript 6", + "ECMAScript 2015", + "ES7", + "ES2016", + "ECMAScript 7", + "ECMAScript 2016", + "Harmony", + "Strawman", + "Map", + "Set", + "WeakMap", + "WeakSet", + "Promise", + "Symbol", + "TypedArray", + "setImmediate", + "Dict", + "polyfill", + "shim" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "zloirock", + "email": "zloirock@zloirock.ru" + } + ], + "name": "core-js", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/zloirock/core-js.git" + }, + "scripts": { + "grunt": "grunt", + "lint": "eslint es5 es6 es7 stage web core fn modules", + "observables-tests": "node tests/observables/adapter && node tests/observables/adapter-library", + "promises-tests": "promises-aplus-tests tests/promises-aplus/adapter", + "test": "npm run lint && npm run grunt livescript client karma:default && npm run grunt library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs" + }, + "version": "2.4.1" +} diff --git a/node_modules/core-js/shim.js b/node_modules/core-js/shim.js new file mode 100755 index 00000000..6db12568 --- /dev/null +++ b/node_modules/core-js/shim.js @@ -0,0 +1,176 @@ +require('./modules/es6.symbol'); +require('./modules/es6.object.create'); +require('./modules/es6.object.define-property'); +require('./modules/es6.object.define-properties'); +require('./modules/es6.object.get-own-property-descriptor'); +require('./modules/es6.object.get-prototype-of'); +require('./modules/es6.object.keys'); +require('./modules/es6.object.get-own-property-names'); +require('./modules/es6.object.freeze'); +require('./modules/es6.object.seal'); +require('./modules/es6.object.prevent-extensions'); +require('./modules/es6.object.is-frozen'); +require('./modules/es6.object.is-sealed'); +require('./modules/es6.object.is-extensible'); +require('./modules/es6.object.assign'); +require('./modules/es6.object.is'); +require('./modules/es6.object.set-prototype-of'); +require('./modules/es6.object.to-string'); +require('./modules/es6.function.bind'); +require('./modules/es6.function.name'); +require('./modules/es6.function.has-instance'); +require('./modules/es6.parse-int'); +require('./modules/es6.parse-float'); +require('./modules/es6.number.constructor'); +require('./modules/es6.number.to-fixed'); +require('./modules/es6.number.to-precision'); +require('./modules/es6.number.epsilon'); +require('./modules/es6.number.is-finite'); +require('./modules/es6.number.is-integer'); +require('./modules/es6.number.is-nan'); +require('./modules/es6.number.is-safe-integer'); +require('./modules/es6.number.max-safe-integer'); +require('./modules/es6.number.min-safe-integer'); +require('./modules/es6.number.parse-float'); +require('./modules/es6.number.parse-int'); +require('./modules/es6.math.acosh'); +require('./modules/es6.math.asinh'); +require('./modules/es6.math.atanh'); +require('./modules/es6.math.cbrt'); +require('./modules/es6.math.clz32'); +require('./modules/es6.math.cosh'); +require('./modules/es6.math.expm1'); +require('./modules/es6.math.fround'); +require('./modules/es6.math.hypot'); +require('./modules/es6.math.imul'); +require('./modules/es6.math.log10'); +require('./modules/es6.math.log1p'); +require('./modules/es6.math.log2'); +require('./modules/es6.math.sign'); +require('./modules/es6.math.sinh'); +require('./modules/es6.math.tanh'); +require('./modules/es6.math.trunc'); +require('./modules/es6.string.from-code-point'); +require('./modules/es6.string.raw'); +require('./modules/es6.string.trim'); +require('./modules/es6.string.iterator'); +require('./modules/es6.string.code-point-at'); +require('./modules/es6.string.ends-with'); +require('./modules/es6.string.includes'); +require('./modules/es6.string.repeat'); +require('./modules/es6.string.starts-with'); +require('./modules/es6.string.anchor'); +require('./modules/es6.string.big'); +require('./modules/es6.string.blink'); +require('./modules/es6.string.bold'); +require('./modules/es6.string.fixed'); +require('./modules/es6.string.fontcolor'); +require('./modules/es6.string.fontsize'); +require('./modules/es6.string.italics'); +require('./modules/es6.string.link'); +require('./modules/es6.string.small'); +require('./modules/es6.string.strike'); +require('./modules/es6.string.sub'); +require('./modules/es6.string.sup'); +require('./modules/es6.date.now'); +require('./modules/es6.date.to-json'); +require('./modules/es6.date.to-iso-string'); +require('./modules/es6.date.to-string'); +require('./modules/es6.date.to-primitive'); +require('./modules/es6.array.is-array'); +require('./modules/es6.array.from'); +require('./modules/es6.array.of'); +require('./modules/es6.array.join'); +require('./modules/es6.array.slice'); +require('./modules/es6.array.sort'); +require('./modules/es6.array.for-each'); +require('./modules/es6.array.map'); +require('./modules/es6.array.filter'); +require('./modules/es6.array.some'); +require('./modules/es6.array.every'); +require('./modules/es6.array.reduce'); +require('./modules/es6.array.reduce-right'); +require('./modules/es6.array.index-of'); +require('./modules/es6.array.last-index-of'); +require('./modules/es6.array.copy-within'); +require('./modules/es6.array.fill'); +require('./modules/es6.array.find'); +require('./modules/es6.array.find-index'); +require('./modules/es6.array.species'); +require('./modules/es6.array.iterator'); +require('./modules/es6.regexp.constructor'); +require('./modules/es6.regexp.to-string'); +require('./modules/es6.regexp.flags'); +require('./modules/es6.regexp.match'); +require('./modules/es6.regexp.replace'); +require('./modules/es6.regexp.search'); +require('./modules/es6.regexp.split'); +require('./modules/es6.promise'); +require('./modules/es6.map'); +require('./modules/es6.set'); +require('./modules/es6.weak-map'); +require('./modules/es6.weak-set'); +require('./modules/es6.typed.array-buffer'); +require('./modules/es6.typed.data-view'); +require('./modules/es6.typed.int8-array'); +require('./modules/es6.typed.uint8-array'); +require('./modules/es6.typed.uint8-clamped-array'); +require('./modules/es6.typed.int16-array'); +require('./modules/es6.typed.uint16-array'); +require('./modules/es6.typed.int32-array'); +require('./modules/es6.typed.uint32-array'); +require('./modules/es6.typed.float32-array'); +require('./modules/es6.typed.float64-array'); +require('./modules/es6.reflect.apply'); +require('./modules/es6.reflect.construct'); +require('./modules/es6.reflect.define-property'); +require('./modules/es6.reflect.delete-property'); +require('./modules/es6.reflect.enumerate'); +require('./modules/es6.reflect.get'); +require('./modules/es6.reflect.get-own-property-descriptor'); +require('./modules/es6.reflect.get-prototype-of'); +require('./modules/es6.reflect.has'); +require('./modules/es6.reflect.is-extensible'); +require('./modules/es6.reflect.own-keys'); +require('./modules/es6.reflect.prevent-extensions'); +require('./modules/es6.reflect.set'); +require('./modules/es6.reflect.set-prototype-of'); +require('./modules/es7.array.includes'); +require('./modules/es7.string.at'); +require('./modules/es7.string.pad-start'); +require('./modules/es7.string.pad-end'); +require('./modules/es7.string.trim-left'); +require('./modules/es7.string.trim-right'); +require('./modules/es7.string.match-all'); +require('./modules/es7.symbol.async-iterator'); +require('./modules/es7.symbol.observable'); +require('./modules/es7.object.get-own-property-descriptors'); +require('./modules/es7.object.values'); +require('./modules/es7.object.entries'); +require('./modules/es7.object.define-getter'); +require('./modules/es7.object.define-setter'); +require('./modules/es7.object.lookup-getter'); +require('./modules/es7.object.lookup-setter'); +require('./modules/es7.map.to-json'); +require('./modules/es7.set.to-json'); +require('./modules/es7.system.global'); +require('./modules/es7.error.is-error'); +require('./modules/es7.math.iaddh'); +require('./modules/es7.math.isubh'); +require('./modules/es7.math.imulh'); +require('./modules/es7.math.umulh'); +require('./modules/es7.reflect.define-metadata'); +require('./modules/es7.reflect.delete-metadata'); +require('./modules/es7.reflect.get-metadata'); +require('./modules/es7.reflect.get-metadata-keys'); +require('./modules/es7.reflect.get-own-metadata'); +require('./modules/es7.reflect.get-own-metadata-keys'); +require('./modules/es7.reflect.has-metadata'); +require('./modules/es7.reflect.has-own-metadata'); +require('./modules/es7.reflect.metadata'); +require('./modules/es7.asap'); +require('./modules/es7.observable'); +require('./modules/web.timers'); +require('./modules/web.immediate'); +require('./modules/web.dom.iterable'); +module.exports = require('./modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/stage/0.js b/node_modules/core-js/stage/0.js new file mode 100755 index 00000000..e89a005f --- /dev/null +++ b/node_modules/core-js/stage/0.js @@ -0,0 +1,10 @@ +require('../modules/es7.string.at'); +require('../modules/es7.map.to-json'); +require('../modules/es7.set.to-json'); +require('../modules/es7.error.is-error'); +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +require('../modules/es7.asap'); +module.exports = require('./1'); \ No newline at end of file diff --git a/node_modules/core-js/stage/1.js b/node_modules/core-js/stage/1.js new file mode 100755 index 00000000..230fe13a --- /dev/null +++ b/node_modules/core-js/stage/1.js @@ -0,0 +1,6 @@ +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.string.match-all'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +module.exports = require('./2'); diff --git a/node_modules/core-js/stage/2.js b/node_modules/core-js/stage/2.js new file mode 100755 index 00000000..ba444e1a --- /dev/null +++ b/node_modules/core-js/stage/2.js @@ -0,0 +1,3 @@ +require('../modules/es7.system.global'); +require('../modules/es7.symbol.async-iterator'); +module.exports = require('./3'); diff --git a/node_modules/core-js/stage/3.js b/node_modules/core-js/stage/3.js new file mode 100755 index 00000000..c1ea400a --- /dev/null +++ b/node_modules/core-js/stage/3.js @@ -0,0 +1,4 @@ +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +module.exports = require('./4'); diff --git a/node_modules/core-js/stage/4.js b/node_modules/core-js/stage/4.js new file mode 100755 index 00000000..0fb53ddd --- /dev/null +++ b/node_modules/core-js/stage/4.js @@ -0,0 +1,8 @@ +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.array.includes'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/stage/index.js b/node_modules/core-js/stage/index.js new file mode 100755 index 00000000..eb959140 --- /dev/null +++ b/node_modules/core-js/stage/index.js @@ -0,0 +1 @@ +module.exports = require('./pre'); \ No newline at end of file diff --git a/node_modules/core-js/stage/pre.js b/node_modules/core-js/stage/pre.js new file mode 100755 index 00000000..f3bc54d9 --- /dev/null +++ b/node_modules/core-js/stage/pre.js @@ -0,0 +1,10 @@ +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +module.exports = require('./0'); \ No newline at end of file diff --git a/node_modules/core-js/web/dom-collections.js b/node_modules/core-js/web/dom-collections.js new file mode 100755 index 00000000..2118e3fe --- /dev/null +++ b/node_modules/core-js/web/dom-collections.js @@ -0,0 +1,2 @@ +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/web/immediate.js b/node_modules/core-js/web/immediate.js new file mode 100755 index 00000000..244ebb16 --- /dev/null +++ b/node_modules/core-js/web/immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/web/index.js b/node_modules/core-js/web/index.js new file mode 100755 index 00000000..6687d571 --- /dev/null +++ b/node_modules/core-js/web/index.js @@ -0,0 +1,4 @@ +require('../modules/web.timers'); +require('../modules/web.immediate'); +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-js/web/timers.js b/node_modules/core-js/web/timers.js new file mode 100755 index 00000000..2c66f438 --- /dev/null +++ b/node_modules/core-js/web/timers.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core'); \ No newline at end of file diff --git a/node_modules/core-util-is/LICENSE b/node_modules/core-util-is/LICENSE new file mode 100755 index 00000000..d8d7f943 --- /dev/null +++ b/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/core-util-is/README.md b/node_modules/core-util-is/README.md new file mode 100755 index 00000000..5a76b414 --- /dev/null +++ b/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/node_modules/core-util-is/float.patch b/node_modules/core-util-is/float.patch new file mode 100755 index 00000000..a06d5c05 --- /dev/null +++ b/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/node_modules/core-util-is/lib/util.js b/node_modules/core-util-is/lib/util.js new file mode 100755 index 00000000..ff4c851c --- /dev/null +++ b/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/node_modules/core-util-is/package.json b/node_modules/core-util-is/package.json new file mode 100755 index 00000000..61810915 --- /dev/null +++ b/node_modules/core-util-is/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "core-util-is@~1.0.0", + "scope": null, + "escapedName": "core-util-is", + "name": "core-util-is", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream" + ] + ], + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_id": "core-util-is@1.0.2", + "_inCache": true, + "_location": "/core-util-is", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "raw": "core-util-is@~1.0.0", + "scope": null, + "escapedName": "core-util-is", + "name": "core-util-is", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_shrinkwrap": null, + "_spec": "core-util-is@~1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "dependencies": {}, + "description": "The `util.is*` functions introduced in Node v0.12.", + "devDependencies": { + "tap": "^2.3.0" + }, + "directories": {}, + "dist": { + "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", + "homepage": "https://github.com/isaacs/core-util-is#readme", + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "license": "MIT", + "main": "lib/util.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "core-util-is", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "scripts": { + "test": "tap test.js" + }, + "version": "1.0.2" +} diff --git a/node_modules/core-util-is/test.js b/node_modules/core-util-is/test.js new file mode 100755 index 00000000..1a490c65 --- /dev/null +++ b/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/node_modules/crypto-browserify/.npmignore b/node_modules/crypto-browserify/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/crypto-browserify/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/crypto-browserify/.travis.yml b/node_modules/crypto-browserify/.travis.yml new file mode 100755 index 00000000..7a589da3 --- /dev/null +++ b/node_modules/crypto-browserify/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + diff --git a/node_modules/crypto-browserify/LICENSE b/node_modules/crypto-browserify/LICENSE new file mode 100755 index 00000000..8abb57d6 --- /dev/null +++ b/node_modules/crypto-browserify/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2013 Dominic Tarr + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/crypto-browserify/c.js b/node_modules/crypto-browserify/c.js new file mode 100755 index 00000000..6f50cb43 --- /dev/null +++ b/node_modules/crypto-browserify/c.js @@ -0,0 +1,19058 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o blocksize) { + key = createHash(alg).update(key).digest() + } else if(key.length < blocksize) { + key = Buffer.concat([key, zeroBuffer], blocksize) + } + + var ipad = this._ipad = new Buffer(blocksize) + var opad = this._opad = new Buffer(blocksize) + + for(var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + this._hash = createHash(alg).update(ipad) +} + +Hmac.prototype.update = function (data, enc) { + this._hash.update(data, enc) + return this +} + +Hmac.prototype.digest = function (enc) { + var h = this._hash.digest() + return createHash(this._alg).update(this._opad).update(h).digest(enc) +} + + +}).call(this,require("buffer").Buffer) +},{"./create-hash":1,"buffer":37}],3:[function(require,module,exports){ +(function (Buffer){ +var intSize = 4; +var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0); +var chrsz = 8; + +function toArray(buf, bigEndian) { + if ((buf.length % intSize) !== 0) { + var len = buf.length + (intSize - (buf.length % intSize)); + buf = Buffer.concat([buf, zeroBuffer], len); + } + + var arr = []; + var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE; + for (var i = 0; i < buf.length; i += intSize) { + arr.push(fn.call(buf, i)); + } + return arr; +} + +function toBuffer(arr, size, bigEndian) { + var buf = new Buffer(size); + var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE; + for (var i = 0; i < arr.length; i++) { + fn.call(buf, arr[i], i * 4, true); + } + return buf; +} + +function hash(buf, fn, hashSize, bigEndian) { + if (!Buffer.isBuffer(buf)) buf = new Buffer(buf); + var arr = fn(toArray(buf, bigEndian), buf.length * chrsz); + return toBuffer(arr, hashSize, bigEndian); +} + +module.exports = { hash: hash }; + +}).call(this,require("buffer").Buffer) +},{"buffer":37}],4:[function(require,module,exports){ +(function (Buffer){ +var rng = require('./rng') + +function error () { + var m = [].slice.call(arguments).join(' ') + throw new Error([ + m, + 'we accept pull requests', + 'http://github.com/dominictarr/crypto-browserify' + ].join('\n')) +} + +exports.createHash = require('./create-hash') + +exports.createHmac = require('./create-hmac') + +exports.randomBytes = function(size, callback) { + if (callback && callback.call) { + try { + callback.call(this, undefined, new Buffer(rng(size))) + } catch (err) { callback(err) } + } else { + return new Buffer(rng(size)) + } +} + +function each(a, f) { + for(var i in a) + f(a[i], i) +} + +exports.getHashes = function () { + return ['sha1', 'sha256', 'sha512', 'md5', 'rmd160'] +} + +var p = require('./pbkdf2')(exports) +exports.pbkdf2 = p.pbkdf2 +exports.pbkdf2Sync = p.pbkdf2Sync + + +// the least I can do is make error messages for the rest of the node.js/crypto api. +each(['createCredentials' +, 'createCipher' +, 'createCipheriv' +, 'createDecipher' +, 'createDecipheriv' +, 'createSign' +, 'createVerify' +, 'createDiffieHellman' +], function (name) { + exports[name] = function () { + error('sorry,', name, 'is not implemented yet') + } +}) + +}).call(this,require("buffer").Buffer) +},{"./create-hash":1,"./create-hmac":2,"./pbkdf2":32,"./rng":33,"buffer":37}],5:[function(require,module,exports){ +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +var helpers = require('./helpers'); + +/* + * Calculate the MD5 of an array of little-endian words, and a bit length + */ +function core_md5(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); + d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); + d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); + d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i+10], 17, -42063); + b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); + d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); + d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); + c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); + d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); + c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); + d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); + c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); + d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); + c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); + d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); + d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); + d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); + d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); + d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); + d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); + d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); + d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); + +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function md5_cmn(q, a, b, x, s, t) +{ + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) +{ + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function md5_gg(a, b, c, d, x, s, t) +{ + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); +} +function md5_hh(a, b, c, d, x, s, t) +{ + return md5_cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5_ii(a, b, c, d, x, s, t) +{ + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function bit_rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} + +module.exports = function md5(buf) { + return helpers.hash(buf, core_md5, 16); +}; + +},{"./helpers":3}],6:[function(require,module,exports){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +var base64 = require('base64-js') +var ieee754 = require('ieee754') + +exports.Buffer = Buffer +exports.SlowBuffer = Buffer +exports.INSPECT_MAX_BYTES = 50 +Buffer.poolSize = 8192 + +/** + * If `Buffer._useTypedArrays`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (compatible down to IE6) + */ +Buffer._useTypedArrays = (function () { + // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+, + // Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding + // properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support + // because we need to be able to add all the node Buffer API methods. This is an issue + // in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438 + try { + var buf = new ArrayBuffer(0) + var arr = new Uint8Array(buf) + arr.foo = function () { return 42 } + return 42 === arr.foo() && + typeof arr.subarray === 'function' // Chrome 9-10 lack `subarray` + } catch (e) { + return false + } +})() + +/** + * Class: Buffer + * ============= + * + * The Buffer constructor returns instances of `Uint8Array` that are augmented + * with function properties for all the node `Buffer` API functions. We use + * `Uint8Array` so that square bracket notation works as expected -- it returns + * a single octet. + * + * By augmenting the instances, we can avoid modifying the `Uint8Array` + * prototype. + */ +function Buffer (subject, encoding, noZero) { + if (!(this instanceof Buffer)) + return new Buffer(subject, encoding, noZero) + + var type = typeof subject + + if (encoding === 'base64' && type === 'string') { + subject = base64clean(subject) + } + + // Find the length + var length + if (type === 'number') + length = coerce(subject) + else if (type === 'string') + length = Buffer.byteLength(subject, encoding) + else if (type === 'object') + length = coerce(subject.length) // assume that object is array-like + else + throw new Error('First argument needs to be a number, array or string.') + + var buf + if (Buffer._useTypedArrays) { + // Preferred: Return an augmented `Uint8Array` instance for best performance + buf = Buffer._augment(new Uint8Array(length)) + } else { + // Fallback: Return THIS instance of Buffer (created by `new`) + buf = this + buf.length = length + buf._isBuffer = true + } + + var i + if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') { + // Speed optimization -- use set if we're copying from a typed array + buf._set(subject) + } else if (isArrayish(subject)) { + // Treat array-ish objects as a byte array + if (Buffer.isBuffer(subject)) { + for (i = 0; i < length; i++) + buf[i] = subject.readUInt8(i) + } else { + for (i = 0; i < length; i++) + buf[i] = ((subject[i] % 256) + 256) % 256 + } + } else if (type === 'string') { + buf.write(subject, 0, encoding) + } else if (type === 'number' && !Buffer._useTypedArrays && !noZero) { + for (i = 0; i < length; i++) { + buf[i] = 0 + } + } + + return buf +} + +// STATIC METHODS +// ============== + +Buffer.isEncoding = function (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'raw': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.isBuffer = function (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.byteLength = function (str, encoding) { + var ret + str = str.toString() + switch (encoding || 'utf8') { + case 'hex': + ret = str.length / 2 + break + case 'utf8': + case 'utf-8': + ret = utf8ToBytes(str).length + break + case 'ascii': + case 'binary': + case 'raw': + ret = str.length + break + case 'base64': + ret = base64ToBytes(str).length + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = str.length * 2 + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.concat = function (list, totalLength) { + assert(isArray(list), 'Usage: Buffer.concat(list[, length])') + + if (list.length === 0) { + return new Buffer(0) + } else if (list.length === 1) { + return list[0] + } + + var i + if (totalLength === undefined) { + totalLength = 0 + for (i = 0; i < list.length; i++) { + totalLength += list[i].length + } + } + + var buf = new Buffer(totalLength) + var pos = 0 + for (i = 0; i < list.length; i++) { + var item = list[i] + item.copy(buf, pos) + pos += item.length + } + return buf +} + +Buffer.compare = function (a, b) { + assert(Buffer.isBuffer(a) && Buffer.isBuffer(b), 'Arguments must be Buffers') + var x = a.length + var y = b.length + for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {} + if (i !== len) { + x = a[i] + y = b[i] + } + if (x < y) { + return -1 + } + if (y < x) { + return 1 + } + return 0 +} + +// BUFFER INSTANCE METHODS +// ======================= + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + assert(strLen % 2 === 0, 'Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; i++) { + var byte = parseInt(string.substr(i * 2, 2), 16) + assert(!isNaN(byte), 'Invalid hex string') + buf[offset + i] = byte + } + return i +} + +function utf8Write (buf, string, offset, length) { + var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length) + return charsWritten +} + +function asciiWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length) + return charsWritten +} + +function binaryWrite (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length) + return charsWritten +} + +function utf16leWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length) + return charsWritten +} + +Buffer.prototype.write = function (string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length + length = undefined + } + } else { // legacy + var swap = encoding + encoding = offset + offset = length + length = swap + } + + offset = Number(offset) || 0 + var remaining = this.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + encoding = String(encoding || 'utf8').toLowerCase() + + var ret + switch (encoding) { + case 'hex': + ret = hexWrite(this, string, offset, length) + break + case 'utf8': + case 'utf-8': + ret = utf8Write(this, string, offset, length) + break + case 'ascii': + ret = asciiWrite(this, string, offset, length) + break + case 'binary': + ret = binaryWrite(this, string, offset, length) + break + case 'base64': + ret = base64Write(this, string, offset, length) + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = utf16leWrite(this, string, offset, length) + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.prototype.toString = function (encoding, start, end) { + var self = this + + encoding = String(encoding || 'utf8').toLowerCase() + start = Number(start) || 0 + end = (end === undefined) ? self.length : Number(end) + + // Fastpath empty strings + if (end === start) + return '' + + var ret + switch (encoding) { + case 'hex': + ret = hexSlice(self, start, end) + break + case 'utf8': + case 'utf-8': + ret = utf8Slice(self, start, end) + break + case 'ascii': + ret = asciiSlice(self, start, end) + break + case 'binary': + ret = binarySlice(self, start, end) + break + case 'base64': + ret = base64Slice(self, start, end) + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = utf16leSlice(self, start, end) + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.prototype.toJSON = function () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +Buffer.prototype.equals = function (b) { + assert(Buffer.isBuffer(b), 'Argument must be a Buffer') + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.compare = function (b) { + assert(Buffer.isBuffer(b), 'Argument must be a Buffer') + return Buffer.compare(this, b) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function (target, target_start, start, end) { + var source = this + + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (!target_start) target_start = 0 + + // Copy 0 bytes; we're done + if (end === start) return + if (target.length === 0 || source.length === 0) return + + // Fatal error conditions + assert(end >= start, 'sourceEnd < sourceStart') + assert(target_start >= 0 && target_start < target.length, + 'targetStart out of bounds') + assert(start >= 0 && start < source.length, 'sourceStart out of bounds') + assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) + end = this.length + if (target.length - target_start < end - start) + end = target.length - target_start + start + + var len = end - start + + if (len < 100 || !Buffer._useTypedArrays) { + for (var i = 0; i < len; i++) { + target[i + target_start] = this[i + start] + } + } else { + target._set(this.subarray(start, start + len), target_start) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + var res = '' + var tmp = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + if (buf[i] <= 0x7F) { + res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) + tmp = '' + } else { + tmp += '%' + buf[i].toString(16) + } + } + + return res + decodeUtf8Char(tmp) +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function binarySlice (buf, start, end) { + return asciiSlice(buf, start, end) +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; i++) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function (start, end) { + var len = this.length + start = clamp(start, len, 0) + end = clamp(end, len, len) + + if (Buffer._useTypedArrays) { + return Buffer._augment(this.subarray(start, end)) + } else { + var sliceLen = end - start + var newBuf = new Buffer(sliceLen, undefined, true) + for (var i = 0; i < sliceLen; i++) { + newBuf[i] = this[i + start] + } + return newBuf + } +} + +// `get` will be removed in Node 0.13+ +Buffer.prototype.get = function (offset) { + console.log('.get() is deprecated. Access using array indexes instead.') + return this.readUInt8(offset) +} + +// `set` will be removed in Node 0.13+ +Buffer.prototype.set = function (v, offset) { + console.log('.set() is deprecated. Access using array indexes instead.') + return this.writeUInt8(v, offset) +} + +Buffer.prototype.readUInt8 = function (offset, noAssert) { + if (!noAssert) { + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'Trying to read beyond buffer length') + } + + if (offset >= this.length) + return + + return this[offset] +} + +function readUInt16 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val + if (littleEndian) { + val = buf[offset] + if (offset + 1 < len) + val |= buf[offset + 1] << 8 + } else { + val = buf[offset] << 8 + if (offset + 1 < len) + val |= buf[offset + 1] + } + return val +} + +Buffer.prototype.readUInt16LE = function (offset, noAssert) { + return readUInt16(this, offset, true, noAssert) +} + +Buffer.prototype.readUInt16BE = function (offset, noAssert) { + return readUInt16(this, offset, false, noAssert) +} + +function readUInt32 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val + if (littleEndian) { + if (offset + 2 < len) + val = buf[offset + 2] << 16 + if (offset + 1 < len) + val |= buf[offset + 1] << 8 + val |= buf[offset] + if (offset + 3 < len) + val = val + (buf[offset + 3] << 24 >>> 0) + } else { + if (offset + 1 < len) + val = buf[offset + 1] << 16 + if (offset + 2 < len) + val |= buf[offset + 2] << 8 + if (offset + 3 < len) + val |= buf[offset + 3] + val = val + (buf[offset] << 24 >>> 0) + } + return val +} + +Buffer.prototype.readUInt32LE = function (offset, noAssert) { + return readUInt32(this, offset, true, noAssert) +} + +Buffer.prototype.readUInt32BE = function (offset, noAssert) { + return readUInt32(this, offset, false, noAssert) +} + +Buffer.prototype.readInt8 = function (offset, noAssert) { + if (!noAssert) { + assert(offset !== undefined && offset !== null, + 'missing offset') + assert(offset < this.length, 'Trying to read beyond buffer length') + } + + if (offset >= this.length) + return + + var neg = this[offset] & 0x80 + if (neg) + return (0xff - this[offset] + 1) * -1 + else + return this[offset] +} + +function readInt16 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val = readUInt16(buf, offset, littleEndian, true) + var neg = val & 0x8000 + if (neg) + return (0xffff - val + 1) * -1 + else + return val +} + +Buffer.prototype.readInt16LE = function (offset, noAssert) { + return readInt16(this, offset, true, noAssert) +} + +Buffer.prototype.readInt16BE = function (offset, noAssert) { + return readInt16(this, offset, false, noAssert) +} + +function readInt32 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val = readUInt32(buf, offset, littleEndian, true) + var neg = val & 0x80000000 + if (neg) + return (0xffffffff - val + 1) * -1 + else + return val +} + +Buffer.prototype.readInt32LE = function (offset, noAssert) { + return readInt32(this, offset, true, noAssert) +} + +Buffer.prototype.readInt32BE = function (offset, noAssert) { + return readInt32(this, offset, false, noAssert) +} + +function readFloat (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + return ieee754.read(buf, offset, littleEndian, 23, 4) +} + +Buffer.prototype.readFloatLE = function (offset, noAssert) { + return readFloat(this, offset, true, noAssert) +} + +Buffer.prototype.readFloatBE = function (offset, noAssert) { + return readFloat(this, offset, false, noAssert) +} + +function readDouble (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset + 7 < buf.length, 'Trying to read beyond buffer length') + } + + return ieee754.read(buf, offset, littleEndian, 52, 8) +} + +Buffer.prototype.readDoubleLE = function (offset, noAssert) { + return readDouble(this, offset, true, noAssert) +} + +Buffer.prototype.readDoubleBE = function (offset, noAssert) { + return readDouble(this, offset, false, noAssert) +} + +Buffer.prototype.writeUInt8 = function (value, offset, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'trying to write beyond buffer length') + verifuint(value, 0xff) + } + + if (offset >= this.length) return + + this[offset] = value + return offset + 1 +} + +function writeUInt16 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'trying to write beyond buffer length') + verifuint(value, 0xffff) + } + + var len = buf.length + if (offset >= len) + return + + for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) { + buf[offset + i] = + (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } + return offset + 2 +} + +Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) { + return writeUInt16(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) { + return writeUInt16(this, value, offset, false, noAssert) +} + +function writeUInt32 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'trying to write beyond buffer length') + verifuint(value, 0xffffffff) + } + + var len = buf.length + if (offset >= len) + return + + for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) { + buf[offset + i] = + (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } + return offset + 4 +} + +Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) { + return writeUInt32(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) { + return writeUInt32(this, value, offset, false, noAssert) +} + +Buffer.prototype.writeInt8 = function (value, offset, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7f, -0x80) + } + + if (offset >= this.length) + return + + if (value >= 0) + this.writeUInt8(value, offset, noAssert) + else + this.writeUInt8(0xff + value + 1, offset, noAssert) + return offset + 1 +} + +function writeInt16 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7fff, -0x8000) + } + + var len = buf.length + if (offset >= len) + return + + if (value >= 0) + writeUInt16(buf, value, offset, littleEndian, noAssert) + else + writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert) + return offset + 2 +} + +Buffer.prototype.writeInt16LE = function (value, offset, noAssert) { + return writeInt16(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeInt16BE = function (value, offset, noAssert) { + return writeInt16(this, value, offset, false, noAssert) +} + +function writeInt32 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7fffffff, -0x80000000) + } + + var len = buf.length + if (offset >= len) + return + + if (value >= 0) + writeUInt32(buf, value, offset, littleEndian, noAssert) + else + writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert) + return offset + 4 +} + +Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { + return writeInt32(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeInt32BE = function (value, offset, noAssert) { + return writeInt32(this, value, offset, false, noAssert) +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') + verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + + var len = buf.length + if (offset >= len) + return + + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 7 < buf.length, + 'Trying to write beyond buffer length') + verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + + var len = buf.length + if (offset >= len) + return + + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// fill(value, start=0, end=buffer.length) +Buffer.prototype.fill = function (value, start, end) { + if (!value) value = 0 + if (!start) start = 0 + if (!end) end = this.length + + assert(end >= start, 'end < start') + + // Fill 0 bytes; we're done + if (end === start) return + if (this.length === 0) return + + assert(start >= 0 && start < this.length, 'start out of bounds') + assert(end >= 0 && end <= this.length, 'end out of bounds') + + var i + if (typeof value === 'number') { + for (i = start; i < end; i++) { + this[i] = value + } + } else { + var bytes = utf8ToBytes(value.toString()) + var len = bytes.length + for (i = start; i < end; i++) { + this[i] = bytes[i % len] + } + } + + return this +} + +Buffer.prototype.inspect = function () { + var out = [] + var len = this.length + for (var i = 0; i < len; i++) { + out[i] = toHex(this[i]) + if (i === exports.INSPECT_MAX_BYTES) { + out[i + 1] = '...' + break + } + } + return '' +} + +/** + * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. + * Added in Node 0.12. Only available in browsers that support ArrayBuffer. + */ +Buffer.prototype.toArrayBuffer = function () { + if (typeof Uint8Array !== 'undefined') { + if (Buffer._useTypedArrays) { + return (new Buffer(this)).buffer + } else { + var buf = new Uint8Array(this.length) + for (var i = 0, len = buf.length; i < len; i += 1) { + buf[i] = this[i] + } + return buf.buffer + } + } else { + throw new Error('Buffer.toArrayBuffer not supported in this browser') + } +} + +// HELPER FUNCTIONS +// ================ + +var BP = Buffer.prototype + +/** + * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods + */ +Buffer._augment = function (arr) { + arr._isBuffer = true + + // save reference to original Uint8Array get/set methods before overwriting + arr._get = arr.get + arr._set = arr.set + + // deprecated, will be removed in node 0.13+ + arr.get = BP.get + arr.set = BP.set + + arr.write = BP.write + arr.toString = BP.toString + arr.toLocaleString = BP.toString + arr.toJSON = BP.toJSON + arr.equals = BP.equals + arr.compare = BP.compare + arr.copy = BP.copy + arr.slice = BP.slice + arr.readUInt8 = BP.readUInt8 + arr.readUInt16LE = BP.readUInt16LE + arr.readUInt16BE = BP.readUInt16BE + arr.readUInt32LE = BP.readUInt32LE + arr.readUInt32BE = BP.readUInt32BE + arr.readInt8 = BP.readInt8 + arr.readInt16LE = BP.readInt16LE + arr.readInt16BE = BP.readInt16BE + arr.readInt32LE = BP.readInt32LE + arr.readInt32BE = BP.readInt32BE + arr.readFloatLE = BP.readFloatLE + arr.readFloatBE = BP.readFloatBE + arr.readDoubleLE = BP.readDoubleLE + arr.readDoubleBE = BP.readDoubleBE + arr.writeUInt8 = BP.writeUInt8 + arr.writeUInt16LE = BP.writeUInt16LE + arr.writeUInt16BE = BP.writeUInt16BE + arr.writeUInt32LE = BP.writeUInt32LE + arr.writeUInt32BE = BP.writeUInt32BE + arr.writeInt8 = BP.writeInt8 + arr.writeInt16LE = BP.writeInt16LE + arr.writeInt16BE = BP.writeInt16BE + arr.writeInt32LE = BP.writeInt32LE + arr.writeInt32BE = BP.writeInt32BE + arr.writeFloatLE = BP.writeFloatLE + arr.writeFloatBE = BP.writeFloatBE + arr.writeDoubleLE = BP.writeDoubleLE + arr.writeDoubleBE = BP.writeDoubleBE + arr.fill = BP.fill + arr.inspect = BP.inspect + arr.toArrayBuffer = BP.toArrayBuffer + + return arr +} + +var INVALID_BASE64_RE = /[^+\/0-9A-z]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +// slice(start, end) +function clamp (index, len, defaultValue) { + if (typeof index !== 'number') return defaultValue + index = ~~index; // Coerce to integer. + if (index >= len) return len + if (index >= 0) return index + index += len + if (index >= 0) return index + return 0 +} + +function coerce (length) { + // Coerce length to a number (possibly NaN), round up + // in case it's fractional (e.g. 123.456) then do a + // double negate to coerce a NaN to 0. Easy, right? + length = ~~Math.ceil(+length) + return length < 0 ? 0 : length +} + +function isArray (subject) { + return (Array.isArray || function (subject) { + return Object.prototype.toString.call(subject) === '[object Array]' + })(subject) +} + +function isArrayish (subject) { + return isArray(subject) || Buffer.isBuffer(subject) || + subject && typeof subject === 'object' && + typeof subject.length === 'number' +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + var b = str.charCodeAt(i) + if (b <= 0x7F) { + byteArray.push(b) + } else { + var start = i + if (b >= 0xD800 && b <= 0xDFFF) i++ + var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%') + for (var j = 0; j < h.length; j++) { + byteArray.push(parseInt(h[j], 16)) + } + } + } + return byteArray +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(str) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; i++) { + if ((i + offset >= dst.length) || (i >= src.length)) + break + dst[i + offset] = src[i] + } + return i +} + +function decodeUtf8Char (str) { + try { + return decodeURIComponent(str) + } catch (err) { + return String.fromCharCode(0xFFFD) // UTF 8 invalid char + } +} + +/* + * We have to make sure that the value is a valid integer. This means that it + * is non-negative. It has no fractional component and that it does not + * exceed the maximum allowed value. + */ +function verifuint (value, max) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value >= 0, 'specified a negative value for writing an unsigned value') + assert(value <= max, 'value is larger than maximum value for type') + assert(Math.floor(value) === value, 'value has a fractional component') +} + +function verifsint (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value <= max, 'value larger than maximum allowed value') + assert(value >= min, 'value smaller than minimum allowed value') + assert(Math.floor(value) === value, 'value has a fractional component') +} + +function verifIEEE754 (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value <= max, 'value larger than maximum allowed value') + assert(value >= min, 'value smaller than minimum allowed value') +} + +function assert (test, message) { + if (!test) throw new Error(message || 'Failed assertion') +} + +},{"base64-js":7,"ieee754":8}],7:[function(require,module,exports){ +var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +;(function (exports) { + 'use strict'; + + var Arr = (typeof Uint8Array !== 'undefined') + ? Uint8Array + : Array + + var PLUS = '+'.charCodeAt(0) + var SLASH = '/'.charCodeAt(0) + var NUMBER = '0'.charCodeAt(0) + var LOWER = 'a'.charCodeAt(0) + var UPPER = 'A'.charCodeAt(0) + + function decode (elt) { + var code = elt.charCodeAt(0) + if (code === PLUS) + return 62 // '+' + if (code === SLASH) + return 63 // '/' + if (code < NUMBER) + return -1 //no match + if (code < NUMBER + 10) + return code - NUMBER + 26 + 26 + if (code < UPPER + 26) + return code - UPPER + if (code < LOWER + 26) + return code - LOWER + 26 + } + + function b64ToByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + + if (b64.length % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + exports.toByteArray = b64ToByteArray + exports.fromByteArray = uint8ToBase64 +}(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) + +},{}],8:[function(require,module,exports){ +exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + nBits = -7, + i = isLE ? (nBytes - 1) : 0, + d = isLE ? -1 : 1, + s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity); + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); +}; + +exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), + i = isLE ? 0 : (nBytes - 1), + d = isLE ? 1 : -1, + s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); + + buffer[offset + i - d] |= s * 128; +}; + +},{}],9:[function(require,module,exports){ +module.exports=[ + { + "input": "", + "DSA": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "DSA-SHA": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "DSA-SHA1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "DSA-SHA1-old": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "RSA-MD4": "31d6cfe0d16ae931b73c59d7e0c089c0", + "RSA-MD5": "d41d8cd98f00b204e9800998ecf8427e", + "RSA-MDC2": "52525252525252522525252525252525", + "RSA-RIPEMD160": "9c1185a5c5e9fc54612808977ee8f548b2258d31", + "RSA-SHA": "f96cea198ad1dd5617ac084a3d92c6107708c0ef", + "RSA-SHA1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "RSA-SHA1-2": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "RSA-SHA224": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", + "RSA-SHA256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "RSA-SHA384": "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", + "RSA-SHA512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + "dsaEncryption": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "dsaWithSHA": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "dsaWithSHA1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "dss1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "ecdsa-with-SHA1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "md4": "31d6cfe0d16ae931b73c59d7e0c089c0", + "md4WithRSAEncryption": "31d6cfe0d16ae931b73c59d7e0c089c0", + "md5": "d41d8cd98f00b204e9800998ecf8427e", + "md5WithRSAEncryption": "d41d8cd98f00b204e9800998ecf8427e", + "mdc2": "52525252525252522525252525252525", + "mdc2WithRSA": "52525252525252522525252525252525", + "ripemd": "9c1185a5c5e9fc54612808977ee8f548b2258d31", + "ripemd160": "9c1185a5c5e9fc54612808977ee8f548b2258d31", + "ripemd160WithRSA": "9c1185a5c5e9fc54612808977ee8f548b2258d31", + "rmd160": "9c1185a5c5e9fc54612808977ee8f548b2258d31", + "sha": "f96cea198ad1dd5617ac084a3d92c6107708c0ef", + "sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "sha1WithRSAEncryption": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "sha224": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", + "sha224WithRSAEncryption": "d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "sha256WithRSAEncryption": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "sha384": "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", + "sha384WithRSAEncryption": "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", + "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + "sha512WithRSAEncryption": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + "shaWithRSAEncryption": "f96cea198ad1dd5617ac084a3d92c6107708c0ef", + "ssl2-md5": "d41d8cd98f00b204e9800998ecf8427e", + "ssl3-md5": "d41d8cd98f00b204e9800998ecf8427e", + "ssl3-sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "whirlpool": "19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3" + }, + { + "input": "JA==", + "DSA": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "DSA-SHA": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "DSA-SHA1": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "DSA-SHA1-old": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "RSA-MD4": "c7215e7d305abfa7f00f9909db8d6770", + "RSA-MD5": "c3e97dd6e97fb5125688c97f36720cbe", + "RSA-MDC2": "c2e2433873daab0be4ab43f5991d3f4f", + "RSA-RIPEMD160": "857b2f94d0b47a0a61bbee5993fd6ff34c0fe4a1", + "RSA-SHA": "7c12402b104c3b87e91f90c8451c871b019160ae", + "RSA-SHA1": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "RSA-SHA1-2": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "RSA-SHA224": "23fa1e672a6c2acdc4d7bfae713e0c9337ba057b5d5ace2685b59321", + "RSA-SHA256": "09fc96082d34c2dfc1295d92073b5ea1dc8ef8da95f14dfded011ffb96d3e54b", + "RSA-SHA384": "b1583f4b2e1bf53fc31e9dfb8e8d945a62955da709f280a9066aa8f31ef688d65e0e9816a5f1f11363b3898820bd1576", + "RSA-SHA512": "840cfc6285878464c36c9aa819d8373729eda14c3e701fd37afec1d5baa2893944c696fc4017a520abfbb1347b62e6b858211d3ea7c7dd26319601fde119c3b4", + "dsaEncryption": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "dsaWithSHA": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "dsaWithSHA1": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "dss1": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "ecdsa-with-SHA1": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "md4": "c7215e7d305abfa7f00f9909db8d6770", + "md4WithRSAEncryption": "c7215e7d305abfa7f00f9909db8d6770", + "md5": "c3e97dd6e97fb5125688c97f36720cbe", + "md5WithRSAEncryption": "c3e97dd6e97fb5125688c97f36720cbe", + "mdc2": "c2e2433873daab0be4ab43f5991d3f4f", + "mdc2WithRSA": "c2e2433873daab0be4ab43f5991d3f4f", + "ripemd": "857b2f94d0b47a0a61bbee5993fd6ff34c0fe4a1", + "ripemd160": "857b2f94d0b47a0a61bbee5993fd6ff34c0fe4a1", + "ripemd160WithRSA": "857b2f94d0b47a0a61bbee5993fd6ff34c0fe4a1", + "rmd160": "857b2f94d0b47a0a61bbee5993fd6ff34c0fe4a1", + "sha": "7c12402b104c3b87e91f90c8451c871b019160ae", + "sha1": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "sha1WithRSAEncryption": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "sha224": "23fa1e672a6c2acdc4d7bfae713e0c9337ba057b5d5ace2685b59321", + "sha224WithRSAEncryption": "23fa1e672a6c2acdc4d7bfae713e0c9337ba057b5d5ace2685b59321", + "sha256": "09fc96082d34c2dfc1295d92073b5ea1dc8ef8da95f14dfded011ffb96d3e54b", + "sha256WithRSAEncryption": "09fc96082d34c2dfc1295d92073b5ea1dc8ef8da95f14dfded011ffb96d3e54b", + "sha384": "b1583f4b2e1bf53fc31e9dfb8e8d945a62955da709f280a9066aa8f31ef688d65e0e9816a5f1f11363b3898820bd1576", + "sha384WithRSAEncryption": "b1583f4b2e1bf53fc31e9dfb8e8d945a62955da709f280a9066aa8f31ef688d65e0e9816a5f1f11363b3898820bd1576", + "sha512": "840cfc6285878464c36c9aa819d8373729eda14c3e701fd37afec1d5baa2893944c696fc4017a520abfbb1347b62e6b858211d3ea7c7dd26319601fde119c3b4", + "sha512WithRSAEncryption": "840cfc6285878464c36c9aa819d8373729eda14c3e701fd37afec1d5baa2893944c696fc4017a520abfbb1347b62e6b858211d3ea7c7dd26319601fde119c3b4", + "shaWithRSAEncryption": "7c12402b104c3b87e91f90c8451c871b019160ae", + "ssl2-md5": "c3e97dd6e97fb5125688c97f36720cbe", + "ssl3-md5": "c3e97dd6e97fb5125688c97f36720cbe", + "ssl3-sha1": "3cdf2936da2fc556bfa533ab1eb59ce710ac80e5", + "whirlpool": "42858987414fe0c406d287f84292e90ad2c4458f9d5493be95780c4bc405dc506b9db976ddbde235d969bfdff2a6abf7c55d5bcf8a4138aab828409096d079fa" + }, + { + "input": "cPA=", + "DSA": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "DSA-SHA": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "DSA-SHA1": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "DSA-SHA1-old": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "RSA-MD4": "8cec4677514fdd9f83865fb501581401", + "RSA-MD5": "038701ca277a9d4de87bff428dd30a12", + "RSA-MDC2": "d51917bf740514d2513f53e005e51d52", + "RSA-RIPEMD160": "c45bf1cfc102c6607c115ba88ad7ab701a8e1d90", + "RSA-SHA": "f21ff66e7c31a44988ad6b38fd930d4e45087b9c", + "RSA-SHA1": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "RSA-SHA1-2": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "RSA-SHA224": "e0a4d9e862c2ed21309902bff1a9fb79f5869052714d6539c5aea631", + "RSA-SHA256": "33a633841666a5c291a82bfae65deac5c537d05f9fe926cbb5b7281bf90ad150", + "RSA-SHA384": "ba3ee00e0d80afcecaf0adeb2161838a4b1ea6a4c9f0aced178ebc7dbb1ab4c51f7032b7086a804c69f864d257b7f480", + "RSA-SHA512": "94d5407efa06aa877c84b998abde44caf6948cf6b6475e519baadb41790e3fbbbecf518288d57f5a84a54892482aa76f5d17adc5be176a476b712e9b5d30bb2c", + "dsaEncryption": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "dsaWithSHA": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "dsaWithSHA1": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "dss1": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "ecdsa-with-SHA1": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "md4": "8cec4677514fdd9f83865fb501581401", + "md4WithRSAEncryption": "8cec4677514fdd9f83865fb501581401", + "md5": "038701ca277a9d4de87bff428dd30a12", + "md5WithRSAEncryption": "038701ca277a9d4de87bff428dd30a12", + "mdc2": "d51917bf740514d2513f53e005e51d52", + "mdc2WithRSA": "d51917bf740514d2513f53e005e51d52", + "ripemd": "c45bf1cfc102c6607c115ba88ad7ab701a8e1d90", + "ripemd160": "c45bf1cfc102c6607c115ba88ad7ab701a8e1d90", + "ripemd160WithRSA": "c45bf1cfc102c6607c115ba88ad7ab701a8e1d90", + "rmd160": "c45bf1cfc102c6607c115ba88ad7ab701a8e1d90", + "sha": "f21ff66e7c31a44988ad6b38fd930d4e45087b9c", + "sha1": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "sha1WithRSAEncryption": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "sha224": "e0a4d9e862c2ed21309902bff1a9fb79f5869052714d6539c5aea631", + "sha224WithRSAEncryption": "e0a4d9e862c2ed21309902bff1a9fb79f5869052714d6539c5aea631", + "sha256": "33a633841666a5c291a82bfae65deac5c537d05f9fe926cbb5b7281bf90ad150", + "sha256WithRSAEncryption": "33a633841666a5c291a82bfae65deac5c537d05f9fe926cbb5b7281bf90ad150", + "sha384": "ba3ee00e0d80afcecaf0adeb2161838a4b1ea6a4c9f0aced178ebc7dbb1ab4c51f7032b7086a804c69f864d257b7f480", + "sha384WithRSAEncryption": "ba3ee00e0d80afcecaf0adeb2161838a4b1ea6a4c9f0aced178ebc7dbb1ab4c51f7032b7086a804c69f864d257b7f480", + "sha512": "94d5407efa06aa877c84b998abde44caf6948cf6b6475e519baadb41790e3fbbbecf518288d57f5a84a54892482aa76f5d17adc5be176a476b712e9b5d30bb2c", + "sha512WithRSAEncryption": "94d5407efa06aa877c84b998abde44caf6948cf6b6475e519baadb41790e3fbbbecf518288d57f5a84a54892482aa76f5d17adc5be176a476b712e9b5d30bb2c", + "shaWithRSAEncryption": "f21ff66e7c31a44988ad6b38fd930d4e45087b9c", + "ssl2-md5": "038701ca277a9d4de87bff428dd30a12", + "ssl3-md5": "038701ca277a9d4de87bff428dd30a12", + "ssl3-sha1": "19c1e2048fa7393cfbf2d310ad8209ec11d996e5", + "whirlpool": "5380824259b0aeccc5617ba3fbf9cdf931c7053e114bec944af7e3371076ac1570a0d774135ae43c958defd06f27aa9d8576106b00b2d9ecbba0a2c88c6d6e6d" + }, + { + "input": "Dh7w", + "DSA": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "DSA-SHA": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "DSA-SHA1": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "DSA-SHA1-old": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "RSA-MD4": "fe6f223ef7e24708a7a4419114aa8879", + "RSA-MD5": "bc60c6192e361d99b59d47250668a852", + "RSA-MDC2": "11a97b562c33212f0d47473dbc43313e", + "RSA-RIPEMD160": "bb76cf98ffe1e37d0c10f15706f73c463dc71053", + "RSA-SHA": "e03d5e997e65b6b7b8c96826fd28e36a59f2a26c", + "RSA-SHA1": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "RSA-SHA1-2": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "RSA-SHA224": "9896a021c402d700800fbc74f9bbf44740349cff83e7763e576cfc51", + "RSA-SHA256": "8e2cc699f7e677265069f172d4cba15c146e954d7e4f2a8c176576035275b7a0", + "RSA-SHA384": "4f779d096abf21d57803369791631552128e67e70cb0d40f56b4e7f0b4b484e794d81aba38a838c95b2d3548c2a0ef40", + "RSA-SHA512": "41e7f289effb46f2ca50b65f9702acc92a4c238a55ce2451a8fa6ccd46e589323ae9ff6dcec415aa42f238749ce9c43f3a7e6d1eaebc27fc7715895afcb16d8f", + "dsaEncryption": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "dsaWithSHA": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "dsaWithSHA1": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "dss1": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "ecdsa-with-SHA1": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "md4": "fe6f223ef7e24708a7a4419114aa8879", + "md4WithRSAEncryption": "fe6f223ef7e24708a7a4419114aa8879", + "md5": "bc60c6192e361d99b59d47250668a852", + "md5WithRSAEncryption": "bc60c6192e361d99b59d47250668a852", + "mdc2": "11a97b562c33212f0d47473dbc43313e", + "mdc2WithRSA": "11a97b562c33212f0d47473dbc43313e", + "ripemd": "bb76cf98ffe1e37d0c10f15706f73c463dc71053", + "ripemd160": "bb76cf98ffe1e37d0c10f15706f73c463dc71053", + "ripemd160WithRSA": "bb76cf98ffe1e37d0c10f15706f73c463dc71053", + "rmd160": "bb76cf98ffe1e37d0c10f15706f73c463dc71053", + "sha": "e03d5e997e65b6b7b8c96826fd28e36a59f2a26c", + "sha1": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "sha1WithRSAEncryption": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "sha224": "9896a021c402d700800fbc74f9bbf44740349cff83e7763e576cfc51", + "sha224WithRSAEncryption": "9896a021c402d700800fbc74f9bbf44740349cff83e7763e576cfc51", + "sha256": "8e2cc699f7e677265069f172d4cba15c146e954d7e4f2a8c176576035275b7a0", + "sha256WithRSAEncryption": "8e2cc699f7e677265069f172d4cba15c146e954d7e4f2a8c176576035275b7a0", + "sha384": "4f779d096abf21d57803369791631552128e67e70cb0d40f56b4e7f0b4b484e794d81aba38a838c95b2d3548c2a0ef40", + "sha384WithRSAEncryption": "4f779d096abf21d57803369791631552128e67e70cb0d40f56b4e7f0b4b484e794d81aba38a838c95b2d3548c2a0ef40", + "sha512": "41e7f289effb46f2ca50b65f9702acc92a4c238a55ce2451a8fa6ccd46e589323ae9ff6dcec415aa42f238749ce9c43f3a7e6d1eaebc27fc7715895afcb16d8f", + "sha512WithRSAEncryption": "41e7f289effb46f2ca50b65f9702acc92a4c238a55ce2451a8fa6ccd46e589323ae9ff6dcec415aa42f238749ce9c43f3a7e6d1eaebc27fc7715895afcb16d8f", + "shaWithRSAEncryption": "e03d5e997e65b6b7b8c96826fd28e36a59f2a26c", + "ssl2-md5": "bc60c6192e361d99b59d47250668a852", + "ssl3-md5": "bc60c6192e361d99b59d47250668a852", + "ssl3-sha1": "ca775d8c80faa6f87fa62beca6ca6089d63b56e5", + "whirlpool": "620675595fcfcbe8486c3eb819075c4aa54b3a022289407a4d68f851278ecba71c83b58e8b9de7a28cff4a45da99e8fc9633f9e9f05bdc01bc0ed5007ec4bc11" + }, + { + "input": "CDh4jw==", + "DSA": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "DSA-SHA": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "DSA-SHA1": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "DSA-SHA1-old": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "RSA-MD4": "70b7b5c5509efe254425736c8eeddca7", + "RSA-MD5": "542c3a0ab6b51bc6a88fa7bb567bca3e", + "RSA-MDC2": "0a010c91851876665dab9f9ad6fcfa77", + "RSA-RIPEMD160": "744a76f9ad4b9b264e834fae665dc5c9be024b1e", + "RSA-SHA": "3eaee2d3221c01fcf5f5626b01642fc69806b5c9", + "RSA-SHA1": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "RSA-SHA1-2": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "RSA-SHA224": "65e4b1ec58c705d04782f44c6d6c5b67ad7469cc3dddd165f08fdc39", + "RSA-SHA256": "8096d72b968a2dbb7ceee163c1981f7f1ec11ee10051b2dc2a8d7601d4e56971", + "RSA-SHA384": "4b2ea7a3e1142ed72ba0e2503a024299d47580928eaa1de8fdc2b2df399e9ddda0654cbc0006ea776bc4a21c8a28b49a", + "RSA-SHA512": "9115ace4a1fb9ad2e367f24cd73a68347db6103e4429f3ef989643563f1eeb74cb279561c461eb67cf47bdc764c107e4371415dab3f089f0f189edf9cc09a84a", + "dsaEncryption": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "dsaWithSHA": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "dsaWithSHA1": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "dss1": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "ecdsa-with-SHA1": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "md4": "70b7b5c5509efe254425736c8eeddca7", + "md4WithRSAEncryption": "70b7b5c5509efe254425736c8eeddca7", + "md5": "542c3a0ab6b51bc6a88fa7bb567bca3e", + "md5WithRSAEncryption": "542c3a0ab6b51bc6a88fa7bb567bca3e", + "mdc2": "0a010c91851876665dab9f9ad6fcfa77", + "mdc2WithRSA": "0a010c91851876665dab9f9ad6fcfa77", + "ripemd": "744a76f9ad4b9b264e834fae665dc5c9be024b1e", + "ripemd160": "744a76f9ad4b9b264e834fae665dc5c9be024b1e", + "ripemd160WithRSA": "744a76f9ad4b9b264e834fae665dc5c9be024b1e", + "rmd160": "744a76f9ad4b9b264e834fae665dc5c9be024b1e", + "sha": "3eaee2d3221c01fcf5f5626b01642fc69806b5c9", + "sha1": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "sha1WithRSAEncryption": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "sha224": "65e4b1ec58c705d04782f44c6d6c5b67ad7469cc3dddd165f08fdc39", + "sha224WithRSAEncryption": "65e4b1ec58c705d04782f44c6d6c5b67ad7469cc3dddd165f08fdc39", + "sha256": "8096d72b968a2dbb7ceee163c1981f7f1ec11ee10051b2dc2a8d7601d4e56971", + "sha256WithRSAEncryption": "8096d72b968a2dbb7ceee163c1981f7f1ec11ee10051b2dc2a8d7601d4e56971", + "sha384": "4b2ea7a3e1142ed72ba0e2503a024299d47580928eaa1de8fdc2b2df399e9ddda0654cbc0006ea776bc4a21c8a28b49a", + "sha384WithRSAEncryption": "4b2ea7a3e1142ed72ba0e2503a024299d47580928eaa1de8fdc2b2df399e9ddda0654cbc0006ea776bc4a21c8a28b49a", + "sha512": "9115ace4a1fb9ad2e367f24cd73a68347db6103e4429f3ef989643563f1eeb74cb279561c461eb67cf47bdc764c107e4371415dab3f089f0f189edf9cc09a84a", + "sha512WithRSAEncryption": "9115ace4a1fb9ad2e367f24cd73a68347db6103e4429f3ef989643563f1eeb74cb279561c461eb67cf47bdc764c107e4371415dab3f089f0f189edf9cc09a84a", + "shaWithRSAEncryption": "3eaee2d3221c01fcf5f5626b01642fc69806b5c9", + "ssl2-md5": "542c3a0ab6b51bc6a88fa7bb567bca3e", + "ssl3-md5": "542c3a0ab6b51bc6a88fa7bb567bca3e", + "ssl3-sha1": "71ac973d0e4b50ae9e5043ff4d615381120a25a0", + "whirlpool": "b4e340da8cf3791c06be2cdf2b116d25af9afd79aa16d7561f0ebc86d2d958366b3aaa4d24bc9fb94fdb018c34d4942c86051c869c3c483fb65c5d8a55874635" + }, + { + "input": "ED4I/A8=", + "DSA": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "DSA-SHA": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "DSA-SHA1": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "DSA-SHA1-old": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "RSA-MD4": "6a393bac79c17ac4b4c807c7e4308246", + "RSA-MD5": "e035f9e748a2a09a4fbdcf18c4f58bf1", + "RSA-MDC2": "425c968bf0c99f4b0bb1d652a014427f", + "RSA-RIPEMD160": "9ea1db9ff405c3ea4961afe11f91ac671a8700c9", + "RSA-SHA": "b6ad4ccb91e7f2979f66b20adca98cab8df1b57b", + "RSA-SHA1": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "RSA-SHA1-2": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "RSA-SHA224": "561c8bf49dc2d996ef5e48c90f33bf020b8e5cf6cbab12910e212593", + "RSA-SHA256": "2cc06402328f034d1909fa7b95f34cdb5585ce7f9096bc4082c97904921f6304", + "RSA-SHA384": "4bec36fa178f30484c4f03764fd8978b204960104d766503be6253ef89ce83d804983c703562f6fb172f954495b80999", + "RSA-SHA512": "f4b4cf07e964c53fcefb0f7d48596beab1722e1d9a70ab74ec73140f0f4b7cd9bce6d7ed8e873639f2c32f2e4828294c6af04267d68c3f27ae065a781d66d9fe", + "dsaEncryption": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "dsaWithSHA": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "dsaWithSHA1": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "dss1": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "ecdsa-with-SHA1": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "md4": "6a393bac79c17ac4b4c807c7e4308246", + "md4WithRSAEncryption": "6a393bac79c17ac4b4c807c7e4308246", + "md5": "e035f9e748a2a09a4fbdcf18c4f58bf1", + "md5WithRSAEncryption": "e035f9e748a2a09a4fbdcf18c4f58bf1", + "mdc2": "425c968bf0c99f4b0bb1d652a014427f", + "mdc2WithRSA": "425c968bf0c99f4b0bb1d652a014427f", + "ripemd": "9ea1db9ff405c3ea4961afe11f91ac671a8700c9", + "ripemd160": "9ea1db9ff405c3ea4961afe11f91ac671a8700c9", + "ripemd160WithRSA": "9ea1db9ff405c3ea4961afe11f91ac671a8700c9", + "rmd160": "9ea1db9ff405c3ea4961afe11f91ac671a8700c9", + "sha": "b6ad4ccb91e7f2979f66b20adca98cab8df1b57b", + "sha1": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "sha1WithRSAEncryption": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "sha224": "561c8bf49dc2d996ef5e48c90f33bf020b8e5cf6cbab12910e212593", + "sha224WithRSAEncryption": "561c8bf49dc2d996ef5e48c90f33bf020b8e5cf6cbab12910e212593", + "sha256": "2cc06402328f034d1909fa7b95f34cdb5585ce7f9096bc4082c97904921f6304", + "sha256WithRSAEncryption": "2cc06402328f034d1909fa7b95f34cdb5585ce7f9096bc4082c97904921f6304", + "sha384": "4bec36fa178f30484c4f03764fd8978b204960104d766503be6253ef89ce83d804983c703562f6fb172f954495b80999", + "sha384WithRSAEncryption": "4bec36fa178f30484c4f03764fd8978b204960104d766503be6253ef89ce83d804983c703562f6fb172f954495b80999", + "sha512": "f4b4cf07e964c53fcefb0f7d48596beab1722e1d9a70ab74ec73140f0f4b7cd9bce6d7ed8e873639f2c32f2e4828294c6af04267d68c3f27ae065a781d66d9fe", + "sha512WithRSAEncryption": "f4b4cf07e964c53fcefb0f7d48596beab1722e1d9a70ab74ec73140f0f4b7cd9bce6d7ed8e873639f2c32f2e4828294c6af04267d68c3f27ae065a781d66d9fe", + "shaWithRSAEncryption": "b6ad4ccb91e7f2979f66b20adca98cab8df1b57b", + "ssl2-md5": "e035f9e748a2a09a4fbdcf18c4f58bf1", + "ssl3-md5": "e035f9e748a2a09a4fbdcf18c4f58bf1", + "ssl3-sha1": "a6b5b9f854cfb76701c3bddbf374b3094ea49cba", + "whirlpool": "38b2050d729bda334f9416cc738a45e00f809b63e785ed5b6e2b4be42a42681027b64f99eb856d85233d63aa8c52f879ab021b62a060ceffe830b7ed8aa1052f" + }, + { + "input": "58ceB+8D", + "DSA": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "DSA-SHA": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "DSA-SHA1": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "DSA-SHA1-old": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "RSA-MD4": "14226bf662b757c985968b1a3cc86b80", + "RSA-MD5": "3b4cc9226a236742d72578c5915b6c3c", + "RSA-MDC2": "e201f3d4d35c67817d9ab7c0ab2b5d26", + "RSA-RIPEMD160": "eee22b636281b5c125e9fe38f9ab754afa648fd1", + "RSA-SHA": "300e8646d5d0ed06c5d7344798d710a115e93888", + "RSA-SHA1": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "RSA-SHA1-2": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "RSA-SHA224": "fc062b6f3c2b5f3fbdcda1bbd6601e8b5b48748dd210634416b254e3", + "RSA-SHA256": "99a8d6823b803a8d41ed7c26322b4ac8fdc86ce4457ffaaf8600e99595f1577a", + "RSA-SHA384": "ae3099ae9838e3e363f365040fa186de3b7d6f134f6018ae763b831afc0cfbde03e17c7b5d5bec3089a26f274fe2b297", + "RSA-SHA512": "eb2276d498230c11404628a8dab7a851b1e9b1e529dc92241e8b99b2d11cea4668be552d40af999af815c9c3994da790de94386b955fa762e9913d288ca33937", + "dsaEncryption": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "dsaWithSHA": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "dsaWithSHA1": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "dss1": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "ecdsa-with-SHA1": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "md4": "14226bf662b757c985968b1a3cc86b80", + "md4WithRSAEncryption": "14226bf662b757c985968b1a3cc86b80", + "md5": "3b4cc9226a236742d72578c5915b6c3c", + "md5WithRSAEncryption": "3b4cc9226a236742d72578c5915b6c3c", + "mdc2": "e201f3d4d35c67817d9ab7c0ab2b5d26", + "mdc2WithRSA": "e201f3d4d35c67817d9ab7c0ab2b5d26", + "ripemd": "eee22b636281b5c125e9fe38f9ab754afa648fd1", + "ripemd160": "eee22b636281b5c125e9fe38f9ab754afa648fd1", + "ripemd160WithRSA": "eee22b636281b5c125e9fe38f9ab754afa648fd1", + "rmd160": "eee22b636281b5c125e9fe38f9ab754afa648fd1", + "sha": "300e8646d5d0ed06c5d7344798d710a115e93888", + "sha1": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "sha1WithRSAEncryption": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "sha224": "fc062b6f3c2b5f3fbdcda1bbd6601e8b5b48748dd210634416b254e3", + "sha224WithRSAEncryption": "fc062b6f3c2b5f3fbdcda1bbd6601e8b5b48748dd210634416b254e3", + "sha256": "99a8d6823b803a8d41ed7c26322b4ac8fdc86ce4457ffaaf8600e99595f1577a", + "sha256WithRSAEncryption": "99a8d6823b803a8d41ed7c26322b4ac8fdc86ce4457ffaaf8600e99595f1577a", + "sha384": "ae3099ae9838e3e363f365040fa186de3b7d6f134f6018ae763b831afc0cfbde03e17c7b5d5bec3089a26f274fe2b297", + "sha384WithRSAEncryption": "ae3099ae9838e3e363f365040fa186de3b7d6f134f6018ae763b831afc0cfbde03e17c7b5d5bec3089a26f274fe2b297", + "sha512": "eb2276d498230c11404628a8dab7a851b1e9b1e529dc92241e8b99b2d11cea4668be552d40af999af815c9c3994da790de94386b955fa762e9913d288ca33937", + "sha512WithRSAEncryption": "eb2276d498230c11404628a8dab7a851b1e9b1e529dc92241e8b99b2d11cea4668be552d40af999af815c9c3994da790de94386b955fa762e9913d288ca33937", + "shaWithRSAEncryption": "300e8646d5d0ed06c5d7344798d710a115e93888", + "ssl2-md5": "3b4cc9226a236742d72578c5915b6c3c", + "ssl3-md5": "3b4cc9226a236742d72578c5915b6c3c", + "ssl3-sha1": "d87a0ee74e4b9ad72e6847c87bdeeb3d07844380", + "whirlpool": "242fc9f0ae29562dea0b04e7b6e5396ea07672aea450a6ab60332c98a332754941a9a8059d7ce8e8e8fd54f5030f4e279a6561928c030e37a7810880e619cd30" + }, + { + "input": "4Ptx+PnB/A==", + "DSA": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "DSA-SHA": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "DSA-SHA1": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "DSA-SHA1-old": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "RSA-MD4": "7f9a8534234f6dfde5a2475ed993347c", + "RSA-MD5": "35950208a022baac90056636827158ce", + "RSA-MDC2": "48117e9635d7cc41320ee331d6e93e54", + "RSA-RIPEMD160": "39eb7ee3be32c69e6ea1055ae7aefd75674c9722", + "RSA-SHA": "2e4b6da9ae9a464f6afe00b5f85c18c09e1e2a62", + "RSA-SHA1": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "RSA-SHA1-2": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "RSA-SHA224": "ba682c86eea9dc3569ecf80f94ed0893ae686d0a34a6bf2ac11dc69b", + "RSA-SHA256": "5d73704556bd458af1b90383d98591c1d01894d99b394fb7647d3d0cbd45f9a0", + "RSA-SHA384": "b9094601f510c4ef26dd4e35c54bd6f456479acdad713ca8bda12bda2f55af0af8adb511b40f880cae655f49f7cde6f5", + "RSA-SHA512": "0d1c37c810abe448b113e196e2afad16dd3dc095a8c28d0c47c023fbd2c5cb032b8b1116efebad9a60a209fc099b8a03c0fe6eb1d7444c2cf01fce4da9ecefad", + "dsaEncryption": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "dsaWithSHA": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "dsaWithSHA1": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "dss1": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "ecdsa-with-SHA1": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "md4": "7f9a8534234f6dfde5a2475ed993347c", + "md4WithRSAEncryption": "7f9a8534234f6dfde5a2475ed993347c", + "md5": "35950208a022baac90056636827158ce", + "md5WithRSAEncryption": "35950208a022baac90056636827158ce", + "mdc2": "48117e9635d7cc41320ee331d6e93e54", + "mdc2WithRSA": "48117e9635d7cc41320ee331d6e93e54", + "ripemd": "39eb7ee3be32c69e6ea1055ae7aefd75674c9722", + "ripemd160": "39eb7ee3be32c69e6ea1055ae7aefd75674c9722", + "ripemd160WithRSA": "39eb7ee3be32c69e6ea1055ae7aefd75674c9722", + "rmd160": "39eb7ee3be32c69e6ea1055ae7aefd75674c9722", + "sha": "2e4b6da9ae9a464f6afe00b5f85c18c09e1e2a62", + "sha1": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "sha1WithRSAEncryption": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "sha224": "ba682c86eea9dc3569ecf80f94ed0893ae686d0a34a6bf2ac11dc69b", + "sha224WithRSAEncryption": "ba682c86eea9dc3569ecf80f94ed0893ae686d0a34a6bf2ac11dc69b", + "sha256": "5d73704556bd458af1b90383d98591c1d01894d99b394fb7647d3d0cbd45f9a0", + "sha256WithRSAEncryption": "5d73704556bd458af1b90383d98591c1d01894d99b394fb7647d3d0cbd45f9a0", + "sha384": "b9094601f510c4ef26dd4e35c54bd6f456479acdad713ca8bda12bda2f55af0af8adb511b40f880cae655f49f7cde6f5", + "sha384WithRSAEncryption": "b9094601f510c4ef26dd4e35c54bd6f456479acdad713ca8bda12bda2f55af0af8adb511b40f880cae655f49f7cde6f5", + "sha512": "0d1c37c810abe448b113e196e2afad16dd3dc095a8c28d0c47c023fbd2c5cb032b8b1116efebad9a60a209fc099b8a03c0fe6eb1d7444c2cf01fce4da9ecefad", + "sha512WithRSAEncryption": "0d1c37c810abe448b113e196e2afad16dd3dc095a8c28d0c47c023fbd2c5cb032b8b1116efebad9a60a209fc099b8a03c0fe6eb1d7444c2cf01fce4da9ecefad", + "shaWithRSAEncryption": "2e4b6da9ae9a464f6afe00b5f85c18c09e1e2a62", + "ssl2-md5": "35950208a022baac90056636827158ce", + "ssl3-md5": "35950208a022baac90056636827158ce", + "ssl3-sha1": "1976b8dd509fe66bf09c9a8d33534d4ef4f63bfd", + "whirlpool": "2c2f7c9be97d4c644ba3945896b7100dafebc814e1a555b8ee77405527ec0af0e778a9314609901da4d944305e47dee6f6055f43b50ede637c303291b83fdb08" + }, + { + "input": "/3xgPB+A4gc=", + "DSA": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "DSA-SHA": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "DSA-SHA1": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "DSA-SHA1-old": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "RSA-MD4": "523af852dca564c3471ebaa3aad7963a", + "RSA-MD5": "84cedff2ed1b78b395cc8651094f4ce3", + "RSA-MDC2": "b177c20a33bb6f7fcd767809a821bcb8", + "RSA-RIPEMD160": "a2c3be6b9be577b2e81b492400ce2e767e689dac", + "RSA-SHA": "7c58e8c28c0209ba93caba1976860799832c0068", + "RSA-SHA1": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "RSA-SHA1-2": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "RSA-SHA224": "b9948b9a8a8242a6549d0f6da4efb80284b1415955f9dab30f0167a6", + "RSA-SHA256": "3b9606c772ea20bf2889732b034f9fd476ceddefe8ec4e3704c5993e38dace1b", + "RSA-SHA384": "0425688027c940ff1dd6a940dd56c2fd206724e08759bdeaaa919f36b15dc883dc7d3b9d2258ebbd193031ab56fa9719", + "RSA-SHA512": "7f3acc0c6821e17e47346b363aec4f45be96963a45253fd6972b7736c45ad8d6bcbe6ffac0a6b919dc3136895c5365e1467add1fee9531f641ec60d5da96489e", + "dsaEncryption": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "dsaWithSHA": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "dsaWithSHA1": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "dss1": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "ecdsa-with-SHA1": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "md4": "523af852dca564c3471ebaa3aad7963a", + "md4WithRSAEncryption": "523af852dca564c3471ebaa3aad7963a", + "md5": "84cedff2ed1b78b395cc8651094f4ce3", + "md5WithRSAEncryption": "84cedff2ed1b78b395cc8651094f4ce3", + "mdc2": "b177c20a33bb6f7fcd767809a821bcb8", + "mdc2WithRSA": "b177c20a33bb6f7fcd767809a821bcb8", + "ripemd": "a2c3be6b9be577b2e81b492400ce2e767e689dac", + "ripemd160": "a2c3be6b9be577b2e81b492400ce2e767e689dac", + "ripemd160WithRSA": "a2c3be6b9be577b2e81b492400ce2e767e689dac", + "rmd160": "a2c3be6b9be577b2e81b492400ce2e767e689dac", + "sha": "7c58e8c28c0209ba93caba1976860799832c0068", + "sha1": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "sha1WithRSAEncryption": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "sha224": "b9948b9a8a8242a6549d0f6da4efb80284b1415955f9dab30f0167a6", + "sha224WithRSAEncryption": "b9948b9a8a8242a6549d0f6da4efb80284b1415955f9dab30f0167a6", + "sha256": "3b9606c772ea20bf2889732b034f9fd476ceddefe8ec4e3704c5993e38dace1b", + "sha256WithRSAEncryption": "3b9606c772ea20bf2889732b034f9fd476ceddefe8ec4e3704c5993e38dace1b", + "sha384": "0425688027c940ff1dd6a940dd56c2fd206724e08759bdeaaa919f36b15dc883dc7d3b9d2258ebbd193031ab56fa9719", + "sha384WithRSAEncryption": "0425688027c940ff1dd6a940dd56c2fd206724e08759bdeaaa919f36b15dc883dc7d3b9d2258ebbd193031ab56fa9719", + "sha512": "7f3acc0c6821e17e47346b363aec4f45be96963a45253fd6972b7736c45ad8d6bcbe6ffac0a6b919dc3136895c5365e1467add1fee9531f641ec60d5da96489e", + "sha512WithRSAEncryption": "7f3acc0c6821e17e47346b363aec4f45be96963a45253fd6972b7736c45ad8d6bcbe6ffac0a6b919dc3136895c5365e1467add1fee9531f641ec60d5da96489e", + "shaWithRSAEncryption": "7c58e8c28c0209ba93caba1976860799832c0068", + "ssl2-md5": "84cedff2ed1b78b395cc8651094f4ce3", + "ssl3-md5": "84cedff2ed1b78b395cc8651094f4ce3", + "ssl3-sha1": "5a78f439b6db845bb8a558e4ceb106cd7b7ff783", + "whirlpool": "997a2b1cbcd048fdb95eba258a108134f64372063c47f5aae204ab24461fc641a9f12b7a818f731e1b14c3e11be5a42b9407774e8767abed403432ebce9b088f" + }, + { + "input": "8D/IYIH+Afh/", + "DSA": "f871bce62436c1e280357416695ee2ef9b83695c", + "DSA-SHA": "f871bce62436c1e280357416695ee2ef9b83695c", + "DSA-SHA1": "f871bce62436c1e280357416695ee2ef9b83695c", + "DSA-SHA1-old": "f871bce62436c1e280357416695ee2ef9b83695c", + "RSA-MD4": "75ee621c4a7e7a34c33ea7e743426793", + "RSA-MD5": "7badf748f4cb700272a72edfea22e9bf", + "RSA-MDC2": "803c503e04447d8e53208b4915e0585b", + "RSA-RIPEMD160": "d3a758579dd2b3ce274d05b850e9a494c616393b", + "RSA-SHA": "52c6e6f1f97ff4289aadb7ea1c74673ac309e31a", + "RSA-SHA1": "f871bce62436c1e280357416695ee2ef9b83695c", + "RSA-SHA1-2": "f871bce62436c1e280357416695ee2ef9b83695c", + "RSA-SHA224": "47f5053b04c3bd37dd93faad62b393a0677e3670aa61d769612980f7", + "RSA-SHA256": "b858d7c61b67e1688c267ca83b57dd0947c4e5acc4eb3d130fbd92222b66a9ab", + "RSA-SHA384": "109ae778f4545968ebf5d0f10d7673d2450007e8649accbd7f432008394ff642f56c0952e94f770fe4f29f8d4c54aac1", + "RSA-SHA512": "64e87ebf5229971b7ba773eb8f9d221a3ade057a293afd1e4ddb20735ea4e5fc908b71e28400afacf3aa58c70f6f72f81173f3990f3f97c9e6f469910fe48ea9", + "dsaEncryption": "f871bce62436c1e280357416695ee2ef9b83695c", + "dsaWithSHA": "f871bce62436c1e280357416695ee2ef9b83695c", + "dsaWithSHA1": "f871bce62436c1e280357416695ee2ef9b83695c", + "dss1": "f871bce62436c1e280357416695ee2ef9b83695c", + "ecdsa-with-SHA1": "f871bce62436c1e280357416695ee2ef9b83695c", + "md4": "75ee621c4a7e7a34c33ea7e743426793", + "md4WithRSAEncryption": "75ee621c4a7e7a34c33ea7e743426793", + "md5": "7badf748f4cb700272a72edfea22e9bf", + "md5WithRSAEncryption": "7badf748f4cb700272a72edfea22e9bf", + "mdc2": "803c503e04447d8e53208b4915e0585b", + "mdc2WithRSA": "803c503e04447d8e53208b4915e0585b", + "ripemd": "d3a758579dd2b3ce274d05b850e9a494c616393b", + "ripemd160": "d3a758579dd2b3ce274d05b850e9a494c616393b", + "ripemd160WithRSA": "d3a758579dd2b3ce274d05b850e9a494c616393b", + "rmd160": "d3a758579dd2b3ce274d05b850e9a494c616393b", + "sha": "52c6e6f1f97ff4289aadb7ea1c74673ac309e31a", + "sha1": "f871bce62436c1e280357416695ee2ef9b83695c", + "sha1WithRSAEncryption": "f871bce62436c1e280357416695ee2ef9b83695c", + "sha224": "47f5053b04c3bd37dd93faad62b393a0677e3670aa61d769612980f7", + "sha224WithRSAEncryption": "47f5053b04c3bd37dd93faad62b393a0677e3670aa61d769612980f7", + "sha256": "b858d7c61b67e1688c267ca83b57dd0947c4e5acc4eb3d130fbd92222b66a9ab", + "sha256WithRSAEncryption": "b858d7c61b67e1688c267ca83b57dd0947c4e5acc4eb3d130fbd92222b66a9ab", + "sha384": "109ae778f4545968ebf5d0f10d7673d2450007e8649accbd7f432008394ff642f56c0952e94f770fe4f29f8d4c54aac1", + "sha384WithRSAEncryption": "109ae778f4545968ebf5d0f10d7673d2450007e8649accbd7f432008394ff642f56c0952e94f770fe4f29f8d4c54aac1", + "sha512": "64e87ebf5229971b7ba773eb8f9d221a3ade057a293afd1e4ddb20735ea4e5fc908b71e28400afacf3aa58c70f6f72f81173f3990f3f97c9e6f469910fe48ea9", + "sha512WithRSAEncryption": "64e87ebf5229971b7ba773eb8f9d221a3ade057a293afd1e4ddb20735ea4e5fc908b71e28400afacf3aa58c70f6f72f81173f3990f3f97c9e6f469910fe48ea9", + "shaWithRSAEncryption": "52c6e6f1f97ff4289aadb7ea1c74673ac309e31a", + "ssl2-md5": "7badf748f4cb700272a72edfea22e9bf", + "ssl3-md5": "7badf748f4cb700272a72edfea22e9bf", + "ssl3-sha1": "f871bce62436c1e280357416695ee2ef9b83695c", + "whirlpool": "b8f2a69be4d9b9c522fc7f9360d6dcc5e1b5564a2d0db6c928ae578c519be0e624430d6b884731eb66f0bb575ccf2cf8e467fb434e1d2a225a44ea49460f9184" + }, + { + "input": "n8f4H8Hjx8c/AA==", + "DSA": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "DSA-SHA": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "DSA-SHA1": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "DSA-SHA1-old": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "RSA-MD4": "dd61fd9c2fa93d506b70c04de9bcf7be", + "RSA-MD5": "a1bb6e142739dbdb0925747d95e0a1ad", + "RSA-MDC2": "1372739810e10d55d30ed565fde5b18d", + "RSA-RIPEMD160": "bda4177d206675cfffeb3ba2b3792c85a37ba3a9", + "RSA-SHA": "8467ac592943a4451b4a4af3e26339f5765ec7f9", + "RSA-SHA1": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "RSA-SHA1-2": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "RSA-SHA224": "65f1f550b227b0b66c2cc2ce1df63ea7195abe174b753f1f8da264e0", + "RSA-SHA256": "87574390294ef6d212b6d8c44ebd5c88e932036dadd0b827c6cb25cd120bfdf6", + "RSA-SHA384": "f7f658a8e47d52cd8870c19a4f6769b667373f8af474451b3cf4032ba43eee167b77970281feb7e2e6f2d0ffaaae750e", + "RSA-SHA512": "ddd79f12cecc64f1936c92a7ab03db23d2c9edf0109187c5687918da836379af37268321c488b0912f734303c77c05296fceb1b35abf2ad651502393211f3ea3", + "dsaEncryption": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "dsaWithSHA": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "dsaWithSHA1": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "dss1": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "ecdsa-with-SHA1": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "md4": "dd61fd9c2fa93d506b70c04de9bcf7be", + "md4WithRSAEncryption": "dd61fd9c2fa93d506b70c04de9bcf7be", + "md5": "a1bb6e142739dbdb0925747d95e0a1ad", + "md5WithRSAEncryption": "a1bb6e142739dbdb0925747d95e0a1ad", + "mdc2": "1372739810e10d55d30ed565fde5b18d", + "mdc2WithRSA": "1372739810e10d55d30ed565fde5b18d", + "ripemd": "bda4177d206675cfffeb3ba2b3792c85a37ba3a9", + "ripemd160": "bda4177d206675cfffeb3ba2b3792c85a37ba3a9", + "ripemd160WithRSA": "bda4177d206675cfffeb3ba2b3792c85a37ba3a9", + "rmd160": "bda4177d206675cfffeb3ba2b3792c85a37ba3a9", + "sha": "8467ac592943a4451b4a4af3e26339f5765ec7f9", + "sha1": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "sha1WithRSAEncryption": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "sha224": "65f1f550b227b0b66c2cc2ce1df63ea7195abe174b753f1f8da264e0", + "sha224WithRSAEncryption": "65f1f550b227b0b66c2cc2ce1df63ea7195abe174b753f1f8da264e0", + "sha256": "87574390294ef6d212b6d8c44ebd5c88e932036dadd0b827c6cb25cd120bfdf6", + "sha256WithRSAEncryption": "87574390294ef6d212b6d8c44ebd5c88e932036dadd0b827c6cb25cd120bfdf6", + "sha384": "f7f658a8e47d52cd8870c19a4f6769b667373f8af474451b3cf4032ba43eee167b77970281feb7e2e6f2d0ffaaae750e", + "sha384WithRSAEncryption": "f7f658a8e47d52cd8870c19a4f6769b667373f8af474451b3cf4032ba43eee167b77970281feb7e2e6f2d0ffaaae750e", + "sha512": "ddd79f12cecc64f1936c92a7ab03db23d2c9edf0109187c5687918da836379af37268321c488b0912f734303c77c05296fceb1b35abf2ad651502393211f3ea3", + "sha512WithRSAEncryption": "ddd79f12cecc64f1936c92a7ab03db23d2c9edf0109187c5687918da836379af37268321c488b0912f734303c77c05296fceb1b35abf2ad651502393211f3ea3", + "shaWithRSAEncryption": "8467ac592943a4451b4a4af3e26339f5765ec7f9", + "ssl2-md5": "a1bb6e142739dbdb0925747d95e0a1ad", + "ssl3-md5": "a1bb6e142739dbdb0925747d95e0a1ad", + "ssl3-sha1": "62b243d1b780e1d31cf1ba2de3f01c72aeea0e47", + "whirlpool": "b2e2282ed1a82c9d0d45f1c44b311250fcfed26470c8ef425ab1ca4a7177da0065469ab5deb239e4ecfc36ab769048c310e21c8f6c43a26abc2518357ce46c9f" + }, + { + "input": "AH+/38D+An4A+H8=", + "DSA": "1698994a273404848e56e7fda4457b5900de1342", + "DSA-SHA": "1698994a273404848e56e7fda4457b5900de1342", + "DSA-SHA1": "1698994a273404848e56e7fda4457b5900de1342", + "DSA-SHA1-old": "1698994a273404848e56e7fda4457b5900de1342", + "RSA-MD4": "96dcf1c7c35807d18fb8c4bc1af8a375", + "RSA-MD5": "0cd9b72dfdee8efd2e1515f4c5a62284", + "RSA-MDC2": "8e84789dfd4bfd091437ba0ee6cf6fb8", + "RSA-RIPEMD160": "fcd08345499eb0083c990873e4dc7173f6cdb5e1", + "RSA-SHA": "603e9b391863947fd4f300a96c9f930fbe3c20c6", + "RSA-SHA1": "1698994a273404848e56e7fda4457b5900de1342", + "RSA-SHA1-2": "1698994a273404848e56e7fda4457b5900de1342", + "RSA-SHA224": "2f703f38b49bd96bb80b5f4826843954a1b54ccbf4b39c1281782e60", + "RSA-SHA256": "afe90242f095e967523c12333b0093d4e532a0db0f27dcc25d44d23ffb62094b", + "RSA-SHA384": "60790ccc54be76d4249b5e90e7551d3787135d74f1d1911f1af1973e5b936860bb9ac2d92c4c885776e1f68810008109", + "RSA-SHA512": "f780834bda7d752773f106df8f99464ffd55dfed8e4df11247e9af8661e62724966a7077af60c1d19d1777e2e83d22ebf357dbafd40b4376dc267a04413c2a35", + "dsaEncryption": "1698994a273404848e56e7fda4457b5900de1342", + "dsaWithSHA": "1698994a273404848e56e7fda4457b5900de1342", + "dsaWithSHA1": "1698994a273404848e56e7fda4457b5900de1342", + "dss1": "1698994a273404848e56e7fda4457b5900de1342", + "ecdsa-with-SHA1": "1698994a273404848e56e7fda4457b5900de1342", + "md4": "96dcf1c7c35807d18fb8c4bc1af8a375", + "md4WithRSAEncryption": "96dcf1c7c35807d18fb8c4bc1af8a375", + "md5": "0cd9b72dfdee8efd2e1515f4c5a62284", + "md5WithRSAEncryption": "0cd9b72dfdee8efd2e1515f4c5a62284", + "mdc2": "8e84789dfd4bfd091437ba0ee6cf6fb8", + "mdc2WithRSA": "8e84789dfd4bfd091437ba0ee6cf6fb8", + "ripemd": "fcd08345499eb0083c990873e4dc7173f6cdb5e1", + "ripemd160": "fcd08345499eb0083c990873e4dc7173f6cdb5e1", + "ripemd160WithRSA": "fcd08345499eb0083c990873e4dc7173f6cdb5e1", + "rmd160": "fcd08345499eb0083c990873e4dc7173f6cdb5e1", + "sha": "603e9b391863947fd4f300a96c9f930fbe3c20c6", + "sha1": "1698994a273404848e56e7fda4457b5900de1342", + "sha1WithRSAEncryption": "1698994a273404848e56e7fda4457b5900de1342", + "sha224": "2f703f38b49bd96bb80b5f4826843954a1b54ccbf4b39c1281782e60", + "sha224WithRSAEncryption": "2f703f38b49bd96bb80b5f4826843954a1b54ccbf4b39c1281782e60", + "sha256": "afe90242f095e967523c12333b0093d4e532a0db0f27dcc25d44d23ffb62094b", + "sha256WithRSAEncryption": "afe90242f095e967523c12333b0093d4e532a0db0f27dcc25d44d23ffb62094b", + "sha384": "60790ccc54be76d4249b5e90e7551d3787135d74f1d1911f1af1973e5b936860bb9ac2d92c4c885776e1f68810008109", + "sha384WithRSAEncryption": "60790ccc54be76d4249b5e90e7551d3787135d74f1d1911f1af1973e5b936860bb9ac2d92c4c885776e1f68810008109", + "sha512": "f780834bda7d752773f106df8f99464ffd55dfed8e4df11247e9af8661e62724966a7077af60c1d19d1777e2e83d22ebf357dbafd40b4376dc267a04413c2a35", + "sha512WithRSAEncryption": "f780834bda7d752773f106df8f99464ffd55dfed8e4df11247e9af8661e62724966a7077af60c1d19d1777e2e83d22ebf357dbafd40b4376dc267a04413c2a35", + "shaWithRSAEncryption": "603e9b391863947fd4f300a96c9f930fbe3c20c6", + "ssl2-md5": "0cd9b72dfdee8efd2e1515f4c5a62284", + "ssl3-md5": "0cd9b72dfdee8efd2e1515f4c5a62284", + "ssl3-sha1": "1698994a273404848e56e7fda4457b5900de1342", + "whirlpool": "266b794a411e41c000af3f75ddb088bdb5f7c290dd287cef6575f7ca1e3b79b401ab0f2bf142e9043aebc64a9d973f85929859ad6b2617c673b49f76b7400929" + }, + { + "input": "AQHAHgP4MAgP8/n/", + "DSA": "056f4cdc02791da7ed1eb2303314f7667518deef", + "DSA-SHA": "056f4cdc02791da7ed1eb2303314f7667518deef", + "DSA-SHA1": "056f4cdc02791da7ed1eb2303314f7667518deef", + "DSA-SHA1-old": "056f4cdc02791da7ed1eb2303314f7667518deef", + "RSA-MD4": "25d0698fca539aa83eccaad6f51cf263", + "RSA-MD5": "ef07c13e75d50578d09052aa21a7cffb", + "RSA-MDC2": "8bda07914a0ac0a16815e96cf63e5e2a", + "RSA-RIPEMD160": "6a303508c5d5a24030ec4dfb545743994a81c145", + "RSA-SHA": "edc32861fd7332014ee45c8321834934accd276e", + "RSA-SHA1": "056f4cdc02791da7ed1eb2303314f7667518deef", + "RSA-SHA1-2": "056f4cdc02791da7ed1eb2303314f7667518deef", + "RSA-SHA224": "5eee9f26dfb6344a86947fb0a3e4920c6d7e40f4d57e9a4edf55f5d7", + "RSA-SHA256": "55731252db2418c49f15d7f0f146c6506589f016a82c72cf8a6276ac6bd123c7", + "RSA-SHA384": "6e6bef8ce8a247a04d42cf16db19ce8c63710da54dcd4b5a31c906e39e4a391576a0165a95b66657c7c9a403b56f3650", + "RSA-SHA512": "5a3a2555f8affd5dad71dbae0571f47cda35089ff232f43f6f7615bd20353203793177d8bbfdc9ef336406811680a88dd6d46f44a1ff46e99a5631bc34eb5e15", + "dsaEncryption": "056f4cdc02791da7ed1eb2303314f7667518deef", + "dsaWithSHA": "056f4cdc02791da7ed1eb2303314f7667518deef", + "dsaWithSHA1": "056f4cdc02791da7ed1eb2303314f7667518deef", + "dss1": "056f4cdc02791da7ed1eb2303314f7667518deef", + "ecdsa-with-SHA1": "056f4cdc02791da7ed1eb2303314f7667518deef", + "md4": "25d0698fca539aa83eccaad6f51cf263", + "md4WithRSAEncryption": "25d0698fca539aa83eccaad6f51cf263", + "md5": "ef07c13e75d50578d09052aa21a7cffb", + "md5WithRSAEncryption": "ef07c13e75d50578d09052aa21a7cffb", + "mdc2": "8bda07914a0ac0a16815e96cf63e5e2a", + "mdc2WithRSA": "8bda07914a0ac0a16815e96cf63e5e2a", + "ripemd": "6a303508c5d5a24030ec4dfb545743994a81c145", + "ripemd160": "6a303508c5d5a24030ec4dfb545743994a81c145", + "ripemd160WithRSA": "6a303508c5d5a24030ec4dfb545743994a81c145", + "rmd160": "6a303508c5d5a24030ec4dfb545743994a81c145", + "sha": "edc32861fd7332014ee45c8321834934accd276e", + "sha1": "056f4cdc02791da7ed1eb2303314f7667518deef", + "sha1WithRSAEncryption": "056f4cdc02791da7ed1eb2303314f7667518deef", + "sha224": "5eee9f26dfb6344a86947fb0a3e4920c6d7e40f4d57e9a4edf55f5d7", + "sha224WithRSAEncryption": "5eee9f26dfb6344a86947fb0a3e4920c6d7e40f4d57e9a4edf55f5d7", + "sha256": "55731252db2418c49f15d7f0f146c6506589f016a82c72cf8a6276ac6bd123c7", + "sha256WithRSAEncryption": "55731252db2418c49f15d7f0f146c6506589f016a82c72cf8a6276ac6bd123c7", + "sha384": "6e6bef8ce8a247a04d42cf16db19ce8c63710da54dcd4b5a31c906e39e4a391576a0165a95b66657c7c9a403b56f3650", + "sha384WithRSAEncryption": "6e6bef8ce8a247a04d42cf16db19ce8c63710da54dcd4b5a31c906e39e4a391576a0165a95b66657c7c9a403b56f3650", + "sha512": "5a3a2555f8affd5dad71dbae0571f47cda35089ff232f43f6f7615bd20353203793177d8bbfdc9ef336406811680a88dd6d46f44a1ff46e99a5631bc34eb5e15", + "sha512WithRSAEncryption": "5a3a2555f8affd5dad71dbae0571f47cda35089ff232f43f6f7615bd20353203793177d8bbfdc9ef336406811680a88dd6d46f44a1ff46e99a5631bc34eb5e15", + "shaWithRSAEncryption": "edc32861fd7332014ee45c8321834934accd276e", + "ssl2-md5": "ef07c13e75d50578d09052aa21a7cffb", + "ssl3-md5": "ef07c13e75d50578d09052aa21a7cffb", + "ssl3-sha1": "056f4cdc02791da7ed1eb2303314f7667518deef", + "whirlpool": "a11324d782bff5cd7da3085c5b5089ea6238def4ea42e4c128d0db56db87c2327a6139239bd3d73d8afef30c43545cb094492f02fef2030760dea4a29b9e9760" + }, + { + "input": "xAP8D/gBwA/wBhBB/w==", + "DSA": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "DSA-SHA": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "DSA-SHA1": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "DSA-SHA1-old": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "RSA-MD4": "475f6dc314219f77abf6b74cc0a48da7", + "RSA-MD5": "cf3b261af9344bf83b4dd82b30242c78", + "RSA-MDC2": "5be443d0163a7f47de9c95d5689f500d", + "RSA-RIPEMD160": "dd658909ab7a733c92284c31570c80efd1f04411", + "RSA-SHA": "9535fc46f8dc06a2a3b4a9c840bb4795d5703bc4", + "RSA-SHA1": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "RSA-SHA1-2": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "RSA-SHA224": "0a2135c560f4fc781223299075897355c7bcd368a64d5ba9d719bd78", + "RSA-SHA256": "c2e0ed603bfa67292b78a29264e409a2e0c98482cdb59cf4fe7cafff69853d11", + "RSA-SHA384": "b49a8a4c87a2b45628f362b424a97a0315f7d0c811ae650e5fef1f2161f8db595405bbb34a125b60b400d68f972c11ae", + "RSA-SHA512": "5737cddc5cd9cb9aca517a4efea88ed34206a1427b1a15323d79d2a731d1981d6eee0d02e9f22dcf44e2ca9c6aab1942d07bcb3a9ca03af388e422175ee476f6", + "dsaEncryption": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "dsaWithSHA": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "dsaWithSHA1": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "dss1": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "ecdsa-with-SHA1": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "md4": "475f6dc314219f77abf6b74cc0a48da7", + "md4WithRSAEncryption": "475f6dc314219f77abf6b74cc0a48da7", + "md5": "cf3b261af9344bf83b4dd82b30242c78", + "md5WithRSAEncryption": "cf3b261af9344bf83b4dd82b30242c78", + "mdc2": "5be443d0163a7f47de9c95d5689f500d", + "mdc2WithRSA": "5be443d0163a7f47de9c95d5689f500d", + "ripemd": "dd658909ab7a733c92284c31570c80efd1f04411", + "ripemd160": "dd658909ab7a733c92284c31570c80efd1f04411", + "ripemd160WithRSA": "dd658909ab7a733c92284c31570c80efd1f04411", + "rmd160": "dd658909ab7a733c92284c31570c80efd1f04411", + "sha": "9535fc46f8dc06a2a3b4a9c840bb4795d5703bc4", + "sha1": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "sha1WithRSAEncryption": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "sha224": "0a2135c560f4fc781223299075897355c7bcd368a64d5ba9d719bd78", + "sha224WithRSAEncryption": "0a2135c560f4fc781223299075897355c7bcd368a64d5ba9d719bd78", + "sha256": "c2e0ed603bfa67292b78a29264e409a2e0c98482cdb59cf4fe7cafff69853d11", + "sha256WithRSAEncryption": "c2e0ed603bfa67292b78a29264e409a2e0c98482cdb59cf4fe7cafff69853d11", + "sha384": "b49a8a4c87a2b45628f362b424a97a0315f7d0c811ae650e5fef1f2161f8db595405bbb34a125b60b400d68f972c11ae", + "sha384WithRSAEncryption": "b49a8a4c87a2b45628f362b424a97a0315f7d0c811ae650e5fef1f2161f8db595405bbb34a125b60b400d68f972c11ae", + "sha512": "5737cddc5cd9cb9aca517a4efea88ed34206a1427b1a15323d79d2a731d1981d6eee0d02e9f22dcf44e2ca9c6aab1942d07bcb3a9ca03af388e422175ee476f6", + "sha512WithRSAEncryption": "5737cddc5cd9cb9aca517a4efea88ed34206a1427b1a15323d79d2a731d1981d6eee0d02e9f22dcf44e2ca9c6aab1942d07bcb3a9ca03af388e422175ee476f6", + "shaWithRSAEncryption": "9535fc46f8dc06a2a3b4a9c840bb4795d5703bc4", + "ssl2-md5": "cf3b261af9344bf83b4dd82b30242c78", + "ssl3-md5": "cf3b261af9344bf83b4dd82b30242c78", + "ssl3-sha1": "9fe2da967bd8441eea1c32df68ddaa9dc1fc8e4b", + "whirlpool": "0f7d01cc3840eab1b9c1e1f96228b8c54d0527ddc30f4981e8ccd0df573ad186f7fc9d70bcf403b82a0165ffd90899dacbb0a7f04b4c627ceca4e62bb9ee46dc" + }, + { + "input": "/weAR/wfwGAwH+A8A/8=", + "DSA": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "DSA-SHA": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "DSA-SHA1": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "DSA-SHA1-old": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "RSA-MD4": "7037c65edc5a13164374364cd53b90aa", + "RSA-MD5": "530710f65fb98fff8eb927e2938cb8c5", + "RSA-MDC2": "d0b5dddeb3adc8c8acd15e5901886132", + "RSA-RIPEMD160": "51b22f7981a95edf3f1839c58d1b0bb9e4ba18f6", + "RSA-SHA": "9a9faccb7dc396c15830b6a81c0e8ae286e122b4", + "RSA-SHA1": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "RSA-SHA1-2": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "RSA-SHA224": "d4621ad17acdbf2dd43cd1b10703d961ff8548cef038d1262292b11a", + "RSA-SHA256": "517f007a8b65d4197411c35b14edb1340490a9be7a6c66b8c827b1e101a05b5c", + "RSA-SHA384": "aebee8f5bae86db3e0735c97cfa6f3bb91cabe8b3508861f95512ef7aeae97cc04476237a51a9ce973ef2e50ab9efb73", + "RSA-SHA512": "046e506b845967cbdead62c325be7dbb01f69057c65670a31f07ca520bdf12a44696bfa85af1614b41a2c60fb5182518ae4bab01fd459f343bed8223b3999415", + "dsaEncryption": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "dsaWithSHA": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "dsaWithSHA1": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "dss1": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "ecdsa-with-SHA1": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "md4": "7037c65edc5a13164374364cd53b90aa", + "md4WithRSAEncryption": "7037c65edc5a13164374364cd53b90aa", + "md5": "530710f65fb98fff8eb927e2938cb8c5", + "md5WithRSAEncryption": "530710f65fb98fff8eb927e2938cb8c5", + "mdc2": "d0b5dddeb3adc8c8acd15e5901886132", + "mdc2WithRSA": "d0b5dddeb3adc8c8acd15e5901886132", + "ripemd": "51b22f7981a95edf3f1839c58d1b0bb9e4ba18f6", + "ripemd160": "51b22f7981a95edf3f1839c58d1b0bb9e4ba18f6", + "ripemd160WithRSA": "51b22f7981a95edf3f1839c58d1b0bb9e4ba18f6", + "rmd160": "51b22f7981a95edf3f1839c58d1b0bb9e4ba18f6", + "sha": "9a9faccb7dc396c15830b6a81c0e8ae286e122b4", + "sha1": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "sha1WithRSAEncryption": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "sha224": "d4621ad17acdbf2dd43cd1b10703d961ff8548cef038d1262292b11a", + "sha224WithRSAEncryption": "d4621ad17acdbf2dd43cd1b10703d961ff8548cef038d1262292b11a", + "sha256": "517f007a8b65d4197411c35b14edb1340490a9be7a6c66b8c827b1e101a05b5c", + "sha256WithRSAEncryption": "517f007a8b65d4197411c35b14edb1340490a9be7a6c66b8c827b1e101a05b5c", + "sha384": "aebee8f5bae86db3e0735c97cfa6f3bb91cabe8b3508861f95512ef7aeae97cc04476237a51a9ce973ef2e50ab9efb73", + "sha384WithRSAEncryption": "aebee8f5bae86db3e0735c97cfa6f3bb91cabe8b3508861f95512ef7aeae97cc04476237a51a9ce973ef2e50ab9efb73", + "sha512": "046e506b845967cbdead62c325be7dbb01f69057c65670a31f07ca520bdf12a44696bfa85af1614b41a2c60fb5182518ae4bab01fd459f343bed8223b3999415", + "sha512WithRSAEncryption": "046e506b845967cbdead62c325be7dbb01f69057c65670a31f07ca520bdf12a44696bfa85af1614b41a2c60fb5182518ae4bab01fd459f343bed8223b3999415", + "shaWithRSAEncryption": "9a9faccb7dc396c15830b6a81c0e8ae286e122b4", + "ssl2-md5": "530710f65fb98fff8eb927e2938cb8c5", + "ssl3-md5": "530710f65fb98fff8eb927e2938cb8c5", + "ssl3-sha1": "73a31777b4ace9384efa8bbead45c51a71aba6dd", + "whirlpool": "e649ad3f0495678465c5cc735eccb8f3e8f007648c21d78ef1d247fa7bb897cc628f842fa74255e25a31dd8216f3c80f5f4eb42ed233a6f172d66b9dfa1f79e2" + }, + { + "input": "gD+EPv/APw8Af8Af5/wA", + "DSA": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "DSA-SHA": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "DSA-SHA1": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "DSA-SHA1-old": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "RSA-MD4": "8f9651724bb7df93718bb3b133ec9489", + "RSA-MD5": "4e6d73658b27e19d4bb4500625001e39", + "RSA-MDC2": "69b6006201efa764d62280188b14f788", + "RSA-RIPEMD160": "ec4a5209cdc592a90517f3e458168dde55733a1e", + "RSA-SHA": "14bb9eadc6f1d5f020c721a92a1e51cd6cba40a3", + "RSA-SHA1": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "RSA-SHA1-2": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "RSA-SHA224": "3032ed74d4d3a71c0d51ebf8bed8dfcced10787f01bcbbc590a15bd4", + "RSA-SHA256": "76c977fdc97261cd0956ce1319476d314bc57d8691c7884cd0a7ff3cf825c31f", + "RSA-SHA384": "e14618fe8eed6f16cf863062f8cec9ef612dd7d6d282faa8336c6382ac85301458b21ac93d9fe03e87904c01233909d4", + "RSA-SHA512": "0f950ae30c7601a170ba2d86025d0f89d9f24ab8ae13db9c1d3345142c7427eda8a997f66533b44176b431e43164b05338b0fe9568a69b85dfde21a28b3c6e6e", + "dsaEncryption": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "dsaWithSHA": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "dsaWithSHA1": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "dss1": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "ecdsa-with-SHA1": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "md4": "8f9651724bb7df93718bb3b133ec9489", + "md4WithRSAEncryption": "8f9651724bb7df93718bb3b133ec9489", + "md5": "4e6d73658b27e19d4bb4500625001e39", + "md5WithRSAEncryption": "4e6d73658b27e19d4bb4500625001e39", + "mdc2": "69b6006201efa764d62280188b14f788", + "mdc2WithRSA": "69b6006201efa764d62280188b14f788", + "ripemd": "ec4a5209cdc592a90517f3e458168dde55733a1e", + "ripemd160": "ec4a5209cdc592a90517f3e458168dde55733a1e", + "ripemd160WithRSA": "ec4a5209cdc592a90517f3e458168dde55733a1e", + "rmd160": "ec4a5209cdc592a90517f3e458168dde55733a1e", + "sha": "14bb9eadc6f1d5f020c721a92a1e51cd6cba40a3", + "sha1": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "sha1WithRSAEncryption": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "sha224": "3032ed74d4d3a71c0d51ebf8bed8dfcced10787f01bcbbc590a15bd4", + "sha224WithRSAEncryption": "3032ed74d4d3a71c0d51ebf8bed8dfcced10787f01bcbbc590a15bd4", + "sha256": "76c977fdc97261cd0956ce1319476d314bc57d8691c7884cd0a7ff3cf825c31f", + "sha256WithRSAEncryption": "76c977fdc97261cd0956ce1319476d314bc57d8691c7884cd0a7ff3cf825c31f", + "sha384": "e14618fe8eed6f16cf863062f8cec9ef612dd7d6d282faa8336c6382ac85301458b21ac93d9fe03e87904c01233909d4", + "sha384WithRSAEncryption": "e14618fe8eed6f16cf863062f8cec9ef612dd7d6d282faa8336c6382ac85301458b21ac93d9fe03e87904c01233909d4", + "sha512": "0f950ae30c7601a170ba2d86025d0f89d9f24ab8ae13db9c1d3345142c7427eda8a997f66533b44176b431e43164b05338b0fe9568a69b85dfde21a28b3c6e6e", + "sha512WithRSAEncryption": "0f950ae30c7601a170ba2d86025d0f89d9f24ab8ae13db9c1d3345142c7427eda8a997f66533b44176b431e43164b05338b0fe9568a69b85dfde21a28b3c6e6e", + "shaWithRSAEncryption": "14bb9eadc6f1d5f020c721a92a1e51cd6cba40a3", + "ssl2-md5": "4e6d73658b27e19d4bb4500625001e39", + "ssl3-md5": "4e6d73658b27e19d4bb4500625001e39", + "ssl3-sha1": "3f9d7c4e2384eddabff5dd8a31e23de3d03f42ac", + "whirlpool": "73391168c2e18436fd130f2e0cba0ca370bdefad62441d07eca7428820dc634a4e67c26ee6740d29b043bfb0a479f28a3bffb5d7e8c3104a1f5f4d9746a0d72e" + }, + { + "input": "/+B/AYGB/4H/AD4AIH+ADw==", + "DSA": "4814908f72b93ffd011135bee347de9a08da838f", + "DSA-SHA": "4814908f72b93ffd011135bee347de9a08da838f", + "DSA-SHA1": "4814908f72b93ffd011135bee347de9a08da838f", + "DSA-SHA1-old": "4814908f72b93ffd011135bee347de9a08da838f", + "RSA-MD4": "3fcce47c5dc1a1e00d093bdbcd02d6a3", + "RSA-MD5": "c8e5f2f272b1ef88ec62dd0d9d54e902", + "RSA-MDC2": "6f668f89c9c0a067e0b49c4fc6740d98", + "RSA-RIPEMD160": "793bd9c7f07ef85a9240349365c64042b683cfc8", + "RSA-SHA": "2e46c65463f972c22baeda0a4a468116d4acd237", + "RSA-SHA1": "4814908f72b93ffd011135bee347de9a08da838f", + "RSA-SHA1-2": "4814908f72b93ffd011135bee347de9a08da838f", + "RSA-SHA224": "acbc312acc42e98a5b3b24460ea6d5644251856a73208dd29dbc5967", + "RSA-SHA256": "f10c26637ea8ca2d0898fa661f087f13f174fe0ca1c91862ce3b6127c3430f51", + "RSA-SHA384": "4e716c348a08a570cbc60b24df1f0fa4e4b2317156bc3e908aea3792f91813abc4fc77c0f1490a11d42ed8e0ceda0738", + "RSA-SHA512": "1d13256c10f5ba75b3ed783c023071805c5cacb622807143d03c41621d883e29573538cabea4c83a277a3a8ff552390ff0f44ffffa6d8a2a51179b03671e7b81", + "dsaEncryption": "4814908f72b93ffd011135bee347de9a08da838f", + "dsaWithSHA": "4814908f72b93ffd011135bee347de9a08da838f", + "dsaWithSHA1": "4814908f72b93ffd011135bee347de9a08da838f", + "dss1": "4814908f72b93ffd011135bee347de9a08da838f", + "ecdsa-with-SHA1": "4814908f72b93ffd011135bee347de9a08da838f", + "md4": "3fcce47c5dc1a1e00d093bdbcd02d6a3", + "md4WithRSAEncryption": "3fcce47c5dc1a1e00d093bdbcd02d6a3", + "md5": "c8e5f2f272b1ef88ec62dd0d9d54e902", + "md5WithRSAEncryption": "c8e5f2f272b1ef88ec62dd0d9d54e902", + "mdc2": "6f668f89c9c0a067e0b49c4fc6740d98", + "mdc2WithRSA": "6f668f89c9c0a067e0b49c4fc6740d98", + "ripemd": "793bd9c7f07ef85a9240349365c64042b683cfc8", + "ripemd160": "793bd9c7f07ef85a9240349365c64042b683cfc8", + "ripemd160WithRSA": "793bd9c7f07ef85a9240349365c64042b683cfc8", + "rmd160": "793bd9c7f07ef85a9240349365c64042b683cfc8", + "sha": "2e46c65463f972c22baeda0a4a468116d4acd237", + "sha1": "4814908f72b93ffd011135bee347de9a08da838f", + "sha1WithRSAEncryption": "4814908f72b93ffd011135bee347de9a08da838f", + "sha224": "acbc312acc42e98a5b3b24460ea6d5644251856a73208dd29dbc5967", + "sha224WithRSAEncryption": "acbc312acc42e98a5b3b24460ea6d5644251856a73208dd29dbc5967", + "sha256": "f10c26637ea8ca2d0898fa661f087f13f174fe0ca1c91862ce3b6127c3430f51", + "sha256WithRSAEncryption": "f10c26637ea8ca2d0898fa661f087f13f174fe0ca1c91862ce3b6127c3430f51", + "sha384": "4e716c348a08a570cbc60b24df1f0fa4e4b2317156bc3e908aea3792f91813abc4fc77c0f1490a11d42ed8e0ceda0738", + "sha384WithRSAEncryption": "4e716c348a08a570cbc60b24df1f0fa4e4b2317156bc3e908aea3792f91813abc4fc77c0f1490a11d42ed8e0ceda0738", + "sha512": "1d13256c10f5ba75b3ed783c023071805c5cacb622807143d03c41621d883e29573538cabea4c83a277a3a8ff552390ff0f44ffffa6d8a2a51179b03671e7b81", + "sha512WithRSAEncryption": "1d13256c10f5ba75b3ed783c023071805c5cacb622807143d03c41621d883e29573538cabea4c83a277a3a8ff552390ff0f44ffffa6d8a2a51179b03671e7b81", + "shaWithRSAEncryption": "2e46c65463f972c22baeda0a4a468116d4acd237", + "ssl2-md5": "c8e5f2f272b1ef88ec62dd0d9d54e902", + "ssl3-md5": "c8e5f2f272b1ef88ec62dd0d9d54e902", + "ssl3-sha1": "4814908f72b93ffd011135bee347de9a08da838f", + "whirlpool": "16b0ee4b2c7438fce376c5cf3ca987abf9ea2034e842ff8501d5adb43274335a81a7685e23d417d36bbecabdd757788577c67a6d22f67f650695808ab4d9f3e7" + }, + { + "input": "AD4AcB/gD/r/yD/z/gD/gP8=", + "DSA": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "DSA-SHA": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "DSA-SHA1": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "DSA-SHA1-old": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "RSA-MD4": "b07f931a5b8bb9e1c26601f43ba4817d", + "RSA-MD5": "031cbf1fb05b4ec09f3c93235d0f49ac", + "RSA-MDC2": "100bb33e33cecc35636c1b30da17d658", + "RSA-RIPEMD160": "6f2cabab4b45a7e69fff5a271d9c166da5920779", + "RSA-SHA": "1bd7b61decc9cd805d492961db64ad95b9cc6784", + "RSA-SHA1": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "RSA-SHA1-2": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "RSA-SHA224": "da2d49346d934ab211aa097f4db2a75aa1d98ee4368aa8e21eb509dd", + "RSA-SHA256": "679b95521601c0ba63ce882046abd7a8cdb8e78d5c0ee9f38c21dc47ca846195", + "RSA-SHA384": "30ffb6ba18b92154d8b83ed8b0f66ae2fc17209d8e6652d141df196fdd0801bedaaea9810c90bcb7a1c9527340213f6d", + "RSA-SHA512": "799809967e08bbc8ab729a12558d8847f6903bcee6f7689229c7080a8c8088d5b5785ecb14e50487068e7bc21bab9575651ea29b614b51cda348129e106e5be5", + "dsaEncryption": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "dsaWithSHA": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "dsaWithSHA1": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "dss1": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "ecdsa-with-SHA1": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "md4": "b07f931a5b8bb9e1c26601f43ba4817d", + "md4WithRSAEncryption": "b07f931a5b8bb9e1c26601f43ba4817d", + "md5": "031cbf1fb05b4ec09f3c93235d0f49ac", + "md5WithRSAEncryption": "031cbf1fb05b4ec09f3c93235d0f49ac", + "mdc2": "100bb33e33cecc35636c1b30da17d658", + "mdc2WithRSA": "100bb33e33cecc35636c1b30da17d658", + "ripemd": "6f2cabab4b45a7e69fff5a271d9c166da5920779", + "ripemd160": "6f2cabab4b45a7e69fff5a271d9c166da5920779", + "ripemd160WithRSA": "6f2cabab4b45a7e69fff5a271d9c166da5920779", + "rmd160": "6f2cabab4b45a7e69fff5a271d9c166da5920779", + "sha": "1bd7b61decc9cd805d492961db64ad95b9cc6784", + "sha1": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "sha1WithRSAEncryption": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "sha224": "da2d49346d934ab211aa097f4db2a75aa1d98ee4368aa8e21eb509dd", + "sha224WithRSAEncryption": "da2d49346d934ab211aa097f4db2a75aa1d98ee4368aa8e21eb509dd", + "sha256": "679b95521601c0ba63ce882046abd7a8cdb8e78d5c0ee9f38c21dc47ca846195", + "sha256WithRSAEncryption": "679b95521601c0ba63ce882046abd7a8cdb8e78d5c0ee9f38c21dc47ca846195", + "sha384": "30ffb6ba18b92154d8b83ed8b0f66ae2fc17209d8e6652d141df196fdd0801bedaaea9810c90bcb7a1c9527340213f6d", + "sha384WithRSAEncryption": "30ffb6ba18b92154d8b83ed8b0f66ae2fc17209d8e6652d141df196fdd0801bedaaea9810c90bcb7a1c9527340213f6d", + "sha512": "799809967e08bbc8ab729a12558d8847f6903bcee6f7689229c7080a8c8088d5b5785ecb14e50487068e7bc21bab9575651ea29b614b51cda348129e106e5be5", + "sha512WithRSAEncryption": "799809967e08bbc8ab729a12558d8847f6903bcee6f7689229c7080a8c8088d5b5785ecb14e50487068e7bc21bab9575651ea29b614b51cda348129e106e5be5", + "shaWithRSAEncryption": "1bd7b61decc9cd805d492961db64ad95b9cc6784", + "ssl2-md5": "031cbf1fb05b4ec09f3c93235d0f49ac", + "ssl3-md5": "031cbf1fb05b4ec09f3c93235d0f49ac", + "ssl3-sha1": "0978374b67a412a3102c5aa0b10e1a6596fc68eb", + "whirlpool": "e501681785c4907cc10e2c769247c30be7432fb4bf4e004ef319f4ea7c7aeba3ba29bac223f526b1eb26487b5d6f547d89eac24970f44d94d77d29dd8f896c6b" + }, + { + "input": "f+/AHnz/4B/+AB/wCP/Af/AA", + "DSA": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "DSA-SHA": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "DSA-SHA1": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "DSA-SHA1-old": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "RSA-MD4": "1322f6c9735d6cae9ad3e42d65a99fc6", + "RSA-MD5": "8c0e1400df02ba8c4809b705e5f5e114", + "RSA-MDC2": "948293d2b5f62efdefbb66140bce003a", + "RSA-RIPEMD160": "90d1d1d90fc703f47a194867e3283a840697069c", + "RSA-SHA": "1b485b6b729795b0b8ed9a10bd479362b3a77c71", + "RSA-SHA1": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "RSA-SHA1-2": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "RSA-SHA224": "184e85945f9019210c141c169e1e3e118526ff83a2ee5ddcf89cf04a", + "RSA-SHA256": "af369f2162152e43847b4d0c595dcf2d27059563909425f37928bc01090f2f34", + "RSA-SHA384": "bbedb2a83dfe945e7a412649269bec28ed9b93bb450eb9595eae005fb324cc4afb9182e7a4f24185bc6e7155cbc28fec", + "RSA-SHA512": "700e168b4a5f1d88788078791580cab12177c12b3d74aabeca82c61c0915cd3396628291bed600c364b41b20350118520c971318b089e26b41f70e1b4db15fc5", + "dsaEncryption": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "dsaWithSHA": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "dsaWithSHA1": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "dss1": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "ecdsa-with-SHA1": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "md4": "1322f6c9735d6cae9ad3e42d65a99fc6", + "md4WithRSAEncryption": "1322f6c9735d6cae9ad3e42d65a99fc6", + "md5": "8c0e1400df02ba8c4809b705e5f5e114", + "md5WithRSAEncryption": "8c0e1400df02ba8c4809b705e5f5e114", + "mdc2": "948293d2b5f62efdefbb66140bce003a", + "mdc2WithRSA": "948293d2b5f62efdefbb66140bce003a", + "ripemd": "90d1d1d90fc703f47a194867e3283a840697069c", + "ripemd160": "90d1d1d90fc703f47a194867e3283a840697069c", + "ripemd160WithRSA": "90d1d1d90fc703f47a194867e3283a840697069c", + "rmd160": "90d1d1d90fc703f47a194867e3283a840697069c", + "sha": "1b485b6b729795b0b8ed9a10bd479362b3a77c71", + "sha1": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "sha1WithRSAEncryption": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "sha224": "184e85945f9019210c141c169e1e3e118526ff83a2ee5ddcf89cf04a", + "sha224WithRSAEncryption": "184e85945f9019210c141c169e1e3e118526ff83a2ee5ddcf89cf04a", + "sha256": "af369f2162152e43847b4d0c595dcf2d27059563909425f37928bc01090f2f34", + "sha256WithRSAEncryption": "af369f2162152e43847b4d0c595dcf2d27059563909425f37928bc01090f2f34", + "sha384": "bbedb2a83dfe945e7a412649269bec28ed9b93bb450eb9595eae005fb324cc4afb9182e7a4f24185bc6e7155cbc28fec", + "sha384WithRSAEncryption": "bbedb2a83dfe945e7a412649269bec28ed9b93bb450eb9595eae005fb324cc4afb9182e7a4f24185bc6e7155cbc28fec", + "sha512": "700e168b4a5f1d88788078791580cab12177c12b3d74aabeca82c61c0915cd3396628291bed600c364b41b20350118520c971318b089e26b41f70e1b4db15fc5", + "sha512WithRSAEncryption": "700e168b4a5f1d88788078791580cab12177c12b3d74aabeca82c61c0915cd3396628291bed600c364b41b20350118520c971318b089e26b41f70e1b4db15fc5", + "shaWithRSAEncryption": "1b485b6b729795b0b8ed9a10bd479362b3a77c71", + "ssl2-md5": "8c0e1400df02ba8c4809b705e5f5e114", + "ssl3-md5": "8c0e1400df02ba8c4809b705e5f5e114", + "ssl3-sha1": "44ad6cb618bd935460d46d3f921d87b99ab91c1e", + "whirlpool": "7adb47d286fb5bcf59308242f66290a179f56b39f148f6e113c9b2d3c70bafc09a33624d90e8c21facf58ebe692e9430812986458700c116e552bc7a6075febe" + }, + { + "input": "4A+ABwwB/+AD8C/4P+8AeAH+AA==", + "DSA": "02dc989af265b09cf8485640842128dcf95e9f39", + "DSA-SHA": "02dc989af265b09cf8485640842128dcf95e9f39", + "DSA-SHA1": "02dc989af265b09cf8485640842128dcf95e9f39", + "DSA-SHA1-old": "02dc989af265b09cf8485640842128dcf95e9f39", + "RSA-MD4": "1158e62cafe5eff6debedbb9f5ebbd81", + "RSA-MD5": "57ec48278e19f71f54c570a5ab306df7", + "RSA-MDC2": "ee55c45e0513f1cc4b058e8186fa26b2", + "RSA-RIPEMD160": "df44259e461b0ce79a9242b7475247c74e048f8b", + "RSA-SHA": "4da754ed2ba59839828c15a6d784470be46c0315", + "RSA-SHA1": "02dc989af265b09cf8485640842128dcf95e9f39", + "RSA-SHA1-2": "02dc989af265b09cf8485640842128dcf95e9f39", + "RSA-SHA224": "77b7518a2eaed8c1a7b2bddeeb6b0525295d6438ad8e0c2f47895893", + "RSA-SHA256": "7e1f6f080a60c402bb9c39578f75afc148a0746c656ca243f75038b82304bdf5", + "RSA-SHA384": "62555c18ed24cac43297aaf9b81b0df3980ae35486745b6c17eb4248dc0560e33e15dbc2d5b62fef889a22b321420557", + "RSA-SHA512": "5c85cf188894d27f376dbcce5d8479c79d77d0bf4bc1c591dbc19bf53edf60f22d2999a537c5322430f85dab971f9ddd19f53a32e56199c56f66b427ffa2cf29", + "dsaEncryption": "02dc989af265b09cf8485640842128dcf95e9f39", + "dsaWithSHA": "02dc989af265b09cf8485640842128dcf95e9f39", + "dsaWithSHA1": "02dc989af265b09cf8485640842128dcf95e9f39", + "dss1": "02dc989af265b09cf8485640842128dcf95e9f39", + "ecdsa-with-SHA1": "02dc989af265b09cf8485640842128dcf95e9f39", + "md4": "1158e62cafe5eff6debedbb9f5ebbd81", + "md4WithRSAEncryption": "1158e62cafe5eff6debedbb9f5ebbd81", + "md5": "57ec48278e19f71f54c570a5ab306df7", + "md5WithRSAEncryption": "57ec48278e19f71f54c570a5ab306df7", + "mdc2": "ee55c45e0513f1cc4b058e8186fa26b2", + "mdc2WithRSA": "ee55c45e0513f1cc4b058e8186fa26b2", + "ripemd": "df44259e461b0ce79a9242b7475247c74e048f8b", + "ripemd160": "df44259e461b0ce79a9242b7475247c74e048f8b", + "ripemd160WithRSA": "df44259e461b0ce79a9242b7475247c74e048f8b", + "rmd160": "df44259e461b0ce79a9242b7475247c74e048f8b", + "sha": "4da754ed2ba59839828c15a6d784470be46c0315", + "sha1": "02dc989af265b09cf8485640842128dcf95e9f39", + "sha1WithRSAEncryption": "02dc989af265b09cf8485640842128dcf95e9f39", + "sha224": "77b7518a2eaed8c1a7b2bddeeb6b0525295d6438ad8e0c2f47895893", + "sha224WithRSAEncryption": "77b7518a2eaed8c1a7b2bddeeb6b0525295d6438ad8e0c2f47895893", + "sha256": "7e1f6f080a60c402bb9c39578f75afc148a0746c656ca243f75038b82304bdf5", + "sha256WithRSAEncryption": "7e1f6f080a60c402bb9c39578f75afc148a0746c656ca243f75038b82304bdf5", + "sha384": "62555c18ed24cac43297aaf9b81b0df3980ae35486745b6c17eb4248dc0560e33e15dbc2d5b62fef889a22b321420557", + "sha384WithRSAEncryption": "62555c18ed24cac43297aaf9b81b0df3980ae35486745b6c17eb4248dc0560e33e15dbc2d5b62fef889a22b321420557", + "sha512": "5c85cf188894d27f376dbcce5d8479c79d77d0bf4bc1c591dbc19bf53edf60f22d2999a537c5322430f85dab971f9ddd19f53a32e56199c56f66b427ffa2cf29", + "sha512WithRSAEncryption": "5c85cf188894d27f376dbcce5d8479c79d77d0bf4bc1c591dbc19bf53edf60f22d2999a537c5322430f85dab971f9ddd19f53a32e56199c56f66b427ffa2cf29", + "shaWithRSAEncryption": "4da754ed2ba59839828c15a6d784470be46c0315", + "ssl2-md5": "57ec48278e19f71f54c570a5ab306df7", + "ssl3-md5": "57ec48278e19f71f54c570a5ab306df7", + "ssl3-sha1": "02dc989af265b09cf8485640842128dcf95e9f39", + "whirlpool": "c25d4c8525263270ff8bc3b60edb62f2ae09897dd3079c8bfc6757c5d8411d93d89baee5281183a39598b8e8ca9690306caa5c6f39f49af86a0d14e1aecaa3a4" + }, + { + "input": "5wAQAPgYD/D/AP+AP8P+8A/8Af8=", + "DSA": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "DSA-SHA": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "DSA-SHA1": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "DSA-SHA1-old": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "RSA-MD4": "3a73a53c24054007a9837b344dd530c3", + "RSA-MD5": "ecd3dc346a2337b95389a094a031610f", + "RSA-MDC2": "93393e249360c5f21e45526d7ece5dc2", + "RSA-RIPEMD160": "b9074cd7c9b51ff209274c4373f7e5322fcaa01f", + "RSA-SHA": "7ad6a3489f5d570a77fb4f3b0f0f96b7af3ee281", + "RSA-SHA1": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "RSA-SHA1-2": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "RSA-SHA224": "d72e80062a87a543145b12626e434cf709d853217f484f23bbdcc2aa", + "RSA-SHA256": "8d6df02738597d95e2eb9e870d4177339728d9ab8b8d61aa96f0b6d1b5ad6efd", + "RSA-SHA384": "fbd393c3bef5cfc77fa20d2fc9e74f586fa6f33d214dad58fb38a6a29820f17dd459aebfed18b2bc3cadb2072d1a66ab", + "RSA-SHA512": "191f9b5cfed52a1dfe219be6c8c25458570e79927cfbf1940855204ec19da84f0df92219c4ecbce93fea970fb6cf74e091265ae7e5ad69ba62331cdb4388d7e3", + "dsaEncryption": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "dsaWithSHA": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "dsaWithSHA1": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "dss1": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "ecdsa-with-SHA1": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "md4": "3a73a53c24054007a9837b344dd530c3", + "md4WithRSAEncryption": "3a73a53c24054007a9837b344dd530c3", + "md5": "ecd3dc346a2337b95389a094a031610f", + "md5WithRSAEncryption": "ecd3dc346a2337b95389a094a031610f", + "mdc2": "93393e249360c5f21e45526d7ece5dc2", + "mdc2WithRSA": "93393e249360c5f21e45526d7ece5dc2", + "ripemd": "b9074cd7c9b51ff209274c4373f7e5322fcaa01f", + "ripemd160": "b9074cd7c9b51ff209274c4373f7e5322fcaa01f", + "ripemd160WithRSA": "b9074cd7c9b51ff209274c4373f7e5322fcaa01f", + "rmd160": "b9074cd7c9b51ff209274c4373f7e5322fcaa01f", + "sha": "7ad6a3489f5d570a77fb4f3b0f0f96b7af3ee281", + "sha1": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "sha1WithRSAEncryption": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "sha224": "d72e80062a87a543145b12626e434cf709d853217f484f23bbdcc2aa", + "sha224WithRSAEncryption": "d72e80062a87a543145b12626e434cf709d853217f484f23bbdcc2aa", + "sha256": "8d6df02738597d95e2eb9e870d4177339728d9ab8b8d61aa96f0b6d1b5ad6efd", + "sha256WithRSAEncryption": "8d6df02738597d95e2eb9e870d4177339728d9ab8b8d61aa96f0b6d1b5ad6efd", + "sha384": "fbd393c3bef5cfc77fa20d2fc9e74f586fa6f33d214dad58fb38a6a29820f17dd459aebfed18b2bc3cadb2072d1a66ab", + "sha384WithRSAEncryption": "fbd393c3bef5cfc77fa20d2fc9e74f586fa6f33d214dad58fb38a6a29820f17dd459aebfed18b2bc3cadb2072d1a66ab", + "sha512": "191f9b5cfed52a1dfe219be6c8c25458570e79927cfbf1940855204ec19da84f0df92219c4ecbce93fea970fb6cf74e091265ae7e5ad69ba62331cdb4388d7e3", + "sha512WithRSAEncryption": "191f9b5cfed52a1dfe219be6c8c25458570e79927cfbf1940855204ec19da84f0df92219c4ecbce93fea970fb6cf74e091265ae7e5ad69ba62331cdb4388d7e3", + "shaWithRSAEncryption": "7ad6a3489f5d570a77fb4f3b0f0f96b7af3ee281", + "ssl2-md5": "ecd3dc346a2337b95389a094a031610f", + "ssl3-md5": "ecd3dc346a2337b95389a094a031610f", + "ssl3-sha1": "67507b8d497b35d6e99fc01976d73f54aeca75cf", + "whirlpool": "a01070bc4d7d369bc2cb1e6f7da9feabdf552bf6922fcb3e9de9d34287bf838d39418434dd0fb0796a484aba36ccb2b59e26ea0f0009ee0c707bb89e01eb7feb" + }, + { + "input": "AB/4D/wA/AD/h8APgHv/AA8CAf/A", + "DSA": "1eae0373c1317cb60c36a42a867b716039d441f5", + "DSA-SHA": "1eae0373c1317cb60c36a42a867b716039d441f5", + "DSA-SHA1": "1eae0373c1317cb60c36a42a867b716039d441f5", + "DSA-SHA1-old": "1eae0373c1317cb60c36a42a867b716039d441f5", + "RSA-MD4": "25946b59fea157e7e04148eb3f8828b0", + "RSA-MD5": "f11d91eae492225cbd82ef356aa96f9f", + "RSA-MDC2": "2fa6894e6b6904a7386ee2e0b51b0b94", + "RSA-RIPEMD160": "d749b4dde2e9de3b5c18ee133922b36d488f2118", + "RSA-SHA": "6af79920d26341031ddcf986048998eec8257d21", + "RSA-SHA1": "1eae0373c1317cb60c36a42a867b716039d441f5", + "RSA-SHA1-2": "1eae0373c1317cb60c36a42a867b716039d441f5", + "RSA-SHA224": "f38e9a3deb3062d122088a6cb8c8335332f7f3d6b57c8eb8b9808ebc", + "RSA-SHA256": "d0a9699291dead3f6fba3b648c28537a04caea4b96b145802c06125a17c3faba", + "RSA-SHA384": "46837113e3e4a9ed405eb07ac7707e104bf0d2976d95cd3aca2eca825fb57e89c60031d5bac3bae57474058ff7efcf84", + "RSA-SHA512": "9fe65bd1a9b8776c4f99059864f73b6f1c9e54904bf9118cba1d06bb40a961de59eaa8294a67406d5310c40b8ca7285a1d726f24f80df7dcef48e5ba32d9a80f", + "dsaEncryption": "1eae0373c1317cb60c36a42a867b716039d441f5", + "dsaWithSHA": "1eae0373c1317cb60c36a42a867b716039d441f5", + "dsaWithSHA1": "1eae0373c1317cb60c36a42a867b716039d441f5", + "dss1": "1eae0373c1317cb60c36a42a867b716039d441f5", + "ecdsa-with-SHA1": "1eae0373c1317cb60c36a42a867b716039d441f5", + "md4": "25946b59fea157e7e04148eb3f8828b0", + "md4WithRSAEncryption": "25946b59fea157e7e04148eb3f8828b0", + "md5": "f11d91eae492225cbd82ef356aa96f9f", + "md5WithRSAEncryption": "f11d91eae492225cbd82ef356aa96f9f", + "mdc2": "2fa6894e6b6904a7386ee2e0b51b0b94", + "mdc2WithRSA": "2fa6894e6b6904a7386ee2e0b51b0b94", + "ripemd": "d749b4dde2e9de3b5c18ee133922b36d488f2118", + "ripemd160": "d749b4dde2e9de3b5c18ee133922b36d488f2118", + "ripemd160WithRSA": "d749b4dde2e9de3b5c18ee133922b36d488f2118", + "rmd160": "d749b4dde2e9de3b5c18ee133922b36d488f2118", + "sha": "6af79920d26341031ddcf986048998eec8257d21", + "sha1": "1eae0373c1317cb60c36a42a867b716039d441f5", + "sha1WithRSAEncryption": "1eae0373c1317cb60c36a42a867b716039d441f5", + "sha224": "f38e9a3deb3062d122088a6cb8c8335332f7f3d6b57c8eb8b9808ebc", + "sha224WithRSAEncryption": "f38e9a3deb3062d122088a6cb8c8335332f7f3d6b57c8eb8b9808ebc", + "sha256": "d0a9699291dead3f6fba3b648c28537a04caea4b96b145802c06125a17c3faba", + "sha256WithRSAEncryption": "d0a9699291dead3f6fba3b648c28537a04caea4b96b145802c06125a17c3faba", + "sha384": "46837113e3e4a9ed405eb07ac7707e104bf0d2976d95cd3aca2eca825fb57e89c60031d5bac3bae57474058ff7efcf84", + "sha384WithRSAEncryption": "46837113e3e4a9ed405eb07ac7707e104bf0d2976d95cd3aca2eca825fb57e89c60031d5bac3bae57474058ff7efcf84", + "sha512": "9fe65bd1a9b8776c4f99059864f73b6f1c9e54904bf9118cba1d06bb40a961de59eaa8294a67406d5310c40b8ca7285a1d726f24f80df7dcef48e5ba32d9a80f", + "sha512WithRSAEncryption": "9fe65bd1a9b8776c4f99059864f73b6f1c9e54904bf9118cba1d06bb40a961de59eaa8294a67406d5310c40b8ca7285a1d726f24f80df7dcef48e5ba32d9a80f", + "shaWithRSAEncryption": "6af79920d26341031ddcf986048998eec8257d21", + "ssl2-md5": "f11d91eae492225cbd82ef356aa96f9f", + "ssl3-md5": "f11d91eae492225cbd82ef356aa96f9f", + "ssl3-sha1": "1eae0373c1317cb60c36a42a867b716039d441f5", + "whirlpool": "b295804620702a5588ca49d0291b0f042710451f8f262b589f12efe905da1940ec3be07a7330df4ad8a534398c3870dfa8bb873de07346a92a143ca36144fa4e" + }, + { + "input": "AA/wA8f4PgP/gAP/gAf/D/8fg/+AHw==", + "DSA": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "DSA-SHA": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "DSA-SHA1": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "DSA-SHA1-old": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "RSA-MD4": "d0cc134b0a58e236dadd480dd0dfb574", + "RSA-MD5": "26bd8b480216c723ce75da98b9bd430c", + "RSA-MDC2": "29e196f6fca87a1f48b990743a8c33f7", + "RSA-RIPEMD160": "460930956b44df8885325750594f72d8a25190bb", + "RSA-SHA": "f182160a952b4a86fda310d7f0bc90b9f85776f4", + "RSA-SHA1": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "RSA-SHA1-2": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "RSA-SHA224": "83e31ded8ac3d5fc2ca9c8d3bf1e0117e08fddf5c8f679e89d1b6687", + "RSA-SHA256": "d504026213b322cbcb0dbadd6a1fc6c708825019da9bac7aec973f750cbf2d3d", + "RSA-SHA384": "dad603ffa318e1d3e91b5afd1438b485bded043713771184bd38b04296f4f77d0a95ee06e5eadeed69ddf6a82d3cff49", + "RSA-SHA512": "0ecef99b7db364703f3a13f19861c0b211b2c450d6ac290136c1a4c2805cf51bd328e456342f44d7be2dc8f2eca657ade47c180d11543b33e615057d12d7b083", + "dsaEncryption": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "dsaWithSHA": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "dsaWithSHA1": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "dss1": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "ecdsa-with-SHA1": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "md4": "d0cc134b0a58e236dadd480dd0dfb574", + "md4WithRSAEncryption": "d0cc134b0a58e236dadd480dd0dfb574", + "md5": "26bd8b480216c723ce75da98b9bd430c", + "md5WithRSAEncryption": "26bd8b480216c723ce75da98b9bd430c", + "mdc2": "29e196f6fca87a1f48b990743a8c33f7", + "mdc2WithRSA": "29e196f6fca87a1f48b990743a8c33f7", + "ripemd": "460930956b44df8885325750594f72d8a25190bb", + "ripemd160": "460930956b44df8885325750594f72d8a25190bb", + "ripemd160WithRSA": "460930956b44df8885325750594f72d8a25190bb", + "rmd160": "460930956b44df8885325750594f72d8a25190bb", + "sha": "f182160a952b4a86fda310d7f0bc90b9f85776f4", + "sha1": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "sha1WithRSAEncryption": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "sha224": "83e31ded8ac3d5fc2ca9c8d3bf1e0117e08fddf5c8f679e89d1b6687", + "sha224WithRSAEncryption": "83e31ded8ac3d5fc2ca9c8d3bf1e0117e08fddf5c8f679e89d1b6687", + "sha256": "d504026213b322cbcb0dbadd6a1fc6c708825019da9bac7aec973f750cbf2d3d", + "sha256WithRSAEncryption": "d504026213b322cbcb0dbadd6a1fc6c708825019da9bac7aec973f750cbf2d3d", + "sha384": "dad603ffa318e1d3e91b5afd1438b485bded043713771184bd38b04296f4f77d0a95ee06e5eadeed69ddf6a82d3cff49", + "sha384WithRSAEncryption": "dad603ffa318e1d3e91b5afd1438b485bded043713771184bd38b04296f4f77d0a95ee06e5eadeed69ddf6a82d3cff49", + "sha512": "0ecef99b7db364703f3a13f19861c0b211b2c450d6ac290136c1a4c2805cf51bd328e456342f44d7be2dc8f2eca657ade47c180d11543b33e615057d12d7b083", + "sha512WithRSAEncryption": "0ecef99b7db364703f3a13f19861c0b211b2c450d6ac290136c1a4c2805cf51bd328e456342f44d7be2dc8f2eca657ade47c180d11543b33e615057d12d7b083", + "shaWithRSAEncryption": "f182160a952b4a86fda310d7f0bc90b9f85776f4", + "ssl2-md5": "26bd8b480216c723ce75da98b9bd430c", + "ssl3-md5": "26bd8b480216c723ce75da98b9bd430c", + "ssl3-sha1": "9c3834589e5bffac9f50950e0199b3ec2620bec8", + "whirlpool": "7065cc0f5dc0bd0dfcdc73039459de45e95859fe37558363061502abfc79d8265726929829b272be725e91661641e8ccb4da5e063f87e160ccd10e9c20696640" + }, + { + "input": "/8AfgD+f+Hg+f/gAPiAEP4B//AAf/gA=", + "DSA": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "DSA-SHA": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "DSA-SHA1": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "DSA-SHA1-old": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "RSA-MD4": "b4d66a7b6f20d13ca81fd827a4993379", + "RSA-MD5": "80999c2d12f623e4f87e0550a8e3523a", + "RSA-MDC2": "168f2168ed2699fcb559209863de5219", + "RSA-RIPEMD160": "25eff1cf234d8daac089385aed80acba697e252d", + "RSA-SHA": "b359a73d59b6728d1f22f77829dc4c26ef703e39", + "RSA-SHA1": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "RSA-SHA1-2": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "RSA-SHA224": "7d78116694ee97b8374da2753adb8b878722249c7e7bd8d0cfc46fbf", + "RSA-SHA256": "66c1a2578b41c3a200296e85d4d30a1876f8ca5cb941ffb1420e04d8e37149a5", + "RSA-SHA384": "1181da8920629b5be02b4f1e9567702503cd05be97e8ed89736f7d5ad809c7ce48c4d5c927b62f4f3b1990b55d0edde7", + "RSA-SHA512": "9faa741aaadd8800590fb24964a541da6913de2e7b9b86c27380b21fb2bec8462b5d4f01df914a646549adface74e979482c41dc43868ceb3ab038fb06331faf", + "dsaEncryption": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "dsaWithSHA": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "dsaWithSHA1": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "dss1": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "ecdsa-with-SHA1": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "md4": "b4d66a7b6f20d13ca81fd827a4993379", + "md4WithRSAEncryption": "b4d66a7b6f20d13ca81fd827a4993379", + "md5": "80999c2d12f623e4f87e0550a8e3523a", + "md5WithRSAEncryption": "80999c2d12f623e4f87e0550a8e3523a", + "mdc2": "168f2168ed2699fcb559209863de5219", + "mdc2WithRSA": "168f2168ed2699fcb559209863de5219", + "ripemd": "25eff1cf234d8daac089385aed80acba697e252d", + "ripemd160": "25eff1cf234d8daac089385aed80acba697e252d", + "ripemd160WithRSA": "25eff1cf234d8daac089385aed80acba697e252d", + "rmd160": "25eff1cf234d8daac089385aed80acba697e252d", + "sha": "b359a73d59b6728d1f22f77829dc4c26ef703e39", + "sha1": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "sha1WithRSAEncryption": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "sha224": "7d78116694ee97b8374da2753adb8b878722249c7e7bd8d0cfc46fbf", + "sha224WithRSAEncryption": "7d78116694ee97b8374da2753adb8b878722249c7e7bd8d0cfc46fbf", + "sha256": "66c1a2578b41c3a200296e85d4d30a1876f8ca5cb941ffb1420e04d8e37149a5", + "sha256WithRSAEncryption": "66c1a2578b41c3a200296e85d4d30a1876f8ca5cb941ffb1420e04d8e37149a5", + "sha384": "1181da8920629b5be02b4f1e9567702503cd05be97e8ed89736f7d5ad809c7ce48c4d5c927b62f4f3b1990b55d0edde7", + "sha384WithRSAEncryption": "1181da8920629b5be02b4f1e9567702503cd05be97e8ed89736f7d5ad809c7ce48c4d5c927b62f4f3b1990b55d0edde7", + "sha512": "9faa741aaadd8800590fb24964a541da6913de2e7b9b86c27380b21fb2bec8462b5d4f01df914a646549adface74e979482c41dc43868ceb3ab038fb06331faf", + "sha512WithRSAEncryption": "9faa741aaadd8800590fb24964a541da6913de2e7b9b86c27380b21fb2bec8462b5d4f01df914a646549adface74e979482c41dc43868ceb3ab038fb06331faf", + "shaWithRSAEncryption": "b359a73d59b6728d1f22f77829dc4c26ef703e39", + "ssl2-md5": "80999c2d12f623e4f87e0550a8e3523a", + "ssl3-md5": "80999c2d12f623e4f87e0550a8e3523a", + "ssl3-sha1": "209f7abc7f3b878ee46cdf3a1fbb9c21c3474f32", + "whirlpool": "a8cb71650a2490e88fee2e679823135dbadc1450c3d2e7879fba1e6a6e85bb882031e0ba7c80d04a5b6719f813fe4971f944c67db50a806a89ebf7f16e2fa10b" + }, + { + "input": "PweA4AfgAPx/wMAPj/CADg4D/7/8Af/g", + "DSA": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "DSA-SHA": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "DSA-SHA1": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "DSA-SHA1-old": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "RSA-MD4": "e5186641d83b2dd9c73ec37eebc88c26", + "RSA-MD5": "00945c1bd739ce389ac24bb93f6f9a85", + "RSA-MDC2": "c0ec81f710f90e1d876fabd4765914cf", + "RSA-RIPEMD160": "32f113cede7edcb10d2723dbfad08cad429d14da", + "RSA-SHA": "5e93d7df63a5c00a602172214f35cf2db61320fb", + "RSA-SHA1": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "RSA-SHA1-2": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "RSA-SHA224": "885646866beadb2cf8430fa74c16a1909102133c44dbdafc1aa3f6b9", + "RSA-SHA256": "b8a87b047350912e4861e4aab7d1046d5372797ecea81d187f8e2c117db535dd", + "RSA-SHA384": "c25c6902e20cd4e57795f0197b5eebade7c12dd8b01bbf06c4e5a9c6b1cd5f7d01894a119092dea696dddb7abed9bae7", + "RSA-SHA512": "25401e50121bec22ecd77147c28afeb3aed0012eac5ce5319cdedafe50552c3dc41fb1375eb1d26d0c7219ba53e8bff8df7bac099c50e19220f9b13c04e9c139", + "dsaEncryption": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "dsaWithSHA": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "dsaWithSHA1": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "dss1": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "ecdsa-with-SHA1": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "md4": "e5186641d83b2dd9c73ec37eebc88c26", + "md4WithRSAEncryption": "e5186641d83b2dd9c73ec37eebc88c26", + "md5": "00945c1bd739ce389ac24bb93f6f9a85", + "md5WithRSAEncryption": "00945c1bd739ce389ac24bb93f6f9a85", + "mdc2": "c0ec81f710f90e1d876fabd4765914cf", + "mdc2WithRSA": "c0ec81f710f90e1d876fabd4765914cf", + "ripemd": "32f113cede7edcb10d2723dbfad08cad429d14da", + "ripemd160": "32f113cede7edcb10d2723dbfad08cad429d14da", + "ripemd160WithRSA": "32f113cede7edcb10d2723dbfad08cad429d14da", + "rmd160": "32f113cede7edcb10d2723dbfad08cad429d14da", + "sha": "5e93d7df63a5c00a602172214f35cf2db61320fb", + "sha1": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "sha1WithRSAEncryption": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "sha224": "885646866beadb2cf8430fa74c16a1909102133c44dbdafc1aa3f6b9", + "sha224WithRSAEncryption": "885646866beadb2cf8430fa74c16a1909102133c44dbdafc1aa3f6b9", + "sha256": "b8a87b047350912e4861e4aab7d1046d5372797ecea81d187f8e2c117db535dd", + "sha256WithRSAEncryption": "b8a87b047350912e4861e4aab7d1046d5372797ecea81d187f8e2c117db535dd", + "sha384": "c25c6902e20cd4e57795f0197b5eebade7c12dd8b01bbf06c4e5a9c6b1cd5f7d01894a119092dea696dddb7abed9bae7", + "sha384WithRSAEncryption": "c25c6902e20cd4e57795f0197b5eebade7c12dd8b01bbf06c4e5a9c6b1cd5f7d01894a119092dea696dddb7abed9bae7", + "sha512": "25401e50121bec22ecd77147c28afeb3aed0012eac5ce5319cdedafe50552c3dc41fb1375eb1d26d0c7219ba53e8bff8df7bac099c50e19220f9b13c04e9c139", + "sha512WithRSAEncryption": "25401e50121bec22ecd77147c28afeb3aed0012eac5ce5319cdedafe50552c3dc41fb1375eb1d26d0c7219ba53e8bff8df7bac099c50e19220f9b13c04e9c139", + "shaWithRSAEncryption": "5e93d7df63a5c00a602172214f35cf2db61320fb", + "ssl2-md5": "00945c1bd739ce389ac24bb93f6f9a85", + "ssl3-md5": "00945c1bd739ce389ac24bb93f6f9a85", + "ssl3-sha1": "05fc054b00d97753a9b3e2da8fbba3ee808cef22", + "whirlpool": "c896ba54d4fc9689ac81075f2876c5e6f065b47c371f3f6c66a58fef321a2562d4c3951320bdd20ee912cd88d161f379b5ed5f329e93a6b7b5a709538ddb5750" + }, + { + "input": "//wR/OAOH/+HgB/g//3/wAP/wA8AB/AB/w==", + "DSA": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "DSA-SHA": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "DSA-SHA1": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "DSA-SHA1-old": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "RSA-MD4": "5a4ec8dcd83c1de8d5ffb0baf464802e", + "RSA-MD5": "7ab55f0bd5dca5b17ecaa7fef73ed87b", + "RSA-MDC2": "b579e8d500502ebdd691512e89dfc1ae", + "RSA-RIPEMD160": "9dffa3a1ee1fd250f126c9b4d671fff02ba1f1cd", + "RSA-SHA": "3ae062b057f3bd594fcfc0bd60321eb2fa6aeb71", + "RSA-SHA1": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "RSA-SHA1-2": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "RSA-SHA224": "3b5a53f0a5bbb7cefb37f08622cc3073990f7b1c200a06937dca5de5", + "RSA-SHA256": "8d2b52d4d4074d471d037cdf9eeb13c18ef9ce4949fce00d106ef0880f2db5ed", + "RSA-SHA384": "0a508ca377541c85fc9d5a94d492e98dab6926b0dc3d16f42acc403fef719dcb7ab7a072b5371ccfdd7ef2f41ccce180", + "RSA-SHA512": "445cf90cc104716f55a8e9af95b9cc4645978968bccb5509606098ae0b913eb7551d7a87c1acf85a0735b21abf928e3abfb709d7770e2299d255ac7a7011d1ff", + "dsaEncryption": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "dsaWithSHA": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "dsaWithSHA1": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "dss1": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "ecdsa-with-SHA1": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "md4": "5a4ec8dcd83c1de8d5ffb0baf464802e", + "md4WithRSAEncryption": "5a4ec8dcd83c1de8d5ffb0baf464802e", + "md5": "7ab55f0bd5dca5b17ecaa7fef73ed87b", + "md5WithRSAEncryption": "7ab55f0bd5dca5b17ecaa7fef73ed87b", + "mdc2": "b579e8d500502ebdd691512e89dfc1ae", + "mdc2WithRSA": "b579e8d500502ebdd691512e89dfc1ae", + "ripemd": "9dffa3a1ee1fd250f126c9b4d671fff02ba1f1cd", + "ripemd160": "9dffa3a1ee1fd250f126c9b4d671fff02ba1f1cd", + "ripemd160WithRSA": "9dffa3a1ee1fd250f126c9b4d671fff02ba1f1cd", + "rmd160": "9dffa3a1ee1fd250f126c9b4d671fff02ba1f1cd", + "sha": "3ae062b057f3bd594fcfc0bd60321eb2fa6aeb71", + "sha1": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "sha1WithRSAEncryption": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "sha224": "3b5a53f0a5bbb7cefb37f08622cc3073990f7b1c200a06937dca5de5", + "sha224WithRSAEncryption": "3b5a53f0a5bbb7cefb37f08622cc3073990f7b1c200a06937dca5de5", + "sha256": "8d2b52d4d4074d471d037cdf9eeb13c18ef9ce4949fce00d106ef0880f2db5ed", + "sha256WithRSAEncryption": "8d2b52d4d4074d471d037cdf9eeb13c18ef9ce4949fce00d106ef0880f2db5ed", + "sha384": "0a508ca377541c85fc9d5a94d492e98dab6926b0dc3d16f42acc403fef719dcb7ab7a072b5371ccfdd7ef2f41ccce180", + "sha384WithRSAEncryption": "0a508ca377541c85fc9d5a94d492e98dab6926b0dc3d16f42acc403fef719dcb7ab7a072b5371ccfdd7ef2f41ccce180", + "sha512": "445cf90cc104716f55a8e9af95b9cc4645978968bccb5509606098ae0b913eb7551d7a87c1acf85a0735b21abf928e3abfb709d7770e2299d255ac7a7011d1ff", + "sha512WithRSAEncryption": "445cf90cc104716f55a8e9af95b9cc4645978968bccb5509606098ae0b913eb7551d7a87c1acf85a0735b21abf928e3abfb709d7770e2299d255ac7a7011d1ff", + "shaWithRSAEncryption": "3ae062b057f3bd594fcfc0bd60321eb2fa6aeb71", + "ssl2-md5": "7ab55f0bd5dca5b17ecaa7fef73ed87b", + "ssl3-md5": "7ab55f0bd5dca5b17ecaa7fef73ed87b", + "ssl3-sha1": "0c4980ea3a46c757dfbfc5baa38ac6c8e72ddce7", + "whirlpool": "d0e913c4dc68d53faf1a66d1682a64dad23a1b3368e4af4fefd82206771c39941fa07cec30ee8c0abcc32abdd0c5f1fd1bd1a898da8573ea62547c083675807b" + }, + { + "input": "8AfB/gD4AeeA/4A/H3+MABwAD/gH/AD//AA=", + "DSA": "96a460d2972d276928b69864445bea353bdcffd2", + "DSA-SHA": "96a460d2972d276928b69864445bea353bdcffd2", + "DSA-SHA1": "96a460d2972d276928b69864445bea353bdcffd2", + "DSA-SHA1-old": "96a460d2972d276928b69864445bea353bdcffd2", + "RSA-MD4": "55cc491fa42a1d79d7a60d3652588616", + "RSA-MD5": "e3cedd606ad51dd18532abd3079a3e0c", + "RSA-MDC2": "28570f0209fd38f13a9fc46954a8f19c", + "RSA-RIPEMD160": "0292bf0051d06cd00b37f5abb15b9d10a02b1a13", + "RSA-SHA": "8aa916fdbd96cca7c28c7a444ccdaf000418cef5", + "RSA-SHA1": "96a460d2972d276928b69864445bea353bdcffd2", + "RSA-SHA1-2": "96a460d2972d276928b69864445bea353bdcffd2", + "RSA-SHA224": "d340b9a6207faa3440f9d4e11c8e243163aeda4a5548d29a99d91d58", + "RSA-SHA256": "3d182e9928b2433c94255452170e59e3f4cca3dd29ea2e9b01e94e89da595393", + "RSA-SHA384": "9fd1473b3582f00dfca4854d312a4cba7337e7d157c5023ac9aaae94ae75fc4e378ed4177d5b05c555812ed355845944", + "RSA-SHA512": "b617e5d54371bb5ec3ae745026c08b4250efc36e74e6a7d60892dee3e605189998d1dc49ed3cc1397beefa04219f035bf28ecdeab7dbeb59c5fe7b32b18e2a59", + "dsaEncryption": "96a460d2972d276928b69864445bea353bdcffd2", + "dsaWithSHA": "96a460d2972d276928b69864445bea353bdcffd2", + "dsaWithSHA1": "96a460d2972d276928b69864445bea353bdcffd2", + "dss1": "96a460d2972d276928b69864445bea353bdcffd2", + "ecdsa-with-SHA1": "96a460d2972d276928b69864445bea353bdcffd2", + "md4": "55cc491fa42a1d79d7a60d3652588616", + "md4WithRSAEncryption": "55cc491fa42a1d79d7a60d3652588616", + "md5": "e3cedd606ad51dd18532abd3079a3e0c", + "md5WithRSAEncryption": "e3cedd606ad51dd18532abd3079a3e0c", + "mdc2": "28570f0209fd38f13a9fc46954a8f19c", + "mdc2WithRSA": "28570f0209fd38f13a9fc46954a8f19c", + "ripemd": "0292bf0051d06cd00b37f5abb15b9d10a02b1a13", + "ripemd160": "0292bf0051d06cd00b37f5abb15b9d10a02b1a13", + "ripemd160WithRSA": "0292bf0051d06cd00b37f5abb15b9d10a02b1a13", + "rmd160": "0292bf0051d06cd00b37f5abb15b9d10a02b1a13", + "sha": "8aa916fdbd96cca7c28c7a444ccdaf000418cef5", + "sha1": "96a460d2972d276928b69864445bea353bdcffd2", + "sha1WithRSAEncryption": "96a460d2972d276928b69864445bea353bdcffd2", + "sha224": "d340b9a6207faa3440f9d4e11c8e243163aeda4a5548d29a99d91d58", + "sha224WithRSAEncryption": "d340b9a6207faa3440f9d4e11c8e243163aeda4a5548d29a99d91d58", + "sha256": "3d182e9928b2433c94255452170e59e3f4cca3dd29ea2e9b01e94e89da595393", + "sha256WithRSAEncryption": "3d182e9928b2433c94255452170e59e3f4cca3dd29ea2e9b01e94e89da595393", + "sha384": "9fd1473b3582f00dfca4854d312a4cba7337e7d157c5023ac9aaae94ae75fc4e378ed4177d5b05c555812ed355845944", + "sha384WithRSAEncryption": "9fd1473b3582f00dfca4854d312a4cba7337e7d157c5023ac9aaae94ae75fc4e378ed4177d5b05c555812ed355845944", + "sha512": "b617e5d54371bb5ec3ae745026c08b4250efc36e74e6a7d60892dee3e605189998d1dc49ed3cc1397beefa04219f035bf28ecdeab7dbeb59c5fe7b32b18e2a59", + "sha512WithRSAEncryption": "b617e5d54371bb5ec3ae745026c08b4250efc36e74e6a7d60892dee3e605189998d1dc49ed3cc1397beefa04219f035bf28ecdeab7dbeb59c5fe7b32b18e2a59", + "shaWithRSAEncryption": "8aa916fdbd96cca7c28c7a444ccdaf000418cef5", + "ssl2-md5": "e3cedd606ad51dd18532abd3079a3e0c", + "ssl3-md5": "e3cedd606ad51dd18532abd3079a3e0c", + "ssl3-sha1": "96a460d2972d276928b69864445bea353bdcffd2", + "whirlpool": "319e012886f9f108df29cb397425c89d5eb0a652e196c7193320f06973bf37b28b4b8863f8c4c6fd01de16bc73bd0dc75ce1e97272fbf69efe4bcc99236da61c" + }, + { + "input": "AA/4P8BgAH/4/wAD8DwHwH/gP/gBAH4D/8AA", + "DSA": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "DSA-SHA": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "DSA-SHA1": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "DSA-SHA1-old": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "RSA-MD4": "97b58393146d5ed76262e9a3f769dd89", + "RSA-MD5": "df5ecc6732e22cc25836398a10222e97", + "RSA-MDC2": "ece6d11cdb0a595319d5edfe00eaf999", + "RSA-RIPEMD160": "f2e490c4000d86f6d35b86e573dbf4e374a1ac69", + "RSA-SHA": "3181ede45f415cacc5841364aa9b5052380206a4", + "RSA-SHA1": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "RSA-SHA1-2": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "RSA-SHA224": "f281f12f045a4d6d13e0cca775d317862464cabc765bcf2c1861c673", + "RSA-SHA256": "17c3f5d88ed7f3f62be0e28913357d65916389c1633db8fb62b92e14230d3611", + "RSA-SHA384": "9885018390a6111f5c5eeb058a989fa8a16e34d4ac748ff6e185d7fb905538a468f1ba25d5913c389c141cfe7334c881", + "RSA-SHA512": "63a3c524ff190df114dbb6f8483048dd4cf6320a2d4c2928f5b97aeaf9583112d12e3fa6fb76a8994ddc06cb7a349f2d8f9b0b30e6bb72f338d7c6ef3988e3e9", + "dsaEncryption": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "dsaWithSHA": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "dsaWithSHA1": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "dss1": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "ecdsa-with-SHA1": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "md4": "97b58393146d5ed76262e9a3f769dd89", + "md4WithRSAEncryption": "97b58393146d5ed76262e9a3f769dd89", + "md5": "df5ecc6732e22cc25836398a10222e97", + "md5WithRSAEncryption": "df5ecc6732e22cc25836398a10222e97", + "mdc2": "ece6d11cdb0a595319d5edfe00eaf999", + "mdc2WithRSA": "ece6d11cdb0a595319d5edfe00eaf999", + "ripemd": "f2e490c4000d86f6d35b86e573dbf4e374a1ac69", + "ripemd160": "f2e490c4000d86f6d35b86e573dbf4e374a1ac69", + "ripemd160WithRSA": "f2e490c4000d86f6d35b86e573dbf4e374a1ac69", + "rmd160": "f2e490c4000d86f6d35b86e573dbf4e374a1ac69", + "sha": "3181ede45f415cacc5841364aa9b5052380206a4", + "sha1": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "sha1WithRSAEncryption": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "sha224": "f281f12f045a4d6d13e0cca775d317862464cabc765bcf2c1861c673", + "sha224WithRSAEncryption": "f281f12f045a4d6d13e0cca775d317862464cabc765bcf2c1861c673", + "sha256": "17c3f5d88ed7f3f62be0e28913357d65916389c1633db8fb62b92e14230d3611", + "sha256WithRSAEncryption": "17c3f5d88ed7f3f62be0e28913357d65916389c1633db8fb62b92e14230d3611", + "sha384": "9885018390a6111f5c5eeb058a989fa8a16e34d4ac748ff6e185d7fb905538a468f1ba25d5913c389c141cfe7334c881", + "sha384WithRSAEncryption": "9885018390a6111f5c5eeb058a989fa8a16e34d4ac748ff6e185d7fb905538a468f1ba25d5913c389c141cfe7334c881", + "sha512": "63a3c524ff190df114dbb6f8483048dd4cf6320a2d4c2928f5b97aeaf9583112d12e3fa6fb76a8994ddc06cb7a349f2d8f9b0b30e6bb72f338d7c6ef3988e3e9", + "sha512WithRSAEncryption": "63a3c524ff190df114dbb6f8483048dd4cf6320a2d4c2928f5b97aeaf9583112d12e3fa6fb76a8994ddc06cb7a349f2d8f9b0b30e6bb72f338d7c6ef3988e3e9", + "shaWithRSAEncryption": "3181ede45f415cacc5841364aa9b5052380206a4", + "ssl2-md5": "df5ecc6732e22cc25836398a10222e97", + "ssl3-md5": "df5ecc6732e22cc25836398a10222e97", + "ssl3-sha1": "f3ef04d8fa8c6fa9850f394a4554c080956fa64b", + "whirlpool": "c55a0079ac6550316c400a9ff6c9b8f4103caf8fcafcff208fef4000f152dc24484473e74f9c0a880263f5e5a84811153271eccb889ba4db72db36629e25ee4d" + }, + { + "input": "AA/4AwAf/wAP/gA/AAP/4AfA/wA8f/AB//g//w==", + "DSA": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "DSA-SHA": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "DSA-SHA1": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "DSA-SHA1-old": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "RSA-MD4": "254170dbfd6de883830200b35fc6d764", + "RSA-MD5": "863b6d9962ee3761bbb9cd8a8367589e", + "RSA-MDC2": "12bae0d014a8cc4125a4db066bf30b3f", + "RSA-RIPEMD160": "7f2575af0e537f2828c44b68bb3ebff84d945b40", + "RSA-SHA": "d38ff53524ae6e00c2b5244bffb7036675a92545", + "RSA-SHA1": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "RSA-SHA1-2": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "RSA-SHA224": "d482f19921293407212e94619a0027f36865d015b80a7770fb47f7c9", + "RSA-SHA256": "93788128441c894247bd9ccd6fc8af146c0ee76cdbe4e1c5a8dfa81dd0c338b4", + "RSA-SHA384": "33202d1cdd68c05bd0d8dcfe166fce393d603f9aa4534b1d1118938855a8fb938ff335606d6e477fdba194458079cdd0", + "RSA-SHA512": "fd256d33a09fca956b374c996c0a22ffbfb47ca3a88723c0274186b095da01c0ba92e89c589fa2fc88b3e614b7928a1f0f101cd5de5425baf4b73b28e305d8cd", + "dsaEncryption": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "dsaWithSHA": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "dsaWithSHA1": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "dss1": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "ecdsa-with-SHA1": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "md4": "254170dbfd6de883830200b35fc6d764", + "md4WithRSAEncryption": "254170dbfd6de883830200b35fc6d764", + "md5": "863b6d9962ee3761bbb9cd8a8367589e", + "md5WithRSAEncryption": "863b6d9962ee3761bbb9cd8a8367589e", + "mdc2": "12bae0d014a8cc4125a4db066bf30b3f", + "mdc2WithRSA": "12bae0d014a8cc4125a4db066bf30b3f", + "ripemd": "7f2575af0e537f2828c44b68bb3ebff84d945b40", + "ripemd160": "7f2575af0e537f2828c44b68bb3ebff84d945b40", + "ripemd160WithRSA": "7f2575af0e537f2828c44b68bb3ebff84d945b40", + "rmd160": "7f2575af0e537f2828c44b68bb3ebff84d945b40", + "sha": "d38ff53524ae6e00c2b5244bffb7036675a92545", + "sha1": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "sha1WithRSAEncryption": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "sha224": "d482f19921293407212e94619a0027f36865d015b80a7770fb47f7c9", + "sha224WithRSAEncryption": "d482f19921293407212e94619a0027f36865d015b80a7770fb47f7c9", + "sha256": "93788128441c894247bd9ccd6fc8af146c0ee76cdbe4e1c5a8dfa81dd0c338b4", + "sha256WithRSAEncryption": "93788128441c894247bd9ccd6fc8af146c0ee76cdbe4e1c5a8dfa81dd0c338b4", + "sha384": "33202d1cdd68c05bd0d8dcfe166fce393d603f9aa4534b1d1118938855a8fb938ff335606d6e477fdba194458079cdd0", + "sha384WithRSAEncryption": "33202d1cdd68c05bd0d8dcfe166fce393d603f9aa4534b1d1118938855a8fb938ff335606d6e477fdba194458079cdd0", + "sha512": "fd256d33a09fca956b374c996c0a22ffbfb47ca3a88723c0274186b095da01c0ba92e89c589fa2fc88b3e614b7928a1f0f101cd5de5425baf4b73b28e305d8cd", + "sha512WithRSAEncryption": "fd256d33a09fca956b374c996c0a22ffbfb47ca3a88723c0274186b095da01c0ba92e89c589fa2fc88b3e614b7928a1f0f101cd5de5425baf4b73b28e305d8cd", + "shaWithRSAEncryption": "d38ff53524ae6e00c2b5244bffb7036675a92545", + "ssl2-md5": "863b6d9962ee3761bbb9cd8a8367589e", + "ssl3-md5": "863b6d9962ee3761bbb9cd8a8367589e", + "ssl3-sha1": "f2a31d875d1d7b30874d416c4d2ea6baf0ffbafe", + "whirlpool": "3425ee9dd80dc63e73609568939298a4e93c80adaddcd3902d2b6584f4e3ea266fb7975b023f9406ecffb56e6f2a9df0580c85e85a5ef4fbbb30e7006ad2b95d" + }, + { + "input": "AAHg4B/+AAP8AA//4A//AA4Af/wP/gB4AD//AP8=", + "DSA": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "DSA-SHA": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "DSA-SHA1": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "DSA-SHA1-old": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "RSA-MD4": "75f3f471982aef5f9ca6c0ca5e542cbc", + "RSA-MD5": "683c9384e29efe82dd3ac847904c28e8", + "RSA-MDC2": "34da35c74643c6c2004710ae9cc333cd", + "RSA-RIPEMD160": "66e68d434de10fe1acc67630a52a645717e46aaa", + "RSA-SHA": "a711bc3da0c132f3ad954a98339007af5355a06e", + "RSA-SHA1": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "RSA-SHA1-2": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "RSA-SHA224": "b4136b52a6bee237debf10c492f963133e8c9fc8c29d3b948c3d7ef4", + "RSA-SHA256": "c7855ac54d2c5767273eec327efe39fdb3bad74121bdd8d2065484268727539e", + "RSA-SHA384": "8f2e09b486045fd19228dafe0ee2fe8ecf56236c33f383bf353f16ebaded83a0f2e8fb1c086e500abb14d0c97013f427", + "RSA-SHA512": "cf7789daccf0b20ced8a6c39ddfd0b53d1806e1447fed350d28212ead062b0d9aba6680c5ab0d85a905dadb5692728b5e4e96f82807265c1a5f908c10dc36b0f", + "dsaEncryption": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "dsaWithSHA": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "dsaWithSHA1": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "dss1": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "ecdsa-with-SHA1": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "md4": "75f3f471982aef5f9ca6c0ca5e542cbc", + "md4WithRSAEncryption": "75f3f471982aef5f9ca6c0ca5e542cbc", + "md5": "683c9384e29efe82dd3ac847904c28e8", + "md5WithRSAEncryption": "683c9384e29efe82dd3ac847904c28e8", + "mdc2": "34da35c74643c6c2004710ae9cc333cd", + "mdc2WithRSA": "34da35c74643c6c2004710ae9cc333cd", + "ripemd": "66e68d434de10fe1acc67630a52a645717e46aaa", + "ripemd160": "66e68d434de10fe1acc67630a52a645717e46aaa", + "ripemd160WithRSA": "66e68d434de10fe1acc67630a52a645717e46aaa", + "rmd160": "66e68d434de10fe1acc67630a52a645717e46aaa", + "sha": "a711bc3da0c132f3ad954a98339007af5355a06e", + "sha1": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "sha1WithRSAEncryption": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "sha224": "b4136b52a6bee237debf10c492f963133e8c9fc8c29d3b948c3d7ef4", + "sha224WithRSAEncryption": "b4136b52a6bee237debf10c492f963133e8c9fc8c29d3b948c3d7ef4", + "sha256": "c7855ac54d2c5767273eec327efe39fdb3bad74121bdd8d2065484268727539e", + "sha256WithRSAEncryption": "c7855ac54d2c5767273eec327efe39fdb3bad74121bdd8d2065484268727539e", + "sha384": "8f2e09b486045fd19228dafe0ee2fe8ecf56236c33f383bf353f16ebaded83a0f2e8fb1c086e500abb14d0c97013f427", + "sha384WithRSAEncryption": "8f2e09b486045fd19228dafe0ee2fe8ecf56236c33f383bf353f16ebaded83a0f2e8fb1c086e500abb14d0c97013f427", + "sha512": "cf7789daccf0b20ced8a6c39ddfd0b53d1806e1447fed350d28212ead062b0d9aba6680c5ab0d85a905dadb5692728b5e4e96f82807265c1a5f908c10dc36b0f", + "sha512WithRSAEncryption": "cf7789daccf0b20ced8a6c39ddfd0b53d1806e1447fed350d28212ead062b0d9aba6680c5ab0d85a905dadb5692728b5e4e96f82807265c1a5f908c10dc36b0f", + "shaWithRSAEncryption": "a711bc3da0c132f3ad954a98339007af5355a06e", + "ssl2-md5": "683c9384e29efe82dd3ac847904c28e8", + "ssl3-md5": "683c9384e29efe82dd3ac847904c28e8", + "ssl3-sha1": "f4942d3b9e9588dcfdc6312a84df75d05f111c20", + "whirlpool": "1c9e2f702bb804cf393aa2e878d278092515746205123fb916a15ff21fd96bc9a8691957c6e58d1c46cf8b932c9bc9083a5017aa9fb9c1854aa4e7c88fd6384e" + }, + { + "input": "gEH/w/4AHgAP/+D/gA/gAH/3/wH+Af/f/wAB/+AA", + "DSA": "310207df35b014e4676d30806fa34424813734dd", + "DSA-SHA": "310207df35b014e4676d30806fa34424813734dd", + "DSA-SHA1": "310207df35b014e4676d30806fa34424813734dd", + "DSA-SHA1-old": "310207df35b014e4676d30806fa34424813734dd", + "RSA-MD4": "a96d7d1c204aa0221ec4c19e97352a60", + "RSA-MD5": "b3d948e72159ddc9c600d75512c5f115", + "RSA-MDC2": "22cd84ab5864b42df054576d0391d2cc", + "RSA-RIPEMD160": "7ba69b7c4378c53519a30020a1c0206a00e878ec", + "RSA-SHA": "5e5b768ea959acd229b268a520698b84b5d4785d", + "RSA-SHA1": "310207df35b014e4676d30806fa34424813734dd", + "RSA-SHA1-2": "310207df35b014e4676d30806fa34424813734dd", + "RSA-SHA224": "325398b0c7c581fecbd21da45855ff3f7b4c134f2719d7f1122e61a8", + "RSA-SHA256": "d1e1f2aca9cfe8c6460f576661190a8008705ef13207c4c7200a2d6b0605f519", + "RSA-SHA384": "e48d377c31ef07e141674e295e6d905e41012a8caec216233a2ae5365d9c43e2c9255622aa0bcb30dc3e1524807afd4b", + "RSA-SHA512": "6e838146cde732b5d72f1709554a578d8ade9182e54827426818cf4ed6a3d9ef1d98f7e23d0365b34c99c0cefb9dd723716ebacd2eab77ba8e9501d12311e910", + "dsaEncryption": "310207df35b014e4676d30806fa34424813734dd", + "dsaWithSHA": "310207df35b014e4676d30806fa34424813734dd", + "dsaWithSHA1": "310207df35b014e4676d30806fa34424813734dd", + "dss1": "310207df35b014e4676d30806fa34424813734dd", + "ecdsa-with-SHA1": "310207df35b014e4676d30806fa34424813734dd", + "md4": "a96d7d1c204aa0221ec4c19e97352a60", + "md4WithRSAEncryption": "a96d7d1c204aa0221ec4c19e97352a60", + "md5": "b3d948e72159ddc9c600d75512c5f115", + "md5WithRSAEncryption": "b3d948e72159ddc9c600d75512c5f115", + "mdc2": "22cd84ab5864b42df054576d0391d2cc", + "mdc2WithRSA": "22cd84ab5864b42df054576d0391d2cc", + "ripemd": "7ba69b7c4378c53519a30020a1c0206a00e878ec", + "ripemd160": "7ba69b7c4378c53519a30020a1c0206a00e878ec", + "ripemd160WithRSA": "7ba69b7c4378c53519a30020a1c0206a00e878ec", + "rmd160": "7ba69b7c4378c53519a30020a1c0206a00e878ec", + "sha": "5e5b768ea959acd229b268a520698b84b5d4785d", + "sha1": "310207df35b014e4676d30806fa34424813734dd", + "sha1WithRSAEncryption": "310207df35b014e4676d30806fa34424813734dd", + "sha224": "325398b0c7c581fecbd21da45855ff3f7b4c134f2719d7f1122e61a8", + "sha224WithRSAEncryption": "325398b0c7c581fecbd21da45855ff3f7b4c134f2719d7f1122e61a8", + "sha256": "d1e1f2aca9cfe8c6460f576661190a8008705ef13207c4c7200a2d6b0605f519", + "sha256WithRSAEncryption": "d1e1f2aca9cfe8c6460f576661190a8008705ef13207c4c7200a2d6b0605f519", + "sha384": "e48d377c31ef07e141674e295e6d905e41012a8caec216233a2ae5365d9c43e2c9255622aa0bcb30dc3e1524807afd4b", + "sha384WithRSAEncryption": "e48d377c31ef07e141674e295e6d905e41012a8caec216233a2ae5365d9c43e2c9255622aa0bcb30dc3e1524807afd4b", + "sha512": "6e838146cde732b5d72f1709554a578d8ade9182e54827426818cf4ed6a3d9ef1d98f7e23d0365b34c99c0cefb9dd723716ebacd2eab77ba8e9501d12311e910", + "sha512WithRSAEncryption": "6e838146cde732b5d72f1709554a578d8ade9182e54827426818cf4ed6a3d9ef1d98f7e23d0365b34c99c0cefb9dd723716ebacd2eab77ba8e9501d12311e910", + "shaWithRSAEncryption": "5e5b768ea959acd229b268a520698b84b5d4785d", + "ssl2-md5": "b3d948e72159ddc9c600d75512c5f115", + "ssl3-md5": "b3d948e72159ddc9c600d75512c5f115", + "ssl3-sha1": "310207df35b014e4676d30806fa34424813734dd", + "whirlpool": "1fded05591b9e6d4c07905d384a43e8976ee8d0263d2e7e06a82769aa843d8e3e627802576e5bdde2b11ebd7558f24ece75bba6cede9f0788032de4c76e50a53" + }, + { + "input": "+AcA/8B/vgAP/wAD4/D/8AAfgf+AD/+AIAPwA4D//A==", + "DSA": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "DSA-SHA": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "DSA-SHA1": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "DSA-SHA1-old": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "RSA-MD4": "7bf25a8f5271da6bde0a905482b07401", + "RSA-MD5": "ce8633a6cf189b07e022147bbbd0f350", + "RSA-MDC2": "bc0975fed3d2d2786d0c5db1e1003384", + "RSA-RIPEMD160": "ff2586f8e09787238b1afcda11023fc73dfc5dd7", + "RSA-SHA": "e9887634d9f889966d51051e384347516ef78dc9", + "RSA-SHA1": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "RSA-SHA1-2": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "RSA-SHA224": "7fd2bb294a49bf524a73059c23b30d7621d17bb1e1ca5a73c5ca5f33", + "RSA-SHA256": "b1843454b0258016558abdbd899319c1fd12d03e0c3d9e882da03de9cb981777", + "RSA-SHA384": "9361ea8d32fc65f15283d36b2deb04850a4e80bcfefc71236f0983b6dfe5e182fc1c4bfbfe9afc166aa2c42b84be372a", + "RSA-SHA512": "7181c16eb19dd6c82a178d1d9c9b79a7a21f2b7185787fbd31ff781a178870fd9ef6434b5814edf2b55a3c0d51f799e2f319beac54bfbb0153130898370aa64e", + "dsaEncryption": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "dsaWithSHA": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "dsaWithSHA1": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "dss1": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "ecdsa-with-SHA1": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "md4": "7bf25a8f5271da6bde0a905482b07401", + "md4WithRSAEncryption": "7bf25a8f5271da6bde0a905482b07401", + "md5": "ce8633a6cf189b07e022147bbbd0f350", + "md5WithRSAEncryption": "ce8633a6cf189b07e022147bbbd0f350", + "mdc2": "bc0975fed3d2d2786d0c5db1e1003384", + "mdc2WithRSA": "bc0975fed3d2d2786d0c5db1e1003384", + "ripemd": "ff2586f8e09787238b1afcda11023fc73dfc5dd7", + "ripemd160": "ff2586f8e09787238b1afcda11023fc73dfc5dd7", + "ripemd160WithRSA": "ff2586f8e09787238b1afcda11023fc73dfc5dd7", + "rmd160": "ff2586f8e09787238b1afcda11023fc73dfc5dd7", + "sha": "e9887634d9f889966d51051e384347516ef78dc9", + "sha1": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "sha1WithRSAEncryption": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "sha224": "7fd2bb294a49bf524a73059c23b30d7621d17bb1e1ca5a73c5ca5f33", + "sha224WithRSAEncryption": "7fd2bb294a49bf524a73059c23b30d7621d17bb1e1ca5a73c5ca5f33", + "sha256": "b1843454b0258016558abdbd899319c1fd12d03e0c3d9e882da03de9cb981777", + "sha256WithRSAEncryption": "b1843454b0258016558abdbd899319c1fd12d03e0c3d9e882da03de9cb981777", + "sha384": "9361ea8d32fc65f15283d36b2deb04850a4e80bcfefc71236f0983b6dfe5e182fc1c4bfbfe9afc166aa2c42b84be372a", + "sha384WithRSAEncryption": "9361ea8d32fc65f15283d36b2deb04850a4e80bcfefc71236f0983b6dfe5e182fc1c4bfbfe9afc166aa2c42b84be372a", + "sha512": "7181c16eb19dd6c82a178d1d9c9b79a7a21f2b7185787fbd31ff781a178870fd9ef6434b5814edf2b55a3c0d51f799e2f319beac54bfbb0153130898370aa64e", + "sha512WithRSAEncryption": "7181c16eb19dd6c82a178d1d9c9b79a7a21f2b7185787fbd31ff781a178870fd9ef6434b5814edf2b55a3c0d51f799e2f319beac54bfbb0153130898370aa64e", + "shaWithRSAEncryption": "e9887634d9f889966d51051e384347516ef78dc9", + "ssl2-md5": "ce8633a6cf189b07e022147bbbd0f350", + "ssl3-md5": "ce8633a6cf189b07e022147bbbd0f350", + "ssl3-sha1": "4da1955b2fa7c7e74e3f47d7360ce530bbf57ca3", + "whirlpool": "b808f1bb089b54bdbc4ef470b6b16963c65f9e4fc8e38ca38a02315a97f7085e89665fb38cf0c912a814bbae3085e2af2a2b237ce401ac73fb1b7e2662c0593b" + }, + { + "input": "ADggAH/wAf/+z/4H/8AAf/gfAADAAMAP/z4PwA//gAA=", + "DSA": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "DSA-SHA": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "DSA-SHA1": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "DSA-SHA1-old": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "RSA-MD4": "83028cd6493d346d79a6f7cb51ef5c16", + "RSA-MD5": "8df17372eb32a0afa4fc47837262ff61", + "RSA-MDC2": "f2ce7971511276de6b17494e074dfe6d", + "RSA-RIPEMD160": "e7fb567b5b5555d1b61b55dbaea3e0e1659ec984", + "RSA-SHA": "56296a1654ca244b3662c9236a037183dbba7c5c", + "RSA-SHA1": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "RSA-SHA1-2": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "RSA-SHA224": "b5866bca881d1ff15fbb14757549d9ea637186b8bfb1132e26f41851", + "RSA-SHA256": "2834dcb6957b97fdde61b532d151ee4482bface8714fe36cd072b4783765901d", + "RSA-SHA384": "1da4e010eaadfd837c926d7ccf688d0b7bee73682601195201a8294e29dcb3adfeb84f43364593766937106dd15fa680", + "RSA-SHA512": "2fcb3ddc573861b64f05ea82a1c1abe7ada1d16bf18fa7760d7893d029dd0b60dd181dd052e7b9882c4e5699f72d2a06a5d83b26960123faae6bbb8d75cdf93c", + "dsaEncryption": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "dsaWithSHA": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "dsaWithSHA1": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "dss1": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "ecdsa-with-SHA1": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "md4": "83028cd6493d346d79a6f7cb51ef5c16", + "md4WithRSAEncryption": "83028cd6493d346d79a6f7cb51ef5c16", + "md5": "8df17372eb32a0afa4fc47837262ff61", + "md5WithRSAEncryption": "8df17372eb32a0afa4fc47837262ff61", + "mdc2": "f2ce7971511276de6b17494e074dfe6d", + "mdc2WithRSA": "f2ce7971511276de6b17494e074dfe6d", + "ripemd": "e7fb567b5b5555d1b61b55dbaea3e0e1659ec984", + "ripemd160": "e7fb567b5b5555d1b61b55dbaea3e0e1659ec984", + "ripemd160WithRSA": "e7fb567b5b5555d1b61b55dbaea3e0e1659ec984", + "rmd160": "e7fb567b5b5555d1b61b55dbaea3e0e1659ec984", + "sha": "56296a1654ca244b3662c9236a037183dbba7c5c", + "sha1": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "sha1WithRSAEncryption": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "sha224": "b5866bca881d1ff15fbb14757549d9ea637186b8bfb1132e26f41851", + "sha224WithRSAEncryption": "b5866bca881d1ff15fbb14757549d9ea637186b8bfb1132e26f41851", + "sha256": "2834dcb6957b97fdde61b532d151ee4482bface8714fe36cd072b4783765901d", + "sha256WithRSAEncryption": "2834dcb6957b97fdde61b532d151ee4482bface8714fe36cd072b4783765901d", + "sha384": "1da4e010eaadfd837c926d7ccf688d0b7bee73682601195201a8294e29dcb3adfeb84f43364593766937106dd15fa680", + "sha384WithRSAEncryption": "1da4e010eaadfd837c926d7ccf688d0b7bee73682601195201a8294e29dcb3adfeb84f43364593766937106dd15fa680", + "sha512": "2fcb3ddc573861b64f05ea82a1c1abe7ada1d16bf18fa7760d7893d029dd0b60dd181dd052e7b9882c4e5699f72d2a06a5d83b26960123faae6bbb8d75cdf93c", + "sha512WithRSAEncryption": "2fcb3ddc573861b64f05ea82a1c1abe7ada1d16bf18fa7760d7893d029dd0b60dd181dd052e7b9882c4e5699f72d2a06a5d83b26960123faae6bbb8d75cdf93c", + "shaWithRSAEncryption": "56296a1654ca244b3662c9236a037183dbba7c5c", + "ssl2-md5": "8df17372eb32a0afa4fc47837262ff61", + "ssl3-md5": "8df17372eb32a0afa4fc47837262ff61", + "ssl3-sha1": "74c4bc5b26fb4a08602d40ccec6c6161b6c11478", + "whirlpool": "cd8ec5b56ac28e0471986a70f8c1dc4b99e070961f9b07babe7960338419873103d17aab924e12458282dfa5fb530b6ecb510e6ec6ad6bea85e1b495cbe5a61d" + }, + { + "input": "H/gH//gD4AH//D/4ADgfAD/cAcAE//8AD/wIAgAB8D//", + "DSA": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "DSA-SHA": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "DSA-SHA1": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "DSA-SHA1-old": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "RSA-MD4": "045f5a64d376e8100a09eeab090c3c80", + "RSA-MD5": "62c63ca91890ce6f78a59c0bdb1e7bab", + "RSA-MDC2": "f536bb3e3365b901815b148c14d7fce9", + "RSA-RIPEMD160": "c633f59186562d45274f67d83a3cb9b5a336cbc4", + "RSA-SHA": "74870248e7af360c2a5a96346f4c76ebd17269f2", + "RSA-SHA1": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "RSA-SHA1-2": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "RSA-SHA224": "b3790b8e49a88c53ec402394518b82bf4058198a7cc37d2e8845435b", + "RSA-SHA256": "47d61de59879013f64eb78fa8f6c8b906f7d25b8e1c3ca888f32421749c0d042", + "RSA-SHA384": "127544ea2bd3173a5eddf8503b5beed520ef445a118e022c94f18ce3b68f90fb85e11df34979118644cdbd793157cee8", + "RSA-SHA512": "e181d464243b380c604e97793333ca188d193357c743d0402990d796f2028f28838a93d717e5e07119e06dd2ba889b2ba775989ed77fa6fd959d565c1f179401", + "dsaEncryption": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "dsaWithSHA": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "dsaWithSHA1": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "dss1": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "ecdsa-with-SHA1": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "md4": "045f5a64d376e8100a09eeab090c3c80", + "md4WithRSAEncryption": "045f5a64d376e8100a09eeab090c3c80", + "md5": "62c63ca91890ce6f78a59c0bdb1e7bab", + "md5WithRSAEncryption": "62c63ca91890ce6f78a59c0bdb1e7bab", + "mdc2": "f536bb3e3365b901815b148c14d7fce9", + "mdc2WithRSA": "f536bb3e3365b901815b148c14d7fce9", + "ripemd": "c633f59186562d45274f67d83a3cb9b5a336cbc4", + "ripemd160": "c633f59186562d45274f67d83a3cb9b5a336cbc4", + "ripemd160WithRSA": "c633f59186562d45274f67d83a3cb9b5a336cbc4", + "rmd160": "c633f59186562d45274f67d83a3cb9b5a336cbc4", + "sha": "74870248e7af360c2a5a96346f4c76ebd17269f2", + "sha1": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "sha1WithRSAEncryption": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "sha224": "b3790b8e49a88c53ec402394518b82bf4058198a7cc37d2e8845435b", + "sha224WithRSAEncryption": "b3790b8e49a88c53ec402394518b82bf4058198a7cc37d2e8845435b", + "sha256": "47d61de59879013f64eb78fa8f6c8b906f7d25b8e1c3ca888f32421749c0d042", + "sha256WithRSAEncryption": "47d61de59879013f64eb78fa8f6c8b906f7d25b8e1c3ca888f32421749c0d042", + "sha384": "127544ea2bd3173a5eddf8503b5beed520ef445a118e022c94f18ce3b68f90fb85e11df34979118644cdbd793157cee8", + "sha384WithRSAEncryption": "127544ea2bd3173a5eddf8503b5beed520ef445a118e022c94f18ce3b68f90fb85e11df34979118644cdbd793157cee8", + "sha512": "e181d464243b380c604e97793333ca188d193357c743d0402990d796f2028f28838a93d717e5e07119e06dd2ba889b2ba775989ed77fa6fd959d565c1f179401", + "sha512WithRSAEncryption": "e181d464243b380c604e97793333ca188d193357c743d0402990d796f2028f28838a93d717e5e07119e06dd2ba889b2ba775989ed77fa6fd959d565c1f179401", + "shaWithRSAEncryption": "74870248e7af360c2a5a96346f4c76ebd17269f2", + "ssl2-md5": "62c63ca91890ce6f78a59c0bdb1e7bab", + "ssl3-md5": "62c63ca91890ce6f78a59c0bdb1e7bab", + "ssl3-sha1": "0b103ce297338dfc7395f7715ee47539b556ddb6", + "whirlpool": "90363b4b32218f1dda7535d499ad59c6a3911731e1b50588b9877b6723423cab907e5007d10f075a409c4504a43555664bc30e830b1f1a0636b3590f0e3475f6" + }, + { + "input": "gAeGAAP/4AA/+AAPgA/4D//gAB+AAH/4wA//8HwEB/8AAA==", + "DSA": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "DSA-SHA": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "DSA-SHA1": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "DSA-SHA1-old": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "RSA-MD4": "325ec9a7c1190a91cc2741650eb93c91", + "RSA-MD5": "1eda4bb0259a939548ec4ceb39facde4", + "RSA-MDC2": "d29176e2f2bb0a680cffaf44be9f0eaf", + "RSA-RIPEMD160": "1a61bd3b02bd0b20a2bbaf0a2bb3d32d94618d5b", + "RSA-SHA": "7c7ebeb661bc0c3dbb7a8f99f865c7543d4f7960", + "RSA-SHA1": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "RSA-SHA1-2": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "RSA-SHA224": "ffac87d0364dc7a0923fbdd3070c687e2bd0acc923ea7faaf0408cc8", + "RSA-SHA256": "855fc59aa873328501ab0b1ce9c60a7d5582662c725605ebe02b64a13e34b3bc", + "RSA-SHA384": "dcb16c0c0022a0ba6917767ecaf29335ad966bac8416dcadc504018b322f845a9f8837cb672d60cbe20319590a4cd15c", + "RSA-SHA512": "4c57d718a80f7e0d59285733fe06e763861cfefab394fc2fef53cf7739514e03b0c334c4420720f1bd4ec219da00e3dfc6272eeb4890ab4fb0d405ab26d9dcd0", + "dsaEncryption": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "dsaWithSHA": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "dsaWithSHA1": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "dss1": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "ecdsa-with-SHA1": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "md4": "325ec9a7c1190a91cc2741650eb93c91", + "md4WithRSAEncryption": "325ec9a7c1190a91cc2741650eb93c91", + "md5": "1eda4bb0259a939548ec4ceb39facde4", + "md5WithRSAEncryption": "1eda4bb0259a939548ec4ceb39facde4", + "mdc2": "d29176e2f2bb0a680cffaf44be9f0eaf", + "mdc2WithRSA": "d29176e2f2bb0a680cffaf44be9f0eaf", + "ripemd": "1a61bd3b02bd0b20a2bbaf0a2bb3d32d94618d5b", + "ripemd160": "1a61bd3b02bd0b20a2bbaf0a2bb3d32d94618d5b", + "ripemd160WithRSA": "1a61bd3b02bd0b20a2bbaf0a2bb3d32d94618d5b", + "rmd160": "1a61bd3b02bd0b20a2bbaf0a2bb3d32d94618d5b", + "sha": "7c7ebeb661bc0c3dbb7a8f99f865c7543d4f7960", + "sha1": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "sha1WithRSAEncryption": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "sha224": "ffac87d0364dc7a0923fbdd3070c687e2bd0acc923ea7faaf0408cc8", + "sha224WithRSAEncryption": "ffac87d0364dc7a0923fbdd3070c687e2bd0acc923ea7faaf0408cc8", + "sha256": "855fc59aa873328501ab0b1ce9c60a7d5582662c725605ebe02b64a13e34b3bc", + "sha256WithRSAEncryption": "855fc59aa873328501ab0b1ce9c60a7d5582662c725605ebe02b64a13e34b3bc", + "sha384": "dcb16c0c0022a0ba6917767ecaf29335ad966bac8416dcadc504018b322f845a9f8837cb672d60cbe20319590a4cd15c", + "sha384WithRSAEncryption": "dcb16c0c0022a0ba6917767ecaf29335ad966bac8416dcadc504018b322f845a9f8837cb672d60cbe20319590a4cd15c", + "sha512": "4c57d718a80f7e0d59285733fe06e763861cfefab394fc2fef53cf7739514e03b0c334c4420720f1bd4ec219da00e3dfc6272eeb4890ab4fb0d405ab26d9dcd0", + "sha512WithRSAEncryption": "4c57d718a80f7e0d59285733fe06e763861cfefab394fc2fef53cf7739514e03b0c334c4420720f1bd4ec219da00e3dfc6272eeb4890ab4fb0d405ab26d9dcd0", + "shaWithRSAEncryption": "7c7ebeb661bc0c3dbb7a8f99f865c7543d4f7960", + "ssl2-md5": "1eda4bb0259a939548ec4ceb39facde4", + "ssl3-md5": "1eda4bb0259a939548ec4ceb39facde4", + "ssl3-sha1": "efc72d99e3d2311ce14190c0b726bdc68f4b0821", + "whirlpool": "1b5afba2021c913e619d5196061be1cd1528ffb4e29cacef7c5304452a3d455bae6999aea4119151a75fd65b6876859a09259f3aab5a9547ab195df812f849d4" + }, + { + "input": "Af8AGD4PAAf/wADwH/4HgGAP+AA//jgfwAA/gf/8H+AAP/8=", + "DSA": "660edac0a8f4ce33da0d8dbae597650e97687250", + "DSA-SHA": "660edac0a8f4ce33da0d8dbae597650e97687250", + "DSA-SHA1": "660edac0a8f4ce33da0d8dbae597650e97687250", + "DSA-SHA1-old": "660edac0a8f4ce33da0d8dbae597650e97687250", + "RSA-MD4": "6ff736d1aa4abd98d9989432edd810ac", + "RSA-MD5": "c4f37a2c450f2a23322513b372e668a5", + "RSA-MDC2": "2ad8a917d8e3600f4f7286ded0951bfb", + "RSA-RIPEMD160": "5c0967aaa76255ea98f062a1abcbef90ce769ae2", + "RSA-SHA": "371d30691202f9d31776855ded13e28a8a36e9af", + "RSA-SHA1": "660edac0a8f4ce33da0d8dbae597650e97687250", + "RSA-SHA1-2": "660edac0a8f4ce33da0d8dbae597650e97687250", + "RSA-SHA224": "0abe94c703e751f4d66d223ebf9c59b3083adcf7c94933677f05e45e", + "RSA-SHA256": "e05939e8ff4ed77a11522dde249a74841c54970d984e0bb6f77ac64f1fa313b0", + "RSA-SHA384": "3893656e1942b21c17880f752c3950cd281a1431ec5e5d7c10329d281f7839edc8e239416bac6705f814d849a2fc4512", + "RSA-SHA512": "28e62841b7553adf1a3fc1e5e24c0f81df969fd315dbc616a75adde00093472f401aa4840a23afa128b19d345756c74ee4ff2dd79879841258508390233f159c", + "dsaEncryption": "660edac0a8f4ce33da0d8dbae597650e97687250", + "dsaWithSHA": "660edac0a8f4ce33da0d8dbae597650e97687250", + "dsaWithSHA1": "660edac0a8f4ce33da0d8dbae597650e97687250", + "dss1": "660edac0a8f4ce33da0d8dbae597650e97687250", + "ecdsa-with-SHA1": "660edac0a8f4ce33da0d8dbae597650e97687250", + "md4": "6ff736d1aa4abd98d9989432edd810ac", + "md4WithRSAEncryption": "6ff736d1aa4abd98d9989432edd810ac", + "md5": "c4f37a2c450f2a23322513b372e668a5", + "md5WithRSAEncryption": "c4f37a2c450f2a23322513b372e668a5", + "mdc2": "2ad8a917d8e3600f4f7286ded0951bfb", + "mdc2WithRSA": "2ad8a917d8e3600f4f7286ded0951bfb", + "ripemd": "5c0967aaa76255ea98f062a1abcbef90ce769ae2", + "ripemd160": "5c0967aaa76255ea98f062a1abcbef90ce769ae2", + "ripemd160WithRSA": "5c0967aaa76255ea98f062a1abcbef90ce769ae2", + "rmd160": "5c0967aaa76255ea98f062a1abcbef90ce769ae2", + "sha": "371d30691202f9d31776855ded13e28a8a36e9af", + "sha1": "660edac0a8f4ce33da0d8dbae597650e97687250", + "sha1WithRSAEncryption": "660edac0a8f4ce33da0d8dbae597650e97687250", + "sha224": "0abe94c703e751f4d66d223ebf9c59b3083adcf7c94933677f05e45e", + "sha224WithRSAEncryption": "0abe94c703e751f4d66d223ebf9c59b3083adcf7c94933677f05e45e", + "sha256": "e05939e8ff4ed77a11522dde249a74841c54970d984e0bb6f77ac64f1fa313b0", + "sha256WithRSAEncryption": "e05939e8ff4ed77a11522dde249a74841c54970d984e0bb6f77ac64f1fa313b0", + "sha384": "3893656e1942b21c17880f752c3950cd281a1431ec5e5d7c10329d281f7839edc8e239416bac6705f814d849a2fc4512", + "sha384WithRSAEncryption": "3893656e1942b21c17880f752c3950cd281a1431ec5e5d7c10329d281f7839edc8e239416bac6705f814d849a2fc4512", + "sha512": "28e62841b7553adf1a3fc1e5e24c0f81df969fd315dbc616a75adde00093472f401aa4840a23afa128b19d345756c74ee4ff2dd79879841258508390233f159c", + "sha512WithRSAEncryption": "28e62841b7553adf1a3fc1e5e24c0f81df969fd315dbc616a75adde00093472f401aa4840a23afa128b19d345756c74ee4ff2dd79879841258508390233f159c", + "shaWithRSAEncryption": "371d30691202f9d31776855ded13e28a8a36e9af", + "ssl2-md5": "c4f37a2c450f2a23322513b372e668a5", + "ssl3-md5": "c4f37a2c450f2a23322513b372e668a5", + "ssl3-sha1": "660edac0a8f4ce33da0d8dbae597650e97687250", + "whirlpool": "8b4523d7e6087f66d5880ac5148d04ebb9385f8fcd3af4cdf45d3f483f2d1903316dfbc654f8dbbf743bb3b87dba1827428f7c6ed2e9eea9f8a3c5f664b0d589" + }, + { + "input": "8D//wAB/8AA//w/gBw/8fgP/8PwPn8A//8//AAD/wADnAf/4", + "DSA": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "DSA-SHA": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "DSA-SHA1": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "DSA-SHA1-old": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "RSA-MD4": "63321fdbb21383e845ff2b30e6a91689", + "RSA-MD5": "cab8f06436c5ad45f982490215836f4e", + "RSA-MDC2": "247ba412552d6ed08363bc63e73d08b1", + "RSA-RIPEMD160": "e09b8578929c27a2004a86e133d34360a583706e", + "RSA-SHA": "c9f49c7f723391913ab0205a6f2b5ab871a850f3", + "RSA-SHA1": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "RSA-SHA1-2": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "RSA-SHA224": "b9b20d5d7d15d2b111c3f0b99e6f86c000fb2b2a1a10b1e13a052b7c", + "RSA-SHA256": "078778fed0e382da5d7dd36f585e1f1aa9b92d4caf20b85c0f6dd346de8d3998", + "RSA-SHA384": "01ea7a7eb085c5f1cedb1fb8ae652acbd318e83d06954cc87d3d1c4af08ab71f227b31781b2c2510e166b936b40a96db", + "RSA-SHA512": "515d0e71faca3297dc1a88774bcf181faa928a4a76481e0adbf0ac2833f6f10c1e55780306c499aa89b4647be727be083ce5f38971e218edbb76d7ee63591bb7", + "dsaEncryption": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "dsaWithSHA": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "dsaWithSHA1": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "dss1": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "ecdsa-with-SHA1": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "md4": "63321fdbb21383e845ff2b30e6a91689", + "md4WithRSAEncryption": "63321fdbb21383e845ff2b30e6a91689", + "md5": "cab8f06436c5ad45f982490215836f4e", + "md5WithRSAEncryption": "cab8f06436c5ad45f982490215836f4e", + "mdc2": "247ba412552d6ed08363bc63e73d08b1", + "mdc2WithRSA": "247ba412552d6ed08363bc63e73d08b1", + "ripemd": "e09b8578929c27a2004a86e133d34360a583706e", + "ripemd160": "e09b8578929c27a2004a86e133d34360a583706e", + "ripemd160WithRSA": "e09b8578929c27a2004a86e133d34360a583706e", + "rmd160": "e09b8578929c27a2004a86e133d34360a583706e", + "sha": "c9f49c7f723391913ab0205a6f2b5ab871a850f3", + "sha1": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "sha1WithRSAEncryption": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "sha224": "b9b20d5d7d15d2b111c3f0b99e6f86c000fb2b2a1a10b1e13a052b7c", + "sha224WithRSAEncryption": "b9b20d5d7d15d2b111c3f0b99e6f86c000fb2b2a1a10b1e13a052b7c", + "sha256": "078778fed0e382da5d7dd36f585e1f1aa9b92d4caf20b85c0f6dd346de8d3998", + "sha256WithRSAEncryption": "078778fed0e382da5d7dd36f585e1f1aa9b92d4caf20b85c0f6dd346de8d3998", + "sha384": "01ea7a7eb085c5f1cedb1fb8ae652acbd318e83d06954cc87d3d1c4af08ab71f227b31781b2c2510e166b936b40a96db", + "sha384WithRSAEncryption": "01ea7a7eb085c5f1cedb1fb8ae652acbd318e83d06954cc87d3d1c4af08ab71f227b31781b2c2510e166b936b40a96db", + "sha512": "515d0e71faca3297dc1a88774bcf181faa928a4a76481e0adbf0ac2833f6f10c1e55780306c499aa89b4647be727be083ce5f38971e218edbb76d7ee63591bb7", + "sha512WithRSAEncryption": "515d0e71faca3297dc1a88774bcf181faa928a4a76481e0adbf0ac2833f6f10c1e55780306c499aa89b4647be727be083ce5f38971e218edbb76d7ee63591bb7", + "shaWithRSAEncryption": "c9f49c7f723391913ab0205a6f2b5ab871a850f3", + "ssl2-md5": "cab8f06436c5ad45f982490215836f4e", + "ssl3-md5": "cab8f06436c5ad45f982490215836f4e", + "ssl3-sha1": "fe0a55a988b3b93946a63eb36b23785a5e6efc3e", + "whirlpool": "b74ca3c5185c129a4a9d9bee472c664775fb6afb6c7bbfa862d101fb516a839ae7fa276560c449f1701bcf2118a3ad6bb06ff99f524beef9bd32dd9d769d7a29" + }, + { + "input": "AAH/gCAAf+AAfgf/+Mf4//AP/gAA4A/gAB//h/8AAfAAf8H//w==", + "DSA": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "DSA-SHA": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "DSA-SHA1": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "DSA-SHA1-old": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "RSA-MD4": "5ad360c53dda52e5091348a59e5d76f5", + "RSA-MD5": "3a43bc720714a2a42a73a76085542f86", + "RSA-MDC2": "9d4c5c0e31af73e6800bd14ecda2529a", + "RSA-RIPEMD160": "8311abae274187e06b2d5bcb79ab9657b8de7928", + "RSA-SHA": "5b8c43786d94380703be99943dcb7804391e3d8b", + "RSA-SHA1": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "RSA-SHA1-2": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "RSA-SHA224": "32c6c30907295bfce00b1921c3900e55e70d2ffa0e10046039541d93", + "RSA-SHA256": "263140810ae46430e19ac1a4a98b6204b63031b282ecb28594bd837268104308", + "RSA-SHA384": "b9dcd27ee66d614f738b56a68efd504f9e30b338812c405cb4579a44a9cf53566b26b600f05726cd95e87e15036e7f99", + "RSA-SHA512": "7113009ad761f953e532a90bd48fa720127539d9b08d1383c09186c23288885c7f841a70ede2485c1d333893347c2f5bf239605b338e57974105427a4235a7b0", + "dsaEncryption": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "dsaWithSHA": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "dsaWithSHA1": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "dss1": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "ecdsa-with-SHA1": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "md4": "5ad360c53dda52e5091348a59e5d76f5", + "md4WithRSAEncryption": "5ad360c53dda52e5091348a59e5d76f5", + "md5": "3a43bc720714a2a42a73a76085542f86", + "md5WithRSAEncryption": "3a43bc720714a2a42a73a76085542f86", + "mdc2": "9d4c5c0e31af73e6800bd14ecda2529a", + "mdc2WithRSA": "9d4c5c0e31af73e6800bd14ecda2529a", + "ripemd": "8311abae274187e06b2d5bcb79ab9657b8de7928", + "ripemd160": "8311abae274187e06b2d5bcb79ab9657b8de7928", + "ripemd160WithRSA": "8311abae274187e06b2d5bcb79ab9657b8de7928", + "rmd160": "8311abae274187e06b2d5bcb79ab9657b8de7928", + "sha": "5b8c43786d94380703be99943dcb7804391e3d8b", + "sha1": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "sha1WithRSAEncryption": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "sha224": "32c6c30907295bfce00b1921c3900e55e70d2ffa0e10046039541d93", + "sha224WithRSAEncryption": "32c6c30907295bfce00b1921c3900e55e70d2ffa0e10046039541d93", + "sha256": "263140810ae46430e19ac1a4a98b6204b63031b282ecb28594bd837268104308", + "sha256WithRSAEncryption": "263140810ae46430e19ac1a4a98b6204b63031b282ecb28594bd837268104308", + "sha384": "b9dcd27ee66d614f738b56a68efd504f9e30b338812c405cb4579a44a9cf53566b26b600f05726cd95e87e15036e7f99", + "sha384WithRSAEncryption": "b9dcd27ee66d614f738b56a68efd504f9e30b338812c405cb4579a44a9cf53566b26b600f05726cd95e87e15036e7f99", + "sha512": "7113009ad761f953e532a90bd48fa720127539d9b08d1383c09186c23288885c7f841a70ede2485c1d333893347c2f5bf239605b338e57974105427a4235a7b0", + "sha512WithRSAEncryption": "7113009ad761f953e532a90bd48fa720127539d9b08d1383c09186c23288885c7f841a70ede2485c1d333893347c2f5bf239605b338e57974105427a4235a7b0", + "shaWithRSAEncryption": "5b8c43786d94380703be99943dcb7804391e3d8b", + "ssl2-md5": "3a43bc720714a2a42a73a76085542f86", + "ssl3-md5": "3a43bc720714a2a42a73a76085542f86", + "ssl3-sha1": "0cbdf2a5781c59f907513147a0de3cc774b54bf3", + "whirlpool": "f675505d8bea33d69d124d2e80571171cde3426a34dc66d3b96f53546cd0c151caa23aea38012ddb63e4bd546bcdfedec5df22f6016ee93d1f99aeffce1bcf0b" + }, + { + "input": "AAB//8AB/n4B//7/8H//z/gH/gAP/8AH//wAPgAH/AB/wAeAD/8=", + "DSA": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "DSA-SHA": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "DSA-SHA1": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "DSA-SHA1-old": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "RSA-MD4": "8ce4760471117752e87c41636b0ea34d", + "RSA-MD5": "03f2f4033b258e6eb1e101f1ed4c24b4", + "RSA-MDC2": "e755476354bdd63c30e3167f70d711c4", + "RSA-RIPEMD160": "335960e48047116b369001869e502fa72bdaa3e5", + "RSA-SHA": "b04d69932f9826200317d5bc2673a8a09622bf90", + "RSA-SHA1": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "RSA-SHA1-2": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "RSA-SHA224": "9aceeccd3a8ae54e0262a8a5728dd7a0436e28313afb5286dd1fe612", + "RSA-SHA256": "ed39f65ea0e6cd8fb39bc5d94a1554dfd0002733e01618161d58a7b7dc8be834", + "RSA-SHA384": "43fad30a9d3ec3c0f01663d151df2015cc858ba6b38a28912251b79137ee5b9c280c52df4681b1dfb6f26c4ca7cdf579", + "RSA-SHA512": "4511276b41b462f8cbf45da6f699d00217a8ee2bb8594c41f33ca39febcf1ab52725c15bad08c6dc1aa5f85e511f218898a574baf7b8e910d6e44158ddfc381d", + "dsaEncryption": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "dsaWithSHA": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "dsaWithSHA1": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "dss1": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "ecdsa-with-SHA1": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "md4": "8ce4760471117752e87c41636b0ea34d", + "md4WithRSAEncryption": "8ce4760471117752e87c41636b0ea34d", + "md5": "03f2f4033b258e6eb1e101f1ed4c24b4", + "md5WithRSAEncryption": "03f2f4033b258e6eb1e101f1ed4c24b4", + "mdc2": "e755476354bdd63c30e3167f70d711c4", + "mdc2WithRSA": "e755476354bdd63c30e3167f70d711c4", + "ripemd": "335960e48047116b369001869e502fa72bdaa3e5", + "ripemd160": "335960e48047116b369001869e502fa72bdaa3e5", + "ripemd160WithRSA": "335960e48047116b369001869e502fa72bdaa3e5", + "rmd160": "335960e48047116b369001869e502fa72bdaa3e5", + "sha": "b04d69932f9826200317d5bc2673a8a09622bf90", + "sha1": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "sha1WithRSAEncryption": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "sha224": "9aceeccd3a8ae54e0262a8a5728dd7a0436e28313afb5286dd1fe612", + "sha224WithRSAEncryption": "9aceeccd3a8ae54e0262a8a5728dd7a0436e28313afb5286dd1fe612", + "sha256": "ed39f65ea0e6cd8fb39bc5d94a1554dfd0002733e01618161d58a7b7dc8be834", + "sha256WithRSAEncryption": "ed39f65ea0e6cd8fb39bc5d94a1554dfd0002733e01618161d58a7b7dc8be834", + "sha384": "43fad30a9d3ec3c0f01663d151df2015cc858ba6b38a28912251b79137ee5b9c280c52df4681b1dfb6f26c4ca7cdf579", + "sha384WithRSAEncryption": "43fad30a9d3ec3c0f01663d151df2015cc858ba6b38a28912251b79137ee5b9c280c52df4681b1dfb6f26c4ca7cdf579", + "sha512": "4511276b41b462f8cbf45da6f699d00217a8ee2bb8594c41f33ca39febcf1ab52725c15bad08c6dc1aa5f85e511f218898a574baf7b8e910d6e44158ddfc381d", + "sha512WithRSAEncryption": "4511276b41b462f8cbf45da6f699d00217a8ee2bb8594c41f33ca39febcf1ab52725c15bad08c6dc1aa5f85e511f218898a574baf7b8e910d6e44158ddfc381d", + "shaWithRSAEncryption": "b04d69932f9826200317d5bc2673a8a09622bf90", + "ssl2-md5": "03f2f4033b258e6eb1e101f1ed4c24b4", + "ssl3-md5": "03f2f4033b258e6eb1e101f1ed4c24b4", + "ssl3-sha1": "663e40fee5a44bfcb1c99ea5935a6b5bc9f583b0", + "whirlpool": "39adfe06ee12f87bc1b7c6fad393a4e0a6bd1e1214c5f815c9618c258b8bb151e313cb4a5353203838f51a055123b7567cd7736897ff3c2d4675e0e86cbf97a3" + }, + { + "input": "//8D/wf4//+AAH/+//4AA//4H/8/+B//AB//D8B/8AH/4AAf/wAA", + "DSA": "00162134256952dd9ae6b51efb159b35c3c138c7", + "DSA-SHA": "00162134256952dd9ae6b51efb159b35c3c138c7", + "DSA-SHA1": "00162134256952dd9ae6b51efb159b35c3c138c7", + "DSA-SHA1-old": "00162134256952dd9ae6b51efb159b35c3c138c7", + "RSA-MD4": "2606d9fd8600b8addf8b126c8d0d1e73", + "RSA-MD5": "2ceb33cec5ecad4a50f6bd3a831ae77c", + "RSA-MDC2": "9cad54842606364770aae6d2e4a86233", + "RSA-RIPEMD160": "2b7b0d23c8ed008e4f6b6e96d0a47ce4bc80c959", + "RSA-SHA": "cde513475313739f6bcd6607dd261d689d39fa8c", + "RSA-SHA1": "00162134256952dd9ae6b51efb159b35c3c138c7", + "RSA-SHA1-2": "00162134256952dd9ae6b51efb159b35c3c138c7", + "RSA-SHA224": "bfc7ba957f6c2f4452aac46fb3d9aec50562396e2a7dd02e675b064e", + "RSA-SHA256": "89830272d1fd54040f9329a39c7f491f15eea851095e0bd2d0bb412baeda7445", + "RSA-SHA384": "f1a62032a76c0e52c6eb444b8cc7d60ee50d220f5b5f0a433ea52da61b8601093797b5cccbb5f68461894cd9779c473a", + "RSA-SHA512": "1eb56e081e4b413df323fb7b9b0b31d9c71e438ea8d80d8d0374c2acfec3825492220e9eecdcbedb48c4017dc28bab48dcd6af5a240a865929641b7cee0e67e9", + "dsaEncryption": "00162134256952dd9ae6b51efb159b35c3c138c7", + "dsaWithSHA": "00162134256952dd9ae6b51efb159b35c3c138c7", + "dsaWithSHA1": "00162134256952dd9ae6b51efb159b35c3c138c7", + "dss1": "00162134256952dd9ae6b51efb159b35c3c138c7", + "ecdsa-with-SHA1": "00162134256952dd9ae6b51efb159b35c3c138c7", + "md4": "2606d9fd8600b8addf8b126c8d0d1e73", + "md4WithRSAEncryption": "2606d9fd8600b8addf8b126c8d0d1e73", + "md5": "2ceb33cec5ecad4a50f6bd3a831ae77c", + "md5WithRSAEncryption": "2ceb33cec5ecad4a50f6bd3a831ae77c", + "mdc2": "9cad54842606364770aae6d2e4a86233", + "mdc2WithRSA": "9cad54842606364770aae6d2e4a86233", + "ripemd": "2b7b0d23c8ed008e4f6b6e96d0a47ce4bc80c959", + "ripemd160": "2b7b0d23c8ed008e4f6b6e96d0a47ce4bc80c959", + "ripemd160WithRSA": "2b7b0d23c8ed008e4f6b6e96d0a47ce4bc80c959", + "rmd160": "2b7b0d23c8ed008e4f6b6e96d0a47ce4bc80c959", + "sha": "cde513475313739f6bcd6607dd261d689d39fa8c", + "sha1": "00162134256952dd9ae6b51efb159b35c3c138c7", + "sha1WithRSAEncryption": "00162134256952dd9ae6b51efb159b35c3c138c7", + "sha224": "bfc7ba957f6c2f4452aac46fb3d9aec50562396e2a7dd02e675b064e", + "sha224WithRSAEncryption": "bfc7ba957f6c2f4452aac46fb3d9aec50562396e2a7dd02e675b064e", + "sha256": "89830272d1fd54040f9329a39c7f491f15eea851095e0bd2d0bb412baeda7445", + "sha256WithRSAEncryption": "89830272d1fd54040f9329a39c7f491f15eea851095e0bd2d0bb412baeda7445", + "sha384": "f1a62032a76c0e52c6eb444b8cc7d60ee50d220f5b5f0a433ea52da61b8601093797b5cccbb5f68461894cd9779c473a", + "sha384WithRSAEncryption": "f1a62032a76c0e52c6eb444b8cc7d60ee50d220f5b5f0a433ea52da61b8601093797b5cccbb5f68461894cd9779c473a", + "sha512": "1eb56e081e4b413df323fb7b9b0b31d9c71e438ea8d80d8d0374c2acfec3825492220e9eecdcbedb48c4017dc28bab48dcd6af5a240a865929641b7cee0e67e9", + "sha512WithRSAEncryption": "1eb56e081e4b413df323fb7b9b0b31d9c71e438ea8d80d8d0374c2acfec3825492220e9eecdcbedb48c4017dc28bab48dcd6af5a240a865929641b7cee0e67e9", + "shaWithRSAEncryption": "cde513475313739f6bcd6607dd261d689d39fa8c", + "ssl2-md5": "2ceb33cec5ecad4a50f6bd3a831ae77c", + "ssl3-md5": "2ceb33cec5ecad4a50f6bd3a831ae77c", + "ssl3-sha1": "00162134256952dd9ae6b51efb159b35c3c138c7", + "whirlpool": "42fd4026bfa5d624f8e0ca73047b1fb78236dc1ae2f321d8b4b8c45ebb36a5eae078e744a5ce9876cc120e418923722d6d1f5b065a67f73fcf11b555de663c05" + }, + { + "input": "//8AAP/8AAMP//AB+AAP4f//A+A/H/+AAHwAAf/AAX/+AA4H/+D//w==", + "DSA": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "DSA-SHA": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "DSA-SHA1": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "DSA-SHA1-old": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "RSA-MD4": "411ab6cf1c2f5497951da1e0eac259de", + "RSA-MD5": "dd808f695d28f93562cfcb164bc3cce4", + "RSA-MDC2": "6d028c0cee1bc0e4170fc6cf77d45b6b", + "RSA-RIPEMD160": "a35ad99104096c19a92ece98bec973c12ffd5f37", + "RSA-SHA": "306d4ae1d4f998d20e3702ab2ea1ac1d15052d49", + "RSA-SHA1": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "RSA-SHA1-2": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "RSA-SHA224": "284ab5f6074548e1acf57da62f3450c81a61a0b36fe2e6edae1de141", + "RSA-SHA256": "c9b63e8ac2e87494f98c9ece5d74f4540090c286166efdaedc6d59a0f623e5f8", + "RSA-SHA384": "1e58486c3bd0053af910d6dbd8bd9b7edd12acf12056df8372ae534407507ffb4ba889ec8660f77d22a3c8e59b49b9de", + "RSA-SHA512": "7f1fd27e9d2aff5bb3b0f5e3e2868b7718f8f27fc4e7e71e71283e1d0563346632bfb36e27710d2129d858db958c34ae51c26cd23cdc5186d9517c9eb5556c17", + "dsaEncryption": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "dsaWithSHA": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "dsaWithSHA1": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "dss1": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "ecdsa-with-SHA1": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "md4": "411ab6cf1c2f5497951da1e0eac259de", + "md4WithRSAEncryption": "411ab6cf1c2f5497951da1e0eac259de", + "md5": "dd808f695d28f93562cfcb164bc3cce4", + "md5WithRSAEncryption": "dd808f695d28f93562cfcb164bc3cce4", + "mdc2": "6d028c0cee1bc0e4170fc6cf77d45b6b", + "mdc2WithRSA": "6d028c0cee1bc0e4170fc6cf77d45b6b", + "ripemd": "a35ad99104096c19a92ece98bec973c12ffd5f37", + "ripemd160": "a35ad99104096c19a92ece98bec973c12ffd5f37", + "ripemd160WithRSA": "a35ad99104096c19a92ece98bec973c12ffd5f37", + "rmd160": "a35ad99104096c19a92ece98bec973c12ffd5f37", + "sha": "306d4ae1d4f998d20e3702ab2ea1ac1d15052d49", + "sha1": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "sha1WithRSAEncryption": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "sha224": "284ab5f6074548e1acf57da62f3450c81a61a0b36fe2e6edae1de141", + "sha224WithRSAEncryption": "284ab5f6074548e1acf57da62f3450c81a61a0b36fe2e6edae1de141", + "sha256": "c9b63e8ac2e87494f98c9ece5d74f4540090c286166efdaedc6d59a0f623e5f8", + "sha256WithRSAEncryption": "c9b63e8ac2e87494f98c9ece5d74f4540090c286166efdaedc6d59a0f623e5f8", + "sha384": "1e58486c3bd0053af910d6dbd8bd9b7edd12acf12056df8372ae534407507ffb4ba889ec8660f77d22a3c8e59b49b9de", + "sha384WithRSAEncryption": "1e58486c3bd0053af910d6dbd8bd9b7edd12acf12056df8372ae534407507ffb4ba889ec8660f77d22a3c8e59b49b9de", + "sha512": "7f1fd27e9d2aff5bb3b0f5e3e2868b7718f8f27fc4e7e71e71283e1d0563346632bfb36e27710d2129d858db958c34ae51c26cd23cdc5186d9517c9eb5556c17", + "sha512WithRSAEncryption": "7f1fd27e9d2aff5bb3b0f5e3e2868b7718f8f27fc4e7e71e71283e1d0563346632bfb36e27710d2129d858db958c34ae51c26cd23cdc5186d9517c9eb5556c17", + "shaWithRSAEncryption": "306d4ae1d4f998d20e3702ab2ea1ac1d15052d49", + "ssl2-md5": "dd808f695d28f93562cfcb164bc3cce4", + "ssl3-md5": "dd808f695d28f93562cfcb164bc3cce4", + "ssl3-sha1": "ceb88e4736e354416e2010fc1061b3b53b81664b", + "whirlpool": "5461d0358c333b80ad97de34372bfa9e900a91b7b0045175b13eeb931ccb3fa9ab199945f0182d662f331483f73a8ebc61ea48e8efcc4bb3b9a77a3bb9644547" + }, + { + "input": "wAA//gP8DAAEAf/h4AP/4DAB/wAAPB4BgAH/AEA//gA//4B8Af+AAH8=", + "DSA": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "DSA-SHA": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "DSA-SHA1": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "DSA-SHA1-old": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "RSA-MD4": "b4f7f72920a85969ba364111878ea21f", + "RSA-MD5": "01c6d7a87e94bf685205ec8d7c5196af", + "RSA-MDC2": "d6758044dfd4c9a26f592daf096f7071", + "RSA-RIPEMD160": "e6e179ca5239e4b4321627b5831add90bd222a62", + "RSA-SHA": "6a147b8fd8222fdcc63cd8e076cf071f990416f0", + "RSA-SHA1": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "RSA-SHA1-2": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "RSA-SHA224": "f117692dbfb6705bb7c596d2c6b573c455067fa52c20379513c0b9b7", + "RSA-SHA256": "509e6b7dacb70bfa62f3964eba990b9c576fd2485c1040fefc8eab5f07269f4d", + "RSA-SHA384": "7ad3873eba02c33dee71a0a5335c0da4b328500017a6d25b3eebdca45482fd8687d2a24f2f3a14f2721d3547274dc2e7", + "RSA-SHA512": "152802b0fcc383bf8e9df9ac1ede5bac84475aceb03a3599e70e1588e7b4b2c0b06fd3d299e72c284bf0d8d8d9f6cf80c8eab409567f9b97554c3d9475573977", + "dsaEncryption": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "dsaWithSHA": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "dsaWithSHA1": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "dss1": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "ecdsa-with-SHA1": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "md4": "b4f7f72920a85969ba364111878ea21f", + "md4WithRSAEncryption": "b4f7f72920a85969ba364111878ea21f", + "md5": "01c6d7a87e94bf685205ec8d7c5196af", + "md5WithRSAEncryption": "01c6d7a87e94bf685205ec8d7c5196af", + "mdc2": "d6758044dfd4c9a26f592daf096f7071", + "mdc2WithRSA": "d6758044dfd4c9a26f592daf096f7071", + "ripemd": "e6e179ca5239e4b4321627b5831add90bd222a62", + "ripemd160": "e6e179ca5239e4b4321627b5831add90bd222a62", + "ripemd160WithRSA": "e6e179ca5239e4b4321627b5831add90bd222a62", + "rmd160": "e6e179ca5239e4b4321627b5831add90bd222a62", + "sha": "6a147b8fd8222fdcc63cd8e076cf071f990416f0", + "sha1": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "sha1WithRSAEncryption": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "sha224": "f117692dbfb6705bb7c596d2c6b573c455067fa52c20379513c0b9b7", + "sha224WithRSAEncryption": "f117692dbfb6705bb7c596d2c6b573c455067fa52c20379513c0b9b7", + "sha256": "509e6b7dacb70bfa62f3964eba990b9c576fd2485c1040fefc8eab5f07269f4d", + "sha256WithRSAEncryption": "509e6b7dacb70bfa62f3964eba990b9c576fd2485c1040fefc8eab5f07269f4d", + "sha384": "7ad3873eba02c33dee71a0a5335c0da4b328500017a6d25b3eebdca45482fd8687d2a24f2f3a14f2721d3547274dc2e7", + "sha384WithRSAEncryption": "7ad3873eba02c33dee71a0a5335c0da4b328500017a6d25b3eebdca45482fd8687d2a24f2f3a14f2721d3547274dc2e7", + "sha512": "152802b0fcc383bf8e9df9ac1ede5bac84475aceb03a3599e70e1588e7b4b2c0b06fd3d299e72c284bf0d8d8d9f6cf80c8eab409567f9b97554c3d9475573977", + "sha512WithRSAEncryption": "152802b0fcc383bf8e9df9ac1ede5bac84475aceb03a3599e70e1588e7b4b2c0b06fd3d299e72c284bf0d8d8d9f6cf80c8eab409567f9b97554c3d9475573977", + "shaWithRSAEncryption": "6a147b8fd8222fdcc63cd8e076cf071f990416f0", + "ssl2-md5": "01c6d7a87e94bf685205ec8d7c5196af", + "ssl3-md5": "01c6d7a87e94bf685205ec8d7c5196af", + "ssl3-sha1": "a6a2c4b6bcc41ddc67278f3df4d8d0b9dd7784ef", + "whirlpool": "5559d00d9bb3123609fcb20b653ecf1bcad01cab748324b04c5c8e7be742f17033a2d478f811b2fb07b9c52d8bf7734a13f0c7bcbbd78d2e724c0ee5675eb328" + }, + { + "input": "P6AAD/+B/8AP8H/4AA/AAH/gAeAABP8AH/4AAf+AB//+AD//wAP/gAA/", + "DSA": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "DSA-SHA": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "DSA-SHA1": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "DSA-SHA1-old": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "RSA-MD4": "b242293b0460fc0c76f53f5c1cbcfc7f", + "RSA-MD5": "ef0e93e8928f8bae1b216da8e661fc9b", + "RSA-MDC2": "03a845894389466cfb52e2547578ccfc", + "RSA-RIPEMD160": "1fc8dfe540c03fd0fcf174ffb823561b3d3e9cee", + "RSA-SHA": "67f756689cffcf9c2adb4086b758c36011e5ba48", + "RSA-SHA1": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "RSA-SHA1-2": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "RSA-SHA224": "e13c64dc6d3b313d6fd72d2debe30b886031569fdc4ba3ee51775189", + "RSA-SHA256": "8bb7546f64ce1cab770407de791ab25f7bfbac3e071810310ee674c2824e59ac", + "RSA-SHA384": "8804834cd00d6a72562fe06665f773724a532fc592beb4c1d53397b2ec9c62005518633a47dde8d354aa8f88f6dcd350", + "RSA-SHA512": "0483e42546dcdd8c225a87308a3b42b4a74a1d0d0c1d5771debea9465483bc04ca267c9203fbcc5ec668ac1de37e77ecc880a78e79f2a618b877f39d42161fa2", + "dsaEncryption": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "dsaWithSHA": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "dsaWithSHA1": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "dss1": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "ecdsa-with-SHA1": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "md4": "b242293b0460fc0c76f53f5c1cbcfc7f", + "md4WithRSAEncryption": "b242293b0460fc0c76f53f5c1cbcfc7f", + "md5": "ef0e93e8928f8bae1b216da8e661fc9b", + "md5WithRSAEncryption": "ef0e93e8928f8bae1b216da8e661fc9b", + "mdc2": "03a845894389466cfb52e2547578ccfc", + "mdc2WithRSA": "03a845894389466cfb52e2547578ccfc", + "ripemd": "1fc8dfe540c03fd0fcf174ffb823561b3d3e9cee", + "ripemd160": "1fc8dfe540c03fd0fcf174ffb823561b3d3e9cee", + "ripemd160WithRSA": "1fc8dfe540c03fd0fcf174ffb823561b3d3e9cee", + "rmd160": "1fc8dfe540c03fd0fcf174ffb823561b3d3e9cee", + "sha": "67f756689cffcf9c2adb4086b758c36011e5ba48", + "sha1": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "sha1WithRSAEncryption": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "sha224": "e13c64dc6d3b313d6fd72d2debe30b886031569fdc4ba3ee51775189", + "sha224WithRSAEncryption": "e13c64dc6d3b313d6fd72d2debe30b886031569fdc4ba3ee51775189", + "sha256": "8bb7546f64ce1cab770407de791ab25f7bfbac3e071810310ee674c2824e59ac", + "sha256WithRSAEncryption": "8bb7546f64ce1cab770407de791ab25f7bfbac3e071810310ee674c2824e59ac", + "sha384": "8804834cd00d6a72562fe06665f773724a532fc592beb4c1d53397b2ec9c62005518633a47dde8d354aa8f88f6dcd350", + "sha384WithRSAEncryption": "8804834cd00d6a72562fe06665f773724a532fc592beb4c1d53397b2ec9c62005518633a47dde8d354aa8f88f6dcd350", + "sha512": "0483e42546dcdd8c225a87308a3b42b4a74a1d0d0c1d5771debea9465483bc04ca267c9203fbcc5ec668ac1de37e77ecc880a78e79f2a618b877f39d42161fa2", + "sha512WithRSAEncryption": "0483e42546dcdd8c225a87308a3b42b4a74a1d0d0c1d5771debea9465483bc04ca267c9203fbcc5ec668ac1de37e77ecc880a78e79f2a618b877f39d42161fa2", + "shaWithRSAEncryption": "67f756689cffcf9c2adb4086b758c36011e5ba48", + "ssl2-md5": "ef0e93e8928f8bae1b216da8e661fc9b", + "ssl3-md5": "ef0e93e8928f8bae1b216da8e661fc9b", + "ssl3-sha1": "c23d083cd8820b57800a869f5f261d45e02dc55d", + "whirlpool": "5c7de0ff9c5b999a4f8f09fa40f64ee484a10d4fbb424477cf9bb8b031a8767fd551cfba9e4e696e07d6dbe69c219d44f73df1b4cc1a8628505e8c50ac1e6182" + }, + { + "input": "8B//Af+A/8CAB/AAA/+AABgB//wA//wD//8Af8AD/8f/wAPw/4AAP/4AAA==", + "DSA": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "DSA-SHA": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "DSA-SHA1": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "DSA-SHA1-old": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "RSA-MD4": "b434544fb31d15c812a6e9054dc98f20", + "RSA-MD5": "c8da55117d7d4b7ee8ddc8dc4ba73aa6", + "RSA-MDC2": "4f7bcedbb455634ff3ff6d86597cd6ff", + "RSA-RIPEMD160": "3445a846455284bdb9f5e4d37bb56f67737eabf5", + "RSA-SHA": "8b9a37d9d0bd0531b90c5d7769aa19ade36e9b03", + "RSA-SHA1": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "RSA-SHA1-2": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "RSA-SHA224": "2e55bebe1a0768be92ccb1bf19715228bf007fe752c3b64ef6e3105d", + "RSA-SHA256": "ac5bf3cad821e7ad8b2ed7bbfbaaa5e7abb30606afd8ed5d6a18a0d0eba343d3", + "RSA-SHA384": "20621239e199ac6e251508c81d35b04a95765e6fb3599f43b041d54b05ead2d475401f72160e66f3d141d314ff2d7dfe", + "RSA-SHA512": "be54942c8080777f4e33c0688c587d4178714357d67f0e285411a931d32fff84944d86c7d0a776034f3a5214e1471022e68fa2082c4c28110792c5d15fa5d998", + "dsaEncryption": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "dsaWithSHA": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "dsaWithSHA1": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "dss1": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "ecdsa-with-SHA1": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "md4": "b434544fb31d15c812a6e9054dc98f20", + "md4WithRSAEncryption": "b434544fb31d15c812a6e9054dc98f20", + "md5": "c8da55117d7d4b7ee8ddc8dc4ba73aa6", + "md5WithRSAEncryption": "c8da55117d7d4b7ee8ddc8dc4ba73aa6", + "mdc2": "4f7bcedbb455634ff3ff6d86597cd6ff", + "mdc2WithRSA": "4f7bcedbb455634ff3ff6d86597cd6ff", + "ripemd": "3445a846455284bdb9f5e4d37bb56f67737eabf5", + "ripemd160": "3445a846455284bdb9f5e4d37bb56f67737eabf5", + "ripemd160WithRSA": "3445a846455284bdb9f5e4d37bb56f67737eabf5", + "rmd160": "3445a846455284bdb9f5e4d37bb56f67737eabf5", + "sha": "8b9a37d9d0bd0531b90c5d7769aa19ade36e9b03", + "sha1": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "sha1WithRSAEncryption": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "sha224": "2e55bebe1a0768be92ccb1bf19715228bf007fe752c3b64ef6e3105d", + "sha224WithRSAEncryption": "2e55bebe1a0768be92ccb1bf19715228bf007fe752c3b64ef6e3105d", + "sha256": "ac5bf3cad821e7ad8b2ed7bbfbaaa5e7abb30606afd8ed5d6a18a0d0eba343d3", + "sha256WithRSAEncryption": "ac5bf3cad821e7ad8b2ed7bbfbaaa5e7abb30606afd8ed5d6a18a0d0eba343d3", + "sha384": "20621239e199ac6e251508c81d35b04a95765e6fb3599f43b041d54b05ead2d475401f72160e66f3d141d314ff2d7dfe", + "sha384WithRSAEncryption": "20621239e199ac6e251508c81d35b04a95765e6fb3599f43b041d54b05ead2d475401f72160e66f3d141d314ff2d7dfe", + "sha512": "be54942c8080777f4e33c0688c587d4178714357d67f0e285411a931d32fff84944d86c7d0a776034f3a5214e1471022e68fa2082c4c28110792c5d15fa5d998", + "sha512WithRSAEncryption": "be54942c8080777f4e33c0688c587d4178714357d67f0e285411a931d32fff84944d86c7d0a776034f3a5214e1471022e68fa2082c4c28110792c5d15fa5d998", + "shaWithRSAEncryption": "8b9a37d9d0bd0531b90c5d7769aa19ade36e9b03", + "ssl2-md5": "c8da55117d7d4b7ee8ddc8dc4ba73aa6", + "ssl3-md5": "c8da55117d7d4b7ee8ddc8dc4ba73aa6", + "ssl3-sha1": "e8ac31927b78ddec41a31ca7a44eb7177165e7ab", + "whirlpool": "6bc314e4db88fa3c8f923320f24a8c459a58bd669e6474f580c8a638436303b43e838bf5248edf2979c9d3bc0762a597944728eef3bb908e05f90b5da181f5e9" + }, + { + "input": "B/G//+AAeAAH4ACAA/A/9wAAOAD+APgP/gAAgD//wf/8AP//j/AAH//wD/8=", + "DSA": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "DSA-SHA": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "DSA-SHA1": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "DSA-SHA1-old": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "RSA-MD4": "713d489c36a2ec53e7e5cb4af3b9a09d", + "RSA-MD5": "bbfc64583c6d4c2ef4b0358464d4d028", + "RSA-MDC2": "b6b0041f6e193bfbfc19c4553d83759a", + "RSA-RIPEMD160": "974c96fe4fc1f87b6569fd80b1775d080b97a846", + "RSA-SHA": "566a4a030d4f1521807a488af917cf7f1a746cc1", + "RSA-SHA1": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "RSA-SHA1-2": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "RSA-SHA224": "6d25a9ec7a2b6e5109de8bc8c8493a548ca7b3225f5251cada60bfaa", + "RSA-SHA256": "f7995f433d17bee25f44c918de82eb147b3bfef24045ff8fb17ffedf559e06b7", + "RSA-SHA384": "eb99b466448ea1dab0d57fe1ecc7f06e9c0186e7714e9ff40408bc9a0ddb68405bb748c9d9a7dc37dca4b012bc60f877", + "RSA-SHA512": "a0e78554a722cca6d512903028d8aa121cd77df3e0779cd0941ade5cbc6080d7e69d0a78e266c7e30505397fa06e7c5b58addcefe12be21fdc8c29075dd3e85c", + "dsaEncryption": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "dsaWithSHA": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "dsaWithSHA1": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "dss1": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "ecdsa-with-SHA1": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "md4": "713d489c36a2ec53e7e5cb4af3b9a09d", + "md4WithRSAEncryption": "713d489c36a2ec53e7e5cb4af3b9a09d", + "md5": "bbfc64583c6d4c2ef4b0358464d4d028", + "md5WithRSAEncryption": "bbfc64583c6d4c2ef4b0358464d4d028", + "mdc2": "b6b0041f6e193bfbfc19c4553d83759a", + "mdc2WithRSA": "b6b0041f6e193bfbfc19c4553d83759a", + "ripemd": "974c96fe4fc1f87b6569fd80b1775d080b97a846", + "ripemd160": "974c96fe4fc1f87b6569fd80b1775d080b97a846", + "ripemd160WithRSA": "974c96fe4fc1f87b6569fd80b1775d080b97a846", + "rmd160": "974c96fe4fc1f87b6569fd80b1775d080b97a846", + "sha": "566a4a030d4f1521807a488af917cf7f1a746cc1", + "sha1": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "sha1WithRSAEncryption": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "sha224": "6d25a9ec7a2b6e5109de8bc8c8493a548ca7b3225f5251cada60bfaa", + "sha224WithRSAEncryption": "6d25a9ec7a2b6e5109de8bc8c8493a548ca7b3225f5251cada60bfaa", + "sha256": "f7995f433d17bee25f44c918de82eb147b3bfef24045ff8fb17ffedf559e06b7", + "sha256WithRSAEncryption": "f7995f433d17bee25f44c918de82eb147b3bfef24045ff8fb17ffedf559e06b7", + "sha384": "eb99b466448ea1dab0d57fe1ecc7f06e9c0186e7714e9ff40408bc9a0ddb68405bb748c9d9a7dc37dca4b012bc60f877", + "sha384WithRSAEncryption": "eb99b466448ea1dab0d57fe1ecc7f06e9c0186e7714e9ff40408bc9a0ddb68405bb748c9d9a7dc37dca4b012bc60f877", + "sha512": "a0e78554a722cca6d512903028d8aa121cd77df3e0779cd0941ade5cbc6080d7e69d0a78e266c7e30505397fa06e7c5b58addcefe12be21fdc8c29075dd3e85c", + "sha512WithRSAEncryption": "a0e78554a722cca6d512903028d8aa121cd77df3e0779cd0941ade5cbc6080d7e69d0a78e266c7e30505397fa06e7c5b58addcefe12be21fdc8c29075dd3e85c", + "shaWithRSAEncryption": "566a4a030d4f1521807a488af917cf7f1a746cc1", + "ssl2-md5": "bbfc64583c6d4c2ef4b0358464d4d028", + "ssl3-md5": "bbfc64583c6d4c2ef4b0358464d4d028", + "ssl3-sha1": "e864ec5dbab0f9ff6984ab6ad43a8c9b81cc9f9c", + "whirlpool": "29159b483e6dcf789ad10f8b987e97f77b87a25c0568ccbad296a2a9e7a0d0aa6fab2b16d29e6e3f4c3a4b41a92150ccaf0383bc0cc42ffd46a2337179f4224c" + }, + { + "input": "ABwAB//8AF4//wAAPP//wD//geBwAB/8AAP/AAB//8AfjA//8P+AB+AQAf//", + "DSA": "cfed6269069417a84d6de2347220f4b858bcd530", + "DSA-SHA": "cfed6269069417a84d6de2347220f4b858bcd530", + "DSA-SHA1": "cfed6269069417a84d6de2347220f4b858bcd530", + "DSA-SHA1-old": "cfed6269069417a84d6de2347220f4b858bcd530", + "RSA-MD4": "5c42e24437efcffd5406bc89c5b82aa0", + "RSA-MD5": "3bb5864481f2e66387419dd1a168aadc", + "RSA-MDC2": "c6de7db6f61e67313a0bc57bd7abfbfa", + "RSA-RIPEMD160": "523ad1f31d1f05b7ab9e325100f4724cfb0b8bee", + "RSA-SHA": "76bc5714d21939afaaaa4426a0308665f7714507", + "RSA-SHA1": "cfed6269069417a84d6de2347220f4b858bcd530", + "RSA-SHA1-2": "cfed6269069417a84d6de2347220f4b858bcd530", + "RSA-SHA224": "9837a1f4ec3839168846c831ea67d236324d690a5cdc015717399b35", + "RSA-SHA256": "2c465ddc53e88894a2279e30b9e6feb064c66b15dcf5a38722f5c92d65a84bab", + "RSA-SHA384": "9115154861977a5037522e48500a0f2c1c06b7e686ff256d8b3e60cd3e061f112c0667745d48e3b7c71e22a068799737", + "RSA-SHA512": "cb370c694eac9caa723acc2f76a91db5f2b25a2d4d420cb36ab7cb39a82e63e474073c84de3789d4342383f85acc4444c0e971c47a4224751a39b5a5aa110eaf", + "dsaEncryption": "cfed6269069417a84d6de2347220f4b858bcd530", + "dsaWithSHA": "cfed6269069417a84d6de2347220f4b858bcd530", + "dsaWithSHA1": "cfed6269069417a84d6de2347220f4b858bcd530", + "dss1": "cfed6269069417a84d6de2347220f4b858bcd530", + "ecdsa-with-SHA1": "cfed6269069417a84d6de2347220f4b858bcd530", + "md4": "5c42e24437efcffd5406bc89c5b82aa0", + "md4WithRSAEncryption": "5c42e24437efcffd5406bc89c5b82aa0", + "md5": "3bb5864481f2e66387419dd1a168aadc", + "md5WithRSAEncryption": "3bb5864481f2e66387419dd1a168aadc", + "mdc2": "c6de7db6f61e67313a0bc57bd7abfbfa", + "mdc2WithRSA": "c6de7db6f61e67313a0bc57bd7abfbfa", + "ripemd": "523ad1f31d1f05b7ab9e325100f4724cfb0b8bee", + "ripemd160": "523ad1f31d1f05b7ab9e325100f4724cfb0b8bee", + "ripemd160WithRSA": "523ad1f31d1f05b7ab9e325100f4724cfb0b8bee", + "rmd160": "523ad1f31d1f05b7ab9e325100f4724cfb0b8bee", + "sha": "76bc5714d21939afaaaa4426a0308665f7714507", + "sha1": "cfed6269069417a84d6de2347220f4b858bcd530", + "sha1WithRSAEncryption": "cfed6269069417a84d6de2347220f4b858bcd530", + "sha224": "9837a1f4ec3839168846c831ea67d236324d690a5cdc015717399b35", + "sha224WithRSAEncryption": "9837a1f4ec3839168846c831ea67d236324d690a5cdc015717399b35", + "sha256": "2c465ddc53e88894a2279e30b9e6feb064c66b15dcf5a38722f5c92d65a84bab", + "sha256WithRSAEncryption": "2c465ddc53e88894a2279e30b9e6feb064c66b15dcf5a38722f5c92d65a84bab", + "sha384": "9115154861977a5037522e48500a0f2c1c06b7e686ff256d8b3e60cd3e061f112c0667745d48e3b7c71e22a068799737", + "sha384WithRSAEncryption": "9115154861977a5037522e48500a0f2c1c06b7e686ff256d8b3e60cd3e061f112c0667745d48e3b7c71e22a068799737", + "sha512": "cb370c694eac9caa723acc2f76a91db5f2b25a2d4d420cb36ab7cb39a82e63e474073c84de3789d4342383f85acc4444c0e971c47a4224751a39b5a5aa110eaf", + "sha512WithRSAEncryption": "cb370c694eac9caa723acc2f76a91db5f2b25a2d4d420cb36ab7cb39a82e63e474073c84de3789d4342383f85acc4444c0e971c47a4224751a39b5a5aa110eaf", + "shaWithRSAEncryption": "76bc5714d21939afaaaa4426a0308665f7714507", + "ssl2-md5": "3bb5864481f2e66387419dd1a168aadc", + "ssl3-md5": "3bb5864481f2e66387419dd1a168aadc", + "ssl3-sha1": "cfed6269069417a84d6de2347220f4b858bcd530", + "whirlpool": "614147a0939ba02b31c06cbee6ab0baebb7c3579bdb70970f5b6730a7d11f30e2cdde19173859498f050e4fa98885f7d4877b5d372d1df24da4e38189d5ddc41" + }, + { + "input": "wAAH/4B//4ABgD//z8D+AP/AH/wB//gA//4P//AGAADAP/+AeP/8AA//8AAP/w==", + "DSA": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "DSA-SHA": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "DSA-SHA1": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "DSA-SHA1-old": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "RSA-MD4": "f0485af8f735a5c94e7e001d06210720", + "RSA-MD5": "0d725d3a1d3d97d7b5ea8293bbbf32ba", + "RSA-MDC2": "5588486752845dd18cb5cf1445461897", + "RSA-RIPEMD160": "0effbcc6b9b139147aab04a6bd20714ae3c083e2", + "RSA-SHA": "229d3ecb95d0be7aee5b50dc0148d12759ca0932", + "RSA-SHA1": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "RSA-SHA1-2": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "RSA-SHA224": "d2dced3f0af5bf576f1d7b0394c2727565e39c90de529e69fbc813e1", + "RSA-SHA256": "b0ced82dc52c4f9b1dec098a80a23a4a711f3a8c9c3684f0761b0e8a29ba560a", + "RSA-SHA384": "30b69da62b0af120e461b7b827abdc92154cd7568363c0c94d24f03f4e55e76b4e7eac436c31697512d347a4b72d3abe", + "RSA-SHA512": "b1be6bc2581e06b40dd711119535f92f5a1f7b4b5752b519203859f3c15817c91b44a2c99949f22f026c2d34463e794ad556bc59593814289c5651a61613847d", + "dsaEncryption": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "dsaWithSHA": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "dsaWithSHA1": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "dss1": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "ecdsa-with-SHA1": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "md4": "f0485af8f735a5c94e7e001d06210720", + "md4WithRSAEncryption": "f0485af8f735a5c94e7e001d06210720", + "md5": "0d725d3a1d3d97d7b5ea8293bbbf32ba", + "md5WithRSAEncryption": "0d725d3a1d3d97d7b5ea8293bbbf32ba", + "mdc2": "5588486752845dd18cb5cf1445461897", + "mdc2WithRSA": "5588486752845dd18cb5cf1445461897", + "ripemd": "0effbcc6b9b139147aab04a6bd20714ae3c083e2", + "ripemd160": "0effbcc6b9b139147aab04a6bd20714ae3c083e2", + "ripemd160WithRSA": "0effbcc6b9b139147aab04a6bd20714ae3c083e2", + "rmd160": "0effbcc6b9b139147aab04a6bd20714ae3c083e2", + "sha": "229d3ecb95d0be7aee5b50dc0148d12759ca0932", + "sha1": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "sha1WithRSAEncryption": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "sha224": "d2dced3f0af5bf576f1d7b0394c2727565e39c90de529e69fbc813e1", + "sha224WithRSAEncryption": "d2dced3f0af5bf576f1d7b0394c2727565e39c90de529e69fbc813e1", + "sha256": "b0ced82dc52c4f9b1dec098a80a23a4a711f3a8c9c3684f0761b0e8a29ba560a", + "sha256WithRSAEncryption": "b0ced82dc52c4f9b1dec098a80a23a4a711f3a8c9c3684f0761b0e8a29ba560a", + "sha384": "30b69da62b0af120e461b7b827abdc92154cd7568363c0c94d24f03f4e55e76b4e7eac436c31697512d347a4b72d3abe", + "sha384WithRSAEncryption": "30b69da62b0af120e461b7b827abdc92154cd7568363c0c94d24f03f4e55e76b4e7eac436c31697512d347a4b72d3abe", + "sha512": "b1be6bc2581e06b40dd711119535f92f5a1f7b4b5752b519203859f3c15817c91b44a2c99949f22f026c2d34463e794ad556bc59593814289c5651a61613847d", + "sha512WithRSAEncryption": "b1be6bc2581e06b40dd711119535f92f5a1f7b4b5752b519203859f3c15817c91b44a2c99949f22f026c2d34463e794ad556bc59593814289c5651a61613847d", + "shaWithRSAEncryption": "229d3ecb95d0be7aee5b50dc0148d12759ca0932", + "ssl2-md5": "0d725d3a1d3d97d7b5ea8293bbbf32ba", + "ssl3-md5": "0d725d3a1d3d97d7b5ea8293bbbf32ba", + "ssl3-sha1": "d9217bfb46c96348722c3783d29d4b1a3feda38c", + "whirlpool": "ee6135d957b324cb10b73564a44c8a66d6dfb67a5abfe60ba73e470a9b1f27559bf567c6e0b0f45a760522987fc668806d441afe81bff537e4b77d7ef44891bb" + }, + { + "input": "/+AH//gAf/Af/4AB//gf+AED/+AAA+B4D/8AD/wf+AAP/+AfAAf//AAfA//3//8=", + "DSA": "dec24e5554f79697218d317315fa986229ce3350", + "DSA-SHA": "dec24e5554f79697218d317315fa986229ce3350", + "DSA-SHA1": "dec24e5554f79697218d317315fa986229ce3350", + "DSA-SHA1-old": "dec24e5554f79697218d317315fa986229ce3350", + "RSA-MD4": "de028feab66bca025dc9996b35bd6030", + "RSA-MD5": "915eb22a15f7673f983672b6c353b6c8", + "RSA-MDC2": "917669574ca879f2454f6fb7a750108f", + "RSA-RIPEMD160": "b1ed395efe6d7ab5fa6601382e2761235353efef", + "RSA-SHA": "a3d0722ed6ac1c1605a5440d07b1014728f242b7", + "RSA-SHA1": "dec24e5554f79697218d317315fa986229ce3350", + "RSA-SHA1-2": "dec24e5554f79697218d317315fa986229ce3350", + "RSA-SHA224": "f7efbd83d2006d973aee86c7216c659ece1337279fe5dfccc2488de6", + "RSA-SHA256": "f8dce75572495bc241288c07246acf7a157d462a9c01d1491618f073e57f47e2", + "RSA-SHA384": "5a141d9111b80d154332907a96181361c37d224f33bc78b43a3653271e03568b2536a0088282bbc5e88318010174f702", + "RSA-SHA512": "688c2c2e28b3eef624ad1f6d47e13d9a73f9a59b5de509a6f56d2c2575fa80919d51fd9e5832ebc3ef680b7e3573c88e1f95cbca73afbfe4f2004a7887e710e0", + "dsaEncryption": "dec24e5554f79697218d317315fa986229ce3350", + "dsaWithSHA": "dec24e5554f79697218d317315fa986229ce3350", + "dsaWithSHA1": "dec24e5554f79697218d317315fa986229ce3350", + "dss1": "dec24e5554f79697218d317315fa986229ce3350", + "ecdsa-with-SHA1": "dec24e5554f79697218d317315fa986229ce3350", + "md4": "de028feab66bca025dc9996b35bd6030", + "md4WithRSAEncryption": "de028feab66bca025dc9996b35bd6030", + "md5": "915eb22a15f7673f983672b6c353b6c8", + "md5WithRSAEncryption": "915eb22a15f7673f983672b6c353b6c8", + "mdc2": "917669574ca879f2454f6fb7a750108f", + "mdc2WithRSA": "917669574ca879f2454f6fb7a750108f", + "ripemd": "b1ed395efe6d7ab5fa6601382e2761235353efef", + "ripemd160": "b1ed395efe6d7ab5fa6601382e2761235353efef", + "ripemd160WithRSA": "b1ed395efe6d7ab5fa6601382e2761235353efef", + "rmd160": "b1ed395efe6d7ab5fa6601382e2761235353efef", + "sha": "a3d0722ed6ac1c1605a5440d07b1014728f242b7", + "sha1": "dec24e5554f79697218d317315fa986229ce3350", + "sha1WithRSAEncryption": "dec24e5554f79697218d317315fa986229ce3350", + "sha224": "f7efbd83d2006d973aee86c7216c659ece1337279fe5dfccc2488de6", + "sha224WithRSAEncryption": "f7efbd83d2006d973aee86c7216c659ece1337279fe5dfccc2488de6", + "sha256": "f8dce75572495bc241288c07246acf7a157d462a9c01d1491618f073e57f47e2", + "sha256WithRSAEncryption": "f8dce75572495bc241288c07246acf7a157d462a9c01d1491618f073e57f47e2", + "sha384": "5a141d9111b80d154332907a96181361c37d224f33bc78b43a3653271e03568b2536a0088282bbc5e88318010174f702", + "sha384WithRSAEncryption": "5a141d9111b80d154332907a96181361c37d224f33bc78b43a3653271e03568b2536a0088282bbc5e88318010174f702", + "sha512": "688c2c2e28b3eef624ad1f6d47e13d9a73f9a59b5de509a6f56d2c2575fa80919d51fd9e5832ebc3ef680b7e3573c88e1f95cbca73afbfe4f2004a7887e710e0", + "sha512WithRSAEncryption": "688c2c2e28b3eef624ad1f6d47e13d9a73f9a59b5de509a6f56d2c2575fa80919d51fd9e5832ebc3ef680b7e3573c88e1f95cbca73afbfe4f2004a7887e710e0", + "shaWithRSAEncryption": "a3d0722ed6ac1c1605a5440d07b1014728f242b7", + "ssl2-md5": "915eb22a15f7673f983672b6c353b6c8", + "ssl3-md5": "915eb22a15f7673f983672b6c353b6c8", + "ssl3-sha1": "dec24e5554f79697218d317315fa986229ce3350", + "whirlpool": "d53970e94fac8419fcd8463bff58253f2ee6f7f9175977d9fd7ff7c735b582eff88b009eedf2f936829021fda9f0c300cc843489f9ff749d3c6e2a104736de71" + }, + { + "input": "wPgAA/4AP//wAAP8D/+AAOP/+D/+AABz4P/8B//D//4DAABwAAP/+A//4AAf//gA", + "DSA": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "DSA-SHA": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "DSA-SHA1": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "DSA-SHA1-old": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "RSA-MD4": "306a941663a185bd3482a37cf0d86568", + "RSA-MD5": "13b51da3e8a1422bfd58b79c4e19de64", + "RSA-MDC2": "21047acb0d86cb869859664cac98d108", + "RSA-RIPEMD160": "24728a16a52263b0616a8ab603d7c6ec0cba5691", + "RSA-SHA": "3cba9d5585b357445922e48d2bb1a420f08ecc80", + "RSA-SHA1": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "RSA-SHA1-2": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "RSA-SHA224": "4ec77dbcbf0669631f3172260c1471d481568b2cdd6af5e61137ede2", + "RSA-SHA256": "46d89d780f178334d19e02c41d5af2e265e2190896dce94822b99c19adc3ff6f", + "RSA-SHA384": "147769479a780330d2ac69f5809ce6e186708a88409575719b3199e824907160f963899466cdd5ce52ad2b1cf1c3caa9", + "RSA-SHA512": "1bed6b7e19942b514d17b1c5a112a23f923e458a01bb58a6291664353df37f734accd54477c68311a86e7f1dcd98df4f1fd05271d2880203932ce7cfddff71fa", + "dsaEncryption": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "dsaWithSHA": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "dsaWithSHA1": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "dss1": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "ecdsa-with-SHA1": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "md4": "306a941663a185bd3482a37cf0d86568", + "md4WithRSAEncryption": "306a941663a185bd3482a37cf0d86568", + "md5": "13b51da3e8a1422bfd58b79c4e19de64", + "md5WithRSAEncryption": "13b51da3e8a1422bfd58b79c4e19de64", + "mdc2": "21047acb0d86cb869859664cac98d108", + "mdc2WithRSA": "21047acb0d86cb869859664cac98d108", + "ripemd": "24728a16a52263b0616a8ab603d7c6ec0cba5691", + "ripemd160": "24728a16a52263b0616a8ab603d7c6ec0cba5691", + "ripemd160WithRSA": "24728a16a52263b0616a8ab603d7c6ec0cba5691", + "rmd160": "24728a16a52263b0616a8ab603d7c6ec0cba5691", + "sha": "3cba9d5585b357445922e48d2bb1a420f08ecc80", + "sha1": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "sha1WithRSAEncryption": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "sha224": "4ec77dbcbf0669631f3172260c1471d481568b2cdd6af5e61137ede2", + "sha224WithRSAEncryption": "4ec77dbcbf0669631f3172260c1471d481568b2cdd6af5e61137ede2", + "sha256": "46d89d780f178334d19e02c41d5af2e265e2190896dce94822b99c19adc3ff6f", + "sha256WithRSAEncryption": "46d89d780f178334d19e02c41d5af2e265e2190896dce94822b99c19adc3ff6f", + "sha384": "147769479a780330d2ac69f5809ce6e186708a88409575719b3199e824907160f963899466cdd5ce52ad2b1cf1c3caa9", + "sha384WithRSAEncryption": "147769479a780330d2ac69f5809ce6e186708a88409575719b3199e824907160f963899466cdd5ce52ad2b1cf1c3caa9", + "sha512": "1bed6b7e19942b514d17b1c5a112a23f923e458a01bb58a6291664353df37f734accd54477c68311a86e7f1dcd98df4f1fd05271d2880203932ce7cfddff71fa", + "sha512WithRSAEncryption": "1bed6b7e19942b514d17b1c5a112a23f923e458a01bb58a6291664353df37f734accd54477c68311a86e7f1dcd98df4f1fd05271d2880203932ce7cfddff71fa", + "shaWithRSAEncryption": "3cba9d5585b357445922e48d2bb1a420f08ecc80", + "ssl2-md5": "13b51da3e8a1422bfd58b79c4e19de64", + "ssl3-md5": "13b51da3e8a1422bfd58b79c4e19de64", + "ssl3-sha1": "83a099df7071437ba5495a5b0bfbfefe1c0ef7f3", + "whirlpool": "7fd471d6e22521a579ed72261365db54039bb0d18fdc672d3d8bb895632dc04393603f2cdbf7c225ad2050e1b678d16570cc34665e7b29eb1ab3c33bb844438e" + }, + { + "input": "//APx//8AD/+AAA//4A/gAA//8AAcAH/wYAD//+AAGH//gP9gD//4AHB//+AAA/+AA==", + "DSA": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "DSA-SHA": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "DSA-SHA1": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "DSA-SHA1-old": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "RSA-MD4": "d63a1d45416e9bc2dd98a3f768e0d54e", + "RSA-MD5": "e69d6c03102464f22c395f9fa27108de", + "RSA-MDC2": "da22a29bc9432f956dc29c65dbc376a8", + "RSA-RIPEMD160": "0b18eb58350d3957f2ca38bed26729169bbbeed8", + "RSA-SHA": "ab21532477066ad3548d278de9edf1f5c17a3150", + "RSA-SHA1": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "RSA-SHA1-2": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "RSA-SHA224": "ce38ac38319dda989edc725269f421ba2ddbd26795214dd5d3aeb080", + "RSA-SHA256": "968954bafff8e2a118d3aedffc6283b30efddbac0af2245195c2a32a665a5d54", + "RSA-SHA384": "ba265d256884a9c993e2fd91333e945b3f7c000580f3bd66eb25679688f4ea48a2ca6dff1733c88dcf883e1cc7ec3618", + "RSA-SHA512": "3d8a970a249b71233b9a25f7109d5a99f62c4bcb11c47bc72d26dd46ad853ff682b8e1abb7053b4401461681a86d6f22bca4ce9420cab97c77f601f2463de7af", + "dsaEncryption": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "dsaWithSHA": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "dsaWithSHA1": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "dss1": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "ecdsa-with-SHA1": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "md4": "d63a1d45416e9bc2dd98a3f768e0d54e", + "md4WithRSAEncryption": "d63a1d45416e9bc2dd98a3f768e0d54e", + "md5": "e69d6c03102464f22c395f9fa27108de", + "md5WithRSAEncryption": "e69d6c03102464f22c395f9fa27108de", + "mdc2": "da22a29bc9432f956dc29c65dbc376a8", + "mdc2WithRSA": "da22a29bc9432f956dc29c65dbc376a8", + "ripemd": "0b18eb58350d3957f2ca38bed26729169bbbeed8", + "ripemd160": "0b18eb58350d3957f2ca38bed26729169bbbeed8", + "ripemd160WithRSA": "0b18eb58350d3957f2ca38bed26729169bbbeed8", + "rmd160": "0b18eb58350d3957f2ca38bed26729169bbbeed8", + "sha": "ab21532477066ad3548d278de9edf1f5c17a3150", + "sha1": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "sha1WithRSAEncryption": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "sha224": "ce38ac38319dda989edc725269f421ba2ddbd26795214dd5d3aeb080", + "sha224WithRSAEncryption": "ce38ac38319dda989edc725269f421ba2ddbd26795214dd5d3aeb080", + "sha256": "968954bafff8e2a118d3aedffc6283b30efddbac0af2245195c2a32a665a5d54", + "sha256WithRSAEncryption": "968954bafff8e2a118d3aedffc6283b30efddbac0af2245195c2a32a665a5d54", + "sha384": "ba265d256884a9c993e2fd91333e945b3f7c000580f3bd66eb25679688f4ea48a2ca6dff1733c88dcf883e1cc7ec3618", + "sha384WithRSAEncryption": "ba265d256884a9c993e2fd91333e945b3f7c000580f3bd66eb25679688f4ea48a2ca6dff1733c88dcf883e1cc7ec3618", + "sha512": "3d8a970a249b71233b9a25f7109d5a99f62c4bcb11c47bc72d26dd46ad853ff682b8e1abb7053b4401461681a86d6f22bca4ce9420cab97c77f601f2463de7af", + "sha512WithRSAEncryption": "3d8a970a249b71233b9a25f7109d5a99f62c4bcb11c47bc72d26dd46ad853ff682b8e1abb7053b4401461681a86d6f22bca4ce9420cab97c77f601f2463de7af", + "shaWithRSAEncryption": "ab21532477066ad3548d278de9edf1f5c17a3150", + "ssl2-md5": "e69d6c03102464f22c395f9fa27108de", + "ssl3-md5": "e69d6c03102464f22c395f9fa27108de", + "ssl3-sha1": "aa3198e30891a83e33ce3bfa0587d86a197d4f80", + "whirlpool": "8804b40b22369a7c19c9d939d922a277b08fe02f413b4128f49e2fa26d8ff70682b85ba3b81b84798c8182639dbc8b6dec96046c3118dffe2c0480e5e94f5362" + }, + { + "input": "//wAA//wD/gAB9+P//gAAf/+AIAA/4Af8AABHAAAP/gAP//v//4Bw4CAAf//wAAH//8=", + "DSA": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "DSA-SHA": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "DSA-SHA1": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "DSA-SHA1-old": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "RSA-MD4": "1fc86868e1bd9332c786acff7e798aca", + "RSA-MD5": "132fa4cbedaa7bd965b0b5900211be48", + "RSA-MDC2": "f263caa22e6eea99d7355ae78738801f", + "RSA-RIPEMD160": "c76b4437ff109a4fde3cd3ce6cc5306e8cb5fc4c", + "RSA-SHA": "b63b8fd589118e7d7837e28147a76674692e30f0", + "RSA-SHA1": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "RSA-SHA1-2": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "RSA-SHA224": "75e0d9316456c0229b8fda801e5cc052e5cd14d945d11e95b01a7098", + "RSA-SHA256": "33f78a8a6adc466fed41020fa799aa537cc1c1bb4e938c06a1baec97f7b3c26c", + "RSA-SHA384": "88f7b78dfb4c9ffedea5c00a25722fe7c2bb559a7065c2a097a7d51548ce7937fa2360b16fa915b1d29393cf99fb2fdc", + "RSA-SHA512": "c618b2550d72c4ba8940c0c38f69d385f1439fd99a5f4b811a3939fdfeaff80490576f1557dc0ec354a2788ecc84220f56dc59ce8b3089312ea180a0d5d26d92", + "dsaEncryption": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "dsaWithSHA": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "dsaWithSHA1": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "dss1": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "ecdsa-with-SHA1": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "md4": "1fc86868e1bd9332c786acff7e798aca", + "md4WithRSAEncryption": "1fc86868e1bd9332c786acff7e798aca", + "md5": "132fa4cbedaa7bd965b0b5900211be48", + "md5WithRSAEncryption": "132fa4cbedaa7bd965b0b5900211be48", + "mdc2": "f263caa22e6eea99d7355ae78738801f", + "mdc2WithRSA": "f263caa22e6eea99d7355ae78738801f", + "ripemd": "c76b4437ff109a4fde3cd3ce6cc5306e8cb5fc4c", + "ripemd160": "c76b4437ff109a4fde3cd3ce6cc5306e8cb5fc4c", + "ripemd160WithRSA": "c76b4437ff109a4fde3cd3ce6cc5306e8cb5fc4c", + "rmd160": "c76b4437ff109a4fde3cd3ce6cc5306e8cb5fc4c", + "sha": "b63b8fd589118e7d7837e28147a76674692e30f0", + "sha1": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "sha1WithRSAEncryption": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "sha224": "75e0d9316456c0229b8fda801e5cc052e5cd14d945d11e95b01a7098", + "sha224WithRSAEncryption": "75e0d9316456c0229b8fda801e5cc052e5cd14d945d11e95b01a7098", + "sha256": "33f78a8a6adc466fed41020fa799aa537cc1c1bb4e938c06a1baec97f7b3c26c", + "sha256WithRSAEncryption": "33f78a8a6adc466fed41020fa799aa537cc1c1bb4e938c06a1baec97f7b3c26c", + "sha384": "88f7b78dfb4c9ffedea5c00a25722fe7c2bb559a7065c2a097a7d51548ce7937fa2360b16fa915b1d29393cf99fb2fdc", + "sha384WithRSAEncryption": "88f7b78dfb4c9ffedea5c00a25722fe7c2bb559a7065c2a097a7d51548ce7937fa2360b16fa915b1d29393cf99fb2fdc", + "sha512": "c618b2550d72c4ba8940c0c38f69d385f1439fd99a5f4b811a3939fdfeaff80490576f1557dc0ec354a2788ecc84220f56dc59ce8b3089312ea180a0d5d26d92", + "sha512WithRSAEncryption": "c618b2550d72c4ba8940c0c38f69d385f1439fd99a5f4b811a3939fdfeaff80490576f1557dc0ec354a2788ecc84220f56dc59ce8b3089312ea180a0d5d26d92", + "shaWithRSAEncryption": "b63b8fd589118e7d7837e28147a76674692e30f0", + "ssl2-md5": "132fa4cbedaa7bd965b0b5900211be48", + "ssl3-md5": "132fa4cbedaa7bd965b0b5900211be48", + "ssl3-sha1": "9b6acbeb4989cbee7015c7d515a75672ffde3442", + "whirlpool": "0d84d05eae2f05329353233049086f1a90f8c0d4eded775a09128b850c2e6d989814ff80ec9491165f45e3b931a1c187c772b331124c96e3016a3e0dd0c96617" + }, + { + "input": "///AAf/B//+H//8APwAAH/wAAf+AH8Af/wAA/4Af//h/+D//wf//4AHAP/f//vwAAD//", + "DSA": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "DSA-SHA": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "DSA-SHA1": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "DSA-SHA1-old": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "RSA-MD4": "6b91b9f582fef43c0fa18698c08832a3", + "RSA-MD5": "e37ff5d9f14249f327a19dd5296e6c7e", + "RSA-MDC2": "51329f27074e4fc3a7b13a1729e1bbd7", + "RSA-RIPEMD160": "07c4b5f0bee272fafa23386adda0a394d1c2a647", + "RSA-SHA": "9063a2d6f269c4fcde986c0f4c0890dddabc540b", + "RSA-SHA1": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "RSA-SHA1-2": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "RSA-SHA224": "efba845d974ccfde660112bbeb3b5e62de51778c2bb17f91f01bd54e", + "RSA-SHA256": "5f7f49d1c307363de95d450b558275f8d5a6780ee47246268e6729f7733e535a", + "RSA-SHA384": "4ed47f6aebb617c1780d595798d70f48648a974388e694bb5f466fcd2be9f33b4e9c3e276f3ebd6311eeffbb47a13aec", + "RSA-SHA512": "6b8de48cc9108209f15be365ade22d3d2172aa2c742b255500153e5d8016af0ba64b403368fe3be84c39d9e1cb366d96bbccd0ebc91ba26baed8618c2d7afe51", + "dsaEncryption": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "dsaWithSHA": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "dsaWithSHA1": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "dss1": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "ecdsa-with-SHA1": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "md4": "6b91b9f582fef43c0fa18698c08832a3", + "md4WithRSAEncryption": "6b91b9f582fef43c0fa18698c08832a3", + "md5": "e37ff5d9f14249f327a19dd5296e6c7e", + "md5WithRSAEncryption": "e37ff5d9f14249f327a19dd5296e6c7e", + "mdc2": "51329f27074e4fc3a7b13a1729e1bbd7", + "mdc2WithRSA": "51329f27074e4fc3a7b13a1729e1bbd7", + "ripemd": "07c4b5f0bee272fafa23386adda0a394d1c2a647", + "ripemd160": "07c4b5f0bee272fafa23386adda0a394d1c2a647", + "ripemd160WithRSA": "07c4b5f0bee272fafa23386adda0a394d1c2a647", + "rmd160": "07c4b5f0bee272fafa23386adda0a394d1c2a647", + "sha": "9063a2d6f269c4fcde986c0f4c0890dddabc540b", + "sha1": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "sha1WithRSAEncryption": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "sha224": "efba845d974ccfde660112bbeb3b5e62de51778c2bb17f91f01bd54e", + "sha224WithRSAEncryption": "efba845d974ccfde660112bbeb3b5e62de51778c2bb17f91f01bd54e", + "sha256": "5f7f49d1c307363de95d450b558275f8d5a6780ee47246268e6729f7733e535a", + "sha256WithRSAEncryption": "5f7f49d1c307363de95d450b558275f8d5a6780ee47246268e6729f7733e535a", + "sha384": "4ed47f6aebb617c1780d595798d70f48648a974388e694bb5f466fcd2be9f33b4e9c3e276f3ebd6311eeffbb47a13aec", + "sha384WithRSAEncryption": "4ed47f6aebb617c1780d595798d70f48648a974388e694bb5f466fcd2be9f33b4e9c3e276f3ebd6311eeffbb47a13aec", + "sha512": "6b8de48cc9108209f15be365ade22d3d2172aa2c742b255500153e5d8016af0ba64b403368fe3be84c39d9e1cb366d96bbccd0ebc91ba26baed8618c2d7afe51", + "sha512WithRSAEncryption": "6b8de48cc9108209f15be365ade22d3d2172aa2c742b255500153e5d8016af0ba64b403368fe3be84c39d9e1cb366d96bbccd0ebc91ba26baed8618c2d7afe51", + "shaWithRSAEncryption": "9063a2d6f269c4fcde986c0f4c0890dddabc540b", + "ssl2-md5": "e37ff5d9f14249f327a19dd5296e6c7e", + "ssl3-md5": "e37ff5d9f14249f327a19dd5296e6c7e", + "ssl3-sha1": "b021eb08a436b02658eaa7ba3c88d49f1219c035", + "whirlpool": "670d7a10b52f22ffb2d50dba696c4469dfb210cb5c4ac9ae84631597cbbd725c3ca89c5ff51096e847a0b91d920c1af2b89483a7c707d05fa3c66c24b911d938" + }, + { + "input": "AP+B/+AD+A4AAP/4H//+AAD/gAAH//gB/+AAD/AB/gA/8H/gAH//4B///AH/4AGAAAf//w==", + "DSA": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "DSA-SHA": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "DSA-SHA1": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "DSA-SHA1-old": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "RSA-MD4": "44ef779db3903ddb1c2f38819b533722", + "RSA-MD5": "4881a65cf107b1d034ff3ecd64ab9cb4", + "RSA-MDC2": "fcce8f0b15c34e9cd38b60672fc44c3d", + "RSA-RIPEMD160": "268aa5b65d2b6807a2722666bd72df0ae48186c9", + "RSA-SHA": "655ea421fd49e9ab3715036690e4b4c879a27fdf", + "RSA-SHA1": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "RSA-SHA1-2": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "RSA-SHA224": "f36328dc33fe910741b8653998e3e921c8ff748812d499b14e020cec", + "RSA-SHA256": "9f126c6e07ed2744cef5de1f468b2ed1c51a13ec3c8351935b9656458a3dc40f", + "RSA-SHA384": "4f5d4dc54ffbf3dd96f0bfb94fa1a7ba8bc94135933be290008a232e3dd7d5d7c5cf198f7348e8406ea5ddf41465920c", + "RSA-SHA512": "2fab3a562074e25cc68d89fd2e4fb2dff240c734391d244eb87e59f256318ebbb77ba1dd7de7a981ba43beefc37411c98e8e523ec3d4995a71cd4718c96a2dfc", + "dsaEncryption": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "dsaWithSHA": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "dsaWithSHA1": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "dss1": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "ecdsa-with-SHA1": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "md4": "44ef779db3903ddb1c2f38819b533722", + "md4WithRSAEncryption": "44ef779db3903ddb1c2f38819b533722", + "md5": "4881a65cf107b1d034ff3ecd64ab9cb4", + "md5WithRSAEncryption": "4881a65cf107b1d034ff3ecd64ab9cb4", + "mdc2": "fcce8f0b15c34e9cd38b60672fc44c3d", + "mdc2WithRSA": "fcce8f0b15c34e9cd38b60672fc44c3d", + "ripemd": "268aa5b65d2b6807a2722666bd72df0ae48186c9", + "ripemd160": "268aa5b65d2b6807a2722666bd72df0ae48186c9", + "ripemd160WithRSA": "268aa5b65d2b6807a2722666bd72df0ae48186c9", + "rmd160": "268aa5b65d2b6807a2722666bd72df0ae48186c9", + "sha": "655ea421fd49e9ab3715036690e4b4c879a27fdf", + "sha1": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "sha1WithRSAEncryption": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "sha224": "f36328dc33fe910741b8653998e3e921c8ff748812d499b14e020cec", + "sha224WithRSAEncryption": "f36328dc33fe910741b8653998e3e921c8ff748812d499b14e020cec", + "sha256": "9f126c6e07ed2744cef5de1f468b2ed1c51a13ec3c8351935b9656458a3dc40f", + "sha256WithRSAEncryption": "9f126c6e07ed2744cef5de1f468b2ed1c51a13ec3c8351935b9656458a3dc40f", + "sha384": "4f5d4dc54ffbf3dd96f0bfb94fa1a7ba8bc94135933be290008a232e3dd7d5d7c5cf198f7348e8406ea5ddf41465920c", + "sha384WithRSAEncryption": "4f5d4dc54ffbf3dd96f0bfb94fa1a7ba8bc94135933be290008a232e3dd7d5d7c5cf198f7348e8406ea5ddf41465920c", + "sha512": "2fab3a562074e25cc68d89fd2e4fb2dff240c734391d244eb87e59f256318ebbb77ba1dd7de7a981ba43beefc37411c98e8e523ec3d4995a71cd4718c96a2dfc", + "sha512WithRSAEncryption": "2fab3a562074e25cc68d89fd2e4fb2dff240c734391d244eb87e59f256318ebbb77ba1dd7de7a981ba43beefc37411c98e8e523ec3d4995a71cd4718c96a2dfc", + "shaWithRSAEncryption": "655ea421fd49e9ab3715036690e4b4c879a27fdf", + "ssl2-md5": "4881a65cf107b1d034ff3ecd64ab9cb4", + "ssl3-md5": "4881a65cf107b1d034ff3ecd64ab9cb4", + "ssl3-sha1": "cae36dab8aea29f62e0855d9cb3cd8e7d39094b1", + "whirlpool": "335ac5b2ea90395271b3d6438142429e2e4c07a36f9a506675d2a8ef167db700f63525b01563119eba76be7b626eb47679ddaeda75c958d281277d0151dcffa5" + }, + { + "input": "AA//8AAA4A/4AAD//4AD/+H//z/4D//H4AAf/wA//g//8AMAwAAf//w//+A///gf8AAf/8A=", + "DSA": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "DSA-SHA": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "DSA-SHA1": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "DSA-SHA1-old": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "RSA-MD4": "4762a395499ddd1e729a3bd1208517ae", + "RSA-MD5": "547e92d01c0b699cfdf43f91714cfe2d", + "RSA-MDC2": "c402e4c555fbe1a00c9adf716e0fb517", + "RSA-RIPEMD160": "3c748cdb3476c7ff1f4d88cf7f6568c77725b740", + "RSA-SHA": "aa1a578a65d05a55d33ffffac48c68edffd9b520", + "RSA-SHA1": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "RSA-SHA1-2": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "RSA-SHA224": "e86e0d8898c6ddd95842fdf9def5d6072786172ddc7dc52ae8d527da", + "RSA-SHA256": "b8e3d23621cb02bcae060bdf5b6b7db1f024651f98ec63766c20b7883bc033d2", + "RSA-SHA384": "de73f6dab881150f4747f0149e717e0e0c0b6b001d6abdb2b03536bc1a924b7afc272dbe706f80fd4b34415804b383e0", + "RSA-SHA512": "95fcadd861b5b2cfd5a7af2696018a9f06090f40b1b1f5a27da12d6463aaf93461222d748412ae3ffed6a2dba87e5cd11acb0195d42e955c86a00ca87fc4c693", + "dsaEncryption": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "dsaWithSHA": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "dsaWithSHA1": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "dss1": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "ecdsa-with-SHA1": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "md4": "4762a395499ddd1e729a3bd1208517ae", + "md4WithRSAEncryption": "4762a395499ddd1e729a3bd1208517ae", + "md5": "547e92d01c0b699cfdf43f91714cfe2d", + "md5WithRSAEncryption": "547e92d01c0b699cfdf43f91714cfe2d", + "mdc2": "c402e4c555fbe1a00c9adf716e0fb517", + "mdc2WithRSA": "c402e4c555fbe1a00c9adf716e0fb517", + "ripemd": "3c748cdb3476c7ff1f4d88cf7f6568c77725b740", + "ripemd160": "3c748cdb3476c7ff1f4d88cf7f6568c77725b740", + "ripemd160WithRSA": "3c748cdb3476c7ff1f4d88cf7f6568c77725b740", + "rmd160": "3c748cdb3476c7ff1f4d88cf7f6568c77725b740", + "sha": "aa1a578a65d05a55d33ffffac48c68edffd9b520", + "sha1": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "sha1WithRSAEncryption": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "sha224": "e86e0d8898c6ddd95842fdf9def5d6072786172ddc7dc52ae8d527da", + "sha224WithRSAEncryption": "e86e0d8898c6ddd95842fdf9def5d6072786172ddc7dc52ae8d527da", + "sha256": "b8e3d23621cb02bcae060bdf5b6b7db1f024651f98ec63766c20b7883bc033d2", + "sha256WithRSAEncryption": "b8e3d23621cb02bcae060bdf5b6b7db1f024651f98ec63766c20b7883bc033d2", + "sha384": "de73f6dab881150f4747f0149e717e0e0c0b6b001d6abdb2b03536bc1a924b7afc272dbe706f80fd4b34415804b383e0", + "sha384WithRSAEncryption": "de73f6dab881150f4747f0149e717e0e0c0b6b001d6abdb2b03536bc1a924b7afc272dbe706f80fd4b34415804b383e0", + "sha512": "95fcadd861b5b2cfd5a7af2696018a9f06090f40b1b1f5a27da12d6463aaf93461222d748412ae3ffed6a2dba87e5cd11acb0195d42e955c86a00ca87fc4c693", + "sha512WithRSAEncryption": "95fcadd861b5b2cfd5a7af2696018a9f06090f40b1b1f5a27da12d6463aaf93461222d748412ae3ffed6a2dba87e5cd11acb0195d42e955c86a00ca87fc4c693", + "shaWithRSAEncryption": "aa1a578a65d05a55d33ffffac48c68edffd9b520", + "ssl2-md5": "547e92d01c0b699cfdf43f91714cfe2d", + "ssl3-md5": "547e92d01c0b699cfdf43f91714cfe2d", + "ssl3-sha1": "02de8ba699f3c1b0cb5ad89a01f2346e630459d7", + "whirlpool": "182dec14b9dd0ee66280bd625704c42f0f4dbaebf2d17ac0f3a7bc3406eea09b06f9150c9421bcc567d97bb214dbae3a5a9f3fdbdb119a6f7686730f763d7e59" + }, + { + "input": "AYAAHwH//4MAAfwAf+AOf/4AADgA/wAAP/+Dg//AAH//gB//8B///AADf/+BwAAH/4P//wAA", + "DSA": "88021458847dd39b4495368f7254941859fad44b", + "DSA-SHA": "88021458847dd39b4495368f7254941859fad44b", + "DSA-SHA1": "88021458847dd39b4495368f7254941859fad44b", + "DSA-SHA1-old": "88021458847dd39b4495368f7254941859fad44b", + "RSA-MD4": "72d73f94bb5323d86d798936f6a40cf9", + "RSA-MD5": "aa2b3a055b56845f19109f21d3c783f4", + "RSA-MDC2": "63c5170472df4188fac595ec595597a3", + "RSA-RIPEMD160": "4dca6e1616513df40e39c509bc66c90a83878a39", + "RSA-SHA": "70c90e9d4ce54d224d213e7564da8226aca87e4b", + "RSA-SHA1": "88021458847dd39b4495368f7254941859fad44b", + "RSA-SHA1-2": "88021458847dd39b4495368f7254941859fad44b", + "RSA-SHA224": "c64db67666ef33a901fbd0090eb74f068570b4602529eed11dcac13c", + "RSA-SHA256": "689c608602d5e5d37a0285eeb5006d97addd7c2b8e006770fad588eff621c971", + "RSA-SHA384": "a3b430fbd7c2c03db652708d22a41a2657bc76caf3305105d75a87aa58de8be90ac435fc68a91315c53d51b0e09f9118", + "RSA-SHA512": "159fd2f979439b91980e9e00cfd86c1f72ab02d7bcc9ca9766cae9448dc4d8d229004936b43fdb066449b5ffa2faf327cac122cb93a8880ed2ee64906954615d", + "dsaEncryption": "88021458847dd39b4495368f7254941859fad44b", + "dsaWithSHA": "88021458847dd39b4495368f7254941859fad44b", + "dsaWithSHA1": "88021458847dd39b4495368f7254941859fad44b", + "dss1": "88021458847dd39b4495368f7254941859fad44b", + "ecdsa-with-SHA1": "88021458847dd39b4495368f7254941859fad44b", + "md4": "72d73f94bb5323d86d798936f6a40cf9", + "md4WithRSAEncryption": "72d73f94bb5323d86d798936f6a40cf9", + "md5": "aa2b3a055b56845f19109f21d3c783f4", + "md5WithRSAEncryption": "aa2b3a055b56845f19109f21d3c783f4", + "mdc2": "63c5170472df4188fac595ec595597a3", + "mdc2WithRSA": "63c5170472df4188fac595ec595597a3", + "ripemd": "4dca6e1616513df40e39c509bc66c90a83878a39", + "ripemd160": "4dca6e1616513df40e39c509bc66c90a83878a39", + "ripemd160WithRSA": "4dca6e1616513df40e39c509bc66c90a83878a39", + "rmd160": "4dca6e1616513df40e39c509bc66c90a83878a39", + "sha": "70c90e9d4ce54d224d213e7564da8226aca87e4b", + "sha1": "88021458847dd39b4495368f7254941859fad44b", + "sha1WithRSAEncryption": "88021458847dd39b4495368f7254941859fad44b", + "sha224": "c64db67666ef33a901fbd0090eb74f068570b4602529eed11dcac13c", + "sha224WithRSAEncryption": "c64db67666ef33a901fbd0090eb74f068570b4602529eed11dcac13c", + "sha256": "689c608602d5e5d37a0285eeb5006d97addd7c2b8e006770fad588eff621c971", + "sha256WithRSAEncryption": "689c608602d5e5d37a0285eeb5006d97addd7c2b8e006770fad588eff621c971", + "sha384": "a3b430fbd7c2c03db652708d22a41a2657bc76caf3305105d75a87aa58de8be90ac435fc68a91315c53d51b0e09f9118", + "sha384WithRSAEncryption": "a3b430fbd7c2c03db652708d22a41a2657bc76caf3305105d75a87aa58de8be90ac435fc68a91315c53d51b0e09f9118", + "sha512": "159fd2f979439b91980e9e00cfd86c1f72ab02d7bcc9ca9766cae9448dc4d8d229004936b43fdb066449b5ffa2faf327cac122cb93a8880ed2ee64906954615d", + "sha512WithRSAEncryption": "159fd2f979439b91980e9e00cfd86c1f72ab02d7bcc9ca9766cae9448dc4d8d229004936b43fdb066449b5ffa2faf327cac122cb93a8880ed2ee64906954615d", + "shaWithRSAEncryption": "70c90e9d4ce54d224d213e7564da8226aca87e4b", + "ssl2-md5": "aa2b3a055b56845f19109f21d3c783f4", + "ssl3-md5": "aa2b3a055b56845f19109f21d3c783f4", + "ssl3-sha1": "88021458847dd39b4495368f7254941859fad44b", + "whirlpool": "5b39bb9ed9e330edd1a18520a305b1df0f792f52af68b85f1aa0d142b4f8ef28c7c05ccd67fb0c0488e3251da7c106d81919381f999a7e081211ee36eba845be" + }, + { + "input": "/4AN/+AD//AA//wA8AH4B//4D4AP//8A//+H/+H//GeMf/4AA/8//AcB///gAAH//8AMQA///w==", + "DSA": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "DSA-SHA": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "DSA-SHA1": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "DSA-SHA1-old": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "RSA-MD4": "e4b8c40a3cbe7c3782c621cde1998635", + "RSA-MD5": "eb1f01cc647ece73b2192537200bb8b9", + "RSA-MDC2": "2794af516ba61627969de1a1eedf877c", + "RSA-RIPEMD160": "51a906da584e7ef0976c103f1df9df47bd615b52", + "RSA-SHA": "991c3e25840ccd2c6c37d04dcebcbc2b0bb3d113", + "RSA-SHA1": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "RSA-SHA1-2": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "RSA-SHA224": "d539062c3b6147b95aacf748b50ee7817c711234cf83dfb95437ae62", + "RSA-SHA256": "17c6f0073c4f92d5eedda57ca2506aa6002695c6b7bf12e4dbf4dd1a7fbceb08", + "RSA-SHA384": "c6f93370caea221f74d2a3cddc9744be99c77b7b420d709b0bdc140d462beaa954f86c1b74e12f0cc75abb01c303542c", + "RSA-SHA512": "e4e68d6dd664a69d5b05e1d2d110a047c34a26417d74aaf26c6e5fb9501a2bf05787dc615c91bfaa224ffd295c80a8694553639f4e82dbd61417e62c269a750e", + "dsaEncryption": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "dsaWithSHA": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "dsaWithSHA1": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "dss1": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "ecdsa-with-SHA1": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "md4": "e4b8c40a3cbe7c3782c621cde1998635", + "md4WithRSAEncryption": "e4b8c40a3cbe7c3782c621cde1998635", + "md5": "eb1f01cc647ece73b2192537200bb8b9", + "md5WithRSAEncryption": "eb1f01cc647ece73b2192537200bb8b9", + "mdc2": "2794af516ba61627969de1a1eedf877c", + "mdc2WithRSA": "2794af516ba61627969de1a1eedf877c", + "ripemd": "51a906da584e7ef0976c103f1df9df47bd615b52", + "ripemd160": "51a906da584e7ef0976c103f1df9df47bd615b52", + "ripemd160WithRSA": "51a906da584e7ef0976c103f1df9df47bd615b52", + "rmd160": "51a906da584e7ef0976c103f1df9df47bd615b52", + "sha": "991c3e25840ccd2c6c37d04dcebcbc2b0bb3d113", + "sha1": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "sha1WithRSAEncryption": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "sha224": "d539062c3b6147b95aacf748b50ee7817c711234cf83dfb95437ae62", + "sha224WithRSAEncryption": "d539062c3b6147b95aacf748b50ee7817c711234cf83dfb95437ae62", + "sha256": "17c6f0073c4f92d5eedda57ca2506aa6002695c6b7bf12e4dbf4dd1a7fbceb08", + "sha256WithRSAEncryption": "17c6f0073c4f92d5eedda57ca2506aa6002695c6b7bf12e4dbf4dd1a7fbceb08", + "sha384": "c6f93370caea221f74d2a3cddc9744be99c77b7b420d709b0bdc140d462beaa954f86c1b74e12f0cc75abb01c303542c", + "sha384WithRSAEncryption": "c6f93370caea221f74d2a3cddc9744be99c77b7b420d709b0bdc140d462beaa954f86c1b74e12f0cc75abb01c303542c", + "sha512": "e4e68d6dd664a69d5b05e1d2d110a047c34a26417d74aaf26c6e5fb9501a2bf05787dc615c91bfaa224ffd295c80a8694553639f4e82dbd61417e62c269a750e", + "sha512WithRSAEncryption": "e4e68d6dd664a69d5b05e1d2d110a047c34a26417d74aaf26c6e5fb9501a2bf05787dc615c91bfaa224ffd295c80a8694553639f4e82dbd61417e62c269a750e", + "shaWithRSAEncryption": "991c3e25840ccd2c6c37d04dcebcbc2b0bb3d113", + "ssl2-md5": "eb1f01cc647ece73b2192537200bb8b9", + "ssl3-md5": "eb1f01cc647ece73b2192537200bb8b9", + "ssl3-sha1": "91a165295c666fe85c2adbc5a10329daf0cb81a0", + "whirlpool": "1b952786f0a57d2288863e20c019260786fd529a1f3e3bce7309a267181056f00b2639e690dcf9d42193ef59e9e8e975a94676bd56e72240ea96772e439e07ea" + }, + { + "input": "AAAf//4AHwAAH///B///wAf/4AACAAD/AHgAAOAACAAf//8AA/gfAAAP/8AAAf//4fgAAD+AD/8=", + "DSA": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "DSA-SHA": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "DSA-SHA1": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "DSA-SHA1-old": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "RSA-MD4": "815d1d3c5fa25f7917698dc56f00ca72", + "RSA-MD5": "1db274ef41b1ad71f713df2b05207e1a", + "RSA-MDC2": "3d8fefb077bd4f6e033656c985c21467", + "RSA-RIPEMD160": "ba57313d4502e3874ea153d7883c98eac645d318", + "RSA-SHA": "6eae2aa1e98a42c0f4e1162e263d09ea0b1d1bc6", + "RSA-SHA1": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "RSA-SHA1-2": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "RSA-SHA224": "a2344200c4633bfa72b776e5a269959aa7f6256900eaf6db033df016", + "RSA-SHA256": "504472bf96d0a3da1098dacacac48886d1ab92929187de95c7f42eab9907801d", + "RSA-SHA384": "06538369656a39f45a5911de3e59a4bb983aa49fef7fef726eecaa824552c32b2bb0ee18868f4f5408b731ab2d14c753", + "RSA-SHA512": "765e9cd6478a6da8c8887a5b76c30a277fd5de87a34fe401286163fc0ae773835f8fe4e81650a6a7a7d32ce43af44774989f29e5295f7d0d1642bc72f5797131", + "dsaEncryption": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "dsaWithSHA": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "dsaWithSHA1": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "dss1": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "ecdsa-with-SHA1": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "md4": "815d1d3c5fa25f7917698dc56f00ca72", + "md4WithRSAEncryption": "815d1d3c5fa25f7917698dc56f00ca72", + "md5": "1db274ef41b1ad71f713df2b05207e1a", + "md5WithRSAEncryption": "1db274ef41b1ad71f713df2b05207e1a", + "mdc2": "3d8fefb077bd4f6e033656c985c21467", + "mdc2WithRSA": "3d8fefb077bd4f6e033656c985c21467", + "ripemd": "ba57313d4502e3874ea153d7883c98eac645d318", + "ripemd160": "ba57313d4502e3874ea153d7883c98eac645d318", + "ripemd160WithRSA": "ba57313d4502e3874ea153d7883c98eac645d318", + "rmd160": "ba57313d4502e3874ea153d7883c98eac645d318", + "sha": "6eae2aa1e98a42c0f4e1162e263d09ea0b1d1bc6", + "sha1": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "sha1WithRSAEncryption": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "sha224": "a2344200c4633bfa72b776e5a269959aa7f6256900eaf6db033df016", + "sha224WithRSAEncryption": "a2344200c4633bfa72b776e5a269959aa7f6256900eaf6db033df016", + "sha256": "504472bf96d0a3da1098dacacac48886d1ab92929187de95c7f42eab9907801d", + "sha256WithRSAEncryption": "504472bf96d0a3da1098dacacac48886d1ab92929187de95c7f42eab9907801d", + "sha384": "06538369656a39f45a5911de3e59a4bb983aa49fef7fef726eecaa824552c32b2bb0ee18868f4f5408b731ab2d14c753", + "sha384WithRSAEncryption": "06538369656a39f45a5911de3e59a4bb983aa49fef7fef726eecaa824552c32b2bb0ee18868f4f5408b731ab2d14c753", + "sha512": "765e9cd6478a6da8c8887a5b76c30a277fd5de87a34fe401286163fc0ae773835f8fe4e81650a6a7a7d32ce43af44774989f29e5295f7d0d1642bc72f5797131", + "sha512WithRSAEncryption": "765e9cd6478a6da8c8887a5b76c30a277fd5de87a34fe401286163fc0ae773835f8fe4e81650a6a7a7d32ce43af44774989f29e5295f7d0d1642bc72f5797131", + "shaWithRSAEncryption": "6eae2aa1e98a42c0f4e1162e263d09ea0b1d1bc6", + "ssl2-md5": "1db274ef41b1ad71f713df2b05207e1a", + "ssl3-md5": "1db274ef41b1ad71f713df2b05207e1a", + "ssl3-sha1": "4b31312eaf8b506811151a9dbd162961f7548c4b", + "whirlpool": "e8b6b7e5050aee6b0dd5195e9a6a305f5f1db7cf21bfedf8a1a45570fd59ff788d48488974f89d7b594d3391a5857f021e3fd2f23baafcb2887cd8cc4f74bb38" + }, + { + "input": "AA/4APwAA///AAA/8AH//+B/+AD4D///gAAP//wP/+AAAP/D//AH//8AOPgAIB/+P/4A/gB//8AA", + "DSA": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "DSA-SHA": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "DSA-SHA1": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "DSA-SHA1-old": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "RSA-MD4": "24b36ec9caa9009c64c2a68bfa0c912a", + "RSA-MD5": "d8b4ec343b4310345efc6da9cee8a2ec", + "RSA-MDC2": "f59a59d03170661717ab7d638a28f6c0", + "RSA-RIPEMD160": "de71f96026252d3baa5197a878daf0276c7ce513", + "RSA-SHA": "ed565d0f32c22d0483c0840e0fcbb070c0fa0fc7", + "RSA-SHA1": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "RSA-SHA1-2": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "RSA-SHA224": "9e418baa84ac4bd2df6fd8fd077e07be1e4180e0d3b5e3bd8cf160da", + "RSA-SHA256": "ad3a49ab7ad5b69182301d9ef971feab72f770f4d9f60f6db308ffea746db005", + "RSA-SHA384": "6d62ccacd4cec0bb0f6104d784fc985fdf11eb44b730db999f35d9d8837f3a67f2246b5002e82273fe1be14adeb412de", + "RSA-SHA512": "6dc712927b0fc4528db9b1412b989f307c98f349e9ae36404b7cba1c5e49ab59a732fc446556b7f80cad3aa04ca92911c8f72a8d663966a442e987f00a08bc3b", + "dsaEncryption": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "dsaWithSHA": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "dsaWithSHA1": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "dss1": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "ecdsa-with-SHA1": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "md4": "24b36ec9caa9009c64c2a68bfa0c912a", + "md4WithRSAEncryption": "24b36ec9caa9009c64c2a68bfa0c912a", + "md5": "d8b4ec343b4310345efc6da9cee8a2ec", + "md5WithRSAEncryption": "d8b4ec343b4310345efc6da9cee8a2ec", + "mdc2": "f59a59d03170661717ab7d638a28f6c0", + "mdc2WithRSA": "f59a59d03170661717ab7d638a28f6c0", + "ripemd": "de71f96026252d3baa5197a878daf0276c7ce513", + "ripemd160": "de71f96026252d3baa5197a878daf0276c7ce513", + "ripemd160WithRSA": "de71f96026252d3baa5197a878daf0276c7ce513", + "rmd160": "de71f96026252d3baa5197a878daf0276c7ce513", + "sha": "ed565d0f32c22d0483c0840e0fcbb070c0fa0fc7", + "sha1": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "sha1WithRSAEncryption": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "sha224": "9e418baa84ac4bd2df6fd8fd077e07be1e4180e0d3b5e3bd8cf160da", + "sha224WithRSAEncryption": "9e418baa84ac4bd2df6fd8fd077e07be1e4180e0d3b5e3bd8cf160da", + "sha256": "ad3a49ab7ad5b69182301d9ef971feab72f770f4d9f60f6db308ffea746db005", + "sha256WithRSAEncryption": "ad3a49ab7ad5b69182301d9ef971feab72f770f4d9f60f6db308ffea746db005", + "sha384": "6d62ccacd4cec0bb0f6104d784fc985fdf11eb44b730db999f35d9d8837f3a67f2246b5002e82273fe1be14adeb412de", + "sha384WithRSAEncryption": "6d62ccacd4cec0bb0f6104d784fc985fdf11eb44b730db999f35d9d8837f3a67f2246b5002e82273fe1be14adeb412de", + "sha512": "6dc712927b0fc4528db9b1412b989f307c98f349e9ae36404b7cba1c5e49ab59a732fc446556b7f80cad3aa04ca92911c8f72a8d663966a442e987f00a08bc3b", + "sha512WithRSAEncryption": "6dc712927b0fc4528db9b1412b989f307c98f349e9ae36404b7cba1c5e49ab59a732fc446556b7f80cad3aa04ca92911c8f72a8d663966a442e987f00a08bc3b", + "shaWithRSAEncryption": "ed565d0f32c22d0483c0840e0fcbb070c0fa0fc7", + "ssl2-md5": "d8b4ec343b4310345efc6da9cee8a2ec", + "ssl3-md5": "d8b4ec343b4310345efc6da9cee8a2ec", + "ssl3-sha1": "3fe70971b20558f7e9bac303ed2bc14bde659a62", + "whirlpool": "309d95791bb0cc1ac009155b2f726c14f0908a7a9b92dfd51326bce3a1ad1a202e603f28374d49d5279e64de5870b9f50675794b9ec99b3cf995a066b14830df" + }, + { + "input": "AD8A4AAP//x///wAAH4AAP/+H/AAH/AAH/+H8AA/wA//h/8AP4H///f/4P/gP5//AAcAf/wD//AAAA==", + "DSA": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "DSA-SHA": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "DSA-SHA1": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "DSA-SHA1-old": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "RSA-MD4": "611686d18f35adc16c74425b5c7a5699", + "RSA-MD5": "082ee3b2be7910f7350368e395a63d90", + "RSA-MDC2": "7549a9bfff6737d3bc91d64ff99d37a3", + "RSA-RIPEMD160": "8d5d691ade94c9cd19db6e2127ee6ed720ed7f39", + "RSA-SHA": "85b2eb1ba4e374de787b653f6162af3d593e535b", + "RSA-SHA1": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "RSA-SHA1-2": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "RSA-SHA224": "d6584455038fe2604700a80305c0083fcc90212b9f0c7dc2adbdcfa1", + "RSA-SHA256": "5cdcb342f26857e8db5ac97a89da6197759adf384ab241a8112795241983238f", + "RSA-SHA384": "00c2d950ce42e33a02d965fee284b50da6dc80a5cea93432aa9406aeb2d27e901e1c402d7aef5a7e9ac3381c4ce076a1", + "RSA-SHA512": "7465eca59636aa00877954200b7a25f03cdf41541ca4e732aba4945ab4dc2ee41ba1438485882e84d997b64af4f31f7f67ae16ea6b94e384e2689a12413aa143", + "dsaEncryption": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "dsaWithSHA": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "dsaWithSHA1": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "dss1": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "ecdsa-with-SHA1": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "md4": "611686d18f35adc16c74425b5c7a5699", + "md4WithRSAEncryption": "611686d18f35adc16c74425b5c7a5699", + "md5": "082ee3b2be7910f7350368e395a63d90", + "md5WithRSAEncryption": "082ee3b2be7910f7350368e395a63d90", + "mdc2": "7549a9bfff6737d3bc91d64ff99d37a3", + "mdc2WithRSA": "7549a9bfff6737d3bc91d64ff99d37a3", + "ripemd": "8d5d691ade94c9cd19db6e2127ee6ed720ed7f39", + "ripemd160": "8d5d691ade94c9cd19db6e2127ee6ed720ed7f39", + "ripemd160WithRSA": "8d5d691ade94c9cd19db6e2127ee6ed720ed7f39", + "rmd160": "8d5d691ade94c9cd19db6e2127ee6ed720ed7f39", + "sha": "85b2eb1ba4e374de787b653f6162af3d593e535b", + "sha1": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "sha1WithRSAEncryption": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "sha224": "d6584455038fe2604700a80305c0083fcc90212b9f0c7dc2adbdcfa1", + "sha224WithRSAEncryption": "d6584455038fe2604700a80305c0083fcc90212b9f0c7dc2adbdcfa1", + "sha256": "5cdcb342f26857e8db5ac97a89da6197759adf384ab241a8112795241983238f", + "sha256WithRSAEncryption": "5cdcb342f26857e8db5ac97a89da6197759adf384ab241a8112795241983238f", + "sha384": "00c2d950ce42e33a02d965fee284b50da6dc80a5cea93432aa9406aeb2d27e901e1c402d7aef5a7e9ac3381c4ce076a1", + "sha384WithRSAEncryption": "00c2d950ce42e33a02d965fee284b50da6dc80a5cea93432aa9406aeb2d27e901e1c402d7aef5a7e9ac3381c4ce076a1", + "sha512": "7465eca59636aa00877954200b7a25f03cdf41541ca4e732aba4945ab4dc2ee41ba1438485882e84d997b64af4f31f7f67ae16ea6b94e384e2689a12413aa143", + "sha512WithRSAEncryption": "7465eca59636aa00877954200b7a25f03cdf41541ca4e732aba4945ab4dc2ee41ba1438485882e84d997b64af4f31f7f67ae16ea6b94e384e2689a12413aa143", + "shaWithRSAEncryption": "85b2eb1ba4e374de787b653f6162af3d593e535b", + "ssl2-md5": "082ee3b2be7910f7350368e395a63d90", + "ssl3-md5": "082ee3b2be7910f7350368e395a63d90", + "ssl3-sha1": "93fb769d5bf49d6c563685954e2aecc024dc02d6", + "whirlpool": "99ab6ef232a55a1302a8c9914cfd09a1c0dd4712ae082896f0f36af16b33e1235ddf02287787452b9347dd7ea40d8499a98d005b70e9162bb66f4f3b896f7d2f" + }, + { + "input": "4D//8P+APgAD/+AAD/wAB//4AAB/gAAP+AH/f//wAD///n//4AD/w///AADwAAB//wA///AAAcAD//8=", + "DSA": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "DSA-SHA": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "DSA-SHA1": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "DSA-SHA1-old": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "RSA-MD4": "5300b5f565c1fed0e91c450a9029f9e0", + "RSA-MD5": "d247c4070ae1de106bcb438a2dacac23", + "RSA-MDC2": "e7795d8f85c383461ee6339d0d918a87", + "RSA-RIPEMD160": "b44d9673ebe43687936d3c52397ac5190ea8b934", + "RSA-SHA": "592a10ac3244878e143540b9bcf74ccc0cac9448", + "RSA-SHA1": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "RSA-SHA1-2": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "RSA-SHA224": "e03841e9b24fd7bd394e73d6899aca180ce418e31eb9ef9b9d9de07c", + "RSA-SHA256": "4ec9883c8ad72131c79f14e4f1e75042a61100a5bc290fc344ee3c2adc99c143", + "RSA-SHA384": "7df760b82976689499679b3f23257f06f0701d94b47fafd60b543420463f3cfdd938b0166359b42c21aacf251a54cb59", + "RSA-SHA512": "3a490375e04aa9723b0fae4e8718f2409c57ec7650709551e65899ce2a6fca62f913f3303b4b073af50cf8c0c2b82bc11ea4ad2f5d56f17af2ae8764f7dda99d", + "dsaEncryption": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "dsaWithSHA": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "dsaWithSHA1": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "dss1": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "ecdsa-with-SHA1": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "md4": "5300b5f565c1fed0e91c450a9029f9e0", + "md4WithRSAEncryption": "5300b5f565c1fed0e91c450a9029f9e0", + "md5": "d247c4070ae1de106bcb438a2dacac23", + "md5WithRSAEncryption": "d247c4070ae1de106bcb438a2dacac23", + "mdc2": "e7795d8f85c383461ee6339d0d918a87", + "mdc2WithRSA": "e7795d8f85c383461ee6339d0d918a87", + "ripemd": "b44d9673ebe43687936d3c52397ac5190ea8b934", + "ripemd160": "b44d9673ebe43687936d3c52397ac5190ea8b934", + "ripemd160WithRSA": "b44d9673ebe43687936d3c52397ac5190ea8b934", + "rmd160": "b44d9673ebe43687936d3c52397ac5190ea8b934", + "sha": "592a10ac3244878e143540b9bcf74ccc0cac9448", + "sha1": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "sha1WithRSAEncryption": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "sha224": "e03841e9b24fd7bd394e73d6899aca180ce418e31eb9ef9b9d9de07c", + "sha224WithRSAEncryption": "e03841e9b24fd7bd394e73d6899aca180ce418e31eb9ef9b9d9de07c", + "sha256": "4ec9883c8ad72131c79f14e4f1e75042a61100a5bc290fc344ee3c2adc99c143", + "sha256WithRSAEncryption": "4ec9883c8ad72131c79f14e4f1e75042a61100a5bc290fc344ee3c2adc99c143", + "sha384": "7df760b82976689499679b3f23257f06f0701d94b47fafd60b543420463f3cfdd938b0166359b42c21aacf251a54cb59", + "sha384WithRSAEncryption": "7df760b82976689499679b3f23257f06f0701d94b47fafd60b543420463f3cfdd938b0166359b42c21aacf251a54cb59", + "sha512": "3a490375e04aa9723b0fae4e8718f2409c57ec7650709551e65899ce2a6fca62f913f3303b4b073af50cf8c0c2b82bc11ea4ad2f5d56f17af2ae8764f7dda99d", + "sha512WithRSAEncryption": "3a490375e04aa9723b0fae4e8718f2409c57ec7650709551e65899ce2a6fca62f913f3303b4b073af50cf8c0c2b82bc11ea4ad2f5d56f17af2ae8764f7dda99d", + "shaWithRSAEncryption": "592a10ac3244878e143540b9bcf74ccc0cac9448", + "ssl2-md5": "d247c4070ae1de106bcb438a2dacac23", + "ssl3-md5": "d247c4070ae1de106bcb438a2dacac23", + "ssl3-sha1": "bc8827c3e614d515e83dea503989dea4fda6ea13", + "whirlpool": "5ea57fdc9c3fa84becae93297ee456672ce3f491c32a04780e9c505f68685e6468de18771a86b3ecc574feb7aef6cf0febaeef3b0b79f3138810be210e18d563" + }, + { + "input": "AAPAAf/f/f+f/h///wA///4AAH/P//Af//4H8AD//+AAAQAH/4Af4AAA//4D//+AA/AP//4AAB//+AAA", + "DSA": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "DSA-SHA": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "DSA-SHA1": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "DSA-SHA1-old": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "RSA-MD4": "c420a0fc8ffdb1de5af32692292a7434", + "RSA-MD5": "f8cbc4f3af45befc792679f2b113f1cb", + "RSA-MDC2": "1ab924f8cec5ecaeb11976e1975318ba", + "RSA-RIPEMD160": "cbd69987073b18a3baee9ec6186bc521265e6665", + "RSA-SHA": "9b2aeaa9eaa303c03855a1a04e2b4d8fa08d3033", + "RSA-SHA1": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "RSA-SHA1-2": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "RSA-SHA224": "21d3d0aa1c09146bec6f47556551415f15d1f6416f1543cdcc205a15", + "RSA-SHA256": "375c64eb3361f34b4d89078fa95d082c74bced92436aa3d50031839375d6473e", + "RSA-SHA384": "af56c257d65f9fb051edd9460e1d6697b1ecdc57569a35fb93122ff85dc8e827967bbfb39048cf27c92c222ad192b804", + "RSA-SHA512": "10a72fadb32da865d39d36445c053776af1f19b384d6cbb45fee9d93399e22250ffdf16b2f867a5adf87d2215cd2685587db3ea50920a36354b22d17b4897e63", + "dsaEncryption": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "dsaWithSHA": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "dsaWithSHA1": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "dss1": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "ecdsa-with-SHA1": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "md4": "c420a0fc8ffdb1de5af32692292a7434", + "md4WithRSAEncryption": "c420a0fc8ffdb1de5af32692292a7434", + "md5": "f8cbc4f3af45befc792679f2b113f1cb", + "md5WithRSAEncryption": "f8cbc4f3af45befc792679f2b113f1cb", + "mdc2": "1ab924f8cec5ecaeb11976e1975318ba", + "mdc2WithRSA": "1ab924f8cec5ecaeb11976e1975318ba", + "ripemd": "cbd69987073b18a3baee9ec6186bc521265e6665", + "ripemd160": "cbd69987073b18a3baee9ec6186bc521265e6665", + "ripemd160WithRSA": "cbd69987073b18a3baee9ec6186bc521265e6665", + "rmd160": "cbd69987073b18a3baee9ec6186bc521265e6665", + "sha": "9b2aeaa9eaa303c03855a1a04e2b4d8fa08d3033", + "sha1": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "sha1WithRSAEncryption": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "sha224": "21d3d0aa1c09146bec6f47556551415f15d1f6416f1543cdcc205a15", + "sha224WithRSAEncryption": "21d3d0aa1c09146bec6f47556551415f15d1f6416f1543cdcc205a15", + "sha256": "375c64eb3361f34b4d89078fa95d082c74bced92436aa3d50031839375d6473e", + "sha256WithRSAEncryption": "375c64eb3361f34b4d89078fa95d082c74bced92436aa3d50031839375d6473e", + "sha384": "af56c257d65f9fb051edd9460e1d6697b1ecdc57569a35fb93122ff85dc8e827967bbfb39048cf27c92c222ad192b804", + "sha384WithRSAEncryption": "af56c257d65f9fb051edd9460e1d6697b1ecdc57569a35fb93122ff85dc8e827967bbfb39048cf27c92c222ad192b804", + "sha512": "10a72fadb32da865d39d36445c053776af1f19b384d6cbb45fee9d93399e22250ffdf16b2f867a5adf87d2215cd2685587db3ea50920a36354b22d17b4897e63", + "sha512WithRSAEncryption": "10a72fadb32da865d39d36445c053776af1f19b384d6cbb45fee9d93399e22250ffdf16b2f867a5adf87d2215cd2685587db3ea50920a36354b22d17b4897e63", + "shaWithRSAEncryption": "9b2aeaa9eaa303c03855a1a04e2b4d8fa08d3033", + "ssl2-md5": "f8cbc4f3af45befc792679f2b113f1cb", + "ssl3-md5": "f8cbc4f3af45befc792679f2b113f1cb", + "ssl3-sha1": "e83868dbe4a389ab48e61cfc4ed894f32ae112ac", + "whirlpool": "16e6a645c7c03c1bd98fe948245b29d5d0609a73f06e1894ef4d26246bd1fb14fe9e2516d1d2c37e78bb7e0845f4c45ab90a6efe5ee18e3914451803daaa13da" + }, + { + "input": "AB//+//+AAf/8AAA//8AAA/z//4AeAAAPgAAP//4AB///4AAA///AAf/7gAf/AB4AAAf/wf//gP//+AAAA==", + "DSA": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "DSA-SHA": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "DSA-SHA1": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "DSA-SHA1-old": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "RSA-MD4": "3328a16bd616f393f072cae3b7a8d568", + "RSA-MD5": "9031006a437019c5dcd987a31731ebd9", + "RSA-MDC2": "1927355cd6a42ba7e8ee2a5e79921e40", + "RSA-RIPEMD160": "5577734066615583f24dabb143614c8a453e9bb5", + "RSA-SHA": "796f1d3bb9dc26016bb372ca901320de7c70df89", + "RSA-SHA1": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "RSA-SHA1-2": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "RSA-SHA224": "7b468eb4af1be5fd6430a657608e926fa935c4ec9eb1c9ab9bfd19dd", + "RSA-SHA256": "8a0a36538da941bea6c614b2c038424588d8d2505039f70cbff291d4f0f9f6a1", + "RSA-SHA384": "7d99a9de7f215dfd851c588c04dda0e141fb5129b44e6936a069267cdcda2d3d74446384be97550d80bfe97f0fa906bf", + "RSA-SHA512": "e1ecf3f08e315a415e0043b21e6b30b18d468c41bce2f58db6dcb59a4147db9a2919512eaefd71b6ed3ae4561f6d9eda2f7519c50a069e04a43db55c626817f9", + "dsaEncryption": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "dsaWithSHA": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "dsaWithSHA1": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "dss1": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "ecdsa-with-SHA1": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "md4": "3328a16bd616f393f072cae3b7a8d568", + "md4WithRSAEncryption": "3328a16bd616f393f072cae3b7a8d568", + "md5": "9031006a437019c5dcd987a31731ebd9", + "md5WithRSAEncryption": "9031006a437019c5dcd987a31731ebd9", + "mdc2": "1927355cd6a42ba7e8ee2a5e79921e40", + "mdc2WithRSA": "1927355cd6a42ba7e8ee2a5e79921e40", + "ripemd": "5577734066615583f24dabb143614c8a453e9bb5", + "ripemd160": "5577734066615583f24dabb143614c8a453e9bb5", + "ripemd160WithRSA": "5577734066615583f24dabb143614c8a453e9bb5", + "rmd160": "5577734066615583f24dabb143614c8a453e9bb5", + "sha": "796f1d3bb9dc26016bb372ca901320de7c70df89", + "sha1": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "sha1WithRSAEncryption": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "sha224": "7b468eb4af1be5fd6430a657608e926fa935c4ec9eb1c9ab9bfd19dd", + "sha224WithRSAEncryption": "7b468eb4af1be5fd6430a657608e926fa935c4ec9eb1c9ab9bfd19dd", + "sha256": "8a0a36538da941bea6c614b2c038424588d8d2505039f70cbff291d4f0f9f6a1", + "sha256WithRSAEncryption": "8a0a36538da941bea6c614b2c038424588d8d2505039f70cbff291d4f0f9f6a1", + "sha384": "7d99a9de7f215dfd851c588c04dda0e141fb5129b44e6936a069267cdcda2d3d74446384be97550d80bfe97f0fa906bf", + "sha384WithRSAEncryption": "7d99a9de7f215dfd851c588c04dda0e141fb5129b44e6936a069267cdcda2d3d74446384be97550d80bfe97f0fa906bf", + "sha512": "e1ecf3f08e315a415e0043b21e6b30b18d468c41bce2f58db6dcb59a4147db9a2919512eaefd71b6ed3ae4561f6d9eda2f7519c50a069e04a43db55c626817f9", + "sha512WithRSAEncryption": "e1ecf3f08e315a415e0043b21e6b30b18d468c41bce2f58db6dcb59a4147db9a2919512eaefd71b6ed3ae4561f6d9eda2f7519c50a069e04a43db55c626817f9", + "shaWithRSAEncryption": "796f1d3bb9dc26016bb372ca901320de7c70df89", + "ssl2-md5": "9031006a437019c5dcd987a31731ebd9", + "ssl3-md5": "9031006a437019c5dcd987a31731ebd9", + "ssl3-sha1": "55c95459cde4b33791b4b2bcaaf840930af3f3bd", + "whirlpool": "6b800fa612fe6153f37713504e8d51e671f9576802ab407ccc507b6bb0c4320c2ebd74a42fcf5f95f63153b7d06083c9a913278e8661bb488f3cee4bb696bc90" + }, + { + "input": "AH///gAAP/wD//wf//B/2APwAP38OAAIABAA4AYAf/4AAA//gAA/A//+///5//gAB//8Af/AAAP//+AD//8=", + "DSA": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "DSA-SHA": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "DSA-SHA1": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "DSA-SHA1-old": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "RSA-MD4": "5ef22d7a910889dc336a5f1162dd1634", + "RSA-MD5": "a6b62759ee3883258fbdeeb8b56e6283", + "RSA-MDC2": "c29f7308445825ac55e893124d367be0", + "RSA-RIPEMD160": "9ad5335ded934194b1248757762ed502c8450085", + "RSA-SHA": "49f14b2e0793a8f9d711d84c0e98bc98c284df5d", + "RSA-SHA1": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "RSA-SHA1-2": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "RSA-SHA224": "817a9ed3a97bbaf56727b98552002bd517564de266a5df09620a126e", + "RSA-SHA256": "a4dd6338174ebeda6a25b88d754fa5b95cad27902eb0bc8321b76db62efb1abc", + "RSA-SHA384": "369e73fc37ef5775684618459b0e4c3e70e5a2609c1c37ada7f34fdfeee9ceaf0dc65551ddb40fad1ac708d69c90d516", + "RSA-SHA512": "96a0d87a5e1da55518c46b94c86d3a3442fbf077bfc92dfd4de8c8135a957b6ec082abc4b16155a423848cd6f221677a764f24e603cfcfd5582cdcdbece50070", + "dsaEncryption": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "dsaWithSHA": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "dsaWithSHA1": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "dss1": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "ecdsa-with-SHA1": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "md4": "5ef22d7a910889dc336a5f1162dd1634", + "md4WithRSAEncryption": "5ef22d7a910889dc336a5f1162dd1634", + "md5": "a6b62759ee3883258fbdeeb8b56e6283", + "md5WithRSAEncryption": "a6b62759ee3883258fbdeeb8b56e6283", + "mdc2": "c29f7308445825ac55e893124d367be0", + "mdc2WithRSA": "c29f7308445825ac55e893124d367be0", + "ripemd": "9ad5335ded934194b1248757762ed502c8450085", + "ripemd160": "9ad5335ded934194b1248757762ed502c8450085", + "ripemd160WithRSA": "9ad5335ded934194b1248757762ed502c8450085", + "rmd160": "9ad5335ded934194b1248757762ed502c8450085", + "sha": "49f14b2e0793a8f9d711d84c0e98bc98c284df5d", + "sha1": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "sha1WithRSAEncryption": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "sha224": "817a9ed3a97bbaf56727b98552002bd517564de266a5df09620a126e", + "sha224WithRSAEncryption": "817a9ed3a97bbaf56727b98552002bd517564de266a5df09620a126e", + "sha256": "a4dd6338174ebeda6a25b88d754fa5b95cad27902eb0bc8321b76db62efb1abc", + "sha256WithRSAEncryption": "a4dd6338174ebeda6a25b88d754fa5b95cad27902eb0bc8321b76db62efb1abc", + "sha384": "369e73fc37ef5775684618459b0e4c3e70e5a2609c1c37ada7f34fdfeee9ceaf0dc65551ddb40fad1ac708d69c90d516", + "sha384WithRSAEncryption": "369e73fc37ef5775684618459b0e4c3e70e5a2609c1c37ada7f34fdfeee9ceaf0dc65551ddb40fad1ac708d69c90d516", + "sha512": "96a0d87a5e1da55518c46b94c86d3a3442fbf077bfc92dfd4de8c8135a957b6ec082abc4b16155a423848cd6f221677a764f24e603cfcfd5582cdcdbece50070", + "sha512WithRSAEncryption": "96a0d87a5e1da55518c46b94c86d3a3442fbf077bfc92dfd4de8c8135a957b6ec082abc4b16155a423848cd6f221677a764f24e603cfcfd5582cdcdbece50070", + "shaWithRSAEncryption": "49f14b2e0793a8f9d711d84c0e98bc98c284df5d", + "ssl2-md5": "a6b62759ee3883258fbdeeb8b56e6283", + "ssl3-md5": "a6b62759ee3883258fbdeeb8b56e6283", + "ssl3-sha1": "36bb0e2ba438a3e03214d9ed2b28a4d5c578fcaa", + "whirlpool": "d7cd91fc9156343280b64419487b09919964204408bed2b799a9d42e768ac986821845304d12e7371997cc12252ed8ed4fcce7eb3c1cc41d56ea69f9a5bd17aa" + }, + { + "input": "//AP//8ABgD///AH/+AEAAMAAAPw//8AA//7/8P/8Af//8cAf4AAA//4AB/h//hj/AA/wJ//+AAAf/8f//wA", + "DSA": "3acbf874199763eba20f3789dfc59572aca4cf33", + "DSA-SHA": "3acbf874199763eba20f3789dfc59572aca4cf33", + "DSA-SHA1": "3acbf874199763eba20f3789dfc59572aca4cf33", + "DSA-SHA1-old": "3acbf874199763eba20f3789dfc59572aca4cf33", + "RSA-MD4": "c4bc5d69be75075927474ef60f58a507", + "RSA-MD5": "4933898605b4a1b970b674a2dde92292", + "RSA-MDC2": "7ed887bb3f7745e007119066aa3af9ed", + "RSA-RIPEMD160": "a7ba45e9e7ef17bd3b4f15bdef23c7bb73467485", + "RSA-SHA": "42f1b94b7bce310a3e6ec0535d3c0231df3dff45", + "RSA-SHA1": "3acbf874199763eba20f3789dfc59572aca4cf33", + "RSA-SHA1-2": "3acbf874199763eba20f3789dfc59572aca4cf33", + "RSA-SHA224": "13c658333351f4171c527333892dbe2dea44f15cb775fd551d16d7a5", + "RSA-SHA256": "a644092a1de8e05e17908ce565d55fcf39e30585565d96bf1c13eeb9f3401803", + "RSA-SHA384": "22db6cca00f4ce076f97fe8513f788968ff1c2cdee2aeb614830ed77b8b4b04481f1831acadc605ecd340c0a79a507fd", + "RSA-SHA512": "92b2850798b270bfd56c21fd8e81e28cb3e353a4b681aac2d0bb6572c6bbd7cff8f1d84d634f1b9c4abd3d1700bd07b4c83fbaae88adf9ec275f0e5eac3ab9c3", + "dsaEncryption": "3acbf874199763eba20f3789dfc59572aca4cf33", + "dsaWithSHA": "3acbf874199763eba20f3789dfc59572aca4cf33", + "dsaWithSHA1": "3acbf874199763eba20f3789dfc59572aca4cf33", + "dss1": "3acbf874199763eba20f3789dfc59572aca4cf33", + "ecdsa-with-SHA1": "3acbf874199763eba20f3789dfc59572aca4cf33", + "md4": "c4bc5d69be75075927474ef60f58a507", + "md4WithRSAEncryption": "c4bc5d69be75075927474ef60f58a507", + "md5": "4933898605b4a1b970b674a2dde92292", + "md5WithRSAEncryption": "4933898605b4a1b970b674a2dde92292", + "mdc2": "7ed887bb3f7745e007119066aa3af9ed", + "mdc2WithRSA": "7ed887bb3f7745e007119066aa3af9ed", + "ripemd": "a7ba45e9e7ef17bd3b4f15bdef23c7bb73467485", + "ripemd160": "a7ba45e9e7ef17bd3b4f15bdef23c7bb73467485", + "ripemd160WithRSA": "a7ba45e9e7ef17bd3b4f15bdef23c7bb73467485", + "rmd160": "a7ba45e9e7ef17bd3b4f15bdef23c7bb73467485", + "sha": "42f1b94b7bce310a3e6ec0535d3c0231df3dff45", + "sha1": "3acbf874199763eba20f3789dfc59572aca4cf33", + "sha1WithRSAEncryption": "3acbf874199763eba20f3789dfc59572aca4cf33", + "sha224": "13c658333351f4171c527333892dbe2dea44f15cb775fd551d16d7a5", + "sha224WithRSAEncryption": "13c658333351f4171c527333892dbe2dea44f15cb775fd551d16d7a5", + "sha256": "a644092a1de8e05e17908ce565d55fcf39e30585565d96bf1c13eeb9f3401803", + "sha256WithRSAEncryption": "a644092a1de8e05e17908ce565d55fcf39e30585565d96bf1c13eeb9f3401803", + "sha384": "22db6cca00f4ce076f97fe8513f788968ff1c2cdee2aeb614830ed77b8b4b04481f1831acadc605ecd340c0a79a507fd", + "sha384WithRSAEncryption": "22db6cca00f4ce076f97fe8513f788968ff1c2cdee2aeb614830ed77b8b4b04481f1831acadc605ecd340c0a79a507fd", + "sha512": "92b2850798b270bfd56c21fd8e81e28cb3e353a4b681aac2d0bb6572c6bbd7cff8f1d84d634f1b9c4abd3d1700bd07b4c83fbaae88adf9ec275f0e5eac3ab9c3", + "sha512WithRSAEncryption": "92b2850798b270bfd56c21fd8e81e28cb3e353a4b681aac2d0bb6572c6bbd7cff8f1d84d634f1b9c4abd3d1700bd07b4c83fbaae88adf9ec275f0e5eac3ab9c3", + "shaWithRSAEncryption": "42f1b94b7bce310a3e6ec0535d3c0231df3dff45", + "ssl2-md5": "4933898605b4a1b970b674a2dde92292", + "ssl3-md5": "4933898605b4a1b970b674a2dde92292", + "ssl3-sha1": "3acbf874199763eba20f3789dfc59572aca4cf33", + "whirlpool": "94aef3f4288be25a88b79704589b269872591e31643e3b9d4bf72758c85421ac83922197b23cbda66da02888c361c9b1164d48d6a30adeb786db8af0d346d885" + }, + { + "input": "AD///AAPx4AAAgAeAABgfwP+AAAf/4Af+AAA//+AAAP/wAB//8B/4AP8AP/3//8AAB/wAAP//+H//4AP+AAAHw==", + "DSA": "86be037c4d509c9202020767d860dab039cadace", + "DSA-SHA": "86be037c4d509c9202020767d860dab039cadace", + "DSA-SHA1": "86be037c4d509c9202020767d860dab039cadace", + "DSA-SHA1-old": "86be037c4d509c9202020767d860dab039cadace", + "RSA-MD4": "475120a727b78f41b9b12631d72060e3", + "RSA-MD5": "f0684ca20de4607232f3e158e81a37f2", + "RSA-MDC2": "73ec5f0c87b7dfaad3d53a1a7132a2e9", + "RSA-RIPEMD160": "36af7bb2af7006bec47cd11eba7ea9c8dc69fdd0", + "RSA-SHA": "d8cb319d77c8e4549c4f9d417168214c4b3ea46d", + "RSA-SHA1": "86be037c4d509c9202020767d860dab039cadace", + "RSA-SHA1-2": "86be037c4d509c9202020767d860dab039cadace", + "RSA-SHA224": "cec6acec377ac4ffd4d6cf603ab6184347cd9e243a8fbe0b7aaa9cc6", + "RSA-SHA256": "7697b1435a5bdc094038469fc5268615cbe94641b2165bee62466426ab414c97", + "RSA-SHA384": "21f91cb26989f353a90013722fcbdd0769ae927fb661dfd8140cfa88d42aa523680404dd50fb80b2112b79da589bb452", + "RSA-SHA512": "9cec66b2a39a697b2a3fbd582ab032ee12f7ee3fdbb58236c87723dffbc541f45b04d865c9da0588917cccd960f4daf725059dd788e39899694a235322bfa9d0", + "dsaEncryption": "86be037c4d509c9202020767d860dab039cadace", + "dsaWithSHA": "86be037c4d509c9202020767d860dab039cadace", + "dsaWithSHA1": "86be037c4d509c9202020767d860dab039cadace", + "dss1": "86be037c4d509c9202020767d860dab039cadace", + "ecdsa-with-SHA1": "86be037c4d509c9202020767d860dab039cadace", + "md4": "475120a727b78f41b9b12631d72060e3", + "md4WithRSAEncryption": "475120a727b78f41b9b12631d72060e3", + "md5": "f0684ca20de4607232f3e158e81a37f2", + "md5WithRSAEncryption": "f0684ca20de4607232f3e158e81a37f2", + "mdc2": "73ec5f0c87b7dfaad3d53a1a7132a2e9", + "mdc2WithRSA": "73ec5f0c87b7dfaad3d53a1a7132a2e9", + "ripemd": "36af7bb2af7006bec47cd11eba7ea9c8dc69fdd0", + "ripemd160": "36af7bb2af7006bec47cd11eba7ea9c8dc69fdd0", + "ripemd160WithRSA": "36af7bb2af7006bec47cd11eba7ea9c8dc69fdd0", + "rmd160": "36af7bb2af7006bec47cd11eba7ea9c8dc69fdd0", + "sha": "d8cb319d77c8e4549c4f9d417168214c4b3ea46d", + "sha1": "86be037c4d509c9202020767d860dab039cadace", + "sha1WithRSAEncryption": "86be037c4d509c9202020767d860dab039cadace", + "sha224": "cec6acec377ac4ffd4d6cf603ab6184347cd9e243a8fbe0b7aaa9cc6", + "sha224WithRSAEncryption": "cec6acec377ac4ffd4d6cf603ab6184347cd9e243a8fbe0b7aaa9cc6", + "sha256": "7697b1435a5bdc094038469fc5268615cbe94641b2165bee62466426ab414c97", + "sha256WithRSAEncryption": "7697b1435a5bdc094038469fc5268615cbe94641b2165bee62466426ab414c97", + "sha384": "21f91cb26989f353a90013722fcbdd0769ae927fb661dfd8140cfa88d42aa523680404dd50fb80b2112b79da589bb452", + "sha384WithRSAEncryption": "21f91cb26989f353a90013722fcbdd0769ae927fb661dfd8140cfa88d42aa523680404dd50fb80b2112b79da589bb452", + "sha512": "9cec66b2a39a697b2a3fbd582ab032ee12f7ee3fdbb58236c87723dffbc541f45b04d865c9da0588917cccd960f4daf725059dd788e39899694a235322bfa9d0", + "sha512WithRSAEncryption": "9cec66b2a39a697b2a3fbd582ab032ee12f7ee3fdbb58236c87723dffbc541f45b04d865c9da0588917cccd960f4daf725059dd788e39899694a235322bfa9d0", + "shaWithRSAEncryption": "d8cb319d77c8e4549c4f9d417168214c4b3ea46d", + "ssl2-md5": "f0684ca20de4607232f3e158e81a37f2", + "ssl3-md5": "f0684ca20de4607232f3e158e81a37f2", + "ssl3-sha1": "86be037c4d509c9202020767d860dab039cadace", + "whirlpool": "d6d4a09ddf64b39742d239b1c0ac5618dbfbbd4486b2c69a3c71b094f708eab67125d7e987163b2c59826b91504c09d1c0ebd9d775beefc15290e55c1972ee98" + }, + { + "input": "AAH+AAOD8///gAf//D///AP/gAAGAAB4AAf//4AH/AH4AAf//8AAOAAH//4///g//88//AB//wAf/4AAMAP//wA=", + "DSA": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "DSA-SHA": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "DSA-SHA1": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "DSA-SHA1-old": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "RSA-MD4": "a6e70363c14951aea848a94c375cd29e", + "RSA-MD5": "c0b3fdecb3bb7b4ff0c936f378ccb027", + "RSA-MDC2": "6ce6a6b52c708cd3e4901de1116062f1", + "RSA-RIPEMD160": "a44429ce419fed89876d84f53ad3b3532ba6d8d6", + "RSA-SHA": "587bc5e083ae369ad4b805ae9219b0131580d8dd", + "RSA-SHA1": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "RSA-SHA1-2": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "RSA-SHA224": "11340da4b0c582ca91fc14906f69e1b74b6d93cf9049abdd10b7114e", + "RSA-SHA256": "62f249a85b14b477e764e63e9821d3f44dd2c745293f3586eff976266311a39f", + "RSA-SHA384": "bbcf5abdb4eeaad97aab9b37c643df3cf4c47686cf87a9cb0155cc26041f23c44c6bb3fae7659a7fcd18fc5cd76eda94", + "RSA-SHA512": "ad3922a3daaca8508e73bcfd2a605c1a7efff788de1ddea32eec897d9cafc137187c0c766b60f642d3697ab6f99ab2ab3d79e0361069b9daf6ad38479757cec7", + "dsaEncryption": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "dsaWithSHA": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "dsaWithSHA1": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "dss1": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "ecdsa-with-SHA1": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "md4": "a6e70363c14951aea848a94c375cd29e", + "md4WithRSAEncryption": "a6e70363c14951aea848a94c375cd29e", + "md5": "c0b3fdecb3bb7b4ff0c936f378ccb027", + "md5WithRSAEncryption": "c0b3fdecb3bb7b4ff0c936f378ccb027", + "mdc2": "6ce6a6b52c708cd3e4901de1116062f1", + "mdc2WithRSA": "6ce6a6b52c708cd3e4901de1116062f1", + "ripemd": "a44429ce419fed89876d84f53ad3b3532ba6d8d6", + "ripemd160": "a44429ce419fed89876d84f53ad3b3532ba6d8d6", + "ripemd160WithRSA": "a44429ce419fed89876d84f53ad3b3532ba6d8d6", + "rmd160": "a44429ce419fed89876d84f53ad3b3532ba6d8d6", + "sha": "587bc5e083ae369ad4b805ae9219b0131580d8dd", + "sha1": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "sha1WithRSAEncryption": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "sha224": "11340da4b0c582ca91fc14906f69e1b74b6d93cf9049abdd10b7114e", + "sha224WithRSAEncryption": "11340da4b0c582ca91fc14906f69e1b74b6d93cf9049abdd10b7114e", + "sha256": "62f249a85b14b477e764e63e9821d3f44dd2c745293f3586eff976266311a39f", + "sha256WithRSAEncryption": "62f249a85b14b477e764e63e9821d3f44dd2c745293f3586eff976266311a39f", + "sha384": "bbcf5abdb4eeaad97aab9b37c643df3cf4c47686cf87a9cb0155cc26041f23c44c6bb3fae7659a7fcd18fc5cd76eda94", + "sha384WithRSAEncryption": "bbcf5abdb4eeaad97aab9b37c643df3cf4c47686cf87a9cb0155cc26041f23c44c6bb3fae7659a7fcd18fc5cd76eda94", + "sha512": "ad3922a3daaca8508e73bcfd2a605c1a7efff788de1ddea32eec897d9cafc137187c0c766b60f642d3697ab6f99ab2ab3d79e0361069b9daf6ad38479757cec7", + "sha512WithRSAEncryption": "ad3922a3daaca8508e73bcfd2a605c1a7efff788de1ddea32eec897d9cafc137187c0c766b60f642d3697ab6f99ab2ab3d79e0361069b9daf6ad38479757cec7", + "shaWithRSAEncryption": "587bc5e083ae369ad4b805ae9219b0131580d8dd", + "ssl2-md5": "c0b3fdecb3bb7b4ff0c936f378ccb027", + "ssl3-md5": "c0b3fdecb3bb7b4ff0c936f378ccb027", + "ssl3-sha1": "51b57d7080a87394eec3eb2e0b242e553f2827c9", + "whirlpool": "9e993bad215ee78624db67a0fd8a0d28a28d1b80beb9fd61ef4e934b0f6001b920be0cb31e0dd10de539a811b67b04a436e464e06ccf3749b7f28a62b111844b" + }, + { + "input": "+AA4AAA+PwAAP//wAgAAD///gIAD/8AABAAPwD///gAAP//+AD//+AAwAHv/AAAD//w/4f+AAHAf/8AH/AAf//AA", + "DSA": "1efbfa78866315ce6a71e457f3a750a38facab41", + "DSA-SHA": "1efbfa78866315ce6a71e457f3a750a38facab41", + "DSA-SHA1": "1efbfa78866315ce6a71e457f3a750a38facab41", + "DSA-SHA1-old": "1efbfa78866315ce6a71e457f3a750a38facab41", + "RSA-MD4": "acbbe3a78dc3378fa7669b77b1c65214", + "RSA-MD5": "50652123b5e0e51bb5bc3fdde3c6a750", + "RSA-MDC2": "0b6dae67058231260435948070898eec", + "RSA-RIPEMD160": "113605cfd7dc057a558751df31148d9f87b97668", + "RSA-SHA": "694248022bedc0cff7e46501f82450220af37c61", + "RSA-SHA1": "1efbfa78866315ce6a71e457f3a750a38facab41", + "RSA-SHA1-2": "1efbfa78866315ce6a71e457f3a750a38facab41", + "RSA-SHA224": "62561df304dd9a368393cfc515595297aef41386335fd2f34758b7a4", + "RSA-SHA256": "eb2c75aa7330a6589d09f58231d1218e4124ba49b7b0c5245a76a5101d136449", + "RSA-SHA384": "02a0759609ca9d1324181abf21b4dfe2b1634a2f7a2e44450a20b88474f3cb9ab9696bc503e85db661866181ab4171de", + "RSA-SHA512": "057cddff81c1b44002cf70049822ef9aa3de2867cdd84b185b5337d7795089de5095f915963dd9569196ab2fc916457c3886a2721a0daf47e79896cbc72e35c8", + "dsaEncryption": "1efbfa78866315ce6a71e457f3a750a38facab41", + "dsaWithSHA": "1efbfa78866315ce6a71e457f3a750a38facab41", + "dsaWithSHA1": "1efbfa78866315ce6a71e457f3a750a38facab41", + "dss1": "1efbfa78866315ce6a71e457f3a750a38facab41", + "ecdsa-with-SHA1": "1efbfa78866315ce6a71e457f3a750a38facab41", + "md4": "acbbe3a78dc3378fa7669b77b1c65214", + "md4WithRSAEncryption": "acbbe3a78dc3378fa7669b77b1c65214", + "md5": "50652123b5e0e51bb5bc3fdde3c6a750", + "md5WithRSAEncryption": "50652123b5e0e51bb5bc3fdde3c6a750", + "mdc2": "0b6dae67058231260435948070898eec", + "mdc2WithRSA": "0b6dae67058231260435948070898eec", + "ripemd": "113605cfd7dc057a558751df31148d9f87b97668", + "ripemd160": "113605cfd7dc057a558751df31148d9f87b97668", + "ripemd160WithRSA": "113605cfd7dc057a558751df31148d9f87b97668", + "rmd160": "113605cfd7dc057a558751df31148d9f87b97668", + "sha": "694248022bedc0cff7e46501f82450220af37c61", + "sha1": "1efbfa78866315ce6a71e457f3a750a38facab41", + "sha1WithRSAEncryption": "1efbfa78866315ce6a71e457f3a750a38facab41", + "sha224": "62561df304dd9a368393cfc515595297aef41386335fd2f34758b7a4", + "sha224WithRSAEncryption": "62561df304dd9a368393cfc515595297aef41386335fd2f34758b7a4", + "sha256": "eb2c75aa7330a6589d09f58231d1218e4124ba49b7b0c5245a76a5101d136449", + "sha256WithRSAEncryption": "eb2c75aa7330a6589d09f58231d1218e4124ba49b7b0c5245a76a5101d136449", + "sha384": "02a0759609ca9d1324181abf21b4dfe2b1634a2f7a2e44450a20b88474f3cb9ab9696bc503e85db661866181ab4171de", + "sha384WithRSAEncryption": "02a0759609ca9d1324181abf21b4dfe2b1634a2f7a2e44450a20b88474f3cb9ab9696bc503e85db661866181ab4171de", + "sha512": "057cddff81c1b44002cf70049822ef9aa3de2867cdd84b185b5337d7795089de5095f915963dd9569196ab2fc916457c3886a2721a0daf47e79896cbc72e35c8", + "sha512WithRSAEncryption": "057cddff81c1b44002cf70049822ef9aa3de2867cdd84b185b5337d7795089de5095f915963dd9569196ab2fc916457c3886a2721a0daf47e79896cbc72e35c8", + "shaWithRSAEncryption": "694248022bedc0cff7e46501f82450220af37c61", + "ssl2-md5": "50652123b5e0e51bb5bc3fdde3c6a750", + "ssl3-md5": "50652123b5e0e51bb5bc3fdde3c6a750", + "ssl3-sha1": "1efbfa78866315ce6a71e457f3a750a38facab41", + "whirlpool": "c8ed06dc7cbe8674d32d0481061a317065413bad8c16edbae8897b67c4abffd6bffa90157108618130ede02600184bf59f4e624a971becbed8edb6a842ca0ebe" + }, + { + "input": "AAP4GAAAcD//+AAA/8///8AD//4AEAAA/gP/+AAAfgAAf4//wAAAf//gADwHwAAAf/8B//gB/4AAD//54AA//+AAAA==", + "DSA": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "DSA-SHA": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "DSA-SHA1": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "DSA-SHA1-old": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "RSA-MD4": "6ae9d4bb24e999169b04deea4c5dcc09", + "RSA-MD5": "ed4526ba8226d969f47edbb27b2f1144", + "RSA-MDC2": "d970ee061adce2df67add1bfc87f076c", + "RSA-RIPEMD160": "b42c0346ecf67deec4f403925804de2aa5b8fe00", + "RSA-SHA": "626ab00e7f281cdfa1653aa7b9778d541f668c2f", + "RSA-SHA1": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "RSA-SHA1-2": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "RSA-SHA224": "5c9dc5097c1d7d72644b70fcc03982e1e2f16da36d003a0ade57d062", + "RSA-SHA256": "90c096f9852990cf0fcfbd36ffeb577b4d106d66e9c7a18abdc6f7a3b1ddbab1", + "RSA-SHA384": "f8779f7604c1bc30b0929deffdf07a5aff85c61a7d054b92cbc305980df4e4df8afedeb231e77078b0bcbd071682c0a5", + "RSA-SHA512": "80409076e286025cef2ee16f55e02c8b96a2eb7b8da31218adda76df57b6ec12303ec1eccab269a508ad7547472ffecd569c56773a301655bb32580b479df093", + "dsaEncryption": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "dsaWithSHA": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "dsaWithSHA1": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "dss1": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "ecdsa-with-SHA1": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "md4": "6ae9d4bb24e999169b04deea4c5dcc09", + "md4WithRSAEncryption": "6ae9d4bb24e999169b04deea4c5dcc09", + "md5": "ed4526ba8226d969f47edbb27b2f1144", + "md5WithRSAEncryption": "ed4526ba8226d969f47edbb27b2f1144", + "mdc2": "d970ee061adce2df67add1bfc87f076c", + "mdc2WithRSA": "d970ee061adce2df67add1bfc87f076c", + "ripemd": "b42c0346ecf67deec4f403925804de2aa5b8fe00", + "ripemd160": "b42c0346ecf67deec4f403925804de2aa5b8fe00", + "ripemd160WithRSA": "b42c0346ecf67deec4f403925804de2aa5b8fe00", + "rmd160": "b42c0346ecf67deec4f403925804de2aa5b8fe00", + "sha": "626ab00e7f281cdfa1653aa7b9778d541f668c2f", + "sha1": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "sha1WithRSAEncryption": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "sha224": "5c9dc5097c1d7d72644b70fcc03982e1e2f16da36d003a0ade57d062", + "sha224WithRSAEncryption": "5c9dc5097c1d7d72644b70fcc03982e1e2f16da36d003a0ade57d062", + "sha256": "90c096f9852990cf0fcfbd36ffeb577b4d106d66e9c7a18abdc6f7a3b1ddbab1", + "sha256WithRSAEncryption": "90c096f9852990cf0fcfbd36ffeb577b4d106d66e9c7a18abdc6f7a3b1ddbab1", + "sha384": "f8779f7604c1bc30b0929deffdf07a5aff85c61a7d054b92cbc305980df4e4df8afedeb231e77078b0bcbd071682c0a5", + "sha384WithRSAEncryption": "f8779f7604c1bc30b0929deffdf07a5aff85c61a7d054b92cbc305980df4e4df8afedeb231e77078b0bcbd071682c0a5", + "sha512": "80409076e286025cef2ee16f55e02c8b96a2eb7b8da31218adda76df57b6ec12303ec1eccab269a508ad7547472ffecd569c56773a301655bb32580b479df093", + "sha512WithRSAEncryption": "80409076e286025cef2ee16f55e02c8b96a2eb7b8da31218adda76df57b6ec12303ec1eccab269a508ad7547472ffecd569c56773a301655bb32580b479df093", + "shaWithRSAEncryption": "626ab00e7f281cdfa1653aa7b9778d541f668c2f", + "ssl2-md5": "ed4526ba8226d969f47edbb27b2f1144", + "ssl3-md5": "ed4526ba8226d969f47edbb27b2f1144", + "ssl3-sha1": "57d6cb41aeec20236f365b3a490c61d0cfa39611", + "whirlpool": "1c38deb54f19b75caa86d002e5f05603d894c9a9937e552bf4afb020b14a40a2319c5dc996f7e8b5c0ce90b366321b9a8ee1725ffa05bf945a992bf919db1784" + }, + { + "input": "//4AP8Af//B/+AAB//gf//4AAP//+AB//4A///8Af//4AAwAAA/+fgA/4Bh//gAAOAAAP//+AAAD/P/h/h///gAAB/8=", + "DSA": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "DSA-SHA": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "DSA-SHA1": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "DSA-SHA1-old": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "RSA-MD4": "b1b60a17789bd4d3093c0ebc28509cd1", + "RSA-MD5": "80e6f61dff9da8673fa16dbbdb14d03d", + "RSA-MDC2": "e5854557b5d3af15ee1abe9870d3f683", + "RSA-RIPEMD160": "1862e03f92e0c820d5fb3750b3cd6b0959046539", + "RSA-SHA": "139691134207cf12eb9ec7fd7c88037b60ee0982", + "RSA-SHA1": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "RSA-SHA1-2": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "RSA-SHA224": "a0b23194cc97dcdbec1ba92a20ccb275cafc3c4bd0cbc543c3080855", + "RSA-SHA256": "327b0e47ba3bc200579ac67ac38968e0df655e2d22ffe3adf238f7ac9029a1de", + "RSA-SHA384": "53db2d26ea80665f7a30c7b5650cb180de649a1afdf33a2bfb926beffe5ffbadf8abdc2a34f408b68963cb308f7e0b07", + "RSA-SHA512": "2d2b0df226f6b5d1bf32d9768e976c58c9e523fdb908b65ba43b10efd3f0b44b2bd752e508b1603c3ad86d28d0e0659ca7fa01002d9a7a17822d360575e799d6", + "dsaEncryption": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "dsaWithSHA": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "dsaWithSHA1": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "dss1": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "ecdsa-with-SHA1": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "md4": "b1b60a17789bd4d3093c0ebc28509cd1", + "md4WithRSAEncryption": "b1b60a17789bd4d3093c0ebc28509cd1", + "md5": "80e6f61dff9da8673fa16dbbdb14d03d", + "md5WithRSAEncryption": "80e6f61dff9da8673fa16dbbdb14d03d", + "mdc2": "e5854557b5d3af15ee1abe9870d3f683", + "mdc2WithRSA": "e5854557b5d3af15ee1abe9870d3f683", + "ripemd": "1862e03f92e0c820d5fb3750b3cd6b0959046539", + "ripemd160": "1862e03f92e0c820d5fb3750b3cd6b0959046539", + "ripemd160WithRSA": "1862e03f92e0c820d5fb3750b3cd6b0959046539", + "rmd160": "1862e03f92e0c820d5fb3750b3cd6b0959046539", + "sha": "139691134207cf12eb9ec7fd7c88037b60ee0982", + "sha1": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "sha1WithRSAEncryption": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "sha224": "a0b23194cc97dcdbec1ba92a20ccb275cafc3c4bd0cbc543c3080855", + "sha224WithRSAEncryption": "a0b23194cc97dcdbec1ba92a20ccb275cafc3c4bd0cbc543c3080855", + "sha256": "327b0e47ba3bc200579ac67ac38968e0df655e2d22ffe3adf238f7ac9029a1de", + "sha256WithRSAEncryption": "327b0e47ba3bc200579ac67ac38968e0df655e2d22ffe3adf238f7ac9029a1de", + "sha384": "53db2d26ea80665f7a30c7b5650cb180de649a1afdf33a2bfb926beffe5ffbadf8abdc2a34f408b68963cb308f7e0b07", + "sha384WithRSAEncryption": "53db2d26ea80665f7a30c7b5650cb180de649a1afdf33a2bfb926beffe5ffbadf8abdc2a34f408b68963cb308f7e0b07", + "sha512": "2d2b0df226f6b5d1bf32d9768e976c58c9e523fdb908b65ba43b10efd3f0b44b2bd752e508b1603c3ad86d28d0e0659ca7fa01002d9a7a17822d360575e799d6", + "sha512WithRSAEncryption": "2d2b0df226f6b5d1bf32d9768e976c58c9e523fdb908b65ba43b10efd3f0b44b2bd752e508b1603c3ad86d28d0e0659ca7fa01002d9a7a17822d360575e799d6", + "shaWithRSAEncryption": "139691134207cf12eb9ec7fd7c88037b60ee0982", + "ssl2-md5": "80e6f61dff9da8673fa16dbbdb14d03d", + "ssl3-md5": "80e6f61dff9da8673fa16dbbdb14d03d", + "ssl3-sha1": "c532cb64b4ba826372bccf2b4b5793d5b88bb715", + "whirlpool": "f8a1d24863f0e53d63b78beb2820b699066406092b592d1ec238066c22387de4f3f1644c537d9da9afb45ca3c33fc5adf9ec1b05e294671ae486d65b95d863a3" + }, + { + "input": "AAAH//4AAAf+AAA/4AB//8AAAH///AD+AAP/4AAfD/wAH/+AAAf///AA///wAAAf//gB/+Af//8AH4AH8AAB//gAAf//", + "DSA": "15833b5631032663e783686a209c6a2b47a1080e", + "DSA-SHA": "15833b5631032663e783686a209c6a2b47a1080e", + "DSA-SHA1": "15833b5631032663e783686a209c6a2b47a1080e", + "DSA-SHA1-old": "15833b5631032663e783686a209c6a2b47a1080e", + "RSA-MD4": "ea930b6d997e4b84fa0b694d3ac7646e", + "RSA-MD5": "1d52744bf1450d7c5cfdf1f0bbf967c1", + "RSA-MDC2": "0290b6e8236b904e8e76d4b0cfd7bd97", + "RSA-RIPEMD160": "369b5e4553148a1c8eed5e504fb193248ed51a12", + "RSA-SHA": "d4315369acda2beb95c8b213136900fe5baed499", + "RSA-SHA1": "15833b5631032663e783686a209c6a2b47a1080e", + "RSA-SHA1-2": "15833b5631032663e783686a209c6a2b47a1080e", + "RSA-SHA224": "920b84e0be9ac697f67b657c8dec761cf524f360d3316cf378a7b0a2", + "RSA-SHA256": "bdf4ef8fcafbe13b772ca217eef56a316210e71f69cd943433087c68d9a67bb9", + "RSA-SHA384": "57a23290e0b610841a905ea45e4de76661e1a1dbe89ced84d7ea488ad16de3eb34a0a501b669e5d4470a0205e978768d", + "RSA-SHA512": "aab28280cbd78a6d4efdcd7c39ef64badfe6e781db9c90d25bbe9192d8d609e89e5e512b2072b462985642345643f29a4b3198c81a41f2b99967bcb6b299e227", + "dsaEncryption": "15833b5631032663e783686a209c6a2b47a1080e", + "dsaWithSHA": "15833b5631032663e783686a209c6a2b47a1080e", + "dsaWithSHA1": "15833b5631032663e783686a209c6a2b47a1080e", + "dss1": "15833b5631032663e783686a209c6a2b47a1080e", + "ecdsa-with-SHA1": "15833b5631032663e783686a209c6a2b47a1080e", + "md4": "ea930b6d997e4b84fa0b694d3ac7646e", + "md4WithRSAEncryption": "ea930b6d997e4b84fa0b694d3ac7646e", + "md5": "1d52744bf1450d7c5cfdf1f0bbf967c1", + "md5WithRSAEncryption": "1d52744bf1450d7c5cfdf1f0bbf967c1", + "mdc2": "0290b6e8236b904e8e76d4b0cfd7bd97", + "mdc2WithRSA": "0290b6e8236b904e8e76d4b0cfd7bd97", + "ripemd": "369b5e4553148a1c8eed5e504fb193248ed51a12", + "ripemd160": "369b5e4553148a1c8eed5e504fb193248ed51a12", + "ripemd160WithRSA": "369b5e4553148a1c8eed5e504fb193248ed51a12", + "rmd160": "369b5e4553148a1c8eed5e504fb193248ed51a12", + "sha": "d4315369acda2beb95c8b213136900fe5baed499", + "sha1": "15833b5631032663e783686a209c6a2b47a1080e", + "sha1WithRSAEncryption": "15833b5631032663e783686a209c6a2b47a1080e", + "sha224": "920b84e0be9ac697f67b657c8dec761cf524f360d3316cf378a7b0a2", + "sha224WithRSAEncryption": "920b84e0be9ac697f67b657c8dec761cf524f360d3316cf378a7b0a2", + "sha256": "bdf4ef8fcafbe13b772ca217eef56a316210e71f69cd943433087c68d9a67bb9", + "sha256WithRSAEncryption": "bdf4ef8fcafbe13b772ca217eef56a316210e71f69cd943433087c68d9a67bb9", + "sha384": "57a23290e0b610841a905ea45e4de76661e1a1dbe89ced84d7ea488ad16de3eb34a0a501b669e5d4470a0205e978768d", + "sha384WithRSAEncryption": "57a23290e0b610841a905ea45e4de76661e1a1dbe89ced84d7ea488ad16de3eb34a0a501b669e5d4470a0205e978768d", + "sha512": "aab28280cbd78a6d4efdcd7c39ef64badfe6e781db9c90d25bbe9192d8d609e89e5e512b2072b462985642345643f29a4b3198c81a41f2b99967bcb6b299e227", + "sha512WithRSAEncryption": "aab28280cbd78a6d4efdcd7c39ef64badfe6e781db9c90d25bbe9192d8d609e89e5e512b2072b462985642345643f29a4b3198c81a41f2b99967bcb6b299e227", + "shaWithRSAEncryption": "d4315369acda2beb95c8b213136900fe5baed499", + "ssl2-md5": "1d52744bf1450d7c5cfdf1f0bbf967c1", + "ssl3-md5": "1d52744bf1450d7c5cfdf1f0bbf967c1", + "ssl3-sha1": "15833b5631032663e783686a209c6a2b47a1080e", + "whirlpool": "532d002032565e658fe0b957daa6a1a866c4bc85885cd175889cdacf8cf7da55cffec30a77ed399688d4ff8160b4c14648224a8b2dfc2900312181e5fa58ea7a" + }, + { + "input": "AAA///8D/gAAB8AAAH/8D/AAAB///gAAB8AAAP/+AAA///wB/3/8AB/4AB//B///4AB///wB///wAAH/+AAeAAB//AA//w==", + "DSA": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "DSA-SHA": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "DSA-SHA1": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "DSA-SHA1-old": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "RSA-MD4": "c0e998ff5763b11cb709436c6b8cc3ef", + "RSA-MD5": "3438a953124960bcc44611923a8844ee", + "RSA-MDC2": "afff12f530d3c29fa1e27ed814ca67e1", + "RSA-RIPEMD160": "c97bd95fbcbb86963ec5e5cdecd4036071e63f3a", + "RSA-SHA": "3e3c52fb482fbe6c087f0004ecee0a79edfd341c", + "RSA-SHA1": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "RSA-SHA1-2": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "RSA-SHA224": "6bb6de5c2f3b8daeb6667d84c1d774ffef1fce26d7f62a742c7adc5e", + "RSA-SHA256": "72c955a5adaf9e49d565342b41b36ee5ab9b5a394d003b804e4e361a46bda571", + "RSA-SHA384": "2eba9c18dcfa208bf6b0385c5a12b40efa0dbe9b0b4042f176dec43201c7a62523f10395f01ed353809740c385cfb140", + "RSA-SHA512": "d6c146d5f60a8354f2ba75c199742ca029ea85cb28f136420e4f80298f231173d4b554ab960b7a4adf2710bd77a6b8e64262f3235e7ab1af631a1f0967d81048", + "dsaEncryption": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "dsaWithSHA": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "dsaWithSHA1": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "dss1": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "ecdsa-with-SHA1": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "md4": "c0e998ff5763b11cb709436c6b8cc3ef", + "md4WithRSAEncryption": "c0e998ff5763b11cb709436c6b8cc3ef", + "md5": "3438a953124960bcc44611923a8844ee", + "md5WithRSAEncryption": "3438a953124960bcc44611923a8844ee", + "mdc2": "afff12f530d3c29fa1e27ed814ca67e1", + "mdc2WithRSA": "afff12f530d3c29fa1e27ed814ca67e1", + "ripemd": "c97bd95fbcbb86963ec5e5cdecd4036071e63f3a", + "ripemd160": "c97bd95fbcbb86963ec5e5cdecd4036071e63f3a", + "ripemd160WithRSA": "c97bd95fbcbb86963ec5e5cdecd4036071e63f3a", + "rmd160": "c97bd95fbcbb86963ec5e5cdecd4036071e63f3a", + "sha": "3e3c52fb482fbe6c087f0004ecee0a79edfd341c", + "sha1": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "sha1WithRSAEncryption": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "sha224": "6bb6de5c2f3b8daeb6667d84c1d774ffef1fce26d7f62a742c7adc5e", + "sha224WithRSAEncryption": "6bb6de5c2f3b8daeb6667d84c1d774ffef1fce26d7f62a742c7adc5e", + "sha256": "72c955a5adaf9e49d565342b41b36ee5ab9b5a394d003b804e4e361a46bda571", + "sha256WithRSAEncryption": "72c955a5adaf9e49d565342b41b36ee5ab9b5a394d003b804e4e361a46bda571", + "sha384": "2eba9c18dcfa208bf6b0385c5a12b40efa0dbe9b0b4042f176dec43201c7a62523f10395f01ed353809740c385cfb140", + "sha384WithRSAEncryption": "2eba9c18dcfa208bf6b0385c5a12b40efa0dbe9b0b4042f176dec43201c7a62523f10395f01ed353809740c385cfb140", + "sha512": "d6c146d5f60a8354f2ba75c199742ca029ea85cb28f136420e4f80298f231173d4b554ab960b7a4adf2710bd77a6b8e64262f3235e7ab1af631a1f0967d81048", + "sha512WithRSAEncryption": "d6c146d5f60a8354f2ba75c199742ca029ea85cb28f136420e4f80298f231173d4b554ab960b7a4adf2710bd77a6b8e64262f3235e7ab1af631a1f0967d81048", + "shaWithRSAEncryption": "3e3c52fb482fbe6c087f0004ecee0a79edfd341c", + "ssl2-md5": "3438a953124960bcc44611923a8844ee", + "ssl3-md5": "3438a953124960bcc44611923a8844ee", + "ssl3-sha1": "d04f2043c96e10cd83b574b1e1c217052cd4a6b2", + "whirlpool": "b6385943d8bff5951eb6ee6e80ff6ff04d9db7cdfd928a80847f8f9dc9fcaf773895de2c81767aa99a11155fc9c4763024190f0443936035a928c36786b33bd3" + }, + { + "input": "/j//g//+AAf///AAPgAA///8AEA//gAAA/AAAHA/+A///+AfgAADw///8AAB//APgAAP4P///vAAAf/AAAB/8AAAf/7gAAA=", + "DSA": "e8882627c64db743f7db8b4413dd033fc63beb20", + "DSA-SHA": "e8882627c64db743f7db8b4413dd033fc63beb20", + "DSA-SHA1": "e8882627c64db743f7db8b4413dd033fc63beb20", + "DSA-SHA1-old": "e8882627c64db743f7db8b4413dd033fc63beb20", + "RSA-MD4": "fb06ab2a6f0f44fead1fdaca2500e738", + "RSA-MD5": "b2f341296dd7aabbd4fd8e011be68a7d", + "RSA-MDC2": "8fea14cf0218c68fc738eb14f09588e3", + "RSA-RIPEMD160": "11e597cb26f5b7be9b7a5fd7901b4b949f578e1a", + "RSA-SHA": "f7ca608b47b90ff65e95f63a6ff60f059a259097", + "RSA-SHA1": "e8882627c64db743f7db8b4413dd033fc63beb20", + "RSA-SHA1-2": "e8882627c64db743f7db8b4413dd033fc63beb20", + "RSA-SHA224": "36d7e31a2eadaa06f99b00ccc32503e8bc649992e98f0c4745c586d6", + "RSA-SHA256": "cbd287d6a6707e2cdc8e63a29f758facbdab375bb252183d3af877dea8d25260", + "RSA-SHA384": "6e010fdcccece7abaae07a26f86dfe945b089603f1013a4ae53e00b5d4c5594a83154ef5f38fefdb626a15b25fbd21ec", + "RSA-SHA512": "d278d3750bb1e2bb657f48f47d92d468e82a1f15b589defca3d54a328e9a143c69c810d2a4d5dc4c40f544ae7134fec00471f4a9fd5fb8ce9fd8cc292be1a5d6", + "dsaEncryption": "e8882627c64db743f7db8b4413dd033fc63beb20", + "dsaWithSHA": "e8882627c64db743f7db8b4413dd033fc63beb20", + "dsaWithSHA1": "e8882627c64db743f7db8b4413dd033fc63beb20", + "dss1": "e8882627c64db743f7db8b4413dd033fc63beb20", + "ecdsa-with-SHA1": "e8882627c64db743f7db8b4413dd033fc63beb20", + "md4": "fb06ab2a6f0f44fead1fdaca2500e738", + "md4WithRSAEncryption": "fb06ab2a6f0f44fead1fdaca2500e738", + "md5": "b2f341296dd7aabbd4fd8e011be68a7d", + "md5WithRSAEncryption": "b2f341296dd7aabbd4fd8e011be68a7d", + "mdc2": "8fea14cf0218c68fc738eb14f09588e3", + "mdc2WithRSA": "8fea14cf0218c68fc738eb14f09588e3", + "ripemd": "11e597cb26f5b7be9b7a5fd7901b4b949f578e1a", + "ripemd160": "11e597cb26f5b7be9b7a5fd7901b4b949f578e1a", + "ripemd160WithRSA": "11e597cb26f5b7be9b7a5fd7901b4b949f578e1a", + "rmd160": "11e597cb26f5b7be9b7a5fd7901b4b949f578e1a", + "sha": "f7ca608b47b90ff65e95f63a6ff60f059a259097", + "sha1": "e8882627c64db743f7db8b4413dd033fc63beb20", + "sha1WithRSAEncryption": "e8882627c64db743f7db8b4413dd033fc63beb20", + "sha224": "36d7e31a2eadaa06f99b00ccc32503e8bc649992e98f0c4745c586d6", + "sha224WithRSAEncryption": "36d7e31a2eadaa06f99b00ccc32503e8bc649992e98f0c4745c586d6", + "sha256": "cbd287d6a6707e2cdc8e63a29f758facbdab375bb252183d3af877dea8d25260", + "sha256WithRSAEncryption": "cbd287d6a6707e2cdc8e63a29f758facbdab375bb252183d3af877dea8d25260", + "sha384": "6e010fdcccece7abaae07a26f86dfe945b089603f1013a4ae53e00b5d4c5594a83154ef5f38fefdb626a15b25fbd21ec", + "sha384WithRSAEncryption": "6e010fdcccece7abaae07a26f86dfe945b089603f1013a4ae53e00b5d4c5594a83154ef5f38fefdb626a15b25fbd21ec", + "sha512": "d278d3750bb1e2bb657f48f47d92d468e82a1f15b589defca3d54a328e9a143c69c810d2a4d5dc4c40f544ae7134fec00471f4a9fd5fb8ce9fd8cc292be1a5d6", + "sha512WithRSAEncryption": "d278d3750bb1e2bb657f48f47d92d468e82a1f15b589defca3d54a328e9a143c69c810d2a4d5dc4c40f544ae7134fec00471f4a9fd5fb8ce9fd8cc292be1a5d6", + "shaWithRSAEncryption": "f7ca608b47b90ff65e95f63a6ff60f059a259097", + "ssl2-md5": "b2f341296dd7aabbd4fd8e011be68a7d", + "ssl3-md5": "b2f341296dd7aabbd4fd8e011be68a7d", + "ssl3-sha1": "e8882627c64db743f7db8b4413dd033fc63beb20", + "whirlpool": "aa062ad77797f2e6760717322cfeb60cc80b715cd5f6b639db10f7e57bd3a951bb07e618644cc34562907047f794a981ca80996b3c08fbf90199711fc664e3a9" + }, + { + "input": "AAAD//AB/AAA//8AAH///4AH/4//gAAP//AAADwAA8D///4B//+ADH//+AAAH/AAAH+AAACAAAD///Af/+AA///+H/8fwAAA", + "DSA": "cd2d32286b8867bc124a0af2236fc74be3622199", + "DSA-SHA": "cd2d32286b8867bc124a0af2236fc74be3622199", + "DSA-SHA1": "cd2d32286b8867bc124a0af2236fc74be3622199", + "DSA-SHA1-old": "cd2d32286b8867bc124a0af2236fc74be3622199", + "RSA-MD4": "0e8483bbf21dc089c51ccc6620b9e24c", + "RSA-MD5": "322dba69658a92e9a9ace4d7177fb97d", + "RSA-MDC2": "cb76ad1d1b33af8e8f9be8076e467f3f", + "RSA-RIPEMD160": "14e9a1dff67ef745cb720e18f92f5c0eed54ba2d", + "RSA-SHA": "3679289596070f3a9258fbcdafbacbeaddb94a77", + "RSA-SHA1": "cd2d32286b8867bc124a0af2236fc74be3622199", + "RSA-SHA1-2": "cd2d32286b8867bc124a0af2236fc74be3622199", + "RSA-SHA224": "0a933fd8facdeaefa80657df37645ee534899f954568f365ada176cd", + "RSA-SHA256": "7aa856fd19741a16ec634b1f653cfd5ac224278652e0b0a2903e274be20a048f", + "RSA-SHA384": "c5ea936d90dc270cd5c7825312bb0d06c07cbe41e7cde5e0a14e2731af1a336f736aa2e9d1a4f1eecb05165ddb00e04a", + "RSA-SHA512": "a13267c4d3e417c839e85649445039b75c5f63a24bcdbabf645cd98da1a4c9d86c3e8765b2d969c562f938f83101fdf4a6dc23dd346c3d4a7686c6e5c93bfe32", + "dsaEncryption": "cd2d32286b8867bc124a0af2236fc74be3622199", + "dsaWithSHA": "cd2d32286b8867bc124a0af2236fc74be3622199", + "dsaWithSHA1": "cd2d32286b8867bc124a0af2236fc74be3622199", + "dss1": "cd2d32286b8867bc124a0af2236fc74be3622199", + "ecdsa-with-SHA1": "cd2d32286b8867bc124a0af2236fc74be3622199", + "md4": "0e8483bbf21dc089c51ccc6620b9e24c", + "md4WithRSAEncryption": "0e8483bbf21dc089c51ccc6620b9e24c", + "md5": "322dba69658a92e9a9ace4d7177fb97d", + "md5WithRSAEncryption": "322dba69658a92e9a9ace4d7177fb97d", + "mdc2": "cb76ad1d1b33af8e8f9be8076e467f3f", + "mdc2WithRSA": "cb76ad1d1b33af8e8f9be8076e467f3f", + "ripemd": "14e9a1dff67ef745cb720e18f92f5c0eed54ba2d", + "ripemd160": "14e9a1dff67ef745cb720e18f92f5c0eed54ba2d", + "ripemd160WithRSA": "14e9a1dff67ef745cb720e18f92f5c0eed54ba2d", + "rmd160": "14e9a1dff67ef745cb720e18f92f5c0eed54ba2d", + "sha": "3679289596070f3a9258fbcdafbacbeaddb94a77", + "sha1": "cd2d32286b8867bc124a0af2236fc74be3622199", + "sha1WithRSAEncryption": "cd2d32286b8867bc124a0af2236fc74be3622199", + "sha224": "0a933fd8facdeaefa80657df37645ee534899f954568f365ada176cd", + "sha224WithRSAEncryption": "0a933fd8facdeaefa80657df37645ee534899f954568f365ada176cd", + "sha256": "7aa856fd19741a16ec634b1f653cfd5ac224278652e0b0a2903e274be20a048f", + "sha256WithRSAEncryption": "7aa856fd19741a16ec634b1f653cfd5ac224278652e0b0a2903e274be20a048f", + "sha384": "c5ea936d90dc270cd5c7825312bb0d06c07cbe41e7cde5e0a14e2731af1a336f736aa2e9d1a4f1eecb05165ddb00e04a", + "sha384WithRSAEncryption": "c5ea936d90dc270cd5c7825312bb0d06c07cbe41e7cde5e0a14e2731af1a336f736aa2e9d1a4f1eecb05165ddb00e04a", + "sha512": "a13267c4d3e417c839e85649445039b75c5f63a24bcdbabf645cd98da1a4c9d86c3e8765b2d969c562f938f83101fdf4a6dc23dd346c3d4a7686c6e5c93bfe32", + "sha512WithRSAEncryption": "a13267c4d3e417c839e85649445039b75c5f63a24bcdbabf645cd98da1a4c9d86c3e8765b2d969c562f938f83101fdf4a6dc23dd346c3d4a7686c6e5c93bfe32", + "shaWithRSAEncryption": "3679289596070f3a9258fbcdafbacbeaddb94a77", + "ssl2-md5": "322dba69658a92e9a9ace4d7177fb97d", + "ssl3-md5": "322dba69658a92e9a9ace4d7177fb97d", + "ssl3-sha1": "cd2d32286b8867bc124a0af2236fc74be3622199", + "whirlpool": "2bc9eb2655b27a07decc64d39d5362556a696f8fdbb54f108a25b60ff049447fe31375291eac5c1fa88654cdcac14e692293e15cfb3f5058e4d367ff47d91838" + }, + { + "input": "///+B//AAAY/n/AH//A//h///4H//8AAAgD+AAQABwAAAf///gAAB//+AB/+AAD//+AH+AD///wAP/P//8AAf//gAA///Af//w==", + "DSA": "019b70d745375091ed5c7b218445ec986d0f5a82", + "DSA-SHA": "019b70d745375091ed5c7b218445ec986d0f5a82", + "DSA-SHA1": "019b70d745375091ed5c7b218445ec986d0f5a82", + "DSA-SHA1-old": "019b70d745375091ed5c7b218445ec986d0f5a82", + "RSA-MD4": "a4ca70e522435979e927cf285a457d6a", + "RSA-MD5": "b94a434a98efa493fbbc989360671bb9", + "RSA-MDC2": "43ad1a98c00d2174e1b9f2e40d9a4645", + "RSA-RIPEMD160": "e5a817bc97cc6f6f2981f2048a341529cbd7487b", + "RSA-SHA": "686126c3ed810e13043743736bfb16c874082ef8", + "RSA-SHA1": "019b70d745375091ed5c7b218445ec986d0f5a82", + "RSA-SHA1-2": "019b70d745375091ed5c7b218445ec986d0f5a82", + "RSA-SHA224": "aa57a857afa42b403375fc25e41d7726b8e88de6e827f004dcaff27a", + "RSA-SHA256": "8410cdb01c659f05741fd29469d0dbb0251b4fd8e708abeec4a879047fba7c37", + "RSA-SHA384": "dfde801f1429c77be11eb1d2e753c5fc9802357554c37cd0fcc02b3cc96a26428a3c4b2b053de62b09bdbf2d2e4faeec", + "RSA-SHA512": "94e96bdf3f3c8f4c5eca524a5e22cdcd779c964be49c958ed7810dedfca6fa93025784d5b1c1a181092b99c4b590a3f8b08efe4b6266a1326e322d03c67ed6a9", + "dsaEncryption": "019b70d745375091ed5c7b218445ec986d0f5a82", + "dsaWithSHA": "019b70d745375091ed5c7b218445ec986d0f5a82", + "dsaWithSHA1": "019b70d745375091ed5c7b218445ec986d0f5a82", + "dss1": "019b70d745375091ed5c7b218445ec986d0f5a82", + "ecdsa-with-SHA1": "019b70d745375091ed5c7b218445ec986d0f5a82", + "md4": "a4ca70e522435979e927cf285a457d6a", + "md4WithRSAEncryption": "a4ca70e522435979e927cf285a457d6a", + "md5": "b94a434a98efa493fbbc989360671bb9", + "md5WithRSAEncryption": "b94a434a98efa493fbbc989360671bb9", + "mdc2": "43ad1a98c00d2174e1b9f2e40d9a4645", + "mdc2WithRSA": "43ad1a98c00d2174e1b9f2e40d9a4645", + "ripemd": "e5a817bc97cc6f6f2981f2048a341529cbd7487b", + "ripemd160": "e5a817bc97cc6f6f2981f2048a341529cbd7487b", + "ripemd160WithRSA": "e5a817bc97cc6f6f2981f2048a341529cbd7487b", + "rmd160": "e5a817bc97cc6f6f2981f2048a341529cbd7487b", + "sha": "686126c3ed810e13043743736bfb16c874082ef8", + "sha1": "019b70d745375091ed5c7b218445ec986d0f5a82", + "sha1WithRSAEncryption": "019b70d745375091ed5c7b218445ec986d0f5a82", + "sha224": "aa57a857afa42b403375fc25e41d7726b8e88de6e827f004dcaff27a", + "sha224WithRSAEncryption": "aa57a857afa42b403375fc25e41d7726b8e88de6e827f004dcaff27a", + "sha256": "8410cdb01c659f05741fd29469d0dbb0251b4fd8e708abeec4a879047fba7c37", + "sha256WithRSAEncryption": "8410cdb01c659f05741fd29469d0dbb0251b4fd8e708abeec4a879047fba7c37", + "sha384": "dfde801f1429c77be11eb1d2e753c5fc9802357554c37cd0fcc02b3cc96a26428a3c4b2b053de62b09bdbf2d2e4faeec", + "sha384WithRSAEncryption": "dfde801f1429c77be11eb1d2e753c5fc9802357554c37cd0fcc02b3cc96a26428a3c4b2b053de62b09bdbf2d2e4faeec", + "sha512": "94e96bdf3f3c8f4c5eca524a5e22cdcd779c964be49c958ed7810dedfca6fa93025784d5b1c1a181092b99c4b590a3f8b08efe4b6266a1326e322d03c67ed6a9", + "sha512WithRSAEncryption": "94e96bdf3f3c8f4c5eca524a5e22cdcd779c964be49c958ed7810dedfca6fa93025784d5b1c1a181092b99c4b590a3f8b08efe4b6266a1326e322d03c67ed6a9", + "shaWithRSAEncryption": "686126c3ed810e13043743736bfb16c874082ef8", + "ssl2-md5": "b94a434a98efa493fbbc989360671bb9", + "ssl3-md5": "b94a434a98efa493fbbc989360671bb9", + "ssl3-sha1": "019b70d745375091ed5c7b218445ec986d0f5a82", + "whirlpool": "91f5ba55f93ce51d814a8da695da5c70d41a76901238252c950fc2a9375fcc7d7ea9d7b8d71b15abdeb276076f38f6237a670d34b8a39c820d8e5b9bbcd26dda" + }, + { + "input": "//AAAH4AHgP//wAAc//wAAAP/9///9/8AAf+B//+AAAf3+//8D///AAAB///8AAAf+AH/4AAAH/gA///+f/gAAA/4////AAAA/8=", + "DSA": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "DSA-SHA": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "DSA-SHA1": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "DSA-SHA1-old": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "RSA-MD4": "e0b33c8215006c4079c5bd82ca280d93", + "RSA-MD5": "cd9ce9a01ed810af70999d8ce4c63811", + "RSA-MDC2": "7b0c28be85018111ce5742b9dfe40567", + "RSA-RIPEMD160": "5fc7055572f08fb6507163f1370362a331127e16", + "RSA-SHA": "05d606bbf62b5fb7d79ebd816005397e231bbdb1", + "RSA-SHA1": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "RSA-SHA1-2": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "RSA-SHA224": "a903dd425031ab66475b6829321dd6dd86a5ad129e49b4c96cf77a3f", + "RSA-SHA256": "b5f811baf9c441d04f010f76bcd7eae80c5bb249a40ce37436f0a0296849b8ab", + "RSA-SHA384": "77663453fac83b7a470d97d13b1b1eddd9ea12c1a35512358f650b056886c91b48eb409895625191c73efe88b0af3bf2", + "RSA-SHA512": "c446aae62b6dce4d53665d0598c2e980280edee0c7cac0a033157cca9a9fe6e70e31f334c42ed17de21fce51599cb0392cef59d1c6fade17928892a531f4937e", + "dsaEncryption": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "dsaWithSHA": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "dsaWithSHA1": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "dss1": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "ecdsa-with-SHA1": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "md4": "e0b33c8215006c4079c5bd82ca280d93", + "md4WithRSAEncryption": "e0b33c8215006c4079c5bd82ca280d93", + "md5": "cd9ce9a01ed810af70999d8ce4c63811", + "md5WithRSAEncryption": "cd9ce9a01ed810af70999d8ce4c63811", + "mdc2": "7b0c28be85018111ce5742b9dfe40567", + "mdc2WithRSA": "7b0c28be85018111ce5742b9dfe40567", + "ripemd": "5fc7055572f08fb6507163f1370362a331127e16", + "ripemd160": "5fc7055572f08fb6507163f1370362a331127e16", + "ripemd160WithRSA": "5fc7055572f08fb6507163f1370362a331127e16", + "rmd160": "5fc7055572f08fb6507163f1370362a331127e16", + "sha": "05d606bbf62b5fb7d79ebd816005397e231bbdb1", + "sha1": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "sha1WithRSAEncryption": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "sha224": "a903dd425031ab66475b6829321dd6dd86a5ad129e49b4c96cf77a3f", + "sha224WithRSAEncryption": "a903dd425031ab66475b6829321dd6dd86a5ad129e49b4c96cf77a3f", + "sha256": "b5f811baf9c441d04f010f76bcd7eae80c5bb249a40ce37436f0a0296849b8ab", + "sha256WithRSAEncryption": "b5f811baf9c441d04f010f76bcd7eae80c5bb249a40ce37436f0a0296849b8ab", + "sha384": "77663453fac83b7a470d97d13b1b1eddd9ea12c1a35512358f650b056886c91b48eb409895625191c73efe88b0af3bf2", + "sha384WithRSAEncryption": "77663453fac83b7a470d97d13b1b1eddd9ea12c1a35512358f650b056886c91b48eb409895625191c73efe88b0af3bf2", + "sha512": "c446aae62b6dce4d53665d0598c2e980280edee0c7cac0a033157cca9a9fe6e70e31f334c42ed17de21fce51599cb0392cef59d1c6fade17928892a531f4937e", + "sha512WithRSAEncryption": "c446aae62b6dce4d53665d0598c2e980280edee0c7cac0a033157cca9a9fe6e70e31f334c42ed17de21fce51599cb0392cef59d1c6fade17928892a531f4937e", + "shaWithRSAEncryption": "05d606bbf62b5fb7d79ebd816005397e231bbdb1", + "ssl2-md5": "cd9ce9a01ed810af70999d8ce4c63811", + "ssl3-md5": "cd9ce9a01ed810af70999d8ce4c63811", + "ssl3-sha1": "e5ff5fec1dadbaed02bf2dad4026be6a96b3f2af", + "whirlpool": "65dc765df2bfe7ac3be6cb6bac0bcbc69cdce18c8da069f40837a0a9f3d3472f0ee1bcf0c37fced33d93a21c10631c60071f24e1a749fd2611d6387b1d8be94e" + }, + { + "input": "AAP/AAA//4AB8AAP/gAABgAD///8A///94AAAH/AD//j/g8AAH//AH/4AAD//+4AfgHAAB/gAAf///gAAOH//D/n///4P//8AB//", + "DSA": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "DSA-SHA": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "DSA-SHA1": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "DSA-SHA1-old": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "RSA-MD4": "e0ed0e64439e624f72f41be2dffa1223", + "RSA-MD5": "4c639abb75a0ae0f22c3384cb9c68441", + "RSA-MDC2": "98d39d205c66427b1f308a109d811d64", + "RSA-RIPEMD160": "bc2f04769c2689968d61059f2b964d40399b6005", + "RSA-SHA": "7dc2a915a78faa03a7b6550773c8cfd1280cc0d6", + "RSA-SHA1": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "RSA-SHA1-2": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "RSA-SHA224": "d79284f1cf212b598ddcad25c285c18db8f079ab680ebbd2cc24cde8", + "RSA-SHA256": "9be38d9ac8a9c30e8a5e86e3ede291b23bb381ee41dc662421e394f6b8b9881e", + "RSA-SHA384": "abc18c34c8eb0510bb48311f03202ad7e4cf23b70e79635758c5dc6aba0a1bf931c2b1c567d0d6011cd1b8bce0b1a9a6", + "RSA-SHA512": "cfefe5a6d4a13bb1d4f8d728ef310efc0bd4fb22c01ef685bc6e9b8459591391e871525448484c46ff6872f4b7d60af3c2530ba3d474ba6cf9ab0ec9cd9a4c90", + "dsaEncryption": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "dsaWithSHA": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "dsaWithSHA1": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "dss1": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "ecdsa-with-SHA1": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "md4": "e0ed0e64439e624f72f41be2dffa1223", + "md4WithRSAEncryption": "e0ed0e64439e624f72f41be2dffa1223", + "md5": "4c639abb75a0ae0f22c3384cb9c68441", + "md5WithRSAEncryption": "4c639abb75a0ae0f22c3384cb9c68441", + "mdc2": "98d39d205c66427b1f308a109d811d64", + "mdc2WithRSA": "98d39d205c66427b1f308a109d811d64", + "ripemd": "bc2f04769c2689968d61059f2b964d40399b6005", + "ripemd160": "bc2f04769c2689968d61059f2b964d40399b6005", + "ripemd160WithRSA": "bc2f04769c2689968d61059f2b964d40399b6005", + "rmd160": "bc2f04769c2689968d61059f2b964d40399b6005", + "sha": "7dc2a915a78faa03a7b6550773c8cfd1280cc0d6", + "sha1": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "sha1WithRSAEncryption": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "sha224": "d79284f1cf212b598ddcad25c285c18db8f079ab680ebbd2cc24cde8", + "sha224WithRSAEncryption": "d79284f1cf212b598ddcad25c285c18db8f079ab680ebbd2cc24cde8", + "sha256": "9be38d9ac8a9c30e8a5e86e3ede291b23bb381ee41dc662421e394f6b8b9881e", + "sha256WithRSAEncryption": "9be38d9ac8a9c30e8a5e86e3ede291b23bb381ee41dc662421e394f6b8b9881e", + "sha384": "abc18c34c8eb0510bb48311f03202ad7e4cf23b70e79635758c5dc6aba0a1bf931c2b1c567d0d6011cd1b8bce0b1a9a6", + "sha384WithRSAEncryption": "abc18c34c8eb0510bb48311f03202ad7e4cf23b70e79635758c5dc6aba0a1bf931c2b1c567d0d6011cd1b8bce0b1a9a6", + "sha512": "cfefe5a6d4a13bb1d4f8d728ef310efc0bd4fb22c01ef685bc6e9b8459591391e871525448484c46ff6872f4b7d60af3c2530ba3d474ba6cf9ab0ec9cd9a4c90", + "sha512WithRSAEncryption": "cfefe5a6d4a13bb1d4f8d728ef310efc0bd4fb22c01ef685bc6e9b8459591391e871525448484c46ff6872f4b7d60af3c2530ba3d474ba6cf9ab0ec9cd9a4c90", + "shaWithRSAEncryption": "7dc2a915a78faa03a7b6550773c8cfd1280cc0d6", + "ssl2-md5": "4c639abb75a0ae0f22c3384cb9c68441", + "ssl3-md5": "4c639abb75a0ae0f22c3384cb9c68441", + "ssl3-sha1": "6f4e23b3f2e2c068d13921fe4e5e053ffed4e146", + "whirlpool": "db664aab16edb3a9d3f3664905b46d6d512c1b0f803c3ef1c7ce554a46119f0e343d1468e7365102dc18e245e02a7d64db69ab636e4ef811c8868cb76b7baa78" + }, + { + "input": "AAAP//gAAP///AAf4Af//wAB/9//gAA///wAAA/8B/8AAP+AAAP///AAB///8AD//h///+A///4AAGAAAP//f//wAAP//8AHAAH//w==", + "DSA": "25e179602a575c915067566fba6da930e97f8678", + "DSA-SHA": "25e179602a575c915067566fba6da930e97f8678", + "DSA-SHA1": "25e179602a575c915067566fba6da930e97f8678", + "DSA-SHA1-old": "25e179602a575c915067566fba6da930e97f8678", + "RSA-MD4": "ba1eb37016b94baba3a1ea3c695809ba", + "RSA-MD5": "fe31ffcced1717988c854c2f3492466e", + "RSA-MDC2": "d38c6004161e0117d76ca9fb6cd94d96", + "RSA-RIPEMD160": "33731b611b0b525f589952fab271b2fc90ecaa7b", + "RSA-SHA": "4b35df60174be0bd138e6649209086a209e2fb82", + "RSA-SHA1": "25e179602a575c915067566fba6da930e97f8678", + "RSA-SHA1-2": "25e179602a575c915067566fba6da930e97f8678", + "RSA-SHA224": "f7d5e2c06b1b25c24243f89b69b1417e8308e135414c319dd45c0a04", + "RSA-SHA256": "ef45cac2d6f325a523c40a989f5554e152f8d65cbd22d35824d1f28378658432", + "RSA-SHA384": "4e21a1ab31bffedd33c2800087346e1f9a5452bcd10889033726451b06fbaa2b51da0d1b47fc52b1cc739e61101e1ea4", + "RSA-SHA512": "b82c05e20de02ae1ee1e68f0c0467b40ccf82e201f96176f940f39117df5d8ad76c351b934cc6aab9d6c857d8d90af4ba4881d11cb8c83bd924aba69d6eafc20", + "dsaEncryption": "25e179602a575c915067566fba6da930e97f8678", + "dsaWithSHA": "25e179602a575c915067566fba6da930e97f8678", + "dsaWithSHA1": "25e179602a575c915067566fba6da930e97f8678", + "dss1": "25e179602a575c915067566fba6da930e97f8678", + "ecdsa-with-SHA1": "25e179602a575c915067566fba6da930e97f8678", + "md4": "ba1eb37016b94baba3a1ea3c695809ba", + "md4WithRSAEncryption": "ba1eb37016b94baba3a1ea3c695809ba", + "md5": "fe31ffcced1717988c854c2f3492466e", + "md5WithRSAEncryption": "fe31ffcced1717988c854c2f3492466e", + "mdc2": "d38c6004161e0117d76ca9fb6cd94d96", + "mdc2WithRSA": "d38c6004161e0117d76ca9fb6cd94d96", + "ripemd": "33731b611b0b525f589952fab271b2fc90ecaa7b", + "ripemd160": "33731b611b0b525f589952fab271b2fc90ecaa7b", + "ripemd160WithRSA": "33731b611b0b525f589952fab271b2fc90ecaa7b", + "rmd160": "33731b611b0b525f589952fab271b2fc90ecaa7b", + "sha": "4b35df60174be0bd138e6649209086a209e2fb82", + "sha1": "25e179602a575c915067566fba6da930e97f8678", + "sha1WithRSAEncryption": "25e179602a575c915067566fba6da930e97f8678", + "sha224": "f7d5e2c06b1b25c24243f89b69b1417e8308e135414c319dd45c0a04", + "sha224WithRSAEncryption": "f7d5e2c06b1b25c24243f89b69b1417e8308e135414c319dd45c0a04", + "sha256": "ef45cac2d6f325a523c40a989f5554e152f8d65cbd22d35824d1f28378658432", + "sha256WithRSAEncryption": "ef45cac2d6f325a523c40a989f5554e152f8d65cbd22d35824d1f28378658432", + "sha384": "4e21a1ab31bffedd33c2800087346e1f9a5452bcd10889033726451b06fbaa2b51da0d1b47fc52b1cc739e61101e1ea4", + "sha384WithRSAEncryption": "4e21a1ab31bffedd33c2800087346e1f9a5452bcd10889033726451b06fbaa2b51da0d1b47fc52b1cc739e61101e1ea4", + "sha512": "b82c05e20de02ae1ee1e68f0c0467b40ccf82e201f96176f940f39117df5d8ad76c351b934cc6aab9d6c857d8d90af4ba4881d11cb8c83bd924aba69d6eafc20", + "sha512WithRSAEncryption": "b82c05e20de02ae1ee1e68f0c0467b40ccf82e201f96176f940f39117df5d8ad76c351b934cc6aab9d6c857d8d90af4ba4881d11cb8c83bd924aba69d6eafc20", + "shaWithRSAEncryption": "4b35df60174be0bd138e6649209086a209e2fb82", + "ssl2-md5": "fe31ffcced1717988c854c2f3492466e", + "ssl3-md5": "fe31ffcced1717988c854c2f3492466e", + "ssl3-sha1": "25e179602a575c915067566fba6da930e97f8678", + "whirlpool": "7554acf88217af7a14a40e8652ae446bb5ca4e392b376670193a408346a9a351d167cce27dc295a4f5a56c196500718644c6ee9749aef46767b4e153b87712d5" + }, + { + "input": "AAAgf/4Pg///gAP/AAAA///gAB///+AAP/5///AAH///4AAA//+H/8AAF/3/n//7///gAAPgAAf/n///gAB///8AAf//wP//wBAAAB8=", + "DSA": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "DSA-SHA": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "DSA-SHA1": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "DSA-SHA1-old": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "RSA-MD4": "043ce077b7bb5344fe630ff312606d9b", + "RSA-MD5": "b56d81337f9bbf0d838df831e9b40216", + "RSA-MDC2": "63422bd277fbf0daa6dc2ccfe1f28987", + "RSA-RIPEMD160": "eea47325f8882a8ddf48ebb209ea4acb077ba971", + "RSA-SHA": "04586f55308d4a48e75b536d9a4155457c974ea5", + "RSA-SHA1": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "RSA-SHA1-2": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "RSA-SHA224": "856ae98e7c9a3471d3b0ebd8e5b60bda641046059f8c041f51ba4c61", + "RSA-SHA256": "8e3d126f3a316e0ec49741a3ae6215e29c4acaee364272b7087d9b766579e00c", + "RSA-SHA384": "8afbdb82a65f2c525d3b998e2ccd7f03769b6eb3dbb0f9b4d505202a753fd369f4140f2dcf5970c5cd501099e6823e21", + "RSA-SHA512": "c4b58481ad9de99212d85c7382dabf79b3e59307152163d748573a56fa844718ded648b77b31dcf1456b269fbf3e4e27c7edb89a10c4a0bbb5f014bbb3962293", + "dsaEncryption": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "dsaWithSHA": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "dsaWithSHA1": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "dss1": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "ecdsa-with-SHA1": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "md4": "043ce077b7bb5344fe630ff312606d9b", + "md4WithRSAEncryption": "043ce077b7bb5344fe630ff312606d9b", + "md5": "b56d81337f9bbf0d838df831e9b40216", + "md5WithRSAEncryption": "b56d81337f9bbf0d838df831e9b40216", + "mdc2": "63422bd277fbf0daa6dc2ccfe1f28987", + "mdc2WithRSA": "63422bd277fbf0daa6dc2ccfe1f28987", + "ripemd": "eea47325f8882a8ddf48ebb209ea4acb077ba971", + "ripemd160": "eea47325f8882a8ddf48ebb209ea4acb077ba971", + "ripemd160WithRSA": "eea47325f8882a8ddf48ebb209ea4acb077ba971", + "rmd160": "eea47325f8882a8ddf48ebb209ea4acb077ba971", + "sha": "04586f55308d4a48e75b536d9a4155457c974ea5", + "sha1": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "sha1WithRSAEncryption": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "sha224": "856ae98e7c9a3471d3b0ebd8e5b60bda641046059f8c041f51ba4c61", + "sha224WithRSAEncryption": "856ae98e7c9a3471d3b0ebd8e5b60bda641046059f8c041f51ba4c61", + "sha256": "8e3d126f3a316e0ec49741a3ae6215e29c4acaee364272b7087d9b766579e00c", + "sha256WithRSAEncryption": "8e3d126f3a316e0ec49741a3ae6215e29c4acaee364272b7087d9b766579e00c", + "sha384": "8afbdb82a65f2c525d3b998e2ccd7f03769b6eb3dbb0f9b4d505202a753fd369f4140f2dcf5970c5cd501099e6823e21", + "sha384WithRSAEncryption": "8afbdb82a65f2c525d3b998e2ccd7f03769b6eb3dbb0f9b4d505202a753fd369f4140f2dcf5970c5cd501099e6823e21", + "sha512": "c4b58481ad9de99212d85c7382dabf79b3e59307152163d748573a56fa844718ded648b77b31dcf1456b269fbf3e4e27c7edb89a10c4a0bbb5f014bbb3962293", + "sha512WithRSAEncryption": "c4b58481ad9de99212d85c7382dabf79b3e59307152163d748573a56fa844718ded648b77b31dcf1456b269fbf3e4e27c7edb89a10c4a0bbb5f014bbb3962293", + "shaWithRSAEncryption": "04586f55308d4a48e75b536d9a4155457c974ea5", + "ssl2-md5": "b56d81337f9bbf0d838df831e9b40216", + "ssl3-md5": "b56d81337f9bbf0d838df831e9b40216", + "ssl3-sha1": "67ded0e68e235c8a523e051e86108eeb757efbfd", + "whirlpool": "12c9d37c12df2db88eae2c5a3031829dba0ccfa2c7fd7beaaa2a8f623f7b6de2ee43de816f2db69902b1f80c6aecb42a4a31737cf61ab945ead77c9f3ac569c6" + }, + { + "input": "AAAH/8AA/+AAB/+AA4AAD/gAAH///gAAGAD/8CAB//4AAGAP8OAD//4APh///AAD/4AAAP/4AAEAAA/z//wAA///4f//wfAAAP///wAA", + "DSA": "af78536ea83c822796745556d62a3ee82c7be098", + "DSA-SHA": "af78536ea83c822796745556d62a3ee82c7be098", + "DSA-SHA1": "af78536ea83c822796745556d62a3ee82c7be098", + "DSA-SHA1-old": "af78536ea83c822796745556d62a3ee82c7be098", + "RSA-MD4": "7f9c8eef3364d36d66bde429a1a36f05", + "RSA-MD5": "0be9161adfeb2dd1c3f20338bfb3ec4b", + "RSA-MDC2": "91895baa7223f2e1b9d8acaa6490066a", + "RSA-RIPEMD160": "01ea808373af742994bc4440e60dfc9ea17c79ad", + "RSA-SHA": "35389446aef5b4b708ac2504f69da56119a2b7a1", + "RSA-SHA1": "af78536ea83c822796745556d62a3ee82c7be098", + "RSA-SHA1-2": "af78536ea83c822796745556d62a3ee82c7be098", + "RSA-SHA224": "387a49bd7462ffa6df6d885202092417ed918a170e5b5babafc5fc84", + "RSA-SHA256": "a43ee360b1dc90c573bef4145e1d4557166d7cce6ea1ed33e0cbd909643c3621", + "RSA-SHA384": "f9b8d542a5b27f8d36e03d6062027e1dbfe05df3cd55561005d1ab4c26f8c97ce2c0bf42eee14ea72a7b1d6a8ed4aad6", + "RSA-SHA512": "c5706521041bc9554215370dfc9bc0c480fa995d46ed5698a63270dba26a901ae059232d9377c150a7d254d23197e56d05ab1e195b8e25dddd9282eb253cc1cb", + "dsaEncryption": "af78536ea83c822796745556d62a3ee82c7be098", + "dsaWithSHA": "af78536ea83c822796745556d62a3ee82c7be098", + "dsaWithSHA1": "af78536ea83c822796745556d62a3ee82c7be098", + "dss1": "af78536ea83c822796745556d62a3ee82c7be098", + "ecdsa-with-SHA1": "af78536ea83c822796745556d62a3ee82c7be098", + "md4": "7f9c8eef3364d36d66bde429a1a36f05", + "md4WithRSAEncryption": "7f9c8eef3364d36d66bde429a1a36f05", + "md5": "0be9161adfeb2dd1c3f20338bfb3ec4b", + "md5WithRSAEncryption": "0be9161adfeb2dd1c3f20338bfb3ec4b", + "mdc2": "91895baa7223f2e1b9d8acaa6490066a", + "mdc2WithRSA": "91895baa7223f2e1b9d8acaa6490066a", + "ripemd": "01ea808373af742994bc4440e60dfc9ea17c79ad", + "ripemd160": "01ea808373af742994bc4440e60dfc9ea17c79ad", + "ripemd160WithRSA": "01ea808373af742994bc4440e60dfc9ea17c79ad", + "rmd160": "01ea808373af742994bc4440e60dfc9ea17c79ad", + "sha": "35389446aef5b4b708ac2504f69da56119a2b7a1", + "sha1": "af78536ea83c822796745556d62a3ee82c7be098", + "sha1WithRSAEncryption": "af78536ea83c822796745556d62a3ee82c7be098", + "sha224": "387a49bd7462ffa6df6d885202092417ed918a170e5b5babafc5fc84", + "sha224WithRSAEncryption": "387a49bd7462ffa6df6d885202092417ed918a170e5b5babafc5fc84", + "sha256": "a43ee360b1dc90c573bef4145e1d4557166d7cce6ea1ed33e0cbd909643c3621", + "sha256WithRSAEncryption": "a43ee360b1dc90c573bef4145e1d4557166d7cce6ea1ed33e0cbd909643c3621", + "sha384": "f9b8d542a5b27f8d36e03d6062027e1dbfe05df3cd55561005d1ab4c26f8c97ce2c0bf42eee14ea72a7b1d6a8ed4aad6", + "sha384WithRSAEncryption": "f9b8d542a5b27f8d36e03d6062027e1dbfe05df3cd55561005d1ab4c26f8c97ce2c0bf42eee14ea72a7b1d6a8ed4aad6", + "sha512": "c5706521041bc9554215370dfc9bc0c480fa995d46ed5698a63270dba26a901ae059232d9377c150a7d254d23197e56d05ab1e195b8e25dddd9282eb253cc1cb", + "sha512WithRSAEncryption": "c5706521041bc9554215370dfc9bc0c480fa995d46ed5698a63270dba26a901ae059232d9377c150a7d254d23197e56d05ab1e195b8e25dddd9282eb253cc1cb", + "shaWithRSAEncryption": "35389446aef5b4b708ac2504f69da56119a2b7a1", + "ssl2-md5": "0be9161adfeb2dd1c3f20338bfb3ec4b", + "ssl3-md5": "0be9161adfeb2dd1c3f20338bfb3ec4b", + "ssl3-sha1": "af78536ea83c822796745556d62a3ee82c7be098", + "whirlpool": "c06233aabbc0f149862da341657c771908c945a75d37a9b400675a6a491f7d21606481770ed96fe74549a54d009be7ed20eddba1ebdc2d3a37c4be8cbaef2b92" + }, + { + "input": "///wAAAH//wAf4f//wAAAH//wH//gAAD8P8//4AwB///H44Af///wAH//Af4AAB///wAP/AA+AAAB/8AAA4AD/+AAH/AAf+P+AAHAf///w==", + "DSA": "64d7ac52e47834be72455f6c64325f9c358b610d", + "DSA-SHA": "64d7ac52e47834be72455f6c64325f9c358b610d", + "DSA-SHA1": "64d7ac52e47834be72455f6c64325f9c358b610d", + "DSA-SHA1-old": "64d7ac52e47834be72455f6c64325f9c358b610d", + "RSA-MD4": "5769b012c8bacc12aaa0dff947bac486", + "RSA-MD5": "be7b7c9fa1ab09d6578a3f2a82bfafe3", + "RSA-MDC2": "f7dfde1489a0857b14f0d2ca35a8d587", + "RSA-RIPEMD160": "79cc9fd2779727a67bd592cdcb5b32cfba7752e4", + "RSA-SHA": "52318c99d321af4a496cade427ebed24821e247c", + "RSA-SHA1": "64d7ac52e47834be72455f6c64325f9c358b610d", + "RSA-SHA1-2": "64d7ac52e47834be72455f6c64325f9c358b610d", + "RSA-SHA224": "7b4db2c69f766cf2ddaf3ba0e25ed9db407ae002866bddc435f7f6d9", + "RSA-SHA256": "5396745f9645dad55b732efde57de49c2ae40624fee192579014dc2b79d814d5", + "RSA-SHA384": "542d258b04158fd5a7246005a205f39d04f9e0819a43bda53ced1b4bfb352d3af75d6e95220c0d88c88e269d881db3f1", + "RSA-SHA512": "7d8a31bde32e9ca2d71e7088c919e0b3640b44bb861071b67f862d748839185fa9ced67edfa8aa6761bc82163efbf343c5ec6b5f26970026361672b686f4251a", + "dsaEncryption": "64d7ac52e47834be72455f6c64325f9c358b610d", + "dsaWithSHA": "64d7ac52e47834be72455f6c64325f9c358b610d", + "dsaWithSHA1": "64d7ac52e47834be72455f6c64325f9c358b610d", + "dss1": "64d7ac52e47834be72455f6c64325f9c358b610d", + "ecdsa-with-SHA1": "64d7ac52e47834be72455f6c64325f9c358b610d", + "md4": "5769b012c8bacc12aaa0dff947bac486", + "md4WithRSAEncryption": "5769b012c8bacc12aaa0dff947bac486", + "md5": "be7b7c9fa1ab09d6578a3f2a82bfafe3", + "md5WithRSAEncryption": "be7b7c9fa1ab09d6578a3f2a82bfafe3", + "mdc2": "f7dfde1489a0857b14f0d2ca35a8d587", + "mdc2WithRSA": "f7dfde1489a0857b14f0d2ca35a8d587", + "ripemd": "79cc9fd2779727a67bd592cdcb5b32cfba7752e4", + "ripemd160": "79cc9fd2779727a67bd592cdcb5b32cfba7752e4", + "ripemd160WithRSA": "79cc9fd2779727a67bd592cdcb5b32cfba7752e4", + "rmd160": "79cc9fd2779727a67bd592cdcb5b32cfba7752e4", + "sha": "52318c99d321af4a496cade427ebed24821e247c", + "sha1": "64d7ac52e47834be72455f6c64325f9c358b610d", + "sha1WithRSAEncryption": "64d7ac52e47834be72455f6c64325f9c358b610d", + "sha224": "7b4db2c69f766cf2ddaf3ba0e25ed9db407ae002866bddc435f7f6d9", + "sha224WithRSAEncryption": "7b4db2c69f766cf2ddaf3ba0e25ed9db407ae002866bddc435f7f6d9", + "sha256": "5396745f9645dad55b732efde57de49c2ae40624fee192579014dc2b79d814d5", + "sha256WithRSAEncryption": "5396745f9645dad55b732efde57de49c2ae40624fee192579014dc2b79d814d5", + "sha384": "542d258b04158fd5a7246005a205f39d04f9e0819a43bda53ced1b4bfb352d3af75d6e95220c0d88c88e269d881db3f1", + "sha384WithRSAEncryption": "542d258b04158fd5a7246005a205f39d04f9e0819a43bda53ced1b4bfb352d3af75d6e95220c0d88c88e269d881db3f1", + "sha512": "7d8a31bde32e9ca2d71e7088c919e0b3640b44bb861071b67f862d748839185fa9ced67edfa8aa6761bc82163efbf343c5ec6b5f26970026361672b686f4251a", + "sha512WithRSAEncryption": "7d8a31bde32e9ca2d71e7088c919e0b3640b44bb861071b67f862d748839185fa9ced67edfa8aa6761bc82163efbf343c5ec6b5f26970026361672b686f4251a", + "shaWithRSAEncryption": "52318c99d321af4a496cade427ebed24821e247c", + "ssl2-md5": "be7b7c9fa1ab09d6578a3f2a82bfafe3", + "ssl3-md5": "be7b7c9fa1ab09d6578a3f2a82bfafe3", + "ssl3-sha1": "64d7ac52e47834be72455f6c64325f9c358b610d", + "whirlpool": "2c50b3c64b854f4410f7b32adb82439412d38b035096caf95884c9336b8d2aecb1795218d57f592d7767f1e98068c63707c61948a5d121d1a6081bc656f71ffb" + }, + { + "input": "/4A//z/+AAD///+f//g///gAAA/4AAAD/gB///8AD/8B//AP/+Agf//8/wH4AAf/4AB/+AAP/4AAAH/gAD/4Af4AB//wAAB////AAAH///8=", + "DSA": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "DSA-SHA": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "DSA-SHA1": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "DSA-SHA1-old": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "RSA-MD4": "59871deaec467a863fa9e971864f9ceb", + "RSA-MD5": "f6bdc04b4611ddf0aa8403bcb04292f7", + "RSA-MDC2": "2fdea8d86abe5a366735b0c79c1b1dc8", + "RSA-RIPEMD160": "8289141680171d1fafd4a234613788f51a9ed504", + "RSA-SHA": "808f17895d75dd558becdd0bbd0885927b7e4ab8", + "RSA-SHA1": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "RSA-SHA1-2": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "RSA-SHA224": "ff92027dd3fb54d85cfc0e03c3c8e1782ba526ee9080b581a9992dc5", + "RSA-SHA256": "b617be050dedb47be64d82dc19e3d84b6799b5bada18944df5417759a85e445e", + "RSA-SHA384": "aed6284880a9caf799ff972de663e68fb2cb6948e2571df884831e532e4aee503fb27141e83b220bb2efaf96205ebbbd", + "RSA-SHA512": "b78eb89bbe88846d006364775b54beb32e9308fd578c810fcec790d053de4abd7554831a67c63c9e9cfaa39bb327de60097d90b4728034410ba20b4398bf59c3", + "dsaEncryption": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "dsaWithSHA": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "dsaWithSHA1": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "dss1": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "ecdsa-with-SHA1": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "md4": "59871deaec467a863fa9e971864f9ceb", + "md4WithRSAEncryption": "59871deaec467a863fa9e971864f9ceb", + "md5": "f6bdc04b4611ddf0aa8403bcb04292f7", + "md5WithRSAEncryption": "f6bdc04b4611ddf0aa8403bcb04292f7", + "mdc2": "2fdea8d86abe5a366735b0c79c1b1dc8", + "mdc2WithRSA": "2fdea8d86abe5a366735b0c79c1b1dc8", + "ripemd": "8289141680171d1fafd4a234613788f51a9ed504", + "ripemd160": "8289141680171d1fafd4a234613788f51a9ed504", + "ripemd160WithRSA": "8289141680171d1fafd4a234613788f51a9ed504", + "rmd160": "8289141680171d1fafd4a234613788f51a9ed504", + "sha": "808f17895d75dd558becdd0bbd0885927b7e4ab8", + "sha1": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "sha1WithRSAEncryption": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "sha224": "ff92027dd3fb54d85cfc0e03c3c8e1782ba526ee9080b581a9992dc5", + "sha224WithRSAEncryption": "ff92027dd3fb54d85cfc0e03c3c8e1782ba526ee9080b581a9992dc5", + "sha256": "b617be050dedb47be64d82dc19e3d84b6799b5bada18944df5417759a85e445e", + "sha256WithRSAEncryption": "b617be050dedb47be64d82dc19e3d84b6799b5bada18944df5417759a85e445e", + "sha384": "aed6284880a9caf799ff972de663e68fb2cb6948e2571df884831e532e4aee503fb27141e83b220bb2efaf96205ebbbd", + "sha384WithRSAEncryption": "aed6284880a9caf799ff972de663e68fb2cb6948e2571df884831e532e4aee503fb27141e83b220bb2efaf96205ebbbd", + "sha512": "b78eb89bbe88846d006364775b54beb32e9308fd578c810fcec790d053de4abd7554831a67c63c9e9cfaa39bb327de60097d90b4728034410ba20b4398bf59c3", + "sha512WithRSAEncryption": "b78eb89bbe88846d006364775b54beb32e9308fd578c810fcec790d053de4abd7554831a67c63c9e9cfaa39bb327de60097d90b4728034410ba20b4398bf59c3", + "shaWithRSAEncryption": "808f17895d75dd558becdd0bbd0885927b7e4ab8", + "ssl2-md5": "f6bdc04b4611ddf0aa8403bcb04292f7", + "ssl3-md5": "f6bdc04b4611ddf0aa8403bcb04292f7", + "ssl3-sha1": "9d4866baa3639c13e541f250ffa3d8bc157a491f", + "whirlpool": "1500ac67e5dca38e5cefdf16ae0fff6e36a54552096845e7f849defd37e2e1b13dc4950e01bcea1edf40c32aad6031de5dd9c64ecd9fa50d0e31808e58d780fc" + }, + { + "input": "AH//4AAB///4AAA///wAf/4AAAP///AD/+AAf4AAD/8/+AAAf///AAeAH4P4AAAP/j//wD///h/gAAfAA//wD8AAA///gAAAf4AAAP//gAAA", + "DSA": "2e258811961d3eb876f30e7019241a01f9517bec", + "DSA-SHA": "2e258811961d3eb876f30e7019241a01f9517bec", + "DSA-SHA1": "2e258811961d3eb876f30e7019241a01f9517bec", + "DSA-SHA1-old": "2e258811961d3eb876f30e7019241a01f9517bec", + "RSA-MD4": "cd9eaa2cf632ea84c4a33f591b615fca", + "RSA-MD5": "1c7146a10f3c76b0c1dd4af354b14982", + "RSA-MDC2": "d19fd9c547abc3762168aa444e1fdbfe", + "RSA-RIPEMD160": "594ce2c0fd56a495a20c3576a6cab628adb8d245", + "RSA-SHA": "7d763f41ab0edc18ee03ea6f1e60443b27bf6ee7", + "RSA-SHA1": "2e258811961d3eb876f30e7019241a01f9517bec", + "RSA-SHA1-2": "2e258811961d3eb876f30e7019241a01f9517bec", + "RSA-SHA224": "f2d520bb881c5420638f0c33629a5d9063d13bd2e483fd998a8d4092", + "RSA-SHA256": "17d5520a82dd7c945de6a92200d036cd95bb16330f0f95df802d23e90c8e5c2c", + "RSA-SHA384": "fa2bb9e84da6538bda60469291c92795edb64f5debedbb4eca6b55374a3f81c9a4bf1ca5537d800a7e2328237fe214e1", + "RSA-SHA512": "37956b43f14a97e2ba3c4a58f13599b8ed7aa419d199939d25b069c00c43d71731d6e9be6d5086a91d5b65aae51581f1d71c481783468c7872dabd068aa71bf6", + "dsaEncryption": "2e258811961d3eb876f30e7019241a01f9517bec", + "dsaWithSHA": "2e258811961d3eb876f30e7019241a01f9517bec", + "dsaWithSHA1": "2e258811961d3eb876f30e7019241a01f9517bec", + "dss1": "2e258811961d3eb876f30e7019241a01f9517bec", + "ecdsa-with-SHA1": "2e258811961d3eb876f30e7019241a01f9517bec", + "md4": "cd9eaa2cf632ea84c4a33f591b615fca", + "md4WithRSAEncryption": "cd9eaa2cf632ea84c4a33f591b615fca", + "md5": "1c7146a10f3c76b0c1dd4af354b14982", + "md5WithRSAEncryption": "1c7146a10f3c76b0c1dd4af354b14982", + "mdc2": "d19fd9c547abc3762168aa444e1fdbfe", + "mdc2WithRSA": "d19fd9c547abc3762168aa444e1fdbfe", + "ripemd": "594ce2c0fd56a495a20c3576a6cab628adb8d245", + "ripemd160": "594ce2c0fd56a495a20c3576a6cab628adb8d245", + "ripemd160WithRSA": "594ce2c0fd56a495a20c3576a6cab628adb8d245", + "rmd160": "594ce2c0fd56a495a20c3576a6cab628adb8d245", + "sha": "7d763f41ab0edc18ee03ea6f1e60443b27bf6ee7", + "sha1": "2e258811961d3eb876f30e7019241a01f9517bec", + "sha1WithRSAEncryption": "2e258811961d3eb876f30e7019241a01f9517bec", + "sha224": "f2d520bb881c5420638f0c33629a5d9063d13bd2e483fd998a8d4092", + "sha224WithRSAEncryption": "f2d520bb881c5420638f0c33629a5d9063d13bd2e483fd998a8d4092", + "sha256": "17d5520a82dd7c945de6a92200d036cd95bb16330f0f95df802d23e90c8e5c2c", + "sha256WithRSAEncryption": "17d5520a82dd7c945de6a92200d036cd95bb16330f0f95df802d23e90c8e5c2c", + "sha384": "fa2bb9e84da6538bda60469291c92795edb64f5debedbb4eca6b55374a3f81c9a4bf1ca5537d800a7e2328237fe214e1", + "sha384WithRSAEncryption": "fa2bb9e84da6538bda60469291c92795edb64f5debedbb4eca6b55374a3f81c9a4bf1ca5537d800a7e2328237fe214e1", + "sha512": "37956b43f14a97e2ba3c4a58f13599b8ed7aa419d199939d25b069c00c43d71731d6e9be6d5086a91d5b65aae51581f1d71c481783468c7872dabd068aa71bf6", + "sha512WithRSAEncryption": "37956b43f14a97e2ba3c4a58f13599b8ed7aa419d199939d25b069c00c43d71731d6e9be6d5086a91d5b65aae51581f1d71c481783468c7872dabd068aa71bf6", + "shaWithRSAEncryption": "7d763f41ab0edc18ee03ea6f1e60443b27bf6ee7", + "ssl2-md5": "1c7146a10f3c76b0c1dd4af354b14982", + "ssl3-md5": "1c7146a10f3c76b0c1dd4af354b14982", + "ssl3-sha1": "2e258811961d3eb876f30e7019241a01f9517bec", + "whirlpool": "186a8ad78da11af36c26a991265c43322df1c94d6cc2bd8573c0b165680e5c3033415e5de785355920c17706ff9cf476150180f17a1fa1cf33f53e40711e54a1" + }, + { + "input": "/gAAIAAEAA///8AB//g/wAAA///AAP///4AAP/gAf//+f/gAf/+AB//AAA//+AB//8AA///AP///4A///+DgH/+AAAB//8Bx///8AAH///gAAA==", + "DSA": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "DSA-SHA": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "DSA-SHA1": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "DSA-SHA1-old": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "RSA-MD4": "a8f4ede471fb47445c6d358d603a8f65", + "RSA-MD5": "0d3d987f94aee65f84436696bcf33ea4", + "RSA-MDC2": "2db8a6df01a2dc676552ea3aff1b29cf", + "RSA-RIPEMD160": "ffe837eae27ac304cacfc4dee09d320bdad1846e", + "RSA-SHA": "7a933688ce6ca9fdbb12c1fc10a2b6a8c3e1af9b", + "RSA-SHA1": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "RSA-SHA1-2": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "RSA-SHA224": "2a19b663463dbac2dc2af1be0dfe1ce2066ab608b3f7787b3ae3c33e", + "RSA-SHA256": "b71e5a677801057ec719ae2655732720644bc8f999a8698876c92e4323d4ae0f", + "RSA-SHA384": "f96a5754e25deef63d7478f1e0d4cb8c25a3f6471af5a6ca0bb98290d7a1a69c5a80ceb1404671f903289dab0c1def2c", + "RSA-SHA512": "bb5802eb5e8011a5b87c81cb4b8562ea03ab2e82168963cfe2c88999d8b341e63b1215a356b328b4cf515b0975da9a5ef51bac9cd13ea8f938e24dcd1a52b9fa", + "dsaEncryption": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "dsaWithSHA": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "dsaWithSHA1": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "dss1": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "ecdsa-with-SHA1": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "md4": "a8f4ede471fb47445c6d358d603a8f65", + "md4WithRSAEncryption": "a8f4ede471fb47445c6d358d603a8f65", + "md5": "0d3d987f94aee65f84436696bcf33ea4", + "md5WithRSAEncryption": "0d3d987f94aee65f84436696bcf33ea4", + "mdc2": "2db8a6df01a2dc676552ea3aff1b29cf", + "mdc2WithRSA": "2db8a6df01a2dc676552ea3aff1b29cf", + "ripemd": "ffe837eae27ac304cacfc4dee09d320bdad1846e", + "ripemd160": "ffe837eae27ac304cacfc4dee09d320bdad1846e", + "ripemd160WithRSA": "ffe837eae27ac304cacfc4dee09d320bdad1846e", + "rmd160": "ffe837eae27ac304cacfc4dee09d320bdad1846e", + "sha": "7a933688ce6ca9fdbb12c1fc10a2b6a8c3e1af9b", + "sha1": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "sha1WithRSAEncryption": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "sha224": "2a19b663463dbac2dc2af1be0dfe1ce2066ab608b3f7787b3ae3c33e", + "sha224WithRSAEncryption": "2a19b663463dbac2dc2af1be0dfe1ce2066ab608b3f7787b3ae3c33e", + "sha256": "b71e5a677801057ec719ae2655732720644bc8f999a8698876c92e4323d4ae0f", + "sha256WithRSAEncryption": "b71e5a677801057ec719ae2655732720644bc8f999a8698876c92e4323d4ae0f", + "sha384": "f96a5754e25deef63d7478f1e0d4cb8c25a3f6471af5a6ca0bb98290d7a1a69c5a80ceb1404671f903289dab0c1def2c", + "sha384WithRSAEncryption": "f96a5754e25deef63d7478f1e0d4cb8c25a3f6471af5a6ca0bb98290d7a1a69c5a80ceb1404671f903289dab0c1def2c", + "sha512": "bb5802eb5e8011a5b87c81cb4b8562ea03ab2e82168963cfe2c88999d8b341e63b1215a356b328b4cf515b0975da9a5ef51bac9cd13ea8f938e24dcd1a52b9fa", + "sha512WithRSAEncryption": "bb5802eb5e8011a5b87c81cb4b8562ea03ab2e82168963cfe2c88999d8b341e63b1215a356b328b4cf515b0975da9a5ef51bac9cd13ea8f938e24dcd1a52b9fa", + "shaWithRSAEncryption": "7a933688ce6ca9fdbb12c1fc10a2b6a8c3e1af9b", + "ssl2-md5": "0d3d987f94aee65f84436696bcf33ea4", + "ssl3-md5": "0d3d987f94aee65f84436696bcf33ea4", + "ssl3-sha1": "8e0ebc487146f83bc9077a1630e0fb3ab3c89e63", + "whirlpool": "3ea41665d1eb284f421a3aabfb6d11392381673fd393ddd5e32cbe734071c5f7eecc2471d12fbaaaedbcdaebf92445ad83940152ecef3290f09c802ce00ba300" + }, + { + "input": "///gAA//8AAAP///wAD//wAAD///4AAB/wAAH//gP/wAA+Af8B/4AAA////AD/4AACAAAP/8AA///j///wD/8AAAgAAfA+AB//oAP+AAAHAAAA8=", + "DSA": "ce8953741fff3425d2311fbbf4ab481b669def70", + "DSA-SHA": "ce8953741fff3425d2311fbbf4ab481b669def70", + "DSA-SHA1": "ce8953741fff3425d2311fbbf4ab481b669def70", + "DSA-SHA1-old": "ce8953741fff3425d2311fbbf4ab481b669def70", + "RSA-MD4": "1164629c3626b86827984dcf0c2aa302", + "RSA-MD5": "1a5c9ac3ee859361ad5477ea792506a3", + "RSA-MDC2": "5c8fc9113df0c8c6dceb80fb7e6e652a", + "RSA-RIPEMD160": "a640d32ae7931f023f5aab36355e9b4fe7ac88b6", + "RSA-SHA": "57648c0b0494d77dbe298cd09c7413f6303f98ce", + "RSA-SHA1": "ce8953741fff3425d2311fbbf4ab481b669def70", + "RSA-SHA1-2": "ce8953741fff3425d2311fbbf4ab481b669def70", + "RSA-SHA224": "5f9694a1cbb0634b4752f256fef456ecd2efb6fb0d4e758fb0471276", + "RSA-SHA256": "80c6a41efdfe452d1ad6f3b0d5eb31b962c332a9bb7e4f7ee6f4aaa18a3b81d4", + "RSA-SHA384": "55b692939a2ba5895df0704df30c01a4c86d33ca843c70550e4ea03b6e2e4c4a413aff20f72ccef49cc77616e6af5797", + "RSA-SHA512": "493f75fc17c2a89a35ca0be8995dc126a2d205897c91b5b120751218b987e371299bbb1f22ad39df68c3d4366790f971fc29fddef5758d78759777b73b9b619d", + "dsaEncryption": "ce8953741fff3425d2311fbbf4ab481b669def70", + "dsaWithSHA": "ce8953741fff3425d2311fbbf4ab481b669def70", + "dsaWithSHA1": "ce8953741fff3425d2311fbbf4ab481b669def70", + "dss1": "ce8953741fff3425d2311fbbf4ab481b669def70", + "ecdsa-with-SHA1": "ce8953741fff3425d2311fbbf4ab481b669def70", + "md4": "1164629c3626b86827984dcf0c2aa302", + "md4WithRSAEncryption": "1164629c3626b86827984dcf0c2aa302", + "md5": "1a5c9ac3ee859361ad5477ea792506a3", + "md5WithRSAEncryption": "1a5c9ac3ee859361ad5477ea792506a3", + "mdc2": "5c8fc9113df0c8c6dceb80fb7e6e652a", + "mdc2WithRSA": "5c8fc9113df0c8c6dceb80fb7e6e652a", + "ripemd": "a640d32ae7931f023f5aab36355e9b4fe7ac88b6", + "ripemd160": "a640d32ae7931f023f5aab36355e9b4fe7ac88b6", + "ripemd160WithRSA": "a640d32ae7931f023f5aab36355e9b4fe7ac88b6", + "rmd160": "a640d32ae7931f023f5aab36355e9b4fe7ac88b6", + "sha": "57648c0b0494d77dbe298cd09c7413f6303f98ce", + "sha1": "ce8953741fff3425d2311fbbf4ab481b669def70", + "sha1WithRSAEncryption": "ce8953741fff3425d2311fbbf4ab481b669def70", + "sha224": "5f9694a1cbb0634b4752f256fef456ecd2efb6fb0d4e758fb0471276", + "sha224WithRSAEncryption": "5f9694a1cbb0634b4752f256fef456ecd2efb6fb0d4e758fb0471276", + "sha256": "80c6a41efdfe452d1ad6f3b0d5eb31b962c332a9bb7e4f7ee6f4aaa18a3b81d4", + "sha256WithRSAEncryption": "80c6a41efdfe452d1ad6f3b0d5eb31b962c332a9bb7e4f7ee6f4aaa18a3b81d4", + "sha384": "55b692939a2ba5895df0704df30c01a4c86d33ca843c70550e4ea03b6e2e4c4a413aff20f72ccef49cc77616e6af5797", + "sha384WithRSAEncryption": "55b692939a2ba5895df0704df30c01a4c86d33ca843c70550e4ea03b6e2e4c4a413aff20f72ccef49cc77616e6af5797", + "sha512": "493f75fc17c2a89a35ca0be8995dc126a2d205897c91b5b120751218b987e371299bbb1f22ad39df68c3d4366790f971fc29fddef5758d78759777b73b9b619d", + "sha512WithRSAEncryption": "493f75fc17c2a89a35ca0be8995dc126a2d205897c91b5b120751218b987e371299bbb1f22ad39df68c3d4366790f971fc29fddef5758d78759777b73b9b619d", + "shaWithRSAEncryption": "57648c0b0494d77dbe298cd09c7413f6303f98ce", + "ssl2-md5": "1a5c9ac3ee859361ad5477ea792506a3", + "ssl3-md5": "1a5c9ac3ee859361ad5477ea792506a3", + "ssl3-sha1": "ce8953741fff3425d2311fbbf4ab481b669def70", + "whirlpool": "e9a8f61e7d754a692e4fcf837e103c4e7370a7f869cf3c690f4389211cbfb00403deb4f93bddf997dfeb9b7820b9cd8f9905bdd4c5e946cd27330a4601a49bd9" + }, + { + "input": "/f/AACAB/gA/+AAD/wAAA/j/z8P///wAA////AAAeD//8AH/4A///wAAB////P//+AAB/4AAB////AAAHAAB//8H+AAAH///8AAB/gB///Af/AAA", + "DSA": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "DSA-SHA": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "DSA-SHA1": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "DSA-SHA1-old": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "RSA-MD4": "fcb0116444df9a4f02803876de218848", + "RSA-MD5": "e827d60f27e35d8e5b05af748ba897dd", + "RSA-MDC2": "687a212075d534e8282565b4e9d6c4d6", + "RSA-RIPEMD160": "5c88cd25e0b55a2534d5bc6fdad192c853c0f83e", + "RSA-SHA": "8507cc667959f7cb4ca9311304c32f31cfa61e16", + "RSA-SHA1": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "RSA-SHA1-2": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "RSA-SHA224": "471398eba2908ec0a0d595d8e8de668e350d576146ad083dd3dac3bd", + "RSA-SHA256": "32ae8512b486d4523ca7a630556758655a5cff12aa5cfcb8dc5e65b21a257f4a", + "RSA-SHA384": "0281ab7ccffe79f3c749c06debbd2da368fca55fbc1725ecf4bb0a28fd967e0efc9482125a37711f11b910435a2a460d", + "RSA-SHA512": "f5af63acbedce005bcb250c44ebee7e9b63200e2d515c6ec74d072ed66adb79f52f44000de5dad0961c8b058f59ebaf9db40806aaab9b71e72d50c7cb2a97576", + "dsaEncryption": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "dsaWithSHA": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "dsaWithSHA1": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "dss1": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "ecdsa-with-SHA1": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "md4": "fcb0116444df9a4f02803876de218848", + "md4WithRSAEncryption": "fcb0116444df9a4f02803876de218848", + "md5": "e827d60f27e35d8e5b05af748ba897dd", + "md5WithRSAEncryption": "e827d60f27e35d8e5b05af748ba897dd", + "mdc2": "687a212075d534e8282565b4e9d6c4d6", + "mdc2WithRSA": "687a212075d534e8282565b4e9d6c4d6", + "ripemd": "5c88cd25e0b55a2534d5bc6fdad192c853c0f83e", + "ripemd160": "5c88cd25e0b55a2534d5bc6fdad192c853c0f83e", + "ripemd160WithRSA": "5c88cd25e0b55a2534d5bc6fdad192c853c0f83e", + "rmd160": "5c88cd25e0b55a2534d5bc6fdad192c853c0f83e", + "sha": "8507cc667959f7cb4ca9311304c32f31cfa61e16", + "sha1": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "sha1WithRSAEncryption": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "sha224": "471398eba2908ec0a0d595d8e8de668e350d576146ad083dd3dac3bd", + "sha224WithRSAEncryption": "471398eba2908ec0a0d595d8e8de668e350d576146ad083dd3dac3bd", + "sha256": "32ae8512b486d4523ca7a630556758655a5cff12aa5cfcb8dc5e65b21a257f4a", + "sha256WithRSAEncryption": "32ae8512b486d4523ca7a630556758655a5cff12aa5cfcb8dc5e65b21a257f4a", + "sha384": "0281ab7ccffe79f3c749c06debbd2da368fca55fbc1725ecf4bb0a28fd967e0efc9482125a37711f11b910435a2a460d", + "sha384WithRSAEncryption": "0281ab7ccffe79f3c749c06debbd2da368fca55fbc1725ecf4bb0a28fd967e0efc9482125a37711f11b910435a2a460d", + "sha512": "f5af63acbedce005bcb250c44ebee7e9b63200e2d515c6ec74d072ed66adb79f52f44000de5dad0961c8b058f59ebaf9db40806aaab9b71e72d50c7cb2a97576", + "sha512WithRSAEncryption": "f5af63acbedce005bcb250c44ebee7e9b63200e2d515c6ec74d072ed66adb79f52f44000de5dad0961c8b058f59ebaf9db40806aaab9b71e72d50c7cb2a97576", + "shaWithRSAEncryption": "8507cc667959f7cb4ca9311304c32f31cfa61e16", + "ssl2-md5": "e827d60f27e35d8e5b05af748ba897dd", + "ssl3-md5": "e827d60f27e35d8e5b05af748ba897dd", + "ssl3-sha1": "789d1d2dab52086bd90c0e137e2515ed9c6b59b5", + "whirlpool": "eb0468f0206e6f2156271ed8adf9c9bc4cc5e12fb3cc42bfc00942b2431c45ecc0759b9b7faa494c4f5fa842ced33f592db7cbdba30cf9a29a9214221b0677b5" + }, + { + "input": "AAAAP/8AAAf///wAAAHgD/+D/AH///AP/wAAAD///8Af///gACAAAD///wAA//wD///wAB///AAAA///wH+AAP///wAPD///4AAA//gAAP/+AAAP/w==", + "DSA": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "DSA-SHA": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "DSA-SHA1": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "DSA-SHA1-old": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "RSA-MD4": "f780a554f2679d39d9ff6638a171f99f", + "RSA-MD5": "5b7899bf7a6267d9b3b8c82f241a1d7b", + "RSA-MDC2": "b5662774e6b7234b2bffcf1a6390c050", + "RSA-RIPEMD160": "d0fb08d21488aef0d85201f786fad47a64d9d4ee", + "RSA-SHA": "71f4809a9efdb9208f8907290f852146ed2a3b4c", + "RSA-SHA1": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "RSA-SHA1-2": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "RSA-SHA224": "9586dc5765ee61d7acb7cc1320158f1ae112db3e499b2518516632e1", + "RSA-SHA256": "0f14c68ffe8c26e9d2ecdd5ea8027b6549b3e8742023ffbdc7547227cc27ec2c", + "RSA-SHA384": "2429f589e94bdaad5b35149fe1d347616f5d8e13a4062c79cf9ecf1c48966d59a4a9e49184afa096eb1d755ae2406313", + "RSA-SHA512": "781dc172a8c8757c56daf68cee5ce6a19b7180334fb33277c7e31031f9e68214b6356fec09725b2e9f7a1f9ffbf3a1371e3c0001c5b5d11a626b797fc649d49b", + "dsaEncryption": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "dsaWithSHA": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "dsaWithSHA1": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "dss1": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "ecdsa-with-SHA1": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "md4": "f780a554f2679d39d9ff6638a171f99f", + "md4WithRSAEncryption": "f780a554f2679d39d9ff6638a171f99f", + "md5": "5b7899bf7a6267d9b3b8c82f241a1d7b", + "md5WithRSAEncryption": "5b7899bf7a6267d9b3b8c82f241a1d7b", + "mdc2": "b5662774e6b7234b2bffcf1a6390c050", + "mdc2WithRSA": "b5662774e6b7234b2bffcf1a6390c050", + "ripemd": "d0fb08d21488aef0d85201f786fad47a64d9d4ee", + "ripemd160": "d0fb08d21488aef0d85201f786fad47a64d9d4ee", + "ripemd160WithRSA": "d0fb08d21488aef0d85201f786fad47a64d9d4ee", + "rmd160": "d0fb08d21488aef0d85201f786fad47a64d9d4ee", + "sha": "71f4809a9efdb9208f8907290f852146ed2a3b4c", + "sha1": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "sha1WithRSAEncryption": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "sha224": "9586dc5765ee61d7acb7cc1320158f1ae112db3e499b2518516632e1", + "sha224WithRSAEncryption": "9586dc5765ee61d7acb7cc1320158f1ae112db3e499b2518516632e1", + "sha256": "0f14c68ffe8c26e9d2ecdd5ea8027b6549b3e8742023ffbdc7547227cc27ec2c", + "sha256WithRSAEncryption": "0f14c68ffe8c26e9d2ecdd5ea8027b6549b3e8742023ffbdc7547227cc27ec2c", + "sha384": "2429f589e94bdaad5b35149fe1d347616f5d8e13a4062c79cf9ecf1c48966d59a4a9e49184afa096eb1d755ae2406313", + "sha384WithRSAEncryption": "2429f589e94bdaad5b35149fe1d347616f5d8e13a4062c79cf9ecf1c48966d59a4a9e49184afa096eb1d755ae2406313", + "sha512": "781dc172a8c8757c56daf68cee5ce6a19b7180334fb33277c7e31031f9e68214b6356fec09725b2e9f7a1f9ffbf3a1371e3c0001c5b5d11a626b797fc649d49b", + "sha512WithRSAEncryption": "781dc172a8c8757c56daf68cee5ce6a19b7180334fb33277c7e31031f9e68214b6356fec09725b2e9f7a1f9ffbf3a1371e3c0001c5b5d11a626b797fc649d49b", + "shaWithRSAEncryption": "71f4809a9efdb9208f8907290f852146ed2a3b4c", + "ssl2-md5": "5b7899bf7a6267d9b3b8c82f241a1d7b", + "ssl3-md5": "5b7899bf7a6267d9b3b8c82f241a1d7b", + "ssl3-sha1": "b76ce7472700dd68d6328b7aa8437fb051d15745", + "whirlpool": "b04e6ff15a22ac5dcc31684f7b906f1dc9986881615a68a2e5612208a2694af3eabdea0012db0a182def39581b11177cbd4f2c2c02edae15abd7d6948abc49f7" + }, + { + "input": "//4DgAAD///AP///AAP///gAAAH//8/8AADg7/gAD//j+AA///+AP7/+AAD//AAAAf8AAM/AAfwAAH///8AAEH///P4AAAfA////j/8AAB+eAAAB//8=", + "DSA": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "DSA-SHA": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "DSA-SHA1": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "DSA-SHA1-old": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "RSA-MD4": "77e0d1457a282455baed22f0b552c7ba", + "RSA-MD5": "6dc9fe740cf4a4b93cb0953a3c2a6026", + "RSA-MDC2": "406437d55be09f14d932b1bf33ffed39", + "RSA-RIPEMD160": "59896e45f25098aa6afd585b74f528b9317e62e4", + "RSA-SHA": "5039f18a070245dec0d008ba682bc717a2f60f3c", + "RSA-SHA1": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "RSA-SHA1-2": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "RSA-SHA224": "4385df93cb2b95cb2565bfa0b88c73540b653deb0fc1e407bd737204", + "RSA-SHA256": "85dff510ebd3f1fa617a2273ed67ef5abe4774cfe95657fe380e75b25090664d", + "RSA-SHA384": "49ee586792de3b0ae45ad44689d7a74694a6ad4f467315815afde426219feae640fce9b2283ff769ba6d28e7e28df8a1", + "RSA-SHA512": "6a295f58b75db5d93485951c5b411adce64309498ce0a189974145b70ecb145b2aba84ee62e72a90a5324aa7fb3b527e9e842bb2c54db9ce58d9bc4550f5f7d9", + "dsaEncryption": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "dsaWithSHA": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "dsaWithSHA1": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "dss1": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "ecdsa-with-SHA1": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "md4": "77e0d1457a282455baed22f0b552c7ba", + "md4WithRSAEncryption": "77e0d1457a282455baed22f0b552c7ba", + "md5": "6dc9fe740cf4a4b93cb0953a3c2a6026", + "md5WithRSAEncryption": "6dc9fe740cf4a4b93cb0953a3c2a6026", + "mdc2": "406437d55be09f14d932b1bf33ffed39", + "mdc2WithRSA": "406437d55be09f14d932b1bf33ffed39", + "ripemd": "59896e45f25098aa6afd585b74f528b9317e62e4", + "ripemd160": "59896e45f25098aa6afd585b74f528b9317e62e4", + "ripemd160WithRSA": "59896e45f25098aa6afd585b74f528b9317e62e4", + "rmd160": "59896e45f25098aa6afd585b74f528b9317e62e4", + "sha": "5039f18a070245dec0d008ba682bc717a2f60f3c", + "sha1": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "sha1WithRSAEncryption": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "sha224": "4385df93cb2b95cb2565bfa0b88c73540b653deb0fc1e407bd737204", + "sha224WithRSAEncryption": "4385df93cb2b95cb2565bfa0b88c73540b653deb0fc1e407bd737204", + "sha256": "85dff510ebd3f1fa617a2273ed67ef5abe4774cfe95657fe380e75b25090664d", + "sha256WithRSAEncryption": "85dff510ebd3f1fa617a2273ed67ef5abe4774cfe95657fe380e75b25090664d", + "sha384": "49ee586792de3b0ae45ad44689d7a74694a6ad4f467315815afde426219feae640fce9b2283ff769ba6d28e7e28df8a1", + "sha384WithRSAEncryption": "49ee586792de3b0ae45ad44689d7a74694a6ad4f467315815afde426219feae640fce9b2283ff769ba6d28e7e28df8a1", + "sha512": "6a295f58b75db5d93485951c5b411adce64309498ce0a189974145b70ecb145b2aba84ee62e72a90a5324aa7fb3b527e9e842bb2c54db9ce58d9bc4550f5f7d9", + "sha512WithRSAEncryption": "6a295f58b75db5d93485951c5b411adce64309498ce0a189974145b70ecb145b2aba84ee62e72a90a5324aa7fb3b527e9e842bb2c54db9ce58d9bc4550f5f7d9", + "shaWithRSAEncryption": "5039f18a070245dec0d008ba682bc717a2f60f3c", + "ssl2-md5": "6dc9fe740cf4a4b93cb0953a3c2a6026", + "ssl3-md5": "6dc9fe740cf4a4b93cb0953a3c2a6026", + "ssl3-sha1": "f218669b596c5ffb0b1c14bd03c467fc873230a0", + "whirlpool": "9c4c4eef21f475aa465495e3ea407cd568fe3026304d5f2cb2c1661c65b42f04d5c224b66b6cf6a4cd12a950f6c5c800fa986f141fe52f7ad45382c637d6db2b" + }, + { + "input": "AH//4AAB///D/4ABA/wAAAD8Af//+H/n8AAAf8A////AAAAf/4AAAf/gAABwAAAcf//4H/wAAAfv4P//wf/8AAAB////oAf/AB4AH/wAADgAGMAAAH//", + "DSA": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "DSA-SHA": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "DSA-SHA1": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "DSA-SHA1-old": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "RSA-MD4": "640b7163f4e578a6e1b37678c79785b7", + "RSA-MD5": "27adf814806fd4a51c1ffc84122c5c8a", + "RSA-MDC2": "727a18112aa78beae425cf04d17865e8", + "RSA-RIPEMD160": "023a2bad26bafc46f9c35b9c21ca8d0ab5caa333", + "RSA-SHA": "f4aafc8ee250c01332d1d872755f832f4411b965", + "RSA-SHA1": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "RSA-SHA1-2": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "RSA-SHA224": "38856bb823d33dbdc63494d53e8d670472173b75ce0ba4e3c384fbc0", + "RSA-SHA256": "7a852eb3b59ad350c9d47adf1ce0812d06866cca8e1f2c65c893e7952a62eea4", + "RSA-SHA384": "d1dd95785a7fc1feb0939b922952b5181183386d2ac5609a5d05668390b1a9414cd8b35acc250f2fdb163d600aad1e16", + "RSA-SHA512": "82976c7f43220e623b217ac30133205c212d56ab94f2c5f132bf318454ae1e485aeac0941b28008dbc87fcd20d635c3ac5fdf5260421fff25ee90f70a521fe27", + "dsaEncryption": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "dsaWithSHA": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "dsaWithSHA1": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "dss1": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "ecdsa-with-SHA1": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "md4": "640b7163f4e578a6e1b37678c79785b7", + "md4WithRSAEncryption": "640b7163f4e578a6e1b37678c79785b7", + "md5": "27adf814806fd4a51c1ffc84122c5c8a", + "md5WithRSAEncryption": "27adf814806fd4a51c1ffc84122c5c8a", + "mdc2": "727a18112aa78beae425cf04d17865e8", + "mdc2WithRSA": "727a18112aa78beae425cf04d17865e8", + "ripemd": "023a2bad26bafc46f9c35b9c21ca8d0ab5caa333", + "ripemd160": "023a2bad26bafc46f9c35b9c21ca8d0ab5caa333", + "ripemd160WithRSA": "023a2bad26bafc46f9c35b9c21ca8d0ab5caa333", + "rmd160": "023a2bad26bafc46f9c35b9c21ca8d0ab5caa333", + "sha": "f4aafc8ee250c01332d1d872755f832f4411b965", + "sha1": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "sha1WithRSAEncryption": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "sha224": "38856bb823d33dbdc63494d53e8d670472173b75ce0ba4e3c384fbc0", + "sha224WithRSAEncryption": "38856bb823d33dbdc63494d53e8d670472173b75ce0ba4e3c384fbc0", + "sha256": "7a852eb3b59ad350c9d47adf1ce0812d06866cca8e1f2c65c893e7952a62eea4", + "sha256WithRSAEncryption": "7a852eb3b59ad350c9d47adf1ce0812d06866cca8e1f2c65c893e7952a62eea4", + "sha384": "d1dd95785a7fc1feb0939b922952b5181183386d2ac5609a5d05668390b1a9414cd8b35acc250f2fdb163d600aad1e16", + "sha384WithRSAEncryption": "d1dd95785a7fc1feb0939b922952b5181183386d2ac5609a5d05668390b1a9414cd8b35acc250f2fdb163d600aad1e16", + "sha512": "82976c7f43220e623b217ac30133205c212d56ab94f2c5f132bf318454ae1e485aeac0941b28008dbc87fcd20d635c3ac5fdf5260421fff25ee90f70a521fe27", + "sha512WithRSAEncryption": "82976c7f43220e623b217ac30133205c212d56ab94f2c5f132bf318454ae1e485aeac0941b28008dbc87fcd20d635c3ac5fdf5260421fff25ee90f70a521fe27", + "shaWithRSAEncryption": "f4aafc8ee250c01332d1d872755f832f4411b965", + "ssl2-md5": "27adf814806fd4a51c1ffc84122c5c8a", + "ssl3-md5": "27adf814806fd4a51c1ffc84122c5c8a", + "ssl3-sha1": "1ff3bdbe0d504cb0cdfab17e6c37aba6b3cffded", + "whirlpool": "4e49d9de1786f2294e83f100fee22e8e40a0ecdefd7a89bc55a7f9d15e8b0d2354c86a530eba5dd8bf4f0e63ad3ff1795f2382d21ef22dc6823de4da4b9e05fd" + }, + { + "input": "AA//+AAAB/8A/AAAA//8AAf//+AAAP/8D/8AAA///g+AB/8D///5//4AAAP4AAAH4AAAwAAf//B////AB////AAAP///4AAAH//4H/4AAD///+A/BgAAAA==", + "DSA": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "DSA-SHA": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "DSA-SHA1": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "DSA-SHA1-old": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "RSA-MD4": "9ed55ef0b5de9b55895b5d512ef413f8", + "RSA-MD5": "f74e94ab992c8f27de264993a09ab429", + "RSA-MDC2": "ade314a75b94f2ef3b584eacd69bc0f9", + "RSA-RIPEMD160": "770b4f509217784881a8349d65526c88ef53bfcc", + "RSA-SHA": "681af577f76c76efa8ca6661a3391346be8afc38", + "RSA-SHA1": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "RSA-SHA1-2": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "RSA-SHA224": "eeefc4300067150acdef5fa8857e2c1f53ac206c2b250a2c6aaa3a82", + "RSA-SHA256": "49cfe8b6302a2d45b866a26c4940d777df4f588ebe1bafeb275a8a03a1eeb0aa", + "RSA-SHA384": "7c8c03d0c9fef5c1b5bc572a4249daed624fc6684409cd0c65dda8eca7e245d9b6ec4baa59f476b5e50e72f89d170e98", + "RSA-SHA512": "8ed7db5fb6d0aa5bde561900450c8f49799b19be158a5d08208c5124dddad1befcda048e4d578827213a55cdd613e5ac667ab8b149ece286af5dec91af98f1ef", + "dsaEncryption": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "dsaWithSHA": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "dsaWithSHA1": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "dss1": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "ecdsa-with-SHA1": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "md4": "9ed55ef0b5de9b55895b5d512ef413f8", + "md4WithRSAEncryption": "9ed55ef0b5de9b55895b5d512ef413f8", + "md5": "f74e94ab992c8f27de264993a09ab429", + "md5WithRSAEncryption": "f74e94ab992c8f27de264993a09ab429", + "mdc2": "ade314a75b94f2ef3b584eacd69bc0f9", + "mdc2WithRSA": "ade314a75b94f2ef3b584eacd69bc0f9", + "ripemd": "770b4f509217784881a8349d65526c88ef53bfcc", + "ripemd160": "770b4f509217784881a8349d65526c88ef53bfcc", + "ripemd160WithRSA": "770b4f509217784881a8349d65526c88ef53bfcc", + "rmd160": "770b4f509217784881a8349d65526c88ef53bfcc", + "sha": "681af577f76c76efa8ca6661a3391346be8afc38", + "sha1": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "sha1WithRSAEncryption": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "sha224": "eeefc4300067150acdef5fa8857e2c1f53ac206c2b250a2c6aaa3a82", + "sha224WithRSAEncryption": "eeefc4300067150acdef5fa8857e2c1f53ac206c2b250a2c6aaa3a82", + "sha256": "49cfe8b6302a2d45b866a26c4940d777df4f588ebe1bafeb275a8a03a1eeb0aa", + "sha256WithRSAEncryption": "49cfe8b6302a2d45b866a26c4940d777df4f588ebe1bafeb275a8a03a1eeb0aa", + "sha384": "7c8c03d0c9fef5c1b5bc572a4249daed624fc6684409cd0c65dda8eca7e245d9b6ec4baa59f476b5e50e72f89d170e98", + "sha384WithRSAEncryption": "7c8c03d0c9fef5c1b5bc572a4249daed624fc6684409cd0c65dda8eca7e245d9b6ec4baa59f476b5e50e72f89d170e98", + "sha512": "8ed7db5fb6d0aa5bde561900450c8f49799b19be158a5d08208c5124dddad1befcda048e4d578827213a55cdd613e5ac667ab8b149ece286af5dec91af98f1ef", + "sha512WithRSAEncryption": "8ed7db5fb6d0aa5bde561900450c8f49799b19be158a5d08208c5124dddad1befcda048e4d578827213a55cdd613e5ac667ab8b149ece286af5dec91af98f1ef", + "shaWithRSAEncryption": "681af577f76c76efa8ca6661a3391346be8afc38", + "ssl2-md5": "f74e94ab992c8f27de264993a09ab429", + "ssl3-md5": "f74e94ab992c8f27de264993a09ab429", + "ssl3-sha1": "2f3cbacbb14405a4652ed52793c1814fd8c4fce0", + "whirlpool": "48c8203ddc91e35e511946c33100ffae5fcdf202aa20ec41babd2ab8ef18491b27a8ac78ad20500db7154bd4fdc54af8166d0f51923355fd8d690ee9ac842bc6" + }, + { + "input": "//AACAAP7////AAAf//wAH//+AD//4H//+D///8AAACAAAP/gD///AAAH//AD//+AAAAc/Af/gD/wD//AD//g//+Af//9///gAAAPwAAH+P///AAD//wAAA=", + "DSA": "982c8ab6ce164f481915af59aaed9fff2a391752", + "DSA-SHA": "982c8ab6ce164f481915af59aaed9fff2a391752", + "DSA-SHA1": "982c8ab6ce164f481915af59aaed9fff2a391752", + "DSA-SHA1-old": "982c8ab6ce164f481915af59aaed9fff2a391752", + "RSA-MD4": "c3923f200f41ab03468f89f728e2ace9", + "RSA-MD5": "5eee0f1591d10c159763749ec86b9ecb", + "RSA-MDC2": "1bcf03e4aadb7d6b81603041a31dfa0f", + "RSA-RIPEMD160": "294ade6c412a8d229db38e7a0ad965476921dc2a", + "RSA-SHA": "77ef0ee88f4433bde3f4d5e056c7eac123bd0ff0", + "RSA-SHA1": "982c8ab6ce164f481915af59aaed9fff2a391752", + "RSA-SHA1-2": "982c8ab6ce164f481915af59aaed9fff2a391752", + "RSA-SHA224": "e82b5c0b1ccdf88bc55b1d08f6e7347acf91a2ffc7c33d1103207bde", + "RSA-SHA256": "e6e49ebcd83acd3a9ec0b100e26c4d82388eb9378ecfcbf967a31c4951ad0c01", + "RSA-SHA384": "6f32fec53a80f38832f24df35c2c5890d8b4e4c093734285472f9fe09a7d555eff38c451f4d7783773925b7f5d6f83d1", + "RSA-SHA512": "03a2d1acb8111cade71d6eec11811743335b4bf3184bbf0848f393824d840e6ed8e6346daae20e546ba759010334a2b86ac4b06af6a672ea47705de21f9b1665", + "dsaEncryption": "982c8ab6ce164f481915af59aaed9fff2a391752", + "dsaWithSHA": "982c8ab6ce164f481915af59aaed9fff2a391752", + "dsaWithSHA1": "982c8ab6ce164f481915af59aaed9fff2a391752", + "dss1": "982c8ab6ce164f481915af59aaed9fff2a391752", + "ecdsa-with-SHA1": "982c8ab6ce164f481915af59aaed9fff2a391752", + "md4": "c3923f200f41ab03468f89f728e2ace9", + "md4WithRSAEncryption": "c3923f200f41ab03468f89f728e2ace9", + "md5": "5eee0f1591d10c159763749ec86b9ecb", + "md5WithRSAEncryption": "5eee0f1591d10c159763749ec86b9ecb", + "mdc2": "1bcf03e4aadb7d6b81603041a31dfa0f", + "mdc2WithRSA": "1bcf03e4aadb7d6b81603041a31dfa0f", + "ripemd": "294ade6c412a8d229db38e7a0ad965476921dc2a", + "ripemd160": "294ade6c412a8d229db38e7a0ad965476921dc2a", + "ripemd160WithRSA": "294ade6c412a8d229db38e7a0ad965476921dc2a", + "rmd160": "294ade6c412a8d229db38e7a0ad965476921dc2a", + "sha": "77ef0ee88f4433bde3f4d5e056c7eac123bd0ff0", + "sha1": "982c8ab6ce164f481915af59aaed9fff2a391752", + "sha1WithRSAEncryption": "982c8ab6ce164f481915af59aaed9fff2a391752", + "sha224": "e82b5c0b1ccdf88bc55b1d08f6e7347acf91a2ffc7c33d1103207bde", + "sha224WithRSAEncryption": "e82b5c0b1ccdf88bc55b1d08f6e7347acf91a2ffc7c33d1103207bde", + "sha256": "e6e49ebcd83acd3a9ec0b100e26c4d82388eb9378ecfcbf967a31c4951ad0c01", + "sha256WithRSAEncryption": "e6e49ebcd83acd3a9ec0b100e26c4d82388eb9378ecfcbf967a31c4951ad0c01", + "sha384": "6f32fec53a80f38832f24df35c2c5890d8b4e4c093734285472f9fe09a7d555eff38c451f4d7783773925b7f5d6f83d1", + "sha384WithRSAEncryption": "6f32fec53a80f38832f24df35c2c5890d8b4e4c093734285472f9fe09a7d555eff38c451f4d7783773925b7f5d6f83d1", + "sha512": "03a2d1acb8111cade71d6eec11811743335b4bf3184bbf0848f393824d840e6ed8e6346daae20e546ba759010334a2b86ac4b06af6a672ea47705de21f9b1665", + "sha512WithRSAEncryption": "03a2d1acb8111cade71d6eec11811743335b4bf3184bbf0848f393824d840e6ed8e6346daae20e546ba759010334a2b86ac4b06af6a672ea47705de21f9b1665", + "shaWithRSAEncryption": "77ef0ee88f4433bde3f4d5e056c7eac123bd0ff0", + "ssl2-md5": "5eee0f1591d10c159763749ec86b9ecb", + "ssl3-md5": "5eee0f1591d10c159763749ec86b9ecb", + "ssl3-sha1": "982c8ab6ce164f481915af59aaed9fff2a391752", + "whirlpool": "4db598aaba118cd24a02d1502f9a3cdaa418fec612f03d4fadb9454f545f4682ac834ce87983868b8cd542abb5c628e138cac9c65218c14ed364fca2d507514a" + }, + { + "input": "AAB//AB/4AAP/+AB+AA//wAAeAB/4AAAHwAH///4+fAB//gHwA//+AAH+H/+AAAP/+PwAAf///wDHAAAf+AA///8AAAP8//gAAAP//kAABAAP//8+H//AAAA", + "DSA": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "DSA-SHA": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "DSA-SHA1": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "DSA-SHA1-old": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "RSA-MD4": "4878e13f6830ca9ad9bbb5618855c5db", + "RSA-MD5": "46898964a3889615d9f7c22a81e0a0e7", + "RSA-MDC2": "5bf60590977c92747671e6f728a13300", + "RSA-RIPEMD160": "f3cc2bc895c6f164efe70cb839fe6ad608fdd021", + "RSA-SHA": "848550915693cbf92fcf25f70f70bcf54c2cc4eb", + "RSA-SHA1": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "RSA-SHA1-2": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "RSA-SHA224": "20de7acc09b7b9472bae4db044c98a766902d153fafb92df899d7b92", + "RSA-SHA256": "9edf4d38cdd6e73e857f1ec91132499e7f930d2cdee6b3583a8f062ff7e9d848", + "RSA-SHA384": "e52d9d66b17f1a61736a699fcf3616bbc37e8f60a609ac88aafb6937908b74a68be30bcbb14a1ab1e3d76e0261e4d32f", + "RSA-SHA512": "06c1accab6d42ea7914ce698993c7a3cb67c1e08e38ba5f7fcb4c67229f5c5f16c4034c04d4fb0bdf51e34c9ee50b87739c77535b3b1b892425b313a5aeb4a6c", + "dsaEncryption": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "dsaWithSHA": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "dsaWithSHA1": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "dss1": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "ecdsa-with-SHA1": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "md4": "4878e13f6830ca9ad9bbb5618855c5db", + "md4WithRSAEncryption": "4878e13f6830ca9ad9bbb5618855c5db", + "md5": "46898964a3889615d9f7c22a81e0a0e7", + "md5WithRSAEncryption": "46898964a3889615d9f7c22a81e0a0e7", + "mdc2": "5bf60590977c92747671e6f728a13300", + "mdc2WithRSA": "5bf60590977c92747671e6f728a13300", + "ripemd": "f3cc2bc895c6f164efe70cb839fe6ad608fdd021", + "ripemd160": "f3cc2bc895c6f164efe70cb839fe6ad608fdd021", + "ripemd160WithRSA": "f3cc2bc895c6f164efe70cb839fe6ad608fdd021", + "rmd160": "f3cc2bc895c6f164efe70cb839fe6ad608fdd021", + "sha": "848550915693cbf92fcf25f70f70bcf54c2cc4eb", + "sha1": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "sha1WithRSAEncryption": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "sha224": "20de7acc09b7b9472bae4db044c98a766902d153fafb92df899d7b92", + "sha224WithRSAEncryption": "20de7acc09b7b9472bae4db044c98a766902d153fafb92df899d7b92", + "sha256": "9edf4d38cdd6e73e857f1ec91132499e7f930d2cdee6b3583a8f062ff7e9d848", + "sha256WithRSAEncryption": "9edf4d38cdd6e73e857f1ec91132499e7f930d2cdee6b3583a8f062ff7e9d848", + "sha384": "e52d9d66b17f1a61736a699fcf3616bbc37e8f60a609ac88aafb6937908b74a68be30bcbb14a1ab1e3d76e0261e4d32f", + "sha384WithRSAEncryption": "e52d9d66b17f1a61736a699fcf3616bbc37e8f60a609ac88aafb6937908b74a68be30bcbb14a1ab1e3d76e0261e4d32f", + "sha512": "06c1accab6d42ea7914ce698993c7a3cb67c1e08e38ba5f7fcb4c67229f5c5f16c4034c04d4fb0bdf51e34c9ee50b87739c77535b3b1b892425b313a5aeb4a6c", + "sha512WithRSAEncryption": "06c1accab6d42ea7914ce698993c7a3cb67c1e08e38ba5f7fcb4c67229f5c5f16c4034c04d4fb0bdf51e34c9ee50b87739c77535b3b1b892425b313a5aeb4a6c", + "shaWithRSAEncryption": "848550915693cbf92fcf25f70f70bcf54c2cc4eb", + "ssl2-md5": "46898964a3889615d9f7c22a81e0a0e7", + "ssl3-md5": "46898964a3889615d9f7c22a81e0a0e7", + "ssl3-sha1": "5cd92012d488a07ece0e47901d0e083b6bd93e3f", + "whirlpool": "9076df8261ff9110fea7e9d425d42aa69662b5c3372f435eed25b57c0735aa4f22676c7dbf3792e67a097c603bd0068d143f44492adde8ed27ab6868046d0576" + }, + { + "input": "AAP//8B////AAAP///8AAA//8B//8AAH///v/4H3//4AB//wAAAf/8APgAAP//wAAP///8AD/+P///4AH///AAD///8P//H4AAAB////gB///gAIAAB///+AAA==", + "DSA": "69603fec02920851d4b3b8782e07b92bb2963009", + "DSA-SHA": "69603fec02920851d4b3b8782e07b92bb2963009", + "DSA-SHA1": "69603fec02920851d4b3b8782e07b92bb2963009", + "DSA-SHA1-old": "69603fec02920851d4b3b8782e07b92bb2963009", + "RSA-MD4": "8669c44038eebd26c3966bb79d7b254b", + "RSA-MD5": "8fb58d6770971b0f12e40b31ad65b4a9", + "RSA-MDC2": "e1b419a4a168666a68f58d9410d75e8f", + "RSA-RIPEMD160": "856219d628a2a5cdd32de7b4c6e24ec9c17ca6e8", + "RSA-SHA": "ecc9709b726dcd9f694b6e18f466f23732916835", + "RSA-SHA1": "69603fec02920851d4b3b8782e07b92bb2963009", + "RSA-SHA1-2": "69603fec02920851d4b3b8782e07b92bb2963009", + "RSA-SHA224": "07ea1c5ef9b180e6bb34c73c331d14087ed0034f54b4361a82a61779", + "RSA-SHA256": "768dbebcd6aa66337810b7457964c63322904e9242229e5d98b808799f7f4cd4", + "RSA-SHA384": "a9010f1a1da7eee8983e94832b595dc3bfc2bb37dfafd93fed5581587dbc0497543c80efa5e576151a96701901ddcaf2", + "RSA-SHA512": "5b695679de2856bf0b7a95680807a2dd147519411ea07234771ebec48f613d865af8516d74eb27e2878a9379d9067fa5f5f2e7c09de452af8060f554e4b09b64", + "dsaEncryption": "69603fec02920851d4b3b8782e07b92bb2963009", + "dsaWithSHA": "69603fec02920851d4b3b8782e07b92bb2963009", + "dsaWithSHA1": "69603fec02920851d4b3b8782e07b92bb2963009", + "dss1": "69603fec02920851d4b3b8782e07b92bb2963009", + "ecdsa-with-SHA1": "69603fec02920851d4b3b8782e07b92bb2963009", + "md4": "8669c44038eebd26c3966bb79d7b254b", + "md4WithRSAEncryption": "8669c44038eebd26c3966bb79d7b254b", + "md5": "8fb58d6770971b0f12e40b31ad65b4a9", + "md5WithRSAEncryption": "8fb58d6770971b0f12e40b31ad65b4a9", + "mdc2": "e1b419a4a168666a68f58d9410d75e8f", + "mdc2WithRSA": "e1b419a4a168666a68f58d9410d75e8f", + "ripemd": "856219d628a2a5cdd32de7b4c6e24ec9c17ca6e8", + "ripemd160": "856219d628a2a5cdd32de7b4c6e24ec9c17ca6e8", + "ripemd160WithRSA": "856219d628a2a5cdd32de7b4c6e24ec9c17ca6e8", + "rmd160": "856219d628a2a5cdd32de7b4c6e24ec9c17ca6e8", + "sha": "ecc9709b726dcd9f694b6e18f466f23732916835", + "sha1": "69603fec02920851d4b3b8782e07b92bb2963009", + "sha1WithRSAEncryption": "69603fec02920851d4b3b8782e07b92bb2963009", + "sha224": "07ea1c5ef9b180e6bb34c73c331d14087ed0034f54b4361a82a61779", + "sha224WithRSAEncryption": "07ea1c5ef9b180e6bb34c73c331d14087ed0034f54b4361a82a61779", + "sha256": "768dbebcd6aa66337810b7457964c63322904e9242229e5d98b808799f7f4cd4", + "sha256WithRSAEncryption": "768dbebcd6aa66337810b7457964c63322904e9242229e5d98b808799f7f4cd4", + "sha384": "a9010f1a1da7eee8983e94832b595dc3bfc2bb37dfafd93fed5581587dbc0497543c80efa5e576151a96701901ddcaf2", + "sha384WithRSAEncryption": "a9010f1a1da7eee8983e94832b595dc3bfc2bb37dfafd93fed5581587dbc0497543c80efa5e576151a96701901ddcaf2", + "sha512": "5b695679de2856bf0b7a95680807a2dd147519411ea07234771ebec48f613d865af8516d74eb27e2878a9379d9067fa5f5f2e7c09de452af8060f554e4b09b64", + "sha512WithRSAEncryption": "5b695679de2856bf0b7a95680807a2dd147519411ea07234771ebec48f613d865af8516d74eb27e2878a9379d9067fa5f5f2e7c09de452af8060f554e4b09b64", + "shaWithRSAEncryption": "ecc9709b726dcd9f694b6e18f466f23732916835", + "ssl2-md5": "8fb58d6770971b0f12e40b31ad65b4a9", + "ssl3-md5": "8fb58d6770971b0f12e40b31ad65b4a9", + "ssl3-sha1": "69603fec02920851d4b3b8782e07b92bb2963009", + "whirlpool": "2d540d16820a0bd2b81b92364fc76172a2fac6dbd9d9ef22a44818461120c7d1c3154adb853aa4f9b0a88dab75d8cda13a85c85ea62e936c3aee271442e71c7e" + }, + { + "input": "H+AAfB/AB//AB////gA8AAAA//+AAAf//wAf+P/AAP+B/wH//gB4f//wAAGAAAAf/wAAH//wAB///+AAPAAAH///gAP/4AH///n/+AAAfAAA/gAA////AAAP//8=", + "DSA": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "DSA-SHA": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "DSA-SHA1": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "DSA-SHA1-old": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "RSA-MD4": "2faf354f138e307cab7c7fe4814a529c", + "RSA-MD5": "eb4ce130268dc13731dcd16ff492d0a9", + "RSA-MDC2": "19dcd545ce72b4a8c303fa86a6c01a58", + "RSA-RIPEMD160": "c13d68828b0c77ae4dc5fb732746b4b4e6afcb3e", + "RSA-SHA": "e5d4e70b781fe2117d3ef3e19499236f6c9f12d4", + "RSA-SHA1": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "RSA-SHA1-2": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "RSA-SHA224": "a4f4a5747a90372583733e2f8d5346363bb4f423c763197ca5142e9c", + "RSA-SHA256": "867a5ab42d15f9843d67438db495a8a581eddd39c3753f3d203225b60eaa9a3e", + "RSA-SHA384": "98e51dc04ec51c743045f86b73d3e38846077ba2ecd08132a850189444455e160272aaf7b5bc5f35ee5dc30a793e2aa5", + "RSA-SHA512": "3ffb6486fb6a3b7931673c5e754b0f44c193a00ed86b0a7bdd0e20f6afa14a870c84fc1d24db19fc2f73680e9719e41679a0ca5dc49e8ddd41496b8d46c49594", + "dsaEncryption": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "dsaWithSHA": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "dsaWithSHA1": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "dss1": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "ecdsa-with-SHA1": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "md4": "2faf354f138e307cab7c7fe4814a529c", + "md4WithRSAEncryption": "2faf354f138e307cab7c7fe4814a529c", + "md5": "eb4ce130268dc13731dcd16ff492d0a9", + "md5WithRSAEncryption": "eb4ce130268dc13731dcd16ff492d0a9", + "mdc2": "19dcd545ce72b4a8c303fa86a6c01a58", + "mdc2WithRSA": "19dcd545ce72b4a8c303fa86a6c01a58", + "ripemd": "c13d68828b0c77ae4dc5fb732746b4b4e6afcb3e", + "ripemd160": "c13d68828b0c77ae4dc5fb732746b4b4e6afcb3e", + "ripemd160WithRSA": "c13d68828b0c77ae4dc5fb732746b4b4e6afcb3e", + "rmd160": "c13d68828b0c77ae4dc5fb732746b4b4e6afcb3e", + "sha": "e5d4e70b781fe2117d3ef3e19499236f6c9f12d4", + "sha1": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "sha1WithRSAEncryption": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "sha224": "a4f4a5747a90372583733e2f8d5346363bb4f423c763197ca5142e9c", + "sha224WithRSAEncryption": "a4f4a5747a90372583733e2f8d5346363bb4f423c763197ca5142e9c", + "sha256": "867a5ab42d15f9843d67438db495a8a581eddd39c3753f3d203225b60eaa9a3e", + "sha256WithRSAEncryption": "867a5ab42d15f9843d67438db495a8a581eddd39c3753f3d203225b60eaa9a3e", + "sha384": "98e51dc04ec51c743045f86b73d3e38846077ba2ecd08132a850189444455e160272aaf7b5bc5f35ee5dc30a793e2aa5", + "sha384WithRSAEncryption": "98e51dc04ec51c743045f86b73d3e38846077ba2ecd08132a850189444455e160272aaf7b5bc5f35ee5dc30a793e2aa5", + "sha512": "3ffb6486fb6a3b7931673c5e754b0f44c193a00ed86b0a7bdd0e20f6afa14a870c84fc1d24db19fc2f73680e9719e41679a0ca5dc49e8ddd41496b8d46c49594", + "sha512WithRSAEncryption": "3ffb6486fb6a3b7931673c5e754b0f44c193a00ed86b0a7bdd0e20f6afa14a870c84fc1d24db19fc2f73680e9719e41679a0ca5dc49e8ddd41496b8d46c49594", + "shaWithRSAEncryption": "e5d4e70b781fe2117d3ef3e19499236f6c9f12d4", + "ssl2-md5": "eb4ce130268dc13731dcd16ff492d0a9", + "ssl3-md5": "eb4ce130268dc13731dcd16ff492d0a9", + "ssl3-sha1": "3e90f76437b1ea44cf98a08d83ea24cecf6e6191", + "whirlpool": "ddfcf526de704cfcba4441dc832643025f279b2871f37a1aef5d580e8dfcd94413aab02a3dc50ec9113321f42a1a62810b820df543cdd6d6d7f887470935cf53" + }, + { + "input": "/AAB/wAADAD//+P///CADg4AAA/+AAP/wAAAf///4MAAAAfg//8Dn///wcAAA///w////P//wAAB/AAP/AAAAH///wP///wP//4AAAOAP///AAD///gAA///gAAA", + "DSA": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "DSA-SHA": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "DSA-SHA1": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "DSA-SHA1-old": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "RSA-MD4": "c55db5ba7c06a7b3a4bf4d51837b1ea1", + "RSA-MD5": "23532a54e8005860ad5e77f4e3392827", + "RSA-MDC2": "a889fd0fd28722914189d4a97d6d8550", + "RSA-RIPEMD160": "5bfa4dc7c605dd3a51c0ef887bc754efc4be1bb4", + "RSA-SHA": "3edd256e433e36c58ca35191f84c6b38b5147c96", + "RSA-SHA1": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "RSA-SHA1-2": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "RSA-SHA224": "c83ff49e6fe7c72a2a4a4da5e48fcb56eb5deb5a01ca46491e53514c", + "RSA-SHA256": "d7acd8d042b8c6802f6d9262055a6e296f3254674745f18cd1b21244e1acb9f0", + "RSA-SHA384": "002b89732594a1e393f74ecd9a8eee2492c7a6b0b0b2863547e34c9d1de3ded4a02007a35a0af714219881552f520fe6", + "RSA-SHA512": "0e9edad47cce524e8030cdf77a9bed351e285b8f41aa9144e7d76de2dcea327ebda0d707d56304c9111d9edf933cc157f771cae51ab17814c24df1a1c343e748", + "dsaEncryption": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "dsaWithSHA": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "dsaWithSHA1": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "dss1": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "ecdsa-with-SHA1": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "md4": "c55db5ba7c06a7b3a4bf4d51837b1ea1", + "md4WithRSAEncryption": "c55db5ba7c06a7b3a4bf4d51837b1ea1", + "md5": "23532a54e8005860ad5e77f4e3392827", + "md5WithRSAEncryption": "23532a54e8005860ad5e77f4e3392827", + "mdc2": "a889fd0fd28722914189d4a97d6d8550", + "mdc2WithRSA": "a889fd0fd28722914189d4a97d6d8550", + "ripemd": "5bfa4dc7c605dd3a51c0ef887bc754efc4be1bb4", + "ripemd160": "5bfa4dc7c605dd3a51c0ef887bc754efc4be1bb4", + "ripemd160WithRSA": "5bfa4dc7c605dd3a51c0ef887bc754efc4be1bb4", + "rmd160": "5bfa4dc7c605dd3a51c0ef887bc754efc4be1bb4", + "sha": "3edd256e433e36c58ca35191f84c6b38b5147c96", + "sha1": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "sha1WithRSAEncryption": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "sha224": "c83ff49e6fe7c72a2a4a4da5e48fcb56eb5deb5a01ca46491e53514c", + "sha224WithRSAEncryption": "c83ff49e6fe7c72a2a4a4da5e48fcb56eb5deb5a01ca46491e53514c", + "sha256": "d7acd8d042b8c6802f6d9262055a6e296f3254674745f18cd1b21244e1acb9f0", + "sha256WithRSAEncryption": "d7acd8d042b8c6802f6d9262055a6e296f3254674745f18cd1b21244e1acb9f0", + "sha384": "002b89732594a1e393f74ecd9a8eee2492c7a6b0b0b2863547e34c9d1de3ded4a02007a35a0af714219881552f520fe6", + "sha384WithRSAEncryption": "002b89732594a1e393f74ecd9a8eee2492c7a6b0b0b2863547e34c9d1de3ded4a02007a35a0af714219881552f520fe6", + "sha512": "0e9edad47cce524e8030cdf77a9bed351e285b8f41aa9144e7d76de2dcea327ebda0d707d56304c9111d9edf933cc157f771cae51ab17814c24df1a1c343e748", + "sha512WithRSAEncryption": "0e9edad47cce524e8030cdf77a9bed351e285b8f41aa9144e7d76de2dcea327ebda0d707d56304c9111d9edf933cc157f771cae51ab17814c24df1a1c343e748", + "shaWithRSAEncryption": "3edd256e433e36c58ca35191f84c6b38b5147c96", + "ssl2-md5": "23532a54e8005860ad5e77f4e3392827", + "ssl3-md5": "23532a54e8005860ad5e77f4e3392827", + "ssl3-sha1": "34c09f107c42d990eb4881d4bf2dddcab01563ae", + "whirlpool": "0dd1702b2ab82691e11ab8a9fbf35101664e5bbec5e533e5f06f5a3d03c2469267b5f5292dcbe53b529c6b0d211d9c73d4e91935038a6f0f5253b6041591f341" + }, + { + "input": "//+A///4AAD8AAP/+AAP//8AAwAAAH//8AA///AAAfwBAAP/gB//4///+AAf///4Af/f//v/wAAAP//4AACAx///+A//AGAf/+AAAf///g////wAAADwBgP///4AAA==", + "DSA": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "DSA-SHA": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "DSA-SHA1": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "DSA-SHA1-old": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "RSA-MD4": "e1dd0c2150819bc282fa07caae63f19b", + "RSA-MD5": "07fedc4dc4891d1a90c501a781a666f2", + "RSA-MDC2": "7a890bb6cdbf57c20f36be37a41473a8", + "RSA-RIPEMD160": "a4b1021a72a32cb261faa78429367c742479835a", + "RSA-SHA": "15615b10f3457ac34a4415c055bf55e26841a7ec", + "RSA-SHA1": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "RSA-SHA1-2": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "RSA-SHA224": "0f97c178452330f03db746ae7b8d3ead338fd3332b425f5c9f78cfd7", + "RSA-SHA256": "fe781c4d49e73ca9f82389b6d58f3def857cffe624acfb6a2a5a8e9559623f37", + "RSA-SHA384": "23138723c1770f2e7752449b989dc8d58bb2f82419e4e2056ed2117791ed32f789abdc8e60d70972d34f497d47a6fb18", + "RSA-SHA512": "ee2ef4b0866deb7e6150e1883613c4a29ec9c62d87fce6d264bd747f4570af190a1d0bb27876376aa1495f8800f7c9c75f1d53a3cc520019a1cbba4fd038fa5e", + "dsaEncryption": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "dsaWithSHA": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "dsaWithSHA1": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "dss1": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "ecdsa-with-SHA1": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "md4": "e1dd0c2150819bc282fa07caae63f19b", + "md4WithRSAEncryption": "e1dd0c2150819bc282fa07caae63f19b", + "md5": "07fedc4dc4891d1a90c501a781a666f2", + "md5WithRSAEncryption": "07fedc4dc4891d1a90c501a781a666f2", + "mdc2": "7a890bb6cdbf57c20f36be37a41473a8", + "mdc2WithRSA": "7a890bb6cdbf57c20f36be37a41473a8", + "ripemd": "a4b1021a72a32cb261faa78429367c742479835a", + "ripemd160": "a4b1021a72a32cb261faa78429367c742479835a", + "ripemd160WithRSA": "a4b1021a72a32cb261faa78429367c742479835a", + "rmd160": "a4b1021a72a32cb261faa78429367c742479835a", + "sha": "15615b10f3457ac34a4415c055bf55e26841a7ec", + "sha1": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "sha1WithRSAEncryption": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "sha224": "0f97c178452330f03db746ae7b8d3ead338fd3332b425f5c9f78cfd7", + "sha224WithRSAEncryption": "0f97c178452330f03db746ae7b8d3ead338fd3332b425f5c9f78cfd7", + "sha256": "fe781c4d49e73ca9f82389b6d58f3def857cffe624acfb6a2a5a8e9559623f37", + "sha256WithRSAEncryption": "fe781c4d49e73ca9f82389b6d58f3def857cffe624acfb6a2a5a8e9559623f37", + "sha384": "23138723c1770f2e7752449b989dc8d58bb2f82419e4e2056ed2117791ed32f789abdc8e60d70972d34f497d47a6fb18", + "sha384WithRSAEncryption": "23138723c1770f2e7752449b989dc8d58bb2f82419e4e2056ed2117791ed32f789abdc8e60d70972d34f497d47a6fb18", + "sha512": "ee2ef4b0866deb7e6150e1883613c4a29ec9c62d87fce6d264bd747f4570af190a1d0bb27876376aa1495f8800f7c9c75f1d53a3cc520019a1cbba4fd038fa5e", + "sha512WithRSAEncryption": "ee2ef4b0866deb7e6150e1883613c4a29ec9c62d87fce6d264bd747f4570af190a1d0bb27876376aa1495f8800f7c9c75f1d53a3cc520019a1cbba4fd038fa5e", + "shaWithRSAEncryption": "15615b10f3457ac34a4415c055bf55e26841a7ec", + "ssl2-md5": "07fedc4dc4891d1a90c501a781a666f2", + "ssl3-md5": "07fedc4dc4891d1a90c501a781a666f2", + "ssl3-sha1": "474be0e5892eb2382109bfc5e3c8249a9283b03d", + "whirlpool": "7e88b67cbf835abfae703c35646e9f9e16ef00bdb6cc0752646ba7f375cdb1a3c951349a1f79e00938a93b466f8e7c0679e54d883f4b922145d56a406a4b5853" + }, + { + "input": "/wAP//wAD////Af//AAA8AAAgAB//gAAD////D8A////AB////AAH///4AAf///D/wAAAf//8AAAD//gB/wAAAD+AAf///gAAD8AAA+AAD//wAAR/+8ABwB///wAAAA=", + "DSA": "a04b4f75051786682483252438f6a75bf4705ec6", + "DSA-SHA": "a04b4f75051786682483252438f6a75bf4705ec6", + "DSA-SHA1": "a04b4f75051786682483252438f6a75bf4705ec6", + "DSA-SHA1-old": "a04b4f75051786682483252438f6a75bf4705ec6", + "RSA-MD4": "c5abd27ca77ee1059d5be589548aaac6", + "RSA-MD5": "83e8341035b37dd70a92a6eed5406927", + "RSA-MDC2": "b0ce0008ffd00d488f092b790db1a0b7", + "RSA-RIPEMD160": "72a6387aa8cded1eff08e7cd8760b9c3dae2ec74", + "RSA-SHA": "d8a67fb670add3418017c56f5539252a87885d9b", + "RSA-SHA1": "a04b4f75051786682483252438f6a75bf4705ec6", + "RSA-SHA1-2": "a04b4f75051786682483252438f6a75bf4705ec6", + "RSA-SHA224": "54d6fdcdb2054c5477de4e75f688646c5f2630e2a00e39223c26ed5c", + "RSA-SHA256": "96fb72ddb440bb1f00dbafc97768f9890effcc172fcc395de4f2a19318c46c86", + "RSA-SHA384": "abb586e03efb1565f9542d2a020a8ea3aa726e7decdac92fd5582c570b410ec72cefec006f7dba32e80c8385fd4b415d", + "RSA-SHA512": "036d8aae871ff4db9549a05157a93ba9e925867543e267cffdb5d2d07584eacd70a57f8029a3125fe880ea5c6613f67e70fe79196a66f9429e83bd9b8f747ec7", + "dsaEncryption": "a04b4f75051786682483252438f6a75bf4705ec6", + "dsaWithSHA": "a04b4f75051786682483252438f6a75bf4705ec6", + "dsaWithSHA1": "a04b4f75051786682483252438f6a75bf4705ec6", + "dss1": "a04b4f75051786682483252438f6a75bf4705ec6", + "ecdsa-with-SHA1": "a04b4f75051786682483252438f6a75bf4705ec6", + "md4": "c5abd27ca77ee1059d5be589548aaac6", + "md4WithRSAEncryption": "c5abd27ca77ee1059d5be589548aaac6", + "md5": "83e8341035b37dd70a92a6eed5406927", + "md5WithRSAEncryption": "83e8341035b37dd70a92a6eed5406927", + "mdc2": "b0ce0008ffd00d488f092b790db1a0b7", + "mdc2WithRSA": "b0ce0008ffd00d488f092b790db1a0b7", + "ripemd": "72a6387aa8cded1eff08e7cd8760b9c3dae2ec74", + "ripemd160": "72a6387aa8cded1eff08e7cd8760b9c3dae2ec74", + "ripemd160WithRSA": "72a6387aa8cded1eff08e7cd8760b9c3dae2ec74", + "rmd160": "72a6387aa8cded1eff08e7cd8760b9c3dae2ec74", + "sha": "d8a67fb670add3418017c56f5539252a87885d9b", + "sha1": "a04b4f75051786682483252438f6a75bf4705ec6", + "sha1WithRSAEncryption": "a04b4f75051786682483252438f6a75bf4705ec6", + "sha224": "54d6fdcdb2054c5477de4e75f688646c5f2630e2a00e39223c26ed5c", + "sha224WithRSAEncryption": "54d6fdcdb2054c5477de4e75f688646c5f2630e2a00e39223c26ed5c", + "sha256": "96fb72ddb440bb1f00dbafc97768f9890effcc172fcc395de4f2a19318c46c86", + "sha256WithRSAEncryption": "96fb72ddb440bb1f00dbafc97768f9890effcc172fcc395de4f2a19318c46c86", + "sha384": "abb586e03efb1565f9542d2a020a8ea3aa726e7decdac92fd5582c570b410ec72cefec006f7dba32e80c8385fd4b415d", + "sha384WithRSAEncryption": "abb586e03efb1565f9542d2a020a8ea3aa726e7decdac92fd5582c570b410ec72cefec006f7dba32e80c8385fd4b415d", + "sha512": "036d8aae871ff4db9549a05157a93ba9e925867543e267cffdb5d2d07584eacd70a57f8029a3125fe880ea5c6613f67e70fe79196a66f9429e83bd9b8f747ec7", + "sha512WithRSAEncryption": "036d8aae871ff4db9549a05157a93ba9e925867543e267cffdb5d2d07584eacd70a57f8029a3125fe880ea5c6613f67e70fe79196a66f9429e83bd9b8f747ec7", + "shaWithRSAEncryption": "d8a67fb670add3418017c56f5539252a87885d9b", + "ssl2-md5": "83e8341035b37dd70a92a6eed5406927", + "ssl3-md5": "83e8341035b37dd70a92a6eed5406927", + "ssl3-sha1": "a04b4f75051786682483252438f6a75bf4705ec6", + "whirlpool": "ff156da649ee49521883092a5d7e920246880d511110d5748ebb313872f359eb9f404e50fce7c7b8d31a1757c8623222b151370d4631211a60432f78d363e6f5" + }, + { + "input": "/gAAf/f//wAAD///4AH/4AAAA//gAP/+AAH/9//4AA//AAAAOAAH//gH//wAH///D8H//8AA//8P//AB//gAAf//gAAAD/gAP//+P///8AAAOA/D////H//AP///4AAA", + "DSA": "be88a6716083eb50ed9416719d6a247661299383", + "DSA-SHA": "be88a6716083eb50ed9416719d6a247661299383", + "DSA-SHA1": "be88a6716083eb50ed9416719d6a247661299383", + "DSA-SHA1-old": "be88a6716083eb50ed9416719d6a247661299383", + "RSA-MD4": "337a3b729fc693cc0fafe9ff1e0896a7", + "RSA-MD5": "6c9f7b3b25734d58f21f5050642874a5", + "RSA-MDC2": "4b947f875d898e71a2d7e783f6f86772", + "RSA-RIPEMD160": "63d2165c69da30efd7fb0b01ecb100d1502ecdb7", + "RSA-SHA": "77c1657d540331165d2379d634a5fb2103b513fb", + "RSA-SHA1": "be88a6716083eb50ed9416719d6a247661299383", + "RSA-SHA1-2": "be88a6716083eb50ed9416719d6a247661299383", + "RSA-SHA224": "9a17cabab19b06d81340aca25628a5a4f802db8b91cc11bdd9aff677", + "RSA-SHA256": "b63555a77fefcadecfa88a770e70f1d51d46ae68fc672ad4770804495eb1b867", + "RSA-SHA384": "d0d05177acbf0e0cf45abfd4797aad775f9f02010b4e2fd57f52883ae383b387465ab4fc021037ad4868656a2fe15f2b", + "RSA-SHA512": "6794d279562e7eb852be3f8a11c23d70c4dae96a3d171d3c017ea94cfd0e30fd462598a977623431c557113b809cbb69c7fa6e6633213b64b74b3ab753d89b3a", + "dsaEncryption": "be88a6716083eb50ed9416719d6a247661299383", + "dsaWithSHA": "be88a6716083eb50ed9416719d6a247661299383", + "dsaWithSHA1": "be88a6716083eb50ed9416719d6a247661299383", + "dss1": "be88a6716083eb50ed9416719d6a247661299383", + "ecdsa-with-SHA1": "be88a6716083eb50ed9416719d6a247661299383", + "md4": "337a3b729fc693cc0fafe9ff1e0896a7", + "md4WithRSAEncryption": "337a3b729fc693cc0fafe9ff1e0896a7", + "md5": "6c9f7b3b25734d58f21f5050642874a5", + "md5WithRSAEncryption": "6c9f7b3b25734d58f21f5050642874a5", + "mdc2": "4b947f875d898e71a2d7e783f6f86772", + "mdc2WithRSA": "4b947f875d898e71a2d7e783f6f86772", + "ripemd": "63d2165c69da30efd7fb0b01ecb100d1502ecdb7", + "ripemd160": "63d2165c69da30efd7fb0b01ecb100d1502ecdb7", + "ripemd160WithRSA": "63d2165c69da30efd7fb0b01ecb100d1502ecdb7", + "rmd160": "63d2165c69da30efd7fb0b01ecb100d1502ecdb7", + "sha": "77c1657d540331165d2379d634a5fb2103b513fb", + "sha1": "be88a6716083eb50ed9416719d6a247661299383", + "sha1WithRSAEncryption": "be88a6716083eb50ed9416719d6a247661299383", + "sha224": "9a17cabab19b06d81340aca25628a5a4f802db8b91cc11bdd9aff677", + "sha224WithRSAEncryption": "9a17cabab19b06d81340aca25628a5a4f802db8b91cc11bdd9aff677", + "sha256": "b63555a77fefcadecfa88a770e70f1d51d46ae68fc672ad4770804495eb1b867", + "sha256WithRSAEncryption": "b63555a77fefcadecfa88a770e70f1d51d46ae68fc672ad4770804495eb1b867", + "sha384": "d0d05177acbf0e0cf45abfd4797aad775f9f02010b4e2fd57f52883ae383b387465ab4fc021037ad4868656a2fe15f2b", + "sha384WithRSAEncryption": "d0d05177acbf0e0cf45abfd4797aad775f9f02010b4e2fd57f52883ae383b387465ab4fc021037ad4868656a2fe15f2b", + "sha512": "6794d279562e7eb852be3f8a11c23d70c4dae96a3d171d3c017ea94cfd0e30fd462598a977623431c557113b809cbb69c7fa6e6633213b64b74b3ab753d89b3a", + "sha512WithRSAEncryption": "6794d279562e7eb852be3f8a11c23d70c4dae96a3d171d3c017ea94cfd0e30fd462598a977623431c557113b809cbb69c7fa6e6633213b64b74b3ab753d89b3a", + "shaWithRSAEncryption": "77c1657d540331165d2379d634a5fb2103b513fb", + "ssl2-md5": "6c9f7b3b25734d58f21f5050642874a5", + "ssl3-md5": "6c9f7b3b25734d58f21f5050642874a5", + "ssl3-sha1": "be88a6716083eb50ed9416719d6a247661299383", + "whirlpool": "8571ff6d27b5698329dc6dad3f2e1da15458aa0ba3c9817cf8d1ed31d3aaacb61eb718d1c712adca547531261da37f4590d74b6671f36152e0582ec0777effb9" + }, + { + "input": "///wAH/AB///gf/AAAH////AAAAf//4DwAAP///8AAP///+D/8AAB/AAAB+AAAA////n/wAH///8AAAf//gAA/AA//wAH///4AP/8AAB////gAAAD///+BAAHgP///+AAA==", + "DSA": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "DSA-SHA": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "DSA-SHA1": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "DSA-SHA1-old": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "RSA-MD4": "47c0c84eb8153c95f3ac7125fbed34be", + "RSA-MD5": "ef661042e6624f4052ce86d8f233d780", + "RSA-MDC2": "d4c56e35c7a8ba2cb45491afd98dd76d", + "RSA-RIPEMD160": "0f9d5f78bfe18bbe73d07d8af522a9a82ccdb91b", + "RSA-SHA": "9cac67ece9f0cfe93f207179584b4932f70ffacd", + "RSA-SHA1": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "RSA-SHA1-2": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "RSA-SHA224": "1020c1e5055b3a3b7337099710a52d994c7bb8a78e4c5961bccfa7dc", + "RSA-SHA256": "161d1a609fdeb2fa425761bf0b751dfd25e7a0a02995920921f99f63331b76d9", + "RSA-SHA384": "d1a207efde1cef11d318679923403837ad9afe0cfa2e0e72bc1ec656abc64d75dddc55ce6f1966e4adf872618d0916f4", + "RSA-SHA512": "c89fe1bc437054e44d4992ead0e5eb9181f28c8e08ff2d92ac879fd0cf6bd2e20ff465cda6be8db631d256135b9513cf299aebd13c75512f5dca3bac62a7f54a", + "dsaEncryption": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "dsaWithSHA": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "dsaWithSHA1": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "dss1": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "ecdsa-with-SHA1": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "md4": "47c0c84eb8153c95f3ac7125fbed34be", + "md4WithRSAEncryption": "47c0c84eb8153c95f3ac7125fbed34be", + "md5": "ef661042e6624f4052ce86d8f233d780", + "md5WithRSAEncryption": "ef661042e6624f4052ce86d8f233d780", + "mdc2": "d4c56e35c7a8ba2cb45491afd98dd76d", + "mdc2WithRSA": "d4c56e35c7a8ba2cb45491afd98dd76d", + "ripemd": "0f9d5f78bfe18bbe73d07d8af522a9a82ccdb91b", + "ripemd160": "0f9d5f78bfe18bbe73d07d8af522a9a82ccdb91b", + "ripemd160WithRSA": "0f9d5f78bfe18bbe73d07d8af522a9a82ccdb91b", + "rmd160": "0f9d5f78bfe18bbe73d07d8af522a9a82ccdb91b", + "sha": "9cac67ece9f0cfe93f207179584b4932f70ffacd", + "sha1": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "sha1WithRSAEncryption": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "sha224": "1020c1e5055b3a3b7337099710a52d994c7bb8a78e4c5961bccfa7dc", + "sha224WithRSAEncryption": "1020c1e5055b3a3b7337099710a52d994c7bb8a78e4c5961bccfa7dc", + "sha256": "161d1a609fdeb2fa425761bf0b751dfd25e7a0a02995920921f99f63331b76d9", + "sha256WithRSAEncryption": "161d1a609fdeb2fa425761bf0b751dfd25e7a0a02995920921f99f63331b76d9", + "sha384": "d1a207efde1cef11d318679923403837ad9afe0cfa2e0e72bc1ec656abc64d75dddc55ce6f1966e4adf872618d0916f4", + "sha384WithRSAEncryption": "d1a207efde1cef11d318679923403837ad9afe0cfa2e0e72bc1ec656abc64d75dddc55ce6f1966e4adf872618d0916f4", + "sha512": "c89fe1bc437054e44d4992ead0e5eb9181f28c8e08ff2d92ac879fd0cf6bd2e20ff465cda6be8db631d256135b9513cf299aebd13c75512f5dca3bac62a7f54a", + "sha512WithRSAEncryption": "c89fe1bc437054e44d4992ead0e5eb9181f28c8e08ff2d92ac879fd0cf6bd2e20ff465cda6be8db631d256135b9513cf299aebd13c75512f5dca3bac62a7f54a", + "shaWithRSAEncryption": "9cac67ece9f0cfe93f207179584b4932f70ffacd", + "ssl2-md5": "ef661042e6624f4052ce86d8f233d780", + "ssl3-md5": "ef661042e6624f4052ce86d8f233d780", + "ssl3-sha1": "c67e38717fee1a5f65ec6c7c7c42afc00cd37f04", + "whirlpool": "d84d67b85a68e20fa41c7873142c88f5a0a089f3b7143860d0fe5462f7585ee9054fb376bfb3da2ae143309eb29bf0cfacfe24c4945359dfa8298ed1e7c77971" + }, + { + "input": "AAH//gAAAH////AAAB//gAf///+AAAH//AP//5///gAIAAAGAAAAgf//wAAH+AD///8AAAD///gAP///+D/4AAAAf//Af///wP///gAAAf/4AAAD/8H/8AAAAwf4Af/+AAA=", + "DSA": "959ac4082388e19e9be5de571c047ef10c174a8d", + "DSA-SHA": "959ac4082388e19e9be5de571c047ef10c174a8d", + "DSA-SHA1": "959ac4082388e19e9be5de571c047ef10c174a8d", + "DSA-SHA1-old": "959ac4082388e19e9be5de571c047ef10c174a8d", + "RSA-MD4": "ca34700840da5b92bb4bfaf89e6c0fc5", + "RSA-MD5": "efe794cdfad5cb86656e29854a1f5c92", + "RSA-MDC2": "c70716f4a55ac0a210d94233bb5000dc", + "RSA-RIPEMD160": "b1765fc4b91bc384a42942f91d5df69062a9ce55", + "RSA-SHA": "2204450ab4b1df64742a7c4518ec72a4221b888d", + "RSA-SHA1": "959ac4082388e19e9be5de571c047ef10c174a8d", + "RSA-SHA1-2": "959ac4082388e19e9be5de571c047ef10c174a8d", + "RSA-SHA224": "64fab6154a77d82267968b152b84cb8ea0eccef27ccb431121b81700", + "RSA-SHA256": "c80931a1263d7f192937eea3e453006b19525ed981314ec3fd561d256e8e135d", + "RSA-SHA384": "5b16aedae909a1d5994aedd5593fe582b8291227937711903a7ff99cacc6b80e25b4f5e6236cbe80a2bc84bd64032bef", + "RSA-SHA512": "03d6d82208d4c26503c1bd34a8eda172f485f14f010d266deb828ec950172b876db8c9a65f90a29b58cb100e7922f4d64edc88ac0af7e20be02c6f5e29a1eff4", + "dsaEncryption": "959ac4082388e19e9be5de571c047ef10c174a8d", + "dsaWithSHA": "959ac4082388e19e9be5de571c047ef10c174a8d", + "dsaWithSHA1": "959ac4082388e19e9be5de571c047ef10c174a8d", + "dss1": "959ac4082388e19e9be5de571c047ef10c174a8d", + "ecdsa-with-SHA1": "959ac4082388e19e9be5de571c047ef10c174a8d", + "md4": "ca34700840da5b92bb4bfaf89e6c0fc5", + "md4WithRSAEncryption": "ca34700840da5b92bb4bfaf89e6c0fc5", + "md5": "efe794cdfad5cb86656e29854a1f5c92", + "md5WithRSAEncryption": "efe794cdfad5cb86656e29854a1f5c92", + "mdc2": "c70716f4a55ac0a210d94233bb5000dc", + "mdc2WithRSA": "c70716f4a55ac0a210d94233bb5000dc", + "ripemd": "b1765fc4b91bc384a42942f91d5df69062a9ce55", + "ripemd160": "b1765fc4b91bc384a42942f91d5df69062a9ce55", + "ripemd160WithRSA": "b1765fc4b91bc384a42942f91d5df69062a9ce55", + "rmd160": "b1765fc4b91bc384a42942f91d5df69062a9ce55", + "sha": "2204450ab4b1df64742a7c4518ec72a4221b888d", + "sha1": "959ac4082388e19e9be5de571c047ef10c174a8d", + "sha1WithRSAEncryption": "959ac4082388e19e9be5de571c047ef10c174a8d", + "sha224": "64fab6154a77d82267968b152b84cb8ea0eccef27ccb431121b81700", + "sha224WithRSAEncryption": "64fab6154a77d82267968b152b84cb8ea0eccef27ccb431121b81700", + "sha256": "c80931a1263d7f192937eea3e453006b19525ed981314ec3fd561d256e8e135d", + "sha256WithRSAEncryption": "c80931a1263d7f192937eea3e453006b19525ed981314ec3fd561d256e8e135d", + "sha384": "5b16aedae909a1d5994aedd5593fe582b8291227937711903a7ff99cacc6b80e25b4f5e6236cbe80a2bc84bd64032bef", + "sha384WithRSAEncryption": "5b16aedae909a1d5994aedd5593fe582b8291227937711903a7ff99cacc6b80e25b4f5e6236cbe80a2bc84bd64032bef", + "sha512": "03d6d82208d4c26503c1bd34a8eda172f485f14f010d266deb828ec950172b876db8c9a65f90a29b58cb100e7922f4d64edc88ac0af7e20be02c6f5e29a1eff4", + "sha512WithRSAEncryption": "03d6d82208d4c26503c1bd34a8eda172f485f14f010d266deb828ec950172b876db8c9a65f90a29b58cb100e7922f4d64edc88ac0af7e20be02c6f5e29a1eff4", + "shaWithRSAEncryption": "2204450ab4b1df64742a7c4518ec72a4221b888d", + "ssl2-md5": "efe794cdfad5cb86656e29854a1f5c92", + "ssl3-md5": "efe794cdfad5cb86656e29854a1f5c92", + "ssl3-sha1": "959ac4082388e19e9be5de571c047ef10c174a8d", + "whirlpool": "f51e413f17b4b0397146a17ced02eaee2e7a676a2ce067ec73a1ceaa5e91734efd768edd94fba3a74daf1dcff34753aa9e6643cc827693daa9563496bd190c6b" + }, + { + "input": "+AAAAf//gAAP//+P/wAf/w//wAAA///8AA//8ABwAAA//8AAAHwAAH4AD/wAAAD//4AAAA////w4AAAD8AAx8B///8AH///gH///8/4AAAD//8AAH+f/4f//3wAAAB//AAAA", + "DSA": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "DSA-SHA": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "DSA-SHA1": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "DSA-SHA1-old": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "RSA-MD4": "55310eb4c7650f3847ca80d363bae64e", + "RSA-MD5": "e5f19a0045481443bae165f03598a9ba", + "RSA-MDC2": "7728d4f29b7b3451153de77f0484a840", + "RSA-RIPEMD160": "4d77c7b1392dcea775686ef4b8067bbaa1a781d8", + "RSA-SHA": "fe467c8f286ed1967b86b5b204dea1793cf60c5e", + "RSA-SHA1": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "RSA-SHA1-2": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "RSA-SHA224": "20ad281199872531bb2353c8b36a6f434d6d683f3071fa2fdf3c3194", + "RSA-SHA256": "a3b6ba9a5cba6071a99b1a43454053bfc3e6d1338ccf0063d5d71247a6b57566", + "RSA-SHA384": "4e2ca16e010a0a71ee5d37fbe012499af5a0c3ea73132462d0f93432ffd1297efd6208833f3a6acaa93ad29716b6ef39", + "RSA-SHA512": "b8e94b6c6bb9bb37c87c7a9adb138bf7af5a7758ef84b5fc7b5a7aab1a8bdce779eb22b3654f0286481805ac90b32c3260145143211668ca881523079344c81c", + "dsaEncryption": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "dsaWithSHA": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "dsaWithSHA1": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "dss1": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "ecdsa-with-SHA1": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "md4": "55310eb4c7650f3847ca80d363bae64e", + "md4WithRSAEncryption": "55310eb4c7650f3847ca80d363bae64e", + "md5": "e5f19a0045481443bae165f03598a9ba", + "md5WithRSAEncryption": "e5f19a0045481443bae165f03598a9ba", + "mdc2": "7728d4f29b7b3451153de77f0484a840", + "mdc2WithRSA": "7728d4f29b7b3451153de77f0484a840", + "ripemd": "4d77c7b1392dcea775686ef4b8067bbaa1a781d8", + "ripemd160": "4d77c7b1392dcea775686ef4b8067bbaa1a781d8", + "ripemd160WithRSA": "4d77c7b1392dcea775686ef4b8067bbaa1a781d8", + "rmd160": "4d77c7b1392dcea775686ef4b8067bbaa1a781d8", + "sha": "fe467c8f286ed1967b86b5b204dea1793cf60c5e", + "sha1": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "sha1WithRSAEncryption": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "sha224": "20ad281199872531bb2353c8b36a6f434d6d683f3071fa2fdf3c3194", + "sha224WithRSAEncryption": "20ad281199872531bb2353c8b36a6f434d6d683f3071fa2fdf3c3194", + "sha256": "a3b6ba9a5cba6071a99b1a43454053bfc3e6d1338ccf0063d5d71247a6b57566", + "sha256WithRSAEncryption": "a3b6ba9a5cba6071a99b1a43454053bfc3e6d1338ccf0063d5d71247a6b57566", + "sha384": "4e2ca16e010a0a71ee5d37fbe012499af5a0c3ea73132462d0f93432ffd1297efd6208833f3a6acaa93ad29716b6ef39", + "sha384WithRSAEncryption": "4e2ca16e010a0a71ee5d37fbe012499af5a0c3ea73132462d0f93432ffd1297efd6208833f3a6acaa93ad29716b6ef39", + "sha512": "b8e94b6c6bb9bb37c87c7a9adb138bf7af5a7758ef84b5fc7b5a7aab1a8bdce779eb22b3654f0286481805ac90b32c3260145143211668ca881523079344c81c", + "sha512WithRSAEncryption": "b8e94b6c6bb9bb37c87c7a9adb138bf7af5a7758ef84b5fc7b5a7aab1a8bdce779eb22b3654f0286481805ac90b32c3260145143211668ca881523079344c81c", + "shaWithRSAEncryption": "fe467c8f286ed1967b86b5b204dea1793cf60c5e", + "ssl2-md5": "e5f19a0045481443bae165f03598a9ba", + "ssl3-md5": "e5f19a0045481443bae165f03598a9ba", + "ssl3-sha1": "baa7aa7b7753fa0abdc4a541842b5d238d949f0a", + "whirlpool": "462639254d4c00ddd11ac8de1fc59cf02b01b3538786e13a65646315f5eeb589480553caadfa66d112ee90ffb7df3c730a934cf956fbb40a735dd38d042a4fe9" + }, + { + "input": "P///+AAAAGAAD///4Af///8AAD////Af//+AAHAAAAEAAAA///4AAAAf+PzAD//4AD//wP//gAAD///4AD///AAAD4H/wAP/wD///4AD//4A///+AAAcAAAAP///+AB//8AAAA==", + "DSA": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "DSA-SHA": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "DSA-SHA1": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "DSA-SHA1-old": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "RSA-MD4": "caf6471ff4b9518b8f016561db4b1a15", + "RSA-MD5": "b8fe8691321edbf308a9d60bb817c6af", + "RSA-MDC2": "f0beb32c7aff9a1c1625fe032ca6f3ec", + "RSA-RIPEMD160": "1543df020691f57f14569545c05c46cd7338d828", + "RSA-SHA": "d804c20c89803fc75bb7e4867ccb9374d9a11d14", + "RSA-SHA1": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "RSA-SHA1-2": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "RSA-SHA224": "b2e0a40cd537e8aca40f6e48ea404ebaacaa2eb40352658d69775673", + "RSA-SHA256": "7d057dc07ed5a7c11590262a0a18c8cd614a029ca12fe08bfedc87307b5f65b9", + "RSA-SHA384": "89498c99301d4543d9eb2845ad25ce4fd66b3ad11a6c6aca2106c75b71647c3162c7f7a6c770fb9ac6f803c3d8172ac7", + "RSA-SHA512": "2f79327fd6c2a23fbbcc197ba3ba2b07a45672ef75619f6ce3eb34343edbffe4787d26a86c28525e1299182076a4ae35ccb0c0c80fa9fae8effe94c336446f1e", + "dsaEncryption": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "dsaWithSHA": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "dsaWithSHA1": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "dss1": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "ecdsa-with-SHA1": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "md4": "caf6471ff4b9518b8f016561db4b1a15", + "md4WithRSAEncryption": "caf6471ff4b9518b8f016561db4b1a15", + "md5": "b8fe8691321edbf308a9d60bb817c6af", + "md5WithRSAEncryption": "b8fe8691321edbf308a9d60bb817c6af", + "mdc2": "f0beb32c7aff9a1c1625fe032ca6f3ec", + "mdc2WithRSA": "f0beb32c7aff9a1c1625fe032ca6f3ec", + "ripemd": "1543df020691f57f14569545c05c46cd7338d828", + "ripemd160": "1543df020691f57f14569545c05c46cd7338d828", + "ripemd160WithRSA": "1543df020691f57f14569545c05c46cd7338d828", + "rmd160": "1543df020691f57f14569545c05c46cd7338d828", + "sha": "d804c20c89803fc75bb7e4867ccb9374d9a11d14", + "sha1": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "sha1WithRSAEncryption": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "sha224": "b2e0a40cd537e8aca40f6e48ea404ebaacaa2eb40352658d69775673", + "sha224WithRSAEncryption": "b2e0a40cd537e8aca40f6e48ea404ebaacaa2eb40352658d69775673", + "sha256": "7d057dc07ed5a7c11590262a0a18c8cd614a029ca12fe08bfedc87307b5f65b9", + "sha256WithRSAEncryption": "7d057dc07ed5a7c11590262a0a18c8cd614a029ca12fe08bfedc87307b5f65b9", + "sha384": "89498c99301d4543d9eb2845ad25ce4fd66b3ad11a6c6aca2106c75b71647c3162c7f7a6c770fb9ac6f803c3d8172ac7", + "sha384WithRSAEncryption": "89498c99301d4543d9eb2845ad25ce4fd66b3ad11a6c6aca2106c75b71647c3162c7f7a6c770fb9ac6f803c3d8172ac7", + "sha512": "2f79327fd6c2a23fbbcc197ba3ba2b07a45672ef75619f6ce3eb34343edbffe4787d26a86c28525e1299182076a4ae35ccb0c0c80fa9fae8effe94c336446f1e", + "sha512WithRSAEncryption": "2f79327fd6c2a23fbbcc197ba3ba2b07a45672ef75619f6ce3eb34343edbffe4787d26a86c28525e1299182076a4ae35ccb0c0c80fa9fae8effe94c336446f1e", + "shaWithRSAEncryption": "d804c20c89803fc75bb7e4867ccb9374d9a11d14", + "ssl2-md5": "b8fe8691321edbf308a9d60bb817c6af", + "ssl3-md5": "b8fe8691321edbf308a9d60bb817c6af", + "ssl3-sha1": "351394dcebc08155d100fcd488578e6ae71d0e9c", + "whirlpool": "380a2ca456afe1b85467c7292c401db802fa36d8228f404bd77269b10ed70e87256a899d25a2565572f12d34d944ebdd2527c6f79300f50366e7f7c4a723d71c" + }, + { + "input": "AAAAD//+D///h////wCAAA//wAAD8B/34AAAcAAB////gAH+B/AAAf/8AAAEAAH//gf///4AB8AAAP///4fwA//8AAAf+AAB///AAAA//8AAAH+P//gAAAB//+AGDgAAD///gAA=", + "DSA": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "DSA-SHA": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "DSA-SHA1": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "DSA-SHA1-old": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "RSA-MD4": "54cdb51d1dc30c96402d1d821092520d", + "RSA-MD5": "f31fdd0f1aef106005e6d29b72229fa1", + "RSA-MDC2": "39876ea15aa7ecdca74dffde0ebff8ea", + "RSA-RIPEMD160": "4e12b38791fea7cf5a83d0f353e82e8f8c2b708c", + "RSA-SHA": "a17893a9d038002e3a6865d93fe519e00bba0df8", + "RSA-SHA1": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "RSA-SHA1-2": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "RSA-SHA224": "c153da85e5091af2a95e6f6ab33f946cd3e5223241dd015e55495fc8", + "RSA-SHA256": "0b7744d3394c04618e6376cd450cc3fc81586493ab5081a9b3b155938d98563c", + "RSA-SHA384": "46e859d40c256cbe2871997329b0e330e4278ce3f2307ef61580d55317fdaf4c73cd380fd64475577e82f975fc06bc21", + "RSA-SHA512": "28fc3b506c5c6ce09784cafad1c08b99c88efc9d46e771ddcfef25e1afc0524453d8c36ceaa9f40dba6689b70d1fcb7febecb0ab302c9e1b2905589d4785808c", + "dsaEncryption": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "dsaWithSHA": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "dsaWithSHA1": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "dss1": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "ecdsa-with-SHA1": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "md4": "54cdb51d1dc30c96402d1d821092520d", + "md4WithRSAEncryption": "54cdb51d1dc30c96402d1d821092520d", + "md5": "f31fdd0f1aef106005e6d29b72229fa1", + "md5WithRSAEncryption": "f31fdd0f1aef106005e6d29b72229fa1", + "mdc2": "39876ea15aa7ecdca74dffde0ebff8ea", + "mdc2WithRSA": "39876ea15aa7ecdca74dffde0ebff8ea", + "ripemd": "4e12b38791fea7cf5a83d0f353e82e8f8c2b708c", + "ripemd160": "4e12b38791fea7cf5a83d0f353e82e8f8c2b708c", + "ripemd160WithRSA": "4e12b38791fea7cf5a83d0f353e82e8f8c2b708c", + "rmd160": "4e12b38791fea7cf5a83d0f353e82e8f8c2b708c", + "sha": "a17893a9d038002e3a6865d93fe519e00bba0df8", + "sha1": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "sha1WithRSAEncryption": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "sha224": "c153da85e5091af2a95e6f6ab33f946cd3e5223241dd015e55495fc8", + "sha224WithRSAEncryption": "c153da85e5091af2a95e6f6ab33f946cd3e5223241dd015e55495fc8", + "sha256": "0b7744d3394c04618e6376cd450cc3fc81586493ab5081a9b3b155938d98563c", + "sha256WithRSAEncryption": "0b7744d3394c04618e6376cd450cc3fc81586493ab5081a9b3b155938d98563c", + "sha384": "46e859d40c256cbe2871997329b0e330e4278ce3f2307ef61580d55317fdaf4c73cd380fd64475577e82f975fc06bc21", + "sha384WithRSAEncryption": "46e859d40c256cbe2871997329b0e330e4278ce3f2307ef61580d55317fdaf4c73cd380fd64475577e82f975fc06bc21", + "sha512": "28fc3b506c5c6ce09784cafad1c08b99c88efc9d46e771ddcfef25e1afc0524453d8c36ceaa9f40dba6689b70d1fcb7febecb0ab302c9e1b2905589d4785808c", + "sha512WithRSAEncryption": "28fc3b506c5c6ce09784cafad1c08b99c88efc9d46e771ddcfef25e1afc0524453d8c36ceaa9f40dba6689b70d1fcb7febecb0ab302c9e1b2905589d4785808c", + "shaWithRSAEncryption": "a17893a9d038002e3a6865d93fe519e00bba0df8", + "ssl2-md5": "f31fdd0f1aef106005e6d29b72229fa1", + "ssl3-md5": "f31fdd0f1aef106005e6d29b72229fa1", + "ssl3-sha1": "ab8be94c5af60d9477ef1252d604e58e27b2a9ee", + "whirlpool": "74a0712eaa873fa0751e25ae58284972bbc487c97361547da0fabc4e0187acc3f691de98630aa2afb99ad039aa67ca1981c5c86277c6f26e7f5a67b9c0e5539d" + }, + { + "input": "A////eAAAB//+AH///v//+AB8PAAAP///4AAAH///+Af///wAYD////gAAB///D//8AAAAf+AAAAHgAf///gH//gAf/AAD//4AAAD/AA//9/wB/4P///wAAAf//g//wAAP8P////", + "DSA": "3429ec74a695fdd3228f152564952308afe0680a", + "DSA-SHA": "3429ec74a695fdd3228f152564952308afe0680a", + "DSA-SHA1": "3429ec74a695fdd3228f152564952308afe0680a", + "DSA-SHA1-old": "3429ec74a695fdd3228f152564952308afe0680a", + "RSA-MD4": "d8c3eb4837b25c0104f2609e39e303fc", + "RSA-MD5": "239ed45c3cb734db446adfbbe3dab8a1", + "RSA-MDC2": "274c9cfec26ca6cd5a0d7fe76d34b981", + "RSA-RIPEMD160": "accbb4022ec357affb25ad843357824a931895af", + "RSA-SHA": "ef0bb7e636cc148fb39424fb6d7d15c06cbc53ae", + "RSA-SHA1": "3429ec74a695fdd3228f152564952308afe0680a", + "RSA-SHA1-2": "3429ec74a695fdd3228f152564952308afe0680a", + "RSA-SHA224": "f756eb8dd16502b6fde9233b7cb4cbea68017da71c163dfa31471ff3", + "RSA-SHA256": "e8d1ea7154ec53c175761311295f69037865db32ec22976b6ddb981d226760ad", + "RSA-SHA384": "6c813aa44a53c8c35569b29fdb5337b1d8f89463a191dcb7c60f4b64a8bfc82c77a515a042fa282345d37a2fe20943d0", + "RSA-SHA512": "d874ce9b2ac8b10d85a6a7c9935c76568559b3eef248161afcecb78585d05d476df2005ab43baedffd2acfc78cffbde018d522a3d1ed34566b56e1b209cb624e", + "dsaEncryption": "3429ec74a695fdd3228f152564952308afe0680a", + "dsaWithSHA": "3429ec74a695fdd3228f152564952308afe0680a", + "dsaWithSHA1": "3429ec74a695fdd3228f152564952308afe0680a", + "dss1": "3429ec74a695fdd3228f152564952308afe0680a", + "ecdsa-with-SHA1": "3429ec74a695fdd3228f152564952308afe0680a", + "md4": "d8c3eb4837b25c0104f2609e39e303fc", + "md4WithRSAEncryption": "d8c3eb4837b25c0104f2609e39e303fc", + "md5": "239ed45c3cb734db446adfbbe3dab8a1", + "md5WithRSAEncryption": "239ed45c3cb734db446adfbbe3dab8a1", + "mdc2": "274c9cfec26ca6cd5a0d7fe76d34b981", + "mdc2WithRSA": "274c9cfec26ca6cd5a0d7fe76d34b981", + "ripemd": "accbb4022ec357affb25ad843357824a931895af", + "ripemd160": "accbb4022ec357affb25ad843357824a931895af", + "ripemd160WithRSA": "accbb4022ec357affb25ad843357824a931895af", + "rmd160": "accbb4022ec357affb25ad843357824a931895af", + "sha": "ef0bb7e636cc148fb39424fb6d7d15c06cbc53ae", + "sha1": "3429ec74a695fdd3228f152564952308afe0680a", + "sha1WithRSAEncryption": "3429ec74a695fdd3228f152564952308afe0680a", + "sha224": "f756eb8dd16502b6fde9233b7cb4cbea68017da71c163dfa31471ff3", + "sha224WithRSAEncryption": "f756eb8dd16502b6fde9233b7cb4cbea68017da71c163dfa31471ff3", + "sha256": "e8d1ea7154ec53c175761311295f69037865db32ec22976b6ddb981d226760ad", + "sha256WithRSAEncryption": "e8d1ea7154ec53c175761311295f69037865db32ec22976b6ddb981d226760ad", + "sha384": "6c813aa44a53c8c35569b29fdb5337b1d8f89463a191dcb7c60f4b64a8bfc82c77a515a042fa282345d37a2fe20943d0", + "sha384WithRSAEncryption": "6c813aa44a53c8c35569b29fdb5337b1d8f89463a191dcb7c60f4b64a8bfc82c77a515a042fa282345d37a2fe20943d0", + "sha512": "d874ce9b2ac8b10d85a6a7c9935c76568559b3eef248161afcecb78585d05d476df2005ab43baedffd2acfc78cffbde018d522a3d1ed34566b56e1b209cb624e", + "sha512WithRSAEncryption": "d874ce9b2ac8b10d85a6a7c9935c76568559b3eef248161afcecb78585d05d476df2005ab43baedffd2acfc78cffbde018d522a3d1ed34566b56e1b209cb624e", + "shaWithRSAEncryption": "ef0bb7e636cc148fb39424fb6d7d15c06cbc53ae", + "ssl2-md5": "239ed45c3cb734db446adfbbe3dab8a1", + "ssl3-md5": "239ed45c3cb734db446adfbbe3dab8a1", + "ssl3-sha1": "3429ec74a695fdd3228f152564952308afe0680a", + "whirlpool": "1063e04df2cb1ecc3193c653525e8fe573a28b04ef344d73990d09da7b5a53d7ab8f411f5ee379bb05376bf431c246109020e4cb945fb3b682d373ad7f745e45" + }, + { + "input": "B//8A////9///4f/GAADgAH/AAAAH/8AAD///8Af4D////wAAAH/+AAAP///+AAAB+AAB//5/+AAP+AAf+/wAAeB//wAAAD/4AAwAAAA///wAAAD//x/B/gD////AD/8AAAB/8AAAA==", + "DSA": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "DSA-SHA": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "DSA-SHA1": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "DSA-SHA1-old": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "RSA-MD4": "e1d299e788abff60e2249ed7e2d80bbf", + "RSA-MD5": "2c2303411c7d25617a54106aca18070d", + "RSA-MDC2": "0d7f2d9d5ff11df485d8fb40433b970d", + "RSA-RIPEMD160": "2fa158685a46114b0aa0eb44792b7a72e206420e", + "RSA-SHA": "c7bb9cb70aaf9eedf243081901aa41f6629eec6f", + "RSA-SHA1": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "RSA-SHA1-2": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "RSA-SHA224": "c892b2e1f5d40b80823182aeb78ca0441e17c690df0fd66633c5565b", + "RSA-SHA256": "40aa287bdf661317439fa5ffa77cc9fa9ca3df504aae74b0ba83b2fbebbaac83", + "RSA-SHA384": "b7e69de25e82bedf5ebb07010b82547b7b3120959eed48417287de0a94e2bd1cd0ee980e8f9cc98abde68bc5f3b16916", + "RSA-SHA512": "1e89f0c16069768b010807a5b504a49a5eb506a0341e25971f87d241a161a4ad743da93dfe8a28ff18b025f27a565bddb57d58a9c44ef8c4ccd1bc4769dae6b1", + "dsaEncryption": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "dsaWithSHA": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "dsaWithSHA1": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "dss1": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "ecdsa-with-SHA1": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "md4": "e1d299e788abff60e2249ed7e2d80bbf", + "md4WithRSAEncryption": "e1d299e788abff60e2249ed7e2d80bbf", + "md5": "2c2303411c7d25617a54106aca18070d", + "md5WithRSAEncryption": "2c2303411c7d25617a54106aca18070d", + "mdc2": "0d7f2d9d5ff11df485d8fb40433b970d", + "mdc2WithRSA": "0d7f2d9d5ff11df485d8fb40433b970d", + "ripemd": "2fa158685a46114b0aa0eb44792b7a72e206420e", + "ripemd160": "2fa158685a46114b0aa0eb44792b7a72e206420e", + "ripemd160WithRSA": "2fa158685a46114b0aa0eb44792b7a72e206420e", + "rmd160": "2fa158685a46114b0aa0eb44792b7a72e206420e", + "sha": "c7bb9cb70aaf9eedf243081901aa41f6629eec6f", + "sha1": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "sha1WithRSAEncryption": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "sha224": "c892b2e1f5d40b80823182aeb78ca0441e17c690df0fd66633c5565b", + "sha224WithRSAEncryption": "c892b2e1f5d40b80823182aeb78ca0441e17c690df0fd66633c5565b", + "sha256": "40aa287bdf661317439fa5ffa77cc9fa9ca3df504aae74b0ba83b2fbebbaac83", + "sha256WithRSAEncryption": "40aa287bdf661317439fa5ffa77cc9fa9ca3df504aae74b0ba83b2fbebbaac83", + "sha384": "b7e69de25e82bedf5ebb07010b82547b7b3120959eed48417287de0a94e2bd1cd0ee980e8f9cc98abde68bc5f3b16916", + "sha384WithRSAEncryption": "b7e69de25e82bedf5ebb07010b82547b7b3120959eed48417287de0a94e2bd1cd0ee980e8f9cc98abde68bc5f3b16916", + "sha512": "1e89f0c16069768b010807a5b504a49a5eb506a0341e25971f87d241a161a4ad743da93dfe8a28ff18b025f27a565bddb57d58a9c44ef8c4ccd1bc4769dae6b1", + "sha512WithRSAEncryption": "1e89f0c16069768b010807a5b504a49a5eb506a0341e25971f87d241a161a4ad743da93dfe8a28ff18b025f27a565bddb57d58a9c44ef8c4ccd1bc4769dae6b1", + "shaWithRSAEncryption": "c7bb9cb70aaf9eedf243081901aa41f6629eec6f", + "ssl2-md5": "2c2303411c7d25617a54106aca18070d", + "ssl3-md5": "2c2303411c7d25617a54106aca18070d", + "ssl3-sha1": "907fa46c029bc67eaa8e4f46e3c2a232f85bd122", + "whirlpool": "6d475795500116878cebffaa6693c791ad416578b98b97c63e1f578c307640125e9f10f1a15b3e81c11d24a79981a54463b5de4d693a0d0e74989d7c18166e68" + }, + { + "input": "AH/8AAAD//gAAGH+f//+AAAf//w//4AB////4AD///+AH/gAf///+AAAB///4AAAB////4AA/4AP///8AAB///4AAAAwAAB/gAAH///wAAAD/8AP//+AP/+AA////gP///9//B/wAAA=", + "DSA": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "DSA-SHA": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "DSA-SHA1": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "DSA-SHA1-old": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "RSA-MD4": "f0e60304c9f67343a4c92ff650c83785", + "RSA-MD5": "de179c41aca8bcdc388964024948ff8e", + "RSA-MDC2": "8f0060202c06090136da8999ae49b67f", + "RSA-RIPEMD160": "0b2d06ac7b6b0c2d389df8503a7abad0073e3c54", + "RSA-SHA": "ec269ef07494b78a45dbac17be0473eac2d43d65", + "RSA-SHA1": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "RSA-SHA1-2": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "RSA-SHA224": "b3fd39c424c89ade47cdf653a5272ee66a5c8a3fb4e989f6dcac5641", + "RSA-SHA256": "ee2e8fb7206e2e8fdae91afcc3e903d534b304069f232c68f53407cfc6d0bbae", + "RSA-SHA384": "94662a4a2d992a072f94b2bcf649cc4169f3f8f46bd4bf9ce9c207f9c4d241eee6c02e4e2e41883c8e916c79c458b771", + "RSA-SHA512": "47f6def39d031dc2353714e174a4b0574eb8c1d6f6001f59d768591a8aa6273c00446a13a6aaf5918a2772de94563e6b8a42448dc9fc0041f5f9290cf385307b", + "dsaEncryption": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "dsaWithSHA": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "dsaWithSHA1": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "dss1": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "ecdsa-with-SHA1": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "md4": "f0e60304c9f67343a4c92ff650c83785", + "md4WithRSAEncryption": "f0e60304c9f67343a4c92ff650c83785", + "md5": "de179c41aca8bcdc388964024948ff8e", + "md5WithRSAEncryption": "de179c41aca8bcdc388964024948ff8e", + "mdc2": "8f0060202c06090136da8999ae49b67f", + "mdc2WithRSA": "8f0060202c06090136da8999ae49b67f", + "ripemd": "0b2d06ac7b6b0c2d389df8503a7abad0073e3c54", + "ripemd160": "0b2d06ac7b6b0c2d389df8503a7abad0073e3c54", + "ripemd160WithRSA": "0b2d06ac7b6b0c2d389df8503a7abad0073e3c54", + "rmd160": "0b2d06ac7b6b0c2d389df8503a7abad0073e3c54", + "sha": "ec269ef07494b78a45dbac17be0473eac2d43d65", + "sha1": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "sha1WithRSAEncryption": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "sha224": "b3fd39c424c89ade47cdf653a5272ee66a5c8a3fb4e989f6dcac5641", + "sha224WithRSAEncryption": "b3fd39c424c89ade47cdf653a5272ee66a5c8a3fb4e989f6dcac5641", + "sha256": "ee2e8fb7206e2e8fdae91afcc3e903d534b304069f232c68f53407cfc6d0bbae", + "sha256WithRSAEncryption": "ee2e8fb7206e2e8fdae91afcc3e903d534b304069f232c68f53407cfc6d0bbae", + "sha384": "94662a4a2d992a072f94b2bcf649cc4169f3f8f46bd4bf9ce9c207f9c4d241eee6c02e4e2e41883c8e916c79c458b771", + "sha384WithRSAEncryption": "94662a4a2d992a072f94b2bcf649cc4169f3f8f46bd4bf9ce9c207f9c4d241eee6c02e4e2e41883c8e916c79c458b771", + "sha512": "47f6def39d031dc2353714e174a4b0574eb8c1d6f6001f59d768591a8aa6273c00446a13a6aaf5918a2772de94563e6b8a42448dc9fc0041f5f9290cf385307b", + "sha512WithRSAEncryption": "47f6def39d031dc2353714e174a4b0574eb8c1d6f6001f59d768591a8aa6273c00446a13a6aaf5918a2772de94563e6b8a42448dc9fc0041f5f9290cf385307b", + "shaWithRSAEncryption": "ec269ef07494b78a45dbac17be0473eac2d43d65", + "ssl2-md5": "de179c41aca8bcdc388964024948ff8e", + "ssl3-md5": "de179c41aca8bcdc388964024948ff8e", + "ssl3-sha1": "2644c87d1fbbbc0fc8d65f64bca2492da15baae4", + "whirlpool": "b5fcd21f790a1992250a38f98d7e5d0d4d880ecddef947a18f46180a900f261c8072cf331504181c36e7f975039d5ea7d90d1fdb8cacde341db201654962746f" + }, + { + "input": "H/AAAH///gIAAAP////YB///4AH//4AAAAfAAA//wH/wAAf//4AAB/AAAH/8A////8AAAf//+f/+AAAf/8AAAAP+P///AAf+AAADwAA/+AAQA/wAD//AAH//4AD/8AAAf//gAAAP////", + "DSA": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "DSA-SHA": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "DSA-SHA1": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "DSA-SHA1-old": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "RSA-MD4": "f9c0d006e6219227df6c78d6ceda1d60", + "RSA-MD5": "ca335b74d59bd50832267d3bf28f81df", + "RSA-MDC2": "973a426475937a0b912f4f09d0527126", + "RSA-RIPEMD160": "c75d0759656a5c6799012aeac7fde086a68ea46d", + "RSA-SHA": "cdad2b9881f807b9d5b02c0cd3360209a534815b", + "RSA-SHA1": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "RSA-SHA1-2": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "RSA-SHA224": "3584fc30e9bee2533b5f35253d633c6d56686e5bd5d0d897be7dd19b", + "RSA-SHA256": "b940c011eaef2b772ba03659581d525e0b6148f9c59cb7120db55ce18bf6d695", + "RSA-SHA384": "76df8b40bcb7a491465081ffc145195dc79d642f2cc0859bf464729e6534db28f04bb04fcbb21722aa248cad4cafb4e1", + "RSA-SHA512": "fbb0bcd5e88a68f5c1644b87db67574716d325fa7dd211e228020f122edc23966a761663231b473fed3626dca83e4e0f3c009fb905a12c91927b279c94e026f1", + "dsaEncryption": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "dsaWithSHA": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "dsaWithSHA1": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "dss1": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "ecdsa-with-SHA1": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "md4": "f9c0d006e6219227df6c78d6ceda1d60", + "md4WithRSAEncryption": "f9c0d006e6219227df6c78d6ceda1d60", + "md5": "ca335b74d59bd50832267d3bf28f81df", + "md5WithRSAEncryption": "ca335b74d59bd50832267d3bf28f81df", + "mdc2": "973a426475937a0b912f4f09d0527126", + "mdc2WithRSA": "973a426475937a0b912f4f09d0527126", + "ripemd": "c75d0759656a5c6799012aeac7fde086a68ea46d", + "ripemd160": "c75d0759656a5c6799012aeac7fde086a68ea46d", + "ripemd160WithRSA": "c75d0759656a5c6799012aeac7fde086a68ea46d", + "rmd160": "c75d0759656a5c6799012aeac7fde086a68ea46d", + "sha": "cdad2b9881f807b9d5b02c0cd3360209a534815b", + "sha1": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "sha1WithRSAEncryption": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "sha224": "3584fc30e9bee2533b5f35253d633c6d56686e5bd5d0d897be7dd19b", + "sha224WithRSAEncryption": "3584fc30e9bee2533b5f35253d633c6d56686e5bd5d0d897be7dd19b", + "sha256": "b940c011eaef2b772ba03659581d525e0b6148f9c59cb7120db55ce18bf6d695", + "sha256WithRSAEncryption": "b940c011eaef2b772ba03659581d525e0b6148f9c59cb7120db55ce18bf6d695", + "sha384": "76df8b40bcb7a491465081ffc145195dc79d642f2cc0859bf464729e6534db28f04bb04fcbb21722aa248cad4cafb4e1", + "sha384WithRSAEncryption": "76df8b40bcb7a491465081ffc145195dc79d642f2cc0859bf464729e6534db28f04bb04fcbb21722aa248cad4cafb4e1", + "sha512": "fbb0bcd5e88a68f5c1644b87db67574716d325fa7dd211e228020f122edc23966a761663231b473fed3626dca83e4e0f3c009fb905a12c91927b279c94e026f1", + "sha512WithRSAEncryption": "fbb0bcd5e88a68f5c1644b87db67574716d325fa7dd211e228020f122edc23966a761663231b473fed3626dca83e4e0f3c009fb905a12c91927b279c94e026f1", + "shaWithRSAEncryption": "cdad2b9881f807b9d5b02c0cd3360209a534815b", + "ssl2-md5": "ca335b74d59bd50832267d3bf28f81df", + "ssl3-md5": "ca335b74d59bd50832267d3bf28f81df", + "ssl3-sha1": "110a3eeb408756e2e81abaf4c5dcd4d4c6afcf6d", + "whirlpool": "6bfbc19433c7ffbb0871d67a3da6b78c66787e155533e1343f4a575cc54e2014b95ba89f63d45bacab3e98d71dfc097709d8c8984df662867b797bd3799cdf01" + }, + { + "input": "////+AAAYAAAAP///AP//AAAPAA/4H/4AAf/+A/4AAB////8AH/CAAP///4AAf////AD///wGAfAAA//wAAAf///h+AAAAcAH4AEB//gAAAf/4H/gAAD//wAAAf////AAAAfgAH//wAAAA==", + "DSA": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "DSA-SHA": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "DSA-SHA1": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "DSA-SHA1-old": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "RSA-MD4": "bfafeb31b1aecf93ff4523a01736565f", + "RSA-MD5": "dabda7a1cbaa8ea5104c57c8950b703a", + "RSA-MDC2": "92d08bcba9c96be38dcfe494e25c3274", + "RSA-RIPEMD160": "306478e5ddc1ca1a45304b197e22e730ec83162a", + "RSA-SHA": "2121298719445ab95023d442f9f9396d5c86d0cb", + "RSA-SHA1": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "RSA-SHA1-2": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "RSA-SHA224": "e2b877b8b10dfecaa2f0b1d0dd0473b84593b375bcfbd8e4e9bc05cf", + "RSA-SHA256": "9574545ba02bd75bb1dcf038884bf9d7892bc017215308f01ebba7932c014a62", + "RSA-SHA384": "4932ed295a0a3b2218eea675ad35b4a6601ac2aed9e2845cfa63ed740a01bb62ed6be35bc13f2ec14a4951387436d45b", + "RSA-SHA512": "fb7fb28ee316d6d17f7f0ddd292fa56e0802269a255380e737e8cb255ca93def16be30379495e36d8e46decb16b93edea0d214e78484c5efac10e7f738259816", + "dsaEncryption": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "dsaWithSHA": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "dsaWithSHA1": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "dss1": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "ecdsa-with-SHA1": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "md4": "bfafeb31b1aecf93ff4523a01736565f", + "md4WithRSAEncryption": "bfafeb31b1aecf93ff4523a01736565f", + "md5": "dabda7a1cbaa8ea5104c57c8950b703a", + "md5WithRSAEncryption": "dabda7a1cbaa8ea5104c57c8950b703a", + "mdc2": "92d08bcba9c96be38dcfe494e25c3274", + "mdc2WithRSA": "92d08bcba9c96be38dcfe494e25c3274", + "ripemd": "306478e5ddc1ca1a45304b197e22e730ec83162a", + "ripemd160": "306478e5ddc1ca1a45304b197e22e730ec83162a", + "ripemd160WithRSA": "306478e5ddc1ca1a45304b197e22e730ec83162a", + "rmd160": "306478e5ddc1ca1a45304b197e22e730ec83162a", + "sha": "2121298719445ab95023d442f9f9396d5c86d0cb", + "sha1": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "sha1WithRSAEncryption": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "sha224": "e2b877b8b10dfecaa2f0b1d0dd0473b84593b375bcfbd8e4e9bc05cf", + "sha224WithRSAEncryption": "e2b877b8b10dfecaa2f0b1d0dd0473b84593b375bcfbd8e4e9bc05cf", + "sha256": "9574545ba02bd75bb1dcf038884bf9d7892bc017215308f01ebba7932c014a62", + "sha256WithRSAEncryption": "9574545ba02bd75bb1dcf038884bf9d7892bc017215308f01ebba7932c014a62", + "sha384": "4932ed295a0a3b2218eea675ad35b4a6601ac2aed9e2845cfa63ed740a01bb62ed6be35bc13f2ec14a4951387436d45b", + "sha384WithRSAEncryption": "4932ed295a0a3b2218eea675ad35b4a6601ac2aed9e2845cfa63ed740a01bb62ed6be35bc13f2ec14a4951387436d45b", + "sha512": "fb7fb28ee316d6d17f7f0ddd292fa56e0802269a255380e737e8cb255ca93def16be30379495e36d8e46decb16b93edea0d214e78484c5efac10e7f738259816", + "sha512WithRSAEncryption": "fb7fb28ee316d6d17f7f0ddd292fa56e0802269a255380e737e8cb255ca93def16be30379495e36d8e46decb16b93edea0d214e78484c5efac10e7f738259816", + "shaWithRSAEncryption": "2121298719445ab95023d442f9f9396d5c86d0cb", + "ssl2-md5": "dabda7a1cbaa8ea5104c57c8950b703a", + "ssl3-md5": "dabda7a1cbaa8ea5104c57c8950b703a", + "ssl3-sha1": "cd4fdc35fac7e1adb5de40f47f256ef74d584959", + "whirlpool": "b60a858f0370118c43dd09621fe335c99a54c8200cddbfd8c13139af024c96765db1e13ec8f8b4b59b8f8396b1a20b1a0aca35ffce61052db0490505028bba33" + }, + { + "input": "AA/8H/gAD///+Af/8fwAH///8AAP/9////8AAAP///8AAf///8AQD/AAAAD8AB8ABwAB8AAAH+AAADB8P//gAP/8B//8AD////j//8H8H///+AAB//wAAA////8AAP/4DAAAB///AAAAf/8=", + "DSA": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "DSA-SHA": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "DSA-SHA1": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "DSA-SHA1-old": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "RSA-MD4": "08ad8dcc7d78469c8fe9834c1798ac8b", + "RSA-MD5": "076352a22ecea5ebc876812f62c1cb8d", + "RSA-MDC2": "94cd50bebdb725432ae9bfae550ca5b2", + "RSA-RIPEMD160": "a2665c4f35e593a9a6294c228d9e25210627af3b", + "RSA-SHA": "099a44003a86df0f797102a5c7f72d99e2898a31", + "RSA-SHA1": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "RSA-SHA1-2": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "RSA-SHA224": "b30a392033a44919538c8c1a199ebda8cd6b9e871f11c7762be3fc57", + "RSA-SHA256": "da685c53ddf810225507141759e3c74ffeaa1c5eecbe150386a83027e7014077", + "RSA-SHA384": "5569d07f4cfa41300d75f69b0c43fad6789c8d7ed1540b81c616e8f95dc8b96b9ab36ddb0ec37e8fcbfd2a2376f2d78d", + "RSA-SHA512": "9272aa50c3f160a107804b19058950dda018a10293cb811af37c5f984e8e0714b0d3e79635484c518877b928c9fba60c088c31776421f414833758dc4e0e4a8f", + "dsaEncryption": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "dsaWithSHA": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "dsaWithSHA1": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "dss1": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "ecdsa-with-SHA1": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "md4": "08ad8dcc7d78469c8fe9834c1798ac8b", + "md4WithRSAEncryption": "08ad8dcc7d78469c8fe9834c1798ac8b", + "md5": "076352a22ecea5ebc876812f62c1cb8d", + "md5WithRSAEncryption": "076352a22ecea5ebc876812f62c1cb8d", + "mdc2": "94cd50bebdb725432ae9bfae550ca5b2", + "mdc2WithRSA": "94cd50bebdb725432ae9bfae550ca5b2", + "ripemd": "a2665c4f35e593a9a6294c228d9e25210627af3b", + "ripemd160": "a2665c4f35e593a9a6294c228d9e25210627af3b", + "ripemd160WithRSA": "a2665c4f35e593a9a6294c228d9e25210627af3b", + "rmd160": "a2665c4f35e593a9a6294c228d9e25210627af3b", + "sha": "099a44003a86df0f797102a5c7f72d99e2898a31", + "sha1": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "sha1WithRSAEncryption": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "sha224": "b30a392033a44919538c8c1a199ebda8cd6b9e871f11c7762be3fc57", + "sha224WithRSAEncryption": "b30a392033a44919538c8c1a199ebda8cd6b9e871f11c7762be3fc57", + "sha256": "da685c53ddf810225507141759e3c74ffeaa1c5eecbe150386a83027e7014077", + "sha256WithRSAEncryption": "da685c53ddf810225507141759e3c74ffeaa1c5eecbe150386a83027e7014077", + "sha384": "5569d07f4cfa41300d75f69b0c43fad6789c8d7ed1540b81c616e8f95dc8b96b9ab36ddb0ec37e8fcbfd2a2376f2d78d", + "sha384WithRSAEncryption": "5569d07f4cfa41300d75f69b0c43fad6789c8d7ed1540b81c616e8f95dc8b96b9ab36ddb0ec37e8fcbfd2a2376f2d78d", + "sha512": "9272aa50c3f160a107804b19058950dda018a10293cb811af37c5f984e8e0714b0d3e79635484c518877b928c9fba60c088c31776421f414833758dc4e0e4a8f", + "sha512WithRSAEncryption": "9272aa50c3f160a107804b19058950dda018a10293cb811af37c5f984e8e0714b0d3e79635484c518877b928c9fba60c088c31776421f414833758dc4e0e4a8f", + "shaWithRSAEncryption": "099a44003a86df0f797102a5c7f72d99e2898a31", + "ssl2-md5": "076352a22ecea5ebc876812f62c1cb8d", + "ssl3-md5": "076352a22ecea5ebc876812f62c1cb8d", + "ssl3-sha1": "8e6e273208ac256f9eccf296f3f5a37bc8a0f9f7", + "whirlpool": "8dc55ce39d1a79957bea671d83f0122bbe2c8ea99fc6b62b082126397ce45ec6ebbad7e28027d4fa6f154bac6ff76932003524eadb430ed690050eb08620224a" + }, + { + "input": "//+A//8AAAB///8AH/wABgAP+AAAAYAAAH///+A////8AGAAAAD+AAAH///wf///+AAAgAAAD////7///8AH//4AABwAH/wHAAH//wAAAIAAH/8DgAAAP///+AAH////gAAf///gH///wAAA", + "DSA": "fe0606100bdbc268db39b503e0fdfe3766185828", + "DSA-SHA": "fe0606100bdbc268db39b503e0fdfe3766185828", + "DSA-SHA1": "fe0606100bdbc268db39b503e0fdfe3766185828", + "DSA-SHA1-old": "fe0606100bdbc268db39b503e0fdfe3766185828", + "RSA-MD4": "a5b788fb2c6d1a97c83d74f1e29872a8", + "RSA-MD5": "ee0a2bdec712a9413623d8a920714b96", + "RSA-MDC2": "a126048a98e78726a312c63113d125f6", + "RSA-RIPEMD160": "05a6e4a41a03606cc6f2e2cb21a8527b2dfe2e2b", + "RSA-SHA": "c0dbd2d8b1e1c261e73963f23a8cce1614e07b45", + "RSA-SHA1": "fe0606100bdbc268db39b503e0fdfe3766185828", + "RSA-SHA1-2": "fe0606100bdbc268db39b503e0fdfe3766185828", + "RSA-SHA224": "224a83538dc40602cf6996116138bc14209c203d8aadb61008678685", + "RSA-SHA256": "5c0769369e4fb9f9d9e599612923554fb2f1e6d87eaeed283f6106845b66b532", + "RSA-SHA384": "c0b0e64230da1e03e83d93083ee33d1bf7eef00189dea1759b172fd235691cb85df92390656911bbc12ed2b3465fb4d0", + "RSA-SHA512": "593c8043119e06289fda10840f0b4cdd651b1a49256ac4aed3fadfacdd52e2c4c09c03e02f16930e9ea8d99f864830e23c35a2796f9bddc96e0db020c18f95ce", + "dsaEncryption": "fe0606100bdbc268db39b503e0fdfe3766185828", + "dsaWithSHA": "fe0606100bdbc268db39b503e0fdfe3766185828", + "dsaWithSHA1": "fe0606100bdbc268db39b503e0fdfe3766185828", + "dss1": "fe0606100bdbc268db39b503e0fdfe3766185828", + "ecdsa-with-SHA1": "fe0606100bdbc268db39b503e0fdfe3766185828", + "md4": "a5b788fb2c6d1a97c83d74f1e29872a8", + "md4WithRSAEncryption": "a5b788fb2c6d1a97c83d74f1e29872a8", + "md5": "ee0a2bdec712a9413623d8a920714b96", + "md5WithRSAEncryption": "ee0a2bdec712a9413623d8a920714b96", + "mdc2": "a126048a98e78726a312c63113d125f6", + "mdc2WithRSA": "a126048a98e78726a312c63113d125f6", + "ripemd": "05a6e4a41a03606cc6f2e2cb21a8527b2dfe2e2b", + "ripemd160": "05a6e4a41a03606cc6f2e2cb21a8527b2dfe2e2b", + "ripemd160WithRSA": "05a6e4a41a03606cc6f2e2cb21a8527b2dfe2e2b", + "rmd160": "05a6e4a41a03606cc6f2e2cb21a8527b2dfe2e2b", + "sha": "c0dbd2d8b1e1c261e73963f23a8cce1614e07b45", + "sha1": "fe0606100bdbc268db39b503e0fdfe3766185828", + "sha1WithRSAEncryption": "fe0606100bdbc268db39b503e0fdfe3766185828", + "sha224": "224a83538dc40602cf6996116138bc14209c203d8aadb61008678685", + "sha224WithRSAEncryption": "224a83538dc40602cf6996116138bc14209c203d8aadb61008678685", + "sha256": "5c0769369e4fb9f9d9e599612923554fb2f1e6d87eaeed283f6106845b66b532", + "sha256WithRSAEncryption": "5c0769369e4fb9f9d9e599612923554fb2f1e6d87eaeed283f6106845b66b532", + "sha384": "c0b0e64230da1e03e83d93083ee33d1bf7eef00189dea1759b172fd235691cb85df92390656911bbc12ed2b3465fb4d0", + "sha384WithRSAEncryption": "c0b0e64230da1e03e83d93083ee33d1bf7eef00189dea1759b172fd235691cb85df92390656911bbc12ed2b3465fb4d0", + "sha512": "593c8043119e06289fda10840f0b4cdd651b1a49256ac4aed3fadfacdd52e2c4c09c03e02f16930e9ea8d99f864830e23c35a2796f9bddc96e0db020c18f95ce", + "sha512WithRSAEncryption": "593c8043119e06289fda10840f0b4cdd651b1a49256ac4aed3fadfacdd52e2c4c09c03e02f16930e9ea8d99f864830e23c35a2796f9bddc96e0db020c18f95ce", + "shaWithRSAEncryption": "c0dbd2d8b1e1c261e73963f23a8cce1614e07b45", + "ssl2-md5": "ee0a2bdec712a9413623d8a920714b96", + "ssl3-md5": "ee0a2bdec712a9413623d8a920714b96", + "ssl3-sha1": "fe0606100bdbc268db39b503e0fdfe3766185828", + "whirlpool": "84d06f016ea6fefbf31759dbd6e6cf9288e49c151f8d2181ecaa3b47556c978dfaf80bc61b3728b6345aafdbe205c963813b2df83dae5180d0d4e4651297fc57" + }, + { + "input": "////+AAAAH4AAAAf/4AH////gAAAD///w//wAAAEf8B/8AA//4AAf+AAA//AAAf/AAAP/4AAAAeAAAAP////Af///8ADwAAAA///4AAP///AAAP//gAD//gAAA///8AB/+AAAP///AAAH////w==", + "DSA": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "DSA-SHA": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "DSA-SHA1": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "DSA-SHA1-old": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "RSA-MD4": "d8c9d2dba098a2a73e2f285887c49c2d", + "RSA-MD5": "a927c3a99f2843de4133377c690db9b7", + "RSA-MDC2": "590e322c3cce4c29823b1c23b3893eff", + "RSA-RIPEMD160": "da29a53340a19bd8126b7092b0b86fd65dadb674", + "RSA-SHA": "2b70c4e5201a0d99dcb8f690bfba18cafdaf2af5", + "RSA-SHA1": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "RSA-SHA1-2": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "RSA-SHA224": "da0a072fb2f2eed7aa39b893aae73c1a53b9197f04861aca1c40eacd", + "RSA-SHA256": "19056a3d33ebe1b84a100c27fc72d0265ceeb9c573d7942a4d44983238d34ea7", + "RSA-SHA384": "493ba3abc996a9ba7d3d47c582ec49c715d03c67ad4b64834c0b3926906764ca9acd7d5c557c093089223a85f04f6b5d", + "RSA-SHA512": "d3ec082c6f34441b9edfb6902e73a1493e15990aa5d230b288bc27f14072ed6265149225d0707a9049c803844ff444559df87be7ee0a1c592468ed1c8c182efb", + "dsaEncryption": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "dsaWithSHA": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "dsaWithSHA1": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "dss1": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "ecdsa-with-SHA1": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "md4": "d8c9d2dba098a2a73e2f285887c49c2d", + "md4WithRSAEncryption": "d8c9d2dba098a2a73e2f285887c49c2d", + "md5": "a927c3a99f2843de4133377c690db9b7", + "md5WithRSAEncryption": "a927c3a99f2843de4133377c690db9b7", + "mdc2": "590e322c3cce4c29823b1c23b3893eff", + "mdc2WithRSA": "590e322c3cce4c29823b1c23b3893eff", + "ripemd": "da29a53340a19bd8126b7092b0b86fd65dadb674", + "ripemd160": "da29a53340a19bd8126b7092b0b86fd65dadb674", + "ripemd160WithRSA": "da29a53340a19bd8126b7092b0b86fd65dadb674", + "rmd160": "da29a53340a19bd8126b7092b0b86fd65dadb674", + "sha": "2b70c4e5201a0d99dcb8f690bfba18cafdaf2af5", + "sha1": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "sha1WithRSAEncryption": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "sha224": "da0a072fb2f2eed7aa39b893aae73c1a53b9197f04861aca1c40eacd", + "sha224WithRSAEncryption": "da0a072fb2f2eed7aa39b893aae73c1a53b9197f04861aca1c40eacd", + "sha256": "19056a3d33ebe1b84a100c27fc72d0265ceeb9c573d7942a4d44983238d34ea7", + "sha256WithRSAEncryption": "19056a3d33ebe1b84a100c27fc72d0265ceeb9c573d7942a4d44983238d34ea7", + "sha384": "493ba3abc996a9ba7d3d47c582ec49c715d03c67ad4b64834c0b3926906764ca9acd7d5c557c093089223a85f04f6b5d", + "sha384WithRSAEncryption": "493ba3abc996a9ba7d3d47c582ec49c715d03c67ad4b64834c0b3926906764ca9acd7d5c557c093089223a85f04f6b5d", + "sha512": "d3ec082c6f34441b9edfb6902e73a1493e15990aa5d230b288bc27f14072ed6265149225d0707a9049c803844ff444559df87be7ee0a1c592468ed1c8c182efb", + "sha512WithRSAEncryption": "d3ec082c6f34441b9edfb6902e73a1493e15990aa5d230b288bc27f14072ed6265149225d0707a9049c803844ff444559df87be7ee0a1c592468ed1c8c182efb", + "shaWithRSAEncryption": "2b70c4e5201a0d99dcb8f690bfba18cafdaf2af5", + "ssl2-md5": "a927c3a99f2843de4133377c690db9b7", + "ssl3-md5": "a927c3a99f2843de4133377c690db9b7", + "ssl3-sha1": "6c63c3e58047bcdb35a17f74eeba4e9b14420809", + "whirlpool": "db36ace428aab422ddf844b164aa8132dd87bb823bb5bfc355a042e51df7558d4515610661251832301b2b9d69b8cab6f47da4c761ecfc719e20c581ed114079" + }, + { + "input": "//AAP/wAAP///+Afw/4AB//4AA/wAf//8AAA/8AP//+AAAD///P/gAAAgAg4AAAP//AAH////AAPgABwAAAx///+P//4AAAAPD/wD///AAP/+////wAP///+AAAA8AAAAP///AB///AAAf///gA=", + "DSA": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "DSA-SHA": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "DSA-SHA1": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "DSA-SHA1-old": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "RSA-MD4": "4dc384f3e7f2836b317ccaf1b8be898a", + "RSA-MD5": "1fa98cff485549d49799dc8cf987a8af", + "RSA-MDC2": "6ec3a005165154faa0269f79d12f28b9", + "RSA-RIPEMD160": "f1869a123b115a90bdd3382ea210a58f37f62d94", + "RSA-SHA": "bc1da92e3ea4a2685d5b058cf4e040c1d0436abc", + "RSA-SHA1": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "RSA-SHA1-2": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "RSA-SHA224": "4e0edbd811507777b492a9c4a458bbe6f100779e56f12156aab4bf79", + "RSA-SHA256": "8a5e6e6cae30d4283fd70af96d9c53d8ea45ca48892d313981fe208b1384f0dc", + "RSA-SHA384": "4ceb6f484051006c78ddd5bbe1d81a9b04ac61a9145297e3ac8fc4b036ac040d6ec99b7eefa436c6a9710149876d7565", + "RSA-SHA512": "0edd3f9f6adf8642d20edad7a3d23b84990de8152534ffc375b4c7cf127b78fe5a7f578ec4f00c623b1aebb9255d6dff4f8df3b07b5c930de5319275a2e1c0e5", + "dsaEncryption": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "dsaWithSHA": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "dsaWithSHA1": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "dss1": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "ecdsa-with-SHA1": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "md4": "4dc384f3e7f2836b317ccaf1b8be898a", + "md4WithRSAEncryption": "4dc384f3e7f2836b317ccaf1b8be898a", + "md5": "1fa98cff485549d49799dc8cf987a8af", + "md5WithRSAEncryption": "1fa98cff485549d49799dc8cf987a8af", + "mdc2": "6ec3a005165154faa0269f79d12f28b9", + "mdc2WithRSA": "6ec3a005165154faa0269f79d12f28b9", + "ripemd": "f1869a123b115a90bdd3382ea210a58f37f62d94", + "ripemd160": "f1869a123b115a90bdd3382ea210a58f37f62d94", + "ripemd160WithRSA": "f1869a123b115a90bdd3382ea210a58f37f62d94", + "rmd160": "f1869a123b115a90bdd3382ea210a58f37f62d94", + "sha": "bc1da92e3ea4a2685d5b058cf4e040c1d0436abc", + "sha1": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "sha1WithRSAEncryption": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "sha224": "4e0edbd811507777b492a9c4a458bbe6f100779e56f12156aab4bf79", + "sha224WithRSAEncryption": "4e0edbd811507777b492a9c4a458bbe6f100779e56f12156aab4bf79", + "sha256": "8a5e6e6cae30d4283fd70af96d9c53d8ea45ca48892d313981fe208b1384f0dc", + "sha256WithRSAEncryption": "8a5e6e6cae30d4283fd70af96d9c53d8ea45ca48892d313981fe208b1384f0dc", + "sha384": "4ceb6f484051006c78ddd5bbe1d81a9b04ac61a9145297e3ac8fc4b036ac040d6ec99b7eefa436c6a9710149876d7565", + "sha384WithRSAEncryption": "4ceb6f484051006c78ddd5bbe1d81a9b04ac61a9145297e3ac8fc4b036ac040d6ec99b7eefa436c6a9710149876d7565", + "sha512": "0edd3f9f6adf8642d20edad7a3d23b84990de8152534ffc375b4c7cf127b78fe5a7f578ec4f00c623b1aebb9255d6dff4f8df3b07b5c930de5319275a2e1c0e5", + "sha512WithRSAEncryption": "0edd3f9f6adf8642d20edad7a3d23b84990de8152534ffc375b4c7cf127b78fe5a7f578ec4f00c623b1aebb9255d6dff4f8df3b07b5c930de5319275a2e1c0e5", + "shaWithRSAEncryption": "bc1da92e3ea4a2685d5b058cf4e040c1d0436abc", + "ssl2-md5": "1fa98cff485549d49799dc8cf987a8af", + "ssl3-md5": "1fa98cff485549d49799dc8cf987a8af", + "ssl3-sha1": "bcc2bd305f0bcda8cf2d478ef9fe080486cb265f", + "whirlpool": "53f07694c682e20eb81ac3cd4422c503b79cedab4c76007ed42478ed4deffd2fe877596f4fe3a54f5a624a7779682ac196d732f73ff984a783343a75758aaf6e" + }, + { + "input": "///wD/g////gAAP//gAAP/+A////AAAA///4///wAA/x//8AAAAP//wAAAAf8AAAH/AD////4f/gAAAf/8H+AAAH//wAAAAf/j/AAAAB//wAAB///w/gAAH8AP4AAAB/4AAf///gfwAP8AD//gAA", + "DSA": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "DSA-SHA": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "DSA-SHA1": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "DSA-SHA1-old": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "RSA-MD4": "656b67acbab69746b6f43ec4f8de0d5a", + "RSA-MD5": "74013a076a786a26c7e04217bb51031d", + "RSA-MDC2": "44d221209b40fde9ada4ef79fb1bd4e9", + "RSA-RIPEMD160": "75e559295cf61fe1279a5714a124e8c417af718c", + "RSA-SHA": "cf381a063825980458da131b5fb624ad847668ca", + "RSA-SHA1": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "RSA-SHA1-2": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "RSA-SHA224": "65f17b1780d6f24816c595b95ca1d69169bf971b43b8921b7bd5463e", + "RSA-SHA256": "880992dadfeccb31f289522214209eb87f41fea5fd3155ab274e9a6fdc6f9f64", + "RSA-SHA384": "14df2839a8925774f0d65a9e9d717ea92d82cc053b948d45ba8ce4169fe491ca4f6604ca9840959c0141ca1e158752a9", + "RSA-SHA512": "ff11746432697d38dbe59a2ae68a96ff29021d011cf9b4e8ca01313dfabf0b76169ff534dafafdd4f7c618988b54bd3b9eb427df15d82853aa37b44ccaa36b4d", + "dsaEncryption": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "dsaWithSHA": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "dsaWithSHA1": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "dss1": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "ecdsa-with-SHA1": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "md4": "656b67acbab69746b6f43ec4f8de0d5a", + "md4WithRSAEncryption": "656b67acbab69746b6f43ec4f8de0d5a", + "md5": "74013a076a786a26c7e04217bb51031d", + "md5WithRSAEncryption": "74013a076a786a26c7e04217bb51031d", + "mdc2": "44d221209b40fde9ada4ef79fb1bd4e9", + "mdc2WithRSA": "44d221209b40fde9ada4ef79fb1bd4e9", + "ripemd": "75e559295cf61fe1279a5714a124e8c417af718c", + "ripemd160": "75e559295cf61fe1279a5714a124e8c417af718c", + "ripemd160WithRSA": "75e559295cf61fe1279a5714a124e8c417af718c", + "rmd160": "75e559295cf61fe1279a5714a124e8c417af718c", + "sha": "cf381a063825980458da131b5fb624ad847668ca", + "sha1": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "sha1WithRSAEncryption": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "sha224": "65f17b1780d6f24816c595b95ca1d69169bf971b43b8921b7bd5463e", + "sha224WithRSAEncryption": "65f17b1780d6f24816c595b95ca1d69169bf971b43b8921b7bd5463e", + "sha256": "880992dadfeccb31f289522214209eb87f41fea5fd3155ab274e9a6fdc6f9f64", + "sha256WithRSAEncryption": "880992dadfeccb31f289522214209eb87f41fea5fd3155ab274e9a6fdc6f9f64", + "sha384": "14df2839a8925774f0d65a9e9d717ea92d82cc053b948d45ba8ce4169fe491ca4f6604ca9840959c0141ca1e158752a9", + "sha384WithRSAEncryption": "14df2839a8925774f0d65a9e9d717ea92d82cc053b948d45ba8ce4169fe491ca4f6604ca9840959c0141ca1e158752a9", + "sha512": "ff11746432697d38dbe59a2ae68a96ff29021d011cf9b4e8ca01313dfabf0b76169ff534dafafdd4f7c618988b54bd3b9eb427df15d82853aa37b44ccaa36b4d", + "sha512WithRSAEncryption": "ff11746432697d38dbe59a2ae68a96ff29021d011cf9b4e8ca01313dfabf0b76169ff534dafafdd4f7c618988b54bd3b9eb427df15d82853aa37b44ccaa36b4d", + "shaWithRSAEncryption": "cf381a063825980458da131b5fb624ad847668ca", + "ssl2-md5": "74013a076a786a26c7e04217bb51031d", + "ssl3-md5": "74013a076a786a26c7e04217bb51031d", + "ssl3-sha1": "ce5223fd3dd920a3b666481d5625b16457dcb5e8", + "whirlpool": "94e9f5158e107b743f84f506d20777591fc5549a3a494ee91c705339acc5d27298c5b358b59f0593439e3bba6e363d9996df3ab6a9a3db7cf8a3d3d65f0bdc4d" + }, + { + "input": "AH//wAf///+AB////gAAAH4AAAAP/4Af//4H///wA8f///4AAAB//gAAH//+AAAA//wAH//AAAA//wAeAAAD////gAAAf//4A//8AAH///4AD/8CAAf///4AAAD+Af//9///Gf//AAAH/8H/AAAH/w==", + "DSA": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "DSA-SHA": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "DSA-SHA1": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "DSA-SHA1-old": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "RSA-MD4": "dd0488533c8571d3846931d475e1022b", + "RSA-MD5": "a44ca9661e967bb2e98af65277dac72f", + "RSA-MDC2": "cc5edaa9dd78e239ba0a57e8db368ce2", + "RSA-RIPEMD160": "f5930c8404aa25fdd40d693196ba9e72333ba911", + "RSA-SHA": "f489ac1c493db0bea73702f16f56bb0df1818929", + "RSA-SHA1": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "RSA-SHA1-2": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "RSA-SHA224": "3d86293856486715354c82ca58c134718803a8479a3beaa2cfa63884", + "RSA-SHA256": "ea7a2b0e780fc6dc8843643a2bc18a17226a1bb3d9e1467cf0be2201decce2c7", + "RSA-SHA384": "db078ec07faf393f15a2cc309c30ab8ddc276cf4529f7438c22e4c6d893f13339c2b144aa4bb77c3f666ff5d6c677cf3", + "RSA-SHA512": "e91363e3e5eaa25ffd8ea3ccf744bb9165ea22339995dd9e645eb1a12b10b6942262e0cea8df8eac080c7b334821780de2ace12b28174f28d7034ef2e826d2ef", + "dsaEncryption": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "dsaWithSHA": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "dsaWithSHA1": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "dss1": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "ecdsa-with-SHA1": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "md4": "dd0488533c8571d3846931d475e1022b", + "md4WithRSAEncryption": "dd0488533c8571d3846931d475e1022b", + "md5": "a44ca9661e967bb2e98af65277dac72f", + "md5WithRSAEncryption": "a44ca9661e967bb2e98af65277dac72f", + "mdc2": "cc5edaa9dd78e239ba0a57e8db368ce2", + "mdc2WithRSA": "cc5edaa9dd78e239ba0a57e8db368ce2", + "ripemd": "f5930c8404aa25fdd40d693196ba9e72333ba911", + "ripemd160": "f5930c8404aa25fdd40d693196ba9e72333ba911", + "ripemd160WithRSA": "f5930c8404aa25fdd40d693196ba9e72333ba911", + "rmd160": "f5930c8404aa25fdd40d693196ba9e72333ba911", + "sha": "f489ac1c493db0bea73702f16f56bb0df1818929", + "sha1": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "sha1WithRSAEncryption": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "sha224": "3d86293856486715354c82ca58c134718803a8479a3beaa2cfa63884", + "sha224WithRSAEncryption": "3d86293856486715354c82ca58c134718803a8479a3beaa2cfa63884", + "sha256": "ea7a2b0e780fc6dc8843643a2bc18a17226a1bb3d9e1467cf0be2201decce2c7", + "sha256WithRSAEncryption": "ea7a2b0e780fc6dc8843643a2bc18a17226a1bb3d9e1467cf0be2201decce2c7", + "sha384": "db078ec07faf393f15a2cc309c30ab8ddc276cf4529f7438c22e4c6d893f13339c2b144aa4bb77c3f666ff5d6c677cf3", + "sha384WithRSAEncryption": "db078ec07faf393f15a2cc309c30ab8ddc276cf4529f7438c22e4c6d893f13339c2b144aa4bb77c3f666ff5d6c677cf3", + "sha512": "e91363e3e5eaa25ffd8ea3ccf744bb9165ea22339995dd9e645eb1a12b10b6942262e0cea8df8eac080c7b334821780de2ace12b28174f28d7034ef2e826d2ef", + "sha512WithRSAEncryption": "e91363e3e5eaa25ffd8ea3ccf744bb9165ea22339995dd9e645eb1a12b10b6942262e0cea8df8eac080c7b334821780de2ace12b28174f28d7034ef2e826d2ef", + "shaWithRSAEncryption": "f489ac1c493db0bea73702f16f56bb0df1818929", + "ssl2-md5": "a44ca9661e967bb2e98af65277dac72f", + "ssl3-md5": "a44ca9661e967bb2e98af65277dac72f", + "ssl3-sha1": "948886776e42e4f5fae1b2d0c906ac3759e3f8b0", + "whirlpool": "1c289ba43ce458398eceb747eb14f86d1c1c08721a14105f164f18580c491c8476474f401091ef0ba91fa7f11c840851df3ccdbeb663b87d3b5e509faeea8765" + }, + { + "input": "AAAAQAAAB///+B///8AAPv//8AAAAH///gAAAP+AAAA/8f///+AAAAH///8AAB//+AAH///4AB//wf///+AB////4AAAB////8//4AA/4P//wAAH///gAf/8PwAB///+AAH/D////AAAAf//gAAAD/8=", + "DSA": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "DSA-SHA": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "DSA-SHA1": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "DSA-SHA1-old": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "RSA-MD4": "fb830ecbdada506ba09c076b5ff372cb", + "RSA-MD5": "d30897726b635548dbfa5cebffd9cd63", + "RSA-MDC2": "182b91f8c6dd07b726a26ce338960442", + "RSA-RIPEMD160": "7c14d04582b5cebe304cc4a75f8c58fa90ce11b2", + "RSA-SHA": "0e504d2af7523cfad6a6f2e0f787428dcb1e4129", + "RSA-SHA1": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "RSA-SHA1-2": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "RSA-SHA224": "d4432c88dc9a633cc218ad73b87d995ee68fc332c3e54582120ddeff", + "RSA-SHA256": "2077395cd7562dd5e9965ea620cedf32c805f50f748c4ee6e82af960c5ce2d66", + "RSA-SHA384": "ac279a379a46a7f2bcc9afebc3c39410816db167ad1319dc01a750b9d73c640b615930dfa114bc48be084710331ed075", + "RSA-SHA512": "5fc80cf23b3ebac3a5d71f79c590fb62b0d8d09d6a87b43c6588cc1266f8895e4927422ae7561c5a9dabfa3bc7764d6d7f15ce192397138a00f22e46a50b56c8", + "dsaEncryption": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "dsaWithSHA": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "dsaWithSHA1": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "dss1": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "ecdsa-with-SHA1": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "md4": "fb830ecbdada506ba09c076b5ff372cb", + "md4WithRSAEncryption": "fb830ecbdada506ba09c076b5ff372cb", + "md5": "d30897726b635548dbfa5cebffd9cd63", + "md5WithRSAEncryption": "d30897726b635548dbfa5cebffd9cd63", + "mdc2": "182b91f8c6dd07b726a26ce338960442", + "mdc2WithRSA": "182b91f8c6dd07b726a26ce338960442", + "ripemd": "7c14d04582b5cebe304cc4a75f8c58fa90ce11b2", + "ripemd160": "7c14d04582b5cebe304cc4a75f8c58fa90ce11b2", + "ripemd160WithRSA": "7c14d04582b5cebe304cc4a75f8c58fa90ce11b2", + "rmd160": "7c14d04582b5cebe304cc4a75f8c58fa90ce11b2", + "sha": "0e504d2af7523cfad6a6f2e0f787428dcb1e4129", + "sha1": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "sha1WithRSAEncryption": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "sha224": "d4432c88dc9a633cc218ad73b87d995ee68fc332c3e54582120ddeff", + "sha224WithRSAEncryption": "d4432c88dc9a633cc218ad73b87d995ee68fc332c3e54582120ddeff", + "sha256": "2077395cd7562dd5e9965ea620cedf32c805f50f748c4ee6e82af960c5ce2d66", + "sha256WithRSAEncryption": "2077395cd7562dd5e9965ea620cedf32c805f50f748c4ee6e82af960c5ce2d66", + "sha384": "ac279a379a46a7f2bcc9afebc3c39410816db167ad1319dc01a750b9d73c640b615930dfa114bc48be084710331ed075", + "sha384WithRSAEncryption": "ac279a379a46a7f2bcc9afebc3c39410816db167ad1319dc01a750b9d73c640b615930dfa114bc48be084710331ed075", + "sha512": "5fc80cf23b3ebac3a5d71f79c590fb62b0d8d09d6a87b43c6588cc1266f8895e4927422ae7561c5a9dabfa3bc7764d6d7f15ce192397138a00f22e46a50b56c8", + "sha512WithRSAEncryption": "5fc80cf23b3ebac3a5d71f79c590fb62b0d8d09d6a87b43c6588cc1266f8895e4927422ae7561c5a9dabfa3bc7764d6d7f15ce192397138a00f22e46a50b56c8", + "shaWithRSAEncryption": "0e504d2af7523cfad6a6f2e0f787428dcb1e4129", + "ssl2-md5": "d30897726b635548dbfa5cebffd9cd63", + "ssl3-md5": "d30897726b635548dbfa5cebffd9cd63", + "ssl3-sha1": "4c12a51fcfe242f832e3d7329304b11b75161efb", + "whirlpool": "08c5c11459b385bdc9d943aa24294a5a26212701b8c5a79bdd182749f5771f80797472732c7792fcf0a5d4adc6c428360554587c8db0e1cc7582297e6adfce83" + }, + { + "input": "///w////wAOAAAEAAAP////x////4Af8AAAD//AAAAB+AAAABwA///wAD8f//wAAB///wAAAA//8AAD/4AAAAH/wAAD////9/wD/4P//4Af///h///4YAAAB8AAf//4BwAH////4AAH+////gAAAB///", + "DSA": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "DSA-SHA": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "DSA-SHA1": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "DSA-SHA1-old": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "RSA-MD4": "21de0cf6735fba67828356bc87b9256e", + "RSA-MD5": "4ad04a250b8029c9a7bf6529ee8793c3", + "RSA-MDC2": "e7d6c96e07124f578d0b2a1e31e960ea", + "RSA-RIPEMD160": "216575af7e6d135c6b19ff8fc4cf09c04ff29ff9", + "RSA-SHA": "5370de0644f49356125239b6f0fda2333018586f", + "RSA-SHA1": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "RSA-SHA1-2": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "RSA-SHA224": "defa097089b62f2f0620a45c2be83cbd8b17745b21c4a35435090cf2", + "RSA-SHA256": "2dbdc632baa5d0831808518beb80e3737de5bbec3dd0438e75dd30b2ea7fbb90", + "RSA-SHA384": "698e100a6a9e7d70045a8cb63162fb9132048b67d12ab4f4ae393c85aebbf88f0ac1f360b9e45bd31c69ce2bf0cdbd95", + "RSA-SHA512": "a4b851e28dac17e2a71261e8a0c80325fab569746b542bf613351a74a68ed47c4bcd1c2170f2cebb0e99ef6d626dd33fb46cc61f10256fe202b6aefa8c90ebeb", + "dsaEncryption": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "dsaWithSHA": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "dsaWithSHA1": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "dss1": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "ecdsa-with-SHA1": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "md4": "21de0cf6735fba67828356bc87b9256e", + "md4WithRSAEncryption": "21de0cf6735fba67828356bc87b9256e", + "md5": "4ad04a250b8029c9a7bf6529ee8793c3", + "md5WithRSAEncryption": "4ad04a250b8029c9a7bf6529ee8793c3", + "mdc2": "e7d6c96e07124f578d0b2a1e31e960ea", + "mdc2WithRSA": "e7d6c96e07124f578d0b2a1e31e960ea", + "ripemd": "216575af7e6d135c6b19ff8fc4cf09c04ff29ff9", + "ripemd160": "216575af7e6d135c6b19ff8fc4cf09c04ff29ff9", + "ripemd160WithRSA": "216575af7e6d135c6b19ff8fc4cf09c04ff29ff9", + "rmd160": "216575af7e6d135c6b19ff8fc4cf09c04ff29ff9", + "sha": "5370de0644f49356125239b6f0fda2333018586f", + "sha1": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "sha1WithRSAEncryption": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "sha224": "defa097089b62f2f0620a45c2be83cbd8b17745b21c4a35435090cf2", + "sha224WithRSAEncryption": "defa097089b62f2f0620a45c2be83cbd8b17745b21c4a35435090cf2", + "sha256": "2dbdc632baa5d0831808518beb80e3737de5bbec3dd0438e75dd30b2ea7fbb90", + "sha256WithRSAEncryption": "2dbdc632baa5d0831808518beb80e3737de5bbec3dd0438e75dd30b2ea7fbb90", + "sha384": "698e100a6a9e7d70045a8cb63162fb9132048b67d12ab4f4ae393c85aebbf88f0ac1f360b9e45bd31c69ce2bf0cdbd95", + "sha384WithRSAEncryption": "698e100a6a9e7d70045a8cb63162fb9132048b67d12ab4f4ae393c85aebbf88f0ac1f360b9e45bd31c69ce2bf0cdbd95", + "sha512": "a4b851e28dac17e2a71261e8a0c80325fab569746b542bf613351a74a68ed47c4bcd1c2170f2cebb0e99ef6d626dd33fb46cc61f10256fe202b6aefa8c90ebeb", + "sha512WithRSAEncryption": "a4b851e28dac17e2a71261e8a0c80325fab569746b542bf613351a74a68ed47c4bcd1c2170f2cebb0e99ef6d626dd33fb46cc61f10256fe202b6aefa8c90ebeb", + "shaWithRSAEncryption": "5370de0644f49356125239b6f0fda2333018586f", + "ssl2-md5": "4ad04a250b8029c9a7bf6529ee8793c3", + "ssl3-md5": "4ad04a250b8029c9a7bf6529ee8793c3", + "ssl3-sha1": "c54bdd2050504d92f551d378ad5fc72c9ed03932", + "whirlpool": "715f992b3c91d6b3c9ffbc4715fc4e29b623eda154381717f37142fe512b0a53e01aab1e18c15e52aba25cd04788aa5899b499c24668a429782c8cd6727042dc" + }, + { + "input": "///wAB///wAAP//wAP//AAf///gD///n////gQAAAf8AAD////gAAADwB//AD/AAP//AAH/4AP/8AAAf/4Af/AAAAf//AAB////+AAAP/4AAAA////wAAAD///wAD/+AAD///gAAP+AP//8AAAH/8AAAAA==", + "DSA": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "DSA-SHA": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "DSA-SHA1": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "DSA-SHA1-old": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "RSA-MD4": "2e11058f97e84c826967fd31f6c42dd5", + "RSA-MD5": "de41e337d96fd23619121ea709861e1a", + "RSA-MDC2": "39d64c13d93ece50c9a66d909e5d9fa5", + "RSA-RIPEMD160": "1ba23820cf3a338b76b967ff31bc9fa4c5eb7b5d", + "RSA-SHA": "8b29803a5d63be54c1f50b340bb359fe9bbaba51", + "RSA-SHA1": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "RSA-SHA1-2": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "RSA-SHA224": "f714566b4ad79f0360c214a1881e60d4d0f65f431edb52d7ecaf253e", + "RSA-SHA256": "ced4cf34982e0abbef40e876659544c4ed01f1975351490984aaa429fef321b0", + "RSA-SHA384": "3e74d663e01b063b2565678d735c4e431f76cf2c243fecfdbb47c22020f5828187dd9053b9ceb496c5118f87dc4afa90", + "RSA-SHA512": "78d1de348e5b71f0be5bfaf81c01f48988a340c6b1392401887e097627d0aa9117335202f0109cc34e5b7fd9b539e1d7dcc7f410a71b381a374a23380dff58a9", + "dsaEncryption": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "dsaWithSHA": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "dsaWithSHA1": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "dss1": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "ecdsa-with-SHA1": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "md4": "2e11058f97e84c826967fd31f6c42dd5", + "md4WithRSAEncryption": "2e11058f97e84c826967fd31f6c42dd5", + "md5": "de41e337d96fd23619121ea709861e1a", + "md5WithRSAEncryption": "de41e337d96fd23619121ea709861e1a", + "mdc2": "39d64c13d93ece50c9a66d909e5d9fa5", + "mdc2WithRSA": "39d64c13d93ece50c9a66d909e5d9fa5", + "ripemd": "1ba23820cf3a338b76b967ff31bc9fa4c5eb7b5d", + "ripemd160": "1ba23820cf3a338b76b967ff31bc9fa4c5eb7b5d", + "ripemd160WithRSA": "1ba23820cf3a338b76b967ff31bc9fa4c5eb7b5d", + "rmd160": "1ba23820cf3a338b76b967ff31bc9fa4c5eb7b5d", + "sha": "8b29803a5d63be54c1f50b340bb359fe9bbaba51", + "sha1": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "sha1WithRSAEncryption": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "sha224": "f714566b4ad79f0360c214a1881e60d4d0f65f431edb52d7ecaf253e", + "sha224WithRSAEncryption": "f714566b4ad79f0360c214a1881e60d4d0f65f431edb52d7ecaf253e", + "sha256": "ced4cf34982e0abbef40e876659544c4ed01f1975351490984aaa429fef321b0", + "sha256WithRSAEncryption": "ced4cf34982e0abbef40e876659544c4ed01f1975351490984aaa429fef321b0", + "sha384": "3e74d663e01b063b2565678d735c4e431f76cf2c243fecfdbb47c22020f5828187dd9053b9ceb496c5118f87dc4afa90", + "sha384WithRSAEncryption": "3e74d663e01b063b2565678d735c4e431f76cf2c243fecfdbb47c22020f5828187dd9053b9ceb496c5118f87dc4afa90", + "sha512": "78d1de348e5b71f0be5bfaf81c01f48988a340c6b1392401887e097627d0aa9117335202f0109cc34e5b7fd9b539e1d7dcc7f410a71b381a374a23380dff58a9", + "sha512WithRSAEncryption": "78d1de348e5b71f0be5bfaf81c01f48988a340c6b1392401887e097627d0aa9117335202f0109cc34e5b7fd9b539e1d7dcc7f410a71b381a374a23380dff58a9", + "shaWithRSAEncryption": "8b29803a5d63be54c1f50b340bb359fe9bbaba51", + "ssl2-md5": "de41e337d96fd23619121ea709861e1a", + "ssl3-md5": "de41e337d96fd23619121ea709861e1a", + "ssl3-sha1": "8f53e8fa79ea09fd1b682af5ed1515eca965604c", + "whirlpool": "49f806ad586a593f8400e27f94bed0e985f01e05c1e5ab2d56786f19f15af3b51f831d7ae0a702a54a206126e5b204c6133bd2ae3c6c55fe84289b57043b6c02" + }, + { + "input": "/8AAAAP///wA///8AAAAf///AAAAH+AAD//A8AAAf///4AAgH////wAAAB+AAAAH//H////AAAAf///wAD//+AA////+Af///n+eAB///AB/4H///+AAf//+AAAB////+AH/wAMAD//4AAAP8A//AAAAD/8=", + "DSA": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "DSA-SHA": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "DSA-SHA1": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "DSA-SHA1-old": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "RSA-MD4": "496facc54329bd0338e538843511b156", + "RSA-MD5": "18e070fd32cf732b9f37a0083320eec2", + "RSA-MDC2": "e9fd94caa6936257b5998c4baf3cfc7d", + "RSA-RIPEMD160": "c29caf4eb2f3ee9fdaa65b1dd11ca3015b6014a6", + "RSA-SHA": "abc56d10e8abd96bd6eda4f0e2ee6222fb5e4c9a", + "RSA-SHA1": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "RSA-SHA1-2": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "RSA-SHA224": "bb2cc8058724e0534e431fe08b02e8793158c759623e3c64d113deed", + "RSA-SHA256": "69339b4534eecca329ef2af397ede2a882d7e315a871dd2b781b8e0f4277ee66", + "RSA-SHA384": "5f934f91aed9b9f82f1d1ebf21d7c6a99fc4d2a9cb7e66f7a9e3c94ac571a22e516a2d9c6cb3afb5738e8da7df256f99", + "RSA-SHA512": "bfb4090a392960e478cc33a9ee3af0d9f743d48621219af21920fb1c989bf6a8ea040ce156a0ba4b42bd2d8a3d3fe3a178b150c9b76452285ebf379e4c8a0713", + "dsaEncryption": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "dsaWithSHA": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "dsaWithSHA1": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "dss1": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "ecdsa-with-SHA1": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "md4": "496facc54329bd0338e538843511b156", + "md4WithRSAEncryption": "496facc54329bd0338e538843511b156", + "md5": "18e070fd32cf732b9f37a0083320eec2", + "md5WithRSAEncryption": "18e070fd32cf732b9f37a0083320eec2", + "mdc2": "e9fd94caa6936257b5998c4baf3cfc7d", + "mdc2WithRSA": "e9fd94caa6936257b5998c4baf3cfc7d", + "ripemd": "c29caf4eb2f3ee9fdaa65b1dd11ca3015b6014a6", + "ripemd160": "c29caf4eb2f3ee9fdaa65b1dd11ca3015b6014a6", + "ripemd160WithRSA": "c29caf4eb2f3ee9fdaa65b1dd11ca3015b6014a6", + "rmd160": "c29caf4eb2f3ee9fdaa65b1dd11ca3015b6014a6", + "sha": "abc56d10e8abd96bd6eda4f0e2ee6222fb5e4c9a", + "sha1": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "sha1WithRSAEncryption": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "sha224": "bb2cc8058724e0534e431fe08b02e8793158c759623e3c64d113deed", + "sha224WithRSAEncryption": "bb2cc8058724e0534e431fe08b02e8793158c759623e3c64d113deed", + "sha256": "69339b4534eecca329ef2af397ede2a882d7e315a871dd2b781b8e0f4277ee66", + "sha256WithRSAEncryption": "69339b4534eecca329ef2af397ede2a882d7e315a871dd2b781b8e0f4277ee66", + "sha384": "5f934f91aed9b9f82f1d1ebf21d7c6a99fc4d2a9cb7e66f7a9e3c94ac571a22e516a2d9c6cb3afb5738e8da7df256f99", + "sha384WithRSAEncryption": "5f934f91aed9b9f82f1d1ebf21d7c6a99fc4d2a9cb7e66f7a9e3c94ac571a22e516a2d9c6cb3afb5738e8da7df256f99", + "sha512": "bfb4090a392960e478cc33a9ee3af0d9f743d48621219af21920fb1c989bf6a8ea040ce156a0ba4b42bd2d8a3d3fe3a178b150c9b76452285ebf379e4c8a0713", + "sha512WithRSAEncryption": "bfb4090a392960e478cc33a9ee3af0d9f743d48621219af21920fb1c989bf6a8ea040ce156a0ba4b42bd2d8a3d3fe3a178b150c9b76452285ebf379e4c8a0713", + "shaWithRSAEncryption": "abc56d10e8abd96bd6eda4f0e2ee6222fb5e4c9a", + "ssl2-md5": "18e070fd32cf732b9f37a0083320eec2", + "ssl3-md5": "18e070fd32cf732b9f37a0083320eec2", + "ssl3-sha1": "2d7e17f6294524ce78b33eab72cdd08e5ff6e313", + "whirlpool": "0536b3f940f82f2a917e62131744281fb94eace0ace0fe815ed993cecd6b3901f07705b1eb078a34285b326bca57da049240e15b452e57ed2c220bc504f31f5c" + }, + { + "input": "AAP////P//h/j////AH///wAAB////+AAAAB///h//AAAAD////4A4AAP4AAD////8AAAAJ///gD/8AAAD//gAAAAf//4AAAA4AAAP/gf////AAAAf///AAAAP//gAAH/gAAB//wAAAfgAAAPh////+f////", + "DSA": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "DSA-SHA": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "DSA-SHA1": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "DSA-SHA1-old": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "RSA-MD4": "2515d191b175e3c0d51227d9fcc84938", + "RSA-MD5": "7dd4b27ca8906182f684d0ee4ddb98c4", + "RSA-MDC2": "382eef43c990f669e5ac131e757f2894", + "RSA-RIPEMD160": "8aad852c68ea8a7ab21a4c116a320cde84dcb3e8", + "RSA-SHA": "1220bf109a2fb30a4c8ec2bd0180d8ee061b0a24", + "RSA-SHA1": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "RSA-SHA1-2": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "RSA-SHA224": "8c12a206caf0a88a64c39dce1b307879d8a40c024f49bb07ac1ae796", + "RSA-SHA256": "79cfbb9b52e573e22cd3427ec258d69e2d19fd27de15df96ca9006ccebe7b58e", + "RSA-SHA384": "e7545372abe460b76d68df6ed6cbcd1db67f54e8f9597c2cb5a60eab890e1259cec61a143b9c8ea4e44b8f5c7368bc9d", + "RSA-SHA512": "6019a0c6bc28bc3c3bdb637f24151b2556b34115dc7f1a20c3f3837104f186ca0ba29d5824c55e31096a39b2f01aa303a34a6ad144e77ce5bb2be42403f96466", + "dsaEncryption": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "dsaWithSHA": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "dsaWithSHA1": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "dss1": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "ecdsa-with-SHA1": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "md4": "2515d191b175e3c0d51227d9fcc84938", + "md4WithRSAEncryption": "2515d191b175e3c0d51227d9fcc84938", + "md5": "7dd4b27ca8906182f684d0ee4ddb98c4", + "md5WithRSAEncryption": "7dd4b27ca8906182f684d0ee4ddb98c4", + "mdc2": "382eef43c990f669e5ac131e757f2894", + "mdc2WithRSA": "382eef43c990f669e5ac131e757f2894", + "ripemd": "8aad852c68ea8a7ab21a4c116a320cde84dcb3e8", + "ripemd160": "8aad852c68ea8a7ab21a4c116a320cde84dcb3e8", + "ripemd160WithRSA": "8aad852c68ea8a7ab21a4c116a320cde84dcb3e8", + "rmd160": "8aad852c68ea8a7ab21a4c116a320cde84dcb3e8", + "sha": "1220bf109a2fb30a4c8ec2bd0180d8ee061b0a24", + "sha1": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "sha1WithRSAEncryption": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "sha224": "8c12a206caf0a88a64c39dce1b307879d8a40c024f49bb07ac1ae796", + "sha224WithRSAEncryption": "8c12a206caf0a88a64c39dce1b307879d8a40c024f49bb07ac1ae796", + "sha256": "79cfbb9b52e573e22cd3427ec258d69e2d19fd27de15df96ca9006ccebe7b58e", + "sha256WithRSAEncryption": "79cfbb9b52e573e22cd3427ec258d69e2d19fd27de15df96ca9006ccebe7b58e", + "sha384": "e7545372abe460b76d68df6ed6cbcd1db67f54e8f9597c2cb5a60eab890e1259cec61a143b9c8ea4e44b8f5c7368bc9d", + "sha384WithRSAEncryption": "e7545372abe460b76d68df6ed6cbcd1db67f54e8f9597c2cb5a60eab890e1259cec61a143b9c8ea4e44b8f5c7368bc9d", + "sha512": "6019a0c6bc28bc3c3bdb637f24151b2556b34115dc7f1a20c3f3837104f186ca0ba29d5824c55e31096a39b2f01aa303a34a6ad144e77ce5bb2be42403f96466", + "sha512WithRSAEncryption": "6019a0c6bc28bc3c3bdb637f24151b2556b34115dc7f1a20c3f3837104f186ca0ba29d5824c55e31096a39b2f01aa303a34a6ad144e77ce5bb2be42403f96466", + "shaWithRSAEncryption": "1220bf109a2fb30a4c8ec2bd0180d8ee061b0a24", + "ssl2-md5": "7dd4b27ca8906182f684d0ee4ddb98c4", + "ssl3-md5": "7dd4b27ca8906182f684d0ee4ddb98c4", + "ssl3-sha1": "64582b4b57f782c9302bfe7d07f74aa176627a3a", + "whirlpool": "61bead7140734f79d65b99501677e82311a519d48f567e4f714d09885273585117a0facbbdf8d063379ea31a2d4087f4b09f81c5a564772a836fd6acbd41beab" + }, + { + "input": "///+AAP///+AAf///6A///gAfwP//8AAD//D//gAA////8B/8B/gD///wAAf/g///+AAB////AAA/AA////wAAAAP/wAAAAP/8QAAP/AAAP///+AAAP8D///8AAAA///wAf///gMP//wAB//gAAAAf/+AAA//w==", + "DSA": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "DSA-SHA": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "DSA-SHA1": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "DSA-SHA1-old": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "RSA-MD4": "f397b65fe86eab550b8d9d92e4131541", + "RSA-MD5": "70a440a8bd06ff40f6e9135946eb174d", + "RSA-MDC2": "c2b84ec8f753b6dfc3753633b0a00197", + "RSA-RIPEMD160": "f518222f0d8d331a5212a11fc50f0313bb1e02ee", + "RSA-SHA": "b6c47736fe155b27f509abb54b254e4a8b73b0fe", + "RSA-SHA1": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "RSA-SHA1-2": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "RSA-SHA224": "973e0711260108e8fe9b17e26e595190bc08bc3e7bce2c49ace6bfbf", + "RSA-SHA256": "1203d54626871bccfa8abb8bbd740b9af3c7266bc8490a210074d7f2b0806ae8", + "RSA-SHA384": "5137d6e9f9d23ac64aa9fc858a7319f8f6ca78d5d5a5ebb84f7a2bed1605e3b6c0fde7b27e95c6bbb551e7933f7cb736", + "RSA-SHA512": "d7f25152eb94d3fb0dee398ad8b38e9320cb484a51b7856f142462d2450e824c3f00ff18017aa86c876e0dfdea2d878f23fef17d4f84bcfc724bfbdfbdc5e480", + "dsaEncryption": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "dsaWithSHA": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "dsaWithSHA1": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "dss1": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "ecdsa-with-SHA1": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "md4": "f397b65fe86eab550b8d9d92e4131541", + "md4WithRSAEncryption": "f397b65fe86eab550b8d9d92e4131541", + "md5": "70a440a8bd06ff40f6e9135946eb174d", + "md5WithRSAEncryption": "70a440a8bd06ff40f6e9135946eb174d", + "mdc2": "c2b84ec8f753b6dfc3753633b0a00197", + "mdc2WithRSA": "c2b84ec8f753b6dfc3753633b0a00197", + "ripemd": "f518222f0d8d331a5212a11fc50f0313bb1e02ee", + "ripemd160": "f518222f0d8d331a5212a11fc50f0313bb1e02ee", + "ripemd160WithRSA": "f518222f0d8d331a5212a11fc50f0313bb1e02ee", + "rmd160": "f518222f0d8d331a5212a11fc50f0313bb1e02ee", + "sha": "b6c47736fe155b27f509abb54b254e4a8b73b0fe", + "sha1": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "sha1WithRSAEncryption": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "sha224": "973e0711260108e8fe9b17e26e595190bc08bc3e7bce2c49ace6bfbf", + "sha224WithRSAEncryption": "973e0711260108e8fe9b17e26e595190bc08bc3e7bce2c49ace6bfbf", + "sha256": "1203d54626871bccfa8abb8bbd740b9af3c7266bc8490a210074d7f2b0806ae8", + "sha256WithRSAEncryption": "1203d54626871bccfa8abb8bbd740b9af3c7266bc8490a210074d7f2b0806ae8", + "sha384": "5137d6e9f9d23ac64aa9fc858a7319f8f6ca78d5d5a5ebb84f7a2bed1605e3b6c0fde7b27e95c6bbb551e7933f7cb736", + "sha384WithRSAEncryption": "5137d6e9f9d23ac64aa9fc858a7319f8f6ca78d5d5a5ebb84f7a2bed1605e3b6c0fde7b27e95c6bbb551e7933f7cb736", + "sha512": "d7f25152eb94d3fb0dee398ad8b38e9320cb484a51b7856f142462d2450e824c3f00ff18017aa86c876e0dfdea2d878f23fef17d4f84bcfc724bfbdfbdc5e480", + "sha512WithRSAEncryption": "d7f25152eb94d3fb0dee398ad8b38e9320cb484a51b7856f142462d2450e824c3f00ff18017aa86c876e0dfdea2d878f23fef17d4f84bcfc724bfbdfbdc5e480", + "shaWithRSAEncryption": "b6c47736fe155b27f509abb54b254e4a8b73b0fe", + "ssl2-md5": "70a440a8bd06ff40f6e9135946eb174d", + "ssl3-md5": "70a440a8bd06ff40f6e9135946eb174d", + "ssl3-sha1": "6d88795b71d3e386bbd1eb830fb9f161ba98869f", + "whirlpool": "76aa430cf1dab949f04682f4b76794335380b8f6c90d62953bfcf0acb2600e5b431dca03bdbed6e57af04b825ffe08c1c8c17acccc800d1836a51c0c9d0eafa9" + }, + { + "input": "AAAAH//D//+AAAA////+AAAAD+AAf//gD/4A////4AP/+AAAAD/gAAAB///n////4AAAB///wAAf4AAAAf//AAAD////4AAAH+AD//8AAAAH//A/gAAAD////gAA////AAA///+AD//+Af////g////AAAD///8=", + "DSA": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "DSA-SHA": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "DSA-SHA1": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "DSA-SHA1-old": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "RSA-MD4": "41142587b0254ef379396b0b30bfdf1b", + "RSA-MD5": "b8d052366e752ce7c803abd24854e934", + "RSA-MDC2": "0c6675bbaf1b773496ad2ac509e93e16", + "RSA-RIPEMD160": "8a1eb1d6b63ba0f43d51f9786fce7fb7d24c69ac", + "RSA-SHA": "2a92cbabccca87310ba606495c9783937b33889e", + "RSA-SHA1": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "RSA-SHA1-2": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "RSA-SHA224": "ead9a5b95a9ec2f1aa11cd81ebed31ff108178fd9e6f70def032a4dc", + "RSA-SHA256": "0c15140d3b5e4b180b0b1517a51fa08f82458c02185ef2bc59fae37543ef9011", + "RSA-SHA384": "100087cc47052a9941d908c5907a069b22cab7bd3ed24446ab1c8dc2188187161ac4f2f3e267ad249797cafe6cd33a8b", + "RSA-SHA512": "e000dadfc0fe9c13ba1cdebeca0a2a4e24f62f317d11a791153f7c5f59bf8f41d73e06db0d1b57c7938563116d74daf25a8b6a3215b51ead5da81e5d2005cf76", + "dsaEncryption": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "dsaWithSHA": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "dsaWithSHA1": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "dss1": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "ecdsa-with-SHA1": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "md4": "41142587b0254ef379396b0b30bfdf1b", + "md4WithRSAEncryption": "41142587b0254ef379396b0b30bfdf1b", + "md5": "b8d052366e752ce7c803abd24854e934", + "md5WithRSAEncryption": "b8d052366e752ce7c803abd24854e934", + "mdc2": "0c6675bbaf1b773496ad2ac509e93e16", + "mdc2WithRSA": "0c6675bbaf1b773496ad2ac509e93e16", + "ripemd": "8a1eb1d6b63ba0f43d51f9786fce7fb7d24c69ac", + "ripemd160": "8a1eb1d6b63ba0f43d51f9786fce7fb7d24c69ac", + "ripemd160WithRSA": "8a1eb1d6b63ba0f43d51f9786fce7fb7d24c69ac", + "rmd160": "8a1eb1d6b63ba0f43d51f9786fce7fb7d24c69ac", + "sha": "2a92cbabccca87310ba606495c9783937b33889e", + "sha1": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "sha1WithRSAEncryption": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "sha224": "ead9a5b95a9ec2f1aa11cd81ebed31ff108178fd9e6f70def032a4dc", + "sha224WithRSAEncryption": "ead9a5b95a9ec2f1aa11cd81ebed31ff108178fd9e6f70def032a4dc", + "sha256": "0c15140d3b5e4b180b0b1517a51fa08f82458c02185ef2bc59fae37543ef9011", + "sha256WithRSAEncryption": "0c15140d3b5e4b180b0b1517a51fa08f82458c02185ef2bc59fae37543ef9011", + "sha384": "100087cc47052a9941d908c5907a069b22cab7bd3ed24446ab1c8dc2188187161ac4f2f3e267ad249797cafe6cd33a8b", + "sha384WithRSAEncryption": "100087cc47052a9941d908c5907a069b22cab7bd3ed24446ab1c8dc2188187161ac4f2f3e267ad249797cafe6cd33a8b", + "sha512": "e000dadfc0fe9c13ba1cdebeca0a2a4e24f62f317d11a791153f7c5f59bf8f41d73e06db0d1b57c7938563116d74daf25a8b6a3215b51ead5da81e5d2005cf76", + "sha512WithRSAEncryption": "e000dadfc0fe9c13ba1cdebeca0a2a4e24f62f317d11a791153f7c5f59bf8f41d73e06db0d1b57c7938563116d74daf25a8b6a3215b51ead5da81e5d2005cf76", + "shaWithRSAEncryption": "2a92cbabccca87310ba606495c9783937b33889e", + "ssl2-md5": "b8d052366e752ce7c803abd24854e934", + "ssl3-md5": "b8d052366e752ce7c803abd24854e934", + "ssl3-sha1": "86ad34a6463f12cee6de9596aba72f0df1397fd1", + "whirlpool": "4a1f58d94270b530227c113e7463aeae772e779079e558651c21fdc1050e2d72139e7fb6b3802129dae7fb91035544e7dfa12147d8d74d95fb81648a8d79d0b1" + }, + { + "input": "////gAD////wAAAfAD///g/wHAD//+AAD8Af/8AAAAH/gPf/+AAAP//AAAAB//AAA+P8AAf4AAA////+AAAfAAAAGAA////4D+AAAABgAAf///4AYP////gAAD//gAAAP///8AAAD/AA///x/wA/////Af/gAAAA", + "DSA": "7eb46685a57c0d466152dc339c8122548c757ed1", + "DSA-SHA": "7eb46685a57c0d466152dc339c8122548c757ed1", + "DSA-SHA1": "7eb46685a57c0d466152dc339c8122548c757ed1", + "DSA-SHA1-old": "7eb46685a57c0d466152dc339c8122548c757ed1", + "RSA-MD4": "1a6843d3e19c4149a8cff1125f536c72", + "RSA-MD5": "8ab9dfff746ce3e62c6e04feb7b48528", + "RSA-MDC2": "1b639b2bf66973922133d40a1a22a909", + "RSA-RIPEMD160": "2ed1f23487d6e3b49884a7886b902bd06fb84ca9", + "RSA-SHA": "68594f3e4ee694a6a9cc266e5e3dbf9481e24974", + "RSA-SHA1": "7eb46685a57c0d466152dc339c8122548c757ed1", + "RSA-SHA1-2": "7eb46685a57c0d466152dc339c8122548c757ed1", + "RSA-SHA224": "135cb54748a681f3ddf56bac7d44ad97dd0d29717fb31cdb5eab34f0", + "RSA-SHA256": "ab71b18daceecc7c8fde7cf5f77eacf118262d760bcd383dd7bfa2170895d518", + "RSA-SHA384": "46c8fcf4f6ddf28ad65931d5d5ff79b44490dca090c230fa5ef5123f160a21b53763151416a48e9a5de4abcd55e8b761", + "RSA-SHA512": "29c97533a23510ad29db92d4db332f35025dbd169ada5fd1686f1e9a538c17ea24389df08b59c060d458878ab2cbc0ce28d8f2572b8ca02efa9d7675c7e253a7", + "dsaEncryption": "7eb46685a57c0d466152dc339c8122548c757ed1", + "dsaWithSHA": "7eb46685a57c0d466152dc339c8122548c757ed1", + "dsaWithSHA1": "7eb46685a57c0d466152dc339c8122548c757ed1", + "dss1": "7eb46685a57c0d466152dc339c8122548c757ed1", + "ecdsa-with-SHA1": "7eb46685a57c0d466152dc339c8122548c757ed1", + "md4": "1a6843d3e19c4149a8cff1125f536c72", + "md4WithRSAEncryption": "1a6843d3e19c4149a8cff1125f536c72", + "md5": "8ab9dfff746ce3e62c6e04feb7b48528", + "md5WithRSAEncryption": "8ab9dfff746ce3e62c6e04feb7b48528", + "mdc2": "1b639b2bf66973922133d40a1a22a909", + "mdc2WithRSA": "1b639b2bf66973922133d40a1a22a909", + "ripemd": "2ed1f23487d6e3b49884a7886b902bd06fb84ca9", + "ripemd160": "2ed1f23487d6e3b49884a7886b902bd06fb84ca9", + "ripemd160WithRSA": "2ed1f23487d6e3b49884a7886b902bd06fb84ca9", + "rmd160": "2ed1f23487d6e3b49884a7886b902bd06fb84ca9", + "sha": "68594f3e4ee694a6a9cc266e5e3dbf9481e24974", + "sha1": "7eb46685a57c0d466152dc339c8122548c757ed1", + "sha1WithRSAEncryption": "7eb46685a57c0d466152dc339c8122548c757ed1", + "sha224": "135cb54748a681f3ddf56bac7d44ad97dd0d29717fb31cdb5eab34f0", + "sha224WithRSAEncryption": "135cb54748a681f3ddf56bac7d44ad97dd0d29717fb31cdb5eab34f0", + "sha256": "ab71b18daceecc7c8fde7cf5f77eacf118262d760bcd383dd7bfa2170895d518", + "sha256WithRSAEncryption": "ab71b18daceecc7c8fde7cf5f77eacf118262d760bcd383dd7bfa2170895d518", + "sha384": "46c8fcf4f6ddf28ad65931d5d5ff79b44490dca090c230fa5ef5123f160a21b53763151416a48e9a5de4abcd55e8b761", + "sha384WithRSAEncryption": "46c8fcf4f6ddf28ad65931d5d5ff79b44490dca090c230fa5ef5123f160a21b53763151416a48e9a5de4abcd55e8b761", + "sha512": "29c97533a23510ad29db92d4db332f35025dbd169ada5fd1686f1e9a538c17ea24389df08b59c060d458878ab2cbc0ce28d8f2572b8ca02efa9d7675c7e253a7", + "sha512WithRSAEncryption": "29c97533a23510ad29db92d4db332f35025dbd169ada5fd1686f1e9a538c17ea24389df08b59c060d458878ab2cbc0ce28d8f2572b8ca02efa9d7675c7e253a7", + "shaWithRSAEncryption": "68594f3e4ee694a6a9cc266e5e3dbf9481e24974", + "ssl2-md5": "8ab9dfff746ce3e62c6e04feb7b48528", + "ssl3-md5": "8ab9dfff746ce3e62c6e04feb7b48528", + "ssl3-sha1": "7eb46685a57c0d466152dc339c8122548c757ed1", + "whirlpool": "e21eb30c87e4fb60942603fdeed901a3847a3ff535c753fbed74fa388b8819495d2733b6c8c145a0febf1207d5f7956ffd50fce1a502e9aee462a227c136f54c" + }, + { + "input": "/////AAAAP//8AH///gAAP///+f/+AH4f///gAA///wAAAH//+AAP8AAAH///wAAD////8AAD//x////+AAP///8AAAH////gP//+AfwAAAAH////8AA////wAAO////wAAAA//4AAAD/4AAAADgAAAP+AAAP////w==", + "DSA": "e7a98fb0692684054407cc221abc60c199d6f52a", + "DSA-SHA": "e7a98fb0692684054407cc221abc60c199d6f52a", + "DSA-SHA1": "e7a98fb0692684054407cc221abc60c199d6f52a", + "DSA-SHA1-old": "e7a98fb0692684054407cc221abc60c199d6f52a", + "RSA-MD4": "6a4c58ec3cfea46e65ee2550b993b138", + "RSA-MD5": "ecfca8b371616efe78e9916dbf825f5b", + "RSA-MDC2": "dd9957a17183cccaec74290baf658a10", + "RSA-RIPEMD160": "db34ffa46a290567569b24da7d6e43285e9450f3", + "RSA-SHA": "2223fb3f2cfbb882947b184b5e83502505d377fd", + "RSA-SHA1": "e7a98fb0692684054407cc221abc60c199d6f52a", + "RSA-SHA1-2": "e7a98fb0692684054407cc221abc60c199d6f52a", + "RSA-SHA224": "e2f4c47a989fbf100442817e77d8150409508e0516544f68b0cda295", + "RSA-SHA256": "fa3174d3432fe38241a34a8387811b54c3d0f183468cef5cd6d3fb325b270b66", + "RSA-SHA384": "32f44654c6038c9fbbe671b0e2e96db31f236634eb9407b08836109678adcf31b0dde6fda83413cd068ef5486a2e61cb", + "RSA-SHA512": "8489ab4c31995c0be48275d6d658fcdee8b57b9b03b801c3c0f02626b0999972001ab4dd1dbb3f633a2e59269ba5ed9e4aa0e9f9a87f56f082a300389d6833b6", + "dsaEncryption": "e7a98fb0692684054407cc221abc60c199d6f52a", + "dsaWithSHA": "e7a98fb0692684054407cc221abc60c199d6f52a", + "dsaWithSHA1": "e7a98fb0692684054407cc221abc60c199d6f52a", + "dss1": "e7a98fb0692684054407cc221abc60c199d6f52a", + "ecdsa-with-SHA1": "e7a98fb0692684054407cc221abc60c199d6f52a", + "md4": "6a4c58ec3cfea46e65ee2550b993b138", + "md4WithRSAEncryption": "6a4c58ec3cfea46e65ee2550b993b138", + "md5": "ecfca8b371616efe78e9916dbf825f5b", + "md5WithRSAEncryption": "ecfca8b371616efe78e9916dbf825f5b", + "mdc2": "dd9957a17183cccaec74290baf658a10", + "mdc2WithRSA": "dd9957a17183cccaec74290baf658a10", + "ripemd": "db34ffa46a290567569b24da7d6e43285e9450f3", + "ripemd160": "db34ffa46a290567569b24da7d6e43285e9450f3", + "ripemd160WithRSA": "db34ffa46a290567569b24da7d6e43285e9450f3", + "rmd160": "db34ffa46a290567569b24da7d6e43285e9450f3", + "sha": "2223fb3f2cfbb882947b184b5e83502505d377fd", + "sha1": "e7a98fb0692684054407cc221abc60c199d6f52a", + "sha1WithRSAEncryption": "e7a98fb0692684054407cc221abc60c199d6f52a", + "sha224": "e2f4c47a989fbf100442817e77d8150409508e0516544f68b0cda295", + "sha224WithRSAEncryption": "e2f4c47a989fbf100442817e77d8150409508e0516544f68b0cda295", + "sha256": "fa3174d3432fe38241a34a8387811b54c3d0f183468cef5cd6d3fb325b270b66", + "sha256WithRSAEncryption": "fa3174d3432fe38241a34a8387811b54c3d0f183468cef5cd6d3fb325b270b66", + "sha384": "32f44654c6038c9fbbe671b0e2e96db31f236634eb9407b08836109678adcf31b0dde6fda83413cd068ef5486a2e61cb", + "sha384WithRSAEncryption": "32f44654c6038c9fbbe671b0e2e96db31f236634eb9407b08836109678adcf31b0dde6fda83413cd068ef5486a2e61cb", + "sha512": "8489ab4c31995c0be48275d6d658fcdee8b57b9b03b801c3c0f02626b0999972001ab4dd1dbb3f633a2e59269ba5ed9e4aa0e9f9a87f56f082a300389d6833b6", + "sha512WithRSAEncryption": "8489ab4c31995c0be48275d6d658fcdee8b57b9b03b801c3c0f02626b0999972001ab4dd1dbb3f633a2e59269ba5ed9e4aa0e9f9a87f56f082a300389d6833b6", + "shaWithRSAEncryption": "2223fb3f2cfbb882947b184b5e83502505d377fd", + "ssl2-md5": "ecfca8b371616efe78e9916dbf825f5b", + "ssl3-md5": "ecfca8b371616efe78e9916dbf825f5b", + "ssl3-sha1": "e7a98fb0692684054407cc221abc60c199d6f52a", + "whirlpool": "2f1a73fb3288333aaed75202296b2ff67851f973459d98fc8442d07ba73500d9deb1e29bad56ddf686c3be609cac831bc2e149a116c997522ac91b61c2229aab" + }, + { + "input": "PwADwB8AAAAP8AAH///vAP4Af/4AAD/wAD/AAAAH/AAAA////w/////AB/gAAPgAAD+f///8AAA//8AAA///wAAA//wAH//gAAAH/+AHAAAAf//+AAAA///+AAAP/AAH//AAAAB/gAPP/4AAAf//4DwAAD////+AAAA=", + "DSA": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "DSA-SHA": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "DSA-SHA1": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "DSA-SHA1-old": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "RSA-MD4": "aa0d6922061b664ba025acc5e1702ee9", + "RSA-MD5": "5f76da828c37fc4edb4557953539c92a", + "RSA-MDC2": "90c016d6c3662a740911559f6a18c9ab", + "RSA-RIPEMD160": "7ca39b6a1c2b6f3e2ef1da5c14bfd881da85430c", + "RSA-SHA": "64e30d2808850a61df7384c05820ead9eb2876fc", + "RSA-SHA1": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "RSA-SHA1-2": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "RSA-SHA224": "88e6af8942768d761cc15610bea4154dd6d08def1bd47563f23a74fb", + "RSA-SHA256": "c13fd9ed22d33aa45f73748782e4dbb835d180dc0662e160c0a6c445c76f0c72", + "RSA-SHA384": "04b81b46c5dad6dac883881ed560c6f7d662400c10dce59d55a34d8d855b5f769fed118b48c22aaef55cdc2895b19c07", + "RSA-SHA512": "7d6da87c8b9be034e95f641368cc4e8a1e01710d5728d7b0064b733c30d40834a7e35918ee2f3c4b4b3f1a88afa4abfb7325489d6ad3fcf2291f5cc38977fad2", + "dsaEncryption": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "dsaWithSHA": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "dsaWithSHA1": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "dss1": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "ecdsa-with-SHA1": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "md4": "aa0d6922061b664ba025acc5e1702ee9", + "md4WithRSAEncryption": "aa0d6922061b664ba025acc5e1702ee9", + "md5": "5f76da828c37fc4edb4557953539c92a", + "md5WithRSAEncryption": "5f76da828c37fc4edb4557953539c92a", + "mdc2": "90c016d6c3662a740911559f6a18c9ab", + "mdc2WithRSA": "90c016d6c3662a740911559f6a18c9ab", + "ripemd": "7ca39b6a1c2b6f3e2ef1da5c14bfd881da85430c", + "ripemd160": "7ca39b6a1c2b6f3e2ef1da5c14bfd881da85430c", + "ripemd160WithRSA": "7ca39b6a1c2b6f3e2ef1da5c14bfd881da85430c", + "rmd160": "7ca39b6a1c2b6f3e2ef1da5c14bfd881da85430c", + "sha": "64e30d2808850a61df7384c05820ead9eb2876fc", + "sha1": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "sha1WithRSAEncryption": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "sha224": "88e6af8942768d761cc15610bea4154dd6d08def1bd47563f23a74fb", + "sha224WithRSAEncryption": "88e6af8942768d761cc15610bea4154dd6d08def1bd47563f23a74fb", + "sha256": "c13fd9ed22d33aa45f73748782e4dbb835d180dc0662e160c0a6c445c76f0c72", + "sha256WithRSAEncryption": "c13fd9ed22d33aa45f73748782e4dbb835d180dc0662e160c0a6c445c76f0c72", + "sha384": "04b81b46c5dad6dac883881ed560c6f7d662400c10dce59d55a34d8d855b5f769fed118b48c22aaef55cdc2895b19c07", + "sha384WithRSAEncryption": "04b81b46c5dad6dac883881ed560c6f7d662400c10dce59d55a34d8d855b5f769fed118b48c22aaef55cdc2895b19c07", + "sha512": "7d6da87c8b9be034e95f641368cc4e8a1e01710d5728d7b0064b733c30d40834a7e35918ee2f3c4b4b3f1a88afa4abfb7325489d6ad3fcf2291f5cc38977fad2", + "sha512WithRSAEncryption": "7d6da87c8b9be034e95f641368cc4e8a1e01710d5728d7b0064b733c30d40834a7e35918ee2f3c4b4b3f1a88afa4abfb7325489d6ad3fcf2291f5cc38977fad2", + "shaWithRSAEncryption": "64e30d2808850a61df7384c05820ead9eb2876fc", + "ssl2-md5": "5f76da828c37fc4edb4557953539c92a", + "ssl3-md5": "5f76da828c37fc4edb4557953539c92a", + "ssl3-sha1": "34df1306662206fd0a5fc2969a4beec4eb0197f7", + "whirlpool": "59234d45350fd47a2fd1b6a26c65339676a0ad1c29f9281db1c596591ee7fe62e74713604ac89b4dc9d19d9f706f4a0f433fd498f4ef686d25dc3fcd3a34469e" + }, + { + "input": "MAAAAP/4AAD//AA///+AAAAPz//P///A////gAAAAf////AAAAAf/wAD//wAAAAH/4AAf////g//wAAAAH/wv///4AAA//gAAAH///gAAD4AAAf/4AAAAIAAA4AB////+GAAAAD/8AAf///H//BA///+AAAH/9//gAAA", + "DSA": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "DSA-SHA": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "DSA-SHA1": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "DSA-SHA1-old": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "RSA-MD4": "de9833ccdae44a93f3acbb97ed477332", + "RSA-MD5": "ecad54f76ce3bc233e02fc6fd7f94628", + "RSA-MDC2": "5ac7d2cf9e4795bb068328baae99c1bb", + "RSA-RIPEMD160": "60556f768eed549340ad2f18395e3ec494d67dd3", + "RSA-SHA": "1232ac009f10ced2c2d212d94e2e6ae6deb06c95", + "RSA-SHA1": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "RSA-SHA1-2": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "RSA-SHA224": "983288fb210551693b2079f8b4476be294241043578be7e9fcf184d5", + "RSA-SHA256": "b88a842dc14c41c2b5bd74e48fdd2bd0d43cfeea1eb9b154bebfc4f03d8a102d", + "RSA-SHA384": "7e8bd777ef907657128c522bc687fbf0383af341cac0a89cb0fd314a49df38cc1172d766c7e7601d858daf04b225f2ef", + "RSA-SHA512": "fb619c19b30935c87e450e40e515bd41c0f6e755309978679bfde5b8ae1701883a157d39275ac69baf77d5e3874d706509d9946b709dead3701515c28c62b388", + "dsaEncryption": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "dsaWithSHA": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "dsaWithSHA1": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "dss1": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "ecdsa-with-SHA1": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "md4": "de9833ccdae44a93f3acbb97ed477332", + "md4WithRSAEncryption": "de9833ccdae44a93f3acbb97ed477332", + "md5": "ecad54f76ce3bc233e02fc6fd7f94628", + "md5WithRSAEncryption": "ecad54f76ce3bc233e02fc6fd7f94628", + "mdc2": "5ac7d2cf9e4795bb068328baae99c1bb", + "mdc2WithRSA": "5ac7d2cf9e4795bb068328baae99c1bb", + "ripemd": "60556f768eed549340ad2f18395e3ec494d67dd3", + "ripemd160": "60556f768eed549340ad2f18395e3ec494d67dd3", + "ripemd160WithRSA": "60556f768eed549340ad2f18395e3ec494d67dd3", + "rmd160": "60556f768eed549340ad2f18395e3ec494d67dd3", + "sha": "1232ac009f10ced2c2d212d94e2e6ae6deb06c95", + "sha1": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "sha1WithRSAEncryption": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "sha224": "983288fb210551693b2079f8b4476be294241043578be7e9fcf184d5", + "sha224WithRSAEncryption": "983288fb210551693b2079f8b4476be294241043578be7e9fcf184d5", + "sha256": "b88a842dc14c41c2b5bd74e48fdd2bd0d43cfeea1eb9b154bebfc4f03d8a102d", + "sha256WithRSAEncryption": "b88a842dc14c41c2b5bd74e48fdd2bd0d43cfeea1eb9b154bebfc4f03d8a102d", + "sha384": "7e8bd777ef907657128c522bc687fbf0383af341cac0a89cb0fd314a49df38cc1172d766c7e7601d858daf04b225f2ef", + "sha384WithRSAEncryption": "7e8bd777ef907657128c522bc687fbf0383af341cac0a89cb0fd314a49df38cc1172d766c7e7601d858daf04b225f2ef", + "sha512": "fb619c19b30935c87e450e40e515bd41c0f6e755309978679bfde5b8ae1701883a157d39275ac69baf77d5e3874d706509d9946b709dead3701515c28c62b388", + "sha512WithRSAEncryption": "fb619c19b30935c87e450e40e515bd41c0f6e755309978679bfde5b8ae1701883a157d39275ac69baf77d5e3874d706509d9946b709dead3701515c28c62b388", + "shaWithRSAEncryption": "1232ac009f10ced2c2d212d94e2e6ae6deb06c95", + "ssl2-md5": "ecad54f76ce3bc233e02fc6fd7f94628", + "ssl3-md5": "ecad54f76ce3bc233e02fc6fd7f94628", + "ssl3-sha1": "56cf7ebf08d10f0cb9fe7ee3b63a5c3a02bcb450", + "whirlpool": "67641bd47b1ebccf8fcc315625b2fe6912574aee63ba1479933c12eb5c1ebff67b2e560a81359a3e76e31d64e4fd02f513b24f95b2f26d5ee53d26fefe849bc7" + }, + { + "input": "////g//4H/8f//+AD///4AAAAD///8D4AAB4ABwAAAAf4AAAAP//4D////4AAAP///4AAAAf//wAf/8AAAAf//8AAgAAP//8AAAA//Af/v//wAH////wAAAA///+AAAAD//AAAB/f8AAAAH///4P////wAAPgAAAP////w==", + "DSA": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "DSA-SHA": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "DSA-SHA1": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "DSA-SHA1-old": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "RSA-MD4": "45e5dd18ff36e9416db673feb605f431", + "RSA-MD5": "e8a1cc06bfec7f677f36a693e1342400", + "RSA-MDC2": "8a09d15aabfdc60f7e67edf5c08cf9f9", + "RSA-RIPEMD160": "f97c17087d7f2a8e3879a54e553e2a52520b7f4d", + "RSA-SHA": "1f5d610dae6d2c30bf2ec26316f96083c7225420", + "RSA-SHA1": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "RSA-SHA1-2": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "RSA-SHA224": "b0a875f78b16b6c114b08c692cca5046272cf0fd4fd97a040fc01294", + "RSA-SHA256": "45ba1056e49828a0385b0b5f9e4933905973f15b2713fee1c1755e2a7a3e8d79", + "RSA-SHA384": "60184c2e97c958e942b0a148d56efb39e6549253338847d361a42f7505e87a4df8a28ed6758a09bca2d0920073d31368", + "RSA-SHA512": "0fee2eac82a5539f49655d2ee5a8428f5f6158cecd3bb97a84d8cbf83bf3b57284d1ab4439183779641c2b50f4a1ff3c32444ceda889263b3b7b577a8d51cff9", + "dsaEncryption": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "dsaWithSHA": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "dsaWithSHA1": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "dss1": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "ecdsa-with-SHA1": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "md4": "45e5dd18ff36e9416db673feb605f431", + "md4WithRSAEncryption": "45e5dd18ff36e9416db673feb605f431", + "md5": "e8a1cc06bfec7f677f36a693e1342400", + "md5WithRSAEncryption": "e8a1cc06bfec7f677f36a693e1342400", + "mdc2": "8a09d15aabfdc60f7e67edf5c08cf9f9", + "mdc2WithRSA": "8a09d15aabfdc60f7e67edf5c08cf9f9", + "ripemd": "f97c17087d7f2a8e3879a54e553e2a52520b7f4d", + "ripemd160": "f97c17087d7f2a8e3879a54e553e2a52520b7f4d", + "ripemd160WithRSA": "f97c17087d7f2a8e3879a54e553e2a52520b7f4d", + "rmd160": "f97c17087d7f2a8e3879a54e553e2a52520b7f4d", + "sha": "1f5d610dae6d2c30bf2ec26316f96083c7225420", + "sha1": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "sha1WithRSAEncryption": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "sha224": "b0a875f78b16b6c114b08c692cca5046272cf0fd4fd97a040fc01294", + "sha224WithRSAEncryption": "b0a875f78b16b6c114b08c692cca5046272cf0fd4fd97a040fc01294", + "sha256": "45ba1056e49828a0385b0b5f9e4933905973f15b2713fee1c1755e2a7a3e8d79", + "sha256WithRSAEncryption": "45ba1056e49828a0385b0b5f9e4933905973f15b2713fee1c1755e2a7a3e8d79", + "sha384": "60184c2e97c958e942b0a148d56efb39e6549253338847d361a42f7505e87a4df8a28ed6758a09bca2d0920073d31368", + "sha384WithRSAEncryption": "60184c2e97c958e942b0a148d56efb39e6549253338847d361a42f7505e87a4df8a28ed6758a09bca2d0920073d31368", + "sha512": "0fee2eac82a5539f49655d2ee5a8428f5f6158cecd3bb97a84d8cbf83bf3b57284d1ab4439183779641c2b50f4a1ff3c32444ceda889263b3b7b577a8d51cff9", + "sha512WithRSAEncryption": "0fee2eac82a5539f49655d2ee5a8428f5f6158cecd3bb97a84d8cbf83bf3b57284d1ab4439183779641c2b50f4a1ff3c32444ceda889263b3b7b577a8d51cff9", + "shaWithRSAEncryption": "1f5d610dae6d2c30bf2ec26316f96083c7225420", + "ssl2-md5": "e8a1cc06bfec7f677f36a693e1342400", + "ssl3-md5": "e8a1cc06bfec7f677f36a693e1342400", + "ssl3-sha1": "3bae5cb8226642088da760a6f78b0cf8eddea9f1", + "whirlpool": "80f6ec2d62ee9769401387833aa9f1de09d3b9578380c1bf1591657a9a7b03426b949a204b08fb2d0a4d73fe170bf85ea8bb73671e33cd61f3d42e6cf43bbaac" + }, + { + "input": "/////gAAAP/4D///8AAAB///+//AAAf8B+AAAAH//+AAf///+AAAP//4AAAAD///AAAPwAAAP//wAAAB///+H//4AAAgAAAAP/+//5////w////wAAAHgAAA///n////8AAAP////wAAB///4P///+AB////+AAAAH////8=", + "DSA": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "DSA-SHA": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "DSA-SHA1": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "DSA-SHA1-old": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "RSA-MD4": "349503c72dda30942bcc11f60c96ce53", + "RSA-MD5": "9ad0fe040e44a8e7146c3dd8582b6752", + "RSA-MDC2": "aaa1fefe12831022859358898f92ba5e", + "RSA-RIPEMD160": "bbe84db46c82161f9777e2155160b7cdb9e3db7d", + "RSA-SHA": "3d1d0397f2c3e37c9dbdd2aa72174f6be389a7c0", + "RSA-SHA1": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "RSA-SHA1-2": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "RSA-SHA224": "336536803a28845506a16214603066598cf48f50f5c2fd14a9d0ceaa", + "RSA-SHA256": "a0d7d4fda9435ef292b761aed2c9fea576519437a824e96150a4324dcc757605", + "RSA-SHA384": "85aea3962c8f3401660806645041495f2b7d7896f28d030d1c28d2289ae11e216dbb22e6d896a634397eade7670ec404", + "RSA-SHA512": "c88ebff861e4fe68f92b17536e70f4b22fe91b6730e7468d57f40f1d1c02f9e474da1027958b715acb6de5fc4da2453f40e93b40f97d137b9dfe39436d05cb20", + "dsaEncryption": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "dsaWithSHA": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "dsaWithSHA1": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "dss1": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "ecdsa-with-SHA1": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "md4": "349503c72dda30942bcc11f60c96ce53", + "md4WithRSAEncryption": "349503c72dda30942bcc11f60c96ce53", + "md5": "9ad0fe040e44a8e7146c3dd8582b6752", + "md5WithRSAEncryption": "9ad0fe040e44a8e7146c3dd8582b6752", + "mdc2": "aaa1fefe12831022859358898f92ba5e", + "mdc2WithRSA": "aaa1fefe12831022859358898f92ba5e", + "ripemd": "bbe84db46c82161f9777e2155160b7cdb9e3db7d", + "ripemd160": "bbe84db46c82161f9777e2155160b7cdb9e3db7d", + "ripemd160WithRSA": "bbe84db46c82161f9777e2155160b7cdb9e3db7d", + "rmd160": "bbe84db46c82161f9777e2155160b7cdb9e3db7d", + "sha": "3d1d0397f2c3e37c9dbdd2aa72174f6be389a7c0", + "sha1": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "sha1WithRSAEncryption": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "sha224": "336536803a28845506a16214603066598cf48f50f5c2fd14a9d0ceaa", + "sha224WithRSAEncryption": "336536803a28845506a16214603066598cf48f50f5c2fd14a9d0ceaa", + "sha256": "a0d7d4fda9435ef292b761aed2c9fea576519437a824e96150a4324dcc757605", + "sha256WithRSAEncryption": "a0d7d4fda9435ef292b761aed2c9fea576519437a824e96150a4324dcc757605", + "sha384": "85aea3962c8f3401660806645041495f2b7d7896f28d030d1c28d2289ae11e216dbb22e6d896a634397eade7670ec404", + "sha384WithRSAEncryption": "85aea3962c8f3401660806645041495f2b7d7896f28d030d1c28d2289ae11e216dbb22e6d896a634397eade7670ec404", + "sha512": "c88ebff861e4fe68f92b17536e70f4b22fe91b6730e7468d57f40f1d1c02f9e474da1027958b715acb6de5fc4da2453f40e93b40f97d137b9dfe39436d05cb20", + "sha512WithRSAEncryption": "c88ebff861e4fe68f92b17536e70f4b22fe91b6730e7468d57f40f1d1c02f9e474da1027958b715acb6de5fc4da2453f40e93b40f97d137b9dfe39436d05cb20", + "shaWithRSAEncryption": "3d1d0397f2c3e37c9dbdd2aa72174f6be389a7c0", + "ssl2-md5": "9ad0fe040e44a8e7146c3dd8582b6752", + "ssl3-md5": "9ad0fe040e44a8e7146c3dd8582b6752", + "ssl3-sha1": "6475df681e061fa506672c27cbabfa9aa6ddff62", + "whirlpool": "ac16fba5ba2cb44e046fe3a18e9f7618a3179aefe63f7e9893fe8a8170927bbc7ec57a775a46b29e140e93fae59b94fe3d359a13e1933ec098bb75982221ae20" + }, + { + "input": "AAAAH//AAA//wAAAH//AAB/AAAAD/4AAAAf////AAAAAgAA//ADAAA///wAABgA//B4AH///8AA+D///8AAAP//wAAAAH//AAAD////4AOAAAP////4AAA////4////8B/4AAADAAH////4A/////Af//+AAP+P//8AAAD//", + "DSA": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "DSA-SHA": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "DSA-SHA1": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "DSA-SHA1-old": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "RSA-MD4": "2729c19da6b8bc7592dea9eccefdaf26", + "RSA-MD5": "4e56f978f94cf72158fd4311831b4f9f", + "RSA-MDC2": "9d755176d0e78bb54b229a09922d9a31", + "RSA-RIPEMD160": "5d47f4ddfda6502f922c5c2bfbb8d61c3b5c7919", + "RSA-SHA": "76de02e1d3383927467b914a5cdaefb425bb4321", + "RSA-SHA1": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "RSA-SHA1-2": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "RSA-SHA224": "0a14fdb29b36a83114cdaa86de2224c9049481878e558c763af2ff35", + "RSA-SHA256": "7906439843a1c1758c232182eaa66d5e6bd5ad2fbc0157fdc5438e1038966dc4", + "RSA-SHA384": "d32b15389e12ed922e1569c92b20af57f564102c7a504726416872adb9a3c06bbf44afb255684aa2e3d2d913926b1471", + "RSA-SHA512": "944d6522c69ffaee3033e3a933b2dcdfb05a3b5cc3bcf3b9d35cce08c496fedb6879a0a277c59a84e5b6d523d9f202e07a09e32a08e63f30269a060d4df81d01", + "dsaEncryption": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "dsaWithSHA": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "dsaWithSHA1": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "dss1": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "ecdsa-with-SHA1": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "md4": "2729c19da6b8bc7592dea9eccefdaf26", + "md4WithRSAEncryption": "2729c19da6b8bc7592dea9eccefdaf26", + "md5": "4e56f978f94cf72158fd4311831b4f9f", + "md5WithRSAEncryption": "4e56f978f94cf72158fd4311831b4f9f", + "mdc2": "9d755176d0e78bb54b229a09922d9a31", + "mdc2WithRSA": "9d755176d0e78bb54b229a09922d9a31", + "ripemd": "5d47f4ddfda6502f922c5c2bfbb8d61c3b5c7919", + "ripemd160": "5d47f4ddfda6502f922c5c2bfbb8d61c3b5c7919", + "ripemd160WithRSA": "5d47f4ddfda6502f922c5c2bfbb8d61c3b5c7919", + "rmd160": "5d47f4ddfda6502f922c5c2bfbb8d61c3b5c7919", + "sha": "76de02e1d3383927467b914a5cdaefb425bb4321", + "sha1": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "sha1WithRSAEncryption": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "sha224": "0a14fdb29b36a83114cdaa86de2224c9049481878e558c763af2ff35", + "sha224WithRSAEncryption": "0a14fdb29b36a83114cdaa86de2224c9049481878e558c763af2ff35", + "sha256": "7906439843a1c1758c232182eaa66d5e6bd5ad2fbc0157fdc5438e1038966dc4", + "sha256WithRSAEncryption": "7906439843a1c1758c232182eaa66d5e6bd5ad2fbc0157fdc5438e1038966dc4", + "sha384": "d32b15389e12ed922e1569c92b20af57f564102c7a504726416872adb9a3c06bbf44afb255684aa2e3d2d913926b1471", + "sha384WithRSAEncryption": "d32b15389e12ed922e1569c92b20af57f564102c7a504726416872adb9a3c06bbf44afb255684aa2e3d2d913926b1471", + "sha512": "944d6522c69ffaee3033e3a933b2dcdfb05a3b5cc3bcf3b9d35cce08c496fedb6879a0a277c59a84e5b6d523d9f202e07a09e32a08e63f30269a060d4df81d01", + "sha512WithRSAEncryption": "944d6522c69ffaee3033e3a933b2dcdfb05a3b5cc3bcf3b9d35cce08c496fedb6879a0a277c59a84e5b6d523d9f202e07a09e32a08e63f30269a060d4df81d01", + "shaWithRSAEncryption": "76de02e1d3383927467b914a5cdaefb425bb4321", + "ssl2-md5": "4e56f978f94cf72158fd4311831b4f9f", + "ssl3-md5": "4e56f978f94cf72158fd4311831b4f9f", + "ssl3-sha1": "79d81991fa4e4957c8062753439dbfd47bbb277d", + "whirlpool": "ee08fe5e47e4b5bae8697f3e989a7e2a24975cebea10b2a6b9526f684bcc547c4e93997ed742d2a338f1bf870fba5b80b7f60212623613f728cb8c0d13def88e" + }, + { + "input": "AAAAD//AAA/4AAAA//wAAA////4AAAAD/wD//Af/8B///g////3////wH//wAAf4//gAAAD//8A/////gAAAD////wAAA///8AAH//8AAD//8AH//8AB////AD//+B////4f////wAAAf+AAB////gAAAAPgB//AA/wAB////w==", + "DSA": "bae224477b20302e881f5249f52ec6c34da8ecef", + "DSA-SHA": "bae224477b20302e881f5249f52ec6c34da8ecef", + "DSA-SHA1": "bae224477b20302e881f5249f52ec6c34da8ecef", + "DSA-SHA1-old": "bae224477b20302e881f5249f52ec6c34da8ecef", + "RSA-MD4": "ccc4c705c60b4bc1bdac69abd94f55c6", + "RSA-MD5": "3b95686fe49f50006607d5978aaa3efc", + "RSA-MDC2": "36eea7d5d7a461845af9dbf1a8470a9d", + "RSA-RIPEMD160": "48ecd17bf0833bf878487b51ca62184e4d28b34d", + "RSA-SHA": "730b8f6170b4e9fa52a392c7be070025d4241208", + "RSA-SHA1": "bae224477b20302e881f5249f52ec6c34da8ecef", + "RSA-SHA1-2": "bae224477b20302e881f5249f52ec6c34da8ecef", + "RSA-SHA224": "1418176e47f3d1542ef62990925df680b941d60b33c7a2fd844443ea", + "RSA-SHA256": "35e5a6c17906646cf15c2bed4884129b5134eb2b411400e4d8797126f51a4cb7", + "RSA-SHA384": "c031380e2e4421d0436dc51d54706b909128d6ee9dba1e2605e15c67f7fae03f6f3dc5ff7695a0f2471f7140aae57dde", + "RSA-SHA512": "c6a5f4bbdb075c17ebcf4131de0fe33d3e2bb6edb5af7c277b472ea7847b11d2aa2598cb7ca75e4fe94c264bd2942bd82fc60b5045bd7c5cbc31325954713dfc", + "dsaEncryption": "bae224477b20302e881f5249f52ec6c34da8ecef", + "dsaWithSHA": "bae224477b20302e881f5249f52ec6c34da8ecef", + "dsaWithSHA1": "bae224477b20302e881f5249f52ec6c34da8ecef", + "dss1": "bae224477b20302e881f5249f52ec6c34da8ecef", + "ecdsa-with-SHA1": "bae224477b20302e881f5249f52ec6c34da8ecef", + "md4": "ccc4c705c60b4bc1bdac69abd94f55c6", + "md4WithRSAEncryption": "ccc4c705c60b4bc1bdac69abd94f55c6", + "md5": "3b95686fe49f50006607d5978aaa3efc", + "md5WithRSAEncryption": "3b95686fe49f50006607d5978aaa3efc", + "mdc2": "36eea7d5d7a461845af9dbf1a8470a9d", + "mdc2WithRSA": "36eea7d5d7a461845af9dbf1a8470a9d", + "ripemd": "48ecd17bf0833bf878487b51ca62184e4d28b34d", + "ripemd160": "48ecd17bf0833bf878487b51ca62184e4d28b34d", + "ripemd160WithRSA": "48ecd17bf0833bf878487b51ca62184e4d28b34d", + "rmd160": "48ecd17bf0833bf878487b51ca62184e4d28b34d", + "sha": "730b8f6170b4e9fa52a392c7be070025d4241208", + "sha1": "bae224477b20302e881f5249f52ec6c34da8ecef", + "sha1WithRSAEncryption": "bae224477b20302e881f5249f52ec6c34da8ecef", + "sha224": "1418176e47f3d1542ef62990925df680b941d60b33c7a2fd844443ea", + "sha224WithRSAEncryption": "1418176e47f3d1542ef62990925df680b941d60b33c7a2fd844443ea", + "sha256": "35e5a6c17906646cf15c2bed4884129b5134eb2b411400e4d8797126f51a4cb7", + "sha256WithRSAEncryption": "35e5a6c17906646cf15c2bed4884129b5134eb2b411400e4d8797126f51a4cb7", + "sha384": "c031380e2e4421d0436dc51d54706b909128d6ee9dba1e2605e15c67f7fae03f6f3dc5ff7695a0f2471f7140aae57dde", + "sha384WithRSAEncryption": "c031380e2e4421d0436dc51d54706b909128d6ee9dba1e2605e15c67f7fae03f6f3dc5ff7695a0f2471f7140aae57dde", + "sha512": "c6a5f4bbdb075c17ebcf4131de0fe33d3e2bb6edb5af7c277b472ea7847b11d2aa2598cb7ca75e4fe94c264bd2942bd82fc60b5045bd7c5cbc31325954713dfc", + "sha512WithRSAEncryption": "c6a5f4bbdb075c17ebcf4131de0fe33d3e2bb6edb5af7c277b472ea7847b11d2aa2598cb7ca75e4fe94c264bd2942bd82fc60b5045bd7c5cbc31325954713dfc", + "shaWithRSAEncryption": "730b8f6170b4e9fa52a392c7be070025d4241208", + "ssl2-md5": "3b95686fe49f50006607d5978aaa3efc", + "ssl3-md5": "3b95686fe49f50006607d5978aaa3efc", + "ssl3-sha1": "bae224477b20302e881f5249f52ec6c34da8ecef", + "whirlpool": "74ecd1220ed2220bf407707c4de77c1563d82ccbe0b4296909578f2adf8293c9fcb8e12ae539b68186a067e61737686caf52609952b3a47668d461aa45301ea0" + }, + { + "input": "////AAADwAAAAf//+AAAAA////8AAA8AAP//+IAA+AAPwAAAAOAAAAD////4D////gAAGAAAf////wAAA////wB////8AAPAAAAP////8AAH//+AAf///+AAD//+B///+AD////AAAAD4AAH//AP//AAAP//+H/AA8A//+AAAAA=", + "DSA": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "DSA-SHA": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "DSA-SHA1": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "DSA-SHA1-old": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "RSA-MD4": "9f087a499ffa01c8296b71259bd36b1a", + "RSA-MD5": "fa354daecc45f14b82b0e7e567d24282", + "RSA-MDC2": "1f3d3c85d0f8c126a21a0df7de24de67", + "RSA-RIPEMD160": "bdee0dbbf5de0d1e1e3b82ae19725c959d2a6305", + "RSA-SHA": "3bc9489fc869cd0249f1bf650ebebe65f6393824", + "RSA-SHA1": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "RSA-SHA1-2": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "RSA-SHA224": "e1b6afbdb36b12e5f3b438a79b969055263713904445364c40bea416", + "RSA-SHA256": "d19ddbd98476519a07cd8917b95eb609e5b50e8088ad68cd7426e8139d5bffc2", + "RSA-SHA384": "ce5bc596b3d3a33a0466927fe3975937edac8cf910cb802ba7c1f7df13ad4b26cf9468a1627f8b80a9905b12dddfd475", + "RSA-SHA512": "cc2a04b943fb4625e799ca7f7566110fd200040e8bc5e76b167fe95bf758dbe68a9eaa0a078445141cf547c417f6953872de8962f9ca06f5be1d777ba6f5d936", + "dsaEncryption": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "dsaWithSHA": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "dsaWithSHA1": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "dss1": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "ecdsa-with-SHA1": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "md4": "9f087a499ffa01c8296b71259bd36b1a", + "md4WithRSAEncryption": "9f087a499ffa01c8296b71259bd36b1a", + "md5": "fa354daecc45f14b82b0e7e567d24282", + "md5WithRSAEncryption": "fa354daecc45f14b82b0e7e567d24282", + "mdc2": "1f3d3c85d0f8c126a21a0df7de24de67", + "mdc2WithRSA": "1f3d3c85d0f8c126a21a0df7de24de67", + "ripemd": "bdee0dbbf5de0d1e1e3b82ae19725c959d2a6305", + "ripemd160": "bdee0dbbf5de0d1e1e3b82ae19725c959d2a6305", + "ripemd160WithRSA": "bdee0dbbf5de0d1e1e3b82ae19725c959d2a6305", + "rmd160": "bdee0dbbf5de0d1e1e3b82ae19725c959d2a6305", + "sha": "3bc9489fc869cd0249f1bf650ebebe65f6393824", + "sha1": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "sha1WithRSAEncryption": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "sha224": "e1b6afbdb36b12e5f3b438a79b969055263713904445364c40bea416", + "sha224WithRSAEncryption": "e1b6afbdb36b12e5f3b438a79b969055263713904445364c40bea416", + "sha256": "d19ddbd98476519a07cd8917b95eb609e5b50e8088ad68cd7426e8139d5bffc2", + "sha256WithRSAEncryption": "d19ddbd98476519a07cd8917b95eb609e5b50e8088ad68cd7426e8139d5bffc2", + "sha384": "ce5bc596b3d3a33a0466927fe3975937edac8cf910cb802ba7c1f7df13ad4b26cf9468a1627f8b80a9905b12dddfd475", + "sha384WithRSAEncryption": "ce5bc596b3d3a33a0466927fe3975937edac8cf910cb802ba7c1f7df13ad4b26cf9468a1627f8b80a9905b12dddfd475", + "sha512": "cc2a04b943fb4625e799ca7f7566110fd200040e8bc5e76b167fe95bf758dbe68a9eaa0a078445141cf547c417f6953872de8962f9ca06f5be1d777ba6f5d936", + "sha512WithRSAEncryption": "cc2a04b943fb4625e799ca7f7566110fd200040e8bc5e76b167fe95bf758dbe68a9eaa0a078445141cf547c417f6953872de8962f9ca06f5be1d777ba6f5d936", + "shaWithRSAEncryption": "3bc9489fc869cd0249f1bf650ebebe65f6393824", + "ssl2-md5": "fa354daecc45f14b82b0e7e567d24282", + "ssl3-md5": "fa354daecc45f14b82b0e7e567d24282", + "ssl3-sha1": "ede4deb4293cfe4138c2c056b7c46ff821cc0acc", + "whirlpool": "4babb00c5a0d0bb5af69d46c2e11a0485346e6a91d4728061b5965f8716fcab92fe7dea59652cc3973d08f23f5921662688f7e6689114d881eec282c356c3bbc" + }, + { + "input": "+P/gAD/8AAAD////+AAACB////5/gAAAAPwH////4P//4AAAP/wP+AAAAA///gAA////AAAAf//+B/+AAHAf8Af/AAAAB4AMH/8AAAAH/gAf////gAAAAH//4AAAAf//gAAADgAAAAeH///+B//AAAAAf/z/4D///8P//gAAAA//", + "DSA": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "DSA-SHA": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "DSA-SHA1": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "DSA-SHA1-old": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "RSA-MD4": "2b6647c18ea7ce0868727632c9f7ac3c", + "RSA-MD5": "b7c30cf902e74c10e3d5c3af7e854f6b", + "RSA-MDC2": "236567aecf4d11a369714f8ad199787f", + "RSA-RIPEMD160": "3ad1f7d953682ea24c61b51f6d9b5df0ac307b08", + "RSA-SHA": "ec4aa3cbe617bcaecffcc71e13d6255e16d41c47", + "RSA-SHA1": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "RSA-SHA1-2": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "RSA-SHA224": "4b5639709abaefa38b794a266a1374aa69d6fbe7f73be7257a3a5bf6", + "RSA-SHA256": "cafea6a1183ca8934867692684194ce9903b375a8036c4c5deb8fb379c3423cb", + "RSA-SHA384": "83edb88cace6e3273db3fced4e5f207afb376b428950954b00cadc55a5cc98b37a18955677b85bbb90fe1db213f85696", + "RSA-SHA512": "7fdcd5fea3209c23797da291503bd224e948e48111e895cf2e033a436309373934cfc88d3c35d3fd31d0a917d6f9303adba0263ceb58fcddcb83aad6a606e479", + "dsaEncryption": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "dsaWithSHA": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "dsaWithSHA1": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "dss1": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "ecdsa-with-SHA1": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "md4": "2b6647c18ea7ce0868727632c9f7ac3c", + "md4WithRSAEncryption": "2b6647c18ea7ce0868727632c9f7ac3c", + "md5": "b7c30cf902e74c10e3d5c3af7e854f6b", + "md5WithRSAEncryption": "b7c30cf902e74c10e3d5c3af7e854f6b", + "mdc2": "236567aecf4d11a369714f8ad199787f", + "mdc2WithRSA": "236567aecf4d11a369714f8ad199787f", + "ripemd": "3ad1f7d953682ea24c61b51f6d9b5df0ac307b08", + "ripemd160": "3ad1f7d953682ea24c61b51f6d9b5df0ac307b08", + "ripemd160WithRSA": "3ad1f7d953682ea24c61b51f6d9b5df0ac307b08", + "rmd160": "3ad1f7d953682ea24c61b51f6d9b5df0ac307b08", + "sha": "ec4aa3cbe617bcaecffcc71e13d6255e16d41c47", + "sha1": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "sha1WithRSAEncryption": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "sha224": "4b5639709abaefa38b794a266a1374aa69d6fbe7f73be7257a3a5bf6", + "sha224WithRSAEncryption": "4b5639709abaefa38b794a266a1374aa69d6fbe7f73be7257a3a5bf6", + "sha256": "cafea6a1183ca8934867692684194ce9903b375a8036c4c5deb8fb379c3423cb", + "sha256WithRSAEncryption": "cafea6a1183ca8934867692684194ce9903b375a8036c4c5deb8fb379c3423cb", + "sha384": "83edb88cace6e3273db3fced4e5f207afb376b428950954b00cadc55a5cc98b37a18955677b85bbb90fe1db213f85696", + "sha384WithRSAEncryption": "83edb88cace6e3273db3fced4e5f207afb376b428950954b00cadc55a5cc98b37a18955677b85bbb90fe1db213f85696", + "sha512": "7fdcd5fea3209c23797da291503bd224e948e48111e895cf2e033a436309373934cfc88d3c35d3fd31d0a917d6f9303adba0263ceb58fcddcb83aad6a606e479", + "sha512WithRSAEncryption": "7fdcd5fea3209c23797da291503bd224e948e48111e895cf2e033a436309373934cfc88d3c35d3fd31d0a917d6f9303adba0263ceb58fcddcb83aad6a606e479", + "shaWithRSAEncryption": "ec4aa3cbe617bcaecffcc71e13d6255e16d41c47", + "ssl2-md5": "b7c30cf902e74c10e3d5c3af7e854f6b", + "ssl3-md5": "b7c30cf902e74c10e3d5c3af7e854f6b", + "ssl3-sha1": "a771fa5c812bd0c9596d869ec99e4f4ac988b13f", + "whirlpool": "9a9769133e866d68966e773a11e0bff3cf6c1447eeaf21a033f171ae1545c1feb092aa54df2e89a96d29f78a7436b816b94f52147bac14bb6d2ecbbbf0d18c01" + }, + { + "input": "AAAH//8AAAf///AB//////+AAAAABgAPf////8AAAP//AAAAH/D/////gABwAAAAP/+AD/////AAf//AAAAAAP////8Af/////4f/////gAD/////AAAAH//8AAAAAAD//8D/////8AAAP/AAAAB/+AAAA//////8AAf////AAAB////4AAAAHgH/wAAAP+AH////8AAAAP//////4AAAP//AAAAB/////wf/////+AAAAcAAB/+AAAAAB///////B/////8AAAAAB8AA/+AAAAAAAP/////gAB/4B/////h//wAAAAAf///5//////wAAA//////gAAB////+AAAAA=", + "DSA": "e99d566212bbbceee903946f6100c9c96039a8f4", + "DSA-SHA": "e99d566212bbbceee903946f6100c9c96039a8f4", + "DSA-SHA1": "e99d566212bbbceee903946f6100c9c96039a8f4", + "DSA-SHA1-old": "e99d566212bbbceee903946f6100c9c96039a8f4", + "RSA-MD4": "1f04445c72c242626b9b38f61508ed7b", + "RSA-MD5": "e9369a7ec98e63186bdae77025cb5519", + "RSA-MDC2": "824ccd5cb696aae633116f460b9e38db", + "RSA-RIPEMD160": "a3b0ecda8f15a6dd64677e975d3571ccdd563d15", + "RSA-SHA": "5751360ddd96f2bec5749fbb96432d6668e57b09", + "RSA-SHA1": "e99d566212bbbceee903946f6100c9c96039a8f4", + "RSA-SHA1-2": "e99d566212bbbceee903946f6100c9c96039a8f4", + "RSA-SHA224": "2623a90f5bc134c3ff0dfbf58a3e6b750fd4b202704e8be2c95e01aa", + "RSA-SHA256": "7e4734ce7e22a515bfe60e296640dec121a089f75034240408fe7be2ed9e5c87", + "RSA-SHA384": "09396174128d49b61ff435be0ec147dec1146cbd3b890087b8b01f24f0dfeb7c7608b035b4380dfaf1b3333d2d85a212", + "RSA-SHA512": "8a006a0a1e2dd36ba57aa0325b2c9532db7649a4c3c6214ee0f004ecabcf1eef89a91b225ffc52a4f811791d20f6faddd900b863386da65daec18e00c48412d6", + "dsaEncryption": "e99d566212bbbceee903946f6100c9c96039a8f4", + "dsaWithSHA": "e99d566212bbbceee903946f6100c9c96039a8f4", + "dsaWithSHA1": "e99d566212bbbceee903946f6100c9c96039a8f4", + "dss1": "e99d566212bbbceee903946f6100c9c96039a8f4", + "ecdsa-with-SHA1": "e99d566212bbbceee903946f6100c9c96039a8f4", + "md4": "1f04445c72c242626b9b38f61508ed7b", + "md4WithRSAEncryption": "1f04445c72c242626b9b38f61508ed7b", + "md5": "e9369a7ec98e63186bdae77025cb5519", + "md5WithRSAEncryption": "e9369a7ec98e63186bdae77025cb5519", + "mdc2": "824ccd5cb696aae633116f460b9e38db", + "mdc2WithRSA": "824ccd5cb696aae633116f460b9e38db", + "ripemd": "a3b0ecda8f15a6dd64677e975d3571ccdd563d15", + "ripemd160": "a3b0ecda8f15a6dd64677e975d3571ccdd563d15", + "ripemd160WithRSA": "a3b0ecda8f15a6dd64677e975d3571ccdd563d15", + "rmd160": "a3b0ecda8f15a6dd64677e975d3571ccdd563d15", + "sha": "5751360ddd96f2bec5749fbb96432d6668e57b09", + "sha1": "e99d566212bbbceee903946f6100c9c96039a8f4", + "sha1WithRSAEncryption": "e99d566212bbbceee903946f6100c9c96039a8f4", + "sha224": "2623a90f5bc134c3ff0dfbf58a3e6b750fd4b202704e8be2c95e01aa", + "sha224WithRSAEncryption": "2623a90f5bc134c3ff0dfbf58a3e6b750fd4b202704e8be2c95e01aa", + "sha256": "7e4734ce7e22a515bfe60e296640dec121a089f75034240408fe7be2ed9e5c87", + "sha256WithRSAEncryption": "7e4734ce7e22a515bfe60e296640dec121a089f75034240408fe7be2ed9e5c87", + "sha384": "09396174128d49b61ff435be0ec147dec1146cbd3b890087b8b01f24f0dfeb7c7608b035b4380dfaf1b3333d2d85a212", + "sha384WithRSAEncryption": "09396174128d49b61ff435be0ec147dec1146cbd3b890087b8b01f24f0dfeb7c7608b035b4380dfaf1b3333d2d85a212", + "sha512": "8a006a0a1e2dd36ba57aa0325b2c9532db7649a4c3c6214ee0f004ecabcf1eef89a91b225ffc52a4f811791d20f6faddd900b863386da65daec18e00c48412d6", + "sha512WithRSAEncryption": "8a006a0a1e2dd36ba57aa0325b2c9532db7649a4c3c6214ee0f004ecabcf1eef89a91b225ffc52a4f811791d20f6faddd900b863386da65daec18e00c48412d6", + "shaWithRSAEncryption": "5751360ddd96f2bec5749fbb96432d6668e57b09", + "ssl2-md5": "e9369a7ec98e63186bdae77025cb5519", + "ssl3-md5": "e9369a7ec98e63186bdae77025cb5519", + "ssl3-sha1": "e99d566212bbbceee903946f6100c9c96039a8f4", + "whirlpool": "cdf7f5f2f9c09d598da59645bb8f938d6d510177dd257e00eee0680a5ca99264511a9e02b6b84101eca079f3c4dbde25772e3fb8b0a94668f77c126c3ef79259" + }, + { + "input": "///AAP///////+fgAAAAH////////AH////+AAAAAAAAf//////4AAAAAAAf///////8A/+AAAAAAAAD///////gAAAAAAAAP//ADgAAAAAAAB/gAAH//+AAAAAAAH///////gAP////8///////8AAAAAAAA///////gAAAP////////wB/////AAAABgAAAAAAA//4AAAAP///wAAAAAAB///////gAAf/////wAD////wAAAAAB/////+AAAAAAAf///////AAD////////AD///////AAAA////////+AAAAAD///wAAAAAA///wAB////////wAAA///AAAD//////8D////////8AAAAAAAB//////gAAD+AA/////AAD+AAAAAAAAH//gAAB//AAAAAAP4AP//////8AAAAAf8AAAB//AAAAAAf//////gAH///////AAAAAAAAB////+AAAAAAfAAAAfAAAAAB//////gAAB////4AAAAAAAAA==", + "DSA": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "DSA-SHA": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "DSA-SHA1": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "DSA-SHA1-old": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "RSA-MD4": "9cdb316aa787ac067afc57a45dcb04d2", + "RSA-MD5": "57b441e2f3397d2628657e636cd2fc80", + "RSA-MDC2": "1a411507bf618413dc7390476e713be2", + "RSA-RIPEMD160": "2a90379b7530d950db49614bbcfe252eca61307c", + "RSA-SHA": "dc69cfc0efef50d0d6953ef101999dca917b9815", + "RSA-SHA1": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "RSA-SHA1-2": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "RSA-SHA224": "7599cf5b41f1b4df0b787584e5537dedf8656f539c47ad8c3c119fac", + "RSA-SHA256": "b09436c29cc3823c434a4689bb67a73a49164bd23ab40c4e04ed99320fd138d2", + "RSA-SHA384": "1c0afadc2d1561b1ee7d024b203e2db3e093cf3bd7ea6c2a38c5907f7f490e8fd167e8fea3058bfa410483e1c62db710", + "RSA-SHA512": "d0b336a283f47f0f6fb19e98df49730d802321f1ba993c760687a0469b72015d98dcf86db7b2b628ff03d690300ec827851f40e621cf6cf98a4b378d901735db", + "dsaEncryption": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "dsaWithSHA": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "dsaWithSHA1": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "dss1": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "ecdsa-with-SHA1": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "md4": "9cdb316aa787ac067afc57a45dcb04d2", + "md4WithRSAEncryption": "9cdb316aa787ac067afc57a45dcb04d2", + "md5": "57b441e2f3397d2628657e636cd2fc80", + "md5WithRSAEncryption": "57b441e2f3397d2628657e636cd2fc80", + "mdc2": "1a411507bf618413dc7390476e713be2", + "mdc2WithRSA": "1a411507bf618413dc7390476e713be2", + "ripemd": "2a90379b7530d950db49614bbcfe252eca61307c", + "ripemd160": "2a90379b7530d950db49614bbcfe252eca61307c", + "ripemd160WithRSA": "2a90379b7530d950db49614bbcfe252eca61307c", + "rmd160": "2a90379b7530d950db49614bbcfe252eca61307c", + "sha": "dc69cfc0efef50d0d6953ef101999dca917b9815", + "sha1": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "sha1WithRSAEncryption": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "sha224": "7599cf5b41f1b4df0b787584e5537dedf8656f539c47ad8c3c119fac", + "sha224WithRSAEncryption": "7599cf5b41f1b4df0b787584e5537dedf8656f539c47ad8c3c119fac", + "sha256": "b09436c29cc3823c434a4689bb67a73a49164bd23ab40c4e04ed99320fd138d2", + "sha256WithRSAEncryption": "b09436c29cc3823c434a4689bb67a73a49164bd23ab40c4e04ed99320fd138d2", + "sha384": "1c0afadc2d1561b1ee7d024b203e2db3e093cf3bd7ea6c2a38c5907f7f490e8fd167e8fea3058bfa410483e1c62db710", + "sha384WithRSAEncryption": "1c0afadc2d1561b1ee7d024b203e2db3e093cf3bd7ea6c2a38c5907f7f490e8fd167e8fea3058bfa410483e1c62db710", + "sha512": "d0b336a283f47f0f6fb19e98df49730d802321f1ba993c760687a0469b72015d98dcf86db7b2b628ff03d690300ec827851f40e621cf6cf98a4b378d901735db", + "sha512WithRSAEncryption": "d0b336a283f47f0f6fb19e98df49730d802321f1ba993c760687a0469b72015d98dcf86db7b2b628ff03d690300ec827851f40e621cf6cf98a4b378d901735db", + "shaWithRSAEncryption": "dc69cfc0efef50d0d6953ef101999dca917b9815", + "ssl2-md5": "57b441e2f3397d2628657e636cd2fc80", + "ssl3-md5": "57b441e2f3397d2628657e636cd2fc80", + "ssl3-sha1": "b48ce6b1d13903e3925ae0c88cb931388c013f9c", + "whirlpool": "a1e8a7b9946d85018867dc47f55d54e810387bfcdbe0a2744235c8db6456fb14baf48f1119fef25fc1206d9e8ddc3dd1c32c69bc4aaf1053f4c7488a7d05ac5c" + }, + { + "input": "AAAAAAAAAD/////4AAAAAAD////wf///+AAAAAAAAAAP8AD///+AP///////gAAAAAAAA////+AAAAAAAAAAfwAAAAAGP///////wf/gAAAAAAAAP////////8AAAAP/////gAf/////////8D/////////wAAAB////wAAAAAAAP//////8AAAAAH/+AAD///wAAAAAAAAD/wCAAH//AAAAAAA//////////4AB////////wAAAAAAAAB///AAAAAAB/AP////////8AAAAAAAH/////gAAAAAAAB///4AAAAAAAH/////////4AAAAAAD/v////////D///gAAAAAAAP/////////4AAH///////+AAAD/+AAAAAAAH/////////+AAAD///////gAAAAAAAAAH/AAAAAAAAAP//wAAAf////wD////8AAAAf/////gAP/////8P/////////AAAAAAAAB///////8AAAD//8AAAAAAH/////////gAAP/wAAP////////AAAAAAA////+AAAAAAAf//////8AAAA//////////4AAAAAf////4AAAAAAP//////////AAH///+AAAAAAAAA///n///////8D////8AAAAAAAAH/8AAAAAAAAD/8AAAAAAAAH/////8AD/////+AAAAAAA", + "DSA": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "DSA-SHA": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "DSA-SHA1": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "DSA-SHA1-old": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "RSA-MD4": "a1236481492a6622b18ebe6d3ced1357", + "RSA-MD5": "8ae3a1e880ffb884260ec26e8fcd71a5", + "RSA-MDC2": "7d1307f4067bcd519a0f125a15f74aff", + "RSA-RIPEMD160": "a6a7630848772bd089bd8448871fb227e4420035", + "RSA-SHA": "3a776fa9f465eea5e4df129318183909feb12add", + "RSA-SHA1": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "RSA-SHA1-2": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "RSA-SHA224": "769585a17115a116712119a2933c62bdfb881e0b7a0735e151003c24", + "RSA-SHA256": "d6752f5e2738cbaa2e154b749216babc990297af411dfa2b66c9f942480ff4b9", + "RSA-SHA384": "557e9592b0c5578786e1c5a66f71f023f1aeda6133104a764f8cffa19b140f2a20ba12c83532ebe99c0e219068002959", + "RSA-SHA512": "525213a2b56a346a3e641b3f951b60df15dc35e56befc197fd7671d3fb955f27c4410f3aa07e4bf2dae05d2419e355a05cdecaf282d44471467c140610d4b495", + "dsaEncryption": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "dsaWithSHA": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "dsaWithSHA1": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "dss1": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "ecdsa-with-SHA1": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "md4": "a1236481492a6622b18ebe6d3ced1357", + "md4WithRSAEncryption": "a1236481492a6622b18ebe6d3ced1357", + "md5": "8ae3a1e880ffb884260ec26e8fcd71a5", + "md5WithRSAEncryption": "8ae3a1e880ffb884260ec26e8fcd71a5", + "mdc2": "7d1307f4067bcd519a0f125a15f74aff", + "mdc2WithRSA": "7d1307f4067bcd519a0f125a15f74aff", + "ripemd": "a6a7630848772bd089bd8448871fb227e4420035", + "ripemd160": "a6a7630848772bd089bd8448871fb227e4420035", + "ripemd160WithRSA": "a6a7630848772bd089bd8448871fb227e4420035", + "rmd160": "a6a7630848772bd089bd8448871fb227e4420035", + "sha": "3a776fa9f465eea5e4df129318183909feb12add", + "sha1": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "sha1WithRSAEncryption": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "sha224": "769585a17115a116712119a2933c62bdfb881e0b7a0735e151003c24", + "sha224WithRSAEncryption": "769585a17115a116712119a2933c62bdfb881e0b7a0735e151003c24", + "sha256": "d6752f5e2738cbaa2e154b749216babc990297af411dfa2b66c9f942480ff4b9", + "sha256WithRSAEncryption": "d6752f5e2738cbaa2e154b749216babc990297af411dfa2b66c9f942480ff4b9", + "sha384": "557e9592b0c5578786e1c5a66f71f023f1aeda6133104a764f8cffa19b140f2a20ba12c83532ebe99c0e219068002959", + "sha384WithRSAEncryption": "557e9592b0c5578786e1c5a66f71f023f1aeda6133104a764f8cffa19b140f2a20ba12c83532ebe99c0e219068002959", + "sha512": "525213a2b56a346a3e641b3f951b60df15dc35e56befc197fd7671d3fb955f27c4410f3aa07e4bf2dae05d2419e355a05cdecaf282d44471467c140610d4b495", + "sha512WithRSAEncryption": "525213a2b56a346a3e641b3f951b60df15dc35e56befc197fd7671d3fb955f27c4410f3aa07e4bf2dae05d2419e355a05cdecaf282d44471467c140610d4b495", + "shaWithRSAEncryption": "3a776fa9f465eea5e4df129318183909feb12add", + "ssl2-md5": "8ae3a1e880ffb884260ec26e8fcd71a5", + "ssl3-md5": "8ae3a1e880ffb884260ec26e8fcd71a5", + "ssl3-sha1": "e647d5baf670d4bf3afc0a6b72a2424b0c64f194", + "whirlpool": "2b9512461d9cad8a14c07ae8a12a403097871d51c4d52d02fc5a9f6ca1c1570608874c866ae41458e0f3bb5e1974d2313461451ee97b328aca65887a0abd3d23" + }, + { + "input": "AAAAAAAAAA8AAAAAAAAf///////AAAAAAAAAD//////AAB//////////wAAAAB///8AAAAP//////4AH///////////AAAAAAAAAAAD/////gAA//AAAAAAAAP//wAAP/////wAAAAAABgAAAAAAAAAAPAAAAAAAH//+H/////AAAAAAP////gAAAAAAD/AAAD/////////wAAAAAB///////////8AAAAAA/////wAAAAAAAAf/////AAAf////////AAAAAf////AAAAAAAAH/////w//////////4AAH/////AAAAP///////gAAAAAAAAAAB/wAAAAAAAAAA//////////wAAAAAAAAAB////+AAIAAAAAP////AAD//////wAAD//AAAAAAAAP////+AAA//////wAAAAP///+AAAAAAAAA/8AAP///////AAAAAAAB/AAAAAAAAAf/gAAAAAAAA////wAAAAAAAAD/////gAAAA/////////gAAAP//gAAAAAAAf//////wAAB///////AAA////AAAAAAAAAAH////AAAAAAAAAAAP///////AAAAAAP////+AAAAAD/wAAP/gAAAD4A/////////8AAAAAH///////////gAAAAAf/////gAAAAAD///////5/4AAAAAAAAAAH///////wf//gAAD///////AAAAAAAAAAAB////////wAAAAAAAABwAAA/gAAAAAAAAH////////8AAAAP///4AB//////4AAf///gAAAAAAAf/////wAAAAAAAAAAP///////8AAAD///////gAAf/////8AAAAAAAAH////////8=", + "DSA": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "DSA-SHA": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "DSA-SHA1": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "DSA-SHA1-old": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "RSA-MD4": "0676c70c114e251aac52c6209a9a2999", + "RSA-MD5": "eb7d8f9199945e8a1e5c3708da45e08b", + "RSA-MDC2": "e10f165f6abd483ee02c56b51fc1e941", + "RSA-RIPEMD160": "b29e66c47b15f9017cd6e5ee79e571315a70da08", + "RSA-SHA": "30fba5748fdd390ee64ff622b906c48c1e7d1713", + "RSA-SHA1": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "RSA-SHA1-2": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "RSA-SHA224": "036008a771af987275a004c5f2e7f6a7142f709634cd34ea3afce3f5", + "RSA-SHA256": "0f0cc4994a2a88f58cc38afdf61ff43952473c437d235cec426139c8f43ffb5a", + "RSA-SHA384": "a85ee3f3c6803416cc846ded8897435a3ef5dabcdfc68e937c976c097e2c11bb5b961ca6e6a231995764499a6d6fb277", + "RSA-SHA512": "546e908100c06a32a98056236acab22e0ca59721f59271d783c8c9f64e39ba5b1de316a0433fe557f68238378cf340ab9f5ad3ebcccfc6eea518b71048eee75c", + "dsaEncryption": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "dsaWithSHA": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "dsaWithSHA1": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "dss1": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "ecdsa-with-SHA1": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "md4": "0676c70c114e251aac52c6209a9a2999", + "md4WithRSAEncryption": "0676c70c114e251aac52c6209a9a2999", + "md5": "eb7d8f9199945e8a1e5c3708da45e08b", + "md5WithRSAEncryption": "eb7d8f9199945e8a1e5c3708da45e08b", + "mdc2": "e10f165f6abd483ee02c56b51fc1e941", + "mdc2WithRSA": "e10f165f6abd483ee02c56b51fc1e941", + "ripemd": "b29e66c47b15f9017cd6e5ee79e571315a70da08", + "ripemd160": "b29e66c47b15f9017cd6e5ee79e571315a70da08", + "ripemd160WithRSA": "b29e66c47b15f9017cd6e5ee79e571315a70da08", + "rmd160": "b29e66c47b15f9017cd6e5ee79e571315a70da08", + "sha": "30fba5748fdd390ee64ff622b906c48c1e7d1713", + "sha1": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "sha1WithRSAEncryption": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "sha224": "036008a771af987275a004c5f2e7f6a7142f709634cd34ea3afce3f5", + "sha224WithRSAEncryption": "036008a771af987275a004c5f2e7f6a7142f709634cd34ea3afce3f5", + "sha256": "0f0cc4994a2a88f58cc38afdf61ff43952473c437d235cec426139c8f43ffb5a", + "sha256WithRSAEncryption": "0f0cc4994a2a88f58cc38afdf61ff43952473c437d235cec426139c8f43ffb5a", + "sha384": "a85ee3f3c6803416cc846ded8897435a3ef5dabcdfc68e937c976c097e2c11bb5b961ca6e6a231995764499a6d6fb277", + "sha384WithRSAEncryption": "a85ee3f3c6803416cc846ded8897435a3ef5dabcdfc68e937c976c097e2c11bb5b961ca6e6a231995764499a6d6fb277", + "sha512": "546e908100c06a32a98056236acab22e0ca59721f59271d783c8c9f64e39ba5b1de316a0433fe557f68238378cf340ab9f5ad3ebcccfc6eea518b71048eee75c", + "sha512WithRSAEncryption": "546e908100c06a32a98056236acab22e0ca59721f59271d783c8c9f64e39ba5b1de316a0433fe557f68238378cf340ab9f5ad3ebcccfc6eea518b71048eee75c", + "shaWithRSAEncryption": "30fba5748fdd390ee64ff622b906c48c1e7d1713", + "ssl2-md5": "eb7d8f9199945e8a1e5c3708da45e08b", + "ssl3-md5": "eb7d8f9199945e8a1e5c3708da45e08b", + "ssl3-sha1": "65c1cd932a06b05cd0b43afb3bc7891f6bcef45c", + "whirlpool": "3ea37ba95e713244051cf3cf883e30f7d4811a6d39909bfbe4a1bc94a08b532cd94b901d4e05286b5b45ed625827707e82f0b45969898d7a3e711e5cce034b9f" + }, + { + "input": "//4AAAAAAAAAB/////8AAAAH//AAAAAAD//+AAAAAAAAAAAAH//////////8PgAAAAAAAAAAA///////8AAAAAAAAAB////gH////////////wAAAAAAAIAAAP/wAAAAAAAAAP//////AAAA///////wAAAAB////8AAAAAAD///////////+AAAAAAAAAAB////////AAAAAAAAAAf//4AAAAEAAAAAAAAD////////wAAAAAAP/////+AAAAAAAAAAH///wAAAAAAAAAAf/////wAAAP//8AH///+AAAAAAAAAAB///4AAAAAAAAAAAAP///AAAAAAAAAH8AAAAAA/////////4AAAAA//////////gAAAAAAAAAAAP4AAAAAAAAAAQAAAAAAAH/////wAAAAAAAAAAAA//wAAAB///wAAAAAAB///////////gAAAAAH/////////gAAAAAAAAAAAP/4AAAAAAAAAAAH///////wAAAAAAAAAAAH/////AP//////////wAAAf/////4f////////4AAAAAAAAAAAAP///////gB///////////8AB///gAAAAP//////gf///////8f//gAA//////////gAAAAAAA//wAAAAAAAP////////////AAAAAAAD////wAAAAA///////v////////8P///4D//////////4AAAAAAIAAAAAf/////wAAAf/////////AAAAAAAAAB////wAAAD/+AAP/8AAAAAAAAAAAAf/////////gAEAAAAP/////////gAAAH//////////wAAAAAAAAAH//gAAA//+AAAAH4AADAAAAAB////////AAAAA////+AAAAAAABgAAAAAAAAAD///////////+AAAAAAAAACP////////////AAAAAAB/8AAB//+AAAAAAA/////////AAAAAAAAAAH//////////8AAAAAAAAeAP////////////wAAAAAAAAAP//////////w==", + "DSA": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "DSA-SHA": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "DSA-SHA1": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "DSA-SHA1-old": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "RSA-MD4": "9f470f90fc581fa48d2cc01c5afea6eb", + "RSA-MD5": "d7dd1997c20a1029f9bd0fd1e2d2ed92", + "RSA-MDC2": "2c96bc851f2fc08a8f72b1df937fd924", + "RSA-RIPEMD160": "0afdb968456c22c65179274e0324bca2f0c5e3a0", + "RSA-SHA": "bc1902358e12259017413b274e921088ab002429", + "RSA-SHA1": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "RSA-SHA1-2": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "RSA-SHA224": "4d5b734d6acc7e7266c4c4d674e14e703049a4c117196466b2705d60", + "RSA-SHA256": "eb9dd875ecf9ec930b1482b8a50c337d48b31590f99cdfb80bbdd160ad4fb49b", + "RSA-SHA384": "76a87af0ad2c96afa592fd0f6b038f4f8f776cf33b1bfe1a20b9c5e55d6405da84c999f944f89177729bc755eb786d67", + "RSA-SHA512": "ea48c9e9245bf42c820385a6167afd3a8bb473645016ff4dba198d184ee0534bbc2d0ec07328be7b58c9a8e9d10c2379d69414ab2bfdddf99dafa8f92daf21af", + "dsaEncryption": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "dsaWithSHA": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "dsaWithSHA1": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "dss1": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "ecdsa-with-SHA1": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "md4": "9f470f90fc581fa48d2cc01c5afea6eb", + "md4WithRSAEncryption": "9f470f90fc581fa48d2cc01c5afea6eb", + "md5": "d7dd1997c20a1029f9bd0fd1e2d2ed92", + "md5WithRSAEncryption": "d7dd1997c20a1029f9bd0fd1e2d2ed92", + "mdc2": "2c96bc851f2fc08a8f72b1df937fd924", + "mdc2WithRSA": "2c96bc851f2fc08a8f72b1df937fd924", + "ripemd": "0afdb968456c22c65179274e0324bca2f0c5e3a0", + "ripemd160": "0afdb968456c22c65179274e0324bca2f0c5e3a0", + "ripemd160WithRSA": "0afdb968456c22c65179274e0324bca2f0c5e3a0", + "rmd160": "0afdb968456c22c65179274e0324bca2f0c5e3a0", + "sha": "bc1902358e12259017413b274e921088ab002429", + "sha1": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "sha1WithRSAEncryption": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "sha224": "4d5b734d6acc7e7266c4c4d674e14e703049a4c117196466b2705d60", + "sha224WithRSAEncryption": "4d5b734d6acc7e7266c4c4d674e14e703049a4c117196466b2705d60", + "sha256": "eb9dd875ecf9ec930b1482b8a50c337d48b31590f99cdfb80bbdd160ad4fb49b", + "sha256WithRSAEncryption": "eb9dd875ecf9ec930b1482b8a50c337d48b31590f99cdfb80bbdd160ad4fb49b", + "sha384": "76a87af0ad2c96afa592fd0f6b038f4f8f776cf33b1bfe1a20b9c5e55d6405da84c999f944f89177729bc755eb786d67", + "sha384WithRSAEncryption": "76a87af0ad2c96afa592fd0f6b038f4f8f776cf33b1bfe1a20b9c5e55d6405da84c999f944f89177729bc755eb786d67", + "sha512": "ea48c9e9245bf42c820385a6167afd3a8bb473645016ff4dba198d184ee0534bbc2d0ec07328be7b58c9a8e9d10c2379d69414ab2bfdddf99dafa8f92daf21af", + "sha512WithRSAEncryption": "ea48c9e9245bf42c820385a6167afd3a8bb473645016ff4dba198d184ee0534bbc2d0ec07328be7b58c9a8e9d10c2379d69414ab2bfdddf99dafa8f92daf21af", + "shaWithRSAEncryption": "bc1902358e12259017413b274e921088ab002429", + "ssl2-md5": "d7dd1997c20a1029f9bd0fd1e2d2ed92", + "ssl3-md5": "d7dd1997c20a1029f9bd0fd1e2d2ed92", + "ssl3-sha1": "70ffae353a5cd0f8a65a8b2746d0f16281b25ec7", + "whirlpool": "17ffcc71099ef4b28e00fecdc298482e3ee1d24ba16959807f57b3fe56bc556b898df011b98e191454e86fc21d55e62f28995a55bf08d498b645823efe380fd0" + }, + { + "input": "AAA///gAAAAAAAAAAAAAf//AA/8AAAAAAAAAf//gAAAAAAAAAAAA////////4AAAAAAAAf/+AAAAAAP///////////8AAAAAAAB////////4AAAAAAAAAA//////wAAAAAAAAAAAMAAf/////////+AAAAAAAAAAAAAD//////////AAAAAAAAf////////4AP///8AAAAAAAAAAA/////////8AAAAAAAAAAAAAH/////AAAB////////gAAAAAAAAAD///////////4AAAAAAAAP///+AAAAAAAAAAAAAB///4AAAAAA//////+AAAAAAAAH/////////gA//////////8B/////////+AAAAAAAP///////////AAAD4AAAAAAAAAAAD//////AAAAA/////AAAAAAAA///4AAAAAAAAAAAA/////////////wAAAAAA///4B////////8Af///4AAAAH/////gAAAAAAAAAAAAD///////////4AAAAAAAAAAAP///////+AAAD////////////gAAAAD//////4AAAP////8H+AAAAAAAAAAB//////4AAAAAAAAAAAH//////gAB//////////+AAAAAAAP/8AAAAAAAD/////wAAB//////8AAAAcAAAAAAAAB////wAAAAAH///wAAAAAAf//////////D/////////gAAAAAAAD////////////AAAD//+AAAAAAAAAAAAP//////wAA///gAAAAAAB//4Af///////gAAH//8AAAAAB//////8AA/////////4A//+AAAAAAAAA//////wf/////////gP///////AAAP//////4AAAAAH//////AAAAAAAAD///AD//////////AAAAAAAH///wAAAAAAA/gAAAAA////////////4AAAAP///////////AAAAAB/////+AAAAAH///8AD//gAAAAAAAAAAAAAf///4AfgAAAAAAAAAAA////+AAAAAAAAAAAAA/////4AAAAB////AAAAAAAAAB////////////4AAAAAAAAAAAAAf/////////+AAAAAAAAAH8A///gAAAAAA////////////z////////4AAAAAAAAAAP///3////////8AAAAAAAAf/////gAAD////////////+A", + "DSA": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "DSA-SHA": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "DSA-SHA1": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "DSA-SHA1-old": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "RSA-MD4": "6ecb90bbde58b881e0d8563a4652977c", + "RSA-MD5": "a986ef62ef378583985cf0d0a34d17d0", + "RSA-MDC2": "04a6b56b96ffbaae2a2b6d3721831667", + "RSA-RIPEMD160": "633b3b9afcad398dab2c70c2301ae8f6ec5f81c3", + "RSA-SHA": "4c178ac8fe2c69ac56bd81bf7cb3efb6f978e05f", + "RSA-SHA1": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "RSA-SHA1-2": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "RSA-SHA224": "618b2fbfd2b9d59db26008ab3108c6a584c194821495b1ee81d6165a", + "RSA-SHA256": "ec7435c1c8e3eb1de2871cdc797bff6969b863e5b9fb005b3a7af4ff96680c63", + "RSA-SHA384": "bcd9d31f3fb6bbb80a191a103554ab5c62774a588929dadf117c32e8361c8c9e958ae12bdcda3a2eb26bf63bcd9c3f05", + "RSA-SHA512": "5b819d5210a41d738341328814cd091220e1fc61333d13fcaa1a0447bed04d48cce66de97573d3e724be1ab18bf0757a4a1fd0b2743fccd74b5cc6d4a7040861", + "dsaEncryption": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "dsaWithSHA": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "dsaWithSHA1": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "dss1": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "ecdsa-with-SHA1": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "md4": "6ecb90bbde58b881e0d8563a4652977c", + "md4WithRSAEncryption": "6ecb90bbde58b881e0d8563a4652977c", + "md5": "a986ef62ef378583985cf0d0a34d17d0", + "md5WithRSAEncryption": "a986ef62ef378583985cf0d0a34d17d0", + "mdc2": "04a6b56b96ffbaae2a2b6d3721831667", + "mdc2WithRSA": "04a6b56b96ffbaae2a2b6d3721831667", + "ripemd": "633b3b9afcad398dab2c70c2301ae8f6ec5f81c3", + "ripemd160": "633b3b9afcad398dab2c70c2301ae8f6ec5f81c3", + "ripemd160WithRSA": "633b3b9afcad398dab2c70c2301ae8f6ec5f81c3", + "rmd160": "633b3b9afcad398dab2c70c2301ae8f6ec5f81c3", + "sha": "4c178ac8fe2c69ac56bd81bf7cb3efb6f978e05f", + "sha1": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "sha1WithRSAEncryption": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "sha224": "618b2fbfd2b9d59db26008ab3108c6a584c194821495b1ee81d6165a", + "sha224WithRSAEncryption": "618b2fbfd2b9d59db26008ab3108c6a584c194821495b1ee81d6165a", + "sha256": "ec7435c1c8e3eb1de2871cdc797bff6969b863e5b9fb005b3a7af4ff96680c63", + "sha256WithRSAEncryption": "ec7435c1c8e3eb1de2871cdc797bff6969b863e5b9fb005b3a7af4ff96680c63", + "sha384": "bcd9d31f3fb6bbb80a191a103554ab5c62774a588929dadf117c32e8361c8c9e958ae12bdcda3a2eb26bf63bcd9c3f05", + "sha384WithRSAEncryption": "bcd9d31f3fb6bbb80a191a103554ab5c62774a588929dadf117c32e8361c8c9e958ae12bdcda3a2eb26bf63bcd9c3f05", + "sha512": "5b819d5210a41d738341328814cd091220e1fc61333d13fcaa1a0447bed04d48cce66de97573d3e724be1ab18bf0757a4a1fd0b2743fccd74b5cc6d4a7040861", + "sha512WithRSAEncryption": "5b819d5210a41d738341328814cd091220e1fc61333d13fcaa1a0447bed04d48cce66de97573d3e724be1ab18bf0757a4a1fd0b2743fccd74b5cc6d4a7040861", + "shaWithRSAEncryption": "4c178ac8fe2c69ac56bd81bf7cb3efb6f978e05f", + "ssl2-md5": "a986ef62ef378583985cf0d0a34d17d0", + "ssl3-md5": "a986ef62ef378583985cf0d0a34d17d0", + "ssl3-sha1": "cc8221f2b829b8cf39646bf46888317c3eb378ea", + "whirlpool": "9897356499427e3cb27e436c1c36239f7332db9fc112b66b1b956bbddef6d5d6cf68db7d5f2cc70b4656a7668e51337e517a3e87a287e763e63b6a4e45b3b84b" + }, + { + "input": "//////////AAAAAAAAAAA///////////A4A////////////gAfwAAAAAA///////////8AAD///////////4AAAAAAAAAAAf//////////AAAAAAAAH/+AAf///8AAAAAAAA/4AAAAAAAAAAAAAA/////////////4AAAAAAAB///4AAD//////wAAAAAH//gAAAAAAAAAAAAP/wAAAAA//////gAAAAAAAAAAAB/////////////4Af/////////wH/////////////AAAAAAAAf//////////wAAAD///////gAAAAAAAAAAAAB////////gAAAAAAAAAAAAD//////////gAAAAAAD///////////gAAAAP////4AAAAAAAAAAAAf///////8Af/////////AAAAAD////////gAAAAAAAAf////+AAAAAAAAAAAAAD/wAAAAB////////wAAAAAAAAAAAAAD/////////////gAAAAAAAAAAAAB///////////wAAP8AAAP//////////AAAf/////////////4AAAAAAAAAB/////////4AAAAA//////gAA/////8H////wAAAAAAAAAAAAAf//////gAAAAAAAAAAAB////////gAAAAAAAAf//////////gAAAAAD/v/////wAAAAAAH//wAAAAAAAAAAfgAAAAA/////////wAAAAAAAAAAAP///////////gAAAAAAAAAAAAA//////////////8AIB//////////////wAAA/AAAH////////////4AAAD//////////////4AAAAAAD//////////AAAAAAD////////+AAAAAAAAAAAAAA/////gAAAAAAAAAAAAAA////////////wAAAAAAAAAB///////4AAAAf///gAAAH////8AAH8A////4AAD/8AAAAAAAAAAAAAB//8AAA////4AAAAAAAAAAAAP/P////////wAAAAAAAAAAAAD//4AAAAAAAAf///////////4AAAAAAAAAAAAf//////////8AAAAAAAAAAAAD/4AAB/////////////h////8AAAD/////////////+AAAAAAAAAAAAP//wAAAAAB///8AAAAAAAAAAAP/////////////gAAAA/////////4AAAAAAAAAAD///////////8AAAAAAAAAAAP////+H//AAAAAAAD//////8///////////4AD////////4AAAAA///////////4AAAAAAAAAAf////8AAAAAAAAAAP/8AAAAAAP//////////+AAAAAAAAAD////////////8AAAAAAAAA=", + "DSA": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "DSA-SHA": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "DSA-SHA1": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "DSA-SHA1-old": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "RSA-MD4": "186ba08380218e9ef2b308554bbe7c14", + "RSA-MD5": "ad5bef0d6ad3434f871983ed09aaa43c", + "RSA-MDC2": "45c2f961e2947b48e54a4bcf99a63135", + "RSA-RIPEMD160": "56344a47517ad21fa46d0e4a2122a09882482d0f", + "RSA-SHA": "baaabd3b735f68f1d870f08e4bb8b4a3648beea3", + "RSA-SHA1": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "RSA-SHA1-2": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "RSA-SHA224": "5f9aa4bade340615d52d74394a05f6667a3a40e930e3103021d2d3f7", + "RSA-SHA256": "e5afd502015d80bb43ab7f92f138b35ce5fafa980c5fba78412ffcfa281f9d8d", + "RSA-SHA384": "9864444f578208835858904203ce122ca1306e570a663576385ba77fb03c6c27d40790c4322f73df6c7fb876d92e82b4", + "RSA-SHA512": "c84d01e7de9caed0887563a40277c89b1c5544d821f3dfb42de262333465a5ab2d11012ace1c7eaf33cdd3a7cdd6710e7c7c645683495c71a0d1588af536b245", + "dsaEncryption": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "dsaWithSHA": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "dsaWithSHA1": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "dss1": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "ecdsa-with-SHA1": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "md4": "186ba08380218e9ef2b308554bbe7c14", + "md4WithRSAEncryption": "186ba08380218e9ef2b308554bbe7c14", + "md5": "ad5bef0d6ad3434f871983ed09aaa43c", + "md5WithRSAEncryption": "ad5bef0d6ad3434f871983ed09aaa43c", + "mdc2": "45c2f961e2947b48e54a4bcf99a63135", + "mdc2WithRSA": "45c2f961e2947b48e54a4bcf99a63135", + "ripemd": "56344a47517ad21fa46d0e4a2122a09882482d0f", + "ripemd160": "56344a47517ad21fa46d0e4a2122a09882482d0f", + "ripemd160WithRSA": "56344a47517ad21fa46d0e4a2122a09882482d0f", + "rmd160": "56344a47517ad21fa46d0e4a2122a09882482d0f", + "sha": "baaabd3b735f68f1d870f08e4bb8b4a3648beea3", + "sha1": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "sha1WithRSAEncryption": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "sha224": "5f9aa4bade340615d52d74394a05f6667a3a40e930e3103021d2d3f7", + "sha224WithRSAEncryption": "5f9aa4bade340615d52d74394a05f6667a3a40e930e3103021d2d3f7", + "sha256": "e5afd502015d80bb43ab7f92f138b35ce5fafa980c5fba78412ffcfa281f9d8d", + "sha256WithRSAEncryption": "e5afd502015d80bb43ab7f92f138b35ce5fafa980c5fba78412ffcfa281f9d8d", + "sha384": "9864444f578208835858904203ce122ca1306e570a663576385ba77fb03c6c27d40790c4322f73df6c7fb876d92e82b4", + "sha384WithRSAEncryption": "9864444f578208835858904203ce122ca1306e570a663576385ba77fb03c6c27d40790c4322f73df6c7fb876d92e82b4", + "sha512": "c84d01e7de9caed0887563a40277c89b1c5544d821f3dfb42de262333465a5ab2d11012ace1c7eaf33cdd3a7cdd6710e7c7c645683495c71a0d1588af536b245", + "sha512WithRSAEncryption": "c84d01e7de9caed0887563a40277c89b1c5544d821f3dfb42de262333465a5ab2d11012ace1c7eaf33cdd3a7cdd6710e7c7c645683495c71a0d1588af536b245", + "shaWithRSAEncryption": "baaabd3b735f68f1d870f08e4bb8b4a3648beea3", + "ssl2-md5": "ad5bef0d6ad3434f871983ed09aaa43c", + "ssl3-md5": "ad5bef0d6ad3434f871983ed09aaa43c", + "ssl3-sha1": "26accc2d6d51ff7bf3e5895588907765111bb69b", + "whirlpool": "1c5736898a3d2e2f776b4abd11a5cd37faac3b69024dcbc7d89bc395bd22bbc3bfe43d7720a9c80292e1693a15675c10b22b519a97f716d8ec6e534fd1424d03" + }, + { + "input": "///////////wAAAAAAH///////////////wAAAAAAAAf/////4AAAAAAAAAf////////wAAAA///wAA///////////gAAAAAAAf//AAAAAAAAAAAAAAP////8AAAAAAA///////////wAAAAAAAAAAH////gAB//gAAAAAAAAAAAAP///4AA////////////AAAAAAAAAAAf///////4AAAAAAAAAAAAB//+AAAAB/4AAAAAAAAAAAAgAAAAAAAAAf//////8AAAAAAAAAAAAAAf////////////gAAAB///////////////8AAAAAAAB//////////wAAAAAAAAAAA/////////+AAAAfgAAAAAAAD///////////+AAAAAAAAAB//////////8AAD////AP/////////////+D/////////wAAAAH///8AAAAAAAAAf/////+AAAAAAAH////////////4AAAAAAAAA/////8AAAAAAAAAAAAD/////////+AAAAAB//////////+AAAAAAAAAP/////8AAAAAAAAAAAAA///8AAAAA///////////wAAAAAAAAAAAf////gAAAAAAAAAAAH/////8AAAAAAAAAAAAAf//////////gAAAAAAAAAAAA///////////AAAAAAAAAYAAAAAAAA////AAAAAAAAAAAAAAAH/////////8AAAAAAP//////////8AAAAAAAf/////////wAP/////////+AAAB//////////////8AAAAAAAAAH////////gAAAAAAAAAAAf//////wAAD///AAAAAAAAAAAH/////4AAAAAAf/////////////+AAAAAAAH/AAAAAAAAAAP////////4AAAAAAAAAAAAP/////////////wAAD//8D////////////4AA////////8AAAAAAf///////////8f///4f/////////////wAAf/////////4AAAAP/gAAAAAAAAAAAAAAH///////gAAAAAAAAB////8AAAAAAAAAH////gAAAAAAf////////////4AAAAAAAAAAAP///////////////z///////+AAAAAAAAAAAAAA//////gAAAAAAAAADwAAAAAAAAAH/+f////////AAAAAAAAAAAAAAH///8AAAAAAAAAAAAAA/AAAAAAAAAAAAH////////////gAAAAAAAAAAAAAAD//////4AAAAAA///////////////4AAAAAAAAAAAAAAB//////+AAAAAAAAAf//////AAAAAAAAAAH///+AAAAH//4AAAAAAAAAAAAP/gAAAAAAAH////////////4AAAAAAAAAAAACAB/+AAAAAAAAAAAAAAA////+AA/////////8H////////+AAAAAAAAAAAAAAAf//////////gAAAAAAAAA8AAAAAAf///////AAAAAAAAAAAAAAAB8H/////////+AAAAAP/4AAAAAAAAAAAAB////w==", + "DSA": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "DSA-SHA": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "DSA-SHA1": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "DSA-SHA1-old": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "RSA-MD4": "f66f4f84a9ced1f2d4febd1ce239c816", + "RSA-MD5": "326f662a5c18a14d26c3d35131ea4b4e", + "RSA-MDC2": "ab582354a247e089782e106d748d4806", + "RSA-RIPEMD160": "8a4f9e3e3beba7eb9933c0df594e03fdacf7c036", + "RSA-SHA": "cb676e93d91e9143aa610d4121f0fe6eb4c22488", + "RSA-SHA1": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "RSA-SHA1-2": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "RSA-SHA224": "8a4b2dc13dfe760185ba69ab06645c6919b8d934d636d72a04440147", + "RSA-SHA256": "14e7975021e84497b4daf367f6861c79820308883c4e1254c038a7458a3f2913", + "RSA-SHA384": "50b57f134351a3697aec638940d2d276c288099e0e83c7b0fad435362cc68ba67436d33c2cf20be4937d7faf48ad9be3", + "RSA-SHA512": "2d1cb26c944b0560e923417441191c87afbb204702c132e100973cf555fc532a6531bbd4addaeeaff13afa629fd30126643985eec68423bf74a643a592c11565", + "dsaEncryption": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "dsaWithSHA": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "dsaWithSHA1": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "dss1": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "ecdsa-with-SHA1": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "md4": "f66f4f84a9ced1f2d4febd1ce239c816", + "md4WithRSAEncryption": "f66f4f84a9ced1f2d4febd1ce239c816", + "md5": "326f662a5c18a14d26c3d35131ea4b4e", + "md5WithRSAEncryption": "326f662a5c18a14d26c3d35131ea4b4e", + "mdc2": "ab582354a247e089782e106d748d4806", + "mdc2WithRSA": "ab582354a247e089782e106d748d4806", + "ripemd": "8a4f9e3e3beba7eb9933c0df594e03fdacf7c036", + "ripemd160": "8a4f9e3e3beba7eb9933c0df594e03fdacf7c036", + "ripemd160WithRSA": "8a4f9e3e3beba7eb9933c0df594e03fdacf7c036", + "rmd160": "8a4f9e3e3beba7eb9933c0df594e03fdacf7c036", + "sha": "cb676e93d91e9143aa610d4121f0fe6eb4c22488", + "sha1": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "sha1WithRSAEncryption": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "sha224": "8a4b2dc13dfe760185ba69ab06645c6919b8d934d636d72a04440147", + "sha224WithRSAEncryption": "8a4b2dc13dfe760185ba69ab06645c6919b8d934d636d72a04440147", + "sha256": "14e7975021e84497b4daf367f6861c79820308883c4e1254c038a7458a3f2913", + "sha256WithRSAEncryption": "14e7975021e84497b4daf367f6861c79820308883c4e1254c038a7458a3f2913", + "sha384": "50b57f134351a3697aec638940d2d276c288099e0e83c7b0fad435362cc68ba67436d33c2cf20be4937d7faf48ad9be3", + "sha384WithRSAEncryption": "50b57f134351a3697aec638940d2d276c288099e0e83c7b0fad435362cc68ba67436d33c2cf20be4937d7faf48ad9be3", + "sha512": "2d1cb26c944b0560e923417441191c87afbb204702c132e100973cf555fc532a6531bbd4addaeeaff13afa629fd30126643985eec68423bf74a643a592c11565", + "sha512WithRSAEncryption": "2d1cb26c944b0560e923417441191c87afbb204702c132e100973cf555fc532a6531bbd4addaeeaff13afa629fd30126643985eec68423bf74a643a592c11565", + "shaWithRSAEncryption": "cb676e93d91e9143aa610d4121f0fe6eb4c22488", + "ssl2-md5": "326f662a5c18a14d26c3d35131ea4b4e", + "ssl3-md5": "326f662a5c18a14d26c3d35131ea4b4e", + "ssl3-sha1": "01072915b8e868d9b28e759cf2bc1aea4bb92165", + "whirlpool": "28f60df89966e84403fc099550f22c39b2377bf36583f5f63a1bbbdd5909849725d750ca02cf15276f4a0f71fb05583f1bd8546d2352df478451a24838cbcc62" + }, + { + "input": "/////+AAAAH/wH//+A//+OAAAAB//////////////8AB//////////8AAAAAAAAA///////////AAAAAAAAAAH///gAAAAAAAAAAAAB//4AAAAD////////+AAAAAAAAAf////////////AAAAAAAAAAAAAAAf//////////////wAAAAAAAAAAAf////////////////AAf+AAAAAAAAAAAAAA////////////////+AAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAAA////////////////wAAAAAAAAAAAAAAH/////AAP//8AAAAAAAD/////Af/////////+AAAAD//////AAAAAB////D///////////////4AAAP/////f/////////////wAAAAAAAAAAAAB///8AAAAB///////////////+AAAAAAAAAAAD/////////////8AAAAAAAA//4AAAAAAAAAAAAD///////4AAAD////////gAAAAAAD/////4AAAAAAAAAAH//8AAAAAAAAAB/////////+AP////4AAAAAAAAAAAAAAA//////////8AAAAAAAAAAAP////wAAAAAAP/////////////8AAAAAAAAEAAAAAAAAAAAH///////gAAAAAAf//+AAAAAAf///////////////gB////////////////wAAAAA////////////8AAAA/////////gAAAAAAAAAAAP/////////+AAAAAAAAAAP///////////////4AAAP//////////////8AAAAAAAAAAAAAf/////////+AAAAAAAEAAAAD////+AAAAAD//////////////AAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAH//////////////AAD/////+AAAAAAAAAAAP/////////////wAAAAAAAAAAAAAAA//////////AAAAAAAAAAAAAAAADgAAAAAAA////////8A///////////+AAAAAAAAAAAAAAP////////+AAAAD////////////wAAAAAAH//4AAAAAAA///////8AAf//////////AA///////wAAAAAAP//////////wAAAAAAAAAP/+AAAAAAAAAAAf//wAAAAAAAAA//////4AAAAAAAAAB////////////4A///////////////wAAAAAAAAAAAAAAAAf////////8AAAAA8AAAAAP/+AAAAAAD//////////AAAAAP//////////////gAAAAAAAAAAA///////gAAAAA/////gAAAAAA///4AAP/////////////AAAAAH///////////////4AAAA//////////wAAAAf////////////+AAAAAAAAAP///////AAAAAAAAAAP/+AAAB////////////////wAAAAAH/////////////wAAAAAA////////8AAAAAAAP////////8AAAAAAAAAAAAA////////////////x///////////////AAAAAAAAAAAAPwAAAB/AAAAAAAAAD///////////////wA//////+AAAAAAAAAAAAA////////////////gAAAAAAAAAAAAAf////////////AAAAAAAAAAAAP///8AAAAAAAAAAAAAAAAf/////", + "DSA": "3016115711d74236adf0c371e47992f87a428598", + "DSA-SHA": "3016115711d74236adf0c371e47992f87a428598", + "DSA-SHA1": "3016115711d74236adf0c371e47992f87a428598", + "DSA-SHA1-old": "3016115711d74236adf0c371e47992f87a428598", + "RSA-MD4": "6e59773936f6ed4d2521df5e5820af99", + "RSA-MD5": "ea4bf919aebf4add0024d91ee6f640d0", + "RSA-MDC2": "cc0675741035972e9408f0c8014d4698", + "RSA-RIPEMD160": "49bfa2fd9617bf2f07863be95c2a94acc79714a3", + "RSA-SHA": "050f17b5616fa86a20be65244fbce0f93f705543", + "RSA-SHA1": "3016115711d74236adf0c371e47992f87a428598", + "RSA-SHA1-2": "3016115711d74236adf0c371e47992f87a428598", + "RSA-SHA224": "2d9e5e1f6a6b788c32cf2b05300e1656b89ea77364dc584734b2a1ed", + "RSA-SHA256": "bcefd79629a6d7a8afbf0c8ccfc2c5889f627989e71c3a212d900e3015e460fa", + "RSA-SHA384": "6b6963c749d0c8ebd14884e2626edc056e5fe9f299211a7c1034338db1de9842c28842cf55f736f849bbe65275112353", + "RSA-SHA512": "7122401afdd5b9c033e721b0c6f321742ced26b680d80f55f1dfc6d0916e9fd96fab18752fa60a4f20b570ed8ede6688f151fd9bc18828ac99cb7afed54c787d", + "dsaEncryption": "3016115711d74236adf0c371e47992f87a428598", + "dsaWithSHA": "3016115711d74236adf0c371e47992f87a428598", + "dsaWithSHA1": "3016115711d74236adf0c371e47992f87a428598", + "dss1": "3016115711d74236adf0c371e47992f87a428598", + "ecdsa-with-SHA1": "3016115711d74236adf0c371e47992f87a428598", + "md4": "6e59773936f6ed4d2521df5e5820af99", + "md4WithRSAEncryption": "6e59773936f6ed4d2521df5e5820af99", + "md5": "ea4bf919aebf4add0024d91ee6f640d0", + "md5WithRSAEncryption": "ea4bf919aebf4add0024d91ee6f640d0", + "mdc2": "cc0675741035972e9408f0c8014d4698", + "mdc2WithRSA": "cc0675741035972e9408f0c8014d4698", + "ripemd": "49bfa2fd9617bf2f07863be95c2a94acc79714a3", + "ripemd160": "49bfa2fd9617bf2f07863be95c2a94acc79714a3", + "ripemd160WithRSA": "49bfa2fd9617bf2f07863be95c2a94acc79714a3", + "rmd160": "49bfa2fd9617bf2f07863be95c2a94acc79714a3", + "sha": "050f17b5616fa86a20be65244fbce0f93f705543", + "sha1": "3016115711d74236adf0c371e47992f87a428598", + "sha1WithRSAEncryption": "3016115711d74236adf0c371e47992f87a428598", + "sha224": "2d9e5e1f6a6b788c32cf2b05300e1656b89ea77364dc584734b2a1ed", + "sha224WithRSAEncryption": "2d9e5e1f6a6b788c32cf2b05300e1656b89ea77364dc584734b2a1ed", + "sha256": "bcefd79629a6d7a8afbf0c8ccfc2c5889f627989e71c3a212d900e3015e460fa", + "sha256WithRSAEncryption": "bcefd79629a6d7a8afbf0c8ccfc2c5889f627989e71c3a212d900e3015e460fa", + "sha384": "6b6963c749d0c8ebd14884e2626edc056e5fe9f299211a7c1034338db1de9842c28842cf55f736f849bbe65275112353", + "sha384WithRSAEncryption": "6b6963c749d0c8ebd14884e2626edc056e5fe9f299211a7c1034338db1de9842c28842cf55f736f849bbe65275112353", + "sha512": "7122401afdd5b9c033e721b0c6f321742ced26b680d80f55f1dfc6d0916e9fd96fab18752fa60a4f20b570ed8ede6688f151fd9bc18828ac99cb7afed54c787d", + "sha512WithRSAEncryption": "7122401afdd5b9c033e721b0c6f321742ced26b680d80f55f1dfc6d0916e9fd96fab18752fa60a4f20b570ed8ede6688f151fd9bc18828ac99cb7afed54c787d", + "shaWithRSAEncryption": "050f17b5616fa86a20be65244fbce0f93f705543", + "ssl2-md5": "ea4bf919aebf4add0024d91ee6f640d0", + "ssl3-md5": "ea4bf919aebf4add0024d91ee6f640d0", + "ssl3-sha1": "3016115711d74236adf0c371e47992f87a428598", + "whirlpool": "99b23099d11571e575c7f47638986d0526f7e99f13aef9903da6588ca018fcf736f1d46af8ad1dbf92ee824ffdcaa72e8fd884645f9d934d89c107611fce958a" + }, + { + "input": "////wAAAAAAAAAAAAAAAAf//AAAAAAAAAAAAAAAf//////8AAAAAAAAAAAAAAAB/////////////gAAAAAAAAA/////////////////AAAAA///////////w//////////////gDwAAAAAB//4AAH/////////////8AAAAAAAAAAAP/gAAAAAAAAAAAAAD//////////AAAAAAAAAAAA/////////////AAAAAAOAAAAAAD////////4AAAAAAAAAAAAAf////////////+AAAAAD//8AB///////////////4AAAAAAAAAAf///////+AAAAAAP////////////gAAAAAAAAA////wB//////////8AAAAAAAP//////////AAAAAAAAAAAAAAAAP////8AAAAH/////////////+AAAAAAAAAAAAA//8AAAAAAAAAAf////////gAAAAAAAAAAAB/////////gAAAAAAAAAAAAAAAH//gAAAAAAAAAAAAAAAH////////////4AAAf///////////gAAAAD////////////////+AAAAAAAAAAAAAAAAAf///////+AAAAAAAAAAAAAB/+AAAAAAAAAAD//gAAAAAAAAAAAAAP////////////////gAAAAAAAAAAAAAAAP/////////////wAAAAH////////AAAAP////////////////AAAAAAAAAAAAAAAAD//////AAAAAAAAAAAAAP/5////////////+A////AAAAAAAP/////////////wAAAAAAAAAAAAAAAAH////Af///+AAH/////AAAAAAAAAAAAAAAAH///8AAAAAAAAAAAAAAAAB////////+AAf//////gAAAAAAAAAH//////////////AAAAAAAAAAAAAAAP///+AAAH//////4P////////AAAAAAAAAAAAAAAAD/////////////8AAAAAAAAAAAB///////////+AAAAAAAAAAP///wAAAAAAAP////////8AAAAAAAAP///g//+AAAAAAAAAAAAH////9///////////////8AAAAAAAAAP//////4AAAAAAAAAH///////+AAAAAAAAAAf////gAAA/////+AAAAAAAAAAAAA///wAAAAAcAAAAAAAAAAAD/////AAAAAAAH////////AAAAAAAAAAAAAAH//////wAAAAAAAAAAAAAP///+AAAAAAAAAAAAA////////////+AAAAAAAAAAAH////////////////4AA/////////AAH////////////////gH////////gAAAAAAAAAAD/////////////////j////8AAAAAAAAAAAAAD//////8AAAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAA///////////4AAAAAAAAAAAB///+AAAAAP//////wAAAAAAAAAAAAAAAHgAAAAAH////////////////AAAAAAAAAAAAAAAAAD/+AAAAAAAAAAAAAAAPwAAAAAAAAAAAAAAAAA////////////wAAAAAAAAAAAAAAAA/////////AAAAAAAH///AAAAAAAAAB/////////gAAAAAP+AAAAAAAAf////4AAAAAAAAAAAA/////////////gAAAAP////////////gD/////////+/wAAAAAAAAAAD8AAAAAAAAAD/////////////gP////////////////AAAAAAAAAAAAAAAAH/+AAAAAAAAAA////////AAAAf///////////wAAAD///////////wAAAAAAAAAAAP///////////////AAAAAA=", + "DSA": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "DSA-SHA": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "DSA-SHA1": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "DSA-SHA1-old": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "RSA-MD4": "8b7bd763f7980fd430532ab2a5d50707", + "RSA-MD5": "9cc49e156084d2c757bd6d502bae8309", + "RSA-MDC2": "d9c43ac3b915b21078db14eef969f00f", + "RSA-RIPEMD160": "e0d1b5b74ae15a0d9fc58235fbbba2ff51e94ca0", + "RSA-SHA": "7ecb5f079615c156e602f2f05e8c104206d305fa", + "RSA-SHA1": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "RSA-SHA1-2": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "RSA-SHA224": "6a4ab46af2b9fe5a8259df41a1448c9b093b837da7aceb968922bfde", + "RSA-SHA256": "74661206cb19ec00619e1fcdcae443486adfa69a564672c9ee9f48f8ea35d5b2", + "RSA-SHA384": "41365242333e728f87a9c7426509e78ef096d2d742a2021a7fc0393008f6180af62011cb169662b7d52d5137284eb51c", + "RSA-SHA512": "9875b0bad0a3a1d841e6294559109d5717742a6566717a6f04ee18a34fa66100143695db036a2e1ef22f370487c6c23b6386c0f1eba1e1d1c348564dfffa7598", + "dsaEncryption": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "dsaWithSHA": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "dsaWithSHA1": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "dss1": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "ecdsa-with-SHA1": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "md4": "8b7bd763f7980fd430532ab2a5d50707", + "md4WithRSAEncryption": "8b7bd763f7980fd430532ab2a5d50707", + "md5": "9cc49e156084d2c757bd6d502bae8309", + "md5WithRSAEncryption": "9cc49e156084d2c757bd6d502bae8309", + "mdc2": "d9c43ac3b915b21078db14eef969f00f", + "mdc2WithRSA": "d9c43ac3b915b21078db14eef969f00f", + "ripemd": "e0d1b5b74ae15a0d9fc58235fbbba2ff51e94ca0", + "ripemd160": "e0d1b5b74ae15a0d9fc58235fbbba2ff51e94ca0", + "ripemd160WithRSA": "e0d1b5b74ae15a0d9fc58235fbbba2ff51e94ca0", + "rmd160": "e0d1b5b74ae15a0d9fc58235fbbba2ff51e94ca0", + "sha": "7ecb5f079615c156e602f2f05e8c104206d305fa", + "sha1": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "sha1WithRSAEncryption": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "sha224": "6a4ab46af2b9fe5a8259df41a1448c9b093b837da7aceb968922bfde", + "sha224WithRSAEncryption": "6a4ab46af2b9fe5a8259df41a1448c9b093b837da7aceb968922bfde", + "sha256": "74661206cb19ec00619e1fcdcae443486adfa69a564672c9ee9f48f8ea35d5b2", + "sha256WithRSAEncryption": "74661206cb19ec00619e1fcdcae443486adfa69a564672c9ee9f48f8ea35d5b2", + "sha384": "41365242333e728f87a9c7426509e78ef096d2d742a2021a7fc0393008f6180af62011cb169662b7d52d5137284eb51c", + "sha384WithRSAEncryption": "41365242333e728f87a9c7426509e78ef096d2d742a2021a7fc0393008f6180af62011cb169662b7d52d5137284eb51c", + "sha512": "9875b0bad0a3a1d841e6294559109d5717742a6566717a6f04ee18a34fa66100143695db036a2e1ef22f370487c6c23b6386c0f1eba1e1d1c348564dfffa7598", + "sha512WithRSAEncryption": "9875b0bad0a3a1d841e6294559109d5717742a6566717a6f04ee18a34fa66100143695db036a2e1ef22f370487c6c23b6386c0f1eba1e1d1c348564dfffa7598", + "shaWithRSAEncryption": "7ecb5f079615c156e602f2f05e8c104206d305fa", + "ssl2-md5": "9cc49e156084d2c757bd6d502bae8309", + "ssl3-md5": "9cc49e156084d2c757bd6d502bae8309", + "ssl3-sha1": "bf30417999c1368f008c1f19feca4d18a5e1c3c9", + "whirlpool": "a6124c1d99eadcbadf10c592ee0342c59a6d7b895e3dd4e422bb12901d2aa02951736a58fb42505bde547a0dd60de3ed53ff73aa5fe2a5bf0b120cab9ae02984" + }, + { + "input": "AB////////////////gAAAAAAAAAAAAAAAAAH//////////////gAAAAA//////////////////wAAAAAf/////////+AAAAAAAA//////////////8AAAAAAAAAAAAAAAf///+AAAAAAAAAAAAAA/AAAAAAAAAAAAA//////////+AAAAAAAAAAAAAAB////////4AAAH///////////////8AAAAAAAAf/////8AAAAAAAAf/////////AAABH///////8AAAAAf/AAAAAAAAAAAAA////4AAAAAP////////4AAAAAAAAAAfAAAAAAAAAAAAAAAAA8AAAAAAAAAAAP///4AAAAAAAAB/////////4AAAAAB//////////+AD////+AAAAAAAAAAAAAAAB//////////+AAAAAAAAAAAAAAAAAf/////////AAAAAAB//////////////gAAAAAAAAB////8AAAAAAAAAAAAB//////8AAAAAAP///////////wAAAAAAAB/+AAAAAAAAAAAAAAAf////+AAAAAAAAH//////+AAAAAAAAAAAP////////////////8AAAf///////////////wAAAAAAAAAAAAAAf///////////////gAAAAAAAf//8P/////////4AAAAAAf///+AAAAAAAAAAA/////8AAAH/////////////8AAAAAAA///8AAAAAAAAAA////////8AAAAAf/////////////gAAA/////AAAAAAAAAAAAf///////////4f////////////wAP////////////+AAAAAAAD/////////////AAAAAAAAB///////8AAAAAAAAAAAAAAH//////gAAP////////////8AAAAAAAAAA/////8AAAAAAAAAB////8AAAAAAH///////////////wAAAAAAEAAAAAAAAAAAP/////////+AAAAAAAAA////////+AAB///AAf///////gB///AAAAAAAAAAAAAAB////////D////////wAAAAAAAAf////////4AAAAAAAAAAAAf+Af////////////////4AAAAAAAAAAAAP/+AAAAH/////+AAAAAAAAAAAAP/////////////////4//////////////gAAAAAAAAAAAAAAf4AAAAAAf4AAAAAAAAAAAAAAA///////////////AAAAAAAf/////8AA//////////AAB/////+AAAAAAAAAAAAB/////////gAAAAAAAAAAAAAAAAD/////////////AAAAAB////////////wAAAAAP/////////AAAAAAAAAAAAAD////////AAAAAAAAAAAAAAAAD////////////////AAAAAAAH///////////+AA///////////AAAAAAAAAAAAAAAB///////////+AAAAAAAAAAAD///////////////4AAAAAf/4AAAAAAAAAAAAAAAB///////////+AAAAAP/////8AAAAAB////////4H/+AAAAAAAAAAAAAAAAAD/////////4////+AAAAAAAAAA///////////gAAAAAAAAAAAAAAAH//////////////+D///////////////gAA////////////////wAAAAAP/////////////+AAAAAAD////////////gAAAAAAAAAAA/////////4AAAAAAAAAAAAAAf//AAAAf//////////////wAAAAAAAAAAAAAOAAAAAAAAAH//+AAAAAAAAAAAAAAAf//////////8AAAAAAAAf///////4AAAAAH////8AA////gAAf////gAAQAAAAAAf////////////////4AAAAH/////////////gAAAAAAAAA//////////////4AAAAAAAAAAAf////+AAAAAAAAAAAAAAAB////4AAAAAAAP/////////8AAAAAAAAAAAAAf////////////////wAAAAAAAA==", + "DSA": "62ba49087185f2742c26e1c1f4844112178bf673", + "DSA-SHA": "62ba49087185f2742c26e1c1f4844112178bf673", + "DSA-SHA1": "62ba49087185f2742c26e1c1f4844112178bf673", + "DSA-SHA1-old": "62ba49087185f2742c26e1c1f4844112178bf673", + "RSA-MD4": "cd5d1cf8469ba52621ba4052e7f483f0", + "RSA-MD5": "9c18d4c75cc02337c277532ecea4b9fa", + "RSA-MDC2": "bc3bdc0b53caaa42dd38ebeba670f8f1", + "RSA-RIPEMD160": "539a5bced487507bdcdb2b1dee44b0306ee16813", + "RSA-SHA": "823202f9d7d999256a346fcf29c5ea4111310ec4", + "RSA-SHA1": "62ba49087185f2742c26e1c1f4844112178bf673", + "RSA-SHA1-2": "62ba49087185f2742c26e1c1f4844112178bf673", + "RSA-SHA224": "1889664dcf226dbb7d75965f0cde9487586956119d368c18ca3a4e14", + "RSA-SHA256": "341bf4dff841088f3b902c2471b67b49498bda5c045e9befd58af93ade0a8df8", + "RSA-SHA384": "cf15c1d2c91b93a2e10f664d1bcca36c6fc2e2ae819609a131d4eb86d51a66cfacf8b2d37afd6aaa539b1cd63bac1a13", + "RSA-SHA512": "3bfeab5bee92507591f21f757765c8c09e1241812f8e51c200f6bc5703f7e15f057d9378f59fd4d50410e68b2451681df70c9c3bcb2be17fa80f2362284e31ff", + "dsaEncryption": "62ba49087185f2742c26e1c1f4844112178bf673", + "dsaWithSHA": "62ba49087185f2742c26e1c1f4844112178bf673", + "dsaWithSHA1": "62ba49087185f2742c26e1c1f4844112178bf673", + "dss1": "62ba49087185f2742c26e1c1f4844112178bf673", + "ecdsa-with-SHA1": "62ba49087185f2742c26e1c1f4844112178bf673", + "md4": "cd5d1cf8469ba52621ba4052e7f483f0", + "md4WithRSAEncryption": "cd5d1cf8469ba52621ba4052e7f483f0", + "md5": "9c18d4c75cc02337c277532ecea4b9fa", + "md5WithRSAEncryption": "9c18d4c75cc02337c277532ecea4b9fa", + "mdc2": "bc3bdc0b53caaa42dd38ebeba670f8f1", + "mdc2WithRSA": "bc3bdc0b53caaa42dd38ebeba670f8f1", + "ripemd": "539a5bced487507bdcdb2b1dee44b0306ee16813", + "ripemd160": "539a5bced487507bdcdb2b1dee44b0306ee16813", + "ripemd160WithRSA": "539a5bced487507bdcdb2b1dee44b0306ee16813", + "rmd160": "539a5bced487507bdcdb2b1dee44b0306ee16813", + "sha": "823202f9d7d999256a346fcf29c5ea4111310ec4", + "sha1": "62ba49087185f2742c26e1c1f4844112178bf673", + "sha1WithRSAEncryption": "62ba49087185f2742c26e1c1f4844112178bf673", + "sha224": "1889664dcf226dbb7d75965f0cde9487586956119d368c18ca3a4e14", + "sha224WithRSAEncryption": "1889664dcf226dbb7d75965f0cde9487586956119d368c18ca3a4e14", + "sha256": "341bf4dff841088f3b902c2471b67b49498bda5c045e9befd58af93ade0a8df8", + "sha256WithRSAEncryption": "341bf4dff841088f3b902c2471b67b49498bda5c045e9befd58af93ade0a8df8", + "sha384": "cf15c1d2c91b93a2e10f664d1bcca36c6fc2e2ae819609a131d4eb86d51a66cfacf8b2d37afd6aaa539b1cd63bac1a13", + "sha384WithRSAEncryption": "cf15c1d2c91b93a2e10f664d1bcca36c6fc2e2ae819609a131d4eb86d51a66cfacf8b2d37afd6aaa539b1cd63bac1a13", + "sha512": "3bfeab5bee92507591f21f757765c8c09e1241812f8e51c200f6bc5703f7e15f057d9378f59fd4d50410e68b2451681df70c9c3bcb2be17fa80f2362284e31ff", + "sha512WithRSAEncryption": "3bfeab5bee92507591f21f757765c8c09e1241812f8e51c200f6bc5703f7e15f057d9378f59fd4d50410e68b2451681df70c9c3bcb2be17fa80f2362284e31ff", + "shaWithRSAEncryption": "823202f9d7d999256a346fcf29c5ea4111310ec4", + "ssl2-md5": "9c18d4c75cc02337c277532ecea4b9fa", + "ssl3-md5": "9c18d4c75cc02337c277532ecea4b9fa", + "ssl3-sha1": "62ba49087185f2742c26e1c1f4844112178bf673", + "whirlpool": "1147a4ae7ce95023090770d52a0c4e6bd0402547ef3069c451202f3266efef5e8b278e509c9571878cf2cbe9491367ed7315d52240bbd5c83ade80bdf57487b5" + }, + { + "input": "//////////4AAAAAAAAAAAAAAH/////////////////4AAAAAAAAAAAAAAAAAH////////////////4AAAAAAAAAAf////////////+AAAAAAAAAAAAAAHgAAAAAAAAAAAAAAAAAD////////////wAAAAAAAAAAAAAAAH///v/////////////////wAAAAAAf////+AAAAAAAAAAAAAAA/////4AAB////AAAA////wD/////////////4AP////4D/////////////+AAAAAAAAAAAAAAAAAA/////////////////8P////////////////+AAAAAAAAAAAAAA///////////wAAAA/////4AAAAAAAAAAAAAAAA////////+Af/+AB/8AAAAAAAAAAAA//+AAAAAAAAAAAAAD//////////8AAAAAAAAAAAP//AAAAA/4AAAAAAAAAAD///////////AAAAAD///8AAAAAAAAAAAAAf///////AAAAAAAAAAAAAAAP///////////wAAAAAAAf/////wAAAAB//////gAAAAAAAAAAAAAAH//wD////wAAAAAAAAAAAAAA///8AAAAAAAAAA///////////4AAAAB//////////////8AAAAAAAAAAAAcAAAAAAAAAAAD///////////////8AAAAAAAAAAAAAB//AAAAAAAAAAAAAAAAAH///4AAAAAB//////AAAAAAAAAAAAAAAD//////////////////+AAAAAAAAAAAAAD///////////8AAAAAAAAAAAAAAAAAD//////////////////8AAAD///////////////gAAAAAAAAAAAB/////////////////AAAAAAAAAA////////////////4AAAAAAAAAAAAAAAAH/AAAAAAAf+AAAAAAAAAD///////////////4AAAAAAAf////8AAAAAAAAAAAAAAAf/8AAAA///////////4AAAAAABgAAAAAAAAAAAAAH/////////////////wAAAAAAAAH///////AAAAAAAAAAf//////////AAAAAAAAAAAAAAAP//////////wB/////////AAAAAAH///////////gAAAAAAAAAAAAA////+AAAAAAAAAAAAAAAAf//////////wAH//////////////////AAH//+AAAAA//////////wDAAAAAAAAH//+AAA/////4AAAAAAB//gAAAAAAAAAAAAAAAAAAP///////////gAAAAAAAAAAAAAAAAAB////////////////AD//////4AAAAf////////AAAAAAAAH///+AAAAAAAAAP/+AAAAAAf///////////////4AAAAAAAAD/////////////////wAAA/////////wAAAAH///////+AAAAAAAAAAAAAAAD/////////////////4AAAAAAAAAAAAAAAAAB/////////////+AAAAAAAAAAAH/gAAAAAAAAAAAAAAAAAf///////////////gAAAAAAAAAAAP////////////////AAAAf/////gAAAAAAAAP//////////////AAAAAAAAAAAB//////////wAAAAAAAAAAAAAAAP////wAAAAAAAAAAAAAAP///////////////wAAAAAAAAAAAAH///gP////wAAAf///+AAAAAAAAAD//////////////4B////////wAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAA/////8AAD//////+AAAAAAAAAAD////////////////AAAAAAAAAAAAAAAAAP/////////////////gAAAAAAAP4AAAAAAAAAAAAD///////////4B/////////wAAB////8AAAAAAAAAAAAAwAAAAAAAAAAAD////////////8AAAAAAA/////////4A//////////gAAB//AAAAAAAAAAAP////////AAAAAAAAAAAAAAAf///////////4AAAAAAAAAAAAAAAB///////AAAAA/////////8AAAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAD///////////8AAAAAAAAAAAAAAAAD////////////wAAAAAAP///////////////+AAAAAAAAAA", + "DSA": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "DSA-SHA": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "DSA-SHA1": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "DSA-SHA1-old": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "RSA-MD4": "b1c6f2c5bc7d0c12668ce471a6535775", + "RSA-MD5": "4159a65b7db275742e998fb855e7b9f3", + "RSA-MDC2": "b805fda09ca1a1ea301019916a4cd4fb", + "RSA-RIPEMD160": "983e60f73a95406387b3cde76b785a1ba48f2d46", + "RSA-SHA": "98928984b28f3095736ba953010b4f7209f0e7fa", + "RSA-SHA1": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "RSA-SHA1-2": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "RSA-SHA224": "6e6ecfc06a7ca207f0e8bc455da5861ba83f7467e3c4a789f97b80a5", + "RSA-SHA256": "e5239ecec9ea7737f614ebab502df1248c0a9a0183fc70441fd9ac88040846ce", + "RSA-SHA384": "b971825991214be8f94fda522823c7ca5eaca06a2283d562749f3bb7c9ddd300f8f108ad2d02785f8fa5e7cf952ba955", + "RSA-SHA512": "7d701e5945751e112f57304fecd6be22e60b85367b14df5b79514ea731d5183f563212fa4ba3ac148b0e96617ab2fc2d9d2b32ff675b8a8344f9c8c102c80896", + "dsaEncryption": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "dsaWithSHA": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "dsaWithSHA1": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "dss1": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "ecdsa-with-SHA1": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "md4": "b1c6f2c5bc7d0c12668ce471a6535775", + "md4WithRSAEncryption": "b1c6f2c5bc7d0c12668ce471a6535775", + "md5": "4159a65b7db275742e998fb855e7b9f3", + "md5WithRSAEncryption": "4159a65b7db275742e998fb855e7b9f3", + "mdc2": "b805fda09ca1a1ea301019916a4cd4fb", + "mdc2WithRSA": "b805fda09ca1a1ea301019916a4cd4fb", + "ripemd": "983e60f73a95406387b3cde76b785a1ba48f2d46", + "ripemd160": "983e60f73a95406387b3cde76b785a1ba48f2d46", + "ripemd160WithRSA": "983e60f73a95406387b3cde76b785a1ba48f2d46", + "rmd160": "983e60f73a95406387b3cde76b785a1ba48f2d46", + "sha": "98928984b28f3095736ba953010b4f7209f0e7fa", + "sha1": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "sha1WithRSAEncryption": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "sha224": "6e6ecfc06a7ca207f0e8bc455da5861ba83f7467e3c4a789f97b80a5", + "sha224WithRSAEncryption": "6e6ecfc06a7ca207f0e8bc455da5861ba83f7467e3c4a789f97b80a5", + "sha256": "e5239ecec9ea7737f614ebab502df1248c0a9a0183fc70441fd9ac88040846ce", + "sha256WithRSAEncryption": "e5239ecec9ea7737f614ebab502df1248c0a9a0183fc70441fd9ac88040846ce", + "sha384": "b971825991214be8f94fda522823c7ca5eaca06a2283d562749f3bb7c9ddd300f8f108ad2d02785f8fa5e7cf952ba955", + "sha384WithRSAEncryption": "b971825991214be8f94fda522823c7ca5eaca06a2283d562749f3bb7c9ddd300f8f108ad2d02785f8fa5e7cf952ba955", + "sha512": "7d701e5945751e112f57304fecd6be22e60b85367b14df5b79514ea731d5183f563212fa4ba3ac148b0e96617ab2fc2d9d2b32ff675b8a8344f9c8c102c80896", + "sha512WithRSAEncryption": "7d701e5945751e112f57304fecd6be22e60b85367b14df5b79514ea731d5183f563212fa4ba3ac148b0e96617ab2fc2d9d2b32ff675b8a8344f9c8c102c80896", + "shaWithRSAEncryption": "98928984b28f3095736ba953010b4f7209f0e7fa", + "ssl2-md5": "4159a65b7db275742e998fb855e7b9f3", + "ssl3-md5": "4159a65b7db275742e998fb855e7b9f3", + "ssl3-sha1": "e1f6b9536f384dd3098285bbfd495a474140dc5a", + "whirlpool": "e326e40eb521915d515149e43492af5896153bf01c24c573349ff642128030ebfae924fc88244a14ad5090d71f66f556f70c93c847a4edb3f446bea72b4097c6" + }, + { + "input": "AAAAH///////////////////AAAAAAAH///////////////////wAAAAAAAAAAAADAAAAAAAAAB////////4B////////////4AAB///////////////4AAAAAAAAAAAAAAAAH///////////AAAAAAAAAAAAAAAA///////AAAAAAAD/////////////////wAAAAAAAAAAH/AAAAAAAAAAAAAAAAAAP//////////////gAAAAAAAAAAA///////////4AAAAAf////wAB//////////////AAD////4AAAAAAAAAAAAAAAAf////////////+AAAAAA//////////wAAAAAAAAAAD///////////////4AAAAAAAAAAAAAAAAAH//////+AAAD//////////////////8AAAAAP/////wAAAAAAAAD///////////////gA/////AAAAAAAAAAAAAAAA//AAAAAf//////////wAD//////////////////8AA///////////AAAAAAAAAAAD////8AAAAAAAAAAAAAf//////+AAAAAAAAD///////////////////4AAAAAAAAAAAAAD8AAAAAAAAAAAAAAAAA///////+AAAAAAAAAAAAAAAf///////////gAAAAAAAAAAB8AAAAAAAAAAAP/+AAAAAAAAAAAAAAAAAAA///////////wAAAAAAAAAAAAAAAAB/////wAAAAAAAAAAAAAAAH/8AAAAAAAAAAAAAB/////////////////4AB//////////AAAAB///4AAAAAAAAAAAAAB///////wAAAAAAAAB///////////wAAAAAAAAAAAAAAH/////+AAAAAAf///+AAAAAAAAAAB//AAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAA4AA+AAAAAAAAAAAAAAAAAAD//////AAAB//////////g//////////+AAAAAAAAAAAAAAAH/////////////////wAAAAAAAAAAAH////////////////+AAAAAA///////+AAAAAAAAAAAAAAAAB///////////////////x////////////+AAAAAD+AAAAAAAAAAAAAAAD/////////AAAAAAAAAAAAA///////4AAAAAAAAf///+AAAAAAAH//////8AAAAAB/////gAAAAAAAA///gAAAAAAAAP////gAAAAAAA////////////////gAAAAAAAAAAAB///////////////////AAAAAAAAAAAAAB///////////8AH///////AAAAAAAAAAP///////////4AAAAAAAAAAAAAAAA///////////////////z///8AAAAAAAAAAAAAAAAAAA/gAAAB//////8////+AAAAAA////////8AAAHwAAAAAAAAAAAAAAAAAAA/////////////gAAAAP////////+AAAAAAAAAAAAAAD/////////+AAAB////////////////8AAAAAAAAAAAAD////////AAAAAAAAAAAAAAAH///////////8AAAAAAH8AAAAAf//////8AAAAAAAH///7///////8AAAAAAAAAAAB/////+P///4AAAAAAAAAAAAAA///////8AAAAP/////////////////wAAAAAAAAP//////////8AAAAAAAAH//////////8AAAAAAAAAAAAAAAAAAAH////gAAAAAf//////////////////+AAAAAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAB////wAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAA//////////////v/////////+AAAAAAP///////////////4AAAAAAAAAAAP///////////8AAAAAAAAAAAAf///////////+AH///////8AD////////////+AD////////AAAAAAAAAAAAAAAAAf//////////////////+AAAAAAAAAAAAAAAH///////////////////AAAAAAAAAAAAAAAAAAAD/////+AAAAP/wAAAAAAAAAAAAAAA//////////AAAAD////////gAAAAAAA/////////////8AAAAAAAAAAAAAAAAAA//+AAP////////////////+AAAD////////wAAAAAAH/4AAA///8AAAAAAAAAAAAAf//////AA////////////wAAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAAAAAP//////////////////+AAAAAAAAAAAAAAAAf//////////w///////////4AAAAAAAAAAAAAA=", + "DSA": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "DSA-SHA": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "DSA-SHA1": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "DSA-SHA1-old": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "RSA-MD4": "6731fed7311b993f725548d477117da9", + "RSA-MD5": "df34d37f6b4ef078bd9570efdd8fd2e2", + "RSA-MDC2": "a4fed7363add791b3c3139a2ef4389db", + "RSA-RIPEMD160": "7dd8c9666ce02b878e57e9ba4d01f5aa5d84627b", + "RSA-SHA": "30114eff874ec1e22a517764247e54c23f0881e4", + "RSA-SHA1": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "RSA-SHA1-2": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "RSA-SHA224": "8551ca25febf9b10a58efec1f72bafc0050ec6d2c7727a5db3ccde7c", + "RSA-SHA256": "58e09b4047770bc998b86a4191b7a11eec6fc65bd5e5d0fb6f30d4b7ee0cd683", + "RSA-SHA384": "d5daa8f149b51e36e56d8b9955fb49bec8d77fb2fd2231d46358c044b1321eb9f62d88a94d3496177d303869844963f9", + "RSA-SHA512": "bd274fcdd48554e5406076d795e5029945d23894ffa4da150a203b8caaccf3fc8dabf8177995c7965822f920c62574b4f65216f3d807b5bb766843ced496343d", + "dsaEncryption": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "dsaWithSHA": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "dsaWithSHA1": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "dss1": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "ecdsa-with-SHA1": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "md4": "6731fed7311b993f725548d477117da9", + "md4WithRSAEncryption": "6731fed7311b993f725548d477117da9", + "md5": "df34d37f6b4ef078bd9570efdd8fd2e2", + "md5WithRSAEncryption": "df34d37f6b4ef078bd9570efdd8fd2e2", + "mdc2": "a4fed7363add791b3c3139a2ef4389db", + "mdc2WithRSA": "a4fed7363add791b3c3139a2ef4389db", + "ripemd": "7dd8c9666ce02b878e57e9ba4d01f5aa5d84627b", + "ripemd160": "7dd8c9666ce02b878e57e9ba4d01f5aa5d84627b", + "ripemd160WithRSA": "7dd8c9666ce02b878e57e9ba4d01f5aa5d84627b", + "rmd160": "7dd8c9666ce02b878e57e9ba4d01f5aa5d84627b", + "sha": "30114eff874ec1e22a517764247e54c23f0881e4", + "sha1": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "sha1WithRSAEncryption": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "sha224": "8551ca25febf9b10a58efec1f72bafc0050ec6d2c7727a5db3ccde7c", + "sha224WithRSAEncryption": "8551ca25febf9b10a58efec1f72bafc0050ec6d2c7727a5db3ccde7c", + "sha256": "58e09b4047770bc998b86a4191b7a11eec6fc65bd5e5d0fb6f30d4b7ee0cd683", + "sha256WithRSAEncryption": "58e09b4047770bc998b86a4191b7a11eec6fc65bd5e5d0fb6f30d4b7ee0cd683", + "sha384": "d5daa8f149b51e36e56d8b9955fb49bec8d77fb2fd2231d46358c044b1321eb9f62d88a94d3496177d303869844963f9", + "sha384WithRSAEncryption": "d5daa8f149b51e36e56d8b9955fb49bec8d77fb2fd2231d46358c044b1321eb9f62d88a94d3496177d303869844963f9", + "sha512": "bd274fcdd48554e5406076d795e5029945d23894ffa4da150a203b8caaccf3fc8dabf8177995c7965822f920c62574b4f65216f3d807b5bb766843ced496343d", + "sha512WithRSAEncryption": "bd274fcdd48554e5406076d795e5029945d23894ffa4da150a203b8caaccf3fc8dabf8177995c7965822f920c62574b4f65216f3d807b5bb766843ced496343d", + "shaWithRSAEncryption": "30114eff874ec1e22a517764247e54c23f0881e4", + "ssl2-md5": "df34d37f6b4ef078bd9570efdd8fd2e2", + "ssl3-md5": "df34d37f6b4ef078bd9570efdd8fd2e2", + "ssl3-sha1": "b522dae1d67726eba7c4136d4e2f6d6d645ac43e", + "whirlpool": "a42c98a588c8ab42618da176885cd4850ffa516d59b38cfa34af8292060a19c2e541637e79249fa4eace1b77be955766fa7f6a9c63d42607feb36d4a72a03f27" + }, + { + "input": "AAAAAAAAAAAAD/////////////gAAAH////////////////wAH//////////+AAAAAAAAAAf////////////////+AAAAAAAAAAAAAAP//4AAAAAAAAAAAAAAAB/////gAAAAAAAAAAAAD//////////gAAAAAAAAAAAAP//////////////+AAAAA////////////////////gAAAAAAAAAAAAAAAAAAAD////////////gAAAAAAAB/8AAAAAAAAAAD//////4AAAAAAAAH//////////////AAAAAAPgAAAAAAAAAAAAAAAAH/////////+AAAAAAAAP/////8AAAAAAAAB////8AAAAB///////////////////+AAAAAAAf/+AAAAAAAB///////////////4AAAAAAAf////////////////8AAAAAAAAAAAAAAB//////////+AAAAAAAAAAAAB////wAAAAAAH4AAAAAAAAAAYAAAAAAAAD////////////+AAAAAAAAAAAAP/////////////wAAAAAAAAAAAAAAAAAAf//+H//////////////////wAAAAAAAAAAAAAAAAAH////8AAAAAf//AAAAAAAAAAAAAAAA/+AAAAD//////////gAAAAAAAAAAAAAAAH////////////////8AAAAAAAAAAAAAAAAAH//////////////////+AAAAAH/+AP///////////////gAAAAAH//4AAAAAAAA////////////4AAAAA//////////////////gAAAAAAAAAAAAAAAAAAB/////////AAAAAAAAAAA8AAAAAAAAAAAAP4AAAAAAAAAAAA///////////8AAAAAAAAAAAAAP///////////8AAAEAAAA///////////4AAAAAAf/////////////////+AAAAAAAAAAAAAAAAP///////gAAAAAAAAAA/////gAAAAAAAAAAB///////////////////8AAAAAAAAP////////////////4AAAAAAAAAAAAAAf/////////////wAAAAAAAAAAAAAD////wAA//AAAAAAAAAAAAD///+AAAH////////////4AAAAAAAAAAf//8AAAAAAAAAAAAAA////4AAAAAAAAAD////////////4AAAAAAAAAAAH/////////////////5//+AAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAAAAAAAH////////4AAf/////////////wAAAAAAAAAAAMAAAAAAAAAAAB////gAAAAAAAAAAAAAB//////////+AAAAAAAAAB/////////////gAAAAA////AAAAAAAAAAAAAAAAAAAH//////////AAAA///////wAAAAAAAAAAH////////gAAAAAAAAAAAAAAAAAAAH///////////////////wAAAAB///////////+AAH////////////////AAAAAAAAAAAAAAAAP//////////+AAAAAAAAB///AAAAAAA////8AAAAAAAAH//////////////////4AAAAB///////////////////wAAAAAAAAAAAAB////////////////4AAAAAAAAA////////gAAAAAAAAAAAAAAAAAAAD/////////AAAH//////////+AAAAAAAAAAAAAf////////AAAAAAAAAAAAAAABAAAAAAAH///////////////wAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAAgAAAD///8AAAAAAAAAAAAAAAAf//////////////////4AAf//////////3//////////////////wAAAAAAAAAAAAAAH/////////////4AAAD//////wAAAH///////////4////8AAAAAAAAAAAAAAD//////////////gAAAAAAAAAAAAAAAAAB/////////////gAB///////////////////wAAAAAAB////////////8AAAAAD//////////////8AAAAAAAAAAAAAAAAAf/////////AAAAAAAAAAAAAAD////////////////////AAAAAAAAAAD/////////////////8AAAAAAAAAAAAAAAAAD///////////4AAAAAAAAAAAAAAAB//+AAAAAAAAf//////////////////wAAAAAAAAAAAAAAB/////////////////wAAAAAAAAAAAAf/////A///////8AAAAAAAAB///////8AAAAAAAAAAAAAAAADwAAAD//////////////gAAAAAAAAAAAAAAAAAD///////////////////8AAAAAAAAAAAAAf//////////////////D/////////gAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAf//////////////+AAAAAAAAAAAAAAAAAAA//////////gAAAAAAAAAAAA==", + "DSA": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "DSA-SHA": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "DSA-SHA1": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "DSA-SHA1-old": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "RSA-MD4": "6eee1232fd46ecfd1167cbdf13be971f", + "RSA-MD5": "84d2c12c4f0c28d288464d33a23f227c", + "RSA-MDC2": "9151c8c48457be975c29ad4f50f1c865", + "RSA-RIPEMD160": "ae3eb73d016d0f958fa3a5e7f90224bcd150b03d", + "RSA-SHA": "12799f8e31af62fad760372e341c578ee62c7f4c", + "RSA-SHA1": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "RSA-SHA1-2": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "RSA-SHA224": "963aedf392ced119789999d3588a495b505343f49ea355170612b8a1", + "RSA-SHA256": "9e01666f3284aec585338d0b452aa1712b9d1392c4a265a2ecfc9dc4cadd002b", + "RSA-SHA384": "770c8472f92f459f1a1aa759e1ee87193245dfd61cb237ea222d3bd89d2f26b734398dfa494b57a496927935fceee3af", + "RSA-SHA512": "f6aeb80185c567f9c51ae74741c800dda109d0d64e0f8b0dbad115d9513564e61e8520baec3a04c98546443c60ee79d1d0d5596d4aac33384a530d7d37518752", + "dsaEncryption": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "dsaWithSHA": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "dsaWithSHA1": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "dss1": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "ecdsa-with-SHA1": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "md4": "6eee1232fd46ecfd1167cbdf13be971f", + "md4WithRSAEncryption": "6eee1232fd46ecfd1167cbdf13be971f", + "md5": "84d2c12c4f0c28d288464d33a23f227c", + "md5WithRSAEncryption": "84d2c12c4f0c28d288464d33a23f227c", + "mdc2": "9151c8c48457be975c29ad4f50f1c865", + "mdc2WithRSA": "9151c8c48457be975c29ad4f50f1c865", + "ripemd": "ae3eb73d016d0f958fa3a5e7f90224bcd150b03d", + "ripemd160": "ae3eb73d016d0f958fa3a5e7f90224bcd150b03d", + "ripemd160WithRSA": "ae3eb73d016d0f958fa3a5e7f90224bcd150b03d", + "rmd160": "ae3eb73d016d0f958fa3a5e7f90224bcd150b03d", + "sha": "12799f8e31af62fad760372e341c578ee62c7f4c", + "sha1": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "sha1WithRSAEncryption": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "sha224": "963aedf392ced119789999d3588a495b505343f49ea355170612b8a1", + "sha224WithRSAEncryption": "963aedf392ced119789999d3588a495b505343f49ea355170612b8a1", + "sha256": "9e01666f3284aec585338d0b452aa1712b9d1392c4a265a2ecfc9dc4cadd002b", + "sha256WithRSAEncryption": "9e01666f3284aec585338d0b452aa1712b9d1392c4a265a2ecfc9dc4cadd002b", + "sha384": "770c8472f92f459f1a1aa759e1ee87193245dfd61cb237ea222d3bd89d2f26b734398dfa494b57a496927935fceee3af", + "sha384WithRSAEncryption": "770c8472f92f459f1a1aa759e1ee87193245dfd61cb237ea222d3bd89d2f26b734398dfa494b57a496927935fceee3af", + "sha512": "f6aeb80185c567f9c51ae74741c800dda109d0d64e0f8b0dbad115d9513564e61e8520baec3a04c98546443c60ee79d1d0d5596d4aac33384a530d7d37518752", + "sha512WithRSAEncryption": "f6aeb80185c567f9c51ae74741c800dda109d0d64e0f8b0dbad115d9513564e61e8520baec3a04c98546443c60ee79d1d0d5596d4aac33384a530d7d37518752", + "shaWithRSAEncryption": "12799f8e31af62fad760372e341c578ee62c7f4c", + "ssl2-md5": "84d2c12c4f0c28d288464d33a23f227c", + "ssl3-md5": "84d2c12c4f0c28d288464d33a23f227c", + "ssl3-sha1": "e9a021c3eb0b9f2c710554d4bf21b19f78e09478", + "whirlpool": "c1b1aa5378f8ada9d47cba8a1ddd2fd12d3e7232c796ef742d1c220172837527a2e0e2820f6e83d8a00558f6d0463fc8b2b8f9005924ff61e75885720263a107" + }, + { + "input": "///////////////gAAAAAAA////////4A/////////4A/////////gAAAAAAAAAAAAAAB//////////AAAAAAAAAAf//////////4AAAAAAAf/////////////////A/////+AAAAAAAAAAAAAP//////////////////wAAAAAAAAAAAAP///////////////wAAAAAAAAAAAD//AAAAAAAAAAAAAAB////////////AAAAAAAAAAAf//////////wAAAAAAAAAAB//////////////////8AAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAD//////////////////4AAAAAAAAAAAAAAAAAD///AAAAAAAAAAAAAAAP//gAAAAAAAAAAP///////////AAAAAAAAAAAAAAD/////////gB////////////////////4A//////////AAAAAAAAAAAAAAAAAAAAP//////////////+AAAAAAAAAAAAAAA///////4D//gAAAf///////8H///////////////+AAAAAAAAAAAAAAAAAAA////AAAAAAAAf//////////////gAAAAAAAAAAAAAAAAH///////////////////AAAAAAAAAAA/////////////////////wAAAAAAAAAAAAAAA//////////8AAAAAAAAAAAAA//AAAAAAAf//////////////wAAAAAAA//////////////////4AAAAAAAAAP/////////AAAAAAAAAAAAB////+AAf/////////////+AAAAAAAAAB////////////////////wAAAAAAAAAAD//////4AAAAAAB///////////gAAAAAB/////////////////gAAAAAAAAAAAAAAAAAAB//////8AAAAAAB///////////////wAAAAAAAAAAAAAAP////////////////+AAAAAAAAAAAAAAAf/+AAAAAAAAAAAAAAAAAAAAA////wAAAAAAAAP////////////////////gAAAAAAAAAAAAAAAAAAf////////////wAAAAAAAAAAAf///gAAAAAAAf//8AAAB///////////////////4AAAAAAf////////////////wAAAAAAAH//////////////8AAAAAAA///////////gAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAA//////////////////gAAf///////gAAA///////////4AAAAAAAAAAAAAAAAAAf/////4AAAAAAAAAD//////////wAAAAAAAAAAAAAB/////////////+AAAAAAAAAAAAAAAAAf///////////////////AAAAAAAAAAAAAAAAAAP///////////////////8AAAAAAAAAAAAAAA///9/gAAAAAAAAAAAAA/////8AAAAAAAAAAAAAAAAP////8AAAAAAAAAA//////+AAAAAAAH//////////////////gAAAAB////////////////+AAAAAAAAAAAAH////////+AAAAAAPAAAAAAAAAAAAAAAAAAAAAf////gAP//4AAAAAAAAAAAAAAAAAB////////////////////4D//wAAAAAAAAAAAAAAAAAAAAD///////////////4f///////////////////+AD/////////////////AAAAAAAAAAAAAAAAAAAP////////////////////wAAAAAAAH///////////////x/////////AAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAAD////////////////4f///////////////////4AAAAAAAAAAAAAAAH////////////AAAAAAAAAAAAAAAAAAAD//////gAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAAAAAAAAP//wAAAAAAP//8AAAAAAAAAAAAAAf/////////////AAAAAB////////////wAAAAAAAAAAAAAAAAAB//////////AAAAAAAAAAAf///////////AAAAD////////////////4A/////////wAAAAA/////////////////4AAAAAAAAAAAAAAAP///////////gAAA////////////gAAAAAAAAAAA////wAAAAAAAAB//wAAAf///////////+AAAAAAAAA////////////////4AAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAA///////////////////4AAAAAAAAAAB///////AAAAAAAAAAAAAAD//////////AAAAAAP/////////8AAAAAAYAAAAAAAAAAAAAP/////wAB////gAAAAAAAAAf////////////////////4AAAAAAAAAAAAAAAH///////////8AAAAAAAAAAAA/9/+AAAAAAB///5////////////8AAAAAf////8AAAAA/////////4AD//AAAAAAAAAAAAAD/////////gAf/////8f////////+AAAAAAAAAAAAAf/4AAAAAAAAAAAAAA//////////////gAAAAAAH///////////AAAAAAAAAAAAAAAAAAf///////////////////", + "DSA": "df13573188f3bf705e697a3e1f580145f2183377", + "DSA-SHA": "df13573188f3bf705e697a3e1f580145f2183377", + "DSA-SHA1": "df13573188f3bf705e697a3e1f580145f2183377", + "DSA-SHA1-old": "df13573188f3bf705e697a3e1f580145f2183377", + "RSA-MD4": "ee35eaade52fe84b3565b71b97e2c004", + "RSA-MD5": "17b55bbd4222066960e54182e1e95f0b", + "RSA-MDC2": "11ba7321a73d95f5994c95fc2f78d6cd", + "RSA-RIPEMD160": "a87eb3deb5da5e5aae1e2e36307321ae794ef0e5", + "RSA-SHA": "afe6b8cb63f9a1f82c5caf4664442cd551bb59c0", + "RSA-SHA1": "df13573188f3bf705e697a3e1f580145f2183377", + "RSA-SHA1-2": "df13573188f3bf705e697a3e1f580145f2183377", + "RSA-SHA224": "d52df79c03c2c84ba8f8a0de1657dfb14c41b09cbd7748137469010e", + "RSA-SHA256": "33aa52b6be6991965ae18124232f108ec7b400528e848e5d8a8d7cf75783ee19", + "RSA-SHA384": "97552e81dc847f71a7aedad578fcf02b345c844850964ce4a60fd46b5099c54572ee72e15af6ff8a59ac6dc7ed3000a9", + "RSA-SHA512": "bd17c744c4f7cdc4b44cd83262754196d8f11750136ca16f93661f8381df351eeff4829e52c4eca7ea8215c0ee54341663633f0c2aa5d820ed3ca0f2cdcd1f6a", + "dsaEncryption": "df13573188f3bf705e697a3e1f580145f2183377", + "dsaWithSHA": "df13573188f3bf705e697a3e1f580145f2183377", + "dsaWithSHA1": "df13573188f3bf705e697a3e1f580145f2183377", + "dss1": "df13573188f3bf705e697a3e1f580145f2183377", + "ecdsa-with-SHA1": "df13573188f3bf705e697a3e1f580145f2183377", + "md4": "ee35eaade52fe84b3565b71b97e2c004", + "md4WithRSAEncryption": "ee35eaade52fe84b3565b71b97e2c004", + "md5": "17b55bbd4222066960e54182e1e95f0b", + "md5WithRSAEncryption": "17b55bbd4222066960e54182e1e95f0b", + "mdc2": "11ba7321a73d95f5994c95fc2f78d6cd", + "mdc2WithRSA": "11ba7321a73d95f5994c95fc2f78d6cd", + "ripemd": "a87eb3deb5da5e5aae1e2e36307321ae794ef0e5", + "ripemd160": "a87eb3deb5da5e5aae1e2e36307321ae794ef0e5", + "ripemd160WithRSA": "a87eb3deb5da5e5aae1e2e36307321ae794ef0e5", + "rmd160": "a87eb3deb5da5e5aae1e2e36307321ae794ef0e5", + "sha": "afe6b8cb63f9a1f82c5caf4664442cd551bb59c0", + "sha1": "df13573188f3bf705e697a3e1f580145f2183377", + "sha1WithRSAEncryption": "df13573188f3bf705e697a3e1f580145f2183377", + "sha224": "d52df79c03c2c84ba8f8a0de1657dfb14c41b09cbd7748137469010e", + "sha224WithRSAEncryption": "d52df79c03c2c84ba8f8a0de1657dfb14c41b09cbd7748137469010e", + "sha256": "33aa52b6be6991965ae18124232f108ec7b400528e848e5d8a8d7cf75783ee19", + "sha256WithRSAEncryption": "33aa52b6be6991965ae18124232f108ec7b400528e848e5d8a8d7cf75783ee19", + "sha384": "97552e81dc847f71a7aedad578fcf02b345c844850964ce4a60fd46b5099c54572ee72e15af6ff8a59ac6dc7ed3000a9", + "sha384WithRSAEncryption": "97552e81dc847f71a7aedad578fcf02b345c844850964ce4a60fd46b5099c54572ee72e15af6ff8a59ac6dc7ed3000a9", + "sha512": "bd17c744c4f7cdc4b44cd83262754196d8f11750136ca16f93661f8381df351eeff4829e52c4eca7ea8215c0ee54341663633f0c2aa5d820ed3ca0f2cdcd1f6a", + "sha512WithRSAEncryption": "bd17c744c4f7cdc4b44cd83262754196d8f11750136ca16f93661f8381df351eeff4829e52c4eca7ea8215c0ee54341663633f0c2aa5d820ed3ca0f2cdcd1f6a", + "shaWithRSAEncryption": "afe6b8cb63f9a1f82c5caf4664442cd551bb59c0", + "ssl2-md5": "17b55bbd4222066960e54182e1e95f0b", + "ssl3-md5": "17b55bbd4222066960e54182e1e95f0b", + "ssl3-sha1": "df13573188f3bf705e697a3e1f580145f2183377", + "whirlpool": "a3b8403793122d5a0cf2c1ee1bff3ecbe68d3758eeaeb56fdf0eb7c1d5249a99dc4072ff6c44b35687dcdefed8ef7d415afeedfd4a9f1bb8629013e5a108ecf2" + }, + { + "input": "AAAAAAAAAAAAAAAAA/////////gAAAAAAAA//////+AAAAAAAAAB//////////////4AAAD//////////+AAAAAAAAAH////////////gAAAAAAH///gAAAAAAAAAAH///////////////////gAAAAAAAAAAAAAAAAAf/////+AAAAAAAAAAAAAAAD///////////////8AAAAAAAAAAAAAf//////////////gAAAAAAAAAAAAAP////AAAAAAAAAAAAB//+AD/////+AAAAAAAAAAAB///////////////wAAAAAAAAAP/////////////////8AAAAAAAAAAAAAAAAAAAAP///////////////////gAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAAAAAAAA//////gAAAAAAAAAAAAAAAAAP////////////////////wD///////////+AAAAAAAAAAAP///////////wAAAAAAAAAAAAD//4AAAAAAAAAAAAAPgAAAAAAAAAAAB///gAAAAH//ACAAAAAAAAAAAAAAAAA///AAAD///////////////////AAAAAAAAAAAAAAAAP+AAAAAAAAP////////////////8AAAAAAAAAAAAAAAAD///////AAAAAH//AA////AAAAAf//////////////fgAAAB////////////////8A//////////8AAAAAAAAAAAD/////////////////wAAAAPgAAAAAAAB//////////////8AAAAAAAAAAAAAAAAAAf/////8AAAAAAAAAAAAAAAAAD//////////wAAAAAAAAAAAAAH//wAAAAAAAAB////////////////////4AAAf////////////////8AAAAAAAAAAAAD//////////////////+P//////AAAAAAAAAAAAAAAAAA///////////AAAAAAAAAAAAAAAAAA////////////+AAAAAAAAAAAAAAAAAAAAAf////////////////wAAAAAAD/////4AAAAAB//AAAAAAAAAAAAAAAB/4AAAAAAAAAAAAAAAAAA//////////4AAAAAAAAAAAAAAAB///////////////////wAAAAAAAAAH////////AAAAAAAAAAAAAAAAAAAAA///////////4AAAAAAAAAAAAAAAH///////////gAAAAAAAAAAB/////////8AAAAAAf/wAAAAAAAAAAAAAAAH/////AAAAAAAAAAAAAAAAAADAAAAAAAAAAAAB/AAAAAAAAAAAAAAAAAAAAH///////////gAAAAAAAAAAAAA////+AAAAAAAAAAB///////////AAAAAAAAf////////////wAAH////////////////+AAAAAAAAAAAAAAAAAAA//wAAAAAAAAAMAAAAAAAAB//////4AAAAAAAAAAAP////+AAAAH//////////////////4AAAAAAAA///////////////gAA///////8AAAAAAAf////////////////////4AAAAAAAAA//////////////4AAAAAAAAAB////AAAAAAAAAAAAAAAAAAAf/////4AAAAAAAB/////////AAAAAAAAAAAAAAA////////////wD////////gAAAAAAAAAAAAAAAAf////////////wAAAAAAH///////////////gAAAAAf///////////////////4AAAAAAAAAAAAAAAf/gAAAAAA//////AAAAf////////////////4AAAAAAAAAAAAAAD///8B////////////////wAAAAAAAAAAAAD////8AAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAH///////////////////+AAAAAAAAAAAAAAAAAD//////////////////8AAAAf///+AAAAAAAAAAAAA//////+AB/////8AAAAAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAD///////////wAAA/////////////gAAAAAAAAAAwAAAAAAAAAAAAAA////4AAP/////////gAD///4AAAAAAB/////////wf//////////A////wAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAAAAAH///////////////AAAAAAAAAAAAAA////////////////8AAAAAAAf//+AAAAAAAAAAAAAAAAAAAAAP//////////8AAAAAD//////////////////gAAAAAAAAAAAH///////////////////gA////////wAAAAAAP///////////////////wAAAAAAAf//8A//////////////wAAAAAAAAAAAAAAAAAA////wAAAAAAAAAAH/////////4AAAAAAAAAAAAAAAA///////4AAAAAAAAAAAAAAA///////+Af/////4AAAAAAAAAP////////AAAAAAAAAP////////////////////AAAP/////////////AAA///////////////////4AAAH//4AAAAAAAf////////////////+AAA///////////////////4AAAB//////8AAAAAAAH///////AAAAAAAAAAAAAAAAAAAAAD+AAIfAAAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAH///////+AAAAAAAf/AAAAAAAA///////////////wAAAAAAAAAAAAAAAAAAAf/////////////////gAAAAAAf//////////////////+AAAAAAAAAAAAAAAAAAAAA=", + "DSA": "188835cfe52ecfa0c4135c2825f245dc29973970", + "DSA-SHA": "188835cfe52ecfa0c4135c2825f245dc29973970", + "DSA-SHA1": "188835cfe52ecfa0c4135c2825f245dc29973970", + "DSA-SHA1-old": "188835cfe52ecfa0c4135c2825f245dc29973970", + "RSA-MD4": "6812984ffb6bc6d6a9d8ca4eb16b6d72", + "RSA-MD5": "75eb69b22793852bc892ce264c421a1e", + "RSA-MDC2": "7d5292756e7b30489c001b37d8aaadc0", + "RSA-RIPEMD160": "b54c0aa4ab99dc64c97aaf57ad573ddeeb478886", + "RSA-SHA": "6c754b84bf708f830a7e98992114e9ab0df17ea6", + "RSA-SHA1": "188835cfe52ecfa0c4135c2825f245dc29973970", + "RSA-SHA1-2": "188835cfe52ecfa0c4135c2825f245dc29973970", + "RSA-SHA224": "e81f598d40f0a91cd4f10efb78763b0ebee72af785d391af0de9e2fa", + "RSA-SHA256": "f854ce37a0821dee06b616d2e86383271c91e09328f884dfef2107712d267601", + "RSA-SHA384": "ba2fc23d19aabdd48145c206f01a317e2f8f2cd596a2ce2278e2d387d80e10c908c2a9523d9979207287f5cd01cf5975", + "RSA-SHA512": "60f8f46caeed82fa1afe2e1a8c27d490f3cdcfc6e0d29010813e36a1acf6c0aa64f9f03823bc60cd48162db49adf4ef8d42be2fd5ee6948ef6e9ec83d8784c51", + "dsaEncryption": "188835cfe52ecfa0c4135c2825f245dc29973970", + "dsaWithSHA": "188835cfe52ecfa0c4135c2825f245dc29973970", + "dsaWithSHA1": "188835cfe52ecfa0c4135c2825f245dc29973970", + "dss1": "188835cfe52ecfa0c4135c2825f245dc29973970", + "ecdsa-with-SHA1": "188835cfe52ecfa0c4135c2825f245dc29973970", + "md4": "6812984ffb6bc6d6a9d8ca4eb16b6d72", + "md4WithRSAEncryption": "6812984ffb6bc6d6a9d8ca4eb16b6d72", + "md5": "75eb69b22793852bc892ce264c421a1e", + "md5WithRSAEncryption": "75eb69b22793852bc892ce264c421a1e", + "mdc2": "7d5292756e7b30489c001b37d8aaadc0", + "mdc2WithRSA": "7d5292756e7b30489c001b37d8aaadc0", + "ripemd": "b54c0aa4ab99dc64c97aaf57ad573ddeeb478886", + "ripemd160": "b54c0aa4ab99dc64c97aaf57ad573ddeeb478886", + "ripemd160WithRSA": "b54c0aa4ab99dc64c97aaf57ad573ddeeb478886", + "rmd160": "b54c0aa4ab99dc64c97aaf57ad573ddeeb478886", + "sha": "6c754b84bf708f830a7e98992114e9ab0df17ea6", + "sha1": "188835cfe52ecfa0c4135c2825f245dc29973970", + "sha1WithRSAEncryption": "188835cfe52ecfa0c4135c2825f245dc29973970", + "sha224": "e81f598d40f0a91cd4f10efb78763b0ebee72af785d391af0de9e2fa", + "sha224WithRSAEncryption": "e81f598d40f0a91cd4f10efb78763b0ebee72af785d391af0de9e2fa", + "sha256": "f854ce37a0821dee06b616d2e86383271c91e09328f884dfef2107712d267601", + "sha256WithRSAEncryption": "f854ce37a0821dee06b616d2e86383271c91e09328f884dfef2107712d267601", + "sha384": "ba2fc23d19aabdd48145c206f01a317e2f8f2cd596a2ce2278e2d387d80e10c908c2a9523d9979207287f5cd01cf5975", + "sha384WithRSAEncryption": "ba2fc23d19aabdd48145c206f01a317e2f8f2cd596a2ce2278e2d387d80e10c908c2a9523d9979207287f5cd01cf5975", + "sha512": "60f8f46caeed82fa1afe2e1a8c27d490f3cdcfc6e0d29010813e36a1acf6c0aa64f9f03823bc60cd48162db49adf4ef8d42be2fd5ee6948ef6e9ec83d8784c51", + "sha512WithRSAEncryption": "60f8f46caeed82fa1afe2e1a8c27d490f3cdcfc6e0d29010813e36a1acf6c0aa64f9f03823bc60cd48162db49adf4ef8d42be2fd5ee6948ef6e9ec83d8784c51", + "shaWithRSAEncryption": "6c754b84bf708f830a7e98992114e9ab0df17ea6", + "ssl2-md5": "75eb69b22793852bc892ce264c421a1e", + "ssl3-md5": "75eb69b22793852bc892ce264c421a1e", + "ssl3-sha1": "188835cfe52ecfa0c4135c2825f245dc29973970", + "whirlpool": "943964f01afbd2f55bb9f185b775f17c0fcdca046e75a7c79511865ef2e9257e7d3dc4d1991b3a597b18534c0c6c8de8b2a33aab2d1db98b0522e29b24348810" + }, + { + "input": "AP/////////4AAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAAAD///AAAAAAAAAAAAAAH////////////////////AAAAAAAAAAAAAAAAAAAAAAP/////////////AAADAAAAAAAAAAAAAAAAAAP///////////////////AAAAAH/////////////+D+D///////////////wAAAAAAAAD//gAAAAAAAAAf///////////////gAAAAAAAAf/wAAA/////////gAAAAAAAAAAAAAAADwAAAH/////////////////AAB//////AAAAAAAAAAAH/gAAAAAH///////////////////AAAAAAAAAAAAAAAAAAAH////4AAAAAAAAAAAf/wB//////////////////AAAAAAAAAAAAAAAAAAAf/////////4AAAAAAAAAAAAAAAf///////+AAAAAAAAAAB///////////////////wAAAAAAAAAAAAAAAA//////////////////////4D////////////gAAA+AAAAAAAAAAAAAP/////////////////8AAAAB///////////////////4AAAAIAAAAAAAAAB/8AAAAAAH//////////////gAAAAAAAAAAAAAAAAAP///////////////////gAAAAAAAAAAAAAAAAf/////x////+AAAAAAAAAAAAAAAAAAAAP///////gAAAAP////////8AAAAAAAAAAAAAAAAAAAAAA////+AAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAH////////////////AAAH////////+AAAAAAAAAAAAD//////////////+AAAD/////+AAAAAAAAAAAAAAAAAAAAAAP////////////+AAAAAAAf///////8AAAAAAAAAAB///////////////8AAAAAAAAf/////////////////////wAAAAP////////+AAAAAAAAAAA///////////////////wAAAAAAAAAAAAAAAAAAAD///////8AAAAAAAAAAAAAAAAP4AAAAAAAAAAAAAAAAAAAAAH///////////////8AAAAAAAAAAAAAAAAAP//////////+AAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAB////////////////////8AAAAAAAAAAAAAAAAD////////////////+AAAAAAAAAAAAAAAAAAAD/////////////gAAAAAAAAD/////////////////////+AAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAAAH//////////////////wAAAAAAAAAAAAB/////////////////////AAB///////wAAAAAAAAAAAAAAAAH////+AAAAAAAAAAAAAAAAAAAA/////////////////////4AAAAAAAAAH//////8AAAAAAAAAAH////////////////////8AAAAD/////8AAAAAAAAAAAAAAAAAAAAAD//////////////////AAAAAAAAD////////4AAAAAP///////////gAf///////////+AAAH///////////4AAAAAAAAAAAAAAAAAAAAAf/////////////////+AAAAAAAAAAAAAAAAP////////////AAAAP//+AAAAAAAAAAAA//////////4AAAAAAAAAA////////////////gAAA/////////8AAAAAAAAAAAAAAAAAAB/////////////////////+AAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA/////gAAAAA///AAAB////////+AAAAB////////8AAAAAAAAAAAAAAAAAAAP/////4AAAAAP/////////////wAAAAAAAAAAAAAAA//////////AAAAAAAAAAAAAAAADgAAAAAAA///AAAAAAAAAAAAAAAAAAP////////////////+AAAAAAAAAAAAAAP////////+AAAAAAAAAAP////////////AAAAAAAf///////+AAAAAAAP///////AAAAAAAAf//////////AA/8AAAAAAD//////////8AAAAAAAAAD///////////////////gAAAAB///AAAAAAAAAAAAAAAPgAAAB////////////4A/////////////////////AAAAAAAAAAAAAAAAB////////////////////8AAAAA//////wAAAAA//4D//////////AAAAAP//+P//////4AAAAAAAAAAA/////gAAAAAAAAAAAAAAAAAP///////////////////+AAAAAAAAP//////////////////8AAAAAAAAAAAAAAAAAAAAAAf////////////////////+AAAAAAAAAAAAAAAAAAAAAP/////////////////////AAAAAAAAAAH/+AAAAAAAAAP////////////8AAAAAAAAAA//4AAAAAAAAAAAAAAAAAAAAH////8AAAAAAAAAAAAAAAAAf/////////////AAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAP////////////////////AAAAAAAD////////////////AAAAAAAAAAAAAAAAAH//////////////8D8AAAAfwAAAAAAAAA/////////////////////wAAAAAAAAAAAAP4AAAAAAAAAAAAD//////////gAAAAAAAAAAAAAf////////////AAAAAAAAAAAAP////////////////////8AAAAAAAAAAH/////////8AAAAAAAAAAAAAAAH///////////////////8AAH///4AAAAAAAAAAAAAAAAAAAA///////////////////4AAAAAAAA////////////////////w==", + "DSA": "41b615a34ee2cec9d84a91b141cfab115821950b", + "DSA-SHA": "41b615a34ee2cec9d84a91b141cfab115821950b", + "DSA-SHA1": "41b615a34ee2cec9d84a91b141cfab115821950b", + "DSA-SHA1-old": "41b615a34ee2cec9d84a91b141cfab115821950b", + "RSA-MD4": "c54bf4d23537e39f59f02af870cd74c1", + "RSA-MD5": "de4abe78e28e2718200c76237f2ed42f", + "RSA-MDC2": "5986ab248d3c97b6e48fc7aff796530a", + "RSA-RIPEMD160": "85b0f0bfbe6551919c10dae363059b101fb9b7b0", + "RSA-SHA": "cbd5c695adc25d5be7b0fc326cea08fcf00116b4", + "RSA-SHA1": "41b615a34ee2cec9d84a91b141cfab115821950b", + "RSA-SHA1-2": "41b615a34ee2cec9d84a91b141cfab115821950b", + "RSA-SHA224": "9d9617991608176ee5e071dca52aafe20bd958e911c9bb9ed27e6d33", + "RSA-SHA256": "a58035c4921e7114b97fde8d4cf04224971d49fc6b23ed5d61a29e133684c809", + "RSA-SHA384": "77658d867c935d257845772ba93576ddf37d12c685568eaab83cff0e3dd1295f9f2c0cccc455a9b415c90da45277fe08", + "RSA-SHA512": "9dfd23daa0e8c6660c0f3bbd1187451b862fb3476ff7725d4f502150bf0a827deb1cbfcd055129f1c0a493d6f71c87380776f2d260cbe39d9bdb4259202f55d9", + "dsaEncryption": "41b615a34ee2cec9d84a91b141cfab115821950b", + "dsaWithSHA": "41b615a34ee2cec9d84a91b141cfab115821950b", + "dsaWithSHA1": "41b615a34ee2cec9d84a91b141cfab115821950b", + "dss1": "41b615a34ee2cec9d84a91b141cfab115821950b", + "ecdsa-with-SHA1": "41b615a34ee2cec9d84a91b141cfab115821950b", + "md4": "c54bf4d23537e39f59f02af870cd74c1", + "md4WithRSAEncryption": "c54bf4d23537e39f59f02af870cd74c1", + "md5": "de4abe78e28e2718200c76237f2ed42f", + "md5WithRSAEncryption": "de4abe78e28e2718200c76237f2ed42f", + "mdc2": "5986ab248d3c97b6e48fc7aff796530a", + "mdc2WithRSA": "5986ab248d3c97b6e48fc7aff796530a", + "ripemd": "85b0f0bfbe6551919c10dae363059b101fb9b7b0", + "ripemd160": "85b0f0bfbe6551919c10dae363059b101fb9b7b0", + "ripemd160WithRSA": "85b0f0bfbe6551919c10dae363059b101fb9b7b0", + "rmd160": "85b0f0bfbe6551919c10dae363059b101fb9b7b0", + "sha": "cbd5c695adc25d5be7b0fc326cea08fcf00116b4", + "sha1": "41b615a34ee2cec9d84a91b141cfab115821950b", + "sha1WithRSAEncryption": "41b615a34ee2cec9d84a91b141cfab115821950b", + "sha224": "9d9617991608176ee5e071dca52aafe20bd958e911c9bb9ed27e6d33", + "sha224WithRSAEncryption": "9d9617991608176ee5e071dca52aafe20bd958e911c9bb9ed27e6d33", + "sha256": "a58035c4921e7114b97fde8d4cf04224971d49fc6b23ed5d61a29e133684c809", + "sha256WithRSAEncryption": "a58035c4921e7114b97fde8d4cf04224971d49fc6b23ed5d61a29e133684c809", + "sha384": "77658d867c935d257845772ba93576ddf37d12c685568eaab83cff0e3dd1295f9f2c0cccc455a9b415c90da45277fe08", + "sha384WithRSAEncryption": "77658d867c935d257845772ba93576ddf37d12c685568eaab83cff0e3dd1295f9f2c0cccc455a9b415c90da45277fe08", + "sha512": "9dfd23daa0e8c6660c0f3bbd1187451b862fb3476ff7725d4f502150bf0a827deb1cbfcd055129f1c0a493d6f71c87380776f2d260cbe39d9bdb4259202f55d9", + "sha512WithRSAEncryption": "9dfd23daa0e8c6660c0f3bbd1187451b862fb3476ff7725d4f502150bf0a827deb1cbfcd055129f1c0a493d6f71c87380776f2d260cbe39d9bdb4259202f55d9", + "shaWithRSAEncryption": "cbd5c695adc25d5be7b0fc326cea08fcf00116b4", + "ssl2-md5": "de4abe78e28e2718200c76237f2ed42f", + "ssl3-md5": "de4abe78e28e2718200c76237f2ed42f", + "ssl3-sha1": "41b615a34ee2cec9d84a91b141cfab115821950b", + "whirlpool": "6c6a9e71e3be4946d24bb0e49a57b50aeda335139ad496822e0c27ee8a647c9fa708b1039d94c28387b6be7132251c45a28ba31971770bd0ecaafa10fe1f210f" + }, + { + "input": "AAAAAAAP///////////gAAAAAAP//8AAAAAAAAAAAAAAAAAAAAD/////////wAAAAAAAAf///////AAAAAAAAAAAAAAAAP//wAAH///////////////////wAAAAAAAAAAAAAAB////8AAAAAAAAAAAP/////+AAAAAAAAAAAAAAAH//////////////////gAAAAAAH//////////////////8AAAAAAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAf+AAAAAAAAAAA////+AAAAAAAAAAAAAAAAB//////////////////8AAAAAAAAAAA/////////////wAAH////////////f//////////////wAAAAAAAAAAAAAAAAAAP/////////////+AAAAAAAAAAAAAfwAAAAAA//////gAAAAAAAAAAAAAH///////////////////4AAf////////////////4AAAAAAAAAAAAAAAAAAAAAAf//////////////////8AAAAAAAAAAAAAP//////////////////////wAAAAD//////////4AAAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAAAAAAAAAAf///////////////////wD/8AAAAAAAP////////////////////wAAAD///////////////////4AAAAAAAAAAAD/////////////////////wAAAAAAAAAP////////////AAAAAAAAAAAAAAAAAAB////////////////4AB//////////////////////AAAAP//////////////////8AAAAAP///////////////////wAAAAAAAAAAAAD///////////////4AAAAAAAAAAAAAH////////wAB///+AAAAAAAf///////8P/AAAB////////////8AAAD////////////////gAAAAAAAAAAf/////wAAAAAAAAP/////////+AAAAAAB//////////////////////4AAA/////8AAAAAAAAAAAAPgAA/////////////////////wAAAAAAAAAAAAAAAAQAAAAAAAAAf/////+AAAAAAAAAAAAAAAAAAD//////////////////wAAAAD///////////////+AAAAA///////////////4AAAAAAAAAAAAAAAAA/////////////gAAAAAAAAAAAAAAP//wAAAAABAAAAAAAAAAAAAAAAAf/////////////////////gAAAAAAAD///////////AAAAAAAAAAAAAAAAAAAAD//////////////////gAP///////////////4AAAAAAD/////////////////////AAAAAAAAAAAH/////////////4AAAAAAAAAAAAAD///////////8AAf/gAAAH//////////////AAD//wAAAAAAAAAAAAAAD////////////////4AD////////////4f//////////////////+AAAAAAAAAAAAAAD////////////////+AAAAAAAAAf//////gAB/////////+AAAAAAAf/////8AAAAAAAAAAAAAAAAAAAAD///////wAAP/////////////gAAAAAAAAAAAAAAD//////4AAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAf////////////////+AAAAAAAAAAAAAAAAAAA///////////////geAAAAAAAAB///////////////////AAH///////////////////4AAAAAAAAAAAAAAAAAD//////////////////4AAAAAAAH//////wB///////////////8AAA//////////wAAAAAAAAAAH/////////////////AAAAAAAAAAAAAAAAAAH///8AAAAAAAAAAAAAAAAAAAAAD+AAAAAAAAAAAAAAAAAAAf//////+AAAAAAAAAAAAAAAAAAAAAAB///////gAAAAAAAAAAAAA//////////gAAAAAAAAAAAAAAAAAAAB/////////////////////8AAAAAH/////////////////wP/////////////////4AAAAAAAAAAAAA///////////////////AAAAAAAAAAAf//////AAAAAAAAAAAAAAAAAAAAAAB////////////8AAAAAAAAA////////////wAAAAAAAAAAAH/////gAf/4AAAAAAAAAAA////////8AH///////////////+AAAAAAAD////////8AAAAAAAAAAAAAH/////////////AgAD//////////////wAAAAAf//////////////////////wAAAAAAAAAAAAD/////////////4AAAAAAAD//////////////4AAAA///////+AAAAAAAAAAAAAAAAAAAAAH//////////////+AAAAAAAAAAAAAAAAAAAAAA//////////////4AAAAAAAA//////////////////8AAAAAAAAAAAAP///////4AAAAAAAAAAAAAAAAAD///////+AAAAAAAAAP//////////////+AAAAAAAAAAAA///8AAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAf////////+AAAAAAAAAAAAAAAA///////////////////////gAAAAAf/////////////////////AAAAAAAAAAAAAAAAAAH/////////////////////8AAAAAAAAAP////+Af/////////////+AAAAAAAAA//////wAAAAAAAAAAAAAAP///////AAAAA///////////////////8AAAAAAAAAf////AAAAAAAAAAAAAD////////////AAAAAAB///////////////////wAAAAAD///////wAAAAAAAAAAAAAAA///////////////wf////////////////8AAf//////////////////8AAAAAAAAAAAP////////////////4AAAAAAAAAAB/////////+AAAAAAAAAAAAAAAAAAAB///////+AAAP/////////////////8AAAAAAAAAAAAAB//////4AAAAAAAAAAAAA///////////", + "DSA": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "DSA-SHA": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "DSA-SHA1": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "DSA-SHA1-old": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "RSA-MD4": "5cdebaaaae4a5022bce4e83b66b489f1", + "RSA-MD5": "1149c8fc988799f43f6e5069355e108b", + "RSA-MDC2": "7880837aef2ab72eec654aaaf31d5456", + "RSA-RIPEMD160": "5b48ac1980cc2ce9256fea3e39758189912951d6", + "RSA-SHA": "5494bdecd5ab6fc01c532190a7850b275160b657", + "RSA-SHA1": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "RSA-SHA1-2": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "RSA-SHA224": "a29361eac82a2c318f2f6de642ea72a664ded2783653f3fe0a58b652", + "RSA-SHA256": "4d8963b832c44bab059a206f162890fff4eafd71e535a03609a67fe3c31de9e3", + "RSA-SHA384": "fe798718bb620d38444c3f43f17604b68a08f6c28635a094e48b6144bc49b7fbc7c82463e3834a80f3ea541d81b274d7", + "RSA-SHA512": "1b627ee9d88d2c8ef7f883f7ca84d888e7fedfda36c32b2e2e2f066e29bb0b42938f4ae7e12b18840050a8f7494caa1699836ba921bc17d6708d503b893281f0", + "dsaEncryption": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "dsaWithSHA": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "dsaWithSHA1": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "dss1": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "ecdsa-with-SHA1": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "md4": "5cdebaaaae4a5022bce4e83b66b489f1", + "md4WithRSAEncryption": "5cdebaaaae4a5022bce4e83b66b489f1", + "md5": "1149c8fc988799f43f6e5069355e108b", + "md5WithRSAEncryption": "1149c8fc988799f43f6e5069355e108b", + "mdc2": "7880837aef2ab72eec654aaaf31d5456", + "mdc2WithRSA": "7880837aef2ab72eec654aaaf31d5456", + "ripemd": "5b48ac1980cc2ce9256fea3e39758189912951d6", + "ripemd160": "5b48ac1980cc2ce9256fea3e39758189912951d6", + "ripemd160WithRSA": "5b48ac1980cc2ce9256fea3e39758189912951d6", + "rmd160": "5b48ac1980cc2ce9256fea3e39758189912951d6", + "sha": "5494bdecd5ab6fc01c532190a7850b275160b657", + "sha1": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "sha1WithRSAEncryption": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "sha224": "a29361eac82a2c318f2f6de642ea72a664ded2783653f3fe0a58b652", + "sha224WithRSAEncryption": "a29361eac82a2c318f2f6de642ea72a664ded2783653f3fe0a58b652", + "sha256": "4d8963b832c44bab059a206f162890fff4eafd71e535a03609a67fe3c31de9e3", + "sha256WithRSAEncryption": "4d8963b832c44bab059a206f162890fff4eafd71e535a03609a67fe3c31de9e3", + "sha384": "fe798718bb620d38444c3f43f17604b68a08f6c28635a094e48b6144bc49b7fbc7c82463e3834a80f3ea541d81b274d7", + "sha384WithRSAEncryption": "fe798718bb620d38444c3f43f17604b68a08f6c28635a094e48b6144bc49b7fbc7c82463e3834a80f3ea541d81b274d7", + "sha512": "1b627ee9d88d2c8ef7f883f7ca84d888e7fedfda36c32b2e2e2f066e29bb0b42938f4ae7e12b18840050a8f7494caa1699836ba921bc17d6708d503b893281f0", + "sha512WithRSAEncryption": "1b627ee9d88d2c8ef7f883f7ca84d888e7fedfda36c32b2e2e2f066e29bb0b42938f4ae7e12b18840050a8f7494caa1699836ba921bc17d6708d503b893281f0", + "shaWithRSAEncryption": "5494bdecd5ab6fc01c532190a7850b275160b657", + "ssl2-md5": "1149c8fc988799f43f6e5069355e108b", + "ssl3-md5": "1149c8fc988799f43f6e5069355e108b", + "ssl3-sha1": "ab3dd6221d2afe6613b815da1c389eec74aa0337", + "whirlpool": "2cb869fdc28019d68b2e5eb970d84ef87d9124e36df34c05716511c72926f3395396c7a4dc93c8ce31287befd7fd1f79c951a9a335056b57b965d18640137622" + }, + { + "input": "AAAAAAAD//////////////////4AAAAAAAAf/////////////////////4AAAAAAAAAAAAD////////////AAAAAAAAAAD/////////gAAf///AH////////gH//gAAAAAAAAAAAAAAAAP////////+AAAAAAAAAAAAAAAAAAAAAAB/////////8AAAAAAAAAH//////////wAAAAAAAAAAAAAADAf////////////////////+AAAAAAAAAAAAAAAf4AAAAAf/////+AAAAAAAAAAAAAAf/////////////////////AAAAAAAAAAAAAAAAAAAAAAAP////////////////AAAAAAAAAAAAAAAAAADwAAAAAAIAAAAAAAAAAAAAAAAAB/////////////////+AAAAAAA//////gAD//////////+AAA/////+AAAAAAAAAAAAAAAH/////////8AAAAAAAAAAAAAAAAAAAAAP///////////////8AAAAAH//////////////gAAAAB//////////8AAAAAAAAAAAAAAAAA/////////wAAAAAAAAAAAAAAAAAAAAP///////////////////AAAAAAAAP/////////////+AH/////////////AAAAAAAAAAAAAAAAAAf//////////////gAAAAAAAAAAAAAH///////////////////gAAAAH4AAAAAAAAAAAAAAAAAAH//////////////gAAAAAD//////AAAAAAH/////////+P/wAAAAAAAAAAAAAAAAAAAAAD///////////8AAAAAAAAAAAAAAAAAAAAAAH/////wAAAAAAAAAAAB/////////////wAAAAAAAAAAAAAAAAAAH/////////////////gAAAAAAAAAAAAAAAAAAAAAAH//////////////////gA////////////////////4AAAAAAP////////////////4AAAAAAA///////////////+AAAAAAAAAAAAAB///////////8AAAAAAAAAAAAAAAAAH/8AAAA//////////////////wAAAAAAAAAAAAAAAP/////////8AAP/////////////////4AAAAAAAAAAAAAH/////////wAAAAAAAAf/////4AAAA/wAAAA//gAAAAH//////////////////////wAAf//////////////////////gAAAAAA////////////////////wAAAAAP///////////////+AAAAAAAAAAD////////////////gAAAAAAAAAAAAA//////AAAAAAAAAAAAAAAAAAD////4AAAAAAAD///////////wAAAAAAAAAAAAAAAP////////////////////wAAAAAAAAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAAAAAAAAAAAAcAAD//4AAAAAAAAAAAAAAAAAAAAH///////////////////////gAH/////8AAAAAAAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAAAAAAf//////gAP//8AAAAAAAAAAAAAH//////4AAAAAAAAAAAAAAAAAAAAAAD/////////////4AAAAAAAAH///////8AAAAAAAAAP//////wH//////////////////////wAAAAf///////gAB////////////////////AAAAAAAAAAAAAAAAAAAAAf////+AAAAAAAAH//////////////////////+AAAAAAAAAAAAAAAAAH////////////////////+AAAAAAAAAH/////4AAAAAAAAAAAAAAAAAAAAf/////////////AAAA///////////4AAAAAAAAH/////////8AAAAAAAAAAAAAAAAAAP//gf///////////////AAAAAAAAAAAAAAAAf///gAAAAAAAAD//////////////AAAAAAAAAAAAAAAAAAAAD/////////4AAAAAAAAAAAP///////////////////gAAAAAAAAAAIAAAAAAAAAAAAAAAAAD////////8AAAAAAAAAAA////////gAAAAAAAAD/////////////////////8AAAAA+AAAAAAAAAAAD//////////////////4AAAAAAf////////////4AAAAAAAAAAAAAAAAB////////////wAAAAAAAAAAAAAAAAA//////////////////////gAAAAP////////////////////wAAAAAAAAAAAAAAAAAAAAA/////////////////wAAAAAAAAAD/gAAAAAD///////AAAAAAAAAAA///////////////////wAAAAAAAAAAAAAAAAAAAAAAB//////////////////////wAAAAAAAAAAAAAAAP/////////////////////wAAH//////wAAAAAAAAAAAAAAAAAAAH////////////////////4AAAAAAAAAAAAAAAAAAAAf////////////APAAAAAAAAAA/////////////8D////////////////4AAAAAAAAAAAAAAAAAAAAf//////////////AAAAAAAAH////////////////////AAAAAAAA//////8AAAAAAAAAAAAAB////////////8AAAf/////////////////+AH///////////AAAAAAAAAAA///////////////////gAAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAP////wAAAAAAAAAAAAAP//////////gAAAAAAAAAAAAH////////////////8AAAAA/////////////////////+AAAAAAAAAAAAAAAAAAAAAAf///////////wAAAAAAAf+AAAAAAAAAAP/////+AAAAAAAAf//////////////8AAAAAB//////////////////////wAAAAAAAAAAAAAAAAAAP//////////+AAAAAAAB/////4AAAAAAAAAf///AAAAH/////////////////////8AAAAAB/wAAAAAA////////////////wAAAAAAf//////////////////wAAAAAAAAAAAAAAAB///////////4AAAAAAAAAAAAAP////gAAAAAAf//////////wAAAAAAAAAAAAAAAAAAAAAH////////8AAAAAAAAAAAAB/////////////gAAAAAAAAAAAAAAP///////////////////8ADAAAAAAAAAAAAAAAAAAAf/////////////////+AAAAAAAA=", + "DSA": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "DSA-SHA": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "DSA-SHA1": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "DSA-SHA1-old": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "RSA-MD4": "f7cb5e6e54cac8107cc3af4ba9f63ea2", + "RSA-MD5": "4129891ff13ddd62820f6f3cdbfa95da", + "RSA-MDC2": "04a5d8697c894898bd92a7588f14a7be", + "RSA-RIPEMD160": "41987e239a937f420a323d696efbc730f276cbee", + "RSA-SHA": "ee2a1fc86530939c3487529b90ce66783750c566", + "RSA-SHA1": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "RSA-SHA1-2": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "RSA-SHA224": "5d0dfeae80140c02dbc13963740787551048288d93fb7de3fe932ac6", + "RSA-SHA256": "6ebf98b52fc3c4e77257d176b47d10729baeec4066a9bc78a89d7d02af7ab2cf", + "RSA-SHA384": "946f233f6c9ac9581384e13395f91088774edfce52a408ecc440ebf64ac3279298d392687726f56cf3b78ac2c0775259", + "RSA-SHA512": "29bcfa8101e8288470c5bd0cf671f52dfc7e8a4fe0026d6d3b6bb86a84d995d9f684dcf6e5a6870cec74f2fa252fa99f5e38144033f105c723d6256199e143f9", + "dsaEncryption": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "dsaWithSHA": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "dsaWithSHA1": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "dss1": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "ecdsa-with-SHA1": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "md4": "f7cb5e6e54cac8107cc3af4ba9f63ea2", + "md4WithRSAEncryption": "f7cb5e6e54cac8107cc3af4ba9f63ea2", + "md5": "4129891ff13ddd62820f6f3cdbfa95da", + "md5WithRSAEncryption": "4129891ff13ddd62820f6f3cdbfa95da", + "mdc2": "04a5d8697c894898bd92a7588f14a7be", + "mdc2WithRSA": "04a5d8697c894898bd92a7588f14a7be", + "ripemd": "41987e239a937f420a323d696efbc730f276cbee", + "ripemd160": "41987e239a937f420a323d696efbc730f276cbee", + "ripemd160WithRSA": "41987e239a937f420a323d696efbc730f276cbee", + "rmd160": "41987e239a937f420a323d696efbc730f276cbee", + "sha": "ee2a1fc86530939c3487529b90ce66783750c566", + "sha1": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "sha1WithRSAEncryption": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "sha224": "5d0dfeae80140c02dbc13963740787551048288d93fb7de3fe932ac6", + "sha224WithRSAEncryption": "5d0dfeae80140c02dbc13963740787551048288d93fb7de3fe932ac6", + "sha256": "6ebf98b52fc3c4e77257d176b47d10729baeec4066a9bc78a89d7d02af7ab2cf", + "sha256WithRSAEncryption": "6ebf98b52fc3c4e77257d176b47d10729baeec4066a9bc78a89d7d02af7ab2cf", + "sha384": "946f233f6c9ac9581384e13395f91088774edfce52a408ecc440ebf64ac3279298d392687726f56cf3b78ac2c0775259", + "sha384WithRSAEncryption": "946f233f6c9ac9581384e13395f91088774edfce52a408ecc440ebf64ac3279298d392687726f56cf3b78ac2c0775259", + "sha512": "29bcfa8101e8288470c5bd0cf671f52dfc7e8a4fe0026d6d3b6bb86a84d995d9f684dcf6e5a6870cec74f2fa252fa99f5e38144033f105c723d6256199e143f9", + "sha512WithRSAEncryption": "29bcfa8101e8288470c5bd0cf671f52dfc7e8a4fe0026d6d3b6bb86a84d995d9f684dcf6e5a6870cec74f2fa252fa99f5e38144033f105c723d6256199e143f9", + "shaWithRSAEncryption": "ee2a1fc86530939c3487529b90ce66783750c566", + "ssl2-md5": "4129891ff13ddd62820f6f3cdbfa95da", + "ssl3-md5": "4129891ff13ddd62820f6f3cdbfa95da", + "ssl3-sha1": "0706d414b4aa7fb4a9051aa70d6856a7264054fb", + "whirlpool": "74784784f3813eeea466ba58d7299eaec37930a54ec9003ce90f44dc935b75a00291e333e94064885e1b7fb25cccae6076cb7ea5496e107d38456af7ed180b4d" + }, + { + "input": "/////4AD////////////////gAAAAAAAAAAAAAAAAAAAAAAQAAAAAAP//////////////gAAAAAAAAAAAAAAAAAAB//////////////wAAAAAAAAAAAAAAAAAAf///////////////8AD//////////////////////AAAAAAAAAAAAAAAAAAAAAAAD////////////////wAAAAAD4AAAAAAAAD////////////gAH/////////////////+AAAAAAAAAAAAAAAAAB//////+AAAAAAAAAAH/////////////////////gAAAAAAAAAAAAP//////////////////////wAAAAAAAAAD//////////wAAAAAAAAAAB/////////wAf///////////////////8AAAB/////////8AAP/////////////////+AAAAAAAAAAAAAAAH///4AAAAAAAAAAP////wAAAAAAAB///////////////////8AAAAAAAD/////////////////4AAAAAAAAAAAAAAB/////////////+AAAAAAAAAAAP////AAAAAAAAAAAAAAAAAAAAAAD///////////////////////4AAAAAAAAH//+B///////////4AAAAAAAP///////////////////////AAAAAAAAAADwAAAAAAAAAAf/////////AAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAA////////////////////////wAAAAAAAAAAAAAAAAP////////////////////gAAAAAAAAAAAAAAAAAAH/////////AAAAAAAAAAAAAAAAAAAAAAB//////////////////////8AAAAAAAAAAAD///////8AAAAAAAAAAAAAAAAAAAAA/////////////B/////////////gAAAAAAAAAD////////8AAAAAAAAAAAAAB////+AAAH/////////////////////AAAAAAAAAAAP//+AAAP///////////8AAAAP////////////////////8AAAAAAAAAAAAAAAAAH////AAAAAAAAAAwAAAAAAAAAAAAAAB///////////////8AAAAAAAAAAAH/////8AH/////8AAf/////8AAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAH//////////wAAAAAAAAAAAAD/////////4AAAAAAAAf//////////////////AAAAAD///AAAAAAAAAAAf/////////gAAAD/////////////gAAAAAAAAAAAAAAAAAAAAAD///////wAAAAAAAAAAAAAAAAA/////////////////8AAAAAAAAAAAAAAAAD///////////AAAAAAAAAAAAAAAAAAAAAP//gAD////////////////wAAAAAAAAAAAAAAAAAAAA//4AAAAAAD//////////////////////wAAAAAAAAAAAAAAAAAAAD////////////////wAAAAAAAAAAH///////////////////////gAAAAA//wAAAAAAAAf///////////////////n//////////////wAAAAAAAAAAAAAAB////////////////wAAAAAAAAAAAH/AAAAAAAAAAAAAAAAAAAAP/////+AAAAAAAAAAAAD//gAAAAAAAAAAAAAAAf//////////////gAAAAAAP////////////4AAAAAAAAAAAAAAAAAAAAAB/////////+AAAAAAAAAAAAAAAf////////////////8AAAAAAAAB///////////////+AAAAA///////////////////+AAAAAAAAAAAAD///////////////+AAAAAAAAAAAB///8AAAAAAAAAAAAAAAAAAAAAAA//////wAAAAP//////4AAAAAAAAAAAAAP//////////////////////AAAAAAAAAAAAAAD/////////////////4AAAAAAAAAAAAAAAAAAA////////////AAAAAAAAAAAAAAAAAAf//////////////////+AAAAAAAAAH//////////////8AAAAAAAAAAAAAAAAAAAH///////////8AAAAAAAAAAAAAAAH////////////////gAAAAAAAAA///////////////////////AAAAAAAAAAAAAAAAAAAAH////////4AAAAAAAD///////////////////////4AAAAAAAB//////////////////////AAAAAAAAAAA/////////////////8AAAAAAAf////////////4AAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAAD4AAAAAAAAAP////////////gAAAAAAAAAAAAAAAA////////////wAAAAAAAAAAAAAAAAAD/////////////////AAAAAAD///////////////AAAf////////////AAAAAAAAAAAAD//////////////AAAAAAAAAAAAAAAAA/////////////////////4////////////////////////AAAAAAAAAAAAAAAAB///////////////////////AAAAAAAAAAAAAAAAAAAAAAP////////8AAAAAAAAAAAAAAD//8AAAAAAAAAAAAAAB///////////////4AAAAAAAAAAAAAD////////+AH//////////////////////wAf////////+/////////////////+AAAAAAAAAAAAAAAAAAD///////////wAAA/gAAAAAAAAH////wAAAAAAAAAAAAAAAAAAAAAAAf/////////////////8A///////8AAAAAAAf//////////////////4AAAAAAAAAAAAAAAAAAAB/////////////////////wAAAAAAAAAAAAAAfwAAAAAAAAAAAAAAAAAAAH////////wAAAAAAAAAAAAAAAf/4AAAAAAAD///////////////////wAAAAAAAAAD////////////////////4AAAAAAAAAAAAAAD/////+AAAAAAAAAAAAAAAA//4AAAAAP////////////////AAAAAAAAAAH//////////////////////+AAAAAAAAAAP///////8AAAAAAAAf////////+AAAAf////////////////////wP//////+AAAAAAAAAD////////////////8AAAAAAAAAAAAAAAAAAAB//////////////////+AAAAAAAAAAAAAA///////////////////////4AAAAAAAAAAAAAAAAAAAAAA/8AAAAAAAAAAAD//+AAAAAAAAAAAAAAAAAH//////////4AAAAAAAAAAH//////wAAAAAAAAf/wAAAAACAAAP////////////////4AAAAAAAB/////////////////+AAAAAAAH///////////////////w==", + "DSA": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "DSA-SHA": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "DSA-SHA1": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "DSA-SHA1-old": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "RSA-MD4": "8d80f6efa5a33bfc364c29860f6c2e25", + "RSA-MD5": "c8758df3c9ad4d311516ea39fe734052", + "RSA-MDC2": "719abf1d4baacdcc5cc747328b7231d6", + "RSA-RIPEMD160": "6ee029c2ffb38ece99bedc4e6e32cfea24bd1d9a", + "RSA-SHA": "033cf8ed34dba8f75bb281ba68d864ed597eff88", + "RSA-SHA1": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "RSA-SHA1-2": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "RSA-SHA224": "3d27689a41ba35dfa6e8504f64cd306d541a1d4694043290bea2b0f6", + "RSA-SHA256": "366cd811c075198d1749db7075c4c333b6f347b64e44b3744ef28a3957a0feb1", + "RSA-SHA384": "6139eb7aa8011ddaab07af0503b889c8ab9331438b08407408802bc2df5b732dd0d710a3f1d175d1e270baa1c78e1ca1", + "RSA-SHA512": "d275f1f6410bf258738b02db1348af55ec1fa524240e9516e5b4ba9066a930e781d7236d7257c998800e64349fa1ffa78d168bf8a626dade502af7472f3f3298", + "dsaEncryption": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "dsaWithSHA": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "dsaWithSHA1": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "dss1": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "ecdsa-with-SHA1": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "md4": "8d80f6efa5a33bfc364c29860f6c2e25", + "md4WithRSAEncryption": "8d80f6efa5a33bfc364c29860f6c2e25", + "md5": "c8758df3c9ad4d311516ea39fe734052", + "md5WithRSAEncryption": "c8758df3c9ad4d311516ea39fe734052", + "mdc2": "719abf1d4baacdcc5cc747328b7231d6", + "mdc2WithRSA": "719abf1d4baacdcc5cc747328b7231d6", + "ripemd": "6ee029c2ffb38ece99bedc4e6e32cfea24bd1d9a", + "ripemd160": "6ee029c2ffb38ece99bedc4e6e32cfea24bd1d9a", + "ripemd160WithRSA": "6ee029c2ffb38ece99bedc4e6e32cfea24bd1d9a", + "rmd160": "6ee029c2ffb38ece99bedc4e6e32cfea24bd1d9a", + "sha": "033cf8ed34dba8f75bb281ba68d864ed597eff88", + "sha1": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "sha1WithRSAEncryption": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "sha224": "3d27689a41ba35dfa6e8504f64cd306d541a1d4694043290bea2b0f6", + "sha224WithRSAEncryption": "3d27689a41ba35dfa6e8504f64cd306d541a1d4694043290bea2b0f6", + "sha256": "366cd811c075198d1749db7075c4c333b6f347b64e44b3744ef28a3957a0feb1", + "sha256WithRSAEncryption": "366cd811c075198d1749db7075c4c333b6f347b64e44b3744ef28a3957a0feb1", + "sha384": "6139eb7aa8011ddaab07af0503b889c8ab9331438b08407408802bc2df5b732dd0d710a3f1d175d1e270baa1c78e1ca1", + "sha384WithRSAEncryption": "6139eb7aa8011ddaab07af0503b889c8ab9331438b08407408802bc2df5b732dd0d710a3f1d175d1e270baa1c78e1ca1", + "sha512": "d275f1f6410bf258738b02db1348af55ec1fa524240e9516e5b4ba9066a930e781d7236d7257c998800e64349fa1ffa78d168bf8a626dade502af7472f3f3298", + "sha512WithRSAEncryption": "d275f1f6410bf258738b02db1348af55ec1fa524240e9516e5b4ba9066a930e781d7236d7257c998800e64349fa1ffa78d168bf8a626dade502af7472f3f3298", + "shaWithRSAEncryption": "033cf8ed34dba8f75bb281ba68d864ed597eff88", + "ssl2-md5": "c8758df3c9ad4d311516ea39fe734052", + "ssl3-md5": "c8758df3c9ad4d311516ea39fe734052", + "ssl3-sha1": "3cbf8151f3a00b1d5a809cbb8c4f3135055a6bd1", + "whirlpool": "030e9a17c45329df995ea0cb972fa1bd8a2a50b620630acf876437c55a285a76f861b86d3640cf1e1c37368c53a80ba2cbc1504404aaacc82857bbc4095d647c" + }, + { + "input": "///////8AAAAB/////////////////////+AAAAAAAAAAAAAAAAAAH////gAAAAAAAAAD////////////////////wAAAAAAAAAAAAAAAH/////////////////////AAAAAAAf/////+AAAAAAAAAAAB////////////////wAAAAAAAAAAAAAAAAAf/////////////////////gAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAAAB////////////////////AAAAAAAAAAAAAAAAAAAAAAAA///////////////////8AAAAAB/////////////wAAAAAB///////////////4AAAAAAAAAH////////8AAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAAAB//////////////////gAAAAAAAAAAAD//////8AD//////////////////////+AAAAAAAAAAAAAAAAAAAAAAD//////+AAAAAAAAAAAAAAAAAAAAAf////////////////+AAAAAAAAAAAAAAAAAD//+AAAAAAAAAAAAAAAAAAAAB/+AAAAAAAAAAAAAAAAD////////////////////////wAAAAAAAAAAAAAAAAAAAAH//AAAAAAAAAAAAAAAAAAAH////////////////////wAAAAAAAAAAAAAAAAAAAAf/////////4AAAAAAAAAAAAAAAH/8AAAAAAAAAAAAP///////////AAAAAAAAAAAAAAAA////////////////+AAAAAAAAAAAAAAAAAAf//////////////////////gH///////////////wAAAAAAAAAAAA///////////////////////+AAD/////AAAAAAAAAAAAAAAAf////////////wAAAAAAAAAAAAAAAAAAAAAAAAf/////8AAAAB///////////////4AAAAAAAAAAAAAAAAAAAA///4AAAAAAP/////////////////////+AAAAAAAAA//////////////AAAAAAAAAAAD/////gAAAAAAAAAAAAAAAAAAAAAD///////////////////wAAAAAAAD//////////AAAAAAAAAAAAAAAAAAAAf////////////9///////wAAAAAAAAAAAAAAAAAAAAAAAP//////////////+AAAAAAAAAB8AAAAAAAAAAP//////////////////////gH/////////////////AAAAAAAAAAAAAAAf////////////+AAAAAAAAAAA////4AAAAAAAAAAAAAAAAAAP///////////////////gAAAAAAAA///AAAAAAAAAAAAAAAAP////////////4AAAAAAAH/////////////4AAAAB//////////////////////wAAAAAAAAAAAAAAAAAAAAD7///AAAAAAAAAAAAD//4AAAAAAAAAAAAAD/////////////////8AAAAAAAAAAAD/////8AAAAAAAAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAD////////////////////////8AAAAAAAAAAAAAAAAAf////////////////4////////////////////////+AAf////////gAAf///////////////////////+AAAAAAAAAAH///////8AAAAAAAAAAAAAAAAAAAAH/////8AAAAP////AAAAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAB///////////////AAAAAP/////////////AAAAAAAAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAAH///////////AAAAAAAAADAAAAAAAAAD//////////////////+AP/////////////////wAAAAAAAf/////////AAAAAAAAAAB//gAAAAAAAAAAAAAAH8P/////////////8AAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAP//////////////8AAAAAAAAAAAAAAAH/////+AAAAAAAAAAAAAAAH/gB///////+AAAAAAAAAAAAAAAA/////////////////wAAAAAAAAAAP//////////////////4AAAAAAAAAAAAAAAD///////////////////////wAAAAAAAAAAAAAAAAAAH///////////////////+AAAAAAAAAAAAAAAAAAAD//////wAAAAAAAAAAAAAAAH//gAAAAH///////wAAAAA//////////////8AAAAAAAAAAAAAAH///+AAAAAAAAf/gAAAAAAAAAAAB/////////////gAAAAAAAD//////wB//////////////////////AAAA///////wAAAAAA////////////////////wAAAAAAAAAAAAAP/////////////////wAAA///////////////////////8AAAAAAAAAAAAAAAAAAAAAAA////////////////4AAAAAAB//wAAAAAAAAP8AAAAAAD////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////gAAD////////////+AAAAAAAAAAAAAAAAAAAAH/////////+AAAAAAAH///////////////////wAB////8AAAAAAAAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAAAAAAAAAAP///////////gAAAAAAAAAP//////////8AAAAAAAAAAAAA///////////////////AgAAAAAAAAAAB////////////////////AAA/////+AAAAAAAAAAAAAAAAAAD/////////AAAAAAAAAAAAAAH/////////////+AH///////////8AA////+AAAAAAD///////////8AAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAB//////////////wAAAAAAAAAAAAAAAAf///////////////////8AAAAAAAAAH//////////////4AAAAAAAAAAAAAAAAAAAAAAAf////////////AAAAAAAAAAAAAAAAAAAAAAf///////+AAAAAAAAAAAAB///////+AAAAAH//////////////////////4AAAAAAAAAAAAAAAAAAAAAB////wAAf/////////gAAAAAAAAAAAAAAAAAAAAA////////////////////////4AAAAAAAAAD///////////////gAAAAAAAAAAAAAAAAAAAAAAAB//////wAAAAAAAAAAAAAAAAAAAAAP///////4AAAAAAAAAB///////////8AAAAAD//////////////+H//////////////////////8AAAAAAAB////////////////4AAAAAAAAAAAAAAAAAAAH//////8AAAAAAAAAAAAAAAAAAH///////////////////////4AAAAH///////////////gAAAAAAAAAAAP////////////////////4AAAAAAf////////////////////", + "DSA": "da5d6a0319272bbccea63acfa6799756ffda6840", + "DSA-SHA": "da5d6a0319272bbccea63acfa6799756ffda6840", + "DSA-SHA1": "da5d6a0319272bbccea63acfa6799756ffda6840", + "DSA-SHA1-old": "da5d6a0319272bbccea63acfa6799756ffda6840", + "RSA-MD4": "6546fda809b5e5fa4b38b86c3f08843f", + "RSA-MD5": "360ddf0b658fd764ef5ae9bf7a8a1a12", + "RSA-MDC2": "2ff8e73b38b235c5ae4b3bfcb7e030d7", + "RSA-RIPEMD160": "03f065c687b56eb6bdd5f488c4b8a2bdc55a28f3", + "RSA-SHA": "b02770779defe28faf4284b94c11a13087ced56f", + "RSA-SHA1": "da5d6a0319272bbccea63acfa6799756ffda6840", + "RSA-SHA1-2": "da5d6a0319272bbccea63acfa6799756ffda6840", + "RSA-SHA224": "7f0f3f16f5d0175266c387e8d0f29bad99dfd4c94d0a8fb956a21084", + "RSA-SHA256": "712157d7d59011c4bf1ee690217f4b0f855816e9bbee6b6aff277b9645340c9a", + "RSA-SHA384": "71affb53c90f2e80fe33cd5072bb64a2f597d6a5c7d694a46bd8c188863d8a66c7403218706656c4e58245716097bd47", + "RSA-SHA512": "9892c6d0f13e39f870d42d1bec54a4cd1823c502026f891227fecf7cd262f10a5b35f3d9b96831ebc4801ffa864ace05b1ba80b31eb91f7031ba8e07f6a91204", + "dsaEncryption": "da5d6a0319272bbccea63acfa6799756ffda6840", + "dsaWithSHA": "da5d6a0319272bbccea63acfa6799756ffda6840", + "dsaWithSHA1": "da5d6a0319272bbccea63acfa6799756ffda6840", + "dss1": "da5d6a0319272bbccea63acfa6799756ffda6840", + "ecdsa-with-SHA1": "da5d6a0319272bbccea63acfa6799756ffda6840", + "md4": "6546fda809b5e5fa4b38b86c3f08843f", + "md4WithRSAEncryption": "6546fda809b5e5fa4b38b86c3f08843f", + "md5": "360ddf0b658fd764ef5ae9bf7a8a1a12", + "md5WithRSAEncryption": "360ddf0b658fd764ef5ae9bf7a8a1a12", + "mdc2": "2ff8e73b38b235c5ae4b3bfcb7e030d7", + "mdc2WithRSA": "2ff8e73b38b235c5ae4b3bfcb7e030d7", + "ripemd": "03f065c687b56eb6bdd5f488c4b8a2bdc55a28f3", + "ripemd160": "03f065c687b56eb6bdd5f488c4b8a2bdc55a28f3", + "ripemd160WithRSA": "03f065c687b56eb6bdd5f488c4b8a2bdc55a28f3", + "rmd160": "03f065c687b56eb6bdd5f488c4b8a2bdc55a28f3", + "sha": "b02770779defe28faf4284b94c11a13087ced56f", + "sha1": "da5d6a0319272bbccea63acfa6799756ffda6840", + "sha1WithRSAEncryption": "da5d6a0319272bbccea63acfa6799756ffda6840", + "sha224": "7f0f3f16f5d0175266c387e8d0f29bad99dfd4c94d0a8fb956a21084", + "sha224WithRSAEncryption": "7f0f3f16f5d0175266c387e8d0f29bad99dfd4c94d0a8fb956a21084", + "sha256": "712157d7d59011c4bf1ee690217f4b0f855816e9bbee6b6aff277b9645340c9a", + "sha256WithRSAEncryption": "712157d7d59011c4bf1ee690217f4b0f855816e9bbee6b6aff277b9645340c9a", + "sha384": "71affb53c90f2e80fe33cd5072bb64a2f597d6a5c7d694a46bd8c188863d8a66c7403218706656c4e58245716097bd47", + "sha384WithRSAEncryption": "71affb53c90f2e80fe33cd5072bb64a2f597d6a5c7d694a46bd8c188863d8a66c7403218706656c4e58245716097bd47", + "sha512": "9892c6d0f13e39f870d42d1bec54a4cd1823c502026f891227fecf7cd262f10a5b35f3d9b96831ebc4801ffa864ace05b1ba80b31eb91f7031ba8e07f6a91204", + "sha512WithRSAEncryption": "9892c6d0f13e39f870d42d1bec54a4cd1823c502026f891227fecf7cd262f10a5b35f3d9b96831ebc4801ffa864ace05b1ba80b31eb91f7031ba8e07f6a91204", + "shaWithRSAEncryption": "b02770779defe28faf4284b94c11a13087ced56f", + "ssl2-md5": "360ddf0b658fd764ef5ae9bf7a8a1a12", + "ssl3-md5": "360ddf0b658fd764ef5ae9bf7a8a1a12", + "ssl3-sha1": "da5d6a0319272bbccea63acfa6799756ffda6840", + "whirlpool": "e64a7eada9c6be478bcc285e8ad70c6e90e216ec90af849d5e2b2ca7b5e221c2f301e9ef240f7abb7f56f9d5554727ea332202958bf2dc8fa15cf985f83f1a5e" + }, + { + "input": "/////+AAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAH/////////////////AAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAA/////AAAAAAAAAAAH/////////8AAAAAAP///////gAAD/////////////////4H//////AAAAAAAAAAAAAH//////////////////4AAAAAAAAP////////////////////gAAAAAAAA////////////////////////4AB4AAAAAAAAAAAD////////////////////////AAAAAAAAAAAAAAAA////////////////wAH//////////////////////gA////////////////wAAAAAAAAAAAAAAAAAAB//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAAAAAB///////////8AAAAAAAAAAAAAAAAf/////////////+A///////////////////////gAAAf/wAAAAAf///////AAAAAAAAAAAAAAAAf///////////////////////wAAAAAAAAAAAD/////8AAAAAAAAAAAAAAAAAAAHAAAAAAAAH/////////////4AAAAAAAH///////////////////wAAAAAAAAf///////wAB/////////////AAB///////////////////+AAAAAAAAAAAAAAAAA////////////////////////8AAAAAAAAAAP////wAAAAAAf///////////////wAAAAAAAAAAAAAAAAAAAP///////////+AAAAAAAAAAAAAAAAAAP/////////+AAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAAAAAAAD//8AB/4AAAAAAAH//4AAf///////gAAAAAAP/+AAAAAAAAB//+AAAAAAD///////4AAAAAAAAAAAAAAAAAAAB///////////////////////+AAAAAAAAAAAAAf//////////////4AAAAAAAAAAAAAAAAAAAAAAAD////////////7/////gAAAAAAAAAAAAAA/////////AAAAAAAD////////////8AAAAAAAD///gAAAAAAAAf//////wAAAAAA////////+AAAB//4AAAAAAAAAAAD//////8AAAAAAAAAAAAAAAP////gAAAAAAH/////gAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////8AAAH////////////////////AA///////////////////////8AAAAAAAAAAAAAAAAAAAAAAA///////gAAAAAP//////////////AAAAB///AAAAAB///////////+AAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAAAAAAAAAAAAAAD//////////AAAAAAAAAAAAAAAAAAD/////wAAAAAP//////////////4AAAAAAAAAAAAAAAAAAAH///////+AAAAAAAAAAAAAAAAAAH//////////////////////5/////////////////wAAAAAAAAAP//////////8AAAAAAAAAAAAAAAAAAAAAAH/////////////////////wf//AAAf//////////////////////wAAAAAAAAAAAD/4AAAAAAAAAAAAAAAAAAAH////////////4AAAAAAAAAAAAAAAAAAAAAAAAP/////////AAAAAAAAAAAAAAAAAAAAAP/+AAAAAAAAAAAAAAAAAf/+AAAAAAAAAAAAAAAAAAAAB////////////+AAAf////////8AAAAAAAAAAAAAAAAAAAAAA///////////+AAAAAAAA///////////////AAAAAAAAAAAAD/////////////////8AAAAAAAAAAAAAAAAAAAAD////////////////wAAAAAAAAP//////////8AAAAAAf/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAD//////8AAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////4AAAAAAAAAAAAAAAAAAAAf/////////4AAAAAAAAAAAAAA/////+AAAAAAAAAAAAP/////////4AAAAAAAAAAP///////AAAAAAAAAAAAAAAAD/////////////wAAAAAAAAAAAAAAAAB//////////////////8AAAAB//////////wf///////////////AAAAAAAAA///////////+AAAAAAAAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAB/////////////gAAAAAf///////////////////////n/////////////////////gAAAAAAAAA////////////wAAAAABwAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////+AAAAAAAAAAAAAAAAAAAAf//gAAAAAAAAAAAAAAAAAAD/8AAAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAAAAAP/////////////////////+AAAAAAAAAAf/////gAAAAAAAAAAD4AAAAAA////////+AAAAAAAAAAAAAAAAAAAAAAAAB////////4AAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////+AAAAB//////////+AAAAAAAAAAAAAAAB////////////////////+AAAAAAAAAAAAAAAAAAAAAD/////////AAAAAAAAAAAAAAAAAAAAAAB/gP/////////////8AAAAAAAAAAAAAAAAAAAAAAAP/8B//////////////////wAAAAAAAAAAAAAAAAAAAAAAB///////////////wAAAAAAAAAAAAAAAAAAAAAA//////////////////////+AAAAAAAAAAAAAAAAAAAAAAf//////wAP//////////////gAAA///////wB/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAH///////////////////8AAAAAAAAAAAAAAAB///AAAAAAP/////////////////8AAAAAAAAAAAAAAB///////////AAP////8AAAAAAAAAAAAAAAAAA///////////AAAAAAAAAAAP8AAAAAAAAAAAAAAAAAAAAAP/////////////wAAAAAAAAAAAH///////////////////gAAAAAAAAA////AAAAAAB///////////+AAAAAAAAAAAAAAAAAAAA/////////////////////////AAAAAAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAP///+AAAAAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAAAAAAAB/wAAAAAAAB//////////////////AAAAAAAB////////////////////8AAAAAAAAAAAAAAAAAB////////////////////////4B////8AAAAAAAH///////////4AAAAAAAAAAAAAAAAAAAAAAAB////////////////////////8AAAAAAAAAB///////////////wA///wAAAAAAAAP/+AAAAAAAAAAAAH/////////////////////8AAAAAAAAAAAAAAAAAAAAH/////////////////gAAAAAAAAAAAAAAAAAH//////////8=", + "DSA": "fb4429c95f6277b346d3b389413758dfffeedc98", + "DSA-SHA": "fb4429c95f6277b346d3b389413758dfffeedc98", + "DSA-SHA1": "fb4429c95f6277b346d3b389413758dfffeedc98", + "DSA-SHA1-old": "fb4429c95f6277b346d3b389413758dfffeedc98", + "RSA-MD4": "2bc7fb69124709e4b8cef5e7712f0bb8", + "RSA-MD5": "ad054e0e84e2b8e2b02ce4dee7688226", + "RSA-MDC2": "17eee41c2c589421a9401a40401b3ebf", + "RSA-RIPEMD160": "301d89c7e32a0b04aa270f1f0cfef5fe58e991fa", + "RSA-SHA": "815900828bfe76a949b4e5e6199e54b416bce6cd", + "RSA-SHA1": "fb4429c95f6277b346d3b389413758dfffeedc98", + "RSA-SHA1-2": "fb4429c95f6277b346d3b389413758dfffeedc98", + "RSA-SHA224": "fb5ac6df4aa6ee0a1e2169e7ed664d5c5bbde1c2252ad5e2f8f9b2e3", + "RSA-SHA256": "1dc0a697f2a7c1da301b256e6822879f212beb56fbc7fe1b8e877ccd964c132a", + "RSA-SHA384": "5a144d494964339214820a98f54a8b461eb9ee47dceb866dad4c9f6002d08d93eddceaf3abe250aa35e33dccc115fdd4", + "RSA-SHA512": "7408a856c2075aae53b77304272161cf6847cef3d4ae8ba3d12c9c9e51ad345049800b7e663e9e75d8e9f8728bea66d2ad46c292625ac850554b3faf605f9956", + "dsaEncryption": "fb4429c95f6277b346d3b389413758dfffeedc98", + "dsaWithSHA": "fb4429c95f6277b346d3b389413758dfffeedc98", + "dsaWithSHA1": "fb4429c95f6277b346d3b389413758dfffeedc98", + "dss1": "fb4429c95f6277b346d3b389413758dfffeedc98", + "ecdsa-with-SHA1": "fb4429c95f6277b346d3b389413758dfffeedc98", + "md4": "2bc7fb69124709e4b8cef5e7712f0bb8", + "md4WithRSAEncryption": "2bc7fb69124709e4b8cef5e7712f0bb8", + "md5": "ad054e0e84e2b8e2b02ce4dee7688226", + "md5WithRSAEncryption": "ad054e0e84e2b8e2b02ce4dee7688226", + "mdc2": "17eee41c2c589421a9401a40401b3ebf", + "mdc2WithRSA": "17eee41c2c589421a9401a40401b3ebf", + "ripemd": "301d89c7e32a0b04aa270f1f0cfef5fe58e991fa", + "ripemd160": "301d89c7e32a0b04aa270f1f0cfef5fe58e991fa", + "ripemd160WithRSA": "301d89c7e32a0b04aa270f1f0cfef5fe58e991fa", + "rmd160": "301d89c7e32a0b04aa270f1f0cfef5fe58e991fa", + "sha": "815900828bfe76a949b4e5e6199e54b416bce6cd", + "sha1": "fb4429c95f6277b346d3b389413758dfffeedc98", + "sha1WithRSAEncryption": "fb4429c95f6277b346d3b389413758dfffeedc98", + "sha224": "fb5ac6df4aa6ee0a1e2169e7ed664d5c5bbde1c2252ad5e2f8f9b2e3", + "sha224WithRSAEncryption": "fb5ac6df4aa6ee0a1e2169e7ed664d5c5bbde1c2252ad5e2f8f9b2e3", + "sha256": "1dc0a697f2a7c1da301b256e6822879f212beb56fbc7fe1b8e877ccd964c132a", + "sha256WithRSAEncryption": "1dc0a697f2a7c1da301b256e6822879f212beb56fbc7fe1b8e877ccd964c132a", + "sha384": "5a144d494964339214820a98f54a8b461eb9ee47dceb866dad4c9f6002d08d93eddceaf3abe250aa35e33dccc115fdd4", + "sha384WithRSAEncryption": "5a144d494964339214820a98f54a8b461eb9ee47dceb866dad4c9f6002d08d93eddceaf3abe250aa35e33dccc115fdd4", + "sha512": "7408a856c2075aae53b77304272161cf6847cef3d4ae8ba3d12c9c9e51ad345049800b7e663e9e75d8e9f8728bea66d2ad46c292625ac850554b3faf605f9956", + "sha512WithRSAEncryption": "7408a856c2075aae53b77304272161cf6847cef3d4ae8ba3d12c9c9e51ad345049800b7e663e9e75d8e9f8728bea66d2ad46c292625ac850554b3faf605f9956", + "shaWithRSAEncryption": "815900828bfe76a949b4e5e6199e54b416bce6cd", + "ssl2-md5": "ad054e0e84e2b8e2b02ce4dee7688226", + "ssl3-md5": "ad054e0e84e2b8e2b02ce4dee7688226", + "ssl3-sha1": "fb4429c95f6277b346d3b389413758dfffeedc98", + "whirlpool": "489a476b2183c672c1dd57d981d54730c64f6c185c1443919d6a2375b67dc9e45772ab3bb6c55d5933ee348c4b623f9505d1c69e472299e79eb0d0fd8bb3d9c6" + }, + { + "input": "AAAB/wAAAD//////////////////////wAAAB////////wAAAAAAAAAAAAAAAAAAH///////////////////+AAAAAAAf////////////////+B////////////////////////gAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAAAAAf///////8A////////////////AAAAAAAB/////////gAAAAAAAAAAAAAAAAAAAAAA//////////wAAAAAAAAAf//////////////AAAAAAAAAAAAAAAAAAAAAAAB///////////8AAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAAAAAAAAH/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAD////////////////gAAAAAAAAAAAAAAAAAAAAAAAAB////+AAAAAAAAD//////////////////+AAAAAD////////////////////////gAAAAAAAAAAAAAAAAAf///////////////////////+AAAAAAAAAH////////gAAAB/////////////////AAAf//////////////4AAAAAAAAAAAAAAAP////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAA/8AH/8AAAAAAAAAAAAAAAAAAAAAAAAAH//////////8AH/////////////wAAAAAAAAAAAAAAAAf//////////8AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////4AAAAAAA///////////////////////4AB///////////////////+AAAAAAAAAAAAAAAAAAAAAP//////////////////////8AAAAAAAAAAAAAAAAAAAH/////////z//////////////4AAAAAAAAAAAD///////////wAAAAAAAAAAAAAf////AAD//////////+AAAAAAAAAAAAAP////v////////wAAAAAAAAAAf///////////////gAAAAAAAAAAAAAAAAAADAAAAAAf///////AAAAAAAAAAAAAAAAAAAAAP////+P//////////////gAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAAAAAAAAAAD///////+AAAAAAAAAAAAB////wAAAAAAAAAAAAAAAAH//////AAAAAAAAAAAAAAAAAAAB///////////////4AAAAAAAAAAAAAAAAAAAAAH//////////////4AAAAAB/////////////////////+AAAAAAAAA//////////+AAAAAAAAAAAAAAAAAAAAAD//////////////8AAAAAAAAAMAAAAAAAAD////////////////wAAAAAAAAAAB///////////////////4AAAf//////4AAD+AAAAAAAAAAAAAAAAAAAAAAAAH///////////////AAAAf////AAAAAAAAAAAAAAAAAAAAH/////////////AAAAAAAAAAD/////////////////////4AAAAAAAAD////9//////////////8AAAAAA////////////////gAAAAAAAAAAAAB//////////4A////8AAAAAAAAAAAAAA////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAAAAAAAAAH//////gAAAAAAAAAAAAAAAAAAAAAAAAB////////////////+H//////////////////AAAAAAAAAAB/wAAAAAAAAAB/////////8AAAAAAAAAAAAAAAAAAAAP//////////////////8AAAAAAAAAAAD/////////////////gAAAAAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAf///////////////wAAAAD///////////////////////+AAAAAAAAAAAAAAAAAB////////////+AAAAAAAAAAAAAAAAAAH///////+AAAAAAA/////8AAAAAAAAAAAAf//4AAAf////////////////////8AAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAH///////////+AAAAAAAAAAAAAAAAAAAAD///////////////////wAAAAAAAAB//8AAA/////////////////////4AAAAAAAAP//////////gAAAAAAAAAP///////////////////////3//wAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////AAAAAAAAD////////////////wAAAAAAAAP/+AAAf/////////AAAAAAAAD//////////gAAAAAAAAAAAAAAAAAAAAA///wAAAAAAAAB////////////////////4AAAAD////////////////////4AAAAAAAf////////////////+AAAAAAAAAAAAH//////////////+Af///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////4AAAAAAAAAAAAB//////////////////+AAP//////////////////////8AAAAAAAAAAAAAAAAAAAAAAP//////////////////AAAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAB////AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////gAAAAAAAAAAAAH////////////////AAAAAAAAAAAH/////////////wAAAAAAAH//////8AAAAAAAAAAAAAAAAAAAAAAAAAD////////////////8AAB/////////wAAAAAAAAAAAAAAAAAAAD///////////////8AAAADgAAAAAD//////////////////////AAAAAAD/////AAAAAAAAAAAAHwAAAAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAH/////////AAAAAAAAD////////////////////////8AAAAAAAAAAAAAAAAAAAAAP//wAAAAAAAAAAAAAAAAAAAAH/////AAAB///////////////////gAAAAAAAAAAAAAAAAA/////////////AAAAAAAAAAAAB////////////8AAAAAAD///////////gAAAAAAAAAAH///////4AAAAAAP//////////+AAAAAP///////////+AAAAAAH///////8AAAAAAAAAAAAAAAAAAAAA/////////////////h////////////////////////gAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAAAf////////////////////////4AAAAH/////+AB/////wf/////8AAAAAAAH//////wAAAAA//////////AAAAAAAAAAAAP//8AAAAAAD/////////////////////////8AAAAAAAAAAB///////4AAAAAAAAB////////////////+AAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAB/////////////wAAAAAAAAAAAAAAAB/////////////////gAAAAAAAAH///////+Af/////////wAAAAAAAAAAAD////////+AAP/////////////+AAAAAAAAAAAAAAAAAB////4AAAAAAAAAAAAAAAAAAAAAAH///////wAAAAAAAAAAAAAAB/////////+f///////////////////+AAAAAAAH////////////////////4AAAAAAAAAAAAAAAAD//////////////+AAAAAAAAAAAAAAAAAAAAAAAA//////AAAAf//////////////////4AAAAAAAAAAAAAAAAAAAB////////w==", + "DSA": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "DSA-SHA": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "DSA-SHA1": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "DSA-SHA1-old": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "RSA-MD4": "fe9d13ec54cf0573d1468ee1581530aa", + "RSA-MD5": "cb434f8c5fad9793ed142805afa861a0", + "RSA-MDC2": "456888fafa2c19d1ea569f25636b509d", + "RSA-RIPEMD160": "d823d5f6d68abcafac352520d2a5a177bd01df75", + "RSA-SHA": "5753c25555e8784edf30519ea754df4f2300507c", + "RSA-SHA1": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "RSA-SHA1-2": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "RSA-SHA224": "a7ebbedd41d6c7bec669b4caae19545a83644a3fc6758158bbf5d3c1", + "RSA-SHA256": "6fb0514a46f06be4bc3798ae82fa6cf14103926f1969b3d70910a9c5d9589e58", + "RSA-SHA384": "c77eee233bea537b97a91d4c661b47e400ce1ce1a9d1c486f9cb08f557b11aa9914f0cf6b22748609dd39378c29db50b", + "RSA-SHA512": "2e132f775423970174eff2ccad923875865ae6b92f1c5d24630dd494c3b8d3fb367ec1e00a67ed63b902338be4ecd4ddcd4a211d0015508d5a1e272a67a9716d", + "dsaEncryption": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "dsaWithSHA": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "dsaWithSHA1": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "dss1": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "ecdsa-with-SHA1": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "md4": "fe9d13ec54cf0573d1468ee1581530aa", + "md4WithRSAEncryption": "fe9d13ec54cf0573d1468ee1581530aa", + "md5": "cb434f8c5fad9793ed142805afa861a0", + "md5WithRSAEncryption": "cb434f8c5fad9793ed142805afa861a0", + "mdc2": "456888fafa2c19d1ea569f25636b509d", + "mdc2WithRSA": "456888fafa2c19d1ea569f25636b509d", + "ripemd": "d823d5f6d68abcafac352520d2a5a177bd01df75", + "ripemd160": "d823d5f6d68abcafac352520d2a5a177bd01df75", + "ripemd160WithRSA": "d823d5f6d68abcafac352520d2a5a177bd01df75", + "rmd160": "d823d5f6d68abcafac352520d2a5a177bd01df75", + "sha": "5753c25555e8784edf30519ea754df4f2300507c", + "sha1": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "sha1WithRSAEncryption": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "sha224": "a7ebbedd41d6c7bec669b4caae19545a83644a3fc6758158bbf5d3c1", + "sha224WithRSAEncryption": "a7ebbedd41d6c7bec669b4caae19545a83644a3fc6758158bbf5d3c1", + "sha256": "6fb0514a46f06be4bc3798ae82fa6cf14103926f1969b3d70910a9c5d9589e58", + "sha256WithRSAEncryption": "6fb0514a46f06be4bc3798ae82fa6cf14103926f1969b3d70910a9c5d9589e58", + "sha384": "c77eee233bea537b97a91d4c661b47e400ce1ce1a9d1c486f9cb08f557b11aa9914f0cf6b22748609dd39378c29db50b", + "sha384WithRSAEncryption": "c77eee233bea537b97a91d4c661b47e400ce1ce1a9d1c486f9cb08f557b11aa9914f0cf6b22748609dd39378c29db50b", + "sha512": "2e132f775423970174eff2ccad923875865ae6b92f1c5d24630dd494c3b8d3fb367ec1e00a67ed63b902338be4ecd4ddcd4a211d0015508d5a1e272a67a9716d", + "sha512WithRSAEncryption": "2e132f775423970174eff2ccad923875865ae6b92f1c5d24630dd494c3b8d3fb367ec1e00a67ed63b902338be4ecd4ddcd4a211d0015508d5a1e272a67a9716d", + "shaWithRSAEncryption": "5753c25555e8784edf30519ea754df4f2300507c", + "ssl2-md5": "cb434f8c5fad9793ed142805afa861a0", + "ssl3-md5": "cb434f8c5fad9793ed142805afa861a0", + "ssl3-sha1": "2c6e30d9c895b42dcccfc84c906ec88c09b20de1", + "whirlpool": "e7ba79b56b7cb722f54f12af1b993710cb65e200fb4d8433ad530ec61b3373c50cace38d35db414a7b116053bfb7d39891ea7b9c3f1b77b621978ac8b3dd1296" + }, + { + "input": "AAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAH/////////////////////////+AAAAAAAAAAAAAP////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////4AAB////////////////////8AAAAAAAAAAAAH//////////////////4AAAAAAAAAAA///////////////wH/////////gAAD////////////////AAAAAAAAAAAAAAAAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAAAAAP////////////////////////gAAAAAAAAAAAAAAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////+P//wAAAAAAAAAAAAAAAAAAAH/////////////+AAAAD///////////4AAAAAAAAAAAAD////////////////58AAAP///////////////////////gB////wAAAAAAAAf///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////wAAAAAAAAAAAAAAAAAA/////4AAAf////////////4AAAAAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAP/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAH//////////AAAAAAAAAAAAP///////////////4AAAAAAAAAAAAAAAAAD/////gAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAH//////////////AAAAAAAAAAAAAAAAAAAAAA///////////////////4AAAAAAAf////////////////////8AAAAAAAAAH//////////////////8AAAAAAAAAAAAAAB//////////////////+AAAAAAAAAAAAAAAAAAAH/////8AAAf8AAAAAAAAAAAAAAAP/////////wAAAH//////////////wAAAAAAAf////////////wAAAAAAAAAAAAAAAAAD////////+AB///////////////////////8AAAAAAAAAAAAAAAAf/////////////8AAAAAAB//////////////4AAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAAAAA////////////8AD///////////4AAAAAAAAAAAAAAAAAAAAB////////////8AAAAAAAAAAAAAAAAAAAAAAAA///////////////////4AAAAAAAAAAAAAAAP////////////////+AAAAAAB//////////+P////////////AAAP////////////AAAAAAAAAAAAAAAAB////////////////4AAAAAAAAAAAAAAAAAAAf////////////////////////AAAAAAAH///+AAAAAAAAAAAAAAAAAAAAAAAD////////////////////////wAAAAD/////////gAAAAAD/////////////////////gAAP////4AAAAAAAAAAAAAH////////////////////f////////////////////////4AAAAAAAAAAAAAAAAAAAAAA+AAAAAAAAB////+AA////////////////////+AAAAAAAAAAAf////gAAAAAAAAAH////////////////wAAAAAAAB///////////////////////4P///////////////AAAAAAAAAAAAAB///gAAAAAAAAAAAAAAAAAAH///4AAAAAAAAAAAAAAAAAP/////////////////4AAAAAAAAAAAAAAAAA///////////////gAAAAAAf//AAAAH///////////////AAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAf//////////4AAAAAAAAAAAAD//////AAAAAAAAAAAAAAwAAAAAAAAAAAAAH////////////////////+AAAAAAAAAAAAAAAAAAAAB////////////////////gAAAAAAAAAAAAAAAAAAAAA///////8AAH/////wAAAAAAAAAAAAAAAD//////8AAAA//////////////////4AAAAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAAAAA/////////gAAAAAAAAAAAAAf//////////////////gAAAAAAAAAAAAAAAAAP///////////////////////4AB//+AAAAAAAAAAAAAAAAAAAAAAB//gD/////////////+A///AAAAAAAAAAAAAAAAAAAAAH//////////////8///////////////8AAAAAAAAf/////////////////////wAAAAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAA//////////8AAAAAAf4AAAAAAAAAAAAAAAAD//////AAAAAAAAAAAAH/////////////////+AAAAAAAAAAAAB/AH///////AAAAAAAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAAAAAAAAAAf/////////////////////8AAAAAAAAAAAAAA/////////////AAD//////////AAAAAAAAD////////////gAAAAAAAAAAAAAAAAAAAAAAAAAD////////8AAAAAAAAAAAAAAAAAAAAAAAAB////////////////////AAAAAAAAAAAAAAAAAAAAAAAAB////////////8AAAAAAAAAAAA//8AAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAAD/////////////////gAAAAAAAAAAAAB///////////////////8AP//////////4AAAAAAAAAAAAAAAAAAAAAAP////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////AAAAD///////+AAAAf////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAB/////+AAAAAAAAAAAAAf/AAAAAAAAAAAAAAAAAAAAAD//////////////////4AAAH//////+AAAAB////////////////+AAAB/////////4AAAAAAAAAAAAAAAAAAAAAD////////////////////AAAAAAAAAAAAAAAAAAAAAAAP///////////////+AAAB/////////////////////////+AAAAAAAAB///////////////////8AAAAAAD//////////////////+AAAAAAAAAAAAAAAAAAAAAAAf//////////////gAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAAAAAAAAAAAAAAAD//+AAAAAAAAAAAD+AAAAAAAAAAAAAAAAAAAAAH/////////////////////////AAAAAAAAAAAAAAAAAA////////4AAA/////////8AAAAAAAAAAAP///////////8AAAAAAAAAAAAAAAAAAAAAAEAAAAAAP/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAD8AAAAf///////////+AAAAAAAAAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAAAAAAAAA///////////////////////3///////////4AAAAP////////////////////////8AAAAAAAAAAAAAAAAB//////////////wAAAAAAAB///////////////wAAAAf////////////4AAAAAAAAAAAAAAAAAAAAAH////////////wAAAAAAAAAAAAAAAAAAAB/////////////////////////wAAAAAAAAAAD//////////////////////////gAH///////////////+AAAAAAAAAAAAAAAAAAB//////////////////////////gAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAAAAAAAAAAAAf/////////////////////", + "DSA": "3de3189a5e19f225cdce254dff23dacd22c61363", + "DSA-SHA": "3de3189a5e19f225cdce254dff23dacd22c61363", + "DSA-SHA1": "3de3189a5e19f225cdce254dff23dacd22c61363", + "DSA-SHA1-old": "3de3189a5e19f225cdce254dff23dacd22c61363", + "RSA-MD4": "cc9eaca055d9a3bccca522703fcd9b85", + "RSA-MD5": "83a3d5436f96cb2cb31d929794425f31", + "RSA-MDC2": "ce30391a222a325afee9b989207dfb40", + "RSA-RIPEMD160": "2706cbc929cbc1297a42d07cf222ce18a5e5b809", + "RSA-SHA": "29e11c3e7067f5251a3e04e46b6cbf3370ed9b56", + "RSA-SHA1": "3de3189a5e19f225cdce254dff23dacd22c61363", + "RSA-SHA1-2": "3de3189a5e19f225cdce254dff23dacd22c61363", + "RSA-SHA224": "f1a44dbd2238d00500012323c1ad7e7c3a127fd9fb38daa304be7a40", + "RSA-SHA256": "9731a6c8ef6c4d601781f231e5b17c0a5194495d5b01b27aefbb4cd857c0c7d1", + "RSA-SHA384": "cfb3a4d8f3fc42886929a2676de1b510692e82058765c06383230a1a7dec82d7b9ab8918a27b983a654decefcd64dad1", + "RSA-SHA512": "5039be6bc422543c53be17b8045b5290b8b337fc20273d1e0da6ca37f8688d17b8b6f60ad9b9065b8d698e0497a3e9d8ce9c5b1e3e572d0b153dc48cb8581cd5", + "dsaEncryption": "3de3189a5e19f225cdce254dff23dacd22c61363", + "dsaWithSHA": "3de3189a5e19f225cdce254dff23dacd22c61363", + "dsaWithSHA1": "3de3189a5e19f225cdce254dff23dacd22c61363", + "dss1": "3de3189a5e19f225cdce254dff23dacd22c61363", + "ecdsa-with-SHA1": "3de3189a5e19f225cdce254dff23dacd22c61363", + "md4": "cc9eaca055d9a3bccca522703fcd9b85", + "md4WithRSAEncryption": "cc9eaca055d9a3bccca522703fcd9b85", + "md5": "83a3d5436f96cb2cb31d929794425f31", + "md5WithRSAEncryption": "83a3d5436f96cb2cb31d929794425f31", + "mdc2": "ce30391a222a325afee9b989207dfb40", + "mdc2WithRSA": "ce30391a222a325afee9b989207dfb40", + "ripemd": "2706cbc929cbc1297a42d07cf222ce18a5e5b809", + "ripemd160": "2706cbc929cbc1297a42d07cf222ce18a5e5b809", + "ripemd160WithRSA": "2706cbc929cbc1297a42d07cf222ce18a5e5b809", + "rmd160": "2706cbc929cbc1297a42d07cf222ce18a5e5b809", + "sha": "29e11c3e7067f5251a3e04e46b6cbf3370ed9b56", + "sha1": "3de3189a5e19f225cdce254dff23dacd22c61363", + "sha1WithRSAEncryption": "3de3189a5e19f225cdce254dff23dacd22c61363", + "sha224": "f1a44dbd2238d00500012323c1ad7e7c3a127fd9fb38daa304be7a40", + "sha224WithRSAEncryption": "f1a44dbd2238d00500012323c1ad7e7c3a127fd9fb38daa304be7a40", + "sha256": "9731a6c8ef6c4d601781f231e5b17c0a5194495d5b01b27aefbb4cd857c0c7d1", + "sha256WithRSAEncryption": "9731a6c8ef6c4d601781f231e5b17c0a5194495d5b01b27aefbb4cd857c0c7d1", + "sha384": "cfb3a4d8f3fc42886929a2676de1b510692e82058765c06383230a1a7dec82d7b9ab8918a27b983a654decefcd64dad1", + "sha384WithRSAEncryption": "cfb3a4d8f3fc42886929a2676de1b510692e82058765c06383230a1a7dec82d7b9ab8918a27b983a654decefcd64dad1", + "sha512": "5039be6bc422543c53be17b8045b5290b8b337fc20273d1e0da6ca37f8688d17b8b6f60ad9b9065b8d698e0497a3e9d8ce9c5b1e3e572d0b153dc48cb8581cd5", + "sha512WithRSAEncryption": "5039be6bc422543c53be17b8045b5290b8b337fc20273d1e0da6ca37f8688d17b8b6f60ad9b9065b8d698e0497a3e9d8ce9c5b1e3e572d0b153dc48cb8581cd5", + "shaWithRSAEncryption": "29e11c3e7067f5251a3e04e46b6cbf3370ed9b56", + "ssl2-md5": "83a3d5436f96cb2cb31d929794425f31", + "ssl3-md5": "83a3d5436f96cb2cb31d929794425f31", + "ssl3-sha1": "3de3189a5e19f225cdce254dff23dacd22c61363", + "whirlpool": "ffa9f3a57a22d5fec6837f82a2a787b381eaed9988d17e36cf3d81f5fd8b3d9e40fa6e9d769374d202c42369548451183e408b69e2f36f5dbe59454357875f31" + }, + { + "input": "AAAAAB///////////////wAAAAAAAAAAAAAAAAAH////////////////////wAAAAAAAAAAAAAAAAAAAf+AH//8AAAAAAAAAAAAAAAAAAAAAAf///4f///////////4AAAAAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAAAAAAAAAAAB/////////////////////wAAAAAAAAAAAAAAAAAAf//////////////4AAP////gAAAAAAA//////////////8AA//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAP/////////////+AAAAAAAP/////wAAAAAAAAAAAB///////////gAAB//////////////////////+AAAf/////////AAAAAAAAAAf///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAP/gAAAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAH/////////////AAAAAAAAAAAAAAAAAAA///////gAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAD////////////////////////wAAAAAAAAAAAAAAAAAAA////////////gAAAAAAAAAAAAAAAAAAAAf////////4AAAAAAAAAf//////////////////////AAAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAf//////////wAAAAAAAAAAAAAAAD////////////////+AAAAAAAAAP///////////////////////8AAAf/////////AAAAAAAAAAAAAAD////////////////////////+AAAAAAAAAAAAAAAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAB////AAB///////8AAAAAAAAAAAAAAAAAAB/////4AAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////wAAAAAAAAAAAAAAAAAf///////8AAAAAAAAAAP////AAAAAAAAAAAH/8AAAAAAAB////////////////////////8AAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAD///////////////gAAAAAAAAAAAAAAAAAAB//////////4AQAAAAAAAAAAH////////////+AAAAAD//////////////////gAP/////////AAAAAAAAAAAAAAAAB////////////////////4AAAAAAAAAAAAAAAAAAAAAH////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAD//8AAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAAAAAAAAAAAAAAAAAAAAAAAAD/////g/////8AAAAAAAAAAAAAAAAAAAAAAAP//////gAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////8AAAAAAAAAAAAAAAAAAD///////////wAAAAAAAAAAAAAAD///////////////////////+AAAAAAAAAP/////////////////////////gAAAAAAAAAAAAAAAAAAAAAA///////////////////AAAAAAAAAAAAAf//////4AAAAAH///////4AAAAAAAH///AAP/4AAAAAAf////8AA/////////////////////////AAAAAH////+AAAAAAAAB///////////////////////8AA8AAAAAAAAAAAAAAAAH///////////////////////gAAA///////////////4AAAAAAAAAAAAAAAAAAAAAAf/////////////////////gAAAAAAAAAAAAAAAAAAAf///////////////////////8AAH/////+AAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////+D////////wAAAAAAA/////////////////////////gAAAAAAAAAAAAAAAAAAAAB/////gAAAAAAAAAAAf////+AAAAAAAAAAAAAAAAAAAAH////////////////////////4AAAAAAAA////////////////8AAAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAAAAAAD//////////4Af///+AAAAAAAAAAAAAAP////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////gAAP///////////////+AAAAAAAAB////////////////////8AAAAAAAAAAAAAAAAAA/////////8AAAAAAAAAAAAAAAAAAAH////gAAAAAAAAAAAAf////////////////////8AAAAAAAAAAAAAAAAA///////////////////////wAAAAAAAAAAAAAAAAAAAAP/////8AAAAAAAAAAAAAAAAAAAAAAAAAP///+AAAAAAAAAAAAAAAAAAB//////////AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////4AAAAAAAAAAH///////////////+AAAAAAAAAAAAH///////+AAAAAAAAAAAAAAAAAAAAAAAAAAf///////gAAAAAD/////////////wAAAAAAAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAAAAAAAAA//////////////////////8AAAAAAAAAAAAAAAAAAD////////wAAAAAH/////wAAAAAAAAAAAB//////8AAf////////////////////////gAAAAAAAAAf///////+AAAAAAAAA/////////////////gAAD///4AAAAAAAAAAAAAAAAAAAAA///////////////+AAAB///////////8AAAAAAAH///////////////8AAAAAAAAAAAAAAAAAAAAAP///////8AAAAAAAAAAAAAAAAAAAAAAA////////////////////////AAAAAAAAAAAAAAAAAD////////////////wB//////////4AAD///////////////////gAAAAAAAAAAAAAAAAAAAH///////////wAAAAAAAAAAAAAAD/AAAAAAAAAAAAB/////////////////////////+AAAAAAAAAAAAAAAA////////////////////gAAAAAAAAAAAAAAAH/////////////8//////AAAAAAH/////////////////8AAAAAAAAAAAAAAAAAAAAAAAH///wAAAAAAAAAAAAAAAAAAAP/////////////////////////wAAAAAAAAAAAAAAAAAAAAAH///////////////AAAAAAAAAAAAAAAAAAAAAAAAAD/////8AAAAAAAAAAD///////////////////AAAAAAAAAAAAAAAAAAAAAB//////////////////////////4AAAAAAAAAAAAAAAAAAAAD//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAH///////gAAAAAAAAAAAAAAAAAAAAAAB//gAAAAAAAAAAAAAAAAAAAAAAD/////////////gAAAAAAAAAAAAAAAAAAAAAAD//////////gAAAAAAAAAAAAAH///////////////////AAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAf/////8AAAAAAAAAAAAAAAAAAAAB/////4AAAAAAAAAAAAAAAAAAAAAD////////////////8AAAAAAAAAAAAAAAAAP//////////////4AAAAAAAAA/4AAAAf/////////gAAAAAAAAAP4AAAAAAAAAAAAAAAAAAAAAAAAAB/+AAAAAAAAAAAAAf///4B////////////////////gAAAAAAAAAAAAH//////+AAAAAAAAAAP//////////8AAAAAAAB//////////////////////////gAAD/////AAAAAAAAAAAAAH////////////////////////4AA///////////////////////4AAAAAAAAAAAAAAAAAH//////////////////////////wAAAAAAAAAA///////8AAAAAAAAAAAAAAAAAAAAP///////////////////+AAAAA////////////////4AAAA/////////////////4AAAAAAAAAAAAAAAAAD////////////////AAAAAAAAAAAAAAAAAAD///////////////////////8=", + "DSA": "93530a9bc9a817f6922518a73a1505c411d05da2", + "DSA-SHA": "93530a9bc9a817f6922518a73a1505c411d05da2", + "DSA-SHA1": "93530a9bc9a817f6922518a73a1505c411d05da2", + "DSA-SHA1-old": "93530a9bc9a817f6922518a73a1505c411d05da2", + "RSA-MD4": "259c1a09ee92b39d8df0449663386ec1", + "RSA-MD5": "34dde0f0fe7d4fdb359df1fccbf5fcde", + "RSA-MDC2": "02f465cb106c551eb5b9c23add402655", + "RSA-RIPEMD160": "3d0dec385e0e8c4bc6ec928839565424e6d48890", + "RSA-SHA": "1e8d5a6256149cb9a837a39c5602e3252b8e7625", + "RSA-SHA1": "93530a9bc9a817f6922518a73a1505c411d05da2", + "RSA-SHA1-2": "93530a9bc9a817f6922518a73a1505c411d05da2", + "RSA-SHA224": "a8111e8da272aefd94a6898f229cb0b45fbdcceb59cb7b7439b4c43b", + "RSA-SHA256": "b18a49b7c4114fb94d16ffdce1e1677e6bde99bba443936af10cbedca6eeaf2a", + "RSA-SHA384": "fb47294aa3cd9670b0c9ba313e248acc6b36a6a2556c356836a24035194e5626e0e09ed39348f6f2d34ab67cab6a4bbf", + "RSA-SHA512": "ea52123ba216899ff9f5c61241108ef555ac322f69ad0fe48ad57364591b360695cfbdb5682c04fd7f333a902f13d2bd2c2702400738e2f62b1fa02e730a07c0", + "dsaEncryption": "93530a9bc9a817f6922518a73a1505c411d05da2", + "dsaWithSHA": "93530a9bc9a817f6922518a73a1505c411d05da2", + "dsaWithSHA1": "93530a9bc9a817f6922518a73a1505c411d05da2", + "dss1": "93530a9bc9a817f6922518a73a1505c411d05da2", + "ecdsa-with-SHA1": "93530a9bc9a817f6922518a73a1505c411d05da2", + "md4": "259c1a09ee92b39d8df0449663386ec1", + "md4WithRSAEncryption": "259c1a09ee92b39d8df0449663386ec1", + "md5": "34dde0f0fe7d4fdb359df1fccbf5fcde", + "md5WithRSAEncryption": "34dde0f0fe7d4fdb359df1fccbf5fcde", + "mdc2": "02f465cb106c551eb5b9c23add402655", + "mdc2WithRSA": "02f465cb106c551eb5b9c23add402655", + "ripemd": "3d0dec385e0e8c4bc6ec928839565424e6d48890", + "ripemd160": "3d0dec385e0e8c4bc6ec928839565424e6d48890", + "ripemd160WithRSA": "3d0dec385e0e8c4bc6ec928839565424e6d48890", + "rmd160": "3d0dec385e0e8c4bc6ec928839565424e6d48890", + "sha": "1e8d5a6256149cb9a837a39c5602e3252b8e7625", + "sha1": "93530a9bc9a817f6922518a73a1505c411d05da2", + "sha1WithRSAEncryption": "93530a9bc9a817f6922518a73a1505c411d05da2", + "sha224": "a8111e8da272aefd94a6898f229cb0b45fbdcceb59cb7b7439b4c43b", + "sha224WithRSAEncryption": "a8111e8da272aefd94a6898f229cb0b45fbdcceb59cb7b7439b4c43b", + "sha256": "b18a49b7c4114fb94d16ffdce1e1677e6bde99bba443936af10cbedca6eeaf2a", + "sha256WithRSAEncryption": "b18a49b7c4114fb94d16ffdce1e1677e6bde99bba443936af10cbedca6eeaf2a", + "sha384": "fb47294aa3cd9670b0c9ba313e248acc6b36a6a2556c356836a24035194e5626e0e09ed39348f6f2d34ab67cab6a4bbf", + "sha384WithRSAEncryption": "fb47294aa3cd9670b0c9ba313e248acc6b36a6a2556c356836a24035194e5626e0e09ed39348f6f2d34ab67cab6a4bbf", + "sha512": "ea52123ba216899ff9f5c61241108ef555ac322f69ad0fe48ad57364591b360695cfbdb5682c04fd7f333a902f13d2bd2c2702400738e2f62b1fa02e730a07c0", + "sha512WithRSAEncryption": "ea52123ba216899ff9f5c61241108ef555ac322f69ad0fe48ad57364591b360695cfbdb5682c04fd7f333a902f13d2bd2c2702400738e2f62b1fa02e730a07c0", + "shaWithRSAEncryption": "1e8d5a6256149cb9a837a39c5602e3252b8e7625", + "ssl2-md5": "34dde0f0fe7d4fdb359df1fccbf5fcde", + "ssl3-md5": "34dde0f0fe7d4fdb359df1fccbf5fcde", + "ssl3-sha1": "93530a9bc9a817f6922518a73a1505c411d05da2", + "whirlpool": "ae8ca1864b632383bcbb7c6692465331a54a3c6322b3282254e315336bca9552a1c4b25bb391b7616b2338ca1aeda26a56370d48442963b22aa5dd6c9a168efa" + }, + { + "input": "/////8AAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAf///////gAAAAAAAAAAP//////////////////////wAAAAAAAAAAAAAAAAAH/////////////////////////4AAAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAAAAAAAAAAf/////////gAAAAAAAAAAAAH/////////////4AAAAAAAAAAAAA//////////////////////////8Af/+AAAAAAAAAAAAAAAB///////////////////////////v///////////////gAAAAAAAAAAAAAAAAAB4AAAAAAAAAAAAAB///////////////////////////AAAAAAAAAAAAAAAAAAAP///////////////8AAAAAAAAAAAAAAAAB/////////AAAAAf4AAAAAAAAB//////AAAAAA/////////////////////gAAAAH/AAAAAAAAAAAAAAB/////////////////AAAAAf///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////+AAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAAf////////////////////////+AAAAAAA///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////AAAAAAAAAAAAAAAAAA/////////////////////wAAAAAD//////8AAAAAAAAAAAAAAAAAAAAAAAAAH////////////////8Af/////////4AAAAAAAAAAP////////////////wAAAAAAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////AAAAAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAAAAAAAAAAAA///////gAAAAAAAAAAAAAAP//////////+AAAAAAAAAAAAAAAAAAAAP/////////////////////wAAAAAf///////////////////w//////////////////wAAAAAAAAAAAAAAf////////////////////+AAAAAAAAAAAP////gAAAAAAAAAAAAAAAAAAAAAAP//////////+AAAAAAAAD///////////wAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////wAAAAAAf8AAAAAAAAAAAAAAAAAD/////wAAAAAAB////////////4AAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////8AAAAAAAAAAAAAAAA/////4AAAAAAAAAAAAAAAAAAAAAAAAAAf////////////wAAAAAAAAAAAAP///////wAAAAAAAAAAAAAAf8AAAAAA//////////////////////wAAAAAAAAAAAAAAB////////////////////////gAAAAAAAAAAAAP////////wAAAAAAAAAAAAAAAAAAAD/////////////AAAAAAP//////////////////AAAAAAAAAf////////wAAAAAAAAAAAAAAAAf//////////+Af////////////////////8AAAAAAA///////////8AAAAAAAAAH///////////////+AAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAAAP////////////////////AAAAAAAAAAAAAAAAAAAAAAA//////////4AAAD///////////////////////////wAAAAAAAAAAAAAf///////8AAAAAP//////////////4AAAAAAA/////AAAAAAAAAAAAAAAAAAAD/////////4AAAAf/////////////8AAAAAAAAAAAD///////AAAAAAAAAAAAAAAAAAAP////AAAAAA/////////////////gAAAAAAAAAAAAAAAA//////////////////+AH//////////////////4AAAAAAAAAB//////////////////wAAAAAAAAAAAf//////////AAAAAAAAAAAAAAAAAAAAA////////+AAA///////////////////AAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAH/////4AAAAAAAAA//////////////////////+AAAAAAAAAP/////////////////////////+AAAAAAAAAAAAAAAD//////////////wAAAAAAAAAAAAP///////////wAAD///4AB//////////8AP///AAAAAAAAAAAAAAAAAAAAAH//////////+///////////wAAAAAAAAAAAD////////////gAAAAAAAAAAAAAAAAAfwH////////////////////////AAAAAAAAAAAAAAAAAAf/wAAAAAf///////8AAAAAAAAAAAAAAAAA//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////AAAAAAAAAAAAAAAAAAAAAwAAAAAAADwAAAAAAAAAAAAAAAAAAAAAP////////////////////4AAAAAAAAAP////////AAf////////////8AAA///////+AAAAAAAAAAAAAAAAAD////////////AAAAAAAAAAAAAAAAAAAAAAAAD//////////////////+AAAAAAAH/////////////////gAAAAAAB/////////////4AAAAAAAAAAAAAAAAAAD///////////AAAAAAAAAAAAAAAAAAAAAAAA///////////////////////8AAAAAAAAAD/////////////////AAH//////////////4AAAAAAAAAAAAAAAAAAAAAAf////////////////gAAAAAAAAAAAAAAAB//////////////////////gAAAAAAf/8AAAAAAAAAAAAAAAAAAAAAAAf///////////////+AAAAAAH///////8AAAAAAAB////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAD/+AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////wAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAB/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////4AAB///////////////////////AAAAAAAH///////////////////+AAAAAAAAAf/////////////////AAAAAAAAAAAAAAAAP////////////4AAAAAAAAAAAAAAAAAAAAf//AAAAAP/////////////////////AAAAAAAAAAAAAAAAAAAA///////////////////////////4AAAAAAAAAAAAP///gAAAAAAAAAAAAAAAAAAAAB///////////////+AAAAAAAAAAA///////////wAAAAAAAf/////wAP////gAAf/////4AAAAAAAAAAAAAAAAAAAAAAAAAB///AAAAAAAAAAAAAAAAAAAAAAAAAAD////////+AAAAAAAAAAAAAAAAAAAAAAAAP/////+AAAAAAAAAAAAAAAAAAAH/////////////wAAAAAAAAAAAAAAAAAAAH///////////////4AAAAAAD//////////////////////4AAAAA///////////AAAAAAAAAAAAAAP//////////////////AAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////4P//4AAP////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAB/4AAAAAAB//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAD/////////gAB////gAAAAAAAAAAAAAAAAf///////x/////////////////gAAAAAAAAAP/////////gAAAAAAAAAAAH////////+AH///////////////////////////AAAAAf////////gAAAP///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAf/////wAAAAAAAAA///////////////////////////4AAAAAAAAAAAAAAAAAAAAB/////////////////////////4AAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAAAAAAAAB///////////////4AAAAAAAAAAAAAAAAAAAAAAA==", + "DSA": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "DSA-SHA": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "DSA-SHA1": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "DSA-SHA1-old": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "RSA-MD4": "608770df7c1f2b15f7e3bb65ef5f23bf", + "RSA-MD5": "7b77219e9549fad49e97c380f7e1f362", + "RSA-MDC2": "d96bac7b7138b39e324473fdcb3974dd", + "RSA-RIPEMD160": "da4aaf7529ddf37eedf3eaa47243e4422b3700c9", + "RSA-SHA": "85e59ebb4b9c14f7777f046e136bcbdd736fb459", + "RSA-SHA1": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "RSA-SHA1-2": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "RSA-SHA224": "79b796772c826f1c2eed627948e9d2c7f973f0353d68b1cf5d2ed40e", + "RSA-SHA256": "ce197d61ddae42c8b8447aa698b3e7e5d51d9f0cd2034bc64f1a9d1b2b18e3cd", + "RSA-SHA384": "d688f9cd1c0d531e32a1ac5ec5ac9117e4ce90de9c2ca6c1e01f7a99d1168c996997a052aa3a277e759e866a1fd6c248", + "RSA-SHA512": "10d2eaa4eb9814ebd114aeb9168793b24109d16d3e9e6fab8182623ba2a13f09ee4a1756733a7c3d084a8ea1d75532b1d65fb2156ac13eae4241273548468f96", + "dsaEncryption": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "dsaWithSHA": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "dsaWithSHA1": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "dss1": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "ecdsa-with-SHA1": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "md4": "608770df7c1f2b15f7e3bb65ef5f23bf", + "md4WithRSAEncryption": "608770df7c1f2b15f7e3bb65ef5f23bf", + "md5": "7b77219e9549fad49e97c380f7e1f362", + "md5WithRSAEncryption": "7b77219e9549fad49e97c380f7e1f362", + "mdc2": "d96bac7b7138b39e324473fdcb3974dd", + "mdc2WithRSA": "d96bac7b7138b39e324473fdcb3974dd", + "ripemd": "da4aaf7529ddf37eedf3eaa47243e4422b3700c9", + "ripemd160": "da4aaf7529ddf37eedf3eaa47243e4422b3700c9", + "ripemd160WithRSA": "da4aaf7529ddf37eedf3eaa47243e4422b3700c9", + "rmd160": "da4aaf7529ddf37eedf3eaa47243e4422b3700c9", + "sha": "85e59ebb4b9c14f7777f046e136bcbdd736fb459", + "sha1": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "sha1WithRSAEncryption": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "sha224": "79b796772c826f1c2eed627948e9d2c7f973f0353d68b1cf5d2ed40e", + "sha224WithRSAEncryption": "79b796772c826f1c2eed627948e9d2c7f973f0353d68b1cf5d2ed40e", + "sha256": "ce197d61ddae42c8b8447aa698b3e7e5d51d9f0cd2034bc64f1a9d1b2b18e3cd", + "sha256WithRSAEncryption": "ce197d61ddae42c8b8447aa698b3e7e5d51d9f0cd2034bc64f1a9d1b2b18e3cd", + "sha384": "d688f9cd1c0d531e32a1ac5ec5ac9117e4ce90de9c2ca6c1e01f7a99d1168c996997a052aa3a277e759e866a1fd6c248", + "sha384WithRSAEncryption": "d688f9cd1c0d531e32a1ac5ec5ac9117e4ce90de9c2ca6c1e01f7a99d1168c996997a052aa3a277e759e866a1fd6c248", + "sha512": "10d2eaa4eb9814ebd114aeb9168793b24109d16d3e9e6fab8182623ba2a13f09ee4a1756733a7c3d084a8ea1d75532b1d65fb2156ac13eae4241273548468f96", + "sha512WithRSAEncryption": "10d2eaa4eb9814ebd114aeb9168793b24109d16d3e9e6fab8182623ba2a13f09ee4a1756733a7c3d084a8ea1d75532b1d65fb2156ac13eae4241273548468f96", + "shaWithRSAEncryption": "85e59ebb4b9c14f7777f046e136bcbdd736fb459", + "ssl2-md5": "7b77219e9549fad49e97c380f7e1f362", + "ssl3-md5": "7b77219e9549fad49e97c380f7e1f362", + "ssl3-sha1": "e31354345f832d31e05c1b842d405d4bd4588ec8", + "whirlpool": "a8071ce7eb93aad56daefc8e750a3d4b017226b7669550dd43db2704fcbc4eb5d5424d5eff9955ed13c48ccf9c8d9a5a04652c4c8c4148b1918610047ec2d354" + }, + { + "input": "//////////gAAAAAAAD//////////4AAAAAAAAAAAAAAAAAAAAAH///wAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAf/4AAAAAAAAAAH8AAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAAAAB///////////wAAAAAAAAAAAAAAAAAAAAH///////////4AAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////4AAAAAAAAAAB///////////wAAAAAAAB///////8AAAAAAAAAAAAAAAAAAAAAAAAAAf////wAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////4AAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAP//////////////////gAAAAAAAAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAAAAAAf//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAD////AAAAAAAf//////////AAAAAAAAAAAAAAAAAAAAAf//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAB////////////////gAAAAAAAAAAAAAAAAAAAAAAAf//gAAAAAAAA//////////////////////+AAAAAAAAAAAAAAAAAAAAAAA////////////////////////8AAAAAAAAAAAAP/////////////////////////8P/////////8AAAAAAAAAAAAD///////////////////////////4AAAAAAAAAAAAAAAAH///////////////////////4AAAAAAAAAAAAAAAf////////wAAAAAAAAAAAAAAAAAAAAAAB//////////wAAAAf///////////////wAAAAAAAAAAAAAAH///4AAAAAAAAAAAAAAAAAAD///////////////////////////wAAAAAAAAAAAAD///////////gAAAAAAAAAAAAAAAAAAAAAf///////////////9///////////////////+AAAD//////////////wAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAf////////////////////////4AAAAAAAAAAAAAAAf/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////AAAAAAAB////////4AAAAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////8AAAAAAAAAAf//////gAAAAAAP////////AB/+AAAAAAAAAAAAAAAAAAAAAAAAA/////gAf//////4AAAAAAAAAAAAAAAAAB/////gAAAAAAAAAAAAAAAAAAAAH///////////////////AAAAAAAAAAAP/////////////+AAAB//////wAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////wAAAAAAAAAAAAAAAAAAAAAAAH/////////gAAAAAAAAAAAAAAAA///////////////gAAAAAAAAAAAAAAAB///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////gAAAAAAAAAAAAAAAAAAAAB/////gAADgAAAAAAAAAAAAAAAAACAAAAA////////////4AAAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAAAAAAAAAAAAAB//////////////////////wAAAAAAAAAAAAAAAAAAAAA////4AAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////wAAAAAAAAAAAAAAAAAAD///4AH/////////+AAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAAB///////////////////////AAAAAAAAf///////////4AAAAAAAAAAAAAAAAAAAAAAAAAf////////////4AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////gAAAAAAAAAB/////////////////wAAAAAAAAAAAAAAH4AAAAAAAAAAAAAAAAAAAAAAAf///8AAAAAAAAAAAAf///gAAAAAAAAAAAAAAAAAAAAH//////////////////gAAAAAA/////////////gAAAA//////////////AAAAAAAAAAAAAAAAAAAAAAAAf/////+AAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAH///////////////wAAH//wAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////+AAP//gAAAAAAAAAAAAAf/////////+AD///////////////gB//////////+AAAAAAAAAAAAB////////////AAAAAAAAAAAAAAAAAAAAAf///////////////////////+AAB/////////////////////wAAAAAAAAAAAAAAAAAAAAAAH///////////////////////wAAAAAAAH////////////////////////4A//////////////AAAAAAAAAAAAAD/////////////////////////wAAAAAAAAAAAAAH//AAAAAAAAAAAAAAD/////////////wAAAAAAAAAP/////////////+AAA//AAAAAAAAAAAAAAAAAAAAAAf////////+AAAf/////8AAAAAAAAAAH////////AAAAAAAAAAAAAAAAAAAAAAAH/////////////////////+AAAAP///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////+AAAAAAAAAAAAAAAAAAAP/////////////8AAAAAAAAAD//wAAAAAAD//wAAAAAAAAB/////////////////////+AAB///////////////////////4AAAAAAAAAAAAAD/////////////////AAAAAAAAAB///////8AAAAAAAAAAAAAAAAAAAAAAAf////////+f//////////gAAAAAAAAAAAAAAAf//////+AAAAAAAAAAAAAAAAAAAD/////////////////////////gAAAAAB//////////////////gAAAAAAAAAAAAAAAAAAAAf////////////////wAAAAAAAAAAAAAAP///////////////////////wAH///+AAAAAAAAAAAAAAAAAH///////////////////////4AAAAAAAAAAAAB////////////////////////AAAAAAAAAAAAAAAAAAAAAAP////////////////4AAAAAAAAAAAAAAAP///wAAAAAAD///gAAAAAAAAAAAAAf//////////////////////4AD///////////////+AAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAP//////wAAAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAB///////////////+AAAAAAAAAAAAAAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAf///////////////////wAAAAAAAAAAAAB//////////////////AD////////4AAAAAAAAAAAAAAAAAAAAAH//////////////////gAAAAAAAAAAAAAAAAAAD/////////////gAAAAD/////////////////////////4AAAAAAAD/////////+AAAAAAf///////////////////f/wAAAAAAAAAAAAAAAAP/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAB///////////////4AAAAAAAAAAAAAAAAAAAAAP///////////////////////gAAAAAAAAAAP///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAH//////////////wAAAAAAAAAAAAAAAAD//////////////////////gAAAAAAAAAAAf///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAD////////////wAAAAAAAAAAAAAB+AAAAAAAAAABgAAAAAAAAAAA////////////////////4AAAAAAAAAAAAP//////////////////wAAAAAAAAAAAAAAAAAP/////////gAAAAAAAAAAAAAAAAAAAD///////////////////////////wAAAAAAAAAD///////////////8AAAAAAAAAAAAAAAAAAAAAAA///////////////8AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "DSA": "3ff76957e80b60cf74d015ad431fca147b3af232", + "DSA-SHA": "3ff76957e80b60cf74d015ad431fca147b3af232", + "DSA-SHA1": "3ff76957e80b60cf74d015ad431fca147b3af232", + "DSA-SHA1-old": "3ff76957e80b60cf74d015ad431fca147b3af232", + "RSA-MD4": "af3ae1603912f594bc9eefff46fc9ca9", + "RSA-MD5": "053f4e89ae2355c5cb259d21e85eb9cd", + "RSA-MDC2": "b27b2b16febbc9d67290b17f4a7cf759", + "RSA-RIPEMD160": "6fcb64e414649cd43862ebb5a2a31e5e691e8854", + "RSA-SHA": "cc02efffa6b5939026bfe3815c7bd6e473881a4a", + "RSA-SHA1": "3ff76957e80b60cf74d015ad431fca147b3af232", + "RSA-SHA1-2": "3ff76957e80b60cf74d015ad431fca147b3af232", + "RSA-SHA224": "fa33144c6182f9b72e5af9f57bb4f9f7ff382b38a14b1f987e9b8e00", + "RSA-SHA256": "7d9a3aebb470990abb92303f0c2ce5d6c38f9a2198d8f1ae8ab7fbbbf007cc7d", + "RSA-SHA384": "e0dc798fdc3a726fa9af40486d93eab2277efdd2beb6866b533d3741c944c6b466ce08e1fe6f08d64a8208f45fe5c15c", + "RSA-SHA512": "cc60cf4c4aae634201325ea053e3890b3868b5a8aec71b1a5b764111edbe9c75bf5ce0a1eb1b3886b416c644dc3fdc4da93a4ce37611f08edf430b5bc6b91fd9", + "dsaEncryption": "3ff76957e80b60cf74d015ad431fca147b3af232", + "dsaWithSHA": "3ff76957e80b60cf74d015ad431fca147b3af232", + "dsaWithSHA1": "3ff76957e80b60cf74d015ad431fca147b3af232", + "dss1": "3ff76957e80b60cf74d015ad431fca147b3af232", + "ecdsa-with-SHA1": "3ff76957e80b60cf74d015ad431fca147b3af232", + "md4": "af3ae1603912f594bc9eefff46fc9ca9", + "md4WithRSAEncryption": "af3ae1603912f594bc9eefff46fc9ca9", + "md5": "053f4e89ae2355c5cb259d21e85eb9cd", + "md5WithRSAEncryption": "053f4e89ae2355c5cb259d21e85eb9cd", + "mdc2": "b27b2b16febbc9d67290b17f4a7cf759", + "mdc2WithRSA": "b27b2b16febbc9d67290b17f4a7cf759", + "ripemd": "6fcb64e414649cd43862ebb5a2a31e5e691e8854", + "ripemd160": "6fcb64e414649cd43862ebb5a2a31e5e691e8854", + "ripemd160WithRSA": "6fcb64e414649cd43862ebb5a2a31e5e691e8854", + "rmd160": "6fcb64e414649cd43862ebb5a2a31e5e691e8854", + "sha": "cc02efffa6b5939026bfe3815c7bd6e473881a4a", + "sha1": "3ff76957e80b60cf74d015ad431fca147b3af232", + "sha1WithRSAEncryption": "3ff76957e80b60cf74d015ad431fca147b3af232", + "sha224": "fa33144c6182f9b72e5af9f57bb4f9f7ff382b38a14b1f987e9b8e00", + "sha224WithRSAEncryption": "fa33144c6182f9b72e5af9f57bb4f9f7ff382b38a14b1f987e9b8e00", + "sha256": "7d9a3aebb470990abb92303f0c2ce5d6c38f9a2198d8f1ae8ab7fbbbf007cc7d", + "sha256WithRSAEncryption": "7d9a3aebb470990abb92303f0c2ce5d6c38f9a2198d8f1ae8ab7fbbbf007cc7d", + "sha384": "e0dc798fdc3a726fa9af40486d93eab2277efdd2beb6866b533d3741c944c6b466ce08e1fe6f08d64a8208f45fe5c15c", + "sha384WithRSAEncryption": "e0dc798fdc3a726fa9af40486d93eab2277efdd2beb6866b533d3741c944c6b466ce08e1fe6f08d64a8208f45fe5c15c", + "sha512": "cc60cf4c4aae634201325ea053e3890b3868b5a8aec71b1a5b764111edbe9c75bf5ce0a1eb1b3886b416c644dc3fdc4da93a4ce37611f08edf430b5bc6b91fd9", + "sha512WithRSAEncryption": "cc60cf4c4aae634201325ea053e3890b3868b5a8aec71b1a5b764111edbe9c75bf5ce0a1eb1b3886b416c644dc3fdc4da93a4ce37611f08edf430b5bc6b91fd9", + "shaWithRSAEncryption": "cc02efffa6b5939026bfe3815c7bd6e473881a4a", + "ssl2-md5": "053f4e89ae2355c5cb259d21e85eb9cd", + "ssl3-md5": "053f4e89ae2355c5cb259d21e85eb9cd", + "ssl3-sha1": "3ff76957e80b60cf74d015ad431fca147b3af232", + "whirlpool": "f7b1a5d069709e2673901d9e26ebb335f2b25d40992c3a9f26b770711dcf5578b73ab834d352706f09fb3c12ca42fec753de945a20654044af001b3cfe8385a4" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAB//8AAAAAAAAAAAAAAAf////////////+AAAAAAAAAAAAAf/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAA////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAeAAAAD//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////+AAAAAAAAAAAAAB//////////////////8AAAAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAH////wAAAAAAAAAH///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAAAA////////AAAAAAAAP/4AAAAAAAAAAAAAAAAAAAAAAH/wAAAAAAAD/////////+AAAAAAAAAAAAAAAAP/////////////////P/////////////////gf//////////////////8AAAAAAAAAAAAAf//////////////////gAAAAB////////AAAAAAAAAAAAAAAAAAD////////wAAAAAAAAAAAAAAAAAAAAA/////////////8AAAAAAAAAAAB/////////////////+AAAf//+AAAAAAAAAAAAAAAAAAf/////////gA////////////////wAAA//////////wAAAAAAAAA////////AAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////gAAA//////////////8AAAAAAAAAAAAAAAAAAAAAAAP//////////////////////4AAAAAAAAAAAAAAAAAAAD//////////////+AAH//////////////////////////8//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////wAAAAAAAAAAAAAAAA//////////wAAAAAAAB///////4Af///gAAAAAAAAAAAAAAAAAAAAAAAAf///////wAAAAAAAAAAAAAAAAAAAAAf/////////gAAAAAAAAAAAAAAAAAAf/////////8AAAAAAAAAAAAAD//////////////+AAAAAAAAAAH///////////////////////////AAAAAAAAAAAAAAAAAAAAAAA//////8AAAAAAA////////////////////////////8AAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAP///////////8AAAAAAAAAAAAAAAAAAB///////////////+AAAAAAAAAAAAAAAAAAAAAP///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////8AAAD///////////////////////////+AAH//////////////////8AAAAAAH////////////////////wAAAAAAA//////////////4AAAAAAAAAD///////////////AAAAAAAAAAAAAAAAAAAAAAAAf/////8AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////+AAAAAAAAAAAAB///////////4AAAAAP///+AAAP///////wAAB/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAH//////gAD4AAAAAAAAAAAAAAAAAAAAAH///////////////////////////+AAAD//8AAAAAAAAAAAAAAAAAH//////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAf////////4AAAAAAAAAAAAAAAAAAAAAD///4AAAAAAAAAAH/////////////////8AAAAAAAAAAAAAAAAAAAAf////////////////gAAAAAAAAAAAAAAAAf///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////8AAAAAAAAAAAAAAAAAAA/////////////////////////gAAAABAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////+D/////8AAAAAP///////////////4AAAAAAAAAAAAAAAAAAH//AAAAAAAAAAAAAD/////////////////////AAAAAAAAAAAAAAAAAAD///////////////////4AAAAAAAAAAAAAAAA////+AAAAAAAAAAAAAAAAAAAAAAB///////////////////////////wAAAAAAP/////wAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////8AAB//////////wAAAAAP//////////////gAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAgAAAAD///////////////gAAAAAAAAAAAAAAAAH//////////////////wAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAP///////////////wAAAAAAAA//////////////////AAAAAAAAAAAAAAA/////////4AAAAAAAAAAAAAAP////4P//////////////////gAAAAf/////8AAAAAB///////////////+H////////////////////////AAAAAAAAAAAAAAAAAAAAAf////////////////8AAAAAAB///////////////////////////wAAAAAf///////////8AAAH///////////////////////wAAAAAAAAAAAAAAAAB///+AAAA/8AAAAAAAAAAAAAAAP/wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////AAAAAAAAAAAAAAAB////////////////////////////gAAAAAAAAAAA///wAAAAAAAAAAA//////////////////8AAAH///////////////wAAAAAAAAAAAAAAAAAAAAAAAP/////////4AAAAAAAAAAAD//////////////////////4AAAAAAAACAAAAAAAAAAAAAP///////////////gAAAH//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////+AAAAAAAAAAAAAAAAAAAAAAAAP////////////4AAAAAAAAAAAAAAAAD/////////////AAAAAAD///////////////////+AAAAAB/+AAAAAAAAAAH///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////4AAAAAAAAAAAAAAAAAA///////////////////gAAAAAAAf////////////////////wB//////wAAAAAAAAAAAAAAAAAf/////////////////////AAAAAAAAAAAAAAAAAAAf//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////8AP///////////////////////AAP///////////////////+AAAAAAAAB///////////////////////wAAAAAP//////gAAAAAAAAAAAAAAAD////////////4AAAAAAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////8AAAB/////////////////4AAAAAAAAA///////////8AAAAAAAAAAP//+AAA//4AAAAAf////////////////////gAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAD//////////////////////////+AAAAAAAAAAAAAAAAAAAAA//////////////wAAAAAf4AAAAAAAAH///wAAAAAA///////////////////////x////////////////////////////AAAAAAAH////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAB///////////////+AAAAAAAAAAAAAP///////////////////////gAAAB////4AAAAAAAAAAAAAAAAAAAAf/////////////8AB//////////////+AP/////////////+AAAAAAAAAAAAAAAAAA////////+AAAAAAAAAAA///////////////////////////wAAAA/////////////////////+AAAAAAAAAAAAAAD////////////////////////4AAAAAAH////////8AAAAAAAAAAAAAAAAAAAAD////////////+AAAAAAAAAAAAAAAAAAAAAB////////////gAAP/////////////////////4AAAAH//////////+AAAAAAAAAAAB////////////wAAAAAAAAAAAAAAAAAAAAAAAA/4Af///////////gAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////4AAAAAAAAAAAAAP/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAH///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////wAAAAAAAAAAAAAAAAAAAAAAAAA=", + "DSA": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "DSA-SHA": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "DSA-SHA1": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "DSA-SHA1-old": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "RSA-MD4": "32cc32110ffdcf48d1097d21126ca826", + "RSA-MD5": "fc45c5118f642cc479e6a550756f1a4e", + "RSA-MDC2": "51ea813430c9ff72e5a17799b0a33250", + "RSA-RIPEMD160": "36551631e11751f6fe7eef4a796a74abaf37d6bd", + "RSA-SHA": "33fed74802eef71b5fcab7ff08fc293d1d9c172b", + "RSA-SHA1": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "RSA-SHA1-2": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "RSA-SHA224": "265d4f6edc21bf86df95fc5765827531fec0f855d322d3bbd76ee2f1", + "RSA-SHA256": "e52d8c79b31f45d4894e0948089da5fc236d33dd79a80d2304043e8c234cf88c", + "RSA-SHA384": "a5bb0a21d45162d7869e6075b807afa8a0dcd087925927a35e0c242edabb8474b5bdccab856881102f2b039d73fb5540", + "RSA-SHA512": "d86d8aa698c70e574e1e88a28e1666302b56f5dfae559cb13470944d4a424830dfa9d05527652330891be236caf2a02b2772a7e8411b065027fe83e03145b0a7", + "dsaEncryption": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "dsaWithSHA": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "dsaWithSHA1": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "dss1": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "ecdsa-with-SHA1": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "md4": "32cc32110ffdcf48d1097d21126ca826", + "md4WithRSAEncryption": "32cc32110ffdcf48d1097d21126ca826", + "md5": "fc45c5118f642cc479e6a550756f1a4e", + "md5WithRSAEncryption": "fc45c5118f642cc479e6a550756f1a4e", + "mdc2": "51ea813430c9ff72e5a17799b0a33250", + "mdc2WithRSA": "51ea813430c9ff72e5a17799b0a33250", + "ripemd": "36551631e11751f6fe7eef4a796a74abaf37d6bd", + "ripemd160": "36551631e11751f6fe7eef4a796a74abaf37d6bd", + "ripemd160WithRSA": "36551631e11751f6fe7eef4a796a74abaf37d6bd", + "rmd160": "36551631e11751f6fe7eef4a796a74abaf37d6bd", + "sha": "33fed74802eef71b5fcab7ff08fc293d1d9c172b", + "sha1": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "sha1WithRSAEncryption": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "sha224": "265d4f6edc21bf86df95fc5765827531fec0f855d322d3bbd76ee2f1", + "sha224WithRSAEncryption": "265d4f6edc21bf86df95fc5765827531fec0f855d322d3bbd76ee2f1", + "sha256": "e52d8c79b31f45d4894e0948089da5fc236d33dd79a80d2304043e8c234cf88c", + "sha256WithRSAEncryption": "e52d8c79b31f45d4894e0948089da5fc236d33dd79a80d2304043e8c234cf88c", + "sha384": "a5bb0a21d45162d7869e6075b807afa8a0dcd087925927a35e0c242edabb8474b5bdccab856881102f2b039d73fb5540", + "sha384WithRSAEncryption": "a5bb0a21d45162d7869e6075b807afa8a0dcd087925927a35e0c242edabb8474b5bdccab856881102f2b039d73fb5540", + "sha512": "d86d8aa698c70e574e1e88a28e1666302b56f5dfae559cb13470944d4a424830dfa9d05527652330891be236caf2a02b2772a7e8411b065027fe83e03145b0a7", + "sha512WithRSAEncryption": "d86d8aa698c70e574e1e88a28e1666302b56f5dfae559cb13470944d4a424830dfa9d05527652330891be236caf2a02b2772a7e8411b065027fe83e03145b0a7", + "shaWithRSAEncryption": "33fed74802eef71b5fcab7ff08fc293d1d9c172b", + "ssl2-md5": "fc45c5118f642cc479e6a550756f1a4e", + "ssl3-md5": "fc45c5118f642cc479e6a550756f1a4e", + "ssl3-sha1": "34ae3b806be143a84dce82e4b830eb7d3d2bac69", + "whirlpool": "8438cc5c19ba9e8779aa76dad0169f38a2dd35e6d88205111635a0f596439ddbb78bc8f291bf84f76ab9e1c2bfe3b18526706530abf3862350d9a4a12a3d8614" + }, + { + "input": "///////////////8AAAAP/4B///gAAAB//+AAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAD//////////////4AAAAAAAAAAD////////////////////////////gAAAAAAAAAB/////////////////////////gAAAAAAAAAAAAAP/////////4AAAAAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////gAAAAB///////////////////AAAAAAAAAAAAAAAAAAAAAAH////////////////////+AAAAAAAAAAAAAAAAAB//////////////////gAAH/////AAAAAAAAAAAAAAAAAAAAAP////////////////4AAAAAP/////8AAAAAAAAAf///////////////AD//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAP///////////////8AAAAH////////////////////////wH/////////////gAAAAAAAAAAD///////////////8AAAAAAAAAAAAAAAAAAD////AAAAAAAAAAAAAAAAAf///////////////////////////8AAAAAAAAAAAAAAAAH////////wAAAAAAAAAAAAAAAAAAAH///5////////////////////AAAAAAAAH/////wAAAAAAAAAAA/////////////+AAAAD/////////////////////////wAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////8AAP///+AAAAAAAAAH/////////5////////////////wAAAAAAAAAAAAAAAAAAAAD///////////4AAAAA//////////////////////////8AAAAAAAAAAAP///////+P//////8AAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAD/////////////8AAAAAAAAAAAAAAAAH//////8AAD//////////////////4AAAAAAAAAAAP/////8AAAAAAAAAAAAAAAP////////4AAAAAAAf///////////4AAAAAAAAf//////////////////////wAAAAAAAAAAAAAAAAP/////gAAAAAAP///////8AAAAAAAAAAAAA////////////////////wP////////////////AAAAAAAAAAAAAAD/////////////////////gAAAAAf///wAAAAAAAAAAAAAAAAAAAAAAAA///////+AAAB/AAAAAAAAAf/////gAAAAf////////////+AAAAAf//wAAAAAAAAAAAAP/////////+AAAAf///////////AAAAD///////////////////////////4AAAAAAAAAAAAAD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf////////////gAAAH//////////4AAAAAP//////////gAAAAAAAAAAAAAAf//////4AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////4AAAAAAAAAP/+AAAAAAAAAAA/////////4AAAAAAAAAAAAAAAAAAAAAAP//+AAAAAAAAAAAAAAAAAAAAAB////////gAAAAAAAAAAB////////////+AAAAAB////////////////////////////B////////////////////////////4AAAAAAAABAAAD/////////////////////gAAAAAAAAAAH///////////////////////////4AAAP///////////8AAAAD////////////////gAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////gAAAAAAAAAAAAAAAAAAAf//////////////wAAAAAAAAAAAAAAAAAAAAAAAAB/gAAAAAAf//////////4AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////8AAAAAAAAAAAAAAAAA////////////////4AAAAAAAAAAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAD/////////4AAAAAAAAf///////////////////////gAAAAAf//4AAAAAB//////////gAAAA//////////////////8AAAAAAAAAAAAAAAAAP///////AAAAAAAAAAAAAAAAAD//+AAAAAAAAAAAA///////////8AAAAAAH//////////////////////AAAAAAAAAAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAAA//4AAAAAAA//////////////////////8AAAAAAAAAAAAAAAf///////////////+AAAAAAAAAAAAAAAAf////////////////////////////A//////////////////////AAAAAAAAAeH////8AAAAAAAAAAP/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////AAAAAAAAAAD/////////////////////////+AAA///////8AAAAAAAAAAAAAAAD///////////////AAAAAAAAAAAAAAAAAf//////////////////////wAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAD//8AAAAAAAAAAAAAA//////wAAAAAAAAAAAAAAf/////////4AAAAAAAAAD////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAAAAAAAAAAAAA//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAH////+AAf/////////////wAAAAAAAAAAAAP////4AAAAAAAAAP//9//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////8AAAAH///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////AAAAAAf////////////////gAAAAf/////////////////wAAAAAAAAAAf/////////////wAAAAAAAB////////////////////////////+AAAAAAAAAAAAAAAAAAf//////////////////////////4AAAAAAAAAAH////////////wAAAAAAAAAAAA//////////////////4AAAAAAAAAAAAAAAAAAAP/////////////////////gAAAAAAAAAAAAAAA+///////////////////////////8AAAAAAAAAAAAAAAAB//////////////////////gAAAAAAAAAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////wAAAAAAAAAAAAAAAAAAAAAAf///////gAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////+AAAAAAAAAAAAAAAAB//H/////////////+AAAAAAA///+AAAAAAAD/////////AAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////4f/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////4AD////////////////////////gAAAAAAAAAAAAAAAAAAA//////////////////gAAAAAAAAP//////gAAAAAAAAAAAAAAAAAAAAAAH//////////8AAAAf////wAAAB////////8AAAAAAAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////AAAAAAAAAAAAAAAAAAAAP//////////////////////////AAAAAAAAAA/gAAAAAAAAAAAAAAH//////////////////wAAAAAAAAAAP//////+AAAAAAAAAAAAAAAAAA//////////AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////AAAAAAAAAAP/////+AAAAAAP//gAAAAAAAAAAAAAAAAAAAAAAAAD/+AAAAAAAAAAAAAAAAAAAAAAAAAf////////AAAAAAAAAAAAAAAD////////AAAAAAAAB//////////////8AAAAAAAAAf////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAB///////wAAAAAAAAAAAAAAAAAAAf////////////////4AAAAAAAAAAAAAAAAAAAD/////////AAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////+AAA//////+AAAAAAAAAAAAAAAAA///////////////////////////8AAAAAAAAAAAAAAAAAD///////////AAAAAAAAAAAAAAAAAAAAA//AAAAAAAAB/////////////////////8AAAAAAAAAAAAAAAAAAAAB////////////////////////4AAAAAAAAf/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH///////+AAAAAAAB/////////////////////////8AAAAAAAAAAAD/////////////////////8AAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAAAAA//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////w==", + "DSA": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "DSA-SHA": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "DSA-SHA1": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "DSA-SHA1-old": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "RSA-MD4": "042abcbbf1dbea3a7ec62422c95daf52", + "RSA-MD5": "0138351089a87a2ddc2d98255ce6b8cc", + "RSA-MDC2": "56db34cf44f8c027390ee03357f13a0b", + "RSA-RIPEMD160": "5df362b8f40bc08360c39931bc38ad5911ddc1a9", + "RSA-SHA": "10aa8186596e5b0473e1e8691ca32ce3f6c3afd8", + "RSA-SHA1": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "RSA-SHA1-2": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "RSA-SHA224": "2ba34b2d79ab45d358ac4149f3e955828caf60afa3d721b05ec4490d", + "RSA-SHA256": "b1870cae9e54cbe8ddd74782c98f6c9ec6eeb835e2765252530d71779685d4ea", + "RSA-SHA384": "b9f70aca302029cae4ed7881ca535bcdc1fbd208e4d9c2f35e69e9c76fed7acdb6e4bc147b9a07332d45439ef4e96d16", + "RSA-SHA512": "3d994a9ab4b95d6622f464dbf2ec8725fafe25988bb108cf9bd09b4c07ad0c3d1b3f6a2500b881f2bfd3b323894898014b4b1eab3956854b8ef1a6c991f73a5f", + "dsaEncryption": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "dsaWithSHA": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "dsaWithSHA1": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "dss1": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "ecdsa-with-SHA1": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "md4": "042abcbbf1dbea3a7ec62422c95daf52", + "md4WithRSAEncryption": "042abcbbf1dbea3a7ec62422c95daf52", + "md5": "0138351089a87a2ddc2d98255ce6b8cc", + "md5WithRSAEncryption": "0138351089a87a2ddc2d98255ce6b8cc", + "mdc2": "56db34cf44f8c027390ee03357f13a0b", + "mdc2WithRSA": "56db34cf44f8c027390ee03357f13a0b", + "ripemd": "5df362b8f40bc08360c39931bc38ad5911ddc1a9", + "ripemd160": "5df362b8f40bc08360c39931bc38ad5911ddc1a9", + "ripemd160WithRSA": "5df362b8f40bc08360c39931bc38ad5911ddc1a9", + "rmd160": "5df362b8f40bc08360c39931bc38ad5911ddc1a9", + "sha": "10aa8186596e5b0473e1e8691ca32ce3f6c3afd8", + "sha1": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "sha1WithRSAEncryption": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "sha224": "2ba34b2d79ab45d358ac4149f3e955828caf60afa3d721b05ec4490d", + "sha224WithRSAEncryption": "2ba34b2d79ab45d358ac4149f3e955828caf60afa3d721b05ec4490d", + "sha256": "b1870cae9e54cbe8ddd74782c98f6c9ec6eeb835e2765252530d71779685d4ea", + "sha256WithRSAEncryption": "b1870cae9e54cbe8ddd74782c98f6c9ec6eeb835e2765252530d71779685d4ea", + "sha384": "b9f70aca302029cae4ed7881ca535bcdc1fbd208e4d9c2f35e69e9c76fed7acdb6e4bc147b9a07332d45439ef4e96d16", + "sha384WithRSAEncryption": "b9f70aca302029cae4ed7881ca535bcdc1fbd208e4d9c2f35e69e9c76fed7acdb6e4bc147b9a07332d45439ef4e96d16", + "sha512": "3d994a9ab4b95d6622f464dbf2ec8725fafe25988bb108cf9bd09b4c07ad0c3d1b3f6a2500b881f2bfd3b323894898014b4b1eab3956854b8ef1a6c991f73a5f", + "sha512WithRSAEncryption": "3d994a9ab4b95d6622f464dbf2ec8725fafe25988bb108cf9bd09b4c07ad0c3d1b3f6a2500b881f2bfd3b323894898014b4b1eab3956854b8ef1a6c991f73a5f", + "shaWithRSAEncryption": "10aa8186596e5b0473e1e8691ca32ce3f6c3afd8", + "ssl2-md5": "0138351089a87a2ddc2d98255ce6b8cc", + "ssl3-md5": "0138351089a87a2ddc2d98255ce6b8cc", + "ssl3-sha1": "d7447e53d66bb5e4c26e8b41f83efd107bf4adda", + "whirlpool": "5b754bcf0ecbf9875f2b1c09d852d59d25c636110ececd531ecc1fd939010a7965ea9bbc7321c107d6a473c16bd6a90fae6bdd3497c2c588c37ac73f0297b836" + }, + { + "input": "////////////gAD////////////+AAAAAAAAAAAAAAAAAAAAAAA///////////+AAAAAAAAP/////////////////////wAAAAAAAAAAAAB//////////////////////wAAAAAAAAAAAAAAAAAB///////////////////////////4AAAAAAAAAD/////+AAAAAAAAAB///////////////////4AAAAAD///////////////AAAAAAAAAAAAAAAAAAAAAAP///////////////AAAAAAAAAA/////////////////////////AAAAAAAAB///////8AAAB//////////////////gAAP//////////////////////gAAAAAAAAAAAAAAAAA////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////AAD///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAP/wAAf//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////4AAAAAAAAAAAAAAAAAAA//////+AAAAAAAAAAAPwAP//////////////////////////8AAAAAAAAAAAAP/////////////////4AAAAAAf////////////////AAAAAAAAAAAAAD/////////////wAAAAAAAAAAAAAAAAAAAAAf/////////////////////4AAAAAAAAAAAAAAAAAAD///////////////////////4AAAAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////gAAAAAAAAAAAAAAD//////////////////////////8AAAAB//////////+AAAAAAAAAAAAAAAAAAAAP///////////////////////wAAAAAAAAAAAAD//////////////////////gAAAAAAAAAAAAAAB//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////4AAAAAAAAAB//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////8AAAAAAAAAAAAAAAAAAPAAAAAAAAAAB/////////////////////AAAAAAAP/////////////////////gAAAAAAAA///gAAAAAAAAAAAAAAAAD//////////////+AAAAAAAAAAAAAAAAAAAAAAAAD/////////////////wAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////AAAAAAAAAAAAAAf/4AAAAAAAAAAAAD///AAAAAAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////4AAAAAAAAAAAH//////////+AAAAAAAAAD////////////////////////////gAA////////////////////8AAAAAAAAAAAAA///////////////////////////+Af////////8AAAAP////////////////////////////AAAAAAAAAAA////////////////////////AAAAAAAA///////AAAAAAf/////////////////wAAAAAAAAAAAAAAAAAAAH//4AAAAAAAAAAAAAAAAAAAH////////////////8AAAAAAAAAAAAAAAAAAA//gAAAAAAAAAAAAAAAAAAAAAf/////8AAAAAAAAAAAB////////////////////////AAAAAAAAAAAAD//////////////////////////AAAAAAAf////////////+AAAAAP///////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////8AAAAAAAAAAAAAAAB//OAAAf///gAAAAAAAAAAAAAAAAAAf///////////////4A////gAAAAAAAAAAAAAAAAAAAAA/////////////////AAAAAAAAAAAAAAAAH/////////////+AAAAAAB//4AAAB//////////////////////////wAAAAAB/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////wAAAAAAAH/////////wAAAAAAf//4AAAAAAAAAAAAAAAAA/////gAAAAAAAAAAAAAAAAAAAAAB////+AAAAAAAAAAAAAAP/AAAAAAAAAAAAAAAAAAAB//////////////////////wAH/////////////wAAAAAAAAAAAAAAAB/////////4AAAAAAA////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAH///+AAAAAAAAAA//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAAAAP/////////////////gAAAAAAAAAAAB////////////8AAAD///////AA///////////AAAAAAAAAAAAAAAB////////////////////////wAAAAAAAAAH/////////////+AAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////4AAAAAAAAH///////wAAAAAAP///////////////4AAAAAAAAAAAAAAAAAAAB//+AAAAAAAAAB//////////////+AAAAAAH///////////8AAAAAAAAAAAAAB//////////wAAAAAAAAAAAAAgAAAAA////////////////AAAAAAAAAAAAAAAD/////////////gAAAAAAAAf/8AAAAAAAAAAAAAAAAAAAAA//////8AAAAAAAAMAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////8AAAAAAAAAAAAAAAAAAH/////////////////////gAAAAAAAAAAAAAP///////////////gAAAAAAAAAAAAAAAH/////////gAAAAAAAAAAAAAAAAD//////////////////wAAAAAAAAf//////////4AAAAAAAAAAAAAAAAAH///////////4AAAAAAAAAAAAAAAAf////////////////////////4AAAAAAAD//////////////gAAAAAAAAAAAAAAAAAAAAAAH//////AAAAAAAAAAAAAAAAAAAAAAAAAD//////////AAAAAAAAAAAAAAAAAAA////////////+AAAAAAAAAAAAAAAAAP/////////+AAAAAAAAf/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAB////gAAAAAAAAAAAAf///////////////////4AAAAAAAAAAD///////////////////////AAAAAAAAAAAB////////////////////////////gAAAAAAAAAAAAAAAAAAA+AAAAAAAAAAAAAAAP//////////AAAAAAAAP////////////////8AAAAAAAAAAAAAAAAAAAAAAAD/////////////////////gAAAAAAAAAAAAAAAAAAAAAAf///////////8AAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////8AAAAAAAAAAAAAAAAAAAAAAB///////////////////+AAAAAAAAB//////////////////8AAAAAwAAAAAAAAAAAAAAAAAAAAAH//wAAAAAAH//////////////////////////8AAAAAAAAAAAAAAAAAAAAAf//////////////AAAAAAAAAAAA////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAD////8AAAAAA/gAAAAAAAAAAAAAAAAAAAAAAfAAAAAAAP/////////4AAAAAAAAAAA////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////8D///////////////gAAAAAAAAAAAAD//////////////////8AAAAP///4AAAAAAAAAAAAAf//+AAAAAAAAAAAAAAAAAAAH/////////gAAAAAAAAAAAP///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////AAAAAAAAAAAAAAAP/////wAf///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////wAAAA///////AAAAAAAAAAAAAAAAAAAAAAAAP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////4AAAAAAAAAAAAAAAAAAAAAAf//////////////////////wAAAAAAAAAAAAAAAAH//////////8AP////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAD///////////wAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////AAAAAAAAAAAAAAAD/////AAAAAAAAH/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////4AAAAAAAAAAAAAAAAAAAAAH///////8AAAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAH///////AAAAAAAAAAAAA////////////gAAAAAAAAAB//////////////////////////wAAAAAAAAAAAAAAAAAAAP///AAAP/////////////////////////AAAAAAAAAAAAAAAAAAH///////////////////AAAAAAAAAD/////////AAAAAAAAAAAAAAAAAAf///////////gAAAAAAAAAAAAAAAAAAAAAAA", + "DSA": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "DSA-SHA": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "DSA-SHA1": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "DSA-SHA1-old": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "RSA-MD4": "ae8734be0f8339853232db5dabbf8814", + "RSA-MD5": "1f3e42daa4b315f2a0e6a530e0cc6976", + "RSA-MDC2": "02082f9c2402be9ef01c712d90d4e117", + "RSA-RIPEMD160": "f19b7624ca276bf25f44fbc8144dc4e39bbbb9bb", + "RSA-SHA": "3d2ea12085151a9f73efd3a1c403a884344b7cf5", + "RSA-SHA1": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "RSA-SHA1-2": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "RSA-SHA224": "e6109631bd6ca82801e934e567d5ca78338eb64eff9cc187141a9bc0", + "RSA-SHA256": "69850fe71261572f61d56863a7dc12aeda7931225d0eafb5b7b45aef7b6c8586", + "RSA-SHA384": "5edcbc3e49ce513ce5b60bc8f369001a9d3a8d996ff350d0e222aad8e9ab407426758bfe962a45bf800dbbe297c731c6", + "RSA-SHA512": "19f812d6a96e6062a71928bc5ed95d84659a4d70f6d47aebdd5eb19be1a8c163a121005228b8eae2fccced12c26b3a295a5c349daed623743b8602364cc2ee2c", + "dsaEncryption": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "dsaWithSHA": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "dsaWithSHA1": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "dss1": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "ecdsa-with-SHA1": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "md4": "ae8734be0f8339853232db5dabbf8814", + "md4WithRSAEncryption": "ae8734be0f8339853232db5dabbf8814", + "md5": "1f3e42daa4b315f2a0e6a530e0cc6976", + "md5WithRSAEncryption": "1f3e42daa4b315f2a0e6a530e0cc6976", + "mdc2": "02082f9c2402be9ef01c712d90d4e117", + "mdc2WithRSA": "02082f9c2402be9ef01c712d90d4e117", + "ripemd": "f19b7624ca276bf25f44fbc8144dc4e39bbbb9bb", + "ripemd160": "f19b7624ca276bf25f44fbc8144dc4e39bbbb9bb", + "ripemd160WithRSA": "f19b7624ca276bf25f44fbc8144dc4e39bbbb9bb", + "rmd160": "f19b7624ca276bf25f44fbc8144dc4e39bbbb9bb", + "sha": "3d2ea12085151a9f73efd3a1c403a884344b7cf5", + "sha1": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "sha1WithRSAEncryption": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "sha224": "e6109631bd6ca82801e934e567d5ca78338eb64eff9cc187141a9bc0", + "sha224WithRSAEncryption": "e6109631bd6ca82801e934e567d5ca78338eb64eff9cc187141a9bc0", + "sha256": "69850fe71261572f61d56863a7dc12aeda7931225d0eafb5b7b45aef7b6c8586", + "sha256WithRSAEncryption": "69850fe71261572f61d56863a7dc12aeda7931225d0eafb5b7b45aef7b6c8586", + "sha384": "5edcbc3e49ce513ce5b60bc8f369001a9d3a8d996ff350d0e222aad8e9ab407426758bfe962a45bf800dbbe297c731c6", + "sha384WithRSAEncryption": "5edcbc3e49ce513ce5b60bc8f369001a9d3a8d996ff350d0e222aad8e9ab407426758bfe962a45bf800dbbe297c731c6", + "sha512": "19f812d6a96e6062a71928bc5ed95d84659a4d70f6d47aebdd5eb19be1a8c163a121005228b8eae2fccced12c26b3a295a5c349daed623743b8602364cc2ee2c", + "sha512WithRSAEncryption": "19f812d6a96e6062a71928bc5ed95d84659a4d70f6d47aebdd5eb19be1a8c163a121005228b8eae2fccced12c26b3a295a5c349daed623743b8602364cc2ee2c", + "shaWithRSAEncryption": "3d2ea12085151a9f73efd3a1c403a884344b7cf5", + "ssl2-md5": "1f3e42daa4b315f2a0e6a530e0cc6976", + "ssl3-md5": "1f3e42daa4b315f2a0e6a530e0cc6976", + "ssl3-sha1": "77dd2a4482705bc2e9dc96ec0a13395771ac850c", + "whirlpool": "25419001a614e178b0a8e9e3755b8cc9bf36392e862eba8be7b774431ee9045bfafa7491c66f8ade25a705f9656b41eee3377fb55e6dd1363f7d22e21634fc45" + }, + { + "input": "//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAA////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////wAB////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8AAAAAAH//////////////wA//////////AAAAAAAAD///////////////AAAAAAAAAAAAAAAAAAAAAAAAf//8AAAAAAAAAAAAAAAAAAAAAAAAAH///////wAAAAAAP/////////4AAAB//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////gAAD////////////////////wAAAAAAAAAAAAAAAAAAAAAAB//////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////AAAAAAAAAAAAAAAAAAA///////////////////////+AAf//////////////////////////4AAAAAAAAAAAP///////////////////////AAAAAAAAAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAAH///wAAAAAB/////////////4AAAAAAAAAAAAAAAAAAH/////////////4AAAAAAAAA///////////////////////////gAAAAAAAAAAAAAAAAAAAAB/////////////////////AAAAAAAAAAAAAAB//////////////////////AAD//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAf////+AAAAAAAAAAAH////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AAAAAAAAAAAAAAAP//////////////////AAAAAAAAAAAAAAAAAAP///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////4AAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////8AAAAAAAAAH//8AAAAf//gAAAAAAAA///////////////wAAA//////////+AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////gAAAAAAAAD/////////////////AAAAAAAAAAAAAAP////////////////////wAAAAAAAAAAAAAAAAAAAAAAAA///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAH////////////4AAAAAAD//////////gAAAAAAAAAAAAAAf///////gAAAAAAAAAAAAH///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAf//////////4AH//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////AAAAAAAAAAAAAAAAAAAD///////////////8AAAAAP////////////////////+AAAAAD////////////g/////////////////+AAAAAAAAAB////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////8AAAAAAAAAAAAABwAAAAAAAAAAAAAAAAAAAAAH////////////AAAAAAAAAAAAAAAB/////////////////////////gAAAAAAAAAAA/////////////////////////////gAAAAAAP///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAP////////////////gAAAAAAB///////////////////////////wAAAAAAB///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAPgAAAAAAAAAAAAAAAAAAAAAAf/////////wAAAAAAAAAAAAAH/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////AAAAAA///////////////////////////+AAA////////+AAAAAAAAAAAAAAAAAAAAAAAAA///////////AAAAAAAAAAA////////////////j////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD/8AAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAAAAH/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////gAH/////////////////AAAAH///////////////////////AH/////////////////////////////gAAAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAAB//////////////////gAAAAAAAAAAAAAAAAAAAAA//////gAB/////////////AA/////8AAAAAB///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH/gAAAAAAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAB////gAAAAAAAAAAAAAAAAAAAAAB/////////////4AAAAAAAB////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAf//////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////4AAAAAAAAAAAAAAAAAAAB///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAP+AAAAAAAAAAAAAAAAAAAAAAAAB////////////////////8AAAAAAAAf////////gAAAAAAAAAAAAAAAAAAAA/////////////////////////////AD////////////////////wAAAAAAAB/////////////////////////////wAAAAAAAAAAAAB////////////////////////////8AAAAAAAAAAAf/////////////////wD///wAAAAAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAAAAD//////////AAAAAAAAAAAAAAAAAAAAAAAAB/////wAAAAAH/////////////////4AAAAAf///////////////gAAAA/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAAAP////////wAAAAAAAAAAP/////////////////////AEAAAAAD//////////////////////AAAAAAAAAAAAAAAAAA//////////+AAAAAAAAAAAAAAAA/////////////////////AAAAAAAAAP//////////////////////////4AAAAAAAAAAAP/////////////gAAAAAAAAAAAAAB/7/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///wP//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////4AAAAAAAAAAAAAAP//////4AAAAAAAAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAA//////////////gAAAAP//////////////gAAAAAAAAAAAH/////////////////////////gAAAAAAAAAAAAAAAAAAAAAA////8AAAAAAAAAAAAAAAAAAB///////////////////wAAAAAAAAAAAAAAAAAAAD/////////////////8AAAAAAAAAAAAAAAA/wAAAB//////////////////gAAAAAAAAAAAAAAAAP////////////////////////////8AAH//+AAAAP////////////gB///////////////wAAAAAAAAAAAAAAAAAAAAAAAH////////////+AAD///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAA////////////8AAAAAAAAAAAf////////////gAAAAAAAAAAAAAAAAf//4AAAAAAAAAAAAAAD////////////////////////////gAAAAAAAAAAAAAAA////+AAAAAAAAAAAAAAAAAAA/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////gAAAAAD///4AAAAAAAAAAAf/////////////AAAAB////////////////////////4AAAAAAAAAAD//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAD/////h//wAAAAAAA///////P//////////+AAAAAAAAAAAAAAAAAf////////AAAAAH//////////////////////////gAAAAAAAAAB/////wAAAAAAAAAAAAAAAAAAAAAAAAAf/4AAAAAAAAAAAAAAAAAAAAAP//////////////////////////AAAAAAAAAB////////////+AAAAAAAAAAAD//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////AAAAAAAAAAB//////gAAAAAAAAAAAAB/////////AAAAAAD/////////AAAAAAD//////////////////+AAAAAAAAAAAAAB////8AAAB///////gAAAAAAAAAAH////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////+AAAAAAAAAAH////////////////////AAA////gAAAAAAAAAAAAAAAAAAAAAB///8D////////////////////////////gAAAAP////wAAAAP/////////AAP/4AAAAAAAAAAAH/////////AAP//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "DSA": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "DSA-SHA": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "DSA-SHA1": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "DSA-SHA1-old": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "RSA-MD4": "ddb4e44343de924cea9716cde25b2e50", + "RSA-MD5": "aec4974f238a6e04dcb07e20ad861230", + "RSA-MDC2": "3bcd8868917aaeb6ce3d650810444b96", + "RSA-RIPEMD160": "ec5285128e058ab15294da535610674c5eaa55b8", + "RSA-SHA": "939cb03f381c9c0cac95828646240d7572be5e30", + "RSA-SHA1": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "RSA-SHA1-2": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "RSA-SHA224": "dd0c60a39cc66be93457d6c0ef0bcf6cac1e9f42fd10d48afcef3bf4", + "RSA-SHA256": "18fdfb38e4f516734cef5de8cba84a54a17cdaf13228621dfcd806c5e822eccd", + "RSA-SHA384": "69c7b211d24476e00f399749b348673edee6f98e96cfb3e2d42115e91e1f3498988baf8d3d52593712a7b9ab92332bfb", + "RSA-SHA512": "c5fa614fa377b61b8e0b6f98367108cae2b599cb6a5ca4ee8917fa8c61589dc67c0c8cc898688845dc992c218477def295ce231200eedb8de65696882f62c163", + "dsaEncryption": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "dsaWithSHA": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "dsaWithSHA1": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "dss1": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "ecdsa-with-SHA1": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "md4": "ddb4e44343de924cea9716cde25b2e50", + "md4WithRSAEncryption": "ddb4e44343de924cea9716cde25b2e50", + "md5": "aec4974f238a6e04dcb07e20ad861230", + "md5WithRSAEncryption": "aec4974f238a6e04dcb07e20ad861230", + "mdc2": "3bcd8868917aaeb6ce3d650810444b96", + "mdc2WithRSA": "3bcd8868917aaeb6ce3d650810444b96", + "ripemd": "ec5285128e058ab15294da535610674c5eaa55b8", + "ripemd160": "ec5285128e058ab15294da535610674c5eaa55b8", + "ripemd160WithRSA": "ec5285128e058ab15294da535610674c5eaa55b8", + "rmd160": "ec5285128e058ab15294da535610674c5eaa55b8", + "sha": "939cb03f381c9c0cac95828646240d7572be5e30", + "sha1": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "sha1WithRSAEncryption": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "sha224": "dd0c60a39cc66be93457d6c0ef0bcf6cac1e9f42fd10d48afcef3bf4", + "sha224WithRSAEncryption": "dd0c60a39cc66be93457d6c0ef0bcf6cac1e9f42fd10d48afcef3bf4", + "sha256": "18fdfb38e4f516734cef5de8cba84a54a17cdaf13228621dfcd806c5e822eccd", + "sha256WithRSAEncryption": "18fdfb38e4f516734cef5de8cba84a54a17cdaf13228621dfcd806c5e822eccd", + "sha384": "69c7b211d24476e00f399749b348673edee6f98e96cfb3e2d42115e91e1f3498988baf8d3d52593712a7b9ab92332bfb", + "sha384WithRSAEncryption": "69c7b211d24476e00f399749b348673edee6f98e96cfb3e2d42115e91e1f3498988baf8d3d52593712a7b9ab92332bfb", + "sha512": "c5fa614fa377b61b8e0b6f98367108cae2b599cb6a5ca4ee8917fa8c61589dc67c0c8cc898688845dc992c218477def295ce231200eedb8de65696882f62c163", + "sha512WithRSAEncryption": "c5fa614fa377b61b8e0b6f98367108cae2b599cb6a5ca4ee8917fa8c61589dc67c0c8cc898688845dc992c218477def295ce231200eedb8de65696882f62c163", + "shaWithRSAEncryption": "939cb03f381c9c0cac95828646240d7572be5e30", + "ssl2-md5": "aec4974f238a6e04dcb07e20ad861230", + "ssl3-md5": "aec4974f238a6e04dcb07e20ad861230", + "ssl3-sha1": "eaa1465db1f59de3f25eb8629602b568e693bb57", + "whirlpool": "dfd7448a75b44a7ec92b2776331b1f6fffe8132f9228a52eda76b4161372ef19e3928a8b07e26857b9f8f6416475838a0981d9e6adcc4a22a0a088584521783c" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAH///////////AAD///////////////////////////4AAAAAAAAAAAAD///////////////////////4AAAAAAAf////////////////////////////+AAAAcAAAAAAAAAAH/////////gAAAAAf/////////////////////8AAAAAAAAAAAAAAAB/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////wAAAAAAAAAAAAAAAAAAAAAAAAD/////////gAAAAAAAAAAAAAAAAAAAAAA////////////////////////////+AAAAAAAAAAAAAAAAAB/4AAAAAAAAH////////////4f////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////+AAAAAAAB/////////////////////////////wAAA/////////////////////4AAAAAAAAAAB///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////gAAAAAAAAAAAAAAAAB////////////////////////////+AAAAAAAAAAAAAAAB////////////wAAAAAAAAAAAAAAAAAAAAB///////////////////////////+AAAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////wAAAAAAAAAAAAAA////////////4AAAAAAAAAAAAAAAAP////////////////////////gAAAAAAAAAAAAAAAAP//////////AAAAAAA/////////+AAAAAAAAH//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//4AAAAH///gAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wAAAAAAAAAAAAAAAD///////wAAAAAAAAAAAAAAAAA/////////////////////////////+AAAAAAAAAAD////8AAH////////////////////8AAAAAAAAAAAAAAAAAAAAH///+AAAAAAAAAAAAAAP/+D//////////////////////wAAAAAAAAAAAAAH////////////////gAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////8AAf/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAB//wAAAAAAAAD////////////////AAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////wAAAAAAAP////////////////////////j//AAAAAAAAAAAAAAAA////////8AAAAAAAAAAAAB///////////////////AAAAAAAAAAAAAAAAAAAAAAP///////////////////////////8AAAAAAAAD/////////////////////////////wAAAAAAAAP///AAAAAAAAAAAAf////gAAAAAAD//////gAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////8AAAAAAAAAAAAAAAD////////////////+AAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////+B///////wAAAAAAAAAD//////////////////////////////gAAAAAAAD/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAH///////////////////AAAH//////////////4AAAAAAAAAAAAAAAAAAAf/////////////////wAAB//////////gAAB////////////////8AAAAAAAB////////8AH///////////////////////gAAAAAAAAAAAAAH/////////////////////4AAAAAAAAAAH///////////AAAAAAAP////////////4AAAAAAAAAAAAAA///////////////////gAAAAAAAAPgAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////wAAAAAAAAAB//////////////////gAAAAAAAAAAAAAAAAAP////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAB///////////////AAAAAAAAAAAAAAAAAAAAAH//////gAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////4AAAAAAAAAAAAAAAAH///////////////////////////H///////////gAAAD////////////////////////////+AAAD/////////AAAAAAAAAAAAAAAAAAAAA///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAB///gAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////4AAAAAAAAAAAAAAAAAA///////////4AAAAAA/////4AAAAAAAAAAAAAAAAAAAAAH//////8AAB/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAAAAAAAD/gAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////wAAAAAAAAAAAAAAAAAAAD/////////////////////AAAAAAAAD+AAAAAAAAAAAAAB//////////////8AAAAAAAAAP/4AAAAAAAAAAAAAD///////AAAAAAAAAAAAAAAAAAAAAAH////////////////////wAAAAAAAAP/////////////////////////////+AAAD//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAf////AAAAAAAAAAP///////8AB/////////wAAAH////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAf//////8AAAAAAAAAAAAAAAH//////////gAAAAAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAP///////////////////////////AAAAAAAAAAAP////AAAAAAAAAAAAAAAAA8AAAAAAAAH////////////////////AAAAAAAAAAAAAAAAAAH////////////////////////gAAH////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAf////+Af//////////////////////wAAAAD///////////////////AAAAAAAAAAA//gAAAAAAAAAAAAAAAAAA//////////4AAAAAAAAAAAAAAAAAAAAAAAP///////////////4AAAAAAAAAA/8AAAAAAAAAH////////////////////gAAAAAAAAAAf//////AAAAAAAAAAAAAAAAAAAAAA///////////+AAAAAAAAAAAAAAAAAAA/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAB///////4AAAf//////8AAAAAAAAAAAAAAAAAAAP/////4AAAAAAAAAAD////////////////////wAAAAAAAAAAAAAAA//////////AAAAAAAAAAAAAAAAAAAAAAAP//////4AAAAAAAP/AAAAAAAAAAAAAAAAAAP+AAAAAAAAAAAAAAAAAAAAA////////////////gP/////////////////////////wAAAAAAH/////////////////////////////4AAAAAAAAAAAAAAAAAAAAP////////////////////wAAAAAAAAAAAAAAAAAAAAAAf///////////////////////wAMAAAAAAAAAAAAAP///////////////////////8AAAAAAAAAAAAAAAAP//////////////////+AAAAf/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////gAAAAAAAAAAAAAA/////AAAAAAAAAAAAAAAAB////////////8AAAAAAAAAAAD////////////////////8AAAAAAAAAAAAAAAAAAD///////////////4AAAAAAAAAAAAAAAAAAAAAAAP////////////////wAAAAD////////////////////////4AAAAAAAAAAAAAAAAAAAAAP/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP////4AAAAAAAAAD////////////////////gAAAAAAAAAAAAAAAAAAAAAAP/////////wAAAAAAAAAAAAAAAAAAAAAB////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAB////////////////+AAAAAAAAAAAAAAAAAAAAAAD///////////////////////////8AAAAAAAAAA/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////8AAAAAAAAAAAAAAAB///////////////////////////AAAAAAAAAA//////////////////8AAAD///////////////////AAAAAAP/////////////////////////////AAAAAAAAAAAAAAAAAH//////////////8AAAAAAAAAAAAAAAAAAAAAA//////////////wAAAB///////8AAAAAAAAAAAAAAAAAAAAAAD///////////8AAAAAAAAAAAP/////////////////////////////+AAAAAAAAAAAAA//4AAAAAAAAAAAAAH///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////AAAAAAAAAH////////wAAAAAB//////////////////////////8AAAAAAAAAAAAAAA==", + "DSA": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "DSA-SHA": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "DSA-SHA1": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "DSA-SHA1-old": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "RSA-MD4": "5e008b0f5ccfa99983f8b7ff27a70377", + "RSA-MD5": "7a27fedaeec41b5832bda3169d76cd05", + "RSA-MDC2": "96990504fa79232e36fb4abb89758d46", + "RSA-RIPEMD160": "9953571d53d3afe746b72759b9906a40ec9eef7d", + "RSA-SHA": "4b0109732a726af4e36a6a76b693dfc2cc50079a", + "RSA-SHA1": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "RSA-SHA1-2": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "RSA-SHA224": "562ea42fd84074c05d95efdc297e754bc70984e8ac4afb320cefca0e", + "RSA-SHA256": "9db6e6591134181c2c19bbc57f24e11ea161165cde584e1f58c4df2fb5ee8c88", + "RSA-SHA384": "7a1a7bcd84311b53d905028331f617b66825919f33312fd014bca69725350eb04bc9ef19c452e49cf8c1d684198e1a9e", + "RSA-SHA512": "ebf031e509ce9143cd427c92df91c3e744aec4d4455eb69ec80d2dac4aaf1fbb699174d2d2a11f08f118f7f4cabc2ccfc6686eb5ba9a81843e223ce3f6f2d336", + "dsaEncryption": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "dsaWithSHA": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "dsaWithSHA1": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "dss1": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "ecdsa-with-SHA1": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "md4": "5e008b0f5ccfa99983f8b7ff27a70377", + "md4WithRSAEncryption": "5e008b0f5ccfa99983f8b7ff27a70377", + "md5": "7a27fedaeec41b5832bda3169d76cd05", + "md5WithRSAEncryption": "7a27fedaeec41b5832bda3169d76cd05", + "mdc2": "96990504fa79232e36fb4abb89758d46", + "mdc2WithRSA": "96990504fa79232e36fb4abb89758d46", + "ripemd": "9953571d53d3afe746b72759b9906a40ec9eef7d", + "ripemd160": "9953571d53d3afe746b72759b9906a40ec9eef7d", + "ripemd160WithRSA": "9953571d53d3afe746b72759b9906a40ec9eef7d", + "rmd160": "9953571d53d3afe746b72759b9906a40ec9eef7d", + "sha": "4b0109732a726af4e36a6a76b693dfc2cc50079a", + "sha1": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "sha1WithRSAEncryption": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "sha224": "562ea42fd84074c05d95efdc297e754bc70984e8ac4afb320cefca0e", + "sha224WithRSAEncryption": "562ea42fd84074c05d95efdc297e754bc70984e8ac4afb320cefca0e", + "sha256": "9db6e6591134181c2c19bbc57f24e11ea161165cde584e1f58c4df2fb5ee8c88", + "sha256WithRSAEncryption": "9db6e6591134181c2c19bbc57f24e11ea161165cde584e1f58c4df2fb5ee8c88", + "sha384": "7a1a7bcd84311b53d905028331f617b66825919f33312fd014bca69725350eb04bc9ef19c452e49cf8c1d684198e1a9e", + "sha384WithRSAEncryption": "7a1a7bcd84311b53d905028331f617b66825919f33312fd014bca69725350eb04bc9ef19c452e49cf8c1d684198e1a9e", + "sha512": "ebf031e509ce9143cd427c92df91c3e744aec4d4455eb69ec80d2dac4aaf1fbb699174d2d2a11f08f118f7f4cabc2ccfc6686eb5ba9a81843e223ce3f6f2d336", + "sha512WithRSAEncryption": "ebf031e509ce9143cd427c92df91c3e744aec4d4455eb69ec80d2dac4aaf1fbb699174d2d2a11f08f118f7f4cabc2ccfc6686eb5ba9a81843e223ce3f6f2d336", + "shaWithRSAEncryption": "4b0109732a726af4e36a6a76b693dfc2cc50079a", + "ssl2-md5": "7a27fedaeec41b5832bda3169d76cd05", + "ssl3-md5": "7a27fedaeec41b5832bda3169d76cd05", + "ssl3-sha1": "9329d5b40e0dc43aa25fed69a0fa9c211a948411", + "whirlpool": "ba8b0e75aa317eef75ff85f595dad2723d93accba038be982efb5f7ca72eabd9cdc3eb39f40eef00c1330c8a1dd205749b488e71dbaa5d884519b9ce28a15f1d" + }, + { + "input": "///////////////wAAAAAAAAAAAP////////////////////////4AAAAA//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAB//////+AAAAAAAAAAAAAAAAAAH////+AHwAAAAAAAAAAAAAAB////////////////AAA//////////////////8AAAAAAAAAAAH//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////AAAAAAAAAAB//////////////////////8AAAAAAAAAAA//////////////////////x/////////////4A///gAAAAAAAAAAAAAAAAAAAP////////////////////////AAAAAAAAAAB//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////4AAAAAAAAAAH/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAA/////////////+AAAAAAAAAAAAAAf///4AAf+AAAAAAAAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAD//////////////////////4AAAAAAAAAAAAAAAAAAAAP//gAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////gP////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////AAAAAAAAAAAAAAAAAAAB/////////////////////////////gAAAAAAAAA////////////4AAHwAAAAAAAAAf/////////////////////gAAAH///AAAAAAAAAAAAAAAAAAAAAf///////////////////AAAAAAAAAAAAAP///////////////AAAAAAAAAAAAAB////////4AAAAAAAAAD///8AAAAAAA8AAAAAAAA/////////gAAAAAAAAAAAAAAAAAAP////gAAAAAAAAAAB///////////////////////gAAAAAAAAAAAAAAAD//////////////////////////gAAAAAAAAAAAAAAAAAAAAB////////+AAP//////wAAAAAAAAAAAAAAf//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAA////8AAAAAAAA//8AAAAAf////////AAAAAAAB/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//8AAAAAAAAAAP////////////wAAAAAAAH////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////+AAAAAf//////4AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////+////////////////////////+AAAAAAAAAAAAAA////////////////gAAAAAAAAAAAAAAAAAAf////////////AAAAAAAAAAH/////////gAAAAAAAH//////////////wAAAAAAAAAAAAD///gAAAAAf/////////////gAAAAAAAAAAAf/////////gAAAAAAAAAAAAAAAAAAAAAAAAH///8AAAAAAAAAAAAAAf/////////////////gAD//////////////////////8AAAAAAAAD/////////////////wAAAAAAAAAAAAf///////////////wAAAf//////gAAAAAAAAP////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////8AAAAAAAAAAAAAAAAAP//////4AAAAAAAAAAAAAAAAAAAAAH////8AAAAAAAAAAAAAAAAAAAAAAD//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////AAAAAAD/wAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAAAf//////////////////gAAAAAAP///////////////8P///////////////////////8AAA/////////////////+AAAAAAAAAAAAAAAAAAAB//gAAAAAAAAAAAAAAAAAA//////////////////////////////gAAAAAAAAAAAAAAAAgAAP/////////////////////////gAAAAAAAAAAAAAAAAAA/////////4AAAAAAAAAAf//////////////////8AAAAAAAAAAAAAAAAAAAAAH4AAAf//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////+AAAAAB//////////AAAAB/////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////+B//////////AAAAAAAAAAAAAH//////////////////4AAB/////////////////////////////+AAAAAAB////////////////////////////AAAAAAAAAAAAAAAAA////wAAAAAAAAAAAH////////////+AAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAAAAAB4AP///////////////8AAAAAAAAAAAAAAAAAAAAAAB+AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////8AAAAAAAAAAAAAAAAAAAAAAAA///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAAAAAAAAAAAAf//////////////////////wAAAAAAAAAAAAH/////z//////////////////////gAAAAAAAAAAAAAAAAAAA///////8AAAAAAAAAAAAAAAAAAAAAf//////////////wAAAAAAAAAAAAAD/////////////////////////////4AAAAAAAA///AAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAAAD///////+AAAAAAAAAAAAAAAAA///////8AAAAAAAAAAAD///gAAAAAAAAAAB////////AAAAAAAAAAD////////////////////////+AAAAAAAAAAAAAAAB//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////4AAAAAAAAAAAAAAAAAA//////////////gAAAAAAAAB/////gAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAAAAAAAA///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////gB////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////wAAAAAAf//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////8AAAAAAAH//////////////+AAAAAAAAAAAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAAAAAAAD///wAAA/////////wAAB//AAAAAAAAAAAAAAAAAAAAAAAAAAAD///////8AAAf/////////////////wAAAAAAAAAAAAAAAAAAAAAf/////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////4AAAAAAAAAAAAAAAAB/////////////////////gD////////////////////////4AAAAAAAA//////////////////////AAAAAAAAAAAAAAAAAAAAP////////////////////////////gAAAAAAAAAAAAAAAAAAA///+AAAB///////////AAAAAAAAAAAAAAAAAAf///////////4AAAAB//////////////////////////gAAAAAAAAAAAAAAAAAH///////////////////AAAAAAAAAAAAP///////////////////+B///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////gAAAAB/////////AAAAAAAAAD////////////////////////AAAAAAAAA////////////AAAAAAAAAAAAAAAAAAD/////////////////gAAAAAAAAD//////////////////////////wAAAAAAAAAAAAA////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAA//////4AAD+Af////8AAAAAAAAAAAAAAf/gAAAAAAAH///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAAAAAP///////////gAAAAAAAAAAAAAAAAAAAAf/////////////////////wAAAAAAAAAAAAAAAAAP///////////////////////4AAAAAAAAAAB//////gAAAAAH//////////////4AAAAAAD////////////gAAAAAAAAAAAAAAAAAAAAAAAB////////////////////gAAAAAAMAAAAAAf////////////////////////+AAAAAAAAB///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////wAAAAAAAAAAAAAAH////wAAAAAAAAAAAAAAAAAH/////wAAAAAAAAAAAB//////////////////////////////gAAAAAAAAAAAAAD/////4AAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////8AAAAAAAAAAAAAAAAAAAAB/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////8AAAAAAAAAD///////////////4AAAAAAAAAAAAAAAAAAAAAAAf///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAH////gAAAAAAAAAAAAAf///////////////////////////gAAAP///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////gAAAAAAAAAAAAD//////4AAAAAAAAAAAAAAAAAAAAAAAAAAf///wAAAAAAAAf///////////////////////", + "DSA": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "DSA-SHA": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "DSA-SHA1": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "DSA-SHA1-old": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "RSA-MD4": "960ac5e5ef8876b2d0e4060574d1de06", + "RSA-MD5": "154bd1371ae66ad3ab9a9ee6b1324e36", + "RSA-MDC2": "975365f58fc3ccf0451de8fb53161da9", + "RSA-RIPEMD160": "4ecaadcd2d2f2af988045fddf25fe197e780af6f", + "RSA-SHA": "f12963c823ab1357312a4581526658c1a1acc65a", + "RSA-SHA1": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "RSA-SHA1-2": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "RSA-SHA224": "64d671725e8f7219ab06aaa2421947fe0b6297c192d430885ff56c91", + "RSA-SHA256": "86eafcaf23edfef66753d664eaa7813b5a16d1abc01a95f74ae88a02e42cadfb", + "RSA-SHA384": "1f1123751c9ded759d24d012da1b26a062475373da22f9e1681f8392b4ed5bd1c303b4e26240309b524c510b40421a0f", + "RSA-SHA512": "c5fc8a78f9106a42da273a6e95894cae0ebe9814a7e4df178c7962eebf251f285cef64a62546220c9a531233cd1d0a886957441ccbcd6ef3849493d1387870a6", + "dsaEncryption": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "dsaWithSHA": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "dsaWithSHA1": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "dss1": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "ecdsa-with-SHA1": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "md4": "960ac5e5ef8876b2d0e4060574d1de06", + "md4WithRSAEncryption": "960ac5e5ef8876b2d0e4060574d1de06", + "md5": "154bd1371ae66ad3ab9a9ee6b1324e36", + "md5WithRSAEncryption": "154bd1371ae66ad3ab9a9ee6b1324e36", + "mdc2": "975365f58fc3ccf0451de8fb53161da9", + "mdc2WithRSA": "975365f58fc3ccf0451de8fb53161da9", + "ripemd": "4ecaadcd2d2f2af988045fddf25fe197e780af6f", + "ripemd160": "4ecaadcd2d2f2af988045fddf25fe197e780af6f", + "ripemd160WithRSA": "4ecaadcd2d2f2af988045fddf25fe197e780af6f", + "rmd160": "4ecaadcd2d2f2af988045fddf25fe197e780af6f", + "sha": "f12963c823ab1357312a4581526658c1a1acc65a", + "sha1": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "sha1WithRSAEncryption": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "sha224": "64d671725e8f7219ab06aaa2421947fe0b6297c192d430885ff56c91", + "sha224WithRSAEncryption": "64d671725e8f7219ab06aaa2421947fe0b6297c192d430885ff56c91", + "sha256": "86eafcaf23edfef66753d664eaa7813b5a16d1abc01a95f74ae88a02e42cadfb", + "sha256WithRSAEncryption": "86eafcaf23edfef66753d664eaa7813b5a16d1abc01a95f74ae88a02e42cadfb", + "sha384": "1f1123751c9ded759d24d012da1b26a062475373da22f9e1681f8392b4ed5bd1c303b4e26240309b524c510b40421a0f", + "sha384WithRSAEncryption": "1f1123751c9ded759d24d012da1b26a062475373da22f9e1681f8392b4ed5bd1c303b4e26240309b524c510b40421a0f", + "sha512": "c5fc8a78f9106a42da273a6e95894cae0ebe9814a7e4df178c7962eebf251f285cef64a62546220c9a531233cd1d0a886957441ccbcd6ef3849493d1387870a6", + "sha512WithRSAEncryption": "c5fc8a78f9106a42da273a6e95894cae0ebe9814a7e4df178c7962eebf251f285cef64a62546220c9a531233cd1d0a886957441ccbcd6ef3849493d1387870a6", + "shaWithRSAEncryption": "f12963c823ab1357312a4581526658c1a1acc65a", + "ssl2-md5": "154bd1371ae66ad3ab9a9ee6b1324e36", + "ssl3-md5": "154bd1371ae66ad3ab9a9ee6b1324e36", + "ssl3-sha1": "e94c0b6aa62aa08c625faf817ddf8f51ec645273", + "whirlpool": "dc07e70fd4b9aaca80e3189e3699fe70514ebe1e7cb6887bb6d862d9a6f7e9151a281cf639c5f95c3af3a90248b264b3fa8169dcf85c6ce889c7e038fe6b7386" + }, + { + "input": "//wAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////gAAAAAAAAAAAAAAAAAAAAB///////wAAAAAAAAAAB///////4AAAAAAAAAAAAAAAAAAAAAAAD/////8AAAAAD////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA//gAAAAAAAAAAAAAAAAAAAAAD//////8AAAA/////////////4AAAAAAAAAAAAAAAAAAAAAAAAA////////////8AAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////AAAAAAAAAAAAAAA/////////////////////+AAAAB////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////4AAAAAAAAAAAAAAAAAAAAAH///////////////////////gAH//////////////x///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////+AAAAAAAAAAD////AAAAAAAAAAAAAAB///////////////4AAAAAAAAAAAAAAAA///////////////////////////////gH////////8AAAAAAAAAAAAAAAAAAAAAAAAAADAAf///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAf////////////////////////////AAAAAAB/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAB//////+AAB///////////////////////gAAAAAAAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAAAAAB//////////////////////////wAAAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAB////////////////8AH////4AAAAAAAAAAAAAAAAAD////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////AAAf///////////////////////////wAAAAAAAAAAAH///////////////////////////AAAAAAAAB//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAH/wAAAAAAA//////wAAAAAAAAAAAAAAAAAAAAAAAAf///wAAB///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAAAAAAAAAAAAAAAAAAAAB//////////////////////wAAAAA//////wAAAAAAAAA///////////////////AH//////////////////////////////D///////////////////wAAAAAAAAAAAA////////gAAAAAAAAAAAAAA/////////////////AAAAAAD//////////////////////////+AAAAAAAD////////////gAAAAAAAAAAAAH////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAf/////////////gAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAAAP8AAAAAAAAAAAAAAAAAAAAAAD/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////gAAAAAAAAAAf////////////////////////+AAAAAAAAAAAAAAAAAAAA///wAAAAAAAAAAAAAAAAAAH///////////////AAAAAAAAAAAAAAAAAAA//////////////////AAAAAAAAAAAAAD//////////////////////////////AAAf/////////////4AAAAAAAAAAAAAAAAD/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////+AH///////////AAAAAAAAAAAAAAAAAAAAAAB/////////v/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAP//////////8AAAAAAAAAAAf////////gAAAAAAAAAAAAAH/4AAAAAAAAAAAA////////////////////////////4AAAAAAAAAAAAAA///////////////////////////////gAAAAAAAAAAAAAAAAA////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAA///////////////4AAAP4AAAAAAAAAAAf/////////////AAAAB///////////////////////gAAAAAAAAAAP//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////8AAAAD//8////+AAAAAAAAAAAB////8AAAAAf/////////////////////////+AAAAAAAAAf8AAAAAAAAAAAAAAAAAAAAf//////////////////////////4AAAAAAAAAAAAAAAAAP//////////////////////AAAf//////////+AAAAA/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAB////////////////wAAAAAAAAB//////gAAAAAAAAAAf////////wAAAAD/////AAAA/////////////+AAAAAAAAAB///3/////4AAAAAAAAf////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////+AAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAf/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///AAAAA////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPgAAAAAAAAAB////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAf/////////////////8AAAAAAAAAf////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAAAP///AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////8AAAAAP////wAAAAAAAAAAAAAAAAAAB///////////////AAB///////////////////////////AAAAAAH/////////////////////+AAAAAAAAAP//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAA///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////wAAAAAAAAAAAAP///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAAAAAA///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////gAAAAAAAAAAAH////////////////////////4AAAAAAAAAAAAAD/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////wAAAAAAAAAB//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAP////AA//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAB////////////4AAAAAAAAA////////////+AAAAAAAAAAAAAAAAAAAAD////////////+AAAAAAH/4AAAAAAAAAP////////AAAAAAAAAAAAAAD/////////////////////////8AAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////gAAAAAAAAH//////////////+AAAAAAAH/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////4AAAAAAAAAAAAAAAAAAAP/8AAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////+AAAAAAAAAAAAA////////////////8AAAAAAD///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAAAAAAAAAAAAAAAAAAAA4AAAAAAAB////////////gAAAAAAAAAAAAAAAAAAAAAH/////////////////////////4AAAAAH///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////4AAAAAAAAAAAAAAAH///gAAAAAAAAAP///////////////4AAAAAAAAAAAAAAAAAAAAAB///////////////////////////gAAAf//////////////////////////+AAAAB/4AAAAAAAAAD8AAAAAf8AAAAAAAAAAAAAAAAAAB/////////////////////////////gAAAAAAAAAAAAAf///////////////wAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////wAB////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////8AAAAAAAAAAAAAAAAAAAAAB/////////////////////AAAAAAAAAAAAAAAH//AAAAAAAAAAA///////////////8AAAAAAAAAAAAAAB/wAAAAD//wAAAAAAAAAAAAAAAf/////wAAAAf///////////////////////////8AAAAAAAAAAAAAAAAAAAP//////////8AAAAAAAAAAAAAAAAAD//////////8AAAAAAAAAAf//4AAAAAAAAD//////////////////////////////8=", + "DSA": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "DSA-SHA": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "DSA-SHA1": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "DSA-SHA1-old": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "RSA-MD4": "4391a0d57bc22a817bd921e4a4ca2e6c", + "RSA-MD5": "a4594c9e974eed1fc159cc306dd7378a", + "RSA-MDC2": "f0cd130ff4918647d28e2aa51d125b65", + "RSA-RIPEMD160": "e9787fbc7cf6d8831b8f25210d902806aa9b5a3c", + "RSA-SHA": "f83f55c5afec00a4e67063932324bc1033261a73", + "RSA-SHA1": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "RSA-SHA1-2": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "RSA-SHA224": "7723da0766d08cfa5aa94138f6c8101bc75e52a409ccc0468483515e", + "RSA-SHA256": "7be29e433c7e17875c71eea08d10ada5a17eea25ead94d41cb1711e8fd204c06", + "RSA-SHA384": "452826a3740b00a70e570982fda86daa0e8d4a76d92000b73a049a0f91d56e9bb266a716ebd0098595936604cb3115c1", + "RSA-SHA512": "4ed3534e84d10d48d7723a6446962fb2f00b977adcce7fc0f59660663961b932133f4c48e3725c2c3e745b6566252d99dd308a8967e67195c1750981d52e61bf", + "dsaEncryption": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "dsaWithSHA": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "dsaWithSHA1": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "dss1": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "ecdsa-with-SHA1": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "md4": "4391a0d57bc22a817bd921e4a4ca2e6c", + "md4WithRSAEncryption": "4391a0d57bc22a817bd921e4a4ca2e6c", + "md5": "a4594c9e974eed1fc159cc306dd7378a", + "md5WithRSAEncryption": "a4594c9e974eed1fc159cc306dd7378a", + "mdc2": "f0cd130ff4918647d28e2aa51d125b65", + "mdc2WithRSA": "f0cd130ff4918647d28e2aa51d125b65", + "ripemd": "e9787fbc7cf6d8831b8f25210d902806aa9b5a3c", + "ripemd160": "e9787fbc7cf6d8831b8f25210d902806aa9b5a3c", + "ripemd160WithRSA": "e9787fbc7cf6d8831b8f25210d902806aa9b5a3c", + "rmd160": "e9787fbc7cf6d8831b8f25210d902806aa9b5a3c", + "sha": "f83f55c5afec00a4e67063932324bc1033261a73", + "sha1": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "sha1WithRSAEncryption": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "sha224": "7723da0766d08cfa5aa94138f6c8101bc75e52a409ccc0468483515e", + "sha224WithRSAEncryption": "7723da0766d08cfa5aa94138f6c8101bc75e52a409ccc0468483515e", + "sha256": "7be29e433c7e17875c71eea08d10ada5a17eea25ead94d41cb1711e8fd204c06", + "sha256WithRSAEncryption": "7be29e433c7e17875c71eea08d10ada5a17eea25ead94d41cb1711e8fd204c06", + "sha384": "452826a3740b00a70e570982fda86daa0e8d4a76d92000b73a049a0f91d56e9bb266a716ebd0098595936604cb3115c1", + "sha384WithRSAEncryption": "452826a3740b00a70e570982fda86daa0e8d4a76d92000b73a049a0f91d56e9bb266a716ebd0098595936604cb3115c1", + "sha512": "4ed3534e84d10d48d7723a6446962fb2f00b977adcce7fc0f59660663961b932133f4c48e3725c2c3e745b6566252d99dd308a8967e67195c1750981d52e61bf", + "sha512WithRSAEncryption": "4ed3534e84d10d48d7723a6446962fb2f00b977adcce7fc0f59660663961b932133f4c48e3725c2c3e745b6566252d99dd308a8967e67195c1750981d52e61bf", + "shaWithRSAEncryption": "f83f55c5afec00a4e67063932324bc1033261a73", + "ssl2-md5": "a4594c9e974eed1fc159cc306dd7378a", + "ssl3-md5": "a4594c9e974eed1fc159cc306dd7378a", + "ssl3-sha1": "7ff02b909d82ad668e31e547e0fb66cb8e213771", + "whirlpool": "d6c1ea8778d99ea4e9901339749e9d22bcdf1718ce22a8a43ca0da524994348aff320108f8d11435133c8d449395ef18ae607021d84d77d83ef2d572802a5c7f" + }, + { + "input": "////////////////gB8AAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////wAAP/////////////gAAAAAAAAAAAP/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAP////////4AAAAAAAAAAAAAAAAAAAH////8AAAAAAAAAAAAAAAAAAAAAH///////////////////////AAAAAAAAAAAAAAAAA///////////////////////H////////gD////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////gAAAAAAAAAAAAAAAD///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAf/////////+AAAAAAAAAAAAAAAAAAAAAAAAAA////////////////8AAAAAAAAAAAAAAAAAAAB//////////////////8AAAAAAAAAAAAAAAAD///8AAAf///gAAAAAAAAAAAAAAAAAAAD//wA///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAH//8AAAAAAAAAAAAAAAAAB////////////////////////gAAAAAAAAAAAAAAAAAAH///////////////////+AAAAAAAAAAAAAAAf//////wH////////////AAAAAAAAAAP///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////4AAAB///////////////////wAAAAAAAAAAAAAAAAAAAAf//////8AAAAAAAAAAAAAAAAAAAAAAAAfAAAAAAAAAAAAAAAAAAAAB//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////P///8AAAAAAAA//////////////////////////+AAAP/////////////////////////////8AAAAAAAAAAAAAAAAAAAAB/////////////////////////wAAAAAAB///////////gAAP///////////////////4AAAf//////////////+AAAAAAAAAAAAAAAAAf///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAB/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////gAAAAAAAAAAAAAAAAAAf//////////////8AAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////+AAAAAAAAAAB/////////////////////////AAD/////////////////////////8AAAAAAAAAAAAAAAAAAAB/////////////////////////////+AAAAAAAAAAAAAAAAf///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAP/////////////////gAAAAAAAAAAAAAAAP//////+///+AAAAAAAAAAAAAAAA/////////4AAAP/////////////////////wAAAAAAAAf////////////wAAAAAAAAAAAAAAAH////////////////////gAAP//////////////////////////////8AAD///////////////////wAAAAAH///gAAAAAAAAAAAAAAAAB///////////////4AAAAAAAAAH///////////////////+AAAA///////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////wAAAAAAAAAAAAH//////////////////////////+AAAAAAAAAAAAAAAAAAAB///////AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////wAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAAAB/+AAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////4AAAAAAAAAAAAAAAAAB/////////////4AAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAAAB////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////+AAAAAAAAAAAAH////////wAP////////////////gAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAA/////////////AAAAAAAAAB///////////////////////8AAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAP////////////////8AAAAAAAAAAH////////////////////////gAAAAP////////AAAAAAAAAAAAAAAAAAAAH/////////////////////gAAAf/////////////////////8AAAAAA/////////////////////////gAAAAAAAAAAAAAAA///////////////////////8AAAAAAAAAAAAAAAf////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAH/////////+AAAAAA////////////////////////8AAAAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAAAAAAAAB////////wAAAAAAAAAAAAAH/////////////////////////////8AAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAAAAAAAAA/////////////////4AAAAAAAAAAAAAAD/////////////////4AAAAAAAB////wAAAAf////////////////gAAAAAf//////wAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////A//////////////AAAAAAAAAAAAAAAAH///////////////////gAAAAAAAAAAAAAAAAAAAAH////4AAABwAAAAAAAAAAAAAAAAAAAAAAAf//AAAAAAAAAAAP//////////wAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////8AAf//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAD///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////+AAAAAAAAAAAAAP////////////4AAH/////////////////gAAAAAAA////////////wAAAAAAAAAAAAAAAAAAAAAAAAP////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////4AAAAAAAAAP/////////////////////gAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////gAAAAAAAAAAAAAAAP//////////////////////AAAAAAB//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////8AAAAAAAAAAAD//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////wAAAAAAAAAAAB////////////gAAAAAAAAAAA//////////////wAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////8AH//////////AAAAAAAAAAAAAAAAAAAB///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////AAf///////////////////////////8AAAAAAAB//////////////////////////////gAAAAAAAAAAAAH///////////////////////////wAAAAAAAAAAAH////////////////////////AAAAAAAAAAAAAAAAAAAB/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAA//////+AAAAAAAAAP/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH////wAAAAAAAAAAAAAAAAAAP///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////4AAAAAAAAAAAAAAAAP////////////8AAAAAAAAAAAAP//////////gAAAAB////////AAAA///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////4AAAD//////////////+D/////////wAAAAAAAAAAAAAAAAAAAAAAD////////////////gAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////wAAAAAAAAP//////////////////////////////AAAAAAA/////////////+AAAAAAAAAAAAAAAAAB/////////////////////////8P//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAB/////8AAAAAAP/////////////////////////////wH//////gAAAAAAAAAAf///wAP/////////////////////////////wAAAAAAAAAAAAAD////AAAAAAP//////////////////////4AAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAD////////////+AAAAAAAAAAAAAA/////////////////AAAAAAAAAAAB//////wAAAA///////wAAAAAAAAAAAAf////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAf///////////gAAAAf////////////////////////4D//////////////gAAAAAAAAAAAAAf//////////////////////////////+AAAAAAAAAAAAAAAAAAAAB///////+AAAAAAAAAAAAAAAAH////////////wAAAAAAAAAAAAAAH//////////////////////////////4AAAAAH////8AAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////8AAAAAAAA///////////////8AAAB////////////////////+///////////////////AAAAAAAAAAAAAAAAAH///////////////////////////+AAAAAAAAAAAAAAAP///AAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////+AAAAAAAAAAAAAAAAAAAf/////////////8AAAAAAAAAAAAAAAD//+AAAAAAAAAAAAeAAAAAAAAAAAAAAAAAAAAf/////////////////////////////8AAAAAAAAAAAAAH///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////gAAAAAAAAAAAA//////////////////////////////3////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", + "DSA": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "DSA-SHA": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "DSA-SHA1": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "DSA-SHA1-old": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "RSA-MD4": "6b4ba7bb0803768331cc9b1266be7aee", + "RSA-MD5": "431acd1a4a4d6036057c9906da8add5e", + "RSA-MDC2": "7103c0d2de5f349c99c9b93fc919cf32", + "RSA-RIPEMD160": "69c982f713bdac312732b964f7f15c911c024eff", + "RSA-SHA": "51d758af0a7e61726b0ce9f3400dd208db25a851", + "RSA-SHA1": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "RSA-SHA1-2": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "RSA-SHA224": "35dcdaf8f7760c994500e25f4b42e6c78e8bd8286a750fd68360aa91", + "RSA-SHA256": "c1f98aac0cfc98f30c3fa13fb8011b2a1d553e6c03edb8e2a35f47574237fc64", + "RSA-SHA384": "f4c39312fafc8a6eadf1c99359274e6a712b27474de052c56ec0a1b66c875d54228ace4e1e395b674d451c5a9c9a0002", + "RSA-SHA512": "1263ee50dddda760e3cd1aae4834fcee248b28d18012c45611f30c2f239d267f8d3e6945015a6c739abac78137e1f9f68c0df04a91ffc5616d4b8c8b2fb65e2f", + "dsaEncryption": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "dsaWithSHA": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "dsaWithSHA1": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "dss1": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "ecdsa-with-SHA1": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "md4": "6b4ba7bb0803768331cc9b1266be7aee", + "md4WithRSAEncryption": "6b4ba7bb0803768331cc9b1266be7aee", + "md5": "431acd1a4a4d6036057c9906da8add5e", + "md5WithRSAEncryption": "431acd1a4a4d6036057c9906da8add5e", + "mdc2": "7103c0d2de5f349c99c9b93fc919cf32", + "mdc2WithRSA": "7103c0d2de5f349c99c9b93fc919cf32", + "ripemd": "69c982f713bdac312732b964f7f15c911c024eff", + "ripemd160": "69c982f713bdac312732b964f7f15c911c024eff", + "ripemd160WithRSA": "69c982f713bdac312732b964f7f15c911c024eff", + "rmd160": "69c982f713bdac312732b964f7f15c911c024eff", + "sha": "51d758af0a7e61726b0ce9f3400dd208db25a851", + "sha1": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "sha1WithRSAEncryption": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "sha224": "35dcdaf8f7760c994500e25f4b42e6c78e8bd8286a750fd68360aa91", + "sha224WithRSAEncryption": "35dcdaf8f7760c994500e25f4b42e6c78e8bd8286a750fd68360aa91", + "sha256": "c1f98aac0cfc98f30c3fa13fb8011b2a1d553e6c03edb8e2a35f47574237fc64", + "sha256WithRSAEncryption": "c1f98aac0cfc98f30c3fa13fb8011b2a1d553e6c03edb8e2a35f47574237fc64", + "sha384": "f4c39312fafc8a6eadf1c99359274e6a712b27474de052c56ec0a1b66c875d54228ace4e1e395b674d451c5a9c9a0002", + "sha384WithRSAEncryption": "f4c39312fafc8a6eadf1c99359274e6a712b27474de052c56ec0a1b66c875d54228ace4e1e395b674d451c5a9c9a0002", + "sha512": "1263ee50dddda760e3cd1aae4834fcee248b28d18012c45611f30c2f239d267f8d3e6945015a6c739abac78137e1f9f68c0df04a91ffc5616d4b8c8b2fb65e2f", + "sha512WithRSAEncryption": "1263ee50dddda760e3cd1aae4834fcee248b28d18012c45611f30c2f239d267f8d3e6945015a6c739abac78137e1f9f68c0df04a91ffc5616d4b8c8b2fb65e2f", + "shaWithRSAEncryption": "51d758af0a7e61726b0ce9f3400dd208db25a851", + "ssl2-md5": "431acd1a4a4d6036057c9906da8add5e", + "ssl3-md5": "431acd1a4a4d6036057c9906da8add5e", + "ssl3-sha1": "5bb3570858fa1744123bac2873b0bb9810f53fa1", + "whirlpool": "1fa150456efd95b4125f416b819b873ac52bfc50bc97a51885e3205f86e7e6db6bb362a12f67cb501b9e8e18b521c7cd24bb3fe32bb5f2a9e163dcd538cfee56" + }, + { + "input": "////gAAAAAAAAH/////////////8AAAAAAAAAAAAAAAAAH/////////////////////////////A///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////8AAAAP/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////A////+AAAAAAAAAAAAAP//////////////////wAP/////////////////////////z//////////////////////4AAAAAAAAAAAAAB///////////////////////////////wAAAAAAAAAAAH//////////gAAAAAAAAAAAAAAAAAAAAP////////////////////+AAAAAAAf///////////////////////////AB////////////////gAAAAAAAAAAAAAAAAA////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAA////wAAAAAAAAAAAAAAAAAAAAAAAD/////////+AAAAAAAAAAAAAAAAAAAAAH//////////////gAAAAAAAAAAAAAAAAAAAf//////////////////////wAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAA///////////gAAAAAAAAAAAAf///////////////////////8AAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////4AAAAAAAAAAAAAH///////8AAAAAAAAAAAAAAf/////4AAAAAAAH///////////////////////////////4AAAAAAAAAB////AAAAAAAAAAD///////////////////////4AAAAAAAAAAAH///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAB/////////////////4AAAAAAAAAAAAAAAAAA////////+AAAAAAAAAH+AAAAAAAAAAAAAAAP8AAAAAAAAAAAAAB////////////////////wAAAAAAAAAAAAAAAAAAAP/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////+f///////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////wAAAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAAAB///wAAAAAB///////////////gAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////gAPgAAAAAAAAAAAAAAAAAAAAAAAAf///////gAAD/////////////+AAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////AAAAAAAAAAAAAAD/////////////////f////////////////////AAAf//////////////////4AAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAAAAf///AAAAAAAf////////////////AAAAAAAAAD//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAB////////////+AAAAAAAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAB//////////////////////////////8AAAAAAAAAAAAAA/////////////////////////gAAAAAAAAAAAAAAAAAAAAB//////////////////////gAAAAAAAAAAAAAAAAAAAAAAA/////8AAAAB////gAAAAAAAAAAAAAAAAAAAH/////+AAAAAAH//////////////////gAAAAAAAAAAAAAAAP////+AAAAAAAAAAAAAAAAAAAAAAH///////+AAAAAAAAAAAAAAAAP////////////////////4AAAAAAAAAAAAAAAAAAAD//////////////////////////gP//4AAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////f////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4AAAAAAAAAAAAAAAAAAAAAf//////////////////+D/////////////////AAAAAAAB////////////////////+AAAAAAAAAAAAAAAAAA///////////////wAAAAAAAAAAAAAAAAAAAAB////////4AAAAH///////////////////////////////8AAAAAAAAAAAAAAD/////4AAAAAAAAAAD///////////////////AAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////gAAAAAAAAAAAAAAAAAAAH////4AAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////+AAAAAAAAAAAAAAAAAP/////////////gAAD////////////4AAAAAP///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAf///////////////AAAAAAAAAAAA//////////////////////////////+AAAAAAAAAAAAAAAH/////4AAAAAAAAAAAAAAAP////////////////////wAAAAAAAAAAAf////////////////////////D///////////AAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////8B////////AAAAAH////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAAAH///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////gAAAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAD/////8AAAAAAAAAAAAAAAAAAAAH/wAAAAAP//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////gAAAAAAAAAAAAAAAAAAAA////7///////////4AAAAAAAAAAAAAAAAAAAAAD/////////+AAAAAAAAAAAAAAAAAAAAAAB///////////////////////////+AAAAAAAAAAAAAA/////////////////////+D///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////4AAAAAAAAAAAAAAAAAAA///////////////////////8AA/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////8AAAAAAAAB/8AAAAAAAAAAAA//////////////AAAAAAAAAAAAAf///////////////////////////H//////gAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////8AAAAAAAAAAAAAAAAP//////////////////////////4AAf////////////////////wAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////+AAAAAAAAAAAAAAAA//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAAAH//4AAAAAAAAAAAAAAAH/////////////////////////gAAAAAAAAAAAAAAAAP////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAD//////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAf/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////+AAAAAAAAAAAf/////////////////////////+AAAAAAA//////////////////gAAAAAAAAAAAAAAAAAAAAAAf////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAfgAAD///4AAAAAAAAAAAAAAAAAAAAAAAAP//8AH/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAH//////+AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////AAAAAAAAAAAAAAAAAAAAAAf//////////////////wAAAP////AAAAAAAAB/////////////////gD//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////AAAAAAAAAP/////+AAAAAAAAAAAAAB//////////////wAAAAP//////////////////////////4AAAAB///////////4AAAAAAAAAAAA///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAAAH//////////gAAAAAAAAAAAAAA///////////////////////////////AAAAAAAAAAAAAAAAAAA//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAD/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////gAAAAAAAAAP/////////////////////////AAAAAAAAAAAAAAAAAAH//AAAAAAAAAAAAAAAAAAAf////////////gAAAAAAAAAAAAAAAAAP/////////////////wAAAAAAAAAAAP////////////////////////////+AAf///////////AAAAAAAAAAAAAAAAAf////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAB//////gB////////+AAAAAAAAAAAAAAAAAAAAAB//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////wAAAAAAAAAAAAAAAAAAAAP/////////+AAAAAAAAAAAP/////+AAAAAAAAAAAAH8AAAAAAAAAAH////////////////////////////AAAAAAAAAAAAAD////////////////////////////wAAAAAAAAAAAAAAAAP////////////////////AAAAAAAAAAAAAAAAAAAAAAAP/////////////gAAAAAAAAAAAAAAAAAA", + "DSA": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "DSA-SHA": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "DSA-SHA1": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "DSA-SHA1-old": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "RSA-MD4": "c38e08c825c3dc0572aaf38cd23d07bf", + "RSA-MD5": "f6afe47bdedf075c7e188b2640152cf7", + "RSA-MDC2": "5f94b6e3a14d4b1cf694f072fe2f7ddf", + "RSA-RIPEMD160": "9521c22bf745d159c417053af365402c22168375", + "RSA-SHA": "db6fd66569bdec06eb6ff28d1ab82d6947e8a930", + "RSA-SHA1": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "RSA-SHA1-2": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "RSA-SHA224": "1602c72a9d7ab2cf4c3b0af1640941d09b2ff2f6c7b9a9f6f915138f", + "RSA-SHA256": "981571f9393463f49cd5352c024a8998d7b139bc8aec7a512101edb18a7e0954", + "RSA-SHA384": "2167d3773885d1e9553720f49c51789a7a8de91b3c09b87ae2d06e12f2d24a16561c6755d4c1e699c6b3a2751961541f", + "RSA-SHA512": "b5adf124a9d519929f4e9dea2d9a1d061451abab6046d51e973d6fd1704cfa8c2f5bf50a950d7d3490ec8032490ed27da5532247c1a7f4831ab355ee28721fa1", + "dsaEncryption": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "dsaWithSHA": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "dsaWithSHA1": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "dss1": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "ecdsa-with-SHA1": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "md4": "c38e08c825c3dc0572aaf38cd23d07bf", + "md4WithRSAEncryption": "c38e08c825c3dc0572aaf38cd23d07bf", + "md5": "f6afe47bdedf075c7e188b2640152cf7", + "md5WithRSAEncryption": "f6afe47bdedf075c7e188b2640152cf7", + "mdc2": "5f94b6e3a14d4b1cf694f072fe2f7ddf", + "mdc2WithRSA": "5f94b6e3a14d4b1cf694f072fe2f7ddf", + "ripemd": "9521c22bf745d159c417053af365402c22168375", + "ripemd160": "9521c22bf745d159c417053af365402c22168375", + "ripemd160WithRSA": "9521c22bf745d159c417053af365402c22168375", + "rmd160": "9521c22bf745d159c417053af365402c22168375", + "sha": "db6fd66569bdec06eb6ff28d1ab82d6947e8a930", + "sha1": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "sha1WithRSAEncryption": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "sha224": "1602c72a9d7ab2cf4c3b0af1640941d09b2ff2f6c7b9a9f6f915138f", + "sha224WithRSAEncryption": "1602c72a9d7ab2cf4c3b0af1640941d09b2ff2f6c7b9a9f6f915138f", + "sha256": "981571f9393463f49cd5352c024a8998d7b139bc8aec7a512101edb18a7e0954", + "sha256WithRSAEncryption": "981571f9393463f49cd5352c024a8998d7b139bc8aec7a512101edb18a7e0954", + "sha384": "2167d3773885d1e9553720f49c51789a7a8de91b3c09b87ae2d06e12f2d24a16561c6755d4c1e699c6b3a2751961541f", + "sha384WithRSAEncryption": "2167d3773885d1e9553720f49c51789a7a8de91b3c09b87ae2d06e12f2d24a16561c6755d4c1e699c6b3a2751961541f", + "sha512": "b5adf124a9d519929f4e9dea2d9a1d061451abab6046d51e973d6fd1704cfa8c2f5bf50a950d7d3490ec8032490ed27da5532247c1a7f4831ab355ee28721fa1", + "sha512WithRSAEncryption": "b5adf124a9d519929f4e9dea2d9a1d061451abab6046d51e973d6fd1704cfa8c2f5bf50a950d7d3490ec8032490ed27da5532247c1a7f4831ab355ee28721fa1", + "shaWithRSAEncryption": "db6fd66569bdec06eb6ff28d1ab82d6947e8a930", + "ssl2-md5": "f6afe47bdedf075c7e188b2640152cf7", + "ssl3-md5": "f6afe47bdedf075c7e188b2640152cf7", + "ssl3-sha1": "905f43940b3591ce39d1145acb1eca80ab5e43cd", + "whirlpool": "56d8556fafbfb14794d84afbb9976bf93e4be93d5f3ddb7f75cd63c4a60668fc2dc015a4614ffe8cf99c35c254cad7162470f1d5bb155d3f68df6471b0516105" + }, + { + "input": "///////////////////////////////4AAAAAAAAAAAf/////////////AAAAB/////////////////////+AAAAAAAAAAA///////////////////gAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////AAP///////////////////////////////z//////////////////////////////+AAAAAAHwAAAAB//////////////////////////4AAAAAAAH//////////////////////////////AAAAAAAAAAAAAAAf/////////////////////gAAAAAAAAAAAAA//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAAAAAAAAAAAAAAAB///////////////AAAAAAAAf/////4AAAAAAAB/////////AAAA/wD////////gAAAAAf/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////gAAAAAf////////4AAAAAAAAAAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAAAAAAAA////////////////////////////AAAAf////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAB///////////////////////////wAD////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////+AAAAAAD/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf///+AAAAAAAAAAAAA//////+AAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////8AAAAAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////gAAAAAAAAAAwAAA///////////////4AAAAAAAAAAAAAP///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAD///4AAAAAAAAAAAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAf/////////////////////AAAAAAAAAAA///////////////////////AAAAP////////////wAAAAAAAAAAAAAAAAAAAAAAAD////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////AAAAAD/////////////////////////////gAAB/////////////////////wAAAAAAAAAAD///////////////////////////8AAAAAAAAAAAAAAAAAAf///////////4AAAAAAAAAAAAAAAAAAAf////////////AAAAAAAAP////////////////////////////wAAAAAAAAP///////gAAAAAAAAAAAAAD///////////////////////AAAP/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////4AAAAAAAAAH/////AAAAAAAH///////////////AAAAAAAB/gAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////wAAAAAAAA/////////wAAAAAAAAAAAAAAAAAAAA///wAA/////////////////////////AAAAAAAAAAAAAAAAAAAH///4AAAAAAAAAAAAAH///////gAAAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAH/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////4AAAAAAAAAAAAAAAAAA////////////////////////////////8AAAAAAAAAAAB//wAAAAAAAAAAAAAAAAAAAAAH//////////////////////gAAAAAAAAAAA////////////////8AP/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////gAAAAAAAAAAAAAAAAAAAAAAA///////////////////AAAAAAAAAAAAAAAP//////////////////////////////gAAAAAAf//////gAAAAAAAAAAAAAAAAAAB/////////////////////////+AAAf/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////4AAAAAAAAAAAAAAAH/////////////////////////////4AAAAAD///////////+AAAAAAAAAAAAAAAAAAAAAAf/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////gAAAAAAD////////////////////////////wAAf///////////////////////////AAAAAAAAAAAAAAAf///////////////////////////gAAAAAAAAAAH//////////////wAAAAAAAAAAAAAAAAAAAAAD///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////gAAAAB///////////////////////wAAAAAH////////////////////////+AAAAAAAAAAAAAAAAAAP//////////////////+AAAAAAAAAAAAAAAAA//////////gP/////AAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////AP/////////////+AAAP///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAA//////////////wAAAAAAD////////////wAAAAAAAAAAP////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///wAAAAH//////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////8AAAAAAAAH////////////////////////wAAAAAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAAAAAAAAAAA////wAAAAAAAAAAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAAP///////////////////+P//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////4AAAAAAAAAAAAAH///////////////////////////AAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////wAAAAAAAAAAAAAAAAAAAAA////////gAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAH////////////////8AAAAAAAAAAAAAAAB////////////////////////////////8AH//8AAAAAAAAAAAAAAAAAAAIP///////////////////gAAAAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAB////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAf///////////gAAAAAH8AAAAAAAAAAAP///////gAAAAAAH/////////////////////////wAAAAAAH//gAAAAAAAAAAAAAAAAA////////////////////+AAAAAAH////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////wAAAAAAAAAAAAAAAAAAAAAf///////////////////////wAAAAAAAAAAAAAAAAAP//////////////////////////////gf///////4AAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAD///////gAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAAAP/////////////wAAAAAAAAAAAAAAAAAAAAB/////////////////////////AAH///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////+AAAAAAAAAB///////////////////////////////gAAAAAAAA//////////////////gAAAAAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAD///////wAAAAAAAAAAAAAAAAAAAAAAAD8AAAAAAAAAAAAAAAAAAAAAAP/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////gAAAAAH///////////////////////////8AAAAAAAAAAAAAB//////////wAAAAAAAAAAAAAB////////////////AAAAAB////////////////////////////////j/////////////wAAAAAAAA//gAAAAAAAAAAAAAAAAAAAAAf//////wAAAAAAAAAf//////////////4AAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////+AAAAAAAAAAAAAAAH/////////4AAAAAAAAAAAAAAAAAAf/8AAAAAAAH///////////////////////////gAAAAAAAAAAAAAAAAAH/////////////////////////////wAAAAAAAAAAAAAAAB///////////wAAAAAAAAAAAAAAAAAAAAAAAAf///////////////+AAAAAAA///////////////////////AAAAAAAAAAAH///////////gAAAAAAAAAAAAAAAAAAAD//////////////4AH/////////////////////////+AAAAAAAAB//////////////+AAAAAAAAAAAB///////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////+AAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////AAAAAGAAAAAAAAAAAAAAAAD//////////gAAAAAAH//////////////////gAAAAAAAAB//////wAAAAAAAAAAAAAAAAAAAAAAAf///////////4AAAAB/////////////////8AAAAAAAAAAAAAAH////////8AAAAAAAAAAAAAAAAAAAAAAAH////8AAAAAAAH////////////////////AAAAAAAAAAAAAAAAAAAAB4AAAAAAAAAAAAAAAAAAAAAA///AAAAAAAAAAAAAAAAAAAAAAAH////////////+AAAAAAAAAAAAAAAAAAAAAAD//////////////wAAAAAAAAAAAAB/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "DSA": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "DSA-SHA": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "DSA-SHA1": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "DSA-SHA1-old": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "RSA-MD4": "de3694df0817b6263272c7f6069c5552", + "RSA-MD5": "8bc3bd8625778f64ed7c29698025f292", + "RSA-MDC2": "4c66604859b648c1c2d960bdfd8cb458", + "RSA-RIPEMD160": "b7a1b9d7afd4590c09595f7a1bb92e6b9d819d60", + "RSA-SHA": "41b2e391eb39cf8683e88467f14ce6944a9ab10c", + "RSA-SHA1": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "RSA-SHA1-2": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "RSA-SHA224": "552437e43c173e40fceeaa65f6b8cd59f062d1a1a625f8ba063aa4e3", + "RSA-SHA256": "8628162a5c9d34c94e60027175f819e98a356832a3d3898a7f11b95e171e2a73", + "RSA-SHA384": "5a24a0f490e2dcac67924ae2e0fe351e7cf45a525ab24a093c7466337d1e00e2714c4c667b8e6e78a6484272e1798e37", + "RSA-SHA512": "d1e420127b234fee4a21777a107b75009621fad13facfe4af57a03de9ca4eeabdf5cf6bd1db312deb2ea2013ba0ca3ae64fa48794464cc12fbb4dfcedcb24a60", + "dsaEncryption": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "dsaWithSHA": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "dsaWithSHA1": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "dss1": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "ecdsa-with-SHA1": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "md4": "de3694df0817b6263272c7f6069c5552", + "md4WithRSAEncryption": "de3694df0817b6263272c7f6069c5552", + "md5": "8bc3bd8625778f64ed7c29698025f292", + "md5WithRSAEncryption": "8bc3bd8625778f64ed7c29698025f292", + "mdc2": "4c66604859b648c1c2d960bdfd8cb458", + "mdc2WithRSA": "4c66604859b648c1c2d960bdfd8cb458", + "ripemd": "b7a1b9d7afd4590c09595f7a1bb92e6b9d819d60", + "ripemd160": "b7a1b9d7afd4590c09595f7a1bb92e6b9d819d60", + "ripemd160WithRSA": "b7a1b9d7afd4590c09595f7a1bb92e6b9d819d60", + "rmd160": "b7a1b9d7afd4590c09595f7a1bb92e6b9d819d60", + "sha": "41b2e391eb39cf8683e88467f14ce6944a9ab10c", + "sha1": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "sha1WithRSAEncryption": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "sha224": "552437e43c173e40fceeaa65f6b8cd59f062d1a1a625f8ba063aa4e3", + "sha224WithRSAEncryption": "552437e43c173e40fceeaa65f6b8cd59f062d1a1a625f8ba063aa4e3", + "sha256": "8628162a5c9d34c94e60027175f819e98a356832a3d3898a7f11b95e171e2a73", + "sha256WithRSAEncryption": "8628162a5c9d34c94e60027175f819e98a356832a3d3898a7f11b95e171e2a73", + "sha384": "5a24a0f490e2dcac67924ae2e0fe351e7cf45a525ab24a093c7466337d1e00e2714c4c667b8e6e78a6484272e1798e37", + "sha384WithRSAEncryption": "5a24a0f490e2dcac67924ae2e0fe351e7cf45a525ab24a093c7466337d1e00e2714c4c667b8e6e78a6484272e1798e37", + "sha512": "d1e420127b234fee4a21777a107b75009621fad13facfe4af57a03de9ca4eeabdf5cf6bd1db312deb2ea2013ba0ca3ae64fa48794464cc12fbb4dfcedcb24a60", + "sha512WithRSAEncryption": "d1e420127b234fee4a21777a107b75009621fad13facfe4af57a03de9ca4eeabdf5cf6bd1db312deb2ea2013ba0ca3ae64fa48794464cc12fbb4dfcedcb24a60", + "shaWithRSAEncryption": "41b2e391eb39cf8683e88467f14ce6944a9ab10c", + "ssl2-md5": "8bc3bd8625778f64ed7c29698025f292", + "ssl3-md5": "8bc3bd8625778f64ed7c29698025f292", + "ssl3-sha1": "336c79fbd82f33e490c577e3f791c3cbfe842aff", + "whirlpool": "d3b274ea00162c8c3124e5ff0ea7c11d0458b216c57034f92d66e2176a24084896356d268f085b393098a4beb3366376b8094da62620224bbf2efcbae74f90ba" + }, + { + "input": "AAAB//////////////////////gAAAAAAAAAAAAAAAAP///////4AAAAAAAAAAAAAAAA///////wAAAAAAAAAA//////////////////////////8AAAAAAAAAAA///////////////////////////////8AAAAAAAAAAAAAAAAAAD/////////////////gAAAAAAAAAAAAAAP/////////////8AAAP///+AAP///////////8A///8AAAAAAAAAAAAAAAAAAAAAAAAB/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////gAAAAAAAAAAAAAP//////////////wAAAAAAAAAAAAAAAAAAAAD/g/////////////////////////////gAAAAAAAAAAAAAAAAAAAAD//4AAAAAAf/////////AAAAAAAAAAAAAAAAAAAAB///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////+AAAAAAAAAAA/////////8AAD////////////////gAAP////////gAAAAAAAAAAAAAAAAAAAAD//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////+AAAAAAAAH////////////////////gAAAAAAAAP///////////////gAAAAAAAAAAAAAAAAAAAAAAf////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAAAAAAH///////////////////+AA//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////4AAAAAAAAAAAAAAAAAAD//////////////////////////4AAAAAAAA//wAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////gAAAAAAA//////////AAAAAAAAAH/////////////+AAH//////////////////////////////gAAAAAAAAAAAAAAAf////////////////////////////////AAAAAAA////////////////wAAAAAAAAAAAAAAAAAA///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAH///AAAAAAAAAAAAAAAAAAAAAAAAAAAA////////8AAAAAAAAAAAAAAAAAAAAAAAA///////////AAAAAAAAAAAAAAAAAAAAA///////////////////+AAAAAAAAAAAAAAAP////////////////////////wAAD/////8AAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////wAAAD/////////////////////////8AAAAAAAAAAAAAAAAAAD/////////////AAAAAAAAAAAAAP////////4AAAAAAB//AAAAAB///+AAAAAAAf///////////////////////////////AAAA///////////////////////////////8AAAAAAAAAAf////////////////////////////8AAAAAAA///////////////////////wAAAAAAAAAAAAAAAB////////////////////////gAAAAAAAAAAAAAAAAAAD////////8AAAAAAAAAAAAAAAAAAAAAAAAAAB//////+AAAAAAAAAAAAH////////////////wAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAA///gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////wAP////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////wAAH////8AAAAAAAAAAAAAAAAAAAP/////////v///////////////////+AAAAAAAAAAAB///////////8AAAAAAAAAAAAAAP//////////AB////////////////////////////////AAAAAAf/////////8AAAAP///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////8AAAAAAAAAAAD////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////4AAAAAAAAAAAAAA/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////wAAAAAAf//////////////8AAAAAAAAAAAAH/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAB////8f/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAAAAAB4AAAAAAAAAAAAAAAAAAAP///////////////////////////AAAAAAAAAAAAAAP///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////3///////////////////////8AAAAAAAAAAAAAH////////////////4AAAAAAAAAAH////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////4f//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAD////////+AAAAAAAAAAAAAAAAAAAB////////////////////////8AAAAAAAAAAAAAAAAAAH////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAP/////////////+D////////gAAAAAAAAAA///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///wAAAAAAAAAH//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////4AAAAAAAAAAAAAAAAAPwB/////////////wAAAAAAAAAAAAAAAAAAP4AAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////4AAAAAAAAAAAAAAAAAAA////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////+AAAAAAAAB//////////////////4AAAAAAAAAAAAAAAAAAH////wAAAAAAAAAAAAAAAAAAAAAAAAD/4AAAAAAAAAAAAAAAB//////////////wAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////4AAA////////////////////////wAAAAAAf//////////////////wAAAAAAAAAAAAAA///////////////////gAAAAAAAAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////AAAAAAAAAAAAAAAAAAf//////////wH//////////////4AAAAAAAAf///////////wAAAAAAAAAAAAAAAAAAAAH////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////AAAAAAAAAAAAAAB///////////wAAAAAAAH////////////wAAAAB/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////gB//////////4AAAAAAAAAAAAAAAAAAAAAAH/////////AAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////gAAAAAAAAAAAAAAP/////////////////+AAAAAP/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////8AAAAAAAAAAAAAAAAAAAP/////////////////8AAAAAAAAAAAAAAAAAAAAD////////////////////////////AAA////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////AAAAAD//////4AAP//////////////////////wP/////AAAAAAAAAAAAAAAP///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////8AAAAAAB/gAAAAAAAAAAAAAAAAAAAAAAH///////4AAA///////////8AAAAAAAAAAAAAAAAAf/////+AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////wAAAAAAAAAAAAP//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////AAAAAAAAAAAAAAAA////////////////////gAAAAAAAAAAAAAAAAB///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////gAAAAAAAAAAAAAAAf///////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////gAAAAAAAAB///////////////AAAAAB////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////+AAAAAAAAAAAAAAAAAAAAH////////////////////+AAAAAH//gf/////////////////AAAAD///AAAAAAAAAAAAAAAAAAD///////////////AAA////////////////////gAAAAf/////////////gAAAAAAAAAAAAAAAAA////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////4AAD/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////AAAAAAAAAAAAP//////////////////////////////wAf///////////////////gAAAAAAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAA///////////////8AAAAAAAAAAAAAP///////////////////gAAAAAAf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////gAAAAf/////////4AAAAAAAAAAAAAAAH///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////gAAAAAD////////////////8AAf////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAD////////////////wAAAAAAAAAAAAP//AAAAAAAAAH/////wAAAAAAAAAAAB////////////////////////////AAAAAB////////////////////////////gAAAAAAAAAAAAAAAAAAH///////////////////////4AAAAAAAAAAAA////////////////////////w==", + "DSA": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "DSA-SHA": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "DSA-SHA1": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "DSA-SHA1-old": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "RSA-MD4": "00a81549257ddc647e718ed80e4ddd16", + "RSA-MD5": "51f6bb4db8e6e61cc4333450c6035139", + "RSA-MDC2": "7820f6dcafa4090c6718db2cc0ba9ea6", + "RSA-RIPEMD160": "12b05637efd8676d2a1c273c68ecfc4f211b36da", + "RSA-SHA": "b0eaf74a5daeab7e550cbf3670b411449e883d71", + "RSA-SHA1": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "RSA-SHA1-2": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "RSA-SHA224": "d9d4e5a4b7c2464a4e3233d96c2b06fbbb711a77a1724320a99b479b", + "RSA-SHA256": "1c4530860ec79ab73b141a7e64b0de775192a002fa2f3832b6c24972797d5161", + "RSA-SHA384": "132e2c74dfbb89b65eab740e42c9e7d715000f3b95837fca99e050376bfab515b48bfb798a729c087e56c60d62e958f9", + "RSA-SHA512": "56ad639b61fe8f834de37d5c760cd436add2a7fb046b78ca87cc6434f3e251d902a8b0d1a7dacef2d156c28ee22ba52c3d90a3640dd0cea4e7a4b5d72f7ca0ee", + "dsaEncryption": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "dsaWithSHA": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "dsaWithSHA1": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "dss1": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "ecdsa-with-SHA1": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "md4": "00a81549257ddc647e718ed80e4ddd16", + "md4WithRSAEncryption": "00a81549257ddc647e718ed80e4ddd16", + "md5": "51f6bb4db8e6e61cc4333450c6035139", + "md5WithRSAEncryption": "51f6bb4db8e6e61cc4333450c6035139", + "mdc2": "7820f6dcafa4090c6718db2cc0ba9ea6", + "mdc2WithRSA": "7820f6dcafa4090c6718db2cc0ba9ea6", + "ripemd": "12b05637efd8676d2a1c273c68ecfc4f211b36da", + "ripemd160": "12b05637efd8676d2a1c273c68ecfc4f211b36da", + "ripemd160WithRSA": "12b05637efd8676d2a1c273c68ecfc4f211b36da", + "rmd160": "12b05637efd8676d2a1c273c68ecfc4f211b36da", + "sha": "b0eaf74a5daeab7e550cbf3670b411449e883d71", + "sha1": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "sha1WithRSAEncryption": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "sha224": "d9d4e5a4b7c2464a4e3233d96c2b06fbbb711a77a1724320a99b479b", + "sha224WithRSAEncryption": "d9d4e5a4b7c2464a4e3233d96c2b06fbbb711a77a1724320a99b479b", + "sha256": "1c4530860ec79ab73b141a7e64b0de775192a002fa2f3832b6c24972797d5161", + "sha256WithRSAEncryption": "1c4530860ec79ab73b141a7e64b0de775192a002fa2f3832b6c24972797d5161", + "sha384": "132e2c74dfbb89b65eab740e42c9e7d715000f3b95837fca99e050376bfab515b48bfb798a729c087e56c60d62e958f9", + "sha384WithRSAEncryption": "132e2c74dfbb89b65eab740e42c9e7d715000f3b95837fca99e050376bfab515b48bfb798a729c087e56c60d62e958f9", + "sha512": "56ad639b61fe8f834de37d5c760cd436add2a7fb046b78ca87cc6434f3e251d902a8b0d1a7dacef2d156c28ee22ba52c3d90a3640dd0cea4e7a4b5d72f7ca0ee", + "sha512WithRSAEncryption": "56ad639b61fe8f834de37d5c760cd436add2a7fb046b78ca87cc6434f3e251d902a8b0d1a7dacef2d156c28ee22ba52c3d90a3640dd0cea4e7a4b5d72f7ca0ee", + "shaWithRSAEncryption": "b0eaf74a5daeab7e550cbf3670b411449e883d71", + "ssl2-md5": "51f6bb4db8e6e61cc4333450c6035139", + "ssl3-md5": "51f6bb4db8e6e61cc4333450c6035139", + "ssl3-sha1": "5c6d07a6b44f7a75a64f6ce592f3bae91e022210", + "whirlpool": "849f385972114ec6cc5ac714fcb0c1aaa4c541b6ca86443dc47c53bcbb69b8c38071459e5b212406d344c2eb94e82f5038e9d2d7d4bdb98d3cc187582afbb9b7" + }, + { + "input": "//////////////////////////////+AAAAAAAAAAAH/4AAAAAAAAAAAAAAAP/////////////////8AAAAAAAAAAAH/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////+AAAAAAAAAAAAAAAAAAAAAAH////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAf//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//AAAAf///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAH/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////4AAAAAAAAAAAAAAAAAAA///gAAAAAAP//8AAAAAAAAAAAAAAAf////////////////////////////gAAAAAf////////////////////AAAAAAAAAAAAAAAAAAAH////////////////////////8AAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAD////////+AAAAAAAAAAAAAAAAD/////+AAAAAAAAAAAAAAAAAAAAf////////////////////////4AAAAAAAAAAAAP/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////8AAAAAAAAAAAAAAAf//////////////////////+AAf/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAB///////////////4AAAAAA///////////////////////////////8AAAAAAAA///////////wAAAAAAAf/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAD/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////+AAAAAAAAAAAf///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////+AAAAAAAAAAAA//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAAAAAA////AAAAAAAAAAAAD/wAAAAAAAAAAAAD////////////////////////AAAAAAAAAAAAAf////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH/////////+AAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////AAAAAAAAAAAAAB//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////+AAAAAAAAAB/////////////////////////gAAAD/////////////////+AAAAAAAAAAAAAAAAAH///////////////////4AAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////4AAAAAAAAAAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAAAAD/////////////////////8AAAAAAAAAAAAAAAAAAAAAB/////////////8A//AAAAAAAH//////////////gD//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAA///////////////wAAAP///gAAAAAAAAAAAB//////////wAD//////////////////////////+Af/////////4AAAAAAAAAAD////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////wAAAAAAAAAAAAAAAAAAAAH////+AAAAAAAAAAAAAAD//////////////////////////8AAAAAAAAAAAAAAD//////////////////////////gAAAAAAAAAAAAAAAAAAAA//////////////gAAAAAAAAAAAAAAAAAAAAD///////4AAAAAAAAP/////////////////////////AAAAAAAAAAAAAAAB/AAAAAAAAAAAAAAAAAAAf////////gAAAAAAAAAAAAAAAA//////////////////AAAAAAAAAP///////////////////////////4H///////wAAAAAAAAAAAAAAAAH////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////8AAAAAAAAAAAAAAAAAAAAH/+AH////4AAAAAAAAAAAAAAAAAAAAf//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////AAAAAAAAAAAAAAAAA/////////gAAAAAAAAAAD//gAAAAAAAAAf////////////////////////////////+AAAAAAAA////////////////////////////4AAAAAAAAAAAB////////////////////////4AAAAAAAAAAAAAAAf//////////////4AAAAAAAAAAAAAAAAAAAAf//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////wAAAAAAAAAAA/////////////+AAAAD////////////////////+AAAAAAAAAAA////////////////8AAAAAAAAAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////8P/////////////////////////////8///////////////////////////+AAAf///////////////////////////////wAAAAB//////////////////////////4AAAAAAD////////////////////////////4AAAAAAAAAAAP//////////////////AAAAAAAAAAAP///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAAAAAAAAAAAAAAAAAAf/////////////4AAAAAAB//////gAAAAAB/////////AAAf///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////4AAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAB///8AAAA//////+AAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAB///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAB/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAP+AAAAB/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////4AAAAAAAA//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////wAAAA/////////+AAAAA////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////wAAAAAAAAAAAAAAAAB////////////////////////////8AAAAAAAAAAAAAAAAAAAB//////////////////////gAAAAAAAAAAAAAAAAAAAAB//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//wAAAAAAAAAAAAP////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////wAH///////////////wAAAAAAAAB//////////////////////8AAAAAAAAAAAAAAAAAAA////////4AAAAAAAAAAAAAAAAAAAf/+AAAAAAAAAAAAB/////////////////////8AAAAAAAAAAAAAAAAAAB/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAD////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAA///8AAAAAAAAAAAAAAAAAAAAAf//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////8AAAAAAAAAAAA////////////////wAAAAAAAAAAAP////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////+AAAAAA////////////AAAAAAAAAAAAAAAAAAAAAD//gAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAAAAAAAAAAAAAAAAAAAA////////wAAP///4AAAAAAAAAAAD////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////AAAAAAAAAB////////4AAAAAH////////////////+AAAf/AAAAAAAAAAAAAAAAAAAAAD///////////////+H////////////8AAAAAAAP/////////////////AAAAAAAAAAAAAAAAAAAAAAAH///////gAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAAAAAAAP/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////gAD//////////////////4AAAAAAAAAAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAAAB////////////////////////////////AAAAAAAAAAB//////////////////////////////gAAAAAAAAAAAAAAAAD////////////////////gAAAAAAAAAAAAAAAD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////+AAAH/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAH/gAAAAAAAAAAAAAAAAAAAAB///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAP///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA///8AAAAAAAAAP/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////wAAAAAAAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAAAAAAAAf///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAA/////////8AAAAAAAAAAAAAD/////////////////////gAAAAAAAAAAAAAAAB///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAB//////////////4AAAAAAMAA///////AAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAf/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////+AAAAAAAAAAB////8AAAAAAAAA///////////AAAAAAAAP///////////////////////////+P/gAAAAAAAAAAAA///////////////////////////g/////////////////////////AAAAAAAAAAAAAAAAAAD/////////////////////", + "DSA": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "DSA-SHA": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "DSA-SHA1": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "DSA-SHA1-old": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "RSA-MD4": "0db744b9e2461b598bd0542c98faff5d", + "RSA-MD5": "0baff1c675866bf259d3ac9417a33464", + "RSA-MDC2": "c28a8f03dca74683836d5491f7d7354b", + "RSA-RIPEMD160": "f0c9b5001ef561311ee81ec171e2f0bba045c6ef", + "RSA-SHA": "d08a0065352411b17fb5349f43cbdf34276e4094", + "RSA-SHA1": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "RSA-SHA1-2": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "RSA-SHA224": "1fd3de781554e16e8f5258b6337a5ccbdbe9efdf2e32ec0a47368784", + "RSA-SHA256": "d97097c16c4d0cf169e61cde78e807cd318b8938992066bfe4e266e14146fbba", + "RSA-SHA384": "bb0e3a3b70f77ad50cda53e3bd61903f94a327579446649877c70402692ecd22207ecf11cb409bbb6133bb399d73b2bd", + "RSA-SHA512": "9c3c1aa2aa6fbb1dca6ebc4be7a8aeca2284f3a4729227dab1c4cab359bcb6750c228e754b170a2f20fc06f7c64789647f26dc0c61f0b62a9dc98fff5bef2289", + "dsaEncryption": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "dsaWithSHA": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "dsaWithSHA1": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "dss1": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "ecdsa-with-SHA1": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "md4": "0db744b9e2461b598bd0542c98faff5d", + "md4WithRSAEncryption": "0db744b9e2461b598bd0542c98faff5d", + "md5": "0baff1c675866bf259d3ac9417a33464", + "md5WithRSAEncryption": "0baff1c675866bf259d3ac9417a33464", + "mdc2": "c28a8f03dca74683836d5491f7d7354b", + "mdc2WithRSA": "c28a8f03dca74683836d5491f7d7354b", + "ripemd": "f0c9b5001ef561311ee81ec171e2f0bba045c6ef", + "ripemd160": "f0c9b5001ef561311ee81ec171e2f0bba045c6ef", + "ripemd160WithRSA": "f0c9b5001ef561311ee81ec171e2f0bba045c6ef", + "rmd160": "f0c9b5001ef561311ee81ec171e2f0bba045c6ef", + "sha": "d08a0065352411b17fb5349f43cbdf34276e4094", + "sha1": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "sha1WithRSAEncryption": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "sha224": "1fd3de781554e16e8f5258b6337a5ccbdbe9efdf2e32ec0a47368784", + "sha224WithRSAEncryption": "1fd3de781554e16e8f5258b6337a5ccbdbe9efdf2e32ec0a47368784", + "sha256": "d97097c16c4d0cf169e61cde78e807cd318b8938992066bfe4e266e14146fbba", + "sha256WithRSAEncryption": "d97097c16c4d0cf169e61cde78e807cd318b8938992066bfe4e266e14146fbba", + "sha384": "bb0e3a3b70f77ad50cda53e3bd61903f94a327579446649877c70402692ecd22207ecf11cb409bbb6133bb399d73b2bd", + "sha384WithRSAEncryption": "bb0e3a3b70f77ad50cda53e3bd61903f94a327579446649877c70402692ecd22207ecf11cb409bbb6133bb399d73b2bd", + "sha512": "9c3c1aa2aa6fbb1dca6ebc4be7a8aeca2284f3a4729227dab1c4cab359bcb6750c228e754b170a2f20fc06f7c64789647f26dc0c61f0b62a9dc98fff5bef2289", + "sha512WithRSAEncryption": "9c3c1aa2aa6fbb1dca6ebc4be7a8aeca2284f3a4729227dab1c4cab359bcb6750c228e754b170a2f20fc06f7c64789647f26dc0c61f0b62a9dc98fff5bef2289", + "shaWithRSAEncryption": "d08a0065352411b17fb5349f43cbdf34276e4094", + "ssl2-md5": "0baff1c675866bf259d3ac9417a33464", + "ssl3-md5": "0baff1c675866bf259d3ac9417a33464", + "ssl3-sha1": "7e0d3e9d33127f4a30eb8d9c134a58409fa8695b", + "whirlpool": "c8f50d42f1f2994367db90fb74e8b6c0d5625758d17d1fb090db6aea31e11888a219f96e73f6671e380aa6164e87badb5b61ad6a14c31682251fbcffe6258394" + }, + { + "input": "///////+AAAA//////////////////////4AAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAAAAAAAAf//////////////////8AAAAAAAAAAAAAAAAD////////////////8f///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////AAAAAAAAAAH///////////////////////////AAAAAAAAAAAAAAAAAAAAP/////////////////////////////+AAAAAAAAAAAAAAAAAAAf///+AAAAAAAAAAAAAAAAAAAAAAAAAA////////8AAAAAAAAAAAB//////////////8AAAAAAAAAAAAAAD///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAA//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////+AAAAAAAAAAAAAAAAAAAf////////////////////////////////4AAAAAAAAAAAAAAAD///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAf//////////////////4AAAAAAAAAAAAAAAAAAAB///////gAAAAP4AAAAAAAAAA////wAAAAAH/////////////////////+AAAGAAAAAAAAAAAAAAAP////////////////////gAAAAD////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////AAAAAAAAAAAAAAAAAAAAD/////////////////////4AAAAAAAAAAAAAAAf///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAP/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAP////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAA///////4AAAAB///////////////////////////gAAAAAAAAAAAAAAAAAAAP/////////////////////////////////gAAAAAAAAB/////////gAAAAAAAAAAAAAAAAAf////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////+AAAAAAP//////////////////////////////8AAAAAAAAH////////////////4AAAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAf//gAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////gAAAAAAAAAAAAAAAAAf///////////////wAAAAAAAAAAAAAAAAAAAAAP///////////8AAAD/////////////////////////4AAAAAAAAAAAP/////////+AAAAAAAAAD///////////////+AAAP///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////+AAAAAAAP/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAP////gAAAAP/////////////4AAAAAAAAAAAAAAf//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////AAAAAAAAAAAAAAAAAAAD/////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////wAAAAAAAAAAAAAAA//////////AAAAAAAAAAAAAAAAIAAAAAAAP////////////////////////8AAAAAAAAAAAAAAAAAA////////////////////////////8AAAAAAAAAAAAAB/////////AAAAAAAAAAAAAAAAAAAAAP///////////wAAAAAAH///////////////////AAAAAAB//////+AAAAAAAAAAAAAAAAAAAf/////////wAP///////////////////////wAAAAAA//////////wAAAAAAAAA///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH//wAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////B////////////////////////////////AAAAAAAAAAAAAAAAB/////////gAAAAf////////////////8AAAAD/4AAAAAAAAAAAAAAAAAAAAAAAP/////////wAAAAD//////////////AAAAAAAAAAAP//////gAAAAAAAAAAAAAAAAAAAAAB/////AAAAAAD////////////////////gAAAAAAAAAAAAAAAAAAB//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////AAAAAAAAAAAAAAAAAAAAAf/////////AAAAAAAAAAAAAAAAAAAAAD/////////////gAAAAAAAA////////////////////////4AAAAAAAAAB//AAAAAAAAAAAAAAAAAAAAD////////////////AAAAAD////////////+AAAAAAP///////4AAAAAAAAAAAAAAAAAAAAAAAD////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////gAAAAAAAAAAAAAAAAD//////////////+AAAAAAAAAAADAAAAHwAAAAAAAAP///////////////////////////////4D///////////////////////gAAAAAAAAAAAAP////////////////////////////////4AAAAAAAAAAAAAH////////////AAAAAAAAAAAD/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////gAA///wAAAAAAAAP//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////wAAAAAAAAAAAAAAAAAAAAB////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////wAAAAAAAAAAAAAAAAAAAAAAP////////+AAAAAAA///AAAAAAAAAAAAAAAD/////////////////////////////////8AAAAAA///////////////////AAAAAAAAAAAAAP/////////////////////////////gAAAAAAAAAAAAAAAAAAf///////AAAAAAAAAAAAAAAAAAAB////////gAAAAAAAAAAAAH///////////////////gAAAAAAAAAAAAB//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAB////////AAAAAAAAAAAAAAAAAAD////////////////////////////////8AAAAAAAAAAAAAAP/////////////////////////gAAAAAAAAAAAAAAAAH///////////////wAAAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////8AAAAAAAAAAAAAAAAP///+AAAAAAAAf///////AAAAAAAAAAAAAAP///////////////////////////////+AAH/////////////////////////////wAAAAAAAAAAAAB///////////////////////////////+AAAAP/////////////gAAAAAAAAAAAAAAAAA/////////////////////////AAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAB//////////AAAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAf//////////////////////4P//+AAAAAAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////AAAAP//////////////////////AAAAAAAAAAAAAAAAAAf//////////AAAAAAAAAAAAAP//////AAAAB/////////////////////////////////8AAAB///+AAAAAAAf///////////////////////////////AAP///////////////////////////8AAAAAAB//////////////////////////+AAAAAH//////////////////////+AAAAAAAAAAAAAAAAP//////////////////////+AAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAAAAAAAf//////gAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAB//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////8AHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAB////////gAH///+AAAAAAAAAAAAAAAAA////////v//////////////////gAAAAAAAAAAP/////////4AAAAAAAAAAAAH/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////+AAAAAf////////AP/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf////gAAAAAAAAAAAf////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////AAAAAAAAAAAAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////gAAAAAf/////////////+AAAAAAAAAAAAD////////////+AAAAAAAAAAAAAAAAAAAAAAB///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////AAAAAAAAAAAAAAAAAAAAAf///4AAAAAAAAAAAf///////////////////////////////4AAAAAAAAAAAAAAAAAAH///////////////////////+AAAAAAAAAAB///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////+AAAAAAAAAAAAB///////////////gAAAAAAAD/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA////w////////////wAAAAAAAAAAAAAAAAAAAAAB/////8AAAAAAAAAAAAAAAAAAAD/////////////////////gAAAAAAAAAAAAAAAAAA//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAD////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////+AAAAAAAP////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//+AAAAAAAAAA////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////wAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////AAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAP/////////////////8=", + "DSA": "9a5f50dfcfb19286206c229019f0abf25283028c", + "DSA-SHA": "9a5f50dfcfb19286206c229019f0abf25283028c", + "DSA-SHA1": "9a5f50dfcfb19286206c229019f0abf25283028c", + "DSA-SHA1-old": "9a5f50dfcfb19286206c229019f0abf25283028c", + "RSA-MD4": "cc48f7da203594f8a0fc7cdd8fdc504f", + "RSA-MD5": "6e8a56a9a005c6c6239ccbdf48f59aa8", + "RSA-MDC2": "4e3c584f062937827518e601b11342e0", + "RSA-RIPEMD160": "c284165bee92e6285563b8bbb344dfad2ee835f9", + "RSA-SHA": "7f111c6ce5f470b193ebb10a03f27e9fe8dafee2", + "RSA-SHA1": "9a5f50dfcfb19286206c229019f0abf25283028c", + "RSA-SHA1-2": "9a5f50dfcfb19286206c229019f0abf25283028c", + "RSA-SHA224": "358bcda7233325f892ae3dc84f32b693dd5a6270f4b8ae0f53599bfc", + "RSA-SHA256": "3a18179cf693d234a8aa913b7362505533b414d60bf7eaf02427157759defaba", + "RSA-SHA384": "988927dd0cdac68181da194ec649d4afc5214dece20d4299a1cbd1fc7d3f5f8073ca475af57da87637c0e9f5fcdea943", + "RSA-SHA512": "4e041ec1fc9208aa3ef65bd5abfaf8db48e0d6f1b1de52a47351d827057bff253effb63c5e868dbdddd56ff93b32e750896db45a534b1e2016cf1f380f564262", + "dsaEncryption": "9a5f50dfcfb19286206c229019f0abf25283028c", + "dsaWithSHA": "9a5f50dfcfb19286206c229019f0abf25283028c", + "dsaWithSHA1": "9a5f50dfcfb19286206c229019f0abf25283028c", + "dss1": "9a5f50dfcfb19286206c229019f0abf25283028c", + "ecdsa-with-SHA1": "9a5f50dfcfb19286206c229019f0abf25283028c", + "md4": "cc48f7da203594f8a0fc7cdd8fdc504f", + "md4WithRSAEncryption": "cc48f7da203594f8a0fc7cdd8fdc504f", + "md5": "6e8a56a9a005c6c6239ccbdf48f59aa8", + "md5WithRSAEncryption": "6e8a56a9a005c6c6239ccbdf48f59aa8", + "mdc2": "4e3c584f062937827518e601b11342e0", + "mdc2WithRSA": "4e3c584f062937827518e601b11342e0", + "ripemd": "c284165bee92e6285563b8bbb344dfad2ee835f9", + "ripemd160": "c284165bee92e6285563b8bbb344dfad2ee835f9", + "ripemd160WithRSA": "c284165bee92e6285563b8bbb344dfad2ee835f9", + "rmd160": "c284165bee92e6285563b8bbb344dfad2ee835f9", + "sha": "7f111c6ce5f470b193ebb10a03f27e9fe8dafee2", + "sha1": "9a5f50dfcfb19286206c229019f0abf25283028c", + "sha1WithRSAEncryption": "9a5f50dfcfb19286206c229019f0abf25283028c", + "sha224": "358bcda7233325f892ae3dc84f32b693dd5a6270f4b8ae0f53599bfc", + "sha224WithRSAEncryption": "358bcda7233325f892ae3dc84f32b693dd5a6270f4b8ae0f53599bfc", + "sha256": "3a18179cf693d234a8aa913b7362505533b414d60bf7eaf02427157759defaba", + "sha256WithRSAEncryption": "3a18179cf693d234a8aa913b7362505533b414d60bf7eaf02427157759defaba", + "sha384": "988927dd0cdac68181da194ec649d4afc5214dece20d4299a1cbd1fc7d3f5f8073ca475af57da87637c0e9f5fcdea943", + "sha384WithRSAEncryption": "988927dd0cdac68181da194ec649d4afc5214dece20d4299a1cbd1fc7d3f5f8073ca475af57da87637c0e9f5fcdea943", + "sha512": "4e041ec1fc9208aa3ef65bd5abfaf8db48e0d6f1b1de52a47351d827057bff253effb63c5e868dbdddd56ff93b32e750896db45a534b1e2016cf1f380f564262", + "sha512WithRSAEncryption": "4e041ec1fc9208aa3ef65bd5abfaf8db48e0d6f1b1de52a47351d827057bff253effb63c5e868dbdddd56ff93b32e750896db45a534b1e2016cf1f380f564262", + "shaWithRSAEncryption": "7f111c6ce5f470b193ebb10a03f27e9fe8dafee2", + "ssl2-md5": "6e8a56a9a005c6c6239ccbdf48f59aa8", + "ssl3-md5": "6e8a56a9a005c6c6239ccbdf48f59aa8", + "ssl3-sha1": "9a5f50dfcfb19286206c229019f0abf25283028c", + "whirlpool": "4f7f493ccdb8647378040cf721295af90109ee75e5b5718861067f3628c88d5d26de863ef219a7c27f5c6791a33208342fbc91dabb843ccce086a716c4d81fc6" + }, + { + "input": "//////////////gAAAAAAAAAf////////////////////////gAAAAAAAAAAAP/////8AAAAAAAAAAAAAAP//////////////wf////////////////////4AP///////////////8AAAAAAAAB/////////////////////4AAAAAAAAAAAAAAD/+AAAAAAAAAAAAAAAAAAAAAAAAf8AAAAAAAAAAAAAAB//////////////4AAAAAAAAAAAAAAAAAP//////////////////////4AAf/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////8AAAAAH///////////////////////////////wAAAAAAAAAAP////AAAAAAAAAAB///////////////8AAAAAAAAf/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAH/////////AAAAAAAH///////8AAAAAAAAAB////AH///////////////////////////gAAAAAAAP///////////////////////////////8AAAAAAAAAAP/////////////////////AAAAAH///////////////////////wAAAAAAAAAAAAAAAAAA///////////gAAAAAAAAAAAAAAAAACAAAAAAAAAH/////////////////////////////AAAAAAAAAAAAAP//////////////////////////8AAAAAAAAAH/////////////////+AAAAAAAAAAAAAAAH///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAH/gAAAAAA////////////////////////////////gAAAAAAAAAAAAAAAAAAf//////////////////////////////+AAAAf//////////////4AAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAf/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////AAAAAAAA///4AAAAAAAf//////////////AAAAAAD/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////gAAAAAAAAAA////////////////////////////////8AAAAAAAAAAAAAA/////////////////////////////gAAAAAAAAAAAAAAf////////////4AAAAAAAAAAAAAAP///////////////8AAAH///////////////////////////8P//////////////AAAAAP/////////////////////+AAAAAAAAAAAAAAAAAAAAAAD////AAAAAAAAAAAAH/wAAAAAAAAAAAAB////////////////////////////4AAAAAf////////////////////////wAAAAAAAAAAAAAAAAAAAAA//////////////////AAAAAAAAAAAAAAAAAP/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////8AAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////+AAAAAAAAAAAAAB/////////////////////////////////4AAAAAAAAAAAAAAAD//////////////////////////////////AAAAAAAAAA////////////4AAAAAAAAAAA//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAD//+AAAAAAAAAAAAAAAAAAAAAD////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAB//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////AAAAAAAAAAAAAAAAAP//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////4B////////////////////+AAAAAAAAAAAH//////////4AAAAAAAAAAAAAAAAD////AAB///////////////////////wAAAAAAAAAAAAAAP///AAAAAAAAA//////////8AAAAAA////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////+AAAAAAAAAAAH////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAP///////////////////////+AAAAAAAAAAAAAAAf//////////+Af///wAAAAAf///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAA///////////////wAAAAAAAAAAAAAAAAAAAAD//////+AAAAAAAAAD//////////////////////////////4AAAAAAAAD/////////////////////////////////+AAAAAAAAAAAAAAAD////////////////wAAAAAAAAAAAf///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////4AAAAAAAAAAAAAAAAAAAAH////////////////////+AAAAAAAAAAAAAAAAAAAAAAAB///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////AAAP//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////wAAAAAAAAAf///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////AAAAAAAAAAAAAAAAAAD/gAAAAD/wAAAAAAAAAAAH/////////////////////////gAAAAAf//////////////////wAAAAAAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAB////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAH///////AAAAAAAAAAAAAH///gAAAAAAAAAAAAAAAAAB///////////////////////4AAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAA/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////8AAAAAAAAAAAAD///////////////////////wAD////////4AAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////gAAAAAAAAAAAAAAAAAAAAAAP///////////8AAAAH/////////////////////////////4AAAAAP/////////AAAAH//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAB//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////wAAAAAAAP//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////8AAAAAAAAAAAAAAAAAAAAAD/////////////////////////8AAAAAAAAAP//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAD///////////AAAAAAAAAAAAD//+AAAAAAAAAfAAAAAAAAAAAD///////////////////////gAAAAAAAAAB//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAD///////4AAAAAAAAAAAAAAAAAAAAA//////////////////////////////8AAAAAAAAAAAB///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////gAAAAAAAAP///////////////////////+AAD/////////////////+AAAAAAAAAAAAAAf///////////////+AAAAAAAAAAAAAAAAAAAAAP////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////8AAAAAAAAAAAAAAAAAAP////////////////////////////////8AAAAAAAAAAAAAAAAAH///////////////////+AAAAAAAAAAAAAAAAAAAAAA//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAB////////////+AP/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAf////////////+H/8AAAAAAAAAAAH///////4f//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////wAAAAAAAAAD///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAf4AAAAAAAAAAAAAAAAf/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////4AAAAAAAAAAAAAAAAAAA//AAAAAAAAAAAAAAB////////////////////////wAAAAAAAAAAAB///////////////////////+AAAAAAAAAAAAAAAAAAAB//////////////AAAAAAAAAAAAAAAAAAf/////wAAAAAAAP/////////////////////////AAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAD//////gAAAAAAAAAAAAAAAf/////////////////gAAAAAAB///////////////////////////v////8AAAAAAAAAAAAAAAAB/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////8AAAAAAAAAAAAAAAAAf/////////////////////////////////8AP/+AAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////wAAAAAAAAAAAAAB////////gAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////gAAAAAAAAAAAAAAAAAAAAAP//////////////gAAAAAAAAAAAf//////////////////gAAAAAAAAD////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAH////wAAAAAAAAAAAAAAAAAAAD//////////+AAAAAAAAAAAAAA//////////////////////4AAAAAAAAAAAAAAAAAA//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////+AAAAAP//////////////////////////AAAAAAP//////////////////////////4AAAAAAAA///////////////wAAAAAAAAf////////////+AAAAAAAAAAAAAAAAAAAAAAD////////wAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////8AAAAAAAAAAAAAAAA/////////////4AAAAAA//////wAAAAP////////4AB//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/wOAAAAAAAAAAAAAAAAAAAAAAAAAD//8AAP///8AAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////+AAAAAAAAAAAAAAAAAAAAAAAAH///8AAAAAAAAAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAAAAAAAAAB4AAAAH//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////AAAAAAAD////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////AAAAD///////////////////////////////w==", + "DSA": "dca737e269f9d8626d488988c996e06b352c0708", + "DSA-SHA": "dca737e269f9d8626d488988c996e06b352c0708", + "DSA-SHA1": "dca737e269f9d8626d488988c996e06b352c0708", + "DSA-SHA1-old": "dca737e269f9d8626d488988c996e06b352c0708", + "RSA-MD4": "1441e723d40eb1201a208b6d716ee960", + "RSA-MD5": "6565bceb49f962f797f49084f3f819a1", + "RSA-MDC2": "efe944f5d723013d2d8763d8b5266a03", + "RSA-RIPEMD160": "a812218c1eae12a88ce7d93d9eb354e5a3ba57b4", + "RSA-SHA": "d5fc56684dee5665b81f27a1e60a5de80907894d", + "RSA-SHA1": "dca737e269f9d8626d488988c996e06b352c0708", + "RSA-SHA1-2": "dca737e269f9d8626d488988c996e06b352c0708", + "RSA-SHA224": "c0cc680c7c15ec8b6c3aedbb54f0626e369dda4e134cb43cf625a403", + "RSA-SHA256": "8ee61f98cea2659f5ab9d8ec444de3b3e843ab02baa7806e96230a64dee93774", + "RSA-SHA384": "b64be3fdd16ce8908ea0ac1f837451db7c30c6a4aa0ba0cf9d7d472463e830887adeb349d17fef6d947d91e90b819c3c", + "RSA-SHA512": "b6e75a0815130a7d690bf587251c88850838f6ae834979e941eabc624529022b181ae7fecba9580193621520c65c416735d85542d5ab635be6bdc6b7c9dd87af", + "dsaEncryption": "dca737e269f9d8626d488988c996e06b352c0708", + "dsaWithSHA": "dca737e269f9d8626d488988c996e06b352c0708", + "dsaWithSHA1": "dca737e269f9d8626d488988c996e06b352c0708", + "dss1": "dca737e269f9d8626d488988c996e06b352c0708", + "ecdsa-with-SHA1": "dca737e269f9d8626d488988c996e06b352c0708", + "md4": "1441e723d40eb1201a208b6d716ee960", + "md4WithRSAEncryption": "1441e723d40eb1201a208b6d716ee960", + "md5": "6565bceb49f962f797f49084f3f819a1", + "md5WithRSAEncryption": "6565bceb49f962f797f49084f3f819a1", + "mdc2": "efe944f5d723013d2d8763d8b5266a03", + "mdc2WithRSA": "efe944f5d723013d2d8763d8b5266a03", + "ripemd": "a812218c1eae12a88ce7d93d9eb354e5a3ba57b4", + "ripemd160": "a812218c1eae12a88ce7d93d9eb354e5a3ba57b4", + "ripemd160WithRSA": "a812218c1eae12a88ce7d93d9eb354e5a3ba57b4", + "rmd160": "a812218c1eae12a88ce7d93d9eb354e5a3ba57b4", + "sha": "d5fc56684dee5665b81f27a1e60a5de80907894d", + "sha1": "dca737e269f9d8626d488988c996e06b352c0708", + "sha1WithRSAEncryption": "dca737e269f9d8626d488988c996e06b352c0708", + "sha224": "c0cc680c7c15ec8b6c3aedbb54f0626e369dda4e134cb43cf625a403", + "sha224WithRSAEncryption": "c0cc680c7c15ec8b6c3aedbb54f0626e369dda4e134cb43cf625a403", + "sha256": "8ee61f98cea2659f5ab9d8ec444de3b3e843ab02baa7806e96230a64dee93774", + "sha256WithRSAEncryption": "8ee61f98cea2659f5ab9d8ec444de3b3e843ab02baa7806e96230a64dee93774", + "sha384": "b64be3fdd16ce8908ea0ac1f837451db7c30c6a4aa0ba0cf9d7d472463e830887adeb349d17fef6d947d91e90b819c3c", + "sha384WithRSAEncryption": "b64be3fdd16ce8908ea0ac1f837451db7c30c6a4aa0ba0cf9d7d472463e830887adeb349d17fef6d947d91e90b819c3c", + "sha512": "b6e75a0815130a7d690bf587251c88850838f6ae834979e941eabc624529022b181ae7fecba9580193621520c65c416735d85542d5ab635be6bdc6b7c9dd87af", + "sha512WithRSAEncryption": "b6e75a0815130a7d690bf587251c88850838f6ae834979e941eabc624529022b181ae7fecba9580193621520c65c416735d85542d5ab635be6bdc6b7c9dd87af", + "shaWithRSAEncryption": "d5fc56684dee5665b81f27a1e60a5de80907894d", + "ssl2-md5": "6565bceb49f962f797f49084f3f819a1", + "ssl3-md5": "6565bceb49f962f797f49084f3f819a1", + "ssl3-sha1": "dca737e269f9d8626d488988c996e06b352c0708", + "whirlpool": "d5090b5ca8d31ecd7079a3d4a99b7b859eee8161f9bbfd3ffbf0d65c9e81a24f6b1793add043254e9e50c7fd3401d4ac3e720ad896fb1bf88992b8cfafb54829" + }, + { + "input": "//+AAAAAAAAAAAAAAAB///////////////////////////8AAAAf//////////////wAAAAAAAAAAAAAAAAAAAAAAAAD////////////////wAAAAAAAAAAAAAAAAA//////////////////gAAAAAAAAAA///////////////////////////wA/////////4AAAAAAAAAAAP///////////////////////////gAAAAAAAAAAAAAAAAAAAD//////////////////////////////////4AAAAAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAf///////////////AAAAA///////////////P////////////wAAAAAAAAAAAAAAAAAD////////////////4AAAAAAAAAAAAAAAAAAAAAAAA///////////////////////AAAD/////////////////////////////gAAB/////////////////////wAAAAAAAAAAD///////////////////////////8AAAAAAAAAAf///////////4AAAAAAAAAAAf//////////P////////////////////////////wAAP///gAAAAAAAD///////////////////AP///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////4AAAAAH//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////gAAAAAAAAAAAAAAAAAAAH/////////wAAAAAAAA/wAAAAAAAAAAAA///w/////////////////AAAAAAAAAAAH//////////////////////////////4AAAAAAAAAAAH///////gAAAAAAAAAAAAAAAAB/////////////////////AAAAAAH/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAD////////////////4AAAAAAAAAAAAAAAA//////////////////////////////8AAAAAAAAAB//wAAAAAAAAAAAAAH//////////////////////gAAAAAAAAA////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////gAAAAAAAAAAAAAAA/////////////AAAAAAAP////////////////////////////gAAAAf/////////////////////////////////gAAAAAAAAAAAAAAB/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////4AAAAAAAAAAAAAAAH/////////////////////7/////+AAAAAAAAAAAAAAAAAAAAAAf///////////////////////gAAAAAAAAAAAAAAAAAAAAAH////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////gAAD//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////AAAAAAAAAf/////////////////////////gAAAAAAH////////////wAAAAAAAAAAAAAAAAAAAD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////gB/////////////////wAAAH////////////////////+AAAAAAAAAAAAP//////////////+AAAAAAAAAAA//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////AAP////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////+AAAAAAAAAAAAAAA//////wD////wAAAAAAAAAAP//////4AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////AAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAAAAAAAAAAAP////8H////////////////////wAAAAAAAAAAAAAAAAAAAA////////////////////////////////+AAAAAAAAAAAAAAAAA//wAAAAAAAAAAAAAAAH/////////////////wAAAAAAAAAAAAAAAAP/////////////+P//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAf////////4AAAAAAAH///////////////////////////AAAAAAAAAAAAAAAAAAD/////////////////////////////wAAAAAAAAAAAAAAAAA//gAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAH////////////8AAAAAAAAAAAAAB////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8AAAAAAAAAAAAAAAAAP////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////gAAAAAAAAAAAAAAAA////////////////////////////////4AAAAAAAAAAAAAAB////////////////////////////////AAAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAf///gAAAH8AAAAAAAAAP/gAAAAH///////////////////wH/////////////////////////////////gAAAAAAAAAAAAA////////////////////+AAAAH////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAAf///////////////////wAAAAAAAAAAAAAP//////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAA///////////////////////////gAAAAAAAAAAAAAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAD///////gAA////////////////////////AAAAAAAAAAAAAAAAAAAAf////////////////////////////////gAAAAAAP/////wAAAAAAAAAAAAAAB///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAB/////////////////+AAAB///////////////////////////////gAAAAAAAA////////////////gAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAD//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////8AAAAAAAAAAAAAAP/////////////+AAAAAAAAAAAAAAAAAAH//////////gAH///////////////////////8AAAAAAAAAB//////////wAAAAAB////////////////AB////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD///////wAAAAAA/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAf//wAf////////////4AAAAAAAAAAAD/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////4AAAAAAAAAAAAAAAAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAAB///////////+AAAAAAAAAAAAAAAH/////////4AAAAAAAAAAAAAAf////////////////////////////////8AAAAAAAH///////////////////////gAAAAAAAAAAAAAAAAAH///////////////////////////wAAAAAAAAAAAB///////wAAAAAAAAAAAAAAAAAAf///////+AAAAAAA/////////////////AAAH///gAAAAAAAAAAAAAAAAAD//////4AH/////////////////////+AAAAB//////+AAAAAAAB///////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAD+AAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////+AAAAAAAAAAAAAAAAD////////gAAH////////////////gB/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAB///////////8AAAAAAAAH////8AAAAAAAAAAAAAAAAAAAAAH////8AAAAAH////////////////////AAAAAAAAAAAAAAAAAAB///////////////////////////4AAAAAAAAAAAAAAAAAAAAAA//////////////////////////////AAAAAAAAAAAAAAAAAAAH//////+AAAAAAAAAAAAAAAAAAAAD////////////wAAAAB///////////////////////4AAAAAAAAABwAAAAAAAAAAAAAAAAAAP//////////////+AAA/////////+AAAAAH/////gAAAAAAAAAAAAAAAAAAAAB//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////+AAAAAAAAAAAAAAAAAP//////////////4AAAAAAAAB///////////////////////////////+AAAAP/////////////////////////////////4AAAAAf////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAH////////////////////////////////8AAAAAAAAAAAAAD//////////4AAAAAAAB/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAD/////////////////+AAD///////+AAAAAAAAAAAAAAAAAP//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////4AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////4AAB////////////////////////////////4AAAAAAAAAAAAAAAAAAAAB////////////////////wAAAAAAAf///+AAB//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///AAAAAAAAAAAAAAAAH///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////8AAAAAAD//////////////////8AAAAAAAf//////////AAAAAAAAAAAAAAAAP/////////////AAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////+AAAAD////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////4AAAAAAAAAAAAAAAAAAAAAAAAH//////////////wAAAAAAAAAAAB///////////////////////wAAB//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////Af/////+AAAAAA//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/+AAAAAAAAAAAf////////////////gAAAAAAAAAAAAAAAAAAAAAD//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////4AH//////////////////+AAAAAAAAAf///////////////gAAAAAAAAAAAAAAAAAAA////////////gAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////gf//////////////////AAAAAAAAAAAAAAAAD/////////////////////////wAAAAAAAAAB////gAAAAAAAAAAAAAAAAAAH////////////////+AAAAAAAAf////////////4AAAD//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////", + "DSA": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "DSA-SHA": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "DSA-SHA1": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "DSA-SHA1-old": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "RSA-MD4": "421c126089eb860449cabcfce5411a3c", + "RSA-MD5": "2267037a7f3e753c653218fcf67ce9c7", + "RSA-MDC2": "4b1a54e8337d64029d3c1d146c10f7b2", + "RSA-RIPEMD160": "0dacd206650e99e239e958ed38128f889c066461", + "RSA-SHA": "d00525def6dbf08a0ae5135a5496bfe8284a8b3d", + "RSA-SHA1": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "RSA-SHA1-2": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "RSA-SHA224": "9fb71c6c0313ffffcb218c76dea9029a1ca80987bebfdf0fb526e639", + "RSA-SHA256": "bc69420ce99aa58de5d5c9ae32c3528b02546347e8f85dca651187142bc2a40b", + "RSA-SHA384": "dac161339d0c7b826dffbcdd9209795d24b1c5d3abc25f8fe655c8e6146b99a227ea27a479e4868d16690fd7715f8491", + "RSA-SHA512": "05a4482e9c87bc49e5c55a087d2d670fec5e3eb0ed2d7fa9d836485c94b477fa50f027f2013a638d9668c4c8a48770415ef5319460c2f4af1b9f628615ccde8d", + "dsaEncryption": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "dsaWithSHA": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "dsaWithSHA1": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "dss1": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "ecdsa-with-SHA1": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "md4": "421c126089eb860449cabcfce5411a3c", + "md4WithRSAEncryption": "421c126089eb860449cabcfce5411a3c", + "md5": "2267037a7f3e753c653218fcf67ce9c7", + "md5WithRSAEncryption": "2267037a7f3e753c653218fcf67ce9c7", + "mdc2": "4b1a54e8337d64029d3c1d146c10f7b2", + "mdc2WithRSA": "4b1a54e8337d64029d3c1d146c10f7b2", + "ripemd": "0dacd206650e99e239e958ed38128f889c066461", + "ripemd160": "0dacd206650e99e239e958ed38128f889c066461", + "ripemd160WithRSA": "0dacd206650e99e239e958ed38128f889c066461", + "rmd160": "0dacd206650e99e239e958ed38128f889c066461", + "sha": "d00525def6dbf08a0ae5135a5496bfe8284a8b3d", + "sha1": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "sha1WithRSAEncryption": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "sha224": "9fb71c6c0313ffffcb218c76dea9029a1ca80987bebfdf0fb526e639", + "sha224WithRSAEncryption": "9fb71c6c0313ffffcb218c76dea9029a1ca80987bebfdf0fb526e639", + "sha256": "bc69420ce99aa58de5d5c9ae32c3528b02546347e8f85dca651187142bc2a40b", + "sha256WithRSAEncryption": "bc69420ce99aa58de5d5c9ae32c3528b02546347e8f85dca651187142bc2a40b", + "sha384": "dac161339d0c7b826dffbcdd9209795d24b1c5d3abc25f8fe655c8e6146b99a227ea27a479e4868d16690fd7715f8491", + "sha384WithRSAEncryption": "dac161339d0c7b826dffbcdd9209795d24b1c5d3abc25f8fe655c8e6146b99a227ea27a479e4868d16690fd7715f8491", + "sha512": "05a4482e9c87bc49e5c55a087d2d670fec5e3eb0ed2d7fa9d836485c94b477fa50f027f2013a638d9668c4c8a48770415ef5319460c2f4af1b9f628615ccde8d", + "sha512WithRSAEncryption": "05a4482e9c87bc49e5c55a087d2d670fec5e3eb0ed2d7fa9d836485c94b477fa50f027f2013a638d9668c4c8a48770415ef5319460c2f4af1b9f628615ccde8d", + "shaWithRSAEncryption": "d00525def6dbf08a0ae5135a5496bfe8284a8b3d", + "ssl2-md5": "2267037a7f3e753c653218fcf67ce9c7", + "ssl3-md5": "2267037a7f3e753c653218fcf67ce9c7", + "ssl3-sha1": "b8ffc1d4972fce63241e0e77850ac46dde75dbfa", + "whirlpool": "a18feaf3f04d0d50a86fe5292b8cc08014348d9bb16be1ead10aeefc6df32c0c87f0ea97d9f7f28b518e86a286cdf035bb135f1e22d4126f6cf5617ccfcf3cd1" + }, + { + "input": "////AAAAAAAP///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAf//////////////////////gAAf//////////////////////4AAAAAAAAAAAAAAAA//////////////////////gAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAAAf//////gAAAAAAAAAD//////////////wAAAAAAAAAAAAAAAf//////////////////////AAAAAAAAAAAAAAAAAAAAAAf////////////////////////wAAAAAAAAAAAAAAAAAAD//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///8AAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAf///4H//4AAAAAAAAAAAAD/////v///////////////4AAAAAAAAAP//////+AAAAAAAAAAf///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////+AAAB//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAPwAAAAAAAAAAAP///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////gAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAP/////////////8AAAAP////////////8AAAAAAAAAAAAH///////////wAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////4AAAAAAAAAAAAAAAAD/wAAAAAAAAP/////////////////////////////AAAAAAAAAAAAAAAAAD//////////////////8AAAAAP/////////////4AAAAAAAAAAAAAAAAAAAAAAAAH///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////8AAAAAAAAAAAP////////////AAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////w///////AAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAD///////////////+AAAAAAAAAAAAAAAAAAD/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////8AAAAAAAAAAAAAAAAAAAAAf/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAA//////wAH////////wAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/8AAAAAAAAAB//////////////////4AAAAAAAAAAAAAAAAAAAP////////////////////////////4AAAAAAAAAAAAAAAAAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////gAAAAAAAAAAAAAAAAAAf/////////////////////////////////8AAAAAAAAAAAAAAAAD////////////////////4AAAAAAAAAAP///////8AAAAAAAAAAAAAAAAAAAAAAf///////////wAAAA////////////gAAAAAAAAAAAD/////////////////////////////////4AAAAAAAAAAAAAAAAAAP/gAAAAAAAAAAAAAAAH/////wAAAAAAAAAAAAAAAAAAH///////////wD////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////wAAAAAAAAAAAAAA/////////////////AAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////+AAAAAAAAAAAAAD//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////+AA//////////AAAAAAAAAAAAH////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////8AAAAAB////+AAAAAAAA////////4AAB//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAP//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AAAAAAAAAAAAAAAAAAAAB//+AAAAAAAAAAAAAAAAAAAAAA////////////////gAAAAAAAB//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////8AAAAAAAAAAAAAAAAAAAAAAAAH///////8AAAAAAAAAAAAAAAAAf/////////////gAAAAAAAAAAAAAAAAAA////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///gAAAAAAAAAAAAAAH///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////gAAAAAAAAAAAAAAAAD/////////////////////4AAAAH//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////4AAAAAAAH///AAAAAf////////////wAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////AAAAAAAAP////////////////////////////////AAAAAAAAAAAB//////////////////////////4AAAAAAAAAAAAB///////////4AAAAAAAAAAA///////////////4AAAP/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////wAAA///////////////////gAAAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAA//////////////////////////////////+AAAAAAAAAAAD///////////////////////////4AB/////////////////////////AAAAAAAAAAAAAAAAAAAAAD////////////////AAAAAAAAAAAAAAB/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////4AAAAAAAAAAAAD///////////////////////////////8AAAAAAAAAAAAAP///////////////////////////////gAAAAAAD////////+AAAAAAAA//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAAAAAAAAAD///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAH/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAAAA///////8AAAAAAAAAAAAAAAAAAAAAAAA/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////8AAAAAAAAB/////////gAAAAAAAAAAAAAAD//wAP///////////////////4AAAAAAAAAAAAAAH//wAAAAAAAH//////+AAB////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAA//////4AAAAAAAB///////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAf///////////////////////8AAAAAAAAAAAAAAf//////////HwAAAAAf///////////8AAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////wAAAAAAAAAAAAAAAAAAA////////////+AAAAAAAAAAAAAAAAAAAH///wAAAAAAAAP//////////////////////////////gAAAAAB////////////////////////////////wAAAAAAAAAAAAAAAf//////////////gAAAAAAAAAAA//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAD/////////////////8AAAAAAAAAAAAAAAAAAAAAAAD////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////wAB//////////////////////gAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////+AAAAAAP/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////AAAAAAAAAAAAAAAAAB///////////////////////////////////gAAA////////+AAAAAAAAAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAAAD////////////4AAAAAAAAAAAAAAAAAA//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////4AAAAAP/////////4D////////////////8AAAAAAAAAAAAAAAAAAAAAD//////////+AAAAAAAAAAAAAAAAAAAAAD/////////////////////AAAAAAAAAAAAA///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAB//////////wAAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAH////////////////////////AAAAAAAAAAAAAAAAAAAAAAAH/////////////////////AAAAAAAAA///gAAAAAAAAAAAAAAAAAAAAAAAAAAAH//+AAAAAAAB/AAAAAAAAAAAAAAAB////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAAAAAAAAf/////////////////////////wAAAAAAAAAAAD////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////gAAAAAAAAAAAAAAAAAAAAP//////////////////////4AAAAAAAAAAAAAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAf//////wAAAAAAAAAAAAAAAAAAAAAAD//////////////////////+AAAAAAAB//////////AAP/////wAAAAAAAAAP//////////////////////AAAAAAAAf///////////////4AAAAAAAAAAAAAAAAAAAAAAAAH////+AAAAAAAAAAAAAAAAAA/////////////////////////////AAAAAAAAAAH/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////4AAAAAAAAAAAAAAAAAAAAAAB////////////////////////gAAAAAAAH///////////////////////gP/////////////////4AAAAAAAAAAH////////////+AAAAAAAAAAAAAAAAAAAAH/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////4AAAAAAAAAAAAAAB//////////////////////////////8AAAAAAAAAAAAAAf/////////////////+AAAAAAAAAAAAAAAAAAAAAA///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////+AAAAAD///////////AH//////////////////////////////AAAAAAAAAAAAAAAAAAAAB///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAf////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////+AAAAAAAAAP/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAP8AAAAAAAAAAAAAB/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////4AAAAAAAAAAAAAAAAAP/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "DSA": "e9c9bf41c8549354151b977003ce1d830be667db", + "DSA-SHA": "e9c9bf41c8549354151b977003ce1d830be667db", + "DSA-SHA1": "e9c9bf41c8549354151b977003ce1d830be667db", + "DSA-SHA1-old": "e9c9bf41c8549354151b977003ce1d830be667db", + "RSA-MD4": "5eb2c3a72b932c060fe5d08a607d4098", + "RSA-MD5": "aca1ae6237f498986991565b0307f0da", + "RSA-MDC2": "99c90730ba346b64c4a8c3e5ae68ceaf", + "RSA-RIPEMD160": "06b093ec41f5d21964081e2d3cdc648ebdceede0", + "RSA-SHA": "51c762b894c97aaad0bc1685a39a31faad22d89c", + "RSA-SHA1": "e9c9bf41c8549354151b977003ce1d830be667db", + "RSA-SHA1-2": "e9c9bf41c8549354151b977003ce1d830be667db", + "RSA-SHA224": "84eff7dda54a498404422baba6e5f1f39e10737a8ba6c81ab6c581df", + "RSA-SHA256": "79b2d4da202168d2c6f7dbff6dba414f71e405731a287a23b58af903f9b1c770", + "RSA-SHA384": "7cb840e5561a93f39f5f84fbd539e09c8f1d99ebfc1ba6eeb0cd32ab8624361f3c64a7fb3a7f426c74358dffa764a2b7", + "RSA-SHA512": "e6684cb464c37e901848d0dd497df81ee31f709dd8304ccb2158783c981f8a8151f60d67271667b159ab11b0912e63900e99dfd8fdcc6c3d24a93dc899919537", + "dsaEncryption": "e9c9bf41c8549354151b977003ce1d830be667db", + "dsaWithSHA": "e9c9bf41c8549354151b977003ce1d830be667db", + "dsaWithSHA1": "e9c9bf41c8549354151b977003ce1d830be667db", + "dss1": "e9c9bf41c8549354151b977003ce1d830be667db", + "ecdsa-with-SHA1": "e9c9bf41c8549354151b977003ce1d830be667db", + "md4": "5eb2c3a72b932c060fe5d08a607d4098", + "md4WithRSAEncryption": "5eb2c3a72b932c060fe5d08a607d4098", + "md5": "aca1ae6237f498986991565b0307f0da", + "md5WithRSAEncryption": "aca1ae6237f498986991565b0307f0da", + "mdc2": "99c90730ba346b64c4a8c3e5ae68ceaf", + "mdc2WithRSA": "99c90730ba346b64c4a8c3e5ae68ceaf", + "ripemd": "06b093ec41f5d21964081e2d3cdc648ebdceede0", + "ripemd160": "06b093ec41f5d21964081e2d3cdc648ebdceede0", + "ripemd160WithRSA": "06b093ec41f5d21964081e2d3cdc648ebdceede0", + "rmd160": "06b093ec41f5d21964081e2d3cdc648ebdceede0", + "sha": "51c762b894c97aaad0bc1685a39a31faad22d89c", + "sha1": "e9c9bf41c8549354151b977003ce1d830be667db", + "sha1WithRSAEncryption": "e9c9bf41c8549354151b977003ce1d830be667db", + "sha224": "84eff7dda54a498404422baba6e5f1f39e10737a8ba6c81ab6c581df", + "sha224WithRSAEncryption": "84eff7dda54a498404422baba6e5f1f39e10737a8ba6c81ab6c581df", + "sha256": "79b2d4da202168d2c6f7dbff6dba414f71e405731a287a23b58af903f9b1c770", + "sha256WithRSAEncryption": "79b2d4da202168d2c6f7dbff6dba414f71e405731a287a23b58af903f9b1c770", + "sha384": "7cb840e5561a93f39f5f84fbd539e09c8f1d99ebfc1ba6eeb0cd32ab8624361f3c64a7fb3a7f426c74358dffa764a2b7", + "sha384WithRSAEncryption": "7cb840e5561a93f39f5f84fbd539e09c8f1d99ebfc1ba6eeb0cd32ab8624361f3c64a7fb3a7f426c74358dffa764a2b7", + "sha512": "e6684cb464c37e901848d0dd497df81ee31f709dd8304ccb2158783c981f8a8151f60d67271667b159ab11b0912e63900e99dfd8fdcc6c3d24a93dc899919537", + "sha512WithRSAEncryption": "e6684cb464c37e901848d0dd497df81ee31f709dd8304ccb2158783c981f8a8151f60d67271667b159ab11b0912e63900e99dfd8fdcc6c3d24a93dc899919537", + "shaWithRSAEncryption": "51c762b894c97aaad0bc1685a39a31faad22d89c", + "ssl2-md5": "aca1ae6237f498986991565b0307f0da", + "ssl3-md5": "aca1ae6237f498986991565b0307f0da", + "ssl3-sha1": "e9c9bf41c8549354151b977003ce1d830be667db", + "whirlpool": "0469b8b86d0fc14dacbf8b5aff9d7d5dfdc9219c1abd4999bb1082ce33010b0ba2292909ba63b47650de0ca1cebdc7f901a81063895436c4ac2f51ab49170ffb" + }, + { + "input": "/////////////////////AAAAAAAAA////////////////////4AAAAAAAAAAAAAAAAAAP/////////////4AAAAAAAAAAAAA///+AAAAAAD/////////////////////////wAAAAAAAAAAAf//////////////////////////////////gAAAAAAAAAAAAAAAAAAP//wAAAAAAAAAAAAAAf/////////////////gAAAAH/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/wAAAAAAAAAAAAAAAAH////////////////////////////+AAAAAAAAAAAAAAAAAAAAAA//////////////////////8AAAAAAAAAAAAH///////////////////////////////8AP//////////////////////////////////gAAAAAAAAAAAAAAAAAB////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////4AAAAAAAAAAH//////8AAAAAAAAAAAf///////////////////////////////4AAAAAH/////////////////////////////////gAAAP///////////////////////////+AAAAAAAAAAf/////////////////+AAAAAAAAAAAAAH//////+AAAAAAAAAAAAAAAAH//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////8AAAAAAAAAAAP/////////////gAAAA///////////////////gAAAAAAAAAAP//////////AAAAAAAAAAAAAAAAAAAAAP/////////////gAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////+f///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////wAAAAB//////////////////////////4AAAAD////////////////////////4AAAP//////////AAAAAP/////////4AAAAAAAAAAAAAAAAAD///////gAAAAAAAAAAAAAAAAAAAP////////////////wAAAAAAAAAAAAf///////////4AAAAB//////gAB/////////Af///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAP/nwAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAf//////////////gAAAAAAAAAAAAAAAAAAAAAH///8AAAAAAAAAAAP/////////////////AAAAAAAAAAAAAAAAAAAAP////////////////+AAAAAAAAAAAAAAAAAAB///////////////////////////////////gAAAAf//////////////////////8AAAAAAAAAAAAAAAAAAAAAP///////////////////////////////+AAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////8AAAAP/gP////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAB//8AAAAAAAAAAAAAf//////////////////////AAAAAAAAAAAAAAf/////////////4AAAAAAAAAAAAAAAf//////////AAAAAAAAAAAAAAAAAAAAAAAAB8AAAAAAD//////////8AAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////4AAAAAAAAA//////////////////////+AAAAAAAAAAAAAf/8AAAAAAAAAAAP/////////////////////////////////+AAAAAAAAAAAAB///////////////8AAAAAAAAAAAAAAB///////////////////////4AAAAAAAAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAAAAAAAAAAAAAAAA///8AAAAAAAAAAAAAAAAAAAAAf//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////8AAAAAAAAAAAA////////wAAAAAAAAAP////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAB/////+AAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAf/////////////////////////4AAAAAAAAAAAAAAAAAAB////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////AAAAf///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAP////////////////wAAAAAAAAAf///////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////AAAP///////////////////////////////////AAAAAAAAAAAAAD///////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////4AAAAAAAf////////////////+AAAAAAAAAAAAAAAAAAAP/////AAAAAAAAAAAAAAA///////////////////////gAAAAAAAAAAAAAAAf//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////AAH//////////wAAAAAAAAAAAAAAAAAAAAAA/////////AAAAAAAAAAAAAAAAD/////////////////////////+AAD//////////////////////////////AAAAAAAAAAAAAAAH////////////AAAAAAAAAAH///4AAAAAAAAAAAAAAAAAAAAAAAAAAAH///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////8AAAAAAAAAAAAAAAAAAAP/////////////////////////wAAAAAAAAAAAAAAAAB///////////////+AAAAAAAAAAAAAAAAAAH/////////////////////////////////AAAD//////////////////////AAAAAAAAAAAAAAAAAAAAAAAf//////////////////gAAAAAAAAAAAAAAAAAAH///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/8AAAAAAAAAAAAAAAAAAAB////////////////////////////////+AAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAf////+AAAAAAAAAAAB///////////////////wAAAAAAAA///////////////////////////////8AAAAAAAAAAAAAAAAAf//////////////gAAH///////////////////gAAAAAAAAAf/////////////AAAAAAAAD//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////gAAAAAAAAAAA///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAAAAAAAAA//////wAAAAAAAAAAAAAAAAAAAAAB////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////8AAAAAAAAAAAAAAAAAAB8AAAAAAAAAAAAAAAAAAAAAAD//////////////wAAAAAAAAAAAAAAAAAAAB//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////gAAAAAAAAAAAAAAAAAAA//////////////////////////////wAAAAAAAAAAAAAAAD/gAAAAAAAAAAAAAD///////////////+AAAAAAAAAAAAAAAAB///////////+P8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////wAAAAAAAAAAAAAAAAAAAAAAAH////////+AAAAAP//////////////////////////+AAAAAAAAAAAAAAAAB////////////////////////////8AAAAAAAAAAAAAAAD///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP/wAAAAB///////////wAAAAAAAAAAAAD/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAP//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////gAAAAAAAAAAAAAH///////////////////////////////gAAAAAAAAAAAAAD///////////////////////////////+AAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAeAAAP4AAAAAAAAP//////////////////////////////////4AAAA/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////8AAAAAAAAAAAB////////////////////8AAAH/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////+AAAAAAAAAAAAAAAAAAB//////////////////wAAAAAAAAAAAD////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP///////8AAAAAAAAAAAB////////////////////////4AAAAAAAAAAAAAAAAAAB/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAH///////P////////////////////AAAAAAAAAAAAAAAAAAAAf///////////////////////////////wAAAA//8AAAAAAAAAAAAD////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////AAAAAAAAAAAAAAAAAAAAAP//////////////AH//////////////////////////////+AAAAAAAAD///////////////AAAAAAAAf///////////////////////+AAAAAAAAAAAAAAAAAAP///////////////////////////////4AAAAAAAAAAAAAAAAAAAAA///////////////////////////////gAAAAAAAAAAH////////////wAAAAAAAAAAAAAAD////////8P/////////////////////+AAAAAAAAP/////////+AAA////////////////v///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAD////+AAAAAD////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////wAAAAAAAAA////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAAAAAAAAAAAAH/////8AAAAAAAAAAAAAAAAAAAAB//////////gAAAAAAAAAAAAAAB/////////+AAAAAAAAAAAAB////////////////////////////////4AAAAAAAP/////////////////////wAAAAAAAAAAAAAAAAAD//////////////////////////8AAAAAAAAAAH/////wAAAAAAAAAAAAAAAD/////AAAAAAAf/////////////9gAAAAAAAAAAAAAAAAB///wAP////////////////////AAAP///AAAAAAP//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAD///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAB////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////AAAAAAAAAAAAAAAAB///////4Af///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAA//////8AAAAA/////////wAAAAAD///gAAAAAAAAAAAAAAAAAAAAf////wAAAAP///////////////////+AAAAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAAAAAAAAAAAAAAAH///////////////////////////AAAAAAAAAAAAAAAAAB////8AAAAAAAAAAAAAAAAAAAD///////////4AD//////////////////////4AAAAAAAAAB//////////////////////////////////4AAAAAAAAAAAAAAAAB//////////////4f/////8AAAAH//8AAAAAAAAAAAAAAAAAAB///8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////wAAAAAAAAAAAAAAAAB///////////////AAAAAAB/////////////////////////////wAAAB/////////////////////////////////gAH//////////////////////////8AAAAAAAAAAAAAAAAAAAAA==", + "DSA": "0942908960b54f96cb43452e583f4f9cb66e398a", + "DSA-SHA": "0942908960b54f96cb43452e583f4f9cb66e398a", + "DSA-SHA1": "0942908960b54f96cb43452e583f4f9cb66e398a", + "DSA-SHA1-old": "0942908960b54f96cb43452e583f4f9cb66e398a", + "RSA-MD4": "e8296f86e645e73081c56cd8d084ba70", + "RSA-MD5": "785bb09a5f25730a3aed4de12da4d9ea", + "RSA-MDC2": "97d9430d8ff0634dd3143c7726f26160", + "RSA-RIPEMD160": "2474086e7c55ebfeb279d627170ff8d928ba1e87", + "RSA-SHA": "1ec7e5f099eaa453ae6e1959b442b0239a7f7f4b", + "RSA-SHA1": "0942908960b54f96cb43452e583f4f9cb66e398a", + "RSA-SHA1-2": "0942908960b54f96cb43452e583f4f9cb66e398a", + "RSA-SHA224": "76bfc01be3ef7c5412524878502000b50c69a62ae0c332f3f3616b03", + "RSA-SHA256": "068c65431e6010461cd77e3d2859fbc978857d1195dc1506ab1b5c9344e1099f", + "RSA-SHA384": "3287f1fecd5907f9c093cf0416f62f26099ae27ad36482f07c82987c0f3d5a54d7d5e59319c16b0e574629c39633c430", + "RSA-SHA512": "b2bf183fbd9e04d480c35d733a2f325a2ee3c936b173d1f925fa545c2dbd02f8a0f0c34b505b8289ce64b621f1f7d53da6b3a5419e7f4f5af531153f1e262137", + "dsaEncryption": "0942908960b54f96cb43452e583f4f9cb66e398a", + "dsaWithSHA": "0942908960b54f96cb43452e583f4f9cb66e398a", + "dsaWithSHA1": "0942908960b54f96cb43452e583f4f9cb66e398a", + "dss1": "0942908960b54f96cb43452e583f4f9cb66e398a", + "ecdsa-with-SHA1": "0942908960b54f96cb43452e583f4f9cb66e398a", + "md4": "e8296f86e645e73081c56cd8d084ba70", + "md4WithRSAEncryption": "e8296f86e645e73081c56cd8d084ba70", + "md5": "785bb09a5f25730a3aed4de12da4d9ea", + "md5WithRSAEncryption": "785bb09a5f25730a3aed4de12da4d9ea", + "mdc2": "97d9430d8ff0634dd3143c7726f26160", + "mdc2WithRSA": "97d9430d8ff0634dd3143c7726f26160", + "ripemd": "2474086e7c55ebfeb279d627170ff8d928ba1e87", + "ripemd160": "2474086e7c55ebfeb279d627170ff8d928ba1e87", + "ripemd160WithRSA": "2474086e7c55ebfeb279d627170ff8d928ba1e87", + "rmd160": "2474086e7c55ebfeb279d627170ff8d928ba1e87", + "sha": "1ec7e5f099eaa453ae6e1959b442b0239a7f7f4b", + "sha1": "0942908960b54f96cb43452e583f4f9cb66e398a", + "sha1WithRSAEncryption": "0942908960b54f96cb43452e583f4f9cb66e398a", + "sha224": "76bfc01be3ef7c5412524878502000b50c69a62ae0c332f3f3616b03", + "sha224WithRSAEncryption": "76bfc01be3ef7c5412524878502000b50c69a62ae0c332f3f3616b03", + "sha256": "068c65431e6010461cd77e3d2859fbc978857d1195dc1506ab1b5c9344e1099f", + "sha256WithRSAEncryption": "068c65431e6010461cd77e3d2859fbc978857d1195dc1506ab1b5c9344e1099f", + "sha384": "3287f1fecd5907f9c093cf0416f62f26099ae27ad36482f07c82987c0f3d5a54d7d5e59319c16b0e574629c39633c430", + "sha384WithRSAEncryption": "3287f1fecd5907f9c093cf0416f62f26099ae27ad36482f07c82987c0f3d5a54d7d5e59319c16b0e574629c39633c430", + "sha512": "b2bf183fbd9e04d480c35d733a2f325a2ee3c936b173d1f925fa545c2dbd02f8a0f0c34b505b8289ce64b621f1f7d53da6b3a5419e7f4f5af531153f1e262137", + "sha512WithRSAEncryption": "b2bf183fbd9e04d480c35d733a2f325a2ee3c936b173d1f925fa545c2dbd02f8a0f0c34b505b8289ce64b621f1f7d53da6b3a5419e7f4f5af531153f1e262137", + "shaWithRSAEncryption": "1ec7e5f099eaa453ae6e1959b442b0239a7f7f4b", + "ssl2-md5": "785bb09a5f25730a3aed4de12da4d9ea", + "ssl3-md5": "785bb09a5f25730a3aed4de12da4d9ea", + "ssl3-sha1": "0942908960b54f96cb43452e583f4f9cb66e398a", + "whirlpool": "79dfad91dd1eadb98c7268c86f85ca38c0c28c4ca1e828780fc242ee418a6bef46ec3e612838e76543907635f9d48a356e95e33943862c4022759f6177d20a24" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAf////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////4AAAAAAAD//8AAAAAAAAAAAAAAAAAAAAA////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////gAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////wAAAAAAAAAAAAAAf//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////8AAAAAAAAAAAAAAAAAAAAAB///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////wAAAAAAAAAAAAAAAAD////////////////gAAAAPAAA/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////gAAAAAAAAAAAD////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////+AAAAAH/////////////////gAAAAAP//////gAAAAAAAAAAf////////////+AAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAD/////8AAAAAAAAAAAAAAAAAAAAAAAP//////////gAAAAAAP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAH///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAf/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//4AAAAAAAAAAAAAAAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////wAAAAAAD///////////////wAAAAAAAAAAAAAAAAAB/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////AAAAAAAA////////////AAAAAAAAAAAAAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAP//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////+AAAAAAAAAAAf///////////////////4AAAAAA////wAAAAAAAAAAAAAP///////////////wAAAD/////////////f/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////4AAAH//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////AAAAAAAAAAAAAAAAAAAD//////////////////////////////////4AAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAD////////////////gAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAA//////////////////gAAAAAAf////////+AAAAAAAAAAAAAD/////////////AAAAAAAAAAAAAAAAAAAAP//////////////////gAAAAAAAAAAAAAAAAAAAAAAD///////////////8AAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////AAD///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////gAgAP//////////AAABAAAAAAAAAAAAAAH////////4AAAAAP////////AAAAAAAD/////////////////////////+AAAAAAAAAAAAAAAAAAAA///gAAAD////////////////////////////8AAAAAAAAAAAAAAAAAAB/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////wAAAAAAAAAAAAAAAAAAAB/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAf/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////8AAAAAAAAAAAAP///gAAAAAAAAAAAD////////////4AAAAAAAAAAH/////////////+AD////////////////////////4AAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAf///////////////////////////gAAAAAAAAAAAAAAAA///////////////8AA/////////////wAAAAAAAAAAAAAAAAAAAAAAAH///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////8AAAAAAAAAAH//////////4AH///AAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////+H///gAAAAAAAAAAAAA/////////////////////////////////4AAAAAAAAAAAAAAAAAAAH////////////wAAAAAAAAAAAAAAAAAAf//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////8AAAAAAAAAAAAAAAAAAAAP///////+AAAAAAAAAAAAAAAAAAAAAAAAA/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////AAAAAAAAAAAAAAAAAAAAAB/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAAAAAAAf//////////////4AAAAAAAAAAAAAAAA/////////////////////////////gAAAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////wAAAAAAAAAAAAAAAAAAP/////////////////////////////////+AAAAAAAAAAAAAAP////////////////+AAAAAAAP//////AAAAAAAAAAAAAAAAAAAA////////////gAAf////////+AAAAAAAAAB////////////////////////////////AAAAAAAAAAAAAAAAP/gAAAAAAAAAAAAAAAH//AAAAAAAAAAAAAAAAD////////j////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////wAAAAAAAAAAAAAA////////////////gAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAB///////////////////////////////wAAAAAAAAAAAH///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////8AAAAAAAAB////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAAf/8AAAAAAAB//////8AAf////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAP/////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////4AAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAH/////////////gAAAAAP/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////wAAAAAAAAAAAAAAAAAAAAAAAAAH///////////gAAAAAAAAAAAAAAAAAAAAAH//////AAAAAAAAAAAAAAAAD////////////AAAAAAAAAAAAAAAAAA////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////4AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAA////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////+AAAAAAAAAAAAAA///////////////////wAAAH//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////+AAAAAAAB///wAA///////////4AAAAAAf///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////8AAAAAH////////////////////////////////gAAAAAAAAH///////////////////////8AAAAAAAAAAAP/////////wAAAAAAAH//////////////gAAA////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////+AB///////////////8AAAAAAAAAAAAAAAAAAAAB/////////////////////////////////+AAAAAAAAA/////////////////////////////////gAAAAAAAAAP//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////+AAAAAAAAAAAAAAAAAAAAAH//////////////gAAAAAAAAAAAH/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////4AAAAAAAAP//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////8AAAAAAAAAAAA//////////////////////////////wAAAAAAAAAAH////////////////////////////+AAAAB/////8AAAAH//////////////////////////AAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAAAAAAAf//////////////////////////4AAAAAAAAAAAAAAAAAAAAD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////gAAAAAAAAAAAAAf///4AAAAAAAAAAAAAAAAAAAAAP////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////wAAAAAA///////8AAAAAAAAAAAAAH4D////////////////4AAAAAAAAAAAAAAH/4AAAAAAB///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAB//////wAAAAP/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAf///////////////////////8AAAAAAAAAAAAAP/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////gAAAAA////////////4AAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////+AAAAAAAAAAAAAAAAf/////////4AAAAAAAAAAAAAAAAAHAAAAAAAAf//////////////////////////////AAAAf//////////////////////////////AAAAAAAAAAAAAAAB/////////////gAAAAAAAAAAA/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAD///wAAAAAAAAAAAAAAAAA//////////////8AAAAAAAAAAAAAAAAAAAAAAAD////////8AAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////+AH/////////////////////AAAAAAAAAAAAAAAAAAAB/////////////////////////////4AAD////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////gAAAAAAAAAAAAAAAAf/////////////////////////////////8AB//////////////////////////////////4AAAAA///////////////////AAAAAA///////////////+AAAAAAAAAP//////////////4AAAAAAAAAAAAD/////////////////////////////AAAAAAAAAAAAAAAAAP///4AAAAAAP//////////////////////////////////wAAAAAAAAAAAAAAD////////////////////AAAAAAAAAAP/////////////////////gAAAAAAAAAAAAAAAAAf///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////gAAAAAAAf//////////////////////+AAf////8AAAAAAAAAAAAAAAAAAAAAAH///////////////////////AAAAAAAAAAAAAAAAAAAB/////4A//////////////////////////8H/////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////AAAAAAAAP/////////////////wAAAAAAAAAAAAAAAAAA", + "DSA": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "DSA-SHA": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "DSA-SHA1": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "DSA-SHA1-old": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "RSA-MD4": "055d4ac39ae31bfe0665fc4fab62e845", + "RSA-MD5": "4eb5472f4e5243fcd4a76533789e829a", + "RSA-MDC2": "d550ff59b9b0ef87d98e540f5ee1bc30", + "RSA-RIPEMD160": "23f82a44beb35e0ac26ff853f9fa1de06387d510", + "RSA-SHA": "9437bffbdb0b5f33b7500ccc112b81d56a02e404", + "RSA-SHA1": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "RSA-SHA1-2": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "RSA-SHA224": "407814ed7b28707c42f0bc6445c1ab0b3fc503eb6aec44ae1a084ea8", + "RSA-SHA256": "918a1d14de8c5fa363fb3137cf5014020646a1a2235f78ef3ed0d034c74f5761", + "RSA-SHA384": "e406e4967de02dfb3a3615edec1c6d6829763a2372035c44c5740146d6b1f781bbfa2465814890eae669d935baef6d9a", + "RSA-SHA512": "6123a636eaaa0de3ff0c09043f9a9d7601f264433c9b3deb5964c42c1892c62f4184271a15ccbd2c017a2e4b4bacab3badbf46393875804a1cf2371e43df643a", + "dsaEncryption": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "dsaWithSHA": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "dsaWithSHA1": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "dss1": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "ecdsa-with-SHA1": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "md4": "055d4ac39ae31bfe0665fc4fab62e845", + "md4WithRSAEncryption": "055d4ac39ae31bfe0665fc4fab62e845", + "md5": "4eb5472f4e5243fcd4a76533789e829a", + "md5WithRSAEncryption": "4eb5472f4e5243fcd4a76533789e829a", + "mdc2": "d550ff59b9b0ef87d98e540f5ee1bc30", + "mdc2WithRSA": "d550ff59b9b0ef87d98e540f5ee1bc30", + "ripemd": "23f82a44beb35e0ac26ff853f9fa1de06387d510", + "ripemd160": "23f82a44beb35e0ac26ff853f9fa1de06387d510", + "ripemd160WithRSA": "23f82a44beb35e0ac26ff853f9fa1de06387d510", + "rmd160": "23f82a44beb35e0ac26ff853f9fa1de06387d510", + "sha": "9437bffbdb0b5f33b7500ccc112b81d56a02e404", + "sha1": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "sha1WithRSAEncryption": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "sha224": "407814ed7b28707c42f0bc6445c1ab0b3fc503eb6aec44ae1a084ea8", + "sha224WithRSAEncryption": "407814ed7b28707c42f0bc6445c1ab0b3fc503eb6aec44ae1a084ea8", + "sha256": "918a1d14de8c5fa363fb3137cf5014020646a1a2235f78ef3ed0d034c74f5761", + "sha256WithRSAEncryption": "918a1d14de8c5fa363fb3137cf5014020646a1a2235f78ef3ed0d034c74f5761", + "sha384": "e406e4967de02dfb3a3615edec1c6d6829763a2372035c44c5740146d6b1f781bbfa2465814890eae669d935baef6d9a", + "sha384WithRSAEncryption": "e406e4967de02dfb3a3615edec1c6d6829763a2372035c44c5740146d6b1f781bbfa2465814890eae669d935baef6d9a", + "sha512": "6123a636eaaa0de3ff0c09043f9a9d7601f264433c9b3deb5964c42c1892c62f4184271a15ccbd2c017a2e4b4bacab3badbf46393875804a1cf2371e43df643a", + "sha512WithRSAEncryption": "6123a636eaaa0de3ff0c09043f9a9d7601f264433c9b3deb5964c42c1892c62f4184271a15ccbd2c017a2e4b4bacab3badbf46393875804a1cf2371e43df643a", + "shaWithRSAEncryption": "9437bffbdb0b5f33b7500ccc112b81d56a02e404", + "ssl2-md5": "4eb5472f4e5243fcd4a76533789e829a", + "ssl3-md5": "4eb5472f4e5243fcd4a76533789e829a", + "ssl3-sha1": "fce34051c34d4b81b85ddc4b543cde8007e284b3", + "whirlpool": "6751161ba77dae2038f2410a8a51cc24f751dcf4eb78dc31090ece1cbd715ee068d1d7209f4801668cab0a9212f54197f862ee52e26817afc01c2002609e3698" + }, + { + "input": "////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////8AAAAAAAAAAAAAAAAAAH//////////////////AAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAAAAAAAAAA///8AAAAAAAAAAAAAAAAAAP///////////////////AAAP//////Af4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////8AAAAAAAAAAAAAAAAAAAAAf///+AAAAAAAAAAAAD////////////////////////8AH/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD///////+AAAAAAAAAB/////////////////////////4AAAAAAAAAAAAAAAAAAAAf///////////////////AAAAAAAAAAAAAAAAAAAAAAAf//////wAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////wAAAAAAAAAAAAAAAAAH/////+AAAAAAAAH///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////8AAAAA//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAA/////////+AAAAAAAAAAAAAAAAf/////////////////////wAB////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///+AAAAAAAAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////gAAAAAAAAB/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////+AB/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////+AAAAAAAP///////8AAAAAAAAAAAAAAAAAAA////////////////////////gH//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////gAAAAAAAAAAAH///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////4AAAAAAAAAAAAAAAAAA//////4AAAAAAAAAAAAAAAAAH/////////////////4AAAAAAAAAAAAAD/////////+AA//////AAAAAAAAAAAAAAAAAAAAAAAAAD/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////H/////////////4AAAAAAAAAAAAAAAAAH///gAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////wAAAAAAAAAAAAAAAAAAAAP////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////+AAAAAAAAAAAAAAAAAP///////+AAAAAAf//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////+AAAAAAAAAAAAAAAA////////////+AAAB//////////////+AAAAAP/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////wAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAAAP//////////4AAAAAAAD////////////////////gAAAAAAAAAD////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAA////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf////8AAAAAAAAAAAAAAAAAAAAAAAAAAP///8AAAAAAAAAAAAAAAAAAAAAABwAAAAAAD//4AAAAAAAf//////////////AAAAAAD////////////////4AAAAAAAAAAAAAA//////////wAAAAAAAAAAB////wAAAAAD8AAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////A///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////wAAAAAAAAAAAAAH////////////////////gAAAP/////////wAAAAAAAAAAAAAAH//////////////////gAAAAAAAAAAAAAAA////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////+AAAAAAAAAAAAAAAAAAAAB///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////AAAf/////////////////////////4AAAAAAAAAAAP////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////wAAAAAAAAD///////////////////////////4D///////////4AAAAAAAAAAAAAAAAAAAB///////////4AAAAAAAAAAH////////////8AAAAAAAAAAH/////////////////////+AAAAP/////////4AAAAAAAAAAAAAAAAAAAAAAAA/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////8AAAAAAAAAf//////////////////////AAAAAAAAAAB////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////+AAAAAAAAAAAAAf////////////8AAAAAAAAAAAAAAAAAAAAAAH////////////////////+AB/////////////////////////////wAAA/////////////////////4AAAAAAAAAAB///////////////////////////+AAAD////////////AAAAA/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAf///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////AAD//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////wAAAAAAAAAAAAA/////////+AAAAAAAAH//////////////////////////////+AAAAAB///gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////gAAAA//////////////////////////AAAAAAAAAAP///////AAAAAAAAAAAAAAAAAD/////////////////4AAAAP///////////AAAAAAAAAAAAAAAAAAAAAH//////////////8AAAAAAAAAAAAAAH////////////////////////////4AAAAAAAA//4AAAAAAA//////////////////////8AAAAAAAB////////////////4AAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////wAAAAAAAAH///////4f//////////////////////////wAAD////////////////////////////8AAAAAAAAAAAA//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAD//////////////8AAAAAAAAAAAAAAAD///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/AAAAAAAAAAAAAAAAAAAAAAP/////////////////////8AAAAAAAAAAAAAAAP/////////////////AAAAAAAAAAAAAAAAAAAAAD////////////////////////////f////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////gAAAP///////////////////////8AAAD//////////+AAAAAAAAAAAAAAAAAAH////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////gAD/////////////////8AAAAAAAf///////////wAAAAAH///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////8AAAAAAAAf///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////gAAAAAAAAAAf////8AAAAAAAAAAAAAAAAAAAD/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAD//////+AAAAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAD////////////8AAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////4AAAAAAAAAAAAAAAAAAH///////////////////////////wAAAAAAAAAAAAAAB4AAAAAAAAAAAAP/////////////+AAAAAAAAAAAAAAAAB/////////x////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAAAA/////////wAAP//////////////////////////+AAAAAAAAAAAAAAAf///////////////////////////gAAAAAAAAAAAAAH/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////+AA/////////+AAAAAAAAAAAAP/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////+AAAAAAAAAAAAAAAB/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////8AAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAA////////////////////////////////gAAAAAAAAAAAAAAAAAAA///////////////////wAAAAAAAAAAAAAAAAAAAD/////////////////////////////////8AAP4AAAAAAAH/////////////////////////////////AAAD//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////wAAAAAAAAAB////////////////////8AAD//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAD//4AAAAAAAAAAAAAAAAAD////////////////4AAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAAAAAAAAD////////AAAAAAAAB//////////////////////AAAAAAAAAAAAAAAAB/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAH///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////+AAAAAAAAAAAAAAAAAAAA///////////////////////////////wAH///////////////////////////////////4AAAAAAAAAA//////////////gAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////wAAAAAAAAAAAAAAAAAP//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////8AAAAAAAAH//////////////AAAAAAH////////////////////////gAAAAAAAAAAAAAAAf////////////////////////////+AAAAAAAAAAAAAAAAAAAAH/////////////////////////////+AAAAAAAB///////////AAAAAAAAAAAA///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////+AAAAAAD//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAB//4AAAAH///////////////////////////////AAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////AAAAAAAf/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "DSA": "61e8916532503627f4024d13884640a46f1d61d4", + "DSA-SHA": "61e8916532503627f4024d13884640a46f1d61d4", + "DSA-SHA1": "61e8916532503627f4024d13884640a46f1d61d4", + "DSA-SHA1-old": "61e8916532503627f4024d13884640a46f1d61d4", + "RSA-MD4": "902d83cd1104de79a2399c9ea77d29e3", + "RSA-MD5": "7d725ae9a8e569f49c56194226b64dee", + "RSA-MDC2": "d97887260a2ac0f64ce35a4ab3220688", + "RSA-RIPEMD160": "bfb3f4c6a831ed7752598a54731ba61edec5fc7d", + "RSA-SHA": "7e6bf7365990bb140e09b2d93e75cd585c9ef13d", + "RSA-SHA1": "61e8916532503627f4024d13884640a46f1d61d4", + "RSA-SHA1-2": "61e8916532503627f4024d13884640a46f1d61d4", + "RSA-SHA224": "672200d406abe214e2543d5458426a15ba6d5b7e85dc8fe924490120", + "RSA-SHA256": "ef88b649d012178186dcf0244835232b5b7392e0c1f8f141f5107e9ead559e74", + "RSA-SHA384": "67d81f06cd91955f8687438102af53150230545e6a9d048607fad016e02871dce328be37f14adebd872e0b85fbfec21c", + "RSA-SHA512": "7b700b34117c7d5d54f678dcbab709b5cb0e43c46ec5909d237d76c915677f6398232a2786b9e2acb44bccf30902ebd21bf5ccb009325ffa2d9fe323af956dd3", + "dsaEncryption": "61e8916532503627f4024d13884640a46f1d61d4", + "dsaWithSHA": "61e8916532503627f4024d13884640a46f1d61d4", + "dsaWithSHA1": "61e8916532503627f4024d13884640a46f1d61d4", + "dss1": "61e8916532503627f4024d13884640a46f1d61d4", + "ecdsa-with-SHA1": "61e8916532503627f4024d13884640a46f1d61d4", + "md4": "902d83cd1104de79a2399c9ea77d29e3", + "md4WithRSAEncryption": "902d83cd1104de79a2399c9ea77d29e3", + "md5": "7d725ae9a8e569f49c56194226b64dee", + "md5WithRSAEncryption": "7d725ae9a8e569f49c56194226b64dee", + "mdc2": "d97887260a2ac0f64ce35a4ab3220688", + "mdc2WithRSA": "d97887260a2ac0f64ce35a4ab3220688", + "ripemd": "bfb3f4c6a831ed7752598a54731ba61edec5fc7d", + "ripemd160": "bfb3f4c6a831ed7752598a54731ba61edec5fc7d", + "ripemd160WithRSA": "bfb3f4c6a831ed7752598a54731ba61edec5fc7d", + "rmd160": "bfb3f4c6a831ed7752598a54731ba61edec5fc7d", + "sha": "7e6bf7365990bb140e09b2d93e75cd585c9ef13d", + "sha1": "61e8916532503627f4024d13884640a46f1d61d4", + "sha1WithRSAEncryption": "61e8916532503627f4024d13884640a46f1d61d4", + "sha224": "672200d406abe214e2543d5458426a15ba6d5b7e85dc8fe924490120", + "sha224WithRSAEncryption": "672200d406abe214e2543d5458426a15ba6d5b7e85dc8fe924490120", + "sha256": "ef88b649d012178186dcf0244835232b5b7392e0c1f8f141f5107e9ead559e74", + "sha256WithRSAEncryption": "ef88b649d012178186dcf0244835232b5b7392e0c1f8f141f5107e9ead559e74", + "sha384": "67d81f06cd91955f8687438102af53150230545e6a9d048607fad016e02871dce328be37f14adebd872e0b85fbfec21c", + "sha384WithRSAEncryption": "67d81f06cd91955f8687438102af53150230545e6a9d048607fad016e02871dce328be37f14adebd872e0b85fbfec21c", + "sha512": "7b700b34117c7d5d54f678dcbab709b5cb0e43c46ec5909d237d76c915677f6398232a2786b9e2acb44bccf30902ebd21bf5ccb009325ffa2d9fe323af956dd3", + "sha512WithRSAEncryption": "7b700b34117c7d5d54f678dcbab709b5cb0e43c46ec5909d237d76c915677f6398232a2786b9e2acb44bccf30902ebd21bf5ccb009325ffa2d9fe323af956dd3", + "shaWithRSAEncryption": "7e6bf7365990bb140e09b2d93e75cd585c9ef13d", + "ssl2-md5": "7d725ae9a8e569f49c56194226b64dee", + "ssl3-md5": "7d725ae9a8e569f49c56194226b64dee", + "ssl3-sha1": "61e8916532503627f4024d13884640a46f1d61d4", + "whirlpool": "f1932d3afdd5b38e9d614ace1cb632f7e9655e295c3e81ea9337275d28a4f183686ee64d8b87ee1fe9d633046e4a54e5ad2356dfe9eb88080c3e53a9f761b92e" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////gAAAAAP///////////////+AAAAAAAB///////////////4AAAAAAAAAH//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////4AAAAAAAAAAAAAAAAAAAf/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAP///////+AAAP////////////h///////AAAAAAAAAAA////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAB+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///+AAAAAAAAAAAAAAAAAAAP/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////4AAAAAAAAAAAAAAAAA///////////////////////////wAAAAAAAAAAAA//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////8AAAAAAf///////////////////////////////////4AAAAAAAAAAAAAAf/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////gAAAH////+AAAAAD//4D///////////////////4AAAAD///4AAAAAAAAAAAAAAAAAAAA////////////////+AAAAAAAAAAAAAAAAAAAAAH//////////////////////AAAAAAAAAAAAAAAAAAAAAAAA///////////////4B//////////////////8AAAAAAAAAAP/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAH/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////wAAAAAAAAAAAAB//////////////////////////////////AB///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////+f///////////////////////4AAAB/////////////////wAAAAAAAAAAAAAAH//+AAAAAAAAAAAAAAAAAAAAAAAAAB////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////4AAAAAAAAAAAAAAAAAP////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////8AAAAAAGAAAAAAAAAAAAAAAAAAAAAf//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////8AAAAAAAAAAAAAB//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////+AAAAAAAAAAAAAP//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH////////////4AAAAAAAAAAAAAAAAAAAAA//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////4AAAAAAAAAAAAAAB//////////////wAAAf//////////////////////////////////+AAB////////////8AAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////AAAAAAAAAAH///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////8AAAAD////////////////8AAAAAf////AAAAAAAAP/////////////AAAAAAAAAAAAAAAAAAAAA////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////8AAAAAAAAAAAAAAAAAAAAAAAAf//4AAAAAAAAAAAAAAAAAAAAAAH////////wAAAB///////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/+AA//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAD////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////+AAAAAf//////////////gAAAAAAAAAAAAAAAD//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////+AAAAAAAf/////////gAAAAAAAAAAAAAAAAAAA////////gAAAAAAAAAAAAAAAAB/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////AAAAAAAAD/////////////////wAAAB////gAAAAAAAAAAH//////////////+AAf////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////8AAAD///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////4AAAAAAAAAAAAAAAAH////////////////////////////////wAAAAAAAAAAAAAAAAAB///////////////////////gAAAAAAAAAAAAAAAD////////////////////wAAAAAAAAAAAAAAAf////////gAAAAAAAAAAAAAAAP//////wAAAAAAAAP////////////4AAAAAAAAAAB//////////////////gAAAAAAAAAAAAAAAP/////////////////////4AAAAAAAAAAAAB//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAH+AAAAAAAAAAAAAAAAAAAAAD////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/gAAAAAAAB//3////////////8AAAAAAAA////4AAAAAAB//////+AAAAAAAAAAAAAAAAAAAAAAAA/////////////////4AA///gAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////wAAAAAAAAAAAAAAAAAAA/////////////////////////////////4AAAAAAAAAAAH/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////wAAAAAAAAAAAAAB///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAH//////////+AAA///////////+AAAAAAAAAAAAD//////////AAAAAAAAAAAD+AAAAAAAAAAAAAAAAAAAAAAD//////////////////8AAAAAAAAAAAAP///////////////////////////////////AAAAAA//////////////////////////8AAAAAAAAAAAAAAAB////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////gAAAAAAAAAAAAAAAAAAAAAAD///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP////////+AAAAAAAAAA/////////8Af////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8D//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////wAAAAAAAAAH//////////////////wAAAAAAAAAAAAA//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////gAAAAAAAAAAAAAAAAAAAAAB///////////////////+AAAAAAA///////////////////////gAAAA/////////////////////////////////gAAAH////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////9//////////AAAAAAAAAAAAD/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////4H///////////////////////wAAAAAAAAAAAAB//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////+AAAAAAAAAAAAAAD////4AAAAB/////////////////+AAAAAAAAAAAA/8AAAAAAAP///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////4AP///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////gAAAAA////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////wAAAAAAAH//////////////gAAAAAAAAAAAAAAD//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////AAAA//////////////////////////////////8AAAAAAAAf/////8AAAAAAAAf///////////////////////////4AAAAAAAAAAAAAAAAAAAAABH///////8AAAAAf/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////4AAAAAP///////////////////////////AAAAAAAAAAD///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////8AAAAAAAAAAAP///4AAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAAH////////////////////////wAAAAAAAAAAP///////////////////8AAAAB///////////////+AAAAAAAAAAB/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////+AAAAAAD////////////////////////+AAAAAAAAAAAB//////////////////////////+AB///////////////gAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAP//////////+AAAAAAAAAAAAAAAAAf//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////8AAAAAAAAAAAAAAAD///////8AAAeAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////4AAAAAf///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////AAAAAAAAAAAAAAAAAAAAAAf/////////4AAAAAAAAf////8AAAAAAAAAAAAAD///4AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////8AAAAAAAAAAAA8AAAAAAAAAAAAB////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////+AAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////wAAAAAAAAAAAAD//////////AAAAAD////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAD//////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////4AAAAAAAAAAAAAAAAAAf//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP//wAAH/8AAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////wAAH//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////gAAAAAAAB///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////8AP///////////////////gAAAAAAAAAAAAAAAAH//////////////////////////////+AAAAAAAAAAAAAAAAAAAAB////4AAAAAB////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAD//////////////8A//////8A//////////////////////////////////AAAAAAAAAAAAAAA/////////////////////////8AAAAAAf/4AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAB////////////+AAAAAAAAAf///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAAAAP///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////8AAAAAAAA////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////wAAAAAAAAAAAAAAAAAAAAAAAAA==", + "DSA": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "DSA-SHA": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "DSA-SHA1": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "DSA-SHA1-old": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "RSA-MD4": "2b1d66eed05bc6e40ffacf55691782cb", + "RSA-MD5": "7396f5d4491e79ec1ac0ce7a105bb233", + "RSA-MDC2": "feabf6a719c5e076c23112828b1003e1", + "RSA-RIPEMD160": "3e1abf43d4864e9abb4debc1b74bc796b56e849d", + "RSA-SHA": "b41016af67a72469aedf7586bbf519250c383306", + "RSA-SHA1": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "RSA-SHA1-2": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "RSA-SHA224": "73c23aad3f52f8852b9a25e1d42f0283500a7db25564b9b2555bf5bf", + "RSA-SHA256": "326f14fc54954b73d704935b213dc797311f7c8fcd88c238c8ab767286dc3f94", + "RSA-SHA384": "49581d90135017813701167b388aa0fb42c7abc20dc6478a9a95227ce3d97cc2ab7669680f83757f689a8317c2b705da", + "RSA-SHA512": "18bdb647bf2cb2b8817a896757820d7dcc18b0f4c1220b3820cae338fc974253d8f92dfbe3f8c2f20bd7298be0a055684a4af91adc02f080c78d376f7676b175", + "dsaEncryption": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "dsaWithSHA": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "dsaWithSHA1": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "dss1": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "ecdsa-with-SHA1": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "md4": "2b1d66eed05bc6e40ffacf55691782cb", + "md4WithRSAEncryption": "2b1d66eed05bc6e40ffacf55691782cb", + "md5": "7396f5d4491e79ec1ac0ce7a105bb233", + "md5WithRSAEncryption": "7396f5d4491e79ec1ac0ce7a105bb233", + "mdc2": "feabf6a719c5e076c23112828b1003e1", + "mdc2WithRSA": "feabf6a719c5e076c23112828b1003e1", + "ripemd": "3e1abf43d4864e9abb4debc1b74bc796b56e849d", + "ripemd160": "3e1abf43d4864e9abb4debc1b74bc796b56e849d", + "ripemd160WithRSA": "3e1abf43d4864e9abb4debc1b74bc796b56e849d", + "rmd160": "3e1abf43d4864e9abb4debc1b74bc796b56e849d", + "sha": "b41016af67a72469aedf7586bbf519250c383306", + "sha1": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "sha1WithRSAEncryption": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "sha224": "73c23aad3f52f8852b9a25e1d42f0283500a7db25564b9b2555bf5bf", + "sha224WithRSAEncryption": "73c23aad3f52f8852b9a25e1d42f0283500a7db25564b9b2555bf5bf", + "sha256": "326f14fc54954b73d704935b213dc797311f7c8fcd88c238c8ab767286dc3f94", + "sha256WithRSAEncryption": "326f14fc54954b73d704935b213dc797311f7c8fcd88c238c8ab767286dc3f94", + "sha384": "49581d90135017813701167b388aa0fb42c7abc20dc6478a9a95227ce3d97cc2ab7669680f83757f689a8317c2b705da", + "sha384WithRSAEncryption": "49581d90135017813701167b388aa0fb42c7abc20dc6478a9a95227ce3d97cc2ab7669680f83757f689a8317c2b705da", + "sha512": "18bdb647bf2cb2b8817a896757820d7dcc18b0f4c1220b3820cae338fc974253d8f92dfbe3f8c2f20bd7298be0a055684a4af91adc02f080c78d376f7676b175", + "sha512WithRSAEncryption": "18bdb647bf2cb2b8817a896757820d7dcc18b0f4c1220b3820cae338fc974253d8f92dfbe3f8c2f20bd7298be0a055684a4af91adc02f080c78d376f7676b175", + "shaWithRSAEncryption": "b41016af67a72469aedf7586bbf519250c383306", + "ssl2-md5": "7396f5d4491e79ec1ac0ce7a105bb233", + "ssl3-md5": "7396f5d4491e79ec1ac0ce7a105bb233", + "ssl3-sha1": "f008d5d7853b6a17b7466cd9e18bd135e520faf4", + "whirlpool": "0c4b3b4955549c8111198dffd123cf1eb3153e8ecc4c09f53279422dbbe5810a83955a9bd62fa4697c296f5a8f963b84370132cafee81ce40b96fef7344a7907" + }, + { + "input": "AAAAAAAAAAAB//////////////8AAAAAAAAAAAAAAAAAAAAAAB/gAAAAAAAAAAAAAAH/////////4AAAAAAAAAAAAAAAAAAAAAAAH///+AAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////j////////////////////AAAAAAAAAAAAAAAAP//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////wAAAAAAAAAAAAAAAf////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////wf/////////////4AAAAAH/////////////AAAAB//////////wAAAAAAAAAAf//////////////////////////gAAAAAAAAAAAB/8AB////////////////////////////////4AAAAAAAAAAAAH/////////////////4AAAAAAAAD/////////////////////4AAAAAAAAAAAAB//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////8AAAAf//////////////////////+AAf//wAAAAAAAAAAAAAAAAAAAB///////////////////////wAAAAAAAAAAAAAAAAB+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////wAAA//////////////4AAAAAAAAAAAAAAAAAAAAAD//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////gAAAAAAAAAAAAAAP///////////////4AAAAAAAAAAAAAAAAAAD////////////////////Af//////////////4AAAAAAAAAAAAAAAAD///+f//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAAAAAAB//AAAAAAAAAAP////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////wAAAAAAAAAAAAAAAAAAAAAAAAP/////+AAAAAAAP////////////////////////gAAAAAAAAAAAAAAAAAAAB/////////////////gAAAAAAAAAAAAAAAAAAAAAH/////+AAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////gAAAAAAAAAAAAAAAAAP//wAAAAD//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////gAAB///////gAAAAAAAAAAAAAAAAAAAAAAAA//////4AAAAAAAAAAAAAAf/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///4AAAAAAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////8AAAAAAAD//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAD///////gAAAAAAAAAAAAAAAAB///////////////////////gH///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////+AAAAAAAAAAAP/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////gAAAAAAAAAAAAAAAf///gAAAAAAAAAAAAAAD////////////////+AAAAAAAAAAAAAA//////+P////4AAAAAAAAAAAAAAAAAAAAAAAAAf///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////4AAAAAAAAAAAAAAAAAH/4AAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////4AAAAAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////wAAAAAAAAAAAAAAAA//////AAAAAH///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPgAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////wAAAAAAAAAAAAA////////////D/////////////AAAB/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAH///////////gAAAAAAAAAAAAA////+AAAAAAAAAAAAAAAAAP//////////4AAAAAf//////////////////+AAAAAAA///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAB//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAB/////wAAAAAAAAAAAAAAAAAAAAAAAAAA///4AAAAAAAAAAAAAAAAAAAAA//////////////////////////////////8AAADAAAAAf//////////8AAAAAH/////////////AAAAAAAAAAAA///////+AAAAAAAAAAH///gAAAAAH////////////////////////////////////wAAAAAAAAH////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////f/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////gAAAAAAAAAAAAAAAAAAAAD///////////////////gAAAAAAAAAAAAH//////////////////4AAAD////////AAAAAAAAAAAAD////////////////8AAAAAAAAAAAAAB/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////gAAAAAAAAAAAAAAAAAD//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////wAD/////////////////////////gAAAAAAAD////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////wAAAAAP///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////wAAAAAAAAAAAAAAAAAf////////wAAAAAAA//////////8AAAAAAAAAAH///////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//AAAAAAAAAP//////////////////////gAAAAAAAAAAAAAAD////////////////////////////////AAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////wAAAAAAAAAAf///////////AAAAAAAAAAAAAAAAAAAAAA////////////////////4D/////////////////////////////gAAB/////////////////////wAAAAAAAAAAD///////////////////////////8f///////////4Af///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////8D//////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////4H/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////gAAAAAAAAAH/////////wAAAAAAAA////////////////////////////+AAH//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////4A///////////////////////4AAAAAAAAA///////8AAAAAAAAAAAAAAAAAP///////////////4AAAH///////+AAAAAAAAAAAAAAAAAAAD//////////////AAAAAAAAAAAAAA////////////////////////////gAAAAAAB//wAAAH//////////////////////gAAAAAAH////////////////gAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////gAAAAA/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAf/////////////////////////8AAAAAAAAAAP/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////gAAAAAAAAAAAAAAAAAAAAAAAH////////////AAAAAAAAAAAAAAAA////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAD/////////////////////gAAAAAAAAAAAH///////////////4AAAAAAAAAAAAAAAAAAD///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////4Af//////////////////////8AA//////////wAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////+AH///////////////+AAAAB//////////wAAA/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////wAAAAH/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////+AAAAAAAAAAB////4AAAAAAAAAAAAAAAAA///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAA/////4AAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAAf//////////4AAAAAAAAAAAAAP//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAAA/////////////////////////wAAAAAAAAAAAAAA/////////////////////////////////////wAAAAAAAAAAH////////////wAAAAAAAAAAAAAAAAP//////x///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////wAAAAAAAAAAAAAAAAAAAAf////////4///////////////////////////4AAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAA////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////8AAAAAAAAAAAP//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////8AAAAAAAAAAAAAAB////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/8AAAAAAAAA//////////////////////////////AAAAAAAAAAAAB////////////////////////////////AAAAAAAAAAAAAAAAAAA///////////////////wAAAAAAAAAAAAAAAAAAAD///////////////////////////////gA/gAAAAAAP///////////////////////////////gAA////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////8AAAAAAAAH////////////////////wAH//8AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////wAAAAAAAAAAAAAAAAD//////////////+AAAAAAAAB/////////////////////8AAAAAAAAAAAAAAAAAAAAf///////4AAAAA///////////////////8AAAAAAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "DSA": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "DSA-SHA": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "DSA-SHA1": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "DSA-SHA1-old": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "RSA-MD4": "646300522d65be1fe0f8017e5cb9b065", + "RSA-MD5": "aa64644a4877da34e2197c5f2dc375c5", + "RSA-MDC2": "5a1d0136c341b3a22c6bcf8a81e6bc6e", + "RSA-RIPEMD160": "772ae5a943ad630f39a7ded192bd4ae3788b8643", + "RSA-SHA": "1a6924f77b05fd91e0fa867b24f807ca24d9f9f9", + "RSA-SHA1": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "RSA-SHA1-2": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "RSA-SHA224": "9fe52a882c3ebffe3eb2679dca6c6b5427fc54b595b05d6c27cafe5b", + "RSA-SHA256": "0087e37129b9a2d58b0987a218a3c1be67cb1e08142cbcf889aa617ca3e4640d", + "RSA-SHA384": "1baef479239218d46b622347b3f9b8e2513df79af4794230934f5f6f3f515c108b060176566c38c913f97f1ef8fa96b1", + "RSA-SHA512": "3b2e6dedcb51a29fff2bfaa8067002e407aaf8409b0f1db895de04b9f99135d02c6c1585bb95adcdc580c5246e11a19d96f4eaf6690d7395ecc183a97e5567b9", + "dsaEncryption": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "dsaWithSHA": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "dsaWithSHA1": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "dss1": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "ecdsa-with-SHA1": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "md4": "646300522d65be1fe0f8017e5cb9b065", + "md4WithRSAEncryption": "646300522d65be1fe0f8017e5cb9b065", + "md5": "aa64644a4877da34e2197c5f2dc375c5", + "md5WithRSAEncryption": "aa64644a4877da34e2197c5f2dc375c5", + "mdc2": "5a1d0136c341b3a22c6bcf8a81e6bc6e", + "mdc2WithRSA": "5a1d0136c341b3a22c6bcf8a81e6bc6e", + "ripemd": "772ae5a943ad630f39a7ded192bd4ae3788b8643", + "ripemd160": "772ae5a943ad630f39a7ded192bd4ae3788b8643", + "ripemd160WithRSA": "772ae5a943ad630f39a7ded192bd4ae3788b8643", + "rmd160": "772ae5a943ad630f39a7ded192bd4ae3788b8643", + "sha": "1a6924f77b05fd91e0fa867b24f807ca24d9f9f9", + "sha1": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "sha1WithRSAEncryption": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "sha224": "9fe52a882c3ebffe3eb2679dca6c6b5427fc54b595b05d6c27cafe5b", + "sha224WithRSAEncryption": "9fe52a882c3ebffe3eb2679dca6c6b5427fc54b595b05d6c27cafe5b", + "sha256": "0087e37129b9a2d58b0987a218a3c1be67cb1e08142cbcf889aa617ca3e4640d", + "sha256WithRSAEncryption": "0087e37129b9a2d58b0987a218a3c1be67cb1e08142cbcf889aa617ca3e4640d", + "sha384": "1baef479239218d46b622347b3f9b8e2513df79af4794230934f5f6f3f515c108b060176566c38c913f97f1ef8fa96b1", + "sha384WithRSAEncryption": "1baef479239218d46b622347b3f9b8e2513df79af4794230934f5f6f3f515c108b060176566c38c913f97f1ef8fa96b1", + "sha512": "3b2e6dedcb51a29fff2bfaa8067002e407aaf8409b0f1db895de04b9f99135d02c6c1585bb95adcdc580c5246e11a19d96f4eaf6690d7395ecc183a97e5567b9", + "sha512WithRSAEncryption": "3b2e6dedcb51a29fff2bfaa8067002e407aaf8409b0f1db895de04b9f99135d02c6c1585bb95adcdc580c5246e11a19d96f4eaf6690d7395ecc183a97e5567b9", + "shaWithRSAEncryption": "1a6924f77b05fd91e0fa867b24f807ca24d9f9f9", + "ssl2-md5": "aa64644a4877da34e2197c5f2dc375c5", + "ssl3-md5": "aa64644a4877da34e2197c5f2dc375c5", + "ssl3-sha1": "bd8d2e873cf659b5c77aac1616827ef8a3b1a3b3", + "whirlpool": "bbf55681639652c32a1b95266f8c6412726502948f78d45c5bca282509d7f3bfb566c5914007fb49eb92d17a4e7c4f62922152860476df635d54fb9ca5530a6b" + }, + { + "input": "///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////wAAAAAAAAAAAAAAAAAAAH/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////8AAAAAAD//////////wAAAAAAAAAAAAAAAAAAAAP///////////////////////////AAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////8AAAAAAAAH////////////+AAAA////////////////////////8AAAAAAAAAAAAf/////////////////////////wAAAAAAAAAAAAAAAAAAB/////////////////////////////AAAP////////gAAAAAAH////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////4AAAA//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////AAAAAAAAAAAAAAAAAAA/////////////////////////////////////AAAB//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////wAAA////////////////////////AAAAAAAAAAAAAAAAAAAA///////////////////////+AAAAAAAAAAAAAAAAAAAH/////8AAAAAAAAAAAAB//////gAAAAAAAAAAAAAAB/////////+AAAAAAAAB//////////////////////////////4AAAAAAAP/////////////////wAAAAAAAAAAAAAAAAAD////////////////////////8AAAAAAH/wAAAAAAAAAD//////////////////////////////////+AAAAAAA////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////8AAAAAAAAAAAAAAAP////////////////////////////////8AD////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////AAP//////////////////+AAAAAAAAAAAAAAAAAAAAH////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAD///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAB////////////4AAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////AAAAAAAAAAAAAAAAB/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAB//4AAAAB///n////////////////////////////////////+AAAAAAAAAAAAAAAAAAB/////AAA////////////////////4AAAAAAAAAAAAAAAH//////////////////8AAAAAAAAAAAAAAAAAAAAAAf////////////////////8AAAAAAAAAAAAAH////////////////////////////////////gAAAAAAAAAAAAAAAAAf/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////+AAAAAAAAAAf///////////////////////////////+AAAAAAAAAAAAAf///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////8AAH//////////////////////////////////4AAAAAAAAAAAAD///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAH//////////////8H///////////////////////AAAAH//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////wAAAAAAAAAAAAH////////////////////////////////8AAAAAAAAAAAAAD////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAAAAAAAAD////////////gAA//////////////////////////4AAAAB///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////gAAAAAAAAAD////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////8AAAAAAAAAAAD/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//+AAAAAAAAAAAB//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAAAAA/////////////////////////////+AAAAf///wAAAAAAAAAAAAAAAH////gAH////4AAAAAAAAAAAAAf//////////////////4AAAAAAAAAAAAAB///////////////////////////////gAAAAAAAAAAH/////////////////////4AAAAAAAAAAAAAAAAAAAAAD//////Af/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////AAAAAAAAAAAAAAAAAAAAAAAP/wAAAAAAAAAAAAAAAAAAAAAAAAAAA/H/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAAAAAAAAAH//AAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////8AAH/////////////8AAAAAAAAAAAAAD///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////gAAAAAAAAAAAAAAAAAAAAAAH//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////+AAAAAAP//////+AAAAAAAAAAAAAAAAAAAD//////gAAAAAAAAAAAAAAAf//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////8AAAAA//////////////wAP///8AAAAAAAD//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////4AAAH//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////4AAAAAAAAAAAAAf/////////////////////////////4AAAAAAAAAAAAAAAH///////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAA////////////////4AAAAAAAAAAAAAAAAAAAP//////////////wAAAAAAAAP/////////////AAAAAAA////////gAAAAAAAAAAAH////////wAAAAAAAAAAAAAAAf////////////AAAAAAAAAAAAAAAAAAAAH/////////4AAAAAAAAAAAAAAAAAAAH///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////8AAAAAAAAAAAAAAAAAAAAAAH///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////4f/////wQAAAAAAAAAAB///////wAAf////+AAAAAA/////////////////////8AAAAAAAAAAAAAB/4A////////////////////////4AAAAAAAAAAAAAAf////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////gAAAAAAAAAAAAAD/////////////////////////AAAAAAAAAAAAAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////AAAAAAAAAD//AAAAAAAAAAA////////////+AAAAAAAAAP///////8////////////////////wAAAAAAAAAAAAAAAAAH/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///+AAAAAAAAAAAAAAAAAAAAAAAAB///////////////gAAAAAAAAB//////////////////////////////////AAAAAAAAAAAB//////////////////////4AAAAAAAAAAAAAAA////////////////////////4AAAAAD/////////AAAAAAAA///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////AAAAAAB//////////////////8AAAAAAAAAAB//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAD//////////////////+AAAAAP////////////////////AAAA//////////////////////////////8AH//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////4AAAAAAAAB//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////wP////////////////////8AAAAAAAAAAAAAf//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////8AAAAAAAAAAAf8AAAP//////////////+AAAAAAAAAAAA/////gAAAAD////////////////////////////+AAAAAAAAAAAD/4AAAAAAAAAAAAAAAB//////////////////////////////////gAAAAAAAAAAAP/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////wAAAAAAAAAAAAAA//////////////8AAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////+AAAAAAAAAAAAAAAAB///////////////////////////////wAAAAAAAAH//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////gAAP///////+AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////wAAAAAAAH///wP/////////////////////////////gAAAAAAAAAAAAAAAAAAAAH////4AAAAAAAAAAAAAAAAAAAAAAAAAH//////////gAAAAAAAAAAAAAAAAAD/////////////////////////////////4AAAAAAAAAAAAAAAAA/////////gB//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAD/////////wAAAAAAAAAAAAAAAAAAAAAAH/////////8AAAAAAAAAAAAAAAAAH///AAAAAAAAAAAAAAAf////////4AAAAAAAAAAAAAAAA////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////4AAAAAAAAAAAAAAAAAAAAAAf////////8AAAAAAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAAAAAAH///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////+AAAAAAAA//////////////+AAH//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////+AAAAAAAB///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////+AAAAAAH/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///4B////////////////////////////////4AAAAP///////////////////AAAAAAAAD//////8AB/////////////AAAB/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////+AAAAAAAAAAAAAAAAAAAH/////////////////////////////AAAAAAf/////////////////////////////wAAAAAAH/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAAAAAAAAAAAAAAD///////////wAAAAAAAf////+AAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////8AAAA/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAD//////////////////wAAAAAAAAAAf//////////////////////////4AAAAAAf////////////////////////H/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////wAAAAAAAAAAAAAAAAA///gAAAAAAAAAAAH/////////////////////////wAAAAAAAAAAAAAAAA///////+AAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "DSA": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "DSA-SHA": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "DSA-SHA1": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "DSA-SHA1-old": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "RSA-MD4": "b318cc590bf331654f863601487c8071", + "RSA-MD5": "2165718fc24bf21f1c4e0623c8e8d811", + "RSA-MDC2": "ff3f4fa633d318e34624b34bd0a2e170", + "RSA-RIPEMD160": "353248e07ae64f251202faa6ed077336f2e80305", + "RSA-SHA": "4d265905a6dcbb0381e82050b3d6d2084fb78cad", + "RSA-SHA1": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "RSA-SHA1-2": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "RSA-SHA224": "96b6dcbcfffaa3243d73174c83951c43ba1620723268916ba964064a", + "RSA-SHA256": "93294033c9de9361a3c6cc0df539e2e459f6d2babbbc0623859e18af0d0ccf4e", + "RSA-SHA384": "98dbc59715eb741d6ee1c30e7fadb581dc43b78619f9e70639ae56b23a9e0dfcaaac86bbe665b8388932e7b4ae43a58a", + "RSA-SHA512": "fb111732088f48dbd779104f1de037bdc5ce349fbbbbfe2b79965e545ab968b347f6403492eb5adfcc347a283c9a58795ee6d0e758e8014a9702c3f1d58910fe", + "dsaEncryption": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "dsaWithSHA": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "dsaWithSHA1": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "dss1": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "ecdsa-with-SHA1": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "md4": "b318cc590bf331654f863601487c8071", + "md4WithRSAEncryption": "b318cc590bf331654f863601487c8071", + "md5": "2165718fc24bf21f1c4e0623c8e8d811", + "md5WithRSAEncryption": "2165718fc24bf21f1c4e0623c8e8d811", + "mdc2": "ff3f4fa633d318e34624b34bd0a2e170", + "mdc2WithRSA": "ff3f4fa633d318e34624b34bd0a2e170", + "ripemd": "353248e07ae64f251202faa6ed077336f2e80305", + "ripemd160": "353248e07ae64f251202faa6ed077336f2e80305", + "ripemd160WithRSA": "353248e07ae64f251202faa6ed077336f2e80305", + "rmd160": "353248e07ae64f251202faa6ed077336f2e80305", + "sha": "4d265905a6dcbb0381e82050b3d6d2084fb78cad", + "sha1": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "sha1WithRSAEncryption": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "sha224": "96b6dcbcfffaa3243d73174c83951c43ba1620723268916ba964064a", + "sha224WithRSAEncryption": "96b6dcbcfffaa3243d73174c83951c43ba1620723268916ba964064a", + "sha256": "93294033c9de9361a3c6cc0df539e2e459f6d2babbbc0623859e18af0d0ccf4e", + "sha256WithRSAEncryption": "93294033c9de9361a3c6cc0df539e2e459f6d2babbbc0623859e18af0d0ccf4e", + "sha384": "98dbc59715eb741d6ee1c30e7fadb581dc43b78619f9e70639ae56b23a9e0dfcaaac86bbe665b8388932e7b4ae43a58a", + "sha384WithRSAEncryption": "98dbc59715eb741d6ee1c30e7fadb581dc43b78619f9e70639ae56b23a9e0dfcaaac86bbe665b8388932e7b4ae43a58a", + "sha512": "fb111732088f48dbd779104f1de037bdc5ce349fbbbbfe2b79965e545ab968b347f6403492eb5adfcc347a283c9a58795ee6d0e758e8014a9702c3f1d58910fe", + "sha512WithRSAEncryption": "fb111732088f48dbd779104f1de037bdc5ce349fbbbbfe2b79965e545ab968b347f6403492eb5adfcc347a283c9a58795ee6d0e758e8014a9702c3f1d58910fe", + "shaWithRSAEncryption": "4d265905a6dcbb0381e82050b3d6d2084fb78cad", + "ssl2-md5": "2165718fc24bf21f1c4e0623c8e8d811", + "ssl3-md5": "2165718fc24bf21f1c4e0623c8e8d811", + "ssl3-sha1": "b25a04dd425302ed211a1c2412d2410fa10c63b6", + "whirlpool": "cb0e8e2d3e9f01df1b8308fb9691b64bc10f216a57a9adc1c9989efe5472d3a3f141c589592c8b4ba1f1059e3947359ca0237285518b154f48406b41742d43d2" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAAAAB////////////////////////////+AAAAAAAAAAAAAAAAAAAAB/AAAA//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////gAAAAAAAAD//////////////9/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////8AAAAAAAAAA////////////////////////4AAAAAA///////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////gAAAAAAAAAAAAAAAAAAAAAAAD///////////4AAAAAAAD///////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAAAAP//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAP////////wAAAAf/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAH///////////wAAAAAAAAAAAAB/////////////////////8AAAAAAAAAAAAAD///////AAAAAAAAAAAAAAAAAAAAAAAA/8AAAAAAAAAAAAAAAAAAAAAA///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////wAAAAAAAAAAAAAD/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////AAAAAAAAAAAAAAAf///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////wAAAAAP///////////4AD///////4AAAAAAAAA/////////////////////////8AAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////gAAAAAAAAAAB////////////////4AAAAAAAA/////////////////////+AAAAAAAAAAH/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////8AAf//////////////////////+AAf/AAAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAB////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//4AAAAAAAAAAAAAAAAAAAAAAAAAAAAf////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////gf///////////8AAAAAAAAAAAAAAAAAAAAH///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////8AAAAAAAAAAAAf//////////////8AAAAAAAAAAAAAAAAAAf//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////gAAAAAAAAAAAAAAP//////////////////////////////////+AA/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////+AAAAH///////////////////7////////AAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////4AAAAAAA///////////////////////8AAAAB/////wAAAAAAAAAAAAAAAAAAAAAAAH////////////////////gAAAAAAAAAAAAAAH/////////////////////gAAAAB////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////P//AAAAAAAAAAAAAAAAAA/////////////////////////////////4AAAAAAAAAAAAB////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAf/4AAAAf//////////////////////AAAB/////////////gAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////wAAH/////4A//////////////////////////////4AAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////gAAAAAAAH///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAD/////8AAAAAAH///////////////+AAAAAAAAAAAAAAAAAAAAAAH+AAAAAA//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAH//////////wAAAAAAAAAAAB//////////////////////////AAAAAAAAAAAAAAB/////////////+AB/////////////wAAAAAAAAAAAAAAAB//////////////AAAAf////////////////////////////////////4AAAA/////////////////////////8AAAAAAB//////////////////////////////////+AAAAAAAAAAAAAAAAAAA//////////////////////////////////gAAAAAAAAAAAD/////////////////8P///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////AAAAAAAAAAAAAAAAAf////////////////////////////4AAAAAAAAAAAAAAAAA//////////////////AAAH///////////////////////////AD/////////////////////////////+AAAAAAAAAAAAAAAAf///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAH///////////////4AAAH////wAAAAAAAAAAB///////////////////////////4B/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////8AAAAAAAD///////////wAAAAAAAAAAD///////////////////////////////////+AAAAAAAAAAAB//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAAAAAAAAAAP/////////////gAAAA////////////////+AAAAAAAAAAA///8AAAAAAAAAAAAAAAAAAD////gAAAAAAAAAAAAAAAAAAAAAAP////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////n//////////AAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAf/////////////////////////+AAD///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//4AAAAAAAAP////4AAAAAAAAAAP/////////wAAAAAf/////////gAAf/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////+AAAAAAAAAAAAAAAAAAD/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////gAAAAAAAAAAAAAAAAAAAAD///////////////////gAAAAAAAAAAAAAAAAD////////////wAAAAAAAAAAAAAAAAA////gAAAAAAf/////////+AAAAAAAAAAAAAAAH////////////wAAAAAAAAAAAP//////////////////////////////////8AAAAD////////////////gAAAAAAAAAAAAAAAAf///////////////////////////////8AAAB/4AAAAAAAAAAAAAAAAAAAAAAAAP/////gAAAB//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////8AAAAAAAAH///////////////wAAAAAAH////4AAAAAAAAf//////////AAAAAAAAAAAAAAAAAB////////////////////////////////////4AAAAAAAAf////////////////////8AAAAAAAAAAAAAB///////////////////////////////4AAP////////+AAAAAAAAAAAAAAAAAAAAAAD//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////gAAAAAAAA//////////4AAAAAAAAAAAAAAAAAAAAB///////////////////8f////////////////////////////8AAAP////////////////////+AAAAAAAAAAAf///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////wAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAB//////////////////8AAAAAAAP/////////gAAAAAAAB//////////////////////////8AAA///////////////////////////////////8AAAA/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAH////////wAAAAAAA/////////////////8AAAAAAAAAAAAAAH//+AAAAAH//////////////////AAAAAAAAAAAAAD/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////4AA/4AAAAAAAAAAAAAAAAAAAAAAf/////+AAAAAAAAAAAAAAAAH//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////8AAAAAAAAAAAAB///AAAH////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAAAAAAP////////8AAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////+AAAAAAAAAAAAAAAAAf//////////////////////+AAAAAAAAAAP///////////////wAAAAAAAAD////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////8AAAAAAAAAAAAAAAAAAAAH/////////gAAAAAAAAAAAAAB/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////gAAAAAAAAAAAAP//////////////////////////////AAAAAAAf/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAB+AAAAAAAAAH////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////+AAAAAAAA/////////////////////////////////4AAAAAAAH4AAAAAAAAAAAAAAH//4AAAAAAAAD/wAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////8AAAAAAAAAAD//////////////////////////////////AAAAAAAAAP//////////////////////////////8AAAAAAAAAAAAAAAAD//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////gAAAf//////////////8AAAAAAAAAAAAAAAAAAAAA//////////////////////8AAAB/////////8H////////////////////gAAAAAAAAAf//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAAAAAAAAAAAAAf////////////////8AAAAAAAAAAAAAAAAAAAAAAA//////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////gAAAAAAAAAAD////////////////8AAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////8AAAAAAP//////////////////+AAAAAAAAAf///////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////8AAAAAAH//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAA==", + "DSA": "a404e21588123e0893718b4b44e91414a785b91f", + "DSA-SHA": "a404e21588123e0893718b4b44e91414a785b91f", + "DSA-SHA1": "a404e21588123e0893718b4b44e91414a785b91f", + "DSA-SHA1-old": "a404e21588123e0893718b4b44e91414a785b91f", + "RSA-MD4": "b35ad3b4139e965d61a9cbf0a396ae34", + "RSA-MD5": "e1f45852024724f00ced7935e297983a", + "RSA-MDC2": "58ceb1e0612f8e326c59fbe712289c34", + "RSA-RIPEMD160": "da645019e2ca77d29eb1fe5aeaea55c6a8117fe9", + "RSA-SHA": "dd2e300be6148c6a69b1635d82a116c4f84562ff", + "RSA-SHA1": "a404e21588123e0893718b4b44e91414a785b91f", + "RSA-SHA1-2": "a404e21588123e0893718b4b44e91414a785b91f", + "RSA-SHA224": "c1416e854b41fb4bfb58428e05b2d17f2807c3af1e6054205544446a", + "RSA-SHA256": "49640215294d9263bc464538c3c29e42edea637d1427c2f04ebcd828d6fcb480", + "RSA-SHA384": "6194c3b9a2fc464a4e26fd3bd7c4ffbcfe8d10919bb5c12d656dee694875f55bc7185d315379fff03547ce0f1b41bc47", + "RSA-SHA512": "ffa4fc1884d61bb097c2481cbfa1e247498627458b792c0abb37d6923345bbcaf51c9720bd4e81109d54e86f822d6cb8e3786876868a1097dd18a34b1f129892", + "dsaEncryption": "a404e21588123e0893718b4b44e91414a785b91f", + "dsaWithSHA": "a404e21588123e0893718b4b44e91414a785b91f", + "dsaWithSHA1": "a404e21588123e0893718b4b44e91414a785b91f", + "dss1": "a404e21588123e0893718b4b44e91414a785b91f", + "ecdsa-with-SHA1": "a404e21588123e0893718b4b44e91414a785b91f", + "md4": "b35ad3b4139e965d61a9cbf0a396ae34", + "md4WithRSAEncryption": "b35ad3b4139e965d61a9cbf0a396ae34", + "md5": "e1f45852024724f00ced7935e297983a", + "md5WithRSAEncryption": "e1f45852024724f00ced7935e297983a", + "mdc2": "58ceb1e0612f8e326c59fbe712289c34", + "mdc2WithRSA": "58ceb1e0612f8e326c59fbe712289c34", + "ripemd": "da645019e2ca77d29eb1fe5aeaea55c6a8117fe9", + "ripemd160": "da645019e2ca77d29eb1fe5aeaea55c6a8117fe9", + "ripemd160WithRSA": "da645019e2ca77d29eb1fe5aeaea55c6a8117fe9", + "rmd160": "da645019e2ca77d29eb1fe5aeaea55c6a8117fe9", + "sha": "dd2e300be6148c6a69b1635d82a116c4f84562ff", + "sha1": "a404e21588123e0893718b4b44e91414a785b91f", + "sha1WithRSAEncryption": "a404e21588123e0893718b4b44e91414a785b91f", + "sha224": "c1416e854b41fb4bfb58428e05b2d17f2807c3af1e6054205544446a", + "sha224WithRSAEncryption": "c1416e854b41fb4bfb58428e05b2d17f2807c3af1e6054205544446a", + "sha256": "49640215294d9263bc464538c3c29e42edea637d1427c2f04ebcd828d6fcb480", + "sha256WithRSAEncryption": "49640215294d9263bc464538c3c29e42edea637d1427c2f04ebcd828d6fcb480", + "sha384": "6194c3b9a2fc464a4e26fd3bd7c4ffbcfe8d10919bb5c12d656dee694875f55bc7185d315379fff03547ce0f1b41bc47", + "sha384WithRSAEncryption": "6194c3b9a2fc464a4e26fd3bd7c4ffbcfe8d10919bb5c12d656dee694875f55bc7185d315379fff03547ce0f1b41bc47", + "sha512": "ffa4fc1884d61bb097c2481cbfa1e247498627458b792c0abb37d6923345bbcaf51c9720bd4e81109d54e86f822d6cb8e3786876868a1097dd18a34b1f129892", + "sha512WithRSAEncryption": "ffa4fc1884d61bb097c2481cbfa1e247498627458b792c0abb37d6923345bbcaf51c9720bd4e81109d54e86f822d6cb8e3786876868a1097dd18a34b1f129892", + "shaWithRSAEncryption": "dd2e300be6148c6a69b1635d82a116c4f84562ff", + "ssl2-md5": "e1f45852024724f00ced7935e297983a", + "ssl3-md5": "e1f45852024724f00ced7935e297983a", + "ssl3-sha1": "a404e21588123e0893718b4b44e91414a785b91f", + "whirlpool": "83ba4e16be2f98d7952c47f486c1f7d0e6ed567f359d6899ff9a850624c18b3576b6ed9f4f1618ab8bf1dd75acaf22e484a68886203e397cade9382fda4650a0" + }, + { + "input": "/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////8AAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////wAAAAAAAAAAAAAAAAAAD////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAHwH/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/wAAAAAAAAD////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////+AAAAAAAAAAAAAAAAAAAAD+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAD//////8AAAAAAAAAAAAAAAAAAAH/////////////////AAAAAAAAP+AAAAAAAAAAAAAAAAH//////////+AAAAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAA//////////////////////////////+AAAAAAAAAB////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////gAAAAAAAB//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////gAAAf///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////wAAAAAAAAAAAA//+AAAAAAAAAAAAAAAAAAAAAAAAH//////////AAAAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAAAAD////wAAA/////////////////////////////////+AAAAAAAAAAAAAAAAA///gAAAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAB/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////AAAAAAAAAB/4AAAAAAAAAAAAAAAAAAAAAAf/////////////////+AAAAAAAAAAAAAAAAAAAAAAP///////////////////AAAAAAf/////////8AAAAD///////////////wAAAAAAAAAP///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////+AAAAAAAAAAAAAAAAH/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAf////8f///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////+AAAAAAP///////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/+AAAAAAAAAAAAAAAf///////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAD///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////+AAAAAAAAAAAAAAP//////////////////////////8AAAAAAAAAAAAP/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////AAAAA//////////////////////////////////+AAAAAAAAAAAAA//////////////////////////gAAAAAAAAAAAAAAAAAAAAAAf///////////////////////AP////8A////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////+AAAAA//wAAAAAAAAAAAAAAAAAAAB///////////////gAAAAAAAAAAAAAAAAP/////////////////////+AAAAAAAAAAAAAAAAAAAP///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////4AAAAAAAAD/////////////////////////////8AAAAAAAAAAAAAAAAAAAB//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////gAAAAAAAAAAAf//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////8AAAAAAAAAAAAAAB/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAD////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////AAAAAAAAAAAAAAAAAAAf/////////////////////////+AAAAAAAAAAAAAAD////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////AAAB////////////////////////////////8AAAAAAAAAAAAAAAAAAAAA////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAP/////////////AAAAAAAAAAAf//AAAAAAAAAAAAAAAAAAAAAAAAH////gAAAAAAAAAD//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAB////////wAAAAAAAAAAAAAAAAAAAP//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////+AAAAAAAAAAD/////////8H////////////////////////////////gAAf//////////4AAAAAAAAAAAAAAAAAAAAH///////////////////////////////wAAAAAP////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/4AAA///////////////4AAAGAAf////////////+AAAAAAAAAAAAAAAAAB////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////4AAAAAAAAAAAAAAAAAAAH///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAB////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////wAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAB//4AAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////g/////////////4AAAAAAAAAAAH////4AAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////wAAAAAAAAAAAAAAAAAAAAD/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAB////////8AAAAAH/////AAAAAAAAAAAAAAAAAAAB/////AAAAAAAAAAAAAAD//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA////+AAH///////////gAAAH////+AAAAAAAAAAAAAD////////////////////////////////////AAAAAAAAAAAAAP///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAAAP///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAA///////////////////gAAAAAAAAAAAAAH////////4AAAAAAAAAAAf//////gAAAAAAD///////////wAAAAAAf/////////////AAAAAAAAAAf//////////////////wAAAAAAD/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////4AAAAAAAAAAAAAAAAAAAP////////////////////////////////////gAAAAAAAAAAAAAAAAH/////////////////////AAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAH//////wB////gAAAAD///////////////////wAAAAAAAAAAB+//////////////////////4AAAAAAAAAAAAf//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////+AAAAAAAAAAAD/////////////////////////AAAAAAAAAAAAAAAAAAAAD//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////wAAAAAAAD/wAAAAAAAAAD////////////4AAAAAAAAP/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////4AAAAAAAAAAAAAAAAA////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//wAAAAAAAAAAAAAAAAAAAAAAA//////////////8AAAAAAD///////////////////////////////+AAAAAAAAAAA//////////////////////AAAAAAAAAAAAAAAH//////////////////////8AAAf///////+AAAAAAH/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////wAAAAAAAAAAAAAAAAAAAAAAAAB4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////gAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////gAAAP//////////////////gAAAAAAAAP/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////4AAAAAAAAAAAAAAAAAAAf/////////////////8AAAB//////////////////4AAB////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////+AAAAAAH///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////wP//////////////////8AAAAAAAAAAAAAf//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////8AAAAAAAAH////////////////////////////////////+AAf////////////8AAAAAAAAAAAB/////////////////////////////////////AAAf//8AAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////wAf///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////gAAB//////////////4AAAAAAAAAAAAAH//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////4AAAAAAHAAAAAAAAH//////////////////////////wAAAAAAAAAAAAAAAAAAAAf///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////4AAwAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////+AAAAf///////////////////////+AAAAAAAAAAH/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////AAAAAAAf/////////////////////////////////////wAAAAAAAAAAAAAAAAAB///////////////////////gAAAAAAAAB/////////////////////8AAAAAAAAAf///////////////AAf/////////////8AAAAAAAD///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////8AAAAAAAAAAAAAAAAAAAAAH////////////////////////////gAAAAAA////////////////////8AAAAAAAf///////////////////////j///////////////AAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAD/////gAAAAAAAAAAAA//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////AAAAAAAAAAAAA////////AAAH//////////////////////////////////gAAAAAAP//////AAAAAAAAAAAAAAAAAAAAAD/////////////////////////////wAA/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//wAAAAAAAAAAAAAAAAA///////wAAAAA//////////////////////////////////////AAAAAAAAAAAAH///wAAAAAAAAAAAAAAAAAAAB///////////////////////////4AAAAAAAAAAP///////////////////////////////////4AAAAAAD//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "DSA": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "DSA-SHA": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "DSA-SHA1": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "DSA-SHA1-old": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "RSA-MD4": "4c1006d8e83a3f69846ceb49f7ea37be", + "RSA-MD5": "deac06cde1f6b18a53a2cf0b03998da2", + "RSA-MDC2": "c8b71a4aafcc799ea87dfe476489094d", + "RSA-RIPEMD160": "5ecdd8e5bdec974e050202e0d0d3d46dbf43188b", + "RSA-SHA": "23890d5af03b95b5441f86f466dadb37b40734e4", + "RSA-SHA1": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "RSA-SHA1-2": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "RSA-SHA224": "bcd73ec191bb23ffc5d784fa2fa6fd008a60ce76da9da663d813d31d", + "RSA-SHA256": "ce5cfa5b3b0485805cf5bcc8c24594a6b6fec9249698d317ce20bc84d857eafe", + "RSA-SHA384": "e2f7ac96a493ab7724dbd2a9663228e3e46409a764447f972e39fe65194b2fc045ec19408476f9b7345a185a671c18cd", + "RSA-SHA512": "a2e8bb021193a23df9f3a1778735827121fdc94f80a9b603f650465c8f62feac24044b73cbbfbcc2aa351b45381eba3ac8a878f284fc76a5d8d25ac4934b1dea", + "dsaEncryption": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "dsaWithSHA": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "dsaWithSHA1": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "dss1": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "ecdsa-with-SHA1": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "md4": "4c1006d8e83a3f69846ceb49f7ea37be", + "md4WithRSAEncryption": "4c1006d8e83a3f69846ceb49f7ea37be", + "md5": "deac06cde1f6b18a53a2cf0b03998da2", + "md5WithRSAEncryption": "deac06cde1f6b18a53a2cf0b03998da2", + "mdc2": "c8b71a4aafcc799ea87dfe476489094d", + "mdc2WithRSA": "c8b71a4aafcc799ea87dfe476489094d", + "ripemd": "5ecdd8e5bdec974e050202e0d0d3d46dbf43188b", + "ripemd160": "5ecdd8e5bdec974e050202e0d0d3d46dbf43188b", + "ripemd160WithRSA": "5ecdd8e5bdec974e050202e0d0d3d46dbf43188b", + "rmd160": "5ecdd8e5bdec974e050202e0d0d3d46dbf43188b", + "sha": "23890d5af03b95b5441f86f466dadb37b40734e4", + "sha1": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "sha1WithRSAEncryption": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "sha224": "bcd73ec191bb23ffc5d784fa2fa6fd008a60ce76da9da663d813d31d", + "sha224WithRSAEncryption": "bcd73ec191bb23ffc5d784fa2fa6fd008a60ce76da9da663d813d31d", + "sha256": "ce5cfa5b3b0485805cf5bcc8c24594a6b6fec9249698d317ce20bc84d857eafe", + "sha256WithRSAEncryption": "ce5cfa5b3b0485805cf5bcc8c24594a6b6fec9249698d317ce20bc84d857eafe", + "sha384": "e2f7ac96a493ab7724dbd2a9663228e3e46409a764447f972e39fe65194b2fc045ec19408476f9b7345a185a671c18cd", + "sha384WithRSAEncryption": "e2f7ac96a493ab7724dbd2a9663228e3e46409a764447f972e39fe65194b2fc045ec19408476f9b7345a185a671c18cd", + "sha512": "a2e8bb021193a23df9f3a1778735827121fdc94f80a9b603f650465c8f62feac24044b73cbbfbcc2aa351b45381eba3ac8a878f284fc76a5d8d25ac4934b1dea", + "sha512WithRSAEncryption": "a2e8bb021193a23df9f3a1778735827121fdc94f80a9b603f650465c8f62feac24044b73cbbfbcc2aa351b45381eba3ac8a878f284fc76a5d8d25ac4934b1dea", + "shaWithRSAEncryption": "23890d5af03b95b5441f86f466dadb37b40734e4", + "ssl2-md5": "deac06cde1f6b18a53a2cf0b03998da2", + "ssl3-md5": "deac06cde1f6b18a53a2cf0b03998da2", + "ssl3-sha1": "a1e13bc55bf6dad83cf3aabda3287ad68681ea64", + "whirlpool": "226e877a7a45261746d9650f86e7441556afa97e3bc80d0ebece69b65775de6983031dd1cdd2d4a3bb66b570e315d28fac5654ea909591308685d63951c68910" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////AAAAAAAAAAAAAAAAAAAAAD/////////wAAAAf////+AAAAAAAAAAAAAAAAAAAAAAAAB/////////////////8A////////////////////////////////4AAAAAAAAAAAAAAAAAAAD//////////////////wAAAAAAAAAf////////////////////////4AAAf/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////gAAAAAAAAAAAAAB///AAAAAAAAAP////////////////////////gAAAAAAAAAAAAB//////8AAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////wAAAAAAAAP////////////////////////////////4AAAAAAAAAAAAAB/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//4AAAAAAAAP//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////4AAAAAAAAAAAAAAH/////////////////////////////////////+AAAAD////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAA///////8AAAAAAAAAAAAAAAAAAAAAAAH//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////8AAAAAAAAAAAAAAAAAAAf///////////////////////8AAAAAAAAAAB///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////8AAAAAH////////////AAAAAAAAAAAAAAAAAAAAAAD//////////////////////wAAAAAD//4AAAAAAAAAAAAH////////////////////////////+AAAAAH//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////8AAAAAAAAAAAAAAAH///////+AAAAAAAAAAAD///////////+AAAAAAAAAAAAAAAAAAAAP////////////////////////////////////+AAAAAAAAAAAAH////gAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAA/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////8AAAAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////8AAAAAAAAAAAAAAf///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////8AAAAAD//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////AAAAAAAAf///////////////////////4AAAAAAB/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////4AAAAAAAAAB///////////////gAAAAAAA/////////////////////+AAAAAAAB/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////x///////////////////////4ABwAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAH//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf4AAAAAAAAAAAAAAAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////+AAAAAAAAAAAAAAAAAAAP/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////gAAAAAAAAA//////////////+AAAAAAAAAAAAAAAAAD/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////wAAAAAAAAAAAAH/////////////////////////////////f/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////AAAP//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////AAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////gAAAA//////////////////////wAAAf//8AAAAAAAAAAAAAAAAAAAAAAAf///////////////////+AAAAAAAAAAAAAf////////////////////gAAAAf///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AAAAAAAAAAAAAAAAAAAAAAAD////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////wP/wAAAAAAAAAAAAAAAAAAAAfwAAAAAAAAAAAP/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8AAAAP+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////gAAAAH//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////4AAAAB//////AAAAAAAAAAAAAAA//////////////////////AP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////wAAAAAAAAAH//////////8AAAAAAAAAAAAAAAAAAAAAAAB//////////////8AAAAAAAAAAAD///////////gAAAAAAAAAAAAAAA//////////////gD////////////////////////////////////wAAAf////////////////////////+AAAAAD//////////////////////////////////8AAAAAAAAAAAAAAAAAAB////////////////////////////////8AAAAAAAAAAAH/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////wAAAAAAAAAAAAAAAAH////////////////////////////+AAAAAAAAAAAAAAAA////////////////8H/////////////////////////8AP////////////////////////////gAAAAAAAAAAAAAAB//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAf//////////////4AH///8AAAAAAAAAAAf/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////AAAAAAAAAD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////gP///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAP///////////AAAAAAAAAAAAAB////8AAAAAAAAAAAAAAAB///////////AD//////////////////AB//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////gAAAAAAAAAAAAAAAAAAAGAAAAAAAD/////////////////////+AAAAAAAAAAAAAAAAAAAAAA/////4AAAAAAAAAAAAAAAAAAAAAAAAAAf/wAAAAAAAAAAAAAAAAAAf/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////4D/////+AAAAP///////4AAAAAAAH///wAAAAAAAAD//AAAAAAP//////////////////////////////////+AAAAAAAAA/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAD////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////4AAAAAAAAAAAAAAAAA///////////////4AAAAAAAAAAAH///////////////+AAAA/////8AAAAAAAAP/////////////8AAAAAAAAAAAf/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////4AAAAAAAAAAAAAA///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//8D///////////////////////+AAA////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////w///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////AAAAAAAAAAAAAB/////AAP//////AAAAAAAAAAB///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////gAAAAAAAf///////////////////wAAAAAAAAAAAAf//////////////////////////////g/////////4AAAAAAAAAAAAAAAAAAAAAAP///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////AAAAAAB/////////AAAAAAAAAAAAAAAAAAAAD//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////AAAD/////////////////////gAAAAAAAAAAH///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////AAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////gAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAf////////////////AAAAA/////////+AAAAAAAAH////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////8AAAAAAAB///////4AAAAAAAAAAAAAAAAAf////////////8AAP//wAAAAAAAAAAAAAAAAH////////////4AAAAAAAAAAAAf//////////////////////////AAAAAAP/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////gAAAAAf///////////////+AAAAAAAAAAAAAAAAA/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////4/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////wH//////////////////////AAAAAAAA//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////gAAAAAAAAAAAAAAAAAAAAAAf///////8AAAAAAAAAAAAAAAD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAD///////////////////+AAAAAAB/////////////gAAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////AAAAAAAAAAAAAAAAH///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////P/////////////A///////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAD////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////AAAAAAAAAAA///wAAAAAAAAAAAAB///////////////////gAAAAAAAAAAAAAAAAAAAB//8AAAAAAB8AAAAAAAAAAAAAAAAAAAD////////wAAAAAAAB////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAB/////////////AAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAH////////////////////////////////////+AAAAAAAAAAA=", + "DSA": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "DSA-SHA": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "DSA-SHA1": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "DSA-SHA1-old": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "RSA-MD4": "5367260e23568b1f8fb40a6f382e58fe", + "RSA-MD5": "8371f0970efbc6099c50afbbd4f0e477", + "RSA-MDC2": "6e0a57f6ea16a91ead4103b2855ead96", + "RSA-RIPEMD160": "da680c974e0bbdbfc0c84bd41ce9b16279c82137", + "RSA-SHA": "778750545a291a890f962682ac5faefcb29ba2f4", + "RSA-SHA1": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "RSA-SHA1-2": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "RSA-SHA224": "df927cad220400bb09773ce003cd72a2aaa7c139dffa1b3d66ad12e9", + "RSA-SHA256": "c9ac43870e02c7b36bb1e7ba3ce2e234507c0076f8a77494f268777edf5ebffc", + "RSA-SHA384": "0765ddba824c8fcbf073286ac775a08761a1f52bd153955a66bc46eb9ed6ddce57060dc36f54f146812eaba10a0f1ab4", + "RSA-SHA512": "8223437b80c6b88e5397f138b9831fb3c06db9ea99ac4cc9e49e082b7b648c58a4dab10d089530d08d9afedd0a7facb27331f2ef51879e7c04758f30a1b7e968", + "dsaEncryption": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "dsaWithSHA": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "dsaWithSHA1": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "dss1": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "ecdsa-with-SHA1": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "md4": "5367260e23568b1f8fb40a6f382e58fe", + "md4WithRSAEncryption": "5367260e23568b1f8fb40a6f382e58fe", + "md5": "8371f0970efbc6099c50afbbd4f0e477", + "md5WithRSAEncryption": "8371f0970efbc6099c50afbbd4f0e477", + "mdc2": "6e0a57f6ea16a91ead4103b2855ead96", + "mdc2WithRSA": "6e0a57f6ea16a91ead4103b2855ead96", + "ripemd": "da680c974e0bbdbfc0c84bd41ce9b16279c82137", + "ripemd160": "da680c974e0bbdbfc0c84bd41ce9b16279c82137", + "ripemd160WithRSA": "da680c974e0bbdbfc0c84bd41ce9b16279c82137", + "rmd160": "da680c974e0bbdbfc0c84bd41ce9b16279c82137", + "sha": "778750545a291a890f962682ac5faefcb29ba2f4", + "sha1": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "sha1WithRSAEncryption": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "sha224": "df927cad220400bb09773ce003cd72a2aaa7c139dffa1b3d66ad12e9", + "sha224WithRSAEncryption": "df927cad220400bb09773ce003cd72a2aaa7c139dffa1b3d66ad12e9", + "sha256": "c9ac43870e02c7b36bb1e7ba3ce2e234507c0076f8a77494f268777edf5ebffc", + "sha256WithRSAEncryption": "c9ac43870e02c7b36bb1e7ba3ce2e234507c0076f8a77494f268777edf5ebffc", + "sha384": "0765ddba824c8fcbf073286ac775a08761a1f52bd153955a66bc46eb9ed6ddce57060dc36f54f146812eaba10a0f1ab4", + "sha384WithRSAEncryption": "0765ddba824c8fcbf073286ac775a08761a1f52bd153955a66bc46eb9ed6ddce57060dc36f54f146812eaba10a0f1ab4", + "sha512": "8223437b80c6b88e5397f138b9831fb3c06db9ea99ac4cc9e49e082b7b648c58a4dab10d089530d08d9afedd0a7facb27331f2ef51879e7c04758f30a1b7e968", + "sha512WithRSAEncryption": "8223437b80c6b88e5397f138b9831fb3c06db9ea99ac4cc9e49e082b7b648c58a4dab10d089530d08d9afedd0a7facb27331f2ef51879e7c04758f30a1b7e968", + "shaWithRSAEncryption": "778750545a291a890f962682ac5faefcb29ba2f4", + "ssl2-md5": "8371f0970efbc6099c50afbbd4f0e477", + "ssl3-md5": "8371f0970efbc6099c50afbbd4f0e477", + "ssl3-sha1": "d5fd35ffabed6733c92365929df0fb4cae864d15", + "whirlpool": "17307f31289dcc757292dc2c9f389b3055f0b9c31dcda5a1957eba23fa4bc405dcc57a3569cae0ba52ab15d23cb13b86b4981827aacd918999b68fcab4ef2be1" + }, + { + "input": "/////////gAAAAAAAAAAAAAAAAf8f////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAP//4AAAAAAAAAAAAAAAAD/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////+AAAAAAAAAB/////////////////////////gAAAAAAAAf///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////4AAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////4AAAAAAAAAAAAB////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////AAAB////////////////////////////AAAAAAAAAAA////////////////////////////////gAAAAAAAAAAAAAAAAP//////////////////8AAAAAAAAAAAAAAAAAAAA//////////////////////////Af////4AAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAAAAH///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////4AAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////8AAAAAAAAAAAf////4AAAAAAAAAAAAAAAAAD//////////////8AAAAAAAA/////////////////////////////////////4AAAAAAAAAAAAAD////////4AAAAAAAAAAAAAAAAAAAAD/////////////////////////gAAAAAAD////////////////////////////+AAAAAAH///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAB//wAAAAAH////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAD///////D//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////gAAAAAAAAAAA/gAAAAAAAAAAAAAAAAAAAAAAAB///////+AAAAAAAAAAAAAAAAAAAAAH/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////+AAAAAD/AA/////////////////////////////////AAAAAAAAAAAAAAAH/AAAAAAAAAAH////////////////////////////AAAAAAAAAAAAAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////wAAAAAAAAP/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAB////////////////+AAAAAAAAAAAAAAAAAAAAD///////////////////wAAAAAH//////8AAA///////////////8AAAAAAAAAD/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAD//////////////////AAAAAAAAAAAAAAAAAAAAAAAH///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////gAAAf////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAP/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAP/wAAAAAAAAAAAAA///////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////wAAAAAAAAAAAAAAAAAAB/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAH//////////////////////////+AAAAAAAAAAAAH///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////+AAAA//////////////////////////////////AAAAAAAAAAAAP///////////////////////AAAAAAAAAAAAAAAAAAAAH///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////wAAAAH/AAAAAAAAAAAAAAAAAAAAH//////////////AAAAAAAAAAAAAAD//////////////////////gAAAAAAAAAAAAAAAAf//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////gAAAAAAAH///////////////////////////AAAAAAAAAAAAAAAAAAAP/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////gAAAAAAAAAAP////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////+AAAAAAAAAAAAAAA///////////////////////////////////8AAAAAAAAAAAAAAAAAAD////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////8AAAAAAAAAAAAAAAAP////////////////////////wAAAAAAAAAAAAH////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////+AA//////////////////////////////wAAAAAAAAAAAAAAAAAAAAD//////////////////////4AAAAAAAAAAAAAAAAAAAAAD//////////+AAAAAAAAAP//gAAAAAAAAAAAAAAAAAAAAAf///AAAAAAAAB///////////////////////////////AAAAAAAAAAAAAAAAAAAAP/////wAAAAAAAAAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////AAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////wAAP/////////+AAAAAAAAAAAAAAAAAAP/////////////////////////////4AAA///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////4AAf/////////////+AAA/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////gAAAAAAAAAAAAAAAH/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAA/////////////////////////////////wAAAAAAAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////8AAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAB//4AAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////AAAAAAAAAH/gAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////4AAAAAAAAAAAAAAAAAAP///////////////wAAAAAAAAAAAAAAAAAAAAAAAP/////8AAAAD//8AAAAAAAAAAAAAAAAAAAH///AAAAAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///8AD////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////4AAAH//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////AAAAAAAD/////////////////////////4AAAAAAAAAAA//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAA////////////////4AAAAAAAAAAAAAAAAAB/////////////wAAAAAAAAP////////4AAAAAAH//////gAAAAAAAAAA////wAAAAAAAAAAD//////4AAAAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////gAAAAAAAAAAAAAAAAAAA//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAA/////////////////gAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////wAAAAAAAAAH////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAAAAAAH////////////////////////+AAAAAAAAAAAAAAAAAAB//////////////wAAAAAAAAAAAAAAAAAAAAAAAA/////////////////wAAAAAA+AAAAAAAAAP////////////gAAAAAAAf/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////4AAAAAAAAAAAAAAAAf////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf4AAAAAAAAAAAAAAAAAAAAAH/////////////wAAA/////////////////////////////8AAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAD/////////////////////v///////gAAAAf///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////gAAAAAAAAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/8AAAAAAAAAAAAAAAAAAAAAAAAf///////////////////g//////////////////+AAAAAAH/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAf//////////////////////wAAAAAAAAAAAAAAAAAP/////////////////AAH///////////////8AAf/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////4AAB////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////wP////////////////gAAAAAAAAAAAAD//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////8AAAAAf//////////////////////////////////D//////////8AAAAAAAAAAAB////////////////////////////////////h+AAAAAAAAAAAAAAAAAAAAAAAAAA///////wAf///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAA//////////////////////gP//////////////AAAAAAAAAAAAAf//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////+AAAAAA////////////////////////////////////4AAAAAAAA//////////////////////////AAAAAAAAAAAAAAAAAAAA//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////g//////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////AAAH//////////////////////4AAAAAAAAAAf////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////4AAAAf///////////////////////////////////8AAAAAAAAAAAAAAAAAAf////////////////////AAAAAAAAAD///////////////////+AAAAAAAAH////////////+P/////////////AAAAAAP//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////AAAAAAAAAAAAAAAAAAAAA///////////////////////////AAAAAAB//////////////////AAAAA//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////8AAAAAAAAAAAAAAAAAAAAAAAB////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAH/8AAAAAAAAAA/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////gAAAAAAAAAAH///////4AAA/////////////////////////////////AAAAAH//////gAAAAAAAAAAAAAAAAAAAA/////////////////////////////8D///////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAA/////8AAAD///////////////////////////////////gAAAAAAAAAAB///8AAAAAAAAAAAAAAAAAAH//////////////////////////w==", + "DSA": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "DSA-SHA": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "DSA-SHA1": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "DSA-SHA1-old": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "RSA-MD4": "faeec0007a5d869c8d89993bd90314db", + "RSA-MD5": "985d909280bc20607f4cb4941ae535f2", + "RSA-MDC2": "276277d8aafb5697b182431111493bc3", + "RSA-RIPEMD160": "050a92e0d6488a205e1c51115d3a3d237a0e6a55", + "RSA-SHA": "6409b2ceb7a288470ceb8900c062e9df00c9a291", + "RSA-SHA1": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "RSA-SHA1-2": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "RSA-SHA224": "0b93fdd9f50a13b6a63db259a64e76dad2e1c128884748818c44f401", + "RSA-SHA256": "30eb195e3aad4c288af76c66e26c6096f5f7de1b56b43d638ab7119d73cfd214", + "RSA-SHA384": "2bdd564652442cacde07dd7548791924f0898ae69eaeb4aaee709b5ce7143ca500952e561fdf28e9841f4ec3ccc86e65", + "RSA-SHA512": "5969edd5e6f7413f921bedb46e63077e0456fdbebea85324f7dbc40b21efda8e05de1c9fe32dd42d777e800ca2b502db8ff5d8117b07cca4a431821456309145", + "dsaEncryption": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "dsaWithSHA": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "dsaWithSHA1": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "dss1": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "ecdsa-with-SHA1": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "md4": "faeec0007a5d869c8d89993bd90314db", + "md4WithRSAEncryption": "faeec0007a5d869c8d89993bd90314db", + "md5": "985d909280bc20607f4cb4941ae535f2", + "md5WithRSAEncryption": "985d909280bc20607f4cb4941ae535f2", + "mdc2": "276277d8aafb5697b182431111493bc3", + "mdc2WithRSA": "276277d8aafb5697b182431111493bc3", + "ripemd": "050a92e0d6488a205e1c51115d3a3d237a0e6a55", + "ripemd160": "050a92e0d6488a205e1c51115d3a3d237a0e6a55", + "ripemd160WithRSA": "050a92e0d6488a205e1c51115d3a3d237a0e6a55", + "rmd160": "050a92e0d6488a205e1c51115d3a3d237a0e6a55", + "sha": "6409b2ceb7a288470ceb8900c062e9df00c9a291", + "sha1": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "sha1WithRSAEncryption": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "sha224": "0b93fdd9f50a13b6a63db259a64e76dad2e1c128884748818c44f401", + "sha224WithRSAEncryption": "0b93fdd9f50a13b6a63db259a64e76dad2e1c128884748818c44f401", + "sha256": "30eb195e3aad4c288af76c66e26c6096f5f7de1b56b43d638ab7119d73cfd214", + "sha256WithRSAEncryption": "30eb195e3aad4c288af76c66e26c6096f5f7de1b56b43d638ab7119d73cfd214", + "sha384": "2bdd564652442cacde07dd7548791924f0898ae69eaeb4aaee709b5ce7143ca500952e561fdf28e9841f4ec3ccc86e65", + "sha384WithRSAEncryption": "2bdd564652442cacde07dd7548791924f0898ae69eaeb4aaee709b5ce7143ca500952e561fdf28e9841f4ec3ccc86e65", + "sha512": "5969edd5e6f7413f921bedb46e63077e0456fdbebea85324f7dbc40b21efda8e05de1c9fe32dd42d777e800ca2b502db8ff5d8117b07cca4a431821456309145", + "sha512WithRSAEncryption": "5969edd5e6f7413f921bedb46e63077e0456fdbebea85324f7dbc40b21efda8e05de1c9fe32dd42d777e800ca2b502db8ff5d8117b07cca4a431821456309145", + "shaWithRSAEncryption": "6409b2ceb7a288470ceb8900c062e9df00c9a291", + "ssl2-md5": "985d909280bc20607f4cb4941ae535f2", + "ssl3-md5": "985d909280bc20607f4cb4941ae535f2", + "ssl3-sha1": "c12e9c280ee9c079e0506ff89f9b20536e0a83ef", + "whirlpool": "b437924aadf4ea10bb9700bfbc13a01d2ff589ce92c0a2b93eac3e5208e2467bbad82abf7f557a290b7476d47e50dcc5494630500c1458f5f7ac26cb238e3967" + }, + { + "input": "AAAAAAAAAD//////////////////////////////////8AAf/////////////////AAAAAAAAAAAAAAAAAAAAAAAA//4AAAAAAAAAAAAAAAAAAAAAAAAAA///4AAAAAAAAAAAAAAAAAAAAAAAf////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////wAAAAAAAP/8AAAAAP//////////////////////8AAAAAAAAAAAAAAA//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////+AAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAAAAAAfwAAAAAAAAAAAAAAAAAAD//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf///////////wAAH//////wAAAAAAAAAAAAAAAAAAAAAAAP//////////4AAAAAH////////////////////////gAAAAAAAAAAAAAAAAAAAAAD///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////4AAAAAAAAAAAAAAAAB/////////////////////////+AAAAAAAAAAAAAAAAAAAAB////////////////////////////////////gf//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////+AAAP//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////AAAAP//////////////////////wAAAAAB///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAP//////////////////AAAAAAAAAAAAAAAAAAAAAAAAH/////////+AAAAAAH///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAP/////gAAAAAAAAAAAD/////////////////////4AAAAAAAAAAAAAAAAAAAD//8///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAB///////////////8AAAAAAP///////////gAAAAAAAAAD//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////gH///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////gAAAAAAAAAAAAAAAAAAP/////////////////////////////////////wAAAAAAAAAAAAAAAAAH/////////wAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////+AAAAAAAAAAAAAAAAAB////////////////////////////4AAD/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////+AAAAAH/////4AAAAAAAAD///////////////////////////////////4AP/////+AAAAAAAAAAAAAAAAAAAAAAH///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////+AAAAAAAAAAAAAH//////4AAAAAAAAAAAAAAAAAAAAAP////AAAAAAAAB//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////AAAAAAAAAAAAAAAAAAAAAAAH////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////gAAAAAAAAAAAAAAAAAAAf/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////4AAAAAAAH/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////wAAAAAAAAAAAAf/////8AAAAAAAAAAAAAD////////////////8AAAAAAAAAAAAAAAD//////////////////////////////////AAAAAAD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/8AAAAAAAAAAAAAAAAAAf//////////////////////////////////4AAAP////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/wAAAAAAAAAAAAAAAAAAAA//gf/////////////////////+AAAAAAAAAAAAAAAAAAAAH//////////wAAAAAAAAAAAAAAAAAAAH///8AAAAAAAAAAAAAAAAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAB/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////4AAAAAAAAAAAAAAAAAAAAAH////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////8AAAAAAAAAAAAAAAAAA/////////////////////////////////////4AAAAAAAAAB//////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/gAAf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAf///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////+AAAAP////8AAAAAAAAAAAAA/////////////////////gH/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////gAAAAAAAAH/////////AAAAAAAAAAAAAAAAAAAAAD//////////////4AAAAAAAAA/////////////////////////////////////gAAAAAAAAf//////////////gAAAAAAAAAAAAAP/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///AAAAAAAAAAAAAAAAAAAAAAAAAD///+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAAAAAf////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////8AAAAAAAAAAAAAAD////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAP/AAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////AAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////+AAAAAAAAAAAAAAP//////////////////////////////////////4AAB///////////wAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////+AAAAAAA/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAH////wAAAAAAAAAAAAAAD//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////AAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////gAAAAAAAAAAAAAAAAABgAAAD///////////////////wAAAAAAAAAAAAAAAAAAAB/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAH///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//wAAA////+AAAAAP8AAAAAAAAf8AAAAAA//////////////////////////////////8AAAAAAAAB////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAB///////////////////////////4AAAAAAAAAAAAAAAAAAAAA/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////8AAAAAAAAAAAAAAD////////////8AAAAAAAAAAB//////////////4AAAD///8AAAAAB////////////4AAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////gAAAAAAAAAAAf/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//3//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////AAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAAAf/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///8AAAAAAAAAAH////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////8AAAAAAB//////////////////wAAAAAAAAAAH/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////gAAAAAAAAAAAAAAAAAAAAAA/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////gAAAH///////AAAAAAAAAAAAAAAAAAAB//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////wAAA/////////////////////4AAAAAAAAAAB///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAAAAB////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////+AAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////gAAAAAAAAAAAAAAAAAAAD////////////////////////////gAAAAAAAAAAAAAAAAAAAA//////////////wA/////////+AAAAAAAAH/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////AAAAAAAP///////AAAAAAAAAAAAAAAAAD///////////4AP//////////////////////////////////////8AAAAAAAAAAAAAAAf///////////wAAAAAAAAAAAf/////////////////////////gAAAAD//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////AAAAAf///////////////+AAAAAAAAAAAAAAH//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////8////////////////////AAAAAAP/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAAAAAAA//////AAAAAAAAAAAAAAAA///wAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAP//////////////////8AAAP///////////AAAAAAAAAAAAD/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////+AAAAAAAAAAAAAAAH////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////gAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAH////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////", + "DSA": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "DSA-SHA": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "DSA-SHA1": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "DSA-SHA1-old": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "RSA-MD4": "ee371b11a15e65fa954c04d52fc7bbb3", + "RSA-MD5": "abcdd18a791546544b52c0587dbd6107", + "RSA-MDC2": "9e55a6b73ef57c2c3dd54f0c2f78ac94", + "RSA-RIPEMD160": "719944eb4cb28b2ff52a458570874d9285519307", + "RSA-SHA": "2b8504f3c11c4bc4e2b58423a1c458586bc15d91", + "RSA-SHA1": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "RSA-SHA1-2": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "RSA-SHA224": "bf740e5c90b4ae7347f37731e2d6b31ff7deb4f400da5a5afce7bd99", + "RSA-SHA256": "338225e3b94025d2b327d72ed3d763a66856e1d1ebcb632bc4d8752000ad9966", + "RSA-SHA384": "f43e6d9cbaad24e7325edc031471e7010f561d2abcdf0b7a450cb2ade97f58e9f4c95b84e0f346ed6f1c31a40f64a9f6", + "RSA-SHA512": "7de4de5d39e0f1efc62d9f5343f1b77657281adb46fc189813196eed279ab0cee8a7fa2cb58ebd31f906c11f82418c83f374055cb745c715c5532ac0f62a6899", + "dsaEncryption": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "dsaWithSHA": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "dsaWithSHA1": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "dss1": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "ecdsa-with-SHA1": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "md4": "ee371b11a15e65fa954c04d52fc7bbb3", + "md4WithRSAEncryption": "ee371b11a15e65fa954c04d52fc7bbb3", + "md5": "abcdd18a791546544b52c0587dbd6107", + "md5WithRSAEncryption": "abcdd18a791546544b52c0587dbd6107", + "mdc2": "9e55a6b73ef57c2c3dd54f0c2f78ac94", + "mdc2WithRSA": "9e55a6b73ef57c2c3dd54f0c2f78ac94", + "ripemd": "719944eb4cb28b2ff52a458570874d9285519307", + "ripemd160": "719944eb4cb28b2ff52a458570874d9285519307", + "ripemd160WithRSA": "719944eb4cb28b2ff52a458570874d9285519307", + "rmd160": "719944eb4cb28b2ff52a458570874d9285519307", + "sha": "2b8504f3c11c4bc4e2b58423a1c458586bc15d91", + "sha1": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "sha1WithRSAEncryption": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "sha224": "bf740e5c90b4ae7347f37731e2d6b31ff7deb4f400da5a5afce7bd99", + "sha224WithRSAEncryption": "bf740e5c90b4ae7347f37731e2d6b31ff7deb4f400da5a5afce7bd99", + "sha256": "338225e3b94025d2b327d72ed3d763a66856e1d1ebcb632bc4d8752000ad9966", + "sha256WithRSAEncryption": "338225e3b94025d2b327d72ed3d763a66856e1d1ebcb632bc4d8752000ad9966", + "sha384": "f43e6d9cbaad24e7325edc031471e7010f561d2abcdf0b7a450cb2ade97f58e9f4c95b84e0f346ed6f1c31a40f64a9f6", + "sha384WithRSAEncryption": "f43e6d9cbaad24e7325edc031471e7010f561d2abcdf0b7a450cb2ade97f58e9f4c95b84e0f346ed6f1c31a40f64a9f6", + "sha512": "7de4de5d39e0f1efc62d9f5343f1b77657281adb46fc189813196eed279ab0cee8a7fa2cb58ebd31f906c11f82418c83f374055cb745c715c5532ac0f62a6899", + "sha512WithRSAEncryption": "7de4de5d39e0f1efc62d9f5343f1b77657281adb46fc189813196eed279ab0cee8a7fa2cb58ebd31f906c11f82418c83f374055cb745c715c5532ac0f62a6899", + "shaWithRSAEncryption": "2b8504f3c11c4bc4e2b58423a1c458586bc15d91", + "ssl2-md5": "abcdd18a791546544b52c0587dbd6107", + "ssl3-md5": "abcdd18a791546544b52c0587dbd6107", + "ssl3-sha1": "e22769dc00748a9bbd6c05bbc8e81f2cd1dc4e2d", + "whirlpool": "318397667fa60031670fda823ca44d72b3f855b10c099495bb2362daebb24472948ad0be9f5961b5a444b55a67afbd08759a0965f25f7c9f0bdf180d69ecc6b1" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////AAAAAAAAAAA//gAAAAAAAAAf///////////////AAAAAAAAAAAAAAAAAcAAfAAAAAAAAAAAAAAAAAAB//////gAAA//////////////////////////////wAAAAAAAAAAAAAAAAAAAAf//////////AAAAAAAAAAAAAAAD/////////////////4AAAAAAAAAAAD/////////////////////////////////////AAAAAAf///////AAAAAAAAAAAAAAAAA///////////////////////////////////////4/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAB/AAAAAAAAAAAAAAAB/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////8AAAAAAAAP////////////////////////AAAAAAAD//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//wAAAAAAAAH////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////wAAAAAAAAAAAA///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////+AD///////////////////////////gAAAAAAAAAH///////////////////////////////8AAAAAAAAAAAAAAAAf//////////////////4AAAAAAAAAAAAAAAAAAAB///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfwAAAA//////////////////////////+f////AAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////+AAAD////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////AAAAAAAAAAAAAAB//////////AAAA////////////////+AAAAAAAAAAAAB////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////+AAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAB///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////H///8AAAAAAAAAAAAAAf//////////////////////////+AAAAH/////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////+AAAAAAAAD//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////wAAAAAP///////////////////AAAAAAAAAAAAAAAAAP//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////3//////////AAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////+AAAAAAAAAAAAP////////////////////////////////AD///////////////////////////+AAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAB////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////AAAAAAAAAAAAAAAD///////////////////gAAAAAAAAAAAAAAAAAAB//////AAAAH/4AAAAAAAAAAAAAAAf/////////gAAAB////////////////////////////wAAAAAAAf////////////+AAAAAAAAAAAAAAAAAAf//////////////////////AAH/////////////////////////////////////AAAB////////////////////////////4AAAAAAD/8AAAAAAAAAAAAAAAAAAAAAAAf//////////////////////+AAAAAAAAAAAAAP//////////////////////////gAf///////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////AAAAAAAAAAAAAAAAP//////////////////////////////4AAAAAAAAAAAAAAAAAAAAf//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAA////////////8AAAAAAAAAAAAAAAAAf/////////////////////////4AAAAAAAAAAAAAAAAP//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////+AAAAAAAAAAAAAAAAAAAAAH//////////////////AAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////////gAAAAH////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////wAAAAAAAAAAAAAAAAf////wf///////////////////8AAAAAAAAAAAAAH////////////gAAAAAAAAAAAAAAAAAAAAAD//////////////8AAAAAAAAAf///////////////////////////////4AAAAAAAAAAAAAAAP///////AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////gAAAAAAAAAH//////////////////////////////AAAAAAAAA//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////4f/////////////////////////////+AAAAAAH//////////////////////////////+AAAAAAAAAAAAAAAAAAf///////////////////////////////4AAAAAAAAAAAAAAAAA///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////4AAAA/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAB//////////////4AAAAAAAAAAAAAAAAAAAAAAAf///////////AAAAAAAAAAAAAf////////////////////////////////wAAAAAAAAAAAAAPgAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////+AAAAAAAAAAAAAAAAAAAAAP////////////////////gAAAAAAAAP///////4AAP///////////////////wAAH///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////gAAAf/////////////////8AAAAAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////4AAAAA/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//4AAAAAAAAAP///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/gB/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/wAAAAAAAAAAAAAP/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////AAAAAAAAAAAAAD//////////////8AAAAAAAH////////////////////////wAAAAAAP//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////4AAAAAAAAAAAAA////////////////////////////4AAAAAAAAAAAAAAAf////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////8AAAAAAAAAAAAAA//////////////////////////8AAP///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////+AAAAAAAAAAAB///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////+AAAAAAAAAAAAD////////////////4AAAAAAAAAAAAAAf/////////////////////gAAAH///+B///////////////////8AB///////////4AAAAAAAAAAAAAAAAAAAAAAB/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////wAAAAA///////////////////////////////////4AAAB///////////////////////////////////////gAAAAAAAAAAAH////////////////////////////////+AAAAAAAAAAAAAf////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAAD///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////gAAAAAAAAAAAAAAAAAAAAAAA/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////+AAAAAAAAAAAAAAAAP/////////////////AAAAAAAAAAAAB////////+AAAAAAA///////AAAAAA//////////gAH////////+AAAA////////////////gH/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////+AAAAAAAAAAAAAAAf//////////////////////////////////4AAAAAAAAAAAAP/////////////////+AAAAAAAAAAAAAAAAAAAAAA//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////f//////wAAAAD//////////////////////////////////////gH///4AAAAAAAAAAAAAAD/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////+AAAAAAAAAAAAAAAAAB////////AAAAAAAAAAD///////////////////////////gAAAAAAAAAAAf/////AAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////AAAAAAAAAAAAAAH//////////////////////gAAAAAAAAAAAAAAAf////7////////4AAAAAAAAAAAAP//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////4AAAAAAAAAAAAAP///////////////wAAA////////////////////////////////8AAAAAAAAAAAAAAAAAAAAP////////////4H///////////////////////////gAAAAAAAAB////////////////////wAAAAAAAAAAAAAAB////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////8AAAP//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////8AAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAD/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAP/////////////////////+AAAAAAAAAAAAAAAAH////////////////4D/////////////+AD///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////8P/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////gf//////////////AAAAAAAAAAAAAH//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///4AAP////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAD///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAB/////gA////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAB////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAAAP//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAf/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAAAAAAAAAH////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////wAAAAB//////////////////////////////////wAAAAAAAB/////////////////////////gAAAAAAAAAAAAAAAAAAH///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////gAA/////////////////////8AAAAAAAAAAP///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////wAA///////////////////////////////////gAAAAAAAAAAAAAAAAAD//////////////////4AAAAAAAAAf//////////////////AAAAAAAA///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////4AAAAH/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////4AAAAAAAAAAAAAAAAAAAB/////////////////////////4AAAAAAP///////////////4AAH////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////+AAAAAAAAAAAAAAAAAAAAAAAA////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////4AAAAAAAB//////////////////////////////////8=", + "DSA": "f29835a93475740e888e8c14318f3ca45a3c8606", + "DSA-SHA": "f29835a93475740e888e8c14318f3ca45a3c8606", + "DSA-SHA1": "f29835a93475740e888e8c14318f3ca45a3c8606", + "DSA-SHA1-old": "f29835a93475740e888e8c14318f3ca45a3c8606", + "RSA-MD4": "01290c5e753bc3cf37856977e252440a", + "RSA-MD5": "23e8b5a657c962a3e77979859ae1400e", + "RSA-MDC2": "5808e10f3baf76a813e602f8ab4e2e39", + "RSA-RIPEMD160": "9a3ee1489539e745759f36e8e538190ca521970e", + "RSA-SHA": "1ef9b27cb24a473e6ba223c79d7eb2181e82de62", + "RSA-SHA1": "f29835a93475740e888e8c14318f3ca45a3c8606", + "RSA-SHA1-2": "f29835a93475740e888e8c14318f3ca45a3c8606", + "RSA-SHA224": "056719242001058ac3f5a383be2b69accf06a822ae7f498dcefd883d", + "RSA-SHA256": "69b6cc0729b2d2877d46a08f3c251ae18f043949a33797c3027668b23c969d68", + "RSA-SHA384": "066aea5a8e7a335908571b21f2c22779a6db5e96c8ecc9fedb504bcfe7cbbe22de1819a58b51544ff6674ad5d518466b", + "RSA-SHA512": "a10cacb49c9425b942e716f4640fca68421eafb13aa318b0c80e19b5b30f82b3395f28ce18d7f5865d16a3f61934918d742b4ffda2f34a2999298078e058bb47", + "dsaEncryption": "f29835a93475740e888e8c14318f3ca45a3c8606", + "dsaWithSHA": "f29835a93475740e888e8c14318f3ca45a3c8606", + "dsaWithSHA1": "f29835a93475740e888e8c14318f3ca45a3c8606", + "dss1": "f29835a93475740e888e8c14318f3ca45a3c8606", + "ecdsa-with-SHA1": "f29835a93475740e888e8c14318f3ca45a3c8606", + "md4": "01290c5e753bc3cf37856977e252440a", + "md4WithRSAEncryption": "01290c5e753bc3cf37856977e252440a", + "md5": "23e8b5a657c962a3e77979859ae1400e", + "md5WithRSAEncryption": "23e8b5a657c962a3e77979859ae1400e", + "mdc2": "5808e10f3baf76a813e602f8ab4e2e39", + "mdc2WithRSA": "5808e10f3baf76a813e602f8ab4e2e39", + "ripemd": "9a3ee1489539e745759f36e8e538190ca521970e", + "ripemd160": "9a3ee1489539e745759f36e8e538190ca521970e", + "ripemd160WithRSA": "9a3ee1489539e745759f36e8e538190ca521970e", + "rmd160": "9a3ee1489539e745759f36e8e538190ca521970e", + "sha": "1ef9b27cb24a473e6ba223c79d7eb2181e82de62", + "sha1": "f29835a93475740e888e8c14318f3ca45a3c8606", + "sha1WithRSAEncryption": "f29835a93475740e888e8c14318f3ca45a3c8606", + "sha224": "056719242001058ac3f5a383be2b69accf06a822ae7f498dcefd883d", + "sha224WithRSAEncryption": "056719242001058ac3f5a383be2b69accf06a822ae7f498dcefd883d", + "sha256": "69b6cc0729b2d2877d46a08f3c251ae18f043949a33797c3027668b23c969d68", + "sha256WithRSAEncryption": "69b6cc0729b2d2877d46a08f3c251ae18f043949a33797c3027668b23c969d68", + "sha384": "066aea5a8e7a335908571b21f2c22779a6db5e96c8ecc9fedb504bcfe7cbbe22de1819a58b51544ff6674ad5d518466b", + "sha384WithRSAEncryption": "066aea5a8e7a335908571b21f2c22779a6db5e96c8ecc9fedb504bcfe7cbbe22de1819a58b51544ff6674ad5d518466b", + "sha512": "a10cacb49c9425b942e716f4640fca68421eafb13aa318b0c80e19b5b30f82b3395f28ce18d7f5865d16a3f61934918d742b4ffda2f34a2999298078e058bb47", + "sha512WithRSAEncryption": "a10cacb49c9425b942e716f4640fca68421eafb13aa318b0c80e19b5b30f82b3395f28ce18d7f5865d16a3f61934918d742b4ffda2f34a2999298078e058bb47", + "shaWithRSAEncryption": "1ef9b27cb24a473e6ba223c79d7eb2181e82de62", + "ssl2-md5": "23e8b5a657c962a3e77979859ae1400e", + "ssl3-md5": "23e8b5a657c962a3e77979859ae1400e", + "ssl3-sha1": "f29835a93475740e888e8c14318f3ca45a3c8606", + "whirlpool": "0ed01376f6e9d35c944475650de6e4f2de792f236fdd03ed52ec68d07506aaa3dcd9a969a2d060d0026c04b38e13ba3857fc6021ef0c1443a5da350a2163af4f" + }, + { + "input": "//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////wAAAAAAAP//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///wAAAAAA///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////4AAAf/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wAAAf////////////////AAAAAAAAAAAAAAAAAAAAAAAA/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////4AAAAAAAAAAAAAAAAD/////////////////////8B/////////////////////////AAf//////////////////////gAAAAAAAAAAAAAAAAAAAAAAH////////////////////////8AAAAAAAAAAAAAAAAAAAAAP//////P/////AAAAAAAAAAAAAAAAAAAAAA/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////4AAAAAAAAAAAAAAAf/////////////////+AAAAAAAAf/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////4AAAAAAAAAD//+AAAAD///////////////////////AAAAAAAAAf////4AAAAAAAAAAAAAAAAAAAAAAAH////////////////////8AAAAAD////////////////////////////wAAAAAAAAAf////////////////4AAAAAAAAAAAAAAAAAAAAAAAAf////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////////gAAAAA/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8AAAAAAAAAAAAAAD//////////////////////////////////////AAAP///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAAAAAAAAAD//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAAAP///////////////////////+AAAAAAAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////wAAAAAf///////////8AAAAAAAAAAAAAAAAAAAAB//////////////////P//////////////////////////////////////AAAAAAAAAA////////////////////////+AAAA//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////gAAAAAAAAAAAAAAA/////wAAAAAAAAAAAf////////wAAAAAAAAAAAAAAAAB///////////////////////////////////+AAAAAAAAAH//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////+AAAAAAAAAAAAAAAAAB/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////4AAAAAAAP/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB/AAAAAAAAAAAAA//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//4AAAAAH///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////8AAAAB/////////////////////gH////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////gAAAAAAH///////////+AAAAAAf/////////////////////AA////////gAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////AAP/////////////////////////////////////gAAAAAAAAAAAAAA///////////////////////4AAAAAAAAAAAP/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////+AAAAAAAAAAAAAAAAP/////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAA///////////4AAAP////////////8AAAAAAAAAAAAAAAA//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAP////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////8/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/8AAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////wf//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAH////////////////////gAAAAAAAA///////////////////4AAA//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////gAAAAAAAAAAAAAAA/////////////////////////////////4AAAAf///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAAAAD///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////+B/4A//////////////////////////////4AAAAAB//gAAAAAAAAAAAAAAAAAH//////////////////////////////8AAAAAB///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////AAAAAAAAAAAAAAAAAAAAAAf///AAAAD///////////8AAAAAAAAAAAAAAAAAAAAf4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAB////////4AAAAAAAD///////////////////wAAAAAAAAAAAAAAf//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////4AAAAAAAAAAAAAB//////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////AAP/////////////////////////AAB//////////////////////////////////+AAAAAAAAAAAAAAAAAAA/////////////////////////////+AAAAAAAAAAf/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////AAAAAAAAAAAAAAAAAf////////////////////////////4AAAAAAAAAAAAD/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////8AP/////////////////////////gAAAAAAAAAAAAAP///////////////////////AAAAAAAAAAAAAAAAAAAAAAAf/////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//4AAAAAAAAAAA///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////wAAAAAf////wAAAAAAAAH/////////////////////////////gAAAAAAB//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////wAAAAAAAAAAA/////////////+AAAAD//////////////wAAAAAAAAAAH/////////////////////////////////////AAAAAAAAAAAAAAAAB////////////////////////////////////AAAAAAAAAAAAAAAAAAAAA//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////n/wAAAAAAAAAAAAAAAAA///////////////////gAAAAD//////////////////////////w///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////v//wAH///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////4P/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////AAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////4AAAAAAAAAAAAAA/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////AAAAAAAAAAAAAAAAAAAP////////////wAAAAAAAAAAP/////////+AAAAAAAAAAAAAf///wAA////gAAAAAAAAAAH////////AAAAAH//////////////////////////////////+AAAAB/////////+AAAAAAAAAAAAH////////////////////////////////AA///////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////////AAAAD///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////wAAAB/////////h////////////////////////////////////4AD//////////4AAAAAAAAAAB////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////+AAAAAAAAAAAAAAAAA/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////AAAAAAAAAH//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////+AAAAAAAAAAAAB//gAAAAAP//////////////////4AAAAAAAAAAAAAAAAAf/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///AAAAAAAAAAAAAAAAAAAAAH//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////wAAAAAAAAAAAD//////////////////////////////wAAAAB///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////+AAAAAAAAH///////////////////////////////////+AAAAAAAH/////////////////////////+AAAAAAAAAAAAAAD///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAf/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAAAP//////////////////////////////////////8AAAAAAAAAH////////gAAAAAAAAAAAAAAAAAAAH///////////////////////////////gAAH///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////8AAAAAAAAAAAAAAD//////wAAAAAAA/////////////////8AAAAAAAAAAfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////+AAAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAAAAAAB////8AAf////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAA////4AAAAAAAAAAAAAAAAf///////////+AAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////wAAAAAAAAAAP//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////wAAAAAAAAAAAAAAAAAP////wAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////wAAAAAAAAAAAAAAH/////////////////////AAAA////////////////D////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAAAAD8AAAAAAAAAA//////////8AAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////4AAAAAAf///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////AAAAAAAAAAAAAAAAAAAAD////////////////////////////////////8AAAAAAAf//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////AH//////////////////////////////////////8AAAAAAAAAAP////////////////////////////////////gAAAA///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAD/////////////////////////////w==", + "DSA": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "DSA-SHA": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "DSA-SHA1": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "DSA-SHA1-old": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "RSA-MD4": "24b88bb08f8d3bd3258ed26d9646ad1d", + "RSA-MD5": "cc4fab29cc180ffa888be396ce6aa6f5", + "RSA-MDC2": "a57a80d979e1a3f26c16fb14548c5e97", + "RSA-RIPEMD160": "16cf3ebedba4fc5d1b438f637e82d8a0b6efc576", + "RSA-SHA": "334b16d6cb72e71d8e5e3e7515954a8452d1fa86", + "RSA-SHA1": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "RSA-SHA1-2": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "RSA-SHA224": "0e857791f3be20b2cd79952588ef9ec13fee68e4d765890bf3b76849", + "RSA-SHA256": "3d35c10650a2da8413a2a11b8e7fb891af5da3a9763584caa6cd71bbe68de6ba", + "RSA-SHA384": "0a7583f394bb8ffb43f21c739da337b46cd3907106596fc2f5774f4ee70b58c0a1f7ef979b89da7c65867d6ec6a33110", + "RSA-SHA512": "b39ffcd51b0fdf9095ec7e38467a4aa87917fdda9acac5a95217ec3f378d4a6c5c5e2b643ca97151a0ab370dcc1af9f2e84cbf1c2535778ffbe45fc320b787d0", + "dsaEncryption": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "dsaWithSHA": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "dsaWithSHA1": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "dss1": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "ecdsa-with-SHA1": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "md4": "24b88bb08f8d3bd3258ed26d9646ad1d", + "md4WithRSAEncryption": "24b88bb08f8d3bd3258ed26d9646ad1d", + "md5": "cc4fab29cc180ffa888be396ce6aa6f5", + "md5WithRSAEncryption": "cc4fab29cc180ffa888be396ce6aa6f5", + "mdc2": "a57a80d979e1a3f26c16fb14548c5e97", + "mdc2WithRSA": "a57a80d979e1a3f26c16fb14548c5e97", + "ripemd": "16cf3ebedba4fc5d1b438f637e82d8a0b6efc576", + "ripemd160": "16cf3ebedba4fc5d1b438f637e82d8a0b6efc576", + "ripemd160WithRSA": "16cf3ebedba4fc5d1b438f637e82d8a0b6efc576", + "rmd160": "16cf3ebedba4fc5d1b438f637e82d8a0b6efc576", + "sha": "334b16d6cb72e71d8e5e3e7515954a8452d1fa86", + "sha1": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "sha1WithRSAEncryption": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "sha224": "0e857791f3be20b2cd79952588ef9ec13fee68e4d765890bf3b76849", + "sha224WithRSAEncryption": "0e857791f3be20b2cd79952588ef9ec13fee68e4d765890bf3b76849", + "sha256": "3d35c10650a2da8413a2a11b8e7fb891af5da3a9763584caa6cd71bbe68de6ba", + "sha256WithRSAEncryption": "3d35c10650a2da8413a2a11b8e7fb891af5da3a9763584caa6cd71bbe68de6ba", + "sha384": "0a7583f394bb8ffb43f21c739da337b46cd3907106596fc2f5774f4ee70b58c0a1f7ef979b89da7c65867d6ec6a33110", + "sha384WithRSAEncryption": "0a7583f394bb8ffb43f21c739da337b46cd3907106596fc2f5774f4ee70b58c0a1f7ef979b89da7c65867d6ec6a33110", + "sha512": "b39ffcd51b0fdf9095ec7e38467a4aa87917fdda9acac5a95217ec3f378d4a6c5c5e2b643ca97151a0ab370dcc1af9f2e84cbf1c2535778ffbe45fc320b787d0", + "sha512WithRSAEncryption": "b39ffcd51b0fdf9095ec7e38467a4aa87917fdda9acac5a95217ec3f378d4a6c5c5e2b643ca97151a0ab370dcc1af9f2e84cbf1c2535778ffbe45fc320b787d0", + "shaWithRSAEncryption": "334b16d6cb72e71d8e5e3e7515954a8452d1fa86", + "ssl2-md5": "cc4fab29cc180ffa888be396ce6aa6f5", + "ssl3-md5": "cc4fab29cc180ffa888be396ce6aa6f5", + "ssl3-sha1": "1a1d77c6d0f97c4b620faa90f3f8644408e4b13d", + "whirlpool": "57245b9a657664b4b88bb7ed9609b9c83aa9728af0d3909a13637ad7013b5c94a7c59614414d10b4d05f0d21c5be9ac5287b1f03cec10cb57fb24677f93860ba" + }, + { + "input": "///////////////8AAAAAAAAAAAAAAAAAAAA////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////8AAAAAAAAAAD/gAAAAAAAf/////////////AAAAAAAAAAAAAAAf///////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAH////4D////////////////////////////8AAAAAAAAAAAAAAAAAAH/////////AAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAP////////////////////////////////////8AAAAH//////AAAAAAAAAAAAAAAAA//////////////////////////////////////j////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////////AAAAAAAAAAAAAAH////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////AAAAAAAP///////////////////////wAAAAAD/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAB/8AAAAAAAAf/wAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////8AAAAAAAAAAAD/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////4AAAAAAAAAf///////////////////////////////wAAAAAAAAAAAAAAAf//////////////////4AAAAAAAAAAAAAAAAAAAB/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfwAAAP////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//AAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////+AAP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////AAAAAAAAAAAAAAf////////AAD///////////////gAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////gAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAD///////gAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAAAAAAAAAAAAAAAAAAf//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/8AAAAAAAAAAAAf//////////////////////////+AB///////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////+AAAAAAAAD//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////AAAA/////////////////8AAAAAAAAAAAAAAAAP/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////8AAAAAAAAAAAAAAAAAAAAAAAAf///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////+AAAAAAAAAAP//////////////////////////////8D///////////////////////////gAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAAAH///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////wAAAAAAAAAAAAAD/////////////////+AAAAAAAAAAAAAAAAAAAH/////8AHgAAAAAAAAAAAAAAB/////////+AAAf///////////////////////////AAAAAAAB////////////gAAAAAAAAAAAAAAAAAH/////////////////////8B////////////////////////////////////8AH//////////////////////////gAAAAAAP////////////////////+AAAAAAAAAAAAAAAAAAAAAH////////////wAAAAAAAAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAf/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////+AAAAAAAAAAAAAAAAAAAP//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////+AAAAAAAAAA///////////////////////////wAAAAAAAAAAAA///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////AAB////////////////////////////////4AAAAAAAAAAH///////////////////gAAAAAAAAAAAAAAAD///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////gAAAAIAAAAAAAAAAAAAAAAAAAA/////////////gAAAAAAAAAB//////////////////////wAAAAAAAAAAAAP///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////8AAAAAAD///////////////////////gAAAAAAAAAAAAAAAAAf/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////AAAAAAAAAB//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////+AAAAH/////////////////////////////4AAAAAAAAAAAAAAAAH/////////////////////////////+AAAAAAAAAAAAAAAAAP//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////4AAAA////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAf///////////+AAAAAAAAAAAAAAAAAAAAAAf/////////8AAAAAAAAAAAAB/////////////////////////////////AAAAAAAAAAAAAA////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////+AAAAAAAAAAAAAAAAAAAA///////////////////4AAAAAAD//////4AAP/////////////////wAB//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////+AB/////////////////8AAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAf///4AAA/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH//4AAAAAAAAD//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////+f/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAAAAAAAAAAAP/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////AAAAAAAAAAAAAD/////////////wAAAAAf//////////////////////AAAAAD/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////+AAAAAAAAAAAA///////////////////////////gAAAAAAAAAAAAB////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////wAAAAAAAAAAAAAD/////////////////////////8AAP//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////4AAAAAAAAAAB/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////gAAAAAAAAAAD//////////////4AAAAAAAAAAAAB///////////////////+AAf//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////wf/////////4AAAAAAAAAAAAAAAAAAAAAH////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////8AAD/////////////////////////////////+AAAAf////////////////////////////////////4AAAAAAAAAAAf///////////////////////////////gAAAAAAAAAAAAH///////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAAAP///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/4AAAAAAAAAAAAAAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAA/////////////////AAAAAAAAAAAAf////////gAAAAP//////wAAAAD/////////n//////+AP//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////gAAAAAAAAAAAAH//////////////////////////////////gAAAAAAAAAA/////////////////gAAAAAAAAAAAAAAAAAAAAD/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////3/////wAAAA/////////////////////////////////////+AAAf////////////wAAf//////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////gAAAAAP////////AAAAAAAAAAAAAAAAAAAAAAAAAAf///////////gAAP////////////////////////8AAAAAAAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAAf/////////////+AAAB////////////////////////////////////////AAAAAAAAf////////////AAAAAAD/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////wAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////8AAAAAAAAAAAAAAAAAAA////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////gAAAAAAAAf///////////////////AAAAAAAAAAAAAAAH//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////wAD/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////wAAAAAAAAAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAD///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////8AAP/////////////////////////////4AAAAAAAAAAAAAAAAAAA/////////////////////+AAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////gP/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////8AAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////4H////////////wAAAAAAAAAAAAB//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP+//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////4AAAAAAAAAAAD//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAf//4AP///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAH///gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAf/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAAD//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAf///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//8AAAAAAAAAAAAAAAAAAAAAAf///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////AAAAB////////////////////////////////wAAAAAAAB////////////////////////4AAAAAAAAAAAAAAAAAAf/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAH///////////////gAP///////////////////8AAAAAAAAAAP///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////D/////////////////////////////////4AAAAAAAAAAAAAAAAAA////////////////+AAAAAAAAAH/////////////////AAAAAAAP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////4AAAf////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////4AAAAAAAAAAAAAAAAAAAf///////////////////////4AAAAAAP/////////////4H///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////4AAAAAAAAAAAAAAAAAAAAAAAD///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAA", + "DSA": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "DSA-SHA": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "DSA-SHA1": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "DSA-SHA1-old": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "RSA-MD4": "3c491ded3b8897fb83a7ee2709e57973", + "RSA-MD5": "b553506daedf701ccdc437fbf3e6bbe4", + "RSA-MDC2": "34a4bf7e54e296760a639852b4718530", + "RSA-RIPEMD160": "a4f7e35299c8fd917a18bd605d4d2a4f084d8e24", + "RSA-SHA": "feb46b5daf29b640d24bcbb973fdd473cb0238c4", + "RSA-SHA1": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "RSA-SHA1-2": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "RSA-SHA224": "76fd1c4eb3e5cd1a34e34fbe9311f92a94e83f79d00029659ab37a71", + "RSA-SHA256": "baf3bcf323f3e5b91649eeb5f1be977a8bd91915a66297a22fdb1a906d1a7e53", + "RSA-SHA384": "33d78d3097e653d99711e9e984792d06b767facc45a76271c40682bebaeb2080418af7d334f51d1f8005daec6582f589", + "RSA-SHA512": "44a5845ade0e82bb34b1ada3b7875193515d5c3c19765f11e5e6d990f869adee5be8e9d995b18bd2d9ff5a308dc22d883198a527e6418833fbc715eccf939469", + "dsaEncryption": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "dsaWithSHA": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "dsaWithSHA1": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "dss1": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "ecdsa-with-SHA1": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "md4": "3c491ded3b8897fb83a7ee2709e57973", + "md4WithRSAEncryption": "3c491ded3b8897fb83a7ee2709e57973", + "md5": "b553506daedf701ccdc437fbf3e6bbe4", + "md5WithRSAEncryption": "b553506daedf701ccdc437fbf3e6bbe4", + "mdc2": "34a4bf7e54e296760a639852b4718530", + "mdc2WithRSA": "34a4bf7e54e296760a639852b4718530", + "ripemd": "a4f7e35299c8fd917a18bd605d4d2a4f084d8e24", + "ripemd160": "a4f7e35299c8fd917a18bd605d4d2a4f084d8e24", + "ripemd160WithRSA": "a4f7e35299c8fd917a18bd605d4d2a4f084d8e24", + "rmd160": "a4f7e35299c8fd917a18bd605d4d2a4f084d8e24", + "sha": "feb46b5daf29b640d24bcbb973fdd473cb0238c4", + "sha1": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "sha1WithRSAEncryption": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "sha224": "76fd1c4eb3e5cd1a34e34fbe9311f92a94e83f79d00029659ab37a71", + "sha224WithRSAEncryption": "76fd1c4eb3e5cd1a34e34fbe9311f92a94e83f79d00029659ab37a71", + "sha256": "baf3bcf323f3e5b91649eeb5f1be977a8bd91915a66297a22fdb1a906d1a7e53", + "sha256WithRSAEncryption": "baf3bcf323f3e5b91649eeb5f1be977a8bd91915a66297a22fdb1a906d1a7e53", + "sha384": "33d78d3097e653d99711e9e984792d06b767facc45a76271c40682bebaeb2080418af7d334f51d1f8005daec6582f589", + "sha384WithRSAEncryption": "33d78d3097e653d99711e9e984792d06b767facc45a76271c40682bebaeb2080418af7d334f51d1f8005daec6582f589", + "sha512": "44a5845ade0e82bb34b1ada3b7875193515d5c3c19765f11e5e6d990f869adee5be8e9d995b18bd2d9ff5a308dc22d883198a527e6418833fbc715eccf939469", + "sha512WithRSAEncryption": "44a5845ade0e82bb34b1ada3b7875193515d5c3c19765f11e5e6d990f869adee5be8e9d995b18bd2d9ff5a308dc22d883198a527e6418833fbc715eccf939469", + "shaWithRSAEncryption": "feb46b5daf29b640d24bcbb973fdd473cb0238c4", + "ssl2-md5": "b553506daedf701ccdc437fbf3e6bbe4", + "ssl3-md5": "b553506daedf701ccdc437fbf3e6bbe4", + "ssl3-sha1": "4ec84870e9bdd25f523c6dfb6edd605052ca4eaa", + "whirlpool": "9bb3953536539da2448cb9e4b2821b5671e4340df3f3a864bb760302cea346ab3d14649ec61500edbc6f4430834bcf4107469773884d53315c97fe2da2949685" + }, + { + "input": "////////////////////////////////////4AAAAB////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////wAAAAAAAP///////wAAB/////////////////////////////4AD//////wAAAAAAAAAAAAAAAAAAH/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////8AAAAAAAAAB//h//////////////////////////////wAAAAAAAAAP///gAAAAAAAAAAAAAAD//////////////////////wAAAAAAAD/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAAAAAAAAAAAAA////////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////AAAAAP//////////////////////////////////////8AAAAAP////////////////////AAAAAAAAAAAP///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////gAAAAAAAAAAAAAAAAAB///////4AAAAAAAAAAAAAAAAAAAAH/////////////////////////////////////8AAAAAAAAAAAAAAA////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAB////////AAAf//AAAAAAAAAAAAAAAAAAAAAAD//////+AAAAH//////////////////////+AAAAAAAAAAAAAAAAAAAD////wAAAAAAAAAAAAAAAAAAAAAAAAAA///////+AAAAAAAAAAAAAAAAAf//////////////////////4AAAAAAAAAAAAAAAAAAAAH/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////wAAAAAB///////////////////////////gAAAAAAAAAAAAAAAAAAAD/////////////////AAAAAAAAAAAAAAAAAAAAAAAAH////////4AAAAB///////////////////////////////////+AAAAAAAAAAAAAAAAAAAD/////4AAAAAAAAAAAA////////////////////4AAAAAAAAAAAAAAAD//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////wAAAAAAAAAAAAAAAAAAAAAAf//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAf///////////////AAAA///////////+AAAAAAAD///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////4AAAAAAAAAAAAAAD/////////////////////////////////////8AAAAAAAAAAAAAAAAH/////wAAAAAAAAAAAAAAAAAAAD/////////////////////////gAAAAAAAAAAAAAAH////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////n/////4AAAAAA///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAAAH/////gAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////wAAAAAAB//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAP/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////wAAAAAAAAAAAAAAAAAAAAAAB//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////4AAAAAAAAAAAAAAAAB///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAB//////////////////////////////4AAAH//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////AAAAAAAAAAfwAAAAAAAAAAAA///////////////8AAAAAAAAAAAAA///////////////////////////////8A//////8AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////8AAAAAAAAAAAAAAAAB////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////wAAAAAAAAAAAAAAAAAP///////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAAAAAAAAB//////8AAAAAAAAAAAAAAAAAAH//wAAAAAAAAAAAAAAAAAH//////////////////////////////8AAAAAAAAAAAAAAAAAB/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/+AAAAAAAAAAAAAAAAAAAf////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////8AAAAAAAAAAAAAA/////////////////////////////////4AAAAAAAf/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAZ/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////gf///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////4AAD///8AAAAAAAAAAP///////////////////gH//////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////+AAAAAAAB//////8AAAAAAAAAAAAAAAAAP//////////////gAAAAD//////////////////////////////////gAAAAf////////////+AAAAAAAAAAAAAA/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/AAAAAAAAAAAAAAAAAAAAAAAAAD/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////4AAAAAAAAAAAAAAAAAH///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAH//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////AAAAAAAAAAAAP////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAP/AAAAAAAAAAAAAAAAAAAAAAAAH/////////////AAAAAAAAAAAAAAAAAAAAAAP/////////////////////+AAAAAAAAAAAAA////////////////////////////////////4AH///////////AAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAD////+AAA////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAH////wAAAAAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////wAAAAAAAAAAAAAAAAAAAAAH//////////////////////////+AAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////AAAAAAAAAAAAAAAAAB/////wAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////7//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////8AAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////+AAAAAAAAAAAAA/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////AAAAAAAAAAAAAAAAAAD//////////8AAAAAAAAD/////////4AAAAAAAAAAAH///8A//gAAAAAAAAAf//////wAAB///////////////////////////////////gAAAAf///////gAAAAAAAAAAH////////////////////////////////AP///////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////8AAAAP/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////8AAB///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////7//////////4AAAAAAAAB////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAAAAAAAD////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////wAAAAAAAAB//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////+AAAAAAAAAAAABgAAAA//////////////////4AAAAAAAAAAAAAAAAH//////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///wAAAAAAAAAAAAAAAAAAAAB///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////8AAAAAAAAAAAA////////////////////////////8AAAAH////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////gAAAAAAH///////////////////////////////////+AAAAAH/////////////////////////+AAAAAAAAAAAAAA///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAAAAAAAAAAAAAAAAAH////////////////wAAAAAAAAAD/////////////////////////////////////AAAAAAAAAB////////4AAAAAAAAAAAAAAAAAB/////////////////////////////4AAB///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////AAAAAAAAAAAAA//////AAAAAAAD/////////////////wAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////gAAAAAAAAAA//////////4AAAAAAAAAAAAAAAAAAAAAAAAf///wAB///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAD///4AAAAAAAAAAAAAAAAf/////////+AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////wAAAAAAAAAD////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////+AAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////8AAAAAAAAAAAAAAAD///wAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////8AAAAAAAAAAAAAAf////////////////////AA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////8AAAAAAAAAAAAAAAAAD///////////////////////////////////////AAAAAAAAA////////8AAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////gAAAB///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////8AAAAAAAAAAAAAAAAAAAD////////////////////////////////////AAAAAAB//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////////AAAAAAAAAP//////////////////////////////////+AAAP/////////////////////////////////4AAAAAAAAAAAAAAAAAAD/////////////////////////////////+AAAAAAAAAAAA=", + "DSA": "d689513fed08b80c39b67371959bc4e3fecb0537", + "DSA-SHA": "d689513fed08b80c39b67371959bc4e3fecb0537", + "DSA-SHA1": "d689513fed08b80c39b67371959bc4e3fecb0537", + "DSA-SHA1-old": "d689513fed08b80c39b67371959bc4e3fecb0537", + "RSA-MD4": "bd4efb750199eed40569d4d8b49adfda", + "RSA-MD5": "d707ae093ab94607010ddda09fc8a5a8", + "RSA-MDC2": "e3a74037014b09cc20664d2a74b4a77e", + "RSA-RIPEMD160": "c549972f8411ca63f94e0f9afaac02f2f653bb23", + "RSA-SHA": "60616180caabab8cd7bf7ff33987386971a3229f", + "RSA-SHA1": "d689513fed08b80c39b67371959bc4e3fecb0537", + "RSA-SHA1-2": "d689513fed08b80c39b67371959bc4e3fecb0537", + "RSA-SHA224": "ec608370deede3749f7382238d7830853612b23211320cc5068ff0c9", + "RSA-SHA256": "7fd9b3abc4684e6f8ee591bbac5a36c5060bb09ef7899690416e5300cc14fcd3", + "RSA-SHA384": "bc0710b5f0cca1dedc4748ea82144be5785489a941fa22b5f9e1e25cc3d6656018f9fda2c40db535fd1519c691989c0b", + "RSA-SHA512": "fa3948c29572d0e7c9103e435fc9f298dcd5a68d0e5174a84aaeb58af8564c473d64d8295347ded8fa5c10e02a96a30b26a6fa7435b449b78bb91105ad043ba0", + "dsaEncryption": "d689513fed08b80c39b67371959bc4e3fecb0537", + "dsaWithSHA": "d689513fed08b80c39b67371959bc4e3fecb0537", + "dsaWithSHA1": "d689513fed08b80c39b67371959bc4e3fecb0537", + "dss1": "d689513fed08b80c39b67371959bc4e3fecb0537", + "ecdsa-with-SHA1": "d689513fed08b80c39b67371959bc4e3fecb0537", + "md4": "bd4efb750199eed40569d4d8b49adfda", + "md4WithRSAEncryption": "bd4efb750199eed40569d4d8b49adfda", + "md5": "d707ae093ab94607010ddda09fc8a5a8", + "md5WithRSAEncryption": "d707ae093ab94607010ddda09fc8a5a8", + "mdc2": "e3a74037014b09cc20664d2a74b4a77e", + "mdc2WithRSA": "e3a74037014b09cc20664d2a74b4a77e", + "ripemd": "c549972f8411ca63f94e0f9afaac02f2f653bb23", + "ripemd160": "c549972f8411ca63f94e0f9afaac02f2f653bb23", + "ripemd160WithRSA": "c549972f8411ca63f94e0f9afaac02f2f653bb23", + "rmd160": "c549972f8411ca63f94e0f9afaac02f2f653bb23", + "sha": "60616180caabab8cd7bf7ff33987386971a3229f", + "sha1": "d689513fed08b80c39b67371959bc4e3fecb0537", + "sha1WithRSAEncryption": "d689513fed08b80c39b67371959bc4e3fecb0537", + "sha224": "ec608370deede3749f7382238d7830853612b23211320cc5068ff0c9", + "sha224WithRSAEncryption": "ec608370deede3749f7382238d7830853612b23211320cc5068ff0c9", + "sha256": "7fd9b3abc4684e6f8ee591bbac5a36c5060bb09ef7899690416e5300cc14fcd3", + "sha256WithRSAEncryption": "7fd9b3abc4684e6f8ee591bbac5a36c5060bb09ef7899690416e5300cc14fcd3", + "sha384": "bc0710b5f0cca1dedc4748ea82144be5785489a941fa22b5f9e1e25cc3d6656018f9fda2c40db535fd1519c691989c0b", + "sha384WithRSAEncryption": "bc0710b5f0cca1dedc4748ea82144be5785489a941fa22b5f9e1e25cc3d6656018f9fda2c40db535fd1519c691989c0b", + "sha512": "fa3948c29572d0e7c9103e435fc9f298dcd5a68d0e5174a84aaeb58af8564c473d64d8295347ded8fa5c10e02a96a30b26a6fa7435b449b78bb91105ad043ba0", + "sha512WithRSAEncryption": "fa3948c29572d0e7c9103e435fc9f298dcd5a68d0e5174a84aaeb58af8564c473d64d8295347ded8fa5c10e02a96a30b26a6fa7435b449b78bb91105ad043ba0", + "shaWithRSAEncryption": "60616180caabab8cd7bf7ff33987386971a3229f", + "ssl2-md5": "d707ae093ab94607010ddda09fc8a5a8", + "ssl3-md5": "d707ae093ab94607010ddda09fc8a5a8", + "ssl3-sha1": "d689513fed08b80c39b67371959bc4e3fecb0537", + "whirlpool": "a07180f5c874805b22671b5d076cf9de8c22f144fb3515e3cb5bf9b88d19933333e169fc09a1c5e84ea29debbb3c44795b7170d8b88909595bb5279a2cf49ced" + }, + { + "input": "AAAAAAAAAAAAAAAAAAP//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAD///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAP////////////////////AAAAAAAAAAA+AAAAAB///////////8AAAAAAAAAAAAB///////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////AAAAAAAAAAAAAAAAB////////AAAAAAAAAAAAAAP/////////////gAAAAAAAAAA/////////////////////////////////////wAAB/////AAAAAAAAAAAAAAAAA////////////////////////////////////+P///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////AAAAAAAAAAAAAf////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////wAAAAAP//////////////////////8AAAAD////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAB////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////wAAAAAAAAAAD////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////gAAAAAAAAf///////////////////////////////wAAAAAAAAAAAAAAH//////////////////+AAAAAAAAAAAAAAAAAAAAf///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8AAA////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////gP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////wAAAAAAAAAAAAB///////wD/////////////+AAAAAAAAB////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////+AAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAf/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAB///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////+AAAAAAAAD/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////8AD///////////////wAAAAAAAAAAAAAAAP/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////wAAAAAAAAAAAAAAAAAAAAAB////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////+AAAAAAAAP/////////////////////////////z//////////////////////////4AAAAAAAAAAAAAAAAAAAAAH///////////////////////////////wAAAAAAAAAAAAAAAAAf//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////8AAAAAAAAAAAAD////////////////4AAAAAAAAAAAAAAAAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////////4AAAAAAAAAAAAAAAf/////////gAf//////////////////////////wAAAAAAAf//////////gAAAAAAAAAAAAAAAAAH/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////gAAAAAAP//////////////////////////////////////8AAAAAAAAAAAAAAAAAAAf//////////////////+AAAAAAAAAAAA//////////////////////+AB/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////wAAAAAAAAAAAAA/////////////////////////////+AAAAAAAAAAAAAAAAAAAf////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////AAAAAAAAAAAAAH////////////////////////4AAAAAAAAAAAAAAAAP/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////+AAAAAAAAAAAAAAAAAH//////////////AAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////+AAAAAf/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////wAAAAAAAAAAAAAAB/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////wAAAAAAAAAAAB////////4AAAAAAAAAAAAAAAAAAAAAA///////////AAAAAAB/////////////////////////////4AAAAAAAAAAAAAA//////wAAAAAAAAAAAAAAAAAAAAB/////////////////gAAAAAAAAAH////////////////////////////8AAAAAA/////////gAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////gAB////////////////////////////4AAAAAAAAAAAAAAAf///////////////////////////4AAAAAAAAAAAAAAAAA///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////+AAAAP///////////////////////////gAAAAAAAAAAAAAAAAAAAAB//////////4AAAAAAAAAAAAAAAAAAAAH////////8AAAAAAAAAAAAB/////////////////////////////////AAAAAAAAAAAAAA///////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAAAAAAA//////////////////gAAAAP////+AAD///////////////8AH////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////+AAAAAAAAAAAAAAAAA/////////////////+AAAAAAAAAAAAAAAAAAAf/////////////////////////4AB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////+AAB////////wAAAAAAAAAAAB//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////8P////////////Af////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////wAAAAAAAAAAAD///4AAAAAAAAAAAAAAAAAAAAP///8AAAAAAAAAAAf//////////////////////////4AAAAAAAAAAAAAAAAAAf////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////8AAAAAAAAAAAAAAAAAAAAAAAAAH///////////gAAAAAAAAAAAAAAAAAAA/////////////////////////////wAAAAAAAAAAAAAAAAH//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////AAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////4AAA///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAf/////////wAAAAAAAAAAAAf///////////gAAAAAAAAAAAAAAAAAYAAH/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAD////////////////////////////////////////4AAAAAAAAH////////////////////gAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////AAAAAAAAAAAAAAAAAAAH//////////////////////////////8AAAD///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////AAAAAH////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAAAAAAAAAP//////////+AAAAAAAAB///AAAAAAA////8AAAAAAAAH///////////////////////////////////////gAAAAH///////////////////////////////////////8AAAAAAAAAAAAAf////////////////////////////////////4AAAAAAAAA////////////////////////////+AAAAAAAAAAAAAAAAAAAAP/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAH//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////8AAAAAAAAAAAAAAAH////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////////4AAf//////////3///////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////+AAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAH///////////4/////////////////////////wAAAAAAAAAAAAAAP/////////////+AAAAAAAAAAAAAAAAAAH////////////+AAH///////////////////////////////////////8AAAAAAAf////////////AAAAAA///////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////8AAAAAAAAAAAAAAP////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////wAAAAAAAAAAAAAAAAAP///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////+AAAAAAAAf//////////////////wAAAAAAAAAAAAAAB/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////8D////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////4AAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////D/////////////////////////////+AAAAAAAAAAAAAAAAAP////////////////////4AAAAAAAAAAAAAH///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////j///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////wAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////4H//////////wAAAAAAAAAAAAB//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////+AAAAAAAAAAAA//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAB/gA////////////////wAAAAAAAAAAAAAAAAAAAAAAAf+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAB////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////gAAAAAAAAAAP//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAH//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/8AAAAAAAAAAAAAAAAAAAAf/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////AAAAf/////////////////////////////8AAAAAAAAf///////////////////////gAAAAAAAAAAAAAAAAAf///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAf/////////////4A///////////////////AAAAAAAAAAD//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAH//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////4AAAAAAAAAAAAAAAAAA//////////////+AAAAAAAAAH///////////////8AAAAAAP//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////gAH////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////gAAAAAAAAAAAAAAAAAAf//////////////////////gAAAAAA////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////w==", + "DSA": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "DSA-SHA": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "DSA-SHA1": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "DSA-SHA1-old": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "RSA-MD4": "f724769c83087912ba4787e4438eeb8f", + "RSA-MD5": "76bdae04521ba996636c4dc431040031", + "RSA-MDC2": "1fdc71c78d86a40a07c8de3c3a7fd53a", + "RSA-RIPEMD160": "beb2b4475cec11d662e85143392c8b184fc91336", + "RSA-SHA": "d7faf9fcc564d0b4231d362b9d55623e8b8ce433", + "RSA-SHA1": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "RSA-SHA1-2": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "RSA-SHA224": "c6d7c6c27cba6fe169c940fe8b7fb5f620c24c439164cf217a7b869c", + "RSA-SHA256": "429e454c0cd5d874d7887f8f8def3390a6e54af783c102af6bc3c75c62f3661f", + "RSA-SHA384": "bf5ee19c4f81ffc3ff0a25879dfbf35782f2cde7f493dc44e07aee8f146e35bdb9766943fbdca87b80fc45fd24ed3de5", + "RSA-SHA512": "288a6fa4607292fd3e4ee38d2007863cb11fd4fa5ffa5cc94cfcceefe9bdd1c5fdd092a0f9db45daeff6702b3d7dee5fd81d821e8f84c0ce21c3df1f0e1b58b2", + "dsaEncryption": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "dsaWithSHA": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "dsaWithSHA1": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "dss1": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "ecdsa-with-SHA1": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "md4": "f724769c83087912ba4787e4438eeb8f", + "md4WithRSAEncryption": "f724769c83087912ba4787e4438eeb8f", + "md5": "76bdae04521ba996636c4dc431040031", + "md5WithRSAEncryption": "76bdae04521ba996636c4dc431040031", + "mdc2": "1fdc71c78d86a40a07c8de3c3a7fd53a", + "mdc2WithRSA": "1fdc71c78d86a40a07c8de3c3a7fd53a", + "ripemd": "beb2b4475cec11d662e85143392c8b184fc91336", + "ripemd160": "beb2b4475cec11d662e85143392c8b184fc91336", + "ripemd160WithRSA": "beb2b4475cec11d662e85143392c8b184fc91336", + "rmd160": "beb2b4475cec11d662e85143392c8b184fc91336", + "sha": "d7faf9fcc564d0b4231d362b9d55623e8b8ce433", + "sha1": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "sha1WithRSAEncryption": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "sha224": "c6d7c6c27cba6fe169c940fe8b7fb5f620c24c439164cf217a7b869c", + "sha224WithRSAEncryption": "c6d7c6c27cba6fe169c940fe8b7fb5f620c24c439164cf217a7b869c", + "sha256": "429e454c0cd5d874d7887f8f8def3390a6e54af783c102af6bc3c75c62f3661f", + "sha256WithRSAEncryption": "429e454c0cd5d874d7887f8f8def3390a6e54af783c102af6bc3c75c62f3661f", + "sha384": "bf5ee19c4f81ffc3ff0a25879dfbf35782f2cde7f493dc44e07aee8f146e35bdb9766943fbdca87b80fc45fd24ed3de5", + "sha384WithRSAEncryption": "bf5ee19c4f81ffc3ff0a25879dfbf35782f2cde7f493dc44e07aee8f146e35bdb9766943fbdca87b80fc45fd24ed3de5", + "sha512": "288a6fa4607292fd3e4ee38d2007863cb11fd4fa5ffa5cc94cfcceefe9bdd1c5fdd092a0f9db45daeff6702b3d7dee5fd81d821e8f84c0ce21c3df1f0e1b58b2", + "sha512WithRSAEncryption": "288a6fa4607292fd3e4ee38d2007863cb11fd4fa5ffa5cc94cfcceefe9bdd1c5fdd092a0f9db45daeff6702b3d7dee5fd81d821e8f84c0ce21c3df1f0e1b58b2", + "shaWithRSAEncryption": "d7faf9fcc564d0b4231d362b9d55623e8b8ce433", + "ssl2-md5": "76bdae04521ba996636c4dc431040031", + "ssl3-md5": "76bdae04521ba996636c4dc431040031", + "ssl3-sha1": "c4fed58f209fc3c34ad19f86a6dacadc86c04d33", + "whirlpool": "ae4f5133cd00f7497b5fd4d915a4e14d66b6e042d01a74c2465e312baa4a6c0e1948120529b6cdf94ba9e17af1c767749e6906faaa88c59301170fcacc29fbce" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////AAAP///////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////+AAAAAAH///////4AAA////////////////////////////wf/////+AAAAAAAAAAAAAAAAAAP/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////gAAAAAAAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////+AAAAAAAAAf///AAAAAAAAAAAAAAf////////////////////4AAAAAAAf////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////gAAAAAAAAAAAAAAAAAf///////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAD///////////////////AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////+AAAB/////////////////////////////////////+AAAAAH//////////////////+AAAAAAAAAf/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////AAAAAAAAAAAAAAAAAAD//////8AAAAAAAAAAAAAAAAAAAP////////////////////////////////////gAAAAAAAAAAAAH//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAA//////gAAPgAAAAAAAAAAAAAAAAAAAAAf////wAAAP//////////////////////AAAAAAAAAAAAAAAAAAH//+AAAAAAAAAAAAAAAAAAAAAAAAH/////wAAAAAAAAAAAAAAAAD/////////////////////8AAAAAAAAAAAAAAAAAAAAD////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/+AAAAAAAAAAAAAAAAAAAAAAAAf///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////gAAAAAD/////////////////////////AAAAAAAAAAAAAAAAAAAf///////////////+AAAAAAAAAAAAAAAAAAAAAAAAP///////8AAAAP///////////////////////////////////wAAAAAAAAAAAAAAAAAf/////AAAAAAAAAAAAH///////////////////wAAAAAAAAAAAAAH////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////4AAAAAAAAAAAAAAAAAAAAP//gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////+AAAAAAAAAAAAAAAAAAAA///////////////+AAH///////////wAAAAAB//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////AAAAAAAAAAAAAf/////////////////////////////////////gAAAAAAAAAAAAAAAP///gAAAAAAAAAAAAAAAAAAf//////////////////////8AAAAAAAAAAAAAD////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////8AAAAB/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8AAAAAAAAAAAAAAAAAAP/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAD////wAAAAAAAAA/////AAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////////gAAAAAA///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAf/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////gAAAAAAAAAAAAAAAAAAAAAAD////////+AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////wAAAAAAAAAAAAAAAP/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////gAAAAAAAAAAAAAAAAAAAA////////////////////////////8AD/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////4AAAAAAAAP///////////////////////////////////////4AAAAAAAAAAAH//////////////4AAAAAAAAAAAH/////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///+AAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////+AAAAAAAAAAAAAAAAP//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////+AAAAAAAAAAAAAAAAH///////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////8AAAAAAAAAAAAAAAAAAAAP////gAAAAAAAAAAAAAAAAAP/4AAAAAAAAAAAAAAAAA//////////////////////////////4AAAAAAAAAAAAAAAAAD///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////AAAAAAAAAAAAAAAAAA////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////gAAAAAAAAAAAH///////////////////////////////AAAAAAP/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////wAB///gAAAAAAAAH//////////////////8A/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////wAAAAAAD/////gAAAAAAAAAAAAAAB//////////////8AAAf////////////////////////////////wAAP////////////wAAAAAAAAAAAAAH///////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP////////wAAAAAAAAAAAAAAAAAP//////////////////////////////////8AAAAAAAAAAAAAAAAAAAA//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////+AAAAAAAAAAB///////////////////////////////AAAAAAAAAAAAAAAAAAAAH/gAAAAAAAAAAAAAAAAAAAAAAP////////////gAAAAAAAAAAAAAAAAAAAAf/////////////////////AAAAAAAAAAAAH//////////////////////////////////8A///////////4AAAAAAAAAAAAAAAAAAAAf///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAH////Af///////AAAAAAAAAAAAAAAAAAAAAAAAAD////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAf//////////+AAAAAAAAAAAAAD////4AAAAAAAAAAAAB///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////gAAAAAAAAAAAAAAAAAAAAD//////////////////////////wAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////gAAAAAAAAAAAAAAAD/////gAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////////+AAAAAAAAAAAAA//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////4Af/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////+AAAAAAP////////////////////////////////////////4AAAAAB////////////////////////////////4AAAAAAAAD////////////////////////////////////8AAAAAAAAAAAAAAAAD/////////////////////////wAAAAAAAAAAAAAAB/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH/////////////////4AAAAAAAAH//////4AAAAAAAAD//////////wAAAEAAAAAAAAP/////gD///////////////////////////////////AAAAA//////AAAAAAAAAA////////////////////////////////4f///////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAP////////////////////////////////+AAAAH///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////4AP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////wAAAAAAD////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////8AAAAAAAAAAAAAAf//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////4AAAAAAAAA//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////8AAAAAAAAAAAAD///////////////////////////////////////8AAAf/////////////////AAAAAAAAAAAAAAAAP//////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///gAAAAAAAAAAAAAAAAAAAAD///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAAAAAAB//////////////////////////4AAAD///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////AAAAAA////////////////////////////////////wAAA//////////////////////////wAAAAAAAAAAAAB//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAP/////////////+AAAAAAAAAAAAAAAAAAAAAAP//////////////gAAAAAAAH//////////////////////////////////+AAAAAAAAAD////////wAAAAAAAAAAAAAAAD///////////////////////////wAAD///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////+AAAAAAAAAAB/////gAAAAAAB/////////////////4AAAAAAAP////////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////8AAAAAAAAAB/////////8AAAAAAAAAAAAAAAAAAAAAAAD///gAD////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAH//8AAAAAAAAAAAAAAAAP////////AAAAAAAAAAAAAAAAAAAAAf/////////////////////////////4AAAAAAAAAf//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////////gAAAAAAAAAAAAAf/4AAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////gAAAAAAAAAAAAA////////////////////gAAAAAAAAAAAAAAAf////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAf////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////4AAAAAAf//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////AAAAAAAAAAAAAD//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////8AAAAAAAAAAAAAAAAA//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAA", + "DSA": "051888c6d00029c176de792b84dece2dc1c74b00", + "DSA-SHA": "051888c6d00029c176de792b84dece2dc1c74b00", + "DSA-SHA1": "051888c6d00029c176de792b84dece2dc1c74b00", + "DSA-SHA1-old": "051888c6d00029c176de792b84dece2dc1c74b00", + "RSA-MD4": "16c5141e205c865c6554495c484a536a", + "RSA-MD5": "556c14fd0f3ff7bd6b435bd630e48811", + "RSA-MDC2": "01c793ae56f6b99a4205a447731478d8", + "RSA-RIPEMD160": "1bc1cf2bd525baa1acd2278937a0e08e1c3fabec", + "RSA-SHA": "082f9a24ef0197b6bd90ff5665d7ff43a7fe1cee", + "RSA-SHA1": "051888c6d00029c176de792b84dece2dc1c74b00", + "RSA-SHA1-2": "051888c6d00029c176de792b84dece2dc1c74b00", + "RSA-SHA224": "ec1f0e50f399737240f177cb3c9cd197728b968c5db795e1f85445c5", + "RSA-SHA256": "0987d19048e10b925bcf394dfffcf259fc1a15e403673a80bfd4e7fd4f43cef0", + "RSA-SHA384": "9c4b19d1a92e3eaf50c6340e422b4f6fac535072085c84cccca89a8ed3b6a5c7231674c1fa54bee856dc56e216631e6b", + "RSA-SHA512": "ea2b4ce965af861dc357b045bcdefe1016bde2245dc9b0d13bd330da25fe5fe95b121163139bcc3cc7306c2a3e3f64f42deccade1c216592e6b94ddbca8d9262", + "dsaEncryption": "051888c6d00029c176de792b84dece2dc1c74b00", + "dsaWithSHA": "051888c6d00029c176de792b84dece2dc1c74b00", + "dsaWithSHA1": "051888c6d00029c176de792b84dece2dc1c74b00", + "dss1": "051888c6d00029c176de792b84dece2dc1c74b00", + "ecdsa-with-SHA1": "051888c6d00029c176de792b84dece2dc1c74b00", + "md4": "16c5141e205c865c6554495c484a536a", + "md4WithRSAEncryption": "16c5141e205c865c6554495c484a536a", + "md5": "556c14fd0f3ff7bd6b435bd630e48811", + "md5WithRSAEncryption": "556c14fd0f3ff7bd6b435bd630e48811", + "mdc2": "01c793ae56f6b99a4205a447731478d8", + "mdc2WithRSA": "01c793ae56f6b99a4205a447731478d8", + "ripemd": "1bc1cf2bd525baa1acd2278937a0e08e1c3fabec", + "ripemd160": "1bc1cf2bd525baa1acd2278937a0e08e1c3fabec", + "ripemd160WithRSA": "1bc1cf2bd525baa1acd2278937a0e08e1c3fabec", + "rmd160": "1bc1cf2bd525baa1acd2278937a0e08e1c3fabec", + "sha": "082f9a24ef0197b6bd90ff5665d7ff43a7fe1cee", + "sha1": "051888c6d00029c176de792b84dece2dc1c74b00", + "sha1WithRSAEncryption": "051888c6d00029c176de792b84dece2dc1c74b00", + "sha224": "ec1f0e50f399737240f177cb3c9cd197728b968c5db795e1f85445c5", + "sha224WithRSAEncryption": "ec1f0e50f399737240f177cb3c9cd197728b968c5db795e1f85445c5", + "sha256": "0987d19048e10b925bcf394dfffcf259fc1a15e403673a80bfd4e7fd4f43cef0", + "sha256WithRSAEncryption": "0987d19048e10b925bcf394dfffcf259fc1a15e403673a80bfd4e7fd4f43cef0", + "sha384": "9c4b19d1a92e3eaf50c6340e422b4f6fac535072085c84cccca89a8ed3b6a5c7231674c1fa54bee856dc56e216631e6b", + "sha384WithRSAEncryption": "9c4b19d1a92e3eaf50c6340e422b4f6fac535072085c84cccca89a8ed3b6a5c7231674c1fa54bee856dc56e216631e6b", + "sha512": "ea2b4ce965af861dc357b045bcdefe1016bde2245dc9b0d13bd330da25fe5fe95b121163139bcc3cc7306c2a3e3f64f42deccade1c216592e6b94ddbca8d9262", + "sha512WithRSAEncryption": "ea2b4ce965af861dc357b045bcdefe1016bde2245dc9b0d13bd330da25fe5fe95b121163139bcc3cc7306c2a3e3f64f42deccade1c216592e6b94ddbca8d9262", + "shaWithRSAEncryption": "082f9a24ef0197b6bd90ff5665d7ff43a7fe1cee", + "ssl2-md5": "556c14fd0f3ff7bd6b435bd630e48811", + "ssl3-md5": "556c14fd0f3ff7bd6b435bd630e48811", + "ssl3-sha1": "051888c6d00029c176de792b84dece2dc1c74b00", + "whirlpool": "96458a47a74d17a36b4e6352036a673b020c23a8b145f592d5dca72353a5de81734f8d4f51a1872111526c0daa57b66d0e15e7715db4edbb3c45de5fca30ce57" + }, + { + "input": "AAAAAH///////////////////////////AAAAAH////////////////////////////8AAAAAAAAAAAAAAAAAAAA//////////////////////wAAAAAAAAAAAAAAAAAA///////////f///gAAAAAAAAA///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////g////////////////+AAf/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////gAAAAAA/////////////8AAAAAAAAAAAH/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//gAAA/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////+AAAAAAAAAf////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD////wAAAAAAAAAAAAAAAAAAAAAA///8AAAAAAAAAAAAAAAAAAAAAAB//////////////////////////AAAAAAAAAAAAAAAAAAAP//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////AAAAAAAAAAAAAAAf/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////gAAAAAAAAAAAAAAAAAAH///////////////////+AAAAAAAAAAAAAAAAAB///////////////////////////////////////gP//AAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAH///////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////4AAAAAAAAAAAAAAAAAAAAAAA////////////+AAAAAA////////////+AAAAAAB////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////+D////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAB/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////////8AAAAAAAAf//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////+AAAAAAAAD////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////wAAAAAAAAAAAAA///////////////wAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////H////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////gAAAAAAAAAP/////////////////////////////////////4AAAAAAAAAA////////////////////4AAAAAAAAAAAAAAAD/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAf////////////////////////////////wAAAAAAAAAAAAAAA///////////8AAAAAAAAAAAAAAAf//////////////////+AAAAAA//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////gAAAAAAAAAeAAAAAAAAAAAAAAAAAAAAAAAAAAP///////gAAAAAAAAB//////////////////gAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAH//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////gAAAAAAAAAAAAAAAAB///////////wAAAAAAAAAAAAAAAAAAAAf/gAAAAAAAH////////////////////////////////4AAAAAAAAAAAAAAAAAAAAH///////////////////////////////////4AAAAAAAAAAAAAAAAAAA////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////gAAAAAAD///////////////////////////AAAAAAAAAAAAD///////////gAAAAAAAAAAAAAAAAAAAAAAAH////////////////wB///////////////////////////////gAAAAAAAAB///////////////4AAAAAAAAAAAA///////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////gAAAAP////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAD///////////4AAAAAAf/////////////////////8AAAAAAAAD/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////wAAAAA///////////////////4AAAAAAAAAAAAAAAAf/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAA/////AAAAAAAAH///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAB4AAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////AAAAAAAAAAAAAAAf/////////////////////////////4AAAAAAAAAAH////AAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////+AAAAAAAAH///////////////////gAAAAAAA/////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////4AAAAAAAAAAAAAAAAAAAAB/////////////////wAAAAAAAAAAAAAAAAf//wAAAH//wAAAAAAAAAAAAAP4AAA///////////////////////////////gAAAAAAAAAAAAAAf///////////////////////////////////////gAAAAAAAAAAAAAAAD////////////////gAAAAAAAAAAAAAAAAH/////////////////////////n/////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////4AAH///////wAAAAAAAAAB////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////wAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////AAAAAAAAAAAAAD//////////8AH//////////////////wAAP////////+AAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////4AAAAAAAAA////////////////////////4AAAAAAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////8AAAAAAAAAAAAAA////////////////////////8AAP/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////4AAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////+AAAAAAAAAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////+AAAAAAAAD//////////4AAAAAAAAAAf///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////4AAAAAAAAAAAAAAAAAAB/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////4AAAB/////////////////////////////////gAAAAAAAAAH////////////////////////////+AAAAAAAAAAAAAf////////////////////////wAAAAAAAAAAAAAAAAAAAAAAD/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAAD///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////gAAAAAAAAAAAAAAAAA///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////+AAAAAAAAAAAAAAAAP///////////////AAAAAAAAAAB////////+A///////AAAA////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////AAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////+AAAAAAAAAf////////////////////////////////4AAAAAAP/////////////+AAAAAAAAAAAAAAAAAAAA//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////f//wAAD////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/4AAAAAAAAD///////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////+AAAAAAAAAAAB//AAAAD///////////////////////gAAAAAAAAAAAf///////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAP/////////////AAAAAAAAAAAAAAH////////////////gAAAAAAAAAAAf4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////4AAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////4AAAAAAAP/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////wAAAAAAAAAAH//////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAf//////+AAAAAAAAAAAAAAAAAAP//////////////+AAAAAAAAAAAAAAAA///////////////////////////////4AAAAD/////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////+AAAAAD//////////////8P//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAAAAAAAAAAAAA////////////////////////////////gAAAAAAAAAAAAAAAAAA////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////wAAAAAAAAAAAAAAAAAAAB////////////4AAAAAAAAAAAAAAH//////////////////////////////////////8AAAAAAAB/////////////////////////////////////////8AAAAAAAAAAAAAAAAAB///////////////////////////////gAAAAAAAAAD///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////4AAAAAAAAAD//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////wAAAAAAAAAAAAAAAAAfgAAAAAAAA/////////////4AAAAAAAAAAAAAAAAAAH//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////4AAH///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAAAAAAAAAAAAAAAP/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////+AAAAAAAAAAAAAA///////////////////////////////////gAAAAAAAAAAAAAB//////////wAAAAAAAAAAAAAAAAAAAAAAH//////////////////////gAAAD///////////////////////////////g//////////////////4AAAAAAAAAAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAP//+AAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////+AAAAAAAAAAAAAAAAAAAAAAAf////////////////4AAAAAAAAAAAAAAAAAAAAAD///////////////////////////gAAAAAAAP////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////gAAAAAAAAAAAAfAAAAAAAAAAAAAAAAAD//////////wAAAAAAAAAAAAAD/////////////////////////gAAAAAAAAP//////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////8AAAAAAAAAAAAH/////////gAAAAAAAAAAAAAA//////AAAAAP////////////////////////////////////4AAAAAAAAAAH4AAAAAAAAAAAB////////////////////////////gAAAAAAAAAH////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////+AAAAAAAAAAAAAAAAAAAAAH//////wAAAAAAAAAH//////////////////////////////////////4AAAAAAAAAAAAAAAAH//////////////////////////////////////4AAAAAAAAAAAAAAB////////////////////////AAAAAAAAAAAAAAAAAAAAAAf/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////wAAAAAAAP//+AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAP/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////8=", + "DSA": "1a3540bee05518505827954f58b751c475aeece0", + "DSA-SHA": "1a3540bee05518505827954f58b751c475aeece0", + "DSA-SHA1": "1a3540bee05518505827954f58b751c475aeece0", + "DSA-SHA1-old": "1a3540bee05518505827954f58b751c475aeece0", + "RSA-MD4": "7a1488a3e00d2ed82a5c9b10260f0d8c", + "RSA-MD5": "b500501957d4b8b412ea0102c842dd5e", + "RSA-MDC2": "aae510e80df71a421270d45dfbce6eb2", + "RSA-RIPEMD160": "950bf739968cda4736dc985abaf73169bf02d8a1", + "RSA-SHA": "c416122b67bf261a80fd515376c8cfbe2ba3e858", + "RSA-SHA1": "1a3540bee05518505827954f58b751c475aeece0", + "RSA-SHA1-2": "1a3540bee05518505827954f58b751c475aeece0", + "RSA-SHA224": "ec60937a1fcd8a97ff5a62c6a0b726ab62b818ddbc4c94c2112a9547", + "RSA-SHA256": "fc774a081d9c93d52bb6a8d99a06ccd7bf32a10154d302524b8c5c5dc1b2969f", + "RSA-SHA384": "b3b6070d7f244dd7267037cc56e34495a10e64ed5923a6a0f85c9ad17c742c0a15705f6a964243f321554d4d1022ea55", + "RSA-SHA512": "57cdfebacae17394501dc67e5a12253e18ff29e8fe15bbd716edd28d070674e60d3fa0d6fd2ca574e670f45b3e9baab384b953e7005db7800bfdf825940f62de", + "dsaEncryption": "1a3540bee05518505827954f58b751c475aeece0", + "dsaWithSHA": "1a3540bee05518505827954f58b751c475aeece0", + "dsaWithSHA1": "1a3540bee05518505827954f58b751c475aeece0", + "dss1": "1a3540bee05518505827954f58b751c475aeece0", + "ecdsa-with-SHA1": "1a3540bee05518505827954f58b751c475aeece0", + "md4": "7a1488a3e00d2ed82a5c9b10260f0d8c", + "md4WithRSAEncryption": "7a1488a3e00d2ed82a5c9b10260f0d8c", + "md5": "b500501957d4b8b412ea0102c842dd5e", + "md5WithRSAEncryption": "b500501957d4b8b412ea0102c842dd5e", + "mdc2": "aae510e80df71a421270d45dfbce6eb2", + "mdc2WithRSA": "aae510e80df71a421270d45dfbce6eb2", + "ripemd": "950bf739968cda4736dc985abaf73169bf02d8a1", + "ripemd160": "950bf739968cda4736dc985abaf73169bf02d8a1", + "ripemd160WithRSA": "950bf739968cda4736dc985abaf73169bf02d8a1", + "rmd160": "950bf739968cda4736dc985abaf73169bf02d8a1", + "sha": "c416122b67bf261a80fd515376c8cfbe2ba3e858", + "sha1": "1a3540bee05518505827954f58b751c475aeece0", + "sha1WithRSAEncryption": "1a3540bee05518505827954f58b751c475aeece0", + "sha224": "ec60937a1fcd8a97ff5a62c6a0b726ab62b818ddbc4c94c2112a9547", + "sha224WithRSAEncryption": "ec60937a1fcd8a97ff5a62c6a0b726ab62b818ddbc4c94c2112a9547", + "sha256": "fc774a081d9c93d52bb6a8d99a06ccd7bf32a10154d302524b8c5c5dc1b2969f", + "sha256WithRSAEncryption": "fc774a081d9c93d52bb6a8d99a06ccd7bf32a10154d302524b8c5c5dc1b2969f", + "sha384": "b3b6070d7f244dd7267037cc56e34495a10e64ed5923a6a0f85c9ad17c742c0a15705f6a964243f321554d4d1022ea55", + "sha384WithRSAEncryption": "b3b6070d7f244dd7267037cc56e34495a10e64ed5923a6a0f85c9ad17c742c0a15705f6a964243f321554d4d1022ea55", + "sha512": "57cdfebacae17394501dc67e5a12253e18ff29e8fe15bbd716edd28d070674e60d3fa0d6fd2ca574e670f45b3e9baab384b953e7005db7800bfdf825940f62de", + "sha512WithRSAEncryption": "57cdfebacae17394501dc67e5a12253e18ff29e8fe15bbd716edd28d070674e60d3fa0d6fd2ca574e670f45b3e9baab384b953e7005db7800bfdf825940f62de", + "shaWithRSAEncryption": "c416122b67bf261a80fd515376c8cfbe2ba3e858", + "ssl2-md5": "b500501957d4b8b412ea0102c842dd5e", + "ssl3-md5": "b500501957d4b8b412ea0102c842dd5e", + "ssl3-sha1": "1a3540bee05518505827954f58b751c475aeece0", + "whirlpool": "0f45677e36adec48ee14743fcca5de6647fda49b9ce288b85a65f509c6fc11d99bd4046f227d56cf316fb902cbdb01974d6b66728fb1f0600839eb348af9864b" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAH////////AAAB////////////wAAAAAAAAAAAAAAAAAAA//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////8AAAAAAAAAAAAAAD///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////4AAAAAAAAAAAAAAAAP////////////////////////4AAAAAAAAAAAAAAAAAAAAAf/4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////4AAAAAAAAAAAAAAAAAf//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////8AAAAAAAAB//////////////////4AAAAAD/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////wAAAAAAAAAAAAAAAAAAAAAA//////////////////////////4AAAf//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////wAA///gAAAAAAAAAAAAAAAAAAAAA////////////////+AH/////////////////////8AAA/////////////////wAAAAAAAAAAAAAAAAAAAD////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////gD//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////AAAAAAAAAAAAAAA//////////////////////////////////////wH/////////////////////wAAAAAAAAAAAAAAAAB///////////////////////////////////wAAAAAAAAAAAAAAAAAAAH//////AAAAAAAAAAAAAAAAAAAAAAB/////////////////wAAAAAAAAAAAAAAAf///////////////////////8AAAAAAAf///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////wAAAAAf///////////8AAAAAAAAAAAAAAAAAAD///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////+AAAAAH/////////////////+AB//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////wAAAAAAAAAAAAAAAfgAAAAAAAAAAA////+AAAAAAAAAAAAA/////////////////////////////////+AAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////4AAAAAAAAAAAAAf/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////gH////////////////+AAAAAAAAAAAAAAAAAAAAB////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////AAAAAAAAAAB////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////gAAAAAf//8AAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////B////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////8AAD///////8AAAB/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////4AAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////AAP///////////////////////////////////AAAAAAAAAAH///////////////////////AAAAAAAH///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////AAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////wAAAAAAAAAAAAAAA//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////8AAAAAAAAAAAB/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////4AAAAAAAAAAAAAAAAAAD//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////8AAAAAAAAAAAAAB//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////8AB//////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAP//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////AAAAAAAAAAAAAAAAAAAB////////////////////4AB/////////////////gH////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////wAAAAAAAAAAAAA/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////wAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///+AAAAAAAAAAAAAAAAAAAAAA/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////4A//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////////wAAAAAAAAAAAf////////////////////////////gAAAf//////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////+AAAAAAAAAAAAAAAAAD/wAB///////4AAAAAAAAAAAAAAAAAB/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////+AAAAAAAAAAAAAAAAAAA//////4AAAP////////////4AAAAAAAAAAAAAAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAH/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////f////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////+AAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAAD/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////+AAAAAAAAAAAAAAAAA/////////////////////////////wAAAAAAAAf////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////AD/////////////////////gAAAAAAAAAAAf//////////////////4AAAAAAAAAAAAAAAAAAAAH///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAD//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////wAAA/////////////////////////////////////////gAAAAAAf//////////////////////wAAD////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////8AAAAAAAAAAAP/////////////gAAAA////////////4AAAAAAAAAAD////////////////////////////////+AAAAAAAAAAAAAAH/////////////////////////////gAAAAAAAAAAAAAAAAAA////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAH////////////5///////////////////////////////////4AAAAAAAAAAD//////////////4AAAAA//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////gAAAAAAAAAAAAAAAAAAB//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////AAAAAAAAAAAAAAAAAAAAAAAAB////////////+AAAAAAAAAAAAAAAAAAAB///////////////////////////////////AAAAAAAAAAf////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////8AAAAAAAAAAAAAAAAB//////wAAAB////////gAAAAAAAAf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////////wAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////wAAAAP//+AAAAAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAP//////////////////////////////wAAAA/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////3//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////gAAAA////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4AAAAAAAAAAAAP////+AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////4AAAAAAAAA//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAAAAAAAA//////////////////////////////////////wAf////////////////gAAAAAAAAAAAAAAD//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAAAAAA///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////wAAAAAAAAAAAD///////////////////////+AAAf////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////+AAAAf///////////////////////////////////4D//////////////////////////AAAAAAAAAAAAD/////////////////////////////////gAAAAAAAAAAAAAAAAAAD///////////8AAAAAAAAAAAAAAAAAAAD////////////AAAAAB////////////////////////////////8AAAAAAAAAH////////gAAAAAAAAAAAAA/////////////////////////gAAH///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////8AAAAAAAAf///8AAAAAAAP/////////////////AAAAAAf////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////wAAAAAAAAD////////8AAAAAAAAAAAAAAAAAAAAAAB//4AA//////////////////////////8AAAAAAAAAAAAAAAAAAAAAAP/8AAAAAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAAf/////////////////////////////4AAAAAAAAP///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////4AAAAAAAAAAAAAAAAAAAAB///////////////////////////////////////+AAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////+AAAAAAAAAAAAB///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////wAAAAAAAAAAAAAAAB//////////////////////////////////8AAAAAD///+AAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////3/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////wAAAAAAAAAAAAAAAAAB//////////////////////////////////8AAAAA////////////+AAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////gAAAAAH////////////////////////////////H//////////////////////////////8AAAAAAAAAAAAAAP/////////////////////////////////4AAAAAAAAAD//////////////4AAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////4AAAAH//////////////////////////4AAAH///////////////////////////gAAAAAAAAAAAAAAAAAA/////////////////////wAAAAAAAAAAAAAAAAH//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//gAAAAAAAH/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////g////////////////wD////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAP////////////8AAAAAH////////////8AAAAAAAAAA/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/gAA/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////+AAAAAAAAAf///////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAD///wAAAAAAAAAAAAAAAAAAAAAH//gAAAAAAAAAAAAAAAAAAAAAP/////////////////////////4AAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/w==", + "DSA": "dfa19180359d5a7a38e842f172359caf4208fc05", + "DSA-SHA": "dfa19180359d5a7a38e842f172359caf4208fc05", + "DSA-SHA1": "dfa19180359d5a7a38e842f172359caf4208fc05", + "DSA-SHA1-old": "dfa19180359d5a7a38e842f172359caf4208fc05", + "RSA-MD4": "bb18288e5885fbc98bd2b77acb08b2e3", + "RSA-MD5": "d18506a74c66e4d8537269c10c783923", + "RSA-MDC2": "12f123761e14500ade4faf050e2e8ee0", + "RSA-RIPEMD160": "11d300e4cd2d314f8bd2c3d1b1d6903873b29007", + "RSA-SHA": "26986e3055a0096247d843e73592c9a45802c3c4", + "RSA-SHA1": "dfa19180359d5a7a38e842f172359caf4208fc05", + "RSA-SHA1-2": "dfa19180359d5a7a38e842f172359caf4208fc05", + "RSA-SHA224": "7b0b0d86fab12ccd0bd968b3faa467a5180e8629ba69b7e944b59411", + "RSA-SHA256": "6c6afa35f1aad6301dfde6c4ababe2da47d92033a9a41e84ca6f00e5eb29bc60", + "RSA-SHA384": "8882a0793659d46a41f40688d92989a0b8185cbab4b071e0db7cb6c648d0be14d32ece95be0506e48737d4b2bd814599", + "RSA-SHA512": "ae75a779c9034a0048caebad4983d870ea61fa2fd5adc8f7eb1c6f0bfaadd13685dcca0eaccee903b857893a17edfc6a08226b35e95804303845434d442f7cc7", + "dsaEncryption": "dfa19180359d5a7a38e842f172359caf4208fc05", + "dsaWithSHA": "dfa19180359d5a7a38e842f172359caf4208fc05", + "dsaWithSHA1": "dfa19180359d5a7a38e842f172359caf4208fc05", + "dss1": "dfa19180359d5a7a38e842f172359caf4208fc05", + "ecdsa-with-SHA1": "dfa19180359d5a7a38e842f172359caf4208fc05", + "md4": "bb18288e5885fbc98bd2b77acb08b2e3", + "md4WithRSAEncryption": "bb18288e5885fbc98bd2b77acb08b2e3", + "md5": "d18506a74c66e4d8537269c10c783923", + "md5WithRSAEncryption": "d18506a74c66e4d8537269c10c783923", + "mdc2": "12f123761e14500ade4faf050e2e8ee0", + "mdc2WithRSA": "12f123761e14500ade4faf050e2e8ee0", + "ripemd": "11d300e4cd2d314f8bd2c3d1b1d6903873b29007", + "ripemd160": "11d300e4cd2d314f8bd2c3d1b1d6903873b29007", + "ripemd160WithRSA": "11d300e4cd2d314f8bd2c3d1b1d6903873b29007", + "rmd160": "11d300e4cd2d314f8bd2c3d1b1d6903873b29007", + "sha": "26986e3055a0096247d843e73592c9a45802c3c4", + "sha1": "dfa19180359d5a7a38e842f172359caf4208fc05", + "sha1WithRSAEncryption": "dfa19180359d5a7a38e842f172359caf4208fc05", + "sha224": "7b0b0d86fab12ccd0bd968b3faa467a5180e8629ba69b7e944b59411", + "sha224WithRSAEncryption": "7b0b0d86fab12ccd0bd968b3faa467a5180e8629ba69b7e944b59411", + "sha256": "6c6afa35f1aad6301dfde6c4ababe2da47d92033a9a41e84ca6f00e5eb29bc60", + "sha256WithRSAEncryption": "6c6afa35f1aad6301dfde6c4ababe2da47d92033a9a41e84ca6f00e5eb29bc60", + "sha384": "8882a0793659d46a41f40688d92989a0b8185cbab4b071e0db7cb6c648d0be14d32ece95be0506e48737d4b2bd814599", + "sha384WithRSAEncryption": "8882a0793659d46a41f40688d92989a0b8185cbab4b071e0db7cb6c648d0be14d32ece95be0506e48737d4b2bd814599", + "sha512": "ae75a779c9034a0048caebad4983d870ea61fa2fd5adc8f7eb1c6f0bfaadd13685dcca0eaccee903b857893a17edfc6a08226b35e95804303845434d442f7cc7", + "sha512WithRSAEncryption": "ae75a779c9034a0048caebad4983d870ea61fa2fd5adc8f7eb1c6f0bfaadd13685dcca0eaccee903b857893a17edfc6a08226b35e95804303845434d442f7cc7", + "shaWithRSAEncryption": "26986e3055a0096247d843e73592c9a45802c3c4", + "ssl2-md5": "d18506a74c66e4d8537269c10c783923", + "ssl3-md5": "d18506a74c66e4d8537269c10c783923", + "ssl3-sha1": "dfa19180359d5a7a38e842f172359caf4208fc05", + "whirlpool": "43c64be749df158343bb188bae2d14c35da89a10f83186cca8f64d480420a56da74948eec5f667e18c045a6ec13d0f9b12b5a3dbbf2fec3684bd74f5859b2d65" + }, + { + "input": "////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////4AAAAAAAAAP////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////+AAAAAAAP///////////////////////////////4AAAAAAAAAAAAAf//////////////////4AAAAAAAAAAAAAAAAAAAB///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+AD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAB/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////+AAAAAAAAAAAAAAAAAAAAAAf////////////////////gAAAAAAAAAAAf///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////AAAAH///////+AAAAAAAAAAAAAAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAP//////+AAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////4AAAAAAAAAAAAAAAAAAAD////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////gAAAAAf//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////gAAAAAAAA////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////4AAAAAAAAAAAAAA////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////+AAAAAAAAAAAAAAAAAB////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////wAAAP//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////wAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////8AAAAAAAAAAAAA/////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////AAAAAAAAAA/////////////+AAAAAAAAAAAAAAAAAAAH/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////+AAAAAAAAAAAAAAAH/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////AAAAAAAB///////+AAAAAAAAAAAAAAAAAAf///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////+AAAAAAA////////////////////////////////////wAAAAAAAAAAAAAAP//////////////4AAAAAAAAAAf/////////////////4AH//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////4AAAAAAAAAAf///////////////////////////4AAAAAAAAAAAAAAAAAP/////gAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////gAAAAAAAAf//////////////////////8AAAAAAAAAAAAAAAAHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////4AAAAAAAAAAAAD/////////8AAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////AAAAAP//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////AAAAAAAAAAAAAA/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////4AAAAAAAAAAH///8AAAAAAAAAAAAAAAAAAAAAAf/////8AAAH//////////////////////////gAAAAAAAAAAAAf////AAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAf//////////////////////////+AAAf//////+AAAAAAAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////AAAAAAAAAAAAD///////////////////////4AAAAAAAAAAAAAAAAA///////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////wAAAB//////////////////////////gAAAAAAAAAAAAAAAAP/////4AAAAAAAAAAAAAAAAAH/////8AAAAAAAAAAAAB/////////////////////////////////AAAAAAAAAAAAAA//////////////////////////////////////AAAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAAAA///////////////h//wAAf//////////8/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////wAAAAAAAAAAAAAAf//////////////AAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAP//wAAAAAAP///////wAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////////gAAAAAAAAAAP/////////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAAAAAAH////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////wD//////8AAAAAAAAAAAAAAAAAAAAAAH////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////+AAAAAAAD//////////////////////4AAAAAAD//////////////////AAAAAAAAAAAAAAAAAAAAAAAAB////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////8AAAAAAAAAAAAAA///////////////////////+AAH////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////wAAAAAAAAAAAAAAAAAAAAD//////////////////////////////wAAAAAAAAH/////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////4AAAAAAD////////AAAAAAAAA/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAAAB////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////8AAAA//////////////////////////////+AAAAAAAAAP///////////////////////////AAAAAAAAAAAAAP//////////////////////+AAAAAAAAAAAAAAAAAAAAAH////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAA///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////gAAAAAAAAAAAAAAH4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////AAAAAAAAAAAAAAAAH//////////////wAAAAAAAAAP////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////+AAA///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////+AAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////wAAAAAAf///////////////////////////////8AAAA////////////+AAAAAAAAAAAAAAAAAAAf////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////f8AAf//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP4AAAAAAf////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////AAAAAAAAAH//////////////////////////////////////////AAf/////////////////////AAAAAAAAAAAA/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAD///////////8AAAAAAAAAAAAAAf/////////////wAAAAAAAAAD//////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////wAAAAAAAAAAAAf///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////////AAAAAP////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////4AAAAAAAAAB////////////////////////////////wAAAAAAAAAAAAAAAAAAH//////wAAAAAAAAAAAAAAAAA///////////////4AAAAAAAAAAAAAA/////////////////////////////AAAAP////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////wAAD////////////h////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////AAAAAAAAAAAAAAAAAAAA/////////////////////////////8AAAAAAAAAAAAAAAAAAH//////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////8AAAAAAAAAAAAAAAAAAAP//////////wAAAAAAAAAAAAAH/////////////////////////////////////+AAAAAH/////////////////////////////////////////wAAAAAAAAAAAAAAA/////////////////////////////8AAAAAAAAH//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////4AAAAAAAAAD///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////wAAAAAAAAAAAAAAAAAfgAAAAAH/////////////AAAAAAAAAAAAAAAAAAA//////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////4////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAAAAAAAAAAAAAAAP//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////gAAAAAAAAAAB/////////////////////////////////wAAAAAAAAAAAAAA/////////8AAAAAAAAAAAAAAAAAAAAAAB////////////////////+AB///////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////wAAAAAAAAAAAAAAB/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAf/+AAAAAAAAAAAAAAAAAAAAAAAAAB////////wAAAAAAAAAAAAAAAAAAAAAB////////////////wAAAAAAAAAAAAAAAAAAA/////////////////////////+AAAAAAAA////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////wAAAAAAAAAAD///////////////8AAAAAAAAAAP////////////+AAAAAAAAAAAAAAAAAAAAAAAD///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////8AAAAAAAAAAAAAAAAAAf/////////4AAAAAAAAAf////////////wAAAAH//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////////////////8AAAAAAAAAAAAAAAAAf///////////////////gAAAAAA///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////8AAAAAAAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////gAAAH///////4AAA//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////AAAAAAAAAAAAAAAAAP/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////wAAAA/////////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////wAAAAAAAH///wAAAAAAAAAAAf//////////////////gAAAAAD///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////+AAAAAAAAAAAAAAP//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAH///////////////////////////////////////4AAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////8AP///////////////////////////////////AAAAAD////////////////8AAAAAH///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////wAAAAAAAAAAAAAAAAAA/////+AAAAAAAAAAAAAAAAAf/////////////////////////////////8AAAAAAAAAH///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAH/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAH///////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAH///////////////////////////////////", + "DSA": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "DSA-SHA": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "DSA-SHA1": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "DSA-SHA1-old": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "RSA-MD4": "6b455bef955c34837d0789d2941cae5d", + "RSA-MD5": "c9b4b691f4d88b7d2b4d5b770b05c8bf", + "RSA-MDC2": "cb9ad9a0b753b1e50a4a932b2cecd247", + "RSA-RIPEMD160": "a47e5a0208b894db4582e9998907268f8a69a072", + "RSA-SHA": "b455ab47978a216fc47cd9cffbc78bf69fd23182", + "RSA-SHA1": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "RSA-SHA1-2": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "RSA-SHA224": "bad5ffb737a22625b1fefab26f330668f31d5bb19e2b61787971ea81", + "RSA-SHA256": "1e858dd15069f54478023c4d8518cd5aa814fb15c9eb8df45c44efbb050587ed", + "RSA-SHA384": "8657ce6c69997fa758477e941e087a9ce4128c61281d60f357dc632cbede5d227f2508c2e590b0ba74fd9b3045120f44", + "RSA-SHA512": "9d807978287e8964df204f412628975a29079e0f9e6ea2602b4bcb1b18ebc4a4566197c5ebdec2b6f86c71bc49c8e6423f2dc48f66e14a0595ae89f68713070c", + "dsaEncryption": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "dsaWithSHA": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "dsaWithSHA1": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "dss1": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "ecdsa-with-SHA1": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "md4": "6b455bef955c34837d0789d2941cae5d", + "md4WithRSAEncryption": "6b455bef955c34837d0789d2941cae5d", + "md5": "c9b4b691f4d88b7d2b4d5b770b05c8bf", + "md5WithRSAEncryption": "c9b4b691f4d88b7d2b4d5b770b05c8bf", + "mdc2": "cb9ad9a0b753b1e50a4a932b2cecd247", + "mdc2WithRSA": "cb9ad9a0b753b1e50a4a932b2cecd247", + "ripemd": "a47e5a0208b894db4582e9998907268f8a69a072", + "ripemd160": "a47e5a0208b894db4582e9998907268f8a69a072", + "ripemd160WithRSA": "a47e5a0208b894db4582e9998907268f8a69a072", + "rmd160": "a47e5a0208b894db4582e9998907268f8a69a072", + "sha": "b455ab47978a216fc47cd9cffbc78bf69fd23182", + "sha1": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "sha1WithRSAEncryption": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "sha224": "bad5ffb737a22625b1fefab26f330668f31d5bb19e2b61787971ea81", + "sha224WithRSAEncryption": "bad5ffb737a22625b1fefab26f330668f31d5bb19e2b61787971ea81", + "sha256": "1e858dd15069f54478023c4d8518cd5aa814fb15c9eb8df45c44efbb050587ed", + "sha256WithRSAEncryption": "1e858dd15069f54478023c4d8518cd5aa814fb15c9eb8df45c44efbb050587ed", + "sha384": "8657ce6c69997fa758477e941e087a9ce4128c61281d60f357dc632cbede5d227f2508c2e590b0ba74fd9b3045120f44", + "sha384WithRSAEncryption": "8657ce6c69997fa758477e941e087a9ce4128c61281d60f357dc632cbede5d227f2508c2e590b0ba74fd9b3045120f44", + "sha512": "9d807978287e8964df204f412628975a29079e0f9e6ea2602b4bcb1b18ebc4a4566197c5ebdec2b6f86c71bc49c8e6423f2dc48f66e14a0595ae89f68713070c", + "sha512WithRSAEncryption": "9d807978287e8964df204f412628975a29079e0f9e6ea2602b4bcb1b18ebc4a4566197c5ebdec2b6f86c71bc49c8e6423f2dc48f66e14a0595ae89f68713070c", + "shaWithRSAEncryption": "b455ab47978a216fc47cd9cffbc78bf69fd23182", + "ssl2-md5": "c9b4b691f4d88b7d2b4d5b770b05c8bf", + "ssl3-md5": "c9b4b691f4d88b7d2b4d5b770b05c8bf", + "ssl3-sha1": "7b0fa84ebbcff7d7f4500f73d79660c4a3431b67", + "whirlpool": "a0000c2a8650764b7113a5d9910c8a8cbc7b0ca89fd6634f3639e7a61679110621b1cd79af5fff7cfb6d7c5d2c137100c3312f6021d72389b5aa875b24097fab" + }, + { + "input": "//4AAAAAAAAAAAAAAAAAAAAD///////////////n///////////////////8A/////////////////wAAAAAAAAAAAAAAAAAAP////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////////+//////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////8AAAAAAAAAAAAAAD//////////////////////////////////////H///////////////////wAAAAAAAAAAAAAAB/////////////////////////////////wAAAAAAAAAAAAAAAAAAB//////wAAAAAAAAAAAAAAAAAAAAf///////////////wAAAAAAAAAAAAAAH////////////////////////AAAAAAB///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wAAAAAf///////////8AAAAAAAAAAAAAAAAAA/////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////+AAAAf///////////////4B//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////8AAAAAAAAAAAAAAAH//////////////////////////////////////////wAAAAAAAAAAAf//8AAAAAAAAAAAH////////////////////////////////8AAAD//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////AAAAAAAAAAAAP////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////gAAAAAAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////8AAAAAAAAAB///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////AAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////gAAAAAf/wAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAH////////////////////+AH//////gAAD/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////+AAf//////////////////////////////////gAAAAAAAAP//////////////////////+AAAAAA/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////4AAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////+AAAAAAAAAAAAAH///////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////8AAAAAAAAAAAAAAAAAAAAAAAB////////////////////////////////////////4AAAAAAAAAAP///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////8AAAAAAAAAAAAAAAAB/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////+AAAAAAAAAAAAAP////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////7////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////////wAAAAAAAAAAAAAAAAAB///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////+AAAAAAAAAAAAAAAAAAA////////////////////8////////////////8P///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////4AAAAAAAAAAAAAAAAAAAAAAA/////////////////////////+AAAAAAAAAAAAB/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////+AAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH///////wAAAAAAAAAAAAAAAAAAAAAAAAAAP//8AAAAAAAAAAAAAAAAAAAAAB///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////////wB//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////gAAAAAAAAA////////////////////////////wAAD/////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////wAAAAAAAAAAAAAAAB+AD//////AAAAAAAAAAAAAAAAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////wAAAAAAAAAAAAAAAAAB/////8AAf//////////wAAAAAAAAAAAAAAf/////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////////////gAAAAAAAAAAD/////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////gAAAAAAAAAAAAAAAAAAP///////////////////////4AAAAAAA//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////4AAAAAAAAAAAAAAAAD/////////////////////////////AAAAAAAH///////4AAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////8AP///////////////////4AAAAAAAAAAB/////////////////+AAAAAAAAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////wAAAAAAAAAAB/////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////+AAB///////////////////////////////////////8AAAAAA/////////////////////gAf//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAB/////////////////////gAAAAAAAAAAB/////////////8AAAAH///////////wAAAAAAAAAAH///////////////////////////////wAAAAAAAAAAAAAP///////////////////////////AAAAAAAAAAAAAAAAAAf///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAP///////////P/////////////////////////////////AAAAAAAAAf////////////8AAAAAf/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////AAAAAAAAAAAAAAAAAD////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////gAAAAAAAAAAAAAAAAAAAAAAAP//////////wAAAAAAAAAAAAAAAAAA///////////////////////////////////gAAAAAAAA/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////4AAAAAAAAAAAAAAAA////4AA///////8AAAAAAAP///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////4AAAAAf//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////4AAAAH/AAAAAAA////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////////8AAAAAAAAAAAAAAAAAAAH////////////////////////////4AAAAf//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////gAA////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAB///4AAAAAAAAAAA////gAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////+AAAAAAAAAP//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////AAAAAAAAAAAAA/////////////////////////////////////H///////////////+AAAAAAAAAAAAAAD//////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///4AAAAAAAAAAAAAAAAAAAAA///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////wAAAAAAAAAAAD/////////////////////+AAH//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////+AAB////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////+AAAAAAAAAAAB////////////////////////////////8AAAAAAAAAAAAAAAAAB/////////+AAAAAAAAAAAAAAAAAB//////////gAAA//////////////////////////////+AAAAAAAAAD////////wAAAAAAAAAAAf//////////////////////wAAD///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////+AAAAAAP///gAAAAAAB/////////////////4AAAAP////////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////gAAAAAAAB////////gAAAAAAAAAAAAAAAAAAAAAD/8AAf///////////////////////+AAAAAAAAAAAAAAAAAAAAAAH/gAAAAAAAAAAAAAAAB////AAAAAAAAAAAAAAAAD//////////////////////////////AAAAAAAAf/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////AAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////8AAAAAAAAAf/////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////+AAAAAAAAAAAAf/////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////+AAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAB////////////////////////////////8AAAAP/4AAAAAAAAAAAAAAAAAAAAAP/////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////+AAAAAAAAAAAAAAAAAD/////////////////////////////////+AAAAH///////////8AAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////////AAAAA///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////wAAAAAAAAAAAA//////////////////////////////////gAAAAAAAP////////////gAAAAAAAAAAAAAAAAAAAAAAA/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////gAAAH/////////////////////////+AB/////////////////////////4AAAAAAAAAAAAAAAAP///////////////////wAAAAAAAAAAAAAAH//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAH///////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////4P///////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////wAAAAAAAAAAD////gAAAAAAAAAAAD////////AAAAAAAAA/////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP+AAAAAAAAAAAAAAAAB/////////////////////////////////H/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////+AAAAAAAAAP////////8AAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////+AAf////////////////////8A////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAAAAf///////////////////////////////////////gAAAAAf//////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////////wAAAAAAAAB////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////8AAAAAAB////////////////////////////////AAAAAAAAAAAAAP//////////////////8AAAAAAAAAAAAAAAAAAAA//////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/AH////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAD/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////AAAAAAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAD///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////+AAAP///////8AAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAH///////AAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////AAAAAAAAAAAAAAAAAAAAf////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////////wAAAAP///////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////8=", + "DSA": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "DSA-SHA": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "DSA-SHA1": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "DSA-SHA1-old": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "RSA-MD4": "b8e2ad13fc5522407092524ee012f573", + "RSA-MD5": "ba915c678f944fe5a480364ddc3382a8", + "RSA-MDC2": "05b301c95bfedc219654ce0a7814de86", + "RSA-RIPEMD160": "69758b92225248317720e8b335950b674656d1b1", + "RSA-SHA": "19f36c6c9b5fe53e4b34646851f78fefb35e8cf0", + "RSA-SHA1": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "RSA-SHA1-2": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "RSA-SHA224": "01e2dadeefa45b34cc63e2164f102d0a61f931adb82993a0b99e951c", + "RSA-SHA256": "5d73820315ebd00f0e419a7fe418ff109664add82a68387daffff4239a2c1b23", + "RSA-SHA384": "15c8a1b5e9f63eb92da306b7fbe8db22a3f8266f110ed82ede94f0cb74387665c1ae7159aacdf38510f345f451f49587", + "RSA-SHA512": "2e66fadfa7cba0704d58989e24a63d3bef3138479a205cf6d3cd2884fb84c1bcb0ee7cbb74e64165d86860c3fea48df8fa1c7ebf6c757b7b7b51d75eb4f60e9e", + "dsaEncryption": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "dsaWithSHA": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "dsaWithSHA1": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "dss1": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "ecdsa-with-SHA1": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "md4": "b8e2ad13fc5522407092524ee012f573", + "md4WithRSAEncryption": "b8e2ad13fc5522407092524ee012f573", + "md5": "ba915c678f944fe5a480364ddc3382a8", + "md5WithRSAEncryption": "ba915c678f944fe5a480364ddc3382a8", + "mdc2": "05b301c95bfedc219654ce0a7814de86", + "mdc2WithRSA": "05b301c95bfedc219654ce0a7814de86", + "ripemd": "69758b92225248317720e8b335950b674656d1b1", + "ripemd160": "69758b92225248317720e8b335950b674656d1b1", + "ripemd160WithRSA": "69758b92225248317720e8b335950b674656d1b1", + "rmd160": "69758b92225248317720e8b335950b674656d1b1", + "sha": "19f36c6c9b5fe53e4b34646851f78fefb35e8cf0", + "sha1": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "sha1WithRSAEncryption": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "sha224": "01e2dadeefa45b34cc63e2164f102d0a61f931adb82993a0b99e951c", + "sha224WithRSAEncryption": "01e2dadeefa45b34cc63e2164f102d0a61f931adb82993a0b99e951c", + "sha256": "5d73820315ebd00f0e419a7fe418ff109664add82a68387daffff4239a2c1b23", + "sha256WithRSAEncryption": "5d73820315ebd00f0e419a7fe418ff109664add82a68387daffff4239a2c1b23", + "sha384": "15c8a1b5e9f63eb92da306b7fbe8db22a3f8266f110ed82ede94f0cb74387665c1ae7159aacdf38510f345f451f49587", + "sha384WithRSAEncryption": "15c8a1b5e9f63eb92da306b7fbe8db22a3f8266f110ed82ede94f0cb74387665c1ae7159aacdf38510f345f451f49587", + "sha512": "2e66fadfa7cba0704d58989e24a63d3bef3138479a205cf6d3cd2884fb84c1bcb0ee7cbb74e64165d86860c3fea48df8fa1c7ebf6c757b7b7b51d75eb4f60e9e", + "sha512WithRSAEncryption": "2e66fadfa7cba0704d58989e24a63d3bef3138479a205cf6d3cd2884fb84c1bcb0ee7cbb74e64165d86860c3fea48df8fa1c7ebf6c757b7b7b51d75eb4f60e9e", + "shaWithRSAEncryption": "19f36c6c9b5fe53e4b34646851f78fefb35e8cf0", + "ssl2-md5": "ba915c678f944fe5a480364ddc3382a8", + "ssl3-md5": "ba915c678f944fe5a480364ddc3382a8", + "ssl3-sha1": "9e886081c9acaad0f97b10810d1de6fcdce6b5f4", + "whirlpool": "c4960dee6f76c42875272f71c7a48af330be7dbaa21b6a37cc22ac67ca8b06a703b0bbc5cff1b2219c1e0d648cbf19b12f92cb3b457071304d1a5c0e78df8fcb" + }, + { + "input": "AAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////8AAAAAAAAH///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////4AAAAAAAAAAAAAH///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////+AAAAAAAAAAAAAAAAP///////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////wAB/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////wAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////gAAAAAAAAAAA/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////4AAAAAAAAH////////////wAAAAAAAAAAAAAAAAAAA//////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////wAAAAAAAAAAAAAAA//////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////4AAAAAAAP//////wAAAAAAAAAAAAAAAAAD///////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////wAAAAAAH//////////////////////////////////+AAAAAAAAAAAAAP/////////////AAAAAAAAAAf////////////////AA/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////4AAAAAAAAAf///////////////////////////AAAAAAAAAAAAAAAAAP////gAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////gAAAAAAD//////////////////////8AAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////AAAAAAAAAAAD////////gAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////AAAAAP/////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////4AAAAAAAAAAAAA/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////4AAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAf////gAA/////////////////////////8AAAAAAAAAAAAf///4AAAAAAAAAAAAAAA///////////////wAAAAAAAAAD//////////////////////////+AAf//////wAAAAAAAAAAAAAAAAAAAAB///////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////AAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAAAH//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAP//////wAAAB/////////////////////////8AAAAAAAAAAAAAAAP////AAAAAAAAAAAAAAAAA/////gAAAAAAAAAAAAP////////////////////////////////4AAAAAAAAAAAAAH/////////////////////////////////////AAAAAAAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAH/////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf8AAH/////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////4AAAAAAAAAAAAAP////////////8AAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAA///AAAAAAH//////AAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////////+AAAAAAAAAAH//////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////4AAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////5/////wAAAAAAAAAAAAAAAAAAAAD////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////AAAAAAB/////////////////////8AAAAAP/////////////////gAAAAAAAAAAAAAAAAAAAAAAH//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////+AAAAAAAAAAAAAAf//////////////////////4AAf///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////AAAAAAAAAAAAAAAAAAAAP/////////////////////////////AAAAAAAAD////////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////8AAAAAB//////8AAAAAAAD///////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////wAAAAAAAAAAAAAAAA///////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////wAAAD/////////////////////////////AAAAAAAAA//////////////////////////8AAAAAAAAAAAAA//////////////////////4AAAAAAAAAAAAAAAAAAAAf//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAB///+AAAAAAAf///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////wAAAAAAAAAAAAAf//////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////AAAAAAAAAAAAAAAAH/////////////+AAAAAAAAAP////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////+AAH//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///gAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////8AAAAA////////////////////////////////AAB///////////8AAAAAAAAAAAAAAAAAAH///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////+4AH//////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAH///////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////////////wAAAAAAAP////////////////////////////////////////+H////////////////////wAAAAAAAAAAAP///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAH//////////4AAAAAAAAAAAAAA////////////8AAAAAAAAA//////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////8AAAAAAAAAAAAH///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////wAAAf///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////+AAAAAAAAAD//////////////////////////////8AAAAAAAAAAAAAAAAAP/////8AAAAAAAAAAAAAAAAB///////////////wAAAAAAAAAAAAB///////////////////////////wAAAf///////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////8AH//////////4f//////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////+AAAAAAAAAAAAAAAAAAAB////////////////////////////AAAAAAAAAAAAAAAAAAB/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////4AAAAAAAAAAAAAAAAAAD/////////8AAAAAAAAAAAAAP/////////////////////////////////////gAAAP/////////////////////////////////////////gAAAAAAAAAAAAAP////////////////////////////AAAAAAAB//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////wAAAAAAAAAH//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////gAAAAAAAAAAAAAAAAA/AAAAB/////////////wAAAAAAAAAAAAAAAAAAP/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/gAAAAAAAAAAAAAAAH/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////wAAAAAAAAAH////////////////////////////////AAAAAAAAAAAAAAD////////+AAAAAAAAAAAAAAAAAAAAAAA////////////////////H///////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////AAAAAAAAAAAAAAH///////////////////////////+AAAAAAAAAAAAAAAAAAAAAB//AAAAAAAAAAAAAAAAAAAAAAAAH////////AAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAf////////////////////////AAAAAAAAf///////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAP//////////////////////////////////////////gAAAAAAAAAAAAAAf/////////+AAAAAAAAAAAAB//////////////////////8AAAAAAf///////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////gAAAAAAAA/////////8AAAAAAAAAAAB////4B///////////////////////////////////8AAAAAAAAAP/////////////////////////////////////////AAAAAAAAAAA////////////////////////////wAAAAAD////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////8AAAAAAAAAAAAAAAAAAD//////4AAAAAD////////////////////////////////////AAAAAAAAAAAAAAP//////////////////////////////////////wAAAAAAAAAAAAAAD///////////////////////+AAAAAAAAAAAAAAAAAAAAD/////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//4AAAAAAAH///AAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////+AAAAAAH////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAB///////4AAAP//////////gAAAAAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////8AAAAAAAAAAAAAB////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////AAAAAAAAAAAAAAP////////////////////////4AAAAAAAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////gAAAAAAAAAAAAAAAf///4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////8AAAAAAP//////////////////AAAAAP///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////AAAAAAAAAAAAAAAAAAAAf/////////////////////////8B///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////////7//AAAAAAAAAAAAAAAAAAAAA///////////////gAAAAAAAAAAAAAAAAAAB8AAAAAAAAAAAAAAAAA//////////////////8AAAAAAAAAAAAAAAAAAAAD////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAB//////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////gAAAAAD////////////////////AAAAAAAAAAAAAAAB//////////////+AAAAAAAAAAAAAAAAAAAAAAAAP//////AAA////////////////////////////////////AAAAAAAAAAAAB/////8AAAAAAAAAAAAf/////////////////wAAAAAAAAH///////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///+AAAAAAAAAAAAAAAD+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////gAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH///////////wAAH///////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////8AAAAAAAAAAAAAAAAAAAAAAAA////////////AAAAAAAAf/////////////////////////////////////gAAAAAAAAAAAAAD/////////////////////////////////////////+AAAAAAAAAAAAAAAH//////////////////AAAAAAAAAAD////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////8AH////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////////////wAAAAAAAAAAAAAAD////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////AAAAAAAAAAAAAAAAAAAAA/wAAAAAD///AAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////w==", + "DSA": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "DSA-SHA": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "DSA-SHA1": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "DSA-SHA1-old": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "RSA-MD4": "0d01d9f80397c1e7ff0258311a33c311", + "RSA-MD5": "78134c91a1ffb2e21594daa2c2a932fc", + "RSA-MDC2": "4b0bc331041f19071009843da43f35dd", + "RSA-RIPEMD160": "06c1a4259d6da0adc41ef780499ebb6ff1237537", + "RSA-SHA": "f70c1705f2bcc30066d9c8458c857a550c295cf5", + "RSA-SHA1": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "RSA-SHA1-2": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "RSA-SHA224": "e2d5bf15257be77f3d983906ae6f0d2699aae2db9f2a1d6f73af82ca", + "RSA-SHA256": "f7f4721be31524d014bacf105b06bacc4bdb953bc04d5a048e1fd4ddc395667e", + "RSA-SHA384": "c010e293fa8ce8a7d021b0882a93f36456481b7e4b5d51e31ecc1ec2f658d413bc0f81b8d18e8a642510b4b3ca2d29be", + "RSA-SHA512": "79ade28ad07bfef57f84f8dd5b8fcf05e887e897c3f10ede2a27990720e70487fdaa29d11fb806e4a7d4920f7b015bf7390437396ef28edd3f52afd67d1cb908", + "dsaEncryption": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "dsaWithSHA": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "dsaWithSHA1": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "dss1": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "ecdsa-with-SHA1": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "md4": "0d01d9f80397c1e7ff0258311a33c311", + "md4WithRSAEncryption": "0d01d9f80397c1e7ff0258311a33c311", + "md5": "78134c91a1ffb2e21594daa2c2a932fc", + "md5WithRSAEncryption": "78134c91a1ffb2e21594daa2c2a932fc", + "mdc2": "4b0bc331041f19071009843da43f35dd", + "mdc2WithRSA": "4b0bc331041f19071009843da43f35dd", + "ripemd": "06c1a4259d6da0adc41ef780499ebb6ff1237537", + "ripemd160": "06c1a4259d6da0adc41ef780499ebb6ff1237537", + "ripemd160WithRSA": "06c1a4259d6da0adc41ef780499ebb6ff1237537", + "rmd160": "06c1a4259d6da0adc41ef780499ebb6ff1237537", + "sha": "f70c1705f2bcc30066d9c8458c857a550c295cf5", + "sha1": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "sha1WithRSAEncryption": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "sha224": "e2d5bf15257be77f3d983906ae6f0d2699aae2db9f2a1d6f73af82ca", + "sha224WithRSAEncryption": "e2d5bf15257be77f3d983906ae6f0d2699aae2db9f2a1d6f73af82ca", + "sha256": "f7f4721be31524d014bacf105b06bacc4bdb953bc04d5a048e1fd4ddc395667e", + "sha256WithRSAEncryption": "f7f4721be31524d014bacf105b06bacc4bdb953bc04d5a048e1fd4ddc395667e", + "sha384": "c010e293fa8ce8a7d021b0882a93f36456481b7e4b5d51e31ecc1ec2f658d413bc0f81b8d18e8a642510b4b3ca2d29be", + "sha384WithRSAEncryption": "c010e293fa8ce8a7d021b0882a93f36456481b7e4b5d51e31ecc1ec2f658d413bc0f81b8d18e8a642510b4b3ca2d29be", + "sha512": "79ade28ad07bfef57f84f8dd5b8fcf05e887e897c3f10ede2a27990720e70487fdaa29d11fb806e4a7d4920f7b015bf7390437396ef28edd3f52afd67d1cb908", + "sha512WithRSAEncryption": "79ade28ad07bfef57f84f8dd5b8fcf05e887e897c3f10ede2a27990720e70487fdaa29d11fb806e4a7d4920f7b015bf7390437396ef28edd3f52afd67d1cb908", + "shaWithRSAEncryption": "f70c1705f2bcc30066d9c8458c857a550c295cf5", + "ssl2-md5": "78134c91a1ffb2e21594daa2c2a932fc", + "ssl3-md5": "78134c91a1ffb2e21594daa2c2a932fc", + "ssl3-sha1": "a4d46e4ba0ae4b012f75b1b50d0534d578ae9cb6", + "whirlpool": "c4c495b8dc022d57fc6a50463357354905e80a10e1b975f91abab2631eae95034214c34a5a5ce8cd4412db032278a1bb58be1db9ea6c7ee840e57403910416f4" + }, + { + "input": "AAAAB//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAA//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////AAAAAAAAAAAAAAAAAAAAAAAH////8AAAAAAAAAAAAAAAAAAAD//////////////////////////////gAAAAAAAAAAAf/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////gAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////AAAAAAAAAAAAAAAAB//////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////AAAAB//////////////////////////////////AAAAAAAAAA/////////////AAAAAAAA//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////////AAAAAAAAAAAAAAAAAAA/////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAAAAAAAAAH//////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////AAAAAAAAAAAAD/////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////+AAAAAAAAAAAAAAAAAAAAH//////////////////////////////////////////AAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAB////////////////////////////wAAAAAAAAAAAAAAAAAH/////////////////////4AAAAAAAAAAAAAAAAAAAAAAAB////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////+AAAAAAAAAAAAAB////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////AAAAAAP////////////////////////+AAf/////////////////////wAAAAAAAAAAAAAAAAAH////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////4AAAAAAAAAAAAAAAAAAAAAAAAAAAP//gAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////+P8AAAAA/////////////////gH////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////////+AAAAAf8AAAAAAAAAP//////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////gAAAAAAAAAAAAAP/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////wAAAAAAAAAAAAAAAAAAAAAAH//////4AAAAAAAAAAAAAAAAAH////////////////////////////////+AAAAAAAAAAAAAAAAAAf//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA/////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////AAAAAAA/////////////////////////gAAAAAAAAAAAAAAAD/wAAAAAAAAAAAAAAAAAAH//////////wAAAAAAAAAAAAAAAAP///////////////////gAAAAAAAAAD//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////wAAAAAAAAAAAAAAAA//////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAP/+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////4AAAAAAAAAAAAAAAAAAAfgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////+AAAAAAAAAAAAAAAAAAAAD///////////wAAAAAAAAAAAAAf////AAAAAAAAAAAP//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////+AAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////8AAAAAAAAAAAAAAAAAAAf///////////////////////+AAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////8AAAAAAAAAAAAf////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////////wAAAAAAAAH///////////////8AAAAAAAAAAAAAAAAAAAAAAD/////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////AAAAH////////////////////////////////////////8AAAAAA//////////////////////////////8AAAAAAAAB////////////////////////////////////+AAAAAAAAAAAAB///////////////////////4AAAAAAAAA/////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////8AAAAAAAAAAAAAAAAAAAAD///////////////8AAD8AAAAAAB//////4AAAD///////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///+AD//////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////gAAAAAf///////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////+AAAAAAAAAAAAAAAAAAAf//////////////////////////8AAAAP/////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////4B////////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAD//+AAAAAAAAAAP//4AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////8AAAAAAAAAf//////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////gAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////+AAAAAAAAAAAAB///////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////+AAAAAAAAAAAAAAf/////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///AAAAAAAAAAAAAAAAAAAAAH//////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////wAAAAAAAAAAAD////////////////////wAH////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////+AB////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////////////////+AAAAAAAAAAAP///////////////////////////////8AAAAAAAAAAAAAAAAB////////wAAAAAAAAAAAAAAAB////////8AA/////////////////////////////wAAAAAAAAAf///////+AAAAAAAAAAf////////////////////+AAAf//////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////wAAAAP//8AAAAAAAP/////////////////AAAB/////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAD///////gAAAAAAAP///////gAAAAAAAAAAAAAAAAAAAAAf8AAf//////////////////////wAAAAAAAAAAAAAAAAAAAAAA/gAAAAAAAAAAAAAAAB//4AAAAAAAAAAAAAAD//////////////////////////////AAAAAAAD////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////////////4AAAAAAAAAAAAAAAAAAAD///////////////////////////////////////8AAAAAAAD/////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////wAAAAAAAAAAAf/////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////+AAAAAAAAAAAAAAAAAAAAAAAD//////////////////////AAAAAAAAAAAAAAAP//////////////////////////////8AAAPAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAH//////////////////////////wAAAAAAAAAAAAAAAAD/////////////////////////////////wAAAH///////////gAAAAAAAAAAAAAAAAAAAAf//////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///////////////////////////////////////AAAA//////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////+AAAAAAAAAAA//////////////////////////////////gAAAAAB///////////gAAAAAAAAAAAAAAAAAAAAAA/////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////////////gAAA/////////////////////////+P///////////////////////4AAAAAAAAAAAAAAB//////////////////+AAAAAAAAAAAAAH//////////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////////////////////////////////////wAAAAf/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////////////////8H//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAf/////////AAAH///////////4AAAAAAP///////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////////8f////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///////8AAAAAAAAA/////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAf4AAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAD/////////////////////////+AAAAAAAAAAAAAAf/////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf////////gAAAAAAAAAAA/////////////////////////////////+AAAAAAAAAAAAAAAAAAAAD//////////////////////////////////gAAAAAAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////8AAAAAAAAAAAAAAAAAAA////////////////////wAAAAAAAAAAAAP//////////////////////////////////////8B+AAAAAAAAAAAAAAAAAAAP///////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//////////////////AAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////gAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAB/////////////////////wAAAAAAAAAAAAAAAAAB///////////AAB////////////////////////////////////////gAAAAAAAAD/8AAAAAAAA////////////////////////4D///////////////////////////////////////gAAAAAAAAAAAAAAAAAAAAP////////////////////////+AAAAAAAP///////////////////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB////////////////////AAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////gAAAAAAAAAAAAAAf////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//8AAAAAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////+AAAAAAAP///////////////////////////////////4AAAAAAAAAAAAAAAAAAAAAAAAf/////////////////////////////////////+AAAAAAAAH/////////////gAAAAAAAAAAAAAAAAAAAAAAH///////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD////////////////////////////wAAAAAAf///////////////////////////////////8AAAAAAAAAAf//////////////8AAAAAAAAAAAAAAAB////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP+AAAAAAAAAAAAAAAAAAAAAAAAAf////////////////////////////////////////+AAAAAAAAAAAAAAAAAAAAAAAAP/////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////8AAAAP/////////////////////////////gAAAAAAAAAAAH///////+AAAAAAAAAAAA///////////////////8AAAAAB/////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////wAAAAAAAAAP////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAf///////AAAAAAP/////////////////8AAAAAAAAAAAAAAAAAAB//////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////////////////////////////AAAAAAAAAAAAAAAAAD//////+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH////////////AAAAAAAAAAAAD/////////4AAAAAAAAAAAAAAAP/wAAAAP//////////////////////////////8AAAAAAAAAAAAAAAD//////////////////////////////////AAAAAAAAAAAAAAAAAAAH////////4AAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////AAAAf//////////////////////////4AAAAAAAAAAAAf/////8AAAAAAAAAAAAAAAAAAAAAAP////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////wAAAAAAAP//////////AAAAAAAH///////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/////////////AAAAAf////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAH/////////8AP/////////////////////+AAAB//AAAAAAAAAAAAAAAAAAAAAAAAA////////////gAAAf/////////////8AAAAAAAAAAAAAAD//////////AAAAAAAAAAAAAAAAAAAAAAAAAAB/4AAAAAAP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "DSA": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "DSA-SHA": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "DSA-SHA1": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "DSA-SHA1-old": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "RSA-MD4": "cb07b1079dcac3c150760aa4133edff0", + "RSA-MD5": "6fc6c8790dfc301ee38b8b63e18def5c", + "RSA-MDC2": "87142fffa2394f85fd8c6ccd18440c62", + "RSA-RIPEMD160": "16e5a88db8f37c2cf5ef64d1e48f84fe1dccba7c", + "RSA-SHA": "7ea14f4d503fec84a1a3d24fdfabc3fba0212f6c", + "RSA-SHA1": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "RSA-SHA1-2": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "RSA-SHA224": "7a639040f7b372947a1774aaf8be4441933bdd991f5913bfb27097f4", + "RSA-SHA256": "426cbfa5a10024c4f5deae9146222146c2d75a5bf13e8215c04d7dd17f455743", + "RSA-SHA384": "90d7b6ece2af45b682b1567022278a4f1171141d85e0d375197b9475a9a86f390b653e57b4f09b678ac9ac2bb58ab45e", + "RSA-SHA512": "a38b0e7a64c8ce3fc050e35bde8dc0df0e47acbfe8be29a0f464d91f1130792c11556f3edd52627753d47fe2b7f257f8406de95cd90857dff2c9cb1d5ba25141", + "dsaEncryption": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "dsaWithSHA": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "dsaWithSHA1": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "dss1": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "ecdsa-with-SHA1": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "md4": "cb07b1079dcac3c150760aa4133edff0", + "md4WithRSAEncryption": "cb07b1079dcac3c150760aa4133edff0", + "md5": "6fc6c8790dfc301ee38b8b63e18def5c", + "md5WithRSAEncryption": "6fc6c8790dfc301ee38b8b63e18def5c", + "mdc2": "87142fffa2394f85fd8c6ccd18440c62", + "mdc2WithRSA": "87142fffa2394f85fd8c6ccd18440c62", + "ripemd": "16e5a88db8f37c2cf5ef64d1e48f84fe1dccba7c", + "ripemd160": "16e5a88db8f37c2cf5ef64d1e48f84fe1dccba7c", + "ripemd160WithRSA": "16e5a88db8f37c2cf5ef64d1e48f84fe1dccba7c", + "rmd160": "16e5a88db8f37c2cf5ef64d1e48f84fe1dccba7c", + "sha": "7ea14f4d503fec84a1a3d24fdfabc3fba0212f6c", + "sha1": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "sha1WithRSAEncryption": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "sha224": "7a639040f7b372947a1774aaf8be4441933bdd991f5913bfb27097f4", + "sha224WithRSAEncryption": "7a639040f7b372947a1774aaf8be4441933bdd991f5913bfb27097f4", + "sha256": "426cbfa5a10024c4f5deae9146222146c2d75a5bf13e8215c04d7dd17f455743", + "sha256WithRSAEncryption": "426cbfa5a10024c4f5deae9146222146c2d75a5bf13e8215c04d7dd17f455743", + "sha384": "90d7b6ece2af45b682b1567022278a4f1171141d85e0d375197b9475a9a86f390b653e57b4f09b678ac9ac2bb58ab45e", + "sha384WithRSAEncryption": "90d7b6ece2af45b682b1567022278a4f1171141d85e0d375197b9475a9a86f390b653e57b4f09b678ac9ac2bb58ab45e", + "sha512": "a38b0e7a64c8ce3fc050e35bde8dc0df0e47acbfe8be29a0f464d91f1130792c11556f3edd52627753d47fe2b7f257f8406de95cd90857dff2c9cb1d5ba25141", + "sha512WithRSAEncryption": "a38b0e7a64c8ce3fc050e35bde8dc0df0e47acbfe8be29a0f464d91f1130792c11556f3edd52627753d47fe2b7f257f8406de95cd90857dff2c9cb1d5ba25141", + "shaWithRSAEncryption": "7ea14f4d503fec84a1a3d24fdfabc3fba0212f6c", + "ssl2-md5": "6fc6c8790dfc301ee38b8b63e18def5c", + "ssl3-md5": "6fc6c8790dfc301ee38b8b63e18def5c", + "ssl3-sha1": "6342b199ee64c7b2c9cbcd4f2dcb65acef51516f", + "whirlpool": "164107a68c4bd310b4bd1a94f7989d69ac7027c108619d6aba63add3e5d48c55008544845dcaf789a4a055bb35d67bfd01fd1c6d544fa16034103d3dbbfa0054" + } +] + +},{}],10:[function(require,module,exports){ +var crypto = require('crypto') + +var exportFn = require('./pbkdf2') +var exported = exportFn(crypto) + +module.exports = { + pbkdf2: exported.pbkdf2, + pbkdf2Sync: exported.pbkdf2Sync, + + // for crypto-browserify + __pbkdf2Export: exportFn +} + +},{"./pbkdf2":11,"crypto":43}],11:[function(require,module,exports){ +(function (Buffer){ +module.exports = function(crypto) { + function pbkdf2(password, salt, iterations, keylen, digest, callback) { + if ('function' === typeof digest) { + callback = digest + digest = undefined + } + + if ('function' !== typeof callback) + throw new Error('No callback provided to pbkdf2') + + setTimeout(function() { + var result + + try { + result = pbkdf2Sync(password, salt, iterations, keylen, digest) + } catch (e) { + return callback(e) + } + + callback(undefined, result) + }) + } + + function pbkdf2Sync(password, salt, iterations, keylen, digest) { + if ('number' !== typeof iterations) + throw new TypeError('Iterations not a number') + + if (iterations < 0) + throw new TypeError('Bad iterations') + + if ('number' !== typeof keylen) + throw new TypeError('Key length not a number') + + if (keylen < 0) + throw new TypeError('Bad key length') + + digest = digest || 'sha1' + + if (!Buffer.isBuffer(password)) password = new Buffer(password) + if (!Buffer.isBuffer(salt)) salt = new Buffer(salt) + + var hLen, l = 1, r, T + var DK = new Buffer(keylen) + var block1 = new Buffer(salt.length + 4) + salt.copy(block1, 0, 0, salt.length) + + for (var i = 1; i <= l; i++) { + block1.writeUInt32BE(i, salt.length) + + var U = crypto.createHmac(digest, password).update(block1).digest() + + if (!hLen) { + hLen = U.length + T = new Buffer(hLen) + l = Math.ceil(keylen / hLen) + r = keylen - (l - 1) * hLen + + if (keylen > (Math.pow(2, 32) - 1) * hLen) + throw new TypeError('keylen exceeds maximum length') + } + + U.copy(T, 0, 0, hLen) + + for (var j = 1; j < iterations; j++) { + U = crypto.createHmac(digest, password).update(U).digest() + + for (var k = 0; k < hLen; k++) { + T[k] ^= U[k] + } + } + + var destPos = (i - 1) * hLen + var len = (i == l ? r : hLen) + T.copy(DK, destPos, 0, len) + } + + return DK + } + + return { + pbkdf2: pbkdf2, + pbkdf2Sync: pbkdf2Sync + } +} + +}).call(this,require("buffer").Buffer) +},{"buffer":37}],12:[function(require,module,exports){ +(function (Buffer){ + +module.exports = ripemd160 + + + +/* +CryptoJS v3.1.2 +code.google.com/p/crypto-js +(c) 2009-2013 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +/** @preserve +(c) 2012 by Cédric Mesnil. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +// Constants table +var zl = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; +var zr = [ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; +var sl = [ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]; +var sr = [ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; + +var hl = [ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]; +var hr = [ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]; + +var bytesToWords = function (bytes) { + var words = []; + for (var i = 0, b = 0; i < bytes.length; i++, b += 8) { + words[b >>> 5] |= bytes[i] << (24 - b % 32); + } + return words; +}; + +var wordsToBytes = function (words) { + var bytes = []; + for (var b = 0; b < words.length * 32; b += 8) { + bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); + } + return bytes; +}; + +var processBlock = function (H, M, offset) { + + // Swap endian + for (var i = 0; i < 16; i++) { + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + // Swap + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Working variables + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + // Computation + var t; + for (var i = 0; i < 80; i += 1) { + t = (al + M[offset+zl[i]])|0; + if (i<16){ + t += f1(bl,cl,dl) + hl[0]; + } else if (i<32) { + t += f2(bl,cl,dl) + hl[1]; + } else if (i<48) { + t += f3(bl,cl,dl) + hl[2]; + } else if (i<64) { + t += f4(bl,cl,dl) + hl[3]; + } else {// if (i<80) { + t += f5(bl,cl,dl) + hl[4]; + } + t = t|0; + t = rotl(t,sl[i]); + t = (t+el)|0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + + t = (ar + M[offset+zr[i]])|0; + if (i<16){ + t += f5(br,cr,dr) + hr[0]; + } else if (i<32) { + t += f4(br,cr,dr) + hr[1]; + } else if (i<48) { + t += f3(br,cr,dr) + hr[2]; + } else if (i<64) { + t += f2(br,cr,dr) + hr[3]; + } else {// if (i<80) { + t += f1(br,cr,dr) + hr[4]; + } + t = t|0; + t = rotl(t,sr[i]) ; + t = (t+er)|0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + // Intermediate hash value + t = (H[1] + cl + dr)|0; + H[1] = (H[2] + dl + er)|0; + H[2] = (H[3] + el + ar)|0; + H[3] = (H[4] + al + br)|0; + H[4] = (H[0] + bl + cr)|0; + H[0] = t; +}; + +function f1(x, y, z) { + return ((x) ^ (y) ^ (z)); +} + +function f2(x, y, z) { + return (((x)&(y)) | ((~x)&(z))); +} + +function f3(x, y, z) { + return (((x) | (~(y))) ^ (z)); +} + +function f4(x, y, z) { + return (((x) & (z)) | ((y)&(~(z)))); +} + +function f5(x, y, z) { + return ((x) ^ ((y) |(~(z)))); +} + +function rotl(x,n) { + return (x<>>(32-n)); +} + +function ripemd160(message) { + var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]; + + if (typeof message == 'string') + message = new Buffer(message, 'utf8'); + + var m = bytesToWords(message); + + var nBitsLeft = message.length * 8; + var nBitsTotal = message.length * 8; + + // Add padding + m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + + for (var i=0 ; i>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + var digestbytes = wordsToBytes(H); + return new Buffer(digestbytes); +} + + + +}).call(this,require("buffer").Buffer) +},{"buffer":37}],13:[function(require,module,exports){ +module.exports = function (Buffer) { + + //prototype class for hash functions + function Hash (blockSize, finalSize) { + this._block = new Buffer(blockSize) //new Uint32Array(blockSize/4) + this._finalSize = finalSize + this._blockSize = blockSize + this._len = 0 + this._s = 0 + } + + Hash.prototype.init = function () { + this._s = 0 + this._len = 0 + } + + Hash.prototype.update = function (data, enc) { + if ("string" === typeof data) { + enc = enc || "utf8" + data = new Buffer(data, enc) + } + + var l = this._len += data.length + var s = this._s = (this._s || 0) + var f = 0 + var buffer = this._block + + while (s < l) { + var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize)) + var ch = (t - f) + + for (var i = 0; i < ch; i++) { + buffer[(s % this._blockSize) + i] = data[i + f] + } + + s += ch + f += ch + + if ((s % this._blockSize) === 0) { + this._update(buffer) + } + } + this._s = s + + return this + } + + Hash.prototype.digest = function (enc) { + // Suppose the length of the message M, in bits, is l + var l = this._len * 8 + + // Append the bit 1 to the end of the message + this._block[this._len % this._blockSize] = 0x80 + + // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize + this._block.fill(0, this._len % this._blockSize + 1) + + if (l % (this._blockSize * 8) >= this._finalSize * 8) { + this._update(this._block) + this._block.fill(0) + } + + // to this append the block which is equal to the number l written in binary + // TODO: handle case where l is > Math.pow(2, 29) + this._block.writeInt32BE(l, this._blockSize - 4) + + var hash = this._update(this._block) || this._hash() + + return enc ? hash.toString(enc) : hash + } + + Hash.prototype._update = function () { + throw new Error('_update must be implemented by subclass') + } + + return Hash +} + +},{}],14:[function(require,module,exports){ +var exports = module.exports = function (alg) { + var Alg = exports[alg] + if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)') + return new Alg() +} + +var Buffer = require('buffer/').Buffer +var Hash = require('./hash')(Buffer) + +exports.sha1 = require('./sha1')(Buffer, Hash) +exports.sha256 = require('./sha256')(Buffer, Hash) +exports.sha512 = require('./sha512')(Buffer, Hash) + +},{"./hash":13,"./sha1":15,"./sha256":16,"./sha512":17,"buffer/":6}],15:[function(require,module,exports){ +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS PUB 180-1 + * Version 2.1a Copyright Paul Johnston 2000 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ + +var inherits = require('util').inherits + +module.exports = function (Buffer, Hash) { + + var A = 0|0 + var B = 4|0 + var C = 8|0 + var D = 12|0 + var E = 16|0 + + var W = new (typeof Int32Array === 'undefined' ? Array : Int32Array)(80) + + var POOL = [] + + function Sha1 () { + if(POOL.length) + return POOL.pop().init() + + if(!(this instanceof Sha1)) return new Sha1() + this._w = W + Hash.call(this, 16*4, 14*4) + + this._h = null + this.init() + } + + inherits(Sha1, Hash) + + Sha1.prototype.init = function () { + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 + this._e = 0xc3d2e1f0 + + Hash.prototype.init.call(this) + return this + } + + Sha1.prototype._POOL = POOL + Sha1.prototype._update = function (X) { + + var a, b, c, d, e, _a, _b, _c, _d, _e + + a = _a = this._a + b = _b = this._b + c = _c = this._c + d = _d = this._d + e = _e = this._e + + var w = this._w + + for(var j = 0; j < 80; j++) { + var W = w[j] = j < 16 ? X.readInt32BE(j*4) + : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1) + + var t = add( + add(rol(a, 5), sha1_ft(j, b, c, d)), + add(add(e, W), sha1_kt(j)) + ) + + e = d + d = c + c = rol(b, 30) + b = a + a = t + } + + this._a = add(a, _a) + this._b = add(b, _b) + this._c = add(c, _c) + this._d = add(d, _d) + this._e = add(e, _e) + } + + Sha1.prototype._hash = function () { + if(POOL.length < 100) POOL.push(this) + var H = new Buffer(20) + //console.log(this._a|0, this._b|0, this._c|0, this._d|0, this._e|0) + H.writeInt32BE(this._a|0, A) + H.writeInt32BE(this._b|0, B) + H.writeInt32BE(this._c|0, C) + H.writeInt32BE(this._d|0, D) + H.writeInt32BE(this._e|0, E) + return H + } + + /* + * Perform the appropriate triplet combination function for the current + * iteration + */ + function sha1_ft(t, b, c, d) { + if(t < 20) return (b & c) | ((~b) & d); + if(t < 40) return b ^ c ^ d; + if(t < 60) return (b & c) | (b & d) | (c & d); + return b ^ c ^ d; + } + + /* + * Determine the appropriate additive constant for the current iteration + */ + function sha1_kt(t) { + return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : + (t < 60) ? -1894007588 : -899497514; + } + + /* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + * //dominictarr: this is 10 years old, so maybe this can be dropped?) + * + */ + function add(x, y) { + return (x + y ) | 0 + //lets see how this goes on testling. + // var lsw = (x & 0xFFFF) + (y & 0xFFFF); + // var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + // return (msw << 16) | (lsw & 0xFFFF); + } + + /* + * Bitwise rotate a 32-bit number to the left. + */ + function rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + } + + return Sha1 +} + +},{"util":72}],16:[function(require,module,exports){ + +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = require('util').inherits + +module.exports = function (Buffer, Hash) { + + var K = [ + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 + ] + + var W = new Array(64) + + function Sha256() { + this.init() + + this._w = W //new Array(64) + + Hash.call(this, 16*4, 14*4) + } + + inherits(Sha256, Hash) + + Sha256.prototype.init = function () { + + this._a = 0x6a09e667|0 + this._b = 0xbb67ae85|0 + this._c = 0x3c6ef372|0 + this._d = 0xa54ff53a|0 + this._e = 0x510e527f|0 + this._f = 0x9b05688c|0 + this._g = 0x1f83d9ab|0 + this._h = 0x5be0cd19|0 + + this._len = this._s = 0 + + return this + } + + function S (X, n) { + return (X >>> n) | (X << (32 - n)); + } + + function R (X, n) { + return (X >>> n); + } + + function Ch (x, y, z) { + return ((x & y) ^ ((~x) & z)); + } + + function Maj (x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); + } + + function Sigma0256 (x) { + return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); + } + + function Sigma1256 (x) { + return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); + } + + function Gamma0256 (x) { + return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); + } + + function Gamma1256 (x) { + return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); + } + + Sha256.prototype._update = function(M) { + + var W = this._w + var a, b, c, d, e, f, g, h + var T1, T2 + + a = this._a | 0 + b = this._b | 0 + c = this._c | 0 + d = this._d | 0 + e = this._e | 0 + f = this._f | 0 + g = this._g | 0 + h = this._h | 0 + + for (var j = 0; j < 64; j++) { + var w = W[j] = j < 16 + ? M.readInt32BE(j * 4) + : Gamma1256(W[j - 2]) + W[j - 7] + Gamma0256(W[j - 15]) + W[j - 16] + + T1 = h + Sigma1256(e) + Ch(e, f, g) + K[j] + w + + T2 = Sigma0256(a) + Maj(a, b, c); + h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 + this._f = (f + this._f) | 0 + this._g = (g + this._g) | 0 + this._h = (h + this._h) | 0 + + }; + + Sha256.prototype._hash = function () { + var H = new Buffer(32) + + H.writeInt32BE(this._a, 0) + H.writeInt32BE(this._b, 4) + H.writeInt32BE(this._c, 8) + H.writeInt32BE(this._d, 12) + H.writeInt32BE(this._e, 16) + H.writeInt32BE(this._f, 20) + H.writeInt32BE(this._g, 24) + H.writeInt32BE(this._h, 28) + + return H + } + + return Sha256 + +} + +},{"util":72}],17:[function(require,module,exports){ +var inherits = require('util').inherits + +module.exports = function (Buffer, Hash) { + var K = [ + 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, + 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, + 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, + 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, + 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, + 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, + 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, + 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, + 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, + 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, + 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, + 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, + 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, + 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, + 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, + 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, + 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, + 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, + 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, + 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, + 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 + ] + + var W = new Array(160) + + function Sha512() { + this.init() + this._w = W + + Hash.call(this, 128, 112) + } + + inherits(Sha512, Hash) + + Sha512.prototype.init = function () { + + this._a = 0x6a09e667|0 + this._b = 0xbb67ae85|0 + this._c = 0x3c6ef372|0 + this._d = 0xa54ff53a|0 + this._e = 0x510e527f|0 + this._f = 0x9b05688c|0 + this._g = 0x1f83d9ab|0 + this._h = 0x5be0cd19|0 + + this._al = 0xf3bcc908|0 + this._bl = 0x84caa73b|0 + this._cl = 0xfe94f82b|0 + this._dl = 0x5f1d36f1|0 + this._el = 0xade682d1|0 + this._fl = 0x2b3e6c1f|0 + this._gl = 0xfb41bd6b|0 + this._hl = 0x137e2179|0 + + this._len = this._s = 0 + + return this + } + + function S (X, Xl, n) { + return (X >>> n) | (Xl << (32 - n)) + } + + function Ch (x, y, z) { + return ((x & y) ^ ((~x) & z)); + } + + function Maj (x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); + } + + Sha512.prototype._update = function(M) { + + var W = this._w + var a, b, c, d, e, f, g, h + var al, bl, cl, dl, el, fl, gl, hl + + a = this._a | 0 + b = this._b | 0 + c = this._c | 0 + d = this._d | 0 + e = this._e | 0 + f = this._f | 0 + g = this._g | 0 + h = this._h | 0 + + al = this._al | 0 + bl = this._bl | 0 + cl = this._cl | 0 + dl = this._dl | 0 + el = this._el | 0 + fl = this._fl | 0 + gl = this._gl | 0 + hl = this._hl | 0 + + for (var i = 0; i < 80; i++) { + var j = i * 2 + + var Wi, Wil + + if (i < 16) { + Wi = W[j] = M.readInt32BE(j * 4) + Wil = W[j + 1] = M.readInt32BE(j * 4 + 4) + + } else { + var x = W[j - 15*2] + var xl = W[j - 15*2 + 1] + var gamma0 = S(x, xl, 1) ^ S(x, xl, 8) ^ (x >>> 7) + var gamma0l = S(xl, x, 1) ^ S(xl, x, 8) ^ S(xl, x, 7) + + x = W[j - 2*2] + xl = W[j - 2*2 + 1] + var gamma1 = S(x, xl, 19) ^ S(xl, x, 29) ^ (x >>> 6) + var gamma1l = S(xl, x, 19) ^ S(x, xl, 29) ^ S(xl, x, 6) + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[j - 7*2] + var Wi7l = W[j - 7*2 + 1] + + var Wi16 = W[j - 16*2] + var Wi16l = W[j - 16*2 + 1] + + Wil = gamma0l + Wi7l + Wi = gamma0 + Wi7 + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0) + Wil = Wil + gamma1l + Wi = Wi + gamma1 + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0) + Wil = Wil + Wi16l + Wi = Wi + Wi16 + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0) + + W[j] = Wi + W[j + 1] = Wil + } + + var maj = Maj(a, b, c) + var majl = Maj(al, bl, cl) + + var sigma0h = S(a, al, 28) ^ S(al, a, 2) ^ S(al, a, 7) + var sigma0l = S(al, a, 28) ^ S(a, al, 2) ^ S(a, al, 7) + var sigma1h = S(e, el, 14) ^ S(e, el, 18) ^ S(el, e, 9) + var sigma1l = S(el, e, 14) ^ S(el, e, 18) ^ S(e, el, 9) + + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[j] + var Kil = K[j + 1] + + var ch = Ch(e, f, g) + var chl = Ch(el, fl, gl) + + var t1l = hl + sigma1l + var t1 = h + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0) + t1l = t1l + chl + t1 = t1 + ch + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0) + t1l = t1l + Kil + t1 = t1 + Ki + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0) + t1l = t1l + Wil + t1 = t1 + Wi + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0) + + // t2 = sigma0 + maj + var t2l = sigma0l + majl + var t2 = sigma0h + maj + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0) + + h = g + hl = gl + g = f + gl = fl + f = e + fl = el + el = (dl + t1l) | 0 + e = (d + t1 + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0 + d = c + dl = cl + c = b + cl = bl + b = a + bl = al + al = (t1l + t2l) | 0 + a = (t1 + t2 + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0 + } + + this._al = (this._al + al) | 0 + this._bl = (this._bl + bl) | 0 + this._cl = (this._cl + cl) | 0 + this._dl = (this._dl + dl) | 0 + this._el = (this._el + el) | 0 + this._fl = (this._fl + fl) | 0 + this._gl = (this._gl + gl) | 0 + this._hl = (this._hl + hl) | 0 + + this._a = (this._a + a + ((this._al >>> 0) < (al >>> 0) ? 1 : 0)) | 0 + this._b = (this._b + b + ((this._bl >>> 0) < (bl >>> 0) ? 1 : 0)) | 0 + this._c = (this._c + c + ((this._cl >>> 0) < (cl >>> 0) ? 1 : 0)) | 0 + this._d = (this._d + d + ((this._dl >>> 0) < (dl >>> 0) ? 1 : 0)) | 0 + this._e = (this._e + e + ((this._el >>> 0) < (el >>> 0) ? 1 : 0)) | 0 + this._f = (this._f + f + ((this._fl >>> 0) < (fl >>> 0) ? 1 : 0)) | 0 + this._g = (this._g + g + ((this._gl >>> 0) < (gl >>> 0) ? 1 : 0)) | 0 + this._h = (this._h + h + ((this._hl >>> 0) < (hl >>> 0) ? 1 : 0)) | 0 + } + + Sha512.prototype._hash = function () { + var H = new Buffer(64) + + function writeInt64BE(h, l, offset) { + H.writeInt32BE(h, offset) + H.writeInt32BE(l, offset + 4) + } + + writeInt64BE(this._a, this._al, 0) + writeInt64BE(this._b, this._bl, 8) + writeInt64BE(this._c, this._cl, 16) + writeInt64BE(this._d, this._dl, 24) + writeInt64BE(this._e, this._el, 32) + writeInt64BE(this._f, this._fl, 40) + writeInt64BE(this._g, this._gl, 48) + writeInt64BE(this._h, this._hl, 56) + + return H + } + + return Sha512 + +} + +},{"util":72}],18:[function(require,module,exports){ +(function (process){ +var defined = require('defined'); +var createDefaultStream = require('./lib/default_stream'); +var Test = require('./lib/test'); +var createResult = require('./lib/results'); + +var canEmitExit = typeof process !== 'undefined' && process + && typeof process.on === 'function' && process.browser !== true +; +var canExit = typeof process !== 'undefined' && process + && typeof process.exit === 'function' +; + +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +exports = module.exports = (function () { + var harness; + var lazyLoad = function () { + if (!harness) harness = createExitHarness({ + autoclose: !canEmitExit + }); + + return harness.apply(this, arguments); + }; + + lazyLoad.only = function () { + if (!harness) harness = createExitHarness({ + autoclose: !canEmitExit + }); + + return harness.only.apply(this, arguments); + } + + return lazyLoad +})(); + +function createExitHarness (conf) { + if (!conf) conf = {}; + var harness = createHarness({ + autoclose: defined(conf.autoclose, false) + }); + + var stream = harness.createStream(); + var es = stream.pipe(createDefaultStream()); + if (canEmitExit) { + es.on('error', function (err) { harness._exitCode = 1 }); + } + + var ended = false; + stream.on('end', function () { ended = true }); + + if (conf.exit === false) return harness; + if (!canEmitExit || !canExit) return harness; + + var _error; + + process.on('uncaughtException', function (err) { + if (err && err.code === 'EPIPE' && err.errno === 'EPIPE' + && err.syscall === 'write') return; + + _error = err + + throw err + }) + + process.on('exit', function (code) { + if (_error) { + return + } + + if (!ended) { + for (var i = 0; i < harness._tests.length; i++) { + var t = harness._tests[i]; + t._exit(); + } + } + harness.close(); + process.exit(code || harness._exitCode); + }); + + return harness; +} + +exports.createHarness = createHarness; +exports.Test = Test; +exports.test = exports; // tap compat + +var exitInterval; + +function createHarness (conf_) { + if (!conf_) conf_ = {}; + var results = createResult(); + if (conf_.autoclose !== false) { + results.once('done', function () { results.close() }); + } + + var test = function (name, conf, cb) { + var t = new Test(name, conf, cb); + test._tests.push(t); + + (function inspectCode (st) { + st.on('test', function sub (st_) { + inspectCode(st_); + }); + st.on('result', function (r) { + if (!r.ok) test._exitCode = 1 + }); + })(t); + + results.push(t); + return t; + }; + + test._tests = []; + + test.createStream = function () { + return results.createStream(); + }; + + var only = false; + test.only = function (name) { + if (only) throw new Error('there can only be one only test'); + results.only(name); + only = true; + return test.apply(null, arguments); + }; + test._exitCode = 0; + + test.close = function () { results.close() }; + + return test; +} + +}).call(this,require('_process')) +},{"./lib/default_stream":19,"./lib/results":20,"./lib/test":21,"_process":57,"defined":25}],19:[function(require,module,exports){ +var through = require('through'); + +module.exports = function () { + var line = ''; + var stream = through(write, flush); + return stream; + + function write (buf) { + for (var i = 0; i < buf.length; i++) { + var c = typeof buf === 'string' + ? buf.charAt(i) + : String.fromCharCode(buf[i]) + ; + if (c === '\n') flush(); + else line += c; + } + } + + function flush () { + try { console.log(line); } + catch (e) { stream.emit('error', e) } + line = ''; + } +}; + +},{"through":31}],20:[function(require,module,exports){ +(function (process){ +var Stream = require('stream'); +var EventEmitter = require('events').EventEmitter; +var inherits = require('inherits'); +var json = typeof JSON === 'object' ? JSON : require('jsonify'); +var through = require('through'); +var resumer = require('resumer'); +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +module.exports = Results; +inherits(Results, EventEmitter); + +function Results () { + if (!(this instanceof Results)) return new Results; + this.count = 0; + this.fail = 0; + this.pass = 0; + this._stream = through(); + this.tests = []; +} + +Results.prototype.createStream = function () { + var self = this; + var output = resumer(); + output.queue('TAP version 13\n'); + + nextTick(function () { + var t = getNextTest(self); + if (t) t.run() + else self.emit('done') + }); + self._stream.pipe(output); + + return output; +}; + +Results.prototype.push = function (t) { + var self = this; + self.tests.push(t); + self._watch(t); + t.once('end', function () { + var nt = getNextTest(self); + if (nt) nt.run() + else self.emit('done') + }); +}; + +Results.prototype.only = function (name) { + if (this._only) { + self.count ++; + self.fail ++; + write('not ok ' + self.count + ' already called .only()\n'); + } + this._only = name; +}; + +Results.prototype._watch = function (t) { + var self = this; + var write = function (s) { self._stream.queue(s) }; + t.once('prerun', function () { + write('# ' + t.name + '\n'); + }); + + t.on('result', function (res) { + if (typeof res === 'string') { + write('# ' + res + '\n'); + return; + } + write(encodeResult(res, self.count + 1)); + self.count ++; + + if (res.ok) self.pass ++ + else self.fail ++ + }); + + t.on('test', function (st) { self._watch(st) }); +}; + +Results.prototype.close = function () { + var self = this; + if (self.closed) self._stream.emit('error', new Error('ALREADY CLOSED')); + self.closed = true; + var write = function (s) { self._stream.queue(s) }; + + write('\n1..' + self.count + '\n'); + write('# tests ' + self.count + '\n'); + write('# pass ' + self.pass + '\n'); + if (self.fail) write('# fail ' + self.fail + '\n') + else write('\n# ok\n') + + self._stream.queue(null); +}; + +function encodeResult (res, count) { + var output = ''; + output += (res.ok ? 'ok ' : 'not ok ') + count; + output += res.name ? ' ' + res.name.toString().replace(/\s+/g, ' ') : ''; + + if (res.skip) output += ' # SKIP'; + else if (res.todo) output += ' # TODO'; + + output += '\n'; + if (res.ok) return output; + + var outer = ' '; + var inner = outer + ' '; + output += outer + '---\n'; + output += inner + 'operator: ' + res.operator + '\n'; + + var ex = json.stringify(res.expected, getSerialize()) || ''; + var ac = json.stringify(res.actual, getSerialize()) || ''; + + if (Math.max(ex.length, ac.length) > 65) { + output += inner + 'expected:\n' + inner + ' ' + ex + '\n'; + output += inner + 'actual:\n' + inner + ' ' + ac + '\n'; + } + else { + output += inner + 'expected: ' + ex + '\n'; + output += inner + 'actual: ' + ac + '\n'; + } + if (res.at) { + output += inner + 'at: ' + res.at + '\n'; + } + if (res.operator === 'error' && res.actual && res.actual.stack) { + var lines = String(res.actual.stack).split('\n'); + output += inner + 'stack:\n'; + output += inner + ' ' + lines[0] + '\n'; + for (var i = 1; i < lines.length; i++) { + output += inner + lines[i] + '\n'; + } + } + + output += outer + '...\n'; + return output; +} + +function getSerialize () { + var seen = []; + + return function (key, value) { + var ret = value; + if (typeof value === 'object' && value) { + var found = false; + for (var i = 0; i < seen.length; i++) { + if (seen[i] === value) { + found = true + break; + } + } + + if (found) ret = '[Circular]' + else seen.push(value) + } + return ret; + }; +} + +function getNextTest(results) { + if (!results._only) { + return results.tests.shift(); + } + + do { + var t = results.tests.shift(); + if (!t) { + return null; + } + if (results._only === t.name) { + return t; + } + } while (results.tests.length !== 0) +} + +}).call(this,require('_process')) +},{"_process":57,"events":53,"inherits":26,"jsonify":27,"resumer":30,"stream":70,"through":31}],21:[function(require,module,exports){ +(function (process,__dirname){ +var Stream = require('stream'); +var deepEqual = require('deep-equal'); +var defined = require('defined'); +var path = require('path'); +var inherits = require('util').inherits; +var EventEmitter = require('events').EventEmitter; + +module.exports = Test; + +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +inherits(Test, EventEmitter); + +function Test (name_, opts_, cb_) { + var self = this; + var name = '(anonymous)'; + var opts = {}; + var cb; + + for (var i = 0; i < arguments.length; i++) { + switch (typeof arguments[i]) { + case 'string': + name = arguments[i]; + break; + case 'object': + opts = arguments[i] || opts; + break; + case 'function': + cb = arguments[i]; + } + } + + this.readable = true; + this.name = name || '(anonymous)'; + this.assertCount = 0; + this.pendingCount = 0; + this._skip = opts.skip || false; + this._plan = undefined; + this._cb = cb; + this._progeny = []; + this._ok = true; +} + +Test.prototype.run = function () { + if (this._skip) { + return this.end(); + } + this.emit('prerun'); + try { + this._cb(this); + } + catch (err) { + this.error(err); + this.end(); + return; + } + this.emit('run'); +}; + +Test.prototype.test = function (name, opts, cb) { + var self = this; + var t = new Test(name, opts, cb); + this._progeny.push(t); + this.pendingCount++; + this.emit('test', t); + t.on('prerun', function () { + self.assertCount++; + }) + + if (!self._pendingAsserts()) { + nextTick(function () { + self.end(); + }); + } + + nextTick(function() { + if (!self._plan && self.pendingCount == self._progeny.length) { + self.end(); + } + }); +}; + +Test.prototype.comment = function (msg) { + this.emit('result', msg.trim().replace(/^#\s*/, '')); +}; + +Test.prototype.plan = function (n) { + this._plan = n; + this.emit('plan', n); +}; + +Test.prototype.end = function () { + var self = this; + + if (this._progeny.length) { + var t = this._progeny.shift(); + t.on('end', function () { + self.end(); + }); + t.run(); + return; + } + + if (!this.ended) this.emit('end'); + var pendingAsserts = this._pendingAsserts(); + if (!this._planError && this._plan !== undefined && pendingAsserts) { + this._planError = true; + this.fail('plan != count', { + expected : this._plan, + actual : this.assertCount + }); + } + this.ended = true; +}; + +Test.prototype._exit = function () { + if (this._plan !== undefined && + !this._planError && this.assertCount !== this._plan) { + this._planError = true; + this.fail('plan != count', { + expected : this._plan, + actual : this.assertCount, + exiting : true + }); + } + else if (!this.ended) { + this.fail('test exited without ending', { + exiting: true + }); + } +}; + +Test.prototype._pendingAsserts = function () { + if (this._plan === undefined) { + return 1; + } else { + return this._plan - + (this._progeny.length + this.assertCount); + } +} + +Test.prototype._assert = function assert (ok, opts) { + var self = this; + var extra = opts.extra || {}; + + var res = { + id : self.assertCount ++, + ok : Boolean(ok), + skip : defined(extra.skip, opts.skip), + name : defined(extra.message, opts.message, '(unnamed assert)'), + operator : defined(extra.operator, opts.operator), + actual : defined(extra.actual, opts.actual), + expected : defined(extra.expected, opts.expected) + }; + this._ok = Boolean(this._ok && ok); + + if (!ok) { + res.error = defined(extra.error, opts.error, new Error(res.name)); + } + + var e = new Error('exception'); + var err = (e.stack || '').split('\n'); + var dir = path.dirname(__dirname) + '/'; + + for (var i = 0; i < err.length; i++) { + var m = /^\s*\bat\s+(.+)/.exec(err[i]); + if (!m) continue; + + var s = m[1].split(/\s+/); + var filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]); + if (!filem) { + filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]); + + if (!filem) continue; + } + + if (filem[1].slice(0, dir.length) === dir) continue; + + res.functionName = s[0]; + res.file = filem[1]; + res.line = Number(filem[2]); + if (filem[3]) res.column = filem[3]; + + res.at = m[1]; + break; + } + + self.emit('result', res); + + var pendingAsserts = self._pendingAsserts(); + if (!pendingAsserts) { + if (extra.exiting) { + self.end(); + } else { + nextTick(function () { + self.end(); + }); + } + } + + if (!self._planError && pendingAsserts < 0) { + self._planError = true; + self.fail('plan != count', { + expected : self._plan, + actual : self._plan - pendingAsserts + }); + } +}; + +Test.prototype.fail = function (msg, extra) { + this._assert(false, { + message : msg, + operator : 'fail', + extra : extra + }); +}; + +Test.prototype.pass = function (msg, extra) { + this._assert(true, { + message : msg, + operator : 'pass', + extra : extra + }); +}; + +Test.prototype.skip = function (msg, extra) { + this._assert(true, { + message : msg, + operator : 'skip', + skip : true, + extra : extra + }); +}; + +Test.prototype.ok += Test.prototype['true'] += Test.prototype.assert += function (value, msg, extra) { + this._assert(value, { + message : msg, + operator : 'ok', + expected : true, + actual : value, + extra : extra + }); +}; + +Test.prototype.notOk += Test.prototype['false'] += Test.prototype.notok += function (value, msg, extra) { + this._assert(!value, { + message : msg, + operator : 'notOk', + expected : false, + actual : value, + extra : extra + }); +}; + +Test.prototype.error += Test.prototype.ifError += Test.prototype.ifErr += Test.prototype.iferror += function (err, msg, extra) { + this._assert(!err, { + message : defined(msg, String(err)), + operator : 'error', + actual : err, + extra : extra + }); +}; + +Test.prototype.equal += Test.prototype.equals += Test.prototype.isEqual += Test.prototype.is += Test.prototype.strictEqual += Test.prototype.strictEquals += function (a, b, msg, extra) { + this._assert(a === b, { + message : defined(msg, 'should be equal'), + operator : 'equal', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype.notEqual += Test.prototype.notEquals += Test.prototype.notStrictEqual += Test.prototype.notStrictEquals += Test.prototype.isNotEqual += Test.prototype.isNot += Test.prototype.not += Test.prototype.doesNotEqual += Test.prototype.isInequal += function (a, b, msg, extra) { + this._assert(a !== b, { + message : defined(msg, 'should not be equal'), + operator : 'notEqual', + actual : a, + notExpected : b, + extra : extra + }); +}; + +Test.prototype.deepEqual += Test.prototype.deepEquals += Test.prototype.isEquivalent += Test.prototype.same += function (a, b, msg, extra) { + this._assert(deepEqual(a, b, { strict: true }), { + message : defined(msg, 'should be equivalent'), + operator : 'deepEqual', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype.deepLooseEqual += Test.prototype.looseEqual += Test.prototype.looseEquals += function (a, b, msg, extra) { + this._assert(deepEqual(a, b), { + message : defined(msg, 'should be equivalent'), + operator : 'deepLooseEqual', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype.notDeepEqual += Test.prototype.notEquivalent += Test.prototype.notDeeply += Test.prototype.notSame += Test.prototype.isNotDeepEqual += Test.prototype.isNotDeeply += Test.prototype.isNotEquivalent += Test.prototype.isInequivalent += function (a, b, msg, extra) { + this._assert(!deepEqual(a, b, { strict: true }), { + message : defined(msg, 'should not be equivalent'), + operator : 'notDeepEqual', + actual : a, + notExpected : b, + extra : extra + }); +}; + +Test.prototype.notDeepLooseEqual += Test.prototype.notLooseEqual += Test.prototype.notLooseEquals += function (a, b, msg, extra) { + this._assert(deepEqual(a, b), { + message : defined(msg, 'should be equivalent'), + operator : 'notDeepLooseEqual', + actual : a, + expected : b, + extra : extra + }); +}; + +Test.prototype['throws'] = function (fn, expected, msg, extra) { + if (typeof expected === 'string') { + msg = expected; + expected = undefined; + } + var caught = undefined; + try { + fn(); + } + catch (err) { + caught = { error : err }; + var message = err.message; + delete err.message; + err.message = message; + } + + var passed = caught; + + if (expected instanceof RegExp) { + passed = expected.test(caught && caught.error); + expected = String(expected); + } + + this._assert(passed, { + message : defined(msg, 'should throw'), + operator : 'throws', + actual : caught && caught.error, + expected : expected, + error: !passed && caught && caught.error, + extra : extra + }); +}; + +Test.prototype.doesNotThrow = function (fn, expected, msg, extra) { + if (typeof expected === 'string') { + msg = expected; + expected = undefined; + } + var caught = undefined; + try { + fn(); + } + catch (err) { + caught = { error : err }; + } + this._assert(!caught, { + message : defined(msg, 'should throw'), + operator : 'throws', + actual : caught && caught.error, + expected : expected, + error : caught && caught.error, + extra : extra + }); +}; + +// vim: set softtabstop=4 shiftwidth=4: + +}).call(this,require('_process'),"/node_modules/tape/lib") +},{"_process":57,"deep-equal":22,"defined":25,"events":53,"path":56,"stream":70,"util":72}],22:[function(require,module,exports){ +var pSlice = Array.prototype.slice; +var objectKeys = require('./lib/keys.js'); +var isArguments = require('./lib/is_arguments.js'); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function objEquiv(a, b, opts) { + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + try { + var ka = objectKeys(a), + kb = objectKeys(b), + key, i; + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return true; +} + +},{"./lib/is_arguments.js":23,"./lib/keys.js":24}],23:[function(require,module,exports){ +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; + +},{}],24:[function(require,module,exports){ +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} + +},{}],25:[function(require,module,exports){ +module.exports = function () { + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] !== undefined) return arguments[i]; + } +}; + +},{}],26:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],27:[function(require,module,exports){ +exports.parse = require('./lib/parse'); +exports.stringify = require('./lib/stringify'); + +},{"./lib/parse":28,"./lib/stringify":29}],28:[function(require,module,exports){ +var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + +value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } +}; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + +module.exports = function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + + // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; +}; + +},{}],29:[function(require,module,exports){ +var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + +function quote(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; +} + +function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } +} + +module.exports = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); +}; + +},{}],30:[function(require,module,exports){ +(function (process){ +var through = require('through'); +var nextTick = typeof setImmediate !== 'undefined' + ? setImmediate + : process.nextTick +; + +module.exports = function (write, end) { + var tr = through(write, end); + tr.pause(); + var resume = tr.resume; + var pause = tr.pause; + var paused = false; + + tr.pause = function () { + paused = true; + return pause.apply(this, arguments); + }; + + tr.resume = function () { + paused = false; + return resume.apply(this, arguments); + }; + + nextTick(function () { + if (!paused) tr.resume(); + }); + + return tr; +}; + +}).call(this,require('_process')) +},{"_process":57,"through":31}],31:[function(require,module,exports){ +(function (process){ +var Stream = require('stream') + +// through +// +// a stream that does nothing but re-emit the input. +// useful for aggregating a series of changing but not ending streams into one stream) + +exports = module.exports = through +through.through = through + +//create a readable writable stream. + +function through (write, end, opts) { + write = write || function (data) { this.queue(data) } + end = end || function () { this.queue(null) } + + var ended = false, destroyed = false, buffer = [], _ended = false + var stream = new Stream() + stream.readable = stream.writable = true + stream.paused = false + +// stream.autoPause = !(opts && opts.autoPause === false) + stream.autoDestroy = !(opts && opts.autoDestroy === false) + + stream.write = function (data) { + write.call(this, data) + return !stream.paused + } + + function drain() { + while(buffer.length && !stream.paused) { + var data = buffer.shift() + if(null === data) + return stream.emit('end') + else + stream.emit('data', data) + } + } + + stream.queue = stream.push = function (data) { +// console.error(ended) + if(_ended) return stream + if(data == null) _ended = true + buffer.push(data) + drain() + return stream + } + + //this will be registered as the first 'end' listener + //must call destroy next tick, to make sure we're after any + //stream piped from here. + //this is only a problem if end is not emitted synchronously. + //a nicer way to do this is to make sure this is the last listener for 'end' + + stream.on('end', function () { + stream.readable = false + if(!stream.writable && stream.autoDestroy) + process.nextTick(function () { + stream.destroy() + }) + }) + + function _end () { + stream.writable = false + end.call(stream) + if(!stream.readable && stream.autoDestroy) + stream.destroy() + } + + stream.end = function (data) { + if(ended) return + ended = true + if(arguments.length) stream.write(data) + _end() // will emit or queue + return stream + } + + stream.destroy = function () { + if(destroyed) return + destroyed = true + ended = true + buffer.length = 0 + stream.writable = stream.readable = false + stream.emit('close') + return stream + } + + stream.pause = function () { + if(stream.paused) return + stream.paused = true + return stream + } + + stream.resume = function () { + if(stream.paused) { + stream.paused = false + stream.emit('resume') + } + drain() + //may have become paused again, + //as drain emits 'data'. + if(!stream.paused) + stream.emit('drain') + return stream + } + return stream +} + + +}).call(this,require('_process')) +},{"_process":57,"stream":70}],32:[function(require,module,exports){ +var pbkdf2Export = require('pbkdf2-compat').__pbkdf2Export + +module.exports = function (crypto, exports) { + exports = exports || {} + + var exported = pbkdf2Export(crypto) + + exports.pbkdf2 = exported.pbkdf2 + exports.pbkdf2Sync = exported.pbkdf2Sync + + return exports +} + +},{"pbkdf2-compat":10}],33:[function(require,module,exports){ +(function (global,Buffer){ +(function() { + var g = ('undefined' === typeof window ? global : window) || {} + _crypto = ( + g.crypto || g.msCrypto || require('crypto') + ) + module.exports = function(size) { + // Modern Browsers + if(_crypto.getRandomValues) { + var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array + /* This will not work in older browsers. + * See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + */ + + _crypto.getRandomValues(bytes); + return bytes; + } + else if (_crypto.randomBytes) { + return _crypto.randomBytes(size) + } + else + throw new Error( + 'secure random number generation not supported by this browser\n'+ + 'use chrome, FireFox or Internet Explorer 11' + ) + } +}()) + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"buffer":37,"crypto":36}],34:[function(require,module,exports){ +(function (Buffer){ +var fs = require('fs') +var test = require('tape') + +var algorithms = require('../').getHashes() +var encodings = [/*'binary',*/ 'hex', 'base64']; +var vectors = require('hash-test-vectors') + +var createHash = require('../create-hash') + +algorithms.forEach(function (algorithm) { + test('test ' + algorithm + ' against test vectors', function (t) { + + vectors.forEach(function (obj, i) { + var input = new Buffer(obj.input, 'base64') + var node = obj[algorithm] + var js = createHash(algorithm).update(input).digest('hex') + t.equal(js, node, algorithm + '(testVector['+i+']) == ' + node) + }) + + encodings.forEach(function (encoding) { + vectors.forEach(function (obj, i) { + var input = new Buffer(obj.input, 'base64').toString(encoding) + var node = obj[algorithm] + var js = createHash(algorithm).update(input, encoding).digest('hex') + t.equal(js, node, algorithm + '(testVector['+i+'], '+encoding+') == ' + node) + }) + }); + + t.end() + }) +}); + + +}).call(this,require("buffer").Buffer) +},{"../":4,"../create-hash":1,"buffer":37,"fs":35,"hash-test-vectors":9,"tape":18}],35:[function(require,module,exports){ + +},{}],36:[function(require,module,exports){ +module.exports=require(35) +},{}],37:[function(require,module,exports){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +var base64 = require('base64-js') +var ieee754 = require('ieee754') + +exports.Buffer = Buffer +exports.SlowBuffer = Buffer +exports.INSPECT_MAX_BYTES = 50 +Buffer.poolSize = 8192 + +/** + * If `TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Note: + * + * - Implementation must support adding new properties to `Uint8Array` instances. + * Firefox 4-29 lacked support, fixed in Firefox 30+. + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + * + * We detect these buggy browsers and set `TYPED_ARRAY_SUPPORT` to `false` so they will + * get the Object implementation, which is slower but will work correctly. + */ +var TYPED_ARRAY_SUPPORT = (function () { + try { + var buf = new ArrayBuffer(0) + var arr = new Uint8Array(buf) + arr.foo = function () { return 42 } + return 42 === arr.foo() && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + new Uint8Array(1).subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +})() + +/** + * Class: Buffer + * ============= + * + * The Buffer constructor returns instances of `Uint8Array` that are augmented + * with function properties for all the node `Buffer` API functions. We use + * `Uint8Array` so that square bracket notation works as expected -- it returns + * a single octet. + * + * By augmenting the instances, we can avoid modifying the `Uint8Array` + * prototype. + */ +function Buffer (subject, encoding, noZero) { + if (!(this instanceof Buffer)) + return new Buffer(subject, encoding, noZero) + + var type = typeof subject + + // Find the length + var length + if (type === 'number') + length = subject > 0 ? subject >>> 0 : 0 + else if (type === 'string') { + if (encoding === 'base64') + subject = base64clean(subject) + length = Buffer.byteLength(subject, encoding) + } else if (type === 'object' && subject !== null) { // assume object is array-like + if (subject.type === 'Buffer' && isArray(subject.data)) + subject = subject.data + length = +subject.length > 0 ? Math.floor(+subject.length) : 0 + } else + throw new Error('First argument needs to be a number, array or string.') + + var buf + if (TYPED_ARRAY_SUPPORT) { + // Preferred: Return an augmented `Uint8Array` instance for best performance + buf = Buffer._augment(new Uint8Array(length)) + } else { + // Fallback: Return THIS instance of Buffer (created by `new`) + buf = this + buf.length = length + buf._isBuffer = true + } + + var i + if (TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') { + // Speed optimization -- use set if we're copying from a typed array + buf._set(subject) + } else if (isArrayish(subject)) { + // Treat array-ish objects as a byte array + if (Buffer.isBuffer(subject)) { + for (i = 0; i < length; i++) + buf[i] = subject.readUInt8(i) + } else { + for (i = 0; i < length; i++) + buf[i] = ((subject[i] % 256) + 256) % 256 + } + } else if (type === 'string') { + buf.write(subject, 0, encoding) + } else if (type === 'number' && !TYPED_ARRAY_SUPPORT && !noZero) { + for (i = 0; i < length; i++) { + buf[i] = 0 + } + } + + return buf +} + +// STATIC METHODS +// ============== + +Buffer.isEncoding = function (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'raw': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.isBuffer = function (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.byteLength = function (str, encoding) { + var ret + str = str.toString() + switch (encoding || 'utf8') { + case 'hex': + ret = str.length / 2 + break + case 'utf8': + case 'utf-8': + ret = utf8ToBytes(str).length + break + case 'ascii': + case 'binary': + case 'raw': + ret = str.length + break + case 'base64': + ret = base64ToBytes(str).length + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = str.length * 2 + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.concat = function (list, totalLength) { + assert(isArray(list), 'Usage: Buffer.concat(list[, length])') + + if (list.length === 0) { + return new Buffer(0) + } else if (list.length === 1) { + return list[0] + } + + var i + if (totalLength === undefined) { + totalLength = 0 + for (i = 0; i < list.length; i++) { + totalLength += list[i].length + } + } + + var buf = new Buffer(totalLength) + var pos = 0 + for (i = 0; i < list.length; i++) { + var item = list[i] + item.copy(buf, pos) + pos += item.length + } + return buf +} + +Buffer.compare = function (a, b) { + assert(Buffer.isBuffer(a) && Buffer.isBuffer(b), 'Arguments must be Buffers') + var x = a.length + var y = b.length + for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {} + if (i !== len) { + x = a[i] + y = b[i] + } + if (x < y) { + return -1 + } + if (y < x) { + return 1 + } + return 0 +} + +// BUFFER INSTANCE METHODS +// ======================= + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + assert(strLen % 2 === 0, 'Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; i++) { + var byte = parseInt(string.substr(i * 2, 2), 16) + assert(!isNaN(byte), 'Invalid hex string') + buf[offset + i] = byte + } + return i +} + +function utf8Write (buf, string, offset, length) { + var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length) + return charsWritten +} + +function asciiWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length) + return charsWritten +} + +function binaryWrite (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length) + return charsWritten +} + +function utf16leWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length) + return charsWritten +} + +Buffer.prototype.write = function (string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length + length = undefined + } + } else { // legacy + var swap = encoding + encoding = offset + offset = length + length = swap + } + + offset = Number(offset) || 0 + var remaining = this.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + encoding = String(encoding || 'utf8').toLowerCase() + + var ret + switch (encoding) { + case 'hex': + ret = hexWrite(this, string, offset, length) + break + case 'utf8': + case 'utf-8': + ret = utf8Write(this, string, offset, length) + break + case 'ascii': + ret = asciiWrite(this, string, offset, length) + break + case 'binary': + ret = binaryWrite(this, string, offset, length) + break + case 'base64': + ret = base64Write(this, string, offset, length) + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = utf16leWrite(this, string, offset, length) + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.prototype.toString = function (encoding, start, end) { + var self = this + + encoding = String(encoding || 'utf8').toLowerCase() + start = Number(start) || 0 + end = (end === undefined) ? self.length : Number(end) + + // Fastpath empty strings + if (end === start) + return '' + + var ret + switch (encoding) { + case 'hex': + ret = hexSlice(self, start, end) + break + case 'utf8': + case 'utf-8': + ret = utf8Slice(self, start, end) + break + case 'ascii': + ret = asciiSlice(self, start, end) + break + case 'binary': + ret = binarySlice(self, start, end) + break + case 'base64': + ret = base64Slice(self, start, end) + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = utf16leSlice(self, start, end) + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.prototype.toJSON = function () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +Buffer.prototype.equals = function (b) { + assert(Buffer.isBuffer(b), 'Argument must be a Buffer') + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.compare = function (b) { + assert(Buffer.isBuffer(b), 'Argument must be a Buffer') + return Buffer.compare(this, b) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function (target, target_start, start, end) { + var source = this + + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (!target_start) target_start = 0 + + // Copy 0 bytes; we're done + if (end === start) return + if (target.length === 0 || source.length === 0) return + + // Fatal error conditions + assert(end >= start, 'sourceEnd < sourceStart') + assert(target_start >= 0 && target_start < target.length, + 'targetStart out of bounds') + assert(start >= 0 && start < source.length, 'sourceStart out of bounds') + assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) + end = this.length + if (target.length - target_start < end - start) + end = target.length - target_start + start + + var len = end - start + + if (len < 100 || !TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < len; i++) { + target[i + target_start] = this[i + start] + } + } else { + target._set(this.subarray(start, start + len), target_start) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + var res = '' + var tmp = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + if (buf[i] <= 0x7F) { + res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) + tmp = '' + } else { + tmp += '%' + buf[i].toString(16) + } + } + + return res + decodeUtf8Char(tmp) +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function binarySlice (buf, start, end) { + return asciiSlice(buf, start, end) +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; i++) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len; + if (start < 0) + start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) + end = 0 + } else if (end > len) { + end = len + } + + if (end < start) + end = start + + if (TYPED_ARRAY_SUPPORT) { + return Buffer._augment(this.subarray(start, end)) + } else { + var sliceLen = end - start + var newBuf = new Buffer(sliceLen, undefined, true) + for (var i = 0; i < sliceLen; i++) { + newBuf[i] = this[i + start] + } + return newBuf + } +} + +// `get` will be removed in Node 0.13+ +Buffer.prototype.get = function (offset) { + console.log('.get() is deprecated. Access using array indexes instead.') + return this.readUInt8(offset) +} + +// `set` will be removed in Node 0.13+ +Buffer.prototype.set = function (v, offset) { + console.log('.set() is deprecated. Access using array indexes instead.') + return this.writeUInt8(v, offset) +} + +Buffer.prototype.readUInt8 = function (offset, noAssert) { + if (!noAssert) { + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'Trying to read beyond buffer length') + } + + if (offset >= this.length) + return + + return this[offset] +} + +function readUInt16 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val + if (littleEndian) { + val = buf[offset] + if (offset + 1 < len) + val |= buf[offset + 1] << 8 + } else { + val = buf[offset] << 8 + if (offset + 1 < len) + val |= buf[offset + 1] + } + return val +} + +Buffer.prototype.readUInt16LE = function (offset, noAssert) { + return readUInt16(this, offset, true, noAssert) +} + +Buffer.prototype.readUInt16BE = function (offset, noAssert) { + return readUInt16(this, offset, false, noAssert) +} + +function readUInt32 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val + if (littleEndian) { + if (offset + 2 < len) + val = buf[offset + 2] << 16 + if (offset + 1 < len) + val |= buf[offset + 1] << 8 + val |= buf[offset] + if (offset + 3 < len) + val = val + (buf[offset + 3] << 24 >>> 0) + } else { + if (offset + 1 < len) + val = buf[offset + 1] << 16 + if (offset + 2 < len) + val |= buf[offset + 2] << 8 + if (offset + 3 < len) + val |= buf[offset + 3] + val = val + (buf[offset] << 24 >>> 0) + } + return val +} + +Buffer.prototype.readUInt32LE = function (offset, noAssert) { + return readUInt32(this, offset, true, noAssert) +} + +Buffer.prototype.readUInt32BE = function (offset, noAssert) { + return readUInt32(this, offset, false, noAssert) +} + +Buffer.prototype.readInt8 = function (offset, noAssert) { + if (!noAssert) { + assert(offset !== undefined && offset !== null, + 'missing offset') + assert(offset < this.length, 'Trying to read beyond buffer length') + } + + if (offset >= this.length) + return + + var neg = this[offset] & 0x80 + if (neg) + return (0xff - this[offset] + 1) * -1 + else + return this[offset] +} + +function readInt16 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val = readUInt16(buf, offset, littleEndian, true) + var neg = val & 0x8000 + if (neg) + return (0xffff - val + 1) * -1 + else + return val +} + +Buffer.prototype.readInt16LE = function (offset, noAssert) { + return readInt16(this, offset, true, noAssert) +} + +Buffer.prototype.readInt16BE = function (offset, noAssert) { + return readInt16(this, offset, false, noAssert) +} + +function readInt32 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val = readUInt32(buf, offset, littleEndian, true) + var neg = val & 0x80000000 + if (neg) + return (0xffffffff - val + 1) * -1 + else + return val +} + +Buffer.prototype.readInt32LE = function (offset, noAssert) { + return readInt32(this, offset, true, noAssert) +} + +Buffer.prototype.readInt32BE = function (offset, noAssert) { + return readInt32(this, offset, false, noAssert) +} + +function readFloat (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + return ieee754.read(buf, offset, littleEndian, 23, 4) +} + +Buffer.prototype.readFloatLE = function (offset, noAssert) { + return readFloat(this, offset, true, noAssert) +} + +Buffer.prototype.readFloatBE = function (offset, noAssert) { + return readFloat(this, offset, false, noAssert) +} + +function readDouble (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset + 7 < buf.length, 'Trying to read beyond buffer length') + } + + return ieee754.read(buf, offset, littleEndian, 52, 8) +} + +Buffer.prototype.readDoubleLE = function (offset, noAssert) { + return readDouble(this, offset, true, noAssert) +} + +Buffer.prototype.readDoubleBE = function (offset, noAssert) { + return readDouble(this, offset, false, noAssert) +} + +Buffer.prototype.writeUInt8 = function (value, offset, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'trying to write beyond buffer length') + verifuint(value, 0xff) + } + + if (offset >= this.length) return + + this[offset] = value + return offset + 1 +} + +function writeUInt16 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'trying to write beyond buffer length') + verifuint(value, 0xffff) + } + + var len = buf.length + if (offset >= len) + return + + for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) { + buf[offset + i] = + (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } + return offset + 2 +} + +Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) { + return writeUInt16(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) { + return writeUInt16(this, value, offset, false, noAssert) +} + +function writeUInt32 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'trying to write beyond buffer length') + verifuint(value, 0xffffffff) + } + + var len = buf.length + if (offset >= len) + return + + for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) { + buf[offset + i] = + (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } + return offset + 4 +} + +Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) { + return writeUInt32(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) { + return writeUInt32(this, value, offset, false, noAssert) +} + +Buffer.prototype.writeInt8 = function (value, offset, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7f, -0x80) + } + + if (offset >= this.length) + return + + if (value >= 0) + this.writeUInt8(value, offset, noAssert) + else + this.writeUInt8(0xff + value + 1, offset, noAssert) + return offset + 1 +} + +function writeInt16 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7fff, -0x8000) + } + + var len = buf.length + if (offset >= len) + return + + if (value >= 0) + writeUInt16(buf, value, offset, littleEndian, noAssert) + else + writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert) + return offset + 2 +} + +Buffer.prototype.writeInt16LE = function (value, offset, noAssert) { + return writeInt16(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeInt16BE = function (value, offset, noAssert) { + return writeInt16(this, value, offset, false, noAssert) +} + +function writeInt32 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7fffffff, -0x80000000) + } + + var len = buf.length + if (offset >= len) + return + + if (value >= 0) + writeUInt32(buf, value, offset, littleEndian, noAssert) + else + writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert) + return offset + 4 +} + +Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { + return writeInt32(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeInt32BE = function (value, offset, noAssert) { + return writeInt32(this, value, offset, false, noAssert) +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') + verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + + var len = buf.length + if (offset >= len) + return + + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 7 < buf.length, + 'Trying to write beyond buffer length') + verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + + var len = buf.length + if (offset >= len) + return + + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// fill(value, start=0, end=buffer.length) +Buffer.prototype.fill = function (value, start, end) { + if (!value) value = 0 + if (!start) start = 0 + if (!end) end = this.length + + assert(end >= start, 'end < start') + + // Fill 0 bytes; we're done + if (end === start) return + if (this.length === 0) return + + assert(start >= 0 && start < this.length, 'start out of bounds') + assert(end >= 0 && end <= this.length, 'end out of bounds') + + var i + if (typeof value === 'number') { + for (i = start; i < end; i++) { + this[i] = value + } + } else { + var bytes = utf8ToBytes(value.toString()) + var len = bytes.length + for (i = start; i < end; i++) { + this[i] = bytes[i % len] + } + } + + return this +} + +Buffer.prototype.inspect = function () { + var out = [] + var len = this.length + for (var i = 0; i < len; i++) { + out[i] = toHex(this[i]) + if (i === exports.INSPECT_MAX_BYTES) { + out[i + 1] = '...' + break + } + } + return '' +} + +/** + * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. + * Added in Node 0.12. Only available in browsers that support ArrayBuffer. + */ +Buffer.prototype.toArrayBuffer = function () { + if (typeof Uint8Array !== 'undefined') { + if (TYPED_ARRAY_SUPPORT) { + return (new Buffer(this)).buffer + } else { + var buf = new Uint8Array(this.length) + for (var i = 0, len = buf.length; i < len; i += 1) { + buf[i] = this[i] + } + return buf.buffer + } + } else { + throw new Error('Buffer.toArrayBuffer not supported in this browser') + } +} + +// HELPER FUNCTIONS +// ================ + +var BP = Buffer.prototype + +/** + * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods + */ +Buffer._augment = function (arr) { + arr._isBuffer = true + + // save reference to original Uint8Array get/set methods before overwriting + arr._get = arr.get + arr._set = arr.set + + // deprecated, will be removed in node 0.13+ + arr.get = BP.get + arr.set = BP.set + + arr.write = BP.write + arr.toString = BP.toString + arr.toLocaleString = BP.toString + arr.toJSON = BP.toJSON + arr.equals = BP.equals + arr.compare = BP.compare + arr.copy = BP.copy + arr.slice = BP.slice + arr.readUInt8 = BP.readUInt8 + arr.readUInt16LE = BP.readUInt16LE + arr.readUInt16BE = BP.readUInt16BE + arr.readUInt32LE = BP.readUInt32LE + arr.readUInt32BE = BP.readUInt32BE + arr.readInt8 = BP.readInt8 + arr.readInt16LE = BP.readInt16LE + arr.readInt16BE = BP.readInt16BE + arr.readInt32LE = BP.readInt32LE + arr.readInt32BE = BP.readInt32BE + arr.readFloatLE = BP.readFloatLE + arr.readFloatBE = BP.readFloatBE + arr.readDoubleLE = BP.readDoubleLE + arr.readDoubleBE = BP.readDoubleBE + arr.writeUInt8 = BP.writeUInt8 + arr.writeUInt16LE = BP.writeUInt16LE + arr.writeUInt16BE = BP.writeUInt16BE + arr.writeUInt32LE = BP.writeUInt32LE + arr.writeUInt32BE = BP.writeUInt32BE + arr.writeInt8 = BP.writeInt8 + arr.writeInt16LE = BP.writeInt16LE + arr.writeInt16BE = BP.writeInt16BE + arr.writeInt32LE = BP.writeInt32LE + arr.writeInt32BE = BP.writeInt32BE + arr.writeFloatLE = BP.writeFloatLE + arr.writeFloatBE = BP.writeFloatBE + arr.writeDoubleLE = BP.writeDoubleLE + arr.writeDoubleBE = BP.writeDoubleBE + arr.fill = BP.fill + arr.inspect = BP.inspect + arr.toArrayBuffer = BP.toArrayBuffer + + return arr +} + +var INVALID_BASE64_RE = /[^+\/0-9A-z]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function isArray (subject) { + return (Array.isArray || function (subject) { + return Object.prototype.toString.call(subject) === '[object Array]' + })(subject) +} + +function isArrayish (subject) { + return isArray(subject) || Buffer.isBuffer(subject) || + subject && typeof subject === 'object' && + typeof subject.length === 'number' +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + var b = str.charCodeAt(i) + if (b <= 0x7F) { + byteArray.push(b) + } else { + var start = i + if (b >= 0xD800 && b <= 0xDFFF) i++ + var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%') + for (var j = 0; j < h.length; j++) { + byteArray.push(parseInt(h[j], 16)) + } + } + } + return byteArray +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(str) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; i++) { + if ((i + offset >= dst.length) || (i >= src.length)) + break + dst[i + offset] = src[i] + } + return i +} + +function decodeUtf8Char (str) { + try { + return decodeURIComponent(str) + } catch (err) { + return String.fromCharCode(0xFFFD) // UTF 8 invalid char + } +} + +/* + * We have to make sure that the value is a valid integer. This means that it + * is non-negative. It has no fractional component and that it does not + * exceed the maximum allowed value. + */ +function verifuint (value, max) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value >= 0, 'specified a negative value for writing an unsigned value') + assert(value <= max, 'value is larger than maximum value for type') + assert(Math.floor(value) === value, 'value has a fractional component') +} + +function verifsint (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value <= max, 'value larger than maximum allowed value') + assert(value >= min, 'value smaller than minimum allowed value') + assert(Math.floor(value) === value, 'value has a fractional component') +} + +function verifIEEE754 (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value <= max, 'value larger than maximum allowed value') + assert(value >= min, 'value smaller than minimum allowed value') +} + +function assert (test, message) { + if (!test) throw new Error(message || 'Failed assertion') +} + +},{"base64-js":38,"ieee754":39}],38:[function(require,module,exports){ +module.exports=require(7) +},{}],39:[function(require,module,exports){ +module.exports=require(8) +},{}],40:[function(require,module,exports){ +arguments[4][1][0].apply(exports,arguments) +},{"./md5":44,"buffer":37,"ripemd160":45,"sha.js":47}],41:[function(require,module,exports){ +(function (Buffer){ +var createHash = require('./create-hash') + +var blocksize = 64 +var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0) + +module.exports = Hmac + +function Hmac (alg, key) { + if(!(this instanceof Hmac)) return new Hmac(alg, key) + this._opad = opad + this._alg = alg + + key = this._key = !Buffer.isBuffer(key) ? new Buffer(key) : key + + if(key.length > blocksize) { + key = createHash(alg).update(key).digest() + } else if(key.length < blocksize) { + key = Buffer.concat([key, zeroBuffer], blocksize) + } + + var ipad = this._ipad = new Buffer(blocksize) + var opad = this._opad = new Buffer(blocksize) + + for(var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + this._hash = createHash(alg).update(ipad) +} + +Hmac.prototype.update = function (data, enc) { + this._hash.update(data, enc) + return this +} + +Hmac.prototype.digest = function (enc) { + var h = this._hash.digest() + return createHash(this._alg).update(this._opad).update(h).digest(enc) +} + + +}).call(this,require("buffer").Buffer) +},{"./create-hash":40,"buffer":37}],42:[function(require,module,exports){ +module.exports=require(3) +},{"buffer":37}],43:[function(require,module,exports){ +(function (Buffer){ +var rng = require('./rng') + +function error () { + var m = [].slice.call(arguments).join(' ') + throw new Error([ + m, + 'we accept pull requests', + 'http://github.com/dominictarr/crypto-browserify' + ].join('\n')) +} + +exports.createHash = require('./create-hash') + +exports.createHmac = require('./create-hmac') + +exports.randomBytes = function(size, callback) { + if (callback && callback.call) { + try { + callback.call(this, undefined, new Buffer(rng(size))) + } catch (err) { callback(err) } + } else { + return new Buffer(rng(size)) + } +} + +function each(a, f) { + for(var i in a) + f(a[i], i) +} + +exports.getHashes = function () { + return ['sha1', 'sha256', 'md5', 'rmd160'] + +} + +var p = require('./pbkdf2')(exports.createHmac) +exports.pbkdf2 = p.pbkdf2 +exports.pbkdf2Sync = p.pbkdf2Sync + + +// the least I can do is make error messages for the rest of the node.js/crypto api. +each(['createCredentials' +, 'createCipher' +, 'createCipheriv' +, 'createDecipher' +, 'createDecipheriv' +, 'createSign' +, 'createVerify' +, 'createDiffieHellman' +], function (name) { + exports[name] = function () { + error('sorry,', name, 'is not implemented yet') + } +}) + +}).call(this,require("buffer").Buffer) +},{"./create-hash":40,"./create-hmac":41,"./pbkdf2":51,"./rng":52,"buffer":37}],44:[function(require,module,exports){ +module.exports=require(5) +},{"./helpers":42}],45:[function(require,module,exports){ +module.exports=require(12) +},{"buffer":37}],46:[function(require,module,exports){ +var u = require('./util') +var write = u.write +var fill = u.zeroFill + +module.exports = function (Buffer) { + + //prototype class for hash functions + function Hash (blockSize, finalSize) { + this._block = new Buffer(blockSize) //new Uint32Array(blockSize/4) + this._finalSize = finalSize + this._blockSize = blockSize + this._len = 0 + this._s = 0 + } + + Hash.prototype.init = function () { + this._s = 0 + this._len = 0 + } + + function lengthOf(data, enc) { + if(enc == null) return data.byteLength || data.length + if(enc == 'ascii' || enc == 'binary') return data.length + if(enc == 'hex') return data.length/2 + if(enc == 'base64') return data.length/3 + } + + Hash.prototype.update = function (data, enc) { + var bl = this._blockSize + + //I'd rather do this with a streaming encoder, like the opposite of + //http://nodejs.org/api/string_decoder.html + var length + if(!enc && 'string' === typeof data) + enc = 'utf8' + + if(enc) { + if(enc === 'utf-8') + enc = 'utf8' + + if(enc === 'base64' || enc === 'utf8') + data = new Buffer(data, enc), enc = null + + length = lengthOf(data, enc) + } else + length = data.byteLength || data.length + + var l = this._len += length + var s = this._s = (this._s || 0) + var f = 0 + var buffer = this._block + while(s < l) { + var t = Math.min(length, f + bl - s%bl) + write(buffer, data, enc, s%bl, f, t) + var ch = (t - f); + s += ch; f += ch + + if(!(s%bl)) + this._update(buffer) + } + this._s = s + + return this + + } + + Hash.prototype.digest = function (enc) { + var bl = this._blockSize + var fl = this._finalSize + var len = this._len*8 + + var x = this._block + + var bits = len % (bl*8) + + //add end marker, so that appending 0's creats a different hash. + x[this._len % bl] = 0x80 + fill(this._block, this._len % bl + 1) + + if(bits >= fl*8) { + this._update(this._block) + u.zeroFill(this._block, 0) + } + + //TODO: handle case where the bit length is > Math.pow(2, 29) + x.writeInt32BE(len, fl + 4) //big endian + + var hash = this._update(this._block) || this._hash() + if(enc == null) return hash + return hash.toString(enc) + } + + Hash.prototype._update = function () { + throw new Error('_update must be implemented by subclass') + } + + return Hash +} + +},{"./util":50}],47:[function(require,module,exports){ +var exports = module.exports = function (alg) { + var Alg = exports[alg] + if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)') + return new Alg() +} + +var Buffer = require('buffer').Buffer +var Hash = require('./hash')(Buffer) + +exports.sha = +exports.sha1 = require('./sha1')(Buffer, Hash) +exports.sha256 = require('./sha256')(Buffer, Hash) + +},{"./hash":46,"./sha1":48,"./sha256":49,"buffer":37}],48:[function(require,module,exports){ +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS PUB 180-1 + * Version 2.1a Copyright Paul Johnston 2000 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ +module.exports = function (Buffer, Hash) { + + var inherits = require('util').inherits + + inherits(Sha1, Hash) + + var A = 0|0 + var B = 4|0 + var C = 8|0 + var D = 12|0 + var E = 16|0 + + var BE = false + var LE = true + + var W = new Int32Array(80) + + var POOL = [] + + function Sha1 () { + if(POOL.length) + return POOL.pop().init() + + if(!(this instanceof Sha1)) return new Sha1() + this._w = W + Hash.call(this, 16*4, 14*4) + + this._h = null + this.init() + } + + Sha1.prototype.init = function () { + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 + this._e = 0xc3d2e1f0 + + Hash.prototype.init.call(this) + return this + } + + Sha1.prototype._POOL = POOL + + // assume that array is a Uint32Array with length=16, + // and that if it is the last block, it already has the length and the 1 bit appended. + + + var isDV = new Buffer(1) instanceof DataView + function readInt32BE (X, i) { + return isDV + ? X.getInt32(i, false) + : X.readInt32BE(i) + } + + Sha1.prototype._update = function (array) { + + var X = this._block + var h = this._h + var a, b, c, d, e, _a, _b, _c, _d, _e + + a = _a = this._a + b = _b = this._b + c = _c = this._c + d = _d = this._d + e = _e = this._e + + var w = this._w + + for(var j = 0; j < 80; j++) { + var W = w[j] + = j < 16 + //? X.getInt32(j*4, false) + //? readInt32BE(X, j*4) //*/ X.readInt32BE(j*4) //*/ + ? X.readInt32BE(j*4) + : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1) + + var t = + add( + add(rol(a, 5), sha1_ft(j, b, c, d)), + add(add(e, W), sha1_kt(j)) + ); + + e = d + d = c + c = rol(b, 30) + b = a + a = t + } + + this._a = add(a, _a) + this._b = add(b, _b) + this._c = add(c, _c) + this._d = add(d, _d) + this._e = add(e, _e) + } + + Sha1.prototype._hash = function () { + if(POOL.length < 100) POOL.push(this) + var H = new Buffer(20) + //console.log(this._a|0, this._b|0, this._c|0, this._d|0, this._e|0) + H.writeInt32BE(this._a|0, A) + H.writeInt32BE(this._b|0, B) + H.writeInt32BE(this._c|0, C) + H.writeInt32BE(this._d|0, D) + H.writeInt32BE(this._e|0, E) + return H + } + + /* + * Perform the appropriate triplet combination function for the current + * iteration + */ + function sha1_ft(t, b, c, d) { + if(t < 20) return (b & c) | ((~b) & d); + if(t < 40) return b ^ c ^ d; + if(t < 60) return (b & c) | (b & d) | (c & d); + return b ^ c ^ d; + } + + /* + * Determine the appropriate additive constant for the current iteration + */ + function sha1_kt(t) { + return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : + (t < 60) ? -1894007588 : -899497514; + } + + /* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + * //dominictarr: this is 10 years old, so maybe this can be dropped?) + * + */ + function add(x, y) { + return (x + y ) | 0 + //lets see how this goes on testling. + // var lsw = (x & 0xFFFF) + (y & 0xFFFF); + // var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + // return (msw << 16) | (lsw & 0xFFFF); + } + + /* + * Bitwise rotate a 32-bit number to the left. + */ + function rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + } + + return Sha1 +} + +},{"util":72}],49:[function(require,module,exports){ + +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = require('util').inherits +var BE = false +var LE = true +var u = require('./util') + +module.exports = function (Buffer, Hash) { + + var K = [ + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 + ] + + inherits(Sha256, Hash) + var W = new Array(64) + var POOL = [] + function Sha256() { + if(POOL.length) { + //return POOL.shift().init() + } + //this._data = new Buffer(32) + + this.init() + + this._w = W //new Array(64) + + Hash.call(this, 16*4, 14*4) + }; + + Sha256.prototype.init = function () { + + this._a = 0x6a09e667|0 + this._b = 0xbb67ae85|0 + this._c = 0x3c6ef372|0 + this._d = 0xa54ff53a|0 + this._e = 0x510e527f|0 + this._f = 0x9b05688c|0 + this._g = 0x1f83d9ab|0 + this._h = 0x5be0cd19|0 + + this._len = this._s = 0 + + return this + } + + var safe_add = function(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + function S (X, n) { + return (X >>> n) | (X << (32 - n)); + } + + function R (X, n) { + return (X >>> n); + } + + function Ch (x, y, z) { + return ((x & y) ^ ((~x) & z)); + } + + function Maj (x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); + } + + function Sigma0256 (x) { + return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); + } + + function Sigma1256 (x) { + return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); + } + + function Gamma0256 (x) { + return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); + } + + function Gamma1256 (x) { + return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); + } + + Sha256.prototype._update = function(m) { + var M = this._block + var W = this._w + var a, b, c, d, e, f, g, h + var T1, T2 + + a = this._a | 0 + b = this._b | 0 + c = this._c | 0 + d = this._d | 0 + e = this._e | 0 + f = this._f | 0 + g = this._g | 0 + h = this._h | 0 + + for (var j = 0; j < 64; j++) { + var w = W[j] = j < 16 + ? M.readInt32BE(j * 4) + : Gamma1256(W[j - 2]) + W[j - 7] + Gamma0256(W[j - 15]) + W[j - 16] + + T1 = h + Sigma1256(e) + Ch(e, f, g) + K[j] + w + + T2 = Sigma0256(a) + Maj(a, b, c); + h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 + this._f = (f + this._f) | 0 + this._g = (g + this._g) | 0 + this._h = (h + this._h) | 0 + + }; + + Sha256.prototype._hash = function () { + if(POOL.length < 10) + POOL.push(this) + + var H = new Buffer(32) + + H.writeInt32BE(this._a, 0) + H.writeInt32BE(this._b, 4) + H.writeInt32BE(this._c, 8) + H.writeInt32BE(this._d, 12) + H.writeInt32BE(this._e, 16) + H.writeInt32BE(this._f, 20) + H.writeInt32BE(this._g, 24) + H.writeInt32BE(this._h, 28) + + return H + } + + return Sha256 + +} + +},{"./util":50,"util":72}],50:[function(require,module,exports){ +exports.write = write +exports.zeroFill = zeroFill + +exports.toString = toString + +function write (buffer, string, enc, start, from, to, LE) { + var l = (to - from) + if(enc === 'ascii' || enc === 'binary') { + for( var i = 0; i < l; i++) { + buffer[start + i] = string.charCodeAt(i + from) + } + } + else if(enc == null) { + for( var i = 0; i < l; i++) { + buffer[start + i] = string[i + from] + } + } + else if(enc === 'hex') { + for(var i = 0; i < l; i++) { + var j = from + i + buffer[start + i] = parseInt(string[j*2] + string[(j*2)+1], 16) + } + } + else if(enc === 'base64') { + throw new Error('base64 encoding not yet supported') + } + else + throw new Error(enc +' encoding not yet supported') +} + +//always fill to the end! +function zeroFill(buf, from) { + for(var i = from; i < buf.length; i++) + buf[i] = 0 +} + + +},{}],51:[function(require,module,exports){ +(function (Buffer){ +// JavaScript PBKDF2 Implementation +// Based on http://git.io/qsv2zw +// Licensed under LGPL v3 +// Copyright (c) 2013 jduncanator + +var blocksize = 64 +var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0) + +module.exports = function (createHmac, exports) { + exports = exports || {} + + exports.pbkdf2 = function(password, salt, iterations, keylen, cb) { + if('function' !== typeof cb) + throw new Error('No callback provided to pbkdf2'); + setTimeout(function () { + cb(null, exports.pbkdf2Sync(password, salt, iterations, keylen)) + }) + } + + exports.pbkdf2Sync = function(key, salt, iterations, keylen) { + if('number' !== typeof iterations) + throw new TypeError('Iterations not a number') + if(iterations < 0) + throw new TypeError('Bad iterations') + if('number' !== typeof keylen) + throw new TypeError('Key length not a number') + if(keylen < 0) + throw new TypeError('Bad key length') + + //stretch key to the correct length that hmac wants it, + //otherwise this will happen every time hmac is called + //twice per iteration. + var key = !Buffer.isBuffer(key) ? new Buffer(key) : key + + if(key.length > blocksize) { + key = createHash(alg).update(key).digest() + } else if(key.length < blocksize) { + key = Buffer.concat([key, zeroBuffer], blocksize) + } + + var HMAC; + var cplen, p = 0, i = 1, itmp = new Buffer(4), digtmp; + var out = new Buffer(keylen); + out.fill(0); + while(keylen) { + if(keylen > 20) + cplen = 20; + else + cplen = keylen; + + /* We are unlikely to ever use more than 256 blocks (5120 bits!) + * but just in case... + */ + itmp[0] = (i >> 24) & 0xff; + itmp[1] = (i >> 16) & 0xff; + itmp[2] = (i >> 8) & 0xff; + itmp[3] = i & 0xff; + + HMAC = createHmac('sha1', key); + HMAC.update(salt) + HMAC.update(itmp); + digtmp = HMAC.digest(); + digtmp.copy(out, p, 0, cplen); + + for(var j = 1; j < iterations; j++) { + HMAC = createHmac('sha1', key); + HMAC.update(digtmp); + digtmp = HMAC.digest(); + for(var k = 0; k < cplen; k++) { + out[k] ^= digtmp[k]; + } + } + keylen -= cplen; + i++; + p += cplen; + } + + return out; + } + + return exports +} + +}).call(this,require("buffer").Buffer) +},{"buffer":37}],52:[function(require,module,exports){ +(function (Buffer){ +(function() { + module.exports = function(size) { + var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array + /* This will not work in older browsers. + * See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + */ + crypto.getRandomValues(bytes); + return bytes; + } +}()) + +}).call(this,require("buffer").Buffer) +},{"buffer":37}],53:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + throw TypeError('Uncaught, unspecified "error" event.'); + } + return false; + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + handler.apply(this, args); + } + } else if (isObject(handler)) { + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + var m; + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.listenerCount = function(emitter, type) { + var ret; + if (!emitter._events || !emitter._events[type]) + ret = 0; + else if (isFunction(emitter._events[type])) + ret = 1; + else + ret = emitter._events[type].length; + return ret; +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + +},{}],54:[function(require,module,exports){ +module.exports=require(26) +},{}],55:[function(require,module,exports){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +},{}],56:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +}).call(this,require('_process')) +},{"_process":57}],57:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + if (canPost) { + var queue = []; + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +} + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}],58:[function(require,module,exports){ +module.exports = require("./lib/_stream_duplex.js") + +},{"./lib/_stream_duplex.js":59}],59:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +module.exports = Duplex; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +forEach(objectKeys(Writable.prototype), function(method) { + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +}); + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(this.end.bind(this)); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +}).call(this,require('_process')) +},{"./_stream_readable":61,"./_stream_writable":63,"_process":57,"core-util-is":64,"inherits":54}],60:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; + +},{"./_stream_transform":62,"core-util-is":64,"inherits":54}],61:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; + +/**/ +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +var Stream = require('stream'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + options = options || {}; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = false; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // In streams that never have any data, and do push(null) right away, + // the consumer can miss the 'end' event if they do some I/O before + // consuming the stream. So, we don't emit('end') until some reading + // happens. + this.calledRead = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (typeof chunk === 'string' && !state.objectMode) { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null || chunk === undefined) { + state.reading = false; + if (!state.ended) + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) { + state.buffer.unshift(chunk); + } else { + state.reading = false; + state.buffer.push(chunk); + } + + if (state.needReadable) + emitReadable(stream); + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (isNaN(n) || n === null) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else + return state.length; + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + var state = this._readableState; + state.calledRead = true; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + + // if we currently have less than the highWaterMark, then also read some + if (state.length - n <= state.highWaterMark) + doRead = true; + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) + doRead = false; + + if (doRead) { + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read called its callback synchronously, then `reading` + // will be false, and we need to re-evaluate how much data we + // can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we happened to read() exactly the remaining amount in the + // buffer, and the EOF has been seen at this point, then make sure + // that we emit 'end' on the very next tick. + if (state.ended && !state.endEmitted && state.length === 0) + endReadable(this); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode && + !er) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // if we've ended and we have some data left, then emit + // 'readable' now to make sure it gets picked up. + if (state.length > 0) + emitReadable(stream); + else + endReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (state.emittedReadable) + return; + + state.emittedReadable = true; + if (state.sync) + process.nextTick(function() { + emitReadable_(stream); + }); + else + emitReadable_(stream); +} + +function emitReadable_(stream) { + stream.emit('readable'); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(function() { + maybeReadMore_(stream, state); + }); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + process.nextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + if (readable !== src) return; + cleanup(); + } + + function onend() { + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (!dest._writableState || dest._writableState.needDrain) + ondrain(); + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + // the handler that waits for readable events after all + // the data gets sucked out in flow. + // This would be easier to follow with a .once() handler + // in flow(), but that is too slow. + this.on('readable', pipeOnReadable); + + state.flowing = true; + process.nextTick(function() { + flow(src); + }); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var dest = this; + var state = src._readableState; + state.awaitDrain--; + if (state.awaitDrain === 0) + flow(src); + }; +} + +function flow(src) { + var state = src._readableState; + var chunk; + state.awaitDrain = 0; + + function write(dest, i, list) { + var written = dest.write(chunk); + if (false === written) { + state.awaitDrain++; + } + } + + while (state.pipesCount && null !== (chunk = src.read())) { + + if (state.pipesCount === 1) + write(state.pipes, 0, null); + else + forEach(state.pipes, write); + + src.emit('data', chunk); + + // if anyone needs a drain, then we have to wait for that. + if (state.awaitDrain > 0) + return; + } + + // if every destination was unpiped, either before entering this + // function, or in the while loop, then stop flowing. + // + // NB: This is a pretty rare edge case. + if (state.pipesCount === 0) { + state.flowing = false; + + // if there were data event listeners added, then switch to old mode. + if (EE.listenerCount(src, 'data') > 0) + emitDataEvents(src); + return; + } + + // at this point, no one needed a drain, so we just ran out of data + // on the next readable event, start it over again. + state.ranOut = true; +} + +function pipeOnReadable() { + if (this._readableState.ranOut) { + this._readableState.ranOut = false; + flow(this); + } +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data' && !this._readableState.flowing) + emitDataEvents(this); + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + this.read(0); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + emitDataEvents(this); + this.read(0); + this.emit('resume'); +}; + +Readable.prototype.pause = function() { + emitDataEvents(this, true); + this.emit('pause'); +}; + +function emitDataEvents(stream, startPaused) { + var state = stream._readableState; + + if (state.flowing) { + // https://github.com/isaacs/readable-stream/issues/16 + throw new Error('Cannot switch to old mode now.'); + } + + var paused = startPaused || false; + var readable = false; + + // convert to an old-style stream. + stream.readable = true; + stream.pipe = Stream.prototype.pipe; + stream.on = stream.addListener = Stream.prototype.on; + + stream.on('readable', function() { + readable = true; + + var c; + while (!paused && (null !== (c = stream.read()))) + stream.emit('data', c); + + if (c === null) { + readable = false; + stream._readableState.needReadable = true; + } + }); + + stream.pause = function() { + paused = true; + this.emit('pause'); + }; + + stream.resume = function() { + paused = false; + if (readable) + process.nextTick(function() { + stream.emit('readable'); + }); + else + this.read(0); + this.emit('resume'); + }; + + // now make it start, just in case it hadn't already. + stream.emit('readable'); +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + if (state.decoder) + chunk = state.decoder.write(chunk); + if (!chunk || !state.objectMode && !chunk.length) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (typeof stream[i] === 'function' && + typeof this[i] === 'undefined') { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }}(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted && state.calledRead) { + state.ended = true; + process.nextTick(function() { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } + }); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +}).call(this,require('_process')) +},{"_process":57,"buffer":37,"core-util-is":64,"events":53,"inherits":54,"isarray":55,"stream":70,"string_decoder/":65}],62:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + + +function TransformState(options, stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + var ts = this._transformState = new TransformState(options, this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + this.once('finish', function() { + if ('function' === typeof this._flush) + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var rs = stream._readableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} + +},{"./_stream_duplex":59,"core-util-is":64,"inherits":54}],63:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +module.exports = Writable; + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + + +var Stream = require('stream'); + +util.inherits(Writable, Stream); + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; +} + +function WritableState(options, stream) { + options = options || {}; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.buffer = []; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; +} + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, state, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (typeof cb !== 'function') + cb = function() {}; + + if (state.ended) + writeAfterEnd(this, state, cb); + else if (validChunk(this, state, chunk, cb)) + ret = writeOrBuffer(this, state, chunk, encoding, cb); + + return ret; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing) + state.buffer.push(new WriteReq(chunk, encoding, cb)); + else + doWrite(stream, state, len, chunk, encoding, cb); + + return ret; +} + +function doWrite(stream, state, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + if (sync) + process.nextTick(function() { + cb(er); + }); + else + cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(stream, state); + + if (!finished && !state.bufferProcessing && state.buffer.length) + clearBuffer(stream, state); + + if (sync) { + process.nextTick(function() { + afterWrite(stream, state, finished, cb); + }); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + cb(); + if (finished) + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + + for (var c = 0; c < state.buffer.length; c++) { + var entry = state.buffer[c]; + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, len, chunk, encoding, cb); + + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + c++; + break; + } + } + + state.bufferProcessing = false; + if (c < state.buffer.length) + state.buffer = state.buffer.slice(c); + else + state.buffer.length = 0; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (typeof chunk !== 'undefined' && chunk !== null) + this.write(chunk, encoding); + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + +function finishMaybe(stream, state) { + var need = needFinish(stream, state); + if (need) { + state.finished = true; + stream.emit('finish'); + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + process.nextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} + +}).call(this,require('_process')) +},{"./_stream_duplex":59,"_process":57,"buffer":37,"core-util-is":64,"inherits":54,"stream":70}],64:[function(require,module,exports){ +(function (Buffer){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return Buffer.isBuffer(arg); +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} +}).call(this,require("buffer").Buffer) +},{"buffer":37}],65:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.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 true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + this.charBuffer = new Buffer(6); + this.charReceived = 0; + this.charLength = 0; +}; + + +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + var offset = 0; + + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var i = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, offset, i); + this.charReceived += (i - offset); + offset = i; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (i == buffer.length) return charStr; + + // otherwise cut off the characters end from the beginning of this buffer + buffer = buffer.slice(i, buffer.length); + break; + } + + var lenIncomplete = this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end); + this.charReceived = lenIncomplete; + end -= lenIncomplete; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + + return i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + var incomplete = this.charReceived = buffer.length % 2; + this.charLength = incomplete ? 2 : 0; + return incomplete; +} + +function base64DetectIncompleteChar(buffer) { + var incomplete = this.charReceived = buffer.length % 3; + this.charLength = incomplete ? 3 : 0; + return incomplete; +} + +},{"buffer":37}],66:[function(require,module,exports){ +module.exports = require("./lib/_stream_passthrough.js") + +},{"./lib/_stream_passthrough.js":60}],67:[function(require,module,exports){ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +},{"./lib/_stream_duplex.js":59,"./lib/_stream_passthrough.js":60,"./lib/_stream_readable.js":61,"./lib/_stream_transform.js":62,"./lib/_stream_writable.js":63}],68:[function(require,module,exports){ +module.exports = require("./lib/_stream_transform.js") + +},{"./lib/_stream_transform.js":62}],69:[function(require,module,exports){ +module.exports = require("./lib/_stream_writable.js") + +},{"./lib/_stream_writable.js":63}],70:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = Stream; + +var EE = require('events').EventEmitter; +var inherits = require('inherits'); + +inherits(Stream, EE); +Stream.Readable = require('readable-stream/readable.js'); +Stream.Writable = require('readable-stream/writable.js'); +Stream.Duplex = require('readable-stream/duplex.js'); +Stream.Transform = require('readable-stream/transform.js'); +Stream.PassThrough = require('readable-stream/passthrough.js'); + +// Backwards-compat with node 0.4.x +Stream.Stream = Stream; + + + +// old-style streams. Note that the pipe method (the only relevant +// part of this class) is overridden in the Readable class. + +function Stream() { + EE.call(this); +} + +Stream.prototype.pipe = function(dest, options) { + var source = this; + + function ondata(chunk) { + if (dest.writable) { + if (false === dest.write(chunk) && source.pause) { + source.pause(); + } + } + } + + source.on('data', ondata); + + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + + dest.on('drain', ondrain); + + // If the 'end' option is not supplied, dest.end() will be called when + // source gets the 'end' or 'close' events. Only dest.end() once. + if (!dest._isStdio && (!options || options.end !== false)) { + source.on('end', onend); + source.on('close', onclose); + } + + var didOnEnd = false; + function onend() { + if (didOnEnd) return; + didOnEnd = true; + + dest.end(); + } + + + function onclose() { + if (didOnEnd) return; + didOnEnd = true; + + if (typeof dest.destroy === 'function') dest.destroy(); + } + + // don't leave dangling pipes when there are errors. + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, 'error') === 0) { + throw er; // Unhandled stream error in pipe. + } + } + + source.on('error', onerror); + dest.on('error', onerror); + + // remove all the event listeners that were added. + function cleanup() { + source.removeListener('data', ondata); + dest.removeListener('drain', ondrain); + + source.removeListener('end', onend); + source.removeListener('close', onclose); + + source.removeListener('error', onerror); + dest.removeListener('error', onerror); + + source.removeListener('end', cleanup); + source.removeListener('close', cleanup); + + dest.removeListener('close', cleanup); + } + + source.on('end', cleanup); + source.on('close', cleanup); + + dest.on('close', cleanup); + + dest.emit('pipe', source); + + // Allow for unix-like usage: A.pipe(B).pipe(C) + return dest; +}; + +},{"events":53,"inherits":54,"readable-stream/duplex.js":58,"readable-stream/passthrough.js":66,"readable-stream/readable.js":67,"readable-stream/transform.js":68,"readable-stream/writable.js":69}],71:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],72:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":71,"_process":57,"inherits":54}]},{},[34]); diff --git a/node_modules/crypto-browserify/create-hash.js b/node_modules/crypto-browserify/create-hash.js new file mode 100755 index 00000000..f826f30a --- /dev/null +++ b/node_modules/crypto-browserify/create-hash.js @@ -0,0 +1,30 @@ +var createHash = require('sha.js') + +var md5 = toConstructor(require('./md5')) +var rmd160 = toConstructor(require('ripemd160')) + +function toConstructor (fn) { + return function () { + var buffers = [] + var m= { + update: function (data, enc) { + if(!Buffer.isBuffer(data)) data = new Buffer(data, enc) + buffers.push(data) + return this + }, + digest: function (enc) { + var buf = Buffer.concat(buffers) + var r = fn(buf) + buffers = null + return enc ? r.toString(enc) : r + } + } + return m + } +} + +module.exports = function (alg) { + if('md5' === alg) return new md5() + if('rmd160' === alg) return new rmd160() + return createHash(alg) +} diff --git a/node_modules/crypto-browserify/create-hmac.js b/node_modules/crypto-browserify/create-hmac.js new file mode 100755 index 00000000..65e6e653 --- /dev/null +++ b/node_modules/crypto-browserify/create-hmac.js @@ -0,0 +1,43 @@ +var createHash = require('./create-hash') + +var zeroBuffer = new Buffer(128) +zeroBuffer.fill(0) + +module.exports = Hmac + +function Hmac (alg, key) { + if(!(this instanceof Hmac)) return new Hmac(alg, key) + this._opad = opad + this._alg = alg + + var blocksize = (alg === 'sha512') ? 128 : 64 + + key = this._key = !Buffer.isBuffer(key) ? new Buffer(key) : key + + if(key.length > blocksize) { + key = createHash(alg).update(key).digest() + } else if(key.length < blocksize) { + key = Buffer.concat([key, zeroBuffer], blocksize) + } + + var ipad = this._ipad = new Buffer(blocksize) + var opad = this._opad = new Buffer(blocksize) + + for(var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + this._hash = createHash(alg).update(ipad) +} + +Hmac.prototype.update = function (data, enc) { + this._hash.update(data, enc) + return this +} + +Hmac.prototype.digest = function (enc) { + var h = this._hash.digest() + return createHash(this._alg).update(this._opad).update(h).digest(enc) +} + diff --git a/node_modules/crypto-browserify/example/bundle.js b/node_modules/crypto-browserify/example/bundle.js new file mode 100755 index 00000000..02698cc7 --- /dev/null +++ b/node_modules/crypto-browserify/example/bundle.js @@ -0,0 +1,637 @@ +var require = function (file, cwd) { + var resolved = require.resolve(file, cwd || '/'); + var mod = require.modules[resolved]; + if (!mod) throw new Error( + 'Failed to resolve module ' + file + ', tried ' + resolved + ); + var res = mod._cached ? mod._cached : mod(); + return res; +} + +require.paths = []; +require.modules = {}; +require.extensions = [".js",".coffee"]; + +require._core = { + 'assert': true, + 'events': true, + 'fs': true, + 'path': true, + 'vm': true +}; + +require.resolve = (function () { + return function (x, cwd) { + if (!cwd) cwd = '/'; + + if (require._core[x]) return x; + var path = require.modules.path(); + cwd = path.resolve('/', cwd); + var y = cwd || '/'; + + if (x.match(/^(?:\.\.?\/|\/)/)) { + var m = loadAsFileSync(path.resolve(y, x)) + || loadAsDirectorySync(path.resolve(y, x)); + if (m) return m; + } + + var n = loadNodeModulesSync(x, y); + if (n) return n; + + throw new Error("Cannot find module '" + x + "'"); + + function loadAsFileSync (x) { + if (require.modules[x]) { + return x; + } + + for (var i = 0; i < require.extensions.length; i++) { + var ext = require.extensions[i]; + if (require.modules[x + ext]) return x + ext; + } + } + + function loadAsDirectorySync (x) { + x = x.replace(/\/+$/, ''); + var pkgfile = x + '/package.json'; + if (require.modules[pkgfile]) { + var pkg = require.modules[pkgfile](); + var b = pkg.browserify; + if (typeof b === 'object' && b.main) { + var m = loadAsFileSync(path.resolve(x, b.main)); + if (m) return m; + } + else if (typeof b === 'string') { + var m = loadAsFileSync(path.resolve(x, b)); + if (m) return m; + } + else if (pkg.main) { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + } + } + + return loadAsFileSync(x + '/index'); + } + + function loadNodeModulesSync (x, start) { + var dirs = nodeModulesPathsSync(start); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(dir + '/' + x); + if (m) return m; + var n = loadAsDirectorySync(dir + '/' + x); + if (n) return n; + } + + var m = loadAsFileSync(x); + if (m) return m; + } + + function nodeModulesPathsSync (start) { + var parts; + if (start === '/') parts = [ '' ]; + else parts = path.normalize(start).split('/'); + + var dirs = []; + for (var i = parts.length - 1; i >= 0; i--) { + if (parts[i] === 'node_modules') continue; + var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; + dirs.push(dir); + } + + return dirs; + } + }; +})(); + +require.alias = function (from, to) { + var path = require.modules.path(); + var res = null; + try { + res = require.resolve(from + '/package.json', '/'); + } + catch (err) { + res = require.resolve(from, '/'); + } + var basedir = path.dirname(res); + + var keys = (Object.keys || function (obj) { + var res = []; + for (var key in obj) res.push(key) + return res; + })(require.modules); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key.slice(0, basedir.length + 1) === basedir + '/') { + var f = key.slice(basedir.length); + require.modules[to + f] = require.modules[basedir + f]; + } + else if (key === basedir) { + require.modules[to] = require.modules[basedir]; + } + } +}; + +require.define = function (filename, fn) { + var dirname = require._core[filename] + ? '' + : require.modules.path().dirname(filename) + ; + + var require_ = function (file) { + return require(file, dirname) + }; + require_.resolve = function (name) { + return require.resolve(name, dirname); + }; + require_.modules = require.modules; + require_.define = require.define; + var module_ = { exports : {} }; + + require.modules[filename] = function () { + require.modules[filename]._cached = module_.exports; + fn.call( + module_.exports, + require_, + module_, + module_.exports, + dirname, + filename + ); + require.modules[filename]._cached = module_.exports; + return module_.exports; + }; +}; + +if (typeof process === 'undefined') process = {}; + +if (!process.nextTick) process.nextTick = (function () { + var queue = []; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canPost) { + window.addEventListener('message', function (ev) { + if (ev.source === window && ev.data === 'browserify-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + } + + return function (fn) { + if (canPost) { + queue.push(fn); + window.postMessage('browserify-tick', '*'); + } + else setTimeout(fn, 0); + }; +})(); + +if (!process.title) process.title = 'browser'; + +if (!process.binding) process.binding = function (name) { + if (name === 'evals') return require('vm') + else throw new Error('No such module') +}; + +if (!process.cwd) process.cwd = function () { return '.' }; + +if (!process.env) process.env = {}; +if (!process.argv) process.argv = []; + +require.define("path", function (require, module, exports, __dirname, __filename) { +function filter (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + if (fn(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length; i >= 0; i--) { + var last = parts[i]; + if (last == '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Regex to split a filename into [*, dir, basename, ext] +// posix version +var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { +var resolvedPath = '', + resolvedAbsolute = false; + +for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) + ? arguments[i] + : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string' || !path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; +} + +// At this point the path should be resolved to a full absolute path, but +// handle relative paths to be safe (might happen when process.cwd() fails) + +// Normalize the path +resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { +var isAbsolute = path.charAt(0) === '/', + trailingSlash = path.slice(-1) === '/'; + +// Normalize the path +path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + return p && typeof p === 'string'; + }).join('/')); +}; + + +exports.dirname = function(path) { + var dir = splitPathRe.exec(path)[1] || ''; + var isWindows = false; + if (!dir) { + // No dirname + return '.'; + } else if (dir.length === 1 || + (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { + // It is just a slash or a drive letter with a slash + return dir; + } else { + // It is a full dirname, strip trailing slash + return dir.substring(0, dir.length - 1); + } +}; + + +exports.basename = function(path, ext) { + var f = splitPathRe.exec(path)[2] || ''; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPathRe.exec(path)[3] || ''; +}; + +}); + +require.define("crypto", function (require, module, exports, __dirname, __filename) { +module.exports = require("crypto-browserify") +}); + +require.define("/node_modules/crypto-browserify/package.json", function (require, module, exports, __dirname, __filename) { +module.exports = {} +}); + +require.define("/node_modules/crypto-browserify/index.js", function (require, module, exports, __dirname, __filename) { +var sha = require('./sha') + +var algorithms = { + sha1: { + hex: sha.hex_sha1, + binary: sha.b64_sha1, + ascii: sha.str_sha1 + } +} + +function error () { + var m = [].slice.call(arguments).join(' ') + throw new Error([ + m, + 'we accept pull requests', + 'http://github.com/dominictarr/crypto-browserify' + ].join('\n')) +} + +exports.createHash = function (alg) { + alg = alg || 'sha1' + if(!algorithms[alg]) + error('algorithm:', alg, 'is not yet supported') + var s = '' + _alg = algorithms[alg] + return { + update: function (data) { + s += data + return this + }, + digest: function (enc) { + enc = enc || 'binary' + var fn + if(!(fn = _alg[enc])) + error('encoding:', enc , 'is not yet supported for algorithm', alg) + var r = fn(s) + s = null //not meant to use the hash after you've called digest. + return r + } + } +} +// the least I can do is make error messages for the rest of the node.js/crypto api. +;['createCredentials' +, 'createHmac' +, 'createCypher' +, 'createCypheriv' +, 'createDecipher' +, 'createDecipheriv' +, 'createSign' +, 'createVerify' +, 'createDeffieHellman', +, 'pbkdf2', +, 'randomBytes' ].forEach(function (name) { + exports[name] = function () { + error('sorry,', name, 'is not implemented yet') + } +}) + +}); + +require.define("/node_modules/crypto-browserify/sha.js", function (require, module, exports, __dirname, __filename) { +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS PUB 180-1 + * Version 2.1a Copyright Paul Johnston 2000 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ + +exports.hex_sha1 = hex_sha1; +exports.b64_sha1 = b64_sha1; +exports.str_sha1 = str_sha1; +exports.hex_hmac_sha1 = hex_hmac_sha1; +exports.b64_hmac_sha1 = b64_hmac_sha1; +exports.str_hmac_sha1 = str_hmac_sha1; + +/* + * Configurable variables. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + */ +var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ +var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ +var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ + +/* + * These are the functions you'll usually want to call + * They take string arguments and return either hex or base-64 encoded strings + */ +function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));} +function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));} +function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));} +function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));} +function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));} +function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));} + +/* + * Perform a simple self-test to see if the VM is working + */ +function sha1_vm_test() +{ + return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; +} + +/* + * Calculate the SHA-1 of an array of big-endian words, and a bit length + */ +function core_sha1(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << (24 - len % 32); + x[((len + 64 >> 9) << 4) + 15] = len; + + var w = Array(80); + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + var e = -1009589776; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + var olde = e; + + for(var j = 0; j < 80; j++) + { + if(j < 16) w[j] = x[i + j]; + else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); + var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), + safe_add(safe_add(e, w[j]), sha1_kt(j))); + e = d; + d = c; + c = rol(b, 30); + b = a; + a = t; + } + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + e = safe_add(e, olde); + } + return Array(a, b, c, d, e); + +} + +/* + * Perform the appropriate triplet combination function for the current + * iteration + */ +function sha1_ft(t, b, c, d) +{ + if(t < 20) return (b & c) | ((~b) & d); + if(t < 40) return b ^ c ^ d; + if(t < 60) return (b & c) | (b & d) | (c & d); + return b ^ c ^ d; +} + +/* + * Determine the appropriate additive constant for the current iteration + */ +function sha1_kt(t) +{ + return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : + (t < 60) ? -1894007588 : -899497514; +} + +/* + * Calculate the HMAC-SHA1 of a key and some data + */ +function core_hmac_sha1(key, data) +{ + var bkey = str2binb(key); + if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); + + var ipad = Array(16), opad = Array(16); + for(var i = 0; i < 16; i++) + { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + + var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); + return core_sha1(opad.concat(hash), 512 + 160); +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} + +/* + * Convert an 8-bit or 16-bit string to an array of big-endian words + * In 8-bit function, characters >255 have their hi-byte silently ignored. + */ +function str2binb(str) +{ + var bin = Array(); + var mask = (1 << chrsz) - 1; + for(var i = 0; i < str.length * chrsz; i += chrsz) + bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32); + return bin; +} + +/* + * Convert an array of big-endian words to a string + */ +function binb2str(bin) +{ + var str = ""; + var mask = (1 << chrsz) - 1; + for(var i = 0; i < bin.length * 32; i += chrsz) + str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); + return str; +} + +/* + * Convert an array of big-endian words to a hex string. + */ +function binb2hex(binarray) +{ + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i++) + { + str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + + hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); + } + return str; +} + +/* + * Convert an array of big-endian words to a base-64 string + */ +function binb2b64(binarray) +{ + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i += 3) + { + var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) + | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) + | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF); + for(var j = 0; j < 4; j++) + { + if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; + else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); + } + } + return str; +} + + +}); + +require.define("/test.js", function (require, module, exports, __dirname, __filename) { + var crypto = require('crypto') +var abc = crypto.createHash('sha1').update('abc').digest('hex') +console.log(abc) +//require('hello').inlineCall().call2() + +}); +require("/test.js"); diff --git a/node_modules/crypto-browserify/example/index.html b/node_modules/crypto-browserify/example/index.html new file mode 100755 index 00000000..9d55c6d7 --- /dev/null +++ b/node_modules/crypto-browserify/example/index.html @@ -0,0 +1,12 @@ + + + + +
+  require('crypto').createHash('sha1').update('abc').digest('hex') == ''
+  
+ + + diff --git a/node_modules/crypto-browserify/example/test.js b/node_modules/crypto-browserify/example/test.js new file mode 100755 index 00000000..f1b0e4a9 --- /dev/null +++ b/node_modules/crypto-browserify/example/test.js @@ -0,0 +1,4 @@ +var crypto = require('crypto') +var abc = crypto.createHash('sha1').update('abc').digest('hex') +console.log(abc) +//require('hello').inlineCall().call2() diff --git a/node_modules/crypto-browserify/helpers.js b/node_modules/crypto-browserify/helpers.js new file mode 100755 index 00000000..b9e1ed01 --- /dev/null +++ b/node_modules/crypto-browserify/helpers.js @@ -0,0 +1,34 @@ +var intSize = 4; +var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0); +var chrsz = 8; + +function toArray(buf, bigEndian) { + if ((buf.length % intSize) !== 0) { + var len = buf.length + (intSize - (buf.length % intSize)); + buf = Buffer.concat([buf, zeroBuffer], len); + } + + var arr = []; + var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE; + for (var i = 0; i < buf.length; i += intSize) { + arr.push(fn.call(buf, i)); + } + return arr; +} + +function toBuffer(arr, size, bigEndian) { + var buf = new Buffer(size); + var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE; + for (var i = 0; i < arr.length; i++) { + fn.call(buf, arr[i], i * 4, true); + } + return buf; +} + +function hash(buf, fn, hashSize, bigEndian) { + if (!Buffer.isBuffer(buf)) buf = new Buffer(buf); + var arr = fn(toArray(buf, bigEndian), buf.length * chrsz); + return toBuffer(arr, hashSize, bigEndian); +} + +module.exports = { hash: hash }; diff --git a/node_modules/crypto-browserify/index.js b/node_modules/crypto-browserify/index.js new file mode 100755 index 00000000..3283c283 --- /dev/null +++ b/node_modules/crypto-browserify/index.js @@ -0,0 +1,49 @@ +var rng = require('./rng') + +function error () { + var m = [].slice.call(arguments).join(' ') + throw new Error([ + m, + 'we accept pull requests', + 'http://github.com/dominictarr/crypto-browserify' + ].join('\n')) +} + +exports.createHash = require('./create-hash') + +exports.createHmac = require('./create-hmac') + +exports.randomBytes = function(size, callback) { + if (callback && callback.call) { + try { + callback.call(this, undefined, new Buffer(rng(size))) + } catch (err) { callback(err) } + } else { + return new Buffer(rng(size)) + } +} + +function each(a, f) { + for(var i in a) + f(a[i], i) +} + +exports.getHashes = function () { + return ['sha1', 'sha256', 'sha512', 'md5', 'rmd160'] +} + +var p = require('./pbkdf2')(exports) +exports.pbkdf2 = p.pbkdf2 +exports.pbkdf2Sync = p.pbkdf2Sync +require('browserify-aes/inject')(exports, module.exports); + +// the least I can do is make error messages for the rest of the node.js/crypto api. +each(['createCredentials' +, 'createSign' +, 'createVerify' +, 'createDiffieHellman' +], function (name) { + exports[name] = function () { + error('sorry,', name, 'is not implemented yet') + } +}) diff --git a/node_modules/crypto-browserify/md5.js b/node_modules/crypto-browserify/md5.js new file mode 100755 index 00000000..92067a02 --- /dev/null +++ b/node_modules/crypto-browserify/md5.js @@ -0,0 +1,155 @@ +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +var helpers = require('./helpers'); + +/* + * Calculate the MD5 of an array of little-endian words, and a bit length + */ +function core_md5(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); + d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); + d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); + d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i+10], 17, -42063); + b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); + d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); + d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); + c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); + d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); + c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); + d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); + c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); + d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); + c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); + d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); + d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); + d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); + d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); + d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); + d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); + d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); + d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); + +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function md5_cmn(q, a, b, x, s, t) +{ + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) +{ + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function md5_gg(a, b, c, d, x, s, t) +{ + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); +} +function md5_hh(a, b, c, d, x, s, t) +{ + return md5_cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5_ii(a, b, c, d, x, s, t) +{ + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function bit_rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} + +module.exports = function md5(buf) { + return helpers.hash(buf, core_md5, 16); +}; diff --git a/node_modules/crypto-browserify/package.json b/node_modules/crypto-browserify/package.json new file mode 100755 index 00000000..b46ef5eb --- /dev/null +++ b/node_modules/crypto-browserify/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "crypto-browserify@3.3.0", + "scope": null, + "escapedName": "crypto-browserify", + "name": "crypto-browserify", + "rawSpec": "3.3.0", + "spec": "3.3.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "crypto-browserify@3.3.0", + "_id": "crypto-browserify@3.3.0", + "_inCache": true, + "_location": "/crypto-browserify", + "_npmUser": { + "name": "dominictarr", + "email": "dominic.tarr@gmail.com" + }, + "_npmVersion": "1.4.26", + "_phantomChildren": {}, + "_requested": { + "raw": "crypto-browserify@3.3.0", + "scope": null, + "escapedName": "crypto-browserify", + "name": "crypto-browserify", + "rawSpec": "3.3.0", + "spec": "3.3.0", + "type": "version" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.3.0.tgz", + "_shasum": "b9fc75bb4a0ed61dcf1cd5dae96eb30c9c3e506c", + "_shrinkwrap": null, + "_spec": "crypto-browserify@3.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "Dominic Tarr", + "email": "dominic.tarr@gmail.com", + "url": "dominictarr.com" + }, + "browser": { + "crypto": false + }, + "bugs": { + "url": "https://github.com/dominictarr/crypto-browserify/issues" + }, + "dependencies": { + "browserify-aes": "0.4.0", + "pbkdf2-compat": "2.0.1", + "ripemd160": "0.2.0", + "sha.js": "2.2.6" + }, + "description": "partial implementation of crypto for the browser", + "devDependencies": { + "hash-test-vectors": "~1.3.0", + "tape": "~2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "b9fc75bb4a0ed61dcf1cd5dae96eb30c9c3e506c", + "tarball": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.3.0.tgz" + }, + "engines": { + "node": "*" + }, + "gitHead": "0f1821f6233548f632de2b5658c895fa7a8e3d3d", + "homepage": "https://github.com/dominictarr/crypto-browserify", + "license": "MIT", + "maintainers": [ + { + "name": "dominictarr", + "email": "dominic.tarr@gmail.com" + } + ], + "name": "crypto-browserify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/dominictarr/crypto-browserify.git" + }, + "scripts": { + "test": "set -e; for t in test/*.js; do node $t; done" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/latest", + "chrome/latest", + "firefox/latest", + "safari/latest", + "opera/latest" + ] + }, + "version": "3.3.0" +} diff --git a/node_modules/crypto-browserify/pbkdf2.js b/node_modules/crypto-browserify/pbkdf2.js new file mode 100755 index 00000000..88382f4f --- /dev/null +++ b/node_modules/crypto-browserify/pbkdf2.js @@ -0,0 +1,12 @@ +var pbkdf2Export = require('pbkdf2-compat/pbkdf2') + +module.exports = function (crypto, exports) { + exports = exports || {} + + var exported = pbkdf2Export(crypto) + + exports.pbkdf2 = exported.pbkdf2 + exports.pbkdf2Sync = exported.pbkdf2Sync + + return exports +} diff --git a/node_modules/crypto-browserify/readme.markdown b/node_modules/crypto-browserify/readme.markdown new file mode 100755 index 00000000..cde89668 --- /dev/null +++ b/node_modules/crypto-browserify/readme.markdown @@ -0,0 +1,47 @@ +# crypto-browserify + +A (partial) port of node's `crypto` module to the browser. + +[![travis](https://secure.travis-ci.org/dominictarr/crypto-browserify.png?branch=master)](https://travis-ci.org/dominictarr/crypto-browserify) + +[![browser support](http://ci.testling.com/dominictarr/crypto-browserify.png)](http://ci.testling.com/dominictarr/crypto-browserify) + +The goal of this module is to reimplement node's crypto module, +in pure javascript so that it can run in the browser. + +Here is the subset that is currently implemented: + +* createHash (sha1, sha256, sha512, md5, rmd160) +* createHmac (sha1, sha256, sha512, md5) +* pbkdf2 +* pbkdf2Sync +* randomBytes +* createCipher (aes) +* createDecipher (aes) + +## TODO + +The highest priority unimplemented features are + +* createDiffieHelman +* createSign (rsa) +* createVerify (rsa) + +## contributions + +If you are interested in writing a feature, please implement as a new module, +which will be incorporated into crypto-browserify as a dependency. + +All deps must be compatible with node's crypto +(generate example inputs and outputs with node, +and save base64 strings inside JSON, so that tests can run in the browser. +see [sha.js](https://github.com/dominictarr/sha.js) + +Crypto is _extra serious_ so please do not hesitate to review the code, +and post comments if you do. + +## License + +MIT + + diff --git a/node_modules/crypto-browserify/rng.js b/node_modules/crypto-browserify/rng.js new file mode 100755 index 00000000..0f140bb0 --- /dev/null +++ b/node_modules/crypto-browserify/rng.js @@ -0,0 +1,26 @@ +(function() { + var g = ('undefined' === typeof window ? global : window) || {} + _crypto = ( + g.crypto || g.msCrypto || require('crypto') + ) + module.exports = function(size) { + // Modern Browsers + if(_crypto.getRandomValues) { + var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array + /* This will not work in older browsers. + * See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + */ + + _crypto.getRandomValues(bytes); + return bytes; + } + else if (_crypto.randomBytes) { + return _crypto.randomBytes(size) + } + else + throw new Error( + 'secure random number generation not supported by this browser\n'+ + 'use chrome, FireFox or Internet Explorer 11' + ) + } +}()) diff --git a/node_modules/crypto-browserify/test/aes.js b/node_modules/crypto-browserify/test/aes.js new file mode 100755 index 00000000..090b27e6 --- /dev/null +++ b/node_modules/crypto-browserify/test/aes.js @@ -0,0 +1,18 @@ +var test = require('tape'); +var crypto = require('../'); +test('ciphers', function (t) { + crypto.listCiphers().forEach(function (cipher) { + t.test(cipher, function (t) { + t.plan(1); + var data = crypto.randomBytes(562); + var password = crypto.randomBytes(20); + var crypter = crypto.createCipher(cipher, password); + var decrypter = crypto.createDecipher(cipher, password); + var out = []; + out.push(decrypter.update(crypter.update(data))); + out.push(decrypter.update(crypter.final())); + out.push(decrypter.final()); + t.equals(data.toString('hex'), Buffer.concat(out).toString('hex')); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/crypto-browserify/test/create-hash.js b/node_modules/crypto-browserify/test/create-hash.js new file mode 100755 index 00000000..60a5e74f --- /dev/null +++ b/node_modules/crypto-browserify/test/create-hash.js @@ -0,0 +1,32 @@ +var fs = require('fs') +var test = require('tape') + +var algorithms = require('../').getHashes() +var encodings = [/*'binary',*/ 'hex', 'base64']; +var vectors = require('hash-test-vectors') + +var createHash = require('../create-hash') + +algorithms.forEach(function (algorithm) { + test('test ' + algorithm + ' against test vectors', function (t) { + + vectors.forEach(function (obj, i) { + var input = new Buffer(obj.input, 'base64') + var node = obj[algorithm] + var js = createHash(algorithm).update(input).digest('hex') + t.equal(js, node, algorithm + '(testVector['+i+']) == ' + node) + }) + + encodings.forEach(function (encoding) { + vectors.forEach(function (obj, i) { + var input = new Buffer(obj.input, 'base64').toString(encoding) + var node = obj[algorithm] + var js = createHash(algorithm).update(input, encoding).digest('hex') + t.equal(js, node, algorithm + '(testVector['+i+'], '+encoding+') == ' + node) + }) + }); + + t.end() + }) +}); + diff --git a/node_modules/crypto-browserify/test/create-hmac.js b/node_modules/crypto-browserify/test/create-hmac.js new file mode 100755 index 00000000..9076000c --- /dev/null +++ b/node_modules/crypto-browserify/test/create-hmac.js @@ -0,0 +1,24 @@ + +var test = require('tape') + +var algorithms = require('../').getHashes() +var vectors = require('hash-test-vectors/hmac') +var createHmac = require('../create-hmac') + +algorithms.forEach(function (alg) { + + test('hmac('+alg+')', function (t) { + vectors.forEach(function (input, i) { + var output = createHmac(alg, new Buffer(input.key, 'hex')) + .update(input.data, 'hex').digest() + + output = input.truncate ? output.slice(0, input.truncate) : output + t.equal(output.toString('hex'), input[alg]) + }) + t.end() + }) + +}) + + + diff --git a/node_modules/crypto-browserify/test/pbkdf2.js b/node_modules/crypto-browserify/test/pbkdf2.js new file mode 100755 index 00000000..fc26900f --- /dev/null +++ b/node_modules/crypto-browserify/test/pbkdf2.js @@ -0,0 +1,23 @@ + +var tape = require('tape') +var pbkdf2Sync = require('../').pbkdf2Sync + +var vectors = require('hash-test-vectors/pbkdf2') + +tape('pbkdf2', function (t) { + vectors.forEach(function (input) { + //skip inputs that will take way too long + if(input.iterations > 10000) return + + var key = pbkdf2Sync(input.password, input.salt, input.iterations, input.length) + + if(key.toString('hex') !== input.sha1) + console.log(input) + + t.equal(key.toString('hex'), input.sha1) + + + }) + + t.end() +}) diff --git a/node_modules/crypto-browserify/test/random-bytes.js b/node_modules/crypto-browserify/test/random-bytes.js new file mode 100755 index 00000000..417f2db8 --- /dev/null +++ b/node_modules/crypto-browserify/test/random-bytes.js @@ -0,0 +1,55 @@ +var test = require('tape') +var crypto = require('../') + +test('get error message', function (t) { + + try { + var b = crypto.randomBytes(10) + t.ok(Buffer.isBuffer(b)) + t.end() + } catch (err) { + t.ok(/not supported/.test(err.message), '"not supported" is in error message') + t.end() + } + +}) + +test('randomBytes', function (t) { + t.plan(5); + t.equal(crypto.randomBytes(10).length, 10); + t.ok(Buffer.isBuffer(crypto.randomBytes(10))) + crypto.randomBytes(10, function(ex, bytes) { + t.error(ex); + t.equal(bytes.length, 10); + t.ok(Buffer.isBuffer(bytes)) + t.end(); + }); +}); + +test('randomBytes seem random', function (t) { + + var L = 1000 + var b = crypto.randomBytes(L) + + var mean = [].reduce.call(b, function (a, b) { return a + b}, 0) / L + + // test that the random numbers are plausably random. + // Math.random() will pass this, but this will catch + // terrible mistakes such as this blunder: + // https://github.com/dominictarr/crypto-browserify/commit/3267955e1df7edd1680e52aeede9a89506ed2464#commitcomment-7916835 + + // this doesn't check that the bytes are in a random *order* + // but it's better than nothing. + + var expected = 256/2 + var smean = Math.sqrt(mean) + //console.log doesn't work right on testling, *grumble grumble* + console.log(JSON.stringify([expected - smean, mean, expected + smean])) + t.ok(mean < expected + smean) + t.ok(mean > expected - smean) + + t.end() + +}) + + diff --git a/node_modules/cycle/README.md b/node_modules/cycle/README.md new file mode 100755 index 00000000..de9a06d0 --- /dev/null +++ b/node_modules/cycle/README.md @@ -0,0 +1,49 @@ +Fork of https://github.com/douglascrockford/JSON-js, maintained in npm as `cycle`. + +# Contributors + +* Douglas Crockford +* Nuno Job +* Justin Warkentin + +# JSON in JavaScript + +Douglas Crockford +douglas@crockford.com + +2010-11-18 + + +JSON is a light-weight, language independent, data interchange format. +See http://www.JSON.org/ + +The files in this collection implement JSON encoders/decoders in JavaScript. + +JSON became a built-in feature of JavaScript when the ECMAScript Programming +Language Standard - Fifth Edition was adopted by the ECMA General Assembly +in December 2009. Most of the files in this collection are for applications +that are expected to run in obsolete web browsers. For most purposes, json2.js +is the best choice. + + +json2.js: This file creates a JSON property in the global object, if there +isn't already one, setting its value to an object containing a stringify +method and a parse method. The parse method uses the eval method to do the +parsing, guarding it with several regular expressions to defend against +accidental code execution hazards. On current browsers, this file does nothing, +prefering the built-in JSON object. + +json.js: This file does everything that json2.js does. It also adds a +toJSONString method and a parseJSON method to Object.prototype. Use of this +file is not recommended. + +json_parse.js: This file contains an alternative JSON parse function that +uses recursive descent instead of eval. + +json_parse_state.js: This files contains an alternative JSON parse function that +uses a state machine instead of eval. + +cycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle, +which make it possible to encode cyclical structures and dags in JSON, and to +then recover them. JSONPath is used to represent the links. +http://GOESSNER.net/articles/JsonPath/ diff --git a/node_modules/cycle/cycle.js b/node_modules/cycle/cycle.js new file mode 100755 index 00000000..2e776ad9 --- /dev/null +++ b/node_modules/cycle/cycle.js @@ -0,0 +1,170 @@ +/* + cycle.js + 2013-02-19 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. +*/ + +/*jslint evil: true, regexp: true */ + +/*members $ref, apply, call, decycle, hasOwnProperty, length, prototype, push, + retrocycle, stringify, test, toString +*/ + +var cycle = exports; + +cycle.decycle = function decycle(object) { + 'use strict'; + +// Make a deep copy of an object or array, assuring that there is at most +// one instance of each object or array in the resulting structure. The +// duplicate references (which might be forming cycles) are replaced with +// an object of the form +// {$ref: PATH} +// where the PATH is a JSONPath string that locates the first occurance. +// So, +// var a = []; +// a[0] = a; +// return JSON.stringify(JSON.decycle(a)); +// produces the string '[{"$ref":"$"}]'. + +// JSONPath is used to locate the unique object. $ indicates the top level of +// the object or array. [NUMBER] or [STRING] indicates a child member or +// property. + + var objects = [], // Keep a reference to each unique object or array + paths = []; // Keep the path to each unique object or array + + return (function derez(value, path) { + +// The derez recurses through the object, producing the deep copy. + + var i, // The loop counter + name, // Property name + nu; // The new object or array + +// typeof null === 'object', so go on if this value is really an object but not +// one of the weird builtin objects. + + if (typeof value === 'object' && value !== null && + !(value instanceof Boolean) && + !(value instanceof Date) && + !(value instanceof Number) && + !(value instanceof RegExp) && + !(value instanceof String)) { + +// If the value is an object or array, look to see if we have already +// encountered it. If so, return a $ref/path object. This is a hard way, +// linear search that will get slower as the number of unique objects grows. + + for (i = 0; i < objects.length; i += 1) { + if (objects[i] === value) { + return {$ref: paths[i]}; + } + } + +// Otherwise, accumulate the unique value and its path. + + objects.push(value); + paths.push(path); + +// If it is an array, replicate the array. + + if (Object.prototype.toString.apply(value) === '[object Array]') { + nu = []; + for (i = 0; i < value.length; i += 1) { + nu[i] = derez(value[i], path + '[' + i + ']'); + } + } else { + +// If it is an object, replicate the object. + + nu = {}; + for (name in value) { + if (Object.prototype.hasOwnProperty.call(value, name)) { + nu[name] = derez(value[name], + path + '[' + JSON.stringify(name) + ']'); + } + } + } + return nu; + } + return value; + }(object, '$')); +}; + + +cycle.retrocycle = function retrocycle($) { + 'use strict'; + +// Restore an object that was reduced by decycle. Members whose values are +// objects of the form +// {$ref: PATH} +// are replaced with references to the value found by the PATH. This will +// restore cycles. The object will be mutated. + +// The eval function is used to locate the values described by a PATH. The +// root object is kept in a $ variable. A regular expression is used to +// assure that the PATH is extremely well formed. The regexp contains nested +// * quantifiers. That has been known to have extremely bad performance +// problems on some browsers for very long strings. A PATH is expected to be +// reasonably short. A PATH is allowed to belong to a very restricted subset of +// Goessner's JSONPath. + +// So, +// var s = '[{"$ref":"$"}]'; +// return JSON.retrocycle(JSON.parse(s)); +// produces an array containing a single element which is the array itself. + + var px = + /^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/; + + (function rez(value) { + +// The rez function walks recursively through the object looking for $ref +// properties. When it finds one that has a value that is a path, then it +// replaces the $ref object with a reference to the value that is found by +// the path. + + var i, item, name, path; + + if (value && typeof value === 'object') { + if (Object.prototype.toString.apply(value) === '[object Array]') { + for (i = 0; i < value.length; i += 1) { + item = value[i]; + if (item && typeof item === 'object') { + path = item.$ref; + if (typeof path === 'string' && px.test(path)) { + value[i] = eval(path); + } else { + rez(item); + } + } + } + } else { + for (name in value) { + if (typeof value[name] === 'object') { + item = value[name]; + if (item) { + path = item.$ref; + if (typeof path === 'string' && px.test(path)) { + value[name] = eval(path); + } else { + rez(item); + } + } + } + } + } + } + }($)); + return $; +}; diff --git a/node_modules/cycle/package.json b/node_modules/cycle/package.json new file mode 100755 index 00000000..8bbf01f3 --- /dev/null +++ b/node_modules/cycle/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + { + "raw": "cycle@1.0.x", + "scope": null, + "escapedName": "cycle", + "name": "cycle", + "rawSpec": "1.0.x", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/winston" + ] + ], + "_from": "cycle@>=1.0.0 <1.1.0", + "_id": "cycle@1.0.3", + "_inCache": true, + "_location": "/cycle", + "_npmUser": { + "name": "dscape", + "email": "nunojobpinto@gmail.com" + }, + "_npmVersion": "1.2.32", + "_phantomChildren": {}, + "_requested": { + "raw": "cycle@1.0.x", + "scope": null, + "escapedName": "cycle", + "name": "cycle", + "rawSpec": "1.0.x", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/winston" + ], + "_resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "_shasum": "21e80b2be8580f98b468f379430662b046c34ad2", + "_shrinkwrap": null, + "_spec": "cycle@1.0.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/winston", + "author": "", + "bugs": { + "url": "http://github.com/douglascrockford/JSON-js/issues" + }, + "dependencies": {}, + "description": "decycle your json", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "21e80b2be8580f98b468f379430662b046c34ad2", + "tarball": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz" + }, + "engines": { + "node": ">=0.4.0" + }, + "homepage": "https://github.com/douglascrockford/JSON-js", + "keywords": [ + "json", + "cycle", + "stringify", + "parse" + ], + "main": "./cycle.js", + "maintainers": [ + { + "name": "dscape", + "email": "nunojobpinto@gmail.com" + } + ], + "name": "cycle", + "optionalDependencies": {}, + "readme": "Fork of https://github.com/douglascrockford/JSON-js, maintained in npm as `cycle`.\n\n# Contributors\n\n* Douglas Crockford\n* Nuno Job\n* Justin Warkentin\n\n# JSON in JavaScript\n\nDouglas Crockford\ndouglas@crockford.com\n\n2010-11-18\n\n\nJSON is a light-weight, language independent, data interchange format.\nSee http://www.JSON.org/\n\nThe files in this collection implement JSON encoders/decoders in JavaScript.\n\nJSON became a built-in feature of JavaScript when the ECMAScript Programming\nLanguage Standard - Fifth Edition was adopted by the ECMA General Assembly\nin December 2009. Most of the files in this collection are for applications\nthat are expected to run in obsolete web browsers. For most purposes, json2.js\nis the best choice.\n\n\njson2.js: This file creates a JSON property in the global object, if there\nisn't already one, setting its value to an object containing a stringify\nmethod and a parse method. The parse method uses the eval method to do the\nparsing, guarding it with several regular expressions to defend against\naccidental code execution hazards. On current browsers, this file does nothing,\nprefering the built-in JSON object.\n\njson.js: This file does everything that json2.js does. It also adds a\ntoJSONString method and a parseJSON method to Object.prototype. Use of this\nfile is not recommended.\n\njson_parse.js: This file contains an alternative JSON parse function that\nuses recursive descent instead of eval.\n\njson_parse_state.js: This files contains an alternative JSON parse function that\nuses a state machine instead of eval.\n\ncycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle,\nwhich make it possible to encode cyclical structures and dags in JSON, and to\nthen recover them. JSONPath is used to represent the links.\nhttp://GOESSNER.net/articles/JsonPath/\n", + "readmeFilename": "README.md", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/dscape/cycle.git" + }, + "version": "1.0.3" +} diff --git a/node_modules/dat-gui/.npmignore b/node_modules/dat-gui/.npmignore new file mode 100755 index 00000000..546f53c9 --- /dev/null +++ b/node_modules/dat-gui/.npmignore @@ -0,0 +1,2 @@ +/node_modules/ +/dat-gui/ \ No newline at end of file diff --git a/node_modules/dat-gui/index.js b/node_modules/dat-gui/index.js new file mode 100755 index 00000000..2f273a14 --- /dev/null +++ b/node_modules/dat-gui/index.js @@ -0,0 +1,2 @@ +module.exports = require('./vendor/dat.gui') +module.exports.color = require('./vendor/dat.color') \ No newline at end of file diff --git a/node_modules/dat-gui/package.json b/node_modules/dat-gui/package.json new file mode 100755 index 00000000..4c5c93da --- /dev/null +++ b/node_modules/dat-gui/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + { + "raw": "dat-gui@^0.5.0", + "scope": null, + "escapedName": "dat-gui", + "name": "dat-gui", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master" + ] + ], + "_from": "dat-gui@>=0.5.0 <0.6.0", + "_id": "dat-gui@0.5.0", + "_inCache": true, + "_location": "/dat-gui", + "_npmUser": { + "name": "shama", + "email": "kyle@dontkry.com" + }, + "_npmVersion": "1.2.32", + "_phantomChildren": {}, + "_requested": { + "raw": "dat-gui@^0.5.0", + "scope": null, + "escapedName": "dat-gui", + "name": "dat-gui", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/dat-gui/-/dat-gui-0.5.0.tgz", + "_shasum": "1212da836109747d0ac220bad7b07c17daa03583", + "_shrinkwrap": null, + "_spec": "dat-gui@^0.5.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master", + "author": { + "name": "Data Arts Team, Google Creative Lab" + }, + "dependencies": {}, + "description": "Browserified dat-gui library", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "1212da836109747d0ac220bad7b07c17daa03583", + "tarball": "https://registry.npmjs.org/dat-gui/-/dat-gui-0.5.0.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "homepage": "https://code.google.com/p/dat-gui/", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "maintainers": [ + { + "name": "shama", + "email": "kyle@dontkry.com" + } + ], + "name": "dat-gui", + "optionalDependencies": {}, + "readme": "=dat.GUI=\nA lightweight graphical user interface for changing variables in JavaScript. \n\nGet started with dat.GUI by reading the tutorial at [http://workshop.chromeexperiments.com/examples/gui].\n\n----\n\n==Packaged Builds==\nThe easiest way to use dat.GUI in your code is by using the built source at {{{build/dat.gui.min.js}}}. These built JavaScript files bundle all the necessary dependencies to run dat.GUI.\n\nIn your {{{head}}} tag, include the following code:\n{{{\n\n}}}\n\n----\n\n==Using dat.GUI with require.js==\nInternally, dat.GUI uses [http://requirejs.org/ require.js] to handle dependency management. If you're making changes to the source and want to see the effects of your changes without building, use require js.\n\nIn your {{{head}}} tag, include the following code:\n{{{\n\n}}}\n\nThen, in {{{path/to/main.js}}}:\n{{{\nrequire([\n 'path/to/gui/module/GUI'\n], function(GUI) {\n\n // No namespace necessary \n var gui = new GUI();\n\n});\n}}}\n\n----\n\n==Directory Contents==\n * build: Concatenated source code.\n * src: Modular code in [http://requirejs.org/ require.js] format. Also includes css, [http://sass-lang.com/ scss], and html, some of which is included during build.\n * tests: [https://github.com/jquery/qunit QUnit] test suite.\n * utils: [http://nodejs.org/ node.js] utility scripts for compiling source.\n\n----\n\n==Building your own dat.GUI==\n\nIn the terminal, enter the following:\n\n{{{\n$ cd utils\n$ node build_gui.js\n}}}\n\nThis will create a namespaced, unminified build of dat.GUI at {{{build/dat.gui.js}}}\n\n_To export minified source using Closure Compiler, open {{{utils/build_gui.js}}} and set the {{{minify}}} parameter to {{{true}}}._\n\n----\n\n==Change log==\n\n===0.5===\n * Moved to requirejs for dependency management.\n * Changed global namespace from *DAT* to *dat* (lowercase).\n * Added support for color controllers. See [http://workshop.chromeexperiments.com/examples/gui/#4--Color-Controllers Color Controllers].\n * Added support for folders. See [http://workshop.chromeexperiments.com/examples/gui/#3--Folders Folders].\n * Added support for saving named presets. See [http://workshop.chromeexperiments.com/examples/gui/examples/gui/#6--Presets Presets].\n * Removed `height` parameter from GUI constructor. Scrollbar automatically induced when window is too short.\n * `dat.GUI.autoPlace` parameter removed. Use `new dat.GUI( { autoPlace: false } )`. See [http://workshop.chromeexperiments.com/examples/gui/#9--Custom-Placement Custom Placement].\n * `gui.autoListen` and `gui.listenAll()` removed. See [http://workshop.chromeexperiments.com/examples/gui/#11--Updating-the-Display-Manually Updating The Display Manually].\n * `dat.GUI.load` removed. See [http://workshop.chromeexperiments.com/examples/gui/#5--Saving-Values Saving Values].\n * Made Controller code completely agnostic of GUI. Controllers can easily be created independent of a GUI panel.\n\n\n===0.4===\n\n * Migrated from GitHub to Google Code.\n\n----\n\n==Thanks==\nThe following libraries / open-source projects were used in the development of dat.GUI:\n * [http://requirejs.org/ require.js]\n * [http://sass-lang.com/ Sass]\n * [http://nodejs.org/ node.js]\n * [https://github.com/jquery/qunit QUnit] / [http://jquery.com/ jquery]", + "readmeFilename": "readme.wiki", + "repository": { + "type": "git", + "url": "https://code.google.com/p/dat-gui/" + }, + "version": "0.5.0" +} diff --git a/node_modules/dat-gui/readme.wiki b/node_modules/dat-gui/readme.wiki new file mode 100755 index 00000000..a6631064 --- /dev/null +++ b/node_modules/dat-gui/readme.wiki @@ -0,0 +1,89 @@ +=dat.GUI= +A lightweight graphical user interface for changing variables in JavaScript. + +Get started with dat.GUI by reading the tutorial at [http://workshop.chromeexperiments.com/examples/gui]. + +---- + +==Packaged Builds== +The easiest way to use dat.GUI in your code is by using the built source at {{{build/dat.gui.min.js}}}. These built JavaScript files bundle all the necessary dependencies to run dat.GUI. + +In your {{{head}}} tag, include the following code: +{{{ + +}}} + +---- + +==Using dat.GUI with require.js== +Internally, dat.GUI uses [http://requirejs.org/ require.js] to handle dependency management. If you're making changes to the source and want to see the effects of your changes without building, use require js. + +In your {{{head}}} tag, include the following code: +{{{ + +}}} + +Then, in {{{path/to/main.js}}}: +{{{ +require([ + 'path/to/gui/module/GUI' +], function(GUI) { + + // No namespace necessary + var gui = new GUI(); + +}); +}}} + +---- + +==Directory Contents== + * build: Concatenated source code. + * src: Modular code in [http://requirejs.org/ require.js] format. Also includes css, [http://sass-lang.com/ scss], and html, some of which is included during build. + * tests: [https://github.com/jquery/qunit QUnit] test suite. + * utils: [http://nodejs.org/ node.js] utility scripts for compiling source. + +---- + +==Building your own dat.GUI== + +In the terminal, enter the following: + +{{{ +$ cd utils +$ node build_gui.js +}}} + +This will create a namespaced, unminified build of dat.GUI at {{{build/dat.gui.js}}} + +_To export minified source using Closure Compiler, open {{{utils/build_gui.js}}} and set the {{{minify}}} parameter to {{{true}}}._ + +---- + +==Change log== + +===0.5=== + * Moved to requirejs for dependency management. + * Changed global namespace from *DAT* to *dat* (lowercase). + * Added support for color controllers. See [http://workshop.chromeexperiments.com/examples/gui/#4--Color-Controllers Color Controllers]. + * Added support for folders. See [http://workshop.chromeexperiments.com/examples/gui/#3--Folders Folders]. + * Added support for saving named presets. See [http://workshop.chromeexperiments.com/examples/gui/examples/gui/#6--Presets Presets]. + * Removed `height` parameter from GUI constructor. Scrollbar automatically induced when window is too short. + * `dat.GUI.autoPlace` parameter removed. Use `new dat.GUI( { autoPlace: false } )`. See [http://workshop.chromeexperiments.com/examples/gui/#9--Custom-Placement Custom Placement]. + * `gui.autoListen` and `gui.listenAll()` removed. See [http://workshop.chromeexperiments.com/examples/gui/#11--Updating-the-Display-Manually Updating The Display Manually]. + * `dat.GUI.load` removed. See [http://workshop.chromeexperiments.com/examples/gui/#5--Saving-Values Saving Values]. + * Made Controller code completely agnostic of GUI. Controllers can easily be created independent of a GUI panel. + + +===0.4=== + + * Migrated from GitHub to Google Code. + +---- + +==Thanks== +The following libraries / open-source projects were used in the development of dat.GUI: + * [http://requirejs.org/ require.js] + * [http://sass-lang.com/ Sass] + * [http://nodejs.org/ node.js] + * [https://github.com/jquery/qunit QUnit] / [http://jquery.com/ jquery] \ No newline at end of file diff --git a/node_modules/dat-gui/vendor/dat.color.js b/node_modules/dat-gui/vendor/dat.color.js new file mode 100755 index 00000000..57351e8f --- /dev/null +++ b/node_modules/dat-gui/vendor/dat.color.js @@ -0,0 +1,755 @@ +/** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +/** @namespace */ +var dat = module.exports = dat || {}; + +/** @namespace */ +dat.color = dat.color || {}; + +/** @namespace */ +dat.utils = dat.utils || {}; + +dat.utils.common = (function () { + + var ARR_EACH = Array.prototype.forEach; + var ARR_SLICE = Array.prototype.slice; + + /** + * Band-aid methods for things that should be a lot easier in JavaScript. + * Implementation and structure inspired by underscore.js + * http://documentcloud.github.com/underscore/ + */ + + return { + + BREAK: {}, + + extend: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (!this.isUndefined(obj[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + defaults: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (this.isUndefined(target[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + compose: function() { + var toCall = ARR_SLICE.call(arguments); + return function() { + var args = ARR_SLICE.call(arguments); + for (var i = toCall.length -1; i >= 0; i--) { + args = [toCall[i].apply(this, args)]; + } + return args[0]; + } + }, + + each: function(obj, itr, scope) { + + + if (ARR_EACH && obj.forEach === ARR_EACH) { + + obj.forEach(itr, scope); + + } else if (obj.length === obj.length + 0) { // Is number but not NaN + + for (var key = 0, l = obj.length; key < l; key++) + if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) + return; + + } else { + + for (var key in obj) + if (itr.call(scope, obj[key], key) === this.BREAK) + return; + + } + + }, + + defer: function(fnc) { + setTimeout(fnc, 0); + }, + + toArray: function(obj) { + if (obj.toArray) return obj.toArray(); + return ARR_SLICE.call(obj); + }, + + isUndefined: function(obj) { + return obj === undefined; + }, + + isNull: function(obj) { + return obj === null; + }, + + isNaN: function(obj) { + return obj !== obj; + }, + + isArray: Array.isArray || function(obj) { + return obj.constructor === Array; + }, + + isObject: function(obj) { + return obj === Object(obj); + }, + + isNumber: function(obj) { + return obj === obj+0; + }, + + isString: function(obj) { + return obj === obj+''; + }, + + isBoolean: function(obj) { + return obj === false || obj === true; + }, + + isFunction: function(obj) { + return Object.prototype.toString.call(obj) === '[object Function]'; + } + + }; + +})(); + + +dat.color.toString = (function (common) { + + return function(color) { + + if (color.a == 1 || common.isUndefined(color.a)) { + + var s = color.hex.toString(16); + while (s.length < 6) { + s = '0' + s; + } + + return '#' + s; + + } else { + + return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')'; + + } + + } + +})(dat.utils.common); + + +dat.Color = dat.color.Color = (function (interpret, math, toString, common) { + + var Color = function() { + + this.__state = interpret.apply(this, arguments); + + if (this.__state === false) { + throw 'Failed to interpret color arguments'; + } + + this.__state.a = this.__state.a || 1; + + + }; + + Color.COMPONENTS = ['r','g','b','h','s','v','hex','a']; + + common.extend(Color.prototype, { + + toString: function() { + return toString(this); + }, + + toOriginal: function() { + return this.__state.conversion.write(this); + } + + }); + + defineRGBComponent(Color.prototype, 'r', 2); + defineRGBComponent(Color.prototype, 'g', 1); + defineRGBComponent(Color.prototype, 'b', 0); + + defineHSVComponent(Color.prototype, 'h'); + defineHSVComponent(Color.prototype, 's'); + defineHSVComponent(Color.prototype, 'v'); + + Object.defineProperty(Color.prototype, 'a', { + + get: function() { + return this.__state.a; + }, + + set: function(v) { + this.__state.a = v; + } + + }); + + Object.defineProperty(Color.prototype, 'hex', { + + get: function() { + + if (!this.__state.space !== 'HEX') { + this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b); + } + + return this.__state.hex; + + }, + + set: function(v) { + + this.__state.space = 'HEX'; + this.__state.hex = v; + + } + + }); + + function defineRGBComponent(target, component, componentHexIndex) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'RGB') { + return this.__state[component]; + } + + recalculateRGB(this, component, componentHexIndex); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'RGB') { + recalculateRGB(this, component, componentHexIndex); + this.__state.space = 'RGB'; + } + + this.__state[component] = v; + + } + + }); + + } + + function defineHSVComponent(target, component) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'HSV') + return this.__state[component]; + + recalculateHSV(this); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'HSV') { + recalculateHSV(this); + this.__state.space = 'HSV'; + } + + this.__state[component] = v; + + } + + }); + + } + + function recalculateRGB(color, component, componentHexIndex) { + + if (color.__state.space === 'HEX') { + + color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex); + + } else if (color.__state.space === 'HSV') { + + common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); + + } else { + + throw 'Corrupted color state'; + + } + + } + + function recalculateHSV(color) { + + var result = math.rgb_to_hsv(color.r, color.g, color.b); + + common.extend(color.__state, + { + s: result.s, + v: result.v + } + ); + + if (!common.isNaN(result.h)) { + color.__state.h = result.h; + } else if (common.isUndefined(color.__state.h)) { + color.__state.h = 0; + } + + } + + return Color; + +})(dat.color.interpret = (function (toString, common) { + + var result, toReturn; + + var interpret = function() { + + toReturn = false; + + var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0]; + + common.each(INTERPRETATIONS, function(family) { + + if (family.litmus(original)) { + + common.each(family.conversions, function(conversion, conversionName) { + + result = conversion.read(original); + + if (toReturn === false && result !== false) { + toReturn = result; + result.conversionName = conversionName; + result.conversion = conversion; + return common.BREAK; + + } + + }); + + return common.BREAK; + + } + + }); + + return toReturn; + + }; + + var INTERPRETATIONS = [ + + // Strings + { + + litmus: common.isString, + + conversions: { + + THREE_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt( + '0x' + + test[1].toString() + test[1].toString() + + test[2].toString() + test[2].toString() + + test[3].toString() + test[3].toString()) + }; + + }, + + write: toString + + }, + + SIX_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9]{6})$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString()) + }; + + }, + + write: toString + + }, + + CSS_RGB: { + + read: function(original) { + + var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]) + }; + + }, + + write: toString + + }, + + CSS_RGBA: { + + read: function(original) { + + var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]), + a: parseFloat(test[4]) + }; + + }, + + write: toString + + } + + } + + }, + + // Numbers + { + + litmus: common.isNumber, + + conversions: { + + HEX: { + read: function(original) { + return { + space: 'HEX', + hex: original, + conversionName: 'HEX' + } + }, + + write: function(color) { + return color.hex; + } + } + + } + + }, + + // Arrays + { + + litmus: common.isArray, + + conversions: { + + RGB_ARRAY: { + read: function(original) { + if (original.length != 3) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b]; + } + + }, + + RGBA_ARRAY: { + read: function(original) { + if (original.length != 4) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2], + a: original[3] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b, color.a]; + } + + } + + } + + }, + + // Objects + { + + litmus: common.isObject, + + conversions: { + + RGBA_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b) && + common.isNumber(original.a)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b, + a: color.a + } + } + }, + + RGB_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b + } + } + }, + + HSVA_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v) && + common.isNumber(original.a)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v, + a: color.a + } + } + }, + + HSV_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v + } + } + + } + + } + + } + + + ]; + + return interpret; + + +})(dat.color.toString, +dat.utils.common), +dat.color.math = (function () { + + var tmpComponent; + + return { + + hsv_to_rgb: function(h, s, v) { + + var hi = Math.floor(h / 60) % 6; + + var f = h / 60 - Math.floor(h / 60); + var p = v * (1.0 - s); + var q = v * (1.0 - (f * s)); + var t = v * (1.0 - ((1.0 - f) * s)); + var c = [ + [v, t, p], + [q, v, p], + [p, v, t], + [p, q, v], + [t, p, v], + [v, p, q] + ][hi]; + + return { + r: c[0] * 255, + g: c[1] * 255, + b: c[2] * 255 + }; + + }, + + rgb_to_hsv: function(r, g, b) { + + var min = Math.min(r, g, b), + max = Math.max(r, g, b), + delta = max - min, + h, s; + + if (max != 0) { + s = delta / max; + } else { + return { + h: NaN, + s: 0, + v: 0 + }; + } + + if (r == max) { + h = (g - b) / delta; + } else if (g == max) { + h = 2 + (b - r) / delta; + } else { + h = 4 + (r - g) / delta; + } + h /= 6; + if (h < 0) { + h += 1; + } + + return { + h: h * 360, + s: s, + v: max / 255 + }; + }, + + rgb_to_hex: function(r, g, b) { + var hex = this.hex_with_component(0, 2, r); + hex = this.hex_with_component(hex, 1, g); + hex = this.hex_with_component(hex, 0, b); + return hex; + }, + + component_from_hex: function(hex, componentIndex) { + return (hex >> (componentIndex * 8)) & 0xFF; + }, + + hex_with_component: function(hex, componentIndex, value) { + return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent)); + } + + } + +})(), +dat.color.toString, +dat.utils.common); \ No newline at end of file diff --git a/node_modules/dat-gui/vendor/dat.gui.js b/node_modules/dat-gui/vendor/dat.gui.js new file mode 100755 index 00000000..36f16f1d --- /dev/null +++ b/node_modules/dat-gui/vendor/dat.gui.js @@ -0,0 +1,3660 @@ +/** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +/** @namespace */ +var dat = module.exports = dat || {}; + +/** @namespace */ +dat.gui = dat.gui || {}; + +/** @namespace */ +dat.utils = dat.utils || {}; + +/** @namespace */ +dat.controllers = dat.controllers || {}; + +/** @namespace */ +dat.dom = dat.dom || {}; + +/** @namespace */ +dat.color = dat.color || {}; + +dat.utils.css = (function () { + return { + load: function (url, doc) { + doc = doc || document; + var link = doc.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; + link.href = url; + doc.getElementsByTagName('head')[0].appendChild(link); + }, + inject: function(css, doc) { + doc = doc || document; + var injected = document.createElement('style'); + injected.type = 'text/css'; + injected.innerHTML = css; + doc.getElementsByTagName('head')[0].appendChild(injected); + } + } +})(); + + +dat.utils.common = (function () { + + var ARR_EACH = Array.prototype.forEach; + var ARR_SLICE = Array.prototype.slice; + + /** + * Band-aid methods for things that should be a lot easier in JavaScript. + * Implementation and structure inspired by underscore.js + * http://documentcloud.github.com/underscore/ + */ + + return { + + BREAK: {}, + + extend: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (!this.isUndefined(obj[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + defaults: function(target) { + + this.each(ARR_SLICE.call(arguments, 1), function(obj) { + + for (var key in obj) + if (this.isUndefined(target[key])) + target[key] = obj[key]; + + }, this); + + return target; + + }, + + compose: function() { + var toCall = ARR_SLICE.call(arguments); + return function() { + var args = ARR_SLICE.call(arguments); + for (var i = toCall.length -1; i >= 0; i--) { + args = [toCall[i].apply(this, args)]; + } + return args[0]; + } + }, + + each: function(obj, itr, scope) { + + + if (ARR_EACH && obj.forEach === ARR_EACH) { + + obj.forEach(itr, scope); + + } else if (obj.length === obj.length + 0) { // Is number but not NaN + + for (var key = 0, l = obj.length; key < l; key++) + if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) + return; + + } else { + + for (var key in obj) + if (itr.call(scope, obj[key], key) === this.BREAK) + return; + + } + + }, + + defer: function(fnc) { + setTimeout(fnc, 0); + }, + + toArray: function(obj) { + if (obj.toArray) return obj.toArray(); + return ARR_SLICE.call(obj); + }, + + isUndefined: function(obj) { + return obj === undefined; + }, + + isNull: function(obj) { + return obj === null; + }, + + isNaN: function(obj) { + return obj !== obj; + }, + + isArray: Array.isArray || function(obj) { + return obj.constructor === Array; + }, + + isObject: function(obj) { + return obj === Object(obj); + }, + + isNumber: function(obj) { + return obj === obj+0; + }, + + isString: function(obj) { + return obj === obj+''; + }, + + isBoolean: function(obj) { + return obj === false || obj === true; + }, + + isFunction: function(obj) { + return Object.prototype.toString.call(obj) === '[object Function]'; + } + + }; + +})(); + + +dat.controllers.Controller = (function (common) { + + /** + * @class An "abstract" class that represents a given property of an object. + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var Controller = function(object, property) { + + this.initialValue = object[property]; + + /** + * Those who extend this class will put their DOM elements in here. + * @type {DOMElement} + */ + this.domElement = document.createElement('div'); + + /** + * The object to manipulate + * @type {Object} + */ + this.object = object; + + /** + * The name of the property to manipulate + * @type {String} + */ + this.property = property; + + /** + * The function to be called on change. + * @type {Function} + * @ignore + */ + this.__onChange = undefined; + + /** + * The function to be called on finishing change. + * @type {Function} + * @ignore + */ + this.__onFinishChange = undefined; + + }; + + common.extend( + + Controller.prototype, + + /** @lends dat.controllers.Controller.prototype */ + { + + /** + * Specify that a function fire every time someone changes the value with + * this Controller. + * + * @param {Function} fnc This function will be called whenever the value + * is modified via this Controller. + * @returns {dat.controllers.Controller} this + */ + onChange: function(fnc) { + this.__onChange = fnc; + return this; + }, + + /** + * Specify that a function fire every time someone "finishes" changing + * the value wih this Controller. Useful for values that change + * incrementally like numbers or strings. + * + * @param {Function} fnc This function will be called whenever + * someone "finishes" changing the value via this Controller. + * @returns {dat.controllers.Controller} this + */ + onFinishChange: function(fnc) { + this.__onFinishChange = fnc; + return this; + }, + + /** + * Change the value of object[property] + * + * @param {Object} newValue The new value of object[property] + */ + setValue: function(newValue) { + this.object[this.property] = newValue; + if (this.__onChange) { + this.__onChange.call(this, newValue); + } + this.updateDisplay(); + return this; + }, + + /** + * Gets the value of object[property] + * + * @returns {Object} The current value of object[property] + */ + getValue: function() { + return this.object[this.property]; + }, + + /** + * Refreshes the visual display of a Controller in order to keep sync + * with the object's current value. + * @returns {dat.controllers.Controller} this + */ + updateDisplay: function() { + return this; + }, + + /** + * @returns {Boolean} true if the value has deviated from initialValue + */ + isModified: function() { + return this.initialValue !== this.getValue() + } + + } + + ); + + return Controller; + + +})(dat.utils.common); + + +dat.dom.dom = (function (common) { + + var EVENT_MAP = { + 'HTMLEvents': ['change'], + 'MouseEvents': ['click','mousemove','mousedown','mouseup', 'mouseover'], + 'KeyboardEvents': ['keydown'] + }; + + var EVENT_MAP_INV = {}; + common.each(EVENT_MAP, function(v, k) { + common.each(v, function(e) { + EVENT_MAP_INV[e] = k; + }); + }); + + var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/; + + function cssValueToPixels(val) { + + if (val === '0' || common.isUndefined(val)) return 0; + + var match = val.match(CSS_VALUE_PIXELS); + + if (!common.isNull(match)) { + return parseFloat(match[1]); + } + + // TODO ...ems? %? + + return 0; + + } + + /** + * @namespace + * @member dat.dom + */ + var dom = { + + /** + * + * @param elem + * @param selectable + */ + makeSelectable: function(elem, selectable) { + + if (elem === undefined || elem.style === undefined) return; + + elem.onselectstart = selectable ? function() { + return false; + } : function() { + }; + + elem.style.MozUserSelect = selectable ? 'auto' : 'none'; + elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none'; + elem.unselectable = selectable ? 'on' : 'off'; + + }, + + /** + * + * @param elem + * @param horizontal + * @param vertical + */ + makeFullscreen: function(elem, horizontal, vertical) { + + if (common.isUndefined(horizontal)) horizontal = true; + if (common.isUndefined(vertical)) vertical = true; + + elem.style.position = 'absolute'; + + if (horizontal) { + elem.style.left = 0; + elem.style.right = 0; + } + if (vertical) { + elem.style.top = 0; + elem.style.bottom = 0; + } + + }, + + /** + * + * @param elem + * @param eventType + * @param params + */ + fakeEvent: function(elem, eventType, params, aux) { + params = params || {}; + var className = EVENT_MAP_INV[eventType]; + if (!className) { + throw new Error('Event type ' + eventType + ' not supported.'); + } + var evt = document.createEvent(className); + switch (className) { + case 'MouseEvents': + var clientX = params.x || params.clientX || 0; + var clientY = params.y || params.clientY || 0; + evt.initMouseEvent(eventType, params.bubbles || false, + params.cancelable || true, window, params.clickCount || 1, + 0, //screen X + 0, //screen Y + clientX, //client X + clientY, //client Y + false, false, false, false, 0, null); + break; + case 'KeyboardEvents': + var init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz + common.defaults(params, { + cancelable: true, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: undefined, + charCode: undefined + }); + init(eventType, params.bubbles || false, + params.cancelable, window, + params.ctrlKey, params.altKey, + params.shiftKey, params.metaKey, + params.keyCode, params.charCode); + break; + default: + evt.initEvent(eventType, params.bubbles || false, + params.cancelable || true); + break; + } + common.defaults(evt, aux); + elem.dispatchEvent(evt); + }, + + /** + * + * @param elem + * @param event + * @param func + * @param bool + */ + bind: function(elem, event, func, bool) { + bool = bool || false; + if (elem.addEventListener) + elem.addEventListener(event, func, bool); + else if (elem.attachEvent) + elem.attachEvent('on' + event, func); + return dom; + }, + + /** + * + * @param elem + * @param event + * @param func + * @param bool + */ + unbind: function(elem, event, func, bool) { + bool = bool || false; + if (elem.removeEventListener) + elem.removeEventListener(event, func, bool); + else if (elem.detachEvent) + elem.detachEvent('on' + event, func); + return dom; + }, + + /** + * + * @param elem + * @param className + */ + addClass: function(elem, className) { + if (elem.className === undefined) { + elem.className = className; + } else if (elem.className !== className) { + var classes = elem.className.split(/ +/); + if (classes.indexOf(className) == -1) { + classes.push(className); + elem.className = classes.join(' ').replace(/^\s+/, '').replace(/\s+$/, ''); + } + } + return dom; + }, + + /** + * + * @param elem + * @param className + */ + removeClass: function(elem, className) { + if (className) { + if (elem.className === undefined) { + // elem.className = className; + } else if (elem.className === className) { + elem.removeAttribute('class'); + } else { + var classes = elem.className.split(/ +/); + var index = classes.indexOf(className); + if (index != -1) { + classes.splice(index, 1); + elem.className = classes.join(' '); + } + } + } else { + elem.className = undefined; + } + return dom; + }, + + hasClass: function(elem, className) { + return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(elem.className) || false; + }, + + /** + * + * @param elem + */ + getWidth: function(elem) { + + var style = getComputedStyle(elem); + + return cssValueToPixels(style['border-left-width']) + + cssValueToPixels(style['border-right-width']) + + cssValueToPixels(style['padding-left']) + + cssValueToPixels(style['padding-right']) + + cssValueToPixels(style['width']); + }, + + /** + * + * @param elem + */ + getHeight: function(elem) { + + var style = getComputedStyle(elem); + + return cssValueToPixels(style['border-top-width']) + + cssValueToPixels(style['border-bottom-width']) + + cssValueToPixels(style['padding-top']) + + cssValueToPixels(style['padding-bottom']) + + cssValueToPixels(style['height']); + }, + + /** + * + * @param elem + */ + getOffset: function(elem) { + var offset = {left: 0, top:0}; + if (elem.offsetParent) { + do { + offset.left += elem.offsetLeft; + offset.top += elem.offsetTop; + } while (elem = elem.offsetParent); + } + return offset; + }, + + // http://stackoverflow.com/posts/2684561/revisions + /** + * + * @param elem + */ + isActive: function(elem) { + return elem === document.activeElement && ( elem.type || elem.href ); + } + + }; + + return dom; + +})(dat.utils.common); + + +dat.controllers.OptionController = (function (Controller, dom, common) { + + /** + * @class Provides a select input to alter the property of an object, using a + * list of accepted values. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Object|string[]} options A map of labels to acceptable values, or + * a list of acceptable string values. + * + * @member dat.controllers + */ + var OptionController = function(object, property, options) { + + OptionController.superclass.call(this, object, property); + + var _this = this; + + /** + * The drop down menu + * @ignore + */ + this.__select = document.createElement('select'); + + if (common.isArray(options)) { + var map = {}; + common.each(options, function(element) { + map[element] = element; + }); + options = map; + } + + common.each(options, function(value, key) { + + var opt = document.createElement('option'); + opt.innerHTML = key; + opt.setAttribute('value', value); + _this.__select.appendChild(opt); + + }); + + // Acknowledge original value + this.updateDisplay(); + + dom.bind(this.__select, 'change', function() { + var desiredValue = this.options[this.selectedIndex].value; + _this.setValue(desiredValue); + }); + + this.domElement.appendChild(this.__select); + + }; + + OptionController.superclass = Controller; + + common.extend( + + OptionController.prototype, + Controller.prototype, + + { + + setValue: function(v) { + var toReturn = OptionController.superclass.prototype.setValue.call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + return toReturn; + }, + + updateDisplay: function() { + this.__select.value = this.getValue(); + return OptionController.superclass.prototype.updateDisplay.call(this); + } + + } + + ); + + return OptionController; + +})(dat.controllers.Controller, +dat.dom.dom, +dat.utils.common); + + +dat.controllers.NumberController = (function (Controller, common) { + + /** + * @class Represents a given property of an object that is a number. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Object} [params] Optional parameters + * @param {Number} [params.min] Minimum allowed value + * @param {Number} [params.max] Maximum allowed value + * @param {Number} [params.step] Increment by which to change value + * + * @member dat.controllers + */ + var NumberController = function(object, property, params) { + + NumberController.superclass.call(this, object, property); + + params = params || {}; + + this.__min = params.min; + this.__max = params.max; + this.__step = params.step; + + if (common.isUndefined(this.__step)) { + + if (this.initialValue == 0) { + this.__impliedStep = 1; // What are we, psychics? + } else { + // Hey Doug, check this out. + this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue)/Math.LN10))/10; + } + + } else { + + this.__impliedStep = this.__step; + + } + + this.__precision = numDecimals(this.__impliedStep); + + + }; + + NumberController.superclass = Controller; + + common.extend( + + NumberController.prototype, + Controller.prototype, + + /** @lends dat.controllers.NumberController.prototype */ + { + + setValue: function(v) { + + if (this.__min !== undefined && v < this.__min) { + v = this.__min; + } else if (this.__max !== undefined && v > this.__max) { + v = this.__max; + } + + if (this.__step !== undefined && v % this.__step != 0) { + v = Math.round(v / this.__step) * this.__step; + } + + return NumberController.superclass.prototype.setValue.call(this, v); + + }, + + /** + * Specify a minimum value for object[property]. + * + * @param {Number} minValue The minimum value for + * object[property] + * @returns {dat.controllers.NumberController} this + */ + min: function(v) { + this.__min = v; + return this; + }, + + /** + * Specify a maximum value for object[property]. + * + * @param {Number} maxValue The maximum value for + * object[property] + * @returns {dat.controllers.NumberController} this + */ + max: function(v) { + this.__max = v; + return this; + }, + + /** + * Specify a step value that dat.controllers.NumberController + * increments by. + * + * @param {Number} stepValue The step value for + * dat.controllers.NumberController + * @default if minimum and maximum specified increment is 1% of the + * difference otherwise stepValue is 1 + * @returns {dat.controllers.NumberController} this + */ + step: function(v) { + this.__step = v; + return this; + } + + } + + ); + + function numDecimals(x) { + x = x.toString(); + if (x.indexOf('.') > -1) { + return x.length - x.indexOf('.') - 1; + } else { + return 0; + } + } + + return NumberController; + +})(dat.controllers.Controller, +dat.utils.common); + + +dat.controllers.NumberControllerBox = (function (NumberController, dom, common) { + + /** + * @class Represents a given property of an object that is a number and + * provides an input element with which to manipulate it. + * + * @extends dat.controllers.Controller + * @extends dat.controllers.NumberController + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Object} [params] Optional parameters + * @param {Number} [params.min] Minimum allowed value + * @param {Number} [params.max] Maximum allowed value + * @param {Number} [params.step] Increment by which to change value + * + * @member dat.controllers + */ + var NumberControllerBox = function(object, property, params) { + + this.__truncationSuspended = false; + + NumberControllerBox.superclass.call(this, object, property, params); + + var _this = this; + + /** + * {Number} Previous mouse y position + * @ignore + */ + var prev_y; + + this.__input = document.createElement('input'); + this.__input.setAttribute('type', 'text'); + + // Makes it so manually specified values are not truncated. + + dom.bind(this.__input, 'change', onChange); + dom.bind(this.__input, 'blur', onBlur); + dom.bind(this.__input, 'mousedown', onMouseDown); + dom.bind(this.__input, 'keydown', function(e) { + + // When pressing entire, you can be as precise as you want. + if (e.keyCode === 13) { + _this.__truncationSuspended = true; + this.blur(); + _this.__truncationSuspended = false; + } + + }); + + function onChange() { + var attempted = parseFloat(_this.__input.value); + if (!common.isNaN(attempted)) _this.setValue(attempted); + } + + function onBlur() { + onChange(); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + function onMouseDown(e) { + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + prev_y = e.clientY; + } + + function onMouseDrag(e) { + + var diff = prev_y - e.clientY; + _this.setValue(_this.getValue() + diff * _this.__impliedStep); + + prev_y = e.clientY; + + } + + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + } + + this.updateDisplay(); + + this.domElement.appendChild(this.__input); + + }; + + NumberControllerBox.superclass = NumberController; + + common.extend( + + NumberControllerBox.prototype, + NumberController.prototype, + + { + + updateDisplay: function() { + + this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); + return NumberControllerBox.superclass.prototype.updateDisplay.call(this); + } + + } + + ); + + function roundToDecimal(value, decimals) { + var tenTo = Math.pow(10, decimals); + return Math.round(value * tenTo) / tenTo; + } + + return NumberControllerBox; + +})(dat.controllers.NumberController, +dat.dom.dom, +dat.utils.common); + + +dat.controllers.NumberControllerSlider = (function (NumberController, dom, css, common, styleSheet) { + + /** + * @class Represents a given property of an object that is a number, contains + * a minimum and maximum, and provides a slider element with which to + * manipulate it. It should be noted that the slider element is made up of + * <div> tags, not the html5 + * <slider> element. + * + * @extends dat.controllers.Controller + * @extends dat.controllers.NumberController + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * @param {Number} minValue Minimum allowed value + * @param {Number} maxValue Maximum allowed value + * @param {Number} stepValue Increment by which to change value + * + * @member dat.controllers + */ + var NumberControllerSlider = function(object, property, min, max, step) { + + NumberControllerSlider.superclass.call(this, object, property, { min: min, max: max, step: step }); + + var _this = this; + + this.__background = document.createElement('div'); + this.__foreground = document.createElement('div'); + + + + dom.bind(this.__background, 'mousedown', onMouseDown); + + dom.addClass(this.__background, 'slider'); + dom.addClass(this.__foreground, 'slider-fg'); + + function onMouseDown(e) { + + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + + onMouseDrag(e); + } + + function onMouseDrag(e) { + + e.preventDefault(); + + var offset = dom.getOffset(_this.__background); + var width = dom.getWidth(_this.__background); + + _this.setValue( + map(e.clientX, offset.left, offset.left + width, _this.__min, _this.__max) + ); + + return false; + + } + + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + this.updateDisplay(); + + this.__background.appendChild(this.__foreground); + this.domElement.appendChild(this.__background); + + }; + + NumberControllerSlider.superclass = NumberController; + + /** + * Injects default stylesheet for slider elements. + */ + NumberControllerSlider.useDefaultStyles = function() { + css.inject(styleSheet); + }; + + common.extend( + + NumberControllerSlider.prototype, + NumberController.prototype, + + { + + updateDisplay: function() { + var pct = (this.getValue() - this.__min)/(this.__max - this.__min); + this.__foreground.style.width = pct*100+'%'; + return NumberControllerSlider.superclass.prototype.updateDisplay.call(this); + } + + } + + + + ); + + function map(v, i1, i2, o1, o2) { + return o1 + (o2 - o1) * ((v - i1) / (i2 - i1)); + } + + return NumberControllerSlider; + +})(dat.controllers.NumberController, +dat.dom.dom, +dat.utils.css, +dat.utils.common, +".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); + + +dat.controllers.FunctionController = (function (Controller, dom, common) { + + /** + * @class Provides a GUI interface to fire a specified method, a property of an object. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var FunctionController = function(object, property, text) { + + FunctionController.superclass.call(this, object, property); + + var _this = this; + + this.__button = document.createElement('div'); + this.__button.innerHTML = text === undefined ? 'Fire' : text; + dom.bind(this.__button, 'click', function(e) { + e.preventDefault(); + _this.fire(); + return false; + }); + + dom.addClass(this.__button, 'button'); + + this.domElement.appendChild(this.__button); + + + }; + + FunctionController.superclass = Controller; + + common.extend( + + FunctionController.prototype, + Controller.prototype, + { + + fire: function() { + if (this.__onChange) { + this.__onChange.call(this); + } + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + this.getValue().call(this.object); + } + } + + ); + + return FunctionController; + +})(dat.controllers.Controller, +dat.dom.dom, +dat.utils.common); + + +dat.controllers.BooleanController = (function (Controller, dom, common) { + + /** + * @class Provides a checkbox input to alter the boolean property of an object. + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var BooleanController = function(object, property) { + + BooleanController.superclass.call(this, object, property); + + var _this = this; + this.__prev = this.getValue(); + + this.__checkbox = document.createElement('input'); + this.__checkbox.setAttribute('type', 'checkbox'); + + + dom.bind(this.__checkbox, 'change', onChange, false); + + this.domElement.appendChild(this.__checkbox); + + // Match original value + this.updateDisplay(); + + function onChange() { + _this.setValue(!_this.__prev); + } + + }; + + BooleanController.superclass = Controller; + + common.extend( + + BooleanController.prototype, + Controller.prototype, + + { + + setValue: function(v) { + var toReturn = BooleanController.superclass.prototype.setValue.call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + this.__prev = this.getValue(); + return toReturn; + }, + + updateDisplay: function() { + + if (this.getValue() === true) { + this.__checkbox.setAttribute('checked', 'checked'); + this.__checkbox.checked = true; + } else { + this.__checkbox.checked = false; + } + + return BooleanController.superclass.prototype.updateDisplay.call(this); + + } + + + } + + ); + + return BooleanController; + +})(dat.controllers.Controller, +dat.dom.dom, +dat.utils.common); + + +dat.color.toString = (function (common) { + + return function(color) { + + if (color.a == 1 || common.isUndefined(color.a)) { + + var s = color.hex.toString(16); + while (s.length < 6) { + s = '0' + s; + } + + return '#' + s; + + } else { + + return 'rgba(' + Math.round(color.r) + ',' + Math.round(color.g) + ',' + Math.round(color.b) + ',' + color.a + ')'; + + } + + } + +})(dat.utils.common); + + +dat.color.interpret = (function (toString, common) { + + var result, toReturn; + + var interpret = function() { + + toReturn = false; + + var original = arguments.length > 1 ? common.toArray(arguments) : arguments[0]; + + common.each(INTERPRETATIONS, function(family) { + + if (family.litmus(original)) { + + common.each(family.conversions, function(conversion, conversionName) { + + result = conversion.read(original); + + if (toReturn === false && result !== false) { + toReturn = result; + result.conversionName = conversionName; + result.conversion = conversion; + return common.BREAK; + + } + + }); + + return common.BREAK; + + } + + }); + + return toReturn; + + }; + + var INTERPRETATIONS = [ + + // Strings + { + + litmus: common.isString, + + conversions: { + + THREE_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt( + '0x' + + test[1].toString() + test[1].toString() + + test[2].toString() + test[2].toString() + + test[3].toString() + test[3].toString()) + }; + + }, + + write: toString + + }, + + SIX_CHAR_HEX: { + + read: function(original) { + + var test = original.match(/^#([A-F0-9]{6})$/i); + if (test === null) return false; + + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString()) + }; + + }, + + write: toString + + }, + + CSS_RGB: { + + read: function(original) { + + var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]) + }; + + }, + + write: toString + + }, + + CSS_RGBA: { + + read: function(original) { + + var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/); + if (test === null) return false; + + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]), + a: parseFloat(test[4]) + }; + + }, + + write: toString + + } + + } + + }, + + // Numbers + { + + litmus: common.isNumber, + + conversions: { + + HEX: { + read: function(original) { + return { + space: 'HEX', + hex: original, + conversionName: 'HEX' + } + }, + + write: function(color) { + return color.hex; + } + } + + } + + }, + + // Arrays + { + + litmus: common.isArray, + + conversions: { + + RGB_ARRAY: { + read: function(original) { + if (original.length != 3) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b]; + } + + }, + + RGBA_ARRAY: { + read: function(original) { + if (original.length != 4) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2], + a: original[3] + }; + }, + + write: function(color) { + return [color.r, color.g, color.b, color.a]; + } + + } + + } + + }, + + // Objects + { + + litmus: common.isObject, + + conversions: { + + RGBA_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b) && + common.isNumber(original.a)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b, + a: color.a + } + } + }, + + RGB_OBJ: { + read: function(original) { + if (common.isNumber(original.r) && + common.isNumber(original.g) && + common.isNumber(original.b)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b + } + } + return false; + }, + + write: function(color) { + return { + r: color.r, + g: color.g, + b: color.b + } + } + }, + + HSVA_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v) && + common.isNumber(original.a)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v, + a: original.a + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v, + a: color.a + } + } + }, + + HSV_OBJ: { + read: function(original) { + if (common.isNumber(original.h) && + common.isNumber(original.s) && + common.isNumber(original.v)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v + } + } + return false; + }, + + write: function(color) { + return { + h: color.h, + s: color.s, + v: color.v + } + } + + } + + } + + } + + + ]; + + return interpret; + + +})(dat.color.toString, +dat.utils.common); + + +dat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, controllerFactory, Controller, BooleanController, FunctionController, NumberControllerBox, NumberControllerSlider, OptionController, ColorController, requestAnimationFrame, CenteredDiv, dom, common) { + + css.inject(styleSheet); + + /** Outer-most className for GUI's */ + var CSS_NAMESPACE = 'dg'; + + var HIDE_KEY_CODE = 72; + + /** The only value shared between the JS and SCSS. Use caution. */ + var CLOSE_BUTTON_HEIGHT = 20; + + var DEFAULT_DEFAULT_PRESET_NAME = 'Default'; + + var SUPPORTS_LOCAL_STORAGE = (function() { + try { + return 'localStorage' in window && window['localStorage'] !== null; + } catch (e) { + return false; + } + })(); + + var SAVE_DIALOGUE; + + /** Have we yet to create an autoPlace GUI? */ + var auto_place_virgin = true; + + /** Fixed position div that auto place GUI's go inside */ + var auto_place_container; + + /** Are we hiding the GUI's ? */ + var hide = false; + + /** GUI's which should be hidden */ + var hideable_guis = []; + + /** + * A lightweight controller library for JavaScript. It allows you to easily + * manipulate variables and fire functions on the fly. + * @class + * + * @member dat.gui + * + * @param {Object} [params] + * @param {String} [params.name] The name of this GUI. + * @param {Object} [params.load] JSON object representing the saved state of + * this GUI. + * @param {Boolean} [params.auto=true] + * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in. + * @param {Boolean} [params.closed] If true, starts closed + */ + var GUI = function(params) { + + var _this = this; + + /** + * Outermost DOM Element + * @type DOMElement + */ + this.domElement = document.createElement('div'); + this.__ul = document.createElement('ul'); + this.domElement.appendChild(this.__ul); + + dom.addClass(this.domElement, CSS_NAMESPACE); + + /** + * Nested GUI's by name + * @ignore + */ + this.__folders = {}; + + this.__controllers = []; + + /** + * List of objects I'm remembering for save, only used in top level GUI + * @ignore + */ + this.__rememberedObjects = []; + + /** + * Maps the index of remembered objects to a map of controllers, only used + * in top level GUI. + * + * @private + * @ignore + * + * @example + * [ + * { + * propertyName: Controller, + * anotherPropertyName: Controller + * }, + * { + * propertyName: Controller + * } + * ] + */ + this.__rememberedObjectIndecesToControllers = []; + + this.__listening = []; + + params = params || {}; + + // Default parameters + params = common.defaults(params, { + autoPlace: true, + width: GUI.DEFAULT_WIDTH + }); + + params = common.defaults(params, { + resizable: params.autoPlace, + hideable: params.autoPlace + }); + + + if (!common.isUndefined(params.load)) { + + // Explicit preset + if (params.preset) params.load.preset = params.preset; + + } else { + + params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME }; + + } + + if (common.isUndefined(params.parent) && params.hideable) { + hideable_guis.push(this); + } + + // Only root level GUI's are resizable. + params.resizable = common.isUndefined(params.parent) && params.resizable; + + + if (params.autoPlace && common.isUndefined(params.scrollable)) { + params.scrollable = true; + } +// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true; + + // Not part of params because I don't want people passing this in via + // constructor. Should be a 'remembered' value. + var use_local_storage = + SUPPORTS_LOCAL_STORAGE && + localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true'; + + Object.defineProperties(this, + + /** @lends dat.gui.GUI.prototype */ + { + + /** + * The parent GUI + * @type dat.gui.GUI + */ + parent: { + get: function() { + return params.parent; + } + }, + + scrollable: { + get: function() { + return params.scrollable; + } + }, + + /** + * Handles GUI's element placement for you + * @type Boolean + */ + autoPlace: { + get: function() { + return params.autoPlace; + } + }, + + /** + * The identifier for a set of saved values + * @type String + */ + preset: { + + get: function() { + if (_this.parent) { + return _this.getRoot().preset; + } else { + return params.load.preset; + } + }, + + set: function(v) { + if (_this.parent) { + _this.getRoot().preset = v; + } else { + params.load.preset = v; + } + setPresetSelectIndex(this); + _this.revert(); + } + + }, + + /** + * The width of GUI element + * @type Number + */ + width: { + get: function() { + return params.width; + }, + set: function(v) { + params.width = v; + setWidth(_this, v); + } + }, + + /** + * The name of GUI. Used for folders. i.e + * a folder's name + * @type String + */ + name: { + get: function() { + return params.name; + }, + set: function(v) { + // TODO Check for collisions among sibling folders + params.name = v; + if (title_row_name) { + title_row_name.innerHTML = params.name; + } + } + }, + + /** + * Whether the GUI is collapsed or not + * @type Boolean + */ + closed: { + get: function() { + return params.closed; + }, + set: function(v) { + params.closed = v; + if (params.closed) { + dom.addClass(_this.__ul, GUI.CLASS_CLOSED); + } else { + dom.removeClass(_this.__ul, GUI.CLASS_CLOSED); + } + // For browsers that aren't going to respect the CSS transition, + // Lets just check our height against the window height right off + // the bat. + this.onResize(); + + if (_this.__closeButton) { + _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED; + } + } + }, + + /** + * Contains all presets + * @type Object + */ + load: { + get: function() { + return params.load; + } + }, + + /** + * Determines whether or not to use localStorage as the means for + * remembering + * @type Boolean + */ + useLocalStorage: { + + get: function() { + return use_local_storage; + }, + set: function(bool) { + if (SUPPORTS_LOCAL_STORAGE) { + use_local_storage = bool; + if (bool) { + dom.bind(window, 'unload', saveToLocalStorage); + } else { + dom.unbind(window, 'unload', saveToLocalStorage); + } + localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool); + } + } + + } + + }); + + // Are we a root level GUI? + if (common.isUndefined(params.parent)) { + + params.closed = false; + + dom.addClass(this.domElement, GUI.CLASS_MAIN); + dom.makeSelectable(this.domElement, false); + + // Are we supposed to be loading locally? + if (SUPPORTS_LOCAL_STORAGE) { + + if (use_local_storage) { + + _this.useLocalStorage = true; + + var saved_gui = localStorage.getItem(getLocalStorageHash(this, 'gui')); + + if (saved_gui) { + params.load = JSON.parse(saved_gui); + } + + } + + } + + this.__closeButton = document.createElement('div'); + this.__closeButton.innerHTML = GUI.TEXT_CLOSED; + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON); + this.domElement.appendChild(this.__closeButton); + + dom.bind(this.__closeButton, 'click', function() { + + _this.closed = !_this.closed; + + + }); + + + // Oh, you're a nested GUI! + } else { + + if (params.closed === undefined) { + params.closed = true; + } + + var title_row_name = document.createTextNode(params.name); + dom.addClass(title_row_name, 'controller-name'); + + var title_row = addRow(_this, title_row_name); + + var on_click_title = function(e) { + e.preventDefault(); + _this.closed = !_this.closed; + return false; + }; + + dom.addClass(this.__ul, GUI.CLASS_CLOSED); + + dom.addClass(title_row, 'title'); + dom.bind(title_row, 'click', on_click_title); + + if (!params.closed) { + this.closed = false; + } + + } + + if (params.autoPlace) { + + if (common.isUndefined(params.parent)) { + + if (auto_place_virgin) { + auto_place_container = document.createElement('div'); + dom.addClass(auto_place_container, CSS_NAMESPACE); + dom.addClass(auto_place_container, GUI.CLASS_AUTO_PLACE_CONTAINER); + document.body.appendChild(auto_place_container); + auto_place_virgin = false; + } + + // Put it in the dom for you. + auto_place_container.appendChild(this.domElement); + + // Apply the auto styles + dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE); + + } + + + // Make it not elastic. + if (!this.parent) setWidth(_this, params.width); + + } + + dom.bind(window, 'resize', function() { _this.onResize() }); + dom.bind(this.__ul, 'webkitTransitionEnd', function() { _this.onResize(); }); + dom.bind(this.__ul, 'transitionend', function() { _this.onResize() }); + dom.bind(this.__ul, 'oTransitionEnd', function() { _this.onResize() }); + this.onResize(); + + + if (params.resizable) { + addResizeHandle(this); + } + + function saveToLocalStorage() { + localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject())); + } + + var root = _this.getRoot(); + function resetWidth() { + var root = _this.getRoot(); + root.width += 1; + common.defer(function() { + root.width -= 1; + }); + } + + if (!params.parent) { + resetWidth(); + } + + }; + + GUI.toggleHide = function() { + + hide = !hide; + common.each(hideable_guis, function(gui) { + gui.domElement.style.zIndex = hide ? -999 : 999; + gui.domElement.style.opacity = hide ? 0 : 1; + }); + }; + + GUI.CLASS_AUTO_PLACE = 'a'; + GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac'; + GUI.CLASS_MAIN = 'main'; + GUI.CLASS_CONTROLLER_ROW = 'cr'; + GUI.CLASS_TOO_TALL = 'taller-than-window'; + GUI.CLASS_CLOSED = 'closed'; + GUI.CLASS_CLOSE_BUTTON = 'close-button'; + GUI.CLASS_DRAG = 'drag'; + + GUI.DEFAULT_WIDTH = 245; + GUI.TEXT_CLOSED = 'Close Controls'; + GUI.TEXT_OPEN = 'Open Controls'; + + dom.bind(window, 'keydown', function(e) { + + if (document.activeElement.type !== 'text' && + (e.which === HIDE_KEY_CODE || e.keyCode == HIDE_KEY_CODE)) { + GUI.toggleHide(); + } + + }, false); + + common.extend( + + GUI.prototype, + + /** @lends dat.gui.GUI */ + { + + /** + * @param object + * @param property + * @returns {dat.controllers.Controller} The new controller that was added. + * @instance + */ + add: function(object, property) { + + return add( + this, + object, + property, + { + factoryArgs: Array.prototype.slice.call(arguments, 2) + } + ); + + }, + + /** + * @param object + * @param property + * @returns {dat.controllers.ColorController} The new controller that was added. + * @instance + */ + addColor: function(object, property) { + + return add( + this, + object, + property, + { + color: true + } + ); + + }, + + /** + * @param controller + * @instance + */ + remove: function(controller) { + + // TODO listening? + this.__ul.removeChild(controller.__li); + this.__controllers.slice(this.__controllers.indexOf(controller), 1); + var _this = this; + common.defer(function() { + _this.onResize(); + }); + + }, + + destroy: function() { + + if (this.autoPlace) { + auto_place_container.removeChild(this.domElement); + } + + }, + + /** + * @param name + * @returns {dat.gui.GUI} The new folder. + * @throws {Error} if this GUI already has a folder by the specified + * name + * @instance + */ + addFolder: function(name) { + + // We have to prevent collisions on names in order to have a key + // by which to remember saved values + if (this.__folders[name] !== undefined) { + throw new Error('You already have a folder in this GUI by the' + + ' name "' + name + '"'); + } + + var new_gui_params = { name: name, parent: this }; + + // We need to pass down the autoPlace trait so that we can + // attach event listeners to open/close folder actions to + // ensure that a scrollbar appears if the window is too short. + new_gui_params.autoPlace = this.autoPlace; + + // Do we have saved appearance data for this folder? + + if (this.load && // Anything loaded? + this.load.folders && // Was my parent a dead-end? + this.load.folders[name]) { // Did daddy remember me? + + // Start me closed if I was closed + new_gui_params.closed = this.load.folders[name].closed; + + // Pass down the loaded data + new_gui_params.load = this.load.folders[name]; + + } + + var gui = new GUI(new_gui_params); + this.__folders[name] = gui; + + var li = addRow(this, gui.domElement); + dom.addClass(li, 'folder'); + return gui; + + }, + + open: function() { + this.closed = false; + }, + + close: function() { + this.closed = true; + }, + + onResize: function() { + + var root = this.getRoot(); + + if (root.scrollable) { + + var top = dom.getOffset(root.__ul).top; + var h = 0; + + common.each(root.__ul.childNodes, function(node) { + if (! (root.autoPlace && node === root.__save_row)) + h += dom.getHeight(node); + }); + + if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) { + dom.addClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px'; + } else { + dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = 'auto'; + } + + } + + if (root.__resize_handle) { + common.defer(function() { + root.__resize_handle.style.height = root.__ul.offsetHeight + 'px'; + }); + } + + if (root.__closeButton) { + root.__closeButton.style.width = root.width + 'px'; + } + + }, + + /** + * Mark objects for saving. The order of these objects cannot change as + * the GUI grows. When remembering new objects, append them to the end + * of the list. + * + * @param {Object...} objects + * @throws {Error} if not called on a top level GUI. + * @instance + */ + remember: function() { + + if (common.isUndefined(SAVE_DIALOGUE)) { + SAVE_DIALOGUE = new CenteredDiv(); + SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents; + } + + if (this.parent) { + throw new Error("You can only call remember on a top level GUI."); + } + + var _this = this; + + common.each(Array.prototype.slice.call(arguments), function(object) { + if (_this.__rememberedObjects.length == 0) { + addSaveMenu(_this); + } + if (_this.__rememberedObjects.indexOf(object) == -1) { + _this.__rememberedObjects.push(object); + } + }); + + if (this.autoPlace) { + // Set save row width + setWidth(this, this.width); + } + + }, + + /** + * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI. + * @instance + */ + getRoot: function() { + var gui = this; + while (gui.parent) { + gui = gui.parent; + } + return gui; + }, + + /** + * @returns {Object} a JSON object representing the current state of + * this GUI as well as its remembered properties. + * @instance + */ + getSaveObject: function() { + + var toReturn = this.load; + + toReturn.closed = this.closed; + + // Am I remembering any values? + if (this.__rememberedObjects.length > 0) { + + toReturn.preset = this.preset; + + if (!toReturn.remembered) { + toReturn.remembered = {}; + } + + toReturn.remembered[this.preset] = getCurrentPreset(this); + + } + + toReturn.folders = {}; + common.each(this.__folders, function(element, key) { + toReturn.folders[key] = element.getSaveObject(); + }); + + return toReturn; + + }, + + save: function() { + + if (!this.load.remembered) { + this.load.remembered = {}; + } + + this.load.remembered[this.preset] = getCurrentPreset(this); + markPresetModified(this, false); + + }, + + saveAs: function(presetName) { + + if (!this.load.remembered) { + + // Retain default values upon first save + this.load.remembered = {}; + this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true); + + } + + this.load.remembered[presetName] = getCurrentPreset(this); + this.preset = presetName; + addPresetOption(this, presetName, true); + + }, + + revert: function(gui) { + + common.each(this.__controllers, function(controller) { + // Make revert work on Default. + if (!this.getRoot().load.remembered) { + controller.setValue(controller.initialValue); + } else { + recallSavedValue(gui || this.getRoot(), controller); + } + }, this); + + common.each(this.__folders, function(folder) { + folder.revert(folder); + }); + + if (!gui) { + markPresetModified(this.getRoot(), false); + } + + + }, + + listen: function(controller) { + + var init = this.__listening.length == 0; + this.__listening.push(controller); + if (init) updateDisplays(this.__listening); + + } + + } + + ); + + function add(gui, object, property, params) { + + if (object[property] === undefined) { + throw new Error("Object " + object + " has no property \"" + property + "\""); + } + + var controller; + + if (params.color) { + + controller = new ColorController(object, property); + + } else { + + var factoryArgs = [object,property].concat(params.factoryArgs); + controller = controllerFactory.apply(gui, factoryArgs); + + } + + if (params.before instanceof Controller) { + params.before = params.before.__li; + } + + recallSavedValue(gui, controller); + + dom.addClass(controller.domElement, 'c'); + + var name = document.createElement('span'); + dom.addClass(name, 'property-name'); + name.innerHTML = controller.property; + + var container = document.createElement('div'); + container.appendChild(name); + container.appendChild(controller.domElement); + + var li = addRow(gui, container, params.before); + + dom.addClass(li, GUI.CLASS_CONTROLLER_ROW); + dom.addClass(li, typeof controller.getValue()); + + augmentController(gui, li, controller); + + gui.__controllers.push(controller); + + return controller; + + } + + /** + * Add a row to the end of the GUI or before another row. + * + * @param gui + * @param [dom] If specified, inserts the dom content in the new row + * @param [liBefore] If specified, places the new row before another row + */ + function addRow(gui, dom, liBefore) { + var li = document.createElement('li'); + if (dom) li.appendChild(dom); + if (liBefore) { + gui.__ul.insertBefore(li, params.before); + } else { + gui.__ul.appendChild(li); + } + gui.onResize(); + return li; + } + + function augmentController(gui, li, controller) { + + controller.__li = li; + controller.__gui = gui; + + common.extend(controller, { + + options: function(options) { + + if (arguments.length > 1) { + controller.remove(); + + return add( + gui, + controller.object, + controller.property, + { + before: controller.__li.nextElementSibling, + factoryArgs: [common.toArray(arguments)] + } + ); + + } + + if (common.isArray(options) || common.isObject(options)) { + controller.remove(); + + return add( + gui, + controller.object, + controller.property, + { + before: controller.__li.nextElementSibling, + factoryArgs: [options] + } + ); + + } + + }, + + name: function(v) { + controller.__li.firstElementChild.firstElementChild.innerHTML = v; + return controller; + }, + + listen: function() { + controller.__gui.listen(controller); + return controller; + }, + + remove: function() { + controller.__gui.remove(controller); + return controller; + } + + }); + + // All sliders should be accompanied by a box. + if (controller instanceof NumberControllerSlider) { + + var box = new NumberControllerBox(controller.object, controller.property, + { min: controller.__min, max: controller.__max, step: controller.__step }); + + common.each(['updateDisplay', 'onChange', 'onFinishChange'], function(method) { + var pc = controller[method]; + var pb = box[method]; + controller[method] = box[method] = function() { + var args = Array.prototype.slice.call(arguments); + pc.apply(controller, args); + return pb.apply(box, args); + } + }); + + dom.addClass(li, 'has-slider'); + controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild); + + } + else if (controller instanceof NumberControllerBox) { + + var r = function(returned) { + + // Have we defined both boundaries? + if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) { + + // Well, then lets just replace this with a slider. + controller.remove(); + return add( + gui, + controller.object, + controller.property, + { + before: controller.__li.nextElementSibling, + factoryArgs: [controller.__min, controller.__max, controller.__step] + }); + + } + + return returned; + + }; + + controller.min = common.compose(r, controller.min); + controller.max = common.compose(r, controller.max); + + } + else if (controller instanceof BooleanController) { + + dom.bind(li, 'click', function() { + dom.fakeEvent(controller.__checkbox, 'click'); + }); + + dom.bind(controller.__checkbox, 'click', function(e) { + e.stopPropagation(); // Prevents double-toggle + }) + + } + else if (controller instanceof FunctionController) { + + dom.bind(li, 'click', function() { + dom.fakeEvent(controller.__button, 'click'); + }); + + dom.bind(li, 'mouseover', function() { + dom.addClass(controller.__button, 'hover'); + }); + + dom.bind(li, 'mouseout', function() { + dom.removeClass(controller.__button, 'hover'); + }); + + } + else if (controller instanceof ColorController) { + + dom.addClass(li, 'color'); + controller.updateDisplay = common.compose(function(r) { + li.style.borderLeftColor = controller.__color.toString(); + return r; + }, controller.updateDisplay); + + controller.updateDisplay(); + + } + + controller.setValue = common.compose(function(r) { + if (gui.getRoot().__preset_select && controller.isModified()) { + markPresetModified(gui.getRoot(), true); + } + return r; + }, controller.setValue); + + } + + function recallSavedValue(gui, controller) { + + // Find the topmost GUI, that's where remembered objects live. + var root = gui.getRoot(); + + // Does the object we're controlling match anything we've been told to + // remember? + var matched_index = root.__rememberedObjects.indexOf(controller.object); + + // Why yes, it does! + if (matched_index != -1) { + + // Let me fetch a map of controllers for thcommon.isObject. + var controller_map = + root.__rememberedObjectIndecesToControllers[matched_index]; + + // Ohp, I believe this is the first controller we've created for this + // object. Lets make the map fresh. + if (controller_map === undefined) { + controller_map = {}; + root.__rememberedObjectIndecesToControllers[matched_index] = + controller_map; + } + + // Keep track of this controller + controller_map[controller.property] = controller; + + // Okay, now have we saved any values for this controller? + if (root.load && root.load.remembered) { + + var preset_map = root.load.remembered; + + // Which preset are we trying to load? + var preset; + + if (preset_map[gui.preset]) { + + preset = preset_map[gui.preset]; + + } else if (preset_map[DEFAULT_DEFAULT_PRESET_NAME]) { + + // Uhh, you can have the default instead? + preset = preset_map[DEFAULT_DEFAULT_PRESET_NAME]; + + } else { + + // Nada. + + return; + + } + + + // Did the loaded object remember thcommon.isObject? + if (preset[matched_index] && + + // Did we remember this particular property? + preset[matched_index][controller.property] !== undefined) { + + // We did remember something for this guy ... + var value = preset[matched_index][controller.property]; + + // And that's what it is. + controller.initialValue = value; + controller.setValue(value); + + } + + } + + } + + } + + function getLocalStorageHash(gui, key) { + // TODO how does this deal with multiple GUI's? + return document.location.href + '.' + key; + + } + + function addSaveMenu(gui) { + + var div = gui.__save_row = document.createElement('li'); + + dom.addClass(gui.domElement, 'has-save'); + + gui.__ul.insertBefore(div, gui.__ul.firstChild); + + dom.addClass(div, 'save-row'); + + var gears = document.createElement('span'); + gears.innerHTML = ' '; + dom.addClass(gears, 'button gears'); + + // TODO replace with FunctionController + var button = document.createElement('span'); + button.innerHTML = 'Save'; + dom.addClass(button, 'button'); + dom.addClass(button, 'save'); + + var button2 = document.createElement('span'); + button2.innerHTML = 'New'; + dom.addClass(button2, 'button'); + dom.addClass(button2, 'save-as'); + + var button3 = document.createElement('span'); + button3.innerHTML = 'Revert'; + dom.addClass(button3, 'button'); + dom.addClass(button3, 'revert'); + + var select = gui.__preset_select = document.createElement('select'); + + if (gui.load && gui.load.remembered) { + + common.each(gui.load.remembered, function(value, key) { + addPresetOption(gui, key, key == gui.preset); + }); + + } else { + addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false); + } + + dom.bind(select, 'change', function() { + + + for (var index = 0; index < gui.__preset_select.length; index++) { + gui.__preset_select[index].innerHTML = gui.__preset_select[index].value; + } + + gui.preset = this.value; + + }); + + div.appendChild(select); + div.appendChild(gears); + div.appendChild(button); + div.appendChild(button2); + div.appendChild(button3); + + if (SUPPORTS_LOCAL_STORAGE) { + + var saveLocally = document.getElementById('dg-save-locally'); + var explain = document.getElementById('dg-local-explain'); + + saveLocally.style.display = 'block'; + + var localStorageCheckBox = document.getElementById('dg-local-storage'); + + if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') { + localStorageCheckBox.setAttribute('checked', 'checked'); + } + + function showHideExplain() { + explain.style.display = gui.useLocalStorage ? 'block' : 'none'; + } + + showHideExplain(); + + // TODO: Use a boolean controller, fool! + dom.bind(localStorageCheckBox, 'change', function() { + gui.useLocalStorage = !gui.useLocalStorage; + showHideExplain(); + }); + + } + + var newConstructorTextArea = document.getElementById('dg-new-constructor'); + + dom.bind(newConstructorTextArea, 'keydown', function(e) { + if (e.metaKey && (e.which === 67 || e.keyCode == 67)) { + SAVE_DIALOGUE.hide(); + } + }); + + dom.bind(gears, 'click', function() { + newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2); + SAVE_DIALOGUE.show(); + newConstructorTextArea.focus(); + newConstructorTextArea.select(); + }); + + dom.bind(button, 'click', function() { + gui.save(); + }); + + dom.bind(button2, 'click', function() { + var presetName = prompt('Enter a new preset name.'); + if (presetName) gui.saveAs(presetName); + }); + + dom.bind(button3, 'click', function() { + gui.revert(); + }); + +// div.appendChild(button2); + + } + + function addResizeHandle(gui) { + + gui.__resize_handle = document.createElement('div'); + + common.extend(gui.__resize_handle.style, { + + width: '6px', + marginLeft: '-3px', + height: '200px', + cursor: 'ew-resize', + position: 'absolute' +// border: '1px solid blue' + + }); + + var pmouseX; + + dom.bind(gui.__resize_handle, 'mousedown', dragStart); + dom.bind(gui.__closeButton, 'mousedown', dragStart); + + gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild); + + function dragStart(e) { + + e.preventDefault(); + + pmouseX = e.clientX; + + dom.addClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.bind(window, 'mousemove', drag); + dom.bind(window, 'mouseup', dragStop); + + return false; + + } + + function drag(e) { + + e.preventDefault(); + + gui.width += pmouseX - e.clientX; + gui.onResize(); + pmouseX = e.clientX; + + return false; + + } + + function dragStop() { + + dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.unbind(window, 'mousemove', drag); + dom.unbind(window, 'mouseup', dragStop); + + } + + } + + function setWidth(gui, w) { + gui.domElement.style.width = w + 'px'; + // Auto placed save-rows are position fixed, so we have to + // set the width manually if we want it to bleed to the edge + if (gui.__save_row && gui.autoPlace) { + gui.__save_row.style.width = w + 'px'; + }if (gui.__closeButton) { + gui.__closeButton.style.width = w + 'px'; + } + } + + function getCurrentPreset(gui, useInitialValues) { + + var toReturn = {}; + + // For each object I'm remembering + common.each(gui.__rememberedObjects, function(val, index) { + + var saved_values = {}; + + // The controllers I've made for thcommon.isObject by property + var controller_map = + gui.__rememberedObjectIndecesToControllers[index]; + + // Remember each value for each property + common.each(controller_map, function(controller, property) { + saved_values[property] = useInitialValues ? controller.initialValue : controller.getValue(); + }); + + // Save the values for thcommon.isObject + toReturn[index] = saved_values; + + }); + + return toReturn; + + } + + function addPresetOption(gui, name, setSelected) { + var opt = document.createElement('option'); + opt.innerHTML = name; + opt.value = name; + gui.__preset_select.appendChild(opt); + if (setSelected) { + gui.__preset_select.selectedIndex = gui.__preset_select.length - 1; + } + } + + function setPresetSelectIndex(gui) { + for (var index = 0; index < gui.__preset_select.length; index++) { + if (gui.__preset_select[index].value == gui.preset) { + gui.__preset_select.selectedIndex = index; + } + } + } + + function markPresetModified(gui, modified) { + var opt = gui.__preset_select[gui.__preset_select.selectedIndex]; +// console.log('mark', modified, opt); + if (modified) { + opt.innerHTML = opt.value + "*"; + } else { + opt.innerHTML = opt.value; + } + } + + function updateDisplays(controllerArray) { + + + if (controllerArray.length != 0) { + + requestAnimationFrame(function() { + updateDisplays(controllerArray); + }); + + } + + common.each(controllerArray, function(c) { + c.updateDisplay(); + }); + + } + + return GUI; + +})(dat.utils.css, +"
\n\n Here's the new load parameter for your GUI's constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI's constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
\n \n
\n\n
", +".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", +dat.controllers.factory = (function (OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, common) { + + return function(object, property) { + + var initialValue = object[property]; + + // Providing options? + if (common.isArray(arguments[2]) || common.isObject(arguments[2])) { + return new OptionController(object, property, arguments[2]); + } + + // Providing a map? + + if (common.isNumber(initialValue)) { + + if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) { + + // Has min and max. + return new NumberControllerSlider(object, property, arguments[2], arguments[3]); + + } else { + + return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] }); + + } + + } + + if (common.isString(initialValue)) { + return new StringController(object, property); + } + + if (common.isFunction(initialValue)) { + return new FunctionController(object, property, ''); + } + + if (common.isBoolean(initialValue)) { + return new BooleanController(object, property); + } + + } + + })(dat.controllers.OptionController, +dat.controllers.NumberControllerBox, +dat.controllers.NumberControllerSlider, +dat.controllers.StringController = (function (Controller, dom, common) { + + /** + * @class Provides a text input to alter the string property of an object. + * + * @extends dat.controllers.Controller + * + * @param {Object} object The object to be manipulated + * @param {string} property The name of the property to be manipulated + * + * @member dat.controllers + */ + var StringController = function(object, property) { + + StringController.superclass.call(this, object, property); + + var _this = this; + + this.__input = document.createElement('input'); + this.__input.setAttribute('type', 'text'); + + dom.bind(this.__input, 'keyup', onChange); + dom.bind(this.__input, 'change', onChange); + dom.bind(this.__input, 'blur', onBlur); + dom.bind(this.__input, 'keydown', function(e) { + if (e.keyCode === 13) { + this.blur(); + } + }); + + + function onChange() { + _this.setValue(_this.__input.value); + } + + function onBlur() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + this.updateDisplay(); + + this.domElement.appendChild(this.__input); + + }; + + StringController.superclass = Controller; + + common.extend( + + StringController.prototype, + Controller.prototype, + + { + + updateDisplay: function() { + // Stops the caret from moving on account of: + // keyup -> setValue -> updateDisplay + if (!dom.isActive(this.__input)) { + this.__input.value = this.getValue(); + } + return StringController.superclass.prototype.updateDisplay.call(this); + } + + } + + ); + + return StringController; + +})(dat.controllers.Controller, +dat.dom.dom, +dat.utils.common), +dat.controllers.FunctionController, +dat.controllers.BooleanController, +dat.utils.common), +dat.controllers.Controller, +dat.controllers.BooleanController, +dat.controllers.FunctionController, +dat.controllers.NumberControllerBox, +dat.controllers.NumberControllerSlider, +dat.controllers.OptionController, +dat.controllers.ColorController = (function (Controller, dom, Color, interpret, common) { + + var ColorController = function(object, property) { + + ColorController.superclass.call(this, object, property); + + this.__color = new Color(this.getValue()); + this.__temp = new Color(0); + + var _this = this; + + this.domElement = document.createElement('div'); + + dom.makeSelectable(this.domElement, false); + + this.__selector = document.createElement('div'); + this.__selector.className = 'selector'; + + this.__saturation_field = document.createElement('div'); + this.__saturation_field.className = 'saturation-field'; + + this.__field_knob = document.createElement('div'); + this.__field_knob.className = 'field-knob'; + this.__field_knob_border = '2px solid '; + + this.__hue_knob = document.createElement('div'); + this.__hue_knob.className = 'hue-knob'; + + this.__hue_field = document.createElement('div'); + this.__hue_field.className = 'hue-field'; + + this.__input = document.createElement('input'); + this.__input.type = 'text'; + this.__input_textShadow = '0 1px 1px '; + + dom.bind(this.__input, 'keydown', function(e) { + if (e.keyCode === 13) { // on enter + onBlur.call(this); + } + }); + + dom.bind(this.__input, 'blur', onBlur); + + dom.bind(this.__selector, 'mousedown', function(e) { + + dom + .addClass(this, 'drag') + .bind(window, 'mouseup', function(e) { + dom.removeClass(_this.__selector, 'drag'); + }); + + }); + + var value_field = document.createElement('div'); + + common.extend(this.__selector.style, { + width: '122px', + height: '102px', + padding: '3px', + backgroundColor: '#222', + boxShadow: '0px 1px 3px rgba(0,0,0,0.3)' + }); + + common.extend(this.__field_knob.style, { + position: 'absolute', + width: '12px', + height: '12px', + border: this.__field_knob_border + (this.__color.v < .5 ? '#fff' : '#000'), + boxShadow: '0px 1px 3px rgba(0,0,0,0.5)', + borderRadius: '12px', + zIndex: 1 + }); + + common.extend(this.__hue_knob.style, { + position: 'absolute', + width: '15px', + height: '2px', + borderRight: '4px solid #fff', + zIndex: 1 + }); + + common.extend(this.__saturation_field.style, { + width: '100px', + height: '100px', + border: '1px solid #555', + marginRight: '3px', + display: 'inline-block', + cursor: 'pointer' + }); + + common.extend(value_field.style, { + width: '100%', + height: '100%', + background: 'none' + }); + + linearGradient(value_field, 'top', 'rgba(0,0,0,0)', '#000'); + + common.extend(this.__hue_field.style, { + width: '15px', + height: '100px', + display: 'inline-block', + border: '1px solid #555', + cursor: 'ns-resize' + }); + + hueGradient(this.__hue_field); + + common.extend(this.__input.style, { + outline: 'none', +// width: '120px', + textAlign: 'center', +// padding: '4px', +// marginBottom: '6px', + color: '#fff', + border: 0, + fontWeight: 'bold', + textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)' + }); + + dom.bind(this.__saturation_field, 'mousedown', fieldDown); + dom.bind(this.__field_knob, 'mousedown', fieldDown); + + dom.bind(this.__hue_field, 'mousedown', function(e) { + setH(e); + dom.bind(window, 'mousemove', setH); + dom.bind(window, 'mouseup', unbindH); + }); + + function fieldDown(e) { + setSV(e); + // document.body.style.cursor = 'none'; + dom.bind(window, 'mousemove', setSV); + dom.bind(window, 'mouseup', unbindSV); + } + + function unbindSV() { + dom.unbind(window, 'mousemove', setSV); + dom.unbind(window, 'mouseup', unbindSV); + // document.body.style.cursor = 'default'; + } + + function onBlur() { + var i = interpret(this.value); + if (i !== false) { + _this.__color.__state = i; + _this.setValue(_this.__color.toOriginal()); + } else { + this.value = _this.__color.toString(); + } + } + + function unbindH() { + dom.unbind(window, 'mousemove', setH); + dom.unbind(window, 'mouseup', unbindH); + } + + this.__saturation_field.appendChild(value_field); + this.__selector.appendChild(this.__field_knob); + this.__selector.appendChild(this.__saturation_field); + this.__selector.appendChild(this.__hue_field); + this.__hue_field.appendChild(this.__hue_knob); + + this.domElement.appendChild(this.__input); + this.domElement.appendChild(this.__selector); + + this.updateDisplay(); + + function setSV(e) { + + e.preventDefault(); + + var w = dom.getWidth(_this.__saturation_field); + var o = dom.getOffset(_this.__saturation_field); + var s = (e.clientX - o.left + document.body.scrollLeft) / w; + var v = 1 - (e.clientY - o.top + document.body.scrollTop) / w; + + if (v > 1) v = 1; + else if (v < 0) v = 0; + + if (s > 1) s = 1; + else if (s < 0) s = 0; + + _this.__color.v = v; + _this.__color.s = s; + + _this.setValue(_this.__color.toOriginal()); + + + return false; + + } + + function setH(e) { + + e.preventDefault(); + + var s = dom.getHeight(_this.__hue_field); + var o = dom.getOffset(_this.__hue_field); + var h = 1 - (e.clientY - o.top + document.body.scrollTop) / s; + + if (h > 1) h = 1; + else if (h < 0) h = 0; + + _this.__color.h = h * 360; + + _this.setValue(_this.__color.toOriginal()); + + return false; + + } + + }; + + ColorController.superclass = Controller; + + common.extend( + + ColorController.prototype, + Controller.prototype, + + { + + updateDisplay: function() { + + var i = interpret(this.getValue()); + + if (i !== false) { + + var mismatch = false; + + // Check for mismatch on the interpreted value. + + common.each(Color.COMPONENTS, function(component) { + if (!common.isUndefined(i[component]) && + !common.isUndefined(this.__color.__state[component]) && + i[component] !== this.__color.__state[component]) { + mismatch = true; + return {}; // break + } + }, this); + + // If nothing diverges, we keep our previous values + // for statefulness, otherwise we recalculate fresh + if (mismatch) { + common.extend(this.__color.__state, i); + } + + } + + common.extend(this.__temp.__state, this.__color.__state); + + this.__temp.a = 1; + + var flip = (this.__color.v < .5 || this.__color.s > .5) ? 255 : 0; + var _flip = 255 - flip; + + common.extend(this.__field_knob.style, { + marginLeft: 100 * this.__color.s - 7 + 'px', + marginTop: 100 * (1 - this.__color.v) - 7 + 'px', + backgroundColor: this.__temp.toString(), + border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip +')' + }); + + this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px' + + this.__temp.s = 1; + this.__temp.v = 1; + + linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toString()); + + common.extend(this.__input.style, { + backgroundColor: this.__input.value = this.__color.toString(), + color: 'rgb(' + flip + ',' + flip + ',' + flip +')', + textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip +',.7)' + }); + + } + + } + + ); + + var vendors = ['-moz-','-o-','-webkit-','-ms-','']; + + function linearGradient(elem, x, a, b) { + elem.style.background = ''; + common.each(vendors, function(vendor) { + elem.style.cssText += 'background: ' + vendor + 'linear-gradient('+x+', '+a+' 0%, ' + b + ' 100%); '; + }); + } + + function hueGradient(elem) { + elem.style.background = ''; + elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);' + elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);' + } + + + return ColorController; + +})(dat.controllers.Controller, +dat.dom.dom, +dat.color.Color = (function (interpret, math, toString, common) { + + var Color = function() { + + this.__state = interpret.apply(this, arguments); + + if (this.__state === false) { + throw 'Failed to interpret color arguments'; + } + + this.__state.a = this.__state.a || 1; + + + }; + + Color.COMPONENTS = ['r','g','b','h','s','v','hex','a']; + + common.extend(Color.prototype, { + + toString: function() { + return toString(this); + }, + + toOriginal: function() { + return this.__state.conversion.write(this); + } + + }); + + defineRGBComponent(Color.prototype, 'r', 2); + defineRGBComponent(Color.prototype, 'g', 1); + defineRGBComponent(Color.prototype, 'b', 0); + + defineHSVComponent(Color.prototype, 'h'); + defineHSVComponent(Color.prototype, 's'); + defineHSVComponent(Color.prototype, 'v'); + + Object.defineProperty(Color.prototype, 'a', { + + get: function() { + return this.__state.a; + }, + + set: function(v) { + this.__state.a = v; + } + + }); + + Object.defineProperty(Color.prototype, 'hex', { + + get: function() { + + if (!this.__state.space !== 'HEX') { + this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b); + } + + return this.__state.hex; + + }, + + set: function(v) { + + this.__state.space = 'HEX'; + this.__state.hex = v; + + } + + }); + + function defineRGBComponent(target, component, componentHexIndex) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'RGB') { + return this.__state[component]; + } + + recalculateRGB(this, component, componentHexIndex); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'RGB') { + recalculateRGB(this, component, componentHexIndex); + this.__state.space = 'RGB'; + } + + this.__state[component] = v; + + } + + }); + + } + + function defineHSVComponent(target, component) { + + Object.defineProperty(target, component, { + + get: function() { + + if (this.__state.space === 'HSV') + return this.__state[component]; + + recalculateHSV(this); + + return this.__state[component]; + + }, + + set: function(v) { + + if (this.__state.space !== 'HSV') { + recalculateHSV(this); + this.__state.space = 'HSV'; + } + + this.__state[component] = v; + + } + + }); + + } + + function recalculateRGB(color, component, componentHexIndex) { + + if (color.__state.space === 'HEX') { + + color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex); + + } else if (color.__state.space === 'HSV') { + + common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); + + } else { + + throw 'Corrupted color state'; + + } + + } + + function recalculateHSV(color) { + + var result = math.rgb_to_hsv(color.r, color.g, color.b); + + common.extend(color.__state, + { + s: result.s, + v: result.v + } + ); + + if (!common.isNaN(result.h)) { + color.__state.h = result.h; + } else if (common.isUndefined(color.__state.h)) { + color.__state.h = 0; + } + + } + + return Color; + +})(dat.color.interpret, +dat.color.math = (function () { + + var tmpComponent; + + return { + + hsv_to_rgb: function(h, s, v) { + + var hi = Math.floor(h / 60) % 6; + + var f = h / 60 - Math.floor(h / 60); + var p = v * (1.0 - s); + var q = v * (1.0 - (f * s)); + var t = v * (1.0 - ((1.0 - f) * s)); + var c = [ + [v, t, p], + [q, v, p], + [p, v, t], + [p, q, v], + [t, p, v], + [v, p, q] + ][hi]; + + return { + r: c[0] * 255, + g: c[1] * 255, + b: c[2] * 255 + }; + + }, + + rgb_to_hsv: function(r, g, b) { + + var min = Math.min(r, g, b), + max = Math.max(r, g, b), + delta = max - min, + h, s; + + if (max != 0) { + s = delta / max; + } else { + return { + h: NaN, + s: 0, + v: 0 + }; + } + + if (r == max) { + h = (g - b) / delta; + } else if (g == max) { + h = 2 + (b - r) / delta; + } else { + h = 4 + (r - g) / delta; + } + h /= 6; + if (h < 0) { + h += 1; + } + + return { + h: h * 360, + s: s, + v: max / 255 + }; + }, + + rgb_to_hex: function(r, g, b) { + var hex = this.hex_with_component(0, 2, r); + hex = this.hex_with_component(hex, 1, g); + hex = this.hex_with_component(hex, 0, b); + return hex; + }, + + component_from_hex: function(hex, componentIndex) { + return (hex >> (componentIndex * 8)) & 0xFF; + }, + + hex_with_component: function(hex, componentIndex, value) { + return value << (tmpComponent = componentIndex * 8) | (hex & ~ (0xFF << tmpComponent)); + } + + } + +})(), +dat.color.toString, +dat.utils.common), +dat.color.interpret, +dat.utils.common), +dat.utils.requestAnimationFrame = (function () { + + /** + * requirejs version of Paul Irish's RequestAnimationFrame + * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + */ + + return window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(callback, element) { + + window.setTimeout(callback, 1000 / 60); + + }; +})(), +dat.dom.CenteredDiv = (function (dom, common) { + + + var CenteredDiv = function() { + + this.backgroundElement = document.createElement('div'); + common.extend(this.backgroundElement.style, { + backgroundColor: 'rgba(0,0,0,0.8)', + top: 0, + left: 0, + display: 'none', + zIndex: '1000', + opacity: 0, + WebkitTransition: 'opacity 0.2s linear' + }); + + dom.makeFullscreen(this.backgroundElement); + this.backgroundElement.style.position = 'fixed'; + + this.domElement = document.createElement('div'); + common.extend(this.domElement.style, { + position: 'fixed', + display: 'none', + zIndex: '1001', + opacity: 0, + WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear' + }); + + + document.body.appendChild(this.backgroundElement); + document.body.appendChild(this.domElement); + + var _this = this; + dom.bind(this.backgroundElement, 'click', function() { + _this.hide(); + }); + + + }; + + CenteredDiv.prototype.show = function() { + + var _this = this; + + + + this.backgroundElement.style.display = 'block'; + + this.domElement.style.display = 'block'; + this.domElement.style.opacity = 0; +// this.domElement.style.top = '52%'; + this.domElement.style.webkitTransform = 'scale(1.1)'; + + this.layout(); + + common.defer(function() { + _this.backgroundElement.style.opacity = 1; + _this.domElement.style.opacity = 1; + _this.domElement.style.webkitTransform = 'scale(1)'; + }); + + }; + + CenteredDiv.prototype.hide = function() { + + var _this = this; + + var hide = function() { + + _this.domElement.style.display = 'none'; + _this.backgroundElement.style.display = 'none'; + + dom.unbind(_this.domElement, 'webkitTransitionEnd', hide); + dom.unbind(_this.domElement, 'transitionend', hide); + dom.unbind(_this.domElement, 'oTransitionEnd', hide); + + }; + + dom.bind(this.domElement, 'webkitTransitionEnd', hide); + dom.bind(this.domElement, 'transitionend', hide); + dom.bind(this.domElement, 'oTransitionEnd', hide); + + this.backgroundElement.style.opacity = 0; +// this.domElement.style.top = '48%'; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + + }; + + CenteredDiv.prototype.layout = function() { + this.domElement.style.left = window.innerWidth/2 - dom.getWidth(this.domElement) / 2 + 'px'; + this.domElement.style.top = window.innerHeight/2 - dom.getHeight(this.domElement) / 2 + 'px'; + }; + + function lockScroll(e) { + console.log(e); + } + + return CenteredDiv; + +})(dat.dom.dom, +dat.utils.common), +dat.dom.dom, +dat.utils.common); \ No newline at end of file diff --git a/node_modules/date-now/.npmignore b/node_modules/date-now/.npmignore new file mode 100755 index 00000000..aa3fd4b8 --- /dev/null +++ b/node_modules/date-now/.npmignore @@ -0,0 +1,14 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript diff --git a/node_modules/date-now/.testem.json b/node_modules/date-now/.testem.json new file mode 100755 index 00000000..633c2ba8 --- /dev/null +++ b/node_modules/date-now/.testem.json @@ -0,0 +1,14 @@ +{ + "launchers": { + "node": { + "command": "npm test" + } + }, + "src_files": [ + "./**/*.js" + ], + "before_tests": "npm run build", + "on_exit": "rm test/static/bundle.js", + "test_page": "test/static/index.html", + "launch_in_dev": ["node", "phantomjs"] +} diff --git a/node_modules/date-now/.travis.yml b/node_modules/date-now/.travis.yml new file mode 100755 index 00000000..ed178f63 --- /dev/null +++ b/node_modules/date-now/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.9 diff --git a/node_modules/date-now/LICENCE b/node_modules/date-now/LICENCE new file mode 100755 index 00000000..822d880b --- /dev/null +++ b/node_modules/date-now/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Colingo. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/date-now/README.md b/node_modules/date-now/README.md new file mode 100755 index 00000000..22d26753 --- /dev/null +++ b/node_modules/date-now/README.md @@ -0,0 +1,45 @@ +# date-now + +[![build status][1]][2] + +[![browser support][3]][4] + +A requirable version of Date.now() + +Use-case is to be able to mock out Date.now() using require interception. + +## Example + +```js +var now = require("date-now") + +var ts = now() +var ts2 = Date.now() +assert.equal(ts, ts2) +``` + +## example of seed + +``` +var now = require("date-now/seed")(timeStampFromServer) + +// ts is in "sync" with the seed value from the server +// useful if your users have their local time being a few minutes +// out of your server time. +var ts = now() +``` + +## Installation + +`npm install date-now` + +## Contributors + + - Raynos + +## MIT Licenced + + [1]: https://secure.travis-ci.org/Colingo/date-now.png + [2]: http://travis-ci.org/Colingo/date-now + [3]: http://ci.testling.com/Colingo/date-now.png + [4]: http://ci.testling.com/Colingo/date-now diff --git a/node_modules/date-now/index.js b/node_modules/date-now/index.js new file mode 100755 index 00000000..d5f143a8 --- /dev/null +++ b/node_modules/date-now/index.js @@ -0,0 +1,5 @@ +module.exports = now + +function now() { + return new Date().getTime() +} diff --git a/node_modules/date-now/package.json b/node_modules/date-now/package.json new file mode 100755 index 00000000..2e947419 --- /dev/null +++ b/node_modules/date-now/package.json @@ -0,0 +1,123 @@ +{ + "_args": [ + [ + { + "raw": "date-now@^0.1.4", + "scope": null, + "escapedName": "date-now", + "name": "date-now", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/console-browserify" + ] + ], + "_from": "date-now@>=0.1.4 <0.2.0", + "_id": "date-now@0.1.4", + "_inCache": true, + "_location": "/date-now", + "_npmUser": { + "name": "raynos", + "email": "raynos2@gmail.com" + }, + "_npmVersion": "1.2.3", + "_phantomChildren": {}, + "_requested": { + "raw": "date-now@^0.1.4", + "scope": null, + "escapedName": "date-now", + "name": "date-now", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/console-browserify" + ], + "_resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "_shasum": "eaf439fd4d4848ad74e5cc7dbef200672b9e345b", + "_shrinkwrap": null, + "_spec": "date-now@^0.1.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/console-browserify", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Colingo/date-now/issues", + "email": "raynos2@gmail.com" + }, + "contributors": [ + { + "name": "Artem Shoobovych" + } + ], + "dependencies": {}, + "description": "A requirable version of Date.now()", + "devDependencies": { + "browserify": "https://github.com/raynos/node-browserify/tarball/master", + "tape": "~0.2.2", + "testem": "~0.2.52" + }, + "directories": {}, + "dist": { + "shasum": "eaf439fd4d4848ad74e5cc7dbef200672b9e345b", + "tarball": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz" + }, + "homepage": "https://github.com/Colingo/date-now", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Colingo/date-now/raw/master/LICENSE" + } + ], + "main": "index", + "maintainers": [ + { + "name": "raynos", + "email": "raynos2@gmail.com" + } + ], + "name": "date-now", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/Colingo/date-now.git" + }, + "scripts": { + "build": "browserify test/index.js -o test/static/bundle.js", + "test": "node ./test", + "testem": "testem" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + "8", + "9", + "10" + ], + "firefox": [ + "16", + "17", + "nightly" + ], + "chrome": [ + "22", + "23", + "canary" + ], + "opera": [ + "12", + "next" + ], + "safari": [ + "5.1" + ] + } + }, + "version": "0.1.4" +} diff --git a/node_modules/date-now/seed.js b/node_modules/date-now/seed.js new file mode 100755 index 00000000..b9727c5a --- /dev/null +++ b/node_modules/date-now/seed.js @@ -0,0 +1,16 @@ +var now = require("./index") + +module.exports = seeded + +/* Returns a Date.now() like function that's in sync with + the seed value +*/ +function seeded(seed) { + var current = now() + + return time + + function time() { + return seed + (now() - current) + } +} diff --git a/node_modules/date-now/test/index.js b/node_modules/date-now/test/index.js new file mode 100755 index 00000000..270584ca --- /dev/null +++ b/node_modules/date-now/test/index.js @@ -0,0 +1,28 @@ +var test = require("tape") +var setTimeout = require("timers").setTimeout + +var now = require("../index") +var seeded = require("../seed") + +test("date", function (assert) { + var ts = now() + var ts2 = Date.now() + assert.equal(ts, ts2) + assert.end() +}) + +test("seeded", function (assert) { + var time = seeded(40) + var ts = time() + + within(assert, time(), 40, 5) + setTimeout(function () { + within(assert, time(), 90, 10) + assert.end() + }, 50) +}) + +function within(assert, a, b, offset) { + assert.ok(a + offset > b) + assert.ok(a - offset < b) +} diff --git a/node_modules/date-now/test/static/index.html b/node_modules/date-now/test/static/index.html new file mode 100755 index 00000000..3d5384da --- /dev/null +++ b/node_modules/date-now/test/static/index.html @@ -0,0 +1,10 @@ + + + + TAPE Example + + + + + + diff --git a/node_modules/debug-stream/.npmignore b/node_modules/debug-stream/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/debug-stream/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/debug-stream/LICENSE b/node_modules/debug-stream/LICENSE new file mode 100755 index 00000000..757562ec --- /dev/null +++ b/node_modules/debug-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/debug-stream/README.md b/node_modules/debug-stream/README.md new file mode 100755 index 00000000..6cce729d --- /dev/null +++ b/node_modules/debug-stream/README.md @@ -0,0 +1,57 @@ +# debug-stream + +Use the debug module on a stream + +``` +npm install debug-stream +``` + +## Usage + +``` js +var debugStream = require('debug-stream')('my-app') + +process.stdin + .pipe(debugStream()) + .resume() // just drain it + +// or if you're already using debug + +var debug = require('debug')('my-app') +var debugStream = require('debug-stream')(debug) + +process.stdin + .pipe(debugStream()) + .resume() +``` + +Running the above program with `DEBUG=*` will use the [debug module](https://github.com/visionmedia/debug) on every line +in the stream. If the stream is an object stream it will run debug on every object in the stream. + +You can add an optional format string as well + +``` js +var debugStream = require('debug-stream')('my-app') + +process.stdin + .pipe(debugStream('process.stdin: %s')) + .resume() // just drain it +``` + +The debug stream behaives as pass through stream so can just insert it in any existing pipe chain + +``` js +inputStream + .pipe(debugStream()) + .pipe(outputStream) +``` +## Browser support + +As with debug, this module also supports the browser environment through either browserify or webpack. + +To enable the functionality, you need to run `require('debug').enable('*')` in your console. It will persist +this setting in localStorage, until you run `require('debug').disable()`. + +## License + +MIT diff --git a/node_modules/debug-stream/example.js b/node_modules/debug-stream/example.js new file mode 100755 index 00000000..92102ba3 --- /dev/null +++ b/node_modules/debug-stream/example.js @@ -0,0 +1,5 @@ +var debugStream = require('debug-stream')('my-app') + +process.stdin + .pipe(debugStream('process.stdin: %s')) + .resume() // just drain it diff --git a/node_modules/debug-stream/index.js b/node_modules/debug-stream/index.js new file mode 100755 index 00000000..e1ab8866 --- /dev/null +++ b/node_modules/debug-stream/index.js @@ -0,0 +1,37 @@ +var debug = require('debug') +var through = require('through2') +var split = require('split') + +module.exports = function(name) { + var d = typeof name === 'function' ? name : debug(name) + + try { + var enabled = process.env.DEBUG || localStorage.debug + } catch (e) {} + + if (!enabled) { + return function() { + return through.obj() + } + } + + return function() { + var args = arguments.length && Array.prototype.slice.call(arguments) + + var run = args ? + function(line) { + d.apply(d, args.concat(line)) + } : + function(line) { + d(line) + } + + var s = split(run) + + return through.obj(function(data, enc, cb) { + if (typeof data === 'string' || Buffer.isBuffer(data)) s.write(data) + else run(data) + cb(null, data) + }) + } +} diff --git a/node_modules/debug-stream/node_modules/debug/.jshintrc b/node_modules/debug-stream/node_modules/debug/.jshintrc new file mode 100755 index 00000000..299877f2 --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/.jshintrc @@ -0,0 +1,3 @@ +{ + "laxbreak": true +} diff --git a/node_modules/debug-stream/node_modules/debug/.npmignore b/node_modules/debug-stream/node_modules/debug/.npmignore new file mode 100755 index 00000000..7e6163db --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/.npmignore @@ -0,0 +1,6 @@ +support +test +examples +example +*.sock +dist diff --git a/node_modules/debug-stream/node_modules/debug/History.md b/node_modules/debug-stream/node_modules/debug/History.md new file mode 100755 index 00000000..3b965608 --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/History.md @@ -0,0 +1,144 @@ + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/debug-stream/node_modules/debug/Makefile b/node_modules/debug-stream/node_modules/debug/Makefile new file mode 100755 index 00000000..b0bde6e6 --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/Makefile @@ -0,0 +1,33 @@ + +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# applications +NODE ?= $(shell which node) +NPM ?= $(NODE) $(shell which npm) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +all: dist/debug.js + +install: node_modules + +clean: + @rm -rf node_modules dist + +dist: + @mkdir -p $@ + +dist/debug.js: node_modules browser.js debug.js dist + @$(BROWSERIFY) \ + --standalone debug \ + . > $@ + +node_modules: package.json + @NODE_ENV= $(NPM) install + @touch node_modules + +.PHONY: all install clean diff --git a/node_modules/debug-stream/node_modules/debug/Readme.md b/node_modules/debug-stream/node_modules/debug/Readme.md new file mode 100755 index 00000000..e59b9ada --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/Readme.md @@ -0,0 +1,156 @@ +# debug + + tiny node.js debugging utility modelled after node core's debugging technique. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + + With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Browser support + + Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + +### stderr vs stdout + +You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: + +Example _stderr.js_: + +```js +var debug = require('../'); +var log = debug('app:log'); + +// by default console.log is used +log('goes to stdout!'); + +var error = debug('app:error'); +// set this namespace to log via console.error +error.log = console.error.bind(console); // don't forget to bind to console! +error('goes to stderr'); +log('still goes to stdout!'); + +// set all output to go via console.warn +// overrides all per-namespace log settings +debug.log = console.warn.bind(console); +log('now goes to stderr via console.warn'); +error('still goes to stderr, but via console.warn now'); +``` + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + +## License + +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/debug-stream/node_modules/debug/browser.js b/node_modules/debug-stream/node_modules/debug/browser.js new file mode 100755 index 00000000..ce6369f1 --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/browser.js @@ -0,0 +1,147 @@ + +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + return ('WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + return JSON.stringify(v); +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // This hackery is required for IE8, + // where the `console.log` function doesn't have 'apply' + return 'object' == typeof console + && 'function' == typeof console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + localStorage.removeItem('debug'); + } else { + localStorage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = localStorage.debug; + } catch(e) {} + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); diff --git a/node_modules/debug-stream/node_modules/debug/component.json b/node_modules/debug-stream/node_modules/debug/component.json new file mode 100755 index 00000000..ab5f3eee --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "1.0.4", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "browser.js", + "scripts": [ + "browser.js", + "debug.js" + ], + "dependencies": { + "guille/ms.js": "0.6.1" + } +} diff --git a/node_modules/debug-stream/node_modules/debug/debug.js b/node_modules/debug-stream/node_modules/debug/debug.js new file mode 100755 index 00000000..7571a860 --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/debug.js @@ -0,0 +1,197 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = debug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + +exports.formatters = {}; + +/** + * Previously assigned color. + */ + +var prevColor = 0; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * + * @return {Number} + * @api private + */ + +function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = Array.prototype.slice.call(arguments); + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + if ('function' === typeof exports.formatArgs) { + args = exports.formatArgs.apply(self, args); + } + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/debug-stream/node_modules/debug/node.js b/node_modules/debug-stream/node_modules/debug/node.js new file mode 100755 index 00000000..c94f7d12 --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/node.js @@ -0,0 +1,129 @@ + +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); + if (0 === debugColors.length) { + return tty.isatty(1); + } else { + return '0' !== debugColors + && 'no' !== debugColors + && 'false' !== debugColors + && 'disabled' !== debugColors; + } +} + +/** + * Map %o to `util.inspect()`, since Node doesn't do that out of the box. + */ + +var inspect = (4 === util.inspect.length ? + // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } : + // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + } +); + +exports.formatters.o = function(v) { + return inspect(v, this.useColors) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + var name = this.namespace; + + if (useColors) { + var c = this.color; + + args[0] = ' \u001b[9' + c + 'm' + name + ' ' + + '\u001b[0m' + + args[0] + '\u001b[3' + c + 'm' + + ' +' + exports.humanize(this.diff) + '\u001b[0m'; + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } + return args; +} + +/** + * Invokes `console.log()` with the specified arguments. + */ + +function log() { + return console.log.apply(console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/debug-stream/node_modules/debug/package.json b/node_modules/debug-stream/node_modules/debug/package.json new file mode 100755 index 00000000..ec4682a5 --- /dev/null +++ b/node_modules/debug-stream/node_modules/debug/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + { + "raw": "debug@^1.0.2", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/debug-stream" + ] + ], + "_from": "debug@>=1.0.2 <2.0.0", + "_id": "debug@1.0.4", + "_inCache": true, + "_location": "/debug-stream/debug", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "_npmVersion": "1.4.14", + "_phantomChildren": {}, + "_requested": { + "raw": "debug@^1.0.2", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/debug-stream" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-1.0.4.tgz", + "_shasum": "5b9c256bd54b6ec02283176fa8a0ede6d154cbf8", + "_shrinkwrap": null, + "_spec": "debug@^1.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/debug-stream", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + } + ], + "dependencies": { + "ms": "0.6.2" + }, + "description": "small debugging utility", + "devDependencies": { + "browserify": "4.1.6", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "5b9c256bd54b6ec02283176fa8a0ede6d154cbf8", + "tarball": "https://registry.npmjs.org/debug/-/debug-1.0.4.tgz" + }, + "gitHead": "abc10a5912f79d251752d18350e269fe0b0fbbf9", + "homepage": "https://github.com/visionmedia/debug", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "./node.js", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "debug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "scripts": {}, + "version": "1.0.4" +} diff --git a/node_modules/debug-stream/node_modules/ms/.npmignore b/node_modules/debug-stream/node_modules/ms/.npmignore new file mode 100755 index 00000000..d1aa0ce4 --- /dev/null +++ b/node_modules/debug-stream/node_modules/ms/.npmignore @@ -0,0 +1,5 @@ +node_modules +test +History.md +Makefile +component.json diff --git a/node_modules/debug-stream/node_modules/ms/README.md b/node_modules/debug-stream/node_modules/ms/README.md new file mode 100755 index 00000000..d4ab12a7 --- /dev/null +++ b/node_modules/debug-stream/node_modules/ms/README.md @@ -0,0 +1,33 @@ +# ms.js: miliseconds conversion utility + +```js +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('100') // 100 +``` + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours', { long: true })) // "10 hours" +``` + +- Node/Browser compatible. Published as `ms` in NPM. +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as +a number (e.g: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of +equivalent ms is returned. + +## License + +MIT \ No newline at end of file diff --git a/node_modules/debug-stream/node_modules/ms/index.js b/node_modules/debug-stream/node_modules/ms/index.js new file mode 100755 index 00000000..c5847f8d --- /dev/null +++ b/node_modules/debug-stream/node_modules/ms/index.js @@ -0,0 +1,111 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options){ + options = options || {}; + if ('string' == typeof val) return parse(val); + return options.long + ? long(val) + : short(val); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); + if (!match) return; + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 's': + return n * s; + case 'ms': + return n; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function short(ms) { + if (ms >= d) return Math.round(ms / d) + 'd'; + if (ms >= h) return Math.round(ms / h) + 'h'; + if (ms >= m) return Math.round(ms / m) + 'm'; + if (ms >= s) return Math.round(ms / s) + 's'; + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function long(ms) { + return plural(ms, d, 'day') + || plural(ms, h, 'hour') + || plural(ms, m, 'minute') + || plural(ms, s, 'second') + || ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) return; + if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/node_modules/debug-stream/node_modules/ms/package.json b/node_modules/debug-stream/node_modules/ms/package.json new file mode 100755 index 00000000..6811b4a8 --- /dev/null +++ b/node_modules/debug-stream/node_modules/ms/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + { + "raw": "ms@0.6.2", + "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.6.2", + "spec": "0.6.2", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/debug-stream/node_modules/debug" + ] + ], + "_from": "ms@0.6.2", + "_id": "ms@0.6.2", + "_inCache": true, + "_location": "/debug-stream/ms", + "_npmUser": { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + "_npmVersion": "1.2.30", + "_phantomChildren": {}, + "_requested": { + "raw": "ms@0.6.2", + "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.6.2", + "spec": "0.6.2", + "type": "version" + }, + "_requiredBy": [ + "/debug-stream/debug" + ], + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz", + "_shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", + "_shrinkwrap": null, + "_spec": "ms@0.6.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/debug-stream/node_modules/debug", + "bugs": { + "url": "https://github.com/guille/ms.js/issues" + }, + "component": { + "scripts": { + "ms/index.js": "index.js" + } + }, + "dependencies": {}, + "description": "Tiny ms conversion utility", + "devDependencies": { + "expect.js": "*", + "mocha": "*", + "serve": "*" + }, + "directories": {}, + "dist": { + "shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", + "tarball": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz" + }, + "homepage": "https://github.com/guille/ms.js#readme", + "main": "./index", + "maintainers": [ + { + "name": "rauchg", + "email": "rauchg@gmail.com" + } + ], + "name": "ms", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/guille/ms.js.git" + }, + "version": "0.6.2" +} diff --git a/node_modules/debug-stream/package.json b/node_modules/debug-stream/package.json new file mode 100755 index 00000000..deb55109 --- /dev/null +++ b/node_modules/debug-stream/package.json @@ -0,0 +1,85 @@ +{ + "_args": [ + [ + { + "raw": "debug-stream@^2.0.2", + "scope": null, + "escapedName": "debug-stream", + "name": "debug-stream", + "rawSpec": "^2.0.2", + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket" + ] + ], + "_from": "debug-stream@>=2.0.2 <3.0.0", + "_id": "debug-stream@2.1.0", + "_inCache": true, + "_location": "/debug-stream", + "_nodeVersion": "2.4.0", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.13.0", + "_phantomChildren": {}, + "_requested": { + "raw": "debug-stream@^2.0.2", + "scope": null, + "escapedName": "debug-stream", + "name": "debug-stream", + "rawSpec": "^2.0.2", + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gasket" + ], + "_resolved": "https://registry.npmjs.org/debug-stream/-/debug-stream-2.1.0.tgz", + "_shasum": "108d2e5a76d8d74d3f35442273b209dcdc380e30", + "_shrinkwrap": null, + "_spec": "debug-stream@^2.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/debug-stream/issues" + }, + "dependencies": { + "debug": "^1.0.2", + "split": "^0.3.0", + "through2": "^2.0.0" + }, + "description": "use the debug module on a stream", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "108d2e5a76d8d74d3f35442273b209dcdc380e30", + "tarball": "https://registry.npmjs.org/debug-stream/-/debug-stream-2.1.0.tgz" + }, + "gitHead": "143c656f9861848f94859a6913e7e80616aead52", + "homepage": "https://github.com/mafintosh/debug-stream", + "keywords": [ + "debug", + "stream" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "debug-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/debug-stream.git" + }, + "scripts": {}, + "version": "2.1.0" +} diff --git a/node_modules/debug/.coveralls.yml b/node_modules/debug/.coveralls.yml new file mode 100755 index 00000000..20a70685 --- /dev/null +++ b/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/debug/.eslintrc b/node_modules/debug/.eslintrc new file mode 100755 index 00000000..8a37ae2c --- /dev/null +++ b/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/debug/.npmignore b/node_modules/debug/.npmignore new file mode 100755 index 00000000..db2fbb9d --- /dev/null +++ b/node_modules/debug/.npmignore @@ -0,0 +1,8 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage diff --git a/node_modules/debug/.travis.yml b/node_modules/debug/.travis.yml new file mode 100755 index 00000000..6c6090c3 --- /dev/null +++ b/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/debug/CHANGELOG.md b/node_modules/debug/CHANGELOG.md new file mode 100755 index 00000000..07ba5396 --- /dev/null +++ b/node_modules/debug/CHANGELOG.md @@ -0,0 +1,330 @@ + +2.6.3 / 2017-03-13 +================== + + * Fix: Fix for electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeeK) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/debug/LICENSE b/node_modules/debug/LICENSE new file mode 100755 index 00000000..658c933d --- /dev/null +++ b/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/debug/Makefile b/node_modules/debug/Makefile new file mode 100755 index 00000000..584da8bf --- /dev/null +++ b/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/debug/README.md b/node_modules/debug/README.md new file mode 100755 index 00000000..4aeab13f --- /dev/null +++ b/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disabled specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/debug/bower.json b/node_modules/debug/bower.json new file mode 100755 index 00000000..027804ce --- /dev/null +++ b/node_modules/debug/bower.json @@ -0,0 +1,29 @@ +{ + "name": "visionmedia-debug", + "main": "./src/browser.js", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/debug/component.json b/node_modules/debug/component.json new file mode 100755 index 00000000..e150dc47 --- /dev/null +++ b/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.3", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/debug/karma.conf.js b/node_modules/debug/karma.conf.js new file mode 100755 index 00000000..103a82d1 --- /dev/null +++ b/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/debug/node.js b/node_modules/debug/node.js new file mode 100755 index 00000000..7fc36fe6 --- /dev/null +++ b/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json new file mode 100755 index 00000000..49eb0b44 --- /dev/null +++ b/node_modules/debug/package.json @@ -0,0 +1,128 @@ +{ + "_args": [ + [ + { + "raw": "debug@^2.1.1", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "^2.1.1", + "spec": ">=2.1.1 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core" + ] + ], + "_from": "debug@>=2.1.1 <3.0.0", + "_id": "debug@2.6.3", + "_inCache": true, + "_location": "/debug", + "_nodeVersion": "6.9.2", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/debug-2.6.3.tgz_1489463433800_0.9440390267409384" + }, + "_npmUser": { + "name": "thebigredgeek", + "email": "rhyneandrew@gmail.com" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "debug@^2.1.1", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "^2.1.1", + "spec": ">=2.1.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-core", + "/babel-traverse", + "/finalhandler", + "/npm-execspawn", + "/sockjs-client" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.3.tgz", + "_shasum": "0f7eb8c30965ec08c72accfa0130c8b79984141d", + "_shrinkwrap": null, + "_spec": "debug@^2.1.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "0.7.2" + }, + "description": "small debugging utility", + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "directories": {}, + "dist": { + "shasum": "0f7eb8c30965ec08c72accfa0130c8b79984141d", + "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.3.tgz" + }, + "gitHead": "9dc30f8378cc12192635cc6a31f0d96bb39be8bb", + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "maintainers": [ + { + "name": "thebigredgeek", + "email": "rhyneandrew@gmail.com" + } + ], + "name": "debug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "scripts": {}, + "version": "2.6.3" +} diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js new file mode 100755 index 00000000..e21c1e0b --- /dev/null +++ b/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/debug/src/debug.js b/node_modules/debug/src/debug.js new file mode 100755 index 00000000..d5d6d167 --- /dev/null +++ b/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/debug/src/index.js b/node_modules/debug/src/index.js new file mode 100755 index 00000000..e12cf4d5 --- /dev/null +++ b/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/debug/src/node.js b/node_modules/debug/src/node.js new file mode 100755 index 00000000..3c7407b6 --- /dev/null +++ b/node_modules/debug/src/node.js @@ -0,0 +1,241 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = util._extend({}, exports.inspectOpts); +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/decamelize/index.js b/node_modules/decamelize/index.js new file mode 100755 index 00000000..8d5bab7e --- /dev/null +++ b/node_modules/decamelize/index.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = function (str, sep) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + sep = typeof sep === 'undefined' ? '_' : sep; + + return str + .replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2') + .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2') + .toLowerCase(); +}; diff --git a/node_modules/decamelize/license b/node_modules/decamelize/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/decamelize/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/decamelize/package.json b/node_modules/decamelize/package.json new file mode 100755 index 00000000..2b141d8f --- /dev/null +++ b/node_modules/decamelize/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "decamelize@^1.0.0", + "scope": null, + "escapedName": "decamelize", + "name": "decamelize", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/yargs" + ] + ], + "_from": "decamelize@>=1.0.0 <2.0.0", + "_id": "decamelize@1.2.0", + "_inCache": true, + "_location": "/decamelize", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/decamelize-1.2.0.tgz_1457167749082_0.9810893186368048" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "3.8.0", + "_phantomChildren": {}, + "_requested": { + "raw": "decamelize@^1.0.0", + "scope": null, + "escapedName": "decamelize", + "name": "decamelize", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/yargs" + ], + "_resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "_shasum": "f6534d15148269b20352e7bee26f501f9a191290", + "_shrinkwrap": null, + "_spec": "decamelize@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/yargs", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/decamelize/issues" + }, + "dependencies": {}, + "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "f6534d15148269b20352e7bee26f501f9a191290", + "tarball": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "95980ab6fb44c40eaca7792bdf93aff7c210c805", + "homepage": "https://github.com/sindresorhus/decamelize#readme", + "keywords": [ + "decamelize", + "decamelcase", + "camelcase", + "lowercase", + "case", + "dash", + "hyphen", + "string", + "str", + "text", + "convert" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "decamelize", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/decamelize.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.2.0" +} diff --git a/node_modules/decamelize/readme.md b/node_modules/decamelize/readme.md new file mode 100755 index 00000000..624c7ee5 --- /dev/null +++ b/node_modules/decamelize/readme.md @@ -0,0 +1,48 @@ +# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize) + +> Convert a camelized string into a lowercased one with a custom separator
+> Example: `unicornRainbow` → `unicorn_rainbow` + + +## Install + +``` +$ npm install --save decamelize +``` + + +## Usage + +```js +const decamelize = require('decamelize'); + +decamelize('unicornRainbow'); +//=> 'unicorn_rainbow' + +decamelize('unicornRainbow', '-'); +//=> 'unicorn-rainbow' +``` + + +## API + +### decamelize(input, [separator]) + +#### input + +Type: `string` + +#### separator + +Type: `string`
+Default: `_` + + +## Related + +See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/deep-equal/.travis.yml b/node_modules/deep-equal/.travis.yml new file mode 100755 index 00000000..f1d0f13c --- /dev/null +++ b/node_modules/deep-equal/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/node_modules/deep-equal/LICENSE b/node_modules/deep-equal/LICENSE new file mode 100755 index 00000000..ee27ba4b --- /dev/null +++ b/node_modules/deep-equal/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/deep-equal/example/cmp.js b/node_modules/deep-equal/example/cmp.js new file mode 100755 index 00000000..67014b88 --- /dev/null +++ b/node_modules/deep-equal/example/cmp.js @@ -0,0 +1,11 @@ +var equal = require('../'); +console.dir([ + equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + ), + equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + ) +]); diff --git a/node_modules/deep-equal/index.js b/node_modules/deep-equal/index.js new file mode 100755 index 00000000..dbc11f2d --- /dev/null +++ b/node_modules/deep-equal/index.js @@ -0,0 +1,94 @@ +var pSlice = Array.prototype.slice; +var objectKeys = require('./lib/keys.js'); +var isArguments = require('./lib/is_arguments.js'); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} diff --git a/node_modules/deep-equal/lib/is_arguments.js b/node_modules/deep-equal/lib/is_arguments.js new file mode 100755 index 00000000..1ff150fc --- /dev/null +++ b/node_modules/deep-equal/lib/is_arguments.js @@ -0,0 +1,20 @@ +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; diff --git a/node_modules/deep-equal/lib/keys.js b/node_modules/deep-equal/lib/keys.js new file mode 100755 index 00000000..13af263f --- /dev/null +++ b/node_modules/deep-equal/lib/keys.js @@ -0,0 +1,9 @@ +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} diff --git a/node_modules/deep-equal/package.json b/node_modules/deep-equal/package.json new file mode 100755 index 00000000..109986a2 --- /dev/null +++ b/node_modules/deep-equal/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "deep-equal@~0.2.1", + "scope": null, + "escapedName": "deep-equal", + "name": "deep-equal", + "rawSpec": "~0.2.1", + "spec": ">=0.2.1 <0.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/utile" + ] + ], + "_from": "deep-equal@>=0.2.1 <0.3.0", + "_id": "deep-equal@0.2.2", + "_inCache": true, + "_location": "/deep-equal", + "_nodeVersion": "0.10.35", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_npmVersion": "2.3.0", + "_phantomChildren": {}, + "_requested": { + "raw": "deep-equal@~0.2.1", + "scope": null, + "escapedName": "deep-equal", + "name": "deep-equal", + "rawSpec": "~0.2.1", + "spec": ">=0.2.1 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/utile" + ], + "_resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", + "_shasum": "84b745896f34c684e98f2ce0e42abaf43bba017d", + "_shrinkwrap": null, + "_spec": "deep-equal@~0.2.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/utile", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-deep-equal/issues" + }, + "dependencies": {}, + "description": "node's assert.deepEqual algorithm", + "devDependencies": { + "tape": "^3.5.0" + }, + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "dist": { + "shasum": "84b745896f34c684e98f2ce0e42abaf43bba017d", + "tarball": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz" + }, + "gitHead": "05cd26a25f0d7babf0c2758827b4dafec9d0582e", + "homepage": "https://github.com/substack/node-deep-equal", + "keywords": [ + "equality", + "equal", + "compare" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "deep-equal", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/substack/node-deep-equal.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.2.2" +} diff --git a/node_modules/deep-equal/readme.markdown b/node_modules/deep-equal/readme.markdown new file mode 100755 index 00000000..f489c2a3 --- /dev/null +++ b/node_modules/deep-equal/readme.markdown @@ -0,0 +1,61 @@ +# deep-equal + +Node's `assert.deepEqual() algorithm` as a standalone module. + +This module is around [5 times faster](https://gist.github.com/2790507) +than wrapping `assert.deepEqual()` in a `try/catch`. + +[![browser support](https://ci.testling.com/substack/node-deep-equal.png)](https://ci.testling.com/substack/node-deep-equal) + +[![build status](https://secure.travis-ci.org/substack/node-deep-equal.png)](https://travis-ci.org/substack/node-deep-equal) + +# example + +``` js +var equal = require('deep-equal'); +console.dir([ + equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + ), + equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + ) +]); +``` + +# methods + +``` js +var deepEqual = require('deep-equal') +``` + +## deepEqual(a, b, opts) + +Compare objects `a` and `b`, returning whether they are equal according to a +recursive equality algorithm. + +If `opts.strict` is `true`, use strict equality (`===`) to compare leaf nodes. +The default is to use coercive equality (`==`) because that's how +`assert.deepEqual()` works by default. + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install deep-equal +``` + +# test + +With [npm](http://npmjs.org) do: + +``` +npm test +``` + +# license + +MIT. Derived largely from node's assert module. diff --git a/node_modules/deep-equal/test/cmp.js b/node_modules/deep-equal/test/cmp.js new file mode 100755 index 00000000..d141256c --- /dev/null +++ b/node_modules/deep-equal/test/cmp.js @@ -0,0 +1,89 @@ +var test = require('tape'); +var equal = require('../'); +var isArguments = require('../lib/is_arguments.js'); +var objectKeys = require('../lib/keys.js'); + +test('equal', function (t) { + t.ok(equal( + { a : [ 2, 3 ], b : [ 4 ] }, + { a : [ 2, 3 ], b : [ 4 ] } + )); + t.end(); +}); + +test('not equal', function (t) { + t.notOk(equal( + { x : 5, y : [6] }, + { x : 5, y : 6 } + )); + t.end(); +}); + +test('nested nulls', function (t) { + t.ok(equal([ null, null, null ], [ null, null, null ])); + t.end(); +}); + +test('strict equal', function (t) { + t.notOk(equal( + [ { a: 3 }, { b: 4 } ], + [ { a: '3' }, { b: '4' } ], + { strict: true } + )); + t.end(); +}); + +test('non-objects', function (t) { + t.ok(equal(3, 3)); + t.ok(equal('beep', 'beep')); + t.ok(equal('3', 3)); + t.notOk(equal('3', 3, { strict: true })); + t.notOk(equal('3', [3])); + t.end(); +}); + +test('arguments class', function (t) { + t.ok(equal( + (function(){return arguments})(1,2,3), + (function(){return arguments})(1,2,3), + "compares arguments" + )); + t.notOk(equal( + (function(){return arguments})(1,2,3), + [1,2,3], + "differenciates array and arguments" + )); + t.end(); +}); + +test('test the arguments shim', function (t) { + t.ok(isArguments.supported((function(){return arguments})())); + t.notOk(isArguments.supported([1,2,3])); + + t.ok(isArguments.unsupported((function(){return arguments})())); + t.notOk(isArguments.unsupported([1,2,3])); + + t.end(); +}); + +test('test the keys shim', function (t) { + t.deepEqual(objectKeys.shim({ a: 1, b : 2 }), [ 'a', 'b' ]); + t.end(); +}); + +test('dates', function (t) { + var d0 = new Date(1387585278000); + var d1 = new Date('Fri Dec 20 2013 16:21:18 GMT-0800 (PST)'); + t.ok(equal(d0, d1)); + t.end(); +}); + +test('buffers', function (t) { + t.ok(equal(Buffer('xyz'), Buffer('xyz'))); + t.end(); +}); + +test('booleans and arrays', function (t) { + t.notOk(equal(true, [])); + t.end(); +}) diff --git a/node_modules/depd/History.md b/node_modules/depd/History.md new file mode 100755 index 00000000..ace11715 --- /dev/null +++ b/node_modules/depd/History.md @@ -0,0 +1,84 @@ +1.1.0 / 2015-09-14 +================== + + * Enable strict mode in more places + * Support io.js 3.x + * Support io.js 2.x + * Support web browser loading + - Requires bundler like Browserify or webpack + +1.0.1 / 2015-04-07 +================== + + * Fix `TypeError`s when under `'use strict'` code + * Fix useless type name on auto-generated messages + * Support io.js 1.x + * Support Node.js 0.12 + +1.0.0 / 2014-09-17 +================== + + * No changes + +0.4.5 / 2014-09-09 +================== + + * Improve call speed to functions using the function wrapper + * Support Node.js 0.6 + +0.4.4 / 2014-07-27 +================== + + * Work-around v8 generating empty stack traces + +0.4.3 / 2014-07-26 +================== + + * Fix exception when global `Error.stackTraceLimit` is too low + +0.4.2 / 2014-07-19 +================== + + * Correct call site for wrapped functions and properties + +0.4.1 / 2014-07-19 +================== + + * Improve automatic message generation for function properties + +0.4.0 / 2014-07-19 +================== + + * Add `TRACE_DEPRECATION` environment variable + * Remove non-standard grey color from color output + * Support `--no-deprecation` argument + * Support `--trace-deprecation` argument + * Support `deprecate.property(fn, prop, message)` + +0.3.0 / 2014-06-16 +================== + + * Add `NO_DEPRECATION` environment variable + +0.2.0 / 2014-06-15 +================== + + * Add `deprecate.property(obj, prop, message)` + * Remove `supports-color` dependency for node.js 0.8 + +0.1.0 / 2014-06-15 +================== + + * Add `deprecate.function(fn, message)` + * Add `process.on('deprecation', fn)` emitter + * Automatically generate message when omitted from `deprecate()` + +0.0.1 / 2014-06-15 +================== + + * Fix warning for dynamic calls at singe call site + +0.0.0 / 2014-06-15 +================== + + * Initial implementation diff --git a/node_modules/depd/LICENSE b/node_modules/depd/LICENSE new file mode 100755 index 00000000..142ede38 --- /dev/null +++ b/node_modules/depd/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/depd/Readme.md b/node_modules/depd/Readme.md new file mode 100755 index 00000000..09bb9799 --- /dev/null +++ b/node_modules/depd/Readme.md @@ -0,0 +1,281 @@ +# depd + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Linux Build][travis-image]][travis-url] +[![Windows Build][appveyor-image]][appveyor-url] +[![Coverage Status][coveralls-image]][coveralls-url] +[![Gratipay][gratipay-image]][gratipay-url] + +Deprecate all the things + +> With great modules comes great responsibility; mark things deprecated! + +## Install + +This module is installed directly using `npm`: + +```sh +$ npm install depd +``` + +This module can also be bundled with systems like +[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), +though by default this module will alter it's API to no longer display or +track deprecations. + +## API + +```js +var deprecate = require('depd')('my-module') +``` + +This library allows you to display deprecation messages to your users. +This library goes above and beyond with deprecation warnings by +introspection of the call stack (but only the bits that it is interested +in). + +Instead of just warning on the first invocation of a deprecated +function and never again, this module will warn on the first invocation +of a deprecated function per unique call site, making it ideal to alert +users of all deprecated uses across the code base, rather than just +whatever happens to execute first. + +The deprecation warnings from this module also include the file and line +information for the call into the module that the deprecated function was +in. + +**NOTE** this library has a similar interface to the `debug` module, and +this module uses the calling file to get the boundary for the call stacks, +so you should always create a new `deprecate` object in each file and not +within some central file. + +### depd(namespace) + +Create a new deprecate function that uses the given namespace name in the +messages and will display the call site prior to the stack entering the +file this function was called from. It is highly suggested you use the +name of your module as the namespace. + +### deprecate(message) + +Call this function from deprecated code to display a deprecation message. +This message will appear once per unique caller site. Caller site is the +first call site in the stack in a different file from the caller of this +function. + +If the message is omitted, a message is generated for you based on the site +of the `deprecate()` call and will display the name of the function called, +similar to the name displayed in a stack trace. + +### deprecate.function(fn, message) + +Call this function to wrap a given function in a deprecation message on any +call to the function. An optional message can be supplied to provide a custom +message. + +### deprecate.property(obj, prop, message) + +Call this function to wrap a given property on object in a deprecation message +on any accessing or setting of the property. An optional message can be supplied +to provide a custom message. + +The method must be called on the object where the property belongs (not +inherited from the prototype). + +If the property is a data descriptor, it will be converted to an accessor +descriptor in order to display the deprecation message. + +### process.on('deprecation', fn) + +This module will allow easy capturing of deprecation errors by emitting the +errors as the type "deprecation" on the global `process`. If there are no +listeners for this type, the errors are written to STDERR as normal, but if +there are any listeners, nothing will be written to STDERR and instead only +emitted. From there, you can write the errors in a different format or to a +logging source. + +The error represents the deprecation and is emitted only once with the same +rules as writing to STDERR. The error has the following properties: + + - `message` - This is the message given by the library + - `name` - This is always `'DeprecationError'` + - `namespace` - This is the namespace the deprecation came from + - `stack` - This is the stack of the call to the deprecated thing + +Example `error.stack` output: + +``` +DeprecationError: my-cool-module deprecated oldfunction + at Object. ([eval]-wrapper:6:22) + at Module._compile (module.js:456:26) + at evalScript (node.js:532:25) + at startup (node.js:80:7) + at node.js:902:3 +``` + +### process.env.NO_DEPRECATION + +As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` +is provided as a quick solution to silencing deprecation warnings from being +output. The format of this is similar to that of `DEBUG`: + +```sh +$ NO_DEPRECATION=my-module,othermod node app.js +``` + +This will suppress deprecations from being output for "my-module" and "othermod". +The value is a list of comma-separated namespaces. To suppress every warning +across all namespaces, use the value `*` for a namespace. + +Providing the argument `--no-deprecation` to the `node` executable will suppress +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not suppress the deperecations given to any "deprecation" +event listeners, just the output to STDERR. + +### process.env.TRACE_DEPRECATION + +As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` +is provided as a solution to getting more detailed location information in deprecation +warnings by including the entire stack trace. The format of this is the same as +`NO_DEPRECATION`: + +```sh +$ TRACE_DEPRECATION=my-module,othermod node app.js +``` + +This will include stack traces for deprecations being output for "my-module" and +"othermod". The value is a list of comma-separated namespaces. To trace every +warning across all namespaces, use the value `*` for a namespace. + +Providing the argument `--trace-deprecation` to the `node` executable will trace +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. + +## Display + +![message](files/message.png) + +When a user calls a function in your library that you mark deprecated, they +will see the following written to STDERR (in the given colors, similar colors +and layout to the `debug` module): + +``` +bright cyan bright yellow +| | reset cyan +| | | | +▼ ▼ ▼ ▼ +my-cool-module deprecated oldfunction [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ +| | | | +namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +If the user redirects their STDERR to a file or somewhere that does not support +colors, they see (similar layout to the `debug` module): + +``` +Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ ▲ +| | | | | +timestamp of message namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +## Examples + +### Deprecating all calls to a function + +This will display a deprecated message about "oldfunction" being deprecated +from "my-module" on STDERR. + +```js +var deprecate = require('depd')('my-cool-module') + +// message automatically derived from function name +// Object.oldfunction +exports.oldfunction = deprecate.function(function oldfunction() { + // all calls to function are deprecated +}) + +// specific message +exports.oldfunction = deprecate.function(function () { + // all calls to function are deprecated +}, 'oldfunction') +``` + +### Conditionally deprecating a function call + +This will display a deprecated message about "weirdfunction" being deprecated +from "my-module" on STDERR when called with less than 2 arguments. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } +} +``` + +When calling `deprecate` as a function, the warning is counted per call site +within your own module, so you can display different deprecations depending +on different situations and the users will still get all the warnings: + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } else if (typeof arguments[0] !== 'string') { + // calls with non-string first argument are deprecated + deprecate('weirdfunction non-string first arg') + } +} +``` + +### Deprecating property access + +This will display a deprecated message about "oldprop" being deprecated +from "my-module" on STDERR when accessed. A deprecation will be displayed +when setting the value and when getting the value. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.oldprop = 'something' + +// message automatically derives from property name +deprecate.property(exports, 'oldprop') + +// explicit message +deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') +``` + +## License + +[MIT](LICENSE) + +[npm-version-image]: https://img.shields.io/npm/v/depd.svg +[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg +[npm-url]: https://npmjs.org/package/depd +[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux +[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd +[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd +[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg +[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master +[node-image]: https://img.shields.io/node/v/depd.svg +[node-url]: http://nodejs.org/download/ +[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg +[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/node_modules/depd/index.js b/node_modules/depd/index.js new file mode 100755 index 00000000..fddcae87 --- /dev/null +++ b/node_modules/depd/index.js @@ -0,0 +1,521 @@ +/*! + * depd + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var callSiteToString = require('./lib/compat').callSiteToString +var eventListenerCount = require('./lib/compat').eventListenerCount +var relative = require('path').relative + +/** + * Module exports. + */ + +module.exports = depd + +/** + * Get the path to base files on. + */ + +var basePath = process.cwd() + +/** + * Determine if namespace is contained in the string. + */ + +function containsNamespace(str, namespace) { + var val = str.split(/[ ,]+/) + + namespace = String(namespace).toLowerCase() + + for (var i = 0 ; i < val.length; i++) { + if (!(str = val[i])) continue; + + // namespace contained + if (str === '*' || str.toLowerCase() === namespace) { + return true + } + } + + return false +} + +/** + * Convert a data descriptor to accessor descriptor. + */ + +function convertDataDescriptorToAccessor(obj, prop, message) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + var value = descriptor.value + + descriptor.get = function getter() { return value } + + if (descriptor.writable) { + descriptor.set = function setter(val) { return value = val } + } + + delete descriptor.value + delete descriptor.writable + + Object.defineProperty(obj, prop, descriptor) + + return descriptor +} + +/** + * Create arguments string to keep arity. + */ + +function createArgumentsString(arity) { + var str = '' + + for (var i = 0; i < arity; i++) { + str += ', arg' + i + } + + return str.substr(2) +} + +/** + * Create stack string from stack. + */ + +function createStackString(stack) { + var str = this.name + ': ' + this.namespace + + if (this.message) { + str += ' deprecated ' + this.message + } + + for (var i = 0; i < stack.length; i++) { + str += '\n at ' + callSiteToString(stack[i]) + } + + return str +} + +/** + * Create deprecate for namespace in caller. + */ + +function depd(namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + var stack = getStack() + var site = callSiteLocation(stack[1]) + var file = site[0] + + function deprecate(message) { + // call to self as log + log.call(deprecate, message) + } + + deprecate._file = file + deprecate._ignored = isignored(namespace) + deprecate._namespace = namespace + deprecate._traced = istraced(namespace) + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Determine if namespace is ignored. + */ + +function isignored(namespace) { + /* istanbul ignore next: tested in a child processs */ + if (process.noDeprecation) { + // --no-deprecation support + return true + } + + var str = process.env.NO_DEPRECATION || '' + + // namespace ignored + return containsNamespace(str, namespace) +} + +/** + * Determine if namespace is traced. + */ + +function istraced(namespace) { + /* istanbul ignore next: tested in a child processs */ + if (process.traceDeprecation) { + // --trace-deprecation support + return true + } + + var str = process.env.TRACE_DEPRECATION || '' + + // namespace traced + return containsNamespace(str, namespace) +} + +/** + * Display deprecation message. + */ + +function log(message, site) { + var haslisteners = eventListenerCount(process, 'deprecation') !== 0 + + // abort early if no destination + if (!haslisteners && this._ignored) { + return + } + + var caller + var callFile + var callSite + var i = 0 + var seen = false + var stack = getStack() + var file = this._file + + if (site) { + // provided site + callSite = callSiteLocation(stack[1]) + callSite.name = site.name + file = callSite[0] + } else { + // get call site + i = 2 + site = callSiteLocation(stack[i]) + callSite = site + } + + // get caller of deprecated thing in relation to file + for (; i < stack.length; i++) { + caller = callSiteLocation(stack[i]) + callFile = caller[0] + + if (callFile === file) { + seen = true + } else if (callFile === this._file) { + file = this._file + } else if (seen) { + break + } + } + + var key = caller + ? site.join(':') + '__' + caller.join(':') + : undefined + + if (key !== undefined && key in this._warned) { + // already warned + return + } + + this._warned[key] = true + + // generate automatic message from call site + if (!message) { + message = callSite === site || !callSite.name + ? defaultMessage(site) + : defaultMessage(callSite) + } + + // emit deprecation if listeners exist + if (haslisteners) { + var err = DeprecationError(this._namespace, message, stack.slice(i)) + process.emit('deprecation', err) + return + } + + // format and write message + var format = process.stderr.isTTY + ? formatColor + : formatPlain + var msg = format.call(this, message, caller, stack.slice(i)) + process.stderr.write(msg + '\n', 'utf8') + + return +} + +/** + * Get call site location as array. + */ + +function callSiteLocation(callSite) { + var file = callSite.getFileName() || '' + var line = callSite.getLineNumber() + var colm = callSite.getColumnNumber() + + if (callSite.isEval()) { + file = callSite.getEvalOrigin() + ', ' + file + } + + var site = [file, line, colm] + + site.callSite = callSite + site.name = callSite.getFunctionName() + + return site +} + +/** + * Generate a default message from the site. + */ + +function defaultMessage(site) { + var callSite = site.callSite + var funcName = site.name + + // make useful anonymous name + if (!funcName) { + funcName = '' + } + + var context = callSite.getThis() + var typeName = context && callSite.getTypeName() + + // ignore useless type name + if (typeName === 'Object') { + typeName = undefined + } + + // make useful type name + if (typeName === 'Function') { + typeName = context.name || typeName + } + + return typeName && callSite.getMethodName() + ? typeName + '.' + funcName + : funcName +} + +/** + * Format deprecation message without color. + */ + +function formatPlain(msg, caller, stack) { + var timestamp = new Date().toUTCString() + + var formatted = timestamp + + ' ' + this._namespace + + ' deprecated ' + msg + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n at ' + callSiteToString(stack[i]) + } + + return formatted + } + + if (caller) { + formatted += ' at ' + formatLocation(caller) + } + + return formatted +} + +/** + * Format deprecation message with color. + */ + +function formatColor(msg, caller, stack) { + var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' // bold cyan + + ' \x1b[33;1mdeprecated\x1b[22;39m' // bold yellow + + ' \x1b[0m' + msg + '\x1b[39m' // reset + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan + } + + return formatted + } + + if (caller) { + formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan + } + + return formatted +} + +/** + * Format call site location. + */ + +function formatLocation(callSite) { + return relative(basePath, callSite[0]) + + ':' + callSite[1] + + ':' + callSite[2] +} + +/** + * Get the stack as array of call sites. + */ + +function getStack() { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = Math.max(10, limit) + + // capture the stack + Error.captureStackTrace(obj) + + // slice this function off the top + var stack = obj.stack.slice(1) + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack +} + +/** + * Capture call site stack from v8. + */ + +function prepareObjectStackTrace(obj, stack) { + return stack +} + +/** + * Return a wrapped function in a deprecation message. + */ + +function wrapfunction(fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + var args = createArgumentsString(fn.length) + var deprecate = this + var stack = getStack() + var site = callSiteLocation(stack[1]) + + site.name = fn.name + + var deprecatedfn = eval('(function (' + args + ') {\n' + + '"use strict"\n' + + 'log.call(deprecate, message, site)\n' + + 'return fn.apply(this, arguments)\n' + + '})') + + return deprecatedfn +} + +/** + * Wrap property in a deprecation message. + */ + +function wrapproperty(obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + var deprecate = this + var stack = getStack() + var site = callSiteLocation(stack[1]) + + // set site name + site.name = prop + + // convert data descriptor + if ('value' in descriptor) { + descriptor = convertDataDescriptorToAccessor(obj, prop, message) + } + + var get = descriptor.get + var set = descriptor.set + + // wrap getter + if (typeof get === 'function') { + descriptor.get = function getter() { + log.call(deprecate, message, site) + return get.apply(this, arguments) + } + } + + // wrap setter + if (typeof set === 'function') { + descriptor.set = function setter() { + log.call(deprecate, message, site) + return set.apply(this, arguments) + } + } + + Object.defineProperty(obj, prop, descriptor) +} + +/** + * Create DeprecationError for deprecation + */ + +function DeprecationError(namespace, message, stack) { + var error = new Error() + var stackString + + Object.defineProperty(error, 'constructor', { + value: DeprecationError + }) + + Object.defineProperty(error, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }) + + Object.defineProperty(error, 'name', { + enumerable: false, + configurable: true, + value: 'DeprecationError', + writable: true + }) + + Object.defineProperty(error, 'namespace', { + configurable: true, + enumerable: false, + value: namespace, + writable: true + }) + + Object.defineProperty(error, 'stack', { + configurable: true, + enumerable: false, + get: function () { + if (stackString !== undefined) { + return stackString + } + + // prepare stack trace + return stackString = createStackString.call(this, stack) + }, + set: function setter(val) { + stackString = val + } + }) + + return error +} diff --git a/node_modules/depd/lib/browser/index.js b/node_modules/depd/lib/browser/index.js new file mode 100755 index 00000000..f464e052 --- /dev/null +++ b/node_modules/depd/lib/browser/index.js @@ -0,0 +1,79 @@ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = depd + +/** + * Create deprecate for namespace in caller. + */ + +function depd(namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + function deprecate(message) { + // no-op in browser + } + + deprecate._file = undefined + deprecate._ignored = true + deprecate._namespace = namespace + deprecate._traced = false + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Return a wrapped function in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapfunction(fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + return fn +} + +/** + * Wrap property in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapproperty(obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + return +} diff --git a/node_modules/depd/lib/compat/buffer-concat.js b/node_modules/depd/lib/compat/buffer-concat.js new file mode 100755 index 00000000..4b733810 --- /dev/null +++ b/node_modules/depd/lib/compat/buffer-concat.js @@ -0,0 +1,35 @@ +/*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = bufferConcat + +/** + * Concatenate an array of Buffers. + */ + +function bufferConcat(bufs) { + var length = 0 + + for (var i = 0, len = bufs.length; i < len; i++) { + length += bufs[i].length + } + + var buf = new Buffer(length) + var pos = 0 + + for (var i = 0, len = bufs.length; i < len; i++) { + bufs[i].copy(buf, pos) + pos += bufs[i].length + } + + return buf +} diff --git a/node_modules/depd/lib/compat/callsite-tostring.js b/node_modules/depd/lib/compat/callsite-tostring.js new file mode 100755 index 00000000..9ecef346 --- /dev/null +++ b/node_modules/depd/lib/compat/callsite-tostring.js @@ -0,0 +1,103 @@ +/*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = callSiteToString + +/** + * Format a CallSite file location to a string. + */ + +function callSiteFileLocation(callSite) { + var fileName + var fileLocation = '' + + if (callSite.isNative()) { + fileLocation = 'native' + } else if (callSite.isEval()) { + fileName = callSite.getScriptNameOrSourceURL() + if (!fileName) { + fileLocation = callSite.getEvalOrigin() + } + } else { + fileName = callSite.getFileName() + } + + if (fileName) { + fileLocation += fileName + + var lineNumber = callSite.getLineNumber() + if (lineNumber != null) { + fileLocation += ':' + lineNumber + + var columnNumber = callSite.getColumnNumber() + if (columnNumber) { + fileLocation += ':' + columnNumber + } + } + } + + return fileLocation || 'unknown source' +} + +/** + * Format a CallSite to a string. + */ + +function callSiteToString(callSite) { + var addSuffix = true + var fileLocation = callSiteFileLocation(callSite) + var functionName = callSite.getFunctionName() + var isConstructor = callSite.isConstructor() + var isMethodCall = !(callSite.isToplevel() || isConstructor) + var line = '' + + if (isMethodCall) { + var methodName = callSite.getMethodName() + var typeName = getConstructorName(callSite) + + if (functionName) { + if (typeName && functionName.indexOf(typeName) !== 0) { + line += typeName + '.' + } + + line += functionName + + if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { + line += ' [as ' + methodName + ']' + } + } else { + line += typeName + '.' + (methodName || '') + } + } else if (isConstructor) { + line += 'new ' + (functionName || '') + } else if (functionName) { + line += functionName + } else { + addSuffix = false + line += fileLocation + } + + if (addSuffix) { + line += ' (' + fileLocation + ')' + } + + return line +} + +/** + * Get constructor name of reviver. + */ + +function getConstructorName(obj) { + var receiver = obj.receiver + return (receiver.constructor && receiver.constructor.name) || null +} diff --git a/node_modules/depd/lib/compat/event-listener-count.js b/node_modules/depd/lib/compat/event-listener-count.js new file mode 100755 index 00000000..a05fceb7 --- /dev/null +++ b/node_modules/depd/lib/compat/event-listener-count.js @@ -0,0 +1,22 @@ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = eventListenerCount + +/** + * Get the count of listeners on an event emitter of a specific type. + */ + +function eventListenerCount(emitter, type) { + return emitter.listeners(type).length +} diff --git a/node_modules/depd/lib/compat/index.js b/node_modules/depd/lib/compat/index.js new file mode 100755 index 00000000..aa3c1de4 --- /dev/null +++ b/node_modules/depd/lib/compat/index.js @@ -0,0 +1,84 @@ +/*! + * depd + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var Buffer = require('buffer') +var EventEmitter = require('events').EventEmitter + +/** + * Module exports. + * @public + */ + +lazyProperty(module.exports, 'bufferConcat', function bufferConcat() { + return Buffer.concat || require('./buffer-concat') +}) + +lazyProperty(module.exports, 'callSiteToString', function callSiteToString() { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + function prepareObjectStackTrace(obj, stack) { + return stack + } + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = 2 + + // capture the stack + Error.captureStackTrace(obj) + + // slice the stack + var stack = obj.stack.slice() + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack[0].toString ? toString : require('./callsite-tostring') +}) + +lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount() { + return EventEmitter.listenerCount || require('./event-listener-count') +}) + +/** + * Define a lazy property. + */ + +function lazyProperty(obj, prop, getter) { + function get() { + var val = getter() + + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + value: val + }) + + return val + } + + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + get: get + }) +} + +/** + * Call toString() on the obj + */ + +function toString(obj) { + return obj.toString() +} diff --git a/node_modules/depd/package.json b/node_modules/depd/package.json new file mode 100755 index 00000000..910ead4a --- /dev/null +++ b/node_modules/depd/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "depd@~1.1.0", + "scope": null, + "escapedName": "depd", + "name": "depd", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "depd@>=1.1.0 <1.2.0", + "_id": "depd@1.1.0", + "_inCache": true, + "_location": "/depd", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "depd@~1.1.0", + "scope": null, + "escapedName": "depd", + "name": "depd", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/http-errors", + "/send" + ], + "_resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz", + "_shasum": "e1bd82c6aab6ced965b97b88b17ed3e528ca18c3", + "_shrinkwrap": null, + "_spec": "depd@~1.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "browser": "lib/browser/index.js", + "bugs": { + "url": "https://github.com/dougwilson/nodejs-depd/issues" + }, + "dependencies": {}, + "description": "Deprecate all the things", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "1.0.0", + "istanbul": "0.3.5", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "e1bd82c6aab6ced965b97b88b17ed3e528ca18c3", + "tarball": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "lib/", + "History.md", + "LICENSE", + "index.js", + "Readme.md" + ], + "gitHead": "78c659de20283e3a6bee92bda455e6daff01686a", + "homepage": "https://github.com/dougwilson/nodejs-depd", + "keywords": [ + "deprecate", + "deprecated" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "depd", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/dougwilson/nodejs-depd.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "test": "mocha --reporter spec --bail test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" + }, + "version": "1.1.0" +} diff --git a/node_modules/destroy/LICENSE b/node_modules/destroy/LICENSE new file mode 100755 index 00000000..a7ae8ee9 --- /dev/null +++ b/node_modules/destroy/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/destroy/README.md b/node_modules/destroy/README.md new file mode 100755 index 00000000..6474bc3c --- /dev/null +++ b/node_modules/destroy/README.md @@ -0,0 +1,60 @@ +# Destroy + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Destroy a stream. + +This module is meant to ensure a stream gets destroyed, handling different APIs +and Node.js bugs. + +## API + +```js +var destroy = require('destroy') +``` + +### destroy(stream) + +Destroy the given stream. In most cases, this is identical to a simple +`stream.destroy()` call. The rules are as follows for a given stream: + + 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` + and add a listener to the `open` event to call `stream.close()` if it is + fired. This is for a Node.js bug that will leak a file descriptor if + `.destroy()` is called before `open`. + 2. If the `stream` is not an instance of `Stream`, then nothing happens. + 3. If the `stream` has a `.destroy()` method, then call it. + +The function returns the `stream` passed in as the argument. + +## Example + +```js +var destroy = require('destroy') + +var fs = require('fs') +var stream = fs.createReadStream('package.json') + +// ... and later +destroy(stream) +``` + +[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square +[npm-url]: https://npmjs.org/package/destroy +[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square +[github-url]: https://github.com/stream-utils/destroy/tags +[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square +[travis-url]: https://travis-ci.org/stream-utils/destroy +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master +[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/destroy +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/destroy/index.js b/node_modules/destroy/index.js new file mode 100755 index 00000000..6da2d26e --- /dev/null +++ b/node_modules/destroy/index.js @@ -0,0 +1,75 @@ +/*! + * destroy + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var ReadStream = require('fs').ReadStream +var Stream = require('stream') + +/** + * Module exports. + * @public + */ + +module.exports = destroy + +/** + * Destroy a stream. + * + * @param {object} stream + * @public + */ + +function destroy(stream) { + if (stream instanceof ReadStream) { + return destroyReadStream(stream) + } + + if (!(stream instanceof Stream)) { + return stream + } + + if (typeof stream.destroy === 'function') { + stream.destroy() + } + + return stream +} + +/** + * Destroy a ReadStream. + * + * @param {object} stream + * @private + */ + +function destroyReadStream(stream) { + stream.destroy() + + if (typeof stream.close === 'function') { + // node.js core bug work-around + stream.on('open', onOpenClose) + } + + return stream +} + +/** + * On open handler to close stream. + * @private + */ + +function onOpenClose() { + if (typeof this.fd === 'number') { + // actually close down the fd + this.close() + } +} diff --git a/node_modules/destroy/package.json b/node_modules/destroy/package.json new file mode 100755 index 00000000..213e2c71 --- /dev/null +++ b/node_modules/destroy/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "destroy@~1.0.4", + "scope": null, + "escapedName": "destroy", + "name": "destroy", + "rawSpec": "~1.0.4", + "spec": ">=1.0.4 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/send" + ] + ], + "_from": "destroy@>=1.0.4 <1.1.0", + "_id": "destroy@1.0.4", + "_inCache": true, + "_location": "/destroy", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "destroy@~1.0.4", + "scope": null, + "escapedName": "destroy", + "name": "destroy", + "rawSpec": "~1.0.4", + "spec": ">=1.0.4 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "_shasum": "978857442c44749e4206613e37946205826abd80", + "_shrinkwrap": null, + "_spec": "destroy@~1.0.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/send", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/stream-utils/destroy/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "destroy a stream if possible", + "devDependencies": { + "istanbul": "0.4.2", + "mocha": "2.3.4" + }, + "directories": {}, + "dist": { + "shasum": "978857442c44749e4206613e37946205826abd80", + "tarball": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" + }, + "files": [ + "index.js", + "LICENSE" + ], + "gitHead": "86edea01456f5fa1027f6a47250c34c713cbcc3b", + "homepage": "https://github.com/stream-utils/destroy", + "keywords": [ + "stream", + "streams", + "destroy", + "cleanup", + "leak", + "fd" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "destroy", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/stream-utils/destroy.git" + }, + "scripts": { + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "1.0.4" +} diff --git a/node_modules/detect-indent/index.js b/node_modules/detect-indent/index.js new file mode 100755 index 00000000..c2da3379 --- /dev/null +++ b/node_modules/detect-indent/index.js @@ -0,0 +1,120 @@ +/* eslint-disable guard-for-in */ +'use strict'; +var repeating = require('repeating'); + +// detect either spaces or tabs but not both to properly handle tabs +// for indentation and spaces for alignment +var INDENT_RE = /^(?:( )+|\t+)/; + +function getMostUsed(indents) { + var result = 0; + var maxUsed = 0; + var maxWeight = 0; + + for (var n in indents) { + var indent = indents[n]; + var u = indent[0]; + var w = indent[1]; + + if (u > maxUsed || u === maxUsed && w > maxWeight) { + maxUsed = u; + maxWeight = w; + result = Number(n); + } + } + + return result; +} + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + // used to see if tabs or spaces are the most used + var tabs = 0; + var spaces = 0; + + // remember the size of previous line's indentation + var prev = 0; + + // remember how many indents/unindents as occurred for a given size + // and how much lines follow a given indentation + // + // indents = { + // 3: [1, 0], + // 4: [1, 5], + // 5: [1, 0], + // 12: [1, 0], + // } + var indents = {}; + + // pointer to the array of last used indent + var current; + + // whether the last action was an indent (opposed to an unindent) + var isIndent; + + str.split(/\n/g).forEach(function (line) { + if (!line) { + // ignore empty lines + return; + } + + var indent; + var matches = line.match(INDENT_RE); + + if (!matches) { + indent = 0; + } else { + indent = matches[0].length; + + if (matches[1]) { + spaces++; + } else { + tabs++; + } + } + + var diff = indent - prev; + prev = indent; + + if (diff) { + // an indent or unindent has been detected + + isIndent = diff > 0; + + current = indents[isIndent ? diff : -diff]; + + if (current) { + current[0]++; + } else { + current = indents[diff] = [1, 0]; + } + } else if (current) { + // if the last action was an indent, increment the weight + current[1] += Number(isIndent); + } + }); + + var amount = getMostUsed(indents); + + var type; + var actual; + if (!amount) { + type = null; + actual = ''; + } else if (spaces >= tabs) { + type = 'space'; + actual = repeating(' ', amount); + } else { + type = 'tab'; + actual = repeating('\t', amount); + } + + return { + amount: amount, + type: type, + indent: actual + }; +}; diff --git a/node_modules/detect-indent/license b/node_modules/detect-indent/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/detect-indent/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/detect-indent/package.json b/node_modules/detect-indent/package.json new file mode 100755 index 00000000..cc303dd0 --- /dev/null +++ b/node_modules/detect-indent/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "detect-indent@^4.0.0", + "scope": null, + "escapedName": "detect-indent", + "name": "detect-indent", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-generator" + ] + ], + "_from": "detect-indent@>=4.0.0 <5.0.0", + "_id": "detect-indent@4.0.0", + "_inCache": true, + "_location": "/detect-indent", + "_nodeVersion": "3.0.0", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.13.3", + "_phantomChildren": {}, + "_requested": { + "raw": "detect-indent@^4.0.0", + "scope": null, + "escapedName": "detect-indent", + "name": "detect-indent", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-generator" + ], + "_resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "_shasum": "f76d064352cdf43a1cb6ce619c4ee3a9475de208", + "_shrinkwrap": null, + "_spec": "detect-indent@^4.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-generator", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/detect-indent/issues" + }, + "dependencies": { + "repeating": "^2.0.0" + }, + "description": "Detect the indentation of code", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "f76d064352cdf43a1cb6ce619c4ee3a9475de208", + "tarball": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "dbbc78fcb37907116eb120a8324070a1df0e8d86", + "homepage": "https://github.com/sindresorhus/detect-indent", + "keywords": [ + "indent", + "indentation", + "detect", + "infer", + "identify", + "code", + "string", + "text", + "source", + "space", + "tab" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "detect-indent", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/detect-indent.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "4.0.0", + "xo": { + "ignores": [ + "fixture/**" + ] + } +} diff --git a/node_modules/detect-indent/readme.md b/node_modules/detect-indent/readme.md new file mode 100755 index 00000000..22938ab8 --- /dev/null +++ b/node_modules/detect-indent/readme.md @@ -0,0 +1,110 @@ +# detect-indent [![Build Status](https://travis-ci.org/sindresorhus/detect-indent.svg?branch=master)](https://travis-ci.org/sindresorhus/detect-indent) + +> Detect the indentation of code + +Pass in a string of any kind of text and get the indentation. + + +## Use cases + +- Persisting the indentation when modifying a file. +- Have new content match the existing indentation. +- Setting the right indentation in your editor. + + +## Install + +``` +$ npm install --save detect-indent +``` + + +## Usage + +Here we modify a JSON file while persisting the indentation: + +```js +var fs = require('fs'); +var detectIndent = require('detect-indent'); + +/* +{ + "ilove": "pizza" +} +*/ +var file = fs.readFileSync('foo.json', 'utf8'); + +// tries to detect the indentation and falls back to a default if it can't +var indent = detectIndent(file).indent || ' '; + +var json = JSON.parse(file); + +json.ilove = 'unicorns'; + +fs.writeFileSync('foo.json', JSON.stringify(json, null, indent)); +/* +{ + "ilove": "unicorns" +} +*/ +``` + + +## API + +Accepts a string and returns an object with stats about the indentation: + +* `amount` {number} - Amount of indentation, e.g. `2` +* `type` {string|null} - Type of indentation. Possible values are `tab`, `space` or `null` if no indentation is detected +* `indent` {string} - Actual indentation + + +## Algorithm + +The current algorithm looks for the most common difference between two consecutive non-empty lines. + +In the following example, even if the 4-space indentation is used 3 times whereas the 2-space one is used 2 times, it is detected as less used because there were only 2 differences with this value instead of 4 for the 2-space indentation: + +```css +html { + box-sizing: border-box; +} + +body { + background: gray; +} + +p { + line-height: 1.3em; + margin-top: 1em; + text-indent: 2em; +} +``` + +[Source.](https://medium.com/@heatherarthur/detecting-code-indentation-eff3ed0fb56b#3918) + +Furthermore, if there are more than one most used difference, the indentation with the most lines is selected. + +In the following example, the indentation is detected as 4-spaces: + +```css +body { + background: gray; +} + +p { + line-height: 1.3em; + margin-top: 1em; + text-indent: 2em; +} +``` + + +## Related + +- [detect-indent-cli](https://github.com/sindresorhus/detect-indent-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/domain-browser/.eslintrc.js b/node_modules/domain-browser/.eslintrc.js new file mode 100755 index 00000000..b6238861 --- /dev/null +++ b/node_modules/domain-browser/.eslintrc.js @@ -0,0 +1,701 @@ +// 2015 December 1 +// https://github.com/bevry/base +// http://eslint.org +/* eslint no-warning-comments: 0 */ +'use strict' + +const IGNORE = 0, WARN = 1, ERROR = 2, MAX_PARAMS = 4 + +module.exports = { + // parser: 'babel-eslint', + // ^ the bundled ESLINT parser is now actually quite good, and supports the ecmaFeatures property + ecmaFeatures: { + // this property only works with the bundled ESLINT parser, not babel-eslint + arrowFunctions: true, + binaryLiterals: true, + blockBindings: true, + classes: true, + defaultParams: true, + destructuring: true, + forOf: true, + generators: true, + modules: false, // Disabled due to https://twitter.com/balupton/status/671519915795345410 + objectLiteralComputedProperties: true, + objectLiteralDuplicateProperties: true, + objectLiteralShorthandMethods: true, + objectLiteralShorthandProperties: true, + octalLiterals: true, + regexUFlag: true, + regexYFlag: true, + restParams: true, + spread: true, + superInFunctions: true, + templateStrings: true, + unicodeCodePointEscapes: true, + globalReturn: true, + jsx: true, + experimentalObjectRestSpread: true + }, + env: { + browser: true, + node: true, + es6: true, + commonjs: true, + amd: true + }, + rules: { + // ---------------------------- + // Problems with these rules + // If we can figure out how to enable the following, that would be great + + // Two spaces after one line if or else: + // if ( blah ) return + // Insead of one space: + // if ( blah ) return + + // No spaces on embedded function: + // .forEach(function(key, value){ + // instead of: + // .forEach(function (key, value) { + + // Else and catch statements on the same line as closing brace: + // } else { + // } catch (e) { + // instead of: + // } + // else { + + + // -------------------------------------- + // Possible Errors + // The following rules point out areas where you might have made mistakes. + + // ES6 supports dangling commas + 'comma-dangle': IGNORE, + + // Don't allow assignments in conditional statements (if, while, etc.) + 'no-cond-assign': [ERROR, 'always'], + + // Warn but don't error about console statements + 'no-console': WARN, + + // Allow while(true) loops + 'no-constant-condition': IGNORE, + + // Seems like a good idea to error about this + 'no-control-regex': ERROR, + + // Warn but don't error about console statements + 'no-debugger': WARN, + + // Don't allow duplicate arguments in a function, they can cause errors + 'no-dupe-args': ERROR, + + // Disallow duplicate keys in an object, they can cause errors + 'no-dupe-keys': ERROR, + + // Disallow duplicate case statements in a switch + 'no-duplicate-case': ERROR, + + // Disallow empty [] in regular expressions as they cause unexpected behaviour + 'no-empty-character-class': ERROR, + + // Allow empty block statements, they are useful for clarity + 'no-empty': IGNORE, + + // Overwriting the exception argument in a catch statement can cause memory leaks in some browsers + 'no-ex-assign': ERROR, + + // Disallow superflous boolean casts, they offer no value + 'no-extra-boolean-cast': ERROR, + + // Allow superflous parenthesis as they offer clarity in some cases + 'no-extra-parens': IGNORE, + + // Disallow superflous semicolons, they offer no value + 'no-extra-semi': IGNORE, + + // Seems like a good idea to error about this + 'no-func-assign': ERROR, + + // Seems like a good idea to error about this + 'no-inner-declarations': ERROR, + + // Seems like a good idea to error about this + 'no-invalid-regexp': ERROR, + + // Seems like a good idea to error about this + 'no-irregular-whitespace': ERROR, + + // Seems like a good idea to error about this + 'no-negated-in-lhs': ERROR, + + // Seems like a good idea to error about this + 'no-obj-calls': ERROR, + + // Seems like a good idea to error about this + // Instead of / / used / {ERROR}/ instead + 'no-regex-spaces': ERROR, + + // Seems like a good idea to error about this + 'no-sparse-arrays': ERROR, + + // Seems like a good idea to error about this + 'no-unexpected-multiline': ERROR, + + // Seems like a good idea to error about this + 'no-unreachable': ERROR, + + // Seems like a good idea to error about this + 'use-isnan': ERROR, + + // We use YUIdoc, not JSDoc + 'valid-jsdoc': IGNORE, + + // Seems like a good idea to error about this + 'valid-typeof': ERROR, + + + // -------------------------------------- + // Best Practices + // These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns. + + // Meh + 'accessor-pairs': IGNORE, + + // This rule seems buggy + 'block-scoped-var': IGNORE, + + // Disable complexity checks, they are annoying and not that useful in detecting actual complexity + 'complexity': IGNORE, + + // We use blank returns for break statements + 'consistent-return': IGNORE, + + // Always require curly braces unless the statement is all on a single line + 'curly': [ERROR, 'multi-line'], + + // If we don't have a default cause, it probably means we should throw an error + 'default-case': ERROR, + + // Dots should be on the newlines + // chainableThingy + // .doSomething() + // .doSomethingElse() + 'dot-location': [ERROR, 'property'], + + // Use dot notation where possible + 'dot-notation': ERROR, + + // Unless you are doing == null, then force === to avoid truthy/falsey mistakes + 'eqeqeq': [ERROR, 'allow-null'], + + // Always use hasOwnProperty when doing for in + 'guard-for-in': ERROR, + + // Warn about alert statements in our code + // Use one of the suggested alternatives instead + // Reasoning is they could be mistaken for left over debugging statements + 'no-alert': WARN, + + // They are very slow + 'no-caller': ERROR, + + // Wow... + 'no-case-declarations': ERROR, + + // Seems like a good idea to error about this + 'no-div-regex': ERROR, + + // Returns in else statements offer code clarity, so disable this rule + 'no-else-return': IGNORE, + + // Seems like a good idea to error about this + 'no-empty-label': ERROR, + + // Seems sensible + 'no-empty-pattern': ERROR, + + // We know that == null is a null and undefined check + 'no-eq-null': IGNORE, + + // Eval is slow and unsafe, use vm's instead + 'no-eval': ERROR, + + // There is never a good reason for this + 'no-extend-native': ERROR, + + // Don't allow useless binds + 'no-extra-bind': ERROR, + + // Don't allow switch case statements to follow through, use continue keyword instead + 'no-fallthrough': ERROR, + + // Use zero when doing decimals, otherwise it is confusing + 'no-floating-decimal': ERROR, + + // Cleverness is unclear + 'no-implicit-coercion': ERROR, + + // A sneaky way to do evals + 'no-implied-eval': ERROR, + + // This throws for a lot of senseless things, like chainy functions + 'no-invalid-this': IGNORE, + + // Use proper iterators instead + 'no-iterator': ERROR, + + // We never use this, it seems silly to allow this + 'no-labels': ERROR, + + // We never use this, it seems silly to allow this + 'no-lone-blocks': ERROR, + + // Loop functions always cause problems, as the scope isn't clear through iterations + 'no-loop-func': ERROR, + + // This is a great idea + // Although ignore -1 and 0 as it is common with indexOf + 'no-magic-numbers': [WARN, { ignore: [-1, 0] }], + + // We like multi spaces for clarity + // E.g. We like + // if ( blah ) return foo + // Instead of: + // if ( blah ) return foo + // @TODO would be great to enforce the above + 'no-multi-spaces': IGNORE, + + // Use ES6 template strings instead + 'no-multi-str': ERROR, + + // Would be silly to allow this + 'no-native-reassign': ERROR, + + // We never use this, it seems silly to allow this + 'no-new-func': ERROR, + + // We never use this, it seems silly to allow this + 'no-new-wrappers': ERROR, + + // We never use this, it seems silly to allow this + 'no-new': ERROR, + + // We never use this, it seems silly to allow this + 'no-octal-escape': ERROR, + + // We never use this, it seems silly to allow this + 'no-octal': ERROR, + + // We got to be pretty silly if we don't realise we are doing this + // As such, take any usage as intentional and aware + 'no-param-reassign': IGNORE, + + // We use process.env wisely + 'no-process-env': IGNORE, + + // We never use this, it seems silly to allow this + 'no-proto': ERROR, + + // We never use this, it seems silly to allow this + 'no-redeclare': ERROR, + + // We never use this, it seems silly to allow this + 'no-return-assign': ERROR, + + // We never use this, it seems silly to allow this + 'no-script-url': ERROR, + + // We never use this, it seems silly to allow this + 'no-self-compare': ERROR, + + // We never use this, it seems silly to allow this + 'no-sequences': ERROR, + + // We always want proper error objects as they have stack traces and respond to instanceof Error checks + 'no-throw-literal': ERROR, + + // We never use this, it seems silly to allow this + 'no-unused-expressions': ERROR, + + // Seems sensible + 'no-useless-call': ERROR, + + // Seems sensible + 'no-useless-concat': ERROR, + + // We never use this, it seems silly to allow this + 'no-void': ERROR, + + // Warn about todos + 'no-warning-comments': [WARN, { terms: ['todo', 'fixme'], location: 'anywhere' }], + + // We never use this, it seems silly to allow this + 'no-with': ERROR, + + // Always specify a radix to avoid errors + 'radix': ERROR, + + // We appreciate the clarity late defines offer + 'vars-on-top': IGNORE, + + // Wrap instant called functions in parenthesis for clearer intent + 'wrap-iife': ERROR, + + // Because we force === and never allow assignments in conditions + // we have no need for yoda statements, so disable them + 'yoda': [ERROR, 'never'], + + + // -------------------------------------- + // Strict Mode + // These rules relate to using strict mode. + + // Ensure that use strict is specified to prevent the runtime erorr: + // SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode + 'strict': [ERROR, 'global'], + + + // -------------------------------------- + // Variables + // These rules have to do with variable declarations. + + // We don't care + 'init-declaration': IGNORE, + + // Don't allow the catch method to shadow objects as browsers handle this differently + // Update: We don't care for IE8 + 'no-catch-shadow': IGNORE, + + // Don't use delete, it disables optimisations + 'no-delete-var': ERROR, + + // We never use this, it seems silly to allow this + 'no-label-var': ERROR, + + // We never use this, it seems silly to allow this + 'no-shadow-restricted-names': ERROR, + + // We use shadowing + 'no-shadow': IGNORE, + + // Makes sense + 'no-undef-init': ERROR, + + // Error when an undefined variable is used + 'no-undef': ERROR, + + // typeof blah === 'undefined' should always be used + 'no-undefined': ERROR, + + // Warn us when we don't use something + 'no-unused-vars': WARN, + + // Error when we try and use something before it is defined + 'no-use-before-define': ERROR, + + + // -------------------------------------- + // Node.js and CommonJS + // These rules are specific to JavaScript running on Node.js or using CommonJS in the browser. + + // Seems to difficult to enforce + 'callback-return': IGNORE, + + // We use require where it is appropriate to use it + 'global-require': IGNORE, + + // Force handling of callback errors + 'handle-callback-err': ERROR, + + // @TODO decide if this is good or not + 'no-mixed-requires': ERROR, + + // Disallow error prone syntax + 'no-new-require': ERROR, + + // Always use path.join for windows support + 'no-path-concat': ERROR, + + // We know what we are doing + 'no-process-exit': IGNORE, + + // No need to disallow any modules + 'no-restricted-modules': IGNORE, + + // Sometimes sync methods are useful, so warn but don't error + 'no-sync': WARN, + + + // -------------------------------------- + // Stylistic + // These rules are purely matters of style and are quite subjective. + + // We don't use spaces with brackets + 'array-bracket-spacing': [ERROR, 'never'], + + // Disallow or enforce spaces inside of single line blocks + 'block-spacing': [ERROR, 'always'], + + // Opening brace on same line, closing brace on its own line, except when statement is a single line + 'brace-style': [ERROR, 'stroustrup', { allowSingleLine: true }], + + // Use camel case + 'camelcase': ERROR, + + // Require a comma after always + 'comma-spacing': [ERROR, { before: false, after: true }], + + // Commas go last, we have tooling to detect if we forget a comma + 'comma-style': [ERROR, 'last'], + + // Require or disallow padding inside computed properties + 'computed-property-spacing': [ERROR, 'never'], + + // Enabling this was incredibly annoying when doing layers of nesting + 'consistent-this': IGNORE, + + // Enable to make UNIX people's lives easier + 'eol-last': ERROR, + + // We like anonymous functions + 'func-names': IGNORE, + + // Prefer to define functions via variables + 'func-style': [WARN, 'declaration'], + + // Sometimes short names are appropriate + 'id-length': IGNORE, + + // Camel case handles this for us + 'id-match': IGNORE, + + // Use tabs and indent case blocks + 'indent': [ERROR, 'tab', { SwitchCase: WARN }], + + // Prefer double qoutes for JSX properties: , + 'jsx-quotes': [ERROR, 'prefer-double'], + + // Space after the colon + 'key-spacing': [ERROR, { + beforeColon: false, + afterColon: true + }], + + // Enforce unix line breaks + 'linebreak-style': [ERROR, 'unix'], + + // Enforce new lines before block comments + 'lines-around-comment': [ERROR, { beforeBlockComment: true, allowBlockStart: true }], + + // Disabled to ensure consistency with complexity option + 'max-depth': IGNORE, + + // We use soft wrap + 'max-len': IGNORE, + + // We are smart enough to know if this is bad or not + 'max-nested-callbacks': IGNORE, + + // Sometimes we have no control over this for compat reasons, so just warn + 'max-params': [WARN, MAX_PARAMS], + + // We should be able to use whatever feels right + 'max-statements': IGNORE, + + // Constructors should be CamelCase + 'new-cap': ERROR, + + // Always use parens when instantiating a class + 'new-parens': ERROR, + + // Too difficult to enforce correctly as too many edge-cases + 'newline-after-var': IGNORE, + + // Don't use the array constructor when it is not needed + 'no-array-constructor': ERROR, + + // We never use bitwise, they are too clever + 'no-bitwise': ERROR, + + // We use continue + 'no-continue': IGNORE, + + // We like inline comments + 'no-inline-comments': IGNORE, + + // The code could be optimised if this error occurs + 'no-lonely-if': ERROR, + + // Don't mix spaces and tabs + // @TODO maybe [ERROR, 'smart-tabs'] will be better, we will see + 'no-mixed-spaces-and-tabs': ERROR, + + // We use multiple empty lines for styling + 'no-multiple-empty-lines': IGNORE, + + // Sometimes it is more understandable with a negated condition + 'no-negated-condition': IGNORE, + + // Sometimes these are useful + 'no-nested-ternary': IGNORE, + + // Use {} instead of new Object() + 'no-new-object': ERROR, + + // We use plus plus + 'no-plusplus': IGNORE, + + // Handled by other rules + 'no-restricted-syntax': IGNORE, + + // We never use this, it seems silly to allow this + 'no-spaced-func': ERROR, + + // Sometimes ternaries are useful + 'no-ternary': IGNORE, + + // Disallow trailing spaces + 'no-trailing-spaces': ERROR, + + // Sometimes this is useful when avoiding shadowing + 'no-underscore-dangle': IGNORE, + + // Sensible + 'no-unneeded-ternary': ERROR, + + // Desirable, but too many edge cases it turns out where it is actually preferred + 'object-curly-spacing': IGNORE, // [ERROR, 'always'], + + // We like multiple var statements + 'one-var': IGNORE, + + // Force use of shorthands when available + 'operator-assignment': [ERROR, 'always'], + + // Should be before, but not with =, *=, /=, += lines + // @TODO figure out how to enforce + 'operator-linebreak': IGNORE, + + // This rule doesn't appear to work correclty + 'padded-blocks': IGNORE, + + // Seems like a good idea to error about this + 'quote-props': [ERROR, 'consistent-as-needed'], + + // Use single quotes where escaping isn't needed + 'quotes': [ERROR, 'single', 'avoid-escape'], + + // We use YUIdoc + 'require-jsdoc': IGNORE, + + // If semi's are used, then add spacing after + 'semi-spacing': [ERROR, { before: false, after: true }], + + // Never use semicolons + 'semi': [ERROR, 'never'], + + // We don't care if our vars are alphabetical + 'sort-vars': IGNORE, + + // Always force a space after a keyword + 'space-after-keywords': [ERROR, 'always'], + + // Always force a space before a { + 'space-before-blocks': [ERROR, 'always'], + + // function () {, get blah () { + 'space-before-function-paren': [ERROR, 'always'], + + // We do this + 'space-before-keywords': [ERROR, 'always'], + + // This is for spacing between [], so [ WARN, ERROR, 3 ] which we don't want + 'space-in-brackets': IGNORE, + + // This is for spacing between (), so doSomething( WARN, ERROR, 3 ) or if ( WARN === 3 ) + // which we want for ifs, but don't want for calls + 'space-in-parens': IGNORE, + + // We use this + 'space-infix-ops': ERROR, + + // We use this + 'space-return-throw-case': ERROR, + + // We use this + 'space-unary-ops': ERROR, + + // We use this + // 'spaced-line-comment': ERROR, + 'spaced-comment': ERROR, + + // We use this + // @TODO revise this + 'wrap-regex': ERROR, + + + // -------------------------------------- + // ECMAScript 6 + + // Sensible to create more informed and clear code + 'arrow-body-style': [ERROR, 'as-needed'], + + // We do this, no reason why, just what we do + 'arrow-parens': [ERROR, 'always'], + + // Require consistent spacing for arrow functions + 'arrow-spacing': ERROR, + + // Makes sense as otherwise runtime error will occur + 'constructor-super': ERROR, + + // Seems the most consistent location for it + 'generator-star-spacing': [ERROR, 'before'], + + // Seems sensible + 'no-arrow-condition': ERROR, + + // Seems sensible + 'no-class-assign': ERROR, + + // Makes sense as otherwise runtime error will occur + 'no-const-assign': ERROR, + + // Makes sense as otherwise runtime error will occur + 'no-dupe-class-members': ERROR, + + // Makes sense as otherwise runtime error will occur + 'no-this-before-super': ERROR, + + // @TODO This probably should be an error + // however it is useful for: for ( var key in obj ) { + // which hopefully is more performant than let (@TODO check if it actually is more performant) + 'no-var': WARN, + + // Enforce ES6 object shorthand + 'object-shorthand': ERROR, + + // Better performance when running native + // but horrible performance if not running native as could fallback to bind + // https://travis-ci.org/bevry/es6-benchmarks + 'prefer-arrow-callback': IGNORE, + + // Sure, why not + 'prefer-const': WARN, + + // Controversial change, but makes sense to move towards to reduce the risk of bad people overwriting apply and call + // https://github.com/eslint/eslint/issues/ERROR939 + 'prefer-reflect': WARN, + + // Sure, why not + 'prefer-spread': ERROR, + + // Too annoying to enforce + 'prefer-template': IGNORE, + + // Makes sense + 'require-yield': ERROR + } +} diff --git a/node_modules/domain-browser/.npmignore b/node_modules/domain-browser/.npmignore new file mode 100755 index 00000000..27859c14 --- /dev/null +++ b/node_modules/domain-browser/.npmignore @@ -0,0 +1,44 @@ +# 2015 September 18 +# https://github.com/bevry/base + +# Temp Files +**/.docpad.db +**/out.* +**/*.log +**/*.cpuprofile +**/*.heapsnapshot + +# Build Files +build/ +components/ +bower_components/ +node_modules/ + +# Private Files +.env + +# Development Files +.editorconfig +.eslintrc +.jshintrc +.jscrc +coffeelint.json +.travis* +nakefile.js +Cakefile +Makefile +BACKERS.md +CONTRIBUTING.md +HISTORY.md +**/src/ +**/test/ + +# Other Package Definitions +template.js +component.json +bower.json + +# ===================================== +# CUSTOM MODIFICATIONS + +# None diff --git a/node_modules/domain-browser/HISTORY.md b/node_modules/domain-browser/HISTORY.md new file mode 100755 index 00000000..758a44fc --- /dev/null +++ b/node_modules/domain-browser/HISTORY.md @@ -0,0 +1,42 @@ +# History + +## v1.1.7 2015 December 12 +- Revert minimum node version from 0.12 back to 0.4 + - Thanks to [Alexander Sorokin](https://github.com/syrnick) for [this comment](https://github.com/bevry/domain-browser/commit/c66ee3445e87955e70d0d60d4515f2d26a81b9c4#commitcomment-14938325) + +## v1.1.6 2015 December 12 +- Fixed `assert-helpers` sneaking into `dependencies` + - Thanks to [Bogdan Chadkin](https://github.com/TrySound) for [Pull Request #8](https://github.com/bevry/domain-browser/pull/8) + +## v1.1.5 2015 December 9 +- Updated internal conventions +- Added better jspm support + - Thanks to [Guy Bedford](https://github.com/guybedford) for [Pull Request #7](https://github.com/bevry/domain-browser/pull/7) + +## v1.1.4 2015 February 3 +- Added + - `domain.enter()` + - `domain.exit()` + - `domain.bind()` + - `domain.intercept()` + +## v1.1.3 2014 October 10 +- Added + - `domain.add()` + - `domain.remove()` + +## v1.1.2 2014 June 8 +- Added `domain.createDomain()` alias + - Thanks to [James Halliday](https://github.com/substack) for [Pull Request #1](https://github.com/bevry/domain-browser/pull/1) + +## v1.1.1 2013 December 27 +- Fixed `domain.create()` not returning anything + +## v1.1.0 2013 November 1 +- Dropped component.io and bower support, just use ender or browserify + +## v1.0.1 2013 September 18 +- Now called `domain-browser` everywhere + +## v1.0.0 2013 September 18 +- Initial release diff --git a/node_modules/domain-browser/LICENSE.md b/node_modules/domain-browser/LICENSE.md new file mode 100755 index 00000000..08d8802a --- /dev/null +++ b/node_modules/domain-browser/LICENSE.md @@ -0,0 +1,23 @@ + + +

License

+ +Unless stated otherwise all works are: + +
+ +and licensed under: + + + +

MIT License

+ +
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ + diff --git a/node_modules/domain-browser/README.md b/node_modules/domain-browser/README.md new file mode 100755 index 00000000..43502eff --- /dev/null +++ b/node_modules/domain-browser/README.md @@ -0,0 +1,111 @@ + + +

domain-browser

+ + + + + + +Travis CI Build Status +NPM version +NPM downloads +Dependency Status +Dev Dependency Status +
+Slack community badge +Patreon donate button +Gratipay donate button +Flattr donate button +PayPal donate button +Bitcoin donate button +Wishlist browse button + + + + + + +Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more. + + + + + + +

Install

+ +

NPM

    +
  • Install: npm install --save domain-browser
  • +
  • Use: require('domain-browser')
+ +

Browserify

    +
  • Install: npm install --save domain-browser
  • +
  • Use: require('domain-browser')
  • +
  • CDN URL: //wzrd.in/bundle/domain-browser@1.1.7
+ +

Ender

    +
  • Install: ender add domain-browser
  • +
  • Use: require('domain-browser')
+ + + + + + +

History

+ +Discover the release history by heading on over to the HISTORY.md file. + + + + + + +

Backers

+ +

Maintainers

+ +These amazing people are maintaining this project: + + + +

Sponsors

+ +No sponsors yet! Will you be the first? + +Patreon donate button +Gratipay donate button +Flattr donate button +PayPal donate button +Bitcoin donate button +Wishlist browse button + +

Contributors

+ +These amazing people have contributed code to this project: + + + +Discover how you can contribute by heading on over to the CONTRIBUTING.md file. + + + + + + +

License

+ +Unless stated otherwise all works are: + + + +and licensed under: + + + + diff --git a/node_modules/domain-browser/index.js b/node_modules/domain-browser/index.js new file mode 100755 index 00000000..f6cd7f7d --- /dev/null +++ b/node_modules/domain-browser/index.js @@ -0,0 +1,69 @@ +// This file should be ES5 compatible +/* eslint prefer-spread:0, no-var:0, prefer-reflect:0, no-magic-numbers:0 */ +'use strict' +module.exports = (function () { + // Import Events + var events = require('events') + + // Export Domain + var domain = {} + domain.createDomain = domain.create = function () { + var d = new events.EventEmitter() + + function emitError (e) { + d.emit('error', e) + } + + d.add = function (emitter) { + emitter.on('error', emitError) + } + d.remove = function (emitter) { + emitter.removeListener('error', emitError) + } + d.bind = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments) + try { + fn.apply(null, args) + } + catch (err) { + emitError(err) + } + } + } + d.intercept = function (fn) { + return function (err) { + if ( err ) { + emitError(err) + } + else { + var args = Array.prototype.slice.call(arguments, 1) + try { + fn.apply(null, args) + } + catch (err) { + emitError(err) + } + } + } + } + d.run = function (fn) { + try { + fn() + } + catch (err) { + emitError(err) + } + return this + } + d.dispose = function () { + this.removeAllListeners() + return this + } + d.enter = d.exit = function () { + return this + } + return d + } + return domain +}).call(this) diff --git a/node_modules/domain-browser/package.json b/node_modules/domain-browser/package.json new file mode 100755 index 00000000..b6783d02 --- /dev/null +++ b/node_modules/domain-browser/package.json @@ -0,0 +1,181 @@ +{ + "_args": [ + [ + { + "raw": "domain-browser@^1.1.1", + "scope": null, + "escapedName": "domain-browser", + "name": "domain-browser", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "domain-browser@>=1.1.1 <2.0.0", + "_id": "domain-browser@1.1.7", + "_inCache": true, + "_location": "/domain-browser", + "_nodeVersion": "5.2.0", + "_npmUser": { + "name": "balupton", + "email": "b@lupton.cc" + }, + "_npmVersion": "3.5.1", + "_phantomChildren": {}, + "_requested": { + "raw": "domain-browser@^1.1.1", + "scope": null, + "escapedName": "domain-browser", + "name": "domain-browser", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "_shasum": "867aa4b093faa05f1de08c06f4d7b21fdf8698bc", + "_shrinkwrap": null, + "_spec": "domain-browser@^1.1.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "2013+ Bevry Pty Ltd", + "email": "us@bevry.me", + "url": "http://bevry.me" + }, + "badges": { + "list": [ + "travisci", + "npmversion", + "npmdownloads", + "daviddm", + "daviddmdev", + "---", + "slackin", + "patreon", + "gratipay", + "flattr", + "paypal", + "bitcoin", + "wishlist" + ], + "config": { + "patreonUsername": "bevry", + "gratipayUsername": "bevry", + "flattrCode": "344188/balupton-on-Flattr", + "paypalButtonID": "QB8GQPZAH84N6", + "bitcoinURL": "https://bevry.me/bitcoin", + "wishlistURL": "https://bevry.me/wishlist", + "slackinURL": "https://slack.bevry.me" + } + }, + "browsers": true, + "bugs": { + "url": "https://github.com/bevry/domain-browser/issues" + }, + "contributors": [ + { + "name": "Benjamin Lupton", + "email": "b@lupton.cc", + "url": "http://balupton.com" + }, + { + "name": "Evan Solomon", + "url": "http://evansolomon.me" + }, + { + "name": "James Halliday", + "email": "substack@gmail.com", + "url": "http://substack.net/" + }, + { + "name": "Guy Bedford", + "email": "guybedford@gmail.com", + "url": "twitter.com/guybedford" + }, + { + "name": "Bogdan Chadkin", + "email": "trysound@yandex.ru", + "url": "https://github.com/TrySound" + } + ], + "dependencies": {}, + "description": "Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more.", + "devDependencies": { + "assert-helpers": "^4.1.0", + "eslint": "^1.10.3", + "joe": "^1.6.0", + "joe-reporter-console": "^1.2.1", + "projectz": "^1.0.8" + }, + "directories": {}, + "dist": { + "shasum": "867aa4b093faa05f1de08c06f4d7b21fdf8698bc", + "tarball": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz" + }, + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + }, + "gitHead": "9b7f0590a10569078b1b3b5c33f201f0a59d9822", + "homepage": "https://github.com/bevry/domain-browser", + "jspm": { + "map": { + "./index.js": { + "node": "@node/domain" + } + } + }, + "keywords": [ + "domain", + "trycatch", + "try", + "catch", + "node-compat", + "ender.js", + "component", + "component.io", + "umd", + "amd", + "require.js", + "browser" + ], + "license": "MIT", + "main": "./index.js", + "maintainers": [ + { + "name": "balupton", + "email": "b@lupton.cc" + }, + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "evansolomon", + "email": "evan@evanalyze.com" + } + ], + "name": "domain-browser", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/bevry/domain-browser.git" + }, + "scripts": { + "clean": "node --harmony nakefile.js clean", + "compile": "node --harmony nakefile.js compile", + "meta": "node --harmony nakefile.js meta", + "prepare": "node --harmony nakefile.js prepare", + "release": "node --harmony nakefile.js release", + "setup": "node --harmony nakefile.js setup", + "test": "node --harmony ./test.js", + "verify": "node --harmony nakefile.js verify", + "watch": "node --harmony nakefile.js watch" + }, + "version": "1.1.7" +} diff --git a/node_modules/domain-browser/test.js b/node_modules/domain-browser/test.js new file mode 100755 index 00000000..70efcfcf --- /dev/null +++ b/node_modules/domain-browser/test.js @@ -0,0 +1,100 @@ +/* eslint handle-callback-err:0, no-magic-numbers:0, no-unused-vars:0 */ +'use strict' + +// Import +const events = require('events') +const equal = require('assert-helpers').equal +const joe = require('joe') +const domain = require('./') + +// ===================================== +// Tests + +joe.describe('domain-browser', function (describe, it) { + it('should work on throws', function (done) { + const d = domain.create() + d.on('error', function (err) { + equal(err && err.message, 'a thrown error', 'error message') + done() + }) + d.run(function () { + throw new Error('a thrown error') + }) + }) + + it('should be able to add emitters', function (done) { + const d = domain.create() + const emitter = new events.EventEmitter() + + d.add(emitter) + d.on('error', function (err) { + equal(err && err.message, 'an emitted error', 'error message') + done() + }) + + emitter.emit('error', new Error('an emitted error')) + }) + + it('should be able to remove emitters', function (done) { + const emitter = new events.EventEmitter() + const d = domain.create() + let domainGotError = false + + d.add(emitter) + d.on('error', function (err) { + domainGotError = true + }) + + emitter.on('error', function (err) { + equal(err && err.message, 'This error should not go to the domain', 'error message') + + // Make sure nothing race condition-y is happening + setTimeout(function () { + equal(domainGotError, false, 'no domain error') + done() + }, 0) + }) + + d.remove(emitter) + emitter.emit('error', new Error('This error should not go to the domain')) + }) + + it('bind should work', function (done) { + const d = domain.create() + d.on('error', function (err) { + equal(err && err.message, 'a thrown error', 'error message') + done() + }) + d.bind(function (err, a, b) { + equal(err && err.message, 'a passed error', 'error message') + equal(a, 2, 'value of a') + equal(b, 3, 'value of b') + throw new Error('a thrown error') + })(new Error('a passed error'), 2, 3) + }) + + it('intercept should work', function (done) { + const d = domain.create() + let count = 0 + d.on('error', function (err) { + if ( count === 0 ) { + equal(err && err.message, 'a thrown error', 'error message') + } + else if ( count === 1 ) { + equal(err && err.message, 'a passed error', 'error message') + done() + } + count++ + }) + + d.intercept(function (a, b) { + equal(a, 2, 'value of a') + equal(b, 3, 'value of b') + throw new Error('a thrown error') + })(null, 2, 3) + + d.intercept(function (a, b) { + throw new Error('should never reach here') + })(new Error('a passed error'), 2, 3) + }) +}) diff --git a/node_modules/duplexify/.npmignore b/node_modules/duplexify/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/duplexify/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/duplexify/.travis.yml b/node_modules/duplexify/.travis.yml new file mode 100755 index 00000000..ecd4193f --- /dev/null +++ b/node_modules/duplexify/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4" + - "6" diff --git a/node_modules/duplexify/LICENSE b/node_modules/duplexify/LICENSE new file mode 100755 index 00000000..757562ec --- /dev/null +++ b/node_modules/duplexify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/duplexify/README.md b/node_modules/duplexify/README.md new file mode 100755 index 00000000..27669f6b --- /dev/null +++ b/node_modules/duplexify/README.md @@ -0,0 +1,97 @@ +# duplexify + +Turn a writeable and readable stream into a single streams2 duplex stream. + +Similar to [duplexer2](https://github.com/deoxxa/duplexer2) except it supports both streams2 and streams1 as input +and it allows you to set the readable and writable part asynchronously using `setReadable(stream)` and `setWritable(stream)` + +``` +npm install duplexify +``` + +[![build status](http://img.shields.io/travis/mafintosh/duplexify.svg?style=flat)](http://travis-ci.org/mafintosh/duplexify) + +## Usage + +Use `duplexify(writable, readable, streamOptions)` (or `duplexify.obj(writable, readable)` to create an object stream) + +``` js +var duplexify = require('duplexify') + +// turn writableStream and readableStream into a single duplex stream +var dup = duplexify(writableStream, readableStream) + +dup.write('hello world') // will write to writableStream +dup.on('data', function(data) { + // will read from readableStream +}) +``` + +You can also set the readable and writable parts asynchronously + +``` js +var dup = duplexify() + +dup.write('hello world') // write will buffer until the writable + // part has been set + +// wait a bit ... +dup.setReadable(readableStream) + +// maybe wait some more? +dup.setWritable(writableStream) +``` + +If you call `setReadable` or `setWritable` multiple times it will unregister the previous readable/writable stream. +To disable the readable or writable part call `setReadable` or `setWritable` with `null`. + +If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event. +You can also explictly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an +error object as argument, in which case the error is emitted as part of the `error` event. + +``` js +dup.on('error', function(err) { + console.log('readable or writable emitted an error - close will follow') +}) + +dup.on('close', function() { + console.log('the duplex stream is destroyed') +}) + +dup.destroy() // calls destroy on the readable and writable part (if present) +``` + +## HTTP request example + +Turn a node core http request into a duplex stream is as easy as + +``` js +var duplexify = require('duplexify') +var http = require('http') + +var request = function(opts) { + var req = http.request(opts) + var dup = duplexify(req) + req.on('response', function(res) { + dup.setReadable(res) + }) + return dup +} + +var req = request({ + method: 'GET', + host: 'www.google.com', + port: 80 +}) + +req.end() +req.pipe(process.stdout) +``` + +## License + +MIT + +## Related + +`duplexify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/duplexify/example.js b/node_modules/duplexify/example.js new file mode 100755 index 00000000..5585c197 --- /dev/null +++ b/node_modules/duplexify/example.js @@ -0,0 +1,21 @@ +var duplexify = require('duplexify') +var http = require('http') + +var request = function(opts) { + var req = http.request(opts) + var dup = duplexify() + dup.setWritable(req) + req.on('response', function(res) { + dup.setReadable(res) + }) + return dup +} + +var req = request({ + method: 'GET', + host: 'www.google.com', + port: 80 +}) + +req.end() +req.pipe(process.stdout) diff --git a/node_modules/duplexify/index.js b/node_modules/duplexify/index.js new file mode 100755 index 00000000..a04f124f --- /dev/null +++ b/node_modules/duplexify/index.js @@ -0,0 +1,228 @@ +var stream = require('readable-stream') +var eos = require('end-of-stream') +var inherits = require('inherits') +var shift = require('stream-shift') + +var SIGNAL_FLUSH = new Buffer([0]) + +var onuncork = function(self, fn) { + if (self._corked) self.once('uncork', fn) + else fn() +} + +var destroyer = function(self, end) { + return function(err) { + if (err) self.destroy(err.message === 'premature close' ? null : err) + else if (end && !self._ended) self.end() + } +} + +var end = function(ws, fn) { + if (!ws) return fn() + if (ws._writableState && ws._writableState.finished) return fn() + if (ws._writableState) return ws.end(fn) + ws.end() + fn() +} + +var toStreams2 = function(rs) { + return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) +} + +var Duplexify = function(writable, readable, opts) { + if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) + stream.Duplex.call(this, opts) + + this._writable = null + this._readable = null + this._readable2 = null + + this._forwardDestroy = !opts || opts.destroy !== false + this._forwardEnd = !opts || opts.end !== false + this._corked = 1 // start corked + this._ondrain = null + this._drained = false + this._forwarding = false + this._unwrite = null + this._unread = null + this._ended = false + + this.destroyed = false + + if (writable) this.setWritable(writable) + if (readable) this.setReadable(readable) +} + +inherits(Duplexify, stream.Duplex) + +Duplexify.obj = function(writable, readable, opts) { + if (!opts) opts = {} + opts.objectMode = true + opts.highWaterMark = 16 + return new Duplexify(writable, readable, opts) +} + +Duplexify.prototype.cork = function() { + if (++this._corked === 1) this.emit('cork') +} + +Duplexify.prototype.uncork = function() { + if (this._corked && --this._corked === 0) this.emit('uncork') +} + +Duplexify.prototype.setWritable = function(writable) { + if (this._unwrite) this._unwrite() + + if (this.destroyed) { + if (writable && writable.destroy) writable.destroy() + return + } + + if (writable === null || writable === false) { + this.end() + return + } + + var self = this + var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd)) + + var ondrain = function() { + var ondrain = self._ondrain + self._ondrain = null + if (ondrain) ondrain() + } + + var clear = function() { + self._writable.removeListener('drain', ondrain) + unend() + } + + if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks + + this._writable = writable + this._writable.on('drain', ondrain) + this._unwrite = clear + + this.uncork() // always uncork setWritable +} + +Duplexify.prototype.setReadable = function(readable) { + if (this._unread) this._unread() + + if (this.destroyed) { + if (readable && readable.destroy) readable.destroy() + return + } + + if (readable === null || readable === false) { + this.push(null) + this.resume() + return + } + + var self = this + var unend = eos(readable, {writable:false, readable:true}, destroyer(this)) + + var onreadable = function() { + self._forward() + } + + var onend = function() { + self.push(null) + } + + var clear = function() { + self._readable2.removeListener('readable', onreadable) + self._readable2.removeListener('end', onend) + unend() + } + + this._drained = true + this._readable = readable + this._readable2 = readable._readableState ? readable : toStreams2(readable) + this._readable2.on('readable', onreadable) + this._readable2.on('end', onend) + this._unread = clear + + this._forward() +} + +Duplexify.prototype._read = function() { + this._drained = true + this._forward() +} + +Duplexify.prototype._forward = function() { + if (this._forwarding || !this._readable2 || !this._drained) return + this._forwarding = true + + var data + + while (this._drained && (data = shift(this._readable2)) !== null) { + if (this.destroyed) continue + this._drained = this.push(data) + } + + this._forwarding = false +} + +Duplexify.prototype.destroy = function(err) { + if (this.destroyed) return + this.destroyed = true + + var self = this + process.nextTick(function() { + self._destroy(err) + }) +} + +Duplexify.prototype._destroy = function(err) { + if (err) { + var ondrain = this._ondrain + this._ondrain = null + if (ondrain) ondrain(err) + else this.emit('error', err) + } + + if (this._forwardDestroy) { + if (this._readable && this._readable.destroy) this._readable.destroy() + if (this._writable && this._writable.destroy) this._writable.destroy() + } + + this.emit('close') +} + +Duplexify.prototype._write = function(data, enc, cb) { + if (this.destroyed) return cb() + if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb)) + if (data === SIGNAL_FLUSH) return this._finish(cb) + if (!this._writable) return cb() + + if (this._writable.write(data) === false) this._ondrain = cb + else cb() +} + + +Duplexify.prototype._finish = function(cb) { + var self = this + this.emit('preend') + onuncork(this, function() { + end(self._forwardEnd && self._writable, function() { + // haxx to not emit prefinish twice + if (self._writableState.prefinished === false) self._writableState.prefinished = true + self.emit('prefinish') + onuncork(self, cb) + }) + }) +} + +Duplexify.prototype.end = function(data, enc, cb) { + if (typeof data === 'function') return this.end(null, null, data) + if (typeof enc === 'function') return this.end(data, null, enc) + this._ended = true + if (data) this.write(data) + if (!this._writableState.ending) this.write(SIGNAL_FLUSH) + return stream.Writable.prototype.end.call(this, cb) +} + +module.exports = Duplexify diff --git a/node_modules/duplexify/package.json b/node_modules/duplexify/package.json new file mode 100755 index 00000000..2f311b32 --- /dev/null +++ b/node_modules/duplexify/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "duplexify@^3.2.0", + "scope": null, + "escapedName": "duplexify", + "name": "duplexify", + "rawSpec": "^3.2.0", + "spec": ">=3.2.0 <4.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket" + ] + ], + "_from": "duplexify@>=3.2.0 <4.0.0", + "_id": "duplexify@3.5.0", + "_inCache": true, + "_location": "/duplexify", + "_nodeVersion": "4.6.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/duplexify-3.5.0.tgz_1477317448157_0.2257942291907966" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "duplexify@^3.2.0", + "scope": null, + "escapedName": "duplexify", + "name": "duplexify", + "rawSpec": "^3.2.0", + "spec": ">=3.2.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gasket", + "/pumpify" + ], + "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", + "_shasum": "1aa773002e1578457e9d9d4a50b0ccaaebcbd604", + "_shrinkwrap": null, + "_spec": "duplexify@^3.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/duplexify/issues" + }, + "dependencies": { + "end-of-stream": "1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input", + "devDependencies": { + "concat-stream": "^1.4.6", + "tape": "^2.13.3", + "through2": "^0.5.1" + }, + "directories": {}, + "dist": { + "shasum": "1aa773002e1578457e9d9d4a50b0ccaaebcbd604", + "tarball": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz" + }, + "gitHead": "97f525d36ce275e52435611d70b3a77a7234eaa1", + "homepage": "https://github.com/mafintosh/duplexify", + "keywords": [ + "duplex", + "streams2", + "streams", + "stream", + "writable", + "readable", + "async" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "duplexify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/duplexify.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "3.5.0" +} diff --git a/node_modules/duplexify/test.js b/node_modules/duplexify/test.js new file mode 100755 index 00000000..f4856d39 --- /dev/null +++ b/node_modules/duplexify/test.js @@ -0,0 +1,292 @@ +var tape = require('tape') +var through = require('through2') +var concat = require('concat-stream') +var net = require('net') +var duplexify = require('./') + +tape('passthrough', function(t) { + t.plan(2) + + var pt = through() + var dup = duplexify(pt, pt) + + dup.end('hello world') + dup.on('finish', function() { + t.ok(true, 'should finish') + }) + dup.pipe(concat(function(data) { + t.same(data.toString(), 'hello world', 'same in as out') + })) +}) + +tape('passthrough + double end', function(t) { + t.plan(2) + + var pt = through() + var dup = duplexify(pt, pt) + + dup.end('hello world') + dup.end() + + dup.on('finish', function() { + t.ok(true, 'should finish') + }) + dup.pipe(concat(function(data) { + t.same(data.toString(), 'hello world', 'same in as out') + })) +}) + +tape('async passthrough + end', function(t) { + t.plan(2) + + var pt = through.obj({highWaterMark:1}, function(data, enc, cb) { + setTimeout(function() { + cb(null, data) + }, 100) + }) + + var dup = duplexify(pt, pt) + + dup.write('hello ') + dup.write('world') + dup.end() + + dup.on('finish', function() { + t.ok(true, 'should finish') + }) + dup.pipe(concat(function(data) { + t.same(data.toString(), 'hello world', 'same in as out') + })) +}) + +tape('duplex', function(t) { + var readExpected = ['read-a', 'read-b', 'read-c'] + var writeExpected = ['write-a', 'write-b', 'write-c'] + + t.plan(readExpected.length+writeExpected.length+2) + + var readable = through.obj() + var writable = through.obj(function(data, enc, cb) { + t.same(data, writeExpected.shift(), 'onwrite should match') + cb() + }) + + var dup = duplexify.obj(writable, readable) + + readExpected.slice().forEach(function(data) { + readable.write(data) + }) + readable.end() + + writeExpected.slice().forEach(function(data) { + dup.write(data) + }) + dup.end() + + dup.on('data', function(data) { + t.same(data, readExpected.shift(), 'ondata should match') + }) + dup.on('end', function() { + t.ok(true, 'should end') + }) + dup.on('finish', function() { + t.ok(true, 'should finish') + }) +}) + +tape('async', function(t) { + var dup = duplexify() + var pt = through() + + dup.pipe(concat(function(data) { + t.same(data.toString(), 'i was async', 'same in as out') + t.end() + })) + + dup.write('i') + dup.write(' was ') + dup.end('async') + + setTimeout(function() { + dup.setWritable(pt) + setTimeout(function() { + dup.setReadable(pt) + }, 50) + }, 50) +}) + +tape('destroy', function(t) { + t.plan(2) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + write.destroy = function() { + t.ok(true, 'write destroyed') + } + + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + dup.destroy() + dup.destroy() // should only work once +}) + +tape('destroy both', function(t) { + t.plan(3) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + write.destroy = function() { + t.ok(true, 'write destroyed') + } + + read.destroy = function() { + t.ok(true, 'read destroyed') + } + + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + dup.destroy() + dup.destroy() // should only work once +}) + +tape('bubble read errors', function(t) { + t.plan(2) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + dup.on('error', function(err) { + t.same(err.message, 'read-error', 'received read error') + }) + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + read.emit('error', new Error('read-error')) + write.emit('error', new Error('write-error')) // only emit first error +}) + +tape('bubble write errors', function(t) { + t.plan(2) + + var write = through() + var read = through() + var dup = duplexify(write, read) + + dup.on('error', function(err) { + t.same(err.message, 'write-error', 'received write error') + }) + dup.on('close', function() { + t.ok(true, 'close emitted') + }) + + write.emit('error', new Error('write-error')) + read.emit('error', new Error('read-error')) // only emit first error +}) + +tape('reset writable / readable', function(t) { + t.plan(3) + + var toUpperCase = function(data, enc, cb) { + cb(null, data.toString().toUpperCase()) + } + + var passthrough = through() + var upper = through(toUpperCase) + var dup = duplexify(passthrough, passthrough) + + dup.once('data', function(data) { + t.same(data.toString(), 'hello') + dup.setWritable(upper) + dup.setReadable(upper) + dup.once('data', function(data) { + t.same(data.toString(), 'HELLO') + dup.once('data', function(data) { + t.same(data.toString(), 'HI') + t.end() + }) + }) + dup.write('hello') + dup.write('hi') + }) + dup.write('hello') +}) + +tape('cork', function(t) { + var passthrough = through() + var dup = duplexify(passthrough, passthrough) + var ok = false + + dup.on('prefinish', function() { + dup.cork() + setTimeout(function() { + ok = true + dup.uncork() + }, 100) + }) + dup.on('finish', function() { + t.ok(ok) + t.end() + }) + dup.end() +}) + +tape('prefinish not twice', function(t) { + var passthrough = through() + var dup = duplexify(passthrough, passthrough) + var prefinished = false + + dup.on('prefinish', function() { + t.ok(!prefinished, 'only prefinish once') + prefinished = true + }) + + dup.on('finish', function() { + t.end() + }) + + dup.end() +}) + +tape('close', function(t) { + var passthrough = through() + var dup = duplexify(passthrough, passthrough) + var ok = false + + passthrough.emit('close') + dup.on('close', function() { + t.ok(true, 'should forward close') + t.end() + }) +}) + +tape('works with node native streams (net)', function(t) { + t.plan(1) + + var server = net.createServer(function(socket) { + var dup = duplexify(socket, socket) + + dup.once('data', function(chunk) { + t.same(chunk, Buffer('hello world')) + server.close() + socket.end() + t.end() + }) + }) + + server.listen(0, function () { + var socket = net.connect(server.address().port) + var dup = duplexify(socket, socket) + + dup.write(Buffer('hello world')) + }) +}) diff --git a/node_modules/ee-first/LICENSE b/node_modules/ee-first/LICENSE new file mode 100755 index 00000000..a7ae8ee9 --- /dev/null +++ b/node_modules/ee-first/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ee-first/README.md b/node_modules/ee-first/README.md new file mode 100755 index 00000000..cbd2478b --- /dev/null +++ b/node_modules/ee-first/README.md @@ -0,0 +1,80 @@ +# EE First + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Get the first event in a set of event emitters and event pairs, +then clean up after itself. + +## Install + +```sh +$ npm install ee-first +``` + +## API + +```js +var first = require('ee-first') +``` + +### first(arr, listener) + +Invoke `listener` on the first event from the list specified in `arr`. `arr` is +an array of arrays, with each array in the format `[ee, ...event]`. `listener` +will be called only once, the first time any of the given events are emitted. If +`error` is one of the listened events, then if that fires first, the `listener` +will be given the `err` argument. + +The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the +first argument emitted from an `error` event, if applicable; `ee` is the event +emitter that fired; `event` is the string event name that fired; and `args` is an +array of the arguments that were emitted on the event. + +```js +var ee1 = new EventEmitter() +var ee2 = new EventEmitter() + +first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) +``` + +#### .cancel() + +The group of listeners can be cancelled before being invoked and have all the event +listeners removed from the underlying event emitters. + +```js +var thunk = first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) + +// cancel and clean up +thunk.cancel() +``` + +[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square +[npm-url]: https://npmjs.org/package/ee-first +[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square +[github-url]: https://github.com/jonathanong/ee-first/tags +[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square +[travis-url]: https://travis-ci.org/jonathanong/ee-first +[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master +[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/ee-first +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/ee-first/index.js b/node_modules/ee-first/index.js new file mode 100755 index 00000000..501287cd --- /dev/null +++ b/node_modules/ee-first/index.js @@ -0,0 +1,95 @@ +/*! + * ee-first + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = first + +/** + * Get the first event in a set of event emitters and event pairs. + * + * @param {array} stuff + * @param {function} done + * @public + */ + +function first(stuff, done) { + if (!Array.isArray(stuff)) + throw new TypeError('arg must be an array of [ee, events...] arrays') + + var cleanups = [] + + for (var i = 0; i < stuff.length; i++) { + var arr = stuff[i] + + if (!Array.isArray(arr) || arr.length < 2) + throw new TypeError('each array member must be [ee, events...]') + + var ee = arr[0] + + for (var j = 1; j < arr.length; j++) { + var event = arr[j] + var fn = listener(event, callback) + + // listen to the event + ee.on(event, fn) + // push this listener to the list of cleanups + cleanups.push({ + ee: ee, + event: event, + fn: fn, + }) + } + } + + function callback() { + cleanup() + done.apply(null, arguments) + } + + function cleanup() { + var x + for (var i = 0; i < cleanups.length; i++) { + x = cleanups[i] + x.ee.removeListener(x.event, x.fn) + } + } + + function thunk(fn) { + done = fn + } + + thunk.cancel = cleanup + + return thunk +} + +/** + * Create the event listener. + * @private + */ + +function listener(event, done) { + return function onevent(arg1) { + var args = new Array(arguments.length) + var ee = this + var err = event === 'error' + ? arg1 + : null + + // copy args to prevent arguments escaping scope + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + done(err, ee, event, args) + } +} diff --git a/node_modules/ee-first/package.json b/node_modules/ee-first/package.json new file mode 100755 index 00000000..e545f48a --- /dev/null +++ b/node_modules/ee-first/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "ee-first@1.1.1", + "scope": null, + "escapedName": "ee-first", + "name": "ee-first", + "rawSpec": "1.1.1", + "spec": "1.1.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/on-finished" + ] + ], + "_from": "ee-first@1.1.1", + "_id": "ee-first@1.1.1", + "_inCache": true, + "_location": "/ee-first", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "ee-first@1.1.1", + "scope": null, + "escapedName": "ee-first", + "name": "ee-first", + "rawSpec": "1.1.1", + "spec": "1.1.1", + "type": "version" + }, + "_requiredBy": [ + "/on-finished" + ], + "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "_shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d", + "_shrinkwrap": null, + "_spec": "ee-first@1.1.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/on-finished", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/jonathanong/ee-first/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "return the first event in a set of ee/event pairs", + "devDependencies": { + "istanbul": "0.3.9", + "mocha": "2.2.5" + }, + "directories": {}, + "dist": { + "shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d", + "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" + }, + "files": [ + "index.js", + "LICENSE" + ], + "gitHead": "512e0ce4cc3643f603708f965a97b61b1a9c0441", + "homepage": "https://github.com/jonathanong/ee-first", + "license": "MIT", + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "ee-first", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonathanong/ee-first.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.1.1" +} diff --git a/node_modules/emojis-list/CHANGELOG.md b/node_modules/emojis-list/CHANGELOG.md new file mode 100755 index 00000000..d81a55cb --- /dev/null +++ b/node_modules/emojis-list/CHANGELOG.md @@ -0,0 +1,70 @@ + +# 2.1.0 (2016-10-03) + +* Fetch new emoji ([7dbe84d](https://github.com/kikobeats/emojis-list/commit/7dbe84d)) + + + + +## 2.0.1 (2016-05-12) + +* Fix typo ([3808909](https://github.com/kikobeats/emojis-list/commit/3808909)) + + + + +# 2.0.0 (2016-05-12) + +* Add update script ([f846dd6](https://github.com/kikobeats/emojis-list/commit/f846dd6)) +* Block dependencies in last version ([1d9e0a5](https://github.com/kikobeats/emojis-list/commit/1d9e0a5)) +* Extract main file name ([9ffe7bb](https://github.com/kikobeats/emojis-list/commit/9ffe7bb)) +* Remove unnecessary files ([4c34729](https://github.com/kikobeats/emojis-list/commit/4c34729)) +* Update docs, special webpack setup is not necessary ([c4aefe9](https://github.com/kikobeats/emojis-list/commit/c4aefe9)) +* Update example ([1e2ae03](https://github.com/kikobeats/emojis-list/commit/1e2ae03)) +* Update how to generate emojis array ([b56bad9](https://github.com/kikobeats/emojis-list/commit/b56bad9)) +* Update main file based in the new interface ([996fccb](https://github.com/kikobeats/emojis-list/commit/996fccb)) + + + + +## 1.0.3 (2016-05-12) + +* Add standard as linter ([5e939d6](https://github.com/kikobeats/emojis-list/commit/5e939d6)) +* Change interface ([16bc0c0](https://github.com/kikobeats/emojis-list/commit/16bc0c0)) +* Generate emoji file ([fbcf8e9](https://github.com/kikobeats/emojis-list/commit/fbcf8e9)) +* Remove unnecessary special doc ([2b12bec](https://github.com/kikobeats/emojis-list/commit/2b12bec)) +* chore(package): update browserify to version 13.0.1 ([e2c98bf](https://github.com/kikobeats/emojis-list/commit/e2c98bf)) +* chore(package): update gulp-header to version 1.8.1 ([28de793](https://github.com/kikobeats/emojis-list/commit/28de793)) + + + + +## 1.0.2 (2016-05-05) + +* fixed #2 ([9a6abe7](https://github.com/kikobeats/emojis-list/commit/9a6abe7)), closes [#2](https://github.com/kikobeats/emojis-list/issues/2) +* Fomar using standard ([5202f9f](https://github.com/kikobeats/emojis-list/commit/5202f9f)) +* Update badge ([53fad9b](https://github.com/kikobeats/emojis-list/commit/53fad9b)) + + + + +## 1.0.1 (2016-04-13) + +* lock versions ([4a5d82e](https://github.com/kikobeats/emojis-list/commit/4a5d82e)) +* setup devDependencies ([d1de0fc](https://github.com/kikobeats/emojis-list/commit/d1de0fc)) +* update bumped ([9941038](https://github.com/kikobeats/emojis-list/commit/9941038)) +* Update package.json ([6c14b74](https://github.com/kikobeats/emojis-list/commit/6c14b74)) +* Update README.md ([1d9beeb](https://github.com/kikobeats/emojis-list/commit/1d9beeb)) +* Update README.md ([73f215e](https://github.com/kikobeats/emojis-list/commit/73f215e)) +* Update tests ([a94f7dc](https://github.com/kikobeats/emojis-list/commit/a94f7dc)) + + + + +# 1.0.0 (2015-05-12) + +* first commit ([a65b79d](https://github.com/kikobeats/emojis-list/commit/a65b79d)) +* updated ([9f0564c](https://github.com/kikobeats/emojis-list/commit/9f0564c)) + + + diff --git a/node_modules/emojis-list/LICENSE.md b/node_modules/emojis-list/LICENSE.md new file mode 100755 index 00000000..c0928aeb --- /dev/null +++ b/node_modules/emojis-list/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright © 2015 Kiko Beats + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/emojis-list/README.md b/node_modules/emojis-list/README.md new file mode 100755 index 00000000..1de02f9f --- /dev/null +++ b/node_modules/emojis-list/README.md @@ -0,0 +1,48 @@ +# emojis-list + +[![Dependency status](http://img.shields.io/david/Kikobeats/emojis-list.svg?style=flat-square)](https://david-dm.org/Kikobeats/emojis-list) +[![Dev Dependencies Status](http://img.shields.io/david/dev/Kikobeats/emojis-list.svg?style=flat-square)](https://david-dm.org/Kikobeats/emojis-list#info=devDependencies) +[![NPM Status](http://img.shields.io/npm/dm/emojis-list.svg?style=flat-square)](https://www.npmjs.org/package/emojis-list) +[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats) + +> Complete list of standard Unicode Hex Character Code that represent emojis. + +**NOTE**: The lists is related with the Unicode Hex Character Code. The representation of the emoji depend of the system. Will be possible that the system don't have all the representations. + +## Install + +```bash +npm install emojis-list --save +``` + +If you want to use in the browser (powered by [Browserify](http://browserify.org/)): + +```bash +bower install emojis-list --save +``` + +and later link in your HTML: + +```html + +``` + +## Usage + +``` +var emojis = require('emojis-list'); +console.log(emojis[0]); +// => 🀄 +``` + +## Related + +* [emojis-unicode](https://github.com/Kikobeats/emojis-unicode) – Complete list of standard Unicode codes that represent emojis. +* [emojis-keywords](https://github.com/Kikobeats/emojis-keywords) – Complete list of am emoji shortcuts. +* [is-emoji-keyword](https://github.com/Kikobeats/is-emoji-keyword) – Check if a word is a emoji shortcut. +* [is-standard-emoji](https://github.com/kikobeats/is-standard-emoji) – Simply way to check if a emoji is a standard emoji. +* [trim-emoji](https://github.com/Kikobeats/trim-emoji) – Deletes ':' from the begin and the end of an emoji shortcut. + +## License + +MIT © [Kiko Beats](http://www.kikobeats.com) diff --git a/node_modules/emojis-list/index.js b/node_modules/emojis-list/index.js new file mode 100755 index 00000000..d59beaba --- /dev/null +++ b/node_modules/emojis-list/index.js @@ -0,0 +1,2479 @@ +module.exports = [ + "🀄", + "🃏", + "🅰", + "🅱", + "🅾", + "🅿", + "🆎", + "🆑", + "🆒", + "🆓", + "🆔", + "🆕", + "🆖", + "🆗", + "🆘", + "🆙", + "🆚", + "🇦🇨", + "🇦🇩", + "🇦🇪", + "🇦🇫", + "🇦🇬", + "🇦🇮", + "🇦🇱", + "🇦🇲", + "🇦🇴", + "🇦🇶", + "🇦🇷", + "🇦🇸", + "🇦🇹", + "🇦🇺", + "🇦🇼", + "🇦🇽", + "🇦🇿", + "🇦", + "🇧🇦", + "🇧🇧", + "🇧🇩", + "🇧🇪", + "🇧🇫", + "🇧🇬", + "🇧🇭", + "🇧🇮", + "🇧🇯", + "🇧🇱", + "🇧🇲", + "🇧🇳", + "🇧🇴", + "🇧🇶", + "🇧🇷", + "🇧🇸", + "🇧🇹", + "🇧🇻", + "🇧🇼", + "🇧🇾", + "🇧🇿", + "🇧", + "🇨🇦", + "🇨🇨", + "🇨🇩", + "🇨🇫", + "🇨🇬", + "🇨🇭", + "🇨🇮", + "🇨🇰", + "🇨🇱", + "🇨🇲", + "🇨🇳", + "🇨🇴", + "🇨🇵", + "🇨🇷", + "🇨🇺", + "🇨🇻", + "🇨🇼", + "🇨🇽", + "🇨🇾", + "🇨🇿", + "🇨", + "🇩🇪", + "🇩🇬", + "🇩🇯", + "🇩🇰", + "🇩🇲", + "🇩🇴", + "🇩🇿", + "🇩", + "🇪🇦", + "🇪🇨", + "🇪🇪", + "🇪🇬", + "🇪🇭", + "🇪🇷", + "🇪🇸", + "🇪🇹", + "🇪🇺", + "🇪", + "🇫🇮", + "🇫🇯", + "🇫🇰", + "🇫🇲", + "🇫🇴", + "🇫🇷", + "🇫", + "🇬🇦", + "🇬🇧", + "🇬🇩", + "🇬🇪", + "🇬🇫", + "🇬🇬", + "🇬🇭", + "🇬🇮", + "🇬🇱", + "🇬🇲", + "🇬🇳", + "🇬🇵", + "🇬🇶", + "🇬🇷", + "🇬🇸", + "🇬🇹", + "🇬🇺", + "🇬🇼", + "🇬🇾", + "🇬", + "🇭🇰", + "🇭🇲", + "🇭🇳", + "🇭🇷", + "🇭🇹", + "🇭🇺", + "🇭", + "🇮🇨", + "🇮🇩", + "🇮🇪", + "🇮🇱", + "🇮🇲", + "🇮🇳", + "🇮🇴", + "🇮🇶", + "🇮🇷", + "🇮🇸", + "🇮🇹", + "🇮", + "🇯🇪", + "🇯🇲", + "🇯🇴", + "🇯🇵", + "🇯", + "🇰🇪", + "🇰🇬", + "🇰🇭", + "🇰🇮", + "🇰🇲", + "🇰🇳", + "🇰🇵", + "🇰🇷", + "🇰🇼", + "🇰🇾", + "🇰🇿", + "🇰", + "🇱🇦", + "🇱🇧", + "🇱🇨", + "🇱🇮", + "🇱🇰", + "🇱🇷", + "🇱🇸", + "🇱🇹", + "🇱🇺", + "🇱🇻", + "🇱🇾", + "🇱", + "🇲🇦", + "🇲🇨", + "🇲🇩", + "🇲🇪", + "🇲🇫", + "🇲🇬", + "🇲🇭", + "🇲🇰", + "🇲🇱", + "🇲🇲", + "🇲🇳", + "🇲🇴", + "🇲🇵", + "🇲🇶", + "🇲🇷", + "🇲🇸", + "🇲🇹", + "🇲🇺", + "🇲🇻", + "🇲🇼", + "🇲🇽", + "🇲🇾", + "🇲🇿", + "🇲", + "🇳🇦", + "🇳🇨", + "🇳🇪", + "🇳🇫", + "🇳🇬", + "🇳🇮", + "🇳🇱", + "🇳🇴", + "🇳🇵", + "🇳🇷", + "🇳🇺", + "🇳🇿", + "🇳", + "🇴🇲", + "🇴", + "🇵🇦", + "🇵🇪", + "🇵🇫", + "🇵🇬", + "🇵🇭", + "🇵🇰", + "🇵🇱", + "🇵🇲", + "🇵🇳", + "🇵🇷", + "🇵🇸", + "🇵🇹", + "🇵🇼", + "🇵🇾", + "🇵", + "🇶🇦", + "🇶", + "🇷🇪", + "🇷🇴", + "🇷🇸", + "🇷🇺", + "🇷🇼", + "🇷", + "🇸🇦", + "🇸🇧", + "🇸🇨", + "🇸🇩", + "🇸🇪", + "🇸🇬", + "🇸🇭", + "🇸🇮", + "🇸🇯", + "🇸🇰", + "🇸🇱", + "🇸🇲", + "🇸🇳", + "🇸🇴", + "🇸🇷", + "🇸🇸", + "🇸🇹", + "🇸🇻", + "🇸🇽", + "🇸🇾", + "🇸🇿", + "🇸", + "🇹🇦", + "🇹🇨", + "🇹🇩", + "🇹🇫", + "🇹🇬", + "🇹🇭", + "🇹🇯", + "🇹🇰", + "🇹🇱", + "🇹🇲", + "🇹🇳", + "🇹🇴", + "🇹🇷", + "🇹🇹", + "🇹🇻", + "🇹🇼", + "🇹🇿", + "🇹", + "🇺🇦", + "🇺🇬", + "🇺🇲", + "🇺🇳", + "🇺🇸", + "🇺🇾", + "🇺🇿", + "🇺", + "🇻🇦", + "🇻🇨", + "🇻🇪", + "🇻🇬", + "🇻🇮", + "🇻🇳", + "🇻🇺", + "🇻", + "🇼🇫", + "🇼🇸", + "🇼", + "🇽🇰", + "🇽", + "🇾🇪", + "🇾🇹", + "🇾", + "🇿🇦", + "🇿🇲", + "🇿🇼", + "🇿", + "🈁", + "🈂", + "🈚", + "🈯", + "🈲", + "🈳", + "🈴", + "🈵", + "🈶", + "🈷", + "🈸", + "🈹", + "🈺", + "🉐", + "🉑", + "🌀", + "🌁", + "🌂", + "🌃", + "🌄", + "🌅", + "🌆", + "🌇", + "🌈", + "🌉", + "🌊", + "🌋", + "🌌", + "🌍", + "🌎", + "🌏", + "🌐", + "🌑", + "🌒", + "🌓", + "🌔", + "🌕", + "🌖", + "🌗", + "🌘", + "🌙", + "🌚", + "🌛", + "🌜", + "🌝", + "🌞", + "🌟", + "🌠", + "🌡", + "🌤", + "🌥", + "🌦", + "🌧", + "🌨", + "🌩", + "🌪", + "🌫", + "🌬", + "🌭", + "🌮", + "🌯", + "🌰", + "🌱", + "🌲", + "🌳", + "🌴", + "🌵", + "🌶", + "🌷", + "🌸", + "🌹", + "🌺", + "🌻", + "🌼", + "🌽", + "🌾", + "🌿", + "🍀", + "🍁", + "🍂", + "🍃", + "🍄", + "🍅", + "🍆", + "🍇", + "🍈", + "🍉", + "🍊", + "🍋", + "🍌", + "🍍", + "🍎", + "🍏", + "🍐", + "🍑", + "🍒", + "🍓", + "🍔", + "🍕", + "🍖", + "🍗", + "🍘", + "🍙", + "🍚", + "🍛", + "🍜", + "🍝", + "🍞", + "🍟", + "🍠", + "🍡", + "🍢", + "🍣", + "🍤", + "🍥", + "🍦", + "🍧", + "🍨", + "🍩", + "🍪", + "🍫", + "🍬", + "🍭", + "🍮", + "🍯", + "🍰", + "🍱", + "🍲", + "🍳", + "🍴", + "🍵", + "🍶", + "🍷", + "🍸", + "🍹", + "🍺", + "🍻", + "🍼", + "🍽", + "🍾", + "🍿", + "🎀", + "🎁", + "🎂", + "🎃", + "🎄", + "🎅🏻", + "🎅🏼", + "🎅🏽", + "🎅🏾", + "🎅🏿", + "🎅", + "🎆", + "🎇", + "🎈", + "🎉", + "🎊", + "🎋", + "🎌", + "🎍", + "🎎", + "🎏", + "🎐", + "🎑", + "🎒", + "🎓", + "🎖", + "🎗", + "🎙", + "🎚", + "🎛", + "🎞", + "🎟", + "🎠", + "🎡", + "🎢", + "🎣", + "🎤", + "🎥", + "🎦", + "🎧", + "🎨", + "🎩", + "🎪", + "🎫", + "🎬", + "🎭", + "🎮", + "🎯", + "🎰", + "🎱", + "🎲", + "🎳", + "🎴", + "🎵", + "🎶", + "🎷", + "🎸", + "🎹", + "🎺", + "🎻", + "🎼", + "🎽", + "🎾", + "🎿", + "🏀", + "🏁", + "🏂🏻", + "🏂🏼", + "🏂🏽", + "🏂🏾", + "🏂🏿", + "🏂", + "🏃🏻‍♀️", + "🏃🏻‍♂️", + "🏃🏻", + "🏃🏼‍♀️", + "🏃🏼‍♂️", + "🏃🏼", + "🏃🏽‍♀️", + "🏃🏽‍♂️", + "🏃🏽", + "🏃🏾‍♀️", + "🏃🏾‍♂️", + "🏃🏾", + "🏃🏿‍♀️", + "🏃🏿‍♂️", + "🏃🏿", + "🏃‍♀️", + "🏃‍♂️", + "🏃", + "🏄🏻‍♀️", + "🏄🏻‍♂️", + "🏄🏻", + "🏄🏼‍♀️", + "🏄🏼‍♂️", + "🏄🏼", + "🏄🏽‍♀️", + "🏄🏽‍♂️", + "🏄🏽", + "🏄🏾‍♀️", + "🏄🏾‍♂️", + "🏄🏾", + "🏄🏿‍♀️", + "🏄🏿‍♂️", + "🏄🏿", + "🏄‍♀️", + "🏄‍♂️", + "🏄", + "🏅", + "🏆", + "🏇🏻", + "🏇🏼", + "🏇🏽", + "🏇🏾", + "🏇🏿", + "🏇", + "🏈", + "🏉", + "🏊🏻‍♀️", + "🏊🏻‍♂️", + "🏊🏻", + "🏊🏼‍♀️", + "🏊🏼‍♂️", + "🏊🏼", + "🏊🏽‍♀️", + "🏊🏽‍♂️", + "🏊🏽", + "🏊🏾‍♀️", + "🏊🏾‍♂️", + "🏊🏾", + "🏊🏿‍♀️", + "🏊🏿‍♂️", + "🏊🏿", + "🏊‍♀️", + "🏊‍♂️", + "🏊", + "🏋🏻‍♀️", + "🏋🏻‍♂️", + "🏋🏻", + "🏋🏼‍♀️", + "🏋🏼‍♂️", + "🏋🏼", + "🏋🏽‍♀️", + "🏋🏽‍♂️", + "🏋🏽", + "🏋🏾‍♀️", + "🏋🏾‍♂️", + "🏋🏾", + "🏋🏿‍♀️", + "🏋🏿‍♂️", + "🏋🏿", + "🏋️‍♀️", + "🏋️‍♂️", + "🏋", + "🏌🏻‍♀️", + "🏌🏻‍♂️", + "🏌🏻", + "🏌🏼‍♀️", + "🏌🏼‍♂️", + "🏌🏼", + "🏌🏽‍♀️", + "🏌🏽‍♂️", + "🏌🏽", + "🏌🏾‍♀️", + "🏌🏾‍♂️", + "🏌🏾", + "🏌🏿‍♀️", + "🏌🏿‍♂️", + "🏌🏿", + "🏌️‍♀️", + "🏌️‍♂️", + "🏌", + "🏍", + "🏎", + "🏏", + "🏐", + "🏑", + "🏒", + "🏓", + "🏔", + "🏕", + "🏖", + "🏗", + "🏘", + "🏙", + "🏚", + "🏛", + "🏜", + "🏝", + "🏞", + "🏟", + "🏠", + "🏡", + "🏢", + "🏣", + "🏤", + "🏥", + "🏦", + "🏧", + "🏨", + "🏩", + "🏪", + "🏫", + "🏬", + "🏭", + "🏮", + "🏯", + "🏰", + "🏳️‍🌈", + "🏳", + "🏴‍☠️", + "🏴", + "🏵", + "🏷", + "🏸", + "🏹", + "🏺", + "🏻", + "🏼", + "🏽", + "🏾", + "🏿", + "🐀", + "🐁", + "🐂", + "🐃", + "🐄", + "🐅", + "🐆", + "🐇", + "🐈", + "🐉", + "🐊", + "🐋", + "🐌", + "🐍", + "🐎", + "🐏", + "🐐", + "🐑", + "🐒", + "🐓", + "🐔", + "🐕", + "🐖", + "🐗", + "🐘", + "🐙", + "🐚", + "🐛", + "🐜", + "🐝", + "🐞", + "🐟", + "🐠", + "🐡", + "🐢", + "🐣", + "🐤", + "🐥", + "🐦", + "🐧", + "🐨", + "🐩", + "🐪", + "🐫", + "🐬", + "🐭", + "🐮", + "🐯", + "🐰", + "🐱", + "🐲", + "🐳", + "🐴", + "🐵", + "🐶", + "🐷", + "🐸", + "🐹", + "🐺", + "🐻", + "🐼", + "🐽", + "🐾", + "🐿", + "👀", + "👁‍🗨", + "👁", + "👂🏻", + "👂🏼", + "👂🏽", + "👂🏾", + "👂🏿", + "👂", + "👃🏻", + "👃🏼", + "👃🏽", + "👃🏾", + "👃🏿", + "👃", + "👄", + "👅", + "👆🏻", + "👆🏼", + "👆🏽", + "👆🏾", + "👆🏿", + "👆", + "👇🏻", + "👇🏼", + "👇🏽", + "👇🏾", + "👇🏿", + "👇", + "👈🏻", + "👈🏼", + "👈🏽", + "👈🏾", + "👈🏿", + "👈", + "👉🏻", + "👉🏼", + "👉🏽", + "👉🏾", + "👉🏿", + "👉", + "👊🏻", + "👊🏼", + "👊🏽", + "👊🏾", + "👊🏿", + "👊", + "👋🏻", + "👋🏼", + "👋🏽", + "👋🏾", + "👋🏿", + "👋", + "👌🏻", + "👌🏼", + "👌🏽", + "👌🏾", + "👌🏿", + "👌", + "👍🏻", + "👍🏼", + "👍🏽", + "👍🏾", + "👍🏿", + "👍", + "👎🏻", + "👎🏼", + "👎🏽", + "👎🏾", + "👎🏿", + "👎", + "👏🏻", + "👏🏼", + "👏🏽", + "👏🏾", + "👏🏿", + "👏", + "👐🏻", + "👐🏼", + "👐🏽", + "👐🏾", + "👐🏿", + "👐", + "👑", + "👒", + "👓", + "👔", + "👕", + "👖", + "👗", + "👘", + "👙", + "👚", + "👛", + "👜", + "👝", + "👞", + "👟", + "👠", + "👡", + "👢", + "👣", + "👤", + "👥", + "👦🏻", + "👦🏼", + "👦🏽", + "👦🏾", + "👦🏿", + "👦", + "👧🏻", + "👧🏼", + "👧🏽", + "👧🏾", + "👧🏿", + "👧", + "👨🏻‍🌾", + "👨🏻‍🍳", + "👨🏻‍🎓", + "👨🏻‍🎤", + "👨🏻‍🎨", + "👨🏻‍🏫", + "👨🏻‍🏭", + "👨🏻‍💻", + "👨🏻‍💼", + "👨🏻‍🔧", + "👨🏻‍🔬", + "👨🏻‍🚀", + "👨🏻‍🚒", + "👨🏻‍⚕️", + "👨🏻‍⚖️", + "👨🏻‍✈️", + "👨🏻", + "👨🏼‍🌾", + "👨🏼‍🍳", + "👨🏼‍🎓", + "👨🏼‍🎤", + "👨🏼‍🎨", + "👨🏼‍🏫", + "👨🏼‍🏭", + "👨🏼‍💻", + "👨🏼‍💼", + "👨🏼‍🔧", + "👨🏼‍🔬", + "👨🏼‍🚀", + "👨🏼‍🚒", + "👨🏼‍⚕️", + "👨🏼‍⚖️", + "👨🏼‍✈️", + "👨🏼", + "👨🏽‍🌾", + "👨🏽‍🍳", + "👨🏽‍🎓", + "👨🏽‍🎤", + "👨🏽‍🎨", + "👨🏽‍🏫", + "👨🏽‍🏭", + "👨🏽‍💻", + "👨🏽‍💼", + "👨🏽‍🔧", + "👨🏽‍🔬", + "👨🏽‍🚀", + "👨🏽‍🚒", + "👨🏽‍⚕️", + "👨🏽‍⚖️", + "👨🏽‍✈️", + "👨🏽", + "👨🏾‍🌾", + "👨🏾‍🍳", + "👨🏾‍🎓", + "👨🏾‍🎤", + "👨🏾‍🎨", + "👨🏾‍🏫", + "👨🏾‍🏭", + "👨🏾‍💻", + "👨🏾‍💼", + "👨🏾‍🔧", + "👨🏾‍🔬", + "👨🏾‍🚀", + "👨🏾‍🚒", + "👨🏾‍⚕️", + "👨🏾‍⚖️", + "👨🏾‍✈️", + "👨🏾", + "👨🏿‍🌾", + "👨🏿‍🍳", + "👨🏿‍🎓", + "👨🏿‍🎤", + "👨🏿‍🎨", + "👨🏿‍🏫", + "👨🏿‍🏭", + "👨🏿‍💻", + "👨🏿‍💼", + "👨🏿‍🔧", + "👨🏿‍🔬", + "👨🏿‍🚀", + "👨🏿‍🚒", + "👨🏿‍⚕️", + "👨🏿‍⚖️", + "👨🏿‍✈️", + "👨🏿", + "👨‍🌾", + "👨‍🍳", + "👨‍🎓", + "👨‍🎤", + "👨‍🎨", + "👨‍🏫", + "👨‍🏭", + "👨‍👦‍👦", + "👨‍👦", + "👨‍👧‍👦", + "👨‍👧‍👧", + "👨‍👧", + "👨‍👨‍👦‍👦", + "👨‍👨‍👦", + "👨‍👨‍👧‍👦", + "👨‍👨‍👧‍👧", + "👨‍👨‍👧", + "👨‍👩‍👦‍👦", + "👨‍👩‍👦", + "👨‍👩‍👧‍👦", + "👨‍👩‍👧‍👧", + "👨‍👩‍👧", + "👨‍💻", + "👨‍💼", + "👨‍🔧", + "👨‍🔬", + "👨‍🚀", + "👨‍🚒", + "👨‍⚕️", + "👨‍⚖️", + "👨‍✈️", + "👨‍❤️‍👨", + "👨‍❤️‍💋‍👨", + "👨", + "👩🏻‍🌾", + "👩🏻‍🍳", + "👩🏻‍🎓", + "👩🏻‍🎤", + "👩🏻‍🎨", + "👩🏻‍🏫", + "👩🏻‍🏭", + "👩🏻‍💻", + "👩🏻‍💼", + "👩🏻‍🔧", + "👩🏻‍🔬", + "👩🏻‍🚀", + "👩🏻‍🚒", + "👩🏻‍⚕️", + "👩🏻‍⚖️", + "👩🏻‍✈️", + "👩🏻", + "👩🏼‍🌾", + "👩🏼‍🍳", + "👩🏼‍🎓", + "👩🏼‍🎤", + "👩🏼‍🎨", + "👩🏼‍🏫", + "👩🏼‍🏭", + "👩🏼‍💻", + "👩🏼‍💼", + "👩🏼‍🔧", + "👩🏼‍🔬", + "👩🏼‍🚀", + "👩🏼‍🚒", + "👩🏼‍⚕️", + "👩🏼‍⚖️", + "👩🏼‍✈️", + "👩🏼", + "👩🏽‍🌾", + "👩🏽‍🍳", + "👩🏽‍🎓", + "👩🏽‍🎤", + "👩🏽‍🎨", + "👩🏽‍🏫", + "👩🏽‍🏭", + "👩🏽‍💻", + "👩🏽‍💼", + "👩🏽‍🔧", + "👩🏽‍🔬", + "👩🏽‍🚀", + "👩🏽‍🚒", + "👩🏽‍⚕️", + "👩🏽‍⚖️", + "👩🏽‍✈️", + "👩🏽", + "👩🏾‍🌾", + "👩🏾‍🍳", + "👩🏾‍🎓", + "👩🏾‍🎤", + "👩🏾‍🎨", + "👩🏾‍🏫", + "👩🏾‍🏭", + "👩🏾‍💻", + "👩🏾‍💼", + "👩🏾‍🔧", + "👩🏾‍🔬", + "👩🏾‍🚀", + "👩🏾‍🚒", + "👩🏾‍⚕️", + "👩🏾‍⚖️", + "👩🏾‍✈️", + "👩🏾", + "👩🏿‍🌾", + "👩🏿‍🍳", + "👩🏿‍🎓", + "👩🏿‍🎤", + "👩🏿‍🎨", + "👩🏿‍🏫", + "👩🏿‍🏭", + "👩🏿‍💻", + "👩🏿‍💼", + "👩🏿‍🔧", + "👩🏿‍🔬", + "👩🏿‍🚀", + "👩🏿‍🚒", + "👩🏿‍⚕️", + "👩🏿‍⚖️", + "👩🏿‍✈️", + "👩🏿", + "👩‍🌾", + "👩‍🍳", + "👩‍🎓", + "👩‍🎤", + "👩‍🎨", + "👩‍🏫", + "👩‍🏭", + "👩‍👦‍👦", + "👩‍👦", + "👩‍👧‍👦", + "👩‍👧‍👧", + "👩‍👧", + "👩‍👩‍👦‍👦", + "👩‍👩‍👦", + "👩‍👩‍👧‍👦", + "👩‍👩‍👧‍👧", + "👩‍👩‍👧", + "👩‍💻", + "👩‍💼", + "👩‍🔧", + "👩‍🔬", + "👩‍🚀", + "👩‍🚒", + "👩‍⚕️", + "👩‍⚖️", + "👩‍✈️", + "👩‍❤️‍👨", + "👩‍❤️‍👩", + "👩‍❤️‍💋‍👨", + "👩‍❤️‍💋‍👩", + "👩", + "👪🏻", + "👪🏼", + "👪🏽", + "👪🏾", + "👪🏿", + "👪", + "👫🏻", + "👫🏼", + "👫🏽", + "👫🏾", + "👫🏿", + "👫", + "👬🏻", + "👬🏼", + "👬🏽", + "👬🏾", + "👬🏿", + "👬", + "👭🏻", + "👭🏼", + "👭🏽", + "👭🏾", + "👭🏿", + "👭", + "👮🏻‍♀️", + "👮🏻‍♂️", + "👮🏻", + "👮🏼‍♀️", + "👮🏼‍♂️", + "👮🏼", + "👮🏽‍♀️", + "👮🏽‍♂️", + "👮🏽", + "👮🏾‍♀️", + "👮🏾‍♂️", + "👮🏾", + "👮🏿‍♀️", + "👮🏿‍♂️", + "👮🏿", + "👮‍♀️", + "👮‍♂️", + "👮", + "👯🏻‍♀️", + "👯🏻‍♂️", + "👯🏻", + "👯🏼‍♀️", + "👯🏼‍♂️", + "👯🏼", + "👯🏽‍♀️", + "👯🏽‍♂️", + "👯🏽", + "👯🏾‍♀️", + "👯🏾‍♂️", + "👯🏾", + "👯🏿‍♀️", + "👯🏿‍♂️", + "👯🏿", + "👯‍♀️", + "👯‍♂️", + "👯", + "👰🏻", + "👰🏼", + "👰🏽", + "👰🏾", + "👰🏿", + "👰", + "👱🏻‍♀️", + "👱🏻‍♂️", + "👱🏻", + "👱🏼‍♀️", + "👱🏼‍♂️", + "👱🏼", + "👱🏽‍♀️", + "👱🏽‍♂️", + "👱🏽", + "👱🏾‍♀️", + "👱🏾‍♂️", + "👱🏾", + "👱🏿‍♀️", + "👱🏿‍♂️", + "👱🏿", + "👱‍♀️", + "👱‍♂️", + "👱", + "👲🏻", + "👲🏼", + "👲🏽", + "👲🏾", + "👲🏿", + "👲", + "👳🏻‍♀️", + "👳🏻‍♂️", + "👳🏻", + "👳🏼‍♀️", + "👳🏼‍♂️", + "👳🏼", + "👳🏽‍♀️", + "👳🏽‍♂️", + "👳🏽", + "👳🏾‍♀️", + "👳🏾‍♂️", + "👳🏾", + "👳🏿‍♀️", + "👳🏿‍♂️", + "👳🏿", + "👳‍♀️", + "👳‍♂️", + "👳", + "👴🏻", + "👴🏼", + "👴🏽", + "👴🏾", + "👴🏿", + "👴", + "👵🏻", + "👵🏼", + "👵🏽", + "👵🏾", + "👵🏿", + "👵", + "👶🏻", + "👶🏼", + "👶🏽", + "👶🏾", + "👶🏿", + "👶", + "👷🏻‍♀️", + "👷🏻‍♂️", + "👷🏻", + "👷🏼‍♀️", + "👷🏼‍♂️", + "👷🏼", + "👷🏽‍♀️", + "👷🏽‍♂️", + "👷🏽", + "👷🏾‍♀️", + "👷🏾‍♂️", + "👷🏾", + "👷🏿‍♀️", + "👷🏿‍♂️", + "👷🏿", + "👷‍♀️", + "👷‍♂️", + "👷", + "👸🏻", + "👸🏼", + "👸🏽", + "👸🏾", + "👸🏿", + "👸", + "👹", + "👺", + "👻", + "👼🏻", + "👼🏼", + "👼🏽", + "👼🏾", + "👼🏿", + "👼", + "👽", + "👾", + "👿", + "💀", + "💁🏻‍♀️", + "💁🏻‍♂️", + "💁🏻", + "💁🏼‍♀️", + "💁🏼‍♂️", + "💁🏼", + "💁🏽‍♀️", + "💁🏽‍♂️", + "💁🏽", + "💁🏾‍♀️", + "💁🏾‍♂️", + "💁🏾", + "💁🏿‍♀️", + "💁🏿‍♂️", + "💁🏿", + "💁‍♀️", + "💁‍♂️", + "💁", + "💂🏻‍♀️", + "💂🏻‍♂️", + "💂🏻", + "💂🏼‍♀️", + "💂🏼‍♂️", + "💂🏼", + "💂🏽‍♀️", + "💂🏽‍♂️", + "💂🏽", + "💂🏾‍♀️", + "💂🏾‍♂️", + "💂🏾", + "💂🏿‍♀️", + "💂🏿‍♂️", + "💂🏿", + "💂‍♀️", + "💂‍♂️", + "💂", + "💃🏻", + "💃🏼", + "💃🏽", + "💃🏾", + "💃🏿", + "💃", + "💄", + "💅🏻", + "💅🏼", + "💅🏽", + "💅🏾", + "💅🏿", + "💅", + "💆🏻‍♀️", + "💆🏻‍♂️", + "💆🏻", + "💆🏼‍♀️", + "💆🏼‍♂️", + "💆🏼", + "💆🏽‍♀️", + "💆🏽‍♂️", + "💆🏽", + "💆🏾‍♀️", + "💆🏾‍♂️", + "💆🏾", + "💆🏿‍♀️", + "💆🏿‍♂️", + "💆🏿", + "💆‍♀️", + "💆‍♂️", + "💆", + "💇🏻‍♀️", + "💇🏻‍♂️", + "💇🏻", + "💇🏼‍♀️", + "💇🏼‍♂️", + "💇🏼", + "💇🏽‍♀️", + "💇🏽‍♂️", + "💇🏽", + "💇🏾‍♀️", + "💇🏾‍♂️", + "💇🏾", + "💇🏿‍♀️", + "💇🏿‍♂️", + "💇🏿", + "💇‍♀️", + "💇‍♂️", + "💇", + "💈", + "💉", + "💊", + "💋", + "💌", + "💍", + "💎", + "💏", + "💐", + "💑", + "💒", + "💓", + "💔", + "💕", + "💖", + "💗", + "💘", + "💙", + "💚", + "💛", + "💜", + "💝", + "💞", + "💟", + "💠", + "💡", + "💢", + "💣", + "💤", + "💥", + "💦", + "💧", + "💨", + "💩", + "💪🏻", + "💪🏼", + "💪🏽", + "💪🏾", + "💪🏿", + "💪", + "💫", + "💬", + "💭", + "💮", + "💯", + "💰", + "💱", + "💲", + "💳", + "💴", + "💵", + "💶", + "💷", + "💸", + "💹", + "💺", + "💻", + "💼", + "💽", + "💾", + "💿", + "📀", + "📁", + "📂", + "📃", + "📄", + "📅", + "📆", + "📇", + "📈", + "📉", + "📊", + "📋", + "📌", + "📍", + "📎", + "📏", + "📐", + "📑", + "📒", + "📓", + "📔", + "📕", + "📖", + "📗", + "📘", + "📙", + "📚", + "📛", + "📜", + "📝", + "📞", + "📟", + "📠", + "📡", + "📢", + "📣", + "📤", + "📥", + "📦", + "📧", + "📨", + "📩", + "📪", + "📫", + "📬", + "📭", + "📮", + "📯", + "📰", + "📱", + "📲", + "📳", + "📴", + "📵", + "📶", + "📷", + "📸", + "📹", + "📺", + "📻", + "📼", + "📽", + "📿", + "🔀", + "🔁", + "🔂", + "🔃", + "🔄", + "🔅", + "🔆", + "🔇", + "🔈", + "🔉", + "🔊", + "🔋", + "🔌", + "🔍", + "🔎", + "🔏", + "🔐", + "🔑", + "🔒", + "🔓", + "🔔", + "🔕", + "🔖", + "🔗", + "🔘", + "🔙", + "🔚", + "🔛", + "🔜", + "🔝", + "🔞", + "🔟", + "🔠", + "🔡", + "🔢", + "🔣", + "🔤", + "🔥", + "🔦", + "🔧", + "🔨", + "🔩", + "🔪", + "🔫", + "🔬", + "🔭", + "🔮", + "🔯", + "🔰", + "🔱", + "🔲", + "🔳", + "🔴", + "🔵", + "🔶", + "🔷", + "🔸", + "🔹", + "🔺", + "🔻", + "🔼", + "🔽", + "🕉", + "🕊", + "🕋", + "🕌", + "🕍", + "🕎", + "🕐", + "🕑", + "🕒", + "🕓", + "🕔", + "🕕", + "🕖", + "🕗", + "🕘", + "🕙", + "🕚", + "🕛", + "🕜", + "🕝", + "🕞", + "🕟", + "🕠", + "🕡", + "🕢", + "🕣", + "🕤", + "🕥", + "🕦", + "🕧", + "🕯", + "🕰", + "🕳", + "🕴🏻", + "🕴🏼", + "🕴🏽", + "🕴🏾", + "🕴🏿", + "🕴", + "🕵🏻‍♀️", + "🕵🏻‍♂️", + "🕵🏻", + "🕵🏼‍♀️", + "🕵🏼‍♂️", + "🕵🏼", + "🕵🏽‍♀️", + "🕵🏽‍♂️", + "🕵🏽", + "🕵🏾‍♀️", + "🕵🏾‍♂️", + "🕵🏾", + "🕵🏿‍♀️", + "🕵🏿‍♂️", + "🕵🏿", + "🕵️‍♀️", + "🕵️‍♂️", + "🕵", + "🕶", + "🕷", + "🕸", + "🕹", + "🕺🏻", + "🕺🏼", + "🕺🏽", + "🕺🏾", + "🕺🏿", + "🕺", + "🖇", + "🖊", + "🖋", + "🖌", + "🖍", + "🖐🏻", + "🖐🏼", + "🖐🏽", + "🖐🏾", + "🖐🏿", + "🖐", + "🖕🏻", + "🖕🏼", + "🖕🏽", + "🖕🏾", + "🖕🏿", + "🖕", + "🖖🏻", + "🖖🏼", + "🖖🏽", + "🖖🏾", + "🖖🏿", + "🖖", + "🖤", + "🖥", + "🖨", + "🖱", + "🖲", + "🖼", + "🗂", + "🗃", + "🗄", + "🗑", + "🗒", + "🗓", + "🗜", + "🗝", + "🗞", + "🗡", + "🗣", + "🗨", + "🗯", + "🗳", + "🗺", + "🗻", + "🗼", + "🗽", + "🗾", + "🗿", + "😀", + "😁", + "😂", + "😃", + "😄", + "😅", + "😆", + "😇", + "😈", + "😉", + "😊", + "😋", + "😌", + "😍", + "😎", + "😏", + "😐", + "😑", + "😒", + "😓", + "😔", + "😕", + "😖", + "😗", + "😘", + "😙", + "😚", + "😛", + "😜", + "😝", + "😞", + "😟", + "😠", + "😡", + "😢", + "😣", + "😤", + "😥", + "😦", + "😧", + "😨", + "😩", + "😪", + "😫", + "😬", + "😭", + "😮", + "😯", + "😰", + "😱", + "😲", + "😳", + "😴", + "😵", + "😶", + "😷", + "😸", + "😹", + "😺", + "😻", + "😼", + "😽", + "😾", + "😿", + "🙀", + "🙁", + "🙂", + "🙃", + "🙄", + "🙅🏻‍♀️", + "🙅🏻‍♂️", + "🙅🏻", + "🙅🏼‍♀️", + "🙅🏼‍♂️", + "🙅🏼", + "🙅🏽‍♀️", + "🙅🏽‍♂️", + "🙅🏽", + "🙅🏾‍♀️", + "🙅🏾‍♂️", + "🙅🏾", + "🙅🏿‍♀️", + "🙅🏿‍♂️", + "🙅🏿", + "🙅‍♀️", + "🙅‍♂️", + "🙅", + "🙆🏻‍♀️", + "🙆🏻‍♂️", + "🙆🏻", + "🙆🏼‍♀️", + "🙆🏼‍♂️", + "🙆🏼", + "🙆🏽‍♀️", + "🙆🏽‍♂️", + "🙆🏽", + "🙆🏾‍♀️", + "🙆🏾‍♂️", + "🙆🏾", + "🙆🏿‍♀️", + "🙆🏿‍♂️", + "🙆🏿", + "🙆‍♀️", + "🙆‍♂️", + "🙆", + "🙇🏻‍♀️", + "🙇🏻‍♂️", + "🙇🏻", + "🙇🏼‍♀️", + "🙇🏼‍♂️", + "🙇🏼", + "🙇🏽‍♀️", + "🙇🏽‍♂️", + "🙇🏽", + "🙇🏾‍♀️", + "🙇🏾‍♂️", + "🙇🏾", + "🙇🏿‍♀️", + "🙇🏿‍♂️", + "🙇🏿", + "🙇‍♀️", + "🙇‍♂️", + "🙇", + "🙈", + "🙉", + "🙊", + "🙋🏻‍♀️", + "🙋🏻‍♂️", + "🙋🏻", + "🙋🏼‍♀️", + "🙋🏼‍♂️", + "🙋🏼", + "🙋🏽‍♀️", + "🙋🏽‍♂️", + "🙋🏽", + "🙋🏾‍♀️", + "🙋🏾‍♂️", + "🙋🏾", + "🙋🏿‍♀️", + "🙋🏿‍♂️", + "🙋🏿", + "🙋‍♀️", + "🙋‍♂️", + "🙋", + "🙌🏻", + "🙌🏼", + "🙌🏽", + "🙌🏾", + "🙌🏿", + "🙌", + "🙍🏻‍♀️", + "🙍🏻‍♂️", + "🙍🏻", + "🙍🏼‍♀️", + "🙍🏼‍♂️", + "🙍🏼", + "🙍🏽‍♀️", + "🙍🏽‍♂️", + "🙍🏽", + "🙍🏾‍♀️", + "🙍🏾‍♂️", + "🙍🏾", + "🙍🏿‍♀️", + "🙍🏿‍♂️", + "🙍🏿", + "🙍‍♀️", + "🙍‍♂️", + "🙍", + "🙎🏻‍♀️", + "🙎🏻‍♂️", + "🙎🏻", + "🙎🏼‍♀️", + "🙎🏼‍♂️", + "🙎🏼", + "🙎🏽‍♀️", + "🙎🏽‍♂️", + "🙎🏽", + "🙎🏾‍♀️", + "🙎🏾‍♂️", + "🙎🏾", + "🙎🏿‍♀️", + "🙎🏿‍♂️", + "🙎🏿", + "🙎‍♀️", + "🙎‍♂️", + "🙎", + "🙏🏻", + "🙏🏼", + "🙏🏽", + "🙏🏾", + "🙏🏿", + "🙏", + "🚀", + "🚁", + "🚂", + "🚃", + "🚄", + "🚅", + "🚆", + "🚇", + "🚈", + "🚉", + "🚊", + "🚋", + "🚌", + "🚍", + "🚎", + "🚏", + "🚐", + "🚑", + "🚒", + "🚓", + "🚔", + "🚕", + "🚖", + "🚗", + "🚘", + "🚙", + "🚚", + "🚛", + "🚜", + "🚝", + "🚞", + "🚟", + "🚠", + "🚡", + "🚢", + "🚣🏻‍♀️", + "🚣🏻‍♂️", + "🚣🏻", + "🚣🏼‍♀️", + "🚣🏼‍♂️", + "🚣🏼", + "🚣🏽‍♀️", + "🚣🏽‍♂️", + "🚣🏽", + "🚣🏾‍♀️", + "🚣🏾‍♂️", + "🚣🏾", + "🚣🏿‍♀️", + "🚣🏿‍♂️", + "🚣🏿", + "🚣‍♀️", + "🚣‍♂️", + "🚣", + "🚤", + "🚥", + "🚦", + "🚧", + "🚨", + "🚩", + "🚪", + "🚫", + "🚬", + "🚭", + "🚮", + "🚯", + "🚰", + "🚱", + "🚲", + "🚳", + "🚴🏻‍♀️", + "🚴🏻‍♂️", + "🚴🏻", + "🚴🏼‍♀️", + "🚴🏼‍♂️", + "🚴🏼", + "🚴🏽‍♀️", + "🚴🏽‍♂️", + "🚴🏽", + "🚴🏾‍♀️", + "🚴🏾‍♂️", + "🚴🏾", + "🚴🏿‍♀️", + "🚴🏿‍♂️", + "🚴🏿", + "🚴‍♀️", + "🚴‍♂️", + "🚴", + "🚵🏻‍♀️", + "🚵🏻‍♂️", + "🚵🏻", + "🚵🏼‍♀️", + "🚵🏼‍♂️", + "🚵🏼", + "🚵🏽‍♀️", + "🚵🏽‍♂️", + "🚵🏽", + "🚵🏾‍♀️", + "🚵🏾‍♂️", + "🚵🏾", + "🚵🏿‍♀️", + "🚵🏿‍♂️", + "🚵🏿", + "🚵‍♀️", + "🚵‍♂️", + "🚵", + "🚶🏻‍♀️", + "🚶🏻‍♂️", + "🚶🏻", + "🚶🏼‍♀️", + "🚶🏼‍♂️", + "🚶🏼", + "🚶🏽‍♀️", + "🚶🏽‍♂️", + "🚶🏽", + "🚶🏾‍♀️", + "🚶🏾‍♂️", + "🚶🏾", + "🚶🏿‍♀️", + "🚶🏿‍♂️", + "🚶🏿", + "🚶‍♀️", + "🚶‍♂️", + "🚶", + "🚷", + "🚸", + "🚹", + "🚺", + "🚻", + "🚼", + "🚽", + "🚾", + "🚿", + "🛀🏻", + "🛀🏼", + "🛀🏽", + "🛀🏾", + "🛀🏿", + "🛀", + "🛁", + "🛂", + "🛃", + "🛄", + "🛅", + "🛋", + "🛌🏻", + "🛌🏼", + "🛌🏽", + "🛌🏾", + "🛌🏿", + "🛌", + "🛍", + "🛎", + "🛏", + "🛐", + "🛑", + "🛒", + "🛠", + "🛡", + "🛢", + "🛣", + "🛤", + "🛥", + "🛩", + "🛫", + "🛬", + "🛰", + "🛳", + "🛴", + "🛵", + "🛶", + "🤐", + "🤑", + "🤒", + "🤓", + "🤔", + "🤕", + "🤖", + "🤗", + "🤘🏻", + "🤘🏼", + "🤘🏽", + "🤘🏾", + "🤘🏿", + "🤘", + "🤙🏻", + "🤙🏼", + "🤙🏽", + "🤙🏾", + "🤙🏿", + "🤙", + "🤚🏻", + "🤚🏼", + "🤚🏽", + "🤚🏾", + "🤚🏿", + "🤚", + "🤛🏻", + "🤛🏼", + "🤛🏽", + "🤛🏾", + "🤛🏿", + "🤛", + "🤜🏻", + "🤜🏼", + "🤜🏽", + "🤜🏾", + "🤜🏿", + "🤜", + "🤝🏻", + "🤝🏼", + "🤝🏽", + "🤝🏾", + "🤝🏿", + "🤝", + "🤞🏻", + "🤞🏼", + "🤞🏽", + "🤞🏾", + "🤞🏿", + "🤞", + "🤠", + "🤡", + "🤢", + "🤣", + "🤤", + "🤥", + "🤦🏻‍♀️", + "🤦🏻‍♂️", + "🤦🏻", + "🤦🏼‍♀️", + "🤦🏼‍♂️", + "🤦🏼", + "🤦🏽‍♀️", + "🤦🏽‍♂️", + "🤦🏽", + "🤦🏾‍♀️", + "🤦🏾‍♂️", + "🤦🏾", + "🤦🏿‍♀️", + "🤦🏿‍♂️", + "🤦🏿", + "🤦‍♀️", + "🤦‍♂️", + "🤦", + "🤧", + "🤰🏻", + "🤰🏼", + "🤰🏽", + "🤰🏾", + "🤰🏿", + "🤰", + "🤳🏻", + "🤳🏼", + "🤳🏽", + "🤳🏾", + "🤳🏿", + "🤳", + "🤴🏻", + "🤴🏼", + "🤴🏽", + "🤴🏾", + "🤴🏿", + "🤴", + "🤵🏻", + "🤵🏼", + "🤵🏽", + "🤵🏾", + "🤵🏿", + "🤵", + "🤶🏻", + "🤶🏼", + "🤶🏽", + "🤶🏾", + "🤶🏿", + "🤶", + "🤷🏻‍♀️", + "🤷🏻‍♂️", + "🤷🏻", + "🤷🏼‍♀️", + "🤷🏼‍♂️", + "🤷🏼", + "🤷🏽‍♀️", + "🤷🏽‍♂️", + "🤷🏽", + "🤷🏾‍♀️", + "🤷🏾‍♂️", + "🤷🏾", + "🤷🏿‍♀️", + "🤷🏿‍♂️", + "🤷🏿", + "🤷‍♀️", + "🤷‍♂️", + "🤷", + "🤸🏻‍♀️", + "🤸🏻‍♂️", + "🤸🏻", + "🤸🏼‍♀️", + "🤸🏼‍♂️", + "🤸🏼", + "🤸🏽‍♀️", + "🤸🏽‍♂️", + "🤸🏽", + "🤸🏾‍♀️", + "🤸🏾‍♂️", + "🤸🏾", + "🤸🏿‍♀️", + "🤸🏿‍♂️", + "🤸🏿", + "🤸‍♀️", + "🤸‍♂️", + "🤸", + "🤹🏻‍♀️", + "🤹🏻‍♂️", + "🤹🏻", + "🤹🏼‍♀️", + "🤹🏼‍♂️", + "🤹🏼", + "🤹🏽‍♀️", + "🤹🏽‍♂️", + "🤹🏽", + "🤹🏾‍♀️", + "🤹🏾‍♂️", + "🤹🏾", + "🤹🏿‍♀️", + "🤹🏿‍♂️", + "🤹🏿", + "🤹‍♀️", + "🤹‍♂️", + "🤹", + "🤺", + "🤼🏻‍♀️", + "🤼🏻‍♂️", + "🤼🏻", + "🤼🏼‍♀️", + "🤼🏼‍♂️", + "🤼🏼", + "🤼🏽‍♀️", + "🤼🏽‍♂️", + "🤼🏽", + "🤼🏾‍♀️", + "🤼🏾‍♂️", + "🤼🏾", + "🤼🏿‍♀️", + "🤼🏿‍♂️", + "🤼🏿", + "🤼‍♀️", + "🤼‍♂️", + "🤼", + "🤽🏻‍♀️", + "🤽🏻‍♂️", + "🤽🏻", + "🤽🏼‍♀️", + "🤽🏼‍♂️", + "🤽🏼", + "🤽🏽‍♀️", + "🤽🏽‍♂️", + "🤽🏽", + "🤽🏾‍♀️", + "🤽🏾‍♂️", + "🤽🏾", + "🤽🏿‍♀️", + "🤽🏿‍♂️", + "🤽🏿", + "🤽‍♀️", + "🤽‍♂️", + "🤽", + "🤾🏻‍♀️", + "🤾🏻‍♂️", + "🤾🏻", + "🤾🏼‍♀️", + "🤾🏼‍♂️", + "🤾🏼", + "🤾🏽‍♀️", + "🤾🏽‍♂️", + "🤾🏽", + "🤾🏾‍♀️", + "🤾🏾‍♂️", + "🤾🏾", + "🤾🏿‍♀️", + "🤾🏿‍♂️", + "🤾🏿", + "🤾‍♀️", + "🤾‍♂️", + "🤾", + "🥀", + "🥁", + "🥂", + "🥃", + "🥄", + "🥅", + "🥇", + "🥈", + "🥉", + "🥊", + "🥋", + "🥐", + "🥑", + "🥒", + "🥓", + "🥔", + "🥕", + "🥖", + "🥗", + "🥘", + "🥙", + "🥚", + "🥛", + "🥜", + "🥝", + "🥞", + "🦀", + "🦁", + "🦂", + "🦃", + "🦄", + "🦅", + "🦆", + "🦇", + "🦈", + "🦉", + "🦊", + "🦋", + "🦌", + "🦍", + "🦎", + "🦏", + "🦐", + "🦑", + "🧀", + "‼", + "⁉", + "™", + "ℹ", + "↔", + "↕", + "↖", + "↗", + "↘", + "↙", + "↩", + "↪", + "#⃣", + "⌚", + "⌛", + "⌨", + "⏏", + "⏩", + "⏪", + "⏫", + "⏬", + "⏭", + "⏮", + "⏯", + "⏰", + "⏱", + "⏲", + "⏳", + "⏸", + "⏹", + "⏺", + "Ⓜ", + "▪", + "▫", + "▶", + "◀", + "◻", + "◼", + "◽", + "◾", + "☀", + "☁", + "☂", + "☃", + "☄", + "☎", + "☑", + "☔", + "☕", + "☘", + "☝🏻", + "☝🏼", + "☝🏽", + "☝🏾", + "☝🏿", + "☝", + "☠", + "☢", + "☣", + "☦", + "☪", + "☮", + "☯", + "☸", + "☹", + "☺", + "♀", + "♂", + "♈", + "♉", + "♊", + "♋", + "♌", + "♍", + "♎", + "♏", + "♐", + "♑", + "♒", + "♓", + "♠", + "♣", + "♥", + "♦", + "♨", + "♻", + "♿", + "⚒", + "⚓", + "⚔", + "⚕", + "⚖", + "⚗", + "⚙", + "⚛", + "⚜", + "⚠", + "⚡", + "⚪", + "⚫", + "⚰", + "⚱", + "⚽", + "⚾", + "⛄", + "⛅", + "⛈", + "⛎", + "⛏", + "⛑", + "⛓", + "⛔", + "⛩", + "⛪", + "⛰", + "⛱", + "⛲", + "⛳", + "⛴", + "⛵", + "⛷🏻", + "⛷🏼", + "⛷🏽", + "⛷🏾", + "⛷🏿", + "⛷", + "⛸", + "⛹🏻‍♀️", + "⛹🏻‍♂️", + "⛹🏻", + "⛹🏼‍♀️", + "⛹🏼‍♂️", + "⛹🏼", + "⛹🏽‍♀️", + "⛹🏽‍♂️", + "⛹🏽", + "⛹🏾‍♀️", + "⛹🏾‍♂️", + "⛹🏾", + "⛹🏿‍♀️", + "⛹🏿‍♂️", + "⛹🏿", + "⛹️‍♀️", + "⛹️‍♂️", + "⛹", + "⛺", + "⛽", + "✂", + "✅", + "✈", + "✉", + "✊🏻", + "✊🏼", + "✊🏽", + "✊🏾", + "✊🏿", + "✊", + "✋🏻", + "✋🏼", + "✋🏽", + "✋🏾", + "✋🏿", + "✋", + "✌🏻", + "✌🏼", + "✌🏽", + "✌🏾", + "✌🏿", + "✌", + "✍🏻", + "✍🏼", + "✍🏽", + "✍🏾", + "✍🏿", + "✍", + "✏", + "✒", + "✔", + "✖", + "✝", + "✡", + "✨", + "✳", + "✴", + "❄", + "❇", + "❌", + "❎", + "❓", + "❔", + "❕", + "❗", + "❣", + "❤", + "➕", + "➖", + "➗", + "➡", + "➰", + "➿", + "⤴", + "⤵", + "*⃣", + "⬅", + "⬆", + "⬇", + "⬛", + "⬜", + "⭐", + "⭕", + "0⃣", + "〰", + "〽", + "1⃣", + "2⃣", + "㊗", + "㊙", + "3⃣", + "4⃣", + "5⃣", + "6⃣", + "7⃣", + "8⃣", + "9⃣", + "©", + "®", + "" +] \ No newline at end of file diff --git a/node_modules/emojis-list/package.json b/node_modules/emojis-list/package.json new file mode 100755 index 00000000..92572bf5 --- /dev/null +++ b/node_modules/emojis-list/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "emojis-list@^2.0.0", + "scope": null, + "escapedName": "emojis-list", + "name": "emojis-list", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/loader-utils" + ] + ], + "_from": "emojis-list@>=2.0.0 <3.0.0", + "_id": "emojis-list@2.1.0", + "_inCache": true, + "_location": "/emojis-list", + "_nodeVersion": "6.7.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/emojis-list-2.1.0.tgz_1475503274409_0.1915575808379799" + }, + "_npmUser": { + "name": "kikobeats", + "email": "josefrancisco.verdu@gmail.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "emojis-list@^2.0.0", + "scope": null, + "escapedName": "emojis-list", + "name": "emojis-list", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/loader-utils" + ], + "_resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "_shasum": "4daa4d9db00f9819880c79fa457ae5b09a1fd389", + "_shrinkwrap": null, + "_spec": "emojis-list@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/loader-utils", + "author": { + "name": "Kiko Beats", + "email": "josefrancisco.verdu@gmail.com", + "url": "https://github.com/Kikobeats" + }, + "bugs": { + "url": "https://github.com/Kikobeats/emojis-list/issues" + }, + "dependencies": {}, + "description": "Complete list of standard emojis.", + "devDependencies": { + "acho": "latest", + "browserify": "latest", + "cheerio": "latest", + "got": ">=5 <6", + "gulp": "latest", + "gulp-header": "latest", + "gulp-uglify": "latest", + "gulp-util": "latest", + "standard": "latest", + "vinyl-buffer": "latest", + "vinyl-source-stream": "latest" + }, + "directories": {}, + "dist": { + "shasum": "4daa4d9db00f9819880c79fa457ae5b09a1fd389", + "tarball": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js" + ], + "gitHead": "be6942ce8973057a6ac3aab5b84a9a9585e89417", + "homepage": "https://github.com/Kikobeats/emojis-list", + "keywords": [ + "archive", + "complete", + "emoji", + "list", + "standard" + ], + "license": "MIT", + "main": "./index.js", + "maintainers": [ + { + "name": "kikobeats", + "email": "josefrancisco.verdu@gmail.com" + } + ], + "name": "emojis-list", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/kikobeats/emojis-list.git" + }, + "scripts": { + "pretest": "standard update.js", + "test": "echo 'YOLO'", + "update": "node update" + }, + "version": "2.1.0" +} diff --git a/node_modules/encodeurl/HISTORY.md b/node_modules/encodeurl/HISTORY.md new file mode 100755 index 00000000..06d34a5a --- /dev/null +++ b/node_modules/encodeurl/HISTORY.md @@ -0,0 +1,9 @@ +1.0.1 / 2016-06-09 +================== + + * Fix encoding unpaired surrogates at start/end of string + +1.0.0 / 2016-06-08 +================== + + * Initial release diff --git a/node_modules/encodeurl/LICENSE b/node_modules/encodeurl/LICENSE new file mode 100755 index 00000000..8812229b --- /dev/null +++ b/node_modules/encodeurl/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/encodeurl/README.md b/node_modules/encodeurl/README.md new file mode 100755 index 00000000..b086133c --- /dev/null +++ b/node_modules/encodeurl/README.md @@ -0,0 +1,124 @@ +# encodeurl + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Encode a URL to a percent-encoded form, excluding already-encoded sequences + +## Installation + +```sh +$ npm install encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function will take an already-encoded URL and encode all the non-URL +code points (as UTF-8 byte sequences). This function will not encode the +"%" character unless it is not part of a valid sequence (`%20` will be +left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as +hard as it can to properly encode the given URL, including replacing any raw, +unpaired surrogate pairs with the Unicode replacement character prior to +encoding. + +This function is _similar_ to the intrinsic function `encodeURI`, except it +will not encode the `%` character if that is part of a valid sequence, will +not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired +surrogate pairs with the Unicode replacement character (instead of throwing). + +## Examples + +### Encode a URL containing user-controled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/encodeurl.svg +[npm-url]: https://npmjs.org/package/encodeurl +[node-version-image]: https://img.shields.io/node/v/encodeurl.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg +[travis-url]: https://travis-ci.org/pillarjs/encodeurl +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master +[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg +[downloads-url]: https://npmjs.org/package/encodeurl diff --git a/node_modules/encodeurl/index.js b/node_modules/encodeurl/index.js new file mode 100755 index 00000000..ae77cc94 --- /dev/null +++ b/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/node_modules/encodeurl/package.json b/node_modules/encodeurl/package.json new file mode 100755 index 00000000..56e4f69a --- /dev/null +++ b/node_modules/encodeurl/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "encodeurl@~1.0.1", + "scope": null, + "escapedName": "encodeurl", + "name": "encodeurl", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "encodeurl@>=1.0.1 <1.1.0", + "_id": "encodeurl@1.0.1", + "_inCache": true, + "_location": "/encodeurl", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/encodeurl-1.0.1.tgz_1465519736251_0.09314409433864057" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "raw": "encodeurl@~1.0.1", + "scope": null, + "escapedName": "encodeurl", + "name": "encodeurl", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/finalhandler", + "/send", + "/serve-static" + ], + "_resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", + "_shasum": "79e3d58655346909fe6f0f45a5de68103b294d20", + "_shrinkwrap": null, + "_spec": "encodeurl@~1.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "bugs": { + "url": "https://github.com/pillarjs/encodeurl/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "devDependencies": { + "eslint": "2.11.1", + "eslint-config-standard": "5.3.1", + "eslint-plugin-promise": "1.3.2", + "eslint-plugin-standard": "1.3.2", + "istanbul": "0.4.3", + "mocha": "2.5.3" + }, + "directories": {}, + "dist": { + "shasum": "79e3d58655346909fe6f0f45a5de68103b294d20", + "tarball": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "39ed0c235fed4cea7d012038fd6bb0480561d226", + "homepage": "https://github.com/pillarjs/encodeurl#readme", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "encodeurl", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/pillarjs/encodeurl.git" + }, + "scripts": { + "lint": "eslint **/*.js", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.0.1" +} diff --git a/node_modules/end-of-stream/.npmignore b/node_modules/end-of-stream/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/end-of-stream/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/end-of-stream/README.md b/node_modules/end-of-stream/README.md new file mode 100755 index 00000000..df800c1e --- /dev/null +++ b/node_modules/end-of-stream/README.md @@ -0,0 +1,47 @@ +# end-of-stream + +A node module that calls a callback when a readable/writable/duplex stream has completed or failed. + + npm install end-of-stream + +## Usage + +Simply pass a stream and a callback to the `eos`. +Both legacy streams and streams2 are supported. + +``` js +var eos = require('end-of-stream'); + +eos(readableStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended'); +}); + +eos(writableStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished'); +}); + +eos(duplexStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended and finished'); +}); + +eos(duplexStream, {readable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended but might still be writable'); +}); + +eos(duplexStream, {writable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended but might still be readable'); +}); + +eos(readableStream, {error:false}, function(err) { + // do not treat emit('error', err) as a end-of-stream +}); +``` + +## License + +MIT \ No newline at end of file diff --git a/node_modules/end-of-stream/index.js b/node_modules/end-of-stream/index.js new file mode 100755 index 00000000..9f61ed5a --- /dev/null +++ b/node_modules/end-of-stream/index.js @@ -0,0 +1,72 @@ +var once = require('once'); + +var noop = function() {}; + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback(); + }; + + var onend = function() { + readable = false; + if (!writable) callback(); + }; + + var onclose = function() { + if (readable && !(rs && rs.ended)) return callback(new Error('premature close')); + if (writable && !(ws && ws.ended)) return callback(new Error('premature close')); + }; + + var onrequest = function() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', callback); + stream.on('close', onclose); + + return function() { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('end', onend); + stream.removeListener('error', callback); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; \ No newline at end of file diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json new file mode 100755 index 00000000..d794cd82 --- /dev/null +++ b/node_modules/end-of-stream/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + { + "raw": "end-of-stream@1.0.0", + "scope": null, + "escapedName": "end-of-stream", + "name": "end-of-stream", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/duplexify" + ] + ], + "_from": "end-of-stream@1.0.0", + "_id": "end-of-stream@1.0.0", + "_inCache": true, + "_location": "/end-of-stream", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "raw": "end-of-stream@1.0.0", + "scope": null, + "escapedName": "end-of-stream", + "name": "end-of-stream", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "_requiredBy": [ + "/duplexify" + ], + "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", + "_shasum": "d4596e702734a93e40e9af864319eabd99ff2f0e", + "_shrinkwrap": null, + "_spec": "end-of-stream@1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/duplexify", + "author": { + "name": "Mathias Buus", + "email": "mathiasbuus@gmail.com" + }, + "bugs": { + "url": "https://github.com/mafintosh/end-of-stream/issues" + }, + "dependencies": { + "once": "~1.3.0" + }, + "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "d4596e702734a93e40e9af864319eabd99ff2f0e", + "tarball": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz" + }, + "homepage": "https://github.com/mafintosh/end-of-stream", + "keywords": [ + "stream", + "streams", + "callback", + "finish", + "close", + "end", + "wait" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "end-of-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/end-of-stream.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/end-of-stream/test.js b/node_modules/end-of-stream/test.js new file mode 100755 index 00000000..d4d126fe --- /dev/null +++ b/node_modules/end-of-stream/test.js @@ -0,0 +1,62 @@ +var assert = require('assert'); +var eos = require('./index'); + +var expected = 6; +var fs = require('fs'); +var net = require('net'); + +var ws = fs.createWriteStream('/dev/null'); +eos(ws, function(err) { + expected--; + assert(!!err); + if (!expected) process.exit(0); +}); +ws.close(); + +var rs = fs.createReadStream('/dev/random'); +eos(rs, function(err) { + expected--; + assert(!!err); + if (!expected) process.exit(0); +}); +rs.close(); + +var rs = fs.createReadStream(__filename); +eos(rs, function(err) { + expected--; + assert(!err); + if (!expected) process.exit(0); +}); +rs.pipe(fs.createWriteStream('/dev/null')); + +var rs = fs.createReadStream(__filename); +eos(rs, function(err) { + throw new Error('no go') +})(); +rs.pipe(fs.createWriteStream('/dev/null')); + +var socket = net.connect(50000); +eos(socket, function(err) { + expected--; + assert(!!err); + if (!expected) process.exit(0); +}); + +var server = net.createServer(function(socket) { + eos(socket, function() { + expected--; + if (!expected) process.exit(0); + }); + socket.destroy(); +}).listen(30000, function() { + var socket = net.connect(30000); + eos(socket, function() { + expected--; + if (!expected) process.exit(0); + }); +}); + +setTimeout(function() { + assert(expected === 0); + process.exit(0); +}, 1000); diff --git a/node_modules/enhanced-resolve/README.md b/node_modules/enhanced-resolve/README.md new file mode 100755 index 00000000..d3f79310 --- /dev/null +++ b/node_modules/enhanced-resolve/README.md @@ -0,0 +1,28 @@ +# enhanced-resolve + +Offers a async require.resolve function. It's highly configurable. + +[documentation](https://github.com/webpack/docs/wiki) + + +## Features + +* plugin system +* provide a custom filesystem +* sync and async node.js filesystems included + + +## Tests + +``` javascript +npm test +``` + +[![Build Status](https://secure.travis-ci.org/webpack/enhanced-resolve.png?branch=master)](http://travis-ci.org/webpack/enhanced-resolve) + + +## License + +Copyright (c) 2012-2013 Tobias Koppers + +MIT (http://www.opensource.org/licenses/mit-license.php) \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js b/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js new file mode 100755 index 00000000..132f9653 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js @@ -0,0 +1,152 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +function Storage(duration) { + this.duration = duration; + this.running = {}; + this.data = {}; + this.levels = []; + if(duration > 0) { + this.levels.push([], [], [], [], [], [], [], [], []); + for(var i = 8000; i < duration; i+=500) + this.levels.push([]); + } + this.count = 0; + this.interval = null; + this.needTickCheck = false; + this.nextTick = null; + this.passive = true; +} + +Storage.prototype.ensureTick = function() { + if(!this.interval && this.duration > 0 && !this.nextTick) + this.interval = setInterval(this.tick.bind(this), Math.floor(this.duration / this.levels.length)); +}; + +Storage.prototype.finished = function(name) { + var args = Array.prototype.slice.call(arguments, 1); + var callbacks = this.running[name]; + delete this.running[name]; + if(this.duration > 0) { + this.count++; + this.data[name] = args; + this.levels[0].push(name); + this.ensureTick(); + } + for(var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(null, args); + } +}; + +Storage.prototype.provide = function(name, provider, callback) { + var running = this.running[name]; + if(running) { + running.push(callback); + return; + } + if(this.duration > 0) { + this.checkTicks(); + var data = this.data[name]; + if(data) { + return callback.apply(null, data); + } + } + this.running[name] = running = [callback]; + provider(name, this.finished.bind(this, name)); +}; + +Storage.prototype.tick = function() { + var decay = this.levels.pop(); + for(var i = decay.length - 1; i >= 0; i--) { + delete this.data[decay[i]]; + } + this.count -= decay.length; + decay.length = 0; + this.levels.unshift(decay); + if(this.count == 0) { + clearInterval(this.interval); + this.interval = null; + this.nextTick = null; + return true; + } else if(this.nextTick) { + this.nextTick += Math.floor(this.duration / this.levels.length); + var time = new Date().getTime(); + if(this.nextTick > time) { + this.nextTick = null; + this.interval = setInterval(this.tick.bind(this), Math.floor(this.duration / this.levels.length)); + return true; + } + } else if(this.passive) { + clearInterval(this.interval); + this.interval = null; + this.nextTick = new Date().getTime() + Math.floor(this.duration / this.levels.length); + } else { + this.passive = true; + } +}; + +Storage.prototype.checkTicks = function() { + this.passive = false; + if(this.nextTick) { + while(!this.tick()); + } +}; + +Storage.prototype.purge = function(what) { + if(!what) { + this.count = 0; + clearInterval(this.interval); + this.nextTick = null; + this.data = {}; + this.levels.forEach(function(level) { + level.length = 0; + }); + } else if(typeof what === "string") { + Object.keys(this.data).forEach(function(key) { + if(key.indexOf(what) === 0) + delete this.data[key]; + }, this); + } else { + for(var i = what.length - 1; i >= 0; i--) { + this.purge(what[i]); + } + } +}; + + +function CachedInputFileSystem(fileSystem, duration) { + this.fileSystem = fileSystem; + this._statStorage = new Storage(duration); + this._readdirStorage = new Storage(duration); + this._readFileStorage = new Storage(duration); + this._readlinkStorage = new Storage(duration); +} +module.exports = CachedInputFileSystem; + +CachedInputFileSystem.prototype.isSync = function() { + return this.fileSystem.isSync(); +}; + +CachedInputFileSystem.prototype.stat = function(path, callback) { + this._statStorage.provide(path, this.fileSystem.stat.bind(this.fileSystem), callback); +}; + +CachedInputFileSystem.prototype.readdir = function(path, callback) { + this._readdirStorage.provide(path, this.fileSystem.readdir.bind(this.fileSystem), callback); +}; + +CachedInputFileSystem.prototype.readFile = function(path, callback) { + this._readFileStorage.provide(path, this.fileSystem.readFile.bind(this.fileSystem), callback); +}; + +CachedInputFileSystem.prototype.readlink = function(path, callback) { + this._readlinkStorage.provide(path, this.fileSystem.readlink.bind(this.fileSystem), callback); +}; + +CachedInputFileSystem.prototype.purge = function(what) { + this._statStorage.purge(what); + this._readdirStorage.purge(what); + this._readFileStorage.purge(what); + this._readlinkStorage.purge(what); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/DirectoryDefaultFilePlugin.js b/node_modules/enhanced-resolve/lib/DirectoryDefaultFilePlugin.js new file mode 100755 index 00000000..f4514ff3 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DirectoryDefaultFilePlugin.js @@ -0,0 +1,42 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var createInnerCallback = require("./createInnerCallback"); + +function DirectoryDefaultFilePlugin(files) { + this.files = files; +} +module.exports = DirectoryDefaultFilePlugin; + +DirectoryDefaultFilePlugin.prototype.apply = function(resolver) { + var files = this.files; + resolver.plugin("directory", function(request, callback) { + var fs = this.fileSystem; + var topLevelCallback = callback; + var directory = this.join(request.path, request.request); + fs.stat(directory, function(err, stat) { + if(err || !stat) { + if(callback.log) callback.log(directory + " doesn't exist (directory default file)"); + return callback(); + } + if(!stat.isDirectory()) { + if(callback.log) callback.log(directory + " is not a directory (directory default file)"); + return callback(); + } + this.forEachBail(files, function(file, callback) { + this.doResolve("file", { + path: directory, + query: request.query, + request: file + }, createInnerCallback(function(err, result) { + if(!err && result) return callback(result); + return callback(); + }, topLevelCallback, "directory default file " + file)); + }.bind(this), function(result) { + if(!result) return callback(); + return callback(null, result); + }); + }.bind(this)); + }); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/DirectoryDescriptionFileFieldAliasPlugin.js b/node_modules/enhanced-resolve/lib/DirectoryDescriptionFileFieldAliasPlugin.js new file mode 100755 index 00000000..e9a44f2c --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DirectoryDescriptionFileFieldAliasPlugin.js @@ -0,0 +1,126 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var createInnerCallback = require("./createInnerCallback"); + +function DirectoryDescriptionFileFieldAliasPlugin(filename, field) { + this.filename = filename; + this.field = field; +} +module.exports = DirectoryDescriptionFileFieldAliasPlugin; + +function findDescriptionFileField(resolver, directory, filename, field, callback) { + (function findDescriptionFile() { + var descriptionFilePath = resolver.join(directory, filename); + resolver.fileSystem.readFile(descriptionFilePath, function(err, content) { + if(err) { + directory = cdUp(directory); + if(!directory) { + return callback(); + } else { + return findDescriptionFile(); + } + } + try { + content = JSON.parse(content); + } catch(e) { + if(callback.log) + callback.log(descriptionFilePath + " (directory description file): " + e); + else + e.message = descriptionFilePath + " (directory description file): " + e; + return callback(e); + } + var fieldData; + if(Array.isArray(field)) { + var current = content; + for(var j = 0; j < field.length; j++) { + if(current === null || typeof current !== "object") { + current = null; + break; + } + current = current[field[j]]; + } + if(typeof current === "object") { + fieldData = current; + } + } else { + if(typeof content[field] === "object") { + fieldData = content[field]; + } + } + if(!fieldData) return callback(); + callback(null, fieldData, directory); + }); + }()); +} + +function cdUp(directory) { + if(directory === "/") return null; + var i = directory.lastIndexOf("/"), + j = directory.lastIndexOf("\\"); + var p = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if(p < 0) return null; + return directory.substr(0, p || 1); +} + +DirectoryDescriptionFileFieldAliasPlugin.prototype.apply = function(resolver) { + var filename = this.filename; + var field = this.field; + resolver.plugin("module", function(request, callback) { + var directory = request.path; + var moduleName = request.request; + findDescriptionFileField(this, directory, filename, field, function(err, fieldData, directory) { + if(err) return callback(err); + if(!fieldData) return callback(); + var data = fieldData[moduleName]; + if(data === moduleName) return callback(); + if(data === false) return callback(null, { + path: false, + resolved: true + }); + if(!data) return callback(); + var newRequest = this.parse(data); + var obj = { + path: directory, + request: newRequest.path, + query: newRequest.query, + directory: newRequest.directory + }; + var newCallback = createInnerCallback(callback, callback, "aliased from directory description file " + this.join(directory, filename) + " with mapping " + JSON.stringify(moduleName)); + if(newRequest.module) return this.doResolve("module", obj, newCallback); + if(newRequest.directory) return this.doResolve("directory", obj, newCallback); + return this.doResolve(["file", "directory"], obj, newCallback); + }.bind(this)); + }); + resolver.plugin("result", function(request, callback) { + var directory = cdUp(request.path); + var requestPath = request.path; + findDescriptionFileField(this, directory, filename, field, function(err, fieldData, directory) { + if(err) return callback(err); + if(!fieldData) return callback(); + var relative = requestPath.substr(directory.length+1).replace(/\\/g, "/"); + if(typeof fieldData[relative] !== "undefined") + var data = fieldData[relative]; + else if(typeof fieldData["./" + relative] !== "undefined") + var data = fieldData["./" + relative]; + if(data === relative || data === "./" + relative) return callback(); + if(data === false) return callback(null, { + path: false, + resolved: true + }); + if(!data) return callback(); + var newRequest = this.parse(data); + var obj = { + path: directory, + request: newRequest.path, + query: newRequest.query, + directory: newRequest.directory + }; + var newCallback = createInnerCallback(callback, callback, "aliased from directory description file " + this.join(directory, filename) + " with mapping " + JSON.stringify(relative)); + if(newRequest.module) return this.doResolve("module", obj, newCallback); + if(newRequest.directory) return this.doResolve("directory", obj, newCallback); + return this.doResolve(["file", "directory"], obj, newCallback); + }.bind(this)); + }); +}; diff --git a/node_modules/enhanced-resolve/lib/DirectoryDescriptionFilePlugin.js b/node_modules/enhanced-resolve/lib/DirectoryDescriptionFilePlugin.js new file mode 100755 index 00000000..2cbc8c68 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DirectoryDescriptionFilePlugin.js @@ -0,0 +1,74 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var createInnerCallback = require("./createInnerCallback"); + +function DirectoryDescriptionFilePlugin(filename, fields) { + this.filename = filename; + this.fields = fields; +} +module.exports = DirectoryDescriptionFilePlugin; + +DirectoryDescriptionFilePlugin.prototype.apply = function(resolver) { + var filename = this.filename; + var fields = this.fields; + resolver.plugin("directory", function(request, callback) { + var fs = this.fileSystem; + var directory = this.join(request.path, request.request); + var descriptionFilePath = this.join(directory, filename); + fs.readFile(descriptionFilePath, function(err, content) { + if(err) { + if(callback.log) + callback.log(descriptionFilePath + " doesn't exist (directory description file)"); + return callback(); + } + content = content.toString("utf-8"); + try { + content = JSON.parse(content); + } catch(e) { + if(callback.log) + callback.log(descriptionFilePath + " (directory description file): " + e); + else + e.message = descriptionFilePath + " (directory description file): " + e; + return callback(e); + } + var mainModules = []; + for(var i = 0; i < fields.length; i++) { + if(Array.isArray(fields[i])) { + var current = content; + for(var j = 0; j < fields[i].length; j++) { + if(current === null || typeof current !== "object") { + current = null; + break; + } + var field = fields[i][j]; + current = current[field]; + } + if(typeof current === "string") { + mainModules.push(current); + continue; + } + } else { + var field = fields[i]; + if(typeof content[field] === "string") { + mainModules.push(content[field]); + continue; + } + } + } + (function next() { + if(mainModules.length == 0) return callback(); + var mainModule = mainModules.shift(); + return this.doResolve(["file", "directory"], { + path: directory, + query: request.query, + request: mainModule + }, createInnerCallback(function(err, result) { + if(!err && result) return callback(null, result); + return next.call(this); + }.bind(this), callback, "use " + mainModule + " from " + filename)); + }.call(this)) + }.bind(this)); + }); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/DirectoryResultPlugin.js b/node_modules/enhanced-resolve/lib/DirectoryResultPlugin.js new file mode 100755 index 00000000..7ad57306 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/DirectoryResultPlugin.js @@ -0,0 +1,31 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +function DirectoryResultPlugin(files) { + this.files = files; +} +module.exports = DirectoryResultPlugin; + +DirectoryResultPlugin.prototype.apply = function(resolver) { + var files = this.files; + resolver.plugin("directory", function(request, callback) { + var fs = this.fileSystem; + var directory = this.join(request.path, request.request); + fs.stat(directory, function(err, stat) { + if(!err && stat && stat.isDirectory()) { + return this.doResolve("result", { + path: directory, + query: request.query, + directory: true, + resolved: true + }, callback); + } + if(callback.log) { + if(err) callback.log(directory + " doesn't exist"); + else callback.log(directory + " is not a directory"); + } + return callback(); + }.bind(this)); + }); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/FileAppendPlugin.js b/node_modules/enhanced-resolve/lib/FileAppendPlugin.js new file mode 100755 index 00000000..1be582a4 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/FileAppendPlugin.js @@ -0,0 +1,40 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +function FileAppendPlugin(appendings) { + this.appendings = appendings; +} +module.exports = FileAppendPlugin; + +FileAppendPlugin.prototype.apply = function(resolver) { + var appendings = this.appendings; + resolver.plugin("file", function(request, callback) { + var fs = this.fileSystem; + var addr = this.join(request.path, request.request); + var addrs = appendings.map(function(a) { return addr + a }); + var log = callback.log; + var missing = callback.missing; + this.forEachBail(addrs, function(addr, callback) { + fs.stat(addr, function(err, stat) { + if(!err && stat && stat.isFile()) + return callback(addr); + if(missing && err) + missing.push(addr); + if(log) { + if(err) log(addr + " doesn't exist"); + else log(addr + " is not a file"); + } + return callback(); + }); + }, function(validAddr) { + if(!validAddr) return callback(); + return this.doResolve("result", { + path: validAddr, + query: request.query, + file: true, + resolved: true + }, callback); + }.bind(this)); + }); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/ModuleAliasPlugin.js b/node_modules/enhanced-resolve/lib/ModuleAliasPlugin.js new file mode 100755 index 00000000..eaa69267 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModuleAliasPlugin.js @@ -0,0 +1,44 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var createInnerCallback = require("./createInnerCallback"); + +function ModuleAliasPlugin(aliasMap) { + this.aliasMap = aliasMap; +} +module.exports = ModuleAliasPlugin; + +ModuleAliasPlugin.prototype.apply = function(resolver) { + var aliasMap = this.aliasMap; + resolver.plugin("module", function(request, callback) { + var fs = this.fileSystem; + var keys = Object.keys(aliasMap); + var i = 0; + (function next() { + for(;i < keys.length; i++) { + var aliasName = keys[i]; + var onlyModule = /\$$/.test(aliasName); + if(onlyModule) aliasName = aliasName.substr(0, aliasName.length-1); + if((!onlyModule && request.request.indexOf(aliasName + "/") === 0) || request.request === aliasName) { + var aliasValue = aliasMap[keys[i]]; + if(request.request.indexOf(aliasValue + "/") !== 0 && request.request != aliasValue) { + var newRequestStr = aliasValue + request.request.substr(aliasName.length); + var newRequest = this.parse(newRequestStr); + var obj = { + path: request.path, + request: newRequest.path, + query: newRequest.query, + directory: newRequest.directory + }; + var newCallback = createInnerCallback(callback, callback, "aliased with mapping " + JSON.stringify(aliasName) + ": " + JSON.stringify(aliasValue) + " to " + newRequestStr); + if(newRequest.module) return this.doResolve("module", obj, newCallback); + if(newRequest.directory) return this.doResolve("directory", obj, newCallback); + return this.doResolve(["file", "directory"], obj, newCallback); + } + } + } + return callback(); + }.call(this)); + }); +}; diff --git a/node_modules/enhanced-resolve/lib/ModuleAsDirectoryPlugin.js b/node_modules/enhanced-resolve/lib/ModuleAsDirectoryPlugin.js new file mode 100755 index 00000000..e058fcf9 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModuleAsDirectoryPlugin.js @@ -0,0 +1,43 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +function ModuleAsDirectoryPlugin(moduleType) { + this.moduleType = moduleType; +} +module.exports = ModuleAsDirectoryPlugin; + +ModuleAsDirectoryPlugin.prototype.apply = function(resolver) { + resolver.plugin("module-" + this.moduleType, function(request, callback) { + var fs = this.fileSystem; + var i = request.request.indexOf("/"), + j = request.request.indexOf("\\"); + var p = i < 0 ? j : j < 0 ? i : i < j ? i : j; + var moduleName, remainingRequest; + if(p < 0) { + moduleName = request.request; + remainingRequest = ""; + } else { + moduleName = request.request.substr(0, p); + remainingRequest = request.request.substr(p+1); + } + var modulePath = this.join(request.path, moduleName); + fs.stat(modulePath, function(err, stat) { + if(err || !stat) { + if(callback.missing) + callback.missing.push(modulePath); + if(callback.log) callback.log(modulePath + " doesn't exist (module as directory)"); + return callback(); + } + if(stat.isDirectory()) { + return this.doResolve(request.directory ? "directory" : ["file", "directory"], { + path: modulePath, + request: remainingRequest, + query: request.query + }, callback, true); + } + if(callback.log) callback.log(modulePath + " is not a directory (module as directory)"); + return callback(); + }.bind(this)); + }); +}; diff --git a/node_modules/enhanced-resolve/lib/ModuleAsFilePlugin.js b/node_modules/enhanced-resolve/lib/ModuleAsFilePlugin.js new file mode 100755 index 00000000..7d6fadba --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModuleAsFilePlugin.js @@ -0,0 +1,18 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +function ModuleAsFilePlugin(moduleType) { + this.moduleType = moduleType; +} +module.exports = ModuleAsFilePlugin; + +ModuleAsFilePlugin.prototype.apply = function(resolver) { + resolver.plugin("module-" + this.moduleType, function(request, callback) { + var fs = this.fileSystem; + var i = request.request.indexOf("/"), + j = request.request.indexOf("\\"); + if(i >= 0 || j >= 0 || request.directory) return callback(); + return this.doResolve("file", request, callback, true); + }); +}; diff --git a/node_modules/enhanced-resolve/lib/ModuleTemplatesPlugin.js b/node_modules/enhanced-resolve/lib/ModuleTemplatesPlugin.js new file mode 100755 index 00000000..2962ee27 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModuleTemplatesPlugin.js @@ -0,0 +1,45 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var createInnerCallback = require("./createInnerCallback"); + +function ModuleTemplatesPlugin(moduleType, templates, targetModuleType) { + this.moduleType = moduleType; + this.targetModuleType = targetModuleType; + this.templates = templates; +} +module.exports = ModuleTemplatesPlugin; + +ModuleTemplatesPlugin.prototype.apply = function(resolver) { + var templates = this.templates; + var targetModuleType = this.targetModuleType; + resolver.plugin("module-" + this.moduleType, function(request, callback) { + var fs = this.fileSystem; + var topLevelCallback = callback; + var i = request.request.indexOf("/"), + j = request.request.indexOf("\\"); + var p = i < 0 ? j : j < 0 ? i : i < j ? i : j; + var moduleName, remainingRequest; + if(p < 0) { + moduleName = request.request; + remainingRequest = ""; + } else { + moduleName = request.request.substr(0, p); + remainingRequest = request.request.substr(p); + } + this.forEachBail(templates, function(template, callback) { + var moduleFinalName = template.replace(/\*/g, moduleName); + this.applyPluginsParallelBailResult("module-" + targetModuleType, { + path: request.path, + request: moduleFinalName + remainingRequest, + query: request.query, + directory: request.directory + }, createInnerCallback(function(err, result) { + if(err) return callback(err); + if(!result) return callback(); + return callback(null, result); + }, topLevelCallback, "module variation " + moduleFinalName)); + }.bind(this), callback); + }); +}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInDirectoriesPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInDirectoriesPlugin.js new file mode 100755 index 00000000..3b801c01 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModulesInDirectoriesPlugin.js @@ -0,0 +1,58 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var createInnerCallback = require("./createInnerCallback"); +var popPathSeqment = require("./popPathSeqment"); + +function ModulesInDirectoriesPlugin(moduleType, directories) { + this.moduleType = moduleType; + this.directories = directories; +} +module.exports = ModulesInDirectoriesPlugin; + +ModulesInDirectoriesPlugin.prototype.apply = function(resolver) { + var moduleType = this.moduleType; + var directories = this.directories; + resolver.plugin("module", function(request, callback) { + var fs = this.fileSystem; + var paths = [request.path]; + var addr = [request.path]; + var pathSeqment = popPathSeqment(addr); + var topLevelCallback = callback; + while(pathSeqment) { + paths.push(addr[0]); + pathSeqment = popPathSeqment(addr); + } + var addrs = paths.map(function(p) { + return directories.map(function(d) { + return this.join(p, d); + }, this); + }, this).reduce(function(array, p) { + array.push.apply(array, p); + return array; + }, []); + this.forEachBail(addrs, function(addr, callback) { + fs.stat(addr, function(err, stat) { + if(!err && stat && stat.isDirectory()) { + this.applyPluginsParallelBailResult("module-" + moduleType, { + path: addr, + request: request.request, + query: request.query, + directory: request.directory + }, createInnerCallback(function(err, result) { + if(err) return callback(err); + if(!result) return callback(); + return callback(null, result); + }, topLevelCallback, "looking for modules in " + addr)); + return; + } + return callback(); + }.bind(this)); + }.bind(this), function(err, result) { + if(err) return callback(err); + if(!result) return callback(); + return callback(null, result); + }); + }); +}; diff --git a/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js b/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js new file mode 100755 index 00000000..2b2ab6ae --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ModulesInRootPlugin.js @@ -0,0 +1,28 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var createInnerCallback = require("./createInnerCallback"); + +function ModulesInRootPlugin(moduleType, path) { + this.moduleType = moduleType; + this.path = path; +} +module.exports = ModulesInRootPlugin; + +ModulesInRootPlugin.prototype.apply = function(resolver) { + var moduleType = this.moduleType; + var path = this.path; + resolver.plugin("module", function(request, callback) { + this.applyPluginsParallelBailResult("module-" + moduleType, { + path: path, + request: request.request, + query: request.query, + directory: request.directory + }, createInnerCallback(function innerCallback(err, result) { + if(err) return callback(err); + if(!result) return callback(); + return callback(null, result); + }, callback, "looking for modules in " + path)); + }); +}; diff --git a/node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js b/node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js new file mode 100755 index 00000000..588095d8 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/NodeJsInputFileSystem.js @@ -0,0 +1,23 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var fs = require("graceful-fs"); + +function NodeJsInputFileSystem() {} +module.exports = NodeJsInputFileSystem; + +NodeJsInputFileSystem.prototype.isSync = function() { + return false; +}; + +NodeJsInputFileSystem.prototype.stat = fs.stat.bind(fs); +NodeJsInputFileSystem.prototype.readdir = function readdir(path, callback) { + fs.readdir(path, function (err, files) { + callback(err, files && files.map(function (file) { + return file.normalize ? file.normalize("NFC") : file; + })); + }); +}; +NodeJsInputFileSystem.prototype.readFile = fs.readFile.bind(fs); +NodeJsInputFileSystem.prototype.readlink = fs.readlink.bind(fs); \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/Resolver.js b/node_modules/enhanced-resolve/lib/Resolver.js new file mode 100755 index 00000000..62e57d92 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/Resolver.js @@ -0,0 +1,200 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var Tapable = require("tapable"); +var createInnerCallback = require("./createInnerCallback"); + +function Resolver(fileSystem) { + Tapable.call(this); + this.fileSystem = fileSystem; +} +module.exports = Resolver; + +Resolver.prototype = Object.create(Tapable.prototype); + +Resolver.prototype.resolveSync = function resolveSync(context, request) { + var err, result, sync = false; + this.resolve(context, request, function(e, r) { + err = e; + result = r; + sync = true; + }); + if(!sync) throw new Error("Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!"); + if(err) throw err; + return result; +}; + +Resolver.prototype.resolve = function resolve(context, request, callback) { + if(typeof request === "string") request = this.parse(request); + this.applyPlugins("resolve", context, request); + var obj = { + path: context, + request: request.path, + query: request.query, + directory: request.directory + }; + function onResolved(err, result) { + if(err) return callback(err); + return callback(null, result.path === false ? false : result.path + (result.query || "")); + } + onResolved.log = callback.log; + onResolved.missing = callback.missing; + if(request.module) return this.doResolve("module", obj, onResolved); + if(request.directory) return this.doResolve("directory", obj, onResolved); + return this.doResolve(["file", "directory"], obj, onResolved); +}; + +Resolver.prototype.doResolve = function doResolve(types, request, callback, noError) { + if(!Array.isArray(types)) types = [types]; + var stackLine = types.join(" or ") + ": (" + request.path + ") " + + (request.request || "") + (request.query || "") + + (request.directory ? " directory" : "") + + (request.module ? " module" : ""); + var newStack = [stackLine]; + if(callback.stack) { + newStack = callback.stack.concat(newStack); + if(callback.stack.indexOf(stackLine) >= 0) { + // Prevent recursion + var recursionError = new Error("Recursion in resolving\nStack:\n " + newStack.join("\n ")); + recursionError.recursion = true; + if(callback.log) callback.log("abort resolving because of recursion"); + return callback(recursionError); + } + } + this.applyPlugins("resolve-step", types, request); + var localMissing = []; + var missing = callback.missing ? { + push: function(item) { + callback.missing.push(item); + localMissing.push(item); + } + } : localMissing; + var log = []; + function writeLog(msg) { + log.push(msg); + } + function logAsString() { + return log.join("\n"); + } + var currentRequestString = request.request ? request.request + " in " + request.path : request.path; + if(types.length == 1 && !noError) { + // If only one type, we can pass the error. + return this.applyPluginsParallelBailResult(types[0], request, createInnerCallback(function innerCallback(err, result) { + if(callback.log) { + for(var i = 0; i < log.length; i++) + callback.log(log[i]); + } + if(err) return callback(err); + if(result) return callback(null, result); + if(types[0] === "result") return callback(null, request); + var error = new Error("Cannot resolve " + types[0] + " '" + request.request + "' in " + request.path); + error.details = logAsString(); + error.missing = localMissing; + return callback(error); + }, { + log: writeLog, + missing: missing, + stack: newStack + }, "resolve " + types[0] + " " + currentRequestString)); + } + // For multiple type we list the errors in the details although some of them are not important + this.forEachBail(types, function(type, callback) { + this.applyPluginsParallelBailResult(type, request, createInnerCallback(function(err, result) { + if(!err && result) return callback(result); + if (err) { + (err.message || "").split("\n").forEach(function(line) { + log.push(" " + line); + }); + } + callback(); + }, { + log: writeLog, + missing: missing, + stack: newStack + }, "resolve " + type)); + }.bind(this), function(result) { + if(callback.log) { + callback.log("resolve '" + types.join("' or '") + "' " + currentRequestString); + for(var i = 0; i < log.length; i++) + callback.log(" " + log[i]); + } + if(noError && !result) return callback(); + if(result) return callback(null, result); + var error = new Error("Cannot resolve '" + types.join("' or '") + "' " + currentRequestString); + error.details = logAsString(); + error.missing = localMissing; + return callback(error); + }); +}; + +Resolver.prototype.parse = function parse(identifier) { + if(identifier === "") return null; + var part = { + path: null, + query: null, + module: false, + directory: false, + file: false + }; + var idxQuery = identifier.indexOf("?"); + if(idxQuery == 0) { + part.query = identifier; + } else if(idxQuery > 0) { + part.path = identifier.slice(0, idxQuery); + part.query = identifier.slice(idxQuery); + } else { + part.path = identifier; + } + if(part.path) { + part.module = this.isModule(part.path); + if(part.directory = this.isDirectory(part.path)) { + part.path = part.path.substr(0, part.path.length - 1); + } + } + return part; +}; + +var notModuleRegExp = /^\.$|^\.[\\\/]|^\.\.$|^\.\.[\/\\]|^\/|^[A-Z]:[\\\/]/i; +Resolver.prototype.isModule = function isModule(path) { + return !notModuleRegExp.test(path); +}; + +var directoryRegExp = /[\/\\]$/i; +Resolver.prototype.isDirectory = function isDirectory(path) { + return directoryRegExp.test(path); +}; + +Resolver.prototype.join = require("memory-fs/lib/join"); + +Resolver.prototype.normalize = require("memory-fs/lib/normalize"); + +Resolver.prototype.forEachBail = function(array, iterator, callback) { + if(array.length == 0) return callback(); + var currentPos = array.length; + var currentError, currentResult; + var done = []; + for(var i = 0; i < array.length; i++) { + var itCb = (function(i) { + return function() { + if(i >= currentPos) return; // ignore + var args = Array.prototype.slice.call(arguments); + done.push(i); + if(args.length > 0) { + currentPos = i + 1; + done = done.filter(function(item) { + return item <= i; + }); + currentResult = args; + } + if(done.length == currentPos) { + callback.apply(null, currentResult); + currentPos = 0; + } + }; + }(i)); + iterator(array[i], itCb); + if(currentPos == 0) break; + } +}; + diff --git a/node_modules/enhanced-resolve/lib/ResultSymlinkPlugin.js b/node_modules/enhanced-resolve/lib/ResultSymlinkPlugin.js new file mode 100755 index 00000000..9d4fac2a --- /dev/null +++ b/node_modules/enhanced-resolve/lib/ResultSymlinkPlugin.js @@ -0,0 +1,49 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var popPathSeqment = require("./popPathSeqment"); + +function ResultSymlinkPlugin(appendings) { +} +module.exports = ResultSymlinkPlugin; + +ResultSymlinkPlugin.prototype.apply = function(resolver) { + resolver.plugin("result", function pluginMethod(request, callback) { + var fs = this.fileSystem; + var paths = [request.path]; + var pathSeqments = []; + var addr = [request.path]; + var pathSeqment = popPathSeqment(addr); + while(pathSeqment) { + pathSeqments.push(pathSeqment); + paths.push(addr[0]); + pathSeqment = popPathSeqment(addr); + } + pathSeqments.push(paths[paths.length-1]); + var log = callback.log; + var missing = callback.missing; + var containsSymlink = false; + this.forEachBail(paths.map(function(_, i) { return i; }), function(idx, callback) { + fs.readlink(paths[idx], function(err, result) { + if(!err && result) { + pathSeqments[idx] = result; + containsSymlink = true; + // Shortcut when absolute symlink found + if(/^(\/|[a-zA-z]:($|\\))/.test(result)) + return callback(null, idx); + } + callback(); + }); + }, function(err, idx) { + if(!containsSymlink) return callback(); + var resultSeqments = typeof idx === "number" ? pathSeqments.slice(0, idx+1) : pathSeqments.slice(); + var result = resultSeqments.reverse().reduce(function(a, b) { + return this.join(a, b); + }.bind(this)); + log("resolved symlink to " + result); + request.path = result; + pluginMethod.call(this, request, callback); + }.bind(this)); + }); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/SyncNodeJsInputFileSystem.js b/node_modules/enhanced-resolve/lib/SyncNodeJsInputFileSystem.js new file mode 100755 index 00000000..9fc036a7 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/SyncNodeJsInputFileSystem.js @@ -0,0 +1,34 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var fs = require("graceful-fs"); + +function SyncNodeJsInputFileSystem() {} +module.exports = SyncNodeJsInputFileSystem; + +SyncNodeJsInputFileSystem.prototype.isSync = function() { + return true; +}; + +function asAsync(fn, context) { + return function() { + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + try { + callback(null, fn.apply(context, args)); + } catch(e) { + callback(e); + } + }; +} + +SyncNodeJsInputFileSystem.prototype.stat = asAsync(fs.statSync, fs); +SyncNodeJsInputFileSystem.prototype.readdir = asAsync(function readdirSync(path) { + var files = fs.readdirSync(path); + return files && files.map(function (file) { + return file.normalize ? file.normalize("NFC") : file; + }); +}, fs); +SyncNodeJsInputFileSystem.prototype.readFile = asAsync(fs.readFileSync, fs); +SyncNodeJsInputFileSystem.prototype.readlink = asAsync(fs.readlinkSync, fs); \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js b/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js new file mode 100755 index 00000000..8806b1ca --- /dev/null +++ b/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js @@ -0,0 +1,32 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +function UnsafeCachePlugin(regExps, cache) { + this.regExps = regExps || [/./]; + if(this.regExps === true) this.regExps = [/./]; + else if(!Array.isArray(this.regExps)) this.regExps = [this.regExps]; + this.cache = cache || {}; +} +module.exports = UnsafeCachePlugin; + +UnsafeCachePlugin.prototype.apply = function(resolver) { + var oldResolve = resolver.resolve; + var regExps = this.regExps; + var cache = this.cache; + resolver.resolve = function resolve(context, request, callback) { + var id = context + "->" + request; + if(cache[id]) { + // From cache + return callback(null, cache[id]); + } + oldResolve.call(resolver, context, request, function(err, result) { + if(err) return callback(err); + var doCache = regExps.some(function(regExp) { + return regExp.test(result.path); + }); + if(!doCache) return callback(null, result); + callback(null, cache[id] = result); + }); + }; +}; diff --git a/node_modules/enhanced-resolve/lib/createInnerCallback.js b/node_modules/enhanced-resolve/lib/createInnerCallback.js new file mode 100755 index 00000000..66fc772a --- /dev/null +++ b/node_modules/enhanced-resolve/lib/createInnerCallback.js @@ -0,0 +1,30 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +module.exports = function createInnerCallback(callback, options, message) { + var log = options.log; + if(!log) { + if(options.stack !== callback.stack) { + function callbackWrapper() { + return callback.apply(this, arguments); + } + callbackWrapper.stack = options.stack; + callbackWrapper.missing = options.missing; + } + return callback; + } + function loggingCallbackWrapper() { + log(message); + for(var i = 0; i < theLog.length; i++) + log(" " + theLog[i]); + return callback.apply(this, arguments); + } + var theLog = []; + loggingCallbackWrapper.log = function writeLog(msg) { + theLog.push(msg); + }; + loggingCallbackWrapper.stack = options.stack; + loggingCallbackWrapper.missing = options.missing; + return loggingCallbackWrapper; +} \ No newline at end of file diff --git a/node_modules/enhanced-resolve/lib/node.js b/node_modules/enhanced-resolve/lib/node.js new file mode 100755 index 00000000..22c65905 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/node.js @@ -0,0 +1,103 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var Resolver = require("./Resolver"); +var NodeJsInputFileSystem = require("./NodeJsInputFileSystem"); +var SyncNodeJsInputFileSystem = require("./SyncNodeJsInputFileSystem"); +var CachedInputFileSystem = require("./CachedInputFileSystem"); +var ModulesInDirectoriesPlugin = require("./ModulesInDirectoriesPlugin"); +var ModuleTemplatesPlugin = require("./ModuleTemplatesPlugin"); +var ModuleAsFilePlugin = require("./ModuleAsFilePlugin"); +var ModuleAsDirectoryPlugin = require("./ModuleAsDirectoryPlugin"); +var DirectoryDefaultFilePlugin = require("./DirectoryDefaultFilePlugin"); +var DirectoryDescriptionFilePlugin = require("./DirectoryDescriptionFilePlugin"); +var FileAppendPlugin = require("./FileAppendPlugin"); +var ResultSymlinkPlugin = require("./ResultSymlinkPlugin"); +var DirectoryResultPlugin = require("./DirectoryResultPlugin"); + +var commonPlugins = [ + new ModulesInDirectoriesPlugin("node", ["node_modules"]), + new ModuleAsFilePlugin("node"), + new ModuleAsDirectoryPlugin("node"), + new DirectoryDescriptionFilePlugin("package.json", ["main"]), + new DirectoryDefaultFilePlugin(["index"]), + new FileAppendPlugin(["", ".js", ".node"]), + new ResultSymlinkPlugin() +]; + +var commonContextPlugins = [ + new ModulesInDirectoriesPlugin("node", ["node_modules"]), + new ModuleAsFilePlugin("node"), + new ModuleAsDirectoryPlugin("node"), + new DirectoryResultPlugin(), + new ResultSymlinkPlugin() +]; + +var commonLoaderPlugins = [ + new ModulesInDirectoriesPlugin("loader-module", ["node_loaders", "node_modules"]), + new ModuleTemplatesPlugin("loader-module", ["*-loader", "*"], "node"), + new ModuleAsFilePlugin("node"), + new ModuleAsDirectoryPlugin("node"), + new DirectoryDescriptionFilePlugin("package.json", ["loader", "main"]), + new DirectoryDefaultFilePlugin(["index"]), + new FileAppendPlugin([".loader.js", "", ".js"]), + new ResultSymlinkPlugin() +]; + +var asyncFileSystem = new CachedInputFileSystem(new NodeJsInputFileSystem(), 4000); +var syncFileSystem = new CachedInputFileSystem(new SyncNodeJsInputFileSystem(), 4000); + + +var asyncResolver = new Resolver(asyncFileSystem); +asyncResolver.apply.apply(asyncResolver, commonPlugins); +module.exports = function resolve(context, request, callback) { + asyncResolver.resolve(context, request, callback); +}; + +var syncResolver = new Resolver(syncFileSystem); +syncResolver.apply.apply(syncResolver, commonPlugins); +module.exports.sync = function resolveSync(context, request) { + return syncResolver.resolveSync(context, request); +}; + + +var asyncContextResolver = new Resolver(asyncFileSystem); +asyncContextResolver.apply.apply(asyncContextResolver, commonContextPlugins); +module.exports.context = function resolveContext(context, request, callback) { + asyncContextResolver.resolve(context, request, callback); +}; + +var syncContextResolver = new Resolver(syncFileSystem); +syncContextResolver.apply.apply(syncContextResolver, commonContextPlugins); +module.exports.context.sync = function resolveSync(context, request) { + return syncContextResolver.resolveSync(context, request); +}; + + +var asyncLoaderResolver = new Resolver(asyncFileSystem); +asyncLoaderResolver.apply.apply(asyncLoaderResolver, commonLoaderPlugins); +module.exports.loader = function resolveContext(context, request, callback) { + asyncLoaderResolver.resolve(context, request, callback); +}; + +var syncLoaderResolver = new Resolver(syncFileSystem); +syncLoaderResolver.apply.apply(syncLoaderResolver, commonLoaderPlugins); +module.exports.loader.sync = function resolveSync(context, request) { + return syncLoaderResolver.resolveSync(context, request); +}; + +// Export Resolver, FileSystems and Plugins +module.exports.Resolver = Resolver; +module.exports.NodeJsInputFileSystem = NodeJsInputFileSystem; +module.exports.SyncNodeJsInputFileSystem = SyncNodeJsInputFileSystem; +module.exports.CachedInputFileSystem = CachedInputFileSystem; +module.exports.ModulesInDirectoriesPlugin = ModulesInDirectoriesPlugin; +module.exports.ModuleAsDirectoryPlugin = ModuleAsDirectoryPlugin; +module.exports.DirectoryDefaultFilePlugin = DirectoryDefaultFilePlugin; +module.exports.DirectoryDescriptionFilePlugin = DirectoryDescriptionFilePlugin; +module.exports.FileAppendPlugin = FileAppendPlugin; +module.exports.DirectoryResultPlugin = DirectoryResultPlugin; +module.exports.ResultSymlinkPlugin = ResultSymlinkPlugin; +module.exports.ModuleAsFilePlugin = ModuleAsFilePlugin; +module.exports.ModuleTemplatesPlugin = ModuleTemplatesPlugin; diff --git a/node_modules/enhanced-resolve/lib/popPathSeqment.js b/node_modules/enhanced-resolve/lib/popPathSeqment.js new file mode 100755 index 00000000..7eea05c2 --- /dev/null +++ b/node_modules/enhanced-resolve/lib/popPathSeqment.js @@ -0,0 +1,13 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +module.exports = function popPathSeqment(pathInArray) { + var i = pathInArray[0].lastIndexOf("/"), + j = pathInArray[0].lastIndexOf("\\"); + var p = i < 0 ? j : j < 0 ? i : i < j ? j : i; + if(p < 0) return null; + var s = pathInArray[0].substr(p+1); + pathInArray[0] = pathInArray[0].substr(0, p || 1); + return s; +}; diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/.gitattributes b/node_modules/enhanced-resolve/node_modules/memory-fs/.gitattributes new file mode 100755 index 00000000..412eeda7 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/.npmignore b/node_modules/enhanced-resolve/node_modules/memory-fs/.npmignore new file mode 100755 index 00000000..d2b38602 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/.npmignore @@ -0,0 +1,65 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Deployed apps should consider commenting this line out: +# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git +node_modules + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Icon must ends with two \r. +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Windows +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/.travis.yml b/node_modules/enhanced-resolve/node_modules/memory-fs/.travis.yml new file mode 100755 index 00000000..1416d607 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.11" \ No newline at end of file diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/README.md b/node_modules/enhanced-resolve/node_modules/memory-fs/README.md new file mode 100755 index 00000000..450ef484 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/README.md @@ -0,0 +1,29 @@ +# memory-fs + +A simple in-memory filesystem. Holds data in a javascript object. + +``` javascript +var MemoryFileSystem = require("memory-fs"); +var fs = new MemoryFileSystem(); // Optionally pass a javascript object + +fs.mkdirpSync("/a/test/dir"); +fs.writeFileSync("/a/test/dir/file.txt", "Hello World"); +fs.readFileSync("/a/test/dir/file.txt"); // returns Buffer("Hello World") + +// Async variantes too +fs.unlink("/a/test/dir/file.txt", function(err) { + // ... +}); + +fs.readdirSync("/a/test"); // returns ["dir"] +fs.statSync("/a/test/dir").isDirectory(); // returns true +fs.rmdirSync("/a/test/dir"); + +fs.mkdirpSync("C:\\use\\windows\\style\\paths"); +``` + +## License + +Copyright (c) 2012-2014 Tobias Koppers + +MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystem.js b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystem.js new file mode 100755 index 00000000..118b3d23 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/MemoryFileSystem.js @@ -0,0 +1,225 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var normalize = require("./normalize"); + +function MemoryFileSystem(data) { + this.data = data || {}; +} +module.exports = MemoryFileSystem; + +function isDir(item) { + if(typeof item !== "object") return false; + return item[""] === true; +} + +function isFile(item) { + if(typeof item !== "object") return false; + return !item[""]; +} + +function pathToArray(path) { + path = normalize(path); + var nix = /^\//.test(path); + if(!nix) { + if(!/^[A-Za-z]:/.test(path)) throw new Error("Invalid path '" + path + "'"); + path = path.replace(/[\\\/]+/g, "\\"); // multi slashs + path = path.split(/[\\\/]/); + path[0] = path[0].toUpperCase(); + } else { + path = path.replace(/\/+/g, "/"); // multi slashs + path = path.substr(1).split("/"); + } + if(!path[path.length-1]) path.pop(); + return path; +} + +function trueFn() { return true; } +function falseFn() { return false; } + +MemoryFileSystem.prototype.statSync = function(_path) { + var path = pathToArray(_path); + var current = this.data; + for(var i = 0; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new Error("Path doesn't exist '" + _path + "'"); + current = current[path[i]]; + } + if(_path === "/" || isDir(current[path[i]])) { + return { + isFile: falseFn, + isDirectory: trueFn, + isBlockDevice: falseFn, + isCharacterDevice: falseFn, + isSymbolicLink: falseFn, + isFIFO: falseFn, + isSocket: falseFn + }; + } else if(isFile(current[path[i]])) { + return { + isFile: trueFn, + isDirectory: falseFn, + isBlockDevice: falseFn, + isCharacterDevice: falseFn, + isSymbolicLink: falseFn, + isFIFO: falseFn, + isSocket: falseFn + }; + } else + throw new Error("Path doesn't exist '" + _path + "'"); +}; + +MemoryFileSystem.prototype.readFileSync = function(_path, encoding) { + var path = pathToArray(_path); + var current = this.data; + for(var i = 0; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new Error("Path doesn't exist '" + _path + "'"); + current = current[path[i]]; + } + if(!isFile(current[path[i]])) { + if(isDir(current[path[i]])) + throw new Error("Cannot readFile on directory '" + _path + "'"); + else + throw new Error("Path doesn't exist '" + _path + "'"); + } + current = current[path[i]]; + return encoding ? current.toString(encoding) : current; +}; + +MemoryFileSystem.prototype.readdirSync = function(_path) { + if(_path === "/") return Object.keys(this.data).filter(Boolean); + var path = pathToArray(_path); + var current = this.data; + for(var i = 0; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new Error("Path doesn't exist '" + _path + "'"); + current = current[path[i]]; + } + if(!isDir(current[path[i]])) { + if(isFile(current[path[i]])) + throw new Error("Cannot readdir on file '" + _path + "'"); + else + throw new Error("Path doesn't exist '" + _path + "'"); + } + return Object.keys(current[path[i]]).filter(Boolean); +}; + +MemoryFileSystem.prototype.mkdirpSync = function(_path) { + var path = pathToArray(_path); + if(path.length === 0) return; + var current = this.data; + for(var i = 0; i < path.length; i++) { + if(isFile(current[path[i]])) + throw new Error("Path is a file '" + _path + "'"); + else if(!isDir(current[path[i]])) + current[path[i]] = {"":true}; + current = current[path[i]]; + } + return; +}; + +MemoryFileSystem.prototype.mkdirSync = function(_path) { + var path = pathToArray(_path); + if(path.length === 0) return; + var current = this.data; + for(var i = 0; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new Error("Path doesn't exist '" + _path + "'"); + current = current[path[i]]; + } + if(isDir(current[path[i]])) + throw new new Error("Directory already exist '" + _path + "'"); + else if(isFile(current[path[i]])) + throw new Error("Cannot mkdir on file '" + _path + "'"); + current[path[i]] = {"":true}; + return; +}; + +MemoryFileSystem.prototype._remove = function(_path, name, testFn) { + var path = pathToArray(_path); + if(path.length === 0) throw new Error("Path cannot be removed '" + _path + "'"); + var current = this.data; + for(var i = 0; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new Error("Path doesn't exist '" + _path + "'"); + current = current[path[i]]; + } + if(!testFn(current[path[i]])) + throw new Error("'" + name + "' doesn't exist '" + _path + "'"); + delete current[path[i]]; + return; +}; + +MemoryFileSystem.prototype.rmdirSync = function(_path) { + return this._remove(_path, "Directory", isDir); +}; + +MemoryFileSystem.prototype.unlinkSync = function(_path) { + return this._remove(_path, "File", isFile); +}; + +MemoryFileSystem.prototype.readlinkSync = function(_path) { + throw new Error("Path is not a link '" + _path + "'"); +}; + +MemoryFileSystem.prototype.writeFileSync = function(_path, content, encoding) { + if(!content && !encoding) throw new Error("No content"); + var path = pathToArray(_path); + if(path.length === 0) throw new Error("Path is not a file '" + _path + "'"); + var current = this.data; + for(var i = 0; i < path.length - 1; i++) { + if(!isDir(current[path[i]])) + throw new Error("Path doesn't exist '" + _path + "'"); + current = current[path[i]]; + } + if(isDir(current[path[i]])) + throw new Error("Cannot writeFile on directory '" + _path + "'"); + current[path[i]] = encoding || typeof content === "string" ? new Buffer(content, encoding) : content; + return; +}; + +MemoryFileSystem.prototype.join = require("./join"); + +MemoryFileSystem.prototype.normalize = normalize; + +// async functions + +["stat", "readdir", "mkdirp", "mkdir", "rmdir", "unlink", "readlink"].forEach(function(fn) { + MemoryFileSystem.prototype[fn] = function(path, callback) { + try { + var result = this[fn + "Sync"](path); + } catch(e) { + return callback(e); + } + return callback(null, result); + }; +}); + +MemoryFileSystem.prototype.readFile = function(path, optArg, callback) { + if(!callback) { + callback = optArg; + optArg = undefined; + } + try { + var result = this.readFileSync(path, optArg); + } catch(e) { + return callback(e); + } + return callback(null, result); +}; + +MemoryFileSystem.prototype.writeFile = function (path, content, encoding, callback) { + if(!callback) { + callback = encoding; + encoding = undefined; + } + try { + this.writeFileSync(path, content, encoding); + } catch(e) { + return callback(e); + } + return callback(); +}; diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/lib/join.js b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/join.js new file mode 100755 index 00000000..255e1755 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/join.js @@ -0,0 +1,14 @@ +var normalize = require("./normalize"); + +var absoluteWinRegExp = /^[A-Z]:([\\\/]|$)/i; +var absoluteNixRegExp = /^\//i; + +module.exports = function join(path, request) { + if(request == "") return normalize(path); + if(absoluteWinRegExp.test(request)) return normalize(request.replace(/\//g, "\\")); + if(absoluteNixRegExp.test(request)) return normalize(request); + if(path == "/") return normalize(path + request); + if(absoluteWinRegExp.test(path)) return normalize(path + "\\" + request.replace(/\//g, "\\")); + if(absoluteNixRegExp.test(path)) return normalize(path + "/" + request); + return normalize(path + "/" + request); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/lib/normalize.js b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/normalize.js new file mode 100755 index 00000000..04726d04 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/lib/normalize.js @@ -0,0 +1,38 @@ +var doubleSlashWinRegExp = /\\+/g; +var doubleSlashNixRegExp = /\/+/g; +var currentDirectoryWinMiddleRegExp = /\\(\.\\)+/; +var currentDirectoryWinEndRegExp = /\\\.$/; +var parentDirectoryWinMiddleRegExp = /\\+[^\\]+\\+\.\.\\/; +var parentDirectoryWinEndRegExp1 = /([A-Z]:\\)\\*[^\\]+\\+\.\.$/i; +var parentDirectoryWinEndRegExp2 = /\\+[^\\]+\\+\.\.$/; +var currentDirectoryNixMiddleRegExp = /\/+(\.\/)+/; +var currentDirectoryNixEndRegExp1 = /^\/+\.$/; +var currentDirectoryNixEndRegExp2 = /\/+\.$/; +var parentDirectoryNixMiddleRegExp = /(^|\/[^\/]+)\/+\.\.\/+/; +var parentDirectoryNixEndRegExp1 = /^\/[^\/]+\/+\.\.$/; +var parentDirectoryNixEndRegExp2 = /\/+[^\/]+\/+\.\.$/; +var parentDirectoryNixEndRegExp3 = /^\/+\.\.$/; + +// RegExp magic :) + +module.exports = function normalize(path) { + while(currentDirectoryWinMiddleRegExp.test(path)) + path = path.replace(currentDirectoryWinMiddleRegExp, "\\"); + path = path.replace(currentDirectoryWinEndRegExp, ""); + while(parentDirectoryWinMiddleRegExp.test(path)) + path = path.replace(parentDirectoryWinMiddleRegExp, "\\"); + path = path.replace(parentDirectoryWinEndRegExp1, "$1"); + path = path.replace(parentDirectoryWinEndRegExp2, ""); + + while(currentDirectoryNixMiddleRegExp.test(path)) + path = path.replace(currentDirectoryNixMiddleRegExp, "/"); + path = path.replace(currentDirectoryNixEndRegExp1, "/"); + path = path.replace(currentDirectoryNixEndRegExp2, ""); + while(parentDirectoryNixMiddleRegExp.test(path)) + path = path.replace(parentDirectoryNixMiddleRegExp, "/"); + path = path.replace(parentDirectoryNixEndRegExp1, "/"); + path = path.replace(parentDirectoryNixEndRegExp2, ""); + path = path.replace(parentDirectoryNixEndRegExp3, "/"); + + return path.replace(doubleSlashWinRegExp, "\\").replace(doubleSlashNixRegExp, "/"); +}; \ No newline at end of file diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/package.json b/node_modules/enhanced-resolve/node_modules/memory-fs/package.json new file mode 100755 index 00000000..6fd90f3c --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + { + "raw": "memory-fs@^0.2.0", + "scope": null, + "escapedName": "memory-fs", + "name": "memory-fs", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/enhanced-resolve" + ] + ], + "_from": "memory-fs@>=0.2.0 <0.3.0", + "_id": "memory-fs@0.2.0", + "_inCache": true, + "_location": "/enhanced-resolve/memory-fs", + "_npmUser": { + "name": "sokra", + "email": "tobias.koppers@googlemail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "memory-fs@^0.2.0", + "scope": null, + "escapedName": "memory-fs", + "name": "memory-fs", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/enhanced-resolve" + ], + "_resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", + "_shasum": "f2bb25368bc121e391c2520de92969caee0a0290", + "_shrinkwrap": null, + "_spec": "memory-fs@^0.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/enhanced-resolve", + "author": { + "name": "Tobias Koppers @sokra" + }, + "bugs": { + "url": "https://github.com/webpack/memory-fs/issues" + }, + "dependencies": {}, + "description": "A simple in-memory filesystem. Holds data in a javascript object.", + "devDependencies": { + "istanbul": "^0.2.13", + "mocha": "^1.20.1", + "should": "^4.0.4" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "f2bb25368bc121e391c2520de92969caee0a0290", + "tarball": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz" + }, + "gitHead": "b90785340f2adf4eed77c59bdda7742a51d16e5e", + "homepage": "https://github.com/webpack/memory-fs", + "keywords": [ + "fs", + "memory" + ], + "license": "MIT", + "main": "lib/MemoryFileSystem.js", + "maintainers": [ + { + "name": "sokra", + "email": "tobias.koppers@googlemail.com" + } + ], + "name": "memory-fs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/webpack/memory-fs.git" + }, + "scripts": { + "cover": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec", + "test": "mocha -R spec" + }, + "version": "0.2.0" +} diff --git a/node_modules/enhanced-resolve/node_modules/memory-fs/test/MemoryFileSystem.js b/node_modules/enhanced-resolve/node_modules/memory-fs/test/MemoryFileSystem.js new file mode 100755 index 00000000..49446181 --- /dev/null +++ b/node_modules/enhanced-resolve/node_modules/memory-fs/test/MemoryFileSystem.js @@ -0,0 +1,362 @@ +var should = require("should"); +var MemoryFileSystem = require("../lib/MemoryFileSystem"); + +describe("directory", function() { + it("should have a empty root directory as startup", function(done) { + var fs = new MemoryFileSystem(); + fs.readdirSync("/").should.be.eql([]); + var stat = fs.statSync("/"); + stat.isFile().should.be.eql(false); + stat.isDirectory().should.be.eql(true); + fs.readdir("/", function(err, files) { + if(err) throw err; + files.should.be.eql([]); + done(); + }); + }); + it("should make and remove directories (linux style)", function() { + var fs = new MemoryFileSystem(); + fs.mkdirSync("/test"); + fs.mkdirSync("/test//sub/"); + fs.mkdirpSync("/test/sub2"); + fs.mkdirSync("/root\\dir"); + fs.mkdirpSync("/"); + fs.mkdirSync("/"); + fs.readdirSync("/").should.be.eql(["test", "root\\dir"]); + fs.readdirSync("/test/").should.be.eql(["sub", "sub2"]); + fs.rmdirSync("/test/sub//"); + fs.readdirSync("//test").should.be.eql(["sub2"]); + fs.rmdirSync("/test/sub2"); + fs.rmdirSync("/test"); + (function() { + fs.readdirSync("/test"); + }).should.throw(); + fs.readdirSync("/").should.be.eql(["root\\dir"]); + fs.mkdirpSync("/a/depth/sub/dir"); + var stat = fs.statSync("/a/depth/sub"); + stat.isFile().should.be.eql(false); + stat.isDirectory().should.be.eql(true); + }); + it("should make and remove directories (windows style)", function() { + var fs = new MemoryFileSystem(); + fs.mkdirSync("C:\\"); + fs.mkdirSync("C:\\test"); + fs.mkdirSync("C:\\test\\\\sub/"); + fs.mkdirpSync("c:\\test/sub2"); + fs.mkdirSync("C:\\root-dir"); + fs.readdirSync("C:").should.be.eql(["test", "root-dir"]); + fs.readdirSync("C:/test/").should.be.eql(["sub", "sub2"]); + fs.rmdirSync("C:/test\\sub\\\\"); + fs.readdirSync("C:\\\\test").should.be.eql(["sub2"]); + fs.rmdirSync("C:\\test\\sub2"); + fs.rmdirSync("C:\\test"); + (function() { + fs.readdirSync("C:\\test"); + }).should.throw(); + fs.readdirSync("C:").should.be.eql(["root-dir"]); + fs.mkdirpSync("D:\\a\\depth\\sub\\dir"); + var stat = fs.statSync("D:\\a\\depth\\sub"); + stat.isFile().should.be.eql(false); + stat.isDirectory().should.be.eql(true); + fs.readdirSync("D:\\//a/depth/\\sub").should.be.eql(["dir"]); + }); +}); +describe("files", function() { + it("should make and remove files", function() { + var fs = new MemoryFileSystem(); + fs.mkdirSync("/test"); + var buf = new Buffer("Hello World", "utf-8"); + fs.writeFileSync("/test/hello-world.txt", buf); + fs.readFileSync("/test/hello-world.txt").should.be.eql(buf); + fs.readFileSync("/test/hello-world.txt", "utf-8").should.be.eql("Hello World"); + (function() { + fs.readFileSync("/test/other-file"); + }).should.throw(); + (function() { + fs.readFileSync("/test/other-file", "utf-8"); + }).should.throw(); + fs.writeFileSync("/a", "Test", "utf-8"); + fs.readFileSync("/a", "utf-8").should.be.eql("Test"); + var stat = fs.statSync("/a"); + stat.isFile().should.be.eql(true); + stat.isDirectory().should.be.eql(false); + }); +}); +describe("errors", function() { + it("should fail on invalid paths", function() { + var fs = new MemoryFileSystem(); + fs.mkdirpSync("/test/a/b/c"); + fs.mkdirpSync("/test/a/bc"); + fs.mkdirpSync("/test/abc"); + (function() { + fs.mkdirpSync("xyz"); + }).should.throw(); + (function() { + fs.readdirSync("/test/abc/a/b/c"); + }).should.throw(); + (function() { + fs.readdirSync("/abc"); + }).should.throw(); + (function() { + fs.statSync("/abc"); + }).should.throw(); + (function() { + fs.mkdirSync("/test/a/d/b/c"); + }).should.throw(); + (function() { + fs.writeFileSync("/test/a/d/b/c", "Hello"); + }).should.throw(); + (function() { + fs.readFileSync("/test/a/d/b/c"); + }).should.throw(); + (function() { + fs.readFileSync("/test/abcd"); + }).should.throw(); + (function() { + fs.mkdirSync("/test/abcd/dir"); + }).should.throw(); + (function() { + fs.unlinkSync("/test/abcd"); + }).should.throw(); + (function() { + fs.unlinkSync("/test/abcd/file"); + }).should.throw(); + (function() { + fs.statSync("/test/a/d/b/c"); + }).should.throw(); + (function() { + fs.statSync("/test/abcd"); + }).should.throw(); + fs.mkdir("/test/a/d/b/c", function(err) { + err.should.be.instanceof(Error); + }); + }); + it("should fail incorrect arguments", function() { + var fs = new MemoryFileSystem(); + (function() { + fs.writeFileSync("/test"); + }).should.throw(); + }); + it("should fail on wrong type", function() { + var fs = new MemoryFileSystem(); + fs.mkdirpSync("/test/dir"); + fs.mkdirpSync("/test/dir"); + fs.writeFileSync("/test/file", "Hello"); + (function() { + fs.writeFileSync("/test/dir", "Hello"); + }).should.throw(); + (function() { + fs.readFileSync("/test/dir"); + }).should.throw(); + (function() { + fs.writeFileSync("/", "Hello"); + }).should.throw(); + (function() { + fs.rmdirSync("/"); + }).should.throw(); + (function() { + fs.unlinkSync("/"); + }).should.throw(); + (function() { + fs.mkdirSync("/test/dir"); + }).should.throw(); + (function() { + fs.mkdirSync("/test/file"); + }).should.throw(); + (function() { + fs.mkdirpSync("/test/file"); + }).should.throw(); + (function() { + fs.readdirSync("/test/file"); + }).should.throw(); + fs.readdirSync("/test/").should.be.eql(["dir", "file"]); + }); + it("should throw on readlink", function() { + var fs = new MemoryFileSystem(); + fs.mkdirpSync("/test/dir"); + (function() { + fs.readlinkSync("/"); + }).should.throw(); + (function() { + fs.readlinkSync("/link"); + }).should.throw(); + (function() { + fs.readlinkSync("/test"); + }).should.throw(); + (function() { + fs.readlinkSync("/test/dir"); + }).should.throw(); + (function() { + fs.readlinkSync("/test/dir/link"); + }).should.throw(); + }); +}); +describe("async", function() { + it("should be able to use the async versions", function(done) { + var fs = new MemoryFileSystem(); + fs.mkdirp("/test/dir", function(err) { + if(err) throw err; + fs.writeFile("/test/dir/a", "Hello", function(err) { + if(err) throw err; + fs.writeFile("/test/dir/b", "World", "utf-8", function(err) { + if(err) throw err; + fs.readFile("/test/dir/a", "utf-8", function(err, content) { + if(err) throw err; + content.should.be.eql("Hello"); + fs.readFile("/test/dir/b", function(err, content) { + if(err) throw err; + content.should.be.eql(new Buffer("World")); + done(); + }); + }); + }); + }); + }); + }); + it("should return errors", function(done) { + var fs = new MemoryFileSystem(); + fs.readFile("/fail/file", function(err, content) { + err.should.be.instanceof(Error); + fs.writeFile("/fail/file", "", function(err) { + err.should.be.instanceof(Error); + done(); + }); + }); + }); +}); +describe("normalize", function() { + it("should normalize paths", function() { + var fs = new MemoryFileSystem(); + fs.normalize("/a/b/c").should.be.eql("/a/b/c"); + fs.normalize("/a//b/c").should.be.eql("/a/b/c"); + fs.normalize("/a//b//c").should.be.eql("/a/b/c"); + fs.normalize("//a//b//c").should.be.eql("/a/b/c"); + fs.normalize("/a/////b/c").should.be.eql("/a/b/c"); + fs.normalize("/./a/d///..////b/c").should.be.eql("/a/b/c"); + fs.normalize("/..").should.be.eql("/"); + fs.normalize("/.").should.be.eql("/"); + fs.normalize("/.git").should.be.eql("/.git"); + fs.normalize("/a/b/c/.git").should.be.eql("/a/b/c/.git"); + fs.normalize("/a/b/c/..git").should.be.eql("/a/b/c/..git"); + fs.normalize("/a/b/c/..").should.be.eql("/a/b"); + fs.normalize("/a/b/c/../..").should.be.eql("/a"); + fs.normalize("/a/b/c/../../..").should.be.eql("/"); + fs.normalize("C:\\a\\..").should.be.eql("C:\\"); + fs.normalize("C:\\a\\b\\..").should.be.eql("C:\\a"); + fs.normalize("C:\\a\\b\\\c\\..\\..").should.be.eql("C:\\a"); + fs.normalize("C:\\a\\b\\d\\..\\c\\..\\..").should.be.eql("C:\\a"); + fs.normalize("C:\\a\\b\\d\\\\.\\\\.\\c\\.\\..").should.be.eql("C:\\a\\b\\d"); + }); +}); +describe("join", function() { + it("should join paths", function() { + var fs = new MemoryFileSystem(); + fs.join("/", "a/b/c").should.be.eql("/a/b/c"); + fs.join("/a", "b/c").should.be.eql("/a/b/c"); + fs.join("/a/b", "c").should.be.eql("/a/b/c"); + fs.join("/a/", "b/c").should.be.eql("/a/b/c"); + fs.join("/a//", "b/c").should.be.eql("/a/b/c"); + fs.join("a", "b/c").should.be.eql("a/b/c"); + fs.join("a/b", "c").should.be.eql("a/b/c"); + fs.join("C:", "a/b").should.be.eql("C:\\a\\b"); + fs.join("C:\\", "a/b").should.be.eql("C:\\a\\b"); + fs.join("C:\\", "a\\b").should.be.eql("C:\\a\\b"); + }); + it("should join paths (weird cases)", function() { + var fs = new MemoryFileSystem(); + fs.join("/", "").should.be.eql("/"); + fs.join("/a/b/", "").should.be.eql("/a/b/"); + fs.join("/a/b/c", "").should.be.eql("/a/b/c"); + fs.join("C:", "").should.be.eql("C:"); + fs.join("C:\\a\\b", "").should.be.eql("C:\\a\\b"); + }); + it("should join paths (absolute request)", function() { + var fs = new MemoryFileSystem(); + fs.join("/a/b/c", "/d/e/f").should.be.eql("/d/e/f"); + fs.join("C:\\a\\b\\c", "/d/e/f").should.be.eql("/d/e/f"); + fs.join("/a/b/c", "C:\\d\\e\\f").should.be.eql("C:\\d\\e\\f"); + fs.join("C:\\a\\b\\c", "C:\\d\\e\\f").should.be.eql("C:\\d\\e\\f"); + }); +}); +describe("os", function() { + var fileSystem; + + beforeEach(function() { + fileSystem = new MemoryFileSystem({ + "": true, + a: { + "": true, + index: new Buffer("1"), // /a/index + dir: { + "": true, + index: new Buffer("2") // /a/dir/index + } + }, + "C:": { + "": true, + a: { + "": true, + index: new Buffer("3"), // C:\files\index + dir: { + "": true, + index: new Buffer("4") // C:\files\a\index + } + } + } + }); + }); + + describe("unix", function() { + it("should stat stuff", function() { + fileSystem.statSync("/a").isDirectory().should.be.eql(true); + fileSystem.statSync("/a").isFile().should.be.eql(false); + fileSystem.statSync("/a/index").isDirectory().should.be.eql(false); + fileSystem.statSync("/a/index").isFile().should.be.eql(true); + fileSystem.statSync("/a/dir").isDirectory().should.be.eql(true); + fileSystem.statSync("/a/dir").isFile().should.be.eql(false); + fileSystem.statSync("/a/dir/index").isDirectory().should.be.eql(false); + fileSystem.statSync("/a/dir/index").isFile().should.be.eql(true); + }); + it("should readdir directories", function() { + fileSystem.readdirSync("/a").should.be.eql(["index", "dir"]); + fileSystem.readdirSync("/a/dir").should.be.eql(["index"]); + }); + it("should readdir directories", function() { + fileSystem.readFileSync("/a/index", "utf-8").should.be.eql("1"); + fileSystem.readFileSync("/a/dir/index", "utf-8").should.be.eql("2"); + }); + it("should also accept multi slashs", function() { + fileSystem.statSync("/a///dir//index").isFile().should.be.eql(true); + }); + }); + + describe("windows", function() { + it("should stat stuff", function() { + fileSystem.statSync("C:\\a").isDirectory().should.be.eql(true); + fileSystem.statSync("C:\\a").isFile().should.be.eql(false); + fileSystem.statSync("C:\\a\\index").isDirectory().should.be.eql(false); + fileSystem.statSync("C:\\a\\index").isFile().should.be.eql(true); + fileSystem.statSync("C:\\a\\dir").isDirectory().should.be.eql(true); + fileSystem.statSync("C:\\a\\dir").isFile().should.be.eql(false); + fileSystem.statSync("C:\\a\\dir\\index").isDirectory().should.be.eql(false); + fileSystem.statSync("C:\\a\\dir\\index").isFile().should.be.eql(true); + }); + it("should readdir directories", function() { + fileSystem.readdirSync("C:\\a").should.be.eql(["index", "dir"]); + fileSystem.readdirSync("C:\\a\\dir").should.be.eql(["index"]); + }); + it("should readdir directories", function() { + fileSystem.readFileSync("C:\\a\\index", "utf-8").should.be.eql("3"); + fileSystem.readFileSync("C:\\a\\dir\\index", "utf-8").should.be.eql("4"); + }); + it("should also accept multi slashs", function() { + fileSystem.statSync("C:\\\\a\\\\\\dir\\\\index").isFile().should.be.eql(true); + }); + it("should also accept a normal slash", function() { + fileSystem.statSync("C:\\a\\dir/index").isFile().should.be.eql(true); + fileSystem.statSync("C:\\a\\dir\\index").isFile().should.be.eql(true); + fileSystem.statSync("C:\\a/dir/index").isFile().should.be.eql(true); + fileSystem.statSync("C:\\a/dir\\index").isFile().should.be.eql(true); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/enhanced-resolve/package.json b/node_modules/enhanced-resolve/package.json new file mode 100755 index 00000000..482a4435 --- /dev/null +++ b/node_modules/enhanced-resolve/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "enhanced-resolve@~0.9.0", + "scope": null, + "escapedName": "enhanced-resolve", + "name": "enhanced-resolve", + "rawSpec": "~0.9.0", + "spec": ">=0.9.0 <0.10.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack" + ] + ], + "_from": "enhanced-resolve@>=0.9.0 <0.10.0", + "_id": "enhanced-resolve@0.9.1", + "_inCache": true, + "_location": "/enhanced-resolve", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "sokra", + "email": "tobias.koppers@googlemail.com" + }, + "_npmVersion": "3.3.3", + "_phantomChildren": {}, + "_requested": { + "raw": "enhanced-resolve@~0.9.0", + "scope": null, + "escapedName": "enhanced-resolve", + "name": "enhanced-resolve", + "rawSpec": "~0.9.0", + "spec": ">=0.9.0 <0.10.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz", + "_shasum": "4d6e689b3725f86090927ccc86cd9f1635b89e2e", + "_shrinkwrap": null, + "_spec": "enhanced-resolve@~0.9.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack", + "author": { + "name": "Tobias Koppers @sokra" + }, + "bugs": { + "url": "https://github.com/webpack/enhanced-resolve/issues" + }, + "dependencies": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.2.0", + "tapable": "^0.1.8" + }, + "description": "Offers a async require.resolve function. It's highly configurable.", + "devDependencies": { + "istanbul": "^0.3.5", + "mocha": "^2.1.0", + "should": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "4d6e689b3725f86090927ccc86cd9f1635b89e2e", + "tarball": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz" + }, + "engines": { + "node": ">=0.6" + }, + "files": [ + "lib" + ], + "gitHead": "1d14a6debbe4054f84d7d7f870ca0a1cb963f75b", + "homepage": "http://github.com/webpack/enhanced-resolve", + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "main": "lib/node.js", + "maintainers": [ + { + "name": "sokra", + "email": "tobias.koppers@googlemail.com" + } + ], + "name": "enhanced-resolve", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/webpack/enhanced-resolve.git" + }, + "scripts": { + "cover": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec", + "test": "mocha --reporter spec" + }, + "version": "0.9.1" +} diff --git a/node_modules/errno/.jshintrc b/node_modules/errno/.jshintrc new file mode 100755 index 00000000..c8ef3ca4 --- /dev/null +++ b/node_modules/errno/.jshintrc @@ -0,0 +1,59 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": false + , "passfail": false +} \ No newline at end of file diff --git a/node_modules/errno/.npmignore b/node_modules/errno/.npmignore new file mode 100755 index 00000000..b512c09d --- /dev/null +++ b/node_modules/errno/.npmignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/node_modules/errno/README.md b/node_modules/errno/README.md new file mode 100755 index 00000000..2c1f8a52 --- /dev/null +++ b/node_modules/errno/README.md @@ -0,0 +1,141 @@ +# node-errno + +Better [libuv](https://github.com/libuv/libuv)/[Node.js](https://nodejs.org)/[io.js](https://iojs.org) error handling & reporting. Available in npm as *errno*. + +* [errno exposed](#errnoexposed) +* [Custom errors](#customerrors) + + +## errno exposed + +Ever find yourself needing more details about Node.js errors? Me too, so *node-errno* contains the errno mappings direct from libuv so you can use them in your code. + +**By errno:** + +```js +require('errno').errno[3] +// → { +// "errno": 3, +// "code": "EACCES", +// "description": "permission denied" +// } +``` + +**By code:** + +```js +require('errno').code.ENOTEMPTY +// → { +// "errno": 53, +// "code": "ENOTEMPTY", +// "description": "directory not empty" +// } +``` + +**Make your errors more descriptive:** + +```js +var errno = require('errno') + +function errmsg(err) { + var str = 'Error: ' + // if it's a libuv error then get the description from errno + if (errno.errno[err.errno]) + str += errno.errno[err.errno].description + else + str += err.message + + // if it's a `fs` error then it'll have a 'path' property + if (err.path) + str += ' [' + err.path + ']' + + return str +} + +var fs = require('fs') + +fs.readFile('thisisnotarealfile.txt', function (err, data) { + if (err) + console.log(errmsg(err)) +}) +``` + +**Use as a command line tool:** + +``` +~ $ errno 53 +{ + "errno": 53, + "code": "ENOTEMPTY", + "description": "directory not empty" +} +~ $ errno EROFS +{ + "errno": 56, + "code": "EROFS", + "description": "read-only file system" +} +~ $ errno foo +No such errno/code: "foo" +``` + +Supply no arguments for the full list. Error codes are processed case-insensitive. + +You will need to install with `npm install errno -g` if you want the `errno` command to be available without supplying a full path to the node_modules installation. + + +## Custom errors + +Use `errno.custom.createError()` to create custom `Error` objects to throw around in your Node.js library. Create error heirachies so `instanceof` becomes a useful tool in tracking errors. Call-stack is correctly captured at the time you create an instance of the error object, plus a `cause` property will make available the original error object if you pass one in to the constructor. + +```js +var create = require('errno').custom.createError +var MyError = create('MyError') // inherits from Error +var SpecificError = create('SpecificError', MyError) // inherits from MyError +var OtherError = create('OtherError', MyError) + +// use them! +if (condition) throw new SpecificError('Eeek! Something bad happened') + +if (err) return callback(new OtherError(err)) +``` + +Also available is a `errno.custom.FilesystemError` with in-built access to errno properties: + +```js +fs.readFile('foo', function (err, data) { + if (err) return callback(new errno.custom.FilesystemError(err)) + // do something else +}) +``` + +The resulting error object passed through the callback will have the following properties: `code`, `errno`, `path` and `message` will contain a descriptive human-readable message. + +## Contributors + +* [bahamas10](https://github.com/bahamas10) (Dave Eddy) - Added CLI +* [ralphtheninja](https://github.com/ralphtheninja) (Lars-Magnus Skog) + +## Copyright & Licence + +*Copyright (c) 2012-2015 [Rod Vagg](https://github.com/rvagg) ([@rvagg](https://twitter.com/rvagg))* + +Made available under the MIT licence: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/errno/build.js b/node_modules/errno/build.js new file mode 100755 index 00000000..fce89260 --- /dev/null +++ b/node_modules/errno/build.js @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +var request = require('request') + , fs = require('fs') + + , uvheadloc = 'https://raw.github.com/joyent/libuv/master/include/uv.h' + , defreg = /^\s*XX\(\s*([\-\d]+),\s*([A-Z]+),\s*"([^"]*)"\s*\)\s*\\?$/ + + +request(uvheadloc, function (err, response) { + if (err) + throw err + + var data, out + + data = response.body + .split('\n') + .map(function (line) { return line.match(defreg) }) + .filter(function (match) { return match }) + .map(function (match) { return { + errno: parseInt(match[1], 10) + , code: match[2] + , description: match[3] + }}) + + out = 'var all = module.exports.all = ' + JSON.stringify(data, 0, 1) + '\n\n' + + out += '\nmodule.exports.errno = {\n ' + + data.map(function (e, i) { + return '\'' + e.errno + '\': all[' + i + ']' + }).join('\n , ') + + '\n}\n\n' + + out += '\nmodule.exports.code = {\n ' + + data.map(function (e, i) { + return '\'' + e.code + '\': all[' + i + ']' + }).join('\n , ') + + '\n}\n\n' + + out += '\nmodule.exports.custom = require("./custom")(module.exports)\n' + + fs.writeFile('errno.js', out) +}) \ No newline at end of file diff --git a/node_modules/errno/cli.js b/node_modules/errno/cli.js new file mode 100755 index 00000000..f841771b --- /dev/null +++ b/node_modules/errno/cli.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node + +var errno = require('./') + , arg = process.argv[2] + , data, code + +if (arg === undefined) + return console.log(JSON.stringify(errno.code, null, 2)) + +if ((code = +arg) == arg) + data = errno.errno[code] +else + data = errno.code[arg] || errno.code[arg.toUpperCase()] + +if (data) + console.log(JSON.stringify(data, null, 2)) +else { + console.error('No such errno/code: "' + arg + '"') + process.exit(1) +} \ No newline at end of file diff --git a/node_modules/errno/custom.js b/node_modules/errno/custom.js new file mode 100755 index 00000000..7be16c1e --- /dev/null +++ b/node_modules/errno/custom.js @@ -0,0 +1,55 @@ +var prr = require('prr') + +function init (type, message, cause) { + prr(this, { + type : type + , name : type + // can be passed just a 'cause' + , cause : typeof message != 'string' ? message : cause + , message : !!message && typeof message != 'string' ? message.message : message + + }, 'ewr') +} + +// generic prototype, not intended to be actually used - helpful for `instanceof` +function CustomError (message, cause) { + Error.call(this) + if (Error.captureStackTrace) + Error.captureStackTrace(this, arguments.callee) + init.call(this, 'CustomError', message, cause) +} + +CustomError.prototype = new Error() + +function createError (errno, type, proto) { + var err = function (message, cause) { + init.call(this, type, message, cause) + //TODO: the specificity here is stupid, errno should be available everywhere + if (type == 'FilesystemError') { + this.code = this.cause.code + this.path = this.cause.path + this.errno = this.cause.errno + this.message = + (errno.errno[this.cause.errno] + ? errno.errno[this.cause.errno].description + : this.cause.message) + + (this.cause.path ? ' [' + this.cause.path + ']' : '') + } + Error.call(this) + if (Error.captureStackTrace) + Error.captureStackTrace(this, arguments.callee) + } + err.prototype = !!proto ? new proto() : new CustomError() + return err +} + +module.exports = function (errno) { + var ce = function (type, proto) { + return createError(errno, type, proto) + } + return { + CustomError : CustomError + , FilesystemError : ce('FilesystemError') + , createError : ce + } +} diff --git a/node_modules/errno/errno.js b/node_modules/errno/errno.js new file mode 100755 index 00000000..efb79d41 --- /dev/null +++ b/node_modules/errno/errno.js @@ -0,0 +1,313 @@ +var all = module.exports.all = [ + { + errno: -2, + code: 'ENOENT', + description: 'no such file or directory' + }, + { + errno: -1, + code: 'UNKNOWN', + description: 'unknown error' + }, + { + errno: 0, + code: 'OK', + description: 'success' + }, + { + errno: 1, + code: 'EOF', + description: 'end of file' + }, + { + errno: 2, + code: 'EADDRINFO', + description: 'getaddrinfo error' + }, + { + errno: 3, + code: 'EACCES', + description: 'permission denied' + }, + { + errno: 4, + code: 'EAGAIN', + description: 'resource temporarily unavailable' + }, + { + errno: 5, + code: 'EADDRINUSE', + description: 'address already in use' + }, + { + errno: 6, + code: 'EADDRNOTAVAIL', + description: 'address not available' + }, + { + errno: 7, + code: 'EAFNOSUPPORT', + description: 'address family not supported' + }, + { + errno: 8, + code: 'EALREADY', + description: 'connection already in progress' + }, + { + errno: 9, + code: 'EBADF', + description: 'bad file descriptor' + }, + { + errno: 10, + code: 'EBUSY', + description: 'resource busy or locked' + }, + { + errno: 11, + code: 'ECONNABORTED', + description: 'software caused connection abort' + }, + { + errno: 12, + code: 'ECONNREFUSED', + description: 'connection refused' + }, + { + errno: 13, + code: 'ECONNRESET', + description: 'connection reset by peer' + }, + { + errno: 14, + code: 'EDESTADDRREQ', + description: 'destination address required' + }, + { + errno: 15, + code: 'EFAULT', + description: 'bad address in system call argument' + }, + { + errno: 16, + code: 'EHOSTUNREACH', + description: 'host is unreachable' + }, + { + errno: 17, + code: 'EINTR', + description: 'interrupted system call' + }, + { + errno: 18, + code: 'EINVAL', + description: 'invalid argument' + }, + { + errno: 19, + code: 'EISCONN', + description: 'socket is already connected' + }, + { + errno: 20, + code: 'EMFILE', + description: 'too many open files' + }, + { + errno: 21, + code: 'EMSGSIZE', + description: 'message too long' + }, + { + errno: 22, + code: 'ENETDOWN', + description: 'network is down' + }, + { + errno: 23, + code: 'ENETUNREACH', + description: 'network is unreachable' + }, + { + errno: 24, + code: 'ENFILE', + description: 'file table overflow' + }, + { + errno: 25, + code: 'ENOBUFS', + description: 'no buffer space available' + }, + { + errno: 26, + code: 'ENOMEM', + description: 'not enough memory' + }, + { + errno: 27, + code: 'ENOTDIR', + description: 'not a directory' + }, + { + errno: 28, + code: 'EISDIR', + description: 'illegal operation on a directory' + }, + { + errno: 29, + code: 'ENONET', + description: 'machine is not on the network' + }, + { + errno: 31, + code: 'ENOTCONN', + description: 'socket is not connected' + }, + { + errno: 32, + code: 'ENOTSOCK', + description: 'socket operation on non-socket' + }, + { + errno: 33, + code: 'ENOTSUP', + description: 'operation not supported on socket' + }, + { + errno: 34, + code: 'ENOENT', + description: 'no such file or directory' + }, + { + errno: 35, + code: 'ENOSYS', + description: 'function not implemented' + }, + { + errno: 36, + code: 'EPIPE', + description: 'broken pipe' + }, + { + errno: 37, + code: 'EPROTO', + description: 'protocol error' + }, + { + errno: 38, + code: 'EPROTONOSUPPORT', + description: 'protocol not supported' + }, + { + errno: 39, + code: 'EPROTOTYPE', + description: 'protocol wrong type for socket' + }, + { + errno: 40, + code: 'ETIMEDOUT', + description: 'connection timed out' + }, + { + errno: 41, + code: 'ECHARSET', + description: 'invalid Unicode character' + }, + { + errno: 42, + code: 'EAIFAMNOSUPPORT', + description: 'address family for hostname not supported' + }, + { + errno: 44, + code: 'EAISERVICE', + description: 'servname not supported for ai_socktype' + }, + { + errno: 45, + code: 'EAISOCKTYPE', + description: 'ai_socktype not supported' + }, + { + errno: 46, + code: 'ESHUTDOWN', + description: 'cannot send after transport endpoint shutdown' + }, + { + errno: 47, + code: 'EEXIST', + description: 'file already exists' + }, + { + errno: 48, + code: 'ESRCH', + description: 'no such process' + }, + { + errno: 49, + code: 'ENAMETOOLONG', + description: 'name too long' + }, + { + errno: 50, + code: 'EPERM', + description: 'operation not permitted' + }, + { + errno: 51, + code: 'ELOOP', + description: 'too many symbolic links encountered' + }, + { + errno: 52, + code: 'EXDEV', + description: 'cross-device link not permitted' + }, + { + errno: 53, + code: 'ENOTEMPTY', + description: 'directory not empty' + }, + { + errno: 54, + code: 'ENOSPC', + description: 'no space left on device' + }, + { + errno: 55, + code: 'EIO', + description: 'i/o error' + }, + { + errno: 56, + code: 'EROFS', + description: 'read-only file system' + }, + { + errno: 57, + code: 'ENODEV', + description: 'no such device' + }, + { + errno: 58, + code: 'ESPIPE', + description: 'invalid seek' + }, + { + errno: 59, + code: 'ECANCELED', + description: 'operation canceled' + } +] + +module.exports.errno = {} +module.exports.code = {} + +all.forEach(function (error) { + module.exports.errno[error.errno] = error + module.exports.code[error.code] = error +}) + +module.exports.custom = require('./custom')(module.exports) +module.exports.create = module.exports.custom.createError diff --git a/node_modules/errno/package.json b/node_modules/errno/package.json new file mode 100755 index 00000000..6d55b9ea --- /dev/null +++ b/node_modules/errno/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + { + "raw": "errno@^0.1.3", + "scope": null, + "escapedName": "errno", + "name": "errno", + "rawSpec": "^0.1.3", + "spec": ">=0.1.3 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/memory-fs" + ] + ], + "_from": "errno@>=0.1.3 <0.2.0", + "_id": "errno@0.1.4", + "_inCache": true, + "_location": "/errno", + "_nodeVersion": "3.0.0", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "2.13.3", + "_phantomChildren": {}, + "_requested": { + "raw": "errno@^0.1.3", + "scope": null, + "escapedName": "errno", + "name": "errno", + "rawSpec": "^0.1.3", + "spec": ">=0.1.3 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/memory-fs", + "/webpack-dev-middleware/memory-fs" + ], + "_resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", + "_shasum": "b896e23a9e5e8ba33871fc996abd3635fc9a1c7d", + "_shrinkwrap": null, + "_spec": "errno@^0.1.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/memory-fs", + "authors": [ + "Rod Vagg @rvagg (https://github.com/rvagg)" + ], + "bin": { + "errno": "./cli.js" + }, + "bugs": { + "url": "https://github.com/rvagg/node-errno/issues" + }, + "dependencies": { + "prr": "~0.0.0" + }, + "description": "libuv errno details exposed", + "devDependencies": { + "tape": "~3.5.0" + }, + "directories": {}, + "dist": { + "shasum": "b896e23a9e5e8ba33871fc996abd3635fc9a1c7d", + "tarball": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz" + }, + "gitHead": "1c2b1fcbf22ef2bafbf6cda378cfed400f5163fd", + "homepage": "https://github.com/rvagg/node-errno", + "keywords": [ + "errors", + "errno", + "libuv" + ], + "license": "MIT", + "main": "errno.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "errno", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/node-errno.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "0.1.4" +} diff --git a/node_modules/errno/test.js b/node_modules/errno/test.js new file mode 100755 index 00000000..6b76a85a --- /dev/null +++ b/node_modules/errno/test.js @@ -0,0 +1,31 @@ +#!/usr/bin/env node + +var test = require('tape') + , errno = require('./') + +test('sanity checks', function (t) { + t.ok(errno.all, 'errno.all not found') + t.ok(errno.errno, 'errno.errno not found') + t.ok(errno.code, 'errno.code not found') + + t.equal(errno.all.length, 59, 'found ' + errno.all.length + ', expected 59') + t.equal(errno.errno['-1'], errno.all[0], 'errno -1 not first element') + + t.equal(errno.code['UNKNOWN'], errno.all[0], 'code UNKNOWN not first element') + + t.equal(errno.errno[1], errno.all[2], 'errno 1 not third element') + + t.equal(errno.code['EOF'], errno.all[2], 'code EOF not third element') + t.end() +}) + +test('custom errors', function (t) { + var Cust = errno.create('FooNotBarError') + var cust = new Cust('foo is not bar') + + t.equal(cust.name, 'FooNotBarError', 'correct custom name') + t.equal(cust.type, 'FooNotBarError', 'correct custom type') + t.equal(cust.message, 'foo is not bar', 'correct custom message') + t.notOk(cust.cause, 'no cause') + t.end() +}) diff --git a/node_modules/escape-html/LICENSE b/node_modules/escape-html/LICENSE new file mode 100755 index 00000000..2e70de97 --- /dev/null +++ b/node_modules/escape-html/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2013 TJ Holowaychuk +Copyright (c) 2015 Andreas Lubbe +Copyright (c) 2015 Tiancheng "Timothy" Gu + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/escape-html/Readme.md b/node_modules/escape-html/Readme.md new file mode 100755 index 00000000..653d9eaa --- /dev/null +++ b/node_modules/escape-html/Readme.md @@ -0,0 +1,43 @@ + +# escape-html + + Escape string for use in HTML + +## Example + +```js +var escape = require('escape-html'); +var html = escape('foo & bar'); +// -> foo & bar +``` + +## Benchmark + +``` +$ npm run-script bench + +> escape-html@1.0.3 bench nodejs-escape-html +> node benchmark/index.js + + + http_parser@1.0 + node@0.10.33 + v8@3.14.5.9 + ares@1.9.0-DEV + uv@0.10.29 + zlib@1.2.3 + modules@11 + openssl@1.0.1j + + 1 test completed. + 2 tests completed. + 3 tests completed. + + no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) + single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) + many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) +``` + +## License + + MIT \ No newline at end of file diff --git a/node_modules/escape-html/index.js b/node_modules/escape-html/index.js new file mode 100755 index 00000000..bf9e226f --- /dev/null +++ b/node_modules/escape-html/index.js @@ -0,0 +1,78 @@ +/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */ + +'use strict'; + +/** + * Module variables. + * @private + */ + +var matchHtmlRegExp = /["'&<>]/; + +/** + * Module exports. + * @public + */ + +module.exports = escapeHtml; + +/** + * Escape special characters in the given string of html. + * + * @param {string} string The string to escape for inserting into HTML + * @return {string} + * @public + */ + +function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; + } + + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; + + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } + + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; + } + + return lastIndex !== index + ? html + str.substring(lastIndex, index) + : html; +} diff --git a/node_modules/escape-html/package.json b/node_modules/escape-html/package.json new file mode 100755 index 00000000..a0648de5 --- /dev/null +++ b/node_modules/escape-html/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + { + "raw": "escape-html@~1.0.3", + "scope": null, + "escapedName": "escape-html", + "name": "escape-html", + "rawSpec": "~1.0.3", + "spec": ">=1.0.3 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "escape-html@>=1.0.3 <1.1.0", + "_id": "escape-html@1.0.3", + "_inCache": true, + "_location": "/escape-html", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "escape-html@~1.0.3", + "scope": null, + "escapedName": "escape-html", + "name": "escape-html", + "rawSpec": "~1.0.3", + "spec": ">=1.0.3 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/finalhandler", + "/send", + "/serve-index", + "/serve-static" + ], + "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "_shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988", + "_shrinkwrap": null, + "_spec": "escape-html@~1.0.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "bugs": { + "url": "https://github.com/component/escape-html/issues" + }, + "dependencies": {}, + "description": "Escape string for use in HTML", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988", + "tarball": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz" + }, + "files": [ + "LICENSE", + "Readme.md", + "index.js" + ], + "gitHead": "7ac2ea3977fcac3d4c5be8d2a037812820c65f28", + "homepage": "https://github.com/component/escape-html", + "keywords": [ + "escape", + "html", + "utility" + ], + "license": "MIT", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "escape-html", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/component/escape-html.git" + }, + "scripts": { + "bench": "node benchmark/index.js" + }, + "version": "1.0.3" +} diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js new file mode 100755 index 00000000..7834bf9b --- /dev/null +++ b/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/escape-string-regexp/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json new file mode 100755 index 00000000..055316c1 --- /dev/null +++ b/node_modules/escape-string-regexp/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "escape-string-regexp@^1.0.2", + "scope": null, + "escapedName": "escape-string-regexp", + "name": "escape-string-regexp", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chalk" + ] + ], + "_from": "escape-string-regexp@>=1.0.2 <2.0.0", + "_id": "escape-string-regexp@1.0.5", + "_inCache": true, + "_location": "/escape-string-regexp", + "_nodeVersion": "4.2.6", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" + }, + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "raw": "escape-string-regexp@^1.0.2", + "scope": null, + "escapedName": "escape-string-regexp", + "name": "escape-string-regexp", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "_shrinkwrap": null, + "_spec": "escape-string-regexp@^1.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "dependencies": {}, + "description": "Escape RegExp special characters", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + }, + "engines": { + "node": ">=0.8.0" + }, + "files": [ + "index.js" + ], + "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20", + "homepage": "https://github.com/sindresorhus/escape-string-regexp", + "keywords": [ + "escape", + "regex", + "regexp", + "re", + "regular", + "expression", + "string", + "str", + "special", + "characters" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "escape-string-regexp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.5" +} diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md new file mode 100755 index 00000000..87ac82d5 --- /dev/null +++ b/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +``` +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> 'how much \$ for a unicorn\?' + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/esutils/LICENSE.BSD b/node_modules/esutils/LICENSE.BSD new file mode 100755 index 00000000..3e580c35 --- /dev/null +++ b/node_modules/esutils/LICENSE.BSD @@ -0,0 +1,19 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esutils/README.md b/node_modules/esutils/README.md new file mode 100755 index 00000000..610d8bde --- /dev/null +++ b/node_modules/esutils/README.md @@ -0,0 +1,169 @@ +### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils) +esutils ([esutils](http://github.com/estools/esutils)) is +utility box for ECMAScript language tools. + +### API + +### ast + +#### ast.isExpression(node) + +Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section +[11](https://es5.github.io/#x11). + +#### ast.isStatement(node) + +Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section +[12](https://es5.github.io/#x12). + +#### ast.isIterationStatement(node) + +Returns true if `node` is an IterationStatement as defined in ECMA262 edition +5.1 section [12.6](https://es5.github.io/#x12.6). + +#### ast.isSourceElement(node) + +Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1 +section [14](https://es5.github.io/#x14). + +#### ast.trailingStatement(node) + +Returns `Statement?` if `node` has trailing `Statement`. +```js +if (cond) + consequent; +``` +When taking this `IfStatement`, returns `consequent;` statement. + +#### ast.isProblematicIfStatement(node) + +Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code. +```js +{ + type: 'IfStatement', + consequent: { + type: 'WithStatement', + body: { + type: 'IfStatement', + consequent: {type: 'EmptyStatement'} + } + }, + alternate: {type: 'EmptyStatement'} +} +``` +The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`. + + +### code + +#### code.isDecimalDigit(code) + +Return true if provided code is decimal digit. + +#### code.isHexDigit(code) + +Return true if provided code is hexadecimal digit. + +#### code.isOctalDigit(code) + +Return true if provided code is octal digit. + +#### code.isWhiteSpace(code) + +Return true if provided code is white space. White space characters are formally defined in ECMA262. + +#### code.isLineTerminator(code) + +Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262. + +#### code.isIdentifierStart(code) + +Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262. + +#### code.isIdentifierPart(code) + +Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262. + +### keyword + +#### keyword.isKeywordES5(id, strict) + +Returns `true` if provided identifier string is a Keyword or Future Reserved Word +in ECMA262 edition 5.1. They are formally defined in ECMA262 sections +[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2), +respectively. If the `strict` flag is truthy, this function additionally checks whether +`id` is a Keyword or Future Reserved Word under strict mode. + +#### keyword.isKeywordES6(id, strict) + +Returns `true` if provided identifier string is a Keyword or Future Reserved Word +in ECMA262 edition 6. They are formally defined in ECMA262 sections +[11.6.2.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords) and +[11.6.2.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-future-reserved-words), +respectively. If the `strict` flag is truthy, this function additionally checks whether +`id` is a Keyword or Future Reserved Word under strict mode. + +#### keyword.isReservedWordES5(id, strict) + +Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1. +They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1). +If the `strict` flag is truthy, this function additionally checks whether `id` +is a Reserved Word under strict mode. + +#### keyword.isReservedWordES6(id, strict) + +Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. +They are formally defined in ECMA262 section [11.6.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words). +If the `strict` flag is truthy, this function additionally checks whether `id` +is a Reserved Word under strict mode. + +#### keyword.isRestrictedWord(id) + +Returns `true` if provided identifier string is one of `eval` or `arguments`. +They are restricted in strict mode code throughout ECMA262 edition 5.1 and +in ECMA262 edition 6 section [12.1.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers-static-semantics-early-errors). + +#### keyword.isIdentifierName(id) + +Return true if provided identifier string is an IdentifierName as specified in +ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). + +#### keyword.isIdentifierES5(id, strict) + +Return true if provided identifier string is an Identifier as specified in +ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict` +flag is truthy, this function additionally checks whether `id` is an Identifier +under strict mode. + +#### keyword.isIdentifierES6(id, strict) + +Return true if provided identifier string is an Identifier as specified in +ECMA262 edition 6 section [12.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers). +If the `strict` flag is truthy, this function additionally checks whether `id` +is an Identifier under strict mode. + +### License + +Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esutils/lib/ast.js b/node_modules/esutils/lib/ast.js new file mode 100755 index 00000000..8faadae1 --- /dev/null +++ b/node_modules/esutils/lib/ast.js @@ -0,0 +1,144 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + function isExpression(node) { + if (node == null) { return false; } + switch (node.type) { + case 'ArrayExpression': + case 'AssignmentExpression': + case 'BinaryExpression': + case 'CallExpression': + case 'ConditionalExpression': + case 'FunctionExpression': + case 'Identifier': + case 'Literal': + case 'LogicalExpression': + case 'MemberExpression': + case 'NewExpression': + case 'ObjectExpression': + case 'SequenceExpression': + case 'ThisExpression': + case 'UnaryExpression': + case 'UpdateExpression': + return true; + } + return false; + } + + function isIterationStatement(node) { + if (node == null) { return false; } + switch (node.type) { + case 'DoWhileStatement': + case 'ForInStatement': + case 'ForStatement': + case 'WhileStatement': + return true; + } + return false; + } + + function isStatement(node) { + if (node == null) { return false; } + switch (node.type) { + case 'BlockStatement': + case 'BreakStatement': + case 'ContinueStatement': + case 'DebuggerStatement': + case 'DoWhileStatement': + case 'EmptyStatement': + case 'ExpressionStatement': + case 'ForInStatement': + case 'ForStatement': + case 'IfStatement': + case 'LabeledStatement': + case 'ReturnStatement': + case 'SwitchStatement': + case 'ThrowStatement': + case 'TryStatement': + case 'VariableDeclaration': + case 'WhileStatement': + case 'WithStatement': + return true; + } + return false; + } + + function isSourceElement(node) { + return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; + } + + function trailingStatement(node) { + switch (node.type) { + case 'IfStatement': + if (node.alternate != null) { + return node.alternate; + } + return node.consequent; + + case 'LabeledStatement': + case 'ForStatement': + case 'ForInStatement': + case 'WhileStatement': + case 'WithStatement': + return node.body; + } + return null; + } + + function isProblematicIfStatement(node) { + var current; + + if (node.type !== 'IfStatement') { + return false; + } + if (node.alternate == null) { + return false; + } + current = node.consequent; + do { + if (current.type === 'IfStatement') { + if (current.alternate == null) { + return true; + } + } + current = trailingStatement(current); + } while (current); + + return false; + } + + module.exports = { + isExpression: isExpression, + isStatement: isStatement, + isIterationStatement: isIterationStatement, + isSourceElement: isSourceElement, + isProblematicIfStatement: isProblematicIfStatement, + + trailingStatement: trailingStatement + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/lib/code.js b/node_modules/esutils/lib/code.js new file mode 100755 index 00000000..2a7c19d6 --- /dev/null +++ b/node_modules/esutils/lib/code.js @@ -0,0 +1,135 @@ +/* + Copyright (C) 2013-2014 Yusuke Suzuki + Copyright (C) 2014 Ivan Nikulin + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; + + // See `tools/generate-identifier-regex.js`. + ES5Regex = { + // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, + // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + }; + + ES6Regex = { + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + + function isDecimalDigit(ch) { + return 0x30 <= ch && ch <= 0x39; // 0..9 + } + + function isHexDigit(ch) { + return 0x30 <= ch && ch <= 0x39 || // 0..9 + 0x61 <= ch && ch <= 0x66 || // a..f + 0x41 <= ch && ch <= 0x46; // A..F + } + + function isOctalDigit(ch) { + return ch >= 0x30 && ch <= 0x37; // 0..7 + } + + // 7.2 White Space + + NON_ASCII_WHITESPACES = [ + 0x1680, 0x180E, + 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, + 0x202F, 0x205F, + 0x3000, + 0xFEFF + ]; + + function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || + ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; + } + + // 7.3 Line Terminators + + function isLineTerminator(ch) { + return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; + } + + // 7.6 Identifier Names and Identifiers + + function fromCodePoint(cp) { + if (cp <= 0xFFFF) { return String.fromCharCode(cp); } + var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); + var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); + return cu1 + cu2; + } + + IDENTIFIER_START = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_START[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + IDENTIFIER_PART = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_PART[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch >= 0x30 && ch <= 0x39 || // 0..9 + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + function isIdentifierStartES5(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES5(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + function isIdentifierStartES6(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES6(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + module.exports = { + isDecimalDigit: isDecimalDigit, + isHexDigit: isHexDigit, + isOctalDigit: isOctalDigit, + isWhiteSpace: isWhiteSpace, + isLineTerminator: isLineTerminator, + isIdentifierStartES5: isIdentifierStartES5, + isIdentifierPartES5: isIdentifierPartES5, + isIdentifierStartES6: isIdentifierStartES6, + isIdentifierPartES6: isIdentifierPartES6 + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/lib/keyword.js b/node_modules/esutils/lib/keyword.js new file mode 100755 index 00000000..13c8c6a9 --- /dev/null +++ b/node_modules/esutils/lib/keyword.js @@ -0,0 +1,165 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + var code = require('./code'); + + function isStrictModeReservedWordES6(id) { + switch (id) { + case 'implements': + case 'interface': + case 'package': + case 'private': + case 'protected': + case 'public': + case 'static': + case 'let': + return true; + default: + return false; + } + } + + function isKeywordES5(id, strict) { + // yield should not be treated as keyword under non-strict mode. + if (!strict && id === 'yield') { + return false; + } + return isKeywordES6(id, strict); + } + + function isKeywordES6(id, strict) { + if (strict && isStrictModeReservedWordES6(id)) { + return true; + } + + switch (id.length) { + case 2: + return (id === 'if') || (id === 'in') || (id === 'do'); + case 3: + return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); + case 4: + return (id === 'this') || (id === 'else') || (id === 'case') || + (id === 'void') || (id === 'with') || (id === 'enum'); + case 5: + return (id === 'while') || (id === 'break') || (id === 'catch') || + (id === 'throw') || (id === 'const') || (id === 'yield') || + (id === 'class') || (id === 'super'); + case 6: + return (id === 'return') || (id === 'typeof') || (id === 'delete') || + (id === 'switch') || (id === 'export') || (id === 'import'); + case 7: + return (id === 'default') || (id === 'finally') || (id === 'extends'); + case 8: + return (id === 'function') || (id === 'continue') || (id === 'debugger'); + case 10: + return (id === 'instanceof'); + default: + return false; + } + } + + function isReservedWordES5(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); + } + + function isReservedWordES6(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); + } + + function isRestrictedWord(id) { + return id === 'eval' || id === 'arguments'; + } + + function isIdentifierNameES5(id) { + var i, iz, ch; + + if (id.length === 0) { return false; } + + ch = id.charCodeAt(0); + if (!code.isIdentifierStartES5(ch)) { + return false; + } + + for (i = 1, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + if (!code.isIdentifierPartES5(ch)) { + return false; + } + } + return true; + } + + function decodeUtf16(lead, trail) { + return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + } + + function isIdentifierNameES6(id) { + var i, iz, ch, lowCh, check; + + if (id.length === 0) { return false; } + + check = code.isIdentifierStartES6; + for (i = 0, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + if (0xD800 <= ch && ch <= 0xDBFF) { + ++i; + if (i >= iz) { return false; } + lowCh = id.charCodeAt(i); + if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { + return false; + } + ch = decodeUtf16(ch, lowCh); + } + if (!check(ch)) { + return false; + } + check = code.isIdentifierPartES6; + } + return true; + } + + function isIdentifierES5(id, strict) { + return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); + } + + function isIdentifierES6(id, strict) { + return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); + } + + module.exports = { + isKeywordES5: isKeywordES5, + isKeywordES6: isKeywordES6, + isReservedWordES5: isReservedWordES5, + isReservedWordES6: isReservedWordES6, + isRestrictedWord: isRestrictedWord, + isIdentifierNameES5: isIdentifierNameES5, + isIdentifierNameES6: isIdentifierNameES6, + isIdentifierES5: isIdentifierES5, + isIdentifierES6: isIdentifierES6 + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/lib/utils.js b/node_modules/esutils/lib/utils.js new file mode 100755 index 00000000..ce18faa6 --- /dev/null +++ b/node_modules/esutils/lib/utils.js @@ -0,0 +1,33 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +(function () { + 'use strict'; + + exports.ast = require('./ast'); + exports.code = require('./code'); + exports.keyword = require('./keyword'); +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/esutils/package.json b/node_modules/esutils/package.json new file mode 100755 index 00000000..d7d7f6c6 --- /dev/null +++ b/node_modules/esutils/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "esutils@^2.0.2", + "scope": null, + "escapedName": "esutils", + "name": "esutils", + "rawSpec": "^2.0.2", + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-code-frame" + ] + ], + "_from": "esutils@>=2.0.2 <3.0.0", + "_id": "esutils@2.0.2", + "_inCache": true, + "_location": "/esutils", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "michaelficarra", + "email": "npm@michael.ficarra.me" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "raw": "esutils@^2.0.2", + "scope": null, + "escapedName": "esutils", + "name": "esutils", + "rawSpec": "^2.0.2", + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-code-frame", + "/babel-types" + ], + "_resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "_shasum": "0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b", + "_shrinkwrap": null, + "_spec": "esutils@^2.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-code-frame", + "bugs": { + "url": "https://github.com/estools/esutils/issues" + }, + "dependencies": {}, + "description": "utility box for ECMAScript language tools", + "devDependencies": { + "chai": "~1.7.2", + "coffee-script": "~1.6.3", + "jshint": "2.6.3", + "mocha": "~2.2.1", + "regenerate": "~1.2.1", + "unicode-7.0.0": "^0.1.5" + }, + "directories": { + "lib": "./lib" + }, + "dist": { + "shasum": "0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b", + "tarball": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "LICENSE.BSD", + "README.md", + "lib" + ], + "gitHead": "3ffd1c403f3f29db9e8a9574b1895682e57b6a7f", + "homepage": "https://github.com/estools/esutils", + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/estools/esutils/raw/master/LICENSE.BSD" + } + ], + "main": "lib/utils.js", + "maintainers": [ + { + "name": "constellation", + "email": "utatane.tea@gmail.com" + }, + { + "name": "michaelficarra", + "email": "npm@michael.ficarra.me" + } + ], + "name": "esutils", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/esutils.git" + }, + "scripts": { + "generate-regex": "node tools/generate-identifier-regex.js", + "lint": "jshint lib/*.js", + "test": "npm run-script lint && npm run-script unit-test", + "unit-test": "mocha --compilers coffee:coffee-script -R spec" + }, + "version": "2.0.2" +} diff --git a/node_modules/etag/HISTORY.md b/node_modules/etag/HISTORY.md new file mode 100755 index 00000000..136da8c6 --- /dev/null +++ b/node_modules/etag/HISTORY.md @@ -0,0 +1,78 @@ +1.8.0 / 2017-02-18 +================== + + * Use SHA1 instead of MD5 for ETag hashing + - Improves performance for larger entities + - Works with FIPS 140-2 OpenSSL configuration + +1.7.0 / 2015-06-08 +================== + + * Always include entity length in ETags for hash length extensions + * Generate non-Stats ETags using MD5 only (no longer CRC32) + * Improve stat performance by removing hashing + * Remove base64 padding in ETags to shorten + * Use MD5 instead of MD4 in weak ETags over 1KB + +1.6.0 / 2015-05-10 +================== + + * Improve support for JXcore + * Remove requirement of `atime` in the stats object + * Support "fake" stats objects in environments without `fs` + +1.5.1 / 2014-11-19 +================== + + * deps: crc@3.2.1 + - Minor fixes + +1.5.0 / 2014-10-14 +================== + + * Improve string performance + * Slightly improve speed for weak ETags over 1KB + +1.4.0 / 2014-09-21 +================== + + * Support "fake" stats objects + * Support Node.js 0.6 + +1.3.1 / 2014-09-14 +================== + + * Use the (new and improved) `crc` for crc32 + +1.3.0 / 2014-08-29 +================== + + * Default strings to strong ETags + * Improve speed for weak ETags over 1KB + +1.2.1 / 2014-08-29 +================== + + * Use the (much faster) `buffer-crc32` for crc32 + +1.2.0 / 2014-08-24 +================== + + * Add support for file stat objects + +1.1.0 / 2014-08-24 +================== + + * Add fast-path for empty entity + * Add weak ETag generation + * Shrink size of generated ETags + +1.0.1 / 2014-08-24 +================== + + * Fix behavior of string containing Unicode + +1.0.0 / 2014-05-18 +================== + + * Initial release diff --git a/node_modules/etag/LICENSE b/node_modules/etag/LICENSE new file mode 100755 index 00000000..cab251c2 --- /dev/null +++ b/node_modules/etag/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/etag/README.md b/node_modules/etag/README.md new file mode 100755 index 00000000..9963a5fc --- /dev/null +++ b/node_modules/etag/README.md @@ -0,0 +1,159 @@ +# etag + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create simple HTTP ETags + +This module generates HTTP ETags (as defined in RFC 7232) for use in +HTTP responses. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install etag +``` + +## API + + + +```js +var etag = require('etag') +``` + +### etag(entity, [options]) + +Generate a strong ETag for the given entity. This should be the complete +body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By +default, a strong ETag is generated except for `fs.Stats`, which will +generate a weak ETag (this can be overwritten by `options.weak`). + + + +```js +res.setHeader('ETag', etag(body)) +``` + +#### Options + +`etag` accepts these properties in the options object. + +##### weak + +Specifies if the generated ETag will include the weak validator mark (that +is, the leading `W/`). The actual entity tag is the same. The default value +is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`. + +## Testing + +```sh +$ npm test +``` + +## Benchmark + +```bash +$ npm run-script bench + +> etag@1.8.0 bench nodejs-etag +> node benchmark/index.js + + http_parser@2.7.0 + node@6.9.1 + v8@5.1.281.84 + uv@1.9.1 + zlib@1.2.8 + ares@1.10.1-DEV + icu@57.1 + modules@48 + openssl@1.0.2j + +> node benchmark/body0-100b.js + + 100B body + + 4 tests completed. + +* buffer - strong x 498,600 ops/sec ±0.82% (191 runs sampled) +* buffer - weak x 496,249 ops/sec ±0.59% (179 runs sampled) + string - strong x 466,298 ops/sec ±0.88% (186 runs sampled) + string - weak x 464,298 ops/sec ±0.84% (184 runs sampled) + +> node benchmark/body1-1kb.js + + 1KB body + + 4 tests completed. + +* buffer - strong x 346,535 ops/sec ±0.32% (189 runs sampled) +* buffer - weak x 344,958 ops/sec ±0.52% (185 runs sampled) + string - strong x 259,672 ops/sec ±0.82% (191 runs sampled) + string - weak x 260,931 ops/sec ±0.76% (190 runs sampled) + +> node benchmark/body2-5kb.js + + 5KB body + + 4 tests completed. + +* buffer - strong x 136,510 ops/sec ±0.62% (189 runs sampled) +* buffer - weak x 136,604 ops/sec ±0.51% (191 runs sampled) + string - strong x 80,903 ops/sec ±0.84% (192 runs sampled) + string - weak x 82,785 ops/sec ±0.50% (193 runs sampled) + +> node benchmark/body3-10kb.js + + 10KB body + + 4 tests completed. + +* buffer - strong x 78,650 ops/sec ±0.31% (193 runs sampled) +* buffer - weak x 78,685 ops/sec ±0.41% (193 runs sampled) + string - strong x 43,999 ops/sec ±0.43% (193 runs sampled) + string - weak x 44,081 ops/sec ±0.45% (192 runs sampled) + +> node benchmark/body4-100kb.js + + 100KB body + + 4 tests completed. + + buffer - strong x 8,860 ops/sec ±0.66% (191 runs sampled) +* buffer - weak x 9,030 ops/sec ±0.26% (193 runs sampled) + string - strong x 4,838 ops/sec ±0.16% (194 runs sampled) + string - weak x 4,800 ops/sec ±0.52% (192 runs sampled) + +> node benchmark/stats.js + + stat + + 4 tests completed. + +* real - strong x 1,468,073 ops/sec ±0.32% (191 runs sampled) +* real - weak x 1,446,852 ops/sec ±0.64% (190 runs sampled) + fake - strong x 635,707 ops/sec ±0.33% (194 runs sampled) + fake - weak x 627,708 ops/sec ±0.36% (192 runs sampled) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/etag.svg +[npm-url]: https://npmjs.org/package/etag +[node-version-image]: https://img.shields.io/node/v/etag.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg +[travis-url]: https://travis-ci.org/jshttp/etag +[coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/etag?branch=master +[downloads-image]: https://img.shields.io/npm/dm/etag.svg +[downloads-url]: https://npmjs.org/package/etag diff --git a/node_modules/etag/index.js b/node_modules/etag/index.js new file mode 100755 index 00000000..607f1488 --- /dev/null +++ b/node_modules/etag/index.js @@ -0,0 +1,132 @@ +/*! + * etag + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = etag + +/** + * Module dependencies. + * @private + */ + +var crypto = require('crypto') +var Stats = require('fs').Stats + +/** + * Module variables. + * @private + */ + +var base64PadCharRegExp = /=+$/ +var toString = Object.prototype.toString + +/** + * Generate an entity tag. + * + * @param {Buffer|string} entity + * @return {string} + * @private + */ + +function entitytag (entity) { + if (entity.length === 0) { + // fast-path empty + return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' + } + + // compute hash of entity + var hash = crypto + .createHash('sha1') + .update(entity, 'utf8') + .digest('base64') + .replace(base64PadCharRegExp, '') + + // compute length of entity + var len = typeof entity === 'string' + ? Buffer.byteLength(entity, 'utf8') + : entity.length + + return '"' + len.toString(16) + '-' + hash + '"' +} + +/** + * Create a simple ETag. + * + * @param {string|Buffer|Stats} entity + * @param {object} [options] + * @param {boolean} [options.weak] + * @return {String} + * @public + */ + +function etag (entity, options) { + if (entity == null) { + throw new TypeError('argument entity is required') + } + + // support fs.Stats object + var isStats = isstats(entity) + var weak = options && typeof options.weak === 'boolean' + ? options.weak + : isStats + + // validate argument + if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { + throw new TypeError('argument entity must be string, Buffer, or fs.Stats') + } + + // generate entity tag + var tag = isStats + ? stattag(entity) + : entitytag(entity) + + return weak + ? 'W/' + tag + : tag +} + +/** + * Determine if object is a Stats object. + * + * @param {object} obj + * @return {boolean} + * @api private + */ + +function isstats (obj) { + // genuine fs.Stats + if (typeof Stats === 'function' && obj instanceof Stats) { + return true + } + + // quack quack + return obj && typeof obj === 'object' && + 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && + 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && + 'ino' in obj && typeof obj.ino === 'number' && + 'size' in obj && typeof obj.size === 'number' +} + +/** + * Generate a tag for a stat. + * + * @param {object} stat + * @return {string} + * @private + */ + +function stattag (stat) { + var mtime = stat.mtime.getTime().toString(16) + var size = stat.size.toString(16) + + return '"' + size + '-' + mtime + '"' +} diff --git a/node_modules/etag/package.json b/node_modules/etag/package.json new file mode 100755 index 00000000..7a858ec0 --- /dev/null +++ b/node_modules/etag/package.json @@ -0,0 +1,119 @@ +{ + "_args": [ + [ + { + "raw": "etag@~1.8.0", + "scope": null, + "escapedName": "etag", + "name": "etag", + "rawSpec": "~1.8.0", + "spec": ">=1.8.0 <1.9.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "etag@>=1.8.0 <1.9.0", + "_id": "etag@1.8.0", + "_inCache": true, + "_location": "/etag", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/etag-1.8.0.tgz_1487475735517_0.6724899658001959" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "etag@~1.8.0", + "scope": null, + "escapedName": "etag", + "name": "etag", + "rawSpec": "~1.8.0", + "spec": ">=1.8.0 <1.9.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/send" + ], + "_resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", + "_shasum": "6f631aef336d6c46362b51764044ce216be3c051", + "_shrinkwrap": null, + "_spec": "etag@~1.8.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "bugs": { + "url": "https://github.com/jshttp/etag/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "David Björklund", + "email": "david.bjorklund@gmail.com" + } + ], + "dependencies": {}, + "description": "Create simple HTTP ETags", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.3", + "eslint": "3.15.0", + "eslint-config-standard": "6.2.1", + "eslint-plugin-markdown": "1.0.0-beta.3", + "eslint-plugin-promise": "3.4.2", + "eslint-plugin-standard": "2.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5", + "seedrandom": "2.4.2" + }, + "directories": {}, + "dist": { + "shasum": "6f631aef336d6c46362b51764044ce216be3c051", + "tarball": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "16979f788efa8c793c8d07543b4d6aef3d2bfff8", + "homepage": "https://github.com/jshttp/etag#readme", + "keywords": [ + "etag", + "http", + "res" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "etag", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/etag.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.8.0" +} diff --git a/node_modules/eventemitter3/LICENSE b/node_modules/eventemitter3/LICENSE new file mode 100755 index 00000000..abcbd54e --- /dev/null +++ b/node_modules/eventemitter3/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Arnout Kazemier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/eventemitter3/README.md b/node_modules/eventemitter3/README.md new file mode 100755 index 00000000..ff209654 --- /dev/null +++ b/node_modules/eventemitter3/README.md @@ -0,0 +1,89 @@ +# EventEmitter3 + +[![Version npm](https://img.shields.io/npm/v/eventemitter3.svg?style=flat-square)](http://browsenpm.org/package/eventemitter3)[![Build Status](https://img.shields.io/travis/primus/eventemitter3/master.svg?style=flat-square)](https://travis-ci.org/primus/eventemitter3)[![Dependencies](https://img.shields.io/david/primus/eventemitter3.svg?style=flat-square)](https://david-dm.org/primus/eventemitter3)[![Coverage Status](https://img.shields.io/coveralls/primus/eventemitter3/master.svg?style=flat-square)](https://coveralls.io/r/primus/eventemitter3?branch=master)[![IRC channel](https://img.shields.io/badge/IRC-irc.freenode.net%23primus-00a8ff.svg?style=flat-square)](https://webchat.freenode.net/?channels=primus) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/eventemitter3.svg)](https://saucelabs.com/u/eventemitter3) + +EventEmitter3 is a high performance EventEmitter. It has been micro-optimized +for various of code paths making this, one of, if not the fastest EventEmitter +available for Node.js and browsers. The module is API compatible with the +EventEmitter that ships by default with Node.js but there are some slight +differences: + +- Domain support has been removed. +- We do not `throw` an error when you emit an `error` event and nobody is + listening. +- The `newListener` event is removed as the use-cases for this functionality are + really just edge cases. +- No `setMaxListeners` and it's pointless memory leak warnings. If you want to + add `end` listeners you should be able to do that without modules complaining. +- No `listenerCount` function. Use `EE.listeners(event).length` instead. +- Support for custom context for events so there is no need to use `fn.bind`. +- `listeners` method can do existence checking instead of returning only arrays. + +It's a drop in replacement for existing EventEmitters, but just faster. Free +performance, who wouldn't want that? The EventEmitter is written in EcmaScript 3 +so it will work in the oldest browsers and node versions that you need to +support. + +## Installation + +```bash +$ npm install --save eventemitter3 # npm +$ component install primus/eventemitter3 # Component +$ bower install eventemitter3 # Bower +``` + +## Usage + +After installation the only thing you need to do is require the module: + +```js +var EventEmitter = require('eventemitter3'); +``` + +And you're ready to create your own EventEmitter instances. For the API +documentation, please follow the official Node.js documentation: + +http://nodejs.org/api/events.html + +### Contextual emits + +We've upgraded the API of the `EventEmitter.on`, `EventEmitter.once` and +`EventEmitter.removeListener` to accept an extra argument which is the `context` +or `this` value that should be set for the emitted events. This means you no +longer have the overhead of an event that required `fn.bind` in order to get a +custom `this` value. + +```js +var EE = new EventEmitter() + , context = { foo: 'bar' }; + +function emitted() { + console.log(this === context); // true +} + +EE.once('event-name', emitted, context); +EE.on('another-event', emitted, context); +EE.removeListener('another-event', emitted, context); +``` + +### Existence + +To check if there is already a listener for a given event you can supply the +`listeners` method with an extra boolean argument. This will transform the +output from an array, to a boolean value which indicates if there are listeners +in place for the given event: + +```js +var EE = new EventEmitter(); +EE.once('event-name', function () {}); +EE.on('another-event', function () {}); + +EE.listeners('event-name', true); // returns true +EE.listeners('unknown-name', true); // returns false +``` + +## License + +[MIT](LICENSE) diff --git a/node_modules/eventemitter3/index.js b/node_modules/eventemitter3/index.js new file mode 100755 index 00000000..40819dfe --- /dev/null +++ b/node_modules/eventemitter3/index.js @@ -0,0 +1,289 @@ +'use strict'; + +var has = Object.prototype.hasOwnProperty; + +// +// We store our EE objects in a plain object whose properties are event names. +// If `Object.create(null)` is not supported we prefix the event names with a +// `~` to make sure that the built-in object properties are not overridden or +// used as an attack vector. +// We also assume that `Object.create(null)` is available when the event name +// is an ES6 Symbol. +// +var prefix = typeof Object.create !== 'function' ? '~' : false; + +/** + * Representation of a single EventEmitter function. + * + * @param {Function} fn Event handler to be called. + * @param {Mixed} context Context for function execution. + * @param {Boolean} [once=false] Only emit once + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal EventEmitter interface that is molded against the Node.js + * EventEmitter interface. + * + * @constructor + * @api public + */ +function EventEmitter() { /* Nothing to set */ } + +/** + * Hold the assigned EventEmitters by name. + * + * @type {Object} + * @private + */ +EventEmitter.prototype._events = undefined; + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var events = this._events + , names = [] + , name; + + if (!events) return names; + + for (name in events) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return a list of assigned event listeners. + * + * @param {String} event The events that should be listed. + * @param {Boolean} exists We only need to know if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events && this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Emit an event to all registered event listeners. + * + * @param {String} event The name of the event. + * @returns {Boolean} Indication if we've emitted an event. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events || !this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if ('function' === typeof listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Register a new EventListener for the given event. + * + * @param {String} event Name of the event. + * @param {Function} fn Callback function. + * @param {Mixed} [context=this] The context of the function. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events) this._events = prefix ? {} : Object.create(null); + if (!this._events[evt]) this._events[evt] = listener; + else { + if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [ + this._events[evt], listener + ]; + } + + return this; +}; + +/** + * Add an EventListener that's only called once. + * + * @param {String} event Name of the event. + * @param {Function} fn Callback function. + * @param {Mixed} [context=this] The context of the function. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events) this._events = prefix ? {} : Object.create(null); + if (!this._events[evt]) this._events[evt] = listener; + else { + if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [ + this._events[evt], listener + ]; + } + + return this; +}; + +/** + * Remove event listeners. + * + * @param {String} event The event we want to remove. + * @param {Function} fn The listener that we need to find. + * @param {Mixed} context Only remove listeners matching this context. + * @param {Boolean} once Only remove once listeners. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events || !this._events[evt]) return this; + + var listeners = this._events[evt] + , events = []; + + if (fn) { + if (listeners.fn) { + if ( + listeners.fn !== fn + || (once && !listeners.once) + || (context && listeners.context !== context) + ) { + events.push(listeners); + } + } else { + for (var i = 0, length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) { + this._events[evt] = events.length === 1 ? events[0] : events; + } else { + delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners or only the listeners for the specified event. + * + * @param {String} event The event want to remove all listeners for. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + if (!this._events) return this; + + if (event) delete this._events[prefix ? prefix + event : event]; + else this._events = prefix ? {} : Object.create(null); + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} diff --git a/node_modules/eventemitter3/package.json b/node_modules/eventemitter3/package.json new file mode 100755 index 00000000..54a95e1b --- /dev/null +++ b/node_modules/eventemitter3/package.json @@ -0,0 +1,119 @@ +{ + "_args": [ + [ + { + "raw": "eventemitter3@1.x.x", + "scope": null, + "escapedName": "eventemitter3", + "name": "eventemitter3", + "rawSpec": "1.x.x", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy" + ] + ], + "_from": "eventemitter3@>=1.0.0 <2.0.0", + "_id": "eventemitter3@1.2.0", + "_inCache": true, + "_location": "/eventemitter3", + "_nodeVersion": "4.3.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/eventemitter3-1.2.0.tgz_1458148661717_0.1867425285745412" + }, + "_npmUser": { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + }, + "_npmVersion": "3.8.0", + "_phantomChildren": {}, + "_requested": { + "raw": "eventemitter3@1.x.x", + "scope": null, + "escapedName": "eventemitter3", + "name": "eventemitter3", + "rawSpec": "1.x.x", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/http-proxy" + ], + "_resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "_shasum": "1c86991d816ad1e504750e73874224ecf3bec508", + "_shrinkwrap": null, + "_spec": "eventemitter3@1.x.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy", + "author": { + "name": "Arnout Kazemier" + }, + "bugs": { + "url": "https://github.com/primus/eventemitter3/issues" + }, + "dependencies": {}, + "description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.", + "devDependencies": { + "assume": "1.3.x", + "istanbul": "0.4.x", + "mocha": "2.4.x", + "pre-commit": "1.1.x", + "zuul": "3.10.x" + }, + "directories": {}, + "dist": { + "shasum": "1c86991d816ad1e504750e73874224ecf3bec508", + "tarball": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz" + }, + "gitHead": "c78d597fed80952c259b916c0a1f4dca91d940e4", + "homepage": "https://github.com/primus/eventemitter3#readme", + "keywords": [ + "EventEmitter", + "EventEmitter2", + "EventEmitter3", + "Events", + "addEventListener", + "addListener", + "emit", + "emits", + "emitter", + "event", + "once", + "pub/sub", + "publish", + "reactor", + "subscribe" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "v1", + "email": "npm@3rd-Eden.com" + }, + { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + }, + { + "name": "lpinca", + "email": "luigipinca@gmail.com" + } + ], + "name": "eventemitter3", + "optionalDependencies": {}, + "pre-commit": "sync, test", + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/primus/eventemitter3.git" + }, + "scripts": { + "coverage": "istanbul cover _mocha -- test.js", + "sync": "node versions.js", + "test": "mocha test.js", + "test-browser": "zuul -- test.js", + "test-node": "istanbul cover _mocha --report lcovonly -- test.js" + }, + "version": "1.2.0" +} diff --git a/node_modules/events/.npmignore b/node_modules/events/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/events/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/events/.travis.yml b/node_modules/events/.travis.yml new file mode 100755 index 00000000..002b0422 --- /dev/null +++ b/node_modules/events/.travis.yml @@ -0,0 +1,8 @@ +sudo: false +language: node_js +node_js: +- '0.10' +env: + global: + - secure: XcBiD8yReflut9q7leKsigDZ0mI3qTKH+QrNVY8DaqlomJOZw8aOrVuX9Jz12l86ZJ41nbxmKnRNkFzcVr9mbP9YaeTb3DpeOBWmvaoSfud9Wnc16VfXtc1FCcwDhSVcSiM3UtnrmFU5cH+Dw1LPh5PbfylYOS/nJxUvG0FFLqI= + - secure: jNWtEbqhUdQ0xXDHvCYfUbKYeJCi6a7B4LsrcxYCyWWn4NIgncE5x2YbB+FSUUFVYfz0dsn5RKP1oHB99f0laUEo18HBNkrAS/rtyOdVzcpJjbQ6kgSILGjnJD/Ty1B57Rcz3iyev5Y7bLZ6Y1FbDnk/i9/l0faOGz8vTC3Vdkc= diff --git a/node_modules/events/.zuul.yml b/node_modules/events/.zuul.yml new file mode 100755 index 00000000..a8e35afd --- /dev/null +++ b/node_modules/events/.zuul.yml @@ -0,0 +1,12 @@ +ui: mocha-qunit +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: 5..latest + - name: iphone + version: latest + - name: ie + version: 8..latest diff --git a/node_modules/events/History.md b/node_modules/events/History.md new file mode 100755 index 00000000..b345858e --- /dev/null +++ b/node_modules/events/History.md @@ -0,0 +1,42 @@ +# 1.1.1 (2016-06-22) + + - add more context to errors if they are not instanceof Error + +# 1.1.0 (2015-09-29) + + - add Emitter#listerCount (to match node v4 api) + +# 1.0.2 (2014-08-28) + + - remove un-reachable code + - update devDeps + +## 1.0.1 / 2014-05-11 + + - check for console.trace before using it + +## 1.0.0 / 2013-12-10 + + - Update to latest events code from node.js 0.10 + - copy tests from node.js + +## 0.4.0 / 2011-07-03 ## + + - Switching to graphquire@0.8.0 + +## 0.3.0 / 2011-07-03 ## + + - Switching to URL based module require. + +## 0.2.0 / 2011-06-10 ## + + - Simplified package structure. + - Graphquire for dependency management. + +## 0.1.1 / 2011-05-16 ## + + - Unhandled errors are logged via console.error + +## 0.1.0 / 2011-04-22 ## + + - Initial release diff --git a/node_modules/events/LICENSE b/node_modules/events/LICENSE new file mode 100755 index 00000000..52ed3b0a --- /dev/null +++ b/node_modules/events/LICENSE @@ -0,0 +1,22 @@ +MIT + +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/events/Readme.md b/node_modules/events/Readme.md new file mode 100755 index 00000000..02694efa --- /dev/null +++ b/node_modules/events/Readme.md @@ -0,0 +1,19 @@ +# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events) + +Node's event emitter for all engines. + +## Install ## + +``` +npm install events +``` + +## Require ## + +```javascript +var EventEmitter = require('events').EventEmitter +``` + +## Usage ## + +See the [node.js event emitter docs](http://nodejs.org/api/events.html) diff --git a/node_modules/events/events.js b/node_modules/events/events.js new file mode 100755 index 00000000..1619a623 --- /dev/null +++ b/node_modules/events/events.js @@ -0,0 +1,302 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); + err.context = er; + throw err; + } + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + args = Array.prototype.slice.call(arguments, 1); + handler.apply(this, args); + } + } else if (isObject(handler)) { + args = Array.prototype.slice.call(arguments, 1); + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; + + if (isFunction(evlistener)) + return 1; + else if (evlistener) + return evlistener.length; + } + return 0; +}; + +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} diff --git a/node_modules/events/package.json b/node_modules/events/package.json new file mode 100755 index 00000000..9a3df71a --- /dev/null +++ b/node_modules/events/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "events@^1.0.0", + "scope": null, + "escapedName": "events", + "name": "events", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "events@>=1.0.0 <2.0.0", + "_id": "events@1.1.1", + "_inCache": true, + "_location": "/events", + "_nodeVersion": "6.2.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/events-1.1.1.tgz_1466611759829_0.353814059169963" + }, + "_npmUser": { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + }, + "_npmVersion": "3.8.9", + "_phantomChildren": {}, + "_requested": { + "raw": "events@^1.0.0", + "scope": null, + "escapedName": "events", + "name": "events", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "_shasum": "9ebdb7635ad099c70dcc4c2a1f5004288e8bd924", + "_shrinkwrap": null, + "_spec": "events@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com", + "url": "http://jeditoolkit.com" + }, + "bugs": { + "url": "http://github.com/Gozala/events/issues/" + }, + "dependencies": {}, + "description": "Node's event emitter for all engines.", + "devDependencies": { + "mocha": "~1.21.4", + "zuul": "~1.10.2" + }, + "directories": {}, + "dist": { + "shasum": "9ebdb7635ad099c70dcc4c2a1f5004288e8bd924", + "tarball": "https://registry.npmjs.org/events/-/events-1.1.1.tgz" + }, + "engines": { + "node": ">=0.4.x" + }, + "gitHead": "623b6f54f3cdccedd71b8b0f5e4b755bacdb5c62", + "homepage": "https://github.com/Gozala/events#readme", + "id": "events", + "keywords": [ + "events", + "eventEmitter", + "eventDispatcher", + "listeners" + ], + "license": "MIT", + "main": "./events.js", + "maintainers": [ + { + "name": "gozala", + "email": "rfobic@gmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + } + ], + "name": "events", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/Gozala/events.git", + "web": "https://github.com/Gozala/events" + }, + "scripts": { + "test": "mocha --ui qunit -- tests/index.js && zuul -- tests/index.js" + }, + "version": "1.1.1" +} diff --git a/node_modules/events/tests/add-listeners.js b/node_modules/events/tests/add-listeners.js new file mode 100755 index 00000000..5ab874ce --- /dev/null +++ b/node_modules/events/tests/add-listeners.js @@ -0,0 +1,63 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var assert = require('assert'); +var events = require('../'); + +var e = new events.EventEmitter(); + +var events_new_listener_emited = []; +var listeners_new_listener_emited = []; +var times_hello_emited = 0; + +// sanity check +assert.equal(e.addListener, e.on); + +e.on('newListener', function(event, listener) { + console.log('newListener: ' + event); + events_new_listener_emited.push(event); + listeners_new_listener_emited.push(listener); +}); + +function hello(a, b) { + console.log('hello'); + times_hello_emited += 1; + assert.equal('a', a); + assert.equal('b', b); +} +e.on('hello', hello); + +var foo = function() {}; +e.once('foo', foo); + +console.log('start'); + +e.emit('hello', 'a', 'b'); + + +// just make sure that this doesn't throw: +var f = new events.EventEmitter(); +f.setMaxListeners(0); + +assert.deepEqual(['hello', 'foo'], events_new_listener_emited); +assert.deepEqual([hello, foo], listeners_new_listener_emited); +assert.equal(1, times_hello_emited); + diff --git a/node_modules/events/tests/check-listener-leaks.js b/node_modules/events/tests/check-listener-leaks.js new file mode 100755 index 00000000..e07866a5 --- /dev/null +++ b/node_modules/events/tests/check-listener-leaks.js @@ -0,0 +1,86 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var assert = require('assert'); +var events = require('../'); + +var e = new events.EventEmitter(); + +// default +for (var i = 0; i < 10; i++) { + e.on('default', function() {}); +} +assert.ok(!e._events['default'].hasOwnProperty('warned')); +e.on('default', function() {}); +assert.ok(e._events['default'].warned); + +// specific +e.setMaxListeners(5); +for (var i = 0; i < 5; i++) { + e.on('specific', function() {}); +} +assert.ok(!e._events['specific'].hasOwnProperty('warned')); +e.on('specific', function() {}); +assert.ok(e._events['specific'].warned); + +// only one +e.setMaxListeners(1); +e.on('only one', function() {}); +assert.ok(!e._events['only one'].hasOwnProperty('warned')); +e.on('only one', function() {}); +assert.ok(e._events['only one'].hasOwnProperty('warned')); + +// unlimited +e.setMaxListeners(0); +for (var i = 0; i < 1000; i++) { + e.on('unlimited', function() {}); +} +assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); + +// process-wide +events.EventEmitter.defaultMaxListeners = 42; +e = new events.EventEmitter(); + +for (var i = 0; i < 42; ++i) { + e.on('fortytwo', function() {}); +} +assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); +e.on('fortytwo', function() {}); +assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); +delete e._events['fortytwo'].warned; + +events.EventEmitter.defaultMaxListeners = 44; +e.on('fortytwo', function() {}); +assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); +e.on('fortytwo', function() {}); +assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); + +// but _maxListeners still has precedence over defaultMaxListeners +events.EventEmitter.defaultMaxListeners = 42; +e = new events.EventEmitter(); +e.setMaxListeners(1); +e.on('uno', function() {}); +assert.ok(!e._events['uno'].hasOwnProperty('warned')); +e.on('uno', function() {}); +assert.ok(e._events['uno'].hasOwnProperty('warned')); + +// chainable +assert.strictEqual(e, e.setMaxListeners(1)); diff --git a/node_modules/events/tests/common.js b/node_modules/events/tests/common.js new file mode 100755 index 00000000..66f70a39 --- /dev/null +++ b/node_modules/events/tests/common.js @@ -0,0 +1,42 @@ +var assert = require('assert'); + +var mustCallChecks = []; + +function runCallChecks() { + var failed_count = 0; + for (var i=0 ; i< mustCallChecks.length; ++i) { + var context = mustCallChecks[i]; + if (context.actual === context.expected) { + continue; + } + + failed_count++; + console.log('Mismatched %s function calls. Expected %d, actual %d.', + context.name, + context.expected, + context.actual); + console.log(context.stack.split('\n').slice(2).join('\n')); + } + + assert(failed_count === 0); +} + +after(runCallChecks); + +exports.mustCall = function(fn, expected) { + if (typeof expected !== 'number') expected = 1; + + var context = { + expected: expected, + actual: 0, + stack: (new Error).stack, + name: fn.name || '' + }; + + mustCallChecks.push(context); + + return function() { + context.actual++; + return fn.apply(this, arguments); + }; +}; diff --git a/node_modules/events/tests/index.js b/node_modules/events/tests/index.js new file mode 100755 index 00000000..f144530b --- /dev/null +++ b/node_modules/events/tests/index.js @@ -0,0 +1,25 @@ + +require('./legacy-compat'); + +// we do this to easily wrap each file in a mocha test +// and also have browserify be able to statically analyze this file +var orig_require = require; +var require = function(file) { + test(file, function() { + orig_require(file); + }); +} + +require('./add-listeners.js'); +require('./check-listener-leaks.js'); +require('./listener-count.js'); +require('./listeners-side-effects.js'); +require('./listeners.js'); +require('./max-listeners.js'); +require('./modify-in-emit.js'); +require('./num-args.js'); +require('./once.js'); +require('./set-max-listeners-side-effects.js'); +require('./subclass.js'); +require('./remove-all-listeners.js'); +require('./remove-listeners.js'); diff --git a/node_modules/events/tests/legacy-compat.js b/node_modules/events/tests/legacy-compat.js new file mode 100755 index 00000000..afbc0ab8 --- /dev/null +++ b/node_modules/events/tests/legacy-compat.js @@ -0,0 +1,18 @@ +// sigh... life is hard +if (!global.console) { + console = {} +} + +var fns = ['log', 'error', 'trace']; +for (var i=0 ; ifoo should not be emitted', '!'); +}; + +e.once('foo', remove); +e.removeListener('foo', remove); +e.emit('foo'); + +var times_recurse_emitted = 0; + +e.once('e', function() { + e.emit('e'); + times_recurse_emitted++; +}); + +e.once('e', function() { + times_recurse_emitted++; +}); + +e.emit('e'); + +assert.equal(1, times_hello_emited); +assert.equal(2, times_recurse_emitted); diff --git a/node_modules/events/tests/remove-all-listeners.js b/node_modules/events/tests/remove-all-listeners.js new file mode 100755 index 00000000..b3dc886e --- /dev/null +++ b/node_modules/events/tests/remove-all-listeners.js @@ -0,0 +1,80 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var common = require('./common'); +var assert = require('assert'); +var events = require('../'); + +var after_checks = []; +after(function() { + for (var i=0 ; i 0) { + buf = buf.slice(pos); + } + }); + }); + + req.on('error', onConnectionClosed); + req.setNoDelay(true); + req.end(); + } + + connect(); + + function _emit() { + if (self.listeners(arguments[0]).length > 0) { + self.emit.apply(self, arguments); + } + } + + this.close = function () { + if (readyState == EventSource.CLOSED) return; + readyState = EventSource.CLOSED; + req.abort(); + }; + + function parseEventStreamLine(buf, pos, fieldLength, lineLength) { + if (lineLength === 0) { + if (data.length > 0) { + var type = eventName || 'message'; + _emit(type, new MessageEvent(type, { + data: data.slice(0, -1), // remove trailing newline + lastEventId: lastEventId, + origin: original(url) + })); + data = ''; + } + eventName = void 0; + } else if (fieldLength > 0) { + var noValue = fieldLength < 0 + , step = 0 + , field = buf.slice(pos, pos + (noValue ? lineLength : fieldLength)); + + if (noValue) { + step = lineLength; + } else if (buf[pos + fieldLength + 1] !== ' ') { + step = fieldLength + 1; + } else { + step = fieldLength + 2; + } + pos += step; + var valueLength = lineLength - step + , value = buf.slice(pos, pos + valueLength); + + if (field === 'data') { + data += value + '\n'; + } else if (field === 'event') { + eventName = value; + } else if (field === 'id') { + lastEventId = value; + } else if (field === 'retry') { + var retry = parseInt(value, 10); + if (!Number.isNaN(retry)) { + self.reconnectInterval = retry; + } + } + } + } +} + +module.exports = EventSource; + +util.inherits(EventSource, events.EventEmitter); +EventSource.prototype.constructor = EventSource; // make stacktraces readable + +['open', 'error', 'message'].forEach(function (method) { + Object.defineProperty(EventSource.prototype, 'on' + method, { + /** + * Returns the current listener + * + * @return {Mixed} the set function or undefined + * @api private + */ + get: function get() { + var listener = this.listeners(method)[0]; + return listener ? (listener._listener ? listener._listener : listener) : undefined; + }, + + /** + * Start listening for events + * + * @param {Function} listener the listener + * @return {Mixed} the set function or undefined + * @api private + */ + set: function set(listener) { + this.removeAllListeners(method); + this.addEventListener(method, listener); + } + }); +}); + +/** + * Ready states + */ +Object.defineProperty(EventSource, 'CONNECTING', { enumerable: true, value: 0}); +Object.defineProperty(EventSource, 'OPEN', { enumerable: true, value: 1}); +Object.defineProperty(EventSource, 'CLOSED', { enumerable: true, value: 2}); + +/** + * Emulates the W3C Browser based WebSocket interface using addEventListener. + * + * @param {String} method Listen for an event + * @param {Function} listener callback + * @see https://developer.mozilla.org/en/DOM/element.addEventListener + * @see http://dev.w3.org/html5/websockets/#the-websocket-interface + * @api public + */ +EventSource.prototype.addEventListener = function addEventListener(method, listener) { + if (typeof listener === 'function') { + // store a reference so we can return the original function again + listener._listener = listener; + this.on(method, listener); + } +}; + +/** + * W3C Event + * + * @see http://www.w3.org/TR/DOM-Level-3-Events/#interface-Event + * @api private + */ +function Event(type, optionalProperties) { + Object.defineProperty(this, 'type', { writable: false, value: type, enumerable: true }); + if (optionalProperties) { + for (var f in optionalProperties) { + if (optionalProperties.hasOwnProperty(f)) { + Object.defineProperty(this, f, { writable: false, value: optionalProperties[f], enumerable: true }); + } + } + } +} + +/** + * W3C MessageEvent + * + * @see http://www.w3.org/TR/webmessaging/#event-definitions + * @api private + */ +function MessageEvent(type, eventInitDict) { + Object.defineProperty(this, 'type', { writable: false, value: type, enumerable: true }); + for (var f in eventInitDict) { + if (eventInitDict.hasOwnProperty(f)) { + Object.defineProperty(this, f, { writable: false, value: eventInitDict[f], enumerable: true }); + } + } +} diff --git a/node_modules/eventsource/package.json b/node_modules/eventsource/package.json new file mode 100755 index 00000000..e1913089 --- /dev/null +++ b/node_modules/eventsource/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "eventsource@0.1.6", + "scope": null, + "escapedName": "eventsource", + "name": "eventsource", + "rawSpec": "0.1.6", + "spec": "0.1.6", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/sockjs-client" + ] + ], + "_from": "eventsource@0.1.6", + "_id": "eventsource@0.1.6", + "_inCache": true, + "_location": "/eventsource", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "aslakhellesoy", + "email": "aslak.hellesoy@gmail.com" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "raw": "eventsource@0.1.6", + "scope": null, + "escapedName": "eventsource", + "name": "eventsource", + "rawSpec": "0.1.6", + "spec": "0.1.6", + "type": "version" + }, + "_requiredBy": [ + "/sockjs-client" + ], + "_resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz", + "_shasum": "0acede849ed7dd1ccc32c811bb11b944d4f29232", + "_shrinkwrap": null, + "_spec": "eventsource@0.1.6", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/sockjs-client", + "author": { + "name": "Aslak Hellesøy", + "email": "aslak.hellesoy@gmail.com" + }, + "bugs": { + "url": "http://github.com/aslakhellesoy/eventsource-node/issues" + }, + "dependencies": { + "original": ">=0.0.5" + }, + "description": "W3C compliant EventSource client for Node.js", + "devDependencies": { + "mocha": ">=1.21.4" + }, + "directories": { + "lib": "./lib" + }, + "dist": { + "shasum": "0acede849ed7dd1ccc32c811bb11b944d4f29232", + "tarball": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz" + }, + "engines": { + "node": ">=0.8.0" + }, + "gitHead": "c93edb547891f7cbd8d576751427445029bb782b", + "homepage": "http://github.com/aslakhellesoy/eventsource-node", + "keywords": [ + "eventsource", + "http", + "streaming", + "sse" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/aslakhellesoy/eventsource-node/raw/master/LICENSE" + } + ], + "main": "./lib/eventsource", + "maintainers": [ + { + "name": "aslakhellesoy", + "email": "aslak.hellesoy@gmail.com" + } + ], + "name": "eventsource", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/aslakhellesoy/eventsource-node.git" + }, + "scripts": { + "postpublish": "git push && git push --tags", + "test": "mocha --reporter spec" + }, + "version": "0.1.6" +} diff --git a/node_modules/eventsource/test/certificate.pem b/node_modules/eventsource/test/certificate.pem new file mode 100755 index 00000000..0efc2ef5 --- /dev/null +++ b/node_modules/eventsource/test/certificate.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIICATCCAWoCCQDPufXH86n2QzANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJu +bzETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMB4XDTEyMDEwMTE0NDQwMFoXDTIwMDMxOTE0NDQwMFowRTELMAkG +A1UEBhMCbm8xEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 +IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtrQ7 ++r//2iV/B6F+4boH0XqFn7alcV9lpjvAmwRXNKnxAoa0f97AjYPGNLKrjpkNXXhB +JROIdbRbZnCNeC5fzX1a+JCo7KStzBXuGSZr27TtFmcV4H+9gIRIcNHtZmJLnxbJ +sIhkGR8yVYdmJZe4eT5ldk1zoB1adgPF1hZhCBMCAwEAATANBgkqhkiG9w0BAQUF +AAOBgQCeWBEHYJ4mCB5McwSSUox0T+/mJ4W48L/ZUE4LtRhHasU9hiW92xZkTa7E +QLcoJKQiWfiLX2ysAro0NX4+V8iqLziMqvswnPzz5nezaOLE/9U/QvH3l8qqNkXu +rNbsW1h/IO6FV8avWFYVFoutUwOaZ809k7iMh2F2JMgXQ5EymQ== +-----END CERTIFICATE----- diff --git a/node_modules/eventsource/test/eventsource_test.js b/node_modules/eventsource/test/eventsource_test.js new file mode 100755 index 00000000..79f0709a --- /dev/null +++ b/node_modules/eventsource/test/eventsource_test.js @@ -0,0 +1,875 @@ +var EventSource = require('../lib/eventsource') + , http = require('http') + , https = require('https') + , fs = require('fs') + , assert = require('assert') + , u = require('url'); + +var _port = 20000; +var servers = 0; +process.on('exit', function () { + if (servers != 0) { + console.error("************ Didn't kill all servers - there is still %d running.", servers); + } +}); + +function createServer(callback) { + var server = http.createServer(); + configureServer(server, 'http', _port++, callback); +} + +function createHttpsServer(callback) { + var options = { + key: fs.readFileSync(__dirname + '/key.pem'), + cert: fs.readFileSync(__dirname + '/certificate.pem') + }; + var server = https.createServer(options); + configureServer(server, 'https', _port++, callback); +} + +function configureServer(server, protocol, port, callback) { + var responses = []; + + var oldClose = server.close; + server.close = function() { + responses.forEach(function (res) { + res.end(); + }); + servers--; + oldClose.apply(this, arguments); + }; + + server.on('request', function (req, res) { + responses.push(res); + }); + + server.url = protocol + '://localhost:' + port; + + server.listen(port, function onOpen(err) { + servers++; + callback(err, server); + }); +} + +function writeEvents(chunks) { + return function (req, res) { + res.writeHead(200, {'Content-Type': 'text/event-stream'}); + chunks.forEach(function (chunk) { + res.write(chunk); + }); + res.write(':'); // send a dummy comment to ensure that the head is flushed + }; +} + +describe('Parser', function () { + it('parses multibyte characters', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["id: 1\ndata: €豆腐\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (m) { + assert.equal("€豆腐", m.data); + server.close(done); + }; + }); + }); + + it('parses empty lines with multibyte characters', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["\n\n\n\nid: 1\ndata: 我現在都看實況不玩遊戲\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (m) { + assert.equal("我現在都看實況不玩遊戲", m.data); + server.close(done); + }; + }); + }); + + it('parses one one-line message in one chunk', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data: Hello\n\n"])); + var es = new EventSource(server.url); + es.onmessage = function (m) { + assert.equal("Hello", m.data); + server.close(done); + }; + }); + }); + + it('parses one one-line message in two chunks', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data: Hel", "lo\n\n"])); + var es = new EventSource(server.url); + es.onmessage = function (m) { + assert.equal("Hello", m.data); + server.close(done); + }; + }); + }); + + it('parses two one-line messages in one chunk', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data: Hello\n\n", "data: World\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = first; + + function first(m) { + assert.equal("Hello", m.data); + es.onmessage = second; + } + + function second(m) { + assert.equal("World", m.data); + server.close(done); + } + }); + }); + + it('parses one two-line message in one chunk', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data: Hello\ndata:World\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (m) { + assert.equal("Hello\nWorld", m.data); + server.close(done); + }; + }); + }); + + it('parses really chopped up unicode data', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + var chopped = "data: Aslak\n\ndata: Hellesøy\n\n".split(""); + server.on('request', writeEvents(chopped)); + var es = new EventSource(server.url); + + es.onmessage = first; + + function first(m) { + assert.equal("Aslak", m.data); + es.onmessage = second; + } + + function second(m) { + assert.equal("Hellesøy", m.data); + server.close(done); + } + }); + }); + + it('accepts CRLF as separator', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + var chopped = "data: Aslak\r\n\r\ndata: Hellesøy\r\n\r\n".split(""); + server.on('request', writeEvents(chopped)); + var es = new EventSource(server.url); + + es.onmessage = first; + + function first(m) { + assert.equal("Aslak", m.data); + es.onmessage = second; + } + + function second(m) { + assert.equal("Hellesøy", m.data); + server.close(done); + } + }); + }); + + it('accepts CR as separator', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + var chopped = "data: Aslak\r\rdata: Hellesøy\r\r".split(""); + server.on('request', writeEvents(chopped)); + var es = new EventSource(server.url); + + es.onmessage = first; + + function first(m) { + assert.equal("Aslak", m.data); + es.onmessage = second; + } + + function second(m) { + assert.equal("Hellesøy", m.data); + server.close(done); + } + }); + }); + + it('delivers message with explicit event', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["event: greeting\ndata: Hello\n\n"])); + var es = new EventSource(server.url); + + es.addEventListener('greeting', function (m) { + assert.equal("Hello", m.data); + server.close(done); + }); + }); + }); + + it('ignores comments', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data: Hello\n\n:nothing to see here\n\ndata: World\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = first; + + function first(m) { + assert.equal("Hello", m.data); + es.onmessage = second; + } + + function second(m) { + assert.equal("World", m.data); + server.close(done); + } + }); + }); + + it('ignores empty comments', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data: Hello\n\n:\n\ndata: World\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = first; + + function first(m) { + assert.equal("Hello", m.data); + es.onmessage = second; + } + + function second(m) { + assert.equal("World", m.data); + server.close(done); + } + }); + }); + + it('does not ignore multilines strings', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data: line one\ndata:\ndata: line two\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (m) { + assert.equal('line one\n\nline two', m.data); + server.close(done); + }; + }); + }); + + it('does not ignore multilines strings even in data beginning', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["data:\ndata:line one\ndata: line two\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (m) { + assert.equal('\nline one\nline two', m.data); + server.close(done); + }; + }); + }); + + it('causes entire event to be ignored for empty event field', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', writeEvents(["event:\n\ndata: Hello\n\n"])); + var es = new EventSource(server.url); + + var originalEmit = es.emit; + es.emit = function (event) { + assert.ok(event === 'message' || event === 'newListener'); + return originalEmit.apply(this, arguments); + }; + es.onmessage = function (m) { + assert.equal('Hello', m.data); + server.close(done); + }; + }); + }); + + it('parses relatively huge messages efficiently', function (done) { + this.timeout(1000); + + createServer(function (err, server) { + if (err) return done(err); + var longMessage = "data: " + new Array(100000).join('a') + "\n\n"; + server.on('request', writeEvents([longMessage])); + + var es = new EventSource(server.url); + + es.onmessage = function () { + server.close(done); + }; + }); + }); +}); + +describe('HTTP Request', function () { + it('passes cache-control: no-cache to server', function (done) { + createServer(function (err, server) { + if (err) return done(err); + + server.on('request', function (req) { + assert.equal('no-cache', req.headers['cache-control']); + server.close(done); + }); + new EventSource(server.url); + }); + }); + + it('sets request headers', function (done) { + var server = createServer(function (err, server) { + if (err) return done(err); + + server.on('request', function (req) { + assert.equal(req.headers['user-agent'], 'test'); + assert.equal(req.headers['cookie'], 'test=test'); + assert.equal(req.headers['last-event-id'], '99'); + server.close(done); + }); + + var headers = { + 'User-Agent': 'test', + 'Cookie': 'test=test', + 'Last-Event-ID': '99' + }; + new EventSource(server.url, {headers: headers}); + }); + }); + + it("does not set request headers that don't have a value", function (done) { + var server = createServer(function (err, server) { + if (err) return done(err); + + server.on('request', function (req) { + assert.equal(req.headers['user-agent'], 'test'); + assert.equal(req.headers['cookie'], 'test=test'); + assert.equal(req.headers['last-event-id'], '99'); + assert.equal(req.headers['X-Something'], undefined); + server.close(done); + }); + + var headers = { + 'User-Agent': 'test', + 'Cookie': 'test=test', + 'Last-Event-ID': '99', + 'X-Something': null + }; + + assert.doesNotThrow( + function() { + new EventSource(server.url, {headers: headers}); + } + ); + }); + }); + + [301, 307].forEach(function (status) { + it('follows http ' + status + ' redirect', function (done) { + var redirectSuffix = '/foobar'; + var clientRequestedRedirectUrl = false; + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', function (req, res) { + if (req.url === '/') { + res.writeHead(status, { + 'Connection': 'Close', + 'Location': server.url + redirectSuffix + }); + res.end(); + } else if (req.url === redirectSuffix) { + clientRequestedRedirectUrl = true; + res.writeHead(200, {'Content-Type': 'text/event-stream'}); + res.end(); + } + }); + + var es = new EventSource(server.url); + es.onopen = function () { + assert.ok(clientRequestedRedirectUrl); + assert.equal(server.url + redirectSuffix, es.url); + server.close(done); + }; + }); + }); + + + it('causes error event when response is ' + status + ' with missing location', function (done) { + var redirectSuffix = '/foobar'; + var clientRequestedRedirectUrl = false; + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', function (req, res) { + res.writeHead(status, { + 'Connection': 'Close' + }); + res.end(); + }); + + var es = new EventSource(server.url); + es.onerror = function (err) { + assert.equal(err.status, status); + server.close(done); + }; + }); + }); + }); + + [401, 403].forEach(function (status) { + it('causes error event when response status is ' + status, function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', function (req, res) { + res.writeHead(status, {'Content-Type': 'text/html'}); + res.end(); + }); + + var es = new EventSource(server.url); + es.onerror = function (err) { + assert.equal(err.status, status); + server.close(done); + }; + }); + }); + }); +}); + +describe('HTTPS Support', function () { + it('uses https for https urls', function (done) { + createHttpsServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["data: hello\n\n"])); + var es = new EventSource(server.url, {rejectUnauthorized: false}); + + es.onmessage = function (m) { + assert.equal("hello", m.data); + server.close(done); + } + }); + }); +}); + +describe('Reconnection', function () { + it('is attempted when server is down', function (done) { + var es = new EventSource('http://localhost:' + _port); + es.reconnectInterval = 0; + + es.onerror = function () { + es.onerror = null; + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["data: hello\n\n"])); + + es.onmessage = function (m) { + assert.equal("hello", m.data); + server.close(done); + } + }); + }; + }); + + it('is attempted when server goes down after connection', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["data: hello\n\n"])); + var es = new EventSource(server.url); + es.reconnectInterval = 0; + + es.onmessage = function (m) { + assert.equal("hello", m.data); + server.close(function (err) { + if(err) return done(err); + + var port = u.parse(es.url).port; + configureServer(http.createServer(), 'http', port, function (err, server2) { + if(err) return done(err); + + server2.on('request', writeEvents(["data: world\n\n"])); + es.onmessage = function (m) { + assert.equal("world", m.data); + server2.close(done); + }; + }); + }); + }; + }); + }); + + it('is stopped when server goes down and eventsource is being closed', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["data: hello\n\n"])); + var es = new EventSource(server.url); + es.reconnectInterval = 0; + + es.onmessage = function (m) { + assert.equal("hello", m.data); + server.close(function (err) { + if(err) return done(err); + // The server has closed down. es.onerror should now get called, + // because es's remote connection was dropped. + }); + }; + + es.onerror = function () { + // We received an error because the remote connection was closed. + // We close es, so we do not want es to reconnect. + es.close(); + + var port = u.parse(es.url).port; + configureServer(http.createServer(), 'http', port, function (err, server2) { + if(err) return done(err); + server2.on('request', writeEvents(["data: world\n\n"])); + + es.onmessage = function (m) { + return done(new Error("Unexpected message: " + m.data)); + }; + + setTimeout(function () { + // We have not received any message within 100ms, we can + // presume this works correctly. + server2.close(done); + }, 100); + }); + }; + }); + }); + + it('is not attempted when server responds with HTTP 204', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', function (req, res) { + res.writeHead(204); + res.end(); + }); + + var es = new EventSource(server.url); + es.reconnectInterval = 0; + + es.onerror = function (e) { + assert.equal(e.status, 204); + server.close(function (err) { + if(err) return done(err); + + var port = u.parse(es.url).port; + configureServer(http.createServer(), 'http', port, function (err, server2) { + if(err) return done(err); + + // this will be verified by the readyState + // going from CONNECTING to CLOSED, + // along with the tests verifying that the + // state is CONNECTING when a server closes. + // it's next to impossible to write a fail-safe + // test for this, though. + var ival = setInterval(function () { + if (es.readyState == EventSource.CLOSED) { + clearInterval(ival); + server2.close(done); + } + }, 5); + }); + }); + }; + }); + }); + + it('sends Last-Event-ID http header when it has previously been passed in an event from the server', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(['id: 10\ndata: Hello\n\n'])); + + var es = new EventSource(server.url); + es.reconnectInterval = 0; + + es.onmessage = function () { + server.close(function (err) { + if(err) return done(err); + + var port = u.parse(es.url).port; + configureServer(http.createServer(), 'http', port, function (err, server2) { + server2.on('request', function (req, res) { + assert.equal('10', req.headers['last-event-id']); + server2.close(done); + }); + }); + }); + }; + }); + }); + + it('sends correct Last-Event-ID http header when an initial Last-Event-ID header was specified in the constructor', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', function (req, res) { + assert.equal('9', req.headers['last-event-id']); + server.close(done); + }); + + new EventSource(server.url, {headers: {'Last-Event-ID': '9'}}); + }); + }); + + it('does not send Last-Event-ID http header when it has not been previously sent by the server', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(['data: Hello\n\n'])); + + var es = new EventSource(server.url); + es.reconnectInterval = 0; + + es.onmessage = function () { + server.close(function (err) { + if(err) return done(err); + + var port = u.parse(es.url).port; + configureServer(http.createServer(), 'http', port, function (err, server2) { + server2.on('request', function (req, res) { + assert.equal(undefined, req.headers['last-event-id']); + server2.close(done); + }); + }); + }); + }; + }); + }); +}); + +describe('readyState', function () { + it('has CONNECTING constant', function () { + assert.equal(0, EventSource.CONNECTING); + }); + + it('has OPEN constant', function () { + assert.equal(1, EventSource.OPEN); + }); + + it('has CLOSED constant', function () { + assert.equal(2, EventSource.CLOSED); + }); + + it('is CONNECTING before connection has been established', function (done) { + var es = new EventSource('http://localhost:' + _port); + assert.equal(EventSource.CONNECTING, es.readyState); + es.onerror = function () { + es.close(); + done(); + } + }); + + it('is CONNECTING when server has closed the connection', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents([])); + var es = new EventSource(server.url); + es.reconnectInterval = 0; + + es.onopen = function (m) { + server.close(function (err) { + if(err) return done(err); + + es.onerror = function () { + es.onerror = null; + assert.equal(EventSource.CONNECTING, es.readyState); + done(); + }; + }); + }; + }); + }); + + it('is OPEN when connection has been established', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents([])); + var es = new EventSource(server.url); + + es.onopen = function () { + assert.equal(EventSource.OPEN, es.readyState); + server.close(done); + } + }); + }); + + it('is CLOSED after connection has been closed', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents([])); + var es = new EventSource(server.url); + + es.onopen = function () { + es.close(); + assert.equal(EventSource.CLOSED, es.readyState); + server.close(done); + } + }); + }); +}); + +describe('Properties', function () { + it('url exposes original request url', function () { + var url = 'http://localhost:' + _port; + var es = new EventSource(url); + assert.equal(url, es.url); + }); +}); + +describe('Events', function () { + it('calls onopen when connection is established', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents([])); + var es = new EventSource(server.url); + + es.onopen = function (event) { + assert.equal(event.type, 'open'); + server.close(done); + } + }); + }); + + it('supplies the correct origin', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["data: hello\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (event) { + assert.equal(event.origin, server.url); + server.close(done); + } + }); + }); + + it('emits open event when connection is established', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents([])); + var es = new EventSource(server.url); + + es.addEventListener('open', function (event) { + assert.equal(event.type, 'open'); + server.close(done); + }); + }); + }); + + it('does not emit error when connection is closed by client', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents([])); + var es = new EventSource(server.url); + + es.addEventListener('open', function () { + es.close(); + process.nextTick(function () { + server.close(done); + }); + }); + es.addEventListener('error', function () { + done(new Error('error should not be emitted')); + }); + }); + }); + + it('populates message\'s lastEventId correctly when the last event has an associated id', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["id: 123\ndata: hello\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (m) { + assert.equal(m.lastEventId, "123"); + server.close(done); + }; + }); + }); + + it('populates message\'s lastEventId correctly when the last event doesn\'t have an associated id', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["id: 123\ndata: Hello\n\n", "data: World\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = first; + + function first() { + es.onmessage = second; + } + + function second(m) { + assert.equal(m.data, "World"); + assert.equal(m.lastEventId, "123"); //expect to get back the previous event id + server.close(done); + } + }); + }); + + it('populates messages with enumerable properties so they can be inspected via console.log().', function (done) { + createServer(function (err, server) { + if(err) return done(err); + + server.on('request', writeEvents(["data: World\n\n"])); + var es = new EventSource(server.url); + + es.onmessage = function (m) { + var enumerableAttributes = Object.keys(m); + assert.notEqual(enumerableAttributes.indexOf("data"), -1); + assert.notEqual(enumerableAttributes.indexOf("type"), -1); + server.close(done); + }; + }); + }); +}); diff --git a/node_modules/eventsource/test/key.pem b/node_modules/eventsource/test/key.pem new file mode 100755 index 00000000..176fe320 --- /dev/null +++ b/node_modules/eventsource/test/key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQC2tDv6v//aJX8HoX7hugfReoWftqVxX2WmO8CbBFc0qfEChrR/ +3sCNg8Y0squOmQ1deEElE4h1tFtmcI14Ll/NfVr4kKjspK3MFe4ZJmvbtO0WZxXg +f72AhEhw0e1mYkufFsmwiGQZHzJVh2Yll7h5PmV2TXOgHVp2A8XWFmEIEwIDAQAB +AoGAAlVY8sHi/aE+9xT77twWX3mGHV0SzdjfDnly40fx6S1Gc7bOtVdd9DC7pk6l +3ENeJVR02IlgU8iC5lMHq4JEHPE272jtPrLlrpWLTGmHEqoVFv9AITPqUDLhB9Kk +Hjl7h8NYBKbr2JHKICr3DIPKOT+RnXVb1PD4EORbJ3ooYmkCQQDfknUnVxPgxUGs +ouABw1WJIOVgcCY/IFt4Ihf6VWTsxBgzTJKxn3HtgvE0oqTH7V480XoH0QxHhjLq +DrgobWU9AkEA0TRJ8/ouXGnFEPAXjWr9GdPQRZ1Use2MrFjneH2+Sxc0CmYtwwqL +Kr5kS6mqJrxprJeluSjBd+3/ElxURrEXjwJAUvmlN1OPEhXDmRHd92mKnlkyKEeX +OkiFCiIFKih1S5Y/sRJTQ0781nyJjtJqO7UyC3pnQu1oFEePL+UEniRztQJAMfav +AtnpYKDSM+1jcp7uu9BemYGtzKDTTAYfoiNF42EzSJiGrWJDQn4eLgPjY0T0aAf/ +yGz3Z9ErbhMm/Ysl+QJBAL4kBxRT8gM4ByJw4sdOvSeCCANFq8fhbgm8pGWlCPb5 +JGmX3/GHFM8x2tbWMGpyZP1DLtiNEFz7eCGktWK5rqE= +-----END RSA PRIVATE KEY----- diff --git a/node_modules/execspawn/.npmignore b/node_modules/execspawn/.npmignore new file mode 100755 index 00000000..b2e08124 --- /dev/null +++ b/node_modules/execspawn/.npmignore @@ -0,0 +1,2 @@ + +/node_modules/ diff --git a/node_modules/execspawn/LICENSE.md b/node_modules/execspawn/LICENSE.md new file mode 100755 index 00000000..62803503 --- /dev/null +++ b/node_modules/execspawn/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (c) 2013 Andreas Madsen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/execspawn/README.md b/node_modules/execspawn/README.md new file mode 100755 index 00000000..6dd91bd1 --- /dev/null +++ b/node_modules/execspawn/README.md @@ -0,0 +1,52 @@ +#execspawn + +> spawn stream for child_process.exec + +## Installation + +```sheel +npm install execspawn +``` + +## Documentation + +```JavaScript +var execspawn = require('execspawn'); + +var cmd = execspawn('echo "hallo world";', { + cwd: __dirname, // all the spawn options + shell: '/bin/bash' // shell to execute the command with +}); + +// all the streams +cmd.stderr; +cmd.stdout; +cmd.stdin; +``` + +See node.js [documentation](http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) +for more info. + +##License + +**The software is license under "MIT"** + +> Copyright (c) 2013 Andreas Madsen +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. diff --git a/node_modules/execspawn/execspawn.js b/node_modules/execspawn/execspawn.js new file mode 100755 index 00000000..8d323c0d --- /dev/null +++ b/node_modules/execspawn/execspawn.js @@ -0,0 +1,25 @@ + +var extend = require('util-extend'); +var spawn = require('child_process').spawn; + +module.exports = function execstream(command, options) { + var file, args; + options = extend({}, options); + + if (process.platform === 'win32') { + file = process.env.comspec || 'cmd.exe'; + args = ['/s', '/c', '"' + command + '"']; + options.windowsVerbatimArguments = true; + } else { + file = '/bin/sh'; + args = ['-c', command]; + options.windowsVerbatimArguments = false; + } + + if (options && options.shell) { + file = options.shell; + delete options.shell; + } + + return spawn(file, args, options); +}; diff --git a/node_modules/execspawn/package.json b/node_modules/execspawn/package.json new file mode 100755 index 00000000..dc155d5a --- /dev/null +++ b/node_modules/execspawn/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "execspawn@^1.0.0", + "scope": null, + "escapedName": "execspawn", + "name": "execspawn", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/npm-execspawn" + ] + ], + "_from": "execspawn@>=1.0.0 <2.0.0", + "_id": "execspawn@1.0.1", + "_inCache": true, + "_location": "/execspawn", + "_nodeVersion": "5.7.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/execspawn-1.0.1.tgz_1456761959847_0.8310068673454225" + }, + "_npmUser": { + "name": "andreasmadsen", + "email": "amwebdk@gmail.com" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "raw": "execspawn@^1.0.0", + "scope": null, + "escapedName": "execspawn", + "name": "execspawn", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-execspawn" + ], + "_resolved": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz", + "_shasum": "8286f9dde7cecde7905fbdc04e24f368f23f8da6", + "_shrinkwrap": null, + "_spec": "execspawn@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/npm-execspawn", + "author": { + "name": "Andreas Madsen", + "email": "amwebdk@gmail.com" + }, + "bugs": { + "url": "https://github.com/AndreasMadsen/execspawn/issues" + }, + "dependencies": { + "util-extend": "^1.0.1" + }, + "description": "spawn stream for child_process.exec", + "devDependencies": { + "endpoint": "^0.4.5", + "tap": "^5.0.0" + }, + "directories": {}, + "dist": { + "shasum": "8286f9dde7cecde7905fbdc04e24f368f23f8da6", + "tarball": "https://registry.npmjs.org/execspawn/-/execspawn-1.0.1.tgz" + }, + "gitHead": "6c11a755af6a666399e8e654b042d01d4ac116a4", + "homepage": "https://github.com/AndreasMadsen/execspawn#readme", + "keywords": [ + "exec", + "stream", + "spawn" + ], + "license": "MIT", + "main": "./execspawn.js", + "maintainers": [ + { + "name": "andreasmadsen", + "email": "amwebdk@gmail.com" + } + ], + "name": "execspawn", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/AndreasMadsen/execspawn.git" + }, + "scripts": { + "test": "tap test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/execspawn/test.js b/node_modules/execspawn/test.js new file mode 100755 index 00000000..bbe9faa7 --- /dev/null +++ b/node_modules/execspawn/test.js @@ -0,0 +1,20 @@ + +var test = require('tap').test; +var execstream = require('./execspawn.js'); +var endpoint = require('endpoint'); + +test('default', function (t) { + execstream('echo "hallo world";').stdout.pipe(endpoint(function (err, out) { + t.equal(err, null); + t.equal(out.toString(), 'hallo world\n'); + t.end(); + })); +}); + +test('shell option', function (t) { + execstream('hallo world', { shell: 'echo' }).stdout.pipe(endpoint(function (err, out) { + t.equal(err, null); + t.equal(out.toString(), '-c hallo world\n'); + t.end(); + })); +}); diff --git a/node_modules/expand-brackets/LICENSE b/node_modules/expand-brackets/LICENSE new file mode 100755 index 00000000..1e49edf8 --- /dev/null +++ b/node_modules/expand-brackets/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/expand-brackets/README.md b/node_modules/expand-brackets/README.md new file mode 100755 index 00000000..d3c913e7 --- /dev/null +++ b/node_modules/expand-brackets/README.md @@ -0,0 +1,107 @@ +# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Build Status](https://img.shields.io/travis/jonschlinkert/expand-brackets.svg?style=flat)](https://travis-ci.org/jonschlinkert/expand-brackets) + +> Expand POSIX bracket expressions (character classes) in glob patterns. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install expand-brackets --save +``` + +## Usage + +```js +var brackets = require('expand-brackets'); + +brackets('[![:lower:]]'); +//=> '[^a-z]' +``` + +## .isMatch + +Return true if the given string matches the bracket expression: + +```js +brackets.isMatch('A', '[![:lower:]]'); +//=> true + +brackets.isMatch('a', '[![:lower:]]'); +//=> false +``` + +## .makeRe + +Make a regular expression from a bracket expression: + +```js +brackets.makeRe('[![:lower:]]'); +//=> /[^a-z]/ +``` + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]`: Alphanumeric characters (`a-zA-Z0-9]`) +* `[:alpha:]`: Alphabetic characters (`a-zA-Z]`) +* `[:blank:]`: Space and tab (`[ t]`) +* `[:digit:]`: Digits (`[0-9]`) +* `[:lower:]`: Lowercase letters (`[a-z]`) +* `[:punct:]`: Punctuation and symbols. (`[!"#$%&'()*+, -./:;<=>?@ [\]^_``{|}~]`) +* `[:upper:]`: Uppercase letters (`[A-Z]`) +* `[:word:]`: Word characters (letters, numbers and underscores) (`[A-Za-z0-9_]`) +* `[:xdigit:]`: Hexadecimal digits (`[A-Fa-f0-9]`) + +Collating sequences are not supported. + +## Related projects + +You might also be interested in these projects: + +* [extglob](https://www.npmjs.com/package/extglob): Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to… [more](https://www.npmjs.com/package/extglob) | [homepage](https://github.com/jonschlinkert/extglob) +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) +* [is-posix-bracket](https://www.npmjs.com/package/is-posix-bracket): Returns true if the given string is a POSIX bracket expression (POSIX character class). | [homepage](https://github.com/jonschlinkert/is-posix-bracket) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/expand-brackets/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +verb © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v, on April 01, 2016._ \ No newline at end of file diff --git a/node_modules/expand-brackets/index.js b/node_modules/expand-brackets/index.js new file mode 100755 index 00000000..b843cc2b --- /dev/null +++ b/node_modules/expand-brackets/index.js @@ -0,0 +1,163 @@ +/*! + * expand-brackets + * + * Copyright (c) 2015 Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var isPosixBracket = require('is-posix-bracket'); + +/** + * POSIX character classes + */ + +var POSIX = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E', + punct: '-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9', +}; + +/** + * Expose `brackets` + */ + +module.exports = brackets; + +function brackets(str) { + if (!isPosixBracket(str)) { + return str; + } + + var negated = false; + if (str.indexOf('[^') !== -1) { + negated = true; + str = str.split('[^').join('['); + } + if (str.indexOf('[!') !== -1) { + negated = true; + str = str.split('[!').join('['); + } + + var a = str.split('['); + var b = str.split(']'); + var imbalanced = a.length !== b.length; + + var parts = str.split(/(?::\]\[:|\[?\[:|:\]\]?)/); + var len = parts.length, i = 0; + var end = '', beg = ''; + var res = []; + + // start at the end (innermost) first + while (len--) { + var inner = parts[i++]; + if (inner === '^[!' || inner === '[!') { + inner = ''; + negated = true; + } + + var prefix = negated ? '^' : ''; + var ch = POSIX[inner]; + + if (ch) { + res.push('[' + prefix + ch + ']'); + } else if (inner) { + if (/^\[?\w-\w\]?$/.test(inner)) { + if (i === parts.length) { + res.push('[' + prefix + inner); + } else if (i === 1) { + res.push(prefix + inner + ']'); + } else { + res.push(prefix + inner); + } + } else { + if (i === 1) { + beg += inner; + } else if (i === parts.length) { + end += inner; + } else { + res.push('[' + prefix + inner + ']'); + } + } + } + } + + var result = res.join('|'); + var rlen = res.length || 1; + if (rlen > 1) { + result = '(?:' + result + ')'; + rlen = 1; + } + if (beg) { + rlen++; + if (beg.charAt(0) === '[') { + if (imbalanced) { + beg = '\\[' + beg.slice(1); + } else { + beg += ']'; + } + } + result = beg + result; + } + if (end) { + rlen++; + if (end.slice(-1) === ']') { + if (imbalanced) { + end = end.slice(0, end.length - 1) + '\\]'; + } else { + end = '[' + end; + } + } + result += end; + } + + if (rlen > 1) { + result = result.split('][').join(']|['); + if (result.indexOf('|') !== -1 && !/\(\?/.test(result)) { + result = '(?:' + result + ')'; + } + } + + result = result.replace(/\[+=|=\]+/g, '\\b'); + return result; +} + +brackets.makeRe = function(pattern) { + try { + return new RegExp(brackets(pattern)); + } catch (err) {} +}; + +brackets.isMatch = function(str, pattern) { + try { + return brackets.makeRe(pattern).test(str); + } catch (err) { + return false; + } +}; + +brackets.match = function(arr, pattern) { + var len = arr.length, i = 0; + var res = arr.slice(); + + var re = brackets.makeRe(pattern); + while (i < len) { + var ele = arr[i++]; + if (!re.test(ele)) { + continue; + } + res.splice(i, 1); + } + return res; +}; diff --git a/node_modules/expand-brackets/package.json b/node_modules/expand-brackets/package.json new file mode 100755 index 00000000..496ebae4 --- /dev/null +++ b/node_modules/expand-brackets/package.json @@ -0,0 +1,136 @@ +{ + "_args": [ + [ + { + "raw": "expand-brackets@^0.1.4", + "scope": null, + "escapedName": "expand-brackets", + "name": "expand-brackets", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch" + ] + ], + "_from": "expand-brackets@>=0.1.4 <0.2.0", + "_id": "expand-brackets@0.1.5", + "_inCache": true, + "_location": "/expand-brackets", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/expand-brackets-0.1.5.tgz_1459554506001_0.9547659594099969" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "raw": "expand-brackets@^0.1.4", + "scope": null, + "escapedName": "expand-brackets", + "name": "expand-brackets", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "_shasum": "df07284e342a807cd733ac5af72411e581d1177b", + "_shrinkwrap": null, + "_spec": "expand-brackets@^0.1.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/expand-brackets/issues" + }, + "dependencies": { + "is-posix-bracket": "^0.1.0" + }, + "description": "Expand POSIX bracket expressions (character classes) in glob patterns.", + "devDependencies": { + "gulp-format-md": "^0.1.7", + "mocha": "^2.2.5", + "should": "^7.0.2" + }, + "directories": {}, + "dist": { + "shasum": "df07284e342a807cd733ac5af72411e581d1177b", + "tarball": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "1b07fda8ee8b6426d95e6539785b74c57e9ee542", + "homepage": "https://github.com/jonschlinkert/expand-brackets", + "keywords": [ + "bracket", + "character class", + "expression", + "posix" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "es128", + "email": "elan.shanker+npm@gmail.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "expand-brackets", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/expand-brackets.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "extglob", + "is-extglob", + "is-glob", + "is-posix-bracket", + "micromatch" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.5" +} diff --git a/node_modules/expand-range/LICENSE b/node_modules/expand-range/LICENSE new file mode 100755 index 00000000..b1e51ff7 --- /dev/null +++ b/node_modules/expand-range/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/expand-range/README.md b/node_modules/expand-range/README.md new file mode 100755 index 00000000..72c7e8c6 --- /dev/null +++ b/node_modules/expand-range/README.md @@ -0,0 +1,145 @@ +# expand-range [![NPM version](https://img.shields.io/npm/v/expand-range.svg?style=flat)](https://www.npmjs.com/package/expand-range) [![NPM downloads](https://img.shields.io/npm/dm/expand-range.svg?style=flat)](https://npmjs.org/package/expand-range) [![Build Status](https://img.shields.io/travis/jonschlinkert/expand-range.svg?style=flat)](https://travis-ci.org/jonschlinkert/expand-range) + +Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install expand-range --save +``` + +Wraps [fill-range] to do range expansion using `..` separated strings. See [fill-range] for the full list of options and features. + +## Example usage + +```js +var expand = require('expand-range'); +``` + +**Params** + +```js +expand(start, stop, increment); +``` + +* `start`: the number or letter to start with +* `end`: the number or letter to end with +* `increment`: optionally pass the increment to use. works for letters or numbers + +**Examples** + +```js +expand('a..e') +//=> ['a', 'b', 'c', 'd', 'e'] + +expand('a..e..2') +//=> ['a', 'c', 'e'] + +expand('A..E..2') +//=> ['A', 'C', 'E'] + +expand('1..3') +//=> ['1', '2', '3'] + +expand('0..-5') +//=> [ '0', '-1', '-2', '-3', '-4', '-5' ] + +expand('-9..9..3') +//=> [ '-9', '-6', '-3', '0', '3', '6', '9' ]) + +expand('-1..-10..-2') +//=> [ '-1', '-3', '-5', '-7', '-9' ] + +expand('1..10..2') +//=> [ '1', '3', '5', '7', '9' ] +``` + +### Custom function + +Optionally pass a custom function as the second argument: + +```js +expand('a..e', function (val, isNumber, pad, i) { + if (!isNumber) { + return String.fromCharCode(val) + i; + } + return val; +}); +//=> ['a0', 'b1', 'c2', 'd3', 'e4'] +``` + +## Benchmarks + +```sh +# benchmark/fixtures/alpha-lower.js (29 bytes) + brace-expansion x 145,653 ops/sec ±0.89% (87 runs sampled) + expand-range x 453,213 ops/sec ±1.66% (85 runs sampled) + minimatch x 152,193 ops/sec ±1.17% (86 runs sampled) + +# benchmark/fixtures/alpha-upper.js (29 bytes) + brace-expansion x 149,975 ops/sec ±1.10% (88 runs sampled) + expand-range x 459,390 ops/sec ±1.27% (84 runs sampled) + minimatch x 155,253 ops/sec ±1.25% (88 runs sampled) + +# benchmark/fixtures/padded.js (33 bytes) + brace-expansion x 14,694 ops/sec ±1.37% (85 runs sampled) + expand-range x 169,393 ops/sec ±1.76% (80 runs sampled) + minimatch x 15,052 ops/sec ±1.15% (88 runs sampled) + +# benchmark/fixtures/range.js (29 bytes) + brace-expansion x 142,968 ops/sec ±1.35% (86 runs sampled) + expand-range x 465,579 ops/sec ±1.43% (86 runs sampled) + minimatch x 126,872 ops/sec ±1.18% (90 runs sampled) +``` + +## Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://www.npmjs.com/package/braces) | [homepage](https://github.com/jonschlinkert/braces) +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://www.npmjs.com/package/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/expand-range/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/expand-range/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 05, 2016._ \ No newline at end of file diff --git a/node_modules/expand-range/index.js b/node_modules/expand-range/index.js new file mode 100755 index 00000000..369962a8 --- /dev/null +++ b/node_modules/expand-range/index.js @@ -0,0 +1,43 @@ +/*! + * expand-range + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var fill = require('fill-range'); + +module.exports = function expandRange(str, options, fn) { + if (typeof str !== 'string') { + throw new TypeError('expand-range expects a string.'); + } + + if (typeof options === 'function') { + fn = options; + options = {}; + } + + if (typeof options === 'boolean') { + options = {}; + options.makeRe = true; + } + + // create arguments to pass to fill-range + var opts = options || {}; + var args = str.split('..'); + var len = args.length; + if (len > 3) { return str; } + + // if only one argument, it can't expand so return it + if (len === 1) { return args; } + + // if `true`, tell fill-range to regexify the string + if (typeof fn === 'boolean' && fn === true) { + opts.makeRe = true; + } + + args.push(opts); + return fill.apply(null, args.concat(fn)); +}; diff --git a/node_modules/expand-range/package.json b/node_modules/expand-range/package.json new file mode 100755 index 00000000..c8ce7583 --- /dev/null +++ b/node_modules/expand-range/package.json @@ -0,0 +1,143 @@ +{ + "_args": [ + [ + { + "raw": "expand-range@^1.8.1", + "scope": null, + "escapedName": "expand-range", + "name": "expand-range", + "rawSpec": "^1.8.1", + "spec": ">=1.8.1 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/braces" + ] + ], + "_from": "expand-range@>=1.8.1 <2.0.0", + "_id": "expand-range@1.8.2", + "_inCache": true, + "_location": "/expand-range", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/expand-range-1.8.2.tgz_1462440434873_0.7174076174851507" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "raw": "expand-range@^1.8.1", + "scope": null, + "escapedName": "expand-range", + "name": "expand-range", + "rawSpec": "^1.8.1", + "spec": ">=1.8.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/braces" + ], + "_resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "_shasum": "a299effd335fe2721ebae8e257ec79644fc85337", + "_shrinkwrap": null, + "_spec": "expand-range@^1.8.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/expand-range/issues" + }, + "dependencies": { + "fill-range": "^2.1.0" + }, + "description": "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.", + "devDependencies": { + "benchmarked": "^0.2.4", + "brace-expansion": "^1.1.4", + "glob": "^7.0.3", + "gulp-format-md": "^0.1.9", + "minimatch": "^3.0.0", + "mocha": "^2.4.5" + }, + "directories": {}, + "dist": { + "shasum": "a299effd335fe2721ebae8e257ec79644fc85337", + "tarball": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "4c873af0870df8382bafc66a93d5c89e3aad3d4d", + "homepage": "https://github.com/jonschlinkert/expand-range", + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "expand", + "expansion", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "sh" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "expand-range", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/expand-range.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "plugins": [ + "gulp-format-md" + ], + "reflinks": [ + "verb" + ], + "toc": false, + "layout": "default", + "lint": { + "reflinks": true + }, + "tasks": [ + "readme" + ], + "related": { + "list": [ + "micromatch", + "fill-range", + "braces" + ] + } + }, + "version": "1.8.2" +} diff --git a/node_modules/express/History.md b/node_modules/express/History.md new file mode 100755 index 00000000..5bfd5690 --- /dev/null +++ b/node_modules/express/History.md @@ -0,0 +1,3248 @@ +4.15.2 / 2017-03-06 +=================== + + * deps: qs@6.4.0 + - Fix regression parsing keys starting with `[` + +4.15.1 / 2017-03-05 +=================== + + * deps: send@0.15.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - Fix strict violation in broken environments + * deps: serve-static@1.12.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - deps: send@0.15.1 + +4.15.0 / 2017-03-01 +=================== + + * Add debug message when loading view engine + * Add `next("router")` to exit from router + * Fix case where `router.use` skipped requests routes did not + * Remove usage of `res._headers` private field + - Improves compatibility with Node.js 8 nightly + * Skip routing when `req.url` is not set + * Use `%o` in path debug to tell types apart + * Use `Object.create` to setup request & response prototypes + * Use `setprototypeof` module to replace `__proto__` setting + * Use `statuses` instead of `http` module for status messages + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: etag@~1.8.0 + - Use SHA1 instead of MD5 for ETag hashing + - Works with FIPS 140-2 OpenSSL configuration + * deps: finalhandler@~1.0.0 + - Fix exception when `err` cannot be converted to a string + - Fully URL-encode the pathname in the 404 + - Only include the pathname in the 404 message + - Send complete HTML document + - Set `Content-Security-Policy: default-src 'self'` header + - deps: debug@2.6.1 + * deps: fresh@0.5.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - perf: delay reading header values until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove duplicate conditional + - perf: remove unnecessary boolean coercions + - perf: skip checking modified time if ETag check failed + - perf: skip parsing `If-None-Match` when no `ETag` header + - perf: use `Date.parse` instead of `new Date` + * deps: qs@6.3.1 + - Fix array parsing from skipping empty values + - Fix compacting nested arrays + * deps: send@0.15.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: debug@2.6.1 + - deps: etag@~1.8.0 + - deps: fresh@0.5.0 + - deps: http-errors@~1.6.1 + * deps: serve-static@1.12.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Send complete HTML document in redirect response + - Set default CSP header in redirect response + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: send@0.15.0 + * perf: add fast match path for `*` route + * perf: improve `req.ips` performance + +4.14.1 / 2017-01-28 +=================== + + * deps: content-disposition@0.5.2 + * deps: finalhandler@0.5.1 + - Fix exception when `err.headers` is not an object + - deps: statuses@~1.3.1 + - perf: hoist regular expressions + - perf: remove duplicate validation path + * deps: proxy-addr@~1.1.3 + - deps: ipaddr.js@1.2.0 + * deps: send@0.14.2 + - deps: http-errors@~1.5.1 + - deps: ms@0.7.2 + - deps: statuses@~1.3.1 + * deps: serve-static@~1.11.2 + - deps: send@0.14.2 + * deps: type-is@~1.6.14 + - deps: mime-types@~2.1.13 + +4.14.0 / 2016-06-16 +=================== + + * Add `acceptRanges` option to `res.sendFile`/`res.sendfile` + * Add `cacheControl` option to `res.sendFile`/`res.sendfile` + * Add `options` argument to `req.range` + - Includes the `combine` option + * Encode URL in `res.location`/`res.redirect` if not already encoded + * Fix some redirect handling in `res.sendFile`/`res.sendfile` + * Fix Windows absolute path check using forward slashes + * Improve error with invalid arguments to `req.get()` + * Improve performance for `res.json`/`res.jsonp` in most cases + * Improve `Range` header handling in `res.sendFile`/`res.sendfile` + * deps: accepts@~1.3.3 + - Fix including type extensions in parameters in `Accept` parsing + - Fix parsing `Accept` parameters with quoted equals + - Fix parsing `Accept` parameters with quoted semicolons + - Many performance improvments + - deps: mime-types@~2.1.11 + - deps: negotiator@0.6.1 + * deps: content-type@~1.0.2 + - perf: enable strict mode + * deps: cookie@0.3.1 + - Add `sameSite` option + - Fix cookie `Max-Age` to never be a floating point number + - Improve error message when `encode` is not a function + - Improve error message when `expires` is not a `Date` + - Throw better error for invalid argument to parse + - Throw on invalid values provided to `serialize` + - perf: enable strict mode + - perf: hoist regular expression + - perf: use for loop in parse + - perf: use string concatination for serialization + * deps: finalhandler@0.5.0 + - Change invalid or non-numeric status code to 500 + - Overwrite status message to match set status code + - Prefer `err.statusCode` if `err.status` is invalid + - Set response headers from `err.headers` object + - Use `statuses` instead of `http` module for status messages + * deps: proxy-addr@~1.1.2 + - Fix accepting various invalid netmasks + - Fix IPv6-mapped IPv4 validation edge cases + - IPv4 netmasks must be contingous + - IPv6 addresses cannot be used as a netmask + - deps: ipaddr.js@1.1.1 + * deps: qs@6.2.0 + - Add `decoder` option in `parse` function + * deps: range-parser@~1.2.0 + - Add `combine` option to combine overlapping ranges + - Fix incorrectly returning -1 when there is at least one valid range + - perf: remove internal function + * deps: send@0.14.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Correctly inherit from `Stream` class + - Fix `Content-Range` header in 416 responses when using `start`/`end` options + - Fix `Content-Range` header missing from default 416 responses + - Fix redirect error when `path` contains raw non-URL characters + - Fix redirect when `path` starts with multiple forward slashes + - Ignore non-byte `Range` headers + - deps: http-errors@~1.5.0 + - deps: range-parser@~1.2.0 + - deps: statuses@~1.3.0 + - perf: remove argument reassignment + * deps: serve-static@~1.11.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Fix redirect error when `req.url` contains raw non-URL characters + - Ignore non-byte `Range` headers + - Use status code 301 for redirects + - deps: send@0.14.1 + * deps: type-is@~1.6.13 + - Fix type error when given invalid type to match against + - deps: mime-types@~2.1.11 + * deps: vary@~1.1.0 + - Only accept valid field names in the `field` argument + * perf: use strict equality when possible + +4.13.4 / 2016-01-21 +=================== + + * deps: content-disposition@0.5.1 + - perf: enable strict mode + * deps: cookie@0.1.5 + - Throw on invalid values provided to `serialize` + * deps: depd@~1.1.0 + - Support web browser loading + - perf: enable strict mode + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: finalhandler@0.4.1 + - deps: escape-html@~1.0.3 + * deps: merge-descriptors@1.0.1 + - perf: enable strict mode + * deps: methods@~1.1.2 + - perf: enable strict mode + * deps: parseurl@~1.3.1 + - perf: enable strict mode + * deps: proxy-addr@~1.0.10 + - deps: ipaddr.js@1.0.5 + - perf: enable strict mode + * deps: range-parser@~1.0.3 + - perf: enable strict mode + * deps: send@0.13.1 + - deps: depd@~1.1.0 + - deps: destroy@~1.0.4 + - deps: escape-html@~1.0.3 + - deps: range-parser@~1.0.3 + * deps: serve-static@~1.10.2 + - deps: escape-html@~1.0.3 + - deps: parseurl@~1.3.0 + - deps: send@0.13.1 + +4.13.3 / 2015-08-02 +=================== + + * Fix infinite loop condition using `mergeParams: true` + * Fix inner numeric indices incorrectly altering parent `req.params` + +4.13.2 / 2015-07-31 +=================== + + * deps: accepts@~1.2.12 + - deps: mime-types@~2.1.4 + * deps: array-flatten@1.1.1 + - perf: enable strict mode + * deps: path-to-regexp@0.1.7 + - Fix regression with escaped round brackets and matching groups + * deps: type-is@~1.6.6 + - deps: mime-types@~2.1.4 + +4.13.1 / 2015-07-05 +=================== + + * deps: accepts@~1.2.10 + - deps: mime-types@~2.1.2 + * deps: qs@4.0.0 + - Fix dropping parameters like `hasOwnProperty` + - Fix various parsing edge cases + * deps: type-is@~1.6.4 + - deps: mime-types@~2.1.2 + - perf: enable strict mode + - perf: remove argument reassignment + +4.13.0 / 2015-06-20 +=================== + + * Add settings to debug output + * Fix `res.format` error when only `default` provided + * Fix issue where `next('route')` in `app.param` would incorrectly skip values + * Fix hiding platform issues with `decodeURIComponent` + - Only `URIError`s are a 400 + * Fix using `*` before params in routes + * Fix using capture groups before params in routes + * Simplify `res.cookie` to call `res.append` + * Use `array-flatten` module for flattening arrays + * deps: accepts@~1.2.9 + - deps: mime-types@~2.1.1 + - perf: avoid argument reassignment & argument slice + - perf: avoid negotiator recursive construction + - perf: enable strict mode + - perf: remove unnecessary bitwise operator + * deps: cookie@0.1.3 + - perf: deduce the scope of try-catch deopt + - perf: remove argument reassignments + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Always include entity length in ETags for hash length extensions + - Generate non-Stats ETags using MD5 only (no longer CRC32) + - Improve stat performance by removing hashing + - Improve support for JXcore + - Remove base64 padding in ETags to shorten + - Support "fake" stats objects in environments without fs + - Use MD5 instead of MD4 in weak ETags over 1KB + * deps: finalhandler@0.4.0 + - Fix a false-positive when unpiping in Node.js 0.8 + - Support `statusCode` property on `Error` objects + - Use `unpipe` module for unpiping requests + - deps: escape-html@1.0.2 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove argument reassignment + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * deps: path-to-regexp@0.1.6 + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + * deps: serve-static@~1.10.0 + - Add `fallthrough` option + - Fix reading options from options prototype + - Improve the default redirect response headers + - Malformed URLs now `next()` instead of 400 + - deps: escape-html@1.0.2 + - deps: send@0.13.0 + - perf: enable strict mode + - perf: remove argument reassignment + * deps: type-is@~1.6.3 + - deps: mime-types@~2.1.1 + - perf: reduce try block size + - perf: remove bitwise operations + * perf: enable strict mode + * perf: isolate `app.render` try block + * perf: remove argument reassignments in application + * perf: remove argument reassignments in request prototype + * perf: remove argument reassignments in response prototype + * perf: remove argument reassignments in routing + * perf: remove argument reassignments in `View` + * perf: skip attempting to decode zero length string + * perf: use saved reference to `http.STATUS_CODES` + +4.12.4 / 2015-05-17 +=================== + + * deps: accepts@~1.2.7 + - deps: mime-types@~2.0.11 + - deps: negotiator@0.5.3 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: etag@~1.6.0 + - Improve support for JXcore + - Support "fake" stats objects in environments without `fs` + * deps: finalhandler@0.3.6 + - deps: debug@~2.2.0 + - deps: on-finished@~2.2.1 + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + * deps: proxy-addr@~1.0.8 + - deps: ipaddr.js@1.0.1 + * deps: qs@2.4.2 + - Fix allowing parameters like `constructor` + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + * deps: serve-static@~1.9.3 + - deps: send@0.12.3 + * deps: type-is@~1.6.2 + - deps: mime-types@~2.0.11 + +4.12.3 / 2015-03-17 +=================== + + * deps: accepts@~1.2.5 + - deps: mime-types@~2.0.10 + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + * deps: finalhandler@0.3.4 + - deps: debug@~2.1.3 + * deps: proxy-addr@~1.0.7 + - deps: ipaddr.js@0.1.9 + * deps: qs@2.4.1 + - Fix error when parameter `hasOwnProperty` is present + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + * deps: serve-static@~1.9.2 + - deps: send@0.12.2 + * deps: type-is@~1.6.1 + - deps: mime-types@~2.0.10 + +4.12.2 / 2015-03-02 +=================== + + * Fix regression where `"Request aborted"` is logged using `res.sendFile` + +4.12.1 / 2015-03-01 +=================== + + * Fix constructing application with non-configurable prototype properties + * Fix `ECONNRESET` errors from `res.sendFile` usage + * Fix `req.host` when using "trust proxy" hops count + * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count + * Fix wrong `code` on aborted connections from `res.sendFile` + * deps: merge-descriptors@1.0.0 + +4.12.0 / 2015-02-23 +=================== + + * Fix `"trust proxy"` setting to inherit when app is mounted + * Generate `ETag`s for all request responses + - No longer restricted to only responses for `GET` and `HEAD` requests + * Use `content-type` to parse `Content-Type` headers + * deps: accepts@~1.2.4 + - Fix preference sorting to be stable for long acceptable lists + - deps: mime-types@~2.0.9 + - deps: negotiator@0.5.1 + * deps: cookie-signature@1.0.6 + * deps: send@0.12.1 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + * deps: serve-static@~1.9.1 + - deps: send@0.12.1 + * deps: type-is@~1.6.0 + - fix argument reassignment + - fix false-positives in `hasBody` `Transfer-Encoding` check + - support wildcard for both type and subtype (`*/*`) + - deps: mime-types@~2.0.9 + +4.11.2 / 2015-02-01 +=================== + + * Fix `res.redirect` double-calling `res.end` for `HEAD` requests + * deps: accepts@~1.2.3 + - deps: mime-types@~2.0.8 + * deps: proxy-addr@~1.0.6 + - deps: ipaddr.js@0.1.8 + * deps: type-is@~1.5.6 + - deps: mime-types@~2.0.8 + +4.11.1 / 2015-01-20 +=================== + + * deps: send@0.11.1 + - Fix root path disclosure + * deps: serve-static@~1.8.1 + - Fix redirect loop in Node.js 0.11.14 + - Fix root path disclosure + - deps: send@0.11.1 + +4.11.0 / 2015-01-13 +=================== + + * Add `res.append(field, val)` to append headers + * Deprecate leading `:` in `name` for `app.param(name, fn)` + * Deprecate `req.param()` -- use `req.params`, `req.body`, or `req.query` instead + * Deprecate `app.param(fn)` + * Fix `OPTIONS` responses to include the `HEAD` method properly + * Fix `res.sendFile` not always detecting aborted connection + * Match routes iteratively to prevent stack overflows + * deps: accepts@~1.2.2 + - deps: mime-types@~2.0.7 + - deps: negotiator@0.5.0 + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + * deps: serve-static@~1.8.0 + - deps: send@0.11.0 + +4.10.8 / 2015-01-13 +=================== + + * Fix crash from error within `OPTIONS` response handler + * deps: proxy-addr@~1.0.5 + - deps: ipaddr.js@0.1.6 + +4.10.7 / 2015-01-04 +=================== + + * Fix `Allow` header for `OPTIONS` to not contain duplicate methods + * Fix incorrect "Request aborted" for `res.sendFile` when `HEAD` or 304 + * deps: debug@~2.1.1 + * deps: finalhandler@0.3.3 + - deps: debug@~2.1.1 + - deps: on-finished@~2.2.0 + * deps: methods@~1.1.1 + * deps: on-finished@~2.2.0 + * deps: serve-static@~1.7.2 + - Fix potential open redirect when mounted at root + * deps: type-is@~1.5.5 + - deps: mime-types@~2.0.7 + +4.10.6 / 2014-12-12 +=================== + + * Fix exception in `req.fresh`/`req.stale` without response headers + +4.10.5 / 2014-12-10 +=================== + + * Fix `res.send` double-calling `res.end` for `HEAD` requests + * deps: accepts@~1.1.4 + - deps: mime-types@~2.0.4 + * deps: type-is@~1.5.4 + - deps: mime-types@~2.0.4 + +4.10.4 / 2014-11-24 +=================== + + * Fix `res.sendfile` logging standard write errors + +4.10.3 / 2014-11-23 +=================== + + * Fix `res.sendFile` logging standard write errors + * deps: etag@~1.5.1 + * deps: proxy-addr@~1.0.4 + - deps: ipaddr.js@0.1.5 + * deps: qs@2.3.3 + - Fix `arrayLimit` behavior + +4.10.2 / 2014-11-09 +=================== + + * Correctly invoke async router callback asynchronously + * deps: accepts@~1.1.3 + - deps: mime-types@~2.0.3 + * deps: type-is@~1.5.3 + - deps: mime-types@~2.0.3 + +4.10.1 / 2014-10-28 +=================== + + * Fix handling of URLs containing `://` in the path + * deps: qs@2.3.2 + - Fix parsing of mixed objects and values + +4.10.0 / 2014-10-23 +=================== + + * Add support for `app.set('views', array)` + - Views are looked up in sequence in array of directories + * Fix `res.send(status)` to mention `res.sendStatus(status)` + * Fix handling of invalid empty URLs + * Use `content-disposition` module for `res.attachment`/`res.download` + - Sends standards-compliant `Content-Disposition` header + - Full Unicode support + * Use `path.resolve` in view lookup + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: etag@~1.5.0 + - Improve string performance + - Slightly improve speed for weak ETags over 1KB + * deps: finalhandler@0.3.2 + - Terminate in progress response only on error + - Use `on-finished` to determine request status + - deps: debug@~2.1.0 + - deps: on-finished@~2.1.1 + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + * deps: qs@2.3.0 + - Fix parsing of mixed implicit and explicit arrays + * deps: send@0.10.1 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + - deps: on-finished@~2.1.1 + * deps: serve-static@~1.7.1 + - deps: send@0.10.1 + +4.9.8 / 2014-10-17 +================== + + * Fix `res.redirect` body when redirect status specified + * deps: accepts@~1.1.2 + - Fix error when media type has invalid parameter + - deps: negotiator@0.4.9 + +4.9.7 / 2014-10-10 +================== + + * Fix using same param name in array of paths + +4.9.6 / 2014-10-08 +================== + + * deps: accepts@~1.1.1 + - deps: mime-types@~2.0.2 + - deps: negotiator@0.4.8 + * deps: serve-static@~1.6.4 + - Fix redirect loop when index file serving disabled + * deps: type-is@~1.5.2 + - deps: mime-types@~2.0.2 + +4.9.5 / 2014-09-24 +================== + + * deps: etag@~1.4.0 + * deps: proxy-addr@~1.0.3 + - Use `forwarded` npm module + * deps: send@0.9.3 + - deps: etag@~1.4.0 + * deps: serve-static@~1.6.3 + - deps: send@0.9.3 + +4.9.4 / 2014-09-19 +================== + + * deps: qs@2.2.4 + - Fix issue with object keys starting with numbers truncated + +4.9.3 / 2014-09-18 +================== + + * deps: proxy-addr@~1.0.2 + - Fix a global leak when multiple subnets are trusted + - deps: ipaddr.js@0.1.3 + +4.9.2 / 2014-09-17 +================== + + * Fix regression for empty string `path` in `app.use` + * Fix `router.use` to accept array of middleware without path + * Improve error message for bad `app.use` arguments + +4.9.1 / 2014-09-16 +================== + + * Fix `app.use` to accept array of middleware without path + * deps: depd@0.4.5 + * deps: etag@~1.3.1 + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + * deps: serve-static@~1.6.2 + - deps: send@0.9.2 + +4.9.0 / 2014-09-08 +================== + + * Add `res.sendStatus` + * Invoke callback for sendfile when client aborts + - Applies to `res.sendFile`, `res.sendfile`, and `res.download` + - `err` will be populated with request aborted error + * Support IP address host in `req.subdomains` + * Use `etag` to generate `ETag` headers + * deps: accepts@~1.1.0 + - update `mime-types` + * deps: cookie-signature@1.0.5 + * deps: debug@~2.0.0 + * deps: finalhandler@0.2.0 + - Set `X-Content-Type-Options: nosniff` header + - deps: debug@~2.0.0 + * deps: fresh@0.2.4 + * deps: media-typer@0.3.0 + - Throw error when parameter format invalid on parse + * deps: qs@2.2.3 + - Fix issue where first empty value in array is discarded + * deps: range-parser@~1.0.2 + * deps: send@0.9.1 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + - deps: fresh@0.2.4 + * deps: serve-static@~1.6.1 + - Add `lastModified` option + - deps: send@0.9.1 + * deps: type-is@~1.5.1 + - fix `hasbody` to be true for `content-length: 0` + - deps: media-typer@0.3.0 + - deps: mime-types@~2.0.1 + * deps: vary@~1.0.0 + - Accept valid `Vary` header string as `field` + +4.8.8 / 2014-09-04 +================== + + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + * deps: serve-static@~1.5.4 + - deps: send@0.8.5 + +4.8.7 / 2014-08-29 +================== + + * deps: qs@2.2.2 + - Remove unnecessary cloning + +4.8.6 / 2014-08-27 +================== + + * deps: qs@2.2.0 + - Array parsing fix + - Performance improvements + +4.8.5 / 2014-08-18 +================== + + * deps: send@0.8.3 + - deps: destroy@1.0.3 + - deps: on-finished@2.1.0 + * deps: serve-static@~1.5.3 + - deps: send@0.8.3 + +4.8.4 / 2014-08-14 +================== + + * deps: qs@1.2.2 + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + * deps: serve-static@~1.5.2 + - deps: send@0.8.2 + +4.8.3 / 2014-08-10 +================== + + * deps: parseurl@~1.3.0 + * deps: qs@1.2.1 + * deps: serve-static@~1.5.1 + - Fix parsing of weird `req.originalUrl` values + - deps: parseurl@~1.3.0 + - deps: utils-merge@1.0.0 + +4.8.2 / 2014-08-07 +================== + + * deps: qs@1.2.0 + - Fix parsing array of objects + +4.8.1 / 2014-08-06 +================== + + * fix incorrect deprecation warnings on `res.download` + * deps: qs@1.1.0 + - Accept urlencoded square brackets + - Accept empty values in implicit array notation + +4.8.0 / 2014-08-05 +================== + + * add `res.sendFile` + - accepts a file system path instead of a URL + - requires an absolute path or `root` option specified + * deprecate `res.sendfile` -- use `res.sendFile` instead + * support mounted app as any argument to `app.use()` + * deps: qs@1.0.2 + - Complete rewrite + - Limits array length to 20 + - Limits object depth to 5 + - Limits parameters to 1,000 + * deps: send@0.8.1 + - Add `extensions` option + * deps: serve-static@~1.5.0 + - Add `extensions` option + - deps: send@0.8.1 + +4.7.4 / 2014-08-04 +================== + + * fix `res.sendfile` regression for serving directory index files + * deps: send@0.7.4 + - Fix incorrect 403 on Windows and Node.js 0.11 + - Fix serving index files without root dir + * deps: serve-static@~1.4.4 + - deps: send@0.7.4 + +4.7.3 / 2014-08-04 +================== + + * deps: send@0.7.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + * deps: serve-static@~1.4.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + - deps: send@0.7.3 + +4.7.2 / 2014-07-27 +================== + + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + * deps: send@0.7.2 + - deps: depd@0.4.4 + * deps: serve-static@~1.4.2 + +4.7.1 / 2014-07-26 +================== + + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + * deps: send@0.7.1 + - deps: depd@0.4.3 + * deps: serve-static@~1.4.1 + +4.7.0 / 2014-07-25 +================== + + * fix `req.protocol` for proxy-direct connections + * configurable query parser with `app.set('query parser', parser)` + - `app.set('query parser', 'extended')` parse with "qs" module + - `app.set('query parser', 'simple')` parse with "querystring" core module + - `app.set('query parser', false)` disable query string parsing + - `app.set('query parser', true)` enable simple parsing + * deprecate `res.json(status, obj)` -- use `res.status(status).json(obj)` instead + * deprecate `res.jsonp(status, obj)` -- use `res.status(status).jsonp(obj)` instead + * deprecate `res.send(status, body)` -- use `res.status(status).send(body)` instead + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + * deps: finalhandler@0.1.0 + - Respond after request fully read + - deps: debug@1.0.4 + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - Cap `maxAge` value to 1 year + - deps: debug@1.0.4 + - deps: depd@0.4.2 + * deps: serve-static@~1.4.0 + - deps: parseurl@~1.2.0 + - deps: send@0.7.0 + * perf: prevent multiple `Buffer` creation in `res.send` + +4.6.1 / 2014-07-12 +================== + + * fix `subapp.mountpath` regression for `app.use(subapp)` + +4.6.0 / 2014-07-11 +================== + + * accept multiple callbacks to `app.use()` + * add explicit "Rosetta Flash JSONP abuse" protection + - previous versions are not vulnerable; this is just explicit protection + * catch errors in multiple `req.param(name, fn)` handlers + * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead + * fix `res.send(status, num)` to send `num` as json (not error) + * remove unnecessary escaping when `res.jsonp` returns JSON response + * support non-string `path` in `app.use(path, fn)` + - supports array of paths + - supports `RegExp` + * router: fix optimization on router exit + * router: refactor location of `try` blocks + * router: speed up standard `app.use(fn)` + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + * deps: finalhandler@0.0.3 + - deps: debug@1.0.3 + * deps: methods@1.1.0 + - add `CONNECT` + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + * deps: path-to-regexp@0.1.3 + * deps: send@0.6.0 + - deps: debug@1.0.3 + * deps: serve-static@~1.3.2 + - deps: parseurl@~1.1.3 + - deps: send@0.6.0 + * perf: fix arguments reassign deopt in some `res` methods + +4.5.1 / 2014-07-06 +================== + + * fix routing regression when altering `req.method` + +4.5.0 / 2014-07-04 +================== + + * add deprecation message to non-plural `req.accepts*` + * add deprecation message to `res.send(body, status)` + * add deprecation message to `res.vary()` + * add `headers` option to `res.sendfile` + - use to set headers on successful file transfer + * add `mergeParams` option to `Router` + - merges `req.params` from parent routes + * add `req.hostname` -- correct name for what `req.host` returns + * deprecate things with `depd` module + * deprecate `req.host` -- use `req.hostname` instead + * fix behavior when handling request without routes + * fix handling when `route.all` is only route + * invoke `router.param()` only when route matches + * restore `req.params` after invoking router + * use `finalhandler` for final response handling + * use `media-typer` to alter content-type charset + * deps: accepts@~1.0.7 + * deps: send@0.5.0 + - Accept string for `maxage` (converted by `ms`) + - Include link in default redirect response + * deps: serve-static@~1.3.0 + - Accept string for `maxAge` (converted by `ms`) + - Add `setHeaders` option + - Include HTML link in redirect response + - deps: send@0.5.0 + * deps: type-is@~1.3.2 + +4.4.5 / 2014-06-26 +================== + + * deps: cookie-signature@1.0.4 + - fix for timing attacks + +4.4.4 / 2014-06-20 +================== + + * fix `res.attachment` Unicode filenames in Safari + * fix "trim prefix" debug message in `express:router` + * deps: accepts@~1.0.5 + * deps: buffer-crc32@0.2.3 + +4.4.3 / 2014-06-11 +================== + + * fix persistence of modified `req.params[name]` from `app.param()` + * deps: accepts@1.0.3 + - deps: negotiator@0.4.6 + * deps: debug@1.0.2 + * deps: send@0.4.3 + - Do not throw un-catchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + * deps: serve-static@1.2.3 + - Do not throw un-catchable error on file open race condition + - deps: send@0.4.3 + +4.4.2 / 2014-06-09 +================== + + * fix catching errors from top-level handlers + * use `vary` module for `res.vary` + * deps: debug@1.0.1 + * deps: proxy-addr@1.0.1 + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: debug@1.0.1 + - deps: finished@1.2.1 + * deps: serve-static@1.2.2 + - fix "event emitter leak" warnings + - deps: send@0.4.2 + * deps: type-is@1.2.1 + +4.4.1 / 2014-06-02 +================== + + * deps: methods@1.0.1 + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + * deps: serve-static@1.2.1 + - use `escape-html` for escaping + - deps: send@0.4.1 + +4.4.0 / 2014-05-30 +================== + + * custom etag control with `app.set('etag', val)` + - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation + - `app.set('etag', 'weak')` weak tag + - `app.set('etag', 'strong')` strong etag + - `app.set('etag', false)` turn off + - `app.set('etag', true)` standard etag + * mark `res.send` ETag as weak and reduce collisions + * update accepts to 1.0.2 + - Fix interpretation when header not in request + * update send to 0.4.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: debug@0.8.1 + * update serve-static to 1.2.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: send@0.4.0 + +4.3.2 / 2014-05-28 +================== + + * fix handling of errors from `router.param()` callbacks + +4.3.1 / 2014-05-23 +================== + + * revert "fix behavior of multiple `app.VERB` for the same path" + - this caused a regression in the order of route execution + +4.3.0 / 2014-05-21 +================== + + * add `req.baseUrl` to access the path stripped from `req.url` in routes + * fix behavior of multiple `app.VERB` for the same path + * fix issue routing requests among sub routers + * invoke `router.param()` only when necessary instead of every match + * proper proxy trust with `app.set('trust proxy', trust)` + - `app.set('trust proxy', 1)` trust first hop + - `app.set('trust proxy', 'loopback')` trust loopback addresses + - `app.set('trust proxy', '10.0.0.1')` trust single IP + - `app.set('trust proxy', '10.0.0.1/16')` trust subnet + - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list + - `app.set('trust proxy', false)` turn off + - `app.set('trust proxy', true)` trust everything + * set proper `charset` in `Content-Type` for `res.send` + * update type-is to 1.2.0 + - support suffix matching + +4.2.0 / 2014-05-11 +================== + + * deprecate `app.del()` -- use `app.delete()` instead + * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead + - the edge-case `res.json(status, num)` requires `res.status(status).json(num)` + * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead + - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)` + * fix `req.next` when inside router instance + * include `ETag` header in `HEAD` requests + * keep previous `Content-Type` for `res.jsonp` + * support PURGE method + - add `app.purge` + - add `router.purge` + - include PURGE in `app.all` + * update debug to 0.8.0 + - add `enable()` method + - change from stderr to stdout + * update methods to 1.0.0 + - add PURGE + +4.1.2 / 2014-05-08 +================== + + * fix `req.host` for IPv6 literals + * fix `res.jsonp` error if callback param is object + +4.1.1 / 2014-04-27 +================== + + * fix package.json to reflect supported node version + +4.1.0 / 2014-04-24 +================== + + * pass options from `res.sendfile` to `send` + * preserve casing of headers in `res.header` and `res.set` + * support unicode file names in `res.attachment` and `res.download` + * update accepts to 1.0.1 + - deps: negotiator@0.4.0 + * update cookie to 0.1.2 + - Fix for maxAge == 0 + - made compat with expires field + * update send to 0.3.0 + - Accept API options in options object + - Coerce option types + - Control whether to generate etags + - Default directory access to 403 when index disabled + - Fix sending files with dots without root set + - Include file path in etag + - Make "Can't set headers after they are sent." catchable + - Send full entity-body for multi range requests + - Set etags to "weak" + - Support "If-Range" header + - Support multiple index paths + - deps: mime@1.2.11 + * update serve-static to 1.1.0 + - Accept options directly to `send` module + - Resolve relative paths at middleware setup + - Use parseurl to parse the URL from request + - deps: send@0.3.0 + * update type-is to 1.1.0 + - add non-array values support + - add `multipart` as a shorthand + +4.0.0 / 2014-04-09 +================== + + * remove: + - node 0.8 support + - connect and connect's patches except for charset handling + - express(1) - moved to [express-generator](https://github.com/expressjs/generator) + - `express.createServer()` - it has been deprecated for a long time. Use `express()` + - `app.configure` - use logic in your own app code + - `app.router` - is removed + - `req.auth` - use `basic-auth` instead + - `req.accepted*` - use `req.accepts*()` instead + - `res.location` - relative URL resolution is removed + - `res.charset` - include the charset in the content type when using `res.set()` + - all bundled middleware except `static` + * change: + - `app.route` -> `app.mountpath` when mounting an express app in another express app + - `json spaces` no longer enabled by default in development + - `req.accepts*` -> `req.accepts*s` - i.e. `req.acceptsEncoding` -> `req.acceptsEncodings` + - `req.params` is now an object instead of an array + - `res.locals` is no longer a function. It is a plain js object. Treat it as such. + - `res.headerSent` -> `res.headersSent` to match node.js ServerResponse object + * refactor: + - `req.accepts*` with [accepts](https://github.com/expressjs/accepts) + - `req.is` with [type-is](https://github.com/expressjs/type-is) + - [path-to-regexp](https://github.com/component/path-to-regexp) + * add: + - `app.router()` - returns the app Router instance + - `app.route()` - Proxy to the app's `Router#route()` method to create a new route + - Router & Route - public API + +3.21.2 / 2015-07-31 +=================== + + * deps: connect@2.30.2 + - deps: body-parser@~1.13.3 + - deps: compression@~1.5.2 + - deps: errorhandler@~1.4.2 + - deps: method-override@~2.3.5 + - deps: serve-index@~1.7.2 + - deps: type-is@~1.6.6 + - deps: vhost@~3.0.1 + * deps: vary@~1.0.1 + - Fix setting empty header from empty `field` + - perf: enable strict mode + - perf: remove argument reassignments + +3.21.1 / 2015-07-05 +=================== + + * deps: basic-auth@~1.0.3 + * deps: connect@2.30.1 + - deps: body-parser@~1.13.2 + - deps: compression@~1.5.1 + - deps: errorhandler@~1.4.1 + - deps: morgan@~1.6.1 + - deps: pause@0.1.0 + - deps: qs@4.0.0 + - deps: serve-index@~1.7.1 + - deps: type-is@~1.6.4 + +3.21.0 / 2015-06-18 +=================== + + * deps: basic-auth@1.0.2 + - perf: enable strict mode + - perf: hoist regular expression + - perf: parse with regular expressions + - perf: remove argument reassignment + * deps: connect@2.30.0 + - deps: body-parser@~1.13.1 + - deps: bytes@2.1.0 + - deps: compression@~1.5.0 + - deps: cookie@0.1.3 + - deps: cookie-parser@~1.3.5 + - deps: csurf@~1.8.3 + - deps: errorhandler@~1.4.0 + - deps: express-session@~1.11.3 + - deps: finalhandler@0.4.0 + - deps: fresh@0.3.0 + - deps: morgan@~1.6.0 + - deps: serve-favicon@~2.3.0 + - deps: serve-index@~1.7.0 + - deps: serve-static@~1.10.0 + - deps: type-is@~1.6.3 + * deps: cookie@0.1.3 + - perf: deduce the scope of try-catch deopt + - perf: remove argument reassignments + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Always include entity length in ETags for hash length extensions + - Generate non-Stats ETags using MD5 only (no longer CRC32) + - Improve stat performance by removing hashing + - Improve support for JXcore + - Remove base64 padding in ETags to shorten + - Support "fake" stats objects in environments without fs + - Use MD5 instead of MD4 in weak ETags over 1KB + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: mkdirp@0.5.1 + - Work in global strict mode + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + +3.20.3 / 2015-05-17 +=================== + + * deps: connect@2.29.2 + - deps: body-parser@~1.12.4 + - deps: compression@~1.4.4 + - deps: connect-timeout@~1.6.2 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: errorhandler@~1.3.6 + - deps: finalhandler@0.3.6 + - deps: method-override@~2.3.3 + - deps: morgan@~1.5.3 + - deps: qs@2.4.2 + - deps: response-time@~2.3.1 + - deps: serve-favicon@~2.2.1 + - deps: serve-index@~1.6.4 + - deps: serve-static@~1.9.3 + - deps: type-is@~1.6.2 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: proxy-addr@~1.0.8 + - deps: ipaddr.js@1.0.1 + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + +3.20.2 / 2015-03-16 +=================== + + * deps: connect@2.29.1 + - deps: body-parser@~1.12.2 + - deps: compression@~1.4.3 + - deps: connect-timeout@~1.6.1 + - deps: debug@~2.1.3 + - deps: errorhandler@~1.3.5 + - deps: express-session@~1.10.4 + - deps: finalhandler@0.3.4 + - deps: method-override@~2.3.2 + - deps: morgan@~1.5.2 + - deps: qs@2.4.1 + - deps: serve-index@~1.6.3 + - deps: serve-static@~1.9.2 + - deps: type-is@~1.6.1 + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + * deps: merge-descriptors@1.0.0 + * deps: proxy-addr@~1.0.7 + - deps: ipaddr.js@0.1.9 + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + +3.20.1 / 2015-02-28 +=================== + + * Fix `req.host` when using "trust proxy" hops count + * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count + +3.20.0 / 2015-02-18 +=================== + + * Fix `"trust proxy"` setting to inherit when app is mounted + * Generate `ETag`s for all request responses + - No longer restricted to only responses for `GET` and `HEAD` requests + * Use `content-type` to parse `Content-Type` headers + * deps: connect@2.29.0 + - Use `content-type` to parse `Content-Type` headers + - deps: body-parser@~1.12.0 + - deps: compression@~1.4.1 + - deps: connect-timeout@~1.6.0 + - deps: cookie-parser@~1.3.4 + - deps: cookie-signature@1.0.6 + - deps: csurf@~1.7.0 + - deps: errorhandler@~1.3.4 + - deps: express-session@~1.10.3 + - deps: http-errors@~1.3.1 + - deps: response-time@~2.3.0 + - deps: serve-index@~1.6.2 + - deps: serve-static@~1.9.1 + - deps: type-is@~1.6.0 + * deps: cookie-signature@1.0.6 + * deps: send@0.12.1 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + +3.19.2 / 2015-02-01 +=================== + + * deps: connect@2.28.3 + - deps: compression@~1.3.1 + - deps: csurf@~1.6.6 + - deps: errorhandler@~1.3.3 + - deps: express-session@~1.10.2 + - deps: serve-index@~1.6.1 + - deps: type-is@~1.5.6 + * deps: proxy-addr@~1.0.6 + - deps: ipaddr.js@0.1.8 + +3.19.1 / 2015-01-20 +=================== + + * deps: connect@2.28.2 + - deps: body-parser@~1.10.2 + - deps: serve-static@~1.8.1 + * deps: send@0.11.1 + - Fix root path disclosure + +3.19.0 / 2015-01-09 +=================== + + * Fix `OPTIONS` responses to include the `HEAD` method property + * Use `readline` for prompt in `express(1)` + * deps: commander@2.6.0 + * deps: connect@2.28.1 + - deps: body-parser@~1.10.1 + - deps: compression@~1.3.0 + - deps: connect-timeout@~1.5.0 + - deps: csurf@~1.6.4 + - deps: debug@~2.1.1 + - deps: errorhandler@~1.3.2 + - deps: express-session@~1.10.1 + - deps: finalhandler@0.3.3 + - deps: method-override@~2.3.1 + - deps: morgan@~1.5.1 + - deps: serve-favicon@~2.2.0 + - deps: serve-index@~1.6.0 + - deps: serve-static@~1.8.0 + - deps: type-is@~1.5.5 + * deps: debug@~2.1.1 + * deps: methods@~1.1.1 + * deps: proxy-addr@~1.0.5 + - deps: ipaddr.js@0.1.6 + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + +3.18.6 / 2014-12-12 +=================== + + * Fix exception in `req.fresh`/`req.stale` without response headers + +3.18.5 / 2014-12-11 +=================== + + * deps: connect@2.27.6 + - deps: compression@~1.2.2 + - deps: express-session@~1.9.3 + - deps: http-errors@~1.2.8 + - deps: serve-index@~1.5.3 + - deps: type-is@~1.5.4 + +3.18.4 / 2014-11-23 +=================== + + * deps: connect@2.27.4 + - deps: body-parser@~1.9.3 + - deps: compression@~1.2.1 + - deps: errorhandler@~1.2.3 + - deps: express-session@~1.9.2 + - deps: qs@2.3.3 + - deps: serve-favicon@~2.1.7 + - deps: serve-static@~1.5.1 + - deps: type-is@~1.5.3 + * deps: etag@~1.5.1 + * deps: proxy-addr@~1.0.4 + - deps: ipaddr.js@0.1.5 + +3.18.3 / 2014-11-09 +=================== + + * deps: connect@2.27.3 + - Correctly invoke async callback asynchronously + - deps: csurf@~1.6.3 + +3.18.2 / 2014-10-28 +=================== + + * deps: connect@2.27.2 + - Fix handling of URLs containing `://` in the path + - deps: body-parser@~1.9.2 + - deps: qs@2.3.2 + +3.18.1 / 2014-10-22 +=================== + + * Fix internal `utils.merge` deprecation warnings + * deps: connect@2.27.1 + - deps: body-parser@~1.9.1 + - deps: express-session@~1.9.1 + - deps: finalhandler@0.3.2 + - deps: morgan@~1.4.1 + - deps: qs@2.3.0 + - deps: serve-static@~1.7.1 + * deps: send@0.10.1 + - deps: on-finished@~2.1.1 + +3.18.0 / 2014-10-17 +=================== + + * Use `content-disposition` module for `res.attachment`/`res.download` + - Sends standards-compliant `Content-Disposition` header + - Full Unicode support + * Use `etag` module to generate `ETag` headers + * deps: connect@2.27.0 + - Use `http-errors` module for creating errors + - Use `utils-merge` module for merging objects + - deps: body-parser@~1.9.0 + - deps: compression@~1.2.0 + - deps: connect-timeout@~1.4.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: express-session@~1.9.0 + - deps: finalhandler@0.3.1 + - deps: method-override@~2.3.0 + - deps: morgan@~1.4.0 + - deps: response-time@~2.2.0 + - deps: serve-favicon@~2.1.6 + - deps: serve-index@~1.5.0 + - deps: serve-static@~1.7.0 + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: send@0.10.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + +3.17.8 / 2014-10-15 +=================== + + * deps: connect@2.26.6 + - deps: compression@~1.1.2 + - deps: csurf@~1.6.2 + - deps: errorhandler@~1.2.2 + +3.17.7 / 2014-10-08 +=================== + + * deps: connect@2.26.5 + - Fix accepting non-object arguments to `logger` + - deps: serve-static@~1.6.4 + +3.17.6 / 2014-10-02 +=================== + + * deps: connect@2.26.4 + - deps: morgan@~1.3.2 + - deps: type-is@~1.5.2 + +3.17.5 / 2014-09-24 +=================== + + * deps: connect@2.26.3 + - deps: body-parser@~1.8.4 + - deps: serve-favicon@~2.1.5 + - deps: serve-static@~1.6.3 + * deps: proxy-addr@~1.0.3 + - Use `forwarded` npm module + * deps: send@0.9.3 + - deps: etag@~1.4.0 + +3.17.4 / 2014-09-19 +=================== + + * deps: connect@2.26.2 + - deps: body-parser@~1.8.3 + - deps: qs@2.2.4 + +3.17.3 / 2014-09-18 +=================== + + * deps: proxy-addr@~1.0.2 + - Fix a global leak when multiple subnets are trusted + - deps: ipaddr.js@0.1.3 + +3.17.2 / 2014-09-15 +=================== + + * Use `crc` instead of `buffer-crc32` for speed + * deps: connect@2.26.1 + - deps: body-parser@~1.8.2 + - deps: depd@0.4.5 + - deps: express-session@~1.8.2 + - deps: morgan@~1.3.1 + - deps: serve-favicon@~2.1.3 + - deps: serve-static@~1.6.2 + * deps: depd@0.4.5 + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + +3.17.1 / 2014-09-08 +=================== + + * Fix error in `req.subdomains` on empty host + +3.17.0 / 2014-09-08 +=================== + + * Support `X-Forwarded-Host` in `req.subdomains` + * Support IP address host in `req.subdomains` + * deps: connect@2.26.0 + - deps: body-parser@~1.8.1 + - deps: compression@~1.1.0 + - deps: connect-timeout@~1.3.0 + - deps: cookie-parser@~1.3.3 + - deps: cookie-signature@1.0.5 + - deps: csurf@~1.6.1 + - deps: debug@~2.0.0 + - deps: errorhandler@~1.2.0 + - deps: express-session@~1.8.1 + - deps: finalhandler@0.2.0 + - deps: fresh@0.2.4 + - deps: media-typer@0.3.0 + - deps: method-override@~2.2.0 + - deps: morgan@~1.3.0 + - deps: qs@2.2.3 + - deps: serve-favicon@~2.1.3 + - deps: serve-index@~1.2.1 + - deps: serve-static@~1.6.1 + - deps: type-is@~1.5.1 + - deps: vhost@~3.0.0 + * deps: cookie-signature@1.0.5 + * deps: debug@~2.0.0 + * deps: fresh@0.2.4 + * deps: media-typer@0.3.0 + - Throw error when parameter format invalid on parse + * deps: range-parser@~1.0.2 + * deps: send@0.9.1 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + - deps: fresh@0.2.4 + * deps: vary@~1.0.0 + - Accept valid `Vary` header string as `field` + +3.16.10 / 2014-09-04 +==================== + + * deps: connect@2.25.10 + - deps: serve-static@~1.5.4 + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + +3.16.9 / 2014-08-29 +=================== + + * deps: connect@2.25.9 + - deps: body-parser@~1.6.7 + - deps: qs@2.2.2 + +3.16.8 / 2014-08-27 +=================== + + * deps: connect@2.25.8 + - deps: body-parser@~1.6.6 + - deps: csurf@~1.4.1 + - deps: qs@2.2.0 + +3.16.7 / 2014-08-18 +=================== + + * deps: connect@2.25.7 + - deps: body-parser@~1.6.5 + - deps: express-session@~1.7.6 + - deps: morgan@~1.2.3 + - deps: serve-static@~1.5.3 + * deps: send@0.8.3 + - deps: destroy@1.0.3 + - deps: on-finished@2.1.0 + +3.16.6 / 2014-08-14 +=================== + + * deps: connect@2.25.6 + - deps: body-parser@~1.6.4 + - deps: qs@1.2.2 + - deps: serve-static@~1.5.2 + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + +3.16.5 / 2014-08-11 +=================== + + * deps: connect@2.25.5 + - Fix backwards compatibility in `logger` + +3.16.4 / 2014-08-10 +=================== + + * Fix original URL parsing in `res.location` + * deps: connect@2.25.4 + - Fix `query` middleware breaking with argument + - deps: body-parser@~1.6.3 + - deps: compression@~1.0.11 + - deps: connect-timeout@~1.2.2 + - deps: express-session@~1.7.5 + - deps: method-override@~2.1.3 + - deps: on-headers@~1.0.0 + - deps: parseurl@~1.3.0 + - deps: qs@1.2.1 + - deps: response-time@~2.0.1 + - deps: serve-index@~1.1.6 + - deps: serve-static@~1.5.1 + * deps: parseurl@~1.3.0 + +3.16.3 / 2014-08-07 +=================== + + * deps: connect@2.25.3 + - deps: multiparty@3.3.2 + +3.16.2 / 2014-08-07 +=================== + + * deps: connect@2.25.2 + - deps: body-parser@~1.6.2 + - deps: qs@1.2.0 + +3.16.1 / 2014-08-06 +=================== + + * deps: connect@2.25.1 + - deps: body-parser@~1.6.1 + - deps: qs@1.1.0 + +3.16.0 / 2014-08-05 +=================== + + * deps: connect@2.25.0 + - deps: body-parser@~1.6.0 + - deps: compression@~1.0.10 + - deps: csurf@~1.4.0 + - deps: express-session@~1.7.4 + - deps: qs@1.0.2 + - deps: serve-static@~1.5.0 + * deps: send@0.8.1 + - Add `extensions` option + +3.15.3 / 2014-08-04 +=================== + + * fix `res.sendfile` regression for serving directory index files + * deps: connect@2.24.3 + - deps: serve-index@~1.1.5 + - deps: serve-static@~1.4.4 + * deps: send@0.7.4 + - Fix incorrect 403 on Windows and Node.js 0.11 + - Fix serving index files without root dir + +3.15.2 / 2014-07-27 +=================== + + * deps: connect@2.24.2 + - deps: body-parser@~1.5.2 + - deps: depd@0.4.4 + - deps: express-session@~1.7.2 + - deps: morgan@~1.2.2 + - deps: serve-static@~1.4.2 + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + * deps: send@0.7.2 + - deps: depd@0.4.4 + +3.15.1 / 2014-07-26 +=================== + + * deps: connect@2.24.1 + - deps: body-parser@~1.5.1 + - deps: depd@0.4.3 + - deps: express-session@~1.7.1 + - deps: morgan@~1.2.1 + - deps: serve-index@~1.1.4 + - deps: serve-static@~1.4.1 + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + * deps: send@0.7.1 + - deps: depd@0.4.3 + +3.15.0 / 2014-07-22 +=================== + + * Fix `req.protocol` for proxy-direct connections + * Pass options from `res.sendfile` to `send` + * deps: connect@2.24.0 + - deps: body-parser@~1.5.0 + - deps: compression@~1.0.9 + - deps: connect-timeout@~1.2.1 + - deps: debug@1.0.4 + - deps: depd@0.4.2 + - deps: express-session@~1.7.0 + - deps: finalhandler@0.1.0 + - deps: method-override@~2.1.2 + - deps: morgan@~1.2.0 + - deps: multiparty@3.3.1 + - deps: parseurl@~1.2.0 + - deps: serve-static@~1.4.0 + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - Cap `maxAge` value to 1 year + - deps: debug@1.0.4 + - deps: depd@0.4.2 + +3.14.0 / 2014-07-11 +=================== + + * add explicit "Rosetta Flash JSONP abuse" protection + - previous versions are not vulnerable; this is just explicit protection + * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead + * fix `res.send(status, num)` to send `num` as json (not error) + * remove unnecessary escaping when `res.jsonp` returns JSON response + * deps: basic-auth@1.0.0 + - support empty password + - support empty username + * deps: connect@2.23.0 + - deps: debug@1.0.3 + - deps: express-session@~1.6.4 + - deps: method-override@~2.1.0 + - deps: parseurl@~1.1.3 + - deps: serve-static@~1.3.1 + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + * deps: methods@1.1.0 + - add `CONNECT` + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + +3.13.0 / 2014-07-03 +=================== + + * add deprecation message to `app.configure` + * add deprecation message to `req.auth` + * use `basic-auth` to parse `Authorization` header + * deps: connect@2.22.0 + - deps: csurf@~1.3.0 + - deps: express-session@~1.6.1 + - deps: multiparty@3.3.0 + - deps: serve-static@~1.3.0 + * deps: send@0.5.0 + - Accept string for `maxage` (converted by `ms`) + - Include link in default redirect response + +3.12.1 / 2014-06-26 +=================== + + * deps: connect@2.21.1 + - deps: cookie-parser@1.3.2 + - deps: cookie-signature@1.0.4 + - deps: express-session@~1.5.2 + - deps: type-is@~1.3.2 + * deps: cookie-signature@1.0.4 + - fix for timing attacks + +3.12.0 / 2014-06-21 +=================== + + * use `media-typer` to alter content-type charset + * deps: connect@2.21.0 + - deprecate `connect(middleware)` -- use `app.use(middleware)` instead + - deprecate `connect.createServer()` -- use `connect()` instead + - fix `res.setHeader()` patch to work with with get -> append -> set pattern + - deps: compression@~1.0.8 + - deps: errorhandler@~1.1.1 + - deps: express-session@~1.5.0 + - deps: serve-index@~1.1.3 + +3.11.0 / 2014-06-19 +=================== + + * deprecate things with `depd` module + * deps: buffer-crc32@0.2.3 + * deps: connect@2.20.2 + - deprecate `verify` option to `json` -- use `body-parser` npm module instead + - deprecate `verify` option to `urlencoded` -- use `body-parser` npm module instead + - deprecate things with `depd` module + - use `finalhandler` for final response handling + - use `media-typer` to parse `content-type` for charset + - deps: body-parser@1.4.3 + - deps: connect-timeout@1.1.1 + - deps: cookie-parser@1.3.1 + - deps: csurf@1.2.2 + - deps: errorhandler@1.1.0 + - deps: express-session@1.4.0 + - deps: multiparty@3.2.9 + - deps: serve-index@1.1.2 + - deps: type-is@1.3.1 + - deps: vhost@2.0.0 + +3.10.5 / 2014-06-11 +=================== + + * deps: connect@2.19.6 + - deps: body-parser@1.3.1 + - deps: compression@1.0.7 + - deps: debug@1.0.2 + - deps: serve-index@1.1.1 + - deps: serve-static@1.2.3 + * deps: debug@1.0.2 + * deps: send@0.4.3 + - Do not throw un-catchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + +3.10.4 / 2014-06-09 +=================== + + * deps: connect@2.19.5 + - fix "event emitter leak" warnings + - deps: csurf@1.2.1 + - deps: debug@1.0.1 + - deps: serve-static@1.2.2 + - deps: type-is@1.2.1 + * deps: debug@1.0.1 + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: finished@1.2.1 + - deps: debug@1.0.1 + +3.10.3 / 2014-06-05 +=================== + + * use `vary` module for `res.vary` + * deps: connect@2.19.4 + - deps: errorhandler@1.0.2 + - deps: method-override@2.0.2 + - deps: serve-favicon@2.0.1 + * deps: debug@1.0.0 + +3.10.2 / 2014-06-03 +=================== + + * deps: connect@2.19.3 + - deps: compression@1.0.6 + +3.10.1 / 2014-06-03 +=================== + + * deps: connect@2.19.2 + - deps: compression@1.0.4 + * deps: proxy-addr@1.0.1 + +3.10.0 / 2014-06-02 +=================== + + * deps: connect@2.19.1 + - deprecate `methodOverride()` -- use `method-override` npm module instead + - deps: body-parser@1.3.0 + - deps: method-override@2.0.1 + - deps: multiparty@3.2.8 + - deps: response-time@2.0.0 + - deps: serve-static@1.2.1 + * deps: methods@1.0.1 + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + +3.9.0 / 2014-05-30 +================== + + * custom etag control with `app.set('etag', val)` + - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation + - `app.set('etag', 'weak')` weak tag + - `app.set('etag', 'strong')` strong etag + - `app.set('etag', false)` turn off + - `app.set('etag', true)` standard etag + * Include ETag in HEAD requests + * mark `res.send` ETag as weak and reduce collisions + * update connect to 2.18.0 + - deps: compression@1.0.3 + - deps: serve-index@1.1.0 + - deps: serve-static@1.2.0 + * update send to 0.4.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: debug@0.8.1 + +3.8.1 / 2014-05-27 +================== + + * update connect to 2.17.3 + - deps: body-parser@1.2.2 + - deps: express-session@1.2.1 + - deps: method-override@1.0.2 + +3.8.0 / 2014-05-21 +================== + + * keep previous `Content-Type` for `res.jsonp` + * set proper `charset` in `Content-Type` for `res.send` + * update connect to 2.17.1 + - fix `res.charset` appending charset when `content-type` has one + - deps: express-session@1.2.0 + - deps: morgan@1.1.1 + - deps: serve-index@1.0.3 + +3.7.0 / 2014-05-18 +================== + + * proper proxy trust with `app.set('trust proxy', trust)` + - `app.set('trust proxy', 1)` trust first hop + - `app.set('trust proxy', 'loopback')` trust loopback addresses + - `app.set('trust proxy', '10.0.0.1')` trust single IP + - `app.set('trust proxy', '10.0.0.1/16')` trust subnet + - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list + - `app.set('trust proxy', false)` turn off + - `app.set('trust proxy', true)` trust everything + * update connect to 2.16.2 + - deprecate `res.headerSent` -- use `res.headersSent` + - deprecate `res.on("header")` -- use on-headers module instead + - fix edge-case in `res.appendHeader` that would append in wrong order + - json: use body-parser + - urlencoded: use body-parser + - dep: bytes@1.0.0 + - dep: cookie-parser@1.1.0 + - dep: csurf@1.2.0 + - dep: express-session@1.1.0 + - dep: method-override@1.0.1 + +3.6.0 / 2014-05-09 +================== + + * deprecate `app.del()` -- use `app.delete()` instead + * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead + - the edge-case `res.json(status, num)` requires `res.status(status).json(num)` + * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead + - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)` + * support PURGE method + - add `app.purge` + - add `router.purge` + - include PURGE in `app.all` + * update connect to 2.15.0 + * Add `res.appendHeader` + * Call error stack even when response has been sent + * Patch `res.headerSent` to return Boolean + * Patch `res.headersSent` for node.js 0.8 + * Prevent default 404 handler after response sent + * dep: compression@1.0.2 + * dep: connect-timeout@1.1.0 + * dep: debug@^0.8.0 + * dep: errorhandler@1.0.1 + * dep: express-session@1.0.4 + * dep: morgan@1.0.1 + * dep: serve-favicon@2.0.0 + * dep: serve-index@1.0.2 + * update debug to 0.8.0 + * add `enable()` method + * change from stderr to stdout + * update methods to 1.0.0 + - add PURGE + * update mkdirp to 0.5.0 + +3.5.3 / 2014-05-08 +================== + + * fix `req.host` for IPv6 literals + * fix `res.jsonp` error if callback param is object + +3.5.2 / 2014-04-24 +================== + + * update connect to 2.14.5 + * update cookie to 0.1.2 + * update mkdirp to 0.4.0 + * update send to 0.3.0 + +3.5.1 / 2014-03-25 +================== + + * pin less-middleware in generated app + +3.5.0 / 2014-03-06 +================== + + * bump deps + +3.4.8 / 2014-01-13 +================== + + * prevent incorrect automatic OPTIONS responses #1868 @dpatti + * update binary and examples for jade 1.0 #1876 @yossi, #1877 @reqshark, #1892 @matheusazzi + * throw 400 in case of malformed paths @rlidwka + +3.4.7 / 2013-12-10 +================== + + * update connect + +3.4.6 / 2013-12-01 +================== + + * update connect (raw-body) + +3.4.5 / 2013-11-27 +================== + + * update connect + * res.location: remove leading ./ #1802 @kapouer + * res.redirect: fix `res.redirect('toString') #1829 @michaelficarra + * res.send: always send ETag when content-length > 0 + * router: add Router.all() method + +3.4.4 / 2013-10-29 +================== + + * update connect + * update supertest + * update methods + * express(1): replace bodyParser() with urlencoded() and json() #1795 @chirag04 + +3.4.3 / 2013-10-23 +================== + + * update connect + +3.4.2 / 2013-10-18 +================== + + * update connect + * downgrade commander + +3.4.1 / 2013-10-15 +================== + + * update connect + * update commander + * jsonp: check if callback is a function + * router: wrap encodeURIComponent in a try/catch #1735 (@lxe) + * res.format: now includes charset @1747 (@sorribas) + * res.links: allow multiple calls @1746 (@sorribas) + +3.4.0 / 2013-09-07 +================== + + * add res.vary(). Closes #1682 + * update connect + +3.3.8 / 2013-09-02 +================== + + * update connect + +3.3.7 / 2013-08-28 +================== + + * update connect + +3.3.6 / 2013-08-27 +================== + + * Revert "remove charset from json responses. Closes #1631" (causes issues in some clients) + * add: req.accepts take an argument list + +3.3.4 / 2013-07-08 +================== + + * update send and connect + +3.3.3 / 2013-07-04 +================== + + * update connect + +3.3.2 / 2013-07-03 +================== + + * update connect + * update send + * remove .version export + +3.3.1 / 2013-06-27 +================== + + * update connect + +3.3.0 / 2013-06-26 +================== + + * update connect + * add support for multiple X-Forwarded-Proto values. Closes #1646 + * change: remove charset from json responses. Closes #1631 + * change: return actual booleans from req.accept* functions + * fix jsonp callback array throw + +3.2.6 / 2013-06-02 +================== + + * update connect + +3.2.5 / 2013-05-21 +================== + + * update connect + * update node-cookie + * add: throw a meaningful error when there is no default engine + * change generation of ETags with res.send() to GET requests only. Closes #1619 + +3.2.4 / 2013-05-09 +================== + + * fix `req.subdomains` when no Host is present + * fix `req.host` when no Host is present, return undefined + +3.2.3 / 2013-05-07 +================== + + * update connect / qs + +3.2.2 / 2013-05-03 +================== + + * update qs + +3.2.1 / 2013-04-29 +================== + + * add app.VERB() paths array deprecation warning + * update connect + * update qs and remove all ~ semver crap + * fix: accept number as value of Signed Cookie + +3.2.0 / 2013-04-15 +================== + + * add "view" constructor setting to override view behaviour + * add req.acceptsEncoding(name) + * add req.acceptedEncodings + * revert cookie signature change causing session race conditions + * fix sorting of Accept values of the same quality + +3.1.2 / 2013-04-12 +================== + + * add support for custom Accept parameters + * update cookie-signature + +3.1.1 / 2013-04-01 +================== + + * add X-Forwarded-Host support to `req.host` + * fix relative redirects + * update mkdirp + * update buffer-crc32 + * remove legacy app.configure() method from app template. + +3.1.0 / 2013-01-25 +================== + + * add support for leading "." in "view engine" setting + * add array support to `res.set()` + * add node 0.8.x to travis.yml + * add "subdomain offset" setting for tweaking `req.subdomains` + * add `res.location(url)` implementing `res.redirect()`-like setting of Location + * use app.get() for x-powered-by setting for inheritance + * fix colons in passwords for `req.auth` + +3.0.6 / 2013-01-04 +================== + + * add http verb methods to Router + * update connect + * fix mangling of the `res.cookie()` options object + * fix jsonp whitespace escape. Closes #1132 + +3.0.5 / 2012-12-19 +================== + + * add throwing when a non-function is passed to a route + * fix: explicitly remove Transfer-Encoding header from 204 and 304 responses + * revert "add 'etag' option" + +3.0.4 / 2012-12-05 +================== + + * add 'etag' option to disable `res.send()` Etags + * add escaping of urls in text/plain in `res.redirect()` + for old browsers interpreting as html + * change crc32 module for a more liberal license + * update connect + +3.0.3 / 2012-11-13 +================== + + * update connect + * update cookie module + * fix cookie max-age + +3.0.2 / 2012-11-08 +================== + + * add OPTIONS to cors example. Closes #1398 + * fix route chaining regression. Closes #1397 + +3.0.1 / 2012-11-01 +================== + + * update connect + +3.0.0 / 2012-10-23 +================== + + * add `make clean` + * add "Basic" check to req.auth + * add `req.auth` test coverage + * add cb && cb(payload) to `res.jsonp()`. Closes #1374 + * add backwards compat for `res.redirect()` status. Closes #1336 + * add support for `res.json()` to retain previously defined Content-Types. Closes #1349 + * update connect + * change `res.redirect()` to utilize a pathname-relative Location again. Closes #1382 + * remove non-primitive string support for `res.send()` + * fix view-locals example. Closes #1370 + * fix route-separation example + +3.0.0rc5 / 2012-09-18 +================== + + * update connect + * add redis search example + * add static-files example + * add "x-powered-by" setting (`app.disable('x-powered-by')`) + * add "application/octet-stream" redirect Accept test case. Closes #1317 + +3.0.0rc4 / 2012-08-30 +================== + + * add `res.jsonp()`. Closes #1307 + * add "verbose errors" option to error-pages example + * add another route example to express(1) so people are not so confused + * add redis online user activity tracking example + * update connect dep + * fix etag quoting. Closes #1310 + * fix error-pages 404 status + * fix jsonp callback char restrictions + * remove old OPTIONS default response + +3.0.0rc3 / 2012-08-13 +================== + + * update connect dep + * fix signed cookies to work with `connect.cookieParser()` ("s:" prefix was missing) [tnydwrds] + * fix `res.render()` clobbering of "locals" + +3.0.0rc2 / 2012-08-03 +================== + + * add CORS example + * update connect dep + * deprecate `.createServer()` & remove old stale examples + * fix: escape `res.redirect()` link + * fix vhost example + +3.0.0rc1 / 2012-07-24 +================== + + * add more examples to view-locals + * add scheme-relative redirects (`res.redirect("//foo.com")`) support + * update cookie dep + * update connect dep + * update send dep + * fix `express(1)` -h flag, use -H for hogan. Closes #1245 + * fix `res.sendfile()` socket error handling regression + +3.0.0beta7 / 2012-07-16 +================== + + * update connect dep for `send()` root normalization regression + +3.0.0beta6 / 2012-07-13 +================== + + * add `err.view` property for view errors. Closes #1226 + * add "jsonp callback name" setting + * add support for "/foo/:bar*" non-greedy matches + * change `res.sendfile()` to use `send()` module + * change `res.send` to use "response-send" module + * remove `app.locals.use` and `res.locals.use`, use regular middleware + +3.0.0beta5 / 2012-07-03 +================== + + * add "make check" support + * add route-map example + * add `res.json(obj, status)` support back for BC + * add "methods" dep, remove internal methods module + * update connect dep + * update auth example to utilize cores pbkdf2 + * updated tests to use "supertest" + +3.0.0beta4 / 2012-06-25 +================== + + * Added `req.auth` + * Added `req.range(size)` + * Added `res.links(obj)` + * Added `res.send(body, status)` support back for backwards compat + * Added `.default()` support to `res.format()` + * Added 2xx / 304 check to `req.fresh` + * Revert "Added + support to the router" + * Fixed `res.send()` freshness check, respect res.statusCode + +3.0.0beta3 / 2012-06-15 +================== + + * Added hogan `--hjs` to express(1) [nullfirm] + * Added another example to content-negotiation + * Added `fresh` dep + * Changed: `res.send()` always checks freshness + * Fixed: expose connects mime module. Closes #1165 + +3.0.0beta2 / 2012-06-06 +================== + + * Added `+` support to the router + * Added `req.host` + * Changed `req.param()` to check route first + * Update connect dep + +3.0.0beta1 / 2012-06-01 +================== + + * Added `res.format()` callback to override default 406 behaviour + * Fixed `res.redirect()` 406. Closes #1154 + +3.0.0alpha5 / 2012-05-30 +================== + + * Added `req.ip` + * Added `{ signed: true }` option to `res.cookie()` + * Removed `res.signedCookie()` + * Changed: dont reverse `req.ips` + * Fixed "trust proxy" setting check for `req.ips` + +3.0.0alpha4 / 2012-05-09 +================== + + * Added: allow `[]` in jsonp callback. Closes #1128 + * Added `PORT` env var support in generated template. Closes #1118 [benatkin] + * Updated: connect 2.2.2 + +3.0.0alpha3 / 2012-05-04 +================== + + * Added public `app.routes`. Closes #887 + * Added _view-locals_ example + * Added _mvc_ example + * Added `res.locals.use()`. Closes #1120 + * Added conditional-GET support to `res.send()` + * Added: coerce `res.set()` values to strings + * Changed: moved `static()` in generated apps below router + * Changed: `res.send()` only set ETag when not previously set + * Changed connect 2.2.1 dep + * Changed: `make test` now runs unit / acceptance tests + * Fixed req/res proto inheritance + +3.0.0alpha2 / 2012-04-26 +================== + + * Added `make benchmark` back + * Added `res.send()` support for `String` objects + * Added client-side data exposing example + * Added `res.header()` and `req.header()` aliases for BC + * Added `express.createServer()` for BC + * Perf: memoize parsed urls + * Perf: connect 2.2.0 dep + * Changed: make `expressInit()` middleware self-aware + * Fixed: use app.get() for all core settings + * Fixed redis session example + * Fixed session example. Closes #1105 + * Fixed generated express dep. Closes #1078 + +3.0.0alpha1 / 2012-04-15 +================== + + * Added `app.locals.use(callback)` + * Added `app.locals` object + * Added `app.locals(obj)` + * Added `res.locals` object + * Added `res.locals(obj)` + * Added `res.format()` for content-negotiation + * Added `app.engine()` + * Added `res.cookie()` JSON cookie support + * Added "trust proxy" setting + * Added `req.subdomains` + * Added `req.protocol` + * Added `req.secure` + * Added `req.path` + * Added `req.ips` + * Added `req.fresh` + * Added `req.stale` + * Added comma-delimited / array support for `req.accepts()` + * Added debug instrumentation + * Added `res.set(obj)` + * Added `res.set(field, value)` + * Added `res.get(field)` + * Added `app.get(setting)`. Closes #842 + * Added `req.acceptsLanguage()` + * Added `req.acceptsCharset()` + * Added `req.accepted` + * Added `req.acceptedLanguages` + * Added `req.acceptedCharsets` + * Added "json replacer" setting + * Added "json spaces" setting + * Added X-Forwarded-Proto support to `res.redirect()`. Closes #92 + * Added `--less` support to express(1) + * Added `express.response` prototype + * Added `express.request` prototype + * Added `express.application` prototype + * Added `app.path()` + * Added `app.render()` + * Added `res.type()` to replace `res.contentType()` + * Changed: `res.redirect()` to add relative support + * Changed: enable "jsonp callback" by default + * Changed: renamed "case sensitive routes" to "case sensitive routing" + * Rewrite of all tests with mocha + * Removed "root" setting + * Removed `res.redirect('home')` support + * Removed `req.notify()` + * Removed `app.register()` + * Removed `app.redirect()` + * Removed `app.is()` + * Removed `app.helpers()` + * Removed `app.dynamicHelpers()` + * Fixed `res.sendfile()` with non-GET. Closes #723 + * Fixed express(1) public dir for windows. Closes #866 + +2.5.9/ 2012-04-02 +================== + + * Added support for PURGE request method [pbuyle] + * Fixed `express(1)` generated app `app.address()` before `listening` [mmalecki] + +2.5.8 / 2012-02-08 +================== + + * Update mkdirp dep. Closes #991 + +2.5.7 / 2012-02-06 +================== + + * Fixed `app.all` duplicate DELETE requests [mscdex] + +2.5.6 / 2012-01-13 +================== + + * Updated hamljs dev dep. Closes #953 + +2.5.5 / 2012-01-08 +================== + + * Fixed: set `filename` on cached templates [matthewleon] + +2.5.4 / 2012-01-02 +================== + + * Fixed `express(1)` eol on 0.4.x. Closes #947 + +2.5.3 / 2011-12-30 +================== + + * Fixed `req.is()` when a charset is present + +2.5.2 / 2011-12-10 +================== + + * Fixed: express(1) LF -> CRLF for windows + +2.5.1 / 2011-11-17 +================== + + * Changed: updated connect to 1.8.x + * Removed sass.js support from express(1) + +2.5.0 / 2011-10-24 +================== + + * Added ./routes dir for generated app by default + * Added npm install reminder to express(1) app gen + * Added 0.5.x support + * Removed `make test-cov` since it wont work with node 0.5.x + * Fixed express(1) public dir for windows. Closes #866 + +2.4.7 / 2011-10-05 +================== + + * Added mkdirp to express(1). Closes #795 + * Added simple _json-config_ example + * Added shorthand for the parsed request's pathname via `req.path` + * Changed connect dep to 1.7.x to fix npm issue... + * Fixed `res.redirect()` __HEAD__ support. [reported by xerox] + * Fixed `req.flash()`, only escape args + * Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie] + +2.4.6 / 2011-08-22 +================== + + * Fixed multiple param callback regression. Closes #824 [reported by TroyGoode] + +2.4.5 / 2011-08-19 +================== + + * Added support for routes to handle errors. Closes #809 + * Added `app.routes.all()`. Closes #803 + * Added "basepath" setting to work in conjunction with reverse proxies etc. + * Refactored `Route` to use a single array of callbacks + * Added support for multiple callbacks for `app.param()`. Closes #801 +Closes #805 + * Changed: removed .call(self) for route callbacks + * Dependency: `qs >= 0.3.1` + * Fixed `res.redirect()` on windows due to `join()` usage. Closes #808 + +2.4.4 / 2011-08-05 +================== + + * Fixed `res.header()` intention of a set, even when `undefined` + * Fixed `*`, value no longer required + * Fixed `res.send(204)` support. Closes #771 + +2.4.3 / 2011-07-14 +================== + + * Added docs for `status` option special-case. Closes #739 + * Fixed `options.filename`, exposing the view path to template engines + +2.4.2. / 2011-07-06 +================== + + * Revert "removed jsonp stripping" for XSS + +2.4.1 / 2011-07-06 +================== + + * Added `res.json()` JSONP support. Closes #737 + * Added _extending-templates_ example. Closes #730 + * Added "strict routing" setting for trailing slashes + * Added support for multiple envs in `app.configure()` calls. Closes #735 + * Changed: `res.send()` using `res.json()` + * Changed: when cookie `path === null` don't default it + * Changed; default cookie path to "home" setting. Closes #731 + * Removed _pids/logs_ creation from express(1) + +2.4.0 / 2011-06-28 +================== + + * Added chainable `res.status(code)` + * Added `res.json()`, an explicit version of `res.send(obj)` + * Added simple web-service example + +2.3.12 / 2011-06-22 +================== + + * \#express is now on freenode! come join! + * Added `req.get(field, param)` + * Added links to Japanese documentation, thanks @hideyukisaito! + * Added; the `express(1)` generated app outputs the env + * Added `content-negotiation` example + * Dependency: connect >= 1.5.1 < 2.0.0 + * Fixed view layout bug. Closes #720 + * Fixed; ignore body on 304. Closes #701 + +2.3.11 / 2011-06-04 +================== + + * Added `npm test` + * Removed generation of dummy test file from `express(1)` + * Fixed; `express(1)` adds express as a dep + * Fixed; prune on `prepublish` + +2.3.10 / 2011-05-27 +================== + + * Added `req.route`, exposing the current route + * Added _package.json_ generation support to `express(1)` + * Fixed call to `app.param()` function for optional params. Closes #682 + +2.3.9 / 2011-05-25 +================== + + * Fixed bug-ish with `../' in `res.partial()` calls + +2.3.8 / 2011-05-24 +================== + + * Fixed `app.options()` + +2.3.7 / 2011-05-23 +================== + + * Added route `Collection`, ex: `app.get('/user/:id').remove();` + * Added support for `app.param(fn)` to define param logic + * Removed `app.param()` support for callback with return value + * Removed module.parent check from express(1) generated app. Closes #670 + * Refactored router. Closes #639 + +2.3.6 / 2011-05-20 +================== + + * Changed; using devDependencies instead of git submodules + * Fixed redis session example + * Fixed markdown example + * Fixed view caching, should not be enabled in development + +2.3.5 / 2011-05-20 +================== + + * Added export `.view` as alias for `.View` + +2.3.4 / 2011-05-08 +================== + + * Added `./examples/say` + * Fixed `res.sendfile()` bug preventing the transfer of files with spaces + +2.3.3 / 2011-05-03 +================== + + * Added "case sensitive routes" option. + * Changed; split methods supported per rfc [slaskis] + * Fixed route-specific middleware when using the same callback function several times + +2.3.2 / 2011-04-27 +================== + + * Fixed view hints + +2.3.1 / 2011-04-26 +================== + + * Added `app.match()` as `app.match.all()` + * Added `app.lookup()` as `app.lookup.all()` + * Added `app.remove()` for `app.remove.all()` + * Added `app.remove.VERB()` + * Fixed template caching collision issue. Closes #644 + * Moved router over from connect and started refactor + +2.3.0 / 2011-04-25 +================== + + * Added options support to `res.clearCookie()` + * Added `res.helpers()` as alias of `res.locals()` + * Added; json defaults to UTF-8 with `res.send()`. Closes #632. [Daniel * Dependency `connect >= 1.4.0` + * Changed; auto set Content-Type in res.attachement [Aaron Heckmann] + * Renamed "cache views" to "view cache". Closes #628 + * Fixed caching of views when using several apps. Closes #637 + * Fixed gotcha invoking `app.param()` callbacks once per route middleware. +Closes #638 + * Fixed partial lookup precedence. Closes #631 +Shaw] + +2.2.2 / 2011-04-12 +================== + + * Added second callback support for `res.download()` connection errors + * Fixed `filename` option passing to template engine + +2.2.1 / 2011-04-04 +================== + + * Added `layout(path)` helper to change the layout within a view. Closes #610 + * Fixed `partial()` collection object support. + Previously only anything with `.length` would work. + When `.length` is present one must still be aware of holes, + however now `{ collection: {foo: 'bar'}}` is valid, exposes + `keyInCollection` and `keysInCollection`. + + * Performance improved with better view caching + * Removed `request` and `response` locals + * Changed; errorHandler page title is now `Express` instead of `Connect` + +2.2.0 / 2011-03-30 +================== + + * Added `app.lookup.VERB()`, ex `app.lookup.put('/user/:id')`. Closes #606 + * Added `app.match.VERB()`, ex `app.match.put('/user/12')`. Closes #606 + * Added `app.VERB(path)` as alias of `app.lookup.VERB()`. + * Dependency `connect >= 1.2.0` + +2.1.1 / 2011-03-29 +================== + + * Added; expose `err.view` object when failing to locate a view + * Fixed `res.partial()` call `next(err)` when no callback is given [reported by aheckmann] + * Fixed; `res.send(undefined)` responds with 204 [aheckmann] + +2.1.0 / 2011-03-24 +================== + + * Added `/_?` partial lookup support. Closes #447 + * Added `request`, `response`, and `app` local variables + * Added `settings` local variable, containing the app's settings + * Added `req.flash()` exception if `req.session` is not available + * Added `res.send(bool)` support (json response) + * Fixed stylus example for latest version + * Fixed; wrap try/catch around `res.render()` + +2.0.0 / 2011-03-17 +================== + + * Fixed up index view path alternative. + * Changed; `res.locals()` without object returns the locals + +2.0.0rc3 / 2011-03-17 +================== + + * Added `res.locals(obj)` to compliment `res.local(key, val)` + * Added `res.partial()` callback support + * Fixed recursive error reporting issue in `res.render()` + +2.0.0rc2 / 2011-03-17 +================== + + * Changed; `partial()` "locals" are now optional + * Fixed `SlowBuffer` support. Closes #584 [reported by tyrda01] + * Fixed .filename view engine option [reported by drudge] + * Fixed blog example + * Fixed `{req,res}.app` reference when mounting [Ben Weaver] + +2.0.0rc / 2011-03-14 +================== + + * Fixed; expose `HTTPSServer` constructor + * Fixed express(1) default test charset. Closes #579 [reported by secoif] + * Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP] + +2.0.0beta3 / 2011-03-09 +================== + + * Added support for `res.contentType()` literal + The original `res.contentType('.json')`, + `res.contentType('application/json')`, and `res.contentType('json')` + will work now. + * Added `res.render()` status option support back + * Added charset option for `res.render()` + * Added `.charset` support (via connect 1.0.4) + * Added view resolution hints when in development and a lookup fails + * Added layout lookup support relative to the page view. + For example while rendering `./views/user/index.jade` if you create + `./views/user/layout.jade` it will be used in favour of the root layout. + * Fixed `res.redirect()`. RFC states absolute url [reported by unlink] + * Fixed; default `res.send()` string charset to utf8 + * Removed `Partial` constructor (not currently used) + +2.0.0beta2 / 2011-03-07 +================== + + * Added res.render() `.locals` support back to aid in migration process + * Fixed flash example + +2.0.0beta / 2011-03-03 +================== + + * Added HTTPS support + * Added `res.cookie()` maxAge support + * Added `req.header()` _Referrer_ / _Referer_ special-case, either works + * Added mount support for `res.redirect()`, now respects the mount-point + * Added `union()` util, taking place of `merge(clone())` combo + * Added stylus support to express(1) generated app + * Added secret to session middleware used in examples and generated app + * Added `res.local(name, val)` for progressive view locals + * Added default param support to `req.param(name, default)` + * Added `app.disabled()` and `app.enabled()` + * Added `app.register()` support for omitting leading ".", either works + * Added `res.partial()`, using the same interface as `partial()` within a view. Closes #539 + * Added `app.param()` to map route params to async/sync logic + * Added; aliased `app.helpers()` as `app.locals()`. Closes #481 + * Added extname with no leading "." support to `res.contentType()` + * Added `cache views` setting, defaulting to enabled in "production" env + * Added index file partial resolution, eg: partial('user') may try _views/user/index.jade_. + * Added `req.accepts()` support for extensions + * Changed; `res.download()` and `res.sendfile()` now utilize Connect's + static file server `connect.static.send()`. + * Changed; replaced `connect.utils.mime()` with npm _mime_ module + * Changed; allow `req.query` to be pre-defined (via middleware or other parent + * Changed view partial resolution, now relative to parent view + * Changed view engine signature. no longer `engine.render(str, options, callback)`, now `engine.compile(str, options) -> Function`, the returned function accepts `fn(locals)`. + * Fixed `req.param()` bug returning Array.prototype methods. Closes #552 + * Fixed; using `Stream#pipe()` instead of `sys.pump()` in `res.sendfile()` + * Fixed; using _qs_ module instead of _querystring_ + * Fixed; strip unsafe chars from jsonp callbacks + * Removed "stream threshold" setting + +1.0.8 / 2011-03-01 +================== + + * Allow `req.query` to be pre-defined (via middleware or other parent app) + * "connect": ">= 0.5.0 < 1.0.0". Closes #547 + * Removed the long deprecated __EXPRESS_ENV__ support + +1.0.7 / 2011-02-07 +================== + + * Fixed `render()` setting inheritance. + Mounted apps would not inherit "view engine" + +1.0.6 / 2011-02-07 +================== + + * Fixed `view engine` setting bug when period is in dirname + +1.0.5 / 2011-02-05 +================== + + * Added secret to generated app `session()` call + +1.0.4 / 2011-02-05 +================== + + * Added `qs` dependency to _package.json_ + * Fixed namespaced `require()`s for latest connect support + +1.0.3 / 2011-01-13 +================== + + * Remove unsafe characters from JSONP callback names [Ryan Grove] + +1.0.2 / 2011-01-10 +================== + + * Removed nested require, using `connect.router` + +1.0.1 / 2010-12-29 +================== + + * Fixed for middleware stacked via `createServer()` + previously the `foo` middleware passed to `createServer(foo)` + would not have access to Express methods such as `res.send()` + or props like `req.query` etc. + +1.0.0 / 2010-11-16 +================== + + * Added; deduce partial object names from the last segment. + For example by default `partial('forum/post', postObject)` will + give you the _post_ object, providing a meaningful default. + * Added http status code string representation to `res.redirect()` body + * Added; `res.redirect()` supporting _text/plain_ and _text/html_ via __Accept__. + * Added `req.is()` to aid in content negotiation + * Added partial local inheritance [suggested by masylum]. Closes #102 + providing access to parent template locals. + * Added _-s, --session[s]_ flag to express(1) to add session related middleware + * Added _--template_ flag to express(1) to specify the + template engine to use. + * Added _--css_ flag to express(1) to specify the + stylesheet engine to use (or just plain css by default). + * Added `app.all()` support [thanks aheckmann] + * Added partial direct object support. + You may now `partial('user', user)` providing the "user" local, + vs previously `partial('user', { object: user })`. + * Added _route-separation_ example since many people question ways + to do this with CommonJS modules. Also view the _blog_ example for + an alternative. + * Performance; caching view path derived partial object names + * Fixed partial local inheritance precedence. [reported by Nick Poulden] Closes #454 + * Fixed jsonp support; _text/javascript_ as per mailinglist discussion + +1.0.0rc4 / 2010-10-14 +================== + + * Added _NODE_ENV_ support, _EXPRESS_ENV_ is deprecated and will be removed in 1.0.0 + * Added route-middleware support (very helpful, see the [docs](http://expressjs.com/guide.html#Route-Middleware)) + * Added _jsonp callback_ setting to enable/disable jsonp autowrapping [Dav Glass] + * Added callback query check on response.send to autowrap JSON objects for simple webservice implementations [Dav Glass] + * Added `partial()` support for array-like collections. Closes #434 + * Added support for swappable querystring parsers + * Added session usage docs. Closes #443 + * Added dynamic helper caching. Closes #439 [suggested by maritz] + * Added authentication example + * Added basic Range support to `res.sendfile()` (and `res.download()` etc) + * Changed; `express(1)` generated app using 2 spaces instead of 4 + * Default env to "development" again [aheckmann] + * Removed _context_ option is no more, use "scope" + * Fixed; exposing _./support_ libs to examples so they can run without installs + * Fixed mvc example + +1.0.0rc3 / 2010-09-20 +================== + + * Added confirmation for `express(1)` app generation. Closes #391 + * Added extending of flash formatters via `app.flashFormatters` + * Added flash formatter support. Closes #411 + * Added streaming support to `res.sendfile()` using `sys.pump()` when >= "stream threshold" + * Added _stream threshold_ setting for `res.sendfile()` + * Added `res.send()` __HEAD__ support + * Added `res.clearCookie()` + * Added `res.cookie()` + * Added `res.render()` headers option + * Added `res.redirect()` response bodies + * Added `res.render()` status option support. Closes #425 [thanks aheckmann] + * Fixed `res.sendfile()` responding with 403 on malicious path + * Fixed `res.download()` bug; when an error occurs remove _Content-Disposition_ + * Fixed; mounted apps settings now inherit from parent app [aheckmann] + * Fixed; stripping Content-Length / Content-Type when 204 + * Fixed `res.send()` 204. Closes #419 + * Fixed multiple _Set-Cookie_ headers via `res.header()`. Closes #402 + * Fixed bug messing with error handlers when `listenFD()` is called instead of `listen()`. [thanks guillermo] + + +1.0.0rc2 / 2010-08-17 +================== + + * Added `app.register()` for template engine mapping. Closes #390 + * Added `res.render()` callback support as second argument (no options) + * Added callback support to `res.download()` + * Added callback support for `res.sendfile()` + * Added support for middleware access via `express.middlewareName()` vs `connect.middlewareName()` + * Added "partials" setting to docs + * Added default expresso tests to `express(1)` generated app. Closes #384 + * Fixed `res.sendfile()` error handling, defer via `next()` + * Fixed `res.render()` callback when a layout is used [thanks guillermo] + * Fixed; `make install` creating ~/.node_libraries when not present + * Fixed issue preventing error handlers from being defined anywhere. Closes #387 + +1.0.0rc / 2010-07-28 +================== + + * Added mounted hook. Closes #369 + * Added connect dependency to _package.json_ + + * Removed "reload views" setting and support code + development env never caches, production always caches. + + * Removed _param_ in route callbacks, signature is now + simply (req, res, next), previously (req, res, params, next). + Use _req.params_ for path captures, _req.query_ for GET params. + + * Fixed "home" setting + * Fixed middleware/router precedence issue. Closes #366 + * Fixed; _configure()_ callbacks called immediately. Closes #368 + +1.0.0beta2 / 2010-07-23 +================== + + * Added more examples + * Added; exporting `Server` constructor + * Added `Server#helpers()` for view locals + * Added `Server#dynamicHelpers()` for dynamic view locals. Closes #349 + * Added support for absolute view paths + * Added; _home_ setting defaults to `Server#route` for mounted apps. Closes #363 + * Added Guillermo Rauch to the contributor list + * Added support for "as" for non-collection partials. Closes #341 + * Fixed _install.sh_, ensuring _~/.node_libraries_ exists. Closes #362 [thanks jf] + * Fixed `res.render()` exceptions, now passed to `next()` when no callback is given [thanks guillermo] + * Fixed instanceof `Array` checks, now `Array.isArray()` + * Fixed express(1) expansion of public dirs. Closes #348 + * Fixed middleware precedence. Closes #345 + * Fixed view watcher, now async [thanks aheckmann] + +1.0.0beta / 2010-07-15 +================== + + * Re-write + - much faster + - much lighter + - Check [ExpressJS.com](http://expressjs.com) for migration guide and updated docs + +0.14.0 / 2010-06-15 +================== + + * Utilize relative requires + * Added Static bufferSize option [aheckmann] + * Fixed caching of view and partial subdirectories [aheckmann] + * Fixed mime.type() comments now that ".ext" is not supported + * Updated haml submodule + * Updated class submodule + * Removed bin/express + +0.13.0 / 2010-06-01 +================== + + * Added node v0.1.97 compatibility + * Added support for deleting cookies via Request#cookie('key', null) + * Updated haml submodule + * Fixed not-found page, now using using charset utf-8 + * Fixed show-exceptions page, now using using charset utf-8 + * Fixed view support due to fs.readFile Buffers + * Changed; mime.type() no longer accepts ".type" due to node extname() changes + +0.12.0 / 2010-05-22 +================== + + * Added node v0.1.96 compatibility + * Added view `helpers` export which act as additional local variables + * Updated haml submodule + * Changed ETag; removed inode, modified time only + * Fixed LF to CRLF for setting multiple cookies + * Fixed cookie complation; values are now urlencoded + * Fixed cookies parsing; accepts quoted values and url escaped cookies + +0.11.0 / 2010-05-06 +================== + + * Added support for layouts using different engines + - this.render('page.html.haml', { layout: 'super-cool-layout.html.ejs' }) + - this.render('page.html.haml', { layout: 'foo' }) // assumes 'foo.html.haml' + - this.render('page.html.haml', { layout: false }) // no layout + * Updated ext submodule + * Updated haml submodule + * Fixed EJS partial support by passing along the context. Issue #307 + +0.10.1 / 2010-05-03 +================== + + * Fixed binary uploads. + +0.10.0 / 2010-04-30 +================== + + * Added charset support via Request#charset (automatically assigned to 'UTF-8' when respond()'s + encoding is set to 'utf8' or 'utf-8'. + * Added "encoding" option to Request#render(). Closes #299 + * Added "dump exceptions" setting, which is enabled by default. + * Added simple ejs template engine support + * Added error response support for text/plain, application/json. Closes #297 + * Added callback function param to Request#error() + * Added Request#sendHead() + * Added Request#stream() + * Added support for Request#respond(304, null) for empty response bodies + * Added ETag support to Request#sendfile() + * Added options to Request#sendfile(), passed to fs.createReadStream() + * Added filename arg to Request#download() + * Performance enhanced due to pre-reversing plugins so that plugins.reverse() is not called on each request + * Performance enhanced by preventing several calls to toLowerCase() in Router#match() + * Changed; Request#sendfile() now streams + * Changed; Renamed Request#halt() to Request#respond(). Closes #289 + * Changed; Using sys.inspect() instead of JSON.encode() for error output + * Changed; run() returns the http.Server instance. Closes #298 + * Changed; Defaulting Server#host to null (INADDR_ANY) + * Changed; Logger "common" format scale of 0.4f + * Removed Logger "request" format + * Fixed; Catching ENOENT in view caching, preventing error when "views/partials" is not found + * Fixed several issues with http client + * Fixed Logger Content-Length output + * Fixed bug preventing Opera from retaining the generated session id. Closes #292 + +0.9.0 / 2010-04-14 +================== + + * Added DSL level error() route support + * Added DSL level notFound() route support + * Added Request#error() + * Added Request#notFound() + * Added Request#render() callback function. Closes #258 + * Added "max upload size" setting + * Added "magic" variables to collection partials (\_\_index\_\_, \_\_length\_\_, \_\_isFirst\_\_, \_\_isLast\_\_). Closes #254 + * Added [haml.js](http://github.com/visionmedia/haml.js) submodule; removed haml-js + * Added callback function support to Request#halt() as 3rd/4th arg + * Added preprocessing of route param wildcards using param(). Closes #251 + * Added view partial support (with collections etc) + * Fixed bug preventing falsey params (such as ?page=0). Closes #286 + * Fixed setting of multiple cookies. Closes #199 + * Changed; view naming convention is now NAME.TYPE.ENGINE (for example page.html.haml) + * Changed; session cookie is now httpOnly + * Changed; Request is no longer global + * Changed; Event is no longer global + * Changed; "sys" module is no longer global + * Changed; moved Request#download to Static plugin where it belongs + * Changed; Request instance created before body parsing. Closes #262 + * Changed; Pre-caching views in memory when "cache view contents" is enabled. Closes #253 + * Changed; Pre-caching view partials in memory when "cache view partials" is enabled + * Updated support to node --version 0.1.90 + * Updated dependencies + * Removed set("session cookie") in favour of use(Session, { cookie: { ... }}) + * Removed utils.mixin(); use Object#mergeDeep() + +0.8.0 / 2010-03-19 +================== + + * Added coffeescript example app. Closes #242 + * Changed; cache api now async friendly. Closes #240 + * Removed deprecated 'express/static' support. Use 'express/plugins/static' + +0.7.6 / 2010-03-19 +================== + + * Added Request#isXHR. Closes #229 + * Added `make install` (for the executable) + * Added `express` executable for setting up simple app templates + * Added "GET /public/*" to Static plugin, defaulting to /public + * Added Static plugin + * Fixed; Request#render() only calls cache.get() once + * Fixed; Namespacing View caches with "view:" + * Fixed; Namespacing Static caches with "static:" + * Fixed; Both example apps now use the Static plugin + * Fixed set("views"). Closes #239 + * Fixed missing space for combined log format + * Deprecated Request#sendfile() and 'express/static' + * Removed Server#running + +0.7.5 / 2010-03-16 +================== + + * Added Request#flash() support without args, now returns all flashes + * Updated ext submodule + +0.7.4 / 2010-03-16 +================== + + * Fixed session reaper + * Changed; class.js replacing js-oo Class implementation (quite a bit faster, no browser cruft) + +0.7.3 / 2010-03-16 +================== + + * Added package.json + * Fixed requiring of haml / sass due to kiwi removal + +0.7.2 / 2010-03-16 +================== + + * Fixed GIT submodules (HAH!) + +0.7.1 / 2010-03-16 +================== + + * Changed; Express now using submodules again until a PM is adopted + * Changed; chat example using millisecond conversions from ext + +0.7.0 / 2010-03-15 +================== + + * Added Request#pass() support (finds the next matching route, or the given path) + * Added Logger plugin (default "common" format replaces CommonLogger) + * Removed Profiler plugin + * Removed CommonLogger plugin + +0.6.0 / 2010-03-11 +================== + + * Added seed.yml for kiwi package management support + * Added HTTP client query string support when method is GET. Closes #205 + + * Added support for arbitrary view engines. + For example "foo.engine.html" will now require('engine'), + the exports from this module are cached after the first require(). + + * Added async plugin support + + * Removed usage of RESTful route funcs as http client + get() etc, use http.get() and friends + + * Removed custom exceptions + +0.5.0 / 2010-03-10 +================== + + * Added ext dependency (library of js extensions) + * Removed extname() / basename() utils. Use path module + * Removed toArray() util. Use arguments.values + * Removed escapeRegexp() util. Use RegExp.escape() + * Removed process.mixin() dependency. Use utils.mixin() + * Removed Collection + * Removed ElementCollection + * Shameless self promotion of ebook "Advanced JavaScript" (http://dev-mag.com) ;) + +0.4.0 / 2010-02-11 +================== + + * Added flash() example to sample upload app + * Added high level restful http client module (express/http) + * Changed; RESTful route functions double as HTTP clients. Closes #69 + * Changed; throwing error when routes are added at runtime + * Changed; defaulting render() context to the current Request. Closes #197 + * Updated haml submodule + +0.3.0 / 2010-02-11 +================== + + * Updated haml / sass submodules. Closes #200 + * Added flash message support. Closes #64 + * Added accepts() now allows multiple args. fixes #117 + * Added support for plugins to halt. Closes #189 + * Added alternate layout support. Closes #119 + * Removed Route#run(). Closes #188 + * Fixed broken specs due to use(Cookie) missing + +0.2.1 / 2010-02-05 +================== + + * Added "plot" format option for Profiler (for gnuplot processing) + * Added request number to Profiler plugin + * Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8 + * Fixed issue with routes not firing when not files are present. Closes #184 + * Fixed process.Promise -> events.Promise + +0.2.0 / 2010-02-03 +================== + + * Added parseParam() support for name[] etc. (allows for file inputs with "multiple" attr) Closes #180 + * Added Both Cache and Session option "reapInterval" may be "reapEvery". Closes #174 + * Added expiration support to cache api with reaper. Closes #133 + * Added cache Store.Memory#reap() + * Added Cache; cache api now uses first class Cache instances + * Added abstract session Store. Closes #172 + * Changed; cache Memory.Store#get() utilizing Collection + * Renamed MemoryStore -> Store.Memory + * Fixed use() of the same plugin several time will always use latest options. Closes #176 + +0.1.0 / 2010-02-03 +================== + + * Changed; Hooks (before / after) pass request as arg as well as evaluated in their context + * Updated node support to 0.1.27 Closes #169 + * Updated dirname(__filename) -> __dirname + * Updated libxmljs support to v0.2.0 + * Added session support with memory store / reaping + * Added quick uid() helper + * Added multi-part upload support + * Added Sass.js support / submodule + * Added production env caching view contents and static files + * Added static file caching. Closes #136 + * Added cache plugin with memory stores + * Added support to StaticFile so that it works with non-textual files. + * Removed dirname() helper + * Removed several globals (now their modules must be required) + +0.0.2 / 2010-01-10 +================== + + * Added view benchmarks; currently haml vs ejs + * Added Request#attachment() specs. Closes #116 + * Added use of node's parseQuery() util. Closes #123 + * Added `make init` for submodules + * Updated Haml + * Updated sample chat app to show messages on load + * Updated libxmljs parseString -> parseHtmlString + * Fixed `make init` to work with older versions of git + * Fixed specs can now run independent specs for those who cant build deps. Closes #127 + * Fixed issues introduced by the node url module changes. Closes 126. + * Fixed two assertions failing due to Collection#keys() returning strings + * Fixed faulty Collection#toArray() spec due to keys() returning strings + * Fixed `make test` now builds libxmljs.node before testing + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/express/LICENSE b/node_modules/express/LICENSE new file mode 100755 index 00000000..aa927e44 --- /dev/null +++ b/node_modules/express/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2009-2014 TJ Holowaychuk +Copyright (c) 2013-2014 Roman Shtylman +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/express/Readme.md b/node_modules/express/Readme.md new file mode 100755 index 00000000..0ddc68fd --- /dev/null +++ b/node_modules/express/Readme.md @@ -0,0 +1,142 @@ +[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/) + + Fast, unopinionated, minimalist web framework for [node](http://nodejs.org). + + [![NPM Version][npm-image]][npm-url] + [![NPM Downloads][downloads-image]][downloads-url] + [![Linux Build][travis-image]][travis-url] + [![Windows Build][appveyor-image]][appveyor-url] + [![Test Coverage][coveralls-image]][coveralls-url] + +```js +var express = require('express') +var app = express() + +app.get('/', function (req, res) { + res.send('Hello World') +}) + +app.listen(3000) +``` + +## Installation + +```bash +$ npm install express +``` + +## Features + + * Robust routing + * Focus on high performance + * Super-high test coverage + * HTTP helpers (redirection, caching, etc) + * View system supporting 14+ template engines + * Content negotiation + * Executable for generating applications quickly + +## Docs & Community + + * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)] + * [#express](https://webchat.freenode.net/?channels=express) on freenode IRC + * [Github Organization](https://github.com/expressjs) for Official Middleware & Modules + * Visit the [Wiki](https://github.com/expressjs/express/wiki) + * [Google Group](https://groups.google.com/group/express-js) for discussion + * [Gitter](https://gitter.im/expressjs/express) for support and discussion + * [Русскоязычная документация](http://jsman.ru/express/) + +**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x). + +###Security Issues + +If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md). + +## Quick Start + + The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below: + + Install the executable. The executable's major version will match Express's: + +```bash +$ npm install -g express-generator@4 +``` + + Create the app: + +```bash +$ express /tmp/foo && cd /tmp/foo +``` + + Install dependencies: + +```bash +$ npm install +``` + + Start the server: + +```bash +$ npm start +``` + +## Philosophy + + The Express philosophy is to provide small, robust tooling for HTTP servers, making + it a great solution for single page applications, web sites, hybrids, or public + HTTP APIs. + + Express does not force you to use any specific ORM or template engine. With support for over + 14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js), + you can quickly craft your perfect framework. + +## Examples + + To view the examples, clone the Express repo and install the dependencies: + +```bash +$ git clone git://github.com/expressjs/express.git --depth 1 +$ cd express +$ npm install +``` + + Then run whichever example you want: + +```bash +$ node examples/content-negotiation +``` + +## Tests + + To run the test suite, first install the dependencies, then run `npm test`: + +```bash +$ npm install +$ npm test +``` + +## People + +The original author of Express is [TJ Holowaychuk](https://github.com/tj) [![TJ's Gratipay][gratipay-image-visionmedia]][gratipay-url-visionmedia] + +The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson) [![Doug's Gratipay][gratipay-image-dougwilson]][gratipay-url-dougwilson] + +[List of all contributors](https://github.com/expressjs/express/graphs/contributors) + +## License + + [MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/express.svg +[npm-url]: https://npmjs.org/package/express +[downloads-image]: https://img.shields.io/npm/dm/express.svg +[downloads-url]: https://npmjs.org/package/express +[travis-image]: https://img.shields.io/travis/expressjs/express/master.svg?label=linux +[travis-url]: https://travis-ci.org/expressjs/express +[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express +[coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg +[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master +[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg +[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/ +[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg +[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/ diff --git a/node_modules/express/index.js b/node_modules/express/index.js new file mode 100755 index 00000000..d219b0c8 --- /dev/null +++ b/node_modules/express/index.js @@ -0,0 +1,11 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +module.exports = require('./lib/express'); diff --git a/node_modules/express/lib/application.js b/node_modules/express/lib/application.js new file mode 100755 index 00000000..21a81ee9 --- /dev/null +++ b/node_modules/express/lib/application.js @@ -0,0 +1,644 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var finalhandler = require('finalhandler'); +var Router = require('./router'); +var methods = require('methods'); +var middleware = require('./middleware/init'); +var query = require('./middleware/query'); +var debug = require('debug')('express:application'); +var View = require('./view'); +var http = require('http'); +var compileETag = require('./utils').compileETag; +var compileQueryParser = require('./utils').compileQueryParser; +var compileTrust = require('./utils').compileTrust; +var deprecate = require('depd')('express'); +var flatten = require('array-flatten'); +var merge = require('utils-merge'); +var resolve = require('path').resolve; +var setPrototyeOf = require('setprototypeof') +var slice = Array.prototype.slice; + +/** + * Application prototype. + */ + +var app = exports = module.exports = {}; + +/** + * Variable for trust proxy inheritance back-compat + * @private + */ + +var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default'; + +/** + * Initialize the server. + * + * - setup default configuration + * - setup default middleware + * - setup route reflection methods + * + * @private + */ + +app.init = function init() { + this.cache = {}; + this.engines = {}; + this.settings = {}; + + this.defaultConfiguration(); +}; + +/** + * Initialize application configuration. + * @private + */ + +app.defaultConfiguration = function defaultConfiguration() { + var env = process.env.NODE_ENV || 'development'; + + // default settings + this.enable('x-powered-by'); + this.set('etag', 'weak'); + this.set('env', env); + this.set('query parser', 'extended'); + this.set('subdomain offset', 2); + this.set('trust proxy', false); + + // trust proxy inherit back-compat + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: true + }); + + debug('booting in %s mode', env); + + this.on('mount', function onmount(parent) { + // inherit trust proxy + if (this.settings[trustProxyDefaultSymbol] === true + && typeof parent.settings['trust proxy fn'] === 'function') { + delete this.settings['trust proxy']; + delete this.settings['trust proxy fn']; + } + + // inherit protos + setPrototyeOf(this.request, parent.request) + setPrototyeOf(this.response, parent.response) + setPrototyeOf(this.engines, parent.engines) + setPrototyeOf(this.settings, parent.settings) + }); + + // setup locals + this.locals = Object.create(null); + + // top-most app is mounted at / + this.mountpath = '/'; + + // default locals + this.locals.settings = this.settings; + + // default configuration + this.set('view', View); + this.set('views', resolve('views')); + this.set('jsonp callback name', 'callback'); + + if (env === 'production') { + this.enable('view cache'); + } + + Object.defineProperty(this, 'router', { + get: function() { + throw new Error('\'app.router\' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.'); + } + }); +}; + +/** + * lazily adds the base router if it has not yet been added. + * + * We cannot add the base router in the defaultConfiguration because + * it reads app settings which might be set after that has run. + * + * @private + */ +app.lazyrouter = function lazyrouter() { + if (!this._router) { + this._router = new Router({ + caseSensitive: this.enabled('case sensitive routing'), + strict: this.enabled('strict routing') + }); + + this._router.use(query(this.get('query parser fn'))); + this._router.use(middleware.init(this)); + } +}; + +/** + * Dispatch a req, res pair into the application. Starts pipeline processing. + * + * If no callback is provided, then default error handlers will respond + * in the event of an error bubbling through the stack. + * + * @private + */ + +app.handle = function handle(req, res, callback) { + var router = this._router; + + // final handler + var done = callback || finalhandler(req, res, { + env: this.get('env'), + onerror: logerror.bind(this) + }); + + // no routes + if (!router) { + debug('no routes defined on app'); + done(); + return; + } + + router.handle(req, res, done); +}; + +/** + * Proxy `Router#use()` to add middleware to the app router. + * See Router#use() documentation for details. + * + * If the _fn_ parameter is an express app, then it will be + * mounted at the _route_ specified. + * + * @public + */ + +app.use = function use(fn) { + var offset = 0; + var path = '/'; + + // default path to '/' + // disambiguate app.use([fn]) + if (typeof fn !== 'function') { + var arg = fn; + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1; + path = fn; + } + } + + var fns = flatten(slice.call(arguments, offset)); + + if (fns.length === 0) { + throw new TypeError('app.use() requires middleware functions'); + } + + // setup router + this.lazyrouter(); + var router = this._router; + + fns.forEach(function (fn) { + // non-express app + if (!fn || !fn.handle || !fn.set) { + return router.use(path, fn); + } + + debug('.use app under %s', path); + fn.mountpath = path; + fn.parent = this; + + // restore .app property on req and res + router.use(path, function mounted_app(req, res, next) { + var orig = req.app; + fn.handle(req, res, function (err) { + setPrototyeOf(req, orig.request) + setPrototyeOf(res, orig.response) + next(err); + }); + }); + + // mounted an app + fn.emit('mount', this); + }, this); + + return this; +}; + +/** + * Proxy to the app `Router#route()` + * Returns a new `Route` instance for the _path_. + * + * Routes are isolated middleware stacks for specific paths. + * See the Route api docs for details. + * + * @public + */ + +app.route = function route(path) { + this.lazyrouter(); + return this._router.route(path); +}; + +/** + * Register the given template engine callback `fn` + * as `ext`. + * + * By default will `require()` the engine based on the + * file extension. For example if you try to render + * a "foo.ejs" file Express will invoke the following internally: + * + * app.engine('ejs', require('ejs').__express); + * + * For engines that do not provide `.__express` out of the box, + * or if you wish to "map" a different extension to the template engine + * you may use this method. For example mapping the EJS template engine to + * ".html" files: + * + * app.engine('html', require('ejs').renderFile); + * + * In this case EJS provides a `.renderFile()` method with + * the same signature that Express expects: `(path, options, callback)`, + * though note that it aliases this method as `ejs.__express` internally + * so if you're using ".ejs" extensions you dont need to do anything. + * + * Some template engines do not follow this convention, the + * [Consolidate.js](https://github.com/tj/consolidate.js) + * library was created to map all of node's popular template + * engines to follow this convention, thus allowing them to + * work seamlessly within Express. + * + * @param {String} ext + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +app.engine = function engine(ext, fn) { + if (typeof fn !== 'function') { + throw new Error('callback function required'); + } + + // get file extension + var extension = ext[0] !== '.' + ? '.' + ext + : ext; + + // store engine + this.engines[extension] = fn; + + return this; +}; + +/** + * Proxy to `Router#param()` with one added api feature. The _name_ parameter + * can be an array of names. + * + * See the Router#param() docs for more details. + * + * @param {String|Array} name + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +app.param = function param(name, fn) { + this.lazyrouter(); + + if (Array.isArray(name)) { + for (var i = 0; i < name.length; i++) { + this.param(name[i], fn); + } + + return this; + } + + this._router.param(name, fn); + + return this; +}; + +/** + * Assign `setting` to `val`, or return `setting`'s value. + * + * app.set('foo', 'bar'); + * app.get('foo'); + * // => "bar" + * + * Mounted servers inherit their parent server's settings. + * + * @param {String} setting + * @param {*} [val] + * @return {Server} for chaining + * @public + */ + +app.set = function set(setting, val) { + if (arguments.length === 1) { + // app.get(setting) + return this.settings[setting]; + } + + debug('set "%s" to %o', setting, val); + + // set value + this.settings[setting] = val; + + // trigger matched settings + switch (setting) { + case 'etag': + this.set('etag fn', compileETag(val)); + break; + case 'query parser': + this.set('query parser fn', compileQueryParser(val)); + break; + case 'trust proxy': + this.set('trust proxy fn', compileTrust(val)); + + // trust proxy inherit back-compat + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: false + }); + + break; + } + + return this; +}; + +/** + * Return the app's absolute pathname + * based on the parent(s) that have + * mounted it. + * + * For example if the application was + * mounted as "/admin", which itself + * was mounted as "/blog" then the + * return value would be "/blog/admin". + * + * @return {String} + * @private + */ + +app.path = function path() { + return this.parent + ? this.parent.path() + this.mountpath + : ''; +}; + +/** + * Check if `setting` is enabled (truthy). + * + * app.enabled('foo') + * // => false + * + * app.enable('foo') + * app.enabled('foo') + * // => true + * + * @param {String} setting + * @return {Boolean} + * @public + */ + +app.enabled = function enabled(setting) { + return Boolean(this.set(setting)); +}; + +/** + * Check if `setting` is disabled. + * + * app.disabled('foo') + * // => true + * + * app.enable('foo') + * app.disabled('foo') + * // => false + * + * @param {String} setting + * @return {Boolean} + * @public + */ + +app.disabled = function disabled(setting) { + return !this.set(setting); +}; + +/** + * Enable `setting`. + * + * @param {String} setting + * @return {app} for chaining + * @public + */ + +app.enable = function enable(setting) { + return this.set(setting, true); +}; + +/** + * Disable `setting`. + * + * @param {String} setting + * @return {app} for chaining + * @public + */ + +app.disable = function disable(setting) { + return this.set(setting, false); +}; + +/** + * Delegate `.VERB(...)` calls to `router.VERB(...)`. + */ + +methods.forEach(function(method){ + app[method] = function(path){ + if (method === 'get' && arguments.length === 1) { + // app.get(setting) + return this.set(path); + } + + this.lazyrouter(); + + var route = this._router.route(path); + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; +}); + +/** + * Special-cased "all" method, applying the given route `path`, + * middleware, and callback to _every_ HTTP method. + * + * @param {String} path + * @param {Function} ... + * @return {app} for chaining + * @public + */ + +app.all = function all(path) { + this.lazyrouter(); + + var route = this._router.route(path); + var args = slice.call(arguments, 1); + + for (var i = 0; i < methods.length; i++) { + route[methods[i]].apply(route, args); + } + + return this; +}; + +// del -> delete alias + +app.del = deprecate.function(app.delete, 'app.del: Use app.delete instead'); + +/** + * Render the given view `name` name with `options` + * and a callback accepting an error and the + * rendered template string. + * + * Example: + * + * app.render('email', { name: 'Tobi' }, function(err, html){ + * // ... + * }) + * + * @param {String} name + * @param {Object|Function} options or fn + * @param {Function} callback + * @public + */ + +app.render = function render(name, options, callback) { + var cache = this.cache; + var done = callback; + var engines = this.engines; + var opts = options; + var renderOptions = {}; + var view; + + // support callback function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // merge app.locals + merge(renderOptions, this.locals); + + // merge options._locals + if (opts._locals) { + merge(renderOptions, opts._locals); + } + + // merge options + merge(renderOptions, opts); + + // set .cache unless explicitly provided + if (renderOptions.cache == null) { + renderOptions.cache = this.enabled('view cache'); + } + + // primed cache + if (renderOptions.cache) { + view = cache[name]; + } + + // view + if (!view) { + var View = this.get('view'); + + view = new View(name, { + defaultEngine: this.get('view engine'), + root: this.get('views'), + engines: engines + }); + + if (!view.path) { + var dirs = Array.isArray(view.root) && view.root.length > 1 + ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"' + : 'directory "' + view.root + '"' + var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs); + err.view = view; + return done(err); + } + + // prime the cache + if (renderOptions.cache) { + cache[name] = view; + } + } + + // render + tryRender(view, renderOptions, done); +}; + +/** + * Listen for connections. + * + * A node `http.Server` is returned, with this + * application (which is a `Function`) as its + * callback. If you wish to create both an HTTP + * and HTTPS server you may do so with the "http" + * and "https" modules as shown here: + * + * var http = require('http') + * , https = require('https') + * , express = require('express') + * , app = express(); + * + * http.createServer(app).listen(80); + * https.createServer({ ... }, app).listen(443); + * + * @return {http.Server} + * @public + */ + +app.listen = function listen() { + var server = http.createServer(this); + return server.listen.apply(server, arguments); +}; + +/** + * Log error using console.error. + * + * @param {Error} err + * @private + */ + +function logerror(err) { + /* istanbul ignore next */ + if (this.get('env') !== 'test') console.error(err.stack || err.toString()); +} + +/** + * Try rendering a view. + * @private + */ + +function tryRender(view, options, callback) { + try { + view.render(options, callback); + } catch (err) { + callback(err); + } +} diff --git a/node_modules/express/lib/express.js b/node_modules/express/lib/express.js new file mode 100755 index 00000000..187e4e2d --- /dev/null +++ b/node_modules/express/lib/express.js @@ -0,0 +1,111 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var EventEmitter = require('events').EventEmitter; +var mixin = require('merge-descriptors'); +var proto = require('./application'); +var Route = require('./router/route'); +var Router = require('./router'); +var req = require('./request'); +var res = require('./response'); + +/** + * Expose `createApplication()`. + */ + +exports = module.exports = createApplication; + +/** + * Create an express application. + * + * @return {Function} + * @api public + */ + +function createApplication() { + var app = function(req, res, next) { + app.handle(req, res, next); + }; + + mixin(app, EventEmitter.prototype, false); + mixin(app, proto, false); + + // expose the prototype that will get set on requests + app.request = Object.create(req, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + + // expose the prototype that will get set on responses + app.response = Object.create(res, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + + app.init(); + return app; +} + +/** + * Expose the prototypes. + */ + +exports.application = proto; +exports.request = req; +exports.response = res; + +/** + * Expose constructors. + */ + +exports.Route = Route; +exports.Router = Router; + +/** + * Expose middleware + */ + +exports.query = require('./middleware/query'); +exports.static = require('serve-static'); + +/** + * Replace removed middleware with an appropriate error message. + */ + +[ + 'json', + 'urlencoded', + 'bodyParser', + 'compress', + 'cookieSession', + 'session', + 'logger', + 'cookieParser', + 'favicon', + 'responseTime', + 'errorHandler', + 'timeout', + 'methodOverride', + 'vhost', + 'csrf', + 'directory', + 'limit', + 'multipart', + 'staticCache', +].forEach(function (name) { + Object.defineProperty(exports, name, { + get: function () { + throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.'); + }, + configurable: true + }); +}); diff --git a/node_modules/express/lib/middleware/init.js b/node_modules/express/lib/middleware/init.js new file mode 100755 index 00000000..328c4a86 --- /dev/null +++ b/node_modules/express/lib/middleware/init.js @@ -0,0 +1,43 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var setPrototyeOf = require('setprototypeof') + +/** + * Initialization middleware, exposing the + * request and response to each other, as well + * as defaulting the X-Powered-By header field. + * + * @param {Function} app + * @return {Function} + * @api private + */ + +exports.init = function(app){ + return function expressInit(req, res, next){ + if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express'); + req.res = res; + res.req = req; + req.next = next; + + setPrototyeOf(req, app.request) + setPrototyeOf(res, app.response) + + res.locals = res.locals || Object.create(null); + + next(); + }; +}; + diff --git a/node_modules/express/lib/middleware/query.js b/node_modules/express/lib/middleware/query.js new file mode 100755 index 00000000..5f76f845 --- /dev/null +++ b/node_modules/express/lib/middleware/query.js @@ -0,0 +1,46 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var parseUrl = require('parseurl'); +var qs = require('qs'); + +/** + * @param {Object} options + * @return {Function} + * @api public + */ + +module.exports = function query(options) { + var opts = Object.create(options || null); + var queryparse = qs.parse; + + if (typeof options === 'function') { + queryparse = options; + opts = undefined; + } + + if (opts !== undefined && opts.allowPrototypes === undefined) { + // back-compat for qs module + opts.allowPrototypes = true; + } + + return function query(req, res, next){ + if (!req.query) { + var val = parseUrl(req).query; + req.query = queryparse(val, opts); + } + + next(); + }; +}; diff --git a/node_modules/express/lib/request.js b/node_modules/express/lib/request.js new file mode 100755 index 00000000..3432e677 --- /dev/null +++ b/node_modules/express/lib/request.js @@ -0,0 +1,517 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var accepts = require('accepts'); +var deprecate = require('depd')('express'); +var isIP = require('net').isIP; +var typeis = require('type-is'); +var http = require('http'); +var fresh = require('fresh'); +var parseRange = require('range-parser'); +var parse = require('parseurl'); +var proxyaddr = require('proxy-addr'); + +/** + * Request prototype. + * @public + */ + +var req = Object.create(http.IncomingMessage.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = req + +/** + * Return request header. + * + * The `Referrer` header field is special-cased, + * both `Referrer` and `Referer` are interchangeable. + * + * Examples: + * + * req.get('Content-Type'); + * // => "text/plain" + * + * req.get('content-type'); + * // => "text/plain" + * + * req.get('Something'); + * // => undefined + * + * Aliased as `req.header()`. + * + * @param {String} name + * @return {String} + * @public + */ + +req.get = +req.header = function header(name) { + if (!name) { + throw new TypeError('name argument is required to req.get'); + } + + if (typeof name !== 'string') { + throw new TypeError('name must be a string to req.get'); + } + + var lc = name.toLowerCase(); + + switch (lc) { + case 'referer': + case 'referrer': + return this.headers.referrer + || this.headers.referer; + default: + return this.headers[lc]; + } +}; + +/** + * To do: update docs. + * + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single MIME type string + * such as "application/json", an extension name + * such as "json", a comma-delimited list such as "json, html, text/plain", + * an argument list such as `"json", "html", "text/plain"`, + * or an array `["json", "html", "text/plain"]`. When a list + * or array is given, the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * req.accepts('html'); + * // => "html" + * + * // Accept: text/*, application/json + * req.accepts('html'); + * // => "html" + * req.accepts('text/html'); + * // => "text/html" + * req.accepts('json, text'); + * // => "json" + * req.accepts('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * req.accepts('image/png'); + * req.accepts('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * req.accepts(['html', 'json']); + * req.accepts('html', 'json'); + * req.accepts('html, json'); + * // => "json" + * + * @param {String|Array} type(s) + * @return {String|Array|Boolean} + * @public + */ + +req.accepts = function(){ + var accept = accepts(this); + return accept.types.apply(accept, arguments); +}; + +/** + * Check if the given `encoding`s are accepted. + * + * @param {String} ...encoding + * @return {String|Array} + * @public + */ + +req.acceptsEncodings = function(){ + var accept = accepts(this); + return accept.encodings.apply(accept, arguments); +}; + +req.acceptsEncoding = deprecate.function(req.acceptsEncodings, + 'req.acceptsEncoding: Use acceptsEncodings instead'); + +/** + * Check if the given `charset`s are acceptable, + * otherwise you should respond with 406 "Not Acceptable". + * + * @param {String} ...charset + * @return {String|Array} + * @public + */ + +req.acceptsCharsets = function(){ + var accept = accepts(this); + return accept.charsets.apply(accept, arguments); +}; + +req.acceptsCharset = deprecate.function(req.acceptsCharsets, + 'req.acceptsCharset: Use acceptsCharsets instead'); + +/** + * Check if the given `lang`s are acceptable, + * otherwise you should respond with 406 "Not Acceptable". + * + * @param {String} ...lang + * @return {String|Array} + * @public + */ + +req.acceptsLanguages = function(){ + var accept = accepts(this); + return accept.languages.apply(accept, arguments); +}; + +req.acceptsLanguage = deprecate.function(req.acceptsLanguages, + 'req.acceptsLanguage: Use acceptsLanguages instead'); + +/** + * Parse Range header field, capping to the given `size`. + * + * Unspecified ranges such as "0-" require knowledge of your resource length. In + * the case of a byte range this is of course the total number of bytes. If the + * Range header field is not given `undefined` is returned, `-1` when unsatisfiable, + * and `-2` when syntactically invalid. + * + * When ranges are returned, the array has a "type" property which is the type of + * range that is required (most commonly, "bytes"). Each array element is an object + * with a "start" and "end" property for the portion of the range. + * + * The "combine" option can be set to `true` and overlapping & adjacent ranges + * will be combined into a single range. + * + * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" + * should respond with 4 users when available, not 3. + * + * @param {number} size + * @param {object} [options] + * @param {boolean} [options.combine=false] + * @return {number|array} + * @public + */ + +req.range = function range(size, options) { + var range = this.get('Range'); + if (!range) return; + return parseRange(size, range, options); +}; + +/** + * Return the value of param `name` when present or `defaultValue`. + * + * - Checks route placeholders, ex: _/user/:id_ + * - Checks body params, ex: id=12, {"id":12} + * - Checks query string params, ex: ?id=12 + * + * To utilize request bodies, `req.body` + * should be an object. This can be done by using + * the `bodyParser()` middleware. + * + * @param {String} name + * @param {Mixed} [defaultValue] + * @return {String} + * @public + */ + +req.param = function param(name, defaultValue) { + var params = this.params || {}; + var body = this.body || {}; + var query = this.query || {}; + + var args = arguments.length === 1 + ? 'name' + : 'name, default'; + deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead'); + + if (null != params[name] && params.hasOwnProperty(name)) return params[name]; + if (null != body[name]) return body[name]; + if (null != query[name]) return query[name]; + + return defaultValue; +}; + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains the give mime `type`. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * req.is('html'); + * req.is('text/html'); + * req.is('text/*'); + * // => true + * + * // When Content-Type is application/json + * req.is('json'); + * req.is('application/json'); + * req.is('application/*'); + * // => true + * + * req.is('html'); + * // => false + * + * @param {String|Array} types... + * @return {String|false|null} + * @public + */ + +req.is = function is(types) { + var arr = types; + + // support flattened arguments + if (!Array.isArray(types)) { + arr = new Array(arguments.length); + for (var i = 0; i < arr.length; i++) { + arr[i] = arguments[i]; + } + } + + return typeis(this, arr); +}; + +/** + * Return the protocol string "http" or "https" + * when requested with TLS. When the "trust proxy" + * setting trusts the socket address, the + * "X-Forwarded-Proto" header field will be trusted + * and used if present. + * + * If you're running behind a reverse proxy that + * supplies https for you this may be enabled. + * + * @return {String} + * @public + */ + +defineGetter(req, 'protocol', function protocol(){ + var proto = this.connection.encrypted + ? 'https' + : 'http'; + var trust = this.app.get('trust proxy fn'); + + if (!trust(this.connection.remoteAddress, 0)) { + return proto; + } + + // Note: X-Forwarded-Proto is normally only ever a + // single value, but this is to be safe. + proto = this.get('X-Forwarded-Proto') || proto; + return proto.split(/\s*,\s*/)[0]; +}); + +/** + * Short-hand for: + * + * req.protocol === 'https' + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'secure', function secure(){ + return this.protocol === 'https'; +}); + +/** + * Return the remote address from the trusted proxy. + * + * The is the remote address on the socket unless + * "trust proxy" is set. + * + * @return {String} + * @public + */ + +defineGetter(req, 'ip', function ip(){ + var trust = this.app.get('trust proxy fn'); + return proxyaddr(this, trust); +}); + +/** + * When "trust proxy" is set, trusted proxy addresses + client. + * + * For example if the value were "client, proxy1, proxy2" + * you would receive the array `["client", "proxy1", "proxy2"]` + * where "proxy2" is the furthest down-stream and "proxy1" and + * "proxy2" were trusted. + * + * @return {Array} + * @public + */ + +defineGetter(req, 'ips', function ips() { + var trust = this.app.get('trust proxy fn'); + var addrs = proxyaddr.all(this, trust); + + // reverse the order (to farthest -> closest) + // and remove socket address + addrs.reverse().pop() + + return addrs +}); + +/** + * Return subdomains as an array. + * + * Subdomains are the dot-separated parts of the host before the main domain of + * the app. By default, the domain of the app is assumed to be the last two + * parts of the host. This can be changed by setting "subdomain offset". + * + * For example, if the domain is "tobi.ferrets.example.com": + * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. + * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. + * + * @return {Array} + * @public + */ + +defineGetter(req, 'subdomains', function subdomains() { + var hostname = this.hostname; + + if (!hostname) return []; + + var offset = this.app.get('subdomain offset'); + var subdomains = !isIP(hostname) + ? hostname.split('.').reverse() + : [hostname]; + + return subdomains.slice(offset); +}); + +/** + * Short-hand for `url.parse(req.url).pathname`. + * + * @return {String} + * @public + */ + +defineGetter(req, 'path', function path() { + return parse(this).pathname; +}); + +/** + * Parse the "Host" header field to a hostname. + * + * When the "trust proxy" setting trusts the socket + * address, the "X-Forwarded-Host" header field will + * be trusted. + * + * @return {String} + * @public + */ + +defineGetter(req, 'hostname', function hostname(){ + var trust = this.app.get('trust proxy fn'); + var host = this.get('X-Forwarded-Host'); + + if (!host || !trust(this.connection.remoteAddress, 0)) { + host = this.get('Host'); + } + + if (!host) return; + + // IPv6 literal support + var offset = host[0] === '[' + ? host.indexOf(']') + 1 + : 0; + var index = host.indexOf(':', offset); + + return index !== -1 + ? host.substring(0, index) + : host; +}); + +// TODO: change req.host to return host in next major + +defineGetter(req, 'host', deprecate.function(function host(){ + return this.hostname; +}, 'req.host: Use req.hostname instead')); + +/** + * Check if the request is fresh, aka + * Last-Modified and/or the ETag + * still match. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'fresh', function(){ + var method = this.method; + var res = this.res + var status = res.statusCode + + // GET or HEAD for weak freshness validation only + if ('GET' !== method && 'HEAD' !== method) return false; + + // 2xx or 304 as per rfc2616 14.26 + if ((status >= 200 && status < 300) || 304 === status) { + return fresh(this.headers, { + 'etag': res.get('ETag'), + 'last-modified': res.get('Last-Modified') + }) + } + + return false; +}); + +/** + * Check if the request is stale, aka + * "Last-Modified" and / or the "ETag" for the + * resource has changed. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'stale', function stale(){ + return !this.fresh; +}); + +/** + * Check if the request was an _XMLHttpRequest_. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'xhr', function xhr(){ + var val = this.get('X-Requested-With') || ''; + return val.toLowerCase() === 'xmlhttprequest'; +}); + +/** + * Helper function for creating a getter on an object. + * + * @param {Object} obj + * @param {String} name + * @param {Function} getter + * @private + */ +function defineGetter(obj, name, getter) { + Object.defineProperty(obj, name, { + configurable: true, + enumerable: true, + get: getter + }); +} diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js new file mode 100755 index 00000000..6aefe1b1 --- /dev/null +++ b/node_modules/express/lib/response.js @@ -0,0 +1,1071 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var contentDisposition = require('content-disposition'); +var deprecate = require('depd')('express'); +var encodeUrl = require('encodeurl'); +var escapeHtml = require('escape-html'); +var http = require('http'); +var isAbsolute = require('./utils').isAbsolute; +var onFinished = require('on-finished'); +var path = require('path'); +var statuses = require('statuses') +var merge = require('utils-merge'); +var sign = require('cookie-signature').sign; +var normalizeType = require('./utils').normalizeType; +var normalizeTypes = require('./utils').normalizeTypes; +var setCharset = require('./utils').setCharset; +var cookie = require('cookie'); +var send = require('send'); +var extname = path.extname; +var mime = send.mime; +var resolve = path.resolve; +var vary = require('vary'); + +/** + * Response prototype. + * @public + */ + +var res = Object.create(http.ServerResponse.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = res + +/** + * Module variables. + * @private + */ + +var charsetRegExp = /;\s*charset\s*=/; + +/** + * Set status `code`. + * + * @param {Number} code + * @return {ServerResponse} + * @public + */ + +res.status = function status(code) { + this.statusCode = code; + return this; +}; + +/** + * Set Link header field with the given `links`. + * + * Examples: + * + * res.links({ + * next: 'http://api.example.com/users?page=2', + * last: 'http://api.example.com/users?page=5' + * }); + * + * @param {Object} links + * @return {ServerResponse} + * @public + */ + +res.links = function(links){ + var link = this.get('Link') || ''; + if (link) link += ', '; + return this.set('Link', link + Object.keys(links).map(function(rel){ + return '<' + links[rel] + '>; rel="' + rel + '"'; + }).join(', ')); +}; + +/** + * Send a response. + * + * Examples: + * + * res.send(new Buffer('wahoo')); + * res.send({ some: 'json' }); + * res.send('

some html

'); + * + * @param {string|number|boolean|object|Buffer} body + * @public + */ + +res.send = function send(body) { + var chunk = body; + var encoding; + var len; + var req = this.req; + var type; + + // settings + var app = this.app; + + // allow status / body + if (arguments.length === 2) { + // res.send(body, status) backwards compat + if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') { + deprecate('res.send(body, status): Use res.status(status).send(body) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.send(status, body): Use res.status(status).send(body) instead'); + this.statusCode = arguments[0]; + chunk = arguments[1]; + } + } + + // disambiguate res.send(status) and res.send(status, num) + if (typeof chunk === 'number' && arguments.length === 1) { + // res.send(status) will set status message as text string + if (!this.get('Content-Type')) { + this.type('txt'); + } + + deprecate('res.send(status): Use res.sendStatus(status) instead'); + this.statusCode = chunk; + chunk = statuses[chunk] + } + + switch (typeof chunk) { + // string defaulting to html + case 'string': + if (!this.get('Content-Type')) { + this.type('html'); + } + break; + case 'boolean': + case 'number': + case 'object': + if (chunk === null) { + chunk = ''; + } else if (Buffer.isBuffer(chunk)) { + if (!this.get('Content-Type')) { + this.type('bin'); + } + } else { + return this.json(chunk); + } + break; + } + + // write strings in utf-8 + if (typeof chunk === 'string') { + encoding = 'utf8'; + type = this.get('Content-Type'); + + // reflect this in content-type + if (typeof type === 'string') { + this.set('Content-Type', setCharset(type, 'utf-8')); + } + } + + // populate Content-Length + if (chunk !== undefined) { + if (!Buffer.isBuffer(chunk)) { + // convert chunk to Buffer; saves later double conversions + chunk = new Buffer(chunk, encoding); + encoding = undefined; + } + + len = chunk.length; + this.set('Content-Length', len); + } + + // populate ETag + var etag; + var generateETag = len !== undefined && app.get('etag fn'); + if (typeof generateETag === 'function' && !this.get('ETag')) { + if ((etag = generateETag(chunk, encoding))) { + this.set('ETag', etag); + } + } + + // freshness + if (req.fresh) this.statusCode = 304; + + // strip irrelevant headers + if (204 === this.statusCode || 304 === this.statusCode) { + this.removeHeader('Content-Type'); + this.removeHeader('Content-Length'); + this.removeHeader('Transfer-Encoding'); + chunk = ''; + } + + if (req.method === 'HEAD') { + // skip body for HEAD + this.end(); + } else { + // respond + this.end(chunk, encoding); + } + + return this; +}; + +/** + * Send JSON response. + * + * Examples: + * + * res.json(null); + * res.json({ user: 'tj' }); + * + * @param {string|number|boolean|object} obj + * @public + */ + +res.json = function json(obj) { + var val = obj; + + // allow status / body + if (arguments.length === 2) { + // res.json(body, status) backwards compat + if (typeof arguments[1] === 'number') { + deprecate('res.json(obj, status): Use res.status(status).json(obj) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.json(status, obj): Use res.status(status).json(obj) instead'); + this.statusCode = arguments[0]; + val = arguments[1]; + } + } + + // settings + var app = this.app; + var replacer = app.get('json replacer'); + var spaces = app.get('json spaces'); + var body = stringify(val, replacer, spaces); + + // content-type + if (!this.get('Content-Type')) { + this.set('Content-Type', 'application/json'); + } + + return this.send(body); +}; + +/** + * Send JSON response with JSONP callback support. + * + * Examples: + * + * res.jsonp(null); + * res.jsonp({ user: 'tj' }); + * + * @param {string|number|boolean|object} obj + * @public + */ + +res.jsonp = function jsonp(obj) { + var val = obj; + + // allow status / body + if (arguments.length === 2) { + // res.json(body, status) backwards compat + if (typeof arguments[1] === 'number') { + deprecate('res.jsonp(obj, status): Use res.status(status).json(obj) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead'); + this.statusCode = arguments[0]; + val = arguments[1]; + } + } + + // settings + var app = this.app; + var replacer = app.get('json replacer'); + var spaces = app.get('json spaces'); + var body = stringify(val, replacer, spaces); + var callback = this.req.query[app.get('jsonp callback name')]; + + // content-type + if (!this.get('Content-Type')) { + this.set('X-Content-Type-Options', 'nosniff'); + this.set('Content-Type', 'application/json'); + } + + // fixup callback + if (Array.isArray(callback)) { + callback = callback[0]; + } + + // jsonp + if (typeof callback === 'string' && callback.length !== 0) { + this.charset = 'utf-8'; + this.set('X-Content-Type-Options', 'nosniff'); + this.set('Content-Type', 'text/javascript'); + + // restrict callback charset + callback = callback.replace(/[^\[\]\w$.]/g, ''); + + // replace chars not allowed in JavaScript that are in JSON + body = body + .replace(/\u2028/g, '\\u2028') + .replace(/\u2029/g, '\\u2029'); + + // the /**/ is a specific security mitigation for "Rosetta Flash JSONP abuse" + // the typeof check is just to reduce client error noise + body = '/**/ typeof ' + callback + ' === \'function\' && ' + callback + '(' + body + ');'; + } + + return this.send(body); +}; + +/** + * Send given HTTP status code. + * + * Sets the response status to `statusCode` and the body of the + * response to the standard description from node's http.STATUS_CODES + * or the statusCode number if no description. + * + * Examples: + * + * res.sendStatus(200); + * + * @param {number} statusCode + * @public + */ + +res.sendStatus = function sendStatus(statusCode) { + var body = statuses[statusCode] || String(statusCode) + + this.statusCode = statusCode; + this.type('txt'); + + return this.send(body); +}; + +/** + * Transfer the file at the given `path`. + * + * Automatically sets the _Content-Type_ response header field. + * The callback `callback(err)` is invoked when the transfer is complete + * or when an error occurs. Be sure to check `res.sentHeader` + * if you wish to attempt responding, as the header and some data + * may have already been transferred. + * + * Options: + * + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. + * + * Examples: + * + * The following example illustrates how `res.sendFile()` may + * be used as an alternative for the `static()` middleware for + * dynamic situations. The code backing `res.sendFile()` is actually + * the same code, so HTTP cache support etc is identical. + * + * app.get('/user/:uid/photos/:file', function(req, res){ + * var uid = req.params.uid + * , file = req.params.file; + * + * req.user.mayViewFilesFrom(uid, function(yes){ + * if (yes) { + * res.sendFile('/uploads/' + uid + '/' + file); + * } else { + * res.send(403, 'Sorry! you cant see that.'); + * } + * }); + * }); + * + * @public + */ + +res.sendFile = function sendFile(path, options, callback) { + var done = callback; + var req = this.req; + var res = this; + var next = req.next; + var opts = options || {}; + + if (!path) { + throw new TypeError('path argument is required to res.sendFile'); + } + + // support function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + if (!opts.root && !isAbsolute(path)) { + throw new TypeError('path must be absolute or specify root to res.sendFile'); + } + + // create file stream + var pathname = encodeURI(path); + var file = send(req, pathname, opts); + + // transfer + sendfile(res, file, opts, function (err) { + if (done) return done(err); + if (err && err.code === 'EISDIR') return next(); + + // next() all but write errors + if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') { + next(err); + } + }); +}; + +/** + * Transfer the file at the given `path`. + * + * Automatically sets the _Content-Type_ response header field. + * The callback `callback(err)` is invoked when the transfer is complete + * or when an error occurs. Be sure to check `res.sentHeader` + * if you wish to attempt responding, as the header and some data + * may have already been transferred. + * + * Options: + * + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. + * + * Examples: + * + * The following example illustrates how `res.sendfile()` may + * be used as an alternative for the `static()` middleware for + * dynamic situations. The code backing `res.sendfile()` is actually + * the same code, so HTTP cache support etc is identical. + * + * app.get('/user/:uid/photos/:file', function(req, res){ + * var uid = req.params.uid + * , file = req.params.file; + * + * req.user.mayViewFilesFrom(uid, function(yes){ + * if (yes) { + * res.sendfile('/uploads/' + uid + '/' + file); + * } else { + * res.send(403, 'Sorry! you cant see that.'); + * } + * }); + * }); + * + * @public + */ + +res.sendfile = function (path, options, callback) { + var done = callback; + var req = this.req; + var res = this; + var next = req.next; + var opts = options || {}; + + // support function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // create file stream + var file = send(req, path, opts); + + // transfer + sendfile(res, file, opts, function (err) { + if (done) return done(err); + if (err && err.code === 'EISDIR') return next(); + + // next() all but write errors + if (err && err.code !== 'ECONNABORT' && err.syscall !== 'write') { + next(err); + } + }); +}; + +res.sendfile = deprecate.function(res.sendfile, + 'res.sendfile: Use res.sendFile instead'); + +/** + * Transfer the file at the given `path` as an attachment. + * + * Optionally providing an alternate attachment `filename`, + * and optional callback `callback(err)`. The callback is invoked + * when the data transfer is complete, or when an error has + * ocurred. Be sure to check `res.headersSent` if you plan to respond. + * + * This method uses `res.sendfile()`. + * + * @public + */ + +res.download = function download(path, filename, callback) { + var done = callback; + var name = filename; + + // support function as second arg + if (typeof filename === 'function') { + done = filename; + name = null; + } + + // set Content-Disposition when file is sent + var headers = { + 'Content-Disposition': contentDisposition(name || path) + }; + + // Resolve the full path for sendFile + var fullPath = resolve(path); + + return this.sendFile(fullPath, { headers: headers }, done); +}; + +/** + * Set _Content-Type_ response header with `type` through `mime.lookup()` + * when it does not contain "/", or set the Content-Type to `type` otherwise. + * + * Examples: + * + * res.type('.html'); + * res.type('html'); + * res.type('json'); + * res.type('application/json'); + * res.type('png'); + * + * @param {String} type + * @return {ServerResponse} for chaining + * @public + */ + +res.contentType = +res.type = function contentType(type) { + var ct = type.indexOf('/') === -1 + ? mime.lookup(type) + : type; + + return this.set('Content-Type', ct); +}; + +/** + * Respond to the Acceptable formats using an `obj` + * of mime-type callbacks. + * + * This method uses `req.accepted`, an array of + * acceptable types ordered by their quality values. + * When "Accept" is not present the _first_ callback + * is invoked, otherwise the first match is used. When + * no match is performed the server responds with + * 406 "Not Acceptable". + * + * Content-Type is set for you, however if you choose + * you may alter this within the callback using `res.type()` + * or `res.set('Content-Type', ...)`. + * + * res.format({ + * 'text/plain': function(){ + * res.send('hey'); + * }, + * + * 'text/html': function(){ + * res.send('

hey

'); + * }, + * + * 'appliation/json': function(){ + * res.send({ message: 'hey' }); + * } + * }); + * + * In addition to canonicalized MIME types you may + * also use extnames mapped to these types: + * + * res.format({ + * text: function(){ + * res.send('hey'); + * }, + * + * html: function(){ + * res.send('

hey

'); + * }, + * + * json: function(){ + * res.send({ message: 'hey' }); + * } + * }); + * + * By default Express passes an `Error` + * with a `.status` of 406 to `next(err)` + * if a match is not made. If you provide + * a `.default` callback it will be invoked + * instead. + * + * @param {Object} obj + * @return {ServerResponse} for chaining + * @public + */ + +res.format = function(obj){ + var req = this.req; + var next = req.next; + + var fn = obj.default; + if (fn) delete obj.default; + var keys = Object.keys(obj); + + var key = keys.length > 0 + ? req.accepts(keys) + : false; + + this.vary("Accept"); + + if (key) { + this.set('Content-Type', normalizeType(key).value); + obj[key](req, this, next); + } else if (fn) { + fn(); + } else { + var err = new Error('Not Acceptable'); + err.status = err.statusCode = 406; + err.types = normalizeTypes(keys).map(function(o){ return o.value }); + next(err); + } + + return this; +}; + +/** + * Set _Content-Disposition_ header to _attachment_ with optional `filename`. + * + * @param {String} filename + * @return {ServerResponse} + * @public + */ + +res.attachment = function attachment(filename) { + if (filename) { + this.type(extname(filename)); + } + + this.set('Content-Disposition', contentDisposition(filename)); + + return this; +}; + +/** + * Append additional header `field` with value `val`. + * + * Example: + * + * res.append('Link', ['', '']); + * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly'); + * res.append('Warning', '199 Miscellaneous warning'); + * + * @param {String} field + * @param {String|Array} val + * @return {ServerResponse} for chaining + * @public + */ + +res.append = function append(field, val) { + var prev = this.get(field); + var value = val; + + if (prev) { + // concat the new and prev vals + value = Array.isArray(prev) ? prev.concat(val) + : Array.isArray(val) ? [prev].concat(val) + : [prev, val]; + } + + return this.set(field, value); +}; + +/** + * Set header `field` to `val`, or pass + * an object of header fields. + * + * Examples: + * + * res.set('Foo', ['bar', 'baz']); + * res.set('Accept', 'application/json'); + * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); + * + * Aliased as `res.header()`. + * + * @param {String|Object} field + * @param {String|Array} val + * @return {ServerResponse} for chaining + * @public + */ + +res.set = +res.header = function header(field, val) { + if (arguments.length === 2) { + var value = Array.isArray(val) + ? val.map(String) + : String(val); + + // add charset to content-type + if (field.toLowerCase() === 'content-type' && !charsetRegExp.test(value)) { + var charset = mime.charsets.lookup(value.split(';')[0]); + if (charset) value += '; charset=' + charset.toLowerCase(); + } + + this.setHeader(field, value); + } else { + for (var key in field) { + this.set(key, field[key]); + } + } + return this; +}; + +/** + * Get value for header `field`. + * + * @param {String} field + * @return {String} + * @public + */ + +res.get = function(field){ + return this.getHeader(field); +}; + +/** + * Clear cookie `name`. + * + * @param {String} name + * @param {Object} [options] + * @return {ServerResponse} for chaining + * @public + */ + +res.clearCookie = function clearCookie(name, options) { + var opts = merge({ expires: new Date(1), path: '/' }, options); + + return this.cookie(name, '', opts); +}; + +/** + * Set cookie `name` to `value`, with the given `options`. + * + * Options: + * + * - `maxAge` max-age in milliseconds, converted to `expires` + * - `signed` sign the cookie + * - `path` defaults to "/" + * + * Examples: + * + * // "Remember Me" for 15 minutes + * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); + * + * // save as above + * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) + * + * @param {String} name + * @param {String|Object} value + * @param {Options} options + * @return {ServerResponse} for chaining + * @public + */ + +res.cookie = function (name, value, options) { + var opts = merge({}, options); + var secret = this.req.secret; + var signed = opts.signed; + + if (signed && !secret) { + throw new Error('cookieParser("secret") required for signed cookies'); + } + + var val = typeof value === 'object' + ? 'j:' + JSON.stringify(value) + : String(value); + + if (signed) { + val = 's:' + sign(val, secret); + } + + if ('maxAge' in opts) { + opts.expires = new Date(Date.now() + opts.maxAge); + opts.maxAge /= 1000; + } + + if (opts.path == null) { + opts.path = '/'; + } + + this.append('Set-Cookie', cookie.serialize(name, String(val), opts)); + + return this; +}; + +/** + * Set the location header to `url`. + * + * The given `url` can also be "back", which redirects + * to the _Referrer_ or _Referer_ headers or "/". + * + * Examples: + * + * res.location('/foo/bar').; + * res.location('http://example.com'); + * res.location('../login'); + * + * @param {String} url + * @return {ServerResponse} for chaining + * @public + */ + +res.location = function location(url) { + var loc = url; + + // "back" is an alias for the referrer + if (url === 'back') { + loc = this.req.get('Referrer') || '/'; + } + + // set location + return this.set('Location', encodeUrl(loc)); +}; + +/** + * Redirect to the given `url` with optional response `status` + * defaulting to 302. + * + * The resulting `url` is determined by `res.location()`, so + * it will play nicely with mounted apps, relative paths, + * `"back"` etc. + * + * Examples: + * + * res.redirect('/foo/bar'); + * res.redirect('http://example.com'); + * res.redirect(301, 'http://example.com'); + * res.redirect('../login'); // /blog/post/1 -> /blog/login + * + * @public + */ + +res.redirect = function redirect(url) { + var address = url; + var body; + var status = 302; + + // allow status / url + if (arguments.length === 2) { + if (typeof arguments[0] === 'number') { + status = arguments[0]; + address = arguments[1]; + } else { + deprecate('res.redirect(url, status): Use res.redirect(status, url) instead'); + status = arguments[1]; + } + } + + // Set location header + address = this.location(address).get('Location'); + + // Support text/{plain,html} by default + this.format({ + text: function(){ + body = statuses[status] + '. Redirecting to ' + address + }, + + html: function(){ + var u = escapeHtml(address); + body = '

' + statuses[status] + '. Redirecting to ' + u + '

' + }, + + default: function(){ + body = ''; + } + }); + + // Respond + this.statusCode = status; + this.set('Content-Length', Buffer.byteLength(body)); + + if (this.req.method === 'HEAD') { + this.end(); + } else { + this.end(body); + } +}; + +/** + * Add `field` to Vary. If already present in the Vary set, then + * this call is simply ignored. + * + * @param {Array|String} field + * @return {ServerResponse} for chaining + * @public + */ + +res.vary = function(field){ + // checks for back-compat + if (!field || (Array.isArray(field) && !field.length)) { + deprecate('res.vary(): Provide a field name'); + return this; + } + + vary(this, field); + + return this; +}; + +/** + * Render `view` with the given `options` and optional callback `fn`. + * When a callback function is given a response will _not_ be made + * automatically, otherwise a response of _200_ and _text/html_ is given. + * + * Options: + * + * - `cache` boolean hinting to the engine it should cache + * - `filename` filename of the view being rendered + * + * @public + */ + +res.render = function render(view, options, callback) { + var app = this.req.app; + var done = callback; + var opts = options || {}; + var req = this.req; + var self = this; + + // support callback function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // merge res.locals + opts._locals = self.locals; + + // default callback to respond + done = done || function (err, str) { + if (err) return req.next(err); + self.send(str); + }; + + // render + app.render(view, opts, done); +}; + +// pipe the send file stream +function sendfile(res, file, options, callback) { + var done = false; + var streaming; + + // request aborted + function onaborted() { + if (done) return; + done = true; + + var err = new Error('Request aborted'); + err.code = 'ECONNABORTED'; + callback(err); + } + + // directory + function ondirectory() { + if (done) return; + done = true; + + var err = new Error('EISDIR, read'); + err.code = 'EISDIR'; + callback(err); + } + + // errors + function onerror(err) { + if (done) return; + done = true; + callback(err); + } + + // ended + function onend() { + if (done) return; + done = true; + callback(); + } + + // file + function onfile() { + streaming = false; + } + + // finished + function onfinish(err) { + if (err && err.code === 'ECONNRESET') return onaborted(); + if (err) return onerror(err); + if (done) return; + + setImmediate(function () { + if (streaming !== false && !done) { + onaborted(); + return; + } + + if (done) return; + done = true; + callback(); + }); + } + + // streaming + function onstream() { + streaming = true; + } + + file.on('directory', ondirectory); + file.on('end', onend); + file.on('error', onerror); + file.on('file', onfile); + file.on('stream', onstream); + onFinished(res, onfinish); + + if (options.headers) { + // set headers on successful transfer + file.on('headers', function headers(res) { + var obj = options.headers; + var keys = Object.keys(obj); + + for (var i = 0; i < keys.length; i++) { + var k = keys[i]; + res.setHeader(k, obj[k]); + } + }); + } + + // pipe + file.pipe(res); +} + +/** + * Stringify JSON, like JSON.stringify, but v8 optimized. + * @private + */ + +function stringify(value, replacer, spaces) { + // v8 checks arguments.length for optimizing simple call + // https://bugs.chromium.org/p/v8/issues/detail?id=4730 + return replacer || spaces + ? JSON.stringify(value, replacer, spaces) + : JSON.stringify(value); +} diff --git a/node_modules/express/lib/router/index.js b/node_modules/express/lib/router/index.js new file mode 100755 index 00000000..51db4c28 --- /dev/null +++ b/node_modules/express/lib/router/index.js @@ -0,0 +1,662 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var Route = require('./route'); +var Layer = require('./layer'); +var methods = require('methods'); +var mixin = require('utils-merge'); +var debug = require('debug')('express:router'); +var deprecate = require('depd')('express'); +var flatten = require('array-flatten'); +var parseUrl = require('parseurl'); +var setPrototypeOf = require('setprototypeof') + +/** + * Module variables. + * @private + */ + +var objectRegExp = /^\[object (\S+)\]$/; +var slice = Array.prototype.slice; +var toString = Object.prototype.toString; + +/** + * Initialize a new `Router` with the given `options`. + * + * @param {Object} options + * @return {Router} which is an callable function + * @public + */ + +var proto = module.exports = function(options) { + var opts = options || {}; + + function router(req, res, next) { + router.handle(req, res, next); + } + + // mixin Router class functions + setPrototypeOf(router, proto) + + router.params = {}; + router._params = []; + router.caseSensitive = opts.caseSensitive; + router.mergeParams = opts.mergeParams; + router.strict = opts.strict; + router.stack = []; + + return router; +}; + +/** + * Map the given param placeholder `name`(s) to the given callback. + * + * Parameter mapping is used to provide pre-conditions to routes + * which use normalized placeholders. For example a _:user_id_ parameter + * could automatically load a user's information from the database without + * any additional code, + * + * The callback uses the same signature as middleware, the only difference + * being that the value of the placeholder is passed, in this case the _id_ + * of the user. Once the `next()` function is invoked, just like middleware + * it will continue on to execute the route, or subsequent parameter functions. + * + * Just like in middleware, you must either respond to the request or call next + * to avoid stalling the request. + * + * app.param('user_id', function(req, res, next, id){ + * User.find(id, function(err, user){ + * if (err) { + * return next(err); + * } else if (!user) { + * return next(new Error('failed to load user')); + * } + * req.user = user; + * next(); + * }); + * }); + * + * @param {String} name + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +proto.param = function param(name, fn) { + // param logic + if (typeof name === 'function') { + deprecate('router.param(fn): Refactor to use path params'); + this._params.push(name); + return; + } + + // apply param functions + var params = this._params; + var len = params.length; + var ret; + + if (name[0] === ':') { + deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.substr(1)) + ', fn) instead'); + name = name.substr(1); + } + + for (var i = 0; i < len; ++i) { + if (ret = params[i](name, fn)) { + fn = ret; + } + } + + // ensure we end up with a + // middleware function + if ('function' !== typeof fn) { + throw new Error('invalid param() call for ' + name + ', got ' + fn); + } + + (this.params[name] = this.params[name] || []).push(fn); + return this; +}; + +/** + * Dispatch a req, res into the router. + * @private + */ + +proto.handle = function handle(req, res, out) { + var self = this; + + debug('dispatching %s %s', req.method, req.url); + + var idx = 0; + var protohost = getProtohost(req.url) || '' + var removed = ''; + var slashAdded = false; + var paramcalled = {}; + + // store options for OPTIONS request + // only used if OPTIONS request + var options = []; + + // middleware and routes + var stack = self.stack; + + // manage inter-router variables + var parentParams = req.params; + var parentUrl = req.baseUrl || ''; + var done = restore(out, req, 'baseUrl', 'next', 'params'); + + // setup next layer + req.next = next; + + // for options requests, respond with a default if nothing else responds + if (req.method === 'OPTIONS') { + done = wrap(done, function(old, err) { + if (err || options.length === 0) return old(err); + sendOptionsResponse(res, options, old); + }); + } + + // setup basic req values + req.baseUrl = parentUrl; + req.originalUrl = req.originalUrl || req.url; + + next(); + + function next(err) { + var layerError = err === 'route' + ? null + : err; + + // remove added slash + if (slashAdded) { + req.url = req.url.substr(1); + slashAdded = false; + } + + // restore altered req.url + if (removed.length !== 0) { + req.baseUrl = parentUrl; + req.url = protohost + removed + req.url.substr(protohost.length); + removed = ''; + } + + // signal to exit router + if (layerError === 'router') { + setImmediate(done, null) + return + } + + // no more matching layers + if (idx >= stack.length) { + setImmediate(done, layerError); + return; + } + + // get pathname of request + var path = getPathname(req); + + if (path == null) { + return done(layerError); + } + + // find next matching layer + var layer; + var match; + var route; + + while (match !== true && idx < stack.length) { + layer = stack[idx++]; + match = matchLayer(layer, path); + route = layer.route; + + if (typeof match !== 'boolean') { + // hold on to layerError + layerError = layerError || match; + } + + if (match !== true) { + continue; + } + + if (!route) { + // process non-route handlers normally + continue; + } + + if (layerError) { + // routes do not match with a pending error + match = false; + continue; + } + + var method = req.method; + var has_method = route._handles_method(method); + + // build up automatic options response + if (!has_method && method === 'OPTIONS') { + appendMethods(options, route._options()); + } + + // don't even bother matching route + if (!has_method && method !== 'HEAD') { + match = false; + continue; + } + } + + // no match + if (match !== true) { + return done(layerError); + } + + // store route for dispatch on change + if (route) { + req.route = route; + } + + // Capture one-time layer values + req.params = self.mergeParams + ? mergeParams(layer.params, parentParams) + : layer.params; + var layerPath = layer.path; + + // this should be done for the layer + self.process_params(layer, paramcalled, req, res, function (err) { + if (err) { + return next(layerError || err); + } + + if (route) { + return layer.handle_request(req, res, next); + } + + trim_prefix(layer, layerError, layerPath, path); + }); + } + + function trim_prefix(layer, layerError, layerPath, path) { + if (layerPath.length !== 0) { + // Validate path breaks on a path separator + var c = path[layerPath.length] + if (c && c !== '/' && c !== '.') return next(layerError) + + // Trim off the part of the url that matches the route + // middleware (.use stuff) needs to have the path stripped + debug('trim prefix (%s) from url %s', layerPath, req.url); + removed = layerPath; + req.url = protohost + req.url.substr(protohost.length + removed.length); + + // Ensure leading slash + if (!protohost && req.url[0] !== '/') { + req.url = '/' + req.url; + slashAdded = true; + } + + // Setup base URL (no trailing slash) + req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' + ? removed.substring(0, removed.length - 1) + : removed); + } + + debug('%s %s : %s', layer.name, layerPath, req.originalUrl); + + if (layerError) { + layer.handle_error(layerError, req, res, next); + } else { + layer.handle_request(req, res, next); + } + } +}; + +/** + * Process any parameters for the layer. + * @private + */ + +proto.process_params = function process_params(layer, called, req, res, done) { + var params = this.params; + + // captured parameters from the layer, keys and values + var keys = layer.keys; + + // fast track + if (!keys || keys.length === 0) { + return done(); + } + + var i = 0; + var name; + var paramIndex = 0; + var key; + var paramVal; + var paramCallbacks; + var paramCalled; + + // process params in order + // param callbacks can be async + function param(err) { + if (err) { + return done(err); + } + + if (i >= keys.length ) { + return done(); + } + + paramIndex = 0; + key = keys[i++]; + name = key.name; + paramVal = req.params[name]; + paramCallbacks = params[name]; + paramCalled = called[name]; + + if (paramVal === undefined || !paramCallbacks) { + return param(); + } + + // param previously called with same value or error occurred + if (paramCalled && (paramCalled.match === paramVal + || (paramCalled.error && paramCalled.error !== 'route'))) { + // restore value + req.params[name] = paramCalled.value; + + // next param + return param(paramCalled.error); + } + + called[name] = paramCalled = { + error: null, + match: paramVal, + value: paramVal + }; + + paramCallback(); + } + + // single param callbacks + function paramCallback(err) { + var fn = paramCallbacks[paramIndex++]; + + // store updated value + paramCalled.value = req.params[key.name]; + + if (err) { + // store error + paramCalled.error = err; + param(err); + return; + } + + if (!fn) return param(); + + try { + fn(req, res, paramCallback, paramVal, key.name); + } catch (e) { + paramCallback(e); + } + } + + param(); +}; + +/** + * Use the given middleware function, with optional path, defaulting to "/". + * + * Use (like `.all`) will run for any http METHOD, but it will not add + * handlers for those methods so OPTIONS requests will not consider `.use` + * functions even if they could respond. + * + * The other difference is that _route_ path is stripped and not visible + * to the handler function. The main effect of this feature is that mounted + * handlers can operate without any code changes regardless of the "prefix" + * pathname. + * + * @public + */ + +proto.use = function use(fn) { + var offset = 0; + var path = '/'; + + // default path to '/' + // disambiguate router.use([fn]) + if (typeof fn !== 'function') { + var arg = fn; + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1; + path = fn; + } + } + + var callbacks = flatten(slice.call(arguments, offset)); + + if (callbacks.length === 0) { + throw new TypeError('Router.use() requires middleware functions'); + } + + for (var i = 0; i < callbacks.length; i++) { + var fn = callbacks[i]; + + if (typeof fn !== 'function') { + throw new TypeError('Router.use() requires middleware function but got a ' + gettype(fn)); + } + + // add the middleware + debug('use %o %s', path, fn.name || '') + + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: false, + end: false + }, fn); + + layer.route = undefined; + + this.stack.push(layer); + } + + return this; +}; + +/** + * Create a new Route for the given path. + * + * Each route contains a separate middleware stack and VERB handlers. + * + * See the Route api documentation for details on adding handlers + * and middleware to routes. + * + * @param {String} path + * @return {Route} + * @public + */ + +proto.route = function route(path) { + var route = new Route(path); + + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: this.strict, + end: true + }, route.dispatch.bind(route)); + + layer.route = route; + + this.stack.push(layer); + return route; +}; + +// create Router#VERB functions +methods.concat('all').forEach(function(method){ + proto[method] = function(path){ + var route = this.route(path) + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; +}); + +// append methods to a list of methods +function appendMethods(list, addition) { + for (var i = 0; i < addition.length; i++) { + var method = addition[i]; + if (list.indexOf(method) === -1) { + list.push(method); + } + } +} + +// get pathname of request +function getPathname(req) { + try { + return parseUrl(req).pathname; + } catch (err) { + return undefined; + } +} + +// Get get protocol + host for a URL +function getProtohost(url) { + if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { + return undefined + } + + var searchIndex = url.indexOf('?') + var pathLength = searchIndex !== -1 + ? searchIndex + : url.length + var fqdnIndex = url.substr(0, pathLength).indexOf('://') + + return fqdnIndex !== -1 + ? url.substr(0, url.indexOf('/', 3 + fqdnIndex)) + : undefined +} + +// get type for error message +function gettype(obj) { + var type = typeof obj; + + if (type !== 'object') { + return type; + } + + // inspect [[Class]] for objects + return toString.call(obj) + .replace(objectRegExp, '$1'); +} + +/** + * Match path to a layer. + * + * @param {Layer} layer + * @param {string} path + * @private + */ + +function matchLayer(layer, path) { + try { + return layer.match(path); + } catch (err) { + return err; + } +} + +// merge params with parent params +function mergeParams(params, parent) { + if (typeof parent !== 'object' || !parent) { + return params; + } + + // make copy of parent for base + var obj = mixin({}, parent); + + // simple non-numeric merging + if (!(0 in params) || !(0 in parent)) { + return mixin(obj, params); + } + + var i = 0; + var o = 0; + + // determine numeric gaps + while (i in params) { + i++; + } + + while (o in parent) { + o++; + } + + // offset numeric indices in params before merge + for (i--; i >= 0; i--) { + params[i + o] = params[i]; + + // create holes for the merge when necessary + if (i < o) { + delete params[i]; + } + } + + return mixin(obj, params); +} + +// restore obj props after function +function restore(fn, obj) { + var props = new Array(arguments.length - 2); + var vals = new Array(arguments.length - 2); + + for (var i = 0; i < props.length; i++) { + props[i] = arguments[i + 2]; + vals[i] = obj[props[i]]; + } + + return function () { + // restore vals + for (var i = 0; i < props.length; i++) { + obj[props[i]] = vals[i]; + } + + return fn.apply(this, arguments); + }; +} + +// send an OPTIONS response +function sendOptionsResponse(res, options, next) { + try { + var body = options.join(','); + res.set('Allow', body); + res.send(body); + } catch (err) { + next(err); + } +} + +// wrap a function +function wrap(old, fn) { + return function proxy() { + var args = new Array(arguments.length + 1); + + args[0] = old; + for (var i = 0, len = arguments.length; i < len; i++) { + args[i + 1] = arguments[i]; + } + + fn.apply(this, args); + }; +} diff --git a/node_modules/express/lib/router/layer.js b/node_modules/express/lib/router/layer.js new file mode 100755 index 00000000..4dc8e86d --- /dev/null +++ b/node_modules/express/lib/router/layer.js @@ -0,0 +1,181 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var pathRegexp = require('path-to-regexp'); +var debug = require('debug')('express:router:layer'); + +/** + * Module variables. + * @private + */ + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * Module exports. + * @public + */ + +module.exports = Layer; + +function Layer(path, options, fn) { + if (!(this instanceof Layer)) { + return new Layer(path, options, fn); + } + + debug('new %o', path) + var opts = options || {}; + + this.handle = fn; + this.name = fn.name || ''; + this.params = undefined; + this.path = undefined; + this.regexp = pathRegexp(path, this.keys = [], opts); + + // set fast path flags + this.regexp.fast_star = path === '*' + this.regexp.fast_slash = path === '/' && opts.end === false +} + +/** + * Handle the error for the layer. + * + * @param {Error} error + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handle_error = function handle_error(error, req, res, next) { + var fn = this.handle; + + if (fn.length !== 4) { + // not a standard error handler + return next(error); + } + + try { + fn(error, req, res, next); + } catch (err) { + next(err); + } +}; + +/** + * Handle the request for the layer. + * + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handle_request = function handle(req, res, next) { + var fn = this.handle; + + if (fn.length > 3) { + // not a standard request handler + return next(); + } + + try { + fn(req, res, next); + } catch (err) { + next(err); + } +}; + +/** + * Check if this route matches `path`, if so + * populate `.params`. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +Layer.prototype.match = function match(path) { + var match + + if (path != null) { + // fast path non-ending match for / (any path matches) + if (this.regexp.fast_slash) { + this.params = {} + this.path = '' + return true + } + + // fast path for * (everything matched in a param) + if (this.regexp.fast_star) { + this.params = {'0': decode_param(path)} + this.path = path + return true + } + + // match the path + match = this.regexp.exec(path) + } + + if (!match) { + this.params = undefined; + this.path = undefined; + return false; + } + + // store values + this.params = {}; + this.path = match[0] + + var keys = this.keys; + var params = this.params; + + for (var i = 1; i < match.length; i++) { + var key = keys[i - 1]; + var prop = key.name; + var val = decode_param(match[i]) + + if (val !== undefined || !(hasOwnProperty.call(params, prop))) { + params[prop] = val; + } + } + + return true; +}; + +/** + * Decode param value. + * + * @param {string} val + * @return {string} + * @private + */ + +function decode_param(val) { + if (typeof val !== 'string' || val.length === 0) { + return val; + } + + try { + return decodeURIComponent(val); + } catch (err) { + if (err instanceof URIError) { + err.message = 'Failed to decode param \'' + val + '\''; + err.status = err.statusCode = 400; + } + + throw err; + } +} diff --git a/node_modules/express/lib/router/route.js b/node_modules/express/lib/router/route.js new file mode 100755 index 00000000..ea82ed29 --- /dev/null +++ b/node_modules/express/lib/router/route.js @@ -0,0 +1,216 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('express:router:route'); +var flatten = require('array-flatten'); +var Layer = require('./layer'); +var methods = require('methods'); + +/** + * Module variables. + * @private + */ + +var slice = Array.prototype.slice; +var toString = Object.prototype.toString; + +/** + * Module exports. + * @public + */ + +module.exports = Route; + +/** + * Initialize `Route` with the given `path`, + * + * @param {String} path + * @public + */ + +function Route(path) { + this.path = path; + this.stack = []; + + debug('new %o', path) + + // route handlers for various http methods + this.methods = {}; +} + +/** + * Determine if the route handles a given method. + * @private + */ + +Route.prototype._handles_method = function _handles_method(method) { + if (this.methods._all) { + return true; + } + + var name = method.toLowerCase(); + + if (name === 'head' && !this.methods['head']) { + name = 'get'; + } + + return Boolean(this.methods[name]); +}; + +/** + * @return {Array} supported HTTP methods + * @private + */ + +Route.prototype._options = function _options() { + var methods = Object.keys(this.methods); + + // append automatic head + if (this.methods.get && !this.methods.head) { + methods.push('head'); + } + + for (var i = 0; i < methods.length; i++) { + // make upper case + methods[i] = methods[i].toUpperCase(); + } + + return methods; +}; + +/** + * dispatch req, res into this route + * @private + */ + +Route.prototype.dispatch = function dispatch(req, res, done) { + var idx = 0; + var stack = this.stack; + if (stack.length === 0) { + return done(); + } + + var method = req.method.toLowerCase(); + if (method === 'head' && !this.methods['head']) { + method = 'get'; + } + + req.route = this; + + next(); + + function next(err) { + // signal to exit route + if (err && err === 'route') { + return done(); + } + + // signal to exit router + if (err && err === 'router') { + return done(err) + } + + var layer = stack[idx++]; + if (!layer) { + return done(err); + } + + if (layer.method && layer.method !== method) { + return next(err); + } + + if (err) { + layer.handle_error(err, req, res, next); + } else { + layer.handle_request(req, res, next); + } + } +}; + +/** + * Add a handler for all HTTP verbs to this route. + * + * Behaves just like middleware and can respond or call `next` + * to continue processing. + * + * You can use multiple `.all` call to add multiple handlers. + * + * function check_something(req, res, next){ + * next(); + * }; + * + * function validate_user(req, res, next){ + * next(); + * }; + * + * route + * .all(validate_user) + * .all(check_something) + * .get(function(req, res, next){ + * res.send('hello world'); + * }); + * + * @param {function} handler + * @return {Route} for chaining + * @api public + */ + +Route.prototype.all = function all() { + var handles = flatten(slice.call(arguments)); + + for (var i = 0; i < handles.length; i++) { + var handle = handles[i]; + + if (typeof handle !== 'function') { + var type = toString.call(handle); + var msg = 'Route.all() requires callback functions but got a ' + type; + throw new TypeError(msg); + } + + var layer = Layer('/', {}, handle); + layer.method = undefined; + + this.methods._all = true; + this.stack.push(layer); + } + + return this; +}; + +methods.forEach(function(method){ + Route.prototype[method] = function(){ + var handles = flatten(slice.call(arguments)); + + for (var i = 0; i < handles.length; i++) { + var handle = handles[i]; + + if (typeof handle !== 'function') { + var type = toString.call(handle); + var msg = 'Route.' + method + '() requires callback functions but got a ' + type; + throw new Error(msg); + } + + debug('%s %o', method, this.path) + + var layer = Layer('/', {}, handle); + layer.method = method; + + this.methods[method] = true; + this.stack.push(layer); + } + + return this; + }; +}); diff --git a/node_modules/express/lib/utils.js b/node_modules/express/lib/utils.js new file mode 100755 index 00000000..f418c580 --- /dev/null +++ b/node_modules/express/lib/utils.js @@ -0,0 +1,299 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @api private + */ + +var contentDisposition = require('content-disposition'); +var contentType = require('content-type'); +var deprecate = require('depd')('express'); +var flatten = require('array-flatten'); +var mime = require('send').mime; +var basename = require('path').basename; +var etag = require('etag'); +var proxyaddr = require('proxy-addr'); +var qs = require('qs'); +var querystring = require('querystring'); + +/** + * Return strong ETag for `body`. + * + * @param {String|Buffer} body + * @param {String} [encoding] + * @return {String} + * @api private + */ + +exports.etag = function (body, encoding) { + var buf = !Buffer.isBuffer(body) + ? new Buffer(body, encoding) + : body; + + return etag(buf, {weak: false}); +}; + +/** + * Return weak ETag for `body`. + * + * @param {String|Buffer} body + * @param {String} [encoding] + * @return {String} + * @api private + */ + +exports.wetag = function wetag(body, encoding){ + var buf = !Buffer.isBuffer(body) + ? new Buffer(body, encoding) + : body; + + return etag(buf, {weak: true}); +}; + +/** + * Check if `path` looks absolute. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +exports.isAbsolute = function(path){ + if ('/' === path[0]) return true; + if (':' === path[1] && ('\\' === path[2] || '/' === path[2])) return true; // Windows device path + if ('\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path +}; + +/** + * Flatten the given `arr`. + * + * @param {Array} arr + * @return {Array} + * @api private + */ + +exports.flatten = deprecate.function(flatten, + 'utils.flatten: use array-flatten npm module instead'); + +/** + * Normalize the given `type`, for example "html" becomes "text/html". + * + * @param {String} type + * @return {Object} + * @api private + */ + +exports.normalizeType = function(type){ + return ~type.indexOf('/') + ? acceptParams(type) + : { value: mime.lookup(type), params: {} }; +}; + +/** + * Normalize `types`, for example "html" becomes "text/html". + * + * @param {Array} types + * @return {Array} + * @api private + */ + +exports.normalizeTypes = function(types){ + var ret = []; + + for (var i = 0; i < types.length; ++i) { + ret.push(exports.normalizeType(types[i])); + } + + return ret; +}; + +/** + * Generate Content-Disposition header appropriate for the filename. + * non-ascii filenames are urlencoded and a filename* parameter is added + * + * @param {String} filename + * @return {String} + * @api private + */ + +exports.contentDisposition = deprecate.function(contentDisposition, + 'utils.contentDisposition: use content-disposition npm module instead'); + +/** + * Parse accept params `str` returning an + * object with `.value`, `.quality` and `.params`. + * also includes `.originalIndex` for stable sorting + * + * @param {String} str + * @return {Object} + * @api private + */ + +function acceptParams(str, index) { + var parts = str.split(/ *; */); + var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index }; + + for (var i = 1; i < parts.length; ++i) { + var pms = parts[i].split(/ *= */); + if ('q' === pms[0]) { + ret.quality = parseFloat(pms[1]); + } else { + ret.params[pms[0]] = pms[1]; + } + } + + return ret; +} + +/** + * Compile "etag" value to function. + * + * @param {Boolean|String|Function} val + * @return {Function} + * @api private + */ + +exports.compileETag = function(val) { + var fn; + + if (typeof val === 'function') { + return val; + } + + switch (val) { + case true: + fn = exports.wetag; + break; + case false: + break; + case 'strong': + fn = exports.etag; + break; + case 'weak': + fn = exports.wetag; + break; + default: + throw new TypeError('unknown value for etag function: ' + val); + } + + return fn; +} + +/** + * Compile "query parser" value to function. + * + * @param {String|Function} val + * @return {Function} + * @api private + */ + +exports.compileQueryParser = function compileQueryParser(val) { + var fn; + + if (typeof val === 'function') { + return val; + } + + switch (val) { + case true: + fn = querystring.parse; + break; + case false: + fn = newObject; + break; + case 'extended': + fn = parseExtendedQueryString; + break; + case 'simple': + fn = querystring.parse; + break; + default: + throw new TypeError('unknown value for query parser function: ' + val); + } + + return fn; +} + +/** + * Compile "proxy trust" value to function. + * + * @param {Boolean|String|Number|Array|Function} val + * @return {Function} + * @api private + */ + +exports.compileTrust = function(val) { + if (typeof val === 'function') return val; + + if (val === true) { + // Support plain true/false + return function(){ return true }; + } + + if (typeof val === 'number') { + // Support trusting hop count + return function(a, i){ return i < val }; + } + + if (typeof val === 'string') { + // Support comma-separated values + val = val.split(/ *, */); + } + + return proxyaddr.compile(val || []); +} + +/** + * Set the charset in a given Content-Type string. + * + * @param {String} type + * @param {String} charset + * @return {String} + * @api private + */ + +exports.setCharset = function setCharset(type, charset) { + if (!type || !charset) { + return type; + } + + // parse type + var parsed = contentType.parse(type); + + // set charset + parsed.parameters.charset = charset; + + // format type + return contentType.format(parsed); +}; + +/** + * Parse an extended query string with qs. + * + * @return {Object} + * @private + */ + +function parseExtendedQueryString(str) { + return qs.parse(str, { + allowPrototypes: true + }); +} + +/** + * Return new empty object. + * + * @return {Object} + * @api private + */ + +function newObject() { + return {}; +} diff --git a/node_modules/express/lib/view.js b/node_modules/express/lib/view.js new file mode 100755 index 00000000..1728725d --- /dev/null +++ b/node_modules/express/lib/view.js @@ -0,0 +1,175 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('express:view'); +var path = require('path'); +var fs = require('fs'); +var utils = require('./utils'); + +/** + * Module variables. + * @private + */ + +var dirname = path.dirname; +var basename = path.basename; +var extname = path.extname; +var join = path.join; +var resolve = path.resolve; + +/** + * Module exports. + * @public + */ + +module.exports = View; + +/** + * Initialize a new `View` with the given `name`. + * + * Options: + * + * - `defaultEngine` the default template engine name + * - `engines` template engine require() cache + * - `root` root path for view lookup + * + * @param {string} name + * @param {object} options + * @public + */ + +function View(name, options) { + var opts = options || {}; + + this.defaultEngine = opts.defaultEngine; + this.ext = extname(name); + this.name = name; + this.root = opts.root; + + if (!this.ext && !this.defaultEngine) { + throw new Error('No default engine was specified and no extension was provided.'); + } + + var fileName = name; + + if (!this.ext) { + // get extension from default engine name + this.ext = this.defaultEngine[0] !== '.' + ? '.' + this.defaultEngine + : this.defaultEngine; + + fileName += this.ext; + } + + if (!opts.engines[this.ext]) { + // load engine + var mod = this.ext.substr(1) + debug('require "%s"', mod) + opts.engines[this.ext] = require(mod).__express + } + + // store loaded engine + this.engine = opts.engines[this.ext]; + + // lookup path + this.path = this.lookup(fileName); +} + +/** + * Lookup view by the given `name` + * + * @param {string} name + * @private + */ + +View.prototype.lookup = function lookup(name) { + var path; + var roots = [].concat(this.root); + + debug('lookup "%s"', name); + + for (var i = 0; i < roots.length && !path; i++) { + var root = roots[i]; + + // resolve the path + var loc = resolve(root, name); + var dir = dirname(loc); + var file = basename(loc); + + // resolve the file + path = this.resolve(dir, file); + } + + return path; +}; + +/** + * Render with the given options. + * + * @param {object} options + * @param {function} callback + * @private + */ + +View.prototype.render = function render(options, callback) { + debug('render "%s"', this.path); + this.engine(this.path, options, callback); +}; + +/** + * Resolve the file within the given directory. + * + * @param {string} dir + * @param {string} file + * @private + */ + +View.prototype.resolve = function resolve(dir, file) { + var ext = this.ext; + + // . + var path = join(dir, file); + var stat = tryStat(path); + + if (stat && stat.isFile()) { + return path; + } + + // /index. + path = join(dir, basename(file, ext), 'index' + ext); + stat = tryStat(path); + + if (stat && stat.isFile()) { + return path; + } +}; + +/** + * Return a stat, maybe. + * + * @param {string} path + * @return {fs.Stats} + * @private + */ + +function tryStat(path) { + debug('stat "%s"', path); + + try { + return fs.statSync(path); + } catch (e) { + return undefined; + } +} diff --git a/node_modules/express/node_modules/debug/.coveralls.yml b/node_modules/express/node_modules/debug/.coveralls.yml new file mode 100755 index 00000000..20a70685 --- /dev/null +++ b/node_modules/express/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/express/node_modules/debug/.eslintrc b/node_modules/express/node_modules/debug/.eslintrc new file mode 100755 index 00000000..8a37ae2c --- /dev/null +++ b/node_modules/express/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/express/node_modules/debug/.npmignore b/node_modules/express/node_modules/debug/.npmignore new file mode 100755 index 00000000..db2fbb9d --- /dev/null +++ b/node_modules/express/node_modules/debug/.npmignore @@ -0,0 +1,8 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage diff --git a/node_modules/express/node_modules/debug/.travis.yml b/node_modules/express/node_modules/debug/.travis.yml new file mode 100755 index 00000000..6c6090c3 --- /dev/null +++ b/node_modules/express/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/express/node_modules/debug/CHANGELOG.md b/node_modules/express/node_modules/debug/CHANGELOG.md new file mode 100755 index 00000000..99abf97f --- /dev/null +++ b/node_modules/express/node_modules/debug/CHANGELOG.md @@ -0,0 +1,316 @@ +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/express/node_modules/debug/LICENSE b/node_modules/express/node_modules/debug/LICENSE new file mode 100755 index 00000000..658c933d --- /dev/null +++ b/node_modules/express/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/express/node_modules/debug/Makefile b/node_modules/express/node_modules/debug/Makefile new file mode 100755 index 00000000..584da8bf --- /dev/null +++ b/node_modules/express/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/express/node_modules/debug/README.md b/node_modules/express/node_modules/debug/README.md new file mode 100755 index 00000000..2c57ddfa --- /dev/null +++ b/node_modules/express/node_modules/debug/README.md @@ -0,0 +1,238 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disabled specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/express/node_modules/debug/bower.json b/node_modules/express/node_modules/debug/bower.json new file mode 100755 index 00000000..027804ce --- /dev/null +++ b/node_modules/express/node_modules/debug/bower.json @@ -0,0 +1,29 @@ +{ + "name": "visionmedia-debug", + "main": "./src/browser.js", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/express/node_modules/debug/component.json b/node_modules/express/node_modules/debug/component.json new file mode 100755 index 00000000..4861027d --- /dev/null +++ b/node_modules/express/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.1", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/express/node_modules/debug/karma.conf.js b/node_modules/express/node_modules/debug/karma.conf.js new file mode 100755 index 00000000..103a82d1 --- /dev/null +++ b/node_modules/express/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/express/node_modules/debug/node.js b/node_modules/express/node_modules/debug/node.js new file mode 100755 index 00000000..7fc36fe6 --- /dev/null +++ b/node_modules/express/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/express/node_modules/debug/package.json b/node_modules/express/node_modules/debug/package.json new file mode 100755 index 00000000..70b4f00e --- /dev/null +++ b/node_modules/express/node_modules/debug/package.json @@ -0,0 +1,124 @@ +{ + "_args": [ + [ + { + "raw": "debug@2.6.1", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "2.6.1", + "spec": "2.6.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "debug@2.6.1", + "_id": "debug@2.6.1", + "_inCache": true, + "_location": "/express/debug", + "_nodeVersion": "6.9.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/debug-2.6.1.tgz_1486753226738_0.07569954148493707" + }, + "_npmUser": { + "name": "thebigredgeek", + "email": "rhyneandrew@gmail.com" + }, + "_npmVersion": "4.0.3", + "_phantomChildren": {}, + "_requested": { + "raw": "debug@2.6.1", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "2.6.1", + "spec": "2.6.1", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz", + "_shasum": "79855090ba2c4e3115cc7d8769491d58f0491351", + "_shrinkwrap": null, + "_spec": "debug@2.6.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "0.7.2" + }, + "description": "small debugging utility", + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "directories": {}, + "dist": { + "shasum": "79855090ba2c4e3115cc7d8769491d58f0491351", + "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.1.tgz" + }, + "gitHead": "941653e3334e9e3e2cca87cad9bbf6c5cb245215", + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "maintainers": [ + { + "name": "thebigredgeek", + "email": "rhyneandrew@gmail.com" + } + ], + "name": "debug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "scripts": {}, + "version": "2.6.1" +} diff --git a/node_modules/express/node_modules/debug/src/browser.js b/node_modules/express/node_modules/debug/src/browser.js new file mode 100755 index 00000000..38d6391e --- /dev/null +++ b/node_modules/express/node_modules/debug/src/browser.js @@ -0,0 +1,182 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + try { + return exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (typeof process !== 'undefined' && 'env' in process) { + return process.env.DEBUG; + } +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/express/node_modules/debug/src/debug.js b/node_modules/express/node_modules/debug/src/debug.js new file mode 100755 index 00000000..d5d6d167 --- /dev/null +++ b/node_modules/express/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/express/node_modules/debug/src/index.js b/node_modules/express/node_modules/debug/src/index.js new file mode 100755 index 00000000..e12cf4d5 --- /dev/null +++ b/node_modules/express/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/express/node_modules/debug/src/node.js b/node_modules/express/node_modules/debug/src/node.js new file mode 100755 index 00000000..4fa564b0 --- /dev/null +++ b/node_modules/express/node_modules/debug/src/node.js @@ -0,0 +1,241 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = util._extend({}, exports.inspectOpts); +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/express/package.json b/node_modules/express/package.json new file mode 100755 index 00000000..1c5e39e0 --- /dev/null +++ b/node_modules/express/package.json @@ -0,0 +1,199 @@ +{ + "_args": [ + [ + { + "raw": "express@^4.13.3", + "scope": null, + "escapedName": "express", + "name": "express", + "rawSpec": "^4.13.3", + "spec": ">=4.13.3 <5.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server" + ] + ], + "_from": "express@>=4.13.3 <5.0.0", + "_id": "express@4.15.2", + "_inCache": true, + "_location": "/express", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/express-4.15.2.tgz_1488807764132_0.2808149973861873" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": { + "ms": "0.7.2" + }, + "_requested": { + "raw": "express@^4.13.3", + "scope": null, + "escapedName": "express", + "name": "express", + "rawSpec": "^4.13.3", + "spec": ">=4.13.3 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack-dev-server" + ], + "_resolved": "https://registry.npmjs.org/express/-/express-4.15.2.tgz", + "_shasum": "af107fc148504457f2dca9a6f2571d7129b97b35", + "_shrinkwrap": null, + "_spec": "express@^4.13.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bugs": { + "url": "https://github.com/expressjs/express/issues" + }, + "contributors": [ + { + "name": "Aaron Heckmann", + "email": "aaron.heckmann+github@gmail.com" + }, + { + "name": "Ciaran Jessup", + "email": "ciaranj@gmail.com" + }, + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Guillermo Rauch", + "email": "rauchg@gmail.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com" + }, + { + "name": "Roman Shtylman", + "email": "shtylman+expressjs@gmail.com" + }, + { + "name": "Young Jae Sim", + "email": "hanul@hanul.me" + } + ], + "dependencies": { + "accepts": "~1.3.3", + "array-flatten": "1.1.1", + "content-disposition": "0.5.2", + "content-type": "~1.0.2", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.1", + "depd": "~1.1.0", + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "etag": "~1.8.0", + "finalhandler": "~1.0.0", + "fresh": "0.5.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.1", + "path-to-regexp": "0.1.7", + "proxy-addr": "~1.1.3", + "qs": "6.4.0", + "range-parser": "~1.2.0", + "send": "0.15.1", + "serve-static": "1.12.1", + "setprototypeof": "1.0.3", + "statuses": "~1.3.1", + "type-is": "~1.6.14", + "utils-merge": "1.0.0", + "vary": "~1.1.0" + }, + "description": "Fast, unopinionated, minimalist web framework", + "devDependencies": { + "after": "0.8.2", + "body-parser": "1.17.1", + "connect-redis": "~2.4.1", + "cookie-parser": "~1.4.3", + "cookie-session": "~1.2.0", + "ejs": "2.5.6", + "express-session": "1.15.1", + "istanbul": "0.4.5", + "jade": "~1.11.0", + "marked": "0.3.6", + "method-override": "2.3.7", + "mocha": "3.2.0", + "morgan": "1.8.1", + "multiparty": "4.1.3", + "pbkdf2-password": "1.2.1", + "should": "11.2.0", + "supertest": "1.2.0", + "vhost": "~3.0.2" + }, + "directories": {}, + "dist": { + "shasum": "af107fc148504457f2dca9a6f2571d7129b97b35", + "tarball": "https://registry.npmjs.org/express/-/express-4.15.2.tgz" + }, + "engines": { + "node": ">= 0.10.0" + }, + "files": [ + "LICENSE", + "History.md", + "Readme.md", + "index.js", + "lib/" + ], + "gitHead": "d43b074f0b3b56a91f240e62798c932ba104b79a", + "homepage": "http://expressjs.com/", + "keywords": [ + "express", + "framework", + "sinatra", + "web", + "rest", + "restful", + "router", + "app", + "api" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "hacksparrow", + "email": "captain@hacksparrow.com" + }, + { + "name": "jasnell", + "email": "jasnell@gmail.com" + }, + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + } + ], + "name": "express", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/expressjs/express.git" + }, + "scripts": { + "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/", + "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" + }, + "version": "4.15.2" +} diff --git a/node_modules/extglob/LICENSE b/node_modules/extglob/LICENSE new file mode 100755 index 00000000..65f90aca --- /dev/null +++ b/node_modules/extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/extglob/README.md b/node_modules/extglob/README.md new file mode 100755 index 00000000..66644066 --- /dev/null +++ b/node_modules/extglob/README.md @@ -0,0 +1,88 @@ +# extglob [![NPM version](https://badge.fury.io/js/extglob.svg)](http://badge.fury.io/js/extglob) [![Build Status](https://travis-ci.org/jonschlinkert/extglob.svg)](https://travis-ci.org/jonschlinkert/extglob) + +> Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extglob --save +``` + +Used by [micromatch](https://github.com/jonschlinkert/micromatch). + +**Features** + +* Convert an extglob string to a regex-compatible string. **Only converts extglobs**, to handle full globs use [micromatch](https://github.com/jonschlinkert/micromatch). +* Pass `{regex: true}` to return a regex +* Handles nested patterns +* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) + +## Usage + +```js +var extglob = require('extglob'); + +extglob('?(z)'); +//=> '(?:z)?' +extglob('*(z)'); +//=> '(?:z)*' +extglob('+(z)'); +//=> '(?:z)+' +extglob('@(z)'); +//=> '(?:z)' +extglob('!(z)'); +//=> '(?!^(?:(?!z)[^/]*?)).*$' +``` + +**Optionally return regex** + +```js +extglob('!(z)', {regex: true}); +//=> /(?!^(?:(?!z)[^/]*?)).*$/ +``` + +## Extglob patterns + +To learn more about how extglobs work, see the docs for [Bash pattern matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html): + +* `?(pattern)`: Match zero or one occurrence of the given pattern. +* `*(pattern)`: Match zero or more occurrences of the given pattern. +* `+(pattern)`: Match one or more occurrences of the given pattern. +* `@(pattern)`: Match one of the given pattern. +* `!(pattern)`: Match anything except one of the given pattern. + +## Related + +* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) +* [expand-brackets](https://github.com/jonschlinkert/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. +* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) +* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://github.com/jonschlinkert/fill-range) +* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://github.com/jonschlinkert/micromatch) + +## Run tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/extglob/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 01, 2015._ \ No newline at end of file diff --git a/node_modules/extglob/index.js b/node_modules/extglob/index.js new file mode 100755 index 00000000..2e774d4a --- /dev/null +++ b/node_modules/extglob/index.js @@ -0,0 +1,178 @@ +/*! + * extglob + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +/** + * Module dependencies + */ + +var isExtglob = require('is-extglob'); +var re, cache = {}; + +/** + * Expose `extglob` + */ + +module.exports = extglob; + +/** + * Convert the given extglob `string` to a regex-compatible + * string. + * + * ```js + * var extglob = require('extglob'); + * extglob('!(a?(b))'); + * //=> '(?!a(?:b)?)[^/]*?' + * ``` + * + * @param {String} `str` The string to convert. + * @param {Object} `options` + * @option {Boolean} [options] `esc` If `false` special characters will not be escaped. Defaults to `true`. + * @option {Boolean} [options] `regex` If `true` a regular expression is returned instead of a string. + * @return {String} + * @api public + */ + + +function extglob(str, opts) { + opts = opts || {}; + var o = {}, i = 0; + + // fix common character reversals + // '*!(.js)' => '*.!(js)' + str = str.replace(/!\(([^\w*()])/g, '$1!('); + + // support file extension negation + str = str.replace(/([*\/])\.!\([*]\)/g, function (m, ch) { + if (ch === '/') { + return escape('\\/[^.]+'); + } + return escape('[^.]+'); + }); + + // create a unique key for caching by + // combining the string and options + var key = str + + String(!!opts.regex) + + String(!!opts.contains) + + String(!!opts.escape); + + if (cache.hasOwnProperty(key)) { + return cache[key]; + } + + if (!(re instanceof RegExp)) { + re = regex(); + } + + opts.negate = false; + var m; + + while (m = re.exec(str)) { + var prefix = m[1]; + var inner = m[3]; + if (prefix === '!') { + opts.negate = true; + } + + var id = '__EXTGLOB_' + (i++) + '__'; + // use the prefix of the _last_ (outtermost) pattern + o[id] = wrap(inner, prefix, opts.escape); + str = str.split(m[0]).join(id); + } + + var keys = Object.keys(o); + var len = keys.length; + + // we have to loop again to allow us to convert + // patterns in reverse order (starting with the + // innermost/last pattern first) + while (len--) { + var prop = keys[len]; + str = str.split(prop).join(o[prop]); + } + + var result = opts.regex + ? toRegex(str, opts.contains, opts.negate) + : str; + + result = result.split('.').join('\\.'); + + // cache the result and return it + return (cache[key] = result); +} + +/** + * Convert `string` to a regex string. + * + * @param {String} `str` + * @param {String} `prefix` Character that determines how to wrap the string. + * @param {Boolean} `esc` If `false` special characters will not be escaped. Defaults to `true`. + * @return {String} + */ + +function wrap(inner, prefix, esc) { + if (esc) inner = escape(inner); + + switch (prefix) { + case '!': + return '(?!' + inner + ')[^/]' + (esc ? '%%%~' : '*?'); + case '@': + return '(?:' + inner + ')'; + case '+': + return '(?:' + inner + ')+'; + case '*': + return '(?:' + inner + ')' + (esc ? '%%' : '*') + case '?': + return '(?:' + inner + '|)'; + default: + return inner; + } +} + +function escape(str) { + str = str.split('*').join('[^/]%%%~'); + str = str.split('.').join('\\.'); + return str; +} + +/** + * extglob regex. + */ + +function regex() { + return /(\\?[@?!+*$]\\?)(\(([^()]*?)\))/; +} + +/** + * Negation regex + */ + +function negate(str) { + return '(?!^' + str + ').*$'; +} + +/** + * Create the regex to do the matching. If + * the leading character in the `pattern` is `!` + * a negation regex is returned. + * + * @param {String} `pattern` + * @param {Boolean} `contains` Allow loose matching. + * @param {Boolean} `isNegated` True if the pattern is a negation pattern. + */ + +function toRegex(pattern, contains, isNegated) { + var prefix = contains ? '^' : ''; + var after = contains ? '$' : ''; + pattern = ('(?:' + pattern + ')' + after); + if (isNegated) { + pattern = prefix + negate(pattern); + } + return new RegExp(prefix + pattern); +} diff --git a/node_modules/extglob/package.json b/node_modules/extglob/package.json new file mode 100755 index 00000000..2e519c16 --- /dev/null +++ b/node_modules/extglob/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "extglob@^0.3.1", + "scope": null, + "escapedName": "extglob", + "name": "extglob", + "rawSpec": "^0.3.1", + "spec": ">=0.3.1 <0.4.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch" + ] + ], + "_from": "extglob@>=0.3.1 <0.4.0", + "_id": "extglob@0.3.2", + "_inCache": true, + "_location": "/extglob", + "_nodeVersion": "5.3.0", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "extglob@^0.3.1", + "scope": null, + "escapedName": "extglob", + "name": "extglob", + "rawSpec": "^0.3.1", + "spec": ">=0.3.1 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "_shasum": "2e18ff3d2f49ab2765cec9023f011daa8d8349a1", + "_shrinkwrap": null, + "_spec": "extglob@^0.3.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extglob/issues" + }, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "description": "Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.", + "devDependencies": { + "ansi-green": "^0.1.1", + "micromatch": "^2.1.6", + "minimatch": "^2.0.1", + "minimist": "^1.1.0", + "mocha": "*", + "should": "*", + "success-symbol": "^0.1.0" + }, + "directories": {}, + "dist": { + "shasum": "2e18ff3d2f49ab2765cec9023f011daa8d8349a1", + "tarball": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8c3f38bbd9e0afaf31a87e411c0d15532434ef41", + "homepage": "https://github.com/jonschlinkert/extglob", + "keywords": [ + "bash", + "extended", + "extglob", + "glob", + "ksh", + "match", + "wildcard" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "extglob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/extglob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "micromatch", + "expand-brackets", + "braces", + "fill-range", + "expand-range" + ] + } + }, + "version": "0.3.2" +} diff --git a/node_modules/eyes/LICENSE b/node_modules/eyes/LICENSE new file mode 100755 index 00000000..a1edd93b --- /dev/null +++ b/node_modules/eyes/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009 cloudhead + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eyes/Makefile b/node_modules/eyes/Makefile new file mode 100755 index 00000000..a121deaf --- /dev/null +++ b/node_modules/eyes/Makefile @@ -0,0 +1,4 @@ +test: + @@node test/eyes-test.js + +.PHONY: test diff --git a/node_modules/eyes/README.md b/node_modules/eyes/README.md new file mode 100755 index 00000000..c4f6f769 --- /dev/null +++ b/node_modules/eyes/README.md @@ -0,0 +1,73 @@ +eyes +==== + +a customizable value inspector for Node.js + +synopsis +-------- + +I was tired of looking at cluttered output in the console -- something needed to be done, +`sys.inspect()` didn't display regexps correctly, and was too verbose, and I had an hour or two to spare. +So I decided to have some fun. _eyes_ were born. + +![eyes-ss](http://dl.dropbox.com/u/251849/eyes-js-ss.gif) + +_example of the output of a user-customized eyes.js inspector_ + +*eyes* also deals with circular objects in an intelligent way, and can pretty-print object literals. + +usage +----- + + var inspect = require('eyes').inspector({styles: {all: 'magenta'}}); + + inspect(something); // inspect with the settings passed to `inspector` + +or + + var eyes = require('eyes'); + + eyes.inspect(something); // inspect with the default settings + +you can pass a _label_ to `inspect()`, to keep track of your inspections: + + eyes.inspect(something, "a random value"); + +If you want to return the output of eyes without printing it, you can set it up this way: + + var inspect = require('eyes').inspector({ stream: null }); + + sys.puts(inspect({ something: 42 })); + +customization +------------- + +These are the default styles and settings used by _eyes_. + + styles: { // Styles applied to stdout + all: 'cyan', // Overall style applied to everything + label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]` + other: 'inverted', // Objects which don't have a literal representation, such as functions + key: 'bold', // The keys in object literals, like 'a' in `{a: 1}` + special: 'grey', // null, undefined... + string: 'green', + number: 'magenta', + bool: 'blue', // true false + regexp: 'green', // /\d+/ + }, + + pretty: true, // Indent object literals + hideFunctions: false, // Don't output functions at all + stream: process.stdout, // Stream to write to, or null + maxLength: 2048 // Truncate output if longer + +You can overwrite them with your own, by passing a similar object to `inspector()` or `inspect()`. + + var inspect = require('eyes').inspector({ + styles: { + all: 'magenta', + special: 'bold' + }, + maxLength: 512 + }); + diff --git a/node_modules/eyes/lib/eyes.js b/node_modules/eyes/lib/eyes.js new file mode 100755 index 00000000..10d964b9 --- /dev/null +++ b/node_modules/eyes/lib/eyes.js @@ -0,0 +1,236 @@ +// +// Eyes.js - a customizable value inspector for Node.js +// +// usage: +// +// var inspect = require('eyes').inspector({styles: {all: 'magenta'}}); +// inspect(something); // inspect with the settings passed to `inspector` +// +// or +// +// var eyes = require('eyes'); +// eyes.inspect(something); // inspect with the default settings +// +var eyes = exports, + stack = []; + +eyes.defaults = { + styles: { // Styles applied to stdout + all: 'cyan', // Overall style applied to everything + label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]` + other: 'inverted', // Objects which don't have a literal representation, such as functions + key: 'bold', // The keys in object literals, like 'a' in `{a: 1}` + special: 'grey', // null, undefined... + string: 'green', + number: 'magenta', + bool: 'blue', // true false + regexp: 'green', // /\d+/ + }, + pretty: true, // Indent object literals + hideFunctions: false, + showHidden: false, + stream: process.stdout, + maxLength: 2048 // Truncate output if longer +}; + +// Return a curried inspect() function, with the `options` argument filled in. +eyes.inspector = function (options) { + var that = this; + return function (obj, label, opts) { + return that.inspect.call(that, obj, label, + merge(options || {}, opts || {})); + }; +}; + +// If we have a `stream` defined, use it to print a styled string, +// if not, we just return the stringified object. +eyes.inspect = function (obj, label, options) { + options = merge(this.defaults, options || {}); + + if (options.stream) { + return this.print(stringify(obj, options), label, options); + } else { + return stringify(obj, options) + (options.styles ? '\033[39m' : ''); + } +}; + +// Output using the 'stream', and an optional label +// Loop through `str`, and truncate it after `options.maxLength` has been reached. +// Because escape sequences are, at this point embeded within +// the output string, we can't measure the length of the string +// in a useful way, without separating what is an escape sequence, +// versus a printable character (`c`). So we resort to counting the +// length manually. +eyes.print = function (str, label, options) { + for (var c = 0, i = 0; i < str.length; i++) { + if (str.charAt(i) === '\033') { i += 4 } // `4` because '\033[25m'.length + 1 == 5 + else if (c === options.maxLength) { + str = str.slice(0, i - 1) + '…'; + break; + } else { c++ } + } + return options.stream.write.call(options.stream, (label ? + this.stylize(label, options.styles.label, options.styles) + ': ' : '') + + this.stylize(str, options.styles.all, options.styles) + '\033[0m' + "\n"); +}; + +// Apply a style to a string, eventually, +// I'd like this to support passing multiple +// styles. +eyes.stylize = function (str, style, styles) { + var codes = { + 'bold' : [1, 22], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'cyan' : [36, 39], + 'magenta' : [35, 39], + 'blue' : [34, 39], + 'yellow' : [33, 39], + 'green' : [32, 39], + 'red' : [31, 39], + 'grey' : [90, 39] + }, endCode; + + if (style && codes[style]) { + endCode = (codes[style][1] === 39 && styles.all) ? codes[styles.all][0] + : codes[style][1]; + return '\033[' + codes[style][0] + 'm' + str + + '\033[' + endCode + 'm'; + } else { return str } +}; + +// Convert any object to a string, ready for output. +// When an 'array' or an 'object' are encountered, they are +// passed to specialized functions, which can then recursively call +// stringify(). +function stringify(obj, options) { + var that = this, stylize = function (str, style) { + return eyes.stylize(str, options.styles[style], options.styles) + }, index, result; + + if ((index = stack.indexOf(obj)) !== -1) { + return stylize(new(Array)(stack.length - index + 1).join('.'), 'special'); + } + stack.push(obj); + + result = (function (obj) { + switch (typeOf(obj)) { + case "string" : obj = stringifyString(obj.indexOf("'") === -1 ? "'" + obj + "'" + : '"' + obj + '"'); + return stylize(obj, 'string'); + case "regexp" : return stylize('/' + obj.source + '/', 'regexp'); + case "number" : return stylize(obj + '', 'number'); + case "function" : return options.stream ? stylize("Function", 'other') : '[Function]'; + case "null" : return stylize("null", 'special'); + case "undefined": return stylize("undefined", 'special'); + case "boolean" : return stylize(obj + '', 'bool'); + case "date" : return stylize(obj.toUTCString()); + case "array" : return stringifyArray(obj, options, stack.length); + case "object" : return stringifyObject(obj, options, stack.length); + } + })(obj); + + stack.pop(); + return result; +}; + +// Escape invisible characters in a string +function stringifyString (str, options) { + return str.replace(/\\/g, '\\\\') + .replace(/\n/g, '\\n') + .replace(/[\u0001-\u001F]/g, function (match) { + return '\\0' + match[0].charCodeAt(0).toString(8); + }); +} + +// Convert an array to a string, such as [1, 2, 3]. +// This function calls stringify() for each of the elements +// in the array. +function stringifyArray(ary, options, level) { + var out = []; + var pretty = options.pretty && (ary.length > 4 || ary.some(function (o) { + return (o !== null && typeof(o) === 'object' && Object.keys(o).length > 0) || + (Array.isArray(o) && o.length > 0); + })); + var ws = pretty ? '\n' + new(Array)(level * 4 + 1).join(' ') : ' '; + + for (var i = 0; i < ary.length; i++) { + out.push(stringify(ary[i], options)); + } + + if (out.length === 0) { + return '[]'; + } else { + return '[' + ws + + out.join(',' + (pretty ? ws : ' ')) + + (pretty ? ws.slice(0, -4) : ws) + + ']'; + } +}; + +// Convert an object to a string, such as {a: 1}. +// This function calls stringify() for each of its values, +// and does not output functions or prototype values. +function stringifyObject(obj, options, level) { + var out = []; + var pretty = options.pretty && (Object.keys(obj).length > 2 || + Object.keys(obj).some(function (k) { return typeof(obj[k]) === 'object' })); + var ws = pretty ? '\n' + new(Array)(level * 4 + 1).join(' ') : ' '; + + var keys = options.showHidden ? Object.keys(obj) : Object.getOwnPropertyNames(obj); + keys.forEach(function (k) { + if (Object.prototype.hasOwnProperty.call(obj, k) + && !(obj[k] instanceof Function && options.hideFunctions)) { + out.push(eyes.stylize(k, options.styles.key, options.styles) + ': ' + + stringify(obj[k], options)); + } + }); + + if (out.length === 0) { + return '{}'; + } else { + return "{" + ws + + out.join(',' + (pretty ? ws : ' ')) + + (pretty ? ws.slice(0, -4) : ws) + + "}"; + } +}; + +// A better `typeof` +function typeOf(value) { + var s = typeof(value), + types = [Object, Array, String, RegExp, Number, Function, Boolean, Date]; + + if (s === 'object' || s === 'function') { + if (value) { + types.forEach(function (t) { + if (value instanceof t) { s = t.name.toLowerCase() } + }); + } else { s = 'null' } + } + return s; +} + +function merge(/* variable args */) { + var objs = Array.prototype.slice.call(arguments); + var target = {}; + + objs.forEach(function (o) { + Object.keys(o).forEach(function (k) { + if (k === 'styles') { + if (! o.styles) { + target.styles = false; + } else { + target.styles = {} + for (var s in o.styles) { + target.styles[s] = o.styles[s]; + } + } + } else { + target[k] = o[k]; + } + }); + }); + return target; +} + diff --git a/node_modules/eyes/package.json b/node_modules/eyes/package.json new file mode 100755 index 00000000..d540204e --- /dev/null +++ b/node_modules/eyes/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + { + "raw": "eyes@0.1.x", + "scope": null, + "escapedName": "eyes", + "name": "eyes", + "rawSpec": "0.1.x", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/winston" + ] + ], + "_from": "eyes@>=0.1.0 <0.2.0", + "_id": "eyes@0.1.8", + "_inCache": true, + "_location": "/eyes", + "_npmUser": { + "name": "indexzero", + "email": "charlie.robbins@gmail.com" + }, + "_npmVersion": "1.1.53", + "_phantomChildren": {}, + "_requested": { + "raw": "eyes@0.1.x", + "scope": null, + "escapedName": "eyes", + "name": "eyes", + "rawSpec": "0.1.x", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/winston" + ], + "_resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "_shasum": "62cf120234c683785d902348a800ef3e0cc20bc0", + "_shrinkwrap": null, + "_spec": "eyes@0.1.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/winston", + "author": { + "name": "Alexis Sellier", + "email": "self@cloudhead.net" + }, + "contributors": [ + { + "name": "Charlie Robbins", + "email": "charlie@nodejitsu.com" + } + ], + "dependencies": {}, + "description": "a customizable value inspector", + "devDependencies": {}, + "directories": { + "lib": "./lib", + "test": "./test" + }, + "dist": { + "shasum": "62cf120234c683785d902348a800ef3e0cc20bc0", + "tarball": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz" + }, + "engines": { + "node": "> 0.1.90" + }, + "keywords": [ + "inspector", + "debug", + "inspect", + "print" + ], + "licenses": [ + "MIT" + ], + "main": "./lib/eyes", + "maintainers": [ + { + "name": "cloudhead", + "email": "self@cloudhead.net" + }, + { + "name": "indexzero", + "email": "charlie.robbins@gmail.com" + } + ], + "name": "eyes", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "scripts": { + "test": "node test/*-test.js" + }, + "url": "http://github.com/cloudhead/eyes.js", + "version": "0.1.8" +} diff --git a/node_modules/eyes/test/eyes-test.js b/node_modules/eyes/test/eyes-test.js new file mode 100755 index 00000000..1f9606a2 --- /dev/null +++ b/node_modules/eyes/test/eyes-test.js @@ -0,0 +1,56 @@ +var util = require('util'); +var eyes = require('../lib/eyes'); + +eyes.inspect({ + number: 42, + string: "John Galt", + regexp: /[a-z]+/, + array: [99, 168, 'x', {}], + func: function () {}, + bool: false, + nil: null, + undef: undefined, + object: {attr: []} +}, "native types"); + +eyes.inspect({ + number: new(Number)(42), + string: new(String)("John Galt"), + regexp: new(RegExp)(/[a-z]+/), + array: new(Array)(99, 168, 'x', {}), + bool: new(Boolean)(false), + object: new(Object)({attr: []}), + date: new(Date) +}, "wrapped types"); + +var obj = {}; +obj.that = { self: obj }; +obj.self = obj; + +eyes.inspect(obj, "circular object"); +eyes.inspect({hello: 'moto'}, "small object"); +eyes.inspect({hello: new(Array)(6) }, "big object"); +eyes.inspect(["hello 'world'", 'hello "world"'], "quotes"); +eyes.inspect({ + recommendations: [{ + id: 'a7a6576c2c822c8e2bd81a27e41437d8', + key: [ 'spree', 3.764316258020699 ], + value: { + _id: 'a7a6576c2c822c8e2bd81a27e41437d8', + _rev: '1-2e2d2f7fd858c4a5984bcf809d22ed98', + type: 'domain', + domain: 'spree', + weight: 3.764316258020699, + product_id: 30 + } + }] +}, 'complex'); + +eyes.inspect([null], "null in array"); + +var inspect = eyes.inspector({ stream: null }); + +util.puts(inspect('something', "something")); +util.puts(inspect("something else")); + +util.puts(inspect(["no color"], null, { styles: false })); diff --git a/node_modules/faye-websocket/CHANGELOG.md b/node_modules/faye-websocket/CHANGELOG.md new file mode 100755 index 00000000..bab808ca --- /dev/null +++ b/node_modules/faye-websocket/CHANGELOG.md @@ -0,0 +1,115 @@ +### 0.10.0 / 2015-07-08 + +* Add the standard `code` and `reason` parameters to the `close` method + +### 0.9.4 / 2015-03-08 + +* Don't send input to the driver before `start()` is called + +### 0.9.3 / 2015-02-19 + +* Make sure the TCP socket is not left open when closing the connection + +### 0.9.2 / 2014-12-21 + +* Only emit `error` once, and don't emit it after `close` + +### 0.9.1 / 2014-12-18 + +* Check that all options to the WebSocket constructor are recognized + +### 0.9.0 / 2014-12-13 + +* Allow protocol extensions to be passed into websocket-extensions + +### 0.8.1 / 2014-11-12 + +* Send the correct hostname when upgrading a connection to TLS + +### 0.8.0 / 2014-11-08 + +* Support connections via HTTP proxies +* Close the connection cleanly if we're still waiting for a handshake response + +### 0.7.3 / 2014-10-04 + +* Allow sockets to be closed when they are in any state other than `CLOSED` + +### 0.7.2 / 2013-12-29 + +* Make sure the `close` event is emitted by clients on Node v0.10 + +### 0.7.1 / 2013-12-03 + +* Support the `maxLength` websocket-driver option +* Make the client emit `error` events on network errors + +### 0.7.0 / 2013-09-09 + +* Allow the server to send custom headers with EventSource responses + +### 0.6.1 / 2013-07-05 + +* Add `ca` option to the client for specifying certificate authorities +* Start the server driver asynchronously so that `onopen` handlers can be added + +### 0.6.0 / 2013-05-12 + +* Add support for custom headers + +### 0.5.0 / 2013-05-05 + +* Extract the protocol handlers into the `websocket-driver` library +* Support the Node streaming API + +### 0.4.4 / 2013-02-14 + +* Emit the `close` event if TCP is closed before CLOSE frame is acked + +### 0.4.3 / 2012-07-09 + +* Add `Connection: close` to EventSource response +* Handle situations where `request.socket` is undefined + +### 0.4.2 / 2012-04-06 + +* Add WebSocket error code `1011`. +* Handle URLs with no path correctly by sending `GET /` + +### 0.4.1 / 2012-02-26 + +* Treat anything other than a `Buffer` as a string when calling `send()` + +### 0.4.0 / 2012-02-13 + +* Add `ping()` method to server-side `WebSocket` and `EventSource` +* Buffer `send()` calls until the draft-76 handshake is complete +* Fix HTTPS problems on Node 0.7 + +### 0.3.1 / 2012-01-16 + +* Call `setNoDelay(true)` on `net.Socket` objects to reduce latency + +### 0.3.0 / 2012-01-13 + +* Add support for `EventSource` connections + +### 0.2.0 / 2011-12-21 + +* Add support for `Sec-WebSocket-Protocol` negotiation +* Support `hixie-76` close frames and 75/76 ignored segments +* Improve performance of HyBi parsing/framing functions +* Decouple parsers from TCP and reduce write volume + +### 0.1.2 / 2011-12-05 + +* Detect closed sockets on the server side when TCP connection breaks +* Make `hixie-76` sockets work through HAProxy + +### 0.1.1 / 2011-11-30 + +* Fix `addEventListener()` interface methods + +### 0.1.0 / 2011-11-27 + +* Initial release, based on WebSocket components from Faye diff --git a/node_modules/faye-websocket/README.md b/node_modules/faye-websocket/README.md new file mode 100755 index 00000000..ff251e39 --- /dev/null +++ b/node_modules/faye-websocket/README.md @@ -0,0 +1,336 @@ +# faye-websocket + +* Travis CI build: [![Build + status](https://secure.travis-ci.org/faye/faye-websocket-node.svg)](http://travis-ci.org/faye/faye-websocket-node) +* Autobahn tests: [server](http://faye.jcoglan.com/autobahn/servers/), + [client](http://faye.jcoglan.com/autobahn/clients/) + +This is a general-purpose WebSocket implementation extracted from the +[Faye](http://faye.jcoglan.com) project. It provides classes for easily building +WebSocket servers and clients in Node. It does not provide a server itself, but +rather makes it easy to handle WebSocket connections within an existing +[Node](http://nodejs.org/) application. It does not provide any abstraction +other than the standard [WebSocket API](http://dev.w3.org/html5/websockets/). + +It also provides an abstraction for handling +[EventSource](http://dev.w3.org/html5/eventsource/) connections, which are +one-way connections that allow the server to push data to the client. They are +based on streaming HTTP responses and can be easier to access via proxies than +WebSockets. + + +## Installation + +``` +$ npm install faye-websocket +``` + + +## Handling WebSocket connections in Node + +You can handle WebSockets on the server side by listening for HTTP Upgrade +requests, and creating a new socket for the request. This socket object exposes +the usual WebSocket methods for receiving and sending messages. For example this +is how you'd implement an echo server: + +```js +var WebSocket = require('faye-websocket'), + http = require('http'); + +var server = http.createServer(); + +server.on('upgrade', function(request, socket, body) { + if (WebSocket.isWebSocket(request)) { + var ws = new WebSocket(request, socket, body); + + ws.on('message', function(event) { + ws.send(event.data); + }); + + ws.on('close', function(event) { + console.log('close', event.code, event.reason); + ws = null; + }); + } +}); + +server.listen(8000); +``` + +`WebSocket` objects are also duplex streams, so you could replace the +`ws.on('message', ...)` line with: + +```js + ws.pipe(ws); +``` + +Note that under certain circumstances (notably a draft-76 client connecting +through an HTTP proxy), the WebSocket handshake will not be complete after you +call `new WebSocket()` because the server will not have received the entire +handshake from the client yet. In this case, calls to `ws.send()` will buffer +the message in memory until the handshake is complete, at which point any +buffered messages will be sent to the client. + +If you need to detect when the WebSocket handshake is complete, you can use the +`onopen` event. + +If the connection's protocol version supports it, you can call `ws.ping()` to +send a ping message and wait for the client's response. This method takes a +message string, and an optional callback that fires when a matching pong message +is received. It returns `true` if and only if a ping message was sent. If the +client does not support ping/pong, this method sends no data and returns +`false`. + +```js +ws.ping('Mic check, one, two', function() { + // fires when pong is received +}); +``` + + +## Using the WebSocket client + +The client supports both the plain-text `ws` protocol and the encrypted `wss` +protocol, and has exactly the same interface as a socket you would use in a web +browser. On the wire it identifies itself as `hybi-13`. + +```js +var WebSocket = require('faye-websocket'), + ws = new WebSocket.Client('ws://www.example.com/'); + +ws.on('open', function(event) { + console.log('open'); + ws.send('Hello, world!'); +}); + +ws.on('message', function(event) { + console.log('message', event.data); +}); + +ws.on('close', function(event) { + console.log('close', event.code, event.reason); + ws = null; +}); +``` + +The WebSocket client also lets you inspect the status and headers of the +handshake response via its `statusCode` and `headers` properties. + +To connect via a proxy, set the `proxy` option to the HTTP origin of the proxy, +including any authorization information, custom headers and TLS config you +require. Only the `origin` setting is required. + +```js +var ws = new WebSocket.Client('ws://www.example.com/', [], { + proxy: { + origin: 'http://username:password@proxy.example.com', + headers: {'User-Agent': 'node'}, + tls: {cert: fs.readFileSync('client.crt')} + } +}); +``` + +The `tls` value is a Node 'TLS options' object that will be passed to +[`tls.connect()`](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback). + + +## Subprotocol negotiation + +The WebSocket protocol allows peers to select and identify the application +protocol to use over the connection. On the client side, you can set which +protocols the client accepts by passing a list of protocol names when you +construct the socket: + +```js +var ws = new WebSocket.Client('ws://www.example.com/', ['irc', 'amqp']); +``` + +On the server side, you can likewise pass in the list of protocols the server +supports after the other constructor arguments: + +```js +var ws = new WebSocket(request, socket, body, ['irc', 'amqp']); +``` + +If the client and server agree on a protocol, both the client- and server-side +socket objects expose the selected protocol through the `ws.protocol` property. + + +## Protocol extensions + +faye-websocket is based on the +[websocket-extensions](https://github.com/faye/websocket-extensions-node) +framework that allows extensions to be negotiated via the +`Sec-WebSocket-Extensions` header. To add extensions to a connection, pass an +array of extensions to the `:extensions` option. For example, to add +[permessage-deflate](https://github.com/faye/permessage-deflate-node): + +```js +var deflate = require('permessage-deflate'); + +var ws = new WebSocket(request, socket, body, [], {extensions: [deflate]}); +``` + + +## Initialization options + +Both the server- and client-side classes allow an options object to be passed in +at initialization time, for example: + +```js +var ws = new WebSocket(request, socket, body, protocols, options); +var ws = new WebSocket.Client(url, protocols, options); +``` + +`protocols` is an array of subprotocols as described above, or `null`. +`options` is an optional object containing any of these fields: + +* `extensions` - an array of + [websocket-extensions](https://github.com/faye/websocket-extensions-node) + compatible extensions, as described above +* `headers` - an object containing key-value pairs representing HTTP headers to + be sent during the handshake process +* `maxLength` - the maximum allowed size of incoming message frames, in bytes. + The default value is `2^26 - 1`, or 1 byte short of 64 MiB. +* `ping` - an integer that sets how often the WebSocket should send ping frames, + measured in seconds + +The client accepts some additional options: + +* `proxy` - settings for a proxy as described above +* `tls` - a Node 'TLS options' object containing TLS settings for the origin + server, this will be passed to + [`tls.connect()`](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback) +* `ca` - (legacy) a shorthand for passing `{tls: {ca: value}}` + + +## WebSocket API + +Both server- and client-side `WebSocket` objects support the following API. + +* `on('open', function(event) {})` fires when the socket connection is + established. Event has no attributes. +* `on('message', function(event) {})` fires when the socket receives a + message. Event has one attribute, `data`, which is either a `String` + (for text frames) or a `Buffer` (for binary frames). +* `on('error', function(event) {})` fires when there is a protocol error + due to bad data sent by the other peer. This event is purely informational, + you do not need to implement error recover. +* `on('close', function(event) {})` fires when either the client or the + server closes the connection. Event has two optional attributes, `code` + and `reason`, that expose the status code and message sent by the peer + that closed the connection. +* `send(message)` accepts either a `String` or a `Buffer` and sends a + text or binary message over the connection to the other peer. +* `ping(message, function() {})` sends a ping frame with an optional + message and fires the callback when a matching pong is received. +* `close(code, reason)` closes the connection, sending the given status + code and reason text, both of which are optional. +* `version` is a string containing the version of the `WebSocket` + protocol the connection is using. +* `protocol` is a string (which may be empty) identifying the subprotocol + the socket is using. + + +## Handling EventSource connections in Node + +EventSource connections provide a very similar interface, although because they +only allow the server to send data to the client, there is no `onmessage` API. +EventSource allows the server to push text messages to the client, where each +message has an optional event-type and ID. + +```js +var WebSocket = require('faye-websocket'), + EventSource = WebSocket.EventSource, + http = require('http'); + +var server = http.createServer(); + +server.on('request', function(request, response) { + if (EventSource.isEventSource(request)) { + var es = new EventSource(request, response); + console.log('open', es.url, es.lastEventId); + + // Periodically send messages + var loop = setInterval(function() { es.send('Hello') }, 1000); + + es.on('close', function() { + clearInterval(loop); + es = null; + }); + + } else { + // Normal HTTP request + response.writeHead(200, {'Content-Type': 'text/plain'}); + response.end('Hello'); + } +}); + +server.listen(8000); +``` + +The `send` method takes two optional parameters, `event` and `id`. The default +event-type is `'message'` with no ID. For example, to send a `notification` +event with ID `99`: + +```js +es.send('Breaking News!', {event: 'notification', id: '99'}); +``` + +The `EventSource` object exposes the following properties: + +* `url` is a string containing the URL the client used to create the + EventSource. +* `lastEventId` is a string containing the last event ID received by the + client. You can use this when the client reconnects after a dropped connection + to determine which messages need resending. + +When you initialize an EventSource with ` new EventSource()`, you can pass +configuration options after the `response` parameter. Available options are: + +* `headers` is an object containing custom headers to be set on the + EventSource response. +* `retry` is a number that tells the client how long (in seconds) it + should wait after a dropped connection before attempting to reconnect. +* `ping` is a number that tells the server how often (in seconds) to send + 'ping' packets to the client to keep the connection open, to defeat timeouts + set by proxies. The client will ignore these messages. + +For example, this creates a connection that allows access from any origin, pings +every 15 seconds and is retryable every 10 seconds if the connection is broken: + +```js +var es = new EventSource(request, response, { + headers: {'Access-Control-Allow-Origin': '*'}, + ping: 15, + retry: 10 +}); +``` + +You can send a ping message at any time by calling `es.ping()`. Unlike +WebSocket, the client does not send a response to this; it is merely to send +some data over the wire to keep the connection alive. + + +## License + +(The MIT License) + +Copyright (c) 2010-2015 James Coglan + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the 'Software'), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/faye-websocket/examples/autobahn_client.js b/node_modules/faye-websocket/examples/autobahn_client.js new file mode 100755 index 00000000..0059b219 --- /dev/null +++ b/node_modules/faye-websocket/examples/autobahn_client.js @@ -0,0 +1,39 @@ +var WebSocket = require('..').Client, + deflate = require('permessage-deflate'), + pace = require('pace'); + +var host = 'ws://localhost:9001', + agent = encodeURIComponent('node-' + process.version), + cases = 0, + options = {extensions: [deflate]}; + +var socket = new WebSocket(host + '/getCaseCount'), + url, progress; + +socket.onmessage = function(event) { + console.log('Total cases to run: ' + event.data); + cases = parseInt(event.data); + progress = pace(cases); +}; + +var runCase = function(n) { + if (n > cases) { + url = host + '/updateReports?agent=' + agent; + socket = new WebSocket(url); + socket.onclose = process.exit; + return; + } + + url = host + '/runCase?case=' + n + '&agent=' + agent; + socket = new WebSocket(url, [], options); + socket.pipe(socket); + + socket.on('close', function() { + progress.op(); + runCase(n + 1); + }); +}; + +socket.onclose = function() { + runCase(1); +}; diff --git a/node_modules/faye-websocket/examples/client.js b/node_modules/faye-websocket/examples/client.js new file mode 100755 index 00000000..7d12039f --- /dev/null +++ b/node_modules/faye-websocket/examples/client.js @@ -0,0 +1,32 @@ +var WebSocket = require('..').Client, + deflate = require('permessage-deflate'), + fs = require('fs'); + +var url = process.argv[2], + proxy = process.argv[3], + ca = fs.readFileSync(__dirname + '/../spec/server.crt'), + tls = {ca: ca}; + +var ws = new WebSocket(url, [], { + proxy: {origin: proxy, headers: {'User-Agent': 'Echo'}, tls: tls}, + tls: tls, + headers: {Origin: 'http://faye.jcoglan.com'}, + extensions: [deflate] +}); + +ws.onopen = function() { + console.log('[open]', ws.headers); + ws.send('mic check'); +}; + +ws.onclose = function(close) { + console.log('[close]', close.code, close.reason); +}; + +ws.onerror = function(error) { + console.log('[error]', error.message); +}; + +ws.onmessage = function(message) { + console.log('[message]', message.data); +}; diff --git a/node_modules/faye-websocket/examples/haproxy.conf b/node_modules/faye-websocket/examples/haproxy.conf new file mode 100755 index 00000000..bb7bc9d5 --- /dev/null +++ b/node_modules/faye-websocket/examples/haproxy.conf @@ -0,0 +1,20 @@ +defaults + mode http + timeout client 5s + timeout connect 5s + timeout server 5s + +frontend all 0.0.0.0:3000 + mode http + timeout client 120s + + option forwardfor + option http-server-close + option http-pretend-keepalive + + default_backend sockets + +backend sockets + balance uri depth 2 + timeout server 120s + server socket1 127.0.0.1:7000 diff --git a/node_modules/faye-websocket/examples/proxy_server.js b/node_modules/faye-websocket/examples/proxy_server.js new file mode 100755 index 00000000..5780440b --- /dev/null +++ b/node_modules/faye-websocket/examples/proxy_server.js @@ -0,0 +1,7 @@ +var ProxyServer = require('../spec/proxy_server'); + +var port = process.argv[2], + secure = process.argv[3] === 'tls', + proxy = new ProxyServer({debug: true, tls: secure}); + +proxy.listen(port); diff --git a/node_modules/faye-websocket/examples/server.js b/node_modules/faye-websocket/examples/server.js new file mode 100755 index 00000000..c2cfa325 --- /dev/null +++ b/node_modules/faye-websocket/examples/server.js @@ -0,0 +1,69 @@ +var WebSocket = require('..'), + deflate = require('permessage-deflate'), + fs = require('fs'), + http = require('http'), + https = require('https'); + +var port = process.argv[2] || 7000, + secure = process.argv[3] === 'tls', + options = {extensions: [deflate], ping: 5}; + +var upgradeHandler = function(request, socket, head) { + var ws = new WebSocket(request, socket, head, ['irc', 'xmpp'], options); + console.log('[open]', ws.url, ws.version, ws.protocol, request.headers); + + ws.pipe(ws); + + ws.onclose = function(event) { + console.log('[close]', event.code, event.reason); + ws = null; + }; +}; + +var requestHandler = function(request, response) { + if (!WebSocket.EventSource.isEventSource(request)) + return staticHandler(request, response); + + var es = new WebSocket.EventSource(request, response), + time = parseInt(es.lastEventId, 10) || 0; + + console.log('[open]', es.url, es.lastEventId); + + var loop = setInterval(function() { + time += 1; + es.send('Time: ' + time); + setTimeout(function() { + if (es) es.send('Update!!', {event: 'update', id: time}); + }, 1000); + }, 2000); + + fs.createReadStream(__dirname + '/haproxy.conf').pipe(es, {end: false}); + + es.onclose = function() { + clearInterval(loop); + console.log('[close]', es.url); + es = null; + }; +}; + +var staticHandler = function(request, response) { + var path = request.url; + + fs.readFile(__dirname + path, function(err, content) { + var status = err ? 404 : 200; + response.writeHead(status, {'Content-Type': 'text/html'}); + response.write(content || 'Not found'); + response.end(); + }); +}; + +var server = secure + ? https.createServer({ + key: fs.readFileSync(__dirname + '/../spec/server.key'), + cert: fs.readFileSync(__dirname + '/../spec/server.crt') + }) + : http.createServer(); + +server.on('request', requestHandler); +server.on('upgrade', upgradeHandler); +server.listen(port); diff --git a/node_modules/faye-websocket/examples/sse.html b/node_modules/faye-websocket/examples/sse.html new file mode 100755 index 00000000..e11a9114 --- /dev/null +++ b/node_modules/faye-websocket/examples/sse.html @@ -0,0 +1,38 @@ + + + + + EventSource test + + + +

EventSource test

+
    + + + + + diff --git a/node_modules/faye-websocket/examples/ws.html b/node_modules/faye-websocket/examples/ws.html new file mode 100755 index 00000000..883cdede --- /dev/null +++ b/node_modules/faye-websocket/examples/ws.html @@ -0,0 +1,43 @@ + + + + + WebSocket test + + + +

    WebSocket test

    +
      + + + + + diff --git a/node_modules/faye-websocket/lib/faye/eventsource.js b/node_modules/faye-websocket/lib/faye/eventsource.js new file mode 100755 index 00000000..6e3f370d --- /dev/null +++ b/node_modules/faye-websocket/lib/faye/eventsource.js @@ -0,0 +1,131 @@ +var Stream = require('stream').Stream, + util = require('util'), + driver = require('websocket-driver'), + Headers = require('websocket-driver/lib/websocket/driver/headers'), + API = require('./websocket/api'), + EventTarget = require('./websocket/api/event_target'), + Event = require('./websocket/api/event'); + +var EventSource = function(request, response, options) { + this.writable = true; + options = options || {}; + + this._stream = response.socket; + this._ping = options.ping || this.DEFAULT_PING; + this._retry = options.retry || this.DEFAULT_RETRY; + + var scheme = driver.isSecureRequest(request) ? 'https:' : 'http:'; + this.url = scheme + '//' + request.headers.host + request.url; + this.lastEventId = request.headers['last-event-id'] || ''; + this.readyState = API.CONNECTING; + + var headers = new Headers(), + self = this; + + if (options.headers) { + for (var key in options.headers) headers.set(key, options.headers[key]); + } + + if (!this._stream || !this._stream.writable) return; + process.nextTick(function() { self._open() }); + + this._stream.setTimeout(0); + this._stream.setNoDelay(true); + + var handshake = 'HTTP/1.1 200 OK\r\n' + + 'Content-Type: text/event-stream\r\n' + + 'Cache-Control: no-cache, no-store\r\n' + + 'Connection: close\r\n' + + headers.toString() + + '\r\n' + + 'retry: ' + Math.floor(this._retry * 1000) + '\r\n\r\n'; + + this._write(handshake); + + this._stream.on('drain', function() { self.emit('drain') }); + + if (this._ping) + this._pingTimer = setInterval(function() { self.ping() }, this._ping * 1000); + + ['error', 'end'].forEach(function(event) { + self._stream.on(event, function() { self.close() }); + }); +}; +util.inherits(EventSource, Stream); + +EventSource.isEventSource = function(request) { + if (request.method !== 'GET') return false; + var accept = (request.headers.accept || '').split(/\s*,\s*/); + return accept.indexOf('text/event-stream') >= 0; +}; + +var instance = { + DEFAULT_PING: 10, + DEFAULT_RETRY: 5, + + _write: function(chunk) { + if (!this.writable) return false; + try { + return this._stream.write(chunk, 'utf8'); + } catch (e) { + return false; + } + }, + + _open: function() { + if (this.readyState !== API.CONNECTING) return; + + this.readyState = API.OPEN; + + var event = new Event('open'); + event.initEvent('open', false, false); + this.dispatchEvent(event); + }, + + write: function(message) { + return this.send(message); + }, + + end: function(message) { + if (message !== undefined) this.write(message); + this.close(); + }, + + send: function(message, options) { + if (this.readyState > API.OPEN) return false; + + message = String(message).replace(/(\r\n|\r|\n)/g, '$1data: '); + options = options || {}; + + var frame = ''; + if (options.event) frame += 'event: ' + options.event + '\r\n'; + if (options.id) frame += 'id: ' + options.id + '\r\n'; + frame += 'data: ' + message + '\r\n\r\n'; + + return this._write(frame); + }, + + ping: function() { + return this._write(':\r\n\r\n'); + }, + + close: function() { + if (this.readyState > API.OPEN) return false; + + this.readyState = API.CLOSED; + this.writable = false; + if (this._pingTimer) clearInterval(this._pingTimer); + if (this._stream) this._stream.end(); + + var event = new Event('close'); + event.initEvent('close', false, false); + this.dispatchEvent(event); + + return true; + } +}; + +for (var method in instance) EventSource.prototype[method] = instance[method]; +for (var key in EventTarget) EventSource.prototype[key] = EventTarget[key]; + +module.exports = EventSource; diff --git a/node_modules/faye-websocket/lib/faye/websocket.js b/node_modules/faye-websocket/lib/faye/websocket.js new file mode 100755 index 00000000..bfb0ae2c --- /dev/null +++ b/node_modules/faye-websocket/lib/faye/websocket.js @@ -0,0 +1,45 @@ +// API references: +// +// * http://dev.w3.org/html5/websockets/ +// * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget +// * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-event + +var util = require('util'), + driver = require('websocket-driver'), + API = require('./websocket/api'); + +var WebSocket = function(request, socket, body, protocols, options) { + options = options || {}; + + this._stream = socket; + this._driver = driver.http(request, {maxLength: options.maxLength, protocols: protocols}); + + var self = this; + if (!this._stream || !this._stream.writable) return; + if (!this._stream.readable) return this._stream.end(); + + var catchup = function() { self._stream.removeListener('data', catchup) }; + this._stream.on('data', catchup); + + API.call(this, options); + + process.nextTick(function() { + self._driver.start(); + self._driver.io.write(body); + }); +}; +util.inherits(WebSocket, API); + +WebSocket.isWebSocket = function(request) { + return driver.isWebSocket(request); +}; + +WebSocket.validateOptions = function(options, validKeys) { + driver.validateOptions(options, validKeys); +}; + +WebSocket.WebSocket = WebSocket; +WebSocket.Client = require('./websocket/client'); +WebSocket.EventSource = require('./eventsource'); + +module.exports = WebSocket; diff --git a/node_modules/faye-websocket/lib/faye/websocket/api.js b/node_modules/faye-websocket/lib/faye/websocket/api.js new file mode 100755 index 00000000..40879e62 --- /dev/null +++ b/node_modules/faye-websocket/lib/faye/websocket/api.js @@ -0,0 +1,186 @@ +var Stream = require('stream').Stream, + util = require('util'), + driver = require('websocket-driver'), + EventTarget = require('./api/event_target'), + Event = require('./api/event'); + +var API = function(options) { + options = options || {}; + driver.validateOptions(options, ['headers', 'extensions', 'maxLength', 'ping', 'proxy', 'tls', 'ca']); + + this.readable = this.writable = true; + + var headers = options.headers; + if (headers) { + for (var name in headers) this._driver.setHeader(name, headers[name]); + } + + var extensions = options.extensions; + if (extensions) { + [].concat(extensions).forEach(this._driver.addExtension, this._driver); + } + + this._ping = options.ping; + this._pingId = 0; + this.readyState = API.CONNECTING; + this.bufferedAmount = 0; + this.protocol = ''; + this.url = this._driver.url; + this.version = this._driver.version; + + var self = this; + + this._driver.on('open', function(e) { self._open() }); + this._driver.on('message', function(e) { self._receiveMessage(e.data) }); + this._driver.on('close', function(e) { self._beginClose(e.reason, e.code) }); + + this._driver.on('error', function(error) { + self._emitError(error.message); + }); + this.on('error', function() {}); + + this._driver.messages.on('drain', function() { + self.emit('drain'); + }); + + if (this._ping) + this._pingTimer = setInterval(function() { + self._pingId += 1; + self.ping(self._pingId.toString()); + }, this._ping * 1000); + + this._configureStream(); + + if (!this._proxy) { + this._stream.pipe(this._driver.io); + this._driver.io.pipe(this._stream); + } +}; +util.inherits(API, Stream); + +API.CONNECTING = 0; +API.OPEN = 1; +API.CLOSING = 2; +API.CLOSED = 3; + +var instance = { + write: function(data) { + return this.send(data); + }, + + end: function(data) { + if (data !== undefined) this.send(data); + this.close(); + }, + + pause: function() { + return this._driver.messages.pause(); + }, + + resume: function() { + return this._driver.messages.resume(); + }, + + send: function(data) { + if (this.readyState > API.OPEN) return false; + if (!(data instanceof Buffer)) data = String(data); + return this._driver.messages.write(data); + }, + + ping: function(message, callback) { + if (this.readyState > API.OPEN) return false; + return this._driver.ping(message, callback); + }, + + close: function(code, reason) { + if (code === undefined) code = 1000; + if (reason === undefined) reason = ''; + + if (code !== 1000 && (code < 3000 || code > 4999)) + throw new Error("Failed to execute 'close' on WebSocket: " + + "The code must be either 1000, or between 3000 and 4999. " + + code + " is neither."); + + if (this.readyState !== API.CLOSED) this.readyState = API.CLOSING; + this._driver.close(reason, code); + }, + + _configureStream: function() { + var self = this; + + this._stream.setTimeout(0); + this._stream.setNoDelay(true); + + ['close', 'end'].forEach(function(event) { + this._stream.on(event, function() { self._finalizeClose() }); + }, this); + + this._stream.on('error', function(error) { + self._emitError('Network error: ' + self.url + ': ' + error.message); + self._finalizeClose(); + }); + }, + + _open: function() { + if (this.readyState !== API.CONNECTING) return; + + this.readyState = API.OPEN; + this.protocol = this._driver.protocol || ''; + + var event = new Event('open'); + event.initEvent('open', false, false); + this.dispatchEvent(event); + }, + + _receiveMessage: function(data) { + if (this.readyState > API.OPEN) return false; + + if (this.readable) this.emit('data', data); + + var event = new Event('message', {data: data}); + event.initEvent('message', false, false); + this.dispatchEvent(event); + }, + + _emitError: function(message) { + if (this.readyState >= API.CLOSING) return; + + var event = new Event('error', {message: message}); + event.initEvent('error', false, false); + this.dispatchEvent(event); + }, + + _beginClose: function(reason, code) { + if (this.readyState === API.CLOSED) return; + this.readyState = API.CLOSING; + this._closeParams = [reason, code]; + + if (this._stream) { + this._stream.end(); + if (!this._stream.readable) this._finalizeClose(); + } + }, + + _finalizeClose: function() { + if (this.readyState === API.CLOSED) return; + this.readyState = API.CLOSED; + + if (this._pingTimer) clearInterval(this._pingTimer); + if (this._stream) this._stream.end(); + + if (this.readable) this.emit('end'); + this.readable = this.writable = false; + + var reason = this._closeParams ? this._closeParams[0] : '', + code = this._closeParams ? this._closeParams[1] : 1006; + + var event = new Event('close', {code: code, reason: reason}); + event.initEvent('close', false, false); + this.dispatchEvent(event); + } +}; + +for (var method in instance) API.prototype[method] = instance[method]; +for (var key in EventTarget) API.prototype[key] = EventTarget[key]; + +module.exports = API; diff --git a/node_modules/faye-websocket/lib/faye/websocket/api/event.js b/node_modules/faye-websocket/lib/faye/websocket/api/event.js new file mode 100755 index 00000000..38445809 --- /dev/null +++ b/node_modules/faye-websocket/lib/faye/websocket/api/event.js @@ -0,0 +1,20 @@ +var Event = function(eventType, options) { + this.type = eventType; + for (var key in options) + this[key] = options[key]; +}; + +Event.prototype.initEvent = function(eventType, canBubble, cancelable) { + this.type = eventType; + this.bubbles = canBubble; + this.cancelable = cancelable; +}; + +Event.prototype.stopPropagation = function() {}; +Event.prototype.preventDefault = function() {}; + +Event.CAPTURING_PHASE = 1; +Event.AT_TARGET = 2; +Event.BUBBLING_PHASE = 3; + +module.exports = Event; diff --git a/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js b/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js new file mode 100755 index 00000000..6c4b8697 --- /dev/null +++ b/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js @@ -0,0 +1,28 @@ +var Event = require('./event'); + +var EventTarget = { + onopen: null, + onmessage: null, + onerror: null, + onclose: null, + + addEventListener: function(eventType, listener, useCapture) { + this.on(eventType, listener); + }, + + removeEventListener: function(eventType, listener, useCapture) { + this.removeListener(eventType, listener); + }, + + dispatchEvent: function(event) { + event.target = event.currentTarget = this; + event.eventPhase = Event.AT_TARGET; + + if (this['on' + event.type]) + this['on' + event.type](event); + + this.emit(event.type, event); + } +}; + +module.exports = EventTarget; diff --git a/node_modules/faye-websocket/lib/faye/websocket/client.js b/node_modules/faye-websocket/lib/faye/websocket/client.js new file mode 100755 index 00000000..e32b31b0 --- /dev/null +++ b/node_modules/faye-websocket/lib/faye/websocket/client.js @@ -0,0 +1,83 @@ +var util = require('util'), + net = require('net'), + tls = require('tls'), + url = require('url'), + driver = require('websocket-driver'), + API = require('./api'), + Event = require('./api/event'); + +var DEFAULT_PORTS = {'http:': 80, 'https:': 443, 'ws:':80, 'wss:': 443}, + SECURE_PROTOCOLS = ['https:', 'wss:']; + +var Client = function(_url, protocols, options) { + options = options || {}; + + this.url = _url; + this._driver = driver.client(this.url, {maxLength: options.maxLength, protocols: protocols}); + + ['open', 'error'].forEach(function(event) { + this._driver.on(event, function() { + self.headers = self._driver.headers; + self.statusCode = self._driver.statusCode; + }); + }, this); + + var proxy = options.proxy || {}, + endpoint = url.parse(proxy.origin || this.url), + port = endpoint.port || DEFAULT_PORTS[endpoint.protocol], + secure = SECURE_PROTOCOLS.indexOf(endpoint.protocol) >= 0, + onConnect = function() { self._onConnect() }, + originTLS = options.tls || {}, + socketTLS = proxy.origin ? (proxy.tls || {}) : originTLS, + self = this; + + originTLS.ca = originTLS.ca || options.ca; + + this._stream = secure + ? tls.connect(port, endpoint.hostname, socketTLS, onConnect) + : net.connect(port, endpoint.hostname, onConnect); + + if (proxy.origin) this._configureProxy(proxy, originTLS); + + API.call(this, options); +}; +util.inherits(Client, API); + +Client.prototype._onConnect = function() { + var worker = this._proxy || this._driver; + worker.start(); +}; + +Client.prototype._configureProxy = function(proxy, originTLS) { + var uri = url.parse(this.url), + secure = SECURE_PROTOCOLS.indexOf(uri.protocol) >= 0, + self = this, + name; + + this._proxy = this._driver.proxy(proxy.origin); + + if (proxy.headers) { + for (name in proxy.headers) this._proxy.setHeader(name, proxy.headers[name]); + } + + this._proxy.pipe(this._stream, {end: false}); + this._stream.pipe(this._proxy); + + this._proxy.on('connect', function() { + if (secure) { + var options = {socket: self._stream, servername: uri.hostname}; + for (name in originTLS) options[name] = originTLS[name]; + self._stream = tls.connect(options); + self._configureStream(); + } + self._driver.io.pipe(self._stream); + self._stream.pipe(self._driver.io); + self._driver.start(); + }); + + this._proxy.on('error', function(error) { + self._driver.emit('error', error); + }); +}; + +module.exports = Client; diff --git a/node_modules/faye-websocket/package.json b/node_modules/faye-websocket/package.json new file mode 100755 index 00000000..b6623cb2 --- /dev/null +++ b/node_modules/faye-websocket/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "faye-websocket@^0.10.0", + "scope": null, + "escapedName": "faye-websocket", + "name": "faye-websocket", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/sockjs" + ] + ], + "_from": "faye-websocket@>=0.10.0 <0.11.0", + "_id": "faye-websocket@0.10.0", + "_inCache": true, + "_location": "/faye-websocket", + "_nodeVersion": "0.12.6", + "_npmUser": { + "name": "jcoglan", + "email": "jcoglan@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "faye-websocket@^0.10.0", + "scope": null, + "escapedName": "faye-websocket", + "name": "faye-websocket", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "_requiredBy": [ + "/sockjs" + ], + "_resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "_shasum": "4e492f8d04dfb6f89003507f6edbf2d501e7c6f4", + "_shrinkwrap": null, + "_spec": "faye-websocket@^0.10.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/sockjs", + "author": { + "name": "James Coglan", + "email": "jcoglan@gmail.com", + "url": "http://jcoglan.com/" + }, + "bugs": { + "url": "http://github.com/faye/faye-websocket-node/issues" + }, + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "description": "Standards-compliant WebSocket server and client", + "devDependencies": { + "jstest": "", + "pace": "", + "permessage-deflate": "" + }, + "directories": {}, + "dist": { + "shasum": "4e492f8d04dfb6f89003507f6edbf2d501e7c6f4", + "tarball": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz" + }, + "engines": { + "node": ">=0.4.0" + }, + "gitHead": "854c0a96581d95d0f07db01ce48431a4098e7c60", + "homepage": "http://github.com/faye/faye-websocket-node", + "keywords": [ + "websocket", + "eventsource" + ], + "license": "MIT", + "main": "./lib/faye/websocket", + "maintainers": [ + { + "name": "jcoglan", + "email": "jcoglan@gmail.com" + } + ], + "name": "faye-websocket", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/faye/faye-websocket-node.git" + }, + "scripts": { + "test": "jstest spec/runner.js" + }, + "version": "0.10.0" +} diff --git a/node_modules/filename-regex/README.md b/node_modules/filename-regex/README.md new file mode 100755 index 00000000..d001e7aa --- /dev/null +++ b/node_modules/filename-regex/README.md @@ -0,0 +1,51 @@ +# filename-regex [![NPM version](https://badge.fury.io/js/filename-regex.svg)](http://badge.fury.io/js/filename-regex) + +> Regular expression for matching file names, with or without extension. + + +## Install with [npm](npmjs.org) + +```bash +npm i filename-regex --save +``` + +## Usage + +```js +var regex = require('filename-regex'); + +'a/b/c/d.min.js'.match(regex()); +//=> match[0] = 'd.min.js' + +'a/b/c/.dotfile'.match(regex()); +//=> match[0] = '.dotfile' +``` + + +## Run tests + +Install dev dependencies: + +```bash +npm i -d && npm test +``` + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/regexps/filename-regex/issues) + + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + + +## License +Copyright (c) 2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb](https://github.com/assemble/verb) on January 24, 2015._ diff --git a/node_modules/filename-regex/index.js b/node_modules/filename-regex/index.js new file mode 100755 index 00000000..bb1888b4 --- /dev/null +++ b/node_modules/filename-regex/index.js @@ -0,0 +1,10 @@ +/*! + * filename-regex + * + * Copyright (c) 2014-2015, Jon Schlinkert + * Licensed under the MIT license. + */ + +module.exports = function filenameRegex() { + return /([^\\\/]+)$/; +}; diff --git a/node_modules/filename-regex/package.json b/node_modules/filename-regex/package.json new file mode 100755 index 00000000..dc57afb2 --- /dev/null +++ b/node_modules/filename-regex/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "filename-regex@^2.0.0", + "scope": null, + "escapedName": "filename-regex", + "name": "filename-regex", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch" + ] + ], + "_from": "filename-regex@>=2.0.0 <3.0.0", + "_id": "filename-regex@2.0.0", + "_inCache": true, + "_location": "/filename-regex", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "filename-regex@^2.0.0", + "scope": null, + "escapedName": "filename-regex", + "name": "filename-regex", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", + "_shasum": "996e3e80479b98b9897f15a8a58b3d084e926775", + "_shrinkwrap": null, + "_spec": "filename-regex@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/regexps/filename-regex/issues" + }, + "dependencies": {}, + "description": "Regular expression for matching file names, with or without extension.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "996e3e80479b98b9897f15a8a58b3d084e926775", + "tarball": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "aa0f2933322d38cf547ff4c8ced882fbd8422866", + "homepage": "https://github.com/regexps/filename-regex", + "keywords": [ + "basename", + "regular expression", + "file", + "filename", + "filepath", + "match", + "name", + "path", + "regex", + "regexp" + ], + "license": { + "type": "MIT", + "url": "https://github.com/regexps/filename-regex/blob/master/LICENSE-MIT" + }, + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "filename-regex", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/regexps/filename-regex.git" + }, + "scripts": { + "test": "mocha -R spec" + }, + "version": "2.0.0" +} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE new file mode 100755 index 00000000..fa30c4cb --- /dev/null +++ b/node_modules/fill-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fill-range/README.md b/node_modules/fill-range/README.md new file mode 100755 index 00000000..c69694a3 --- /dev/null +++ b/node_modules/fill-range/README.md @@ -0,0 +1,290 @@ +# fill-range [![NPM version](https://badge.fury.io/js/fill-range.svg)](http://badge.fury.io/js/fill-range) [![Build Status](https://travis-ci.org/jonschlinkert/fill-range.svg)](https://travis-ci.org/jonschlinkert/fill-range) + +> Fill in a range of numbers or letters, optionally passing an increment or multiplier to use. + +## Install with [npm](npmjs.org) + +```bash +npm i fill-range --save +``` + + + +- [Usage](#usage) + * [Invalid ranges](#invalid-ranges) + * [Custom function](#custom-function) + * [Special characters](#special-characters) + + [plus](#plus) + + [pipe and tilde](#pipe-and-tilde) + + [angle bracket](#angle-bracket) + + [question mark](#question-mark) +- [Other useful libs](#other-useful-libs) +- [Running tests](#running-tests) +- [Contributing](#contributing) +- [Author](#author) +- [License](#license) + +_(Table of contents generated by [verb])_ + + + +## Usage + +```js +var range = require('fill-range'); + +range('a', 'e'); +//=> ['a', 'b', 'c', 'd', 'e'] +``` + +**Params** + +```js +range(start, stop, step, options, fn); +``` + + - `start`: **{String|Number}** the number or letter to start with + - `end`: **{String|Number}** the number or letter to end with + - `step`: **{String|Number}** optionally pass the step to use. works for letters or numbers. + - `options`: **{Object}**: + + `makeRe`: return a regex-compatible string (still returned as an array for consistency) + + `step`: pass the step on the options as an alternative to passing it as an argument + + `silent`: `true` by default, set to false to throw errors for invalid ranges. + - `fn`: **{Function}** optionally [pass a function](#custom-function) to modify each character + + +**Examples** + +```js +range(1, 3) +//=> ['1', '2', '3'] + +range('1', '3') +//=> ['1', '2', '3'] + +range('0', '-5') +//=> [ '0', '-1', '-2', '-3', '-4', '-5' ] + +range(-9, 9, 3) +//=> [ '-9', '-6', '-3', '0', '3', '6', '9' ]) + +range('-1', '-10', '-2') +//=> [ '-1', '-3', '-5', '-7', '-9' ] + +range('1', '10', '2') +//=> [ '1', '3', '5', '7', '9' ] + +range('a', 'e') +//=> ['a', 'b', 'c', 'd', 'e'] + +range('a', 'e', 2) +//=> ['a', 'c', 'e'] + +range('A', 'E', 2) +//=> ['A', 'C', 'E'] +``` + +### Invalid ranges + +When an invalid range is passed, `null` is returned. + +```js +range('1.1', '2'); +//=> null + +range('a', '2'); +//=> null + +range(1, 10, 'foo'); +//=> null +``` + +If you want errors to be throw, pass `silent: false` on the options: + + +### Custom function + +Optionally pass a custom function as the third or fourth argument: + +```js +range('a', 'e', function (val, isNumber, pad, i) { + if (!isNumber) { + return String.fromCharCode(val) + i; + } + return val; +}); +//=> ['a0', 'b1', 'c2', 'd3', 'e4'] +``` + +### Special characters + +A special character may be passed as the third arg instead of a step increment. These characters can be pretty useful for brace expansion, creating file paths, test fixtures and similar use case. + +```js +range('a', 'z', SPECIAL_CHARACTER_HERE); +``` + +**Supported characters** + + - `+`: repeat the given string `n` times + - `|`: create a regex-ready string, instead of an array + - `>`: join values to single array element + - `?`: randomize the given pattern using [randomatic] + +#### plus + +Character: _(`+`)_ + +Repeat the first argument the number of times passed on the second argument. + +**Examples:** + +```js +range('a', 3, '+'); +//=> ['a', 'a', 'a'] + +range('abc', 2, '+'); +//=> ['abc', 'abc'] +``` + +#### pipe and tilde + +Characters: _(`|` and `~`)_ + +Creates a regex-capable string (either a logical `or` or a character class) from the expanded arguments. + +**Examples:** + +```js +range('a', 'c', '|'); +//=> ['(a|b|c)' + +range('a', 'c', '~'); +//=> ['[a-c]' + +range('a', 'z', '|5'); +//=> ['(a|f|k|p|u|z)' +``` + +**Automatic separator correction** + +To avoid this error: + +> `Range out of order in character class` + +Fill-range detects invalid sequences and uses the correct syntax. For example: + +**invalid** (regex) + +If you pass these: + +```js +range('a', 'z', '~5'); +// which would result in this +//=> ['[a-f-k-p-u-z]'] + +range('10', '20', '~'); +// which would result in this +//=> ['[10-20]'] +``` + +**valid** (regex) + +fill-range corrects them to this: + +```js +range('a', 'z', '~5'); +//=> ['(a|f|k|p|u|z)' + +range('10', '20', '~'); +//=> ['(10-20)' +``` + +#### angle bracket + +Character: _(`>`)_ + +Joins all values in the returned array to a single value. + +**Examples:** + +```js +range('a', 'e', '>'); +//=> ['abcde'] + +range('5', '8', '>'); +//=> ['5678'] + +range('2', '20', '2>'); +//=> ['2468101214161820'] +``` + + +#### question mark + +Character: _(`?`)_ + +Uses [randomatic] to generate randomized alpha, numeric, or alpha-numeric patterns based on the provided arguments. + +**Examples:** + +_(actual results would obviously be randomized)_ + +Generate a 5-character, uppercase, alphabetical string: + +```js +range('A', 5, '?'); +//=> ['NSHAK'] +``` + +Generate a 5-digit random number: + +```js +range('0', 5, '?'); +//=> ['36583'] +``` + +Generate a 10-character alpha-numeric string: + +```js +range('A0', 10, '?'); +//=> ['5YJD60VQNN'] +``` + +See the [randomatic] repo for all available options and or to create issues or feature requests related to randomization. + +## Other useful libs + * [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just use `micromatch.isMatch()` instead of `minimatch()`, or use `micromatch()` instead of `multimatch()`. + * [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch. + * [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification. + * [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern. + +## Running tests +Install dev dependencies: + +```bash +npm i -d && npm test +``` + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/fill-range/issues) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2014-2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on April 07, 2015._ + +[randomatic]: https://github.com/jonschlinkert/randomatic +[expand-range]: https://github.com/jonschlinkert/expand-range +[micromatch]: https://github.com/jonschlinkert/micromatch +[braces]: https://github.com/jonschlinkert/braces \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js new file mode 100755 index 00000000..5657051b --- /dev/null +++ b/node_modules/fill-range/index.js @@ -0,0 +1,408 @@ +/*! + * fill-range + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); +var isNumber = require('is-number'); +var randomize = require('randomatic'); +var repeatStr = require('repeat-string'); +var repeat = require('repeat-element'); + +/** + * Expose `fillRange` + */ + +module.exports = fillRange; + +/** + * Return a range of numbers or letters. + * + * @param {String} `a` Start of the range + * @param {String} `b` End of the range + * @param {String} `step` Increment or decrement to use. + * @param {Function} `fn` Custom function to modify each element in the range. + * @return {Array} + */ + +function fillRange(a, b, step, options, fn) { + if (a == null || b == null) { + throw new Error('fill-range expects the first and second args to be strings.'); + } + + if (typeof step === 'function') { + fn = step; options = {}; step = null; + } + + if (typeof options === 'function') { + fn = options; options = {}; + } + + if (isObject(step)) { + options = step; step = ''; + } + + var expand, regex = false, sep = ''; + var opts = options || {}; + + if (typeof opts.silent === 'undefined') { + opts.silent = true; + } + + step = step || opts.step; + + // store a ref to unmodified arg + var origA = a, origB = b; + + b = (b.toString() === '-0') ? 0 : b; + + if (opts.optimize || opts.makeRe) { + step = step ? (step += '~') : step; + expand = true; + regex = true; + sep = '~'; + } + + // handle special step characters + if (typeof step === 'string') { + var match = stepRe().exec(step); + + if (match) { + var i = match.index; + var m = match[0]; + + // repeat string + if (m === '+') { + return repeat(a, b); + + // randomize a, `b` times + } else if (m === '?') { + return [randomize(a, b)]; + + // expand right, no regex reduction + } else if (m === '>') { + step = step.substr(0, i) + step.substr(i + 1); + expand = true; + + // expand to an array, or if valid create a reduced + // string for a regex logic `or` + } else if (m === '|') { + step = step.substr(0, i) + step.substr(i + 1); + expand = true; + regex = true; + sep = m; + + // expand to an array, or if valid create a reduced + // string for a regex range + } else if (m === '~') { + step = step.substr(0, i) + step.substr(i + 1); + expand = true; + regex = true; + sep = m; + } + } else if (!isNumber(step)) { + if (!opts.silent) { + throw new TypeError('fill-range: invalid step.'); + } + return null; + } + } + + if (/[.&*()[\]^%$#@!]/.test(a) || /[.&*()[\]^%$#@!]/.test(b)) { + if (!opts.silent) { + throw new RangeError('fill-range: invalid range arguments.'); + } + return null; + } + + // has neither a letter nor number, or has both letters and numbers + // this needs to be after the step logic + if (!noAlphaNum(a) || !noAlphaNum(b) || hasBoth(a) || hasBoth(b)) { + if (!opts.silent) { + throw new RangeError('fill-range: invalid range arguments.'); + } + return null; + } + + // validate arguments + var isNumA = isNumber(zeros(a)); + var isNumB = isNumber(zeros(b)); + + if ((!isNumA && isNumB) || (isNumA && !isNumB)) { + if (!opts.silent) { + throw new TypeError('fill-range: first range argument is incompatible with second.'); + } + return null; + } + + // by this point both are the same, so we + // can use A to check going forward. + var isNum = isNumA; + var num = formatStep(step); + + // is the range alphabetical? or numeric? + if (isNum) { + // if numeric, coerce to an integer + a = +a; b = +b; + } else { + // otherwise, get the charCode to expand alpha ranges + a = a.charCodeAt(0); + b = b.charCodeAt(0); + } + + // is the pattern descending? + var isDescending = a > b; + + // don't create a character class if the args are < 0 + if (a < 0 || b < 0) { + expand = false; + regex = false; + } + + // detect padding + var padding = isPadded(origA, origB); + var res, pad, arr = []; + var ii = 0; + + // character classes, ranges and logical `or` + if (regex) { + if (shouldExpand(a, b, num, isNum, padding, opts)) { + // make sure the correct separator is used + if (sep === '|' || sep === '~') { + sep = detectSeparator(a, b, num, isNum, isDescending); + } + return wrap([origA, origB], sep, opts); + } + } + + while (isDescending ? (a >= b) : (a <= b)) { + if (padding && isNum) { + pad = padding(a); + } + + // custom function + if (typeof fn === 'function') { + res = fn(a, isNum, pad, ii++); + + // letters + } else if (!isNum) { + if (regex && isInvalidChar(a)) { + res = null; + } else { + res = String.fromCharCode(a); + } + + // numbers + } else { + res = formatPadding(a, pad); + } + + // add result to the array, filtering any nulled values + if (res !== null) arr.push(res); + + // increment or decrement + if (isDescending) { + a -= num; + } else { + a += num; + } + } + + // now that the array is expanded, we need to handle regex + // character classes, ranges or logical `or` that wasn't + // already handled before the loop + if ((regex || expand) && !opts.noexpand) { + // make sure the correct separator is used + if (sep === '|' || sep === '~') { + sep = detectSeparator(a, b, num, isNum, isDescending); + } + if (arr.length === 1 || a < 0 || b < 0) { return arr; } + return wrap(arr, sep, opts); + } + + return arr; +} + +/** + * Wrap the string with the correct regex + * syntax. + */ + +function wrap(arr, sep, opts) { + if (sep === '~') { sep = '-'; } + var str = arr.join(sep); + var pre = opts && opts.regexPrefix; + + // regex logical `or` + if (sep === '|') { + str = pre ? pre + str : str; + str = '(' + str + ')'; + } + + // regex character class + if (sep === '-') { + str = (pre && pre === '^') + ? pre + str + : str; + str = '[' + str + ']'; + } + return [str]; +} + +/** + * Check for invalid characters + */ + +function isCharClass(a, b, step, isNum, isDescending) { + if (isDescending) { return false; } + if (isNum) { return a <= 9 && b <= 9; } + if (a < b) { return step === 1; } + return false; +} + +/** + * Detect the correct separator to use + */ + +function shouldExpand(a, b, num, isNum, padding, opts) { + if (isNum && (a > 9 || b > 9)) { return false; } + return !padding && num === 1 && a < b; +} + +/** + * Detect the correct separator to use + */ + +function detectSeparator(a, b, step, isNum, isDescending) { + var isChar = isCharClass(a, b, step, isNum, isDescending); + if (!isChar) { + return '|'; + } + return '~'; +} + +/** + * Correctly format the step based on type + */ + +function formatStep(step) { + return Math.abs(step >> 0) || 1; +} + +/** + * Format padding, taking leading `-` into account + */ + +function formatPadding(ch, pad) { + var res = pad ? pad + ch : ch; + if (pad && ch.toString().charAt(0) === '-') { + res = '-' + pad + ch.toString().substr(1); + } + return res.toString(); +} + +/** + * Check for invalid characters + */ + +function isInvalidChar(str) { + var ch = toStr(str); + return ch === '\\' + || ch === '[' + || ch === ']' + || ch === '^' + || ch === '(' + || ch === ')' + || ch === '`'; +} + +/** + * Convert to a string from a charCode + */ + +function toStr(ch) { + return String.fromCharCode(ch); +} + + +/** + * Step regex + */ + +function stepRe() { + return /\?|>|\||\+|\~/g; +} + +/** + * Return true if `val` has either a letter + * or a number + */ + +function noAlphaNum(val) { + return /[a-z0-9]/i.test(val); +} + +/** + * Return true if `val` has both a letter and + * a number (invalid) + */ + +function hasBoth(val) { + return /[a-z][0-9]|[0-9][a-z]/i.test(val); +} + +/** + * Normalize zeros for checks + */ + +function zeros(val) { + if (/^-*0+$/.test(val.toString())) { + return '0'; + } + return val; +} + +/** + * Return true if `val` has leading zeros, + * or a similar valid pattern. + */ + +function hasZeros(val) { + return /[^.]\.|^-*0+[0-9]/.test(val); +} + +/** + * If the string is padded, returns a curried function with + * the a cached padding string, or `false` if no padding. + * + * @param {*} `origA` String or number. + * @return {String|Boolean} + */ + +function isPadded(origA, origB) { + if (hasZeros(origA) || hasZeros(origB)) { + var alen = length(origA); + var blen = length(origB); + + var len = alen >= blen + ? alen + : blen; + + return function (a) { + return repeatStr('0', len - length(a)); + }; + } + return false; +} + +/** + * Get the string length of `val` + */ + +function length(val) { + return val.toString().length; +} diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json new file mode 100755 index 00000000..db15646b --- /dev/null +++ b/node_modules/fill-range/package.json @@ -0,0 +1,131 @@ +{ + "_args": [ + [ + { + "raw": "fill-range@^2.1.0", + "scope": null, + "escapedName": "fill-range", + "name": "fill-range", + "rawSpec": "^2.1.0", + "spec": ">=2.1.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/expand-range" + ] + ], + "_from": "fill-range@>=2.1.0 <3.0.0", + "_id": "fill-range@2.2.3", + "_inCache": true, + "_location": "/fill-range", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "raw": "fill-range@^2.1.0", + "scope": null, + "escapedName": "fill-range", + "name": "fill-range", + "rawSpec": "^2.1.0", + "spec": ">=2.1.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/expand-range" + ], + "_resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "_shasum": "50b77dfd7e469bc7492470963699fe7a8485a723", + "_shrinkwrap": null, + "_spec": "fill-range@^2.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/expand-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "dependencies": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^1.1.3", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + }, + "description": "Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.", + "devDependencies": { + "benchmarked": "^0.1.3", + "chalk": "^0.5.1", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "50b77dfd7e469bc7492470963699fe7a8485a723", + "tarball": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "6cb50d5c679d9e6d9e8ad97bb2efd63a8c8da610", + "homepage": "https://github.com/jonschlinkert/fill-range", + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "expand", + "expansion", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "sh" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + }, + { + "name": "es128", + "email": "elan.shanker+npm@gmail.com" + } + ], + "name": "fill-range", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/fill-range.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "micromatch", + "expand-range", + "braces", + "is-glob" + ] + } + }, + "version": "2.2.3" +} diff --git a/node_modules/finalhandler/HISTORY.md b/node_modules/finalhandler/HISTORY.md new file mode 100755 index 00000000..e7fb43db --- /dev/null +++ b/node_modules/finalhandler/HISTORY.md @@ -0,0 +1,138 @@ +1.0.1 / 2017-03-21 +================== + + * Fix missing `` in HTML document + * deps: debug@2.6.3 + - Fix: `DEBUG_MAX_ARRAY_LENGTH` + +1.0.0 / 2017-02-15 +================== + + * Fix exception when `err` cannot be converted to a string + * Fully URL-encode the pathname in the 404 message + * Only include the pathname in the 404 message + * Send complete HTML document + * Set `Content-Security-Policy: default-src 'self'` header + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +0.5.1 / 2016-11-12 +================== + + * Fix exception when `err.headers` is not an object + * deps: statuses@~1.3.1 + * perf: hoist regular expressions + * perf: remove duplicate validation path + +0.5.0 / 2016-06-15 +================== + + * Change invalid or non-numeric status code to 500 + * Overwrite status message to match set status code + * Prefer `err.statusCode` if `err.status` is invalid + * Set response headers from `err.headers` object + * Use `statuses` instead of `http` module for status messages + - Includes all defined status messages + +0.4.1 / 2015-12-02 +================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + +0.4.0 / 2015-06-14 +================== + + * Fix a false-positive when unpiping in Node.js 0.8 + * Support `statusCode` property on `Error` objects + * Use `unpipe` module for unpiping requests + * deps: escape-html@1.0.2 + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * perf: enable strict mode + * perf: remove argument reassignment + +0.3.6 / 2015-05-11 +================== + + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +0.3.5 / 2015-04-22 +================== + + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + +0.3.4 / 2015-03-15 +================== + + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +0.3.3 / 2015-01-01 +================== + + * deps: debug@~2.1.1 + * deps: on-finished@~2.2.0 + +0.3.2 / 2014-10-22 +================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + +0.3.1 / 2014-10-16 +================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + +0.3.0 / 2014-09-17 +================== + + * Terminate in progress response only on error + * Use `on-finished` to determine request status + +0.2.0 / 2014-09-03 +================== + + * Set `X-Content-Type-Options: nosniff` header + * deps: debug@~2.0.0 + +0.1.0 / 2014-07-16 +================== + + * Respond after request fully read + - prevents hung responses and socket hang ups + * deps: debug@1.0.4 + +0.0.3 / 2014-07-11 +================== + + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + +0.0.2 / 2014-06-19 +================== + + * Handle invalid status codes + +0.0.1 / 2014-06-05 +================== + + * deps: debug@1.0.2 + +0.0.0 / 2014-06-05 +================== + + * Extracted from connect/express diff --git a/node_modules/finalhandler/LICENSE b/node_modules/finalhandler/LICENSE new file mode 100755 index 00000000..fb309827 --- /dev/null +++ b/node_modules/finalhandler/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/finalhandler/README.md b/node_modules/finalhandler/README.md new file mode 100755 index 00000000..84c3d2af --- /dev/null +++ b/node_modules/finalhandler/README.md @@ -0,0 +1,146 @@ +# finalhandler + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Node.js function to invoke as the final step to respond to HTTP request. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install finalhandler +``` + +## API + +``` +var finalhandler = require('finalhandler') +``` + +### finalhandler(req, res, [options]) + +Returns function to be invoked as the final step for the given `req` and `res`. +This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will +write out a 404 response to the `res`. If it is truthy, an error response will +be written out to the `res`. + +When an error is written, the following information is added to the response: + + * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If + this value is outside the 4xx or 5xx range, it will be set to 500. + * The `res.statusMessage` is set according to the status code. + * The body will be the HTML of the status code message if `env` is + `'production'`, otherwise will be `err.stack`. + * Any headers specified in an `err.headers` object. + +The final handler will also unpipe anything from `req` when it is invoked. + +#### options.env + +By default, the environment is determined by `NODE_ENV` variable, but it can be +overridden by this option. + +#### options.onerror + +Provide a function to be called with the `err` when it exists. Can be used for +writing errors to a central location without excessive function generation. Called +as `onerror(err, req, res)`. + +## Examples + +### always 404 + +```js +var finalhandler = require('finalhandler') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + done() +}) + +server.listen(3000) +``` + +### perform simple action + +```js +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + + fs.readFile('index.html', function (err, buf) { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) +``` + +### use with middleware-style functions + +```js +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') + +var serve = serveStatic('public') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + serve(req, res, done) +}) + +server.listen(3000) +``` + +### keep log of all errors + +```js +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res, {onerror: logerror}) + + fs.readFile('index.html', function (err, buf) { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) + +function logerror (err) { + console.error(err.stack || err.toString()) +} +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/finalhandler.svg +[npm-url]: https://npmjs.org/package/finalhandler +[node-image]: https://img.shields.io/node/v/finalhandler.svg +[node-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg +[travis-url]: https://travis-ci.org/pillarjs/finalhandler +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master +[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg +[downloads-url]: https://npmjs.org/package/finalhandler diff --git a/node_modules/finalhandler/index.js b/node_modules/finalhandler/index.js new file mode 100755 index 00000000..87974ca0 --- /dev/null +++ b/node_modules/finalhandler/index.js @@ -0,0 +1,300 @@ +/*! + * finalhandler + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('finalhandler') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var onFinished = require('on-finished') +var parseUrl = require('parseurl') +var statuses = require('statuses') +var unpipe = require('unpipe') + +/** + * Module variables. + * @private + */ + +var DOUBLE_SPACE_REGEXP = /\x20{2}/g +var NEWLINE_REGEXP = /\n/g + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } +var isFinished = onFinished.isFinished + +/** + * Create a minimal HTML document. + * + * @param {string} message + * @private + */ + +function createHtmlDocument (message) { + var body = escapeHtml(message) + .replace(NEWLINE_REGEXP, '
      ') + .replace(DOUBLE_SPACE_REGEXP, '  ') + + return '\n' + + '\n' + + '\n' + + '\n' + + 'Error\n' + + '\n' + + '\n' + + '
      ' + body + '
      \n' + + '\n' + + '\n' +} + +/** + * Module exports. + * @public + */ + +module.exports = finalhandler + +/** + * Create a function to handle the final response. + * + * @param {Request} req + * @param {Response} res + * @param {Object} [options] + * @return {Function} + * @public + */ + +function finalhandler (req, res, options) { + var opts = options || {} + + // get environment + var env = opts.env || process.env.NODE_ENV || 'development' + + // get error callback + var onerror = opts.onerror + + return function (err) { + var headers + var msg + var status + + // ignore 404 on in-flight response + if (!err && res._header) { + debug('cannot 404 after headers sent') + return + } + + // unhandled error + if (err) { + // respect status code from error + status = getErrorStatusCode(err) + + // respect headers from error + if (status !== undefined) { + headers = getErrorHeaders(err) + } + + // fallback to status code on response + if (status === undefined) { + status = getResponseStatusCode(res) + } + + // get error message + msg = getErrorMessage(err, status, env) + } else { + // not found + status = 404 + msg = 'Cannot ' + req.method + ' ' + encodeUrl(parseUrl.original(req).pathname) + } + + debug('default %s', status) + + // schedule onerror callback + if (err && onerror) { + defer(onerror, err, req, res) + } + + // cannot actually respond + if (res._header) { + debug('cannot %d after headers sent', status) + req.socket.destroy() + return + } + + // send response + send(req, res, status, headers, msg) + } +} + +/** + * Get headers from Error object. + * + * @param {Error} err + * @return {object} + * @private + */ + +function getErrorHeaders (err) { + if (!err.headers || typeof err.headers !== 'object') { + return undefined + } + + var headers = Object.create(null) + var keys = Object.keys(err.headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + headers[key] = err.headers[key] + } + + return headers +} + +/** + * Get message from Error object, fallback to status message. + * + * @param {Error} err + * @param {number} status + * @param {string} env + * @return {string} + * @private + */ + +function getErrorMessage (err, status, env) { + var msg + + if (env !== 'production') { + // use err.stack, which typically includes err.message + msg = err.stack + + // fallback to err.toString() when possible + if (!msg && typeof err.toString === 'function') { + msg = err.toString() + } + } + + return msg || statuses[status] +} + +/** + * Get status code from Error object. + * + * @param {Error} err + * @return {number} + * @private + */ + +function getErrorStatusCode (err) { + // check err.status + if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { + return err.status + } + + // check err.statusCode + if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode + } + + return undefined +} + +/** + * Get status code from response. + * + * @param {OutgoingMessage} res + * @return {number} + * @private + */ + +function getResponseStatusCode (res) { + var status = res.statusCode + + // default status code to 500 if outside valid range + if (typeof status !== 'number' || status < 400 || status > 599) { + status = 500 + } + + return status +} + +/** + * Send response. + * + * @param {IncomingMessage} req + * @param {OutgoingMessage} res + * @param {number} status + * @param {object} headers + * @param {string} message + * @private + */ + +function send (req, res, status, headers, message) { + function write () { + // response body + var body = createHtmlDocument(message) + + // response status + res.statusCode = status + res.statusMessage = statuses[status] + + // response headers + setHeaders(res, headers) + + // security headers + res.setHeader('Content-Security-Policy', "default-src 'self'") + res.setHeader('X-Content-Type-Options', 'nosniff') + + // standard headers + res.setHeader('Content-Type', 'text/html; charset=utf-8') + res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')) + + if (req.method === 'HEAD') { + res.end() + return + } + + res.end(body, 'utf8') + } + + if (isFinished(req)) { + write() + return + } + + // unpipe everything from the request + unpipe(req) + + // flush the request + onFinished(req, write) + req.resume() +} + +/** + * Set response headers from an object. + * + * @param {OutgoingMessage} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + if (!headers) { + return + } + + var keys = Object.keys(headers) + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/node_modules/finalhandler/package.json b/node_modules/finalhandler/package.json new file mode 100755 index 00000000..74678652 --- /dev/null +++ b/node_modules/finalhandler/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "finalhandler@~1.0.0", + "scope": null, + "escapedName": "finalhandler", + "name": "finalhandler", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "finalhandler@>=1.0.0 <1.1.0", + "_id": "finalhandler@1.0.1", + "_inCache": true, + "_location": "/finalhandler", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/finalhandler-1.0.1.tgz_1490162581058_0.40150946634821594" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "finalhandler@~1.0.0", + "scope": null, + "escapedName": "finalhandler", + "name": "finalhandler", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.1.tgz", + "_shasum": "bcd15d1689c0e5ed729b6f7f541a6df984117db8", + "_shrinkwrap": null, + "_spec": "finalhandler@~1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "bugs": { + "url": "https://github.com/pillarjs/finalhandler/issues" + }, + "dependencies": { + "debug": "2.6.3", + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.1", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" + }, + "description": "Node.js final http responder", + "devDependencies": { + "eslint": "3.18.0", + "eslint-config-standard": "7.1.0", + "eslint-plugin-markdown": "1.0.0-beta.4", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "2.1.1", + "istanbul": "0.4.5", + "mocha": "2.5.3", + "readable-stream": "2.1.2", + "supertest": "1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "bcd15d1689c0e5ed729b6f7f541a6df984117db8", + "tarball": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.1.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "gitHead": "7643136085e8c178902a93d6ef43ad42cd3936f1", + "homepage": "https://github.com/pillarjs/finalhandler#readme", + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "finalhandler", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/pillarjs/finalhandler.git" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + }, + "version": "1.0.1" +} diff --git a/node_modules/find-cache-dir/index.js b/node_modules/find-cache-dir/index.js new file mode 100755 index 00000000..85928628 --- /dev/null +++ b/node_modules/find-cache-dir/index.js @@ -0,0 +1,33 @@ +'use strict'; +var path = require('path'); +var commonDir = require('commondir'); +var pkgDir = require('pkg-dir'); +var mkdirp = require('mkdirp'); + +module.exports = function (options) { + var name = options.name; + var dir = options.cwd; + if (options.files) { + dir = commonDir(dir, options.files); + } else { + dir = dir || process.cwd(); + } + + dir = pkgDir.sync(dir); + + if (dir) { + dir = path.join(dir, 'node_modules', '.cache', name); + + if (dir && options.create) { + mkdirp.sync(dir); + } + + if (options.thunk) { + return function () { + return path.join.apply(path, [dir].concat(Array.prototype.slice.call(arguments))); + }; + } + } + + return dir; +}; diff --git a/node_modules/find-cache-dir/license b/node_modules/find-cache-dir/license new file mode 100755 index 00000000..ad5d021e --- /dev/null +++ b/node_modules/find-cache-dir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) James Talmage (github.com/jamestalmage) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/find-cache-dir/package.json b/node_modules/find-cache-dir/package.json new file mode 100755 index 00000000..8caba3ef --- /dev/null +++ b/node_modules/find-cache-dir/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "find-cache-dir@^0.1.1", + "scope": null, + "escapedName": "find-cache-dir", + "name": "find-cache-dir", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-loader" + ] + ], + "_from": "find-cache-dir@>=0.1.1 <0.2.0", + "_id": "find-cache-dir@0.1.1", + "_inCache": true, + "_location": "/find-cache-dir", + "_nodeVersion": "5.2.0", + "_npmUser": { + "name": "jamestalmage", + "email": "james@talmage.io" + }, + "_npmVersion": "3.5.2", + "_phantomChildren": {}, + "_requested": { + "raw": "find-cache-dir@^0.1.1", + "scope": null, + "escapedName": "find-cache-dir", + "name": "find-cache-dir", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-loader" + ], + "_resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "_shasum": "c8defae57c8a52a8a784f9e31c57c742e993a0b9", + "_shrinkwrap": null, + "_spec": "find-cache-dir@^0.1.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-loader", + "author": { + "name": "James Talmage", + "email": "james@talmage.io", + "url": "github.com/jamestalmage" + }, + "bugs": { + "url": "https://github.com/jamestalmage/find-cache-dir/issues" + }, + "dependencies": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" + }, + "description": "My well-made module", + "devDependencies": { + "ava": "^0.8.0", + "coveralls": "^2.11.6", + "nyc": "^5.0.1", + "rimraf": "^2.5.0", + "xo": "^0.12.1" + }, + "directories": {}, + "dist": { + "shasum": "c8defae57c8a52a8a784f9e31c57c742e993a0b9", + "tarball": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "722fff2aa8fbf666d37192917d2e1fb0e1287489", + "homepage": "https://github.com/jamestalmage/find-cache-dir#readme", + "keywords": [ + "cache", + "directory", + "dir" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jamestalmage", + "email": "james@talmage.io" + } + ], + "name": "find-cache-dir", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jamestalmage/find-cache-dir.git" + }, + "scripts": { + "test": "xo && nyc --reporter=lcov --reporter=text ava" + }, + "version": "0.1.1" +} diff --git a/node_modules/find-cache-dir/readme.md b/node_modules/find-cache-dir/readme.md new file mode 100755 index 00000000..d0b71b19 --- /dev/null +++ b/node_modules/find-cache-dir/readme.md @@ -0,0 +1,108 @@ +# find-cache-dir [![Build Status](https://travis-ci.org/jamestalmage/find-cache-dir.svg?branch=master)](https://travis-ci.org/jamestalmage/find-cache-dir) [![Coverage Status](https://coveralls.io/repos/jamestalmage/find-cache-dir/badge.svg?branch=master&service=github)](https://coveralls.io/github/jamestalmage/find-cache-dir?branch=master) + +> Finds the common standard cache directory. + +Recently the [`nyc`](https://www.npmjs.com/package/nyc) and [`AVA`](https://www.npmjs.com/package/ava) projects decided to standardize on a common directory structure for storing cache information: + +```sh +# nyc +./node_modules/.cache/nyc + +# ava +./node_modules/.cache/ava + +# your-module +./node_modules/.cache/your-module +``` + +This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent: + +``` +rm -rf ./node_modules/.cache +``` + +If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below. + + +## Install + +``` +$ npm install --save find-cache-dir +``` + + +## Usage + +```js +const findCacheDir = require('find-cache-dir'); + +findCacheDir({name: 'unicorns'}); +//=> /user/path/node-modules/.cache/unicorns +``` + + +## API + +### findCacheDir([options]) + +Finds the cache dir using the supplied options. The algorithm tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `null` if `package.json` was never found. + +#### options + +##### name + +*Required* +Type: `string` + +This should be the same as your project name in `package.json`. + +##### files + +Type: `array` of `string` + +An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the `cwd` option below. + +##### cwd + +Type: `string` +Default `process.cwd()` + +The directory to start searching for a `package.json` from. + +##### create + +Type: `boolean` +Default `false` + +If `true`, the directory will be created synchronously before returning. + +##### thunk + +Type: `boolean` +Default `false` + +If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`. + +```js +const thunk = findCacheDir({name: 'foo', thunk: true}); + +thunk(); +//=> /some/path/node_modules/.cache/foo + +thunk('bar.js') +//=> /some/path/node_modules/.cache/foo/bar.js + +thunk('baz', 'quz.js') +//=> /some/path/node_modules/.cache/foo/baz/quz.js +``` + +This is helpful for actually putting actual files in the cache! + +## Adopters + +- [`NYC`](https://www.npmjs.com/package/nyc) +- [`AVA`](https://www.npmjs.com/package/ava) + +## License + +MIT © [James Talmage](http://github.com/jamestalmage) diff --git a/node_modules/find-up/index.js b/node_modules/find-up/index.js new file mode 100755 index 00000000..7ff0e2b7 --- /dev/null +++ b/node_modules/find-up/index.js @@ -0,0 +1,53 @@ +'use strict'; +var path = require('path'); +var pathExists = require('path-exists'); +var Promise = require('pinkie-promise'); + +function splitPath(x) { + return path.resolve(x || '').split(path.sep); +} + +function join(parts, filename) { + return path.resolve(parts.join(path.sep) + path.sep, filename); +} + +module.exports = function (filename, opts) { + opts = opts || {}; + + var parts = splitPath(opts.cwd); + + return new Promise(function (resolve) { + (function find() { + var fp = join(parts, filename); + + pathExists(fp).then(function (exists) { + if (exists) { + resolve(fp); + } else if (parts.pop()) { + find(); + } else { + resolve(null); + } + }); + })(); + }); +}; + +module.exports.sync = function (filename, opts) { + opts = opts || {}; + + var parts = splitPath(opts.cwd); + var len = parts.length; + + while (len--) { + var fp = join(parts, filename); + + if (pathExists.sync(fp)) { + return fp; + } + + parts.pop(); + } + + return null; +}; diff --git a/node_modules/find-up/license b/node_modules/find-up/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/find-up/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/find-up/package.json b/node_modules/find-up/package.json new file mode 100755 index 00000000..31490cc6 --- /dev/null +++ b/node_modules/find-up/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "find-up@^1.0.0", + "scope": null, + "escapedName": "find-up", + "name": "find-up", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pkg-dir" + ] + ], + "_from": "find-up@>=1.0.0 <2.0.0", + "_id": "find-up@1.1.2", + "_inCache": true, + "_location": "/find-up", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/find-up-1.1.2.tgz_1457199955637_0.3445317060686648" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "raw": "find-up@^1.0.0", + "scope": null, + "escapedName": "find-up", + "name": "find-up", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/pkg-dir" + ], + "_resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "_shasum": "6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f", + "_shrinkwrap": null, + "_spec": "find-up@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pkg-dir", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/find-up/issues" + }, + "dependencies": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "description": "Find a file by walking up parent directories", + "devDependencies": { + "ava": "*", + "tempfile": "^1.1.1", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f", + "tarball": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f2d7c1ff74fbac82b2cff038e311ef4b075d9184", + "homepage": "https://github.com/sindresorhus/find-up", + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "find-up", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/find-up.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.1.2" +} diff --git a/node_modules/find-up/readme.md b/node_modules/find-up/readme.md new file mode 100755 index 00000000..9ea0611c --- /dev/null +++ b/node_modules/find-up/readme.md @@ -0,0 +1,72 @@ +# find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) + +> Find a file by walking up parent directories + + +## Install + +``` +$ npm install --save find-up +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +```js +// example.js +const findUp = require('find-up'); + +findUp('unicorn.png').then(filepath => { + console.log(filepath); + //=> '/Users/sindresorhus/unicorn.png' +}); +``` + + +## API + +### findUp(filename, [options]) + +Returns a promise for the filepath or `null`. + +### findUp.sync(filename, [options]) + +Returns a filepath or `null`. + +#### filename + +Type: `string` + +Filename of the file to find. + +#### options + +##### cwd + +Type: `string` +Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/for-in/LICENSE b/node_modules/for-in/LICENSE new file mode 100755 index 00000000..d734237b --- /dev/null +++ b/node_modules/for-in/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/for-in/README.md b/node_modules/for-in/README.md new file mode 100755 index 00000000..874e1895 --- /dev/null +++ b/node_modules/for-in/README.md @@ -0,0 +1,85 @@ +# for-in [![NPM version](https://img.shields.io/npm/v/for-in.svg?style=flat)](https://www.npmjs.com/package/for-in) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![NPM total downloads](https://img.shields.io/npm/dt/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-in.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-in) + +> Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save for-in +``` + +## Usage + +```js +var forIn = require('for-in'); + +var obj = {a: 'foo', b: 'bar', c: 'baz'}; +var values = []; +var keys = []; + +forIn(obj, function (value, key, o) { + keys.push(key); + values.push(value); +}); + +console.log(keys); +//=> ['a', 'b', 'c']; + +console.log(values); +//=> ['foo', 'bar', 'baz']; +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") +* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 16 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulirish](https://github.com/paulirish) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 28, 2017._ \ No newline at end of file diff --git a/node_modules/for-in/index.js b/node_modules/for-in/index.js new file mode 100755 index 00000000..0b5f95f0 --- /dev/null +++ b/node_modules/for-in/index.js @@ -0,0 +1,16 @@ +/*! + * for-in + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function forIn(obj, fn, thisArg) { + for (var key in obj) { + if (fn.call(thisArg, obj[key], key, obj) === false) { + break; + } + } +}; diff --git a/node_modules/for-in/package.json b/node_modules/for-in/package.json new file mode 100755 index 00000000..0be94189 --- /dev/null +++ b/node_modules/for-in/package.json @@ -0,0 +1,146 @@ +{ + "_args": [ + [ + { + "raw": "for-in@^1.0.1", + "scope": null, + "escapedName": "for-in", + "name": "for-in", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/for-own" + ] + ], + "_from": "for-in@>=1.0.1 <2.0.0", + "_id": "for-in@1.0.2", + "_inCache": true, + "_location": "/for-in", + "_nodeVersion": "7.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/for-in-1.0.2.tgz_1488298375632_0.9562143329530954" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "for-in@^1.0.1", + "scope": null, + "escapedName": "for-in", + "name": "for-in", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/for-own" + ], + "_resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "_shasum": "81068d295a8142ec0ac726c6e2200c30fb6d5e80", + "_shrinkwrap": null, + "_spec": "for-in@^1.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/for-own", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/for-in/issues" + }, + "contributors": [ + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Paul Irish", + "url": "http://paulirish.com" + } + ], + "dependencies": {}, + "description": "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "directories": {}, + "dist": { + "shasum": "81068d295a8142ec0ac726c6e2200c30fb6d5e80", + "tarball": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "5f97ad4f6556e938d9b71614259ddd8044a081e3", + "homepage": "https://github.com/jonschlinkert/for-in", + "keywords": [ + "for", + "for-in", + "for-own", + "has", + "has-own", + "hasOwn", + "in", + "key", + "keys", + "object", + "own", + "value" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "for-in", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/for-in.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "collection-map", + "for-own" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/for-own/LICENSE b/node_modules/for-own/LICENSE new file mode 100755 index 00000000..d290fe00 --- /dev/null +++ b/node_modules/for-own/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, 2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/for-own/README.md b/node_modules/for-own/README.md new file mode 100755 index 00000000..fd56877a --- /dev/null +++ b/node_modules/for-own/README.md @@ -0,0 +1,85 @@ +# for-own [![NPM version](https://img.shields.io/npm/v/for-own.svg?style=flat)](https://www.npmjs.com/package/for-own) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![NPM total downloads](https://img.shields.io/npm/dt/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-own.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-own) + +> Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save for-own +``` + +## Usage + +```js +var forOwn = require('for-own'); + +var obj = {a: 'foo', b: 'bar', c: 'baz'}; +var values = []; +var keys = []; + +forOwn(obj, function (value, key, o) { + keys.push(key); + values.push(value); +}); + +console.log(keys); +//=> ['a', 'b', 'c']; + +console.log(values); +//=> ['foo', 'bar', 'baz']; +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") +* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 10 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [javiercejudo](https://github.com/javiercejudo) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 26, 2017._ \ No newline at end of file diff --git a/node_modules/for-own/index.js b/node_modules/for-own/index.js new file mode 100755 index 00000000..74e2d755 --- /dev/null +++ b/node_modules/for-own/index.js @@ -0,0 +1,19 @@ +/*! + * for-own + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var forIn = require('for-in'); +var hasOwn = Object.prototype.hasOwnProperty; + +module.exports = function forOwn(obj, fn, thisArg) { + forIn(obj, function(val, key) { + if (hasOwn.call(obj, key)) { + return fn.call(thisArg, obj[key], key, obj); + } + }); +}; diff --git a/node_modules/for-own/package.json b/node_modules/for-own/package.json new file mode 100755 index 00000000..130815da --- /dev/null +++ b/node_modules/for-own/package.json @@ -0,0 +1,148 @@ +{ + "_args": [ + [ + { + "raw": "for-own@^0.1.4", + "scope": null, + "escapedName": "for-own", + "name": "for-own", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/object.omit" + ] + ], + "_from": "for-own@>=0.1.4 <0.2.0", + "_id": "for-own@0.1.5", + "_inCache": true, + "_location": "/for-own", + "_nodeVersion": "7.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/for-own-0.1.5.tgz_1488159172480_0.8725875311065465" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "for-own@^0.1.4", + "scope": null, + "escapedName": "for-own", + "name": "for-own", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/object.omit" + ], + "_resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "_shasum": "5265c681a4f294dabbf17c9509b6763aa84510ce", + "_shrinkwrap": null, + "_spec": "for-own@^0.1.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/object.omit", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/for-own/issues" + }, + "contributors": [ + { + "name": "Javier Cejudo", + "email": "javier@javiercejudo.com", + "url": "https://www.javiercejudo.com" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "for-in": "^1.0.1" + }, + "description": "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "directories": {}, + "dist": { + "shasum": "5265c681a4f294dabbf17c9509b6763aa84510ce", + "tarball": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "e64ee3492f218c812011ec3feff4194e9272d2a1", + "homepage": "https://github.com/jonschlinkert/for-own", + "keywords": [ + "for", + "for-in", + "for-own", + "has", + "has-own", + "hasOwn", + "key", + "keys", + "object", + "own", + "value" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "for-own", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/for-own.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "collection-map", + "for-in" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.5" +} diff --git a/node_modules/forwarded/HISTORY.md b/node_modules/forwarded/HISTORY.md new file mode 100755 index 00000000..97fa1d10 --- /dev/null +++ b/node_modules/forwarded/HISTORY.md @@ -0,0 +1,4 @@ +0.1.0 / 2014-09-21 +================== + + * Initial release diff --git a/node_modules/forwarded/LICENSE b/node_modules/forwarded/LICENSE new file mode 100755 index 00000000..b7dce6cf --- /dev/null +++ b/node_modules/forwarded/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/forwarded/README.md b/node_modules/forwarded/README.md new file mode 100755 index 00000000..2b4988fa --- /dev/null +++ b/node_modules/forwarded/README.md @@ -0,0 +1,53 @@ +# forwarded + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Parse HTTP X-Forwarded-For header + +## Installation + +```sh +$ npm install forwarded +``` + +## API + +```js +var forwarded = require('forwarded') +``` + +### forwarded(req) + +```js +var addresses = forwarded(req) +``` + +Parse the `X-Forwarded-For` header from the request. Returns an array +of the addresses, including the socket address for the `req`. In reverse +order (i.e. index `0` is the socket address and the last index is the +furthest address, typically the end-user). + +## Testing + +```sh +$ npm test +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/forwarded.svg?style=flat +[npm-url]: https://npmjs.org/package/forwarded +[node-version-image]: https://img.shields.io/node/v/forwarded.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/forwarded.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/forwarded +[coveralls-image]: https://img.shields.io/coveralls/jshttp/forwarded.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/forwarded?branch=master +[downloads-image]: https://img.shields.io/npm/dm/forwarded.svg?style=flat +[downloads-url]: https://npmjs.org/package/forwarded diff --git a/node_modules/forwarded/index.js b/node_modules/forwarded/index.js new file mode 100755 index 00000000..2f5c3408 --- /dev/null +++ b/node_modules/forwarded/index.js @@ -0,0 +1,35 @@ +/*! + * forwarded + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = forwarded + +/** + * Get all addresses in the request, using the `X-Forwarded-For` header. + * + * @param {Object} req + * @api public + */ + +function forwarded(req) { + if (!req) { + throw new TypeError('argument req is required') + } + + // simple header parsing + var proxyAddrs = (req.headers['x-forwarded-for'] || '') + .split(/ *, */) + .filter(Boolean) + .reverse() + var socketAddr = req.connection.remoteAddress + var addrs = [socketAddr].concat(proxyAddrs) + + // return all addresses + return addrs +} diff --git a/node_modules/forwarded/package.json b/node_modules/forwarded/package.json new file mode 100755 index 00000000..e8558cc0 --- /dev/null +++ b/node_modules/forwarded/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "forwarded@~0.1.0", + "scope": null, + "escapedName": "forwarded", + "name": "forwarded", + "rawSpec": "~0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/proxy-addr" + ] + ], + "_from": "forwarded@>=0.1.0 <0.2.0", + "_id": "forwarded@0.1.0", + "_inCache": true, + "_location": "/forwarded", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "raw": "forwarded@~0.1.0", + "scope": null, + "escapedName": "forwarded", + "name": "forwarded", + "rawSpec": "~0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/proxy-addr" + ], + "_resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz", + "_shasum": "19ef9874c4ae1c297bcf078fde63a09b66a84363", + "_shrinkwrap": null, + "_spec": "forwarded@~0.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/proxy-addr", + "bugs": { + "url": "https://github.com/jshttp/forwarded/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "Parse HTTP X-Forwarded-For header", + "devDependencies": { + "istanbul": "0.3.2", + "mocha": "~1.21.4" + }, + "directories": {}, + "dist": { + "shasum": "19ef9874c4ae1c297bcf078fde63a09b66a84363", + "tarball": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "e9a9faeb3cfaadf40eb57d144fff26bca9b818e8", + "homepage": "https://github.com/jshttp/forwarded", + "keywords": [ + "x-forwarded-for", + "http", + "req" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "forwarded", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/forwarded.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "0.1.0" +} diff --git a/node_modules/fresh/HISTORY.md b/node_modules/fresh/HISTORY.md new file mode 100755 index 00000000..edd6c058 --- /dev/null +++ b/node_modules/fresh/HISTORY.md @@ -0,0 +1,58 @@ +0.5.0 / 2017-02-21 +================== + + * Fix incorrect result when `If-None-Match` has both `*` and ETags + * Fix weak `ETag` matching to match spec + * perf: delay reading header values until needed + * perf: skip checking modified time if ETag check failed + * perf: skip parsing `If-None-Match` when no `ETag` header + * perf: use `Date.parse` instead of `new Date` + +0.4.0 / 2017-02-05 +================== + + * Fix false detection of `no-cache` request directive + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove duplicate conditional + * perf: remove unnecessary boolean coercions + +0.3.0 / 2015-05-12 +================== + + * Add weak `ETag` matching support + +0.2.4 / 2014-09-07 +================== + + * Support Node.js 0.6 + +0.2.3 / 2014-09-07 +================== + + * Move repository to jshttp + +0.2.2 / 2014-02-19 +================== + + * Revert "Fix for blank page on Safari reload" + +0.2.1 / 2014-01-29 +================== + + * Fix for blank page on Safari reload + +0.2.0 / 2013-08-11 +================== + + * Return stale for `Cache-Control: no-cache` + +0.1.0 / 2012-06-15 +================== + + * Add `If-None-Match: *` support + +0.0.1 / 2012-06-10 +================== + + * Initial release diff --git a/node_modules/fresh/LICENSE b/node_modules/fresh/LICENSE new file mode 100755 index 00000000..1434ade7 --- /dev/null +++ b/node_modules/fresh/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2016-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fresh/README.md b/node_modules/fresh/README.md new file mode 100755 index 00000000..d2b63e59 --- /dev/null +++ b/node_modules/fresh/README.md @@ -0,0 +1,113 @@ +# fresh + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +HTTP response freshness testing + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +``` +$ npm install fresh +``` + +## API + +```js +var fresh = require('fresh') +``` + +### fresh(reqHeaders, resHeaders) + +Check freshness of the response using request and response headers. + +When the response is still "fresh" in the client's cache `true` is +returned, otherwise `false` is returned to indicate that the client +cache is now stale and the full response should be sent. + +When a client sends the `Cache-Control: no-cache` request header to +indicate an end-to-end reload request, this module will return `false` +to make handling these requests transparent. + +## Known Issues + +This module is designed to only follow the HTTP specifications, not +to work-around all kinda of client bugs (especially since this module +typically does not recieve enough information to understand what the +client actually is). + +There is a known issue that in certain versions of Safari, Safari +will incorrectly make a request that allows this module to validate +freshness of the resource even when Safari does not have a +representation of the resource in the cache. The module +[jumanji](https://www.npmjs.com/package/jumanji) can be used in +an Express application to work-around this issue and also provides +links to further reading on this Safari bug. + +## Example + +### API usage + +```js +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { 'etag': '"bar"' } +fresh(reqHeaders, resHeaders) +// => false + +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { 'etag': '"foo"' } +fresh(reqHeaders, resHeaders) +// => true +``` + +### Using with Node.js http server + +```js +var fresh = require('fresh') +var http = require('http') + +var server = http.createServer(function (req, res) { + // perform server logic + // ... including adding ETag / Last-Modified response headers + + if (isFresh(req, res)) { + // client has a fresh copy of resource + res.statusCode = 304 + res.end() + return + } + + // send the resource +}) + +function isFresh (req, res) { + return fresh(req.headers, { + 'etag': res.getHeader('ETag'), + 'last-modified': res.getHeader('Last-Modified') + }) +} + +server.listen(3000) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/fresh.svg +[npm-url]: https://npmjs.org/package/fresh +[node-version-image]: https://img.shields.io/node/v/fresh.svg +[node-version-url]: https://nodejs.org/en/ +[travis-image]: https://img.shields.io/travis/jshttp/fresh/master.svg +[travis-url]: https://travis-ci.org/jshttp/fresh +[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master +[downloads-image]: https://img.shields.io/npm/dm/fresh.svg +[downloads-url]: https://npmjs.org/package/fresh diff --git a/node_modules/fresh/index.js b/node_modules/fresh/index.js new file mode 100755 index 00000000..bd9812ef --- /dev/null +++ b/node_modules/fresh/index.js @@ -0,0 +1,81 @@ +/*! + * fresh + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2016-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to check for no-cache token in Cache-Control. + * @private + */ + +var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/ + +/** + * Simple expression to split token list. + * @private + */ + +var TOKEN_LIST_REGEXP = / *, */ + +/** + * Module exports. + * @public + */ + +module.exports = fresh + +/** + * Check freshness of the response using request and response headers. + * + * @param {Object} reqHeaders + * @param {Object} resHeaders + * @return {Boolean} + * @public + */ + +function fresh (reqHeaders, resHeaders) { + // fields + var modifiedSince = reqHeaders['if-modified-since'] + var noneMatch = reqHeaders['if-none-match'] + + // unconditional request + if (!modifiedSince && !noneMatch) { + return false + } + + // Always return stale when Cache-Control: no-cache + // to support end-to-end reload requests + // https://tools.ietf.org/html/rfc2616#section-14.9.4 + var cacheControl = reqHeaders['cache-control'] + if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { + return false + } + + // if-none-match + if (noneMatch && noneMatch !== '*') { + var etag = resHeaders['etag'] + var etagStale = !etag || noneMatch.split(TOKEN_LIST_REGEXP).every(function (match) { + return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag + }) + + if (etagStale) { + return false + } + } + + // if-modified-since + if (modifiedSince) { + var lastModified = resHeaders['last-modified'] + var modifiedStale = !lastModified || Date.parse(lastModified) > Date.parse(modifiedSince) + + if (modifiedStale) { + return false + } + } + + return true +} diff --git a/node_modules/fresh/package.json b/node_modules/fresh/package.json new file mode 100755 index 00000000..66508274 --- /dev/null +++ b/node_modules/fresh/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "fresh@0.5.0", + "scope": null, + "escapedName": "fresh", + "name": "fresh", + "rawSpec": "0.5.0", + "spec": "0.5.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "fresh@0.5.0", + "_id": "fresh@0.5.0", + "_inCache": true, + "_location": "/fresh", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/fresh-0.5.0.tgz_1487738798128_0.4817247486207634" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "fresh@0.5.0", + "scope": null, + "escapedName": "fresh", + "name": "fresh", + "rawSpec": "0.5.0", + "spec": "0.5.0", + "type": "version" + }, + "_requiredBy": [ + "/express", + "/send" + ], + "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", + "_shasum": "f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e", + "_shrinkwrap": null, + "_spec": "fresh@0.5.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca", + "url": "http://tjholowaychuk.com" + }, + "bugs": { + "url": "https://github.com/jshttp/fresh/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "dependencies": {}, + "description": "HTTP response freshness testing", + "devDependencies": { + "eslint": "3.16.0", + "eslint-config-standard": "6.2.1", + "eslint-plugin-promise": "3.4.2", + "eslint-plugin-standard": "2.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e", + "tarball": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "gitHead": "b1d26abb390d5dd1d9b82f0a5b890ab0ef1fee5c", + "homepage": "https://github.com/jshttp/fresh#readme", + "keywords": [ + "fresh", + "http", + "conditional", + "cache" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "fresh", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/fresh.git" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "0.5.0" +} diff --git a/node_modules/fs.realpath/LICENSE b/node_modules/fs.realpath/LICENSE new file mode 100755 index 00000000..5bd884c2 --- /dev/null +++ b/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fs.realpath/README.md b/node_modules/fs.realpath/README.md new file mode 100755 index 00000000..a42ceac6 --- /dev/null +++ b/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/node_modules/fs.realpath/index.js b/node_modules/fs.realpath/index.js new file mode 100755 index 00000000..b09c7c7e --- /dev/null +++ b/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/node_modules/fs.realpath/old.js b/node_modules/fs.realpath/old.js new file mode 100755 index 00000000..b40305e7 --- /dev/null +++ b/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json new file mode 100755 index 00000000..78c2866f --- /dev/null +++ b/node_modules/fs.realpath/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "fs.realpath@^1.0.0", + "scope": null, + "escapedName": "fs.realpath", + "name": "fs.realpath", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/glob" + ] + ], + "_from": "fs.realpath@>=1.0.0 <2.0.0", + "_id": "fs.realpath@1.0.0", + "_inCache": true, + "_location": "/fs.realpath", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/fs.realpath-1.0.0.tgz_1466015941059_0.3332864767871797" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.9.1", + "_phantomChildren": {}, + "_requested": { + "raw": "fs.realpath@^1.0.0", + "scope": null, + "escapedName": "fs.realpath", + "name": "fs.realpath", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "_shrinkwrap": null, + "_spec": "fs.realpath@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" + }, + "dependencies": {}, + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "tarball": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + }, + "files": [ + "old.js", + "index.js" + ], + "gitHead": "03e7c884431fe185dfebbc9b771aeca339c1807a", + "homepage": "https://github.com/isaacs/fs.realpath#readme", + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "fs.realpath", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.0.0" +} diff --git a/node_modules/fs/index.js b/node_modules/fs/index.js new file mode 100755 index 00000000..5f292805 --- /dev/null +++ b/node_modules/fs/index.js @@ -0,0 +1 @@ +console.log("I'm `fs` modules"); diff --git a/node_modules/fs/package.json b/node_modules/fs/package.json new file mode 100755 index 00000000..eda96655 --- /dev/null +++ b/node_modules/fs/package.json @@ -0,0 +1,68 @@ +{ + "_args": [ + [ + { + "raw": "fs@0.0.2", + "scope": null, + "escapedName": "fs", + "name": "fs", + "rawSpec": "0.0.2", + "spec": "0.0.2", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-glsl-loader" + ] + ], + "_from": "fs@0.0.2", + "_id": "fs@0.0.2", + "_inCache": true, + "_location": "/fs", + "_nodeVersion": "0.0.0-fake", + "_npmUser": { + "name": "npm", + "email": "support@npmjs.com" + }, + "_npmVersion": "0.0.0-fake", + "_phantomChildren": {}, + "_requested": { + "raw": "fs@0.0.2", + "scope": null, + "escapedName": "fs", + "name": "fs", + "rawSpec": "0.0.2", + "spec": "0.0.2", + "type": "version" + }, + "_requiredBy": [ + "/webpack-glsl-loader" + ], + "_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.2.tgz", + "_shasum": "e1f244ef3933c1b2a64bd4799136060d0f5914f8", + "_shrinkwrap": null, + "_spec": "fs@0.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-glsl-loader", + "author": "", + "dependencies": {}, + "description": "", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "e1f244ef3933c1b2a64bd4799136060d0f5914f8", + "tarball": "https://registry.npmjs.org/fs/-/fs-0.0.2.tgz" + }, + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "npm", + "email": "npm@npmjs.com" + } + ], + "name": "fs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "0.0.2" +} diff --git a/node_modules/fsevents/.npmignore b/node_modules/fsevents/.npmignore new file mode 100755 index 00000000..65e3ba2e --- /dev/null +++ b/node_modules/fsevents/.npmignore @@ -0,0 +1 @@ +test/ diff --git a/node_modules/fsevents/.travis.yml b/node_modules/fsevents/.travis.yml new file mode 100755 index 00000000..afcfde0f --- /dev/null +++ b/node_modules/fsevents/.travis.yml @@ -0,0 +1,103 @@ +language: objective-c + +env: + global: + - secure: "gve1nkeKkwFEG1VAT3i+JwYyAdF0gKXwKx0uxbkBTsmm2M+0MDusohQdFLoEIkSIFktXBIDefoa7iGpLKRfG2VsZLpwJgnvnD0HqbnuR+k+W+bu7BHt4CAaR6GTllsDCjyq9zNyhUThzSnf2WNIpOEF5kHspZlbGfawURuUJH/U=" + - secure: "jqVpmWxxBVXu2X8+XJMpKH0cooc2EKz9xKL2znBfYdNafJORSXcFAVbjCX5mZmVDcgIMwDtm2+gIG4P73hzJ2e3S+y2Z9ROJGyXHa3AxUTvXHQsxqzH8coHHqB8vTvfr0t2O5aKfpvpICpSea39r0hzNoMv6Ie5SwBdqj1YY9K0=" + matrix: + - NODE_VERSION="v7" + - NODE_VERSION="v6" + - NODE_VERSION="v5" + - NODE_VERSION="v4" + - NODE_VERSION="v0.12" + - NODE_VERSION="v0.10" + - NODE_VERSION="iojs-v3" + - NODE_VERSION="iojs-v2" + - NODE_VERSION="iojs-v1" + +before_install: + + - echo $TRAVIS_OS_NAME + + # commit + # ------------------------ + # The commit message is used to determine the whether to manually + # invoke a binary publish + + - COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n') + + # node + # ------------------------ + + - export PATH=./node_modules/.bin/:$PATH + - rm -rf ~/.nvm && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm + - source ~/.nvm/nvm.sh + - nvm install $NODE_VERSION + - nvm use $NODE_VERSION + - npm install -g npm@latest + - node --version + - npm --version + - nvm --version + + # publish dependencies + # ------------------------ + + - npm install node-gyp -g + - npm install aws-sdk + +install: + + # in the first instance we build from source to create the initial binary + # which can then be used to create a package + + - npm install --build-from-source + - npm test + +before_script: + + # Detemine if a publish is required. + # + # a) we are building a tag + # b) we put [publish binary] in the commit message + + - PUBLISH_BINARY=false + + - if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi; # a + - if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi; # b + + # package & publish + # ------------------------ + + - if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package publish; fi; + + # clean-up + # ------------------------ + + - node-pre-gyp clean + - node-gyp clean + +script: + + # validate + # ------------------------ + # Post publishing a release verify that installing will pull down latest + # binary from remote host + + - INSTALL_RESULT=0 + - if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi; + + - node-pre-gyp clean + + # failure? + # ------------------------ + # if install returned non zero (errored) then we first unpublish and then + # call false so travis will bail at this line. + + - if [[ $INSTALL_RESULT != 0 ]]; then node-pre-gyp unpublish; fi; + - if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";false; fi; + +after_success: + + # display all published binaries + + - node-pre-gyp info diff --git a/node_modules/fsevents/ISSUE_TEMPLATE.md b/node_modules/fsevents/ISSUE_TEMPLATE.md new file mode 100755 index 00000000..426abbb7 --- /dev/null +++ b/node_modules/fsevents/ISSUE_TEMPLATE.md @@ -0,0 +1,8 @@ +If you are NOT on OS X and have come here to file an issue about compatibility problems, +please stop and go to #115 for your answer. + +You can look through many other similar closed issues as well if you're interested: +https://github.com/strongloop/fsevents/search?utf8=%E2%9C%93&q=%22notsup%22+OR+%22EBADPLATFORM%22&type=Issues. + +If you are here to report an issue observed while using this module on OS X, please delete +all this pre-filled text then go ahead and submit your report. diff --git a/node_modules/fsevents/LICENSE b/node_modules/fsevents/LICENSE new file mode 100755 index 00000000..4a49ad8d --- /dev/null +++ b/node_modules/fsevents/LICENSE @@ -0,0 +1,22 @@ +MIT License +----------- + +Copyright (C) 2010-2014 Philipp Dunkel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fsevents/Readme.md b/node_modules/fsevents/Readme.md new file mode 100755 index 00000000..03ddfa94 --- /dev/null +++ b/node_modules/fsevents/Readme.md @@ -0,0 +1,78 @@ +# fsevents [![NPM](https://nodei.co/npm/fsevents.png)](https://nodei.co/npm/fsevents/) + +Native access to OS X FSEvents in [Node.js](http://nodejs.org/) + +The FSEvents API in OS X allows applications to register for notifications of +changes to a given directory tree. It is a very fast and lightweight alternative +to kqueue. + +This is a low-level library. For a cross-compatible file watching module that +uses fsevents, check out [Chokidar](https://www.npmjs.com/package/chokidar). + +* [Module Site & GitHub](https://github.com/strongloop/fsevents) +* [NPM Page](https://npmjs.org/package/fsevents) + +## Installation + + $ npm install fsevents + +## Usage + +```js +var fsevents = require('fsevents'); +var watcher = fsevents(__dirname); +watcher.on('fsevent', function(path, flags, id) { }); // RAW Event as emitted by OS-X +watcher.on('change', function(path, info) { }); // Common Event for all changes +watcher.start() // To start observation +watcher.stop() // To end observation +``` + +### Events + + * *fsevent* - RAW Event as emitted by OS-X + * *change* - Common Event for all changes + * *created* - A File-System-Item has been created + * *deleted* - A File-System-Item has been deleted + * *modified* - A File-System-Item has been modified + * *moved-out* - A File-System-Item has been moved away from this location + * *moved-in* - A File-System-Item has been moved into this location + +All events except *fsevent* take an *info* object as the second parameter of the callback. The structure of this object is: + +```js +{ + "event": "", + "id": , + "path": "", + "type": "", + "changes": { + "inode": true, // Has the iNode Meta-Information changed + "finder": false, // Has the Finder Meta-Data changed + "access": false, // Have the access permissions changed + "xattrs": false // Have the xAttributes changed + }, + "flags": +} +``` + +## MIT License + +Copyright (C) 2010-2014 Philipp Dunkel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fsevents/binding.gyp b/node_modules/fsevents/binding.gyp new file mode 100755 index 00000000..06ca003d --- /dev/null +++ b/node_modules/fsevents/binding.gyp @@ -0,0 +1,29 @@ +{ + "targets": [ + { "target_name": "" } + ], + "conditions": [ + ['OS=="mac"', { + "targets": [{ + "target_name": "<(module_name)", + "sources": ["fsevents.cc"], + "xcode_settings": { + "OTHER_LDFLAGS": [ + "-framework CoreFoundation -framework CoreServices" + ] + }, + "include_dirs": [ + "> $(depfile) +# Add extra rules as in (2). +# We remove slashes and replace spaces with new lines; +# remove blank lines; +# delete the first line and append a colon to the remaining lines. +sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ + grep -v '^$$' |\ + sed -e 1d -e 's|$$|:|' \ + >> $(depfile) +rm $(depfile).raw +endef + +# Command definitions: +# - cmd_foo is the actual command to run; +# - quiet_cmd_foo is the brief-output summary of the command. + +quiet_cmd_cc = CC($(TOOLSET)) $@ +cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_cxx = CXX($(TOOLSET)) $@ +cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_objc = CXX($(TOOLSET)) $@ +cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< + +quiet_cmd_objcxx = CXX($(TOOLSET)) $@ +cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# Commands for precompiled header files. +quiet_cmd_pch_c = CXX($(TOOLSET)) $@ +cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ +cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_m = CXX($(TOOLSET)) $@ +cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< +quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ +cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# gyp-mac-tool is written next to the root Makefile by gyp. +# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd +# already. +quiet_cmd_mac_tool = MACTOOL $(4) $< +cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" + +quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ +cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) + +quiet_cmd_infoplist = INFOPLIST $@ +cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" + +quiet_cmd_touch = TOUCH $@ +cmd_touch = touch $@ + +quiet_cmd_copy = COPY $@ +# send stderr to /dev/null to ignore messages when linking directories. +cmd_copy = rm -rf "$@" && cp -af "$<" "$@" + +quiet_cmd_alink = LIBTOOL-STATIC $@ +cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) + + +# Define an escape_quotes function to escape single quotes. +# This allows us to handle quotes properly as long as we always use +# use single quotes and escape_quotes. +escape_quotes = $(subst ','\'',$(1)) +# This comment is here just to include a ' to unconfuse syntax highlighting. +# Define an escape_vars function to escape '$' variable syntax. +# This allows us to read/write command lines with shell variables (e.g. +# $LD_LIBRARY_PATH), without triggering make substitution. +escape_vars = $(subst $$,$$$$,$(1)) +# Helper that expands to a shell command to echo a string exactly as it is in +# make. This uses printf instead of echo because printf's behaviour with respect +# to escape sequences is more portable than echo's across different shells +# (e.g., dash, bash). +exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' + +# Helper to compare the command we're about to run against the command +# we logged the last time we ran the command. Produces an empty +# string (false) when the commands match. +# Tricky point: Make has no string-equality test function. +# The kernel uses the following, but it seems like it would have false +# positives, where one string reordered its arguments. +# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ +# $(filter-out $(cmd_$@), $(cmd_$(1)))) +# We instead substitute each for the empty string into the other, and +# say they're equal if both substitutions produce the empty string. +# .d files contain ? instead of spaces, take that into account. +command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ + $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) + +# Helper that is non-empty when a prerequisite changes. +# Normally make does this implicitly, but we force rules to always run +# so we can check their command lines. +# $? -- new prerequisites +# $| -- order-only dependencies +prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) + +# Helper that executes all postbuilds until one fails. +define do_postbuilds + @E=0;\ + for p in $(POSTBUILDS); do\ + eval $$p;\ + E=$$?;\ + if [ $$E -ne 0 ]; then\ + break;\ + fi;\ + done;\ + if [ $$E -ne 0 ]; then\ + rm -rf "$@";\ + exit $$E;\ + fi +endef + +# do_cmd: run a command via the above cmd_foo names, if necessary. +# Should always run for a given target to handle command-line changes. +# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. +# Third argument, if non-zero, makes it do POSTBUILDS processing. +# Note: We intentionally do NOT call dirx for depfile, since it contains ? for +# spaces already and dirx strips the ? characters. +define do_cmd +$(if $(or $(command_changed),$(prereq_changed)), + @$(call exact_echo, $($(quiet)cmd_$(1))) + @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" + $(if $(findstring flock,$(word 2,$(cmd_$1))), + @$(cmd_$(1)) + @echo " $(quiet_cmd_$(1)): Finished", + @$(cmd_$(1)) + ) + @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) + @$(if $(2),$(fixup_dep)) + $(if $(and $(3), $(POSTBUILDS)), + $(call do_postbuilds) + ) +) +endef + +# Declare the "all" target first so it is the default, +# even though we don't have the deps yet. +.PHONY: all +all: + +# make looks for ways to re-generate included makefiles, but in our case, we +# don't have a direct way. Explicitly telling make that it has nothing to do +# for them makes it go faster. +%.d: ; + +# Use FORCE_DO_CMD to force a target to run. Should be coupled with +# do_cmd. +.PHONY: FORCE_DO_CMD +FORCE_DO_CMD: + +TOOLSET := target +# Suffix rules, putting all outputs into $(obj). +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD + @$(call do_cmd,objc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD + @$(call do_cmd,objcxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +# Try building from generated source, too. +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD + @$(call do_cmd,objc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD + @$(call do_cmd,objcxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD + @$(call do_cmd,objc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD + @$(call do_cmd,objcxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + + +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,.target.mk)))),) + include .target.mk +endif +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,action_after_build.target.mk)))),) + include action_after_build.target.mk +endif +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,fse.target.mk)))),) + include fse.target.mk +endif + +quiet_cmd_regen_makefile = ACTION Regenerating $@ +cmd_regen_makefile = cd $(srcdir); /Users/eshanker/.nvm/versions/node/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/eshanker/Code/fsevents/build/config.gypi -I/Users/eshanker/.nvm/versions/node/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/eshanker/.node-gyp/5.0.0/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/eshanker/.node-gyp/5.0.0" "-Dnode_gyp_dir=/Users/eshanker/.nvm/versions/node/v5.0.0/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/Users/eshanker/Code/fsevents" binding.gyp +Makefile: $(srcdir)/../../.nvm/versions/node/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/../../.node-gyp/5.0.0/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp + $(call do_cmd,regen_makefile) + +# "all" is a concatenation of the "all" targets from all the included +# sub-makefiles. This is just here to clarify. +all: + +# Add in dependency-tracking rules. $(all_deps) is the list of every single +# target in our tree. Only consider the ones with .d (dependency) info: +d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) +ifneq ($(d_files),) + include $(d_files) +endif diff --git a/node_modules/fsevents/build/action_after_build.target.mk b/node_modules/fsevents/build/action_after_build.target.mk new file mode 100755 index 00000000..cf7a250f --- /dev/null +++ b/node_modules/fsevents/build/action_after_build.target.mk @@ -0,0 +1,32 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := action_after_build +### Generated for copy rule. +/Users/eshanker/Code/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node: TOOLSET := $(TOOLSET) +/Users/eshanker/Code/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node: $(builddir)/fse.node FORCE_DO_CMD + $(call do_cmd,copy) + +all_deps += /Users/eshanker/Code/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node +binding_gyp_action_after_build_target_copies = /Users/eshanker/Code/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node + +### Rules for final target. +# Build our special outputs first. +$(obj).target/action_after_build.stamp: | $(binding_gyp_action_after_build_target_copies) + +# Preserve order dependency of special output on deps. +$(binding_gyp_action_after_build_target_copies): | $(builddir)/fse.node + +$(obj).target/action_after_build.stamp: TOOLSET := $(TOOLSET) +$(obj).target/action_after_build.stamp: $(builddir)/fse.node FORCE_DO_CMD + $(call do_cmd,touch) + +all_deps += $(obj).target/action_after_build.stamp +# Add target alias +.PHONY: action_after_build +action_after_build: $(obj).target/action_after_build.stamp + +# Add target alias to "all" target. +.PHONY: all +all: action_after_build + diff --git a/node_modules/fsevents/build/binding.Makefile b/node_modules/fsevents/build/binding.Makefile new file mode 100755 index 00000000..f2ba1f78 --- /dev/null +++ b/node_modules/fsevents/build/binding.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= ./build/. +.PHONY: all +all: + $(MAKE) fse action_after_build diff --git a/node_modules/fsevents/build/fse.target.mk b/node_modules/fsevents/build/fse.target.mk new file mode 100755 index 00000000..b09ec0ee --- /dev/null +++ b/node_modules/fsevents/build/fse.target.mk @@ -0,0 +1,169 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := fse +DEFS_Debug := \ + '-DNODE_GYP_MODULE_NAME=fse' \ + '-D_DARWIN_USE_64_BIT_INODE=1' \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' \ + '-DDEBUG' \ + '-D_DEBUG' + +# Flags passed to all source files. +CFLAGS_Debug := \ + -O0 \ + -gdwarf-2 \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -Wall \ + -Wendif-labels \ + -W \ + -Wno-unused-parameter + +# Flags passed to only C files. +CFLAGS_C_Debug := \ + -fno-strict-aliasing + +# Flags passed to only C++ files. +CFLAGS_CC_Debug := \ + -std=gnu++0x \ + -fno-rtti \ + -fno-exceptions \ + -fno-threadsafe-statics \ + -fno-strict-aliasing + +# Flags passed to only ObjC files. +CFLAGS_OBJC_Debug := + +# Flags passed to only ObjC++ files. +CFLAGS_OBJCC_Debug := + +INCS_Debug := \ + -I/Users/eshanker/.node-gyp/5.0.0/include/node \ + -I/Users/eshanker/.node-gyp/5.0.0/src \ + -I/Users/eshanker/.node-gyp/5.0.0/deps/uv/include \ + -I/Users/eshanker/.node-gyp/5.0.0/deps/v8/include \ + -I$(srcdir)/node_modules/nan + +DEFS_Release := \ + '-DNODE_GYP_MODULE_NAME=fse' \ + '-D_DARWIN_USE_64_BIT_INODE=1' \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' + +# Flags passed to all source files. +CFLAGS_Release := \ + -Os \ + -gdwarf-2 \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -Wall \ + -Wendif-labels \ + -W \ + -Wno-unused-parameter + +# Flags passed to only C files. +CFLAGS_C_Release := \ + -fno-strict-aliasing + +# Flags passed to only C++ files. +CFLAGS_CC_Release := \ + -std=gnu++0x \ + -fno-rtti \ + -fno-exceptions \ + -fno-threadsafe-statics \ + -fno-strict-aliasing + +# Flags passed to only ObjC files. +CFLAGS_OBJC_Release := + +# Flags passed to only ObjC++ files. +CFLAGS_OBJCC_Release := + +INCS_Release := \ + -I/Users/eshanker/.node-gyp/5.0.0/include/node \ + -I/Users/eshanker/.node-gyp/5.0.0/src \ + -I/Users/eshanker/.node-gyp/5.0.0/deps/uv/include \ + -I/Users/eshanker/.node-gyp/5.0.0/deps/v8/include \ + -I$(srcdir)/node_modules/nan + +OBJS := \ + $(obj).target/$(TARGET)/fsevents.o + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual. +$(OBJS): TOOLSET := $(TOOLSET) +$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) +$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) +$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE)) +$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE)) + +# Suffix rules, putting all outputs into $(obj). + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# Try building from generated source, too. + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# End of this set of suffix rules +### Rules for final target. +LDFLAGS_Debug := \ + -framework CoreFoundation -framework CoreServices \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -L$(builddir) + +LIBTOOLFLAGS_Debug := \ + -framework CoreFoundation -framework CoreServices \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first + +LDFLAGS_Release := \ + -framework CoreFoundation -framework CoreServices \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -L$(builddir) + +LIBTOOLFLAGS_Release := \ + -framework CoreFoundation -framework CoreServices \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first + +LIBS := + +$(builddir)/fse.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) +$(builddir)/fse.node: LIBS := $(LIBS) +$(builddir)/fse.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE)) +$(builddir)/fse.node: TOOLSET := $(TOOLSET) +$(builddir)/fse.node: $(OBJS) FORCE_DO_CMD + $(call do_cmd,solink_module) + +all_deps += $(builddir)/fse.node +# Add target alias +.PHONY: fse +fse: $(builddir)/fse.node + +# Short alias for building this executable. +.PHONY: fse.node +fse.node: $(builddir)/fse.node + +# Add executable to "all" target. +.PHONY: all +all: $(builddir)/fse.node + diff --git a/node_modules/fsevents/build/gyp-mac-tool b/node_modules/fsevents/build/gyp-mac-tool new file mode 100755 index 00000000..976c5987 --- /dev/null +++ b/node_modules/fsevents/build/gyp-mac-tool @@ -0,0 +1,612 @@ +#!/usr/bin/env python +# Generated by gyp. Do not edit. +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Utility functions to perform Xcode-style build steps. + +These functions are executed via gyp-mac-tool when using the Makefile generator. +""" + +import fcntl +import fnmatch +import glob +import json +import os +import plistlib +import re +import shutil +import string +import subprocess +import sys +import tempfile + + +def main(args): + executor = MacTool() + exit_code = executor.Dispatch(args) + if exit_code is not None: + sys.exit(exit_code) + + +class MacTool(object): + """This class performs all the Mac tooling steps. The methods can either be + executed directly, or dispatched from an argument list.""" + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + return getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like copy-info-plist to CopyInfoPlist""" + return name_string.title().replace('-', '') + + def ExecCopyBundleResource(self, source, dest, convert_to_binary): + """Copies a resource file to the bundle/Resources directory, performing any + necessary compilation on each resource.""" + extension = os.path.splitext(source)[1].lower() + if os.path.isdir(source): + # Copy tree. + # TODO(thakis): This copies file attributes like mtime, while the + # single-file branch below doesn't. This should probably be changed to + # be consistent with the single-file branch. + if os.path.exists(dest): + shutil.rmtree(dest) + shutil.copytree(source, dest) + elif extension == '.xib': + return self._CopyXIBFile(source, dest) + elif extension == '.storyboard': + return self._CopyXIBFile(source, dest) + elif extension == '.strings': + self._CopyStringsFile(source, dest, convert_to_binary) + else: + shutil.copy(source, dest) + + def _CopyXIBFile(self, source, dest): + """Compiles a XIB file with ibtool into a binary plist in the bundle.""" + + # ibtool sometimes crashes with relative paths. See crbug.com/314728. + base = os.path.dirname(os.path.realpath(__file__)) + if os.path.relpath(source): + source = os.path.join(base, source) + if os.path.relpath(dest): + dest = os.path.join(base, dest) + + args = ['xcrun', 'ibtool', '--errors', '--warnings', '--notices', + '--output-format', 'human-readable-text', '--compile', dest, source] + ibtool_section_re = re.compile(r'/\*.*\*/') + ibtool_re = re.compile(r'.*note:.*is clipping its content') + ibtoolout = subprocess.Popen(args, stdout=subprocess.PIPE) + current_section_header = None + for line in ibtoolout.stdout: + if ibtool_section_re.match(line): + current_section_header = line + elif not ibtool_re.match(line): + if current_section_header: + sys.stdout.write(current_section_header) + current_section_header = None + sys.stdout.write(line) + return ibtoolout.returncode + + def _ConvertToBinary(self, dest): + subprocess.check_call([ + 'xcrun', 'plutil', '-convert', 'binary1', '-o', dest, dest]) + + def _CopyStringsFile(self, source, dest, convert_to_binary): + """Copies a .strings file using iconv to reconvert the input into UTF-16.""" + input_code = self._DetectInputEncoding(source) or "UTF-8" + + # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call + # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints + # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing + # semicolon in dictionary. + # on invalid files. Do the same kind of validation. + import CoreFoundation + s = open(source, 'rb').read() + d = CoreFoundation.CFDataCreate(None, s, len(s)) + _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) + if error: + return + + fp = open(dest, 'wb') + fp.write(s.decode(input_code).encode('UTF-16')) + fp.close() + + if convert_to_binary == 'True': + self._ConvertToBinary(dest) + + def _DetectInputEncoding(self, file_name): + """Reads the first few bytes from file_name and tries to guess the text + encoding. Returns None as a guess if it can't detect it.""" + fp = open(file_name, 'rb') + try: + header = fp.read(3) + except e: + fp.close() + return None + fp.close() + if header.startswith("\xFE\xFF"): + return "UTF-16" + elif header.startswith("\xFF\xFE"): + return "UTF-16" + elif header.startswith("\xEF\xBB\xBF"): + return "UTF-8" + else: + return None + + def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): + """Copies the |source| Info.plist to the destination directory |dest|.""" + # Read the source Info.plist into memory. + fd = open(source, 'r') + lines = fd.read() + fd.close() + + # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). + plist = plistlib.readPlistFromString(lines) + if keys: + plist = dict(plist.items() + json.loads(keys[0]).items()) + lines = plistlib.writePlistToString(plist) + + # Go through all the environment variables and replace them as variables in + # the file. + IDENT_RE = re.compile(r'[/\s]') + for key in os.environ: + if key.startswith('_'): + continue + evar = '${%s}' % key + evalue = os.environ[key] + lines = string.replace(lines, evar, evalue) + + # Xcode supports various suffices on environment variables, which are + # all undocumented. :rfc1034identifier is used in the standard project + # template these days, and :identifier was used earlier. They are used to + # convert non-url characters into things that look like valid urls -- + # except that the replacement character for :identifier, '_' isn't valid + # in a URL either -- oops, hence :rfc1034identifier was born. + evar = '${%s:identifier}' % key + evalue = IDENT_RE.sub('_', os.environ[key]) + lines = string.replace(lines, evar, evalue) + + evar = '${%s:rfc1034identifier}' % key + evalue = IDENT_RE.sub('-', os.environ[key]) + lines = string.replace(lines, evar, evalue) + + # Remove any keys with values that haven't been replaced. + lines = lines.split('\n') + for i in range(len(lines)): + if lines[i].strip().startswith("${"): + lines[i] = None + lines[i - 1] = None + lines = '\n'.join(filter(lambda x: x is not None, lines)) + + # Write out the file with variables replaced. + fd = open(dest, 'w') + fd.write(lines) + fd.close() + + # Now write out PkgInfo file now that the Info.plist file has been + # "compiled". + self._WritePkgInfo(dest) + + if convert_to_binary == 'True': + self._ConvertToBinary(dest) + + def _WritePkgInfo(self, info_plist): + """This writes the PkgInfo file from the data stored in Info.plist.""" + plist = plistlib.readPlist(info_plist) + if not plist: + return + + # Only create PkgInfo for executable types. + package_type = plist['CFBundlePackageType'] + if package_type != 'APPL': + return + + # The format of PkgInfo is eight characters, representing the bundle type + # and bundle signature, each four characters. If that is missing, four + # '?' characters are used instead. + signature_code = plist.get('CFBundleSignature', '????') + if len(signature_code) != 4: # Wrong length resets everything, too. + signature_code = '?' * 4 + + dest = os.path.join(os.path.dirname(info_plist), 'PkgInfo') + fp = open(dest, 'w') + fp.write('%s%s' % (package_type, signature_code)) + fp.close() + + def ExecFlock(self, lockfile, *cmd_list): + """Emulates the most basic behavior of Linux's flock(1).""" + # Rely on exception handling to report errors. + fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) + fcntl.flock(fd, fcntl.LOCK_EX) + return subprocess.call(cmd_list) + + def ExecFilterLibtool(self, *cmd_list): + """Calls libtool and filters out '/path/to/libtool: file: foo.o has no + symbols'.""" + libtool_re = re.compile(r'^.*libtool: file: .* has no symbols$') + libtool_re5 = re.compile( + r'^.*libtool: warning for library: ' + + r'.* the table of contents is empty ' + + r'\(no object file members in the library define global symbols\)$') + env = os.environ.copy() + # Ref: + # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c + # The problem with this flag is that it resets the file mtime on the file to + # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. + env['ZERO_AR_DATE'] = '1' + libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) + _, err = libtoolout.communicate() + for line in err.splitlines(): + if not libtool_re.match(line) and not libtool_re5.match(line): + print >>sys.stderr, line + # Unconditionally touch the output .a file on the command line if present + # and the command succeeded. A bit hacky. + if not libtoolout.returncode: + for i in range(len(cmd_list) - 1): + if cmd_list[i] == "-o" and cmd_list[i+1].endswith('.a'): + os.utime(cmd_list[i+1], None) + break + return libtoolout.returncode + + def ExecPackageFramework(self, framework, version): + """Takes a path to Something.framework and the Current version of that and + sets up all the symlinks.""" + # Find the name of the binary based on the part before the ".framework". + binary = os.path.basename(framework).split('.')[0] + + CURRENT = 'Current' + RESOURCES = 'Resources' + VERSIONS = 'Versions' + + if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): + # Binary-less frameworks don't seem to contain symlinks (see e.g. + # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). + return + + # Move into the framework directory to set the symlinks correctly. + pwd = os.getcwd() + os.chdir(framework) + + # Set up the Current version. + self._Relink(version, os.path.join(VERSIONS, CURRENT)) + + # Set up the root symlinks. + self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) + self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) + + # Back to where we were before! + os.chdir(pwd) + + def _Relink(self, dest, link): + """Creates a symlink to |dest| named |link|. If |link| already exists, + it is overwritten.""" + if os.path.lexists(link): + os.remove(link) + os.symlink(dest, link) + + def ExecCompileXcassets(self, keys, *inputs): + """Compiles multiple .xcassets files into a single .car file. + + This invokes 'actool' to compile all the inputs .xcassets files. The + |keys| arguments is a json-encoded dictionary of extra arguments to + pass to 'actool' when the asset catalogs contains an application icon + or a launch image. + + Note that 'actool' does not create the Assets.car file if the asset + catalogs does not contains imageset. + """ + command_line = [ + 'xcrun', 'actool', '--output-format', 'human-readable-text', + '--compress-pngs', '--notices', '--warnings', '--errors', + ] + is_iphone_target = 'IPHONEOS_DEPLOYMENT_TARGET' in os.environ + if is_iphone_target: + platform = os.environ['CONFIGURATION'].split('-')[-1] + if platform not in ('iphoneos', 'iphonesimulator'): + platform = 'iphonesimulator' + command_line.extend([ + '--platform', platform, '--target-device', 'iphone', + '--target-device', 'ipad', '--minimum-deployment-target', + os.environ['IPHONEOS_DEPLOYMENT_TARGET'], '--compile', + os.path.abspath(os.environ['CONTENTS_FOLDER_PATH']), + ]) + else: + command_line.extend([ + '--platform', 'macosx', '--target-device', 'mac', + '--minimum-deployment-target', os.environ['MACOSX_DEPLOYMENT_TARGET'], + '--compile', + os.path.abspath(os.environ['UNLOCALIZED_RESOURCES_FOLDER_PATH']), + ]) + if keys: + keys = json.loads(keys) + for key, value in keys.iteritems(): + arg_name = '--' + key + if isinstance(value, bool): + if value: + command_line.append(arg_name) + elif isinstance(value, list): + for v in value: + command_line.append(arg_name) + command_line.append(str(v)) + else: + command_line.append(arg_name) + command_line.append(str(value)) + # Note: actool crashes if inputs path are relative, so use os.path.abspath + # to get absolute path name for inputs. + command_line.extend(map(os.path.abspath, inputs)) + subprocess.check_call(command_line) + + def ExecMergeInfoPlist(self, output, *inputs): + """Merge multiple .plist files into a single .plist file.""" + merged_plist = {} + for path in inputs: + plist = self._LoadPlistMaybeBinary(path) + self._MergePlist(merged_plist, plist) + plistlib.writePlist(merged_plist, output) + + def ExecCodeSignBundle(self, key, resource_rules, entitlements, provisioning): + """Code sign a bundle. + + This function tries to code sign an iOS bundle, following the same + algorithm as Xcode: + 1. copy ResourceRules.plist from the user or the SDK into the bundle, + 2. pick the provisioning profile that best match the bundle identifier, + and copy it into the bundle as embedded.mobileprovision, + 3. copy Entitlements.plist from user or SDK next to the bundle, + 4. code sign the bundle. + """ + resource_rules_path = self._InstallResourceRules(resource_rules) + substitutions, overrides = self._InstallProvisioningProfile( + provisioning, self._GetCFBundleIdentifier()) + entitlements_path = self._InstallEntitlements( + entitlements, substitutions, overrides) + subprocess.check_call([ + 'codesign', '--force', '--sign', key, '--resource-rules', + resource_rules_path, '--entitlements', entitlements_path, + os.path.join( + os.environ['TARGET_BUILD_DIR'], + os.environ['FULL_PRODUCT_NAME'])]) + + def _InstallResourceRules(self, resource_rules): + """Installs ResourceRules.plist from user or SDK into the bundle. + + Args: + resource_rules: string, optional, path to the ResourceRules.plist file + to use, default to "${SDKROOT}/ResourceRules.plist" + + Returns: + Path to the copy of ResourceRules.plist into the bundle. + """ + source_path = resource_rules + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['CONTENTS_FOLDER_PATH'], + 'ResourceRules.plist') + if not source_path: + source_path = os.path.join( + os.environ['SDKROOT'], 'ResourceRules.plist') + shutil.copy2(source_path, target_path) + return target_path + + def _InstallProvisioningProfile(self, profile, bundle_identifier): + """Installs embedded.mobileprovision into the bundle. + + Args: + profile: string, optional, short name of the .mobileprovision file + to use, if empty or the file is missing, the best file installed + will be used + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + + Returns: + A tuple containing two dictionary: variables substitutions and values + to overrides when generating the entitlements file. + """ + source_path, provisioning_data, team_id = self._FindProvisioningProfile( + profile, bundle_identifier) + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['CONTENTS_FOLDER_PATH'], + 'embedded.mobileprovision') + shutil.copy2(source_path, target_path) + substitutions = self._GetSubstitutions(bundle_identifier, team_id + '.') + return substitutions, provisioning_data['Entitlements'] + + def _FindProvisioningProfile(self, profile, bundle_identifier): + """Finds the .mobileprovision file to use for signing the bundle. + + Checks all the installed provisioning profiles (or if the user specified + the PROVISIONING_PROFILE variable, only consult it) and select the most + specific that correspond to the bundle identifier. + + Args: + profile: string, optional, short name of the .mobileprovision file + to use, if empty or the file is missing, the best file installed + will be used + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + + Returns: + A tuple of the path to the selected provisioning profile, the data of + the embedded plist in the provisioning profile and the team identifier + to use for code signing. + + Raises: + SystemExit: if no .mobileprovision can be used to sign the bundle. + """ + profiles_dir = os.path.join( + os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles') + if not os.path.isdir(profiles_dir): + print >>sys.stderr, ( + 'cannot find mobile provisioning for %s' % bundle_identifier) + sys.exit(1) + provisioning_profiles = None + if profile: + profile_path = os.path.join(profiles_dir, profile + '.mobileprovision') + if os.path.exists(profile_path): + provisioning_profiles = [profile_path] + if not provisioning_profiles: + provisioning_profiles = glob.glob( + os.path.join(profiles_dir, '*.mobileprovision')) + valid_provisioning_profiles = {} + for profile_path in provisioning_profiles: + profile_data = self._LoadProvisioningProfile(profile_path) + app_id_pattern = profile_data.get( + 'Entitlements', {}).get('application-identifier', '') + for team_identifier in profile_data.get('TeamIdentifier', []): + app_id = '%s.%s' % (team_identifier, bundle_identifier) + if fnmatch.fnmatch(app_id, app_id_pattern): + valid_provisioning_profiles[app_id_pattern] = ( + profile_path, profile_data, team_identifier) + if not valid_provisioning_profiles: + print >>sys.stderr, ( + 'cannot find mobile provisioning for %s' % bundle_identifier) + sys.exit(1) + # If the user has multiple provisioning profiles installed that can be + # used for ${bundle_identifier}, pick the most specific one (ie. the + # provisioning profile whose pattern is the longest). + selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) + return valid_provisioning_profiles[selected_key] + + def _LoadProvisioningProfile(self, profile_path): + """Extracts the plist embedded in a provisioning profile. + + Args: + profile_path: string, path to the .mobileprovision file + + Returns: + Content of the plist embedded in the provisioning profile as a dictionary. + """ + with tempfile.NamedTemporaryFile() as temp: + subprocess.check_call([ + 'security', 'cms', '-D', '-i', profile_path, '-o', temp.name]) + return self._LoadPlistMaybeBinary(temp.name) + + def _MergePlist(self, merged_plist, plist): + """Merge |plist| into |merged_plist|.""" + for key, value in plist.iteritems(): + if isinstance(value, dict): + merged_value = merged_plist.get(key, {}) + if isinstance(merged_value, dict): + self._MergePlist(merged_value, value) + merged_plist[key] = merged_value + else: + merged_plist[key] = value + else: + merged_plist[key] = value + + def _LoadPlistMaybeBinary(self, plist_path): + """Loads into a memory a plist possibly encoded in binary format. + + This is a wrapper around plistlib.readPlist that tries to convert the + plist to the XML format if it can't be parsed (assuming that it is in + the binary format). + + Args: + plist_path: string, path to a plist file, in XML or binary format + + Returns: + Content of the plist as a dictionary. + """ + try: + # First, try to read the file using plistlib that only supports XML, + # and if an exception is raised, convert a temporary copy to XML and + # load that copy. + return plistlib.readPlist(plist_path) + except: + pass + with tempfile.NamedTemporaryFile() as temp: + shutil.copy2(plist_path, temp.name) + subprocess.check_call(['plutil', '-convert', 'xml1', temp.name]) + return plistlib.readPlist(temp.name) + + def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): + """Constructs a dictionary of variable substitutions for Entitlements.plist. + + Args: + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + app_identifier_prefix: string, value for AppIdentifierPrefix + + Returns: + Dictionary of substitutions to apply when generating Entitlements.plist. + """ + return { + 'CFBundleIdentifier': bundle_identifier, + 'AppIdentifierPrefix': app_identifier_prefix, + } + + def _GetCFBundleIdentifier(self): + """Extracts CFBundleIdentifier value from Info.plist in the bundle. + + Returns: + Value of CFBundleIdentifier in the Info.plist located in the bundle. + """ + info_plist_path = os.path.join( + os.environ['TARGET_BUILD_DIR'], + os.environ['INFOPLIST_PATH']) + info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) + return info_plist_data['CFBundleIdentifier'] + + def _InstallEntitlements(self, entitlements, substitutions, overrides): + """Generates and install the ${BundleName}.xcent entitlements file. + + Expands variables "$(variable)" pattern in the source entitlements file, + add extra entitlements defined in the .mobileprovision file and the copy + the generated plist to "${BundlePath}.xcent". + + Args: + entitlements: string, optional, path to the Entitlements.plist template + to use, defaults to "${SDKROOT}/Entitlements.plist" + substitutions: dictionary, variable substitutions + overrides: dictionary, values to add to the entitlements + + Returns: + Path to the generated entitlements file. + """ + source_path = entitlements + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['PRODUCT_NAME'] + '.xcent') + if not source_path: + source_path = os.path.join( + os.environ['SDKROOT'], + 'Entitlements.plist') + shutil.copy2(source_path, target_path) + data = self._LoadPlistMaybeBinary(target_path) + data = self._ExpandVariables(data, substitutions) + if overrides: + for key in overrides: + if key not in data: + data[key] = overrides[key] + plistlib.writePlist(data, target_path) + return target_path + + def _ExpandVariables(self, data, substitutions): + """Expands variables "$(variable)" in data. + + Args: + data: object, can be either string, list or dictionary + substitutions: dictionary, variable substitutions to perform + + Returns: + Copy of data where each references to "$(variable)" has been replaced + by the corresponding value found in substitutions, or left intact if + the key was not found. + """ + if isinstance(data, str): + for key, value in substitutions.iteritems(): + data = data.replace('$(%s)' % key, value) + return data + if isinstance(data, list): + return [self._ExpandVariables(v, substitutions) for v in data] + if isinstance(data, dict): + return dict((k, self._ExpandVariables(data[k], + substitutions)) for k in data) + return data + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/node_modules/fsevents/fsevents.cc b/node_modules/fsevents/fsevents.cc new file mode 100755 index 00000000..a347db12 --- /dev/null +++ b/node_modules/fsevents/fsevents.cc @@ -0,0 +1,102 @@ +/* +** © 2014 by Philipp Dunkel +** Licensed under MIT License. +*/ + +#include "nan.h" +#include "uv.h" +#include "v8.h" +#include "pthread.h" +#include "CoreFoundation/CoreFoundation.h" +#include "CoreServices/CoreServices.h" +#include +#include + +#include "src/storage.cc" +namespace fse { + class FSEvents : public node::ObjectWrap { + public: + FSEvents(const char *path, Nan::Callback *handler); + ~FSEvents(); + + // locking.cc + bool lockStarted; + pthread_mutex_t lockmutex; + void lockingStart(); + void lock(); + void unlock(); + void lockingStop(); + + // async.cc + uv_async_t async; + void asyncStart(); + void asyncTrigger(); + void asyncStop(); + + // thread.cc + pthread_t thread; + CFRunLoopRef threadloop; + void threadStart(); + static void *threadRun(void *ctx); + void threadStop(); + + // methods.cc - internal + Nan::Callback *handler; + void emitEvent(const char *path, UInt32 flags, UInt64 id); + + // Common + CFArrayRef paths; + std::vector events; + static void Initialize(v8::Handle exports); + + // methods.cc - exposed + static NAN_METHOD(New); + static NAN_METHOD(Stop); + static NAN_METHOD(Start); + + }; +} + +using namespace fse; + +FSEvents::FSEvents(const char *path, Nan::Callback *handler): handler(handler) { + CFStringRef dirs[] = { CFStringCreateWithCString(NULL, path, kCFStringEncodingUTF8) }; + paths = CFArrayCreate(NULL, (const void **)&dirs, 1, NULL); + threadloop = NULL; + lockingStart(); +} +FSEvents::~FSEvents() { + std::cout << "YIKES" << std::endl; + lockingStop(); + delete handler; + handler = NULL; + + CFRelease(paths); +} + +#ifndef kFSEventStreamEventFlagItemCreated +#define kFSEventStreamEventFlagItemCreated 0x00000010 +#endif + +#include "src/locking.cc" +#include "src/async.cc" +#include "src/thread.cc" +#include "src/constants.cc" +#include "src/methods.cc" + +void FSEvents::Initialize(v8::Handle exports) { + v8::Local tpl = Nan::New(FSEvents::New); + tpl->SetClassName(Nan::New("FSEvents").ToLocalChecked()); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + tpl->PrototypeTemplate()->Set( + Nan::New("start").ToLocalChecked(), + Nan::New(FSEvents::Start)); + tpl->PrototypeTemplate()->Set( + Nan::New("stop").ToLocalChecked(), + Nan::New(FSEvents::Stop)); + exports->Set(Nan::New("Constants").ToLocalChecked(), Constants()); + exports->Set(Nan::New("FSEvents").ToLocalChecked(), + tpl->GetFunction()); +} + +NODE_MODULE(fse, FSEvents::Initialize) diff --git a/node_modules/fsevents/fsevents.js b/node_modules/fsevents/fsevents.js new file mode 100755 index 00000000..32f4ad18 --- /dev/null +++ b/node_modules/fsevents/fsevents.js @@ -0,0 +1,108 @@ +/* + ** © 2014 by Philipp Dunkel + ** Licensed under MIT License. + */ + +/* jshint node:true */ +'use strict'; + +if (process.platform !== 'darwin') + throw new Error('Module \'fsevents\' is not compatible with platform \'' + process.platform + '\''); + +var path = require('path'); +var binary = require('node-pre-gyp'); +var Native = require(binary.find(path.join(__dirname, 'package.json'))); + +var EventEmitter = require('events').EventEmitter; +var fs = require('fs'); +var inherits = require('util').inherits; + +function FSEvents(path, handler) { + EventEmitter.call(this); + + Object.defineProperty(this, '_impl', { + value: new Native.FSEvents(String(path || ''), handler), + enumerable: false, + writable: false + }); +} + +inherits(FSEvents, EventEmitter); +proxies(FSEvents, Native.FSEvents); + +module.exports = watch; +module.exports.getInfo = getInfo; +module.exports.FSEvents = Native.FSEvents; +module.exports.Constants = Native.Constants; + +var defer = global.setImmediate || process.nextTick; + +function watch(path) { + var fse = new FSEvents(String(path || ''), handler); + EventEmitter.call(fse); + return fse; + + function handler(path, flags, id) { + defer(function() { + fse.emit('fsevent', path, flags, id); + var info = getInfo(path, flags); + info.id = id; + if (info.event === 'moved') { + fs.stat(info.path, function(err, stat) { + info.event = (err || !stat) ? 'moved-out' : 'moved-in'; + fse.emit('change', path, info); + fse.emit(info.event, path, info); + }); + } else { + fse.emit('change', path, info); + fse.emit(info.event, path, info); + } + }); + } +} + +function proxies(ctor, target) { + Object.keys(target.prototype).filter(function(key) { + return typeof target.prototype[key] === 'function'; + }).forEach(function(key) { + ctor.prototype[key] = function() { + this._impl[key].apply(this._impl, arguments); + return this; + } + }); +} + +function getFileType(flags) { + if (Native.Constants.kFSEventStreamEventFlagItemIsFile & flags) return 'file'; + if (Native.Constants.kFSEventStreamEventFlagItemIsDir & flags) return 'directory'; + if (Native.Constants.kFSEventStreamEventFlagItemIsSymlink & flags) return 'symlink'; +} + +function getEventType(flags) { + if (Native.Constants.kFSEventStreamEventFlagItemRemoved & flags) return 'deleted'; + if (Native.Constants.kFSEventStreamEventFlagItemRenamed & flags) return 'moved'; + if (Native.Constants.kFSEventStreamEventFlagItemCreated & flags) return 'created'; + if (Native.Constants.kFSEventStreamEventFlagItemModified & flags) return 'modified'; + if (Native.Constants.kFSEventStreamEventFlagRootChanged & flags) return 'root-changed'; + + return 'unknown'; +} + +function getFileChanges(flags) { + return { + inode: !! (Native.Constants.kFSEventStreamEventFlagItemInodeMetaMod & flags), + finder: !! (Native.Constants.kFSEventStreamEventFlagItemFinderInfoMod & flags), + access: !! (Native.Constants.kFSEventStreamEventFlagItemChangeOwner & flags), + xattrs: !! (Native.Constants.kFSEventStreamEventFlagItemXattrMod & flags) + }; +} + +function getInfo(path, flags) { + return { + path: path, + event: getEventType(flags), + type: getFileType(flags), + changes: getFileChanges(flags), + flags: flags + }; +} diff --git a/node_modules/fsevents/install.js b/node_modules/fsevents/install.js new file mode 100755 index 00000000..ece4e938 --- /dev/null +++ b/node_modules/fsevents/install.js @@ -0,0 +1,7 @@ +if (process.platform === 'darwin') { + var spawn = require('child_process').spawn; + var args = ['install', '--fallback-to-build']; + var options = {stdio: 'inherit'}; + var child = spawn('node-pre-gyp', args, options); + child.on('close', process.exit); +} \ No newline at end of file diff --git a/node_modules/fsevents/lib/binding/Release/node-v11-darwin-x64/fse.node b/node_modules/fsevents/lib/binding/Release/node-v11-darwin-x64/fse.node new file mode 100755 index 00000000..1d4e2d12 Binary files /dev/null and b/node_modules/fsevents/lib/binding/Release/node-v11-darwin-x64/fse.node differ diff --git a/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node b/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node new file mode 100755 index 00000000..ca473e6e Binary files /dev/null and b/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node differ diff --git a/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node b/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node new file mode 100755 index 00000000..393572ad Binary files /dev/null and b/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node differ diff --git a/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node b/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node new file mode 100755 index 00000000..23035413 Binary files /dev/null and b/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node differ diff --git a/node_modules/fsevents/node_modules/.bin/har-validator b/node_modules/fsevents/node_modules/.bin/har-validator new file mode 120000 index 00000000..c6ec1634 --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/har-validator @@ -0,0 +1 @@ +../har-validator/bin/har-validator \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/mkdirp b/node_modules/fsevents/node_modules/.bin/mkdirp new file mode 120000 index 00000000..017896ce --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/node-pre-gyp b/node_modules/fsevents/node_modules/.bin/node-pre-gyp new file mode 120000 index 00000000..47a90a51 --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/node-pre-gyp @@ -0,0 +1 @@ +../node-pre-gyp/bin/node-pre-gyp \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/nopt b/node_modules/fsevents/node_modules/.bin/nopt new file mode 120000 index 00000000..6b6566ea --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/nopt @@ -0,0 +1 @@ +../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/rc b/node_modules/fsevents/node_modules/.bin/rc new file mode 120000 index 00000000..a3f6fc7f --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/rc @@ -0,0 +1 @@ +../rc/index.js \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/rimraf b/node_modules/fsevents/node_modules/.bin/rimraf new file mode 120000 index 00000000..4cd49a49 --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/semver b/node_modules/fsevents/node_modules/.bin/semver new file mode 120000 index 00000000..317eb293 --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/sshpk-conv b/node_modules/fsevents/node_modules/.bin/sshpk-conv new file mode 120000 index 00000000..a2a295c8 --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/sshpk-conv @@ -0,0 +1 @@ +../sshpk/bin/sshpk-conv \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/sshpk-sign b/node_modules/fsevents/node_modules/.bin/sshpk-sign new file mode 120000 index 00000000..766b9b3a --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/sshpk-sign @@ -0,0 +1 @@ +../sshpk/bin/sshpk-sign \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/sshpk-verify b/node_modules/fsevents/node_modules/.bin/sshpk-verify new file mode 120000 index 00000000..bfd7e3ad --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/sshpk-verify @@ -0,0 +1 @@ +../sshpk/bin/sshpk-verify \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/.bin/uuid b/node_modules/fsevents/node_modules/.bin/uuid new file mode 120000 index 00000000..b3e45bc5 --- /dev/null +++ b/node_modules/fsevents/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/bin/uuid \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/abbrev/LICENSE b/node_modules/fsevents/node_modules/abbrev/LICENSE new file mode 100755 index 00000000..19129e31 --- /dev/null +++ b/node_modules/fsevents/node_modules/abbrev/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fsevents/node_modules/abbrev/README.md b/node_modules/fsevents/node_modules/abbrev/README.md new file mode 100755 index 00000000..99746fe6 --- /dev/null +++ b/node_modules/fsevents/node_modules/abbrev/README.md @@ -0,0 +1,23 @@ +# abbrev-js + +Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). + +Usage: + + var abbrev = require("abbrev"); + abbrev("foo", "fool", "folding", "flop"); + + // returns: + { fl: 'flop' + , flo: 'flop' + , flop: 'flop' + , fol: 'folding' + , fold: 'folding' + , foldi: 'folding' + , foldin: 'folding' + , folding: 'folding' + , foo: 'foo' + , fool: 'fool' + } + +This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/node_modules/fsevents/node_modules/abbrev/abbrev.js b/node_modules/fsevents/node_modules/abbrev/abbrev.js new file mode 100755 index 00000000..7b1dc5d6 --- /dev/null +++ b/node_modules/fsevents/node_modules/abbrev/abbrev.js @@ -0,0 +1,61 @@ +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} diff --git a/node_modules/fsevents/node_modules/abbrev/package.json b/node_modules/fsevents/node_modules/abbrev/package.json new file mode 100755 index 00000000..15140d89 --- /dev/null +++ b/node_modules/fsevents/node_modules/abbrev/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + { + "raw": "abbrev@1", + "scope": null, + "escapedName": "abbrev", + "name": "abbrev", + "rawSpec": "1", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/nopt" + ] + ], + "_from": "abbrev@>=1.0.0 <2.0.0", + "_id": "abbrev@1.1.0", + "_inCache": true, + "_location": "/fsevents/abbrev", + "_nodeVersion": "8.0.0-pre", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/abbrev-1.1.0.tgz_1487054000015_0.9229173036292195" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "4.3.0", + "_phantomChildren": {}, + "_requested": { + "raw": "abbrev@1", + "scope": null, + "escapedName": "abbrev", + "name": "abbrev", + "rawSpec": "1", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/nopt" + ], + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "_shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f", + "_shrinkwrap": null, + "_spec": "abbrev@1", + "_where": "/Users/eshanker/Code/fsevents/node_modules/nopt", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/abbrev-js/issues" + }, + "dependencies": {}, + "description": "Like ruby's abbrev module, but in js", + "devDependencies": { + "tap": "^10.1" + }, + "directories": {}, + "dist": { + "shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f", + "tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" + }, + "files": [ + "abbrev.js" + ], + "gitHead": "7136d4d95449dc44115d4f78b80ec907724f64e0", + "homepage": "https://github.com/isaacs/abbrev-js#readme", + "license": "ISC", + "main": "abbrev.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "abbrev", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test.js --100" + }, + "version": "1.1.0" +} diff --git a/node_modules/fsevents/node_modules/ansi-regex/index.js b/node_modules/fsevents/node_modules/ansi-regex/index.js new file mode 100755 index 00000000..b9574ed7 --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; diff --git a/node_modules/fsevents/node_modules/ansi-regex/license b/node_modules/fsevents/node_modules/ansi-regex/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fsevents/node_modules/ansi-regex/package.json b/node_modules/fsevents/node_modules/ansi-regex/package.json new file mode 100755 index 00000000..adb2df1e --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-regex/package.json @@ -0,0 +1,132 @@ +{ + "_args": [ + [ + { + "raw": "ansi-regex@^2.0.0", + "scope": null, + "escapedName": "ansi-regex", + "name": "ansi-regex", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/strip-ansi" + ] + ], + "_from": "ansi-regex@>=2.0.0 <3.0.0", + "_id": "ansi-regex@2.1.1", + "_inCache": true, + "_location": "/fsevents/ansi-regex", + "_nodeVersion": "0.10.32", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/ansi-regex-2.1.1.tgz_1484363378013_0.4482989883981645" + }, + "_npmUser": { + "name": "qix", + "email": "i.am.qix@gmail.com" + }, + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "raw": "ansi-regex@^2.0.0", + "scope": null, + "escapedName": "ansi-regex", + "name": "ansi-regex", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/has-ansi", + "/fsevents/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "_shrinkwrap": null, + "_spec": "ansi-regex@^2.0.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "dependencies": {}, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "0.17.0", + "xo": "0.16.0" + }, + "directories": {}, + "dist": { + "shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "tarball": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "7c908e7b4eb6cd82bfe1295e33fdf6d166c7ed85", + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "maintainers": [ + { + "name": "qix", + "email": "i.am.qix@gmail.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "ansi-regex", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava --verbose", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "2.1.1", + "xo": { + "rules": { + "guard-for-in": 0, + "no-loop-func": 0 + } + } +} diff --git a/node_modules/fsevents/node_modules/ansi-regex/readme.md b/node_modules/fsevents/node_modules/ansi-regex/readme.md new file mode 100755 index 00000000..6a928edf --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-regex/readme.md @@ -0,0 +1,39 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/fsevents/node_modules/ansi-styles/index.js b/node_modules/fsevents/node_modules/ansi-styles/index.js new file mode 100755 index 00000000..78945278 --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-styles/index.js @@ -0,0 +1,65 @@ +'use strict'; + +function assembleStyles () { + var styles = { + modifiers: { + reset: [0, 0], + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + colors: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39] + }, + bgColors: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] + } + }; + + // fix humans + styles.colors.grey = styles.colors.gray; + + Object.keys(styles).forEach(function (groupName) { + var group = styles[groupName]; + + Object.keys(group).forEach(function (styleName) { + var style = group[styleName]; + + styles[styleName] = group[styleName] = { + open: '\u001b[' + style[0] + 'm', + close: '\u001b[' + style[1] + 'm' + }; + }); + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + }); + + return styles; +} + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/fsevents/node_modules/ansi-styles/license b/node_modules/fsevents/node_modules/ansi-styles/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-styles/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fsevents/node_modules/ansi-styles/package.json b/node_modules/fsevents/node_modules/ansi-styles/package.json new file mode 100755 index 00000000..646cf59a --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-styles/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + { + "raw": "ansi-styles@^2.2.1", + "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^2.2.1", + "spec": ">=2.2.1 <3.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/chalk" + ] + ], + "_from": "ansi-styles@>=2.2.1 <3.0.0", + "_id": "ansi-styles@2.2.1", + "_inCache": true, + "_location": "/fsevents/ansi-styles", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "3.8.3", + "_phantomChildren": {}, + "_requested": { + "raw": "ansi-styles@^2.2.1", + "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^2.2.1", + "spec": ">=2.2.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "_shrinkwrap": null, + "_spec": "ansi-styles@^2.2.1", + "_where": "/Users/eshanker/Code/fsevents/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "dependencies": {}, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "95c59b23be760108b6530ca1c89477c21b258032", + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "ansi-styles", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.2.1" +} diff --git a/node_modules/fsevents/node_modules/ansi-styles/readme.md b/node_modules/fsevents/node_modules/ansi-styles/readme.md new file mode 100755 index 00000000..3f933f61 --- /dev/null +++ b/node_modules/fsevents/node_modules/ansi-styles/readme.md @@ -0,0 +1,86 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + +![](screenshot.png) + + +## Install + +``` +$ npm install --save ansi-styles +``` + + +## Usage + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green.open + 'Hello world!' + ansi.green.close); +``` + + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` + + +## Advanced usage + +By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `ansi.modifiers` +- `ansi.colors` +- `ansi.bgColors` + + +###### Example + +```js +console.log(ansi.colors.green.open); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/fsevents/node_modules/aproba/LICENSE b/node_modules/fsevents/node_modules/aproba/LICENSE new file mode 100755 index 00000000..f4be44d8 --- /dev/null +++ b/node_modules/fsevents/node_modules/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/fsevents/node_modules/aproba/README.md b/node_modules/fsevents/node_modules/aproba/README.md new file mode 100755 index 00000000..a9d38222 --- /dev/null +++ b/node_modules/fsevents/node_modules/aproba/README.md @@ -0,0 +1,89 @@ +aproba +====== + +A ridiculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +type | description +---- | ----------- +* | matches any type +A | Array.isArray OR an arguments object +S | typeof == string +N | typeof == number +F | typeof == function +O | typeof == object and not type A and not type E +B | typeof == boolean +E | instanceof Error OR null **(special: see below)** +Z | == null + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. + diff --git a/node_modules/fsevents/node_modules/aproba/index.js b/node_modules/fsevents/node_modules/aproba/index.js new file mode 100755 index 00000000..bc6ed1f1 --- /dev/null +++ b/node_modules/fsevents/node_modules/aproba/index.js @@ -0,0 +1,103 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + function addSchema (schema) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) + } + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E')) + addSchema(schema.replace(/E/, 'Z')) + if (schema.length === 1) addSchema('') + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + Error.captureStackTrace(e, validate) + return e +} diff --git a/node_modules/fsevents/node_modules/aproba/package.json b/node_modules/fsevents/node_modules/aproba/package.json new file mode 100755 index 00000000..81bdb780 --- /dev/null +++ b/node_modules/fsevents/node_modules/aproba/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + { + "raw": "aproba@^1.0.3", + "scope": null, + "escapedName": "aproba", + "name": "aproba", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/gauge" + ] + ], + "_from": "aproba@>=1.0.3 <2.0.0", + "_id": "aproba@1.1.1", + "_inCache": true, + "_location": "/fsevents/aproba", + "_nodeVersion": "7.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/aproba-1.1.1.tgz_1486593129508_0.5718816472217441" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "4.2.0", + "_phantomChildren": {}, + "_requested": { + "raw": "aproba@^1.0.3", + "scope": null, + "escapedName": "aproba", + "name": "aproba", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/gauge" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", + "_shasum": "95d3600f07710aa0e9298c726ad5ecf2eacbabab", + "_shrinkwrap": null, + "_spec": "aproba@^1.0.3", + "_where": "/Users/eshanker/Code/fsevents/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "dependencies": {}, + "description": "A rediculously light-weight argument validator", + "devDependencies": { + "standard": "^8.6.0", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "95d3600f07710aa0e9298c726ad5ecf2eacbabab", + "tarball": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "e7c76b4b42356092db3cd9e2d9388a0134845eb2", + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "aproba", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.1.1" +} diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/.npmignore b/node_modules/fsevents/node_modules/are-we-there-yet/.npmignore new file mode 100755 index 00000000..bc818974 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/.npmignore @@ -0,0 +1,5 @@ +*~ +.#* +node_modules +coverage +.nyc_output diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/CHANGES.md b/node_modules/fsevents/node_modules/are-we-there-yet/CHANGES.md new file mode 100755 index 00000000..e990b86d --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,19 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/LICENSE b/node_modules/fsevents/node_modules/are-we-there-yet/LICENSE new file mode 100755 index 00000000..af458806 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/README.md b/node_modules/fsevents/node_modules/are-we-there-yet/README.md new file mode 100755 index 00000000..c41d3922 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/README.md @@ -0,0 +1,194 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +All tracker objects described below have the following methods, they, along +with the event comprise the interface for consumers of tracker objects. + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/index.js b/node_modules/fsevents/node_modules/are-we-there-yet/index.js new file mode 100755 index 00000000..57d8743f --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/package.json b/node_modules/fsevents/node_modules/are-we-there-yet/package.json new file mode 100755 index 00000000..8128479e --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/npmlog" + ] + ], + "_from": "are-we-there-yet@>=1.1.2 <1.2.0", + "_id": "are-we-there-yet@1.1.2", + "_inCache": true, + "_location": "/fsevents/are-we-there-yet", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.8.1", + "_phantomChildren": {}, + "_requested": { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/npmlog" + ], + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", + "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "_shrinkwrap": null, + "_spec": "are-we-there-yet@~1.1.2", + "_where": "/Users/eshanker/Code/fsevents/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.0 || ^1.1.13" + }, + "description": "Keep track of the overall completion of many dispirate processes", + "devDependencies": { + "standard": "^6.0.8", + "tap": "^5.7.0" + }, + "directories": {}, + "dist": { + "shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "tarball": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz" + }, + "gitHead": "dd5706e2204cb681e78031d0ffe156ed4cc75823", + "homepage": "https://github.com/iarna/are-we-there-yet", + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "are-we-there-yet", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.2" +} diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/test/lib/test-event.js b/node_modules/fsevents/node_modules/are-we-there-yet/test/lib/test-event.js new file mode 100755 index 00000000..2aa7c05c --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/test/lib/test-event.js @@ -0,0 +1,29 @@ +'use strict' +var util = require('util') + +module.exports = function (obj, event, next) { + var timeout = setTimeout(gotTimeout, 10) + obj.once(event, gotResult) + + function gotTimeout () { + obj.removeListener(event, gotResult) + next(new Error('Timeout listening for ' + event)) + } + var result = [] + function gotResult () { + result = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + timeout = setTimeout(gotNoMoreResults, 10) + obj.once(event, gotTooManyResults) + } + function gotNoMoreResults () { + obj.removeListener(event, gotTooManyResults) + var args = [null].concat(result) + next.apply(null, args) + } + function gotTooManyResults () { + var secondResult = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + next(new Error('Got too many results, first ' + util.inspect(result) + ' and then ' + util.inspect(secondResult))) + } +} diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/test/tracker.js b/node_modules/fsevents/node_modules/are-we-there-yet/test/tracker.js new file mode 100755 index 00000000..374c7739 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/test/tracker.js @@ -0,0 +1,57 @@ +'use strict' +var test = require('tap').test +var Tracker = require('../index.js').Tracker + +var testEvent = require('./lib/test-event.js') + +var name = 'test' + +test('initialization', function (t) { + var simple = new Tracker(name) + + t.is(simple.completed(), 0, 'Nothing todo is 0 completion') + t.done() +}) + +var track +var todo = 100 +test('completion', function (t) { + track = new Tracker(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + testEvent(track, 'change', afterCompleteWork) + + track.completeWork(todo) + t.is(track.completed(), 1, 'completeWork: 100% completed') + + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'completeWork: on change event fired') + t.is(onChangeName, name, 'completeWork: on change emits the correct name') + t.done() + } +}) + +test('add more work', function (t) { + testEvent(track, 'change', afterAddWork) + track.addWork(todo) + t.is(track.completed(), 0.5, 'addWork: 50% completed') + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(onChangeName, name, 'addWork: on change emits the correct name') + t.done() + } +}) + +test('complete more work', function (t) { + track.completeWork(200) + t.is(track.completed(), 1, 'completeWork: Over completion is still only 100% complete') + t.done() +}) + +test('finish is always 100%', function (t) { + var finishtest = new Tracker(name, todo) + finishtest.completeWork(50) + finishtest.finish() + t.is(finishtest.completed(), 1, 'finish: Explicitly finishing moves to 100%') + t.done() +}) diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/test/trackergroup.js b/node_modules/fsevents/node_modules/are-we-there-yet/test/trackergroup.js new file mode 100755 index 00000000..799a7670 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/test/trackergroup.js @@ -0,0 +1,96 @@ +'use strict' +var test = require('tap').test +var TrackerGroup = require('../index.js').TrackerGroup +var testEvent = require('./lib/test-event.js') + +test('TrackerGroup', function (t) { + var name = 'test' + + var track = new TrackerGroup(name) + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + testEvent(track, 'change', afterFinishEmpty) + track.finish() + var a, b + function afterFinishEmpty (er, onChangeName, completion) { + t.is(er, null, 'finishEmpty: on change event fired') + t.is(onChangeName, name, 'finishEmpty: on change emits the correct name') + t.is(completion, 1, 'finishEmpty: passed through completion was correct') + t.is(track.completed(), 1, 'finishEmpty: Finishing an empty group actually finishes it') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 1) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'Initially empty') + testEvent(track, 'change', afterCompleteWork) + a.completeWork(5) + } + function afterCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'on change event fired') + t.is(onChangeName, 'a', 'on change emits the correct name') + t.is(completion, 0.25, 'Complete half of one is a quarter overall') + t.is(track.completed(), 0.25, 'Complete half of one is a quarter overall') + testEvent(track, 'change', afterFinishAll) + track.finish() + } + function afterFinishAll (er, onChangeName, completion) { + t.is(er, null, 'finishAll: on change event fired') + t.is(onChangeName, name, 'finishAll: on change emits the correct name') + t.is(completion, 1, 'Finishing everything ') + t.is(track.completed(), 1, 'Finishing everything ') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 2) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'weighted: Initially empty') + testEvent(track, 'change', afterWeightedCompleteWork) + a.completeWork(5) + } + function afterWeightedCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'weighted: on change event fired') + t.is(onChangeName, 'a', 'weighted: on change emits the correct name') + t.is(Math.floor(completion * 100), 33, 'weighted: Complete half of double weighted') + t.is(Math.floor(track.completed() * 100), 33, 'weighted: Complete half of double weighted') + testEvent(track, 'change', afterWeightedFinishAll) + track.finish() + } + function afterWeightedFinishAll (er, onChangeName, completion) { + t.is(er, null, 'weightedFinishAll: on change event fired') + t.is(onChangeName, name, 'weightedFinishAll: on change emits the correct name') + t.is(completion, 1, 'weightedFinishaAll: Finishing everything ') + t.is(track.completed(), 1, 'weightedFinishaAll: Finishing everything ') + + track = new TrackerGroup(name) + a = track.newGroup('a', 10) + b = track.newGroup('b', 10) + var a1 = a.newItem('a.1', 10) + a1.completeWork(5) + t.is(track.completed(), 0.25, 'nested: Initially quarter done') + testEvent(track, 'change', afterNestedComplete) + b.finish() + } + function afterNestedComplete (er, onChangeName, completion) { + t.is(er, null, 'nestedComplete: on change event fired') + t.is(onChangeName, 'b', 'nestedComplete: on change emits the correct name') + t.is(completion, 0.75, 'nestedComplete: Finishing everything ') + t.is(track.completed(), 0.75, 'nestedComplete: Finishing everything ') + t.end() + } +}) + +test('cycles', function (t) { + var track = new TrackerGroup('top') + testCycle(track, track) + var layer1 = track.newGroup('layer1') + testCycle(layer1, track) + t.end() + + function testCycle (addTo, toAdd) { + try { + addTo.addUnit(toAdd) + t.fail(toAdd.name) + } catch (ex) { + console.log(ex) + t.pass(toAdd.name) + } + } +}) diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/test/trackerstream.js b/node_modules/fsevents/node_modules/are-we-there-yet/test/trackerstream.js new file mode 100755 index 00000000..65f04b03 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/test/trackerstream.js @@ -0,0 +1,51 @@ +'use strict' +var test = require('tap').test +var util = require('util') +var stream = require('readable-stream') +var TrackerStream = require('../index.js').TrackerStream +var testEvent = require('./lib/test-event.js') + +var Sink = function () { + stream.Writable.apply(this, arguments) +} +util.inherits(Sink, stream.Writable) +Sink.prototype._write = function (data, encoding, cb) { + cb() +} + +test('TrackerStream', function (t) { + t.plan(9) + + var name = 'test' + var track = new TrackerStream(name) + + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + + var todo = 10 + track = new TrackerStream(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + track.pipe(new Sink()) + + testEvent(track, 'change', afterCompleteWork) + track.write('0123456789') + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'write: on change event fired') + t.is(onChangeName, name, 'write: on change emits the correct name') + t.is(track.completed(), 1, 'write: 100% completed') + + testEvent(track, 'change', afterAddWork) + track.addWork(10) + } + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(track.completed(), 0.5, 'addWork: 50% completed') + + testEvent(track, 'change', afterAllWork) + track.write('ABCDEFGHIJKLMNOPQRST') + } + function afterAllWork (er) { + t.is(er, null, 'allWork: on change event fired') + t.is(track.completed(), 1, 'allWork: 100% completed') + } +}) diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/tracker-base.js b/node_modules/fsevents/node_modules/are-we-there-yet/tracker-base.js new file mode 100755 index 00000000..6f436875 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/tracker-group.js b/node_modules/fsevents/node_modules/are-we-there-yet/tracker-group.js new file mode 100755 index 00000000..9759e122 --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/tracker-stream.js b/node_modules/fsevents/node_modules/are-we-there-yet/tracker-stream.js new file mode 100755 index 00000000..fb9598ed --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,35 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') diff --git a/node_modules/fsevents/node_modules/are-we-there-yet/tracker.js b/node_modules/fsevents/node_modules/are-we-there-yet/tracker.js new file mode 100755 index 00000000..68c2339b --- /dev/null +++ b/node_modules/fsevents/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/node_modules/fsevents/node_modules/asn1/.npmignore b/node_modules/fsevents/node_modules/asn1/.npmignore new file mode 100755 index 00000000..eb03e3e1 --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/.npmignore @@ -0,0 +1,2 @@ +node_modules +*.log diff --git a/node_modules/fsevents/node_modules/asn1/.travis.yml b/node_modules/fsevents/node_modules/asn1/.travis.yml new file mode 100755 index 00000000..09d3ef37 --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.10 diff --git a/node_modules/fsevents/node_modules/asn1/LICENSE b/node_modules/fsevents/node_modules/asn1/LICENSE new file mode 100755 index 00000000..9b5dcdb7 --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Mark Cavage, All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE diff --git a/node_modules/fsevents/node_modules/asn1/README.md b/node_modules/fsevents/node_modules/asn1/README.md new file mode 100755 index 00000000..7cebf7a2 --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/README.md @@ -0,0 +1,50 @@ +node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS. +Currently BER encoding is supported; at some point I'll likely have to do DER. + +## Usage + +Mostly, if you're *actually* needing to read and write ASN.1, you probably don't +need this readme to explain what and why. If you have no idea what ASN.1 is, +see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +The source is pretty much self-explanatory, and has read/write methods for the +common types out there. + +### Decoding + +The following reads an ASN.1 sequence with a boolean. + + var Ber = require('asn1').Ber; + + var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff])); + + reader.readSequence(); + console.log('Sequence len: ' + reader.length); + if (reader.peek() === Ber.Boolean) + console.log(reader.readBoolean()); + +### Encoding + +The following generates the same payload as above. + + var Ber = require('asn1').Ber; + + var writer = new Ber.Writer(); + + writer.startSequence(); + writer.writeBoolean(true); + writer.endSequence(); + + console.log(writer.buffer); + +## Installation + + npm install asn1 + +## License + +MIT. + +## Bugs + +See . diff --git a/node_modules/fsevents/node_modules/asn1/lib/ber/errors.js b/node_modules/fsevents/node_modules/asn1/lib/ber/errors.js new file mode 100755 index 00000000..ff21d4fa --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/lib/ber/errors.js @@ -0,0 +1,13 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + + newInvalidAsn1Error: function(msg) { + var e = new Error(); + e.name = 'InvalidAsn1Error'; + e.message = msg || ''; + return e; + } + +}; diff --git a/node_modules/fsevents/node_modules/asn1/lib/ber/index.js b/node_modules/fsevents/node_modules/asn1/lib/ber/index.js new file mode 100755 index 00000000..4fb90aea --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/lib/ber/index.js @@ -0,0 +1,27 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var errors = require('./errors'); +var types = require('./types'); + +var Reader = require('./reader'); +var Writer = require('./writer'); + + +///--- Exports + +module.exports = { + + Reader: Reader, + + Writer: Writer + +}; + +for (var t in types) { + if (types.hasOwnProperty(t)) + module.exports[t] = types[t]; +} +for (var e in errors) { + if (errors.hasOwnProperty(e)) + module.exports[e] = errors[e]; +} diff --git a/node_modules/fsevents/node_modules/asn1/lib/ber/reader.js b/node_modules/fsevents/node_modules/asn1/lib/ber/reader.js new file mode 100755 index 00000000..0a00e98e --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/lib/ber/reader.js @@ -0,0 +1,261 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); + +var ASN1 = require('./types'); +var errors = require('./errors'); + + +///--- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + + + +///--- API + +function Reader(data) { + if (!data || !Buffer.isBuffer(data)) + throw new TypeError('data must be a node Buffer'); + + this._buf = data; + this._size = data.length; + + // These hold the "current" state + this._len = 0; + this._offset = 0; +} + +Object.defineProperty(Reader.prototype, 'length', { + enumerable: true, + get: function () { return (this._len); } +}); + +Object.defineProperty(Reader.prototype, 'offset', { + enumerable: true, + get: function () { return (this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'remain', { + get: function () { return (this._size - this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'buffer', { + get: function () { return (this._buf.slice(this._offset)); } +}); + + +/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */ +Reader.prototype.readByte = function(peek) { + if (this._size - this._offset < 1) + return null; + + var b = this._buf[this._offset] & 0xff; + + if (!peek) + this._offset += 1; + + return b; +}; + + +Reader.prototype.peek = function() { + return this.readByte(true); +}; + + +/** + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 + */ +Reader.prototype.readLength = function(offset) { + if (offset === undefined) + offset = this._offset; + + if (offset >= this._size) + return null; + + var lenB = this._buf[offset++] & 0xff; + if (lenB === null) + return null; + + if ((lenB & 0x80) == 0x80) { + lenB &= 0x7f; + + if (lenB == 0) + throw newInvalidAsn1Error('Indefinite length not supported'); + + if (lenB > 4) + throw newInvalidAsn1Error('encoding too long'); + + if (this._size - offset < lenB) + return null; + + this._len = 0; + for (var i = 0; i < lenB; i++) + this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + + } else { + // Wasn't a variable length + this._len = lenB; + } + + return offset; +}; + + +/** + * Parses the next sequence in this BER buffer. + * + * To get the length of the sequence, call `Reader.length`. + * + * @return {Number} the sequence's tag. + */ +Reader.prototype.readSequence = function(tag) { + var seq = this.peek(); + if (seq === null) + return null; + if (tag !== undefined && tag !== seq) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + seq.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + this._offset = o; + return seq; +}; + + +Reader.prototype.readInt = function() { + return this._readTag(ASN1.Integer); +}; + + +Reader.prototype.readBoolean = function() { + return (this._readTag(ASN1.Boolean) === 0 ? false : true); +}; + + +Reader.prototype.readEnumeration = function() { + return this._readTag(ASN1.Enumeration); +}; + + +Reader.prototype.readString = function(tag, retbuf) { + if (!tag) + tag = ASN1.OctetString; + + var b = this.peek(); + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + + if (o === null) + return null; + + if (this.length > this._size - o) + return null; + + this._offset = o; + + if (this.length === 0) + return retbuf ? new Buffer(0) : ''; + + var str = this._buf.slice(this._offset, this._offset + this.length); + this._offset += this.length; + + return retbuf ? str : str.toString('utf8'); +}; + +Reader.prototype.readOID = function(tag) { + if (!tag) + tag = ASN1.OID; + + var b = this.readString(tag, true); + if (b === null) + return null; + + var values = []; + var value = 0; + + for (var i = 0; i < b.length; i++) { + var byte = b[i] & 0xff; + + value <<= 7; + value += byte & 0x7f; + if ((byte & 0x80) == 0) { + values.push(value); + value = 0; + } + } + + value = values.shift(); + values.unshift(value % 40); + values.unshift((value / 40) >> 0); + + return values.join('.'); +}; + + +Reader.prototype._readTag = function(tag) { + assert.ok(tag !== undefined); + + var b = this.peek(); + + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + if (this.length > 4) + throw newInvalidAsn1Error('Integer too long: ' + this.length); + + if (this.length > this._size - o) + return null; + this._offset = o; + + var fb = this._buf[this._offset]; + var value = 0; + + for (var i = 0; i < this.length; i++) { + value <<= 8; + value |= (this._buf[this._offset++] & 0xff); + } + + if ((fb & 0x80) == 0x80 && i !== 4) + value -= (1 << (i * 8)); + + return value >> 0; +}; + + + +///--- Exported API + +module.exports = Reader; diff --git a/node_modules/fsevents/node_modules/asn1/lib/ber/types.js b/node_modules/fsevents/node_modules/asn1/lib/ber/types.js new file mode 100755 index 00000000..8aea0001 --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/lib/ber/types.js @@ -0,0 +1,36 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + EOC: 0, + Boolean: 1, + Integer: 2, + BitString: 3, + OctetString: 4, + Null: 5, + OID: 6, + ObjectDescriptor: 7, + External: 8, + Real: 9, // float + Enumeration: 10, + PDV: 11, + Utf8String: 12, + RelativeOID: 13, + Sequence: 16, + Set: 17, + NumericString: 18, + PrintableString: 19, + T61String: 20, + VideotexString: 21, + IA5String: 22, + UTCTime: 23, + GeneralizedTime: 24, + GraphicString: 25, + VisibleString: 26, + GeneralString: 28, + UniversalString: 29, + CharacterString: 30, + BMPString: 31, + Constructor: 32, + Context: 128 +}; diff --git a/node_modules/fsevents/node_modules/asn1/lib/ber/writer.js b/node_modules/fsevents/node_modules/asn1/lib/ber/writer.js new file mode 100755 index 00000000..d9d99af6 --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/lib/ber/writer.js @@ -0,0 +1,316 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var ASN1 = require('./types'); +var errors = require('./errors'); + + +///--- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + +var DEFAULT_OPTS = { + size: 1024, + growthFactor: 8 +}; + + +///--- Helpers + +function merge(from, to) { + assert.ok(from); + assert.equal(typeof(from), 'object'); + assert.ok(to); + assert.equal(typeof(to), 'object'); + + var keys = Object.getOwnPropertyNames(from); + keys.forEach(function(key) { + if (to[key]) + return; + + var value = Object.getOwnPropertyDescriptor(from, key); + Object.defineProperty(to, key, value); + }); + + return to; +} + + + +///--- API + +function Writer(options) { + options = merge(DEFAULT_OPTS, options || {}); + + this._buf = new Buffer(options.size || 1024); + this._size = this._buf.length; + this._offset = 0; + this._options = options; + + // A list of offsets in the buffer where we need to insert + // sequence tag/len pairs. + this._seq = []; +} + +Object.defineProperty(Writer.prototype, 'buffer', { + get: function () { + if (this._seq.length) + throw new InvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + + return (this._buf.slice(0, this._offset)); + } +}); + +Writer.prototype.writeByte = function(b) { + if (typeof(b) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(1); + this._buf[this._offset++] = b; +}; + + +Writer.prototype.writeInt = function(i, tag) { + if (typeof(i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof(tag) !== 'number') + tag = ASN1.Integer; + + var sz = 4; + + while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && + (sz > 1)) { + sz--; + i <<= 8; + } + + if (sz > 4) + throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff'); + + this._ensure(2 + sz); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = sz; + + while (sz-- > 0) { + this._buf[this._offset++] = ((i & 0xff000000) >>> 24); + i <<= 8; + } + +}; + + +Writer.prototype.writeNull = function() { + this.writeByte(ASN1.Null); + this.writeByte(0x00); +}; + + +Writer.prototype.writeEnumeration = function(i, tag) { + if (typeof(i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof(tag) !== 'number') + tag = ASN1.Enumeration; + + return this.writeInt(i, tag); +}; + + +Writer.prototype.writeBoolean = function(b, tag) { + if (typeof(b) !== 'boolean') + throw new TypeError('argument must be a Boolean'); + if (typeof(tag) !== 'number') + tag = ASN1.Boolean; + + this._ensure(3); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = 0x01; + this._buf[this._offset++] = b ? 0xff : 0x00; +}; + + +Writer.prototype.writeString = function(s, tag) { + if (typeof(s) !== 'string') + throw new TypeError('argument must be a string (was: ' + typeof(s) + ')'); + if (typeof(tag) !== 'number') + tag = ASN1.OctetString; + + var len = Buffer.byteLength(s); + this.writeByte(tag); + this.writeLength(len); + if (len) { + this._ensure(len); + this._buf.write(s, this._offset); + this._offset += len; + } +}; + + +Writer.prototype.writeBuffer = function(buf, tag) { + if (typeof(tag) !== 'number') + throw new TypeError('tag must be a number'); + if (!Buffer.isBuffer(buf)) + throw new TypeError('argument must be a buffer'); + + this.writeByte(tag); + this.writeLength(buf.length); + this._ensure(buf.length); + buf.copy(this._buf, this._offset, 0, buf.length); + this._offset += buf.length; +}; + + +Writer.prototype.writeStringArray = function(strings) { + if ((!strings instanceof Array)) + throw new TypeError('argument must be an Array[String]'); + + var self = this; + strings.forEach(function(s) { + self.writeString(s); + }); +}; + +// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID = function(s, tag) { + if (typeof(s) !== 'string') + throw new TypeError('argument must be a string'); + if (typeof(tag) !== 'number') + tag = ASN1.OID; + + if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) + throw new Error('argument is not a valid OID string'); + + function encodeOctet(bytes, octet) { + if (octet < 128) { + bytes.push(octet); + } else if (octet < 16384) { + bytes.push((octet >>> 7) | 0x80); + bytes.push(octet & 0x7F); + } else if (octet < 2097152) { + bytes.push((octet >>> 14) | 0x80); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else if (octet < 268435456) { + bytes.push((octet >>> 21) | 0x80); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else { + bytes.push(((octet >>> 28) | 0x80) & 0xFF); + bytes.push(((octet >>> 21) | 0x80) & 0xFF); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } + } + + var tmp = s.split('.'); + var bytes = []; + bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); + tmp.slice(2).forEach(function(b) { + encodeOctet(bytes, parseInt(b, 10)); + }); + + var self = this; + this._ensure(2 + bytes.length); + this.writeByte(tag); + this.writeLength(bytes.length); + bytes.forEach(function(b) { + self.writeByte(b); + }); +}; + + +Writer.prototype.writeLength = function(len) { + if (typeof(len) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(4); + + if (len <= 0x7f) { + this._buf[this._offset++] = len; + } else if (len <= 0xff) { + this._buf[this._offset++] = 0x81; + this._buf[this._offset++] = len; + } else if (len <= 0xffff) { + this._buf[this._offset++] = 0x82; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else if (len <= 0xffffff) { + this._buf[this._offset++] = 0x83; + this._buf[this._offset++] = len >> 16; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else { + throw new InvalidAsn1ERror('Length too long (> 4 bytes)'); + } +}; + +Writer.prototype.startSequence = function(tag) { + if (typeof(tag) !== 'number') + tag = ASN1.Sequence | ASN1.Constructor; + + this.writeByte(tag); + this._seq.push(this._offset); + this._ensure(3); + this._offset += 3; +}; + + +Writer.prototype.endSequence = function() { + var seq = this._seq.pop(); + var start = seq + 3; + var len = this._offset - start; + + if (len <= 0x7f) { + this._shift(start, len, -2); + this._buf[seq] = len; + } else if (len <= 0xff) { + this._shift(start, len, -1); + this._buf[seq] = 0x81; + this._buf[seq + 1] = len; + } else if (len <= 0xffff) { + this._buf[seq] = 0x82; + this._buf[seq + 1] = len >> 8; + this._buf[seq + 2] = len; + } else if (len <= 0xffffff) { + this._shift(start, len, 1); + this._buf[seq] = 0x83; + this._buf[seq + 1] = len >> 16; + this._buf[seq + 2] = len >> 8; + this._buf[seq + 3] = len; + } else { + throw new InvalidAsn1Error('Sequence too long'); + } +}; + + +Writer.prototype._shift = function(start, len, shift) { + assert.ok(start !== undefined); + assert.ok(len !== undefined); + assert.ok(shift); + + this._buf.copy(this._buf, start + shift, start, start + len); + this._offset += shift; +}; + +Writer.prototype._ensure = function(len) { + assert.ok(len); + + if (this._size - this._offset < len) { + var sz = this._size * this._options.growthFactor; + if (sz - this._offset < len) + sz += len; + + var buf = new Buffer(sz); + + this._buf.copy(buf, 0, 0, this._offset); + this._buf = buf; + this._size = sz; + } +}; + + + +///--- Exported API + +module.exports = Writer; diff --git a/node_modules/fsevents/node_modules/asn1/lib/index.js b/node_modules/fsevents/node_modules/asn1/lib/index.js new file mode 100755 index 00000000..d1766e7a --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/lib/index.js @@ -0,0 +1,20 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +// If you have no idea what ASN.1 or BER is, see this: +// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +var Ber = require('./ber/index'); + + + +///--- Exported API + +module.exports = { + + Ber: Ber, + + BerReader: Ber.Reader, + + BerWriter: Ber.Writer + +}; diff --git a/node_modules/fsevents/node_modules/asn1/package.json b/node_modules/fsevents/node_modules/asn1/package.json new file mode 100755 index 00000000..a4d9a3e9 --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "asn1@~0.2.3", + "scope": null, + "escapedName": "asn1", + "name": "asn1", + "rawSpec": "~0.2.3", + "spec": ">=0.2.3 <0.3.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/sshpk" + ] + ], + "_from": "asn1@>=0.2.3 <0.3.0", + "_id": "asn1@0.2.3", + "_inCache": true, + "_location": "/fsevents/asn1", + "_npmUser": { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "asn1@~0.2.3", + "scope": null, + "escapedName": "asn1", + "name": "asn1", + "rawSpec": "~0.2.3", + "spec": ">=0.2.3 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/sshpk" + ], + "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", + "_shrinkwrap": null, + "_spec": "asn1@~0.2.3", + "_where": "/Users/eshanker/Code/fsevents/node_modules/sshpk", + "author": { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + "bugs": { + "url": "https://github.com/mcavage/node-asn1/issues" + }, + "contributors": [ + { + "name": "David Gwynne", + "email": "loki@animata.net" + }, + { + "name": "Yunong Xiao", + "email": "yunong@joyent.com" + }, + { + "name": "Alex Wilson", + "email": "alex.wilson@joyent.com" + } + ], + "dependencies": {}, + "description": "Contains parsers and serializers for ASN.1 (currently BER only)", + "devDependencies": { + "tap": "0.4.8" + }, + "directories": {}, + "dist": { + "shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", + "tarball": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" + }, + "homepage": "https://github.com/mcavage/node-asn1", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "mcavage", + "email": "mcavage@gmail.com" + }, + { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + } + ], + "name": "asn1", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mcavage/node-asn1.git" + }, + "scripts": { + "test": "tap ./tst" + }, + "version": "0.2.3" +} diff --git a/node_modules/fsevents/node_modules/asn1/tst/ber/reader.test.js b/node_modules/fsevents/node_modules/asn1/tst/ber/reader.test.js new file mode 100755 index 00000000..062fd7ee --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/tst/ber/reader.test.js @@ -0,0 +1,208 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var test = require('tap').test; + + + +///--- Globals + +var BerReader; + + + +///--- Tests + +test('load library', function(t) { + BerReader = require('../../lib/index').BerReader; + t.ok(BerReader); + try { + new BerReader(); + t.fail('Should have thrown'); + } catch (e) { + t.ok(e instanceof TypeError, 'Should have been a type error'); + } + t.end(); +}); + + +test('read byte', function(t) { + var reader = new BerReader(new Buffer([0xde])); + t.ok(reader); + t.equal(reader.readByte(), 0xde, 'wrong value'); + t.end(); +}); + + +test('read 1 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x01, 0x03])); + t.ok(reader); + t.equal(reader.readInt(), 0x03, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read 2 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde])); + t.ok(reader); + t.equal(reader.readInt(), 0x7ede, 'wrong value'); + t.equal(reader.length, 0x02, 'wrong length'); + t.end(); +}); + + +test('read 3 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03])); + t.ok(reader); + t.equal(reader.readInt(), 0x7ede03, 'wrong value'); + t.equal(reader.length, 0x03, 'wrong length'); + t.end(); +}); + + +test('read 4 byte int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01])); + t.ok(reader); + t.equal(reader.readInt(), 0x7ede0301, 'wrong value'); + t.equal(reader.length, 0x04, 'wrong length'); + t.end(); +}); + + +test('read 1 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x01, 0xdc])); + t.ok(reader); + t.equal(reader.readInt(), -36, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read 2 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x02, 0xc0, 0x4e])); + t.ok(reader); + t.equal(reader.readInt(), -16306, 'wrong value'); + t.equal(reader.length, 0x02, 'wrong length'); + t.end(); +}); + + +test('read 3 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x03, 0xff, 0x00, 0x19])); + t.ok(reader); + t.equal(reader.readInt(), -65511, 'wrong value'); + t.equal(reader.length, 0x03, 'wrong length'); + t.end(); +}); + + +test('read 4 byte negative int', function(t) { + var reader = new BerReader(new Buffer([0x02, 0x04, 0x91, 0x7c, 0x22, 0x1f])); + t.ok(reader); + t.equal(reader.readInt(), -1854135777, 'wrong value'); + t.equal(reader.length, 0x04, 'wrong length'); + t.end(); +}); + + +test('read boolean true', function(t) { + var reader = new BerReader(new Buffer([0x01, 0x01, 0xff])); + t.ok(reader); + t.equal(reader.readBoolean(), true, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read boolean false', function(t) { + var reader = new BerReader(new Buffer([0x01, 0x01, 0x00])); + t.ok(reader); + t.equal(reader.readBoolean(), false, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read enumeration', function(t) { + var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20])); + t.ok(reader); + t.equal(reader.readEnumeration(), 0x20, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('read string', function(t) { + var dn = 'cn=foo,ou=unit,o=test'; + var buf = new Buffer(dn.length + 2); + buf[0] = 0x04; + buf[1] = Buffer.byteLength(dn); + buf.write(dn, 2); + var reader = new BerReader(buf); + t.ok(reader); + t.equal(reader.readString(), dn, 'wrong value'); + t.equal(reader.length, dn.length, 'wrong length'); + t.end(); +}); + + +test('read sequence', function(t) { + var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff])); + t.ok(reader); + t.equal(reader.readSequence(), 0x30, 'wrong value'); + t.equal(reader.length, 0x03, 'wrong length'); + t.equal(reader.readBoolean(), true, 'wrong value'); + t.equal(reader.length, 0x01, 'wrong length'); + t.end(); +}); + + +test('anonymous LDAPv3 bind', function(t) { + var BIND = new Buffer(14); + BIND[0] = 0x30; // Sequence + BIND[1] = 12; // len + BIND[2] = 0x02; // ASN.1 Integer + BIND[3] = 1; // len + BIND[4] = 0x04; // msgid (make up 4) + BIND[5] = 0x60; // Bind Request + BIND[6] = 7; // len + BIND[7] = 0x02; // ASN.1 Integer + BIND[8] = 1; // len + BIND[9] = 0x03; // v3 + BIND[10] = 0x04; // String (bind dn) + BIND[11] = 0; // len + BIND[12] = 0x80; // ContextSpecific (choice) + BIND[13] = 0; // simple bind + + // Start testing ^^ + var ber = new BerReader(BIND); + t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence'); + t.equal(ber.length, 12, 'Message length should be 12'); + t.equal(ber.readInt(), 4, 'Message id should have been 4'); + t.equal(ber.readSequence(), 96, 'Bind Request should have been 96'); + t.equal(ber.length, 7, 'Bind length should have been 7'); + t.equal(ber.readInt(), 3, 'LDAP version should have been 3'); + t.equal(ber.readString(), '', 'Bind DN should have been empty'); + t.equal(ber.length, 0, 'string length should have been 0'); + t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)'); + t.equal(ber.readByte(), 0, 'Should have been simple bind'); + t.equal(null, ber.readByte(), 'Should be out of data'); + t.end(); +}); + + +test('long string', function(t) { + var buf = new Buffer(256); + var o; + var s = + '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' + + 'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' + + 'Teena Vradmin\'s description.'; + buf[0] = 0x04; + buf[1] = 0x81; + buf[2] = 0x94; + buf.write(s, 3); + var ber = new BerReader(buf.slice(0, 3 + s.length)); + t.equal(ber.readString(), s); + t.end(); +}); diff --git a/node_modules/fsevents/node_modules/asn1/tst/ber/writer.test.js b/node_modules/fsevents/node_modules/asn1/tst/ber/writer.test.js new file mode 100755 index 00000000..d87cb7bc --- /dev/null +++ b/node_modules/fsevents/node_modules/asn1/tst/ber/writer.test.js @@ -0,0 +1,370 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var test = require('tap').test; +var sys = require('sys'); + +///--- Globals + +var BerWriter; + +var BerReader; + + +///--- Tests + +test('load library', function(t) { + BerWriter = require('../../lib/index').BerWriter; + t.ok(BerWriter); + t.ok(new BerWriter()); + t.end(); +}); + + +test('write byte', function(t) { + var writer = new BerWriter(); + + writer.writeByte(0xC2); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 1, 'Wrong length'); + t.equal(ber[0], 0xC2, 'value wrong'); + + t.end(); +}); + + +test('write 1 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7f); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 3, 'Wrong length for an int: ' + ber.length); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong (2) -> ' + ber[0]); + t.equal(ber[1], 0x01, 'length wrong(1) -> ' + ber[1]); + t.equal(ber[2], 0x7f, 'value wrong(3) -> ' + ber[2]); + + t.end(); +}); + + +test('write 2 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7ffe); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 4, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x02, 'length wrong'); + t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); + t.equal(ber[3], 0xfe, 'value wrong (byte 2)'); + + t.end(); +}); + + +test('write 3 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7ffffe); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 5, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x03, 'length wrong'); + t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); + t.equal(ber[3], 0xff, 'value wrong (byte 2)'); + t.equal(ber[4], 0xfe, 'value wrong (byte 3)'); + + t.end(); +}); + + +test('write 4 byte int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(0x7ffffffe); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 6, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x04, 'length wrong'); + t.equal(ber[2], 0x7f, 'value wrong (byte 1)'); + t.equal(ber[3], 0xff, 'value wrong (byte 2)'); + t.equal(ber[4], 0xff, 'value wrong (byte 3)'); + t.equal(ber[5], 0xfe, 'value wrong (byte 4)'); + + t.end(); +}); + + +test('write 1 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-128); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 3, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x01, 'length wrong'); + t.equal(ber[2], 0x80, 'value wrong (byte 1)'); + + t.end(); +}); + + +test('write 2 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-22400); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 4, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x02, 'length wrong'); + t.equal(ber[2], 0xa8, 'value wrong (byte 1)'); + t.equal(ber[3], 0x80, 'value wrong (byte 2)'); + + t.end(); +}); + + +test('write 3 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-481653); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 5, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x03, 'length wrong'); + t.equal(ber[2], 0xf8, 'value wrong (byte 1)'); + t.equal(ber[3], 0xa6, 'value wrong (byte 2)'); + t.equal(ber[4], 0x8b, 'value wrong (byte 3)'); + + t.end(); +}); + + +test('write 4 byte negative int', function(t) { + var writer = new BerWriter(); + + writer.writeInt(-1522904131); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 6, 'Wrong length for an int'); + t.equal(ber[0], 0x02, 'ASN.1 tag wrong'); + t.equal(ber[1], 0x04, 'length wrong'); + t.equal(ber[2], 0xa5, 'value wrong (byte 1)'); + t.equal(ber[3], 0x3a, 'value wrong (byte 2)'); + t.equal(ber[4], 0x53, 'value wrong (byte 3)'); + t.equal(ber[5], 0xbd, 'value wrong (byte 4)'); + + t.end(); +}); + + +test('write boolean', function(t) { + var writer = new BerWriter(); + + writer.writeBoolean(true); + writer.writeBoolean(false); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 6, 'Wrong length'); + t.equal(ber[0], 0x01, 'tag wrong'); + t.equal(ber[1], 0x01, 'length wrong'); + t.equal(ber[2], 0xff, 'value wrong'); + t.equal(ber[3], 0x01, 'tag wrong'); + t.equal(ber[4], 0x01, 'length wrong'); + t.equal(ber[5], 0x00, 'value wrong'); + + t.end(); +}); + + +test('write string', function(t) { + var writer = new BerWriter(); + writer.writeString('hello world'); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 13, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + +test('write buffer', function(t) { + var writer = new BerWriter(); + // write some stuff to start with + writer.writeString('hello world'); + var ber = writer.buffer; + var buf = new Buffer([0x04, 0x0b, 0x30, 0x09, 0x02, 0x01, 0x0f, 0x01, 0x01, + 0xff, 0x01, 0x01, 0xff]); + writer.writeBuffer(buf.slice(2, buf.length), 0x04); + ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 26, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value'); + t.equal(ber[13], buf[0], 'wrong tag'); + t.equal(ber[14], buf[1], 'wrong length'); + for (var i = 13, j = 0; i < ber.length && j < buf.length; i++, j++) { + t.equal(ber[i], buf[j], 'buffer contents not identical'); + } + t.end(); +}); + +test('write string array', function(t) { + var writer = new BerWriter(); + writer.writeStringArray(['hello world', 'fubar!']); + var ber = writer.buffer; + + t.ok(ber); + + t.equal(ber.length, 21, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value'); + + t.equal(ber[13], 0x04, 'wrong tag'); + t.equal(ber[14], 6, 'wrong length'); + t.equal(ber.slice(15).toString('utf8'), 'fubar!', 'wrong value'); + + t.end(); +}); + + +test('resize internal buffer', function(t) { + var writer = new BerWriter({size: 2}); + writer.writeString('hello world'); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 13, 'wrong length'); + t.equal(ber[0], 0x04, 'wrong tag'); + t.equal(ber[1], 11, 'wrong length'); + t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + + +test('sequence', function(t) { + var writer = new BerWriter({size: 25}); + writer.startSequence(); + writer.writeString('hello world'); + writer.endSequence(); + var ber = writer.buffer; + + t.ok(ber); + console.log(ber); + t.equal(ber.length, 15, 'wrong length'); + t.equal(ber[0], 0x30, 'wrong tag'); + t.equal(ber[1], 13, 'wrong length'); + t.equal(ber[2], 0x04, 'wrong tag'); + t.equal(ber[3], 11, 'wrong length'); + t.equal(ber.slice(4).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + + +test('nested sequence', function(t) { + var writer = new BerWriter({size: 25}); + writer.startSequence(); + writer.writeString('hello world'); + writer.startSequence(); + writer.writeString('hello world'); + writer.endSequence(); + writer.endSequence(); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 30, 'wrong length'); + t.equal(ber[0], 0x30, 'wrong tag'); + t.equal(ber[1], 28, 'wrong length'); + t.equal(ber[2], 0x04, 'wrong tag'); + t.equal(ber[3], 11, 'wrong length'); + t.equal(ber.slice(4, 15).toString('utf8'), 'hello world', 'wrong value'); + t.equal(ber[15], 0x30, 'wrong tag'); + t.equal(ber[16], 13, 'wrong length'); + t.equal(ber[17], 0x04, 'wrong tag'); + t.equal(ber[18], 11, 'wrong length'); + t.equal(ber.slice(19, 30).toString('utf8'), 'hello world', 'wrong value'); + + t.end(); +}); + + +test('LDAP bind message', function(t) { + var dn = 'cn=foo,ou=unit,o=test'; + var writer = new BerWriter(); + writer.startSequence(); + writer.writeInt(3); // msgid = 3 + writer.startSequence(0x60); // ldap bind + writer.writeInt(3); // ldap v3 + writer.writeString(dn); + writer.writeByte(0x80); + writer.writeByte(0x00); + writer.endSequence(); + writer.endSequence(); + var ber = writer.buffer; + + t.ok(ber); + t.equal(ber.length, 35, 'wrong length (buffer)'); + t.equal(ber[0], 0x30, 'wrong tag'); + t.equal(ber[1], 33, 'wrong length'); + t.equal(ber[2], 0x02, 'wrong tag'); + t.equal(ber[3], 1, 'wrong length'); + t.equal(ber[4], 0x03, 'wrong value'); + t.equal(ber[5], 0x60, 'wrong tag'); + t.equal(ber[6], 28, 'wrong length'); + t.equal(ber[7], 0x02, 'wrong tag'); + t.equal(ber[8], 1, 'wrong length'); + t.equal(ber[9], 0x03, 'wrong value'); + t.equal(ber[10], 0x04, 'wrong tag'); + t.equal(ber[11], dn.length, 'wrong length'); + t.equal(ber.slice(12, 33).toString('utf8'), dn, 'wrong value'); + t.equal(ber[33], 0x80, 'wrong tag'); + t.equal(ber[34], 0x00, 'wrong len'); + + t.end(); +}); + + +test('Write OID', function(t) { + var oid = '1.2.840.113549.1.1.1'; + var writer = new BerWriter(); + writer.writeOID(oid); + + var ber = writer.buffer; + t.ok(ber); + console.log(require('util').inspect(ber)); + console.log(require('util').inspect(new Buffer([0x06, 0x09, 0x2a, 0x86, + 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x01, 0x01]))); + + t.end(); +}); diff --git a/node_modules/fsevents/node_modules/assert-plus/AUTHORS b/node_modules/fsevents/node_modules/assert-plus/AUTHORS new file mode 100755 index 00000000..1923524f --- /dev/null +++ b/node_modules/fsevents/node_modules/assert-plus/AUTHORS @@ -0,0 +1,6 @@ +Dave Eddy +Fred Kuo +Lars-Magnus Skog +Mark Cavage +Patrick Mooney +Rob Gulewich diff --git a/node_modules/fsevents/node_modules/assert-plus/CHANGES.md b/node_modules/fsevents/node_modules/assert-plus/CHANGES.md new file mode 100755 index 00000000..d249d9b2 --- /dev/null +++ b/node_modules/fsevents/node_modules/assert-plus/CHANGES.md @@ -0,0 +1,8 @@ +# assert-plus Changelog + +## 0.2.0 + +- Fix `assert.object(null)` so it throws +- Fix optional/arrayOf exports for non-type-of asserts +- Add optiona/arrayOf exports for Stream/Date/Regex/uuid +- Add basic unit test coverage diff --git a/node_modules/fsevents/node_modules/assert-plus/README.md b/node_modules/fsevents/node_modules/assert-plus/README.md new file mode 100755 index 00000000..0b39593c --- /dev/null +++ b/node_modules/fsevents/node_modules/assert-plus/README.md @@ -0,0 +1,155 @@ +# assert-plus + +This library is a super small wrapper over node's assert module that has two +things: (1) the ability to disable assertions with the environment variable +NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like +`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks +like this: + +```javascript + var assert = require('assert-plus'); + + function fooAccount(options, callback) { + assert.object(options, 'options'); + assert.number(options.id, 'options.id'); + assert.bool(options.isManager, 'options.isManager'); + assert.string(options.name, 'options.name'); + assert.arrayOfString(options.email, 'options.email'); + assert.func(callback, 'callback'); + + // Do stuff + callback(null, {}); + } +``` + +# API + +All methods that *aren't* part of node's core assert API are simply assumed to +take an argument, and then a string 'name' that's not a message; `AssertionError` +will be thrown if the assertion fails with a message like: + + AssertionError: foo (string) is required + at test (/home/mark/work/foo/foo.js:3:9) + at Object. (/home/mark/work/foo/foo.js:15:1) + at Module._compile (module.js:446:26) + at Object..js (module.js:464:10) + at Module.load (module.js:353:31) + at Function._load (module.js:311:12) + at Array.0 (module.js:484:10) + at EventEmitter._tickCallback (node.js:190:38) + +from: + +```javascript + function test(foo) { + assert.string(foo, 'foo'); + } +``` + +There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`: + +```javascript + function test(foo) { + assert.arrayOfString(foo, 'foo'); + } +``` + +You can assert IFF an argument is not `undefined` (i.e., an optional arg): + +```javascript + assert.optionalString(foo, 'foo'); +``` + +Lastly, you can opt-out of assertion checking altogether by setting the +environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have +lots of assertions, and don't want to pay `typeof ()` taxes to v8 in +production. Be advised: The standard functions re-exported from `assert` are +also disabled in assert-plus if NDEBUG is specified. Using them directly from +the `assert` module avoids this behavior. + +The complete list of APIs is: + +* assert.array +* assert.bool +* assert.buffer +* assert.func +* assert.number +* assert.object +* assert.string +* assert.stream +* assert.date +* assert.regex +* assert.uuid +* assert.arrayOfArray +* assert.arrayOfBool +* assert.arrayOfBuffer +* assert.arrayOfFunc +* assert.arrayOfNumber +* assert.arrayOfObject +* assert.arrayOfString +* assert.arrayOfStream +* assert.arrayOfDate +* assert.arrayOfUuid +* assert.optionalArray +* assert.optionalBool +* assert.optionalBuffer +* assert.optionalFunc +* assert.optionalNumber +* assert.optionalObject +* assert.optionalString +* assert.optionalStream +* assert.optionalDate +* assert.optionalUuid +* assert.optionalArrayOfArray +* assert.optionalArrayOfBool +* assert.optionalArrayOfBuffer +* assert.optionalArrayOfFunc +* assert.optionalArrayOfNumber +* assert.optionalArrayOfObject +* assert.optionalArrayOfString +* assert.optionalArrayOfStream +* assert.optionalArrayOfDate +* assert.optionalArrayOfUuid +* assert.AssertionError +* assert.fail +* assert.ok +* assert.equal +* assert.notEqual +* assert.deepEqual +* assert.notDeepEqual +* assert.strictEqual +* assert.notStrictEqual +* assert.throws +* assert.doesNotThrow +* assert.ifError + +# Installation + + npm install assert-plus + +## License + +The MIT License (MIT) +Copyright (c) 2012 Mark Cavage + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## Bugs + +See . diff --git a/node_modules/fsevents/node_modules/assert-plus/assert.js b/node_modules/fsevents/node_modules/assert-plus/assert.js new file mode 100755 index 00000000..6bce4d8c --- /dev/null +++ b/node_modules/fsevents/node_modules/assert-plus/assert.js @@ -0,0 +1,206 @@ +// Copyright (c) 2012, Mark Cavage. All rights reserved. +// Copyright 2015 Joyent, Inc. + +var assert = require('assert'); +var Stream = require('stream').Stream; +var util = require('util'); + + +///--- Globals + +/* JSSTYLED */ +var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; + + +///--- Internal + +function _capitalize(str) { + return (str.charAt(0).toUpperCase() + str.slice(1)); +} + +function _toss(name, expected, oper, arg, actual) { + throw new assert.AssertionError({ + message: util.format('%s (%s) is required', name, expected), + actual: (actual === undefined) ? typeof (arg) : actual(arg), + expected: expected, + operator: oper || '===', + stackStartFunction: _toss.caller + }); +} + +function _getClass(arg) { + return (Object.prototype.toString.call(arg).slice(8, -1)); +} + +function noop() { + // Why even bother with asserts? +} + + +///--- Exports + +var types = { + bool: { + check: function (arg) { return typeof (arg) === 'boolean'; } + }, + func: { + check: function (arg) { return typeof (arg) === 'function'; } + }, + string: { + check: function (arg) { return typeof (arg) === 'string'; } + }, + object: { + check: function (arg) { + return typeof (arg) === 'object' && arg !== null; + } + }, + number: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); + } + }, + buffer: { + check: function (arg) { return Buffer.isBuffer(arg); }, + operator: 'Buffer.isBuffer' + }, + array: { + check: function (arg) { return Array.isArray(arg); }, + operator: 'Array.isArray' + }, + stream: { + check: function (arg) { return arg instanceof Stream; }, + operator: 'instanceof', + actual: _getClass + }, + date: { + check: function (arg) { return arg instanceof Date; }, + operator: 'instanceof', + actual: _getClass + }, + regexp: { + check: function (arg) { return arg instanceof RegExp; }, + operator: 'instanceof', + actual: _getClass + }, + uuid: { + check: function (arg) { + return typeof (arg) === 'string' && UUID_REGEXP.test(arg); + }, + operator: 'isUUID' + } +}; + +function _setExports(ndebug) { + var keys = Object.keys(types); + var out; + + /* re-export standard assert */ + if (process.env.NODE_NDEBUG) { + out = noop; + } else { + out = function (arg, msg) { + if (!arg) { + _toss(msg, 'true', arg); + } + }; + } + + /* standard checks */ + keys.forEach(function (k) { + if (ndebug) { + out[k] = noop; + return; + } + var type = types[k]; + out[k] = function (arg, msg) { + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* optional checks */ + keys.forEach(function (k) { + var name = 'optional' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* arrayOf checks */ + keys.forEach(function (k) { + var name = 'arrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* optionalArrayOf checks */ + keys.forEach(function (k) { + var name = 'optionalArrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* re-export built-in assertions */ + Object.keys(assert).forEach(function (k) { + if (k === 'AssertionError') { + out[k] = assert[k]; + return; + } + if (ndebug) { + out[k] = noop; + return; + } + out[k] = assert[k]; + }); + + /* export ourselves (for unit tests _only_) */ + out._setExports = _setExports; + + return out; +} + +module.exports = _setExports(process.env.NODE_NDEBUG); diff --git a/node_modules/fsevents/node_modules/assert-plus/package.json b/node_modules/fsevents/node_modules/assert-plus/package.json new file mode 100755 index 00000000..0200b198 --- /dev/null +++ b/node_modules/fsevents/node_modules/assert-plus/package.json @@ -0,0 +1,115 @@ +{ + "_args": [ + [ + { + "raw": "assert-plus@^0.2.0", + "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/http-signature" + ] + ], + "_from": "assert-plus@>=0.2.0 <0.3.0", + "_id": "assert-plus@0.2.0", + "_inCache": true, + "_location": "/fsevents/assert-plus", + "_nodeVersion": "0.10.36", + "_npmUser": { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + }, + "_npmVersion": "3.3.8", + "_phantomChildren": {}, + "_requested": { + "raw": "assert-plus@^0.2.0", + "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/http-signature" + ], + "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "_shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", + "_shrinkwrap": null, + "_spec": "assert-plus@^0.2.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/http-signature", + "author": { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + "bugs": { + "url": "https://github.com/mcavage/node-assert-plus/issues" + }, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Fred Kuo", + "email": "fred.kuo@joyent.com" + }, + { + "name": "Lars-Magnus Skog", + "email": "ralphtheninja@riseup.net" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Patrick Mooney", + "email": "pmooney@pfmooney.com" + }, + { + "name": "Rob Gulewich", + "email": "robert.gulewich@joyent.com" + } + ], + "dependencies": {}, + "description": "Extra assertions on top of node's assert module", + "devDependencies": { + "faucet": "0.0.1", + "tape": "4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", + "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + }, + "engines": { + "node": ">=0.8" + }, + "homepage": "https://github.com/mcavage/node-assert-plus#readme", + "license": "MIT", + "main": "./assert.js", + "maintainers": [ + { + "name": "mcavage", + "email": "mcavage@gmail.com" + }, + { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + } + ], + "name": "assert-plus", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mcavage/node-assert-plus.git" + }, + "scripts": { + "test": "tape tests/*.js | ./node_modules/.bin/faucet" + }, + "version": "0.2.0" +} diff --git a/node_modules/fsevents/node_modules/asynckit/LICENSE b/node_modules/fsevents/node_modules/asynckit/LICENSE new file mode 100755 index 00000000..c9eca5dd --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fsevents/node_modules/asynckit/README.md b/node_modules/fsevents/node_modules/asynckit/README.md new file mode 100755 index 00000000..ddcc7e6b --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/node_modules/fsevents/node_modules/asynckit/bench.js b/node_modules/fsevents/node_modules/asynckit/bench.js new file mode 100755 index 00000000..c612f1a5 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/node_modules/fsevents/node_modules/asynckit/index.js b/node_modules/fsevents/node_modules/asynckit/index.js new file mode 100755 index 00000000..455f9454 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/node_modules/fsevents/node_modules/asynckit/lib/abort.js b/node_modules/fsevents/node_modules/asynckit/lib/abort.js new file mode 100755 index 00000000..114367e5 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/async.js b/node_modules/fsevents/node_modules/asynckit/lib/async.js new file mode 100755 index 00000000..7f1288a4 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/defer.js b/node_modules/fsevents/node_modules/asynckit/lib/defer.js new file mode 100755 index 00000000..b67110c7 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/iterate.js b/node_modules/fsevents/node_modules/asynckit/lib/iterate.js new file mode 100755 index 00000000..5d2839a5 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/readable_asynckit.js b/node_modules/fsevents/node_modules/asynckit/lib/readable_asynckit.js new file mode 100755 index 00000000..78ad240f --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/readable_parallel.js b/node_modules/fsevents/node_modules/asynckit/lib/readable_parallel.js new file mode 100755 index 00000000..5d2929f7 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/readable_serial.js b/node_modules/fsevents/node_modules/asynckit/lib/readable_serial.js new file mode 100755 index 00000000..78226982 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/readable_serial_ordered.js b/node_modules/fsevents/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100755 index 00000000..3de89c47 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/state.js b/node_modules/fsevents/node_modules/asynckit/lib/state.js new file mode 100755 index 00000000..cbea7ad8 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/streamify.js b/node_modules/fsevents/node_modules/asynckit/lib/streamify.js new file mode 100755 index 00000000..f56a1c92 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/node_modules/fsevents/node_modules/asynckit/lib/terminator.js b/node_modules/fsevents/node_modules/asynckit/lib/terminator.js new file mode 100755 index 00000000..d6eb9921 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/node_modules/fsevents/node_modules/asynckit/package.json b/node_modules/fsevents/node_modules/asynckit/package.json new file mode 100755 index 00000000..ddf472a8 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "asynckit@^0.4.0", + "scope": null, + "escapedName": "asynckit", + "name": "asynckit", + "rawSpec": "^0.4.0", + "spec": ">=0.4.0 <0.5.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/form-data" + ] + ], + "_from": "asynckit@>=0.4.0 <0.5.0", + "_id": "asynckit@0.4.0", + "_inCache": true, + "_location": "/fsevents/asynckit", + "_nodeVersion": "0.12.11", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/asynckit-0.4.0.tgz_1465928940169_0.8008207362145185" + }, + "_npmUser": { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + "_npmVersion": "2.15.6", + "_phantomChildren": {}, + "_requested": { + "raw": "asynckit@^0.4.0", + "scope": null, + "escapedName": "asynckit", + "name": "asynckit", + "rawSpec": "^0.4.0", + "spec": ">=0.4.0 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/form-data" + ], + "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", + "_shrinkwrap": null, + "_spec": "asynckit@^0.4.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/form-data", + "author": { + "name": "Alex Indigo", + "email": "iam@alexindigo.com" + }, + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "dependencies": {}, + "description": "Minimal async jobs utility library, with streams support", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "directories": {}, + "dist": { + "shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", + "tarball": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" + }, + "gitHead": "583a75ed4fe41761b66416bb6e703ebb1f8963bf", + "homepage": "https://github.com/alexindigo/asynckit#readme", + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "alexindigo", + "email": "iam@alexindigo.com" + } + ], + "name": "asynckit", + "optionalDependencies": {}, + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "scripts": { + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "clean": "rimraf coverage", + "debug": "tape test/test-*.js", + "lint": "eslint *.js lib/*.js test/*.js", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js" + }, + "version": "0.4.0" +} diff --git a/node_modules/fsevents/node_modules/asynckit/parallel.js b/node_modules/fsevents/node_modules/asynckit/parallel.js new file mode 100755 index 00000000..3c50344d --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/node_modules/fsevents/node_modules/asynckit/serial.js b/node_modules/fsevents/node_modules/asynckit/serial.js new file mode 100755 index 00000000..6cd949a6 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/node_modules/fsevents/node_modules/asynckit/serialOrdered.js b/node_modules/fsevents/node_modules/asynckit/serialOrdered.js new file mode 100755 index 00000000..607eafea --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/node_modules/fsevents/node_modules/asynckit/stream.js b/node_modules/fsevents/node_modules/asynckit/stream.js new file mode 100755 index 00000000..d43465f9 --- /dev/null +++ b/node_modules/fsevents/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/node_modules/fsevents/node_modules/aws-sign2/LICENSE b/node_modules/fsevents/node_modules/aws-sign2/LICENSE new file mode 100755 index 00000000..a4a9aee0 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws-sign2/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/aws-sign2/README.md b/node_modules/fsevents/node_modules/aws-sign2/README.md new file mode 100755 index 00000000..763564e0 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws-sign2/README.md @@ -0,0 +1,4 @@ +aws-sign +======== + +AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/node_modules/fsevents/node_modules/aws-sign2/index.js b/node_modules/fsevents/node_modules/aws-sign2/index.js new file mode 100755 index 00000000..ac720930 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws-sign2/index.js @@ -0,0 +1,212 @@ + +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , parse = require('url').parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.queryStringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource diff --git a/node_modules/fsevents/node_modules/aws-sign2/package.json b/node_modules/fsevents/node_modules/aws-sign2/package.json new file mode 100755 index 00000000..8ce47ff6 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws-sign2/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + { + "raw": "aws-sign2@~0.6.0", + "scope": null, + "escapedName": "aws-sign2", + "name": "aws-sign2", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/request" + ] + ], + "_from": "aws-sign2@>=0.6.0 <0.7.0", + "_id": "aws-sign2@0.6.0", + "_inCache": true, + "_location": "/fsevents/aws-sign2", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "raw": "aws-sign2@~0.6.0", + "scope": null, + "escapedName": "aws-sign2", + "name": "aws-sign2", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/request" + ], + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "_shrinkwrap": null, + "_spec": "aws-sign2@~0.6.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/request", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" + }, + "dependencies": {}, + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "tarball": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, + "engines": { + "node": "*" + }, + "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", + "homepage": "https://github.com/mikeal/aws-sign#readme", + "license": "Apache-2.0", + "main": "index.js", + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + } + ], + "name": "aws-sign2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" + }, + "scripts": {}, + "version": "0.6.0" +} diff --git a/node_modules/fsevents/node_modules/aws4/.npmignore b/node_modules/fsevents/node_modules/aws4/.npmignore new file mode 100755 index 00000000..6c6ade6f --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/.npmignore @@ -0,0 +1,4 @@ +test +examples +example.js +browser diff --git a/node_modules/fsevents/node_modules/aws4/.tern-port b/node_modules/fsevents/node_modules/aws4/.tern-port new file mode 100755 index 00000000..7fd1b522 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/.tern-port @@ -0,0 +1 @@ +62638 \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/aws4/.travis.yml b/node_modules/fsevents/node_modules/aws4/.travis.yml new file mode 100755 index 00000000..61d06340 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4.2" diff --git a/node_modules/fsevents/node_modules/aws4/LICENSE b/node_modules/fsevents/node_modules/aws4/LICENSE new file mode 100755 index 00000000..4f321e59 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 Michael Hart (michael.hart.au@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fsevents/node_modules/aws4/README.md b/node_modules/fsevents/node_modules/aws4/README.md new file mode 100755 index 00000000..6b002d02 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/README.md @@ -0,0 +1,523 @@ +aws4 +---- + +[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4) + +A small utility to sign vanilla node.js http(s) request options using Amazon's +[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html). + +Can also be used [in the browser](./browser). + +This signature is supported by nearly all Amazon services, including +[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/), +[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/), +[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html), +[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/), +[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html), +[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/), +[SNS](http://docs.aws.amazon.com/sns/latest/api/), +[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/), +[STS](http://docs.aws.amazon.com/STS/latest/APIReference/), +[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/), +[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/), +[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/), +[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/), +[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/), +[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/), +[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/), +[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/), +[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html), +[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html), +[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/), +[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html), +[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/), +[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/), +[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html), +[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/), +[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/), +[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/), +[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/), +[SES](http://docs.aws.amazon.com/ses/latest/APIReference/), +[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/), +[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/), +[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html), +[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/), +[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/), +[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/), +[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html), +[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/), +[Config](http://docs.aws.amazon.com/config/latest/APIReference/), +[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html), +[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and +[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html). + +Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are +[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and +[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) +(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)). + +It also provides defaults for a number of core AWS headers and +request parameters, making it very easy to query AWS services, or +build out a fully-featured AWS library. + +Example +------- + +```javascript +var http = require('http'), + https = require('https'), + aws4 = require('aws4') + +// given an options object you could pass to http.request +var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'} + +// alternatively (as aws4 can infer the host): +opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'} + +// alternatively (as us-east-1 is default): +opts = {service: 'sqs', path: '/?Action=ListQueues'} + +aws4.sign(opts) // assumes AWS credentials are available in process.env + +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS using the standard node.js http API +http.request(opts, function(res) { res.pipe(process.stdout) }).end() +/* + + +... +*/ +``` + +More options +------------ + +```javascript +// you can also pass AWS credentials in explicitly (otherwise taken from process.env) +aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''}) + +// can also add the signature to query strings +aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true}) + +// create a utility function to pipe to stdout (with https this time) +function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') } + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'})) +/* + +... +*/ + +// can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// works with all other services that support Signature Version 4 + +request(aws4.sign({service: 's3', path: '/', signQuery: true})) +/* + +... +*/ + +request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'})) +/* + +... +*/ + +request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'})) +/* + +... +*/ + +request(aws4.sign({service: 'appstream', path: '/applications'})) +/* +{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/... +... +*/ + +request(aws4.sign({service: 'cognito-sync', path: '/identitypools'})) +/* +{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null} +... +*/ + +request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'})) +/* +{"NextPageToken":null,"Pipelines":[]} +... +*/ + +request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'})) +/* +{"Functions":[],"NextMarker":null} +... +*/ + +request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'})) +/* + +... +*/ + +request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}})) +/* +{"Marker":null,"VaultList":[]} +... +*/ + +request(aws4.sign({service: 'storagegateway', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StorageGateway_20120630.ListGateways' +}})) +/* +{"Gateways":[]} +... +*/ + +request(aws4.sign({service: 'datapipeline', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'DataPipeline.ListPipelines' +}})) +/* +{"hasMoreResults":false,"pipelineIdList":[]} +... +*/ + +request(aws4.sign({service: 'opsworks', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks' +}})) +/* +{"Stacks":[]} +... +*/ + +request(aws4.sign({service: 'route53domains', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains' +}})) +/* +{"Domains":[]} +... +*/ + +request(aws4.sign({service: 'kinesis', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Kinesis_20131202.ListStreams' +}})) +/* +{"HasMoreStreams":false,"StreamNames":[]} +... +*/ + +request(aws4.sign({service: 'cloudtrail', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails' +}})) +/* +{"trailList":[]} +... +*/ + +request(aws4.sign({service: 'logs', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups' +}})) +/* +{"logGroups":[]} +... +*/ + +request(aws4.sign({service: 'codedeploy', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications' +}})) +/* +{"applications":[]} +... +*/ + +request(aws4.sign({service: 'directconnect', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OvertureService.DescribeConnections' +}})) +/* +{"connections":[]} +... +*/ + +request(aws4.sign({service: 'kms', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'TrentService.ListKeys' +}})) +/* +{"Keys":[],"Truncated":false} +... +*/ + +request(aws4.sign({service: 'config', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels' +}})) +/* +{"DeliveryChannels":[]} +... +*/ + +request(aws4.sign({service: 'cloudhsm', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones' +}})) +/* +{"AZList":["us-east-1a","us-east-1b","us-east-1c"]} +... +*/ + +request(aws4.sign({ + service: 'swf', + body: '{"registrationStatus":"REGISTERED"}', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'SimpleWorkflowService.ListDomains' + } +})) +/* +{"domainInfos":[]} +... +*/ + +request(aws4.sign({ + service: 'cognito-identity', + body: '{"MaxResults": 1}', + headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools' + } +})) +/* +{"IdentityPools":[]} +... +*/ + +request(aws4.sign({ + service: 'mobileanalytics', + path: '/2014-06-05/events', + body: JSON.stringify({events:[{ + eventType: 'a', + timestamp: new Date().toISOString(), + session: {}, + }]}), + headers: { + 'Content-Type': 'application/json', + 'X-Amz-Client-Context': JSON.stringify({ + client: {client_id: 'a', app_title: 'a'}, + custom: {}, + env: {platform: 'a'}, + services: {}, + }), + } +})) +/* +(HTTP 202, empty response) +*/ + +// Generate CodeCommit Git access password +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() +``` + +API +--- + +### aws4.sign(requestOptions, [credentials]) + +This calculates and populates the `Authorization` header of +`requestOptions`, and any other necessary AWS headers and/or request +options. Returns `requestOptions` as a convenience for chaining. + +`requestOptions` is an object holding the same options that the node.js +[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) +function takes. + +The following properties of `requestOptions` are used in the signing or +populated if they don't already exist: + +- `hostname` or `host` (will be determined from `service` and `region` if not given) +- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`) +- `path` (will use `'/'` if not given) +- `body` (will use `''` if not given) +- `service` (will be calculated from `hostname` or `host` if not given) +- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `headers['Host']` (will use `hostname` or `host` or be calculated if not given) +- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` + if not given and there is a `body`) +- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used) + +Your AWS credentials (which can be found in your +[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials)) +can be specified in one of two ways: + +- As the second argument, like this: + +```javascript +aws4.sign(requestOptions, { + secretAccessKey: "", + accessKeyId: "", + sessionToken: "" +}) +``` + +- From `process.env`, such as this: + +``` +export AWS_SECRET_ACCESS_KEY="" +export AWS_ACCESS_KEY_ID="" +export AWS_SESSION_TOKEN="" +``` + +(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available) + +The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing +with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html). + +Installation +------------ + +With [npm](http://npmjs.org/) do: + +``` +npm install aws4 +``` + +Can also be used [in the browser](./browser). + +Thanks +------ + +Thanks to [@jed](https://github.com/jed) for his +[dynamo-client](https://github.com/jed/dynamo-client) lib where I first +committed and subsequently extracted this code. + +Also thanks to the +[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +me a start on implementing the v4 signature. + diff --git a/node_modules/fsevents/node_modules/aws4/aws4.js b/node_modules/fsevents/node_modules/aws4/aws4.js new file mode 100755 index 00000000..0cff0f0e --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/aws4.js @@ -0,0 +1,332 @@ +var aws4 = exports, + url = require('url'), + querystring = require('querystring'), + crypto = require('crypto'), + lru = require('./lru'), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : + (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, + service = this.service === 'ses' ? 'email' : this.service + return service + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { + if (!key) return obj + obj[key] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key].slice().sort()) + return obj + }, {}))) + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = querystring.unescape(piece) + path.push(encodeRfc3986(querystring.escape(piece))) + } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .sort() + .join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/', + queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { + path = path.split('/').map(function(piece) { + return querystring.escape(querystring.unescape(piece)) + }).join('/') + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} diff --git a/node_modules/fsevents/node_modules/aws4/lru.js b/node_modules/fsevents/node_modules/aws4/lru.js new file mode 100755 index 00000000..333f66a4 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/node_modules/fsevents/node_modules/aws4/package.json b/node_modules/fsevents/node_modules/aws4/package.json new file mode 100755 index 00000000..fbcb6b14 --- /dev/null +++ b/node_modules/fsevents/node_modules/aws4/package.json @@ -0,0 +1,140 @@ +{ + "_args": [ + [ + { + "raw": "aws4@^1.2.1", + "scope": null, + "escapedName": "aws4", + "name": "aws4", + "rawSpec": "^1.2.1", + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/request" + ] + ], + "_from": "aws4@>=1.2.1 <2.0.0", + "_id": "aws4@1.6.0", + "_inCache": true, + "_location": "/fsevents/aws4", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/aws4-1.6.0.tgz_1486481933920_0.6127187723759562" + }, + "_npmUser": { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + }, + "_npmVersion": "4.0.5", + "_phantomChildren": {}, + "_requested": { + "raw": "aws4@^1.2.1", + "scope": null, + "escapedName": "aws4", + "name": "aws4", + "rawSpec": "^1.2.1", + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/request" + ], + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "_shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e", + "_shrinkwrap": null, + "_spec": "aws4@^1.2.1", + "_where": "/Users/eshanker/Code/fsevents/node_modules/request", + "author": { + "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", + "url": "http://github.com/mhart" + }, + "bugs": { + "url": "https://github.com/mhart/aws4/issues" + }, + "dependencies": {}, + "description": "Signs and prepares requests using AWS Signature Version 4", + "devDependencies": { + "mocha": "^2.4.5", + "should": "^8.2.2" + }, + "directories": {}, + "dist": { + "shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e", + "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz" + }, + "gitHead": "74bf0b64d1e8cbcd184964999c7ef53f52d7ad32", + "homepage": "https://github.com/mhart/aws4#readme", + "keywords": [ + "amazon", + "aws", + "signature", + "s3", + "ec2", + "autoscaling", + "cloudformation", + "elasticloadbalancing", + "elb", + "elasticbeanstalk", + "cloudsearch", + "dynamodb", + "kinesis", + "lambda", + "glacier", + "sqs", + "sns", + "iam", + "sts", + "ses", + "swf", + "storagegateway", + "datapipeline", + "directconnect", + "redshift", + "opsworks", + "rds", + "monitoring", + "cloudtrail", + "cloudfront", + "codedeploy", + "elasticache", + "elasticmapreduce", + "elastictranscoder", + "emr", + "cloudwatch", + "mobileanalytics", + "cognitoidentity", + "cognitosync", + "cognito", + "containerservice", + "ecs", + "appstream", + "keymanagementservice", + "kms", + "config", + "cloudhsm", + "route53", + "route53domains", + "logs" + ], + "license": "MIT", + "main": "aws4.js", + "maintainers": [ + { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + } + ], + "name": "aws4", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/aws4.git" + }, + "scripts": { + "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" + }, + "version": "1.6.0" +} diff --git a/node_modules/fsevents/node_modules/balanced-match/.npmignore b/node_modules/fsevents/node_modules/balanced-match/.npmignore new file mode 100755 index 00000000..ae5d8c36 --- /dev/null +++ b/node_modules/fsevents/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/node_modules/fsevents/node_modules/balanced-match/LICENSE.md b/node_modules/fsevents/node_modules/balanced-match/LICENSE.md new file mode 100755 index 00000000..2cdc8e41 --- /dev/null +++ b/node_modules/fsevents/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fsevents/node_modules/balanced-match/README.md b/node_modules/fsevents/node_modules/balanced-match/README.md new file mode 100755 index 00000000..08e918c0 --- /dev/null +++ b/node_modules/fsevents/node_modules/balanced-match/README.md @@ -0,0 +1,91 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fsevents/node_modules/balanced-match/index.js b/node_modules/fsevents/node_modules/balanced-match/index.js new file mode 100755 index 00000000..e8d85870 --- /dev/null +++ b/node_modules/fsevents/node_modules/balanced-match/index.js @@ -0,0 +1,58 @@ +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/node_modules/fsevents/node_modules/balanced-match/package.json b/node_modules/fsevents/node_modules/balanced-match/package.json new file mode 100755 index 00000000..5d362231 --- /dev/null +++ b/node_modules/fsevents/node_modules/balanced-match/package.json @@ -0,0 +1,110 @@ +{ + "_args": [ + [ + { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.4.1 <0.5.0", + "_id": "balanced-match@0.4.2", + "_inCache": true, + "_location": "/fsevents/balanced-match", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" + }, + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "_shrinkwrap": null, + "_spec": "balanced-match@^0.4.1", + "_where": "/Users/eshanker/Code/fsevents/node_modules/brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" + }, + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "0.4.2" +} diff --git a/node_modules/fsevents/node_modules/bcrypt-pbkdf/README.md b/node_modules/fsevents/node_modules/bcrypt-pbkdf/README.md new file mode 100755 index 00000000..12018090 --- /dev/null +++ b/node_modules/fsevents/node_modules/bcrypt-pbkdf/README.md @@ -0,0 +1,39 @@ +Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified +version of [Devi Mandiri's port] +(https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js), +with some minor performance improvements. The code is copied verbatim (and +un-styled) from Devi's work. + +This product includes software developed by Niels Provos. + +## API + +### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)` + +Derive a cryptographic key of arbitrary length from a given password and salt, +using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and +SHA-512. + +See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for +further information. + +Parameters: + + * `pass`, a Uint8Array of length `passlen` + * `passlen`, an integer Number + * `salt`, a Uint8Array of length `saltlen` + * `saltlen`, an integer Number + * `key`, a Uint8Array of length `keylen`, will be filled with output + * `keylen`, an integer Number + * `rounds`, an integer Number, number of rounds of the PBKDF to run + +### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)` + +Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as +part of the inner round function in the PBKDF. + +Parameters: + + * `sha2pass`, a Uint8Array of length 64 + * `sha2salt`, a Uint8Array of length 64 + * `out`, a Uint8Array of length 32, will be filled with output diff --git a/node_modules/fsevents/node_modules/bcrypt-pbkdf/index.js b/node_modules/fsevents/node_modules/bcrypt-pbkdf/index.js new file mode 100755 index 00000000..b1b5ad4b --- /dev/null +++ b/node_modules/fsevents/node_modules/bcrypt-pbkdf/index.js @@ -0,0 +1,556 @@ +'use strict'; + +var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash; + +/* + * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a + * result, it retains the original copyright and license. The two files are + * under slightly different (but compatible) licenses, and are here combined in + * one file. + * + * Credit for the actual porting work goes to: + * Devi Mandiri + */ + +/* + * The Blowfish portions are under the following license: + * + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * The bcrypt_pbkdf portions are under the following license: + * + * Copyright (c) 2013 Ted Unangst + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Performance improvements (Javascript-specific): + * + * Copyright 2016, Joyent Inc + * Author: Alex Wilson + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// Ported from OpenBSD bcrypt_pbkdf.c v1.9 + +var BLF_J = 0; + +var Blowfish = function() { + this.S = [ + new Uint32Array([ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), + new Uint32Array([ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), + new Uint32Array([ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), + new Uint32Array([ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) + ]; + this.P = new Uint32Array([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b]); +}; + +function F(S, x8, i) { + return (((S[0][x8[i+3]] + + S[1][x8[i+2]]) ^ + S[2][x8[i+1]]) + + S[3][x8[i]]); +}; + +Blowfish.prototype.encipher = function(x, x8) { + if (x8 === undefined) { + x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + } + x[0] ^= this.P[0]; + for (var i = 1; i < 16; i += 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[17]; + x[1] = t; +}; + +Blowfish.prototype.decipher = function(x) { + var x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + x[0] ^= this.P[17]; + for (var i = 16; i > 0; i -= 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[0]; + x[1] = t; +}; + +function stream2word(data, databytes){ + var i, temp = 0; + for (i = 0; i < 4; i++, BLF_J++) { + if (BLF_J >= databytes) BLF_J = 0; + temp = (temp << 8) | data[BLF_J]; + } + return temp; +}; + +Blowfish.prototype.expand0state = function(key, keybytes) { + var d = new Uint32Array(2), i, k; + var d8 = new Uint8Array(d.buffer); + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + BLF_J = 0; + + for (i = 0; i < 18; i += 2) { + this.encipher(d, d8); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + this.encipher(d, d8); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } +}; + +Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { + var d = new Uint32Array(2), i, k; + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + + for (i = 0, BLF_J = 0; i < 18; i += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } + BLF_J = 0; +}; + +Blowfish.prototype.enc = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.encipher(data.subarray(i*2)); + } +}; + +Blowfish.prototype.dec = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.decipher(data.subarray(i*2)); + } +}; + +var BCRYPT_BLOCKS = 8, + BCRYPT_HASHSIZE = 32; + +function bcrypt_hash(sha2pass, sha2salt, out) { + var state = new Blowfish(), + cdata = new Uint32Array(BCRYPT_BLOCKS), i, + ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, + 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, + 105,116,101]); //"OxychromaticBlowfishSwatDynamite" + + state.expandstate(sha2salt, 64, sha2pass, 64); + for (i = 0; i < 64; i++) { + state.expand0state(sha2salt, 64); + state.expand0state(sha2pass, 64); + } + + for (i = 0; i < BCRYPT_BLOCKS; i++) + cdata[i] = stream2word(ciphertext, ciphertext.byteLength); + for (i = 0; i < 64; i++) + state.enc(cdata, cdata.byteLength / 8); + + for (i = 0; i < BCRYPT_BLOCKS; i++) { + out[4*i+3] = cdata[i] >>> 24; + out[4*i+2] = cdata[i] >>> 16; + out[4*i+1] = cdata[i] >>> 8; + out[4*i+0] = cdata[i]; + } +}; + +function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { + var sha2pass = new Uint8Array(64), + sha2salt = new Uint8Array(64), + out = new Uint8Array(BCRYPT_HASHSIZE), + tmpout = new Uint8Array(BCRYPT_HASHSIZE), + countsalt = new Uint8Array(saltlen+4), + i, j, amt, stride, dest, count, + origkeylen = keylen; + + if (rounds < 1) + return -1; + if (passlen === 0 || saltlen === 0 || keylen === 0 || + keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) + return -1; + + stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); + amt = Math.floor((keylen + stride - 1) / stride); + + for (i = 0; i < saltlen; i++) + countsalt[i] = salt[i]; + + crypto_hash_sha512(sha2pass, pass, passlen); + + for (count = 1; keylen > 0; count++) { + countsalt[saltlen+0] = count >>> 24; + countsalt[saltlen+1] = count >>> 16; + countsalt[saltlen+2] = count >>> 8; + countsalt[saltlen+3] = count; + + crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (i = out.byteLength; i--;) + out[i] = tmpout[i]; + + for (i = 1; i < rounds; i++) { + crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (j = 0; j < out.byteLength; j++) + out[j] ^= tmpout[j]; + } + + amt = Math.min(amt, keylen); + for (i = 0; i < amt; i++) { + dest = i * stride + (count - 1); + if (dest >= origkeylen) + break; + key[dest] = out[i]; + } + keylen -= i; + } + + return 0; +}; + +module.exports = { + BLOCKS: BCRYPT_BLOCKS, + HASHSIZE: BCRYPT_HASHSIZE, + hash: bcrypt_hash, + pbkdf: bcrypt_pbkdf +}; diff --git a/node_modules/fsevents/node_modules/bcrypt-pbkdf/package.json b/node_modules/fsevents/node_modules/bcrypt-pbkdf/package.json new file mode 100755 index 00000000..a9908554 --- /dev/null +++ b/node_modules/fsevents/node_modules/bcrypt-pbkdf/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + { + "raw": "bcrypt-pbkdf@^1.0.0", + "scope": null, + "escapedName": "bcrypt-pbkdf", + "name": "bcrypt-pbkdf", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/sshpk" + ] + ], + "_from": "bcrypt-pbkdf@>=1.0.0 <2.0.0", + "_id": "bcrypt-pbkdf@1.0.1", + "_inCache": true, + "_location": "/fsevents/bcrypt-pbkdf", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/bcrypt-pbkdf-1.0.1.tgz_1486007687899_0.974529881728813" + }, + "_npmUser": { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "raw": "bcrypt-pbkdf@^1.0.0", + "scope": null, + "escapedName": "bcrypt-pbkdf", + "name": "bcrypt-pbkdf", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/sshpk" + ], + "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "_shasum": "63bc5dcb61331b92bc05fd528953c33462a06f8d", + "_shrinkwrap": null, + "_spec": "bcrypt-pbkdf@^1.0.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/sshpk", + "dependencies": { + "tweetnacl": "^0.14.3" + }, + "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "63bc5dcb61331b92bc05fd528953c33462a06f8d", + "tarball": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz" + }, + "gitHead": "fa2ab3ae9efa15367264151398635a915c7b411d", + "license": "BSD-3-Clause", + "main": "index.js", + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + { + "name": "dap", + "email": "dap@cs.brown.edu" + }, + { + "name": "jclulow", + "email": "josh@sysmgr.org" + }, + { + "name": "trentm", + "email": "trentm@gmail.com" + } + ], + "name": "bcrypt-pbkdf", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "scripts": {}, + "version": "1.0.1" +} diff --git a/node_modules/fsevents/node_modules/block-stream/LICENCE b/node_modules/fsevents/node_modules/block-stream/LICENCE new file mode 100755 index 00000000..74489e2e --- /dev/null +++ b/node_modules/fsevents/node_modules/block-stream/LICENCE @@ -0,0 +1,25 @@ +Copyright (c) Isaac Z. Schlueter +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/fsevents/node_modules/block-stream/LICENSE b/node_modules/fsevents/node_modules/block-stream/LICENSE new file mode 100755 index 00000000..19129e31 --- /dev/null +++ b/node_modules/fsevents/node_modules/block-stream/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/fsevents/node_modules/block-stream/README.md b/node_modules/fsevents/node_modules/block-stream/README.md new file mode 100755 index 00000000..c16e9c46 --- /dev/null +++ b/node_modules/fsevents/node_modules/block-stream/README.md @@ -0,0 +1,14 @@ +# block-stream + +A stream of blocks. + +Write data into it, and it'll output data in buffer blocks the size you +specify, padding with zeroes if necessary. + +```javascript +var block = new BlockStream(512) +fs.createReadStream("some-file").pipe(block) +block.pipe(fs.createWriteStream("block-file")) +``` + +When `.end()` or `.flush()` is called, it'll pad the block with zeroes. diff --git a/node_modules/fsevents/node_modules/block-stream/block-stream.js b/node_modules/fsevents/node_modules/block-stream/block-stream.js new file mode 100755 index 00000000..008de035 --- /dev/null +++ b/node_modules/fsevents/node_modules/block-stream/block-stream.js @@ -0,0 +1,209 @@ +// write data to it, and it'll emit data in 512 byte blocks. +// if you .end() or .flush(), it'll emit whatever it's got, +// padded with nulls to 512 bytes. + +module.exports = BlockStream + +var Stream = require("stream").Stream + , inherits = require("inherits") + , assert = require("assert").ok + , debug = process.env.DEBUG ? console.error : function () {} + +function BlockStream (size, opt) { + this.writable = this.readable = true + this._opt = opt || {} + this._chunkSize = size || 512 + this._offset = 0 + this._buffer = [] + this._bufferLength = 0 + if (this._opt.nopad) this._zeroes = false + else { + this._zeroes = new Buffer(this._chunkSize) + for (var i = 0; i < this._chunkSize; i ++) { + this._zeroes[i] = 0 + } + } +} + +inherits(BlockStream, Stream) + +BlockStream.prototype.write = function (c) { + // debug(" BS write", c) + if (this._ended) throw new Error("BlockStream: write after end") + if (c && !Buffer.isBuffer(c)) c = new Buffer(c + "") + if (c.length) { + this._buffer.push(c) + this._bufferLength += c.length + } + // debug("pushed onto buffer", this._bufferLength) + if (this._bufferLength >= this._chunkSize) { + if (this._paused) { + // debug(" BS paused, return false, need drain") + this._needDrain = true + return false + } + this._emitChunk() + } + return true +} + +BlockStream.prototype.pause = function () { + // debug(" BS pausing") + this._paused = true +} + +BlockStream.prototype.resume = function () { + // debug(" BS resume") + this._paused = false + return this._emitChunk() +} + +BlockStream.prototype.end = function (chunk) { + // debug("end", chunk) + if (typeof chunk === "function") cb = chunk, chunk = null + if (chunk) this.write(chunk) + this._ended = true + this.flush() +} + +BlockStream.prototype.flush = function () { + this._emitChunk(true) +} + +BlockStream.prototype._emitChunk = function (flush) { + // debug("emitChunk flush=%j emitting=%j paused=%j", flush, this._emitting, this._paused) + + // emit a chunk + if (flush && this._zeroes) { + // debug(" BS push zeroes", this._bufferLength) + // push a chunk of zeroes + var padBytes = (this._bufferLength % this._chunkSize) + if (padBytes !== 0) padBytes = this._chunkSize - padBytes + if (padBytes > 0) { + // debug("padBytes", padBytes, this._zeroes.slice(0, padBytes)) + this._buffer.push(this._zeroes.slice(0, padBytes)) + this._bufferLength += padBytes + // debug(this._buffer[this._buffer.length - 1].length, this._bufferLength) + } + } + + if (this._emitting || this._paused) return + this._emitting = true + + // debug(" BS entering loops") + var bufferIndex = 0 + while (this._bufferLength >= this._chunkSize && + (flush || !this._paused)) { + // debug(" BS data emission loop", this._bufferLength) + + var out + , outOffset = 0 + , outHas = this._chunkSize + + while (outHas > 0 && (flush || !this._paused) ) { + // debug(" BS data inner emit loop", this._bufferLength) + var cur = this._buffer[bufferIndex] + , curHas = cur.length - this._offset + // debug("cur=", cur) + // debug("curHas=%j", curHas) + // If it's not big enough to fill the whole thing, then we'll need + // to copy multiple buffers into one. However, if it is big enough, + // then just slice out the part we want, to save unnecessary copying. + // Also, need to copy if we've already done some copying, since buffers + // can't be joined like cons strings. + if (out || curHas < outHas) { + out = out || new Buffer(this._chunkSize) + cur.copy(out, outOffset, + this._offset, this._offset + Math.min(curHas, outHas)) + } else if (cur.length === outHas && this._offset === 0) { + // shortcut -- cur is exactly long enough, and no offset. + out = cur + } else { + // slice out the piece of cur that we need. + out = cur.slice(this._offset, this._offset + outHas) + } + + if (curHas > outHas) { + // means that the current buffer couldn't be completely output + // update this._offset to reflect how much WAS written + this._offset += outHas + outHas = 0 + } else { + // output the entire current chunk. + // toss it away + outHas -= curHas + outOffset += curHas + bufferIndex ++ + this._offset = 0 + } + } + + this._bufferLength -= this._chunkSize + assert(out.length === this._chunkSize) + // debug("emitting data", out) + // debug(" BS emitting, paused=%j", this._paused, this._bufferLength) + this.emit("data", out) + out = null + } + // debug(" BS out of loops", this._bufferLength) + + // whatever is left, it's not enough to fill up a block, or we're paused + this._buffer = this._buffer.slice(bufferIndex) + if (this._paused) { + // debug(" BS paused, leaving", this._bufferLength) + this._needsDrain = true + this._emitting = false + return + } + + // if flushing, and not using null-padding, then need to emit the last + // chunk(s) sitting in the queue. We know that it's not enough to + // fill up a whole block, because otherwise it would have been emitted + // above, but there may be some offset. + var l = this._buffer.length + if (flush && !this._zeroes && l) { + if (l === 1) { + if (this._offset) { + this.emit("data", this._buffer[0].slice(this._offset)) + } else { + this.emit("data", this._buffer[0]) + } + } else { + var outHas = this._bufferLength + , out = new Buffer(outHas) + , outOffset = 0 + for (var i = 0; i < l; i ++) { + var cur = this._buffer[i] + , curHas = cur.length - this._offset + cur.copy(out, outOffset, this._offset) + this._offset = 0 + outOffset += curHas + this._bufferLength -= curHas + } + this.emit("data", out) + } + // truncate + this._buffer.length = 0 + this._bufferLength = 0 + this._offset = 0 + } + + // now either drained or ended + // debug("either draining, or ended", this._bufferLength, this._ended) + // means that we've flushed out all that we can so far. + if (this._needDrain) { + // debug("emitting drain", this._bufferLength) + this._needDrain = false + this.emit("drain") + } + + if ((this._bufferLength === 0) && this._ended && !this._endEmitted) { + // debug("emitting end", this._bufferLength) + this._endEmitted = true + this.emit("end") + } + + this._emitting = false + + // debug(" BS no longer emitting", flush, this._paused, this._emitting, this._bufferLength, this._chunkSize) +} diff --git a/node_modules/fsevents/node_modules/block-stream/package.json b/node_modules/fsevents/node_modules/block-stream/package.json new file mode 100755 index 00000000..7b34c476 --- /dev/null +++ b/node_modules/fsevents/node_modules/block-stream/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + { + "raw": "block-stream@*", + "scope": null, + "escapedName": "block-stream", + "name": "block-stream", + "rawSpec": "*", + "spec": "*", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/tar" + ] + ], + "_from": "block-stream@*", + "_id": "block-stream@0.0.9", + "_inCache": true, + "_location": "/fsevents/block-stream", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/block-stream-0.0.9.tgz_1462149852620_0.6890447810292244" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.8.5", + "_phantomChildren": {}, + "_requested": { + "raw": "block-stream@*", + "scope": null, + "escapedName": "block-stream", + "name": "block-stream", + "rawSpec": "*", + "spec": "*", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/tar" + ], + "_resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "_shasum": "13ebfe778a03205cfe03751481ebb4b3300c126a", + "_shrinkwrap": null, + "_spec": "block-stream@*", + "_where": "/Users/eshanker/Code/fsevents/node_modules/tar", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/block-stream/issues" + }, + "dependencies": { + "inherits": "~2.0.0" + }, + "description": "a stream of blocks", + "devDependencies": { + "tap": "^5.7.1" + }, + "directories": {}, + "dist": { + "shasum": "13ebfe778a03205cfe03751481ebb4b3300c126a", + "tarball": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz" + }, + "engines": { + "node": "0.4 || >=0.5.8" + }, + "files": [ + "block-stream.js" + ], + "gitHead": "321cf242ef6d130bb2e59c0565a61ded5dd2673f", + "homepage": "https://github.com/isaacs/block-stream#readme", + "license": "ISC", + "main": "block-stream.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "block-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/block-stream.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "0.0.9" +} diff --git a/node_modules/fsevents/node_modules/boom/.npmignore b/node_modules/fsevents/node_modules/boom/.npmignore new file mode 100755 index 00000000..77ba16cb --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/.npmignore @@ -0,0 +1,18 @@ +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov + diff --git a/node_modules/fsevents/node_modules/boom/.travis.yml b/node_modules/fsevents/node_modules/boom/.travis.yml new file mode 100755 index 00000000..dd1b24f1 --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/.travis.yml @@ -0,0 +1,8 @@ +language: node_js + +node_js: + - 0.10 + - 4.0 + +sudo: false + diff --git a/node_modules/fsevents/node_modules/boom/CONTRIBUTING.md b/node_modules/fsevents/node_modules/boom/CONTRIBUTING.md new file mode 100755 index 00000000..89283615 --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/CONTRIBUTING.md @@ -0,0 +1 @@ +Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/node_modules/fsevents/node_modules/boom/LICENSE b/node_modules/fsevents/node_modules/boom/LICENSE new file mode 100755 index 00000000..39468893 --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012-2014, Walmart and other contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/boom/README.md b/node_modules/fsevents/node_modules/boom/README.md new file mode 100755 index 00000000..cbd91c93 --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/README.md @@ -0,0 +1,652 @@ +![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) + +HTTP-friendly error objects + +[![Build Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom) +[![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom) + +Lead Maintainer: [Adam Bretz](https://github.com/arb) + +**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response +object (instance of `Error`) which includes the following properties: +- `isBoom` - if `true`, indicates this is a `Boom` object instance. +- `isServer` - convenience bool indicating status code >= 500. +- `message` - the error message. +- `output` - the formatted response. Can be directly manipulated after object construction to return a custom + error response. Allowed root keys: + - `statusCode` - the HTTP status code (typically 4xx or 5xx). + - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content. + - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any + changes will be lost + if `reformat()` is called. Any content allowed and by default includes the following content: + - `statusCode` - the HTTP status code, derived from `error.output.statusCode`. + - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`. + - `message` - the error message derived from `error.message`. +- inherited `Error` properties. + +The `Boom` object also supports the following method: +- `reformat()` - rebuilds `error.output` using the other object properties. + +## Overview + +- Helper methods + - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message) + - [`create(statusCode, [message], [data])`](#createstatuscode-message-data) +- HTTP 4xx Errors + - 400: [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data) + - 401: [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) + - 403: [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) + - 404: [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) + - 405: [`Boom.methodNotAllowed([message], [data])`](#boommethodnotallowedmessage-data) + - 406: [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data) + - 407: [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data) + - 408: [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data) + - 409: [`Boom.conflict([message], [data])`](#boomconflictmessage-data) + - 410: [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data) + - 411: [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data) + - 412: [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data) + - 413: [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data) + - 414: [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data) + - 415: [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data) + - 416: [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data) + - 417: [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data) + - 422: [`Boom.badData([message], [data])`](#boombaddatamessage-data) + - 428: [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data) + - 429: [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data) +- HTTP 5xx Errors + - 500: [`Boom.badImplementation([message], [data])`](#boombadimplementationmessage-data) + - 501: [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) + - 502: [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) + - 503: [`Boom.serverTimeout([message], [data])`](#boomservertimeoutmessage-data) + - 504: [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data) +- [FAQ](#faq) + + +## Helper Methods + +### `wrap(error, [statusCode], [message])` + +Decorates an error with the **boom** properties where: +- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object. +- `statusCode` - optional HTTP status code. Defaults to `500`. +- `message` - optional message string. If the error already has a message, it adds the message as a prefix. + Defaults to no message. + +```js +var error = new Error('Unexpected input'); +Boom.wrap(error, 400); +``` + +### `create(statusCode, [message], [data])` + +Generates an `Error` object with the **boom** decorations where: +- `statusCode` - an HTTP error code number. Must be greater or equal 400. +- `message` - optional message string. +- `data` - additional error data set to `error.data` property. + +```js +var error = Boom.create(400, 'Bad request', { timestamp: Date.now() }); +``` + +## HTTP 4xx Errors + +### `Boom.badRequest([message], [data])` + +Returns a 400 Bad Request error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badRequest('invalid query'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 400, + "error": "Bad Request", + "message": "invalid query" +} +``` + +### `Boom.unauthorized([message], [scheme], [attributes])` + +Returns a 401 Unauthorized error where: +- `message` - optional message. +- `scheme` can be one of the following: + - an authentication scheme name + - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. +- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used + when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the + 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. + `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as + the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header + will not be present and `isMissing` will be true on the error object. + +If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response. + +```js +Boom.unauthorized('invalid password'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password" +}, +"headers" {} +``` + +```js +Boom.unauthorized('invalid password', 'sample'); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password" + } +}, +"headers" { + "WWW-Authenticate": "sample error=\"invalid password\"" +} +``` + +```js +Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' }); +``` + +Generates the following response: + +```json +"payload": { + "statusCode": 401, + "error": "Unauthorized", + "message": "invalid password", + "attributes": { + "error": "invalid password", + "ttl": 0, + "cache": "", + "foo": "bar" + } +}, +"headers" { + "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\"" +} +``` + +### `Boom.forbidden([message], [data])` + +Returns a 403 Forbidden error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.forbidden('try again some time'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 403, + "error": "Forbidden", + "message": "try again some time" +} +``` + +### `Boom.notFound([message], [data])` + +Returns a 404 Not Found error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notFound('missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 404, + "error": "Not Found", + "message": "missing" +} +``` + +### `Boom.methodNotAllowed([message], [data])` + +Returns a 405 Method Not Allowed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.methodNotAllowed('that method is not allowed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 405, + "error": "Method Not Allowed", + "message": "that method is not allowed" +} +``` + +### `Boom.notAcceptable([message], [data])` + +Returns a 406 Not Acceptable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notAcceptable('unacceptable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 406, + "error": "Not Acceptable", + "message": "unacceptable" +} +``` + +### `Boom.proxyAuthRequired([message], [data])` + +Returns a 407 Proxy Authentication Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.proxyAuthRequired('auth missing'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 407, + "error": "Proxy Authentication Required", + "message": "auth missing" +} +``` + +### `Boom.clientTimeout([message], [data])` + +Returns a 408 Request Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.clientTimeout('timed out'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 408, + "error": "Request Time-out", + "message": "timed out" +} +``` + +### `Boom.conflict([message], [data])` + +Returns a 409 Conflict error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.conflict('there was a conflict'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 409, + "error": "Conflict", + "message": "there was a conflict" +} +``` + +### `Boom.resourceGone([message], [data])` + +Returns a 410 Gone error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.resourceGone('it is gone'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 410, + "error": "Gone", + "message": "it is gone" +} +``` + +### `Boom.lengthRequired([message], [data])` + +Returns a 411 Length Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.lengthRequired('length needed'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 411, + "error": "Length Required", + "message": "length needed" +} +``` + +### `Boom.preconditionFailed([message], [data])` + +Returns a 412 Precondition Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionFailed(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 412, + "error": "Precondition Failed" +} +``` + +### `Boom.entityTooLarge([message], [data])` + +Returns a 413 Request Entity Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.entityTooLarge('too big'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 413, + "error": "Request Entity Too Large", + "message": "too big" +} +``` + +### `Boom.uriTooLong([message], [data])` + +Returns a 414 Request-URI Too Large error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.uriTooLong('uri is too long'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 414, + "error": "Request-URI Too Large", + "message": "uri is too long" +} +``` + +### `Boom.unsupportedMediaType([message], [data])` + +Returns a 415 Unsupported Media Type error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.unsupportedMediaType('that media is not supported'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 415, + "error": "Unsupported Media Type", + "message": "that media is not supported" +} +``` + +### `Boom.rangeNotSatisfiable([message], [data])` + +Returns a 416 Requested Range Not Satisfiable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.rangeNotSatisfiable(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 416, + "error": "Requested Range Not Satisfiable" +} +``` + +### `Boom.expectationFailed([message], [data])` + +Returns a 417 Expectation Failed error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.expectationFailed('expected this to work'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 417, + "error": "Expectation Failed", + "message": "expected this to work" +} +``` + +### `Boom.badData([message], [data])` + +Returns a 422 Unprocessable Entity error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badData('your data is bad and you should feel bad'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 422, + "error": "Unprocessable Entity", + "message": "your data is bad and you should feel bad" +} +``` + +### `Boom.preconditionRequired([message], [data])` + +Returns a 428 Precondition Required error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.preconditionRequired('you must supply an If-Match header'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 428, + "error": "Precondition Required", + "message": "you must supply an If-Match header" +} +``` + +### `Boom.tooManyRequests([message], [data])` + +Returns a 429 Too Many Requests error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.tooManyRequests('you have exceeded your request limit'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 429, + "error": "Too Many Requests", + "message": "you have exceeded your request limit" +} +``` + +## HTTP 5xx Errors + +All 500 errors hide your message from the end user. Your message is recorded in the server log. + +### `Boom.badImplementation([message], [data])` + +Returns a 500 Internal Server Error error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badImplementation('terrible implementation'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 500, + "error": "Internal Server Error", + "message": "An internal server error occurred" +} +``` + +### `Boom.notImplemented([message], [data])` + +Returns a 501 Not Implemented error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.notImplemented('method not implemented'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 501, + "error": "Not Implemented", + "message": "method not implemented" +} +``` + +### `Boom.badGateway([message], [data])` + +Returns a 502 Bad Gateway error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.badGateway('that is a bad gateway'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 502, + "error": "Bad Gateway", + "message": "that is a bad gateway" +} +``` + +### `Boom.serverTimeout([message], [data])` + +Returns a 503 Service Unavailable error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.serverTimeout('unavailable'); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 503, + "error": "Service Unavailable", + "message": "unavailable" +} +``` + +### `Boom.gatewayTimeout([message], [data])` + +Returns a 504 Gateway Time-out error where: +- `message` - optional message. +- `data` - optional additional error data. + +```js +Boom.gatewayTimeout(); +``` + +Generates the following response payload: + +```json +{ + "statusCode": 504, + "error": "Gateway Time-out" +} +``` + +## F.A.Q. + +###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives? + +There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation. diff --git a/node_modules/fsevents/node_modules/boom/images/boom.png b/node_modules/fsevents/node_modules/boom/images/boom.png new file mode 100755 index 00000000..373bc134 Binary files /dev/null and b/node_modules/fsevents/node_modules/boom/images/boom.png differ diff --git a/node_modules/fsevents/node_modules/boom/lib/index.js b/node_modules/fsevents/node_modules/boom/lib/index.js new file mode 100755 index 00000000..6bdea693 --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/lib/index.js @@ -0,0 +1,318 @@ +// Load modules + +var Http = require('http'); +var Hoek = require('hoek'); + + +// Declare internals + +var internals = {}; + +exports.wrap = function (error, statusCode, message) { + + Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); + return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); +}; + + +exports.create = function (statusCode, message, data) { + + return internals.create(statusCode, message, data, exports.create); +}; + +internals.create = function (statusCode, message, data, ctor) { + + var error = new Error(message ? message : undefined); // Avoids settings null message + Error.captureStackTrace(error, ctor); // Filter the stack to our external API + error.data = data || null; + internals.initialize(error, statusCode); + return error; +}; + +internals.initialize = function (error, statusCode, message) { + + var numberCode = parseInt(statusCode, 10); + Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); + + error.isBoom = true; + error.isServer = numberCode >= 500; + + if (!error.hasOwnProperty('data')) { + error.data = null; + } + + error.output = { + statusCode: numberCode, + payload: {}, + headers: {} + }; + + error.reformat = internals.reformat; + error.reformat(); + + if (!message && + !error.message) { + + message = error.output.payload.error; + } + + if (message) { + error.message = (message + (error.message ? ': ' + error.message : '')); + } + + return error; +}; + + +internals.reformat = function () { + + this.output.payload.statusCode = this.output.statusCode; + this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown'; + + if (this.output.statusCode === 500) { + this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user + } + else if (this.message) { + this.output.payload.message = this.message; + } +}; + + +// 4xx Client Errors + +exports.badRequest = function (message, data) { + + return internals.create(400, message, data, exports.badRequest); +}; + + +exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) + + var err = internals.create(401, message, undefined, exports.unauthorized); + + if (!scheme) { + return err; + } + + var wwwAuthenticate = ''; + var i = 0; + var il = 0; + + if (typeof scheme === 'string') { + + // function (message, scheme, attributes) + + wwwAuthenticate = scheme; + + if (attributes || message) { + err.output.payload.attributes = {}; + } + + if (attributes) { + var names = Object.keys(attributes); + for (i = 0, il = names.length; i < il; ++i) { + var name = names[i]; + if (i) { + wwwAuthenticate += ','; + } + + var value = attributes[name]; + if (value === null || + value === undefined) { // Value can be zero + + value = ''; + } + wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + err.output.payload.attributes[name] = value; + } + } + + if (message) { + if (attributes) { + wwwAuthenticate += ','; + } + wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; + err.output.payload.attributes.error = message; + } + else { + err.isMissing = true; + } + } + else { + + // function (message, wwwAuthenticate[]) + + var wwwArray = scheme; + for (i = 0, il = wwwArray.length; i < il; ++i) { + if (i) { + wwwAuthenticate += ', '; + } + + wwwAuthenticate += wwwArray[i]; + } + } + + err.output.headers['WWW-Authenticate'] = wwwAuthenticate; + + return err; +}; + + +exports.forbidden = function (message, data) { + + return internals.create(403, message, data, exports.forbidden); +}; + + +exports.notFound = function (message, data) { + + return internals.create(404, message, data, exports.notFound); +}; + + +exports.methodNotAllowed = function (message, data) { + + return internals.create(405, message, data, exports.methodNotAllowed); +}; + + +exports.notAcceptable = function (message, data) { + + return internals.create(406, message, data, exports.notAcceptable); +}; + + +exports.proxyAuthRequired = function (message, data) { + + return internals.create(407, message, data, exports.proxyAuthRequired); +}; + + +exports.clientTimeout = function (message, data) { + + return internals.create(408, message, data, exports.clientTimeout); +}; + + +exports.conflict = function (message, data) { + + return internals.create(409, message, data, exports.conflict); +}; + + +exports.resourceGone = function (message, data) { + + return internals.create(410, message, data, exports.resourceGone); +}; + + +exports.lengthRequired = function (message, data) { + + return internals.create(411, message, data, exports.lengthRequired); +}; + + +exports.preconditionFailed = function (message, data) { + + return internals.create(412, message, data, exports.preconditionFailed); +}; + + +exports.entityTooLarge = function (message, data) { + + return internals.create(413, message, data, exports.entityTooLarge); +}; + + +exports.uriTooLong = function (message, data) { + + return internals.create(414, message, data, exports.uriTooLong); +}; + + +exports.unsupportedMediaType = function (message, data) { + + return internals.create(415, message, data, exports.unsupportedMediaType); +}; + + +exports.rangeNotSatisfiable = function (message, data) { + + return internals.create(416, message, data, exports.rangeNotSatisfiable); +}; + + +exports.expectationFailed = function (message, data) { + + return internals.create(417, message, data, exports.expectationFailed); +}; + +exports.badData = function (message, data) { + + return internals.create(422, message, data, exports.badData); +}; + + +exports.preconditionRequired = function (message, data) { + + return internals.create(428, message, data, exports.preconditionRequired); +}; + + +exports.tooManyRequests = function (message, data) { + + return internals.create(429, message, data, exports.tooManyRequests); +}; + + +// 5xx Server Errors + +exports.internal = function (message, data, statusCode) { + + return internals.serverError(message, data, statusCode, exports.internal); +}; + +internals.serverError = function (message, data, statusCode, ctor) { + + var error; + if (data instanceof Error) { + error = exports.wrap(data, statusCode, message); + } else { + error = internals.create(statusCode || 500, message, undefined, ctor); + error.data = data; + } + + return error; +}; + + +exports.notImplemented = function (message, data) { + + return internals.serverError(message, data, 501, exports.notImplemented); +}; + + +exports.badGateway = function (message, data) { + + return internals.serverError(message, data, 502, exports.badGateway); +}; + + +exports.serverTimeout = function (message, data) { + + return internals.serverError(message, data, 503, exports.serverTimeout); +}; + + +exports.gatewayTimeout = function (message, data) { + + return internals.serverError(message, data, 504, exports.gatewayTimeout); +}; + + +exports.badImplementation = function (message, data) { + + var err = internals.serverError(message, data, 500, exports.badImplementation); + err.isDeveloperError = true; + return err; +}; diff --git a/node_modules/fsevents/node_modules/boom/package.json b/node_modules/fsevents/node_modules/boom/package.json new file mode 100755 index 00000000..84039cb5 --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "boom@2.x.x", + "scope": null, + "escapedName": "boom", + "name": "boom", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/hawk" + ] + ], + "_from": "boom@>=2.0.0 <3.0.0", + "_id": "boom@2.10.1", + "_inCache": true, + "_location": "/fsevents/boom", + "_nodeVersion": "0.10.40", + "_npmUser": { + "name": "arb", + "email": "arbretz@gmail.com" + }, + "_npmVersion": "2.11.1", + "_phantomChildren": {}, + "_requested": { + "raw": "boom@2.x.x", + "scope": null, + "escapedName": "boom", + "name": "boom", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/cryptiles", + "/fsevents/hawk" + ], + "_resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "_shasum": "39c8918ceff5799f83f9492a848f625add0c766f", + "_shrinkwrap": null, + "_spec": "boom@2.x.x", + "_where": "/Users/eshanker/Code/fsevents/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/boom/issues" + }, + "dependencies": { + "hoek": "2.x.x" + }, + "description": "HTTP-friendly error objects", + "devDependencies": { + "code": "1.x.x", + "lab": "7.x.x" + }, + "directories": {}, + "dist": { + "shasum": "39c8918ceff5799f83f9492a848f625add0c766f", + "tarball": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + }, + "engines": { + "node": ">=0.10.40" + }, + "gitHead": "ff1a662a86b39426cdd18f4441b112d307a34a6f", + "homepage": "https://github.com/hapijs/boom#readme", + "keywords": [ + "error", + "http" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + { + "name": "wyatt", + "email": "wpreul@gmail.com" + }, + { + "name": "arb", + "email": "arbretz@gmail.com" + } + ], + "name": "boom", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/boom.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L", + "test-cov-html": "lab -a code -r html -o coverage.html -L" + }, + "version": "2.10.1" +} diff --git a/node_modules/fsevents/node_modules/boom/test/index.js b/node_modules/fsevents/node_modules/boom/test/index.js new file mode 100755 index 00000000..79a59e9f --- /dev/null +++ b/node_modules/fsevents/node_modules/boom/test/index.js @@ -0,0 +1,654 @@ +// Load modules + +var Code = require('code'); +var Boom = require('../lib'); +var Lab = require('lab'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var describe = lab.describe; +var it = lab.it; +var expect = Code.expect; + + +it('returns the same object when already boom', function (done) { + + var error = Boom.badRequest(); + var wrapped = Boom.wrap(error); + expect(error).to.equal(wrapped); + done(); +}); + +it('returns an error with info when constructed using another error', function (done) { + + var error = new Error('ka-boom'); + error.xyz = 123; + var err = Boom.wrap(error); + expect(err.xyz).to.equal(123); + expect(err.message).to.equal('ka-boom'); + expect(err.output).to.deep.equal({ + statusCode: 500, + payload: { + statusCode: 500, + error: 'Internal Server Error', + message: 'An internal server error occurred' + }, + headers: {} + }); + expect(err.data).to.equal(null); + done(); +}); + +it('does not override data when constructed using another error', function (done) { + + var error = new Error('ka-boom'); + error.data = { useful: 'data' }; + var err = Boom.wrap(error); + expect(err.data).to.equal(error.data); + done(); +}); + +it('sets new message when none exists', function (done) { + + var error = new Error(); + var wrapped = Boom.wrap(error, 400, 'something bad'); + expect(wrapped.message).to.equal('something bad'); + done(); +}); + +it('throws when statusCode is not a number', function (done) { + + expect(function () { + + Boom.create('x'); + }).to.throw('First argument must be a number (400+): x'); + done(); +}); + +it('will cast a number-string to an integer', function (done) { + + var codes = [ + { input: '404', result: 404 }, + { input: '404.1', result: 404 }, + { input: 400, result: 400 }, + { input: 400.123, result: 400 }]; + for (var i = 0, il = codes.length; i < il; ++i) { + var code = codes[i]; + var err = Boom.create(code.input); + expect(err.output.statusCode).to.equal(code.result); + } + + done(); +}); + +it('throws when statusCode is not finite', function (done) { + + expect(function () { + + Boom.create(1 / 0); + }).to.throw('First argument must be a number (400+): null'); + done(); +}); + +it('sets error code to unknown', function (done) { + + var err = Boom.create(999); + expect(err.output.payload.error).to.equal('Unknown'); + done(); +}); + +describe('create()', function () { + + it('does not sets null message', function (done) { + + var error = Boom.unauthorized(null); + expect(error.output.payload.message).to.not.exist(); + expect(error.isServer).to.be.false(); + done(); + }); + + it('sets message and data', function (done) { + + var error = Boom.badRequest('Missing data', { type: 'user' }); + expect(error.data.type).to.equal('user'); + expect(error.output.payload.message).to.equal('Missing data'); + done(); + }); +}); + +describe('isBoom()', function () { + + it('returns true for Boom object', function (done) { + + expect(Boom.badRequest().isBoom).to.equal(true); + done(); + }); + + it('returns false for Error object', function (done) { + + expect((new Error()).isBoom).to.not.exist(); + done(); + }); +}); + +describe('badRequest()', function () { + + it('returns a 400 error statusCode', function (done) { + + var error = Boom.badRequest(); + + expect(error.output.statusCode).to.equal(400); + expect(error.isServer).to.be.false(); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.badRequest('my message').message).to.equal('my message'); + done(); + }); + + it('sets the message to HTTP status if none provided', function (done) { + + expect(Boom.badRequest().message).to.equal('Bad Request'); + done(); + }); +}); + +describe('unauthorized()', function () { + + it('returns a 401 error statusCode', function (done) { + + var err = Boom.unauthorized(); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers).to.deep.equal({}); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.unauthorized('my message').message).to.equal('my message'); + done(); + }); + + it('returns a WWW-Authenticate header when passed a scheme', function (done) { + + var err = Boom.unauthorized('boom', 'Test'); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test error="boom"'); + done(); + }); + + it('returns a WWW-Authenticate header set to the schema array value', function (done) { + + var err = Boom.unauthorized(null, ['Test','one','two']); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test, one, two'); + done(); + }); + + it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) { + + var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 }); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"'); + expect(err.output.payload.attributes).to.deep.equal({ a: 1, b: 'something', c: '', d: 0, error: 'boom' }); + done(); + }); + + it('returns a WWW-Authenticate header when passed attributes, missing error', function (done) { + + var err = Boom.unauthorized(null, 'Test', { a: 1, b: 'something', c: null, d: 0 }); + expect(err.output.statusCode).to.equal(401); + expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0"'); + expect(err.isMissing).to.equal(true); + done(); + }); + + it('sets the isMissing flag when error message is empty', function (done) { + + var err = Boom.unauthorized('', 'Basic'); + expect(err.isMissing).to.equal(true); + done(); + }); + + it('does not set the isMissing flag when error message is not empty', function (done) { + + var err = Boom.unauthorized('message', 'Basic'); + expect(err.isMissing).to.equal(undefined); + done(); + }); + + it('sets a WWW-Authenticate when passed as an array', function (done) { + + var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']); + expect(err.output.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"'); + done(); + }); +}); + + +describe('methodNotAllowed()', function () { + + it('returns a 405 error statusCode', function (done) { + + expect(Boom.methodNotAllowed().output.statusCode).to.equal(405); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.methodNotAllowed('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('notAcceptable()', function () { + + it('returns a 406 error statusCode', function (done) { + + expect(Boom.notAcceptable().output.statusCode).to.equal(406); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.notAcceptable('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('proxyAuthRequired()', function () { + + it('returns a 407 error statusCode', function (done) { + + expect(Boom.proxyAuthRequired().output.statusCode).to.equal(407); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.proxyAuthRequired('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('clientTimeout()', function () { + + it('returns a 408 error statusCode', function (done) { + + expect(Boom.clientTimeout().output.statusCode).to.equal(408); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.clientTimeout('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('conflict()', function () { + + it('returns a 409 error statusCode', function (done) { + + expect(Boom.conflict().output.statusCode).to.equal(409); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.conflict('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('resourceGone()', function () { + + it('returns a 410 error statusCode', function (done) { + + expect(Boom.resourceGone().output.statusCode).to.equal(410); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.resourceGone('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('lengthRequired()', function () { + + it('returns a 411 error statusCode', function (done) { + + expect(Boom.lengthRequired().output.statusCode).to.equal(411); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.lengthRequired('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('preconditionFailed()', function () { + + it('returns a 412 error statusCode', function (done) { + + expect(Boom.preconditionFailed().output.statusCode).to.equal(412); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.preconditionFailed('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('entityTooLarge()', function () { + + it('returns a 413 error statusCode', function (done) { + + expect(Boom.entityTooLarge().output.statusCode).to.equal(413); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.entityTooLarge('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('uriTooLong()', function () { + + it('returns a 414 error statusCode', function (done) { + + expect(Boom.uriTooLong().output.statusCode).to.equal(414); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.uriTooLong('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('unsupportedMediaType()', function () { + + it('returns a 415 error statusCode', function (done) { + + expect(Boom.unsupportedMediaType().output.statusCode).to.equal(415); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.unsupportedMediaType('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('rangeNotSatisfiable()', function () { + + it('returns a 416 error statusCode', function (done) { + + expect(Boom.rangeNotSatisfiable().output.statusCode).to.equal(416); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.rangeNotSatisfiable('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('expectationFailed()', function () { + + it('returns a 417 error statusCode', function (done) { + + expect(Boom.expectationFailed().output.statusCode).to.equal(417); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.expectationFailed('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('badData()', function () { + + it('returns a 422 error statusCode', function (done) { + + expect(Boom.badData().output.statusCode).to.equal(422); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.badData('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('preconditionRequired()', function () { + + it('returns a 428 error statusCode', function (done) { + + expect(Boom.preconditionRequired().output.statusCode).to.equal(428); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.preconditionRequired('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('tooManyRequests()', function () { + + it('returns a 429 error statusCode', function (done) { + + expect(Boom.tooManyRequests().output.statusCode).to.equal(429); + done(); + }); + + it('sets the message with the passed-in message', function (done) { + + expect(Boom.tooManyRequests('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('serverTimeout()', function () { + + it('returns a 503 error statusCode', function (done) { + + expect(Boom.serverTimeout().output.statusCode).to.equal(503); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.serverTimeout('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('forbidden()', function () { + + it('returns a 403 error statusCode', function (done) { + + expect(Boom.forbidden().output.statusCode).to.equal(403); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.forbidden('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('notFound()', function () { + + it('returns a 404 error statusCode', function (done) { + + expect(Boom.notFound().output.statusCode).to.equal(404); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.notFound('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('internal()', function () { + + it('returns a 500 error statusCode', function (done) { + + expect(Boom.internal().output.statusCode).to.equal(500); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + var err = Boom.internal('my message'); + expect(err.message).to.equal('my message'); + expect(err.isServer).to.true(); + expect(err.output.payload.message).to.equal('An internal server error occurred'); + done(); + }); + + it('passes data on the callback if its passed in', function (done) { + + expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data'); + done(); + }); + + it('returns an error with composite message', function (done) { + + try { + JSON.parse('{'); + } + catch (err) { + var boom = Boom.internal('Someting bad', err); + expect(boom.message).to.equal('Someting bad: Unexpected end of input'); + expect(boom.isServer).to.be.true(); + done(); + } + }); +}); + +describe('notImplemented()', function () { + + it('returns a 501 error statusCode', function (done) { + + expect(Boom.notImplemented().output.statusCode).to.equal(501); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.notImplemented('my message').message).to.equal('my message'); + done(); + }); +}); + + +describe('badGateway()', function () { + + it('returns a 502 error statusCode', function (done) { + + expect(Boom.badGateway().output.statusCode).to.equal(502); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.badGateway('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('gatewayTimeout()', function () { + + it('returns a 504 error statusCode', function (done) { + + expect(Boom.gatewayTimeout().output.statusCode).to.equal(504); + done(); + }); + + it('sets the message with the passed in message', function (done) { + + expect(Boom.gatewayTimeout('my message').message).to.equal('my message'); + done(); + }); +}); + +describe('badImplementation()', function () { + + it('returns a 500 error statusCode', function (done) { + + var err = Boom.badImplementation(); + expect(err.output.statusCode).to.equal(500); + expect(err.isDeveloperError).to.equal(true); + expect(err.isServer).to.be.true(); + done(); + }); +}); + +describe('stack trace', function () { + + it('should omit lib', function (done) { + + ['badRequest', 'unauthorized', 'forbidden', 'notFound', 'methodNotAllowed', + 'notAcceptable', 'proxyAuthRequired', 'clientTimeout', 'conflict', + 'resourceGone', 'lengthRequired', 'preconditionFailed', 'entityTooLarge', + 'uriTooLong', 'unsupportedMediaType', 'rangeNotSatisfiable', 'expectationFailed', + 'badData', 'preconditionRequired', 'tooManyRequests', + + // 500s + 'internal', 'notImplemented', 'badGateway', 'serverTimeout', 'gatewayTimeout', + 'badImplementation' + ].forEach(function (name) { + + var err = Boom[name](); + expect(err.stack).to.not.match(/\/lib\/index\.js/); + }); + + done(); + }); +}); diff --git a/node_modules/fsevents/node_modules/brace-expansion/README.md b/node_modules/fsevents/node_modules/brace-expansion/README.md new file mode 100755 index 00000000..17939297 --- /dev/null +++ b/node_modules/fsevents/node_modules/brace-expansion/README.md @@ -0,0 +1,122 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fsevents/node_modules/brace-expansion/index.js b/node_modules/fsevents/node_modules/brace-expansion/index.js new file mode 100755 index 00000000..955f27c8 --- /dev/null +++ b/node_modules/fsevents/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/fsevents/node_modules/brace-expansion/package.json b/node_modules/fsevents/node_modules/brace-expansion/package.json new file mode 100755 index 00000000..6291362a --- /dev/null +++ b/node_modules/fsevents/node_modules/brace-expansion/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "brace-expansion@^1.0.0", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.6", + "_inCache": true, + "_location": "/fsevents/brace-expansion", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" + }, + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "brace-expansion@^1.0.0", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/minimatch", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "dependencies": { + "balanced-match": "^0.4.1", + "concat-map": "0.0.1" + }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "tape": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + }, + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.6" +} diff --git a/node_modules/fsevents/node_modules/buffer-shims/index.js b/node_modules/fsevents/node_modules/buffer-shims/index.js new file mode 100755 index 00000000..1cab4c05 --- /dev/null +++ b/node_modules/fsevents/node_modules/buffer-shims/index.js @@ -0,0 +1,108 @@ +'use strict'; + +var buffer = require('buffer'); +var Buffer = buffer.Buffer; +var SlowBuffer = buffer.SlowBuffer; +var MAX_LEN = buffer.kMaxLength || 2147483647; +exports.alloc = function alloc(size, fill, encoding) { + if (typeof Buffer.alloc === 'function') { + return Buffer.alloc(size, fill, encoding); + } + if (typeof encoding === 'number') { + throw new TypeError('encoding must not be number'); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size > MAX_LEN) { + throw new RangeError('size is too large'); + } + var enc = encoding; + var _fill = fill; + if (_fill === undefined) { + enc = undefined; + _fill = 0; + } + var buf = new Buffer(size); + if (typeof _fill === 'string') { + var fillBuf = new Buffer(_fill, enc); + var flen = fillBuf.length; + var i = -1; + while (++i < size) { + buf[i] = fillBuf[i % flen]; + } + } else { + buf.fill(_fill); + } + return buf; +} +exports.allocUnsafe = function allocUnsafe(size) { + if (typeof Buffer.allocUnsafe === 'function') { + return Buffer.allocUnsafe(size); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size > MAX_LEN) { + throw new RangeError('size is too large'); + } + return new Buffer(size); +} +exports.from = function from(value, encodingOrOffset, length) { + if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) { + return Buffer.from(value, encodingOrOffset, length); + } + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number'); + } + if (typeof value === 'string') { + return new Buffer(value, encodingOrOffset); + } + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + var offset = encodingOrOffset; + if (arguments.length === 1) { + return new Buffer(value); + } + if (typeof offset === 'undefined') { + offset = 0; + } + var len = length; + if (typeof len === 'undefined') { + len = value.byteLength - offset; + } + if (offset >= value.byteLength) { + throw new RangeError('\'offset\' is out of bounds'); + } + if (len > value.byteLength - offset) { + throw new RangeError('\'length\' is out of bounds'); + } + return new Buffer(value.slice(offset, offset + len)); + } + if (Buffer.isBuffer(value)) { + var out = new Buffer(value.length); + value.copy(out, 0, 0, value.length); + return out; + } + if (value) { + if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) { + return new Buffer(value); + } + if (value.type === 'Buffer' && Array.isArray(value.data)) { + return new Buffer(value.data); + } + } + + throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.'); +} +exports.allocUnsafeSlow = function allocUnsafeSlow(size) { + if (typeof Buffer.allocUnsafeSlow === 'function') { + return Buffer.allocUnsafeSlow(size); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size >= MAX_LEN) { + throw new RangeError('size is too large'); + } + return new SlowBuffer(size); +} diff --git a/node_modules/fsevents/node_modules/buffer-shims/license.md b/node_modules/fsevents/node_modules/buffer-shims/license.md new file mode 100755 index 00000000..01cfaefe --- /dev/null +++ b/node_modules/fsevents/node_modules/buffer-shims/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2016 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** diff --git a/node_modules/fsevents/node_modules/buffer-shims/package.json b/node_modules/fsevents/node_modules/buffer-shims/package.json new file mode 100755 index 00000000..e71dd04e --- /dev/null +++ b/node_modules/fsevents/node_modules/buffer-shims/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + { + "raw": "buffer-shims@^1.0.0", + "scope": null, + "escapedName": "buffer-shims", + "name": "buffer-shims", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/readable-stream" + ] + ], + "_from": "buffer-shims@>=1.0.0 <2.0.0", + "_id": "buffer-shims@1.0.0", + "_inCache": true, + "_location": "/fsevents/buffer-shims", + "_nodeVersion": "5.11.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/buffer-shims-1.0.0.tgz_1462560889323_0.8640750856138766" + }, + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "_npmVersion": "3.8.6", + "_phantomChildren": {}, + "_requested": { + "raw": "buffer-shims@^1.0.0", + "scope": null, + "escapedName": "buffer-shims", + "name": "buffer-shims", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/readable-stream", + "/fsevents/tar-pack/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "_shasum": "9978ce317388c649ad8793028c3477ef044a8b51", + "_shrinkwrap": null, + "_spec": "buffer-shims@^1.0.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/calvinmetcalf/buffer-shims/issues" + }, + "dependencies": {}, + "description": "some shims for node buffers", + "devDependencies": { + "tape": "^4.5.1" + }, + "directories": {}, + "dist": { + "shasum": "9978ce317388c649ad8793028c3477ef044a8b51", + "tarball": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "ea89b3857ab5b8203957922a84e9a48cf4c47e0a", + "homepage": "https://github.com/calvinmetcalf/buffer-shims#readme", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "name": "buffer-shims", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/calvinmetcalf/buffer-shims.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/fsevents/node_modules/buffer-shims/readme.md b/node_modules/fsevents/node_modules/buffer-shims/readme.md new file mode 100755 index 00000000..7ea6475e --- /dev/null +++ b/node_modules/fsevents/node_modules/buffer-shims/readme.md @@ -0,0 +1,21 @@ +buffer-shims +=== + +functions to make sure the new buffer methods work in older browsers. + +```js +var bufferShim = require('buffer-shims'); +bufferShim.from('foo'); +bufferShim.alloc(9, 'cafeface', 'hex'); +bufferShim.allocUnsafe(15); +bufferShim.allocUnsafeSlow(21); +``` + +should just use the original in newer nodes and on older nodes uses fallbacks. + +Known Issues +=== +- this does not patch the buffer object, only the constructor stuff +- it's actually a polyfill + +![](https://i.imgur.com/zxII3jJ.gif) diff --git a/node_modules/fsevents/node_modules/caseless/LICENSE b/node_modules/fsevents/node_modules/caseless/LICENSE new file mode 100755 index 00000000..61789f4a --- /dev/null +++ b/node_modules/fsevents/node_modules/caseless/LICENSE @@ -0,0 +1,28 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/node_modules/fsevents/node_modules/caseless/README.md b/node_modules/fsevents/node_modules/caseless/README.md new file mode 100755 index 00000000..e5077a21 --- /dev/null +++ b/node_modules/fsevents/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/node_modules/fsevents/node_modules/caseless/index.js b/node_modules/fsevents/node_modules/caseless/index.js new file mode 100755 index 00000000..d86a70ec --- /dev/null +++ b/node_modules/fsevents/node_modules/caseless/index.js @@ -0,0 +1,66 @@ +function Caseless (dict) { + this.dict = dict || {} +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i=0.11.0 <0.12.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/request" + ] + ], + "_from": "caseless@>=0.11.0 <0.12.0", + "_id": "caseless@0.11.0", + "_inCache": true, + "_location": "/fsevents/caseless", + "_nodeVersion": "1.8.1", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + "_npmVersion": "2.8.3", + "_phantomChildren": {}, + "_requested": { + "raw": "caseless@~0.11.0", + "scope": null, + "escapedName": "caseless", + "name": "caseless", + "rawSpec": "~0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/request" + ], + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "_shrinkwrap": null, + "_spec": "caseless@~0.11.0", + "_where": "/Users/eshanker/Code/fsevents/node_modules/request", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com" + }, + "bugs": { + "url": "https://github.com/mikeal/caseless/issues" + }, + "dependencies": {}, + "description": "Caseless object set/get/has, very useful when working with HTTP headers.", + "devDependencies": { + "tape": "^2.10.2" + }, + "directories": {}, + "dist": { + "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, + "gitHead": "c578232a02cc2b46b6da8851caf57fdbfac89ff5", + "homepage": "https://github.com/mikeal/caseless#readme", + "keywords": [ + "headers", + "http", + "caseless" + ], + "license": "Apache-2.0", + "main": "index.js", + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "name": "caseless", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mikeal/caseless.git" + }, + "scripts": { + "test": "node test.js" + }, + "test": "node test.js", + "version": "0.11.0" +} diff --git a/node_modules/fsevents/node_modules/caseless/test.js b/node_modules/fsevents/node_modules/caseless/test.js new file mode 100755 index 00000000..084bbaf5 --- /dev/null +++ b/node_modules/fsevents/node_modules/caseless/test.js @@ -0,0 +1,40 @@ +var tape = require('tape') + , caseless = require('./') + ; + +tape('set get has', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(17) + c.set('a-Header', 'asdf') + t.equal(c.get('a-header'), 'asdf') + t.equal(c.has('a-header'), 'a-Header') + t.ok(!c.has('nothing')) + // old bug where we used the wrong regex + t.ok(!c.has('a-hea')) + c.set('a-header', 'fdsa') + t.equal(c.get('a-header'), 'fdsa') + t.equal(c.get('a-Header'), 'fdsa') + c.set('a-HEADER', 'more', false) + t.equal(c.get('a-header'), 'fdsa,more') + + t.deepEqual(headers, {'a-Header': 'fdsa,more'}) + c.swap('a-HEADER') + t.deepEqual(headers, {'a-HEADER': 'fdsa,more'}) + + c.set('deleteme', 'foobar') + t.ok(c.has('deleteme')) + t.ok(c.del('deleteme')) + t.notOk(c.has('deleteme')) + t.notOk(c.has('idonotexist')) + t.ok(c.del('idonotexist')) + + c.set('tva', 'test1') + c.set('tva-header', 'test2') + t.equal(c.has('tva'), 'tva') + t.notOk(c.has('header')) + + t.equal(c.get('tva'), 'test1') + +}) diff --git a/node_modules/fsevents/node_modules/chalk/index.js b/node_modules/fsevents/node_modules/chalk/index.js new file mode 100755 index 00000000..2d85a917 --- /dev/null +++ b/node_modules/fsevents/node_modules/chalk/index.js @@ -0,0 +1,116 @@ +'use strict'; +var escapeStringRegexp = require('escape-string-regexp'); +var ansiStyles = require('ansi-styles'); +var stripAnsi = require('strip-ansi'); +var hasAnsi = require('has-ansi'); +var supportsColor = require('supports-color'); +var defineProps = Object.defineProperties; +var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); + +function Chalk(options) { + // detect mode if not set manually + this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +} + +// use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001b[94m'; +} + +var styles = (function () { + var ret = {}; + + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + ret[key] = { + get: function () { + return build.call(this, this._styles.concat(key)); + } + }; + }); + + return ret; +})(); + +var proto = defineProps(function chalk() {}, styles); + +function build(_styles) { + var builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder.enabled = this.enabled; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + /* eslint-disable no-proto */ + builder.__proto__ = proto; + + return builder; +} + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || !str) { + return str; + } + + var nestedStyles = this._styles; + var i = nestedStyles.length; + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + var originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { + ansiStyles.dim.open = ''; + } + + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } + + // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. + ansiStyles.dim.open = originalDim; + + return str; +} + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build.call(this, [name]); + } + }; + }); + + return ret; +} + +defineProps(Chalk.prototype, init()); + +module.exports = new Chalk(); +module.exports.styles = ansiStyles; +module.exports.hasColor = hasAnsi; +module.exports.stripColor = stripAnsi; +module.exports.supportsColor = supportsColor; diff --git a/node_modules/fsevents/node_modules/chalk/license b/node_modules/fsevents/node_modules/chalk/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/fsevents/node_modules/chalk/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fsevents/node_modules/chalk/package.json b/node_modules/fsevents/node_modules/chalk/package.json new file mode 100755 index 00000000..bbbfc827 --- /dev/null +++ b/node_modules/fsevents/node_modules/chalk/package.json @@ -0,0 +1,140 @@ +{ + "_args": [ + [ + { + "raw": "chalk@^1.1.1", + "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "/Users/eshanker/Code/fsevents/node_modules/har-validator" + ] + ], + "_from": "chalk@>=1.1.1 <2.0.0", + "_id": "chalk@1.1.3", + "_inCache": true, + "_location": "/fsevents/chalk", + "_nodeVersion": "0.10.32", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" + }, + "_npmUser": { + "name": "qix", + "email": "i.am.qix@gmail.com" + }, + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "raw": "chalk@^1.1.1", + "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents/har-validator" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "_shrinkwrap": null, + "_spec": "chalk@^1.1.1", + "_where": "/Users/eshanker/Code/fsevents/node_modules/har-validator", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "description": "Terminal string styling done right. Much color.", + "devDependencies": { + "coveralls": "^2.11.2", + "matcha": "^0.6.0", + "mocha": "*", + "nyc": "^3.0.0", + "require-uncached": "^1.0.2", + "resolve-from": "^1.0.0", + "semver": "^4.3.3", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24", + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "qix", + "email": "i.am.qix@gmail.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "unicorn", + "email": "sindresorhus+unicorn@gmail.com" + } + ], + "name": "chalk", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", + "test": "xo && mocha" + }, + "version": "1.1.3", + "xo": { + "envs": [ + "node", + "mocha" + ] + } +} diff --git a/node_modules/fsevents/node_modules/chalk/readme.md b/node_modules/fsevents/node_modules/chalk/readme.md new file mode 100755 index 00000000..5cf111e3 --- /dev/null +++ b/node_modules/fsevents/node_modules/chalk/readme.md @@ -0,0 +1,213 @@ +

      +
      +
      + chalk +
      +
      +
      +

      + +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) +[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) +[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) + + +## Why + +- Highly performant +- Doesn't extend `String.prototype` +- Expressive API +- Ability to nest styles +- Clean and focused +- Auto-detects color support +- Actively maintained +- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 + + +## Install + +``` +$ npm install --save chalk +``` + + +## Usage + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +chalk.blue('Hello world!'); + +// combine styled and normal strings +chalk.blue('Hello') + 'World' + chalk.red('!'); + +// compose multiple styles using the chainable API +chalk.blue.bgRed.bold('Hello world!'); + +// pass in multiple arguments +chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); + +// nest styles +chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); + +// nest styles of the same type even (color, underline, background) +chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +); +``` + +Easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + + +## API + +### chalk.` + + + + {+include("static/header.html")+} + +
      + + \ No newline at end of file diff --git a/node_modules/gl-matrix/jsdoc-template/class.tmpl b/node_modules/gl-matrix/jsdoc-template/class.tmpl new file mode 100755 index 00000000..cb1d2b0f --- /dev/null +++ b/node_modules/gl-matrix/jsdoc-template/class.tmpl @@ -0,0 +1,340 @@ + + + + + + {! Link.base = "../"; /* all generated links will be relative to this */ !} + glMatrix - {+data.alias+} + + + + + + + + {+include("static/header.html")+} + + +
      + +
      + + {+publish.classesIndex+} + +
      + +
      + +

      + {! + var classType = ""; + + if (data.isBuiltin()) { + classType += "Built-In "; + } + + if (data.isNamespace) { + if (data.is('FUNCTION')) { + classType += "Function "; + } + classType += "Namespace "; + } + else { + classType += "Class "; + } + !} + {+classType+}{+data.alias+} +

      + + +

      +
      Version + {+ data.version +}.
      +
      +
      Extends + {+ + data.augments + .sort() + .map( + function($) { return new Link().toSymbol($); } + ) + .join(", ") + +}.
      +
      + + {+resolveLinks(data.classDesc)+} + + +

      {+resolveLinks(summarize(data.desc))+}
      + + + {# isn't defined in any file #} +
      Defined in: {+new Link().toSrc(data.srcFile)+}. +
      +

      + + + + {! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !} + + + + + + + + + + + + + + + + + +
      Field Summary
      Field AttributesField Name and Description
      {! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + if (member.isConstant) output += "<constant> "; + !}  +
      + {+member.memberOf+}.{+new Link().toSymbol(member.alias).withText(member.name)+} +
      +
      {+resolveLinks(summarize(member.desc))+}
      +
      +
      + + +
      + {! + var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias}); + + var contributers = []; + borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)}); + for (var i = 0, l = contributers.length; i < l; i++) { + output += + "
      Fields borrowed from class "+new Link().toSymbol(contributers[i])+":
      " + + + "
      " + + borrowedMembers + .filter( + function($) { return $.memberOf == contributers[i] } + ) + .sort(makeSortby("name")) + .map( + function($) { return new Link().toSymbol($.alias).withText($.name) } + ) + .join(", ") + + + "
      "; + } + !} +
      +
      +
      + + + + {! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !} + +

      Methods

      + + + + + + + + +
      + {+member.memberOf+}.{+new Link().toSymbol(member.alias).withText(member.name.replace(/\^\d+$/, ''))+}{+makeSignature(member.params)+} + +
      {+resolveLinks(summarize(member.desc))+}
      +
      +
      +
      + + + +
      + Field Detail +
      + + +
      {! + if (member.isPrivate) output += "<private> "; + if (member.isInner) output += "<inner> "; + if (member.isStatic) output += "<static> "; + if (member.isConstant) output += "<constant> "; + !} + + {{+new Link().toSymbol(member.type)+}} + {+member.memberOf+}.{+member.name+} + +
      +
      + {+resolveLinks(member.desc)+} + +
      + Defined in: {+new Link().toSrc(member.srcFile)+}. +
      +
      Author: {+member.author+}.
      +
      + + + +
      {+example+}
      +
      +
      + + +
      +
      Deprecated:
      +
      + {+ resolveLinks(member.deprecated) +} +
      +
      +
      + +
      +
      Since:
      +
      {+ member.since +}
      +
      +
      + +
      +
      See:
      + +
      {+ new Link().toSymbol(item) +}
      +
      +
      +
      + +
      +
      Default Value:
      +
      + {+resolveLinks(member.defaultValue)+} +
      +
      +
      + +
      +
      +
      + + + +

      Method Detail

      + + +

      + {{+new Link().toSymbol(member.type)+}} + {+member.memberOf+}.{+member.name.replace(/\^\d+$/, '')+}{+makeSignature(member.params)+} +

      + +
      +

      + {+resolveLinks(member.desc)+} + +
      + Defined in: {+new Link().toSrc(member.srcFile)+}. +
      +
      Author: {+member.author+}.
      +

      + + + +
      {+example+}
      +
      +
      + + +
      +
      Parameters:
      + +
      + {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+}{+item.name+} + Optional, Default: {+item.defaultValue+} +
      +
      {+resolveLinks(item.desc)+}
      +
      +
      +
      + +
      +
      Deprecated:
      +
      + {+ resolveLinks(member.deprecated) +} +
      +
      +
      + +
      +
      Since:
      +
      {+ member.since +}
      +
      + +
      + +
      +
      Throws:
      + +
      + {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+} {+item.name+} +
      +
      {+resolveLinks(item.desc)+}
      +
      +
      +
      + +
      +
      Returns:
      + +
      {+((item.type)?"{"+(new Link().toSymbol(item.type))+"} " : "")+}{+resolveLinks(item.desc)+}
      +
      +
      +
      + +
      +
      Requires:
      + +
      {+ resolveLinks(item) +}
      +
      +
      +
      + +
      +
      See:
      + +
      {+ new Link().toSymbol(item) +}
      +
      +
      +
      + +
      +
      +
      +
      + +
      +
      + + + +
      + + ©{+JSDOC.opt.D.copyright+}
      + Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} +

      + Theme based on Github Pages template by orderedlist +
      +
      + +
      + + diff --git a/node_modules/gl-matrix/jsdoc-template/index.tmpl b/node_modules/gl-matrix/jsdoc-template/index.tmpl new file mode 100755 index 00000000..7c92dd40 --- /dev/null +++ b/node_modules/gl-matrix/jsdoc-template/index.tmpl @@ -0,0 +1,52 @@ + + + + + + glMatrix - Index + + + + + + + + + {+include("static/header.html")+} + +
      + +
      + {+publish.classesIndex+} +
      + +
      +

      Class Index

      + + + +
      +

      {+(new Link().toSymbol(thisClass.alias))+}

      + {+resolveLinks(summarize(thisClass.classDesc))+} +
      +
      +
      +
      + +
      + +
      + + ©{+JSDOC.opt.D.copyright+}
      + Documentation generated by JsDoc Toolkit {+JSDOC.VERSION+} on {+new Date()+} +

      + Theme based on Github Pages template by orderedlist +
      +
      + +
      + + \ No newline at end of file diff --git a/node_modules/gl-matrix/jsdoc-template/publish.js b/node_modules/gl-matrix/jsdoc-template/publish.js new file mode 100755 index 00000000..82c20045 --- /dev/null +++ b/node_modules/gl-matrix/jsdoc-template/publish.js @@ -0,0 +1,201 @@ +/** Called automatically by JsDoc Toolkit. */ +function publish(symbolSet) { + publish.conf = { // trailing slash expected for dirs + ext: ".html", + outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/", + templatesDir: JSDOC.opt.t || SYS.pwd+"../jsdoc-template/", + symbolsDir: "symbols/", + srcDir: "symbols/src/" + }; + + // is source output is suppressed, just display the links to the source file + if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) { + Link.prototype._makeSrcLink = function(srcFilePath) { + return "<"+srcFilePath+">"; + } + } + + // create the folders and subfolders to hold the output + IO.mkPath((publish.conf.outDir+"symbols/src").split("/")); + + // used to allow Link to check the details of things being linked to + Link.symbolSet = symbolSet; + + // create the required templates + try { + var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl"); + var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl"); + } + catch(e) { + print("Couldn't create the required templates: "+e); + quit(); + } + + // some ustility filters + function hasNoParent($) {return ($.memberOf == "")} + function isaFile($) {return ($.is("FILE"))} + function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)} + + // get an array version of the symbolset, useful for filtering + var symbols = symbolSet.toArray(); + + // create the hilited source code files + var files = JSDOC.opt.srcFiles; + for (var i = 0, l = files.length; i < l; i++) { + var file = files[i]; + var srcDir = publish.conf.outDir + "symbols/src/"; + makeSrcFile(file, srcDir); + } + + // get a list of all the classes in the symbolset + var classes = symbols.filter(isaClass).sort(makeSortby("alias")); + + // create a filemap in which outfiles must be to be named uniquely, ignoring case + if (JSDOC.opt.u) { + var filemapCounts = {}; + Link.filemap = {}; + for (var i = 0, l = classes.length; i < l; i++) { + var lcAlias = classes[i].alias.toLowerCase(); + + if (!filemapCounts[lcAlias]) filemapCounts[lcAlias] = 1; + else filemapCounts[lcAlias]++; + + Link.filemap[classes[i].alias] = + (filemapCounts[lcAlias] > 1)? + lcAlias+"_"+filemapCounts[lcAlias] : lcAlias; + } + } + + // create a class index, displayed in the left-hand column of every class page + Link.base = "../"; + publish.classesIndex = classesTemplate.process(classes); // kept in memory + + // create each of the class pages + for (var i = 0, l = classes.length; i < l; i++) { + var symbol = classes[i]; + + symbol.events = symbol.getEvents(); // 1 order matters + symbol.methods = symbol.getMethods(); // 2 + + Link.currentSymbol= symbol; + var output = ""; + output = classTemplate.process(symbol); + + IO.saveFile(publish.conf.outDir+"symbols/", ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output); + } + + // regenerate the index with different relative links, used in the index pages + Link.base = ""; + publish.classesIndex = classesTemplate.process(classes); + + // create the class index page + try { + var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl"); + } + catch(e) { print(e.message); quit(); } + + var classesIndex = classesindexTemplate.process(classes); + IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex); + classesindexTemplate = classesIndex = classes = null; + + // create the file index page + try { + var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl"); + } + catch(e) { print(e.message); quit(); } + + var documentedFiles = symbols.filter(isaFile); // files that have file-level docs + var allFiles = []; // not all files have file-level docs, but we need to list every one + + for (var i = 0; i < files.length; i++) { + allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */"))); + } + + for (var i = 0; i < documentedFiles.length; i++) { + var offset = files.indexOf(documentedFiles[i].alias); + allFiles[offset] = documentedFiles[i]; + } + + allFiles = allFiles.sort(makeSortby("name")); + + // output the file index page + var filesIndex = fileindexTemplate.process(allFiles); + IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex); + fileindexTemplate = filesIndex = files = null; +} + + +/** Just the first sentence (up to a full stop). Should not break on dotted variable names. */ +function summarize(desc) { + if (typeof desc != "undefined") + return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc; +} + +/** Make a symbol sorter by some attribute. */ +function makeSortby(attribute) { + return function(a, b) { + if (a[attribute] != undefined && b[attribute] != undefined) { + a = a[attribute].toLowerCase(); + b = b[attribute].toLowerCase(); + if (a < b) return -1; + if (a > b) return 1; + return 0; + } + } +} + +/** Pull in the contents of an external file at the given path. */ +function include(path) { + var path = publish.conf.templatesDir+path; + return IO.readFile(path); +} + +/** Turn a raw source file into a code-hilited page in the docs. */ +function makeSrcFile(path, srcDir, name) { + if (JSDOC.opt.s) return; + + if (!name) { + name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_"); + name = name.replace(/\:/g, "_"); + } + + var src = {path: path, name:name, charset: IO.encoding, hilited: ""}; + + if (defined(JSDOC.PluginManager)) { + JSDOC.PluginManager.run("onPublishSrc", src); + } + + if (src.hilited) { + IO.saveFile(srcDir, name+publish.conf.ext, src.hilited); + } +} + +/** Build output for displaying function parameters. */ +function makeSignature(params) { + if (!params) return "()"; + var signature = "(" + + + params.filter( + function($) { + return $.name.indexOf(".") == -1; // don't show config params in signature + } + ).map( + function($) { + return $.name; + } + ).join(", ") + + + ")"; + return signature; +} + +/** Find symbol {@link ...} strings in text and turn into html links */ +function resolveLinks(str, from) { + str = str.replace(/\{@link ([^} ]+) ?\}/gi, + function(match, symbolName) { + return new Link().toSymbol(symbolName); + } + ); + + return str; +} diff --git a/node_modules/gl-matrix/jsdoc-template/static/default.css b/node_modules/gl-matrix/jsdoc-template/static/default.css new file mode 100755 index 00000000..efcf7827 --- /dev/null +++ b/node_modules/gl-matrix/jsdoc-template/static/default.css @@ -0,0 +1,428 @@ +/* default.css */ + +/* + +body +{ + font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; + width: 800px; +} + +.header +{ + clear: both; + background-color: #ccc; + padding: 8px; +} + +h1 +{ + font-size: 150%; + font-weight: bold; + padding: 0; + margin: 1em 0 0 .3em; +} + +hr +{ + border: none 0; + border-top: 1px solid #7F8FB1; + height: 1px; +} + +pre.code +{ + display: block; + padding: 8px; + border: 1px dashed #ccc; +} + +#index +{ + margin-top: 24px; + float: left; + width: 160px; + position: absolute; + left: 8px; + background-color: #F3F3F3; + padding: 8px; +} + +#content +{ + margin-left: 190px; + width: 600px; +} + +.classList +{ + list-style-type: none; + padding: 0; + margin: 0 0 0 8px; + font-family: arial, sans-serif; + font-size: 1em; + overflow: auto; +} + +.classList li +{ + padding: 0; + margin: 0 0 8px 0; +} + +.summaryTable { width: 100%; } + +h1.classTitle +{ + font-size:170%; + line-height:130%; +} + +h2 { font-size: 110%; } +caption, div.sectionTitle +{ + background-color: #7F8FB1; + color: #fff; + font-size:130%; + text-align: left; + padding: 2px 6px 2px 6px; + border: 1px #7F8FB1 solid; +} + +div.sectionTitle { margin-bottom: 8px; } +.summaryTable thead { display: none; } + +.summaryTable td +{ + vertical-align: top; + padding: 4px; + border-bottom: 1px #7F8FB1 solid; + border-right: 1px #7F8FB1 solid; + border-left: 1px #7F8FB1 solid; +} + +.summaryTable td.attributes +{ + border-left: 1px #7F8FB1 solid; + width: 140px; + text-align: right; +} + +td.attributes, .fixedFont +{ + line-height: 15px; + color: #002EBE; + font-family: "Courier New",Courier,monospace; + font-size: 13px; +} + +.summaryTable td.nameDescription +{ + text-align: left; + font-size: 13px; + line-height: 15px; +} + +.summaryTable td.nameDescription, .description +{ + line-height: 15px; + padding: 4px; + padding-left: 4px; +} + +.summaryTable { margin-bottom: 8px; } + +ul.inheritsList +{ + list-style: square; + margin-left: 20px; + padding-left: 0; +} + +.detailList { + margin-left: 20px; + line-height: 15px; +} +.detailList dt { margin-left: 20px; } + +.detailList .heading +{ + font-weight: bold; + padding-bottom: 6px; + margin-left: 0; +} + +.light, td.attributes, .light a:link, .light a:visited +{ + color: #777; + font-style: italic; +} + +.fineprint +{ + text-align: right; + font-size: 10px; +} + +*/ + +/* Copied from styles.css generated by Github Pages */ + +@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700); + +body { + padding:50px; + font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; + color:#777; + font-weight:300; +} + +h1, h2, h3, h4, h5, h6 { + color:#222; + margin:0 0 20px; +} + +p, ul, ol, table, pre, dl { + margin:0 0 20px; +} + +h1, h2, h3 { + line-height:1.1; +} + +h1 { + font-size:28px; +} + +h2 { + color:#393939; +} + +h3, h4, h5, h6 { + color:#494949; +} + +a { + color:#39c; + font-weight:400; + text-decoration:none; +} + +a small { + font-size:11px; + color:#777; + margin-top:-0.6em; + display:block; +} + +.wrapper { + width:860px; + margin:0 auto; +} + +blockquote { + border-left:1px solid #e5e5e5; + margin:0; + padding:0 0 0 20px; + font-style:italic; +} + +code, pre { + font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; + color:#333; + font-size:12px; +} + +pre { + padding:8px 15px; + background: #f8f8f8; + border-radius:5px; + border:1px solid #e5e5e5; + overflow-x: auto; +} + +table { + width:100%; + border-collapse:collapse; +} + +th, td { + text-align:left; + padding:5px 10px; + border-bottom:1px solid #e5e5e5; +} + +dt { + color:#444; + font-weight:700; +} + +th { + color:#444; +} + +img { + max-width:100%; +} + +header { + width:270px; + float:left; + position:fixed; +} + +header ul { + list-style:none; + padding:0; + + /*background: #eee; + background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); + background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + + border-radius:5px; + border:1px solid #d2d2d2; + box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0;*/ + width:270px; +} + +header li { + width:89px; + /*float:left; + border-right:1px solid #d2d2d2; + height:40px;*/ +} + +header ul a { + line-height:1; + font-size:11px; + color:#999; + display:block; + text-align:center; + padding-top:6px; + /*height:40px;*/ +} + +strong { + color:#222; + font-weight:700; +} + +/*header ul li + li { + width:88px; + border-left:1px solid #fff; +} + +header ul li + li + li { + border-right:none; + width:89px; +}*/ + +header ul a strong { + font-size:14px; + display:block; + color:#222; +} + +section { + width:500px; + float:right; + padding-bottom:50px; +} + +small { + font-size:11px; +} + +hr { + border:0; + background:#e5e5e5; + height:1px; + margin:0 0 20px; +} + +footer { + width:270px; + float:left; + position:fixed; + bottom:50px; +} + +@media print, screen and (max-width: 960px) { + + div.wrapper { + width:auto; + margin:0; + } + + header, section, footer { + float:none; + position:static; + width:auto; + } + + header { + /*padding-right:320px;*/ + padding: 0; + } + + section { + border:1px solid #e5e5e5; + border-width:1px 0; + padding:20px 0; + margin:0 0 20px; + } + + header a small { + display:inline; + } + + header ul { + position:static; + height:40px; + width: auto; + } + + header ul li { + float: left; + } +} + +@media print, screen and (max-width: 720px) { + body { + word-wrap:break-word; + } + + header { + padding:0; + } + + header ul, header p.view { + position:static; + } + + pre, code { + word-wrap:normal; + } +} + +@media print, screen and (max-width: 480px) { + body { + padding:15px; + } + + /*header ul { + display:none; + }*/ +} + +@media print { + body { + padding:0.4in; + font-size:12pt; + color:#444; + } +} diff --git a/node_modules/gl-matrix/jsdoc-template/static/header.html b/node_modules/gl-matrix/jsdoc-template/static/header.html new file mode 100755 index 00000000..353b735a --- /dev/null +++ b/node_modules/gl-matrix/jsdoc-template/static/header.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/node_modules/gl-matrix/jsdoc-template/static/index.html b/node_modules/gl-matrix/jsdoc-template/static/index.html new file mode 100755 index 00000000..d51d4efa --- /dev/null +++ b/node_modules/gl-matrix/jsdoc-template/static/index.html @@ -0,0 +1,19 @@ + + + + + glMatrix Documentation + + + + + + <body> + <p> + This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. + </p> + </body> + + + \ No newline at end of file diff --git a/node_modules/gl-matrix/jsdoc-template/symbol.tmpl b/node_modules/gl-matrix/jsdoc-template/symbol.tmpl new file mode 100755 index 00000000..f8f4bd1f --- /dev/null +++ b/node_modules/gl-matrix/jsdoc-template/symbol.tmpl @@ -0,0 +1,35 @@ + + {+data.name+} + {+data.memberOf+} + {+data.isStatic+} + {+data.isa+} + {+data.desc+} + {+data.classDesc+} + + + + {+method.name+} + {+method.memberOf+} + {+method.isStatic+} + {+method.desc+} + + + {+param.type+} + {+param.name+} + {+param.desc+} + {+param.defaultValue+} + + + + + + + + {+property.name+} + {+property.memberOf+} + {+property.isStatic+} + {+property.desc+} + {+property.type+} + + + diff --git a/node_modules/gl-matrix/package.json b/node_modules/gl-matrix/package.json new file mode 100755 index 00000000..c8f9bbd8 --- /dev/null +++ b/node_modules/gl-matrix/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "gl-matrix@^2.3.2", + "scope": null, + "escapedName": "gl-matrix", + "name": "gl-matrix", + "rawSpec": "^2.3.2", + "spec": ">=2.3.2 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master" + ] + ], + "_from": "gl-matrix@>=2.3.2 <3.0.0", + "_id": "gl-matrix@2.3.2", + "_inCache": true, + "_location": "/gl-matrix", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/gl-matrix-2.3.2.tgz_1456349622726_0.2502399489749223" + }, + "_npmUser": { + "name": "toji", + "email": "tojiro@gmail.com" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "raw": "gl-matrix@^2.3.2", + "scope": null, + "escapedName": "gl-matrix", + "name": "gl-matrix", + "rawSpec": "^2.3.2", + "spec": ">=2.3.2 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-2.3.2.tgz", + "_shasum": "aac808c74af7d5db05fe04cb60ca1a0fcb174d74", + "_shrinkwrap": null, + "_spec": "gl-matrix@^2.3.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master", + "bugs": { + "url": "https://github.com/toji/gl-matrix/issues" + }, + "contributors": [ + { + "name": "Brandon Jones", + "email": "tojiro@gmail.com" + }, + { + "name": "Colin MacKenzie IV", + "email": "sinisterchipmunk@gmail.com" + } + ], + "dependencies": {}, + "description": "Javascript Matrix and Vector library for High Performance WebGL apps", + "devDependencies": { + "jasmine-node": "1.2.2", + "node-libs-browser": "^0.5.2", + "simd": "2.0.0", + "webpack": "^1.9.10" + }, + "directories": {}, + "dist": { + "shasum": "aac808c74af7d5db05fe04cb60ca1a0fcb174d74", + "tarball": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-2.3.2.tgz" + }, + "gitHead": "6723211d7adcde84f4b3f5cfc9c3f75eb8acaccb", + "homepage": "http://glmatrix.net", + "license": "MIT", + "main": "src/gl-matrix.js", + "maintainers": [ + { + "name": "toji", + "email": "tojiro@gmail.com" + }, + { + "name": "hughsk", + "email": "hughskennedy@gmail.com" + } + ], + "name": "gl-matrix", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/toji/gl-matrix.git" + }, + "scripts": { + "test": "jasmine-node spec" + }, + "version": "2.3.2" +} diff --git a/node_modules/gl-matrix/spec/gl-matrix/common-spec.js b/node_modules/gl-matrix/spec/gl-matrix/common-spec.js new file mode 100755 index 00000000..1bcd7814 --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/common-spec.js @@ -0,0 +1,27 @@ +/* +* common.js unit test +*/ + +describe("glMatrix", function(){ + var result; + + var glMatrix = require("../../src/gl-matrix/common.js"); + + describe("toRadian", function(){ + beforeEach(function(){ result = glMatrix.toRadian(180); }); + it("should return a value of 3.141592654(Math.PI)", function(){ expect(result).toBeEqualish(Math.PI); }); + }); + + describe("equals", function() { + var r0, r1, r2; + beforeEach(function() { + r0 = glMatrix.equals(1.0, 0.0); + r1 = glMatrix.equals(1.0, 1.0); + r2 = glMatrix.equals(1.0+glMatrix.EPSILON/2, 1.0); + }); + it("should return false for different numbers", function() { expect(r0).toBe(false); }); + it("should return true for the same number", function() { expect(r1).toBe(true); }); + it("should return true for numbers that are close", function() { expect(r2).toBe(true); }); + }); + +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/mat2-spec.js b/node_modules/gl-matrix/spec/gl-matrix/mat2-spec.js new file mode 100755 index 00000000..c116df6a --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/mat2-spec.js @@ -0,0 +1,354 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +describe("mat2", function() { + var mat2 = require("../../src/gl-matrix/mat2.js"); + + var out, matA, matB, identity, result; + + beforeEach(function() { + matA = [1, 2, + 3, 4]; + + matB = [5, 6, + 7, 8]; + + out = [0, 0, + 0, 0]; + + identity = [1, 0, + 0, 1]; + }); + + describe("create", function() { + beforeEach(function() { result = mat2.create(); }); + it("should return a 4 element array initialized to a 2x2 identity matrix", function() { expect(result).toBeEqualish(identity); }); + }); + + describe("clone", function() { + beforeEach(function() { result = mat2.clone(matA); }); + it("should return a 4 element array initialized to the values in matA", function() { expect(result).toBeEqualish(matA); }); + }); + + describe("copy", function() { + beforeEach(function() { result = mat2.copy(out, matA); }); + it("should place values into out", function() { expect(out).toBeEqualish(matA); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("identity", function() { + beforeEach(function() { result = mat2.identity(out); }); + it("should place values into out", function() { expect(result).toBeEqualish(identity); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("transpose", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.transpose(out, matA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 3, 2, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.transpose(matA, matA); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([1, 3, 2, 4]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("invert", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.invert(out, matA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-2, 1, 1.5, -0.5]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.invert(matA, matA); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([-2, 1, 1.5, -0.5]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("adjoint", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.adjoint(out, matA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([4, -2, -3, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.adjoint(matA, matA); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([4, -2, -3, 1]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("determinant", function() { + beforeEach(function() { result = mat2.determinant(matA); }); + + it("should return the determinant", function() { expect(result).toEqual(-2); }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(mat2.mul).toEqual(mat2.multiply); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.multiply(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([23, 34, 31, 46]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.multiply(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([23, 34, 31, 46]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2.multiply(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([23, 34, 31, 46]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("rotate", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.rotate(out, matA, Math.PI * 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4, -1, -2]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.rotate(matA, matA, Math.PI * 0.5); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([3, 4, -1, -2]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("scale", function() { + var vecA; + beforeEach(function() { vecA = [2, 3]; }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.scale(out, matA, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 9, 12]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.scale(matA, matA, vecA); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([2, 4, 9, 12]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("str", function() { + beforeEach(function() { result = mat2.str(matA); }); + + it("should return a string representation of the matrix", function() { expect(result).toEqual("mat2(1, 2, 3, 4)"); }); + }); + + describe("frob", function() { + beforeEach(function() { result = mat2.frob(matA); }); + it("should return the Frobenius Norm of the matrix", function() { expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2))); }); + }); + + describe("LDU", function() { + beforeEach(function() {L = mat2.create(); D = mat2.create(); U = mat2.create(); result = mat2.LDU(L, D, U, [4,3,6,3]); + L_result = mat2.create(); L_result[2] = 1.5; + D_result = mat2.create(); + U_result = mat2.create(); + U_result[0] = 4; U_result[1] = 3; U_result[3] = -1.5; + }); + it("should return a lower triangular, a diagonal and an upper triangular matrix", function() { + expect(result[0]).toBeEqualish(L_result); + expect(result[1]).toBeEqualish(D_result); + expect(result[2]).toBeEqualish(U_result); + }); + }); + + describe("add", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.add(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([6, 8, 10, 12]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.add(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([6, 8, 10, 12]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2.add(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([6, 8, 10, 12]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("subtract", function() { + it("should have an alias called 'sub'", function() { expect(mat2.sub).toEqual(mat2.subtract); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.subtract(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-4, -4, -4, -4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.subtract(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([-4, -4, -4, -4]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2.subtract(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([-4, -4, -4, -4]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = mat2.fromValues(1, 2, 3, 4); }); + it("should return a 4 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("set", function() { + beforeEach(function() { result = mat2.set(out, 1, 2, 3, 4); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("multiplyScalar", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.multiplyScalar(out, matA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 6, 8]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.multiplyScalar(matA, matA, 2); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([2, 4, 6, 8]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("multiplyScalarAndAdd", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3.5, 5, 6.5, 8]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([3.5, 5, 6.5, 8]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([3.5, 5, 6.5, 8]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("exactEquals", function() { + var matC, r0, r1, r2; + beforeEach(function() { + matA = [0, 1, 2, 3]; + matB = [0, 1, 2, 3]; + matC = [1, 2, 3, 4]; + r0 = mat2.exactEquals(matA, matB); + r1 = mat2.exactEquals(matA, matC); + }); + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3]); }); + }); + + describe("equals", function() { + var matC, matD, r0, r1, r2; + beforeEach(function() { + matA = [0, 1, 2, 3]; + matB = [0, 1, 2, 3]; + matC = [1, 2, 3, 4]; + matD = [1e-16, 1, 2, 3]; + r0 = mat2.equals(matA, matB); + r1 = mat2.equals(matA, matC); + r2 = mat2.equals(matA, matD); + }); + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical matrices", function() { expect(r2).toBe(true); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3]); }); + }); + +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/mat2d-spec.js b/node_modules/gl-matrix/spec/gl-matrix/mat2d-spec.js new file mode 100755 index 00000000..96da8fd2 --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/mat2d-spec.js @@ -0,0 +1,339 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +describe("mat2d", function() { + var mat2d = require("../../src/gl-matrix/mat2d.js"); + + var out, matA, matB, identity, result; + + beforeEach(function() { + matA = [1, 2, + 3, 4, + 5, 6]; + + oldA = [1, 2, + 3, 4, + 5, 6]; + + matB = [7, 8, + 9, 10, + 11, 12]; + + oldB = [7, 8, + 9, 10, + 11, 12]; + + out = [0, 0, + 0, 0, + 0, 0]; + + identity = [1, 0, + 0, 1, + 0, 0]; + }); + + describe("create", function() { + beforeEach(function() { result = mat2d.create(); }); + it("should return a 6 element array initialized to a 2x3 identity matrix", function() { expect(result).toBeEqualish(identity); }); + }); + + describe("clone", function() { + beforeEach(function() { result = mat2d.clone(matA); }); + it("should return a 6 element array initialized to the values in matA", function() { expect(result).toBeEqualish(matA); }); + }); + + describe("copy", function() { + beforeEach(function() { result = mat2d.copy(out, matA); }); + it("should place values into out", function() { expect(out).toBeEqualish(matA); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("identity", function() { + beforeEach(function() { result = mat2d.identity(out); }); + it("should place values into out", function() { expect(result).toBeEqualish(identity); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("invert", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.invert(out, matA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([ -2, 1, 1.5, -0.5, 1, -2 ]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.invert(matA, matA); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([ -2, 1, 1.5, -0.5, 1, -2 ]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("determinant", function() { + beforeEach(function() { result = mat2d.determinant(matA); }); + + it("should return the determinant", function() { expect(result).toEqual(-2); }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(mat2d.mul).toEqual(mat2d.multiply); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.multiply(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([31, 46, 39, 58, 52, 76]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish(oldB); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.multiply(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([31, 46, 39, 58, 52, 76]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish(oldB); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2d.multiply(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([31, 46, 39, 58, 52, 76]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + }); + }); + + describe("rotate", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.rotate(out, matA, Math.PI * 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4, -1, -2, 5, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.rotate(matA, matA, Math.PI * 0.5); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([3, 4, -1, -2, 5, 6]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("scale", function() { + var vecA; + beforeEach(function() { vecA = [2, 3]; }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.scale(out, matA, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 9, 12, 5, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.scale(matA, matA, vecA); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([2, 4, 9, 12, 5, 6]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("translate", function() { + var vecA; + beforeEach(function() { vecA = [2, 3]; }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.translate(out, matA, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4, 16, 22]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.translate(matA, matA, vecA); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 16, 22]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("str", function() { + beforeEach(function() { result = mat2d.str(matA); }); + + it("should return a string representation of the matrix", function() { expect(result).toEqual("mat2d(1, 2, 3, 4, 5, 6)"); }); + }); + + describe("frob", function() { + beforeEach(function() { result = mat2d.frob(matA); }); + it("should return the Frobenius Norm of the matrix", function() { expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) + Math.pow(4, 2) + Math.pow(5, 2) + Math.pow(6, 2) + 1)); }); + }); + + describe("add", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.add(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([8, 10, 12, 14, 16, 18]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish(oldB); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.add(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([8, 10, 12, 14, 16, 18]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish(oldB); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2d.add(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([8, 10, 12, 14, 16, 18]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + }); + }); + + describe("subtract", function() { + it("should have an alias called 'sub'", function() { expect(mat2d.sub).toEqual(mat2d.subtract); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.subtract(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-6, -6, -6, -6, -6, -6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish(oldB); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.subtract(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([-6, -6, -6, -6, -6, -6]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish(oldB); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2d.subtract(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([-6, -6, -6, -6, -6, -6]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish(oldA); }); + }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = mat2d.fromValues(1, 2, 3, 4, 5, 6); }); + it("should return a 6 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2, 3, 4, 5, 6]); }); + }); + + describe("set", function() { + beforeEach(function() { result = mat2d.set(out, 1, 2, 3, 4, 5, 6); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4, 5, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("multiplyScalar", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.multiplyScalar(out, matA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 6, 8, 10, 12]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.multiplyScalar(matA, matA, 2); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([2, 4, 6, 8, 10, 12]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("multiplyScalarAndAdd", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat2d.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([4.5, 6, 7.5, 9, 10.5, 12]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([7, 8, 9, 10, 11, 12]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat2d.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([4.5, 6, 7.5, 9, 10.5, 12]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([7, 8, 9, 10, 11, 12]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat2d.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([4.5, 6, 7.5, 9, 10.5, 12]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6]); }); + }); + }); + + describe("exactEquals", function() { + var matC, r0, r1; + beforeEach(function() { + matA = [0, 1, 2, 3, 4, 5]; + matB = [0, 1, 2, 3, 4, 5]; + matC = [1, 2, 3, 4, 5, 6]; + r0 = mat2d.exactEquals(matA, matB); + r1 = mat2d.exactEquals(matA, matC); + }); + + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3, 4, 5]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3, 4, 5]); }); + }); + + describe("equals", function() { + var matC, matD, r0, r1, r2; + beforeEach(function() { + matA = [0, 1, 2, 3, 4, 5]; + matB = [0, 1, 2, 3, 4, 5]; + matC = [1, 2, 3, 4, 5, 6]; + matD = [1e-16, 1, 2, 3, 4, 5]; + r0 = mat2d.equals(matA, matB); + r1 = mat2d.equals(matA, matC); + r2 = mat2d.equals(matA, matD); + }); + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical matrices", function() { expect(r2).toBe(true); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3, 4, 5]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3, 4, 5]); }); + }); + +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/mat3-spec.js b/node_modules/gl-matrix/spec/gl-matrix/mat3-spec.js new file mode 100755 index 00000000..1af462a1 --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/mat3-spec.js @@ -0,0 +1,509 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +describe("mat3", function() { + var mat3 = require("../../src/gl-matrix/mat3.js"); + var mat4 = require("../../src/gl-matrix/mat4.js"); + var vec3 = require("../../src/gl-matrix/vec3.js"); + + var out, matA, matB, identity, result; + + beforeEach(function() { + matA = [1, 0, 0, + 0, 1, 0, + 1, 2, 1]; + + matB = [1, 0, 0, + 0, 1, 0, + 3, 4, 1]; + + out = [0, 0, 0, + 0, 0, 0, + 0, 0, 0]; + + identity = [1, 0, 0, + 0, 1, 0, + 0, 0, 1]; + }); + + describe("normalFromMat4", function() { + beforeEach(function() { + matA = [1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]; + result = mat3.normalFromMat4(out, matA); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + describe("with translation and rotation", function() { + beforeEach(function() { + mat4.translate(matA, matA, [2, 4, 6]); + mat4.rotateX(matA, matA, Math.PI / 2); + + result = mat3.normalFromMat4(out, matA); + }); + + it("should give rotated matrix", function() { + expect(result).toBeEqualish([1, 0, 0, + 0, 0, 1, + 0,-1, 0]); + }); + + describe("and scale", function() { + beforeEach(function() { + mat4.scale(matA, matA, [2, 3, 4]); + + result = mat3.normalFromMat4(out, matA); + }); + + it("should give rotated matrix", function() { + expect(result).toBeEqualish([0.5, 0, 0, + 0, 0, 0.333333, + 0, -0.25, 0]); + }); + }); + }); + }); + + describe("fromQuat", function() { + var q; + + beforeEach(function() { + q = [ 0, -0.7071067811865475, 0, 0.7071067811865475 ]; + result = mat3.fromQuat(out, q); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("should rotate a vector the same as the original quat", function() { + expect(vec3.transformMat3([], [0,0,-1], out)).toBeEqualish(vec3.transformQuat([], [0,0,-1], q)); + }); + + it("should rotate a vector by PI/2 radians", function() { + expect(vec3.transformMat3([], [0,0,-1], out)).toBeEqualish([1,0,0]); + }); + }); + + describe("fromMat4", function() { + beforeEach(function() { + result = mat3.fromMat4(out, [ 1, 2, 3, 4, + 5, 6, 7, 8, + 9,10,11,12, + 13,14,15,16]); }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("should calculate proper mat3", function() { + expect(out).toBeEqualish([ 1, 2, 3, + 5, 6, 7, + 9,10,11]); + }); + }); + + describe("scale", function() { + beforeEach(function() { result = mat3.scale(out, matA, [2,2]); }); + it("should return out", function() { expect(result).toBe(out); }); + it('should place proper values in out', function() { + expect(out).toBeEqualish([ 2, 0, 0, + 0, 2, 0, + 1, 2, 1 ]); + }); + }); + + describe("create", function() { + beforeEach(function() { result = mat3.create(); }); + it("should return a 9 element array initialized to a 3x3 identity matrix", function() { expect(result).toBeEqualish(identity); }); + }); + + describe("clone", function() { + beforeEach(function() { result = mat3.clone(matA); }); + it("should return a 9 element array initialized to the values in matA", function() { expect(result).toBeEqualish(matA); }); + }); + + describe("copy", function() { + beforeEach(function() { result = mat3.copy(out, matA); }); + it("should place values into out", function() { expect(out).toBeEqualish(matA); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("identity", function() { + beforeEach(function() { result = mat3.identity(out); }); + it("should place values into out", function() { expect(result).toBeEqualish(identity); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("transpose", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.transpose(out, matA); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 1, + 0, 1, 2, + 0, 0, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.transpose(matA, matA); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 1, + 0, 1, 2, + 0, 0, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("invert", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.invert(out, matA); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.invert(matA, matA); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("adjoint", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.adjoint(out, matA); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.adjoint(matA, matA); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + -1, -2, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("determinant", function() { + beforeEach(function() { result = mat3.determinant(matA); }); + + it("should return the determinant", function() { expect(result).toEqual(1); }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(mat3.mul).toEqual(mat3.multiply); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.multiply(out, matA, matB); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ]); + }); + it("should not modify matB", function() { + expect(matB).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 3, 4, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.multiply(matA, matA, matB); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { + expect(matB).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 3, 4, 1 + ]); + }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat3.multiply(matB, matA, matB); }); + + it("should place values into matB", function() { + expect(matB).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 4, 6, 1 + ]); + }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, + 0, 1, 0, + 1, 2, 1 + ]); + }); + }); + }); + + describe("str", function() { + beforeEach(function() { result = mat3.str(matA); }); + + it("should return a string representation of the matrix", function() { expect(result).toEqual("mat3(1, 0, 0, 0, 1, 0, 1, 2, 1)"); }); + }); + + describe("frob", function() { + beforeEach(function() { result = mat3.frob(matA); }); + it("should return the Frobenius Norm of the matrix", function() { expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(0, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(1, 2))); }); + }); + + describe("add", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + describe("with a separate output matrix", function() { + beforeEach(function() { + result = mat3.add(out, matA, matB); + }); + + it("should place values into out", function() { expect(out).toBeEqualish([11, 13, 15, 17, 19, 21, 23, 25, 27]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([10, 11, 12, 13, 14, 15, 16, 17, 18]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.add(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([11, 13, 15, 17, 19, 21, 23, 25, 27]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([10, 11, 12, 13, 14, 15, 16, 17, 18]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat3.add(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([11, 13, 15, 17, 19, 21, 23, 25, 27]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + }); + }); + + describe("subtract", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + it("should have an alias called 'sub'", function() { expect(mat3.sub).toEqual(mat3.subtract); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.subtract(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-9, -9, -9, -9, -9, -9, -9, -9, -9]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([10, 11, 12, 13, 14, 15, 16, 17, 18]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.subtract(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([-9, -9, -9, -9, -9, -9, -9, -9, -9]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([10, 11, 12, 13, 14, 15, 16, 17, 18]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat3.subtract(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([-9, -9, -9, -9, -9, -9, -9, -9, -9]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = mat3.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9); }); + it("should return a 9 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + }); + + describe("set", function() { + beforeEach(function() { result = mat3.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("multiplyScalar", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + }); + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalar(out, matA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 6, 8, 10, 12, 14, 16, 18]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalar(matA, matA, 2); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([2, 4, 6, 8, 10, 12, 14, 16, 18]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("multiplyScalarAndAdd", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matB = [10, 11, 12, 13, 14, 15, 16, 17, 18]; + }); + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([10, 11, 12, 13, 14, 15, 16, 17, 18]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([10, 11, 12, 13, 14, 15, 16, 17, 18]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([6, 7.5, 9, 10.5, 12, 13.5, 15, 16.5, 18]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9]); }); + }); + }); + + describe("exactEquals", function() { + var matC, r0, r1; + beforeEach(function() { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + r0 = mat3.exactEquals(matA, matB); + r1 = mat3.exactEquals(matA, matC); + }); + + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8]); }); + }); + + describe("equals", function() { + var matC, matD, r0, r1, r2; + beforeEach(function() { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9]; + matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8]; + r0 = mat3.equals(matA, matB); + r1 = mat3.equals(matA, matC); + r2 = mat3.equals(matA, matD); + }); + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical matrices", function() { expect(r2).toBe(true); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8]); }); + }); + +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/mat4-spec.js b/node_modules/gl-matrix/spec/gl-matrix/mat4-spec.js new file mode 100755 index 00000000..a7c6051b --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/mat4-spec.js @@ -0,0 +1,900 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("../../src/gl-matrix/common.js"); +var mat4 = require("../../src/gl-matrix/mat4.js"); +var vec3 = require("../../src/gl-matrix/vec3.js"); +var quat = require("../../src/gl-matrix/quat.js"); + +// Inject the polyfill for testing +if (!glMatrix.SIMD_AVAILABLE) { + require("simd").shim(); +} + +function buildMat4Tests(useSIMD) { + mat4.TEST_PATH = useSIMD ? mat4.SIMD : mat4.scalar; + + return function() { + var out, matA, matB, identity, result; + + beforeEach(function() { + // Attempting to portray a semi-realistic transform matrix + matA = new Float32Array([1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1]); + + matB = new Float32Array([1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1]); + + out = new Float32Array([0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0]); + + identity = new Float32Array([1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1]); + }); + + describe("create", function() { + beforeEach(function() { result = mat4.create(); }); + it("should return a 16 element array initialized to a 4x4 identity matrix", function() { expect(result).toBeEqualish(identity); }); + }); + + describe("clone", function() { + beforeEach(function() { result = mat4.clone(matA); }); + it("should return a 16 element array initialized to the values in matA", function() { expect(result).toBeEqualish(matA); }); + }); + + describe("copy", function() { + beforeEach(function() { result = mat4.copy(out, matA); }); + it("should place values into out", function() { expect(out).toBeEqualish(matA); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("identity", function() { + beforeEach(function() { result = mat4.identity(out); }); + it("should place values into out", function() { expect(result).toBeEqualish(identity); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("transpose", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.transpose(out, matA); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, 1, + 0, 1, 0, 2, + 0, 0, 1, 3, + 0, 0, 0, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.transpose(matA, matA); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 1, + 0, 1, 0, 2, + 0, 0, 1, 3, + 0, 0, 0, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("invert", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.invert(out, matA); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.invert(matA, matA); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("adjoint", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.adjoint(out, matA); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.adjoint(matA, matA); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -1, -2, -3, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("determinant", function() { + beforeEach(function() { result = mat4.determinant(matA); }); + + it("should return the determinant", function() { expect(result).toEqual(1); }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(mat4.mul).toEqual(mat4.multiply); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.multiply(out, matA, matB); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + it("should not modify matB", function() { + expect(matB).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.multiply(matA, matA, matB); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { + expect(matB).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 4, 5, 6, 1 + ]); + }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.multiply(matB, matA, matB); }); + + it("should place values into matB", function() { + expect(matB).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + ]); + }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + }); + + describe("translate", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.translate(out, matA, [4, 5, 6]); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.translate(matA, matA, [4, 5, 6]); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 5, 7, 9, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("scale", function() { + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.scale(out, matA, [4, 5, 6]); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 4, 0, 0, 0, + 0, 5, 0, 0, + 0, 0, 6, 0, + 1, 2, 3, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.scale(matA, matA, [4, 5, 6]); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 4, 0, 0, 0, + 0, 5, 0, 0, + 0, 0, 6, 0, + 1, 2, 3, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("rotate", function() { + var rad = Math.PI * 0.5; + var axis = [1, 0, 0]; + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.rotate(out, matA, rad, axis); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.rotate(matA, matA, rad, axis); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("rotateX", function() { + var rad = Math.PI * 0.5; + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.rotateX(out, matA, rad); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.rotateX(matA, matA, rad); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, Math.cos(rad), Math.sin(rad), 0, + 0, -Math.sin(rad), Math.cos(rad), 0, + 1, 2, 3, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("rotateY", function() { + var rad = Math.PI * 0.5; + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.rotateY(out, matA, rad); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + Math.cos(rad), 0, -Math.sin(rad), 0, + 0, 1, 0, 0, + Math.sin(rad), 0, Math.cos(rad), 0, + 1, 2, 3, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.rotateY(matA, matA, rad); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + Math.cos(rad), 0, -Math.sin(rad), 0, + 0, 1, 0, 0, + Math.sin(rad), 0, Math.cos(rad), 0, + 1, 2, 3, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("rotateZ", function() { + var rad = Math.PI * 0.5; + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.rotateZ(out, matA, rad); }); + + it("should place values into out", function() { + expect(out).toBeEqualish([ + Math.cos(rad), Math.sin(rad), 0, 0, + -Math.sin(rad), Math.cos(rad), 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { + expect(matA).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat4.TEST_PATH.rotateZ(matA, matA, rad); }); + + it("should place values into matA", function() { + expect(matA).toBeEqualish([ + Math.cos(rad), Math.sin(rad), 0, 0, + -Math.sin(rad), Math.cos(rad), 0, 0, + 0, 0, 1, 0, + 1, 2, 3, 1 + ]); + }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + // TODO: fromRotationTranslation + + describe("getTranslation", function() { + describe("from the identity matrix", function() { + beforeEach(function() { + result = vec3.fromValues(1, 2, 3); + out = vec3.fromValues(1, 2, 3); + result = mat4.getTranslation(out, identity); + }); + it("should place result both in result and out", function() { expect(result).toBe(out); }); + it("should return the zero vector", function() { expect(result).toBeEqualish([0, 0, 0]); }); + }); + + describe("from a translation-only matrix", function() { + beforeEach(function() { + result = vec3.fromValues(1, 2, 3); + out = vec3.fromValues(1, 2, 3); + result = mat4.getTranslation(out, matB); + }); + it("should return translation vector", function() { expect(out).toBeEqualish([4, 5, 6]); }); + }); + + describe("from a translation and rotation matrix", function() { + beforeEach(function() { + var q = quat.create(); + var v = vec3.fromValues(5, 6, 7); + q = quat.setAxisAngle(q, [0.26726124, 0.534522474, 0.8017837], 0.55); + mat4.fromRotationTranslation(out, q, v); + + result = vec3.create(); + mat4.getTranslation(result, out); + }); + it("should keep the same translation vector, regardless of rotation", function() { + expect(result).toBeEqualish([5, 6, 7]); + }); + }); + }); + + describe("getRotation", function() { + describe("from the identity matrix", function() { + beforeEach(function() { + result = quat.fromValues(1, 2, 3, 4); + out = quat.fromValues(1, 2, 3, 4); + result = mat4.getRotation(out, identity); + }); + it("should place result both in result and out", function() { expect(result).toBe(out); }); + it("should return the unit quaternion", function() { + var unitQuat = quat.create(); + quat.identity(unitQuat); + expect(result).toBeEqualish(unitQuat); + }); + }); + + describe("from a translation-only matrix", function() { + beforeEach(function() { + result = quat.fromValues(1, 2, 3, 4); + out = quat.fromValues(1, 2, 3, 4); + result = mat4.getRotation(out, matB); + }); + it("should return the unit quaternion", function() { + var unitQuat = quat.create(); + quat.identity(unitQuat); + expect(result).toBeEqualish(unitQuat); + }); + }); + + describe("from a translation and rotation matrix", function() { + it("should keep the same rotation as when created", function() { + var q = quat.create(); + var outVec = vec3.fromValues(5, 6, 7); + var testVec = vec3.fromValues(1, 5, 2); + var ang = 0.78972; + + vec3.normalize(testVec, testVec); + q = quat.setAxisAngle(q, testVec, ang); + mat4.fromRotationTranslation(out, q, outVec); + + result = quat.fromValues(2, 3, 4, 6); + mat4.getRotation(result, out); + var outaxis = vec3.create(); + var outangle = quat.getAxisAngle(outaxis, result); + + expect(outaxis).toBeEqualish(testVec); + expect(outangle).toBeEqualish(ang); + }); + }); + }); + + describe("frustum", function() { + beforeEach(function() { result = mat4.frustum(out, -1, 1, -1, 1, -1, 1); }); + it("should place values into out", function() { expect(result).toBeEqualish([ + -1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 0, -1, + 0, 0, 1, 0 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("perspective", function() { + var fovy = Math.PI * 0.5; + beforeEach(function() { result = mat4.perspective(out, fovy, 1, 0, 1); }); + it("should place values into out", function() { expect(result).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1, -1, + 0, 0, 0, 0 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + + describe("with nonzero near, 45deg fovy, and realistic aspect ratio", function() { + beforeEach(function() { result = mat4.perspective(out, 45 * Math.PI / 180.0, 640/480, 0.1, 200); }); + it("should calculate correct matrix", function() { expect(result).toBeEqualish([ + 1.81066, 0, 0, 0, + 0, 2.414213, 0, 0, + 0, 0, -1.001, -1, + 0, 0, -0.2001, 0 + ]); }); + }); + }); + + describe("ortho", function() { + beforeEach(function() { result = mat4.ortho(out, -1, 1, -1, 1, -1, 1); }); + it("should place values into out", function() { expect(result).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1, 0, + 0, 0, 0, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("lookAt", function() { + var eye = new Float32Array([0, 0, 1]); + var center = new Float32Array([0, 0, -1]); + var up = new Float32Array([0, 1, 0]); + var view, up, right; + + describe("looking down", function() { + beforeEach(function() { + view = new Float32Array([0, -1, 0]); + up = new Float32Array([0, 0, -1]); + right= new Float32Array([1, 0, 0]); + result = mat4.lookAt(out, [0, 0, 0], view, up); + }); + + it("should transform view into local -Z", function() { + result = vec3.transformMat4(new Float32Array(3), view, out); + expect(result).toBeEqualish([0, 0, -1]); + }); + + it("should transform up into local +Y", function() { + result = vec3.transformMat4(new Float32Array(3), up, out); + expect(result).toBeEqualish([0, 1, 0]); + }); + + it("should transform right into local +X", function() { + result = vec3.transformMat4(new Float32Array(3), right, out); + expect(result).toBeEqualish([1, 0, 0]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("#74", function() { + beforeEach(function() { + mat4.lookAt(out, + new Float32Array([0,2,0]), + new Float32Array([0,0.6,0]), + new Float32Array([0,0,-1])); + }); + + it("should transform a point 'above' into local +Y", function() { + result = vec3.transformMat4(new Float32Array(3), [0, 2, -1], out); + expect(result).toBeEqualish([0, 1, 0]); + }); + + it("should transform a point 'right of' into local +X", function() { + result = vec3.transformMat4(new Float32Array(3), [1, 2, 0], out); + expect(result).toBeEqualish([1, 0, 0]); + }); + + it("should transform a point 'in front of' into local -Z", function() { + result = vec3.transformMat4(new Float32Array(3), [0, 1, 0], out); + expect(result).toBeEqualish([0, 0, -1]); + }); + }); + + beforeEach(function() { + eye = new Float32Array([0, 0, 1]); + center = new Float32Array([0, 0, -1]); + up = new Float32Array([0, 1, 0]); + result = mat4.lookAt(out, eye, center, up); + }); + it("should place values into out", function() { expect(result).toBeEqualish([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, -1, 1 + ]); + }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("str", function() { + beforeEach(function() { result = mat4.str(matA); }); + + it("should return a string representation of the matrix", function() { expect(result).toEqual("mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)"); }); + }); + + describe("frob", function() { + beforeEach(function() { result = mat4.frob(matA); }); + it("should return the Frobenius Norm of the matrix", function() { expect(result).toEqual( Math.sqrt(Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(1, 2) + Math.pow(2, 2) + Math.pow(3, 2) )); }); + }); + }; + + describe("add", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + describe("with a separate output matrix", function() { + beforeEach(function() { + result = mat3.add(out, matA, matB); + }); + + it("should place values into out", function() { expect(out).toBeEqualish([18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.add(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat3.add(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + }); + }); + + describe("subtract", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + it("should have an alias called 'sub'", function() { expect(mat3.sub).toEqual(mat3.subtract); }); + + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.subtract(out, matA, matB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.subtract(matA, matA, matB); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat3.subtract(matB, matA, matB); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([-16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, -16]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = mat4.fromValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); + it("should return a 16 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + }); + + describe("set", function() { + beforeEach(function() { result = mat4.set(out, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("multiplyScalar", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + }); + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalar(out, matA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalar(matA, matA, 2); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + }); + }); + + describe("multiplyScalarAndAdd", function() { + beforeEach(function() { + matA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matB = [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; + }); + describe("with a separate output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalarAndAdd(out, matA, matB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); }); + }); + + describe("when matA is the output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalarAndAdd(matA, matA, matB, 0.5); }); + + it("should place values into matA", function() { expect(matA).toBeEqualish([9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32]); }); + it("should return matA", function() { expect(result).toBe(matA); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); }); + }); + + describe("when matB is the output matrix", function() { + beforeEach(function() { result = mat3.multiplyScalarAndAdd(matB, matA, matB, 0.5); }); + + it("should place values into matB", function() { expect(matB).toBeEqualish([9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32]); }); + it("should return matB", function() { expect(result).toBe(matB); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); }); + }); + }); + + describe("exactEquals", function() { + var matC, r0, r1; + beforeEach(function() { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + r0 = mat4.exactEquals(matA, matB); + r1 = mat4.exactEquals(matA, matC); + }); + + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); }); + }); + + describe("equals", function() { + var matC, matD, r0, r1, r2; + beforeEach(function() { + matA = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matB = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + matC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + matD = [1e-16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + r0 = mat4.equals(matA, matB); + r1 = mat4.equals(matA, matC); + r2 = mat4.equals(matA, matD); + }); + it("should return true for identical matrices", function() { expect(r0).toBe(true); }); + it("should return false for different matrices", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical matrices", function() { expect(r2).toBe(true); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); }); + it("should not modify matB", function() { expect(matB).toBeEqualish([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); }); + }); +} + +describe("mat4 (SISD)", buildMat4Tests(false)); +describe("mat4 (SIMD)", buildMat4Tests(true)); diff --git a/node_modules/gl-matrix/spec/gl-matrix/quat-spec.js b/node_modules/gl-matrix/spec/gl-matrix/quat-spec.js new file mode 100755 index 00000000..ec4c0375 --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/quat-spec.js @@ -0,0 +1,634 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +describe("quat", function() { + var mat3 = require("../../src/gl-matrix/mat3.js"); + var mat4 = require("../../src/gl-matrix/mat4.js"); + var quat = require("../../src/gl-matrix/quat.js"); + var vec3 = require("../../src/gl-matrix/vec3.js"); + + var out, quatA, quatB, result; + var vec, id, deg90; + + beforeEach(function() { + quatA = [1, 2, 3, 4]; + quatB = [5, 6, 7, 8]; + out = [0, 0, 0, 0]; + vec = [1, 1, -1]; + id = [0, 0, 0, 1]; + deg90 = Math.PI / 2; + }); + + describe("slerp", function() { + describe("the normal case", function() { + beforeEach(function() { + result = quat.slerp(out, [0, 0, 0, 1], [0, 1, 0, 0], 0.5); + }); + + it("should return out", function() { expect(result).toBe(out); }); + it("should calculate proper quat", function() { + expect(result).toBeEqualish([0, 0.707106, 0, 0.707106]); + }); + }); + + describe("where a == b", function() { + beforeEach(function() { + result = quat.slerp(out, [0, 0, 0, 1], [0, 0, 0, 1], 0.5); + }); + + it("should return out", function() { expect(result).toBe(out); }); + it("should calculate proper quat", function() { + expect(result).toBeEqualish([0, 0, 0, 1]); + }); + }); + + describe("where theta == 180deg", function() { + beforeEach(function() { + quat.rotateX(quatA, [1,0,0,0], Math.PI); // 180 deg + result = quat.slerp(out, [1,0,0,0], quatA, 1); + }); + + it("should calculate proper quat", function() { + expect(result).toBeEqualish([0,0,0,-1]); + }); + }); + + describe("where a == -b", function() { + beforeEach(function() { + result = quat.slerp(out, [1, 0, 0, 0], [-1, 0, 0, 0], 0.5); + }); + + it("should return out", function() { expect(result).toBe(out); }); + it("should calculate proper quat", function() { + expect(result).toBeEqualish([1, 0, 0, 0]); + }); + }); + }); + + describe("rotateX", function() { + beforeEach(function() { + result = quat.rotateX(out, id, deg90); + }); + + it("should return out", function() { expect(result).toBe(out); }); + it("should transform vec accordingly", function() { + vec3.transformQuat(vec, [0,0,-1], out); + expect(vec).toBeEqualish([0, 1, 0]); + }); + }); + + describe("rotateY", function() { + beforeEach(function() { + result = quat.rotateY(out, id, deg90); + }); + + it("should return out", function() { expect(result).toBe(out); }); + it("should transform vec accordingly", function() { + vec3.transformQuat(vec, [0,0,-1], out); + expect(vec).toBeEqualish([-1, 0, 0]); + }); + }); + + describe("rotateZ", function() { + beforeEach(function() { + result = quat.rotateZ(out, id, deg90); + }); + + it("should return out", function() { expect(result).toBe(out); }); + it("should transform vec accordingly", function() { + vec3.transformQuat(vec, [0,1,0], out); + expect(vec).toBeEqualish([-1, 0, 0]); + }); + }); + + describe("fromMat3", function() { + var matr; + + describe("legacy", function() { + beforeEach(function() { + matr = [ 1, 0, 0, + 0, 0, -1, + 0, 1, 0 ]; + result = quat.fromMat3(out, matr); + }); + + it("should set dest to the correct value", function() { + expect(result).toBeEqualish([-0.707106, 0, 0, 0.707106]); + }); + }); + + describe("where trace > 0", function() { + beforeEach(function() { + matr = [ 1, 0, 0, + 0, 0, -1, + 0, 1, 0 ]; + result = quat.fromMat3(out, matr); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("should produce the correct transformation", function() { + expect(vec3.transformQuat([], [0,1,0], out)).toBeEqualish([0,0,-1]); + }); + }); + + describe("from a normal matrix looking 'backward'", function() { + beforeEach(function() { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt(mat4.create(), [0, 0, 0], [0, 0, 1], [0, 1, 0])))); + result = quat.fromMat3(out, matr); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("should produce the same transformation as the given matrix", function() { + expect(vec3.transformQuat([], [3,2,-1], quat.normalize(out, out))).toBeEqualish(vec3.transformMat3([], [3,2,-1], matr)); + }); + }); + + describe("from a normal matrix looking 'left' and 'upside down'", function() { + beforeEach(function() { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt(mat4.create(), [0, 0, 0], [-1, 0, 0], [0, -1, 0])))); + result = quat.fromMat3(out, matr); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("should produce the same transformation as the given matrix", function() { + expect(vec3.transformQuat([], [3,2,-1], quat.normalize(out, out))).toBeEqualish(vec3.transformMat3([], [3,2,-1], matr)); + }); + }); + + describe("from a normal matrix looking 'upside down'", function() { + beforeEach(function() { + matr = mat3.create(); + mat3.transpose(matr, mat3.invert(matr, mat3.fromMat4(matr, mat4.lookAt(mat4.create(), [0, 0, 0], [0, 0, -1], [0, -1, 0])))); + result = quat.fromMat3(out, matr); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("should produce the same transformation as the given matrix", function() { + expect(vec3.transformQuat([], [3,2,-1], quat.normalize(out, out))).toBeEqualish(vec3.transformMat3([], [3,2,-1], matr)); + }); + }); + }); + + describe("setAxes", function() { + var r; + beforeEach(function() { r = vec3.create(); }); + + describe("looking left", function() { + var view, up, right; + beforeEach(function() { + view = [-1, 0, 0]; + up = [ 0, 1, 0]; + right= [ 0, 0,-1]; + result = quat.setAxes([], view, right, up); + }); + + it("should transform local view into world left", function() { + r = vec3.transformQuat([], [0,0,-1], result); + expect(r).toBeEqualish([1, 0, 0]); + }); + + it("should transform local right into world front", function() { + r = vec3.transformQuat([], [1,0,0], result); + expect(r).toBeEqualish([0, 0, 1]); + }); + }); + + describe("given opengl defaults", function() { + var view, up, right; + beforeEach(function() { + view = [0, 0, -1]; + up = [0, 1, 0]; + right= [1, 0, 0]; + result = quat.setAxes(out, view, right, up); + }); + + it("should return out", function() { + expect(result).toBe(out); + }); + + it("should produce identity", function() { + expect(out).toBeEqualish([0, 0, 0, 1]); + }); + }); + + describe("legacy example", function() { + var view, up, right; + beforeEach(function() { + right= [1, 0, 0]; + up = [0, 0, 1]; + view = [0, -1, 0]; + result = quat.setAxes(out, view, right, up); + }); + + xit("should set correct quat4 values", function() { + expect(result).toBeEqualish([0.707106, 0, 0, 0.707106]); + }); + }); + }); + + describe("rotationTo", function() { + var r; + beforeEach(function() { r = vec3.create(); }); + + describe("at right angle", function() { + beforeEach(function() { + result = quat.rotationTo(out, [0, 1, 0], [1, 0, 0]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("should calculate proper quaternion", function() { + expect(out).toBeEqualish([0, 0, -0.707106, 0.707106]); + }); + }); + + describe("when vectors are parallel", function() { + beforeEach(function() { + result = quat.rotationTo(out, [0, 1, 0], [0, 1, 0]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("multiplying A should produce B", function() { + expect(vec3.transformQuat(r, [0, 1, 0], out)).toBeEqualish([0, 1, 0]); + }); + }); + + describe("when vectors are opposed X", function() { + beforeEach(function() { + result = quat.rotationTo(out, [1, 0, 0], [-1, 0, 0]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("multiplying A should produce B", function() { + expect(vec3.transformQuat(r, [1, 0, 0], out)).toBeEqualish([-1, 0, 0]); + }); + }); + + describe("when vectors are opposed Y", function() { + beforeEach(function() { + result = quat.rotationTo(out, [0, 1, 0], [0, -1, 0]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("multiplying A should produce B", function() { + expect(vec3.transformQuat(r, [0, 1, 0], out)).toBeEqualish([0, -1, 0]); + }); + }); + + describe("when vectors are opposed Z", function() { + beforeEach(function() { + result = quat.rotationTo(out, [0, 0, 1], [0, 0, -1]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + + it("multiplying A should produce B", function() { + expect(vec3.transformQuat(r, [0, 0, 1], out)).toBeEqualish([0, 0, -1]); + }); + }); + }); + + describe("create", function() { + beforeEach(function() { result = quat.create(); }); + it("should return a 4 element array initialized to an identity quaternion", function() { expect(result).toBeEqualish([0, 0, 0, 1]); }); + }); + + describe("clone", function() { + beforeEach(function() { result = quat.clone(quatA); }); + it("should return a 4 element array initialized to the values in quatA", function() { expect(result).toBeEqualish(quatA); }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = quat.fromValues(1, 2, 3, 4); }); + it("should return a 4 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("copy", function() { + beforeEach(function() { result = quat.copy(out, quatA); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("set", function() { + beforeEach(function() { result = quat.set(out, 1, 2, 3, 4); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("identity", function() { + beforeEach(function() { result = quat.identity(out); }); + it("should place values into out", function() { expect(result).toBeEqualish([0, 0, 0, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("setAxisAngle", function() { + beforeEach(function() { result = quat.setAxisAngle(out, [1, 0, 0], Math.PI * 0.5); }); + it("should place values into out", function() { expect(result).toBeEqualish([0.707106, 0, 0, 0.707106]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("getAxisAngle", function() { + describe("for a quaternion representing no rotation", function() { + beforeEach(function() { result = quat.setAxisAngle(out, [0, 1, 0], 0.0); deg90 = quat.getAxisAngle(vec, out); }); + it("should return a multiple of 2*PI as the angle component", function() { expect(deg90 % (Math.PI * 2.0)).toBeEqualish(0.0); }); + }); + + describe("for a simple rotation about X axis", function() { + beforeEach(function() { result = quat.setAxisAngle(out, [1, 0, 0], 0.7778); deg90 = quat.getAxisAngle(vec, out); }); + it("should return the same provided angle", function() { expect(deg90).toBeEqualish(0.7778); }); + it("should return the X axis as the angle", function() { expect(vec).toBeEqualish([1, 0, 0]); }); + }); + + describe("for a simple rotation about Y axis", function() { + beforeEach(function() { result = quat.setAxisAngle(out, [0, 1, 0], 0.879546); deg90 = quat.getAxisAngle(vec, out); }); + it("should return the same provided angle", function() { expect(deg90).toBeEqualish(0.879546); }); + it("should return the X axis as the angle", function() { expect(vec).toBeEqualish([0, 1, 0]); }); + }); + + describe("for a simple rotation about Z axis", function() { + beforeEach(function() { result = quat.setAxisAngle(out, [0, 0, 1], 0.123456); deg90 = quat.getAxisAngle(vec, out); }); + it("should return the same provided angle", function() { expect(deg90).toBeEqualish(0.123456); }); + it("should return the X axis as the angle", function() { expect(vec).toBeEqualish([0, 0, 1]); }); + }); + + describe("for a slightly irregular axis and right angle", function() { + beforeEach(function() { result = quat.setAxisAngle(out, [0.707106, 0, 0.707106], Math.PI * 0.5); deg90 = quat.getAxisAngle(vec, out); }); + it("should place values into vec", function() { expect(vec).toBeEqualish([0.707106, 0, 0.707106]); }); + it("should return a numeric angle", function() { expect(deg90).toBeEqualish(Math.PI * 0.5); }); + }); + + describe("for a very irregular axis and negative input angle", function() { + beforeEach(function() { + quatA = quat.setAxisAngle(quatA, [0.65538555, 0.49153915, 0.57346237], 8.8888); + deg90 = quat.getAxisAngle(vec, quatA); + quatB = quat.setAxisAngle(quatB, vec, deg90); + }); + it("should return an angle between 0 and 2*PI", function() { expect(deg90).toBeGreaterThan(0.0); expect(deg90).toBeLessThan(Math.PI * 2.0); }); + it("should create the same quaternion from axis and angle extracted", function() { expect(quatA).toBeEqualish(quatB); }); + }); + }); + + describe("add", function() { + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.add(out, quatA, quatB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([6, 8, 10, 12]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.add(quatA, quatA, quatB); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([6, 8, 10, 12]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatB is the output quaternion", function() { + beforeEach(function() { result = quat.add(quatB, quatA, quatB); }); + + it("should place values into quatB", function() { expect(quatB).toBeEqualish([6, 8, 10, 12]); }); + it("should return quatB", function() { expect(result).toBe(quatB); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(quat.mul).toEqual(quat.multiply); }); + + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.multiply(out, quatA, quatB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([24, 48, 48, -6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.multiply(quatA, quatA, quatB); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([24, 48, 48, -6]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatB is the output quaternion", function() { + beforeEach(function() { result = quat.multiply(quatB, quatA, quatB); }); + + it("should place values into quatB", function() { expect(quatB).toBeEqualish([24, 48, 48, -6]); }); + it("should return quatB", function() { expect(result).toBe(quatB); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("scale", function() { + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.scale(out, quatA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 6, 8]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.scale(quatA, quatA, 2); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([2, 4, 6, 8]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + }); + }); + + describe("length", function() { + it("should have an alias called 'len'", function() { expect(quat.len).toEqual(quat.length); }); + + beforeEach(function() { result = quat.length(quatA); }); + + it("should return the length", function() { expect(result).toBeCloseTo(5.477225); }); + }); + + describe("squaredLength", function() { + it("should have an alias called 'sqrLen'", function() { expect(quat.sqrLen).toEqual(quat.squaredLength); }); + + beforeEach(function() { result = quat.squaredLength(quatA); }); + + it("should return the squared length", function() { expect(result).toEqual(30); }); + }); + + describe("normalize", function() { + beforeEach(function() { quatA = [5, 0, 0, 0]; }); + + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.normalize(out, quatA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 0, 0, 0]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([5, 0, 0, 0]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.normalize(quatA, quatA); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([1, 0, 0, 0]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + }); + }); + + describe("lerp", function() { + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.lerp(out, quatA, quatB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4, 5, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.lerp(quatA, quatA, quatB, 0.5); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([3, 4, 5, 6]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatB is the output quaternion", function() { + beforeEach(function() { result = quat.lerp(quatB, quatA, quatB, 0.5); }); + + it("should place values into quatB", function() { expect(quatB).toBeEqualish([3, 4, 5, 6]); }); + it("should return quatB", function() { expect(result).toBe(quatB); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + /*describe("slerp", function() { + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.slerp(out, quatA, quatB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4, 5, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.slerp(quatA, quatA, quatB, 0.5); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([3, 4, 5, 6]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when quatB is the output quaternion", function() { + beforeEach(function() { result = quat.slerp(quatB, quatA, quatB, 0.5); }); + + it("should place values into quatB", function() { expect(quatB).toBeEqualish([3, 4, 5, 6]); }); + it("should return quatB", function() { expect(result).toBe(quatB); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + }); + });*/ + + // TODO: slerp, calcuateW, rotateX, rotateY, rotateZ + + describe("invert", function() { + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.invert(out, quatA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-0.033333, -0.066666, -0.1, 0.133333]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.invert(quatA, quatA); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([-0.033333, -0.066666, -0.1, 0.133333]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + }); + }); + + describe("conjugate", function() { + describe("with a separate output quaternion", function() { + beforeEach(function() { result = quat.conjugate(out, quatA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-1, -2, -3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when quatA is the output quaternion", function() { + beforeEach(function() { result = quat.conjugate(quatA, quatA); }); + + it("should place values into quatA", function() { expect(quatA).toBeEqualish([-1, -2, -3, 4]); }); + it("should return quatA", function() { expect(result).toBe(quatA); }); + }); + }); + + describe("str", function() { + beforeEach(function() { result = quat.str(quatA); }); + + it("should return a string representation of the quaternion", function() { expect(result).toEqual("quat(1, 2, 3, 4)"); }); + }); + + describe("exactEquals", function() { + var quatC, r0, r1; + beforeEach(function() { + quatA = [0, 1, 2, 3]; + quatB = [0, 1, 2, 3]; + quatC = [1, 2, 3, 4]; + r0 = quat.exactEquals(quatA, quatB); + r1 = quat.exactEquals(quatA, quatC); + }); + + it("should return true for identical quaternions", function() { expect(r0).toBe(true); }); + it("should return false for different quaternions", function() { expect(r1).toBe(false); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([0, 1, 2, 3]); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([0, 1, 2, 3]); }); + }); + + describe("equals", function() { + var quatC, quatD, r0, r1, r2; + beforeEach(function() { + quatA = [0, 1, 2, 3]; + quatB = [0, 1, 2, 3]; + quatC = [1, 2, 3, 4]; + quatD = [1e-16, 1, 2, 3]; + r0 = quat.equals(quatA, quatB); + r1 = quat.equals(quatA, quatC); + r2 = quat.equals(quatA, quatD); + }); + it("should return true for identical quaternions", function() { expect(r0).toBe(true); }); + it("should return false for different quaternions", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical quaternions", function() { expect(r2).toBe(true); }); + it("should not modify quatA", function() { expect(quatA).toBeEqualish([0, 1, 2, 3]); }); + it("should not modify quatB", function() { expect(quatB).toBeEqualish([0, 1, 2, 3]); }); + }); +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/vec2-spec.js b/node_modules/gl-matrix/spec/gl-matrix/vec2-spec.js new file mode 100755 index 00000000..99bd79cc --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/vec2-spec.js @@ -0,0 +1,640 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +describe("vec2", function() { + var vec2 = require("../../src/gl-matrix/vec2.js"); + + var out, vecA, vecB, result; + + beforeEach(function() { vecA = [1, 2]; vecB = [3, 4]; out = [0, 0]; }); + + describe("create", function() { + beforeEach(function() { result = vec2.create(); }); + it("should return a 2 element array initialized to 0s", function() { expect(result).toBeEqualish([0, 0]); }); + }); + + describe("clone", function() { + beforeEach(function() { result = vec2.clone(vecA); }); + it("should return a 2 element array initialized to the values in vecA", function() { expect(result).toBeEqualish(vecA); }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = vec2.fromValues(1, 2); }); + it("should return a 2 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2]); }); + }); + + describe("copy", function() { + beforeEach(function() { result = vec2.copy(out, vecA); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("set", function() { + beforeEach(function() { result = vec2.set(out, 1, 2); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("add", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.add(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([4, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.add(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([4, 6]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.add(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([4, 6]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + }); + + describe("subtract", function() { + it("should have an alias called 'sub'", function() { expect(vec2.sub).toEqual(vec2.subtract); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.subtract(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-2, -2]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.subtract(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([-2, -2]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.subtract(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([-2, -2]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(vec2.mul).toEqual(vec2.multiply); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.multiply(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 8]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.multiply(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 8]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.multiply(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([3, 8]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + }); + + describe("divide", function() { + it("should have an alias called 'div'", function() { expect(vec2.div).toEqual(vec2.divide); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.divide(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([0.3333333, 0.5]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.divide(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([0.3333333, 0.5]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.divide(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([0.3333333, 0.5]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + }); + + describe("ceil", function() { + beforeEach(function() { vecA = [Math.E, Math.PI]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.ceil(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.ceil(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 4]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("floor", function() { + beforeEach(function() { vecA = [Math.E, Math.PI]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.floor(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.floor(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2, 3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("min", function() { + beforeEach(function() { vecA = [1, 4]; vecB = [3, 2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.min(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 2]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.min(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 2]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.min(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([1, 2]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 4]); }); + }); + }); + + describe("max", function() { + beforeEach(function() { vecA = [1, 4]; vecB = [3, 2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.max(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.max(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 4]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 2]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.max(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 4]); }); + }); + }); + + describe("round", function() { + beforeEach(function() { vecA = [Math.E, Math.PI]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.round(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.round(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("scale", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.scale(out, vecA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.scale(vecA, vecA, 2); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2, 4]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("scaleAndAdd", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2.5, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2.5, 4]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([2.5, 4]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + }); + + describe("distance", function() { + it("should have an alias called 'dist'", function() { expect(vec2.dist).toEqual(vec2.distance); }); + + beforeEach(function() { result = vec2.distance(vecA, vecB); }); + + it("should return the distance", function() { expect(result).toBeCloseTo(2.828427); }); + }); + + describe("squaredDistance", function() { + it("should have an alias called 'sqrDist'", function() { expect(vec2.sqrDist).toEqual(vec2.squaredDistance); }); + + beforeEach(function() { result = vec2.squaredDistance(vecA, vecB); }); + + it("should return the squared distance", function() { expect(result).toEqual(8); }); + }); + + describe("length", function() { + it("should have an alias called 'len'", function() { expect(vec2.len).toEqual(vec2.length); }); + + beforeEach(function() { result = vec2.length(vecA); }); + + it("should return the length", function() { expect(result).toBeCloseTo(2.236067); }); + }); + + describe("squaredLength", function() { + it("should have an alias called 'sqrLen'", function() { expect(vec2.sqrLen).toEqual(vec2.squaredLength); }); + + beforeEach(function() { result = vec2.squaredLength(vecA); }); + + it("should return the squared length", function() { expect(result).toEqual(5); }); + }); + + describe("negate", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.negate(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-1, -2]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.negate(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([-1, -2]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("normalize", function() { + beforeEach(function() { vecA = [5, 0]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.normalize(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 0]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([5, 0]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.normalize(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([1, 0]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("dot", function() { + beforeEach(function() { result = vec2.dot(vecA, vecB); }); + + it("should return the dot product", function() { expect(result).toEqual(11); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("cross", function() { + var out3; + + beforeEach(function() { + out3 = [0, 0, 0]; + result = vec2.cross(out3, vecA, vecB); + }); + + it("should place values into out", function() { expect(out3).toBeEqualish([0, 0, -2]); }); + it("should return out", function() { expect(result).toBe(out3); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("lerp", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.lerp(out, vecA, vecB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.lerp(vecA, vecA, vecB, 0.5); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2, 3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 4]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec2.lerp(vecB, vecA, vecB, 0.5); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([2, 3]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + }); + + describe("random", function() { + describe("with no scale", function() { + beforeEach(function() { result = vec2.random(out); }); + + it("should result in a unit length vector", function() { expect(vec2.length(out)).toBeCloseTo(1.0); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("with a scale", function() { + beforeEach(function() { result = vec2.random(out, 5.0); }); + + it("should result in a unit length vector", function() { expect(vec2.length(out)).toBeCloseTo(5.0); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + }); + + describe("transformMat2", function() { + var matA; + beforeEach(function() { matA = [1, 2, 3, 4]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.transformMat2(out, vecA, matA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([7, 10]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.transformMat2(vecA, vecA, matA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([7, 10]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("transformMat2d", function() { + var matA; + beforeEach(function() { matA = [1, 2, 3, 4, 5, 6]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec2.transformMat2d(out, vecA, matA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([12, 16]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec2.transformMat2d(vecA, vecA, matA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([12, 16]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify matA", function() { expect(matA).toBeEqualish([1, 2, 3, 4, 5, 6]); }); + }); + }); + + describe("forEach", function() { + var vecArray; + + beforeEach(function() { + vecArray = [ + 1, 2, + 3, 4, + 0, 0 + ]; + }); + + describe("when performing operations that take no extra arguments", function() { + beforeEach(function() { result = vec2.forEach(vecArray, 0, 0, 0, vec2.normalize); }); + + it("should update all values", function() { + expect(vecArray).toBeEqualish([ + 0.447214, 0.894427, + 0.6, 0.8, + 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + }); + + describe("when performing operations that takes one extra arguments", function() { + beforeEach(function() { result = vec2.forEach(vecArray, 0, 0, 0, vec2.add, vecA); }); + + it("should update all values", function() { + expect(vecArray).toBeEqualish([ + 2, 4, + 4, 6, + 1, 2 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + + describe("when specifying an offset", function() { + beforeEach(function() { result = vec2.forEach(vecArray, 0, 2, 0, vec2.add, vecA); }); + + it("should update all values except the first vector", function() { + expect(vecArray).toBeEqualish([ + 1, 2, + 4, 6, + 1, 2 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + + describe("when specifying a count", function() { + beforeEach(function() { result = vec2.forEach(vecArray, 0, 0, 2, vec2.add, vecA); }); + + it("should update all values except the last vector", function() { + expect(vecArray).toBeEqualish([ + 2, 4, + 4, 6, + 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + + describe("when specifying a stride", function() { + beforeEach(function() { result = vec2.forEach(vecArray, 4, 0, 0, vec2.add, vecA); }); + + it("should update all values except the second vector", function() { + expect(vecArray).toBeEqualish([ + 2, 4, + 3, 4, + 1, 2 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2]); }); + }); + + describe("when calling a function that does not modify the out variable", function() { + beforeEach(function() { + result = vec2.forEach(vecArray, 0, 0, 0, function(out, vec) {}); + }); + + it("values should remain unchanged", function() { + expect(vecArray).toBeEqualish([ + 1, 2, + 3, 4, + 0, 0, + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + }); + }); + + describe("str", function() { + beforeEach(function() { result = vec2.str(vecA); }); + + it("should return a string representation of the vector", function() { expect(result).toEqual("vec2(1, 2)"); }); + }); + + describe("exactEquals", function() { + var vecC, r0, r1; + beforeEach(function() { + vecA = [0, 1]; + vecB = [0, 1]; + vecC = [1, 2]; + r0 = vec2.exactEquals(vecA, vecB); + r1 = vec2.exactEquals(vecA, vecC); + }); + + it("should return true for identical vectors", function() { expect(r0).toBe(true); }); + it("should return false for different vectors", function() { expect(r1).toBe(false); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([0, 1]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([0, 1]); }); + }); + + describe("equals", function() { + var vecC, vecD, r0, r1, r2; + beforeEach(function() { + vecA = [0, 1]; + vecB = [0, 1]; + vecC = [1, 2]; + vecD = [1e-16, 1]; + r0 = vec2.equals(vecA, vecB); + r1 = vec2.equals(vecA, vecC); + r2 = vec2.equals(vecA, vecD); + }); + it("should return true for identical vectors", function() { expect(r0).toBe(true); }); + it("should return false for different vectors", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical vectors", function() { expect(r2).toBe(true); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([0, 1]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([0, 1]); }); + }); +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/vec3-spec.js b/node_modules/gl-matrix/spec/gl-matrix/vec3-spec.js new file mode 100755 index 00000000..1aa866aa --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/vec3-spec.js @@ -0,0 +1,752 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +describe("vec3", function() { + var mat3 = require("../../src/gl-matrix/mat3.js"); + var mat4 = require("../../src/gl-matrix/mat4.js"); + var vec3 = require("../../src/gl-matrix/vec3.js"); + + var out, vecA, vecB, result; + + beforeEach(function() { vecA = [1, 2, 3]; vecB = [4, 5, 6]; out = [0, 0, 0]; }); + + describe('rotateX', function(){ + describe('rotation around world origin [0, 0, 0]', function(){ + beforeEach(function(){ vecA = [0, 1, 0]; vecB = [0, 0, 0]; result = vec3.rotateX(out, vecA, vecB, Math.PI); }); + it("should return the rotated vector", function(){ expect(result).toBeEqualish([0, -1, 0]); }); + }); + describe('rotation around an arbitrary origin', function(){ + beforeEach(function(){ vecA = [2, 7, 0]; vecB = [2, 5, 0]; result = vec3.rotateX(out, vecA, vecB, Math.PI); }); + it("should return the rotated vector", function(){ expect(result).toBeEqualish([2, 3, 0]); }); + }); + }); + + describe('rotateY', function(){ + describe('rotation around world origin [0, 0, 0]', function(){ + beforeEach(function(){ vecA = [1, 0, 0]; vecB = [0, 0, 0]; result = vec3.rotateY(out, vecA, vecB, Math.PI); }); + it("should return the rotated vector", function(){ expect(result).toBeEqualish([-1, 0, 0]); }); + }); + describe('rotation around an arbitrary origin', function(){ + beforeEach(function(){ vecA = [-2, 3, 10]; vecB = [-4, 3, 10]; result = vec3.rotateY(out, vecA, vecB, Math.PI); }); + it("should return the rotated vector", function(){ expect(result).toBeEqualish([-6, 3, 10]); }); + }); + }); + + describe('rotateZ', function(){ + describe('rotation around world origin [0, 0, 0]', function(){ + beforeEach(function(){ vecA = [0, 1, 0]; vecB = [0, 0, 0]; result = vec3.rotateZ(out, vecA, vecB, Math.PI); }); + it("should return the rotated vector", function(){ expect(result).toBeEqualish([0, -1, 0]); }); + }); + describe('rotation around an arbitrary origin', function(){ + beforeEach(function(){ vecA = [0, 6, -5]; vecB = [0, 0, -5]; result = vec3.rotateZ(out, vecA, vecB, Math.PI); }); + it("should return the rotated vector", function(){ expect(result).toBeEqualish([0, -6, -5]); }); + }); + }); + + describe('transformMat4', function() { + var matr; + describe("with an identity", function() { + beforeEach(function() { matr = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ] }); + + beforeEach(function() { result = vec3.transformMat4(out, vecA, matr); }); + + it("should produce the input", function() { + expect(out).toBeEqualish([1, 2, 3]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("with a lookAt", function() { + beforeEach(function() { matr = mat4.lookAt(mat4.create(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); }); + + beforeEach(function() { result = vec3.transformMat4(out, vecA, matr); }); + + it("should rotate and translate the input", function() { + expect(out).toBeEqualish([ 4, -4, -4 ]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("with a perspective matrix (#92)", function() { + it("should transform a point from perspective(pi/2, 4/3, 1, 100)", function() { + matr = [0.750, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1.02, -1, + 0, 0, -2.02, 0]; + result = vec3.transformMat4([], [10, 20, 30], matr); + expect(result).toBeEqualish([-0.25, -0.666666, 1.087333]); + }); + }); + + }); + + describe('transformMat3', function() { + var matr; + describe("with an identity", function() { + beforeEach(function() { matr = [1, 0, 0, 0, 1, 0, 0, 0, 1 ] }); + + beforeEach(function() { result = vec3.transformMat3(out, vecA, matr); }); + + it("should produce the input", function() { + expect(out).toBeEqualish([1, 2, 3]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("with 90deg about X", function() { + beforeEach(function() { + result = vec3.transformMat3(out, [0,1,0], [1,0,0,0,0,1,0,-1,0]); + }); + + it("should produce correct output", function() { + expect(out).toBeEqualish([0,0,1]); + }); + }); + + describe("with 90deg about Y", function() { + beforeEach(function() { + result = vec3.transformMat3(out, [1,0,0], [0,0,-1,0,1,0,1,0,0]); + }); + + it("should produce correct output", function() { + expect(out).toBeEqualish([0,0,-1]); + }); + }); + + describe("with 90deg about Z", function() { + beforeEach(function() { + result = vec3.transformMat3(out, [1,0,0], [0,1,0,-1,0,0,0,0,1]); + }); + + it("should produce correct output", function() { + expect(out).toBeEqualish([0,1,0]); + }); + }); + + describe("with a lookAt normal matrix", function() { + beforeEach(function() { + matr = mat4.lookAt(mat4.create(), [5, 6, 7], [2, 6, 7], [0, 1, 0]); + var n = mat3.create(); + matr = mat3.transpose(n, mat3.invert(n, mat3.fromMat4(n, matr))); + }); + + beforeEach(function() { result = vec3.transformMat3(out, [1,0,0], matr); }); + + it("should rotate the input", function() { + expect(out).toBeEqualish([ 0,0,1 ]); + }); + + it("should return out", function() { expect(result).toBe(out); }); + }); + }); + + describe("create", function() { + beforeEach(function() { result = vec3.create(); }); + it("should return a 3 element array initialized to 0s", function() { expect(result).toBeEqualish([0, 0, 0]); }); + }); + + describe("clone", function() { + beforeEach(function() { result = vec3.clone(vecA); }); + it("should return a 3 element array initialized to the values in vecA", function() { expect(result).toBeEqualish(vecA); }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = vec3.fromValues(1, 2, 3); }); + it("should return a 3 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2, 3]); }); + }); + + describe("copy", function() { + beforeEach(function() { result = vec3.copy(out, vecA); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("set", function() { + beforeEach(function() { result = vec3.set(out, 1, 2, 3); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("add", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.add(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([5, 7, 9]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.add(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([5, 7, 9]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.add(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([5, 7, 9]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + }); + + describe("subtract", function() { + it("should have an alias called 'sub'", function() { expect(vec3.sub).toEqual(vec3.subtract); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.subtract(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-3, -3, -3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.subtract(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([-3, -3, -3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.subtract(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([-3, -3, -3]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(vec3.mul).toEqual(vec3.multiply); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.multiply(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([4, 10, 18]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.multiply(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([4, 10, 18]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.multiply(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([4, 10, 18]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + }); + + describe("divide", function() { + it("should have an alias called 'div'", function() { expect(vec3.div).toEqual(vec3.divide); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.divide(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([0.25, 0.4, 0.5]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.divide(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([0.25, 0.4, 0.5]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.divide(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([0.25, 0.4, 0.5]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + }); + + describe("ceil", function() { + beforeEach(function() { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.ceil(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4, 2]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI, Math.SQRT2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.ceil(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 4, 2]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("floor", function() { + beforeEach(function() { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.floor(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 3, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI, Math.SQRT2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.floor(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2, 3, 1]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("min", function() { + beforeEach(function() { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.min(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 1, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.min(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([1, 1, 1]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.min(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([1, 1, 1]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1]); }); + }); + }); + + describe("max", function() { + beforeEach(function() { vecA = [1, 3, 1]; vecB = [3, 1, 3]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.max(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 3, 3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.max(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 3, 3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.max(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([3, 3, 3]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1]); }); + }); + }); + + describe("round", function() { + beforeEach(function() { vecA = [Math.E, Math.PI, Math.SQRT2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.round(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 3, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI, Math.SQRT2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.round(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 3, 1]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("scale", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.scale(out, vecA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.scale(vecA, vecA, 2); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2, 4, 6]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("scaleAndAdd", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4.5, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 4.5, 6]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([3, 4.5, 6]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + }); + + describe("distance", function() { + it("should have an alias called 'dist'", function() { expect(vec3.dist).toEqual(vec3.distance); }); + + beforeEach(function() { result = vec3.distance(vecA, vecB); }); + + it("should return the distance", function() { expect(result).toBeCloseTo(5.196152); }); + }); + + describe("squaredDistance", function() { + it("should have an alias called 'sqrDist'", function() { expect(vec3.sqrDist).toEqual(vec3.squaredDistance); }); + + beforeEach(function() { result = vec3.squaredDistance(vecA, vecB); }); + + it("should return the squared distance", function() { expect(result).toEqual(27); }); + }); + + describe("length", function() { + it("should have an alias called 'len'", function() { expect(vec3.len).toEqual(vec3.length); }); + + beforeEach(function() { result = vec3.length(vecA); }); + + it("should return the length", function() { expect(result).toBeCloseTo(3.741657); }); + }); + + describe("squaredLength", function() { + it("should have an alias called 'sqrLen'", function() { expect(vec3.sqrLen).toEqual(vec3.squaredLength); }); + + beforeEach(function() { result = vec3.squaredLength(vecA); }); + + it("should return the squared length", function() { expect(result).toEqual(14); }); + }); + + describe("negate", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.negate(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-1, -2, -3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.negate(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([-1, -2, -3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("normalize", function() { + beforeEach(function() { vecA = [5, 0, 0]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.normalize(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 0, 0]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([5, 0, 0]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.normalize(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([1, 0, 0]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("dot", function() { + beforeEach(function() { result = vec3.dot(vecA, vecB); }); + + it("should return the dot product", function() { expect(result).toEqual(32); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("cross", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.cross(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-3, 6, -3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.cross(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([-3, 6, -3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.cross(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([-3, 6, -3]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + }); + + describe("lerp", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec3.lerp(out, vecA, vecB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2.5, 3.5, 4.5]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec3.lerp(vecA, vecA, vecB, 0.5); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2.5, 3.5, 4.5]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec3.lerp(vecB, vecA, vecB, 0.5); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([2.5, 3.5, 4.5]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + }); + + describe("random", function() { + describe("with no scale", function() { + beforeEach(function() { result = vec3.random(out); }); + + it("should result in a unit length vector", function() { expect(vec3.length(out)).toBeCloseTo(1.0); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("with a scale", function() { + beforeEach(function() { result = vec3.random(out, 5.0); }); + + it("should result in a unit length vector", function() { expect(vec3.length(out)).toBeCloseTo(5.0); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + }); + + describe("forEach", function() { + var vecArray; + + beforeEach(function() { + vecArray = [ + 1, 2, 3, + 4, 5, 6, + 0, 0, 0 + ]; + }); + + describe("when performing operations that take no extra arguments", function() { + beforeEach(function() { result = vec3.forEach(vecArray, 0, 0, 0, vec3.normalize); }); + + it("should update all values", function() { + expect(vecArray).toBeEqualish([ + 0.267261, 0.534522, 0.801783, + 0.455842, 0.569802, 0.683763, + 0, 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + }); + + describe("when performing operations that takes one extra arguments", function() { + beforeEach(function() { result = vec3.forEach(vecArray, 0, 0, 0, vec3.add, vecA); }); + + it("should update all values", function() { + expect(vecArray).toBeEqualish([ + 2, 4, 6, + 5, 7, 9, + 1, 2, 3 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + + describe("when specifying an offset", function() { + beforeEach(function() { result = vec3.forEach(vecArray, 0, 3, 0, vec3.add, vecA); }); + + it("should update all values except the first vector", function() { + expect(vecArray).toBeEqualish([ + 1, 2, 3, + 5, 7, 9, + 1, 2, 3 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + + describe("when specifying a count", function() { + beforeEach(function() { result = vec3.forEach(vecArray, 0, 0, 2, vec3.add, vecA); }); + + it("should update all values except the last vector", function() { + expect(vecArray).toBeEqualish([ + 2, 4, 6, + 5, 7, 9, + 0, 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + + describe("when specifying a stride", function() { + beforeEach(function() { result = vec3.forEach(vecArray, 6, 0, 0, vec3.add, vecA); }); + + it("should update all values except the second vector", function() { + expect(vecArray).toBeEqualish([ + 2, 4, 6, + 4, 5, 6, + 1, 2, 3 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + }); + + describe("when calling a function that does not modify the out variable", function() { + beforeEach(function() { + result = vec3.forEach(vecArray, 0, 0, 0, function(out, vec) {}); + }); + + it("values should remain unchanged", function() { + expect(vecArray).toBeEqualish([ + 1, 2, 3, + 4, 5, 6, + 0, 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + }); + }); + + describe("angle", function() { + beforeEach(function() { result = vec3.angle(vecA, vecB); }); + + it("should return the angle", function() { expect(result).toBeEqualish(0.225726); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([4, 5, 6]); }); + }); + + describe("str", function() { + beforeEach(function() { result = vec3.str(vecA); }); + + it("should return a string representation of the vector", function() { expect(result).toEqual("vec3(1, 2, 3)"); }); + }); + + describe("exactEquals", function() { + var vecC, r0, r1; + beforeEach(function() { + vecA = [0, 1, 2]; + vecB = [0, 1, 2]; + vecC = [1, 2, 3]; + r0 = vec3.exactEquals(vecA, vecB); + r1 = vec3.exactEquals(vecA, vecC); + }); + + it("should return true for identical vectors", function() { expect(r0).toBe(true); }); + it("should return false for different vectors", function() { expect(r1).toBe(false); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([0, 1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([0, 1, 2]); }); + }); + + describe("equals", function() { + var vecC, vecD, r0, r1, r2; + beforeEach(function() { + vecA = [0, 1, 2]; + vecB = [0, 1, 2]; + vecC = [1, 2, 3]; + vecD = [1e-16, 1, 2]; + r0 = vec3.equals(vecA, vecB); + r1 = vec3.equals(vecA, vecC); + r2 = vec3.equals(vecA, vecD); + }); + it("should return true for identical vectors", function() { expect(r0).toBe(true); }); + it("should return false for different vectors", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical vectors", function() { expect(r2).toBe(true); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([0, 1, 2]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([0, 1, 2]); }); + }); +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/vec4-spec.js b/node_modules/gl-matrix/spec/gl-matrix/vec4-spec.js new file mode 100755 index 00000000..eabae840 --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/vec4-spec.js @@ -0,0 +1,583 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +describe("vec4", function() { + var vec3 = require("../../src/gl-matrix/vec3.js"); + var vec4 = require("../../src/gl-matrix/vec4.js"); + + var out, vecA, vecB, result; + + beforeEach(function() { vecA = [1, 2, 3, 4]; vecB = [5, 6, 7, 8]; out = [0, 0, 0, 0]; }); + + describe("create", function() { + beforeEach(function() { result = vec4.create(); }); + it("should return a 4 element array initialized to 0s", function() { expect(result).toBeEqualish([0, 0, 0, 0]); }); + }); + + describe("clone", function() { + beforeEach(function() { result = vec4.clone(vecA); }); + it("should return a 4 element array initialized to the values in vecA", function() { expect(result).toBeEqualish(vecA); }); + }); + + describe("fromValues", function() { + beforeEach(function() { result = vec4.fromValues(1, 2, 3, 4); }); + it("should return a 4 element array initialized to the values passed", function() { expect(result).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("copy", function() { + beforeEach(function() { result = vec4.copy(out, vecA); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("set", function() { + beforeEach(function() { result = vec4.set(out, 1, 2, 3, 4); }); + it("should place values into out", function() { expect(out).toBeEqualish([1, 2, 3, 4]); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("add", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.add(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([6, 8, 10, 12]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.add(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([6, 8, 10, 12]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.add(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([6, 8, 10, 12]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("subtract", function() { + it("should have an alias called 'sub'", function() { expect(vec4.sub).toEqual(vec4.subtract); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.subtract(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-4, -4, -4, -4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.subtract(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([-4, -4, -4, -4]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.subtract(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([-4, -4, -4, -4]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("multiply", function() { + it("should have an alias called 'mul'", function() { expect(vec4.mul).toEqual(vec4.multiply); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.multiply(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([5, 12, 21, 32]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.multiply(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([5, 12, 21, 32]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.multiply(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([5, 12, 21, 32]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("divide", function() { + it("should have an alias called 'div'", function() { expect(vec4.div).toEqual(vec4.divide); }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.divide(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([0.2, 0.333333, 0.428571, 0.5]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.divide(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([0.2, 0.333333, 0.428571, 0.5]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.divide(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([0.2, 0.333333, 0.428571, 0.5]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("ceil", function() { + beforeEach(function() { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.ceil(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4, 2, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.ceil(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 4, 2, 1]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("floor", function() { + beforeEach(function() { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.floor(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 3, 1, 0]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.floor(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2, 3, 1, 0]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("min", function() { + beforeEach(function() { vecA = [1, 3, 1, 3]; vecB = [3, 1, 3, 1]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.min(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 1, 1, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3, 1]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.min(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([1, 1, 1, 1]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3, 1]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.min(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([1, 1, 1, 1]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1, 3]); }); + }); + }); + + describe("max", function() { + beforeEach(function() { vecA = [1, 3, 1, 3]; vecB = [3, 1, 3, 1]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.max(out, vecA, vecB); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 3, 3, 3]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3, 1]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.max(vecA, vecA, vecB); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 3, 3, 3]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([3, 1, 3, 1]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.max(vecB, vecA, vecB); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([3, 3, 3, 3]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 3, 1, 3]); }); + }); + }); + + describe("round", function() { + beforeEach(function() { vecA = [Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.round(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 3, 1, 1]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([Math.E, Math.PI, Math.SQRT2, Math.SQRT1_2]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.round(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 3, 1, 1]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("scale", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.scale(out, vecA, 2); }); + + it("should place values into out", function() { expect(out).toBeEqualish([2, 4, 6, 8]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.scale(vecA, vecA, 2); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([2, 4, 6, 8]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("scaleAndAdd", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.scaleAndAdd(out, vecA, vecB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3.5, 5, 6.5, 8]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.scaleAndAdd(vecA, vecA, vecB, 0.5); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3.5, 5, 6.5, 8]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.scaleAndAdd(vecB, vecA, vecB, 0.5); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([3.5, 5, 6.5, 8]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("distance", function() { + it("should have an alias called 'dist'", function() { expect(vec4.dist).toEqual(vec4.distance); }); + + beforeEach(function() { result = vec4.distance(vecA, vecB); }); + + it("should return the distance", function() { expect(result).toBeCloseTo(8); }); + }); + + describe("squaredDistance", function() { + it("should have an alias called 'sqrDist'", function() { expect(vec4.sqrDist).toEqual(vec4.squaredDistance); }); + + beforeEach(function() { result = vec4.squaredDistance(vecA, vecB); }); + + it("should return the squared distance", function() { expect(result).toEqual(64); }); + }); + + describe("length", function() { + it("should have an alias called 'len'", function() { expect(vec4.len).toEqual(vec4.length); }); + + beforeEach(function() { result = vec4.length(vecA); }); + + it("should return the length", function() { expect(result).toBeCloseTo(5.477225); }); + }); + + describe("squaredLength", function() { + it("should have an alias called 'sqrLen'", function() { expect(vec4.sqrLen).toEqual(vec4.squaredLength); }); + + beforeEach(function() { result = vec4.squaredLength(vecA); }); + + it("should return the squared length", function() { expect(result).toEqual(30); }); + }); + + describe("negate", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.negate(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([-1, -2, -3, -4]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.negate(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([-1, -2, -3, -4]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("normalize", function() { + beforeEach(function() { vecA = [5, 0, 0, 0]; }); + + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.normalize(out, vecA); }); + + it("should place values into out", function() { expect(out).toBeEqualish([1, 0, 0, 0]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([5, 0, 0, 0]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.normalize(vecA, vecA); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([1, 0, 0, 0]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + }); + }); + + describe("dot", function() { + beforeEach(function() { result = vec4.dot(vecA, vecB); }); + + it("should return the dot product", function() { expect(result).toEqual(70); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("lerp", function() { + describe("with a separate output vector", function() { + beforeEach(function() { result = vec4.lerp(out, vecA, vecB, 0.5); }); + + it("should place values into out", function() { expect(out).toBeEqualish([3, 4, 5, 6]); }); + it("should return out", function() { expect(result).toBe(out); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecA is the output vector", function() { + beforeEach(function() { result = vec4.lerp(vecA, vecA, vecB, 0.5); }); + + it("should place values into vecA", function() { expect(vecA).toBeEqualish([3, 4, 5, 6]); }); + it("should return vecA", function() { expect(result).toBe(vecA); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([5, 6, 7, 8]); }); + }); + + describe("when vecB is the output vector", function() { + beforeEach(function() { result = vec4.lerp(vecB, vecA, vecB, 0.5); }); + + it("should place values into vecB", function() { expect(vecB).toBeEqualish([3, 4, 5, 6]); }); + it("should return vecB", function() { expect(result).toBe(vecB); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + }); + + describe("random", function() { + describe("with no scale", function() { + beforeEach(function() { result = vec4.random(out); }); + + it("should result in a unit length vector", function() { expect(vec4.length(out)).toBeCloseTo(1.0); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + + describe("with a scale", function() { + beforeEach(function() { result = vec4.random(out, 5.0); }); + + it("should result in a unit length vector", function() { expect(vec4.length(out)).toBeCloseTo(5.0); }); + it("should return out", function() { expect(result).toBe(out); }); + }); + }); + + describe("forEach", function() { + var vecArray; + + beforeEach(function() { + vecArray = [ + 1, 2, 3, 4, + 5, 6, 7, 8, + 0, 0, 0, 0 + ]; + }); + + describe("when performing operations that take no extra arguments", function() { + beforeEach(function() { result = vec4.forEach(vecArray, 0, 0, 0, vec4.normalize); }); + + it("should update all values", function() { + expect(vecArray).toBeEqualish([ + 0.182574, 0.365148, 0.547722, 0.730296, + 0.379049, 0.454858, 0.530668, 0.606478, + 0, 0, 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + }); + + describe("when performing operations that takes one extra arguments", function() { + beforeEach(function() { result = vec4.forEach(vecArray, 0, 0, 0, vec4.add, vecA); }); + + it("should update all values", function() { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 6, 8, 10, 12, + 1, 2, 3, 4 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when specifying an offset", function() { + beforeEach(function() { result = vec4.forEach(vecArray, 0, 4, 0, vec4.add, vecA); }); + + it("should update all values except the first vector", function() { + expect(vecArray).toBeEqualish([ + 1, 2, 3, 4, + 6, 8, 10, 12, + 1, 2, 3, 4 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when specifying a count", function() { + beforeEach(function() { result = vec4.forEach(vecArray, 0, 0, 2, vec4.add, vecA); }); + + it("should update all values except the last vector", function() { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 6, 8, 10, 12, + 0, 0, 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when specifying a stride", function() { + beforeEach(function() { result = vec4.forEach(vecArray, 8, 0, 0, vec4.add, vecA); }); + + it("should update all values except the second vector", function() { + expect(vecArray).toBeEqualish([ + 2, 4, 6, 8, + 5, 6, 7, 8, + 1, 2, 3, 4 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([1, 2, 3, 4]); }); + }); + + describe("when calling a function that does not modify the out variable", function() { + beforeEach(function() { + result = vec3.forEach(vecArray, 0, 0, 0, function(out, vec) {}); + }); + + it("values should remain unchanged", function() { + expect(vecArray).toBeEqualish([ + 1, 2, 3, 4, + 5, 6, 7, 8, + 0, 0, 0, 0 + ]); + }); + it("should return vecArray", function() { expect(result).toBe(vecArray); }); + }); + }); + + describe("str", function() { + beforeEach(function() { result = vec4.str(vecA); }); + + it("should return a string representation of the vector", function() { expect(result).toEqual("vec4(1, 2, 3, 4)"); }); + }); + + describe("exactEquals", function() { + var vecC, r0, r1; + beforeEach(function() { + vecA = [0, 1, 2, 3]; + vecB = [0, 1, 2, 3]; + vecC = [1, 2, 3, 4]; + r0 = vec4.exactEquals(vecA, vecB); + r1 = vec4.exactEquals(vecA, vecC); + }); + + it("should return true for identical vectors", function() { expect(r0).toBe(true); }); + it("should return false for different vectors", function() { expect(r1).toBe(false); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([0, 1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([0, 1, 2, 3]); }); + }); + + describe("equals", function() { + var vecC, vecD, r0, r1, r2; + beforeEach(function() { + vecA = [0, 1, 2, 3]; + vecB = [0, 1, 2, 3]; + vecC = [1, 2, 3, 4]; + vecD = [1e-16, 1, 2, 3]; + r0 = vec4.equals(vecA, vecB); + r1 = vec4.equals(vecA, vecC); + r2 = vec4.equals(vecA, vecD); + }); + it("should return true for identical vectors", function() { expect(r0).toBe(true); }); + it("should return false for different vectors", function() { expect(r1).toBe(false); }); + it("should return true for close but not identical vectors", function() { expect(r2).toBe(true); }); + it("should not modify vecA", function() { expect(vecA).toBeEqualish([0, 1, 2, 3]); }); + it("should not modify vecB", function() { expect(vecB).toBeEqualish([0, 1, 2, 3]); }); + }); +}); diff --git a/node_modules/gl-matrix/spec/gl-matrix/worker-spec.js b/node_modules/gl-matrix/spec/gl-matrix/worker-spec.js new file mode 100755 index 00000000..8b1754f4 --- /dev/null +++ b/node_modules/gl-matrix/spec/gl-matrix/worker-spec.js @@ -0,0 +1,44 @@ +/* spec tests gl-matrix when embedded into a Web Worker */ + +// only test with workers if workers are available +if (typeof(Worker) !== 'undefined') { + describe("Embedded within Web Workers", function() { + it("should initialize successfully", function() { + var xhr = new XMLHttpRequest(); + var source = null; + xhr.onreadystatechange = function() { + if (this.readyState == this.DONE) { + if (this.status == 200) { + source = this.responseText; + } + } + }; + xhr.open("GET", "/dist/gl-matrix-min.js"); + xhr.send(); + + var result = null; + + waitsFor(function() { + if (!source) return false; + var blob = new Blob([ + source, + "self.postMessage(vec3.create());" + ], + {type: "application/javascript"} + ); + + var worker = new Worker(URL.createObjectURL(blob)); + worker.onmessage = function(e) { + result = e.data; + }; + return true; + }); + + waitsFor(function() { + if (!result) return false; + expect(result).toBeEqualish([0, 0, 0]); + return true; + }); + }); + }); +} diff --git a/node_modules/gl-matrix/spec/helpers/spec-helper.js b/node_modules/gl-matrix/spec/helpers/spec-helper.js new file mode 100755 index 00000000..58e36714 --- /dev/null +++ b/node_modules/gl-matrix/spec/helpers/spec-helper.js @@ -0,0 +1,32 @@ +var HELPER_MATCHERS = (function() { + var EPSILON = 0.00001; + + return { + /* + Returns true if `actual` has the same length as `expected`, and + if each element of both arrays is within 0.000001 of each other. + This is a way to check for "equal enough" conditions, as a way + of working around floating point imprecision. + */ + toBeEqualish: function(expected) { + if (typeof(this.actual) == 'number') + return Math.abs(this.actual - expected) < EPSILON; + + if (this.actual.length != expected.length) return false; + for (var i = 0; i < this.actual.length; i++) { + if (isNaN(this.actual[i]) !== isNaN(expected[i])) + return false; + if (Math.abs(this.actual[i] - expected[i]) >= EPSILON) + return false; + } + return true; + } + }; +})(); + +beforeEach(function() { + this.addMatchers(HELPER_MATCHERS); +}); + +if (typeof(global) != 'undefined') + global.HELPER_MATCHERS = HELPER_MATCHERS; diff --git a/node_modules/gl-matrix/spec/jasmine.yml b/node_modules/gl-matrix/spec/jasmine.yml new file mode 100755 index 00000000..afb56ec6 --- /dev/null +++ b/node_modules/gl-matrix/spec/jasmine.yml @@ -0,0 +1,74 @@ +# src_files +# +# Return an array of filepaths relative to src_dir to include before jasmine specs. +# Default: [] +# +# EXAMPLE: +# +# src_files: +# - lib/source1.js +# - lib/source2.js +# - dist/**/*.js +# +src_files: + - src/gl-matrix.js + - src/gl-matrix/common.js + +# stylesheets +# +# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs. +# Default: [] +# +# EXAMPLE: +# +# stylesheets: +# - css/style.css +# - stylesheets/*.css +# +stylesheets: + +# helpers +# +# Return an array of filepaths relative to spec_dir to include before jasmine specs. +# Default: ["helpers/**/*.js"] +# +# EXAMPLE: +# +# helpers: +# - helpers/**/*.js +# +helpers: + +# spec_files +# +# Return an array of filepaths relative to spec_dir to include. +# Default: ["**/*[sS]pec.js"] +# +# EXAMPLE: +# +# spec_files: +# - **/*[sS]pec.js +# +spec_files: + +# src_dir +# +# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank. +# Default: project root +# +# EXAMPLE: +# +# src_dir: public +# +src_dir: + +# spec_dir +# +# Spec directory path. Your spec_files must be returned relative to this path. +# Default: spec/javascripts +# +# EXAMPLE: +# +# spec_dir: spec/javascripts +# +spec_dir: spec diff --git a/node_modules/gl-matrix/src/gl-matrix.js b/node_modules/gl-matrix/src/gl-matrix.js new file mode 100755 index 00000000..58187d0b --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix.js @@ -0,0 +1,37 @@ +/** + * @fileoverview gl-matrix - High performance matrix and vector operations + * @author Brandon Jones + * @author Colin MacKenzie IV + * @version 2.3.2 + */ + +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ +// END HEADER + +exports.glMatrix = require("./gl-matrix/common.js"); +exports.mat2 = require("./gl-matrix/mat2.js"); +exports.mat2d = require("./gl-matrix/mat2d.js"); +exports.mat3 = require("./gl-matrix/mat3.js"); +exports.mat4 = require("./gl-matrix/mat4.js"); +exports.quat = require("./gl-matrix/quat.js"); +exports.vec2 = require("./gl-matrix/vec2.js"); +exports.vec3 = require("./gl-matrix/vec3.js"); +exports.vec4 = require("./gl-matrix/vec4.js"); \ No newline at end of file diff --git a/node_modules/gl-matrix/src/gl-matrix/common.js b/node_modules/gl-matrix/src/gl-matrix/common.js new file mode 100755 index 00000000..6602cb5a --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/common.js @@ -0,0 +1,70 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +/** + * @class Common utilities + * @name glMatrix + */ +var glMatrix = {}; + +// Configuration Constants +glMatrix.EPSILON = 0.000001; +glMatrix.ARRAY_TYPE = (typeof Float32Array !== 'undefined') ? Float32Array : Array; +glMatrix.RANDOM = Math.random; +glMatrix.ENABLE_SIMD = false; + +// Capability detection +glMatrix.SIMD_AVAILABLE = (glMatrix.ARRAY_TYPE === Float32Array) && ('SIMD' in this); +glMatrix.USE_SIMD = glMatrix.ENABLE_SIMD && glMatrix.SIMD_AVAILABLE; + +/** + * Sets the type of array used when creating new vectors and matrices + * + * @param {Type} type Array type, such as Float32Array or Array + */ +glMatrix.setMatrixArrayType = function(type) { + glMatrix.ARRAY_TYPE = type; +} + +var degree = Math.PI / 180; + +/** +* Convert Degree To Radian +* +* @param {Number} Angle in Degrees +*/ +glMatrix.toRadian = function(a){ + return a * degree; +} + +/** + * Tests whether or not the arguments have approximately the same value, within an absolute + * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less + * than or equal to 1.0, and a relative tolerance is used for larger values) + * + * @param {Number} a The first number to test. + * @param {Number} b The second number to test. + * @returns {Boolean} True if the numbers are approximately equal, false otherwise. + */ +glMatrix.equals = function(a, b) { + return Math.abs(a - b) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a), Math.abs(b)); +} + +module.exports = glMatrix; diff --git a/node_modules/gl-matrix/src/gl-matrix/mat2.js b/node_modules/gl-matrix/src/gl-matrix/mat2.js new file mode 100755 index 00000000..29b9f0a5 --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/mat2.js @@ -0,0 +1,436 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); + +/** + * @class 2x2 Matrix + * @name mat2 + */ +var mat2 = {}; + +/** + * Creates a new identity mat2 + * + * @returns {mat2} a new 2x2 matrix + */ +mat2.create = function() { + var out = new glMatrix.ARRAY_TYPE(4); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +}; + +/** + * Creates a new mat2 initialized with values from an existing matrix + * + * @param {mat2} a matrix to clone + * @returns {mat2} a new 2x2 matrix + */ +mat2.clone = function(a) { + var out = new glMatrix.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +}; + +/** + * Copy the values from one mat2 to another + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the source matrix + * @returns {mat2} out + */ +mat2.copy = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +}; + +/** + * Set a mat2 to the identity matrix + * + * @param {mat2} out the receiving matrix + * @returns {mat2} out + */ +mat2.identity = function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +}; + +/** + * Create a new mat2 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out A new 2x2 matrix + */ +mat2.fromValues = function(m00, m01, m10, m11) { + var out = new glMatrix.ARRAY_TYPE(4); + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +}; + +/** + * Set the components of a mat2 to the given values + * + * @param {mat2} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m10 Component in column 1, row 0 position (index 2) + * @param {Number} m11 Component in column 1, row 1 position (index 3) + * @returns {mat2} out + */ +mat2.set = function(out, m00, m01, m10, m11) { + out[0] = m00; + out[1] = m01; + out[2] = m10; + out[3] = m11; + return out; +}; + + +/** + * Transpose the values of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the source matrix + * @returns {mat2} out + */ +mat2.transpose = function(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a1 = a[1]; + out[1] = a[2]; + out[2] = a1; + } else { + out[0] = a[0]; + out[1] = a[2]; + out[2] = a[1]; + out[3] = a[3]; + } + + return out; +}; + +/** + * Inverts a mat2 + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the source matrix + * @returns {mat2} out + */ +mat2.invert = function(out, a) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], + + // Calculate the determinant + det = a0 * a3 - a2 * a1; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = a3 * det; + out[1] = -a1 * det; + out[2] = -a2 * det; + out[3] = a0 * det; + + return out; +}; + +/** + * Calculates the adjugate of a mat2 + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the source matrix + * @returns {mat2} out + */ +mat2.adjoint = function(out, a) { + // Caching this value is nessecary if out == a + var a0 = a[0]; + out[0] = a[3]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a0; + + return out; +}; + +/** + * Calculates the determinant of a mat2 + * + * @param {mat2} a the source matrix + * @returns {Number} determinant of a + */ +mat2.determinant = function (a) { + return a[0] * a[3] - a[2] * a[1]; +}; + +/** + * Multiplies two mat2's + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @returns {mat2} out + */ +mat2.multiply = function (out, a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + return out; +}; + +/** + * Alias for {@link mat2.multiply} + * @function + */ +mat2.mul = mat2.multiply; + +/** + * Rotates a mat2 by the given angle + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ +mat2.rotate = function (out, a, rad) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], + s = Math.sin(rad), + c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + return out; +}; + +/** + * Scales the mat2 by the dimensions in the given vec2 + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the matrix to rotate + * @param {vec2} v the vec2 to scale the matrix by + * @returns {mat2} out + **/ +mat2.scale = function(out, a, v) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], + v0 = v[0], v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + return out; +}; + +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.rotate(dest, dest, rad); + * + * @param {mat2} out mat2 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2} out + */ +mat2.fromRotation = function(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + return out; +} + +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2.identity(dest); + * mat2.scale(dest, dest, vec); + * + * @param {mat2} out mat2 receiving operation result + * @param {vec2} v Scaling vector + * @returns {mat2} out + */ +mat2.fromScaling = function(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + return out; +} + +/** + * Returns a string representation of a mat2 + * + * @param {mat2} mat matrix to represent as a string + * @returns {String} string representation of the matrix + */ +mat2.str = function (a) { + return 'mat2(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')'; +}; + +/** + * Returns Frobenius norm of a mat2 + * + * @param {mat2} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ +mat2.frob = function (a) { + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2))) +}; + +/** + * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix + * @param {mat2} L the lower triangular matrix + * @param {mat2} D the diagonal matrix + * @param {mat2} U the upper triangular matrix + * @param {mat2} a the input matrix to factorize + */ + +mat2.LDU = function (L, D, U, a) { + L[2] = a[2]/a[0]; + U[0] = a[0]; + U[1] = a[1]; + U[3] = a[3] - L[2] * U[1]; + return [L, D, U]; +}; + +/** + * Adds two mat2's + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @returns {mat2} out + */ +mat2.add = function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +}; + +/** + * Subtracts matrix b from matrix a + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @returns {mat2} out + */ +mat2.subtract = function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +}; + +/** + * Alias for {@link mat2.subtract} + * @function + */ +mat2.sub = mat2.subtract; + +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat2} a The first matrix. + * @param {mat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat2.exactEquals = function (a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +}; + +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat2} a The first matrix. + * @param {mat2} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat2.equals = function (a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; + return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3))); +}; + +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2} out the receiving matrix + * @param {mat2} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2} out + */ +mat2.multiplyScalar = function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +}; + +/** + * Adds two mat2's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2} out the receiving vector + * @param {mat2} a the first operand + * @param {mat2} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2} out + */ +mat2.multiplyScalarAndAdd = function(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale); + out[1] = a[1] + (b[1] * scale); + out[2] = a[2] + (b[2] * scale); + out[3] = a[3] + (b[3] * scale); + return out; +}; + +module.exports = mat2; diff --git a/node_modules/gl-matrix/src/gl-matrix/mat2d.js b/node_modules/gl-matrix/src/gl-matrix/mat2d.js new file mode 100755 index 00000000..b4e5e8ab --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/mat2d.js @@ -0,0 +1,469 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); + +/** + * @class 2x3 Matrix + * @name mat2d + * + * @description + * A mat2d contains six elements defined as: + *
      + * [a, c, tx,
      + *  b, d, ty]
      + * 
      + * This is a short form for the 3x3 matrix: + *
      + * [a, c, tx,
      + *  b, d, ty,
      + *  0, 0, 1]
      + * 
      + * The last row is ignored so the array is shorter and operations are faster. + */ +var mat2d = {}; + +/** + * Creates a new identity mat2d + * + * @returns {mat2d} a new 2x3 matrix + */ +mat2d.create = function() { + var out = new glMatrix.ARRAY_TYPE(6); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +}; + +/** + * Creates a new mat2d initialized with values from an existing matrix + * + * @param {mat2d} a matrix to clone + * @returns {mat2d} a new 2x3 matrix + */ +mat2d.clone = function(a) { + var out = new glMatrix.ARRAY_TYPE(6); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +}; + +/** + * Copy the values from one mat2d to another + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the source matrix + * @returns {mat2d} out + */ +mat2d.copy = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + return out; +}; + +/** + * Set a mat2d to the identity matrix + * + * @param {mat2d} out the receiving matrix + * @returns {mat2d} out + */ +mat2d.identity = function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +}; + +/** + * Create a new mat2d with the given values + * + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} A new mat2d + */ +mat2d.fromValues = function(a, b, c, d, tx, ty) { + var out = new glMatrix.ARRAY_TYPE(6); + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +}; + +/** + * Set the components of a mat2d to the given values + * + * @param {mat2d} out the receiving matrix + * @param {Number} a Component A (index 0) + * @param {Number} b Component B (index 1) + * @param {Number} c Component C (index 2) + * @param {Number} d Component D (index 3) + * @param {Number} tx Component TX (index 4) + * @param {Number} ty Component TY (index 5) + * @returns {mat2d} out + */ +mat2d.set = function(out, a, b, c, d, tx, ty) { + out[0] = a; + out[1] = b; + out[2] = c; + out[3] = d; + out[4] = tx; + out[5] = ty; + return out; +}; + +/** + * Inverts a mat2d + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the source matrix + * @returns {mat2d} out + */ +mat2d.invert = function(out, a) { + var aa = a[0], ab = a[1], ac = a[2], ad = a[3], + atx = a[4], aty = a[5]; + + var det = aa * ad - ab * ac; + if(!det){ + return null; + } + det = 1.0 / det; + + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; +}; + +/** + * Calculates the determinant of a mat2d + * + * @param {mat2d} a the source matrix + * @returns {Number} determinant of a + */ +mat2d.determinant = function (a) { + return a[0] * a[3] - a[1] * a[2]; +}; + +/** + * Multiplies two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @returns {mat2d} out + */ +mat2d.multiply = function (out, a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], + b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5]; + out[0] = a0 * b0 + a2 * b1; + out[1] = a1 * b0 + a3 * b1; + out[2] = a0 * b2 + a2 * b3; + out[3] = a1 * b2 + a3 * b3; + out[4] = a0 * b4 + a2 * b5 + a4; + out[5] = a1 * b4 + a3 * b5 + a5; + return out; +}; + +/** + * Alias for {@link mat2d.multiply} + * @function + */ +mat2d.mul = mat2d.multiply; + +/** + * Rotates a mat2d by the given angle + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ +mat2d.rotate = function (out, a, rad) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], + s = Math.sin(rad), + c = Math.cos(rad); + out[0] = a0 * c + a2 * s; + out[1] = a1 * c + a3 * s; + out[2] = a0 * -s + a2 * c; + out[3] = a1 * -s + a3 * c; + out[4] = a4; + out[5] = a5; + return out; +}; + +/** + * Scales the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the matrix to translate + * @param {vec2} v the vec2 to scale the matrix by + * @returns {mat2d} out + **/ +mat2d.scale = function(out, a, v) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], + v0 = v[0], v1 = v[1]; + out[0] = a0 * v0; + out[1] = a1 * v0; + out[2] = a2 * v1; + out[3] = a3 * v1; + out[4] = a4; + out[5] = a5; + return out; +}; + +/** + * Translates the mat2d by the dimensions in the given vec2 + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the matrix to translate + * @param {vec2} v the vec2 to translate the matrix by + * @returns {mat2d} out + **/ +mat2d.translate = function(out, a, v) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], + v0 = v[0], v1 = v[1]; + out[0] = a0; + out[1] = a1; + out[2] = a2; + out[3] = a3; + out[4] = a0 * v0 + a2 * v1 + a4; + out[5] = a1 * v0 + a3 * v1 + a5; + return out; +}; + +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.rotate(dest, dest, rad); + * + * @param {mat2d} out mat2d receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat2d} out + */ +mat2d.fromRotation = function(out, rad) { + var s = Math.sin(rad), c = Math.cos(rad); + out[0] = c; + out[1] = s; + out[2] = -s; + out[3] = c; + out[4] = 0; + out[5] = 0; + return out; +} + +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.scale(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {vec2} v Scaling vector + * @returns {mat2d} out + */ +mat2d.fromScaling = function(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = v[1]; + out[4] = 0; + out[5] = 0; + return out; +} + +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat2d.identity(dest); + * mat2d.translate(dest, dest, vec); + * + * @param {mat2d} out mat2d receiving operation result + * @param {vec2} v Translation vector + * @returns {mat2d} out + */ +mat2d.fromTranslation = function(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = v[0]; + out[5] = v[1]; + return out; +} + +/** + * Returns a string representation of a mat2d + * + * @param {mat2d} a matrix to represent as a string + * @returns {String} string representation of the matrix + */ +mat2d.str = function (a) { + return 'mat2d(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + + a[3] + ', ' + a[4] + ', ' + a[5] + ')'; +}; + +/** + * Returns Frobenius norm of a mat2d + * + * @param {mat2d} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ +mat2d.frob = function (a) { + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1)) +}; + +/** + * Adds two mat2d's + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @returns {mat2d} out + */ +mat2d.add = function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + return out; +}; + +/** + * Subtracts matrix b from matrix a + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @returns {mat2d} out + */ +mat2d.subtract = function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + return out; +}; + +/** + * Alias for {@link mat2d.subtract} + * @function + */ +mat2d.sub = mat2d.subtract; + +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat2d} out the receiving matrix + * @param {mat2d} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat2d} out + */ +mat2d.multiplyScalar = function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + return out; +}; + +/** + * Adds two mat2d's after multiplying each element of the second operand by a scalar value. + * + * @param {mat2d} out the receiving vector + * @param {mat2d} a the first operand + * @param {mat2d} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat2d} out + */ +mat2d.multiplyScalarAndAdd = function(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale); + out[1] = a[1] + (b[1] * scale); + out[2] = a[2] + (b[2] * scale); + out[3] = a[3] + (b[3] * scale); + out[4] = a[4] + (b[4] * scale); + out[5] = a[5] + (b[5] * scale); + return out; +}; + +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat2d} a The first matrix. + * @param {mat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat2d.exactEquals = function (a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5]; +}; + +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat2d} a The first matrix. + * @param {mat2d} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat2d.equals = function (a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5]; + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5]; + return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a5), Math.abs(b5))); +}; + +module.exports = mat2d; diff --git a/node_modules/gl-matrix/src/gl-matrix/mat3.js b/node_modules/gl-matrix/src/gl-matrix/mat3.js new file mode 100755 index 00000000..e5d84dc1 --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/mat3.js @@ -0,0 +1,746 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); + +/** + * @class 3x3 Matrix + * @name mat3 + */ +var mat3 = {}; + +/** + * Creates a new identity mat3 + * + * @returns {mat3} a new 3x3 matrix + */ +mat3.create = function() { + var out = new glMatrix.ARRAY_TYPE(9); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +}; + +/** + * Copies the upper-left 3x3 values into the given mat3. + * + * @param {mat3} out the receiving 3x3 matrix + * @param {mat4} a the source 4x4 matrix + * @returns {mat3} out + */ +mat3.fromMat4 = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + return out; +}; + +/** + * Creates a new mat3 initialized with values from an existing matrix + * + * @param {mat3} a matrix to clone + * @returns {mat3} a new 3x3 matrix + */ +mat3.clone = function(a) { + var out = new glMatrix.ARRAY_TYPE(9); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +}; + +/** + * Copy the values from one mat3 to another + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the source matrix + * @returns {mat3} out + */ +mat3.copy = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +}; + +/** + * Create a new mat3 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} A new mat3 + */ +mat3.fromValues = function(m00, m01, m02, m10, m11, m12, m20, m21, m22) { + var out = new glMatrix.ARRAY_TYPE(9); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +}; + +/** + * Set the components of a mat3 to the given values + * + * @param {mat3} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m10 Component in column 1, row 0 position (index 3) + * @param {Number} m11 Component in column 1, row 1 position (index 4) + * @param {Number} m12 Component in column 1, row 2 position (index 5) + * @param {Number} m20 Component in column 2, row 0 position (index 6) + * @param {Number} m21 Component in column 2, row 1 position (index 7) + * @param {Number} m22 Component in column 2, row 2 position (index 8) + * @returns {mat3} out + */ +mat3.set = function(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m10; + out[4] = m11; + out[5] = m12; + out[6] = m20; + out[7] = m21; + out[8] = m22; + return out; +}; + +/** + * Set a mat3 to the identity matrix + * + * @param {mat3} out the receiving matrix + * @returns {mat3} out + */ +mat3.identity = function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +}; + +/** + * Transpose the values of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the source matrix + * @returns {mat3} out + */ +mat3.transpose = function(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], a02 = a[2], a12 = a[5]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a01; + out[5] = a[7]; + out[6] = a02; + out[7] = a12; + } else { + out[0] = a[0]; + out[1] = a[3]; + out[2] = a[6]; + out[3] = a[1]; + out[4] = a[4]; + out[5] = a[7]; + out[6] = a[2]; + out[7] = a[5]; + out[8] = a[8]; + } + + return out; +}; + +/** + * Inverts a mat3 + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the source matrix + * @returns {mat3} out + */ +mat3.invert = function(out, a) { + var a00 = a[0], a01 = a[1], a02 = a[2], + a10 = a[3], a11 = a[4], a12 = a[5], + a20 = a[6], a21 = a[7], a22 = a[8], + + b01 = a22 * a11 - a12 * a21, + b11 = -a22 * a10 + a12 * a20, + b21 = a21 * a10 - a11 * a20, + + // Calculate the determinant + det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = b01 * det; + out[1] = (-a22 * a01 + a02 * a21) * det; + out[2] = (a12 * a01 - a02 * a11) * det; + out[3] = b11 * det; + out[4] = (a22 * a00 - a02 * a20) * det; + out[5] = (-a12 * a00 + a02 * a10) * det; + out[6] = b21 * det; + out[7] = (-a21 * a00 + a01 * a20) * det; + out[8] = (a11 * a00 - a01 * a10) * det; + return out; +}; + +/** + * Calculates the adjugate of a mat3 + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the source matrix + * @returns {mat3} out + */ +mat3.adjoint = function(out, a) { + var a00 = a[0], a01 = a[1], a02 = a[2], + a10 = a[3], a11 = a[4], a12 = a[5], + a20 = a[6], a21 = a[7], a22 = a[8]; + + out[0] = (a11 * a22 - a12 * a21); + out[1] = (a02 * a21 - a01 * a22); + out[2] = (a01 * a12 - a02 * a11); + out[3] = (a12 * a20 - a10 * a22); + out[4] = (a00 * a22 - a02 * a20); + out[5] = (a02 * a10 - a00 * a12); + out[6] = (a10 * a21 - a11 * a20); + out[7] = (a01 * a20 - a00 * a21); + out[8] = (a00 * a11 - a01 * a10); + return out; +}; + +/** + * Calculates the determinant of a mat3 + * + * @param {mat3} a the source matrix + * @returns {Number} determinant of a + */ +mat3.determinant = function (a) { + var a00 = a[0], a01 = a[1], a02 = a[2], + a10 = a[3], a11 = a[4], a12 = a[5], + a20 = a[6], a21 = a[7], a22 = a[8]; + + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); +}; + +/** + * Multiplies two mat3's + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @returns {mat3} out + */ +mat3.multiply = function (out, a, b) { + var a00 = a[0], a01 = a[1], a02 = a[2], + a10 = a[3], a11 = a[4], a12 = a[5], + a20 = a[6], a21 = a[7], a22 = a[8], + + b00 = b[0], b01 = b[1], b02 = b[2], + b10 = b[3], b11 = b[4], b12 = b[5], + b20 = b[6], b21 = b[7], b22 = b[8]; + + out[0] = b00 * a00 + b01 * a10 + b02 * a20; + out[1] = b00 * a01 + b01 * a11 + b02 * a21; + out[2] = b00 * a02 + b01 * a12 + b02 * a22; + + out[3] = b10 * a00 + b11 * a10 + b12 * a20; + out[4] = b10 * a01 + b11 * a11 + b12 * a21; + out[5] = b10 * a02 + b11 * a12 + b12 * a22; + + out[6] = b20 * a00 + b21 * a10 + b22 * a20; + out[7] = b20 * a01 + b21 * a11 + b22 * a21; + out[8] = b20 * a02 + b21 * a12 + b22 * a22; + return out; +}; + +/** + * Alias for {@link mat3.multiply} + * @function + */ +mat3.mul = mat3.multiply; + +/** + * Translate a mat3 by the given vector + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the matrix to translate + * @param {vec2} v vector to translate by + * @returns {mat3} out + */ +mat3.translate = function(out, a, v) { + var a00 = a[0], a01 = a[1], a02 = a[2], + a10 = a[3], a11 = a[4], a12 = a[5], + a20 = a[6], a21 = a[7], a22 = a[8], + x = v[0], y = v[1]; + + out[0] = a00; + out[1] = a01; + out[2] = a02; + + out[3] = a10; + out[4] = a11; + out[5] = a12; + + out[6] = x * a00 + y * a10 + a20; + out[7] = x * a01 + y * a11 + a21; + out[8] = x * a02 + y * a12 + a22; + return out; +}; + +/** + * Rotates a mat3 by the given angle + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ +mat3.rotate = function (out, a, rad) { + var a00 = a[0], a01 = a[1], a02 = a[2], + a10 = a[3], a11 = a[4], a12 = a[5], + a20 = a[6], a21 = a[7], a22 = a[8], + + s = Math.sin(rad), + c = Math.cos(rad); + + out[0] = c * a00 + s * a10; + out[1] = c * a01 + s * a11; + out[2] = c * a02 + s * a12; + + out[3] = c * a10 - s * a00; + out[4] = c * a11 - s * a01; + out[5] = c * a12 - s * a02; + + out[6] = a20; + out[7] = a21; + out[8] = a22; + return out; +}; + +/** + * Scales the mat3 by the dimensions in the given vec2 + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the matrix to rotate + * @param {vec2} v the vec2 to scale the matrix by + * @returns {mat3} out + **/ +mat3.scale = function(out, a, v) { + var x = v[0], y = v[1]; + + out[0] = x * a[0]; + out[1] = x * a[1]; + out[2] = x * a[2]; + + out[3] = y * a[3]; + out[4] = y * a[4]; + out[5] = y * a[5]; + + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + return out; +}; + +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.translate(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {vec2} v Translation vector + * @returns {mat3} out + */ +mat3.fromTranslation = function(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = v[0]; + out[7] = v[1]; + out[8] = 1; + return out; +} + +/** + * Creates a matrix from a given angle + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.rotate(dest, dest, rad); + * + * @param {mat3} out mat3 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat3} out + */ +mat3.fromRotation = function(out, rad) { + var s = Math.sin(rad), c = Math.cos(rad); + + out[0] = c; + out[1] = s; + out[2] = 0; + + out[3] = -s; + out[4] = c; + out[5] = 0; + + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} + +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat3.identity(dest); + * mat3.scale(dest, dest, vec); + * + * @param {mat3} out mat3 receiving operation result + * @param {vec2} v Scaling vector + * @returns {mat3} out + */ +mat3.fromScaling = function(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + + out[3] = 0; + out[4] = v[1]; + out[5] = 0; + + out[6] = 0; + out[7] = 0; + out[8] = 1; + return out; +} + +/** + * Copies the values from a mat2d into a mat3 + * + * @param {mat3} out the receiving matrix + * @param {mat2d} a the matrix to copy + * @returns {mat3} out + **/ +mat3.fromMat2d = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = 0; + + out[3] = a[2]; + out[4] = a[3]; + out[5] = 0; + + out[6] = a[4]; + out[7] = a[5]; + out[8] = 1; + return out; +}; + +/** +* Calculates a 3x3 matrix from the given quaternion +* +* @param {mat3} out mat3 receiving operation result +* @param {quat} q Quaternion to create matrix from +* +* @returns {mat3} out +*/ +mat3.fromQuat = function (out, q) { + var x = q[0], y = q[1], z = q[2], w = q[3], + x2 = x + x, + y2 = y + y, + z2 = z + z, + + xx = x * x2, + yx = y * x2, + yy = y * y2, + zx = z * x2, + zy = z * y2, + zz = z * z2, + wx = w * x2, + wy = w * y2, + wz = w * z2; + + out[0] = 1 - yy - zz; + out[3] = yx - wz; + out[6] = zx + wy; + + out[1] = yx + wz; + out[4] = 1 - xx - zz; + out[7] = zy - wx; + + out[2] = zx - wy; + out[5] = zy + wx; + out[8] = 1 - xx - yy; + + return out; +}; + +/** +* Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix +* +* @param {mat3} out mat3 receiving operation result +* @param {mat4} a Mat4 to derive the normal matrix from +* +* @returns {mat3} out +*/ +mat3.normalFromMat4 = function (out, a) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15], + + b00 = a00 * a11 - a01 * a10, + b01 = a00 * a12 - a02 * a10, + b02 = a00 * a13 - a03 * a10, + b03 = a01 * a12 - a02 * a11, + b04 = a01 * a13 - a03 * a11, + b05 = a02 * a13 - a03 * a12, + b06 = a20 * a31 - a21 * a30, + b07 = a20 * a32 - a22 * a30, + b08 = a20 * a33 - a23 * a30, + b09 = a21 * a32 - a22 * a31, + b10 = a21 * a33 - a23 * a31, + b11 = a22 * a33 - a23 * a32, + + // Calculate the determinant + det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return out; +}; + +/** + * Returns a string representation of a mat3 + * + * @param {mat3} mat matrix to represent as a string + * @returns {String} string representation of the matrix + */ +mat3.str = function (a) { + return 'mat3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + + a[3] + ', ' + a[4] + ', ' + a[5] + ', ' + + a[6] + ', ' + a[7] + ', ' + a[8] + ')'; +}; + +/** + * Returns Frobenius norm of a mat3 + * + * @param {mat3} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ +mat3.frob = function (a) { + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2))) +}; + +/** + * Adds two mat3's + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @returns {mat3} out + */ +mat3.add = function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + return out; +}; + +/** + * Subtracts matrix b from matrix a + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @returns {mat3} out + */ +mat3.subtract = function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + return out; +}; + +/** + * Alias for {@link mat3.subtract} + * @function + */ +mat3.sub = mat3.subtract; + +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat3} out the receiving matrix + * @param {mat3} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat3} out + */ +mat3.multiplyScalar = function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + return out; +}; + +/** + * Adds two mat3's after multiplying each element of the second operand by a scalar value. + * + * @param {mat3} out the receiving vector + * @param {mat3} a the first operand + * @param {mat3} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat3} out + */ +mat3.multiplyScalarAndAdd = function(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale); + out[1] = a[1] + (b[1] * scale); + out[2] = a[2] + (b[2] * scale); + out[3] = a[3] + (b[3] * scale); + out[4] = a[4] + (b[4] * scale); + out[5] = a[5] + (b[5] * scale); + out[6] = a[6] + (b[6] * scale); + out[7] = a[7] + (b[7] * scale); + out[8] = a[8] + (b[8] * scale); + return out; +}; + +/* + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat3} a The first matrix. + * @param {mat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat3.exactEquals = function (a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && + a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && + a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; +}; + +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat3} a The first matrix. + * @param {mat3} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat3.equals = function (a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7], a8 = a[8]; + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = a[6], b7 = b[7], b8 = b[8]; + return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a7), Math.abs(b7)) && + Math.abs(a8 - b8) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a8), Math.abs(b8))); +}; + + +module.exports = mat3; diff --git a/node_modules/gl-matrix/src/gl-matrix/mat4.js b/node_modules/gl-matrix/src/gl-matrix/mat4.js new file mode 100755 index 00000000..fc308966 --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/mat4.js @@ -0,0 +1,2136 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); + +/** + * @class 4x4 Matrix + * @name mat4 + */ +var mat4 = { + scalar: {}, + SIMD: {}, +}; + +/** + * Creates a new identity mat4 + * + * @returns {mat4} a new 4x4 matrix + */ +mat4.create = function() { + var out = new glMatrix.ARRAY_TYPE(16); + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +}; + +/** + * Creates a new mat4 initialized with values from an existing matrix + * + * @param {mat4} a matrix to clone + * @returns {mat4} a new 4x4 matrix + */ +mat4.clone = function(a) { + var out = new glMatrix.ARRAY_TYPE(16); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +}; + +/** + * Copy the values from one mat4 to another + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.copy = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +}; + +/** + * Create a new mat4 with the given values + * + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} A new mat4 + */ +mat4.fromValues = function(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + var out = new glMatrix.ARRAY_TYPE(16); + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +}; + +/** + * Set the components of a mat4 to the given values + * + * @param {mat4} out the receiving matrix + * @param {Number} m00 Component in column 0, row 0 position (index 0) + * @param {Number} m01 Component in column 0, row 1 position (index 1) + * @param {Number} m02 Component in column 0, row 2 position (index 2) + * @param {Number} m03 Component in column 0, row 3 position (index 3) + * @param {Number} m10 Component in column 1, row 0 position (index 4) + * @param {Number} m11 Component in column 1, row 1 position (index 5) + * @param {Number} m12 Component in column 1, row 2 position (index 6) + * @param {Number} m13 Component in column 1, row 3 position (index 7) + * @param {Number} m20 Component in column 2, row 0 position (index 8) + * @param {Number} m21 Component in column 2, row 1 position (index 9) + * @param {Number} m22 Component in column 2, row 2 position (index 10) + * @param {Number} m23 Component in column 2, row 3 position (index 11) + * @param {Number} m30 Component in column 3, row 0 position (index 12) + * @param {Number} m31 Component in column 3, row 1 position (index 13) + * @param {Number} m32 Component in column 3, row 2 position (index 14) + * @param {Number} m33 Component in column 3, row 3 position (index 15) + * @returns {mat4} out + */ +mat4.set = function(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + return out; +}; + + +/** + * Set a mat4 to the identity matrix + * + * @param {mat4} out the receiving matrix + * @returns {mat4} out + */ +mat4.identity = function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +}; + +/** + * Transpose the values of a mat4 not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.scalar.transpose = function(out, a) { + // If we are transposing ourselves we can skip a few steps but have to cache some values + if (out === a) { + var a01 = a[1], a02 = a[2], a03 = a[3], + a12 = a[6], a13 = a[7], + a23 = a[11]; + + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a01; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a02; + out[9] = a12; + out[11] = a[14]; + out[12] = a03; + out[13] = a13; + out[14] = a23; + } else { + out[0] = a[0]; + out[1] = a[4]; + out[2] = a[8]; + out[3] = a[12]; + out[4] = a[1]; + out[5] = a[5]; + out[6] = a[9]; + out[7] = a[13]; + out[8] = a[2]; + out[9] = a[6]; + out[10] = a[10]; + out[11] = a[14]; + out[12] = a[3]; + out[13] = a[7]; + out[14] = a[11]; + out[15] = a[15]; + } + + return out; +}; + +/** + * Transpose the values of a mat4 using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.SIMD.transpose = function(out, a) { + var a0, a1, a2, a3, + tmp01, tmp23, + out0, out1, out2, out3; + + a0 = SIMD.Float32x4.load(a, 0); + a1 = SIMD.Float32x4.load(a, 4); + a2 = SIMD.Float32x4.load(a, 8); + a3 = SIMD.Float32x4.load(a, 12); + + tmp01 = SIMD.Float32x4.shuffle(a0, a1, 0, 1, 4, 5); + tmp23 = SIMD.Float32x4.shuffle(a2, a3, 0, 1, 4, 5); + out0 = SIMD.Float32x4.shuffle(tmp01, tmp23, 0, 2, 4, 6); + out1 = SIMD.Float32x4.shuffle(tmp01, tmp23, 1, 3, 5, 7); + SIMD.Float32x4.store(out, 0, out0); + SIMD.Float32x4.store(out, 4, out1); + + tmp01 = SIMD.Float32x4.shuffle(a0, a1, 2, 3, 6, 7); + tmp23 = SIMD.Float32x4.shuffle(a2, a3, 2, 3, 6, 7); + out2 = SIMD.Float32x4.shuffle(tmp01, tmp23, 0, 2, 4, 6); + out3 = SIMD.Float32x4.shuffle(tmp01, tmp23, 1, 3, 5, 7); + SIMD.Float32x4.store(out, 8, out2); + SIMD.Float32x4.store(out, 12, out3); + + return out; +}; + +/** + * Transpse a mat4 using SIMD if available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.transpose = glMatrix.USE_SIMD ? mat4.SIMD.transpose : mat4.scalar.transpose; + +/** + * Inverts a mat4 not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.scalar.invert = function(out, a) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15], + + b00 = a00 * a11 - a01 * a10, + b01 = a00 * a12 - a02 * a10, + b02 = a00 * a13 - a03 * a10, + b03 = a01 * a12 - a02 * a11, + b04 = a01 * a13 - a03 * a11, + b05 = a02 * a13 - a03 * a12, + b06 = a20 * a31 - a21 * a30, + b07 = a20 * a32 - a22 * a30, + b08 = a20 * a33 - a23 * a30, + b09 = a21 * a32 - a22 * a31, + b10 = a21 * a33 - a23 * a31, + b11 = a22 * a33 - a23 * a32, + + // Calculate the determinant + det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return out; +}; + +/** + * Inverts a mat4 using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.SIMD.invert = function(out, a) { + var row0, row1, row2, row3, + tmp1, + minor0, minor1, minor2, minor3, + det, + a0 = SIMD.Float32x4.load(a, 0), + a1 = SIMD.Float32x4.load(a, 4), + a2 = SIMD.Float32x4.load(a, 8), + a3 = SIMD.Float32x4.load(a, 12); + + // Compute matrix adjugate + tmp1 = SIMD.Float32x4.shuffle(a0, a1, 0, 1, 4, 5); + row1 = SIMD.Float32x4.shuffle(a2, a3, 0, 1, 4, 5); + row0 = SIMD.Float32x4.shuffle(tmp1, row1, 0, 2, 4, 6); + row1 = SIMD.Float32x4.shuffle(row1, tmp1, 1, 3, 5, 7); + tmp1 = SIMD.Float32x4.shuffle(a0, a1, 2, 3, 6, 7); + row3 = SIMD.Float32x4.shuffle(a2, a3, 2, 3, 6, 7); + row2 = SIMD.Float32x4.shuffle(tmp1, row3, 0, 2, 4, 6); + row3 = SIMD.Float32x4.shuffle(row3, tmp1, 1, 3, 5, 7); + + tmp1 = SIMD.Float32x4.mul(row2, row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor0 = SIMD.Float32x4.mul(row1, tmp1); + minor1 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row1, tmp1), minor0); + minor1 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor1); + minor1 = SIMD.Float32x4.swizzle(minor1, 2, 3, 0, 1); + + tmp1 = SIMD.Float32x4.mul(row1, row2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor0 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor0); + minor3 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.sub(minor0, SIMD.Float32x4.mul(row3, tmp1)); + minor3 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor3); + minor3 = SIMD.Float32x4.swizzle(minor3, 2, 3, 0, 1); + + tmp1 = SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(row1, 2, 3, 0, 1), row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + row2 = SIMD.Float32x4.swizzle(row2, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row2, tmp1), minor0); + minor2 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.sub(minor0, SIMD.Float32x4.mul(row2, tmp1)); + minor2 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor2); + minor2 = SIMD.Float32x4.swizzle(minor2, 2, 3, 0, 1); + + tmp1 = SIMD.Float32x4.mul(row0, row1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor2 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor2); + minor3 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row2, tmp1), minor3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor2 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row3, tmp1), minor2); + minor3 = SIMD.Float32x4.sub(minor3, SIMD.Float32x4.mul(row2, tmp1)); + + tmp1 = SIMD.Float32x4.mul(row0, row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor1 = SIMD.Float32x4.sub(minor1, SIMD.Float32x4.mul(row2, tmp1)); + minor2 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row1, tmp1), minor2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor1 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row2, tmp1), minor1); + minor2 = SIMD.Float32x4.sub(minor2, SIMD.Float32x4.mul(row1, tmp1)); + + tmp1 = SIMD.Float32x4.mul(row0, row2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor1 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor1); + minor3 = SIMD.Float32x4.sub(minor3, SIMD.Float32x4.mul(row1, tmp1)); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor1 = SIMD.Float32x4.sub(minor1, SIMD.Float32x4.mul(row3, tmp1)); + minor3 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row1, tmp1), minor3); + + // Compute matrix determinant + det = SIMD.Float32x4.mul(row0, minor0); + det = SIMD.Float32x4.add(SIMD.Float32x4.swizzle(det, 2, 3, 0, 1), det); + det = SIMD.Float32x4.add(SIMD.Float32x4.swizzle(det, 1, 0, 3, 2), det); + tmp1 = SIMD.Float32x4.reciprocalApproximation(det); + det = SIMD.Float32x4.sub( + SIMD.Float32x4.add(tmp1, tmp1), + SIMD.Float32x4.mul(det, SIMD.Float32x4.mul(tmp1, tmp1))); + det = SIMD.Float32x4.swizzle(det, 0, 0, 0, 0); + if (!det) { + return null; + } + + // Compute matrix inverse + SIMD.Float32x4.store(out, 0, SIMD.Float32x4.mul(det, minor0)); + SIMD.Float32x4.store(out, 4, SIMD.Float32x4.mul(det, minor1)); + SIMD.Float32x4.store(out, 8, SIMD.Float32x4.mul(det, minor2)); + SIMD.Float32x4.store(out, 12, SIMD.Float32x4.mul(det, minor3)); + return out; +} + +/** + * Inverts a mat4 using SIMD if available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.invert = glMatrix.USE_SIMD ? mat4.SIMD.invert : mat4.scalar.invert; + +/** + * Calculates the adjugate of a mat4 not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.scalar.adjoint = function(out, a) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + + out[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + out[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + out[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + out[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + out[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + out[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + out[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + out[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + return out; +}; + +/** + * Calculates the adjugate of a mat4 using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ +mat4.SIMD.adjoint = function(out, a) { + var a0, a1, a2, a3; + var row0, row1, row2, row3; + var tmp1; + var minor0, minor1, minor2, minor3; + + var a0 = SIMD.Float32x4.load(a, 0); + var a1 = SIMD.Float32x4.load(a, 4); + var a2 = SIMD.Float32x4.load(a, 8); + var a3 = SIMD.Float32x4.load(a, 12); + + // Transpose the source matrix. Sort of. Not a true transpose operation + tmp1 = SIMD.Float32x4.shuffle(a0, a1, 0, 1, 4, 5); + row1 = SIMD.Float32x4.shuffle(a2, a3, 0, 1, 4, 5); + row0 = SIMD.Float32x4.shuffle(tmp1, row1, 0, 2, 4, 6); + row1 = SIMD.Float32x4.shuffle(row1, tmp1, 1, 3, 5, 7); + + tmp1 = SIMD.Float32x4.shuffle(a0, a1, 2, 3, 6, 7); + row3 = SIMD.Float32x4.shuffle(a2, a3, 2, 3, 6, 7); + row2 = SIMD.Float32x4.shuffle(tmp1, row3, 0, 2, 4, 6); + row3 = SIMD.Float32x4.shuffle(row3, tmp1, 1, 3, 5, 7); + + tmp1 = SIMD.Float32x4.mul(row2, row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor0 = SIMD.Float32x4.mul(row1, tmp1); + minor1 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row1, tmp1), minor0); + minor1 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor1); + minor1 = SIMD.Float32x4.swizzle(minor1, 2, 3, 0, 1); + + tmp1 = SIMD.Float32x4.mul(row1, row2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor0 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor0); + minor3 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.sub(minor0, SIMD.Float32x4.mul(row3, tmp1)); + minor3 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor3); + minor3 = SIMD.Float32x4.swizzle(minor3, 2, 3, 0, 1); + + tmp1 = SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(row1, 2, 3, 0, 1), row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + row2 = SIMD.Float32x4.swizzle(row2, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row2, tmp1), minor0); + minor2 = SIMD.Float32x4.mul(row0, tmp1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor0 = SIMD.Float32x4.sub(minor0, SIMD.Float32x4.mul(row2, tmp1)); + minor2 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row0, tmp1), minor2); + minor2 = SIMD.Float32x4.swizzle(minor2, 2, 3, 0, 1); + + tmp1 = SIMD.Float32x4.mul(row0, row1); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor2 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor2); + minor3 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row2, tmp1), minor3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor2 = SIMD.Float32x4.sub(SIMD.Float32x4.mul(row3, tmp1), minor2); + minor3 = SIMD.Float32x4.sub(minor3, SIMD.Float32x4.mul(row2, tmp1)); + + tmp1 = SIMD.Float32x4.mul(row0, row3); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor1 = SIMD.Float32x4.sub(minor1, SIMD.Float32x4.mul(row2, tmp1)); + minor2 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row1, tmp1), minor2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor1 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row2, tmp1), minor1); + minor2 = SIMD.Float32x4.sub(minor2, SIMD.Float32x4.mul(row1, tmp1)); + + tmp1 = SIMD.Float32x4.mul(row0, row2); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 1, 0, 3, 2); + minor1 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row3, tmp1), minor1); + minor3 = SIMD.Float32x4.sub(minor3, SIMD.Float32x4.mul(row1, tmp1)); + tmp1 = SIMD.Float32x4.swizzle(tmp1, 2, 3, 0, 1); + minor1 = SIMD.Float32x4.sub(minor1, SIMD.Float32x4.mul(row3, tmp1)); + minor3 = SIMD.Float32x4.add(SIMD.Float32x4.mul(row1, tmp1), minor3); + + SIMD.Float32x4.store(out, 0, minor0); + SIMD.Float32x4.store(out, 4, minor1); + SIMD.Float32x4.store(out, 8, minor2); + SIMD.Float32x4.store(out, 12, minor3); + return out; +}; + +/** + * Calculates the adjugate of a mat4 using SIMD if available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the source matrix + * @returns {mat4} out + */ + mat4.adjoint = glMatrix.USE_SIMD ? mat4.SIMD.adjoint : mat4.scalar.adjoint; + +/** + * Calculates the determinant of a mat4 + * + * @param {mat4} a the source matrix + * @returns {Number} determinant of a + */ +mat4.determinant = function (a) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15], + + b00 = a00 * a11 - a01 * a10, + b01 = a00 * a12 - a02 * a10, + b02 = a00 * a13 - a03 * a10, + b03 = a01 * a12 - a02 * a11, + b04 = a01 * a13 - a03 * a11, + b05 = a02 * a13 - a03 * a12, + b06 = a20 * a31 - a21 * a30, + b07 = a20 * a32 - a22 * a30, + b08 = a20 * a33 - a23 * a30, + b09 = a21 * a32 - a22 * a31, + b10 = a21 * a33 - a23 * a31, + b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; +}; + +/** + * Multiplies two mat4's explicitly using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand, must be a Float32Array + * @param {mat4} b the second operand, must be a Float32Array + * @returns {mat4} out + */ +mat4.SIMD.multiply = function (out, a, b) { + var a0 = SIMD.Float32x4.load(a, 0); + var a1 = SIMD.Float32x4.load(a, 4); + var a2 = SIMD.Float32x4.load(a, 8); + var a3 = SIMD.Float32x4.load(a, 12); + + var b0 = SIMD.Float32x4.load(b, 0); + var out0 = SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b0, 0, 0, 0, 0), a0), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b0, 1, 1, 1, 1), a1), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b0, 2, 2, 2, 2), a2), + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b0, 3, 3, 3, 3), a3)))); + SIMD.Float32x4.store(out, 0, out0); + + var b1 = SIMD.Float32x4.load(b, 4); + var out1 = SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b1, 0, 0, 0, 0), a0), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b1, 1, 1, 1, 1), a1), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b1, 2, 2, 2, 2), a2), + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b1, 3, 3, 3, 3), a3)))); + SIMD.Float32x4.store(out, 4, out1); + + var b2 = SIMD.Float32x4.load(b, 8); + var out2 = SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b2, 0, 0, 0, 0), a0), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b2, 1, 1, 1, 1), a1), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b2, 2, 2, 2, 2), a2), + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b2, 3, 3, 3, 3), a3)))); + SIMD.Float32x4.store(out, 8, out2); + + var b3 = SIMD.Float32x4.load(b, 12); + var out3 = SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b3, 0, 0, 0, 0), a0), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b3, 1, 1, 1, 1), a1), + SIMD.Float32x4.add( + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b3, 2, 2, 2, 2), a2), + SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(b3, 3, 3, 3, 3), a3)))); + SIMD.Float32x4.store(out, 12, out3); + + return out; +}; + +/** + * Multiplies two mat4's explicitly not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ +mat4.scalar.multiply = function (out, a, b) { + var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], + a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], + a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], + a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; + + // Cache only the current line of the second matrix + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; + out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7]; + out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11]; + out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + + b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15]; + out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30; + out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31; + out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32; + out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33; + return out; +}; + +/** + * Multiplies two mat4's using SIMD if available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ +mat4.multiply = glMatrix.USE_SIMD ? mat4.SIMD.multiply : mat4.scalar.multiply; + +/** + * Alias for {@link mat4.multiply} + * @function + */ +mat4.mul = mat4.multiply; + +/** + * Translate a mat4 by the given vector not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to translate + * @param {vec3} v vector to translate by + * @returns {mat4} out + */ +mat4.scalar.translate = function (out, a, v) { + var x = v[0], y = v[1], z = v[2], + a00, a01, a02, a03, + a10, a11, a12, a13, + a20, a21, a22, a23; + + if (a === out) { + out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + } else { + a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; + a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; + a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; + + out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03; + out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13; + out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23; + + out[12] = a00 * x + a10 * y + a20 * z + a[12]; + out[13] = a01 * x + a11 * y + a21 * z + a[13]; + out[14] = a02 * x + a12 * y + a22 * z + a[14]; + out[15] = a03 * x + a13 * y + a23 * z + a[15]; + } + + return out; +}; + +/** + * Translates a mat4 by the given vector using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to translate + * @param {vec3} v vector to translate by + * @returns {mat4} out + */ +mat4.SIMD.translate = function (out, a, v) { + var a0 = SIMD.Float32x4.load(a, 0), + a1 = SIMD.Float32x4.load(a, 4), + a2 = SIMD.Float32x4.load(a, 8), + a3 = SIMD.Float32x4.load(a, 12), + vec = SIMD.Float32x4(v[0], v[1], v[2] , 0); + + if (a !== out) { + out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; + out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; + out[8] = a[8]; out[9] = a[9]; out[10] = a[10]; out[11] = a[11]; + } + + a0 = SIMD.Float32x4.mul(a0, SIMD.Float32x4.swizzle(vec, 0, 0, 0, 0)); + a1 = SIMD.Float32x4.mul(a1, SIMD.Float32x4.swizzle(vec, 1, 1, 1, 1)); + a2 = SIMD.Float32x4.mul(a2, SIMD.Float32x4.swizzle(vec, 2, 2, 2, 2)); + + var t0 = SIMD.Float32x4.add(a0, SIMD.Float32x4.add(a1, SIMD.Float32x4.add(a2, a3))); + SIMD.Float32x4.store(out, 12, t0); + + return out; +}; + +/** + * Translates a mat4 by the given vector using SIMD if available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to translate + * @param {vec3} v vector to translate by + * @returns {mat4} out + */ +mat4.translate = glMatrix.USE_SIMD ? mat4.SIMD.translate : mat4.scalar.translate; + +/** + * Scales the mat4 by the dimensions in the given vec3 not using vectorization + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to scale + * @param {vec3} v the vec3 to scale the matrix by + * @returns {mat4} out + **/ +mat4.scalar.scale = function(out, a, v) { + var x = v[0], y = v[1], z = v[2]; + + out[0] = a[0] * x; + out[1] = a[1] * x; + out[2] = a[2] * x; + out[3] = a[3] * x; + out[4] = a[4] * y; + out[5] = a[5] * y; + out[6] = a[6] * y; + out[7] = a[7] * y; + out[8] = a[8] * z; + out[9] = a[9] * z; + out[10] = a[10] * z; + out[11] = a[11] * z; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +}; + +/** + * Scales the mat4 by the dimensions in the given vec3 using vectorization + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to scale + * @param {vec3} v the vec3 to scale the matrix by + * @returns {mat4} out + **/ +mat4.SIMD.scale = function(out, a, v) { + var a0, a1, a2; + var vec = SIMD.Float32x4(v[0], v[1], v[2], 0); + + a0 = SIMD.Float32x4.load(a, 0); + SIMD.Float32x4.store( + out, 0, SIMD.Float32x4.mul(a0, SIMD.Float32x4.swizzle(vec, 0, 0, 0, 0))); + + a1 = SIMD.Float32x4.load(a, 4); + SIMD.Float32x4.store( + out, 4, SIMD.Float32x4.mul(a1, SIMD.Float32x4.swizzle(vec, 1, 1, 1, 1))); + + a2 = SIMD.Float32x4.load(a, 8); + SIMD.Float32x4.store( + out, 8, SIMD.Float32x4.mul(a2, SIMD.Float32x4.swizzle(vec, 2, 2, 2, 2))); + + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + return out; +}; + +/** + * Scales the mat4 by the dimensions in the given vec3 using SIMD if available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to scale + * @param {vec3} v the vec3 to scale the matrix by + * @returns {mat4} out + */ +mat4.scale = glMatrix.USE_SIMD ? mat4.SIMD.scale : mat4.scalar.scale; + +/** + * Rotates a mat4 by the given angle around the given axis + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @param {vec3} axis the axis to rotate around + * @returns {mat4} out + */ +mat4.rotate = function (out, a, rad, axis) { + var x = axis[0], y = axis[1], z = axis[2], + len = Math.sqrt(x * x + y * y + z * z), + s, c, t, + a00, a01, a02, a03, + a10, a11, a12, a13, + a20, a21, a22, a23, + b00, b01, b02, + b10, b11, b12, + b20, b21, b22; + + if (Math.abs(len) < glMatrix.EPSILON) { return null; } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; + + a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; + a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; + a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; + + // Construct the elements of the rotation matrix + b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s; + b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s; + b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + out[0] = a00 * b00 + a10 * b01 + a20 * b02; + out[1] = a01 * b00 + a11 * b01 + a21 * b02; + out[2] = a02 * b00 + a12 * b01 + a22 * b02; + out[3] = a03 * b00 + a13 * b01 + a23 * b02; + out[4] = a00 * b10 + a10 * b11 + a20 * b12; + out[5] = a01 * b10 + a11 * b11 + a21 * b12; + out[6] = a02 * b10 + a12 * b11 + a22 * b12; + out[7] = a03 * b10 + a13 * b11 + a23 * b12; + out[8] = a00 * b20 + a10 * b21 + a20 * b22; + out[9] = a01 * b20 + a11 * b21 + a21 * b22; + out[10] = a02 * b20 + a12 * b21 + a22 * b22; + out[11] = a03 * b20 + a13 * b21 + a23 * b22; + + if (a !== out) { // If the source and destination differ, copy the unchanged last row + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + return out; +}; + +/** + * Rotates a matrix by the given angle around the X axis not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.scalar.rotateX = function (out, a, rad) { + var s = Math.sin(rad), + c = Math.cos(rad), + a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7], + a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + + if (a !== out) { // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[4] = a10 * c + a20 * s; + out[5] = a11 * c + a21 * s; + out[6] = a12 * c + a22 * s; + out[7] = a13 * c + a23 * s; + out[8] = a20 * c - a10 * s; + out[9] = a21 * c - a11 * s; + out[10] = a22 * c - a12 * s; + out[11] = a23 * c - a13 * s; + return out; +}; + +/** + * Rotates a matrix by the given angle around the X axis using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.SIMD.rotateX = function (out, a, rad) { + var s = SIMD.Float32x4.splat(Math.sin(rad)), + c = SIMD.Float32x4.splat(Math.cos(rad)); + + if (a !== out) { // If the source and destination differ, copy the unchanged rows + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + var a_1 = SIMD.Float32x4.load(a, 4); + var a_2 = SIMD.Float32x4.load(a, 8); + SIMD.Float32x4.store(out, 4, + SIMD.Float32x4.add(SIMD.Float32x4.mul(a_1, c), SIMD.Float32x4.mul(a_2, s))); + SIMD.Float32x4.store(out, 8, + SIMD.Float32x4.sub(SIMD.Float32x4.mul(a_2, c), SIMD.Float32x4.mul(a_1, s))); + return out; +}; + +/** + * Rotates a matrix by the given angle around the X axis using SIMD if availabe and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.rotateX = glMatrix.USE_SIMD ? mat4.SIMD.rotateX : mat4.scalar.rotateX; + +/** + * Rotates a matrix by the given angle around the Y axis not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.scalar.rotateY = function (out, a, rad) { + var s = Math.sin(rad), + c = Math.cos(rad), + a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3], + a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11]; + + if (a !== out) { // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[0] = a00 * c - a20 * s; + out[1] = a01 * c - a21 * s; + out[2] = a02 * c - a22 * s; + out[3] = a03 * c - a23 * s; + out[8] = a00 * s + a20 * c; + out[9] = a01 * s + a21 * c; + out[10] = a02 * s + a22 * c; + out[11] = a03 * s + a23 * c; + return out; +}; + +/** + * Rotates a matrix by the given angle around the Y axis using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.SIMD.rotateY = function (out, a, rad) { + var s = SIMD.Float32x4.splat(Math.sin(rad)), + c = SIMD.Float32x4.splat(Math.cos(rad)); + + if (a !== out) { // If the source and destination differ, copy the unchanged rows + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + var a_0 = SIMD.Float32x4.load(a, 0); + var a_2 = SIMD.Float32x4.load(a, 8); + SIMD.Float32x4.store(out, 0, + SIMD.Float32x4.sub(SIMD.Float32x4.mul(a_0, c), SIMD.Float32x4.mul(a_2, s))); + SIMD.Float32x4.store(out, 8, + SIMD.Float32x4.add(SIMD.Float32x4.mul(a_0, s), SIMD.Float32x4.mul(a_2, c))); + return out; +}; + +/** + * Rotates a matrix by the given angle around the Y axis if SIMD available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + mat4.rotateY = glMatrix.USE_SIMD ? mat4.SIMD.rotateY : mat4.scalar.rotateY; + +/** + * Rotates a matrix by the given angle around the Z axis not using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.scalar.rotateZ = function (out, a, rad) { + var s = Math.sin(rad), + c = Math.cos(rad), + a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3], + a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7]; + + if (a !== out) { // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + out[0] = a00 * c + a10 * s; + out[1] = a01 * c + a11 * s; + out[2] = a02 * c + a12 * s; + out[3] = a03 * c + a13 * s; + out[4] = a10 * c - a00 * s; + out[5] = a11 * c - a01 * s; + out[6] = a12 * c - a02 * s; + out[7] = a13 * c - a03 * s; + return out; +}; + +/** + * Rotates a matrix by the given angle around the Z axis using SIMD + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.SIMD.rotateZ = function (out, a, rad) { + var s = SIMD.Float32x4.splat(Math.sin(rad)), + c = SIMD.Float32x4.splat(Math.cos(rad)); + + if (a !== out) { // If the source and destination differ, copy the unchanged last row + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + } + + // Perform axis-specific matrix multiplication + var a_0 = SIMD.Float32x4.load(a, 0); + var a_1 = SIMD.Float32x4.load(a, 4); + SIMD.Float32x4.store(out, 0, + SIMD.Float32x4.add(SIMD.Float32x4.mul(a_0, c), SIMD.Float32x4.mul(a_1, s))); + SIMD.Float32x4.store(out, 4, + SIMD.Float32x4.sub(SIMD.Float32x4.mul(a_1, c), SIMD.Float32x4.mul(a_0, s))); + return out; +}; + +/** + * Rotates a matrix by the given angle around the Z axis if SIMD available and enabled + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to rotate + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ + mat4.rotateZ = glMatrix.USE_SIMD ? mat4.SIMD.rotateZ : mat4.scalar.rotateZ; + +/** + * Creates a matrix from a vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {vec3} v Translation vector + * @returns {mat4} out + */ +mat4.fromTranslation = function(out, v) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + return out; +} + +/** + * Creates a matrix from a vector scaling + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.scale(dest, dest, vec); + * + * @param {mat4} out mat4 receiving operation result + * @param {vec3} v Scaling vector + * @returns {mat4} out + */ +mat4.fromScaling = function(out, v) { + out[0] = v[0]; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = v[1]; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = v[2]; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} + +/** + * Creates a matrix from a given angle around a given axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotate(dest, dest, rad, axis); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @param {vec3} axis the axis to rotate around + * @returns {mat4} out + */ +mat4.fromRotation = function(out, rad, axis) { + var x = axis[0], y = axis[1], z = axis[2], + len = Math.sqrt(x * x + y * y + z * z), + s, c, t; + + if (Math.abs(len) < glMatrix.EPSILON) { return null; } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + s = Math.sin(rad); + c = Math.cos(rad); + t = 1 - c; + + // Perform rotation-specific matrix multiplication + out[0] = x * x * t + c; + out[1] = y * x * t + z * s; + out[2] = z * x * t - y * s; + out[3] = 0; + out[4] = x * y * t - z * s; + out[5] = y * y * t + c; + out[6] = z * y * t + x * s; + out[7] = 0; + out[8] = x * z * t + y * s; + out[9] = y * z * t - x * s; + out[10] = z * z * t + c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} + +/** + * Creates a matrix from the given angle around the X axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateX(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.fromXRotation = function(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + + // Perform axis-specific matrix multiplication + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = c; + out[6] = s; + out[7] = 0; + out[8] = 0; + out[9] = -s; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} + +/** + * Creates a matrix from the given angle around the Y axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateY(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.fromYRotation = function(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + + // Perform axis-specific matrix multiplication + out[0] = c; + out[1] = 0; + out[2] = -s; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = s; + out[9] = 0; + out[10] = c; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} + +/** + * Creates a matrix from the given angle around the Z axis + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.rotateZ(dest, dest, rad); + * + * @param {mat4} out mat4 receiving operation result + * @param {Number} rad the angle to rotate the matrix by + * @returns {mat4} out + */ +mat4.fromZRotation = function(out, rad) { + var s = Math.sin(rad), + c = Math.cos(rad); + + // Perform axis-specific matrix multiplication + out[0] = c; + out[1] = s; + out[2] = 0; + out[3] = 0; + out[4] = -s; + out[5] = c; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + return out; +} + +/** + * Creates a matrix from a quaternion rotation and vector translation + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {vec3} v Translation vector + * @returns {mat4} out + */ +mat4.fromRotationTranslation = function (out, q, v) { + // Quaternion math + var x = q[0], y = q[1], z = q[2], w = q[3], + x2 = x + x, + y2 = y + y, + z2 = z + z, + + xx = x * x2, + xy = x * y2, + xz = x * z2, + yy = y * y2, + yz = y * z2, + zz = z * z2, + wx = w * x2, + wy = w * y2, + wz = w * z2; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + + return out; +}; + +/** + * Returns the translation vector component of a transformation + * matrix. If a matrix is built with fromRotationTranslation, + * the returned vector will be the same as the translation vector + * originally supplied. + * @param {vec3} out Vector to receive translation component + * @param {mat4} mat Matrix to be decomposed (input) + * @return {vec3} out + */ +mat4.getTranslation = function (out, mat) { + out[0] = mat[12]; + out[1] = mat[13]; + out[2] = mat[14]; + + return out; +}; + +/** + * Returns a quaternion representing the rotational component + * of a transformation matrix. If a matrix is built with + * fromRotationTranslation, the returned quaternion will be the + * same as the quaternion originally supplied. + * @param {quat} out Quaternion to receive the rotation component + * @param {mat4} mat Matrix to be decomposed (input) + * @return {quat} out + */ +mat4.getRotation = function (out, mat) { + // Algorithm taken from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm + var trace = mat[0] + mat[5] + mat[10]; + var S = 0; + + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out[3] = 0.25 * S; + out[0] = (mat[6] - mat[9]) / S; + out[1] = (mat[8] - mat[2]) / S; + out[2] = (mat[1] - mat[4]) / S; + } else if ((mat[0] > mat[5])&(mat[0] > mat[10])) { + S = Math.sqrt(1.0 + mat[0] - mat[5] - mat[10]) * 2; + out[3] = (mat[6] - mat[9]) / S; + out[0] = 0.25 * S; + out[1] = (mat[1] + mat[4]) / S; + out[2] = (mat[8] + mat[2]) / S; + } else if (mat[5] > mat[10]) { + S = Math.sqrt(1.0 + mat[5] - mat[0] - mat[10]) * 2; + out[3] = (mat[8] - mat[2]) / S; + out[0] = (mat[1] + mat[4]) / S; + out[1] = 0.25 * S; + out[2] = (mat[6] + mat[9]) / S; + } else { + S = Math.sqrt(1.0 + mat[10] - mat[0] - mat[5]) * 2; + out[3] = (mat[1] - mat[4]) / S; + out[0] = (mat[8] + mat[2]) / S; + out[1] = (mat[6] + mat[9]) / S; + out[2] = 0.25 * S; + } + + return out; +}; + +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {vec3} v Translation vector + * @param {vec3} s Scaling vector + * @returns {mat4} out + */ +mat4.fromRotationTranslationScale = function (out, q, v, s) { + // Quaternion math + var x = q[0], y = q[1], z = q[2], w = q[3], + x2 = x + x, + y2 = y + y, + z2 = z + z, + + xx = x * x2, + xy = x * y2, + xz = x * z2, + yy = y * y2, + yz = y * z2, + zz = z * z2, + wx = w * x2, + wy = w * y2, + wz = w * z2, + sx = s[0], + sy = s[1], + sz = s[2]; + + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0]; + out[13] = v[1]; + out[14] = v[2]; + out[15] = 1; + + return out; +}; + +/** + * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin + * This is equivalent to (but much faster than): + * + * mat4.identity(dest); + * mat4.translate(dest, vec); + * mat4.translate(dest, origin); + * var quatMat = mat4.create(); + * quat4.toMat4(quat, quatMat); + * mat4.multiply(dest, quatMat); + * mat4.scale(dest, scale) + * mat4.translate(dest, negativeOrigin); + * + * @param {mat4} out mat4 receiving operation result + * @param {quat4} q Rotation quaternion + * @param {vec3} v Translation vector + * @param {vec3} s Scaling vector + * @param {vec3} o The origin vector around which to scale and rotate + * @returns {mat4} out + */ +mat4.fromRotationTranslationScaleOrigin = function (out, q, v, s, o) { + // Quaternion math + var x = q[0], y = q[1], z = q[2], w = q[3], + x2 = x + x, + y2 = y + y, + z2 = z + z, + + xx = x * x2, + xy = x * y2, + xz = x * z2, + yy = y * y2, + yz = y * z2, + zz = z * z2, + wx = w * x2, + wy = w * y2, + wz = w * z2, + + sx = s[0], + sy = s[1], + sz = s[2], + + ox = o[0], + oy = o[1], + oz = o[2]; + + out[0] = (1 - (yy + zz)) * sx; + out[1] = (xy + wz) * sx; + out[2] = (xz - wy) * sx; + out[3] = 0; + out[4] = (xy - wz) * sy; + out[5] = (1 - (xx + zz)) * sy; + out[6] = (yz + wx) * sy; + out[7] = 0; + out[8] = (xz + wy) * sz; + out[9] = (yz - wx) * sz; + out[10] = (1 - (xx + yy)) * sz; + out[11] = 0; + out[12] = v[0] + ox - (out[0] * ox + out[4] * oy + out[8] * oz); + out[13] = v[1] + oy - (out[1] * ox + out[5] * oy + out[9] * oz); + out[14] = v[2] + oz - (out[2] * ox + out[6] * oy + out[10] * oz); + out[15] = 1; + + return out; +}; + +/** + * Calculates a 4x4 matrix from the given quaternion + * + * @param {mat4} out mat4 receiving operation result + * @param {quat} q Quaternion to create matrix from + * + * @returns {mat4} out + */ +mat4.fromQuat = function (out, q) { + var x = q[0], y = q[1], z = q[2], w = q[3], + x2 = x + x, + y2 = y + y, + z2 = z + z, + + xx = x * x2, + yx = y * x2, + yy = y * y2, + zx = z * x2, + zy = z * y2, + zz = z * z2, + wx = w * x2, + wy = w * y2, + wz = w * z2; + + out[0] = 1 - yy - zz; + out[1] = yx + wz; + out[2] = zx - wy; + out[3] = 0; + + out[4] = yx - wz; + out[5] = 1 - xx - zz; + out[6] = zy + wx; + out[7] = 0; + + out[8] = zx + wy; + out[9] = zy - wx; + out[10] = 1 - xx - yy; + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return out; +}; + +/** + * Generates a frustum matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Number} left Left bound of the frustum + * @param {Number} right Right bound of the frustum + * @param {Number} bottom Bottom bound of the frustum + * @param {Number} top Top bound of the frustum + * @param {Number} near Near bound of the frustum + * @param {Number} far Far bound of the frustum + * @returns {mat4} out + */ +mat4.frustum = function (out, left, right, bottom, top, near, far) { + var rl = 1 / (right - left), + tb = 1 / (top - bottom), + nf = 1 / (near - far); + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + return out; +}; + +/** + * Generates a perspective projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} fovy Vertical field of view in radians + * @param {number} aspect Aspect ratio. typically viewport width/height + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ +mat4.perspective = function (out, fovy, aspect, near, far) { + var f = 1.0 / Math.tan(fovy / 2), + nf = 1 / (near - far); + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + return out; +}; + +/** + * Generates a perspective projection matrix with the given field of view. + * This is primarily useful for generating projection matrices to be used + * with the still experiemental WebVR API. + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ +mat4.perspectiveFromFieldOfView = function (out, fov, near, far) { + var upTan = Math.tan(fov.upDegrees * Math.PI/180.0), + downTan = Math.tan(fov.downDegrees * Math.PI/180.0), + leftTan = Math.tan(fov.leftDegrees * Math.PI/180.0), + rightTan = Math.tan(fov.rightDegrees * Math.PI/180.0), + xScale = 2.0 / (leftTan + rightTan), + yScale = 2.0 / (upTan + downTan); + + out[0] = xScale; + out[1] = 0.0; + out[2] = 0.0; + out[3] = 0.0; + out[4] = 0.0; + out[5] = yScale; + out[6] = 0.0; + out[7] = 0.0; + out[8] = -((leftTan - rightTan) * xScale * 0.5); + out[9] = ((upTan - downTan) * yScale * 0.5); + out[10] = far / (near - far); + out[11] = -1.0; + out[12] = 0.0; + out[13] = 0.0; + out[14] = (far * near) / (near - far); + out[15] = 0.0; + return out; +} + +/** + * Generates a orthogonal projection matrix with the given bounds + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {number} left Left bound of the frustum + * @param {number} right Right bound of the frustum + * @param {number} bottom Bottom bound of the frustum + * @param {number} top Top bound of the frustum + * @param {number} near Near bound of the frustum + * @param {number} far Far bound of the frustum + * @returns {mat4} out + */ +mat4.ortho = function (out, left, right, bottom, top, near, far) { + var lr = 1 / (left - right), + bt = 1 / (bottom - top), + nf = 1 / (near - far); + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + return out; +}; + +/** + * Generates a look-at matrix with the given eye position, focal point, and up axis + * + * @param {mat4} out mat4 frustum matrix will be written into + * @param {vec3} eye Position of the viewer + * @param {vec3} center Point the viewer is looking at + * @param {vec3} up vec3 pointing up + * @returns {mat4} out + */ +mat4.lookAt = function (out, eye, center, up) { + var x0, x1, x2, y0, y1, y2, z0, z1, z2, len, + eyex = eye[0], + eyey = eye[1], + eyez = eye[2], + upx = up[0], + upy = up[1], + upz = up[2], + centerx = center[0], + centery = center[1], + centerz = center[2]; + + if (Math.abs(eyex - centerx) < glMatrix.EPSILON && + Math.abs(eyey - centery) < glMatrix.EPSILON && + Math.abs(eyez - centerz) < glMatrix.EPSILON) { + return mat4.identity(out); + } + + z0 = eyex - centerx; + z1 = eyey - centery; + z2 = eyez - centerz; + + len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + z0 *= len; + z1 *= len; + z2 *= len; + + x0 = upy * z2 - upz * z1; + x1 = upz * z0 - upx * z2; + x2 = upx * z1 - upy * z0; + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + if (!len) { + x0 = 0; + x1 = 0; + x2 = 0; + } else { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + y0 = z1 * x2 - z2 * x1; + y1 = z2 * x0 - z0 * x2; + y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + if (!len) { + y0 = 0; + y1 = 0; + y2 = 0; + } else { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return out; +}; + +/** + * Returns a string representation of a mat4 + * + * @param {mat4} mat matrix to represent as a string + * @returns {String} string representation of the matrix + */ +mat4.str = function (a) { + return 'mat4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ', ' + + a[4] + ', ' + a[5] + ', ' + a[6] + ', ' + a[7] + ', ' + + a[8] + ', ' + a[9] + ', ' + a[10] + ', ' + a[11] + ', ' + + a[12] + ', ' + a[13] + ', ' + a[14] + ', ' + a[15] + ')'; +}; + +/** + * Returns Frobenius norm of a mat4 + * + * @param {mat4} a the matrix to calculate Frobenius norm of + * @returns {Number} Frobenius norm + */ +mat4.frob = function (a) { + return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) )) +}; + +/** + * Adds two mat4's + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ +mat4.add = function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + out[4] = a[4] + b[4]; + out[5] = a[5] + b[5]; + out[6] = a[6] + b[6]; + out[7] = a[7] + b[7]; + out[8] = a[8] + b[8]; + out[9] = a[9] + b[9]; + out[10] = a[10] + b[10]; + out[11] = a[11] + b[11]; + out[12] = a[12] + b[12]; + out[13] = a[13] + b[13]; + out[14] = a[14] + b[14]; + out[15] = a[15] + b[15]; + return out; +}; + +/** + * Subtracts matrix b from matrix a + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @returns {mat4} out + */ +mat4.subtract = function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + out[4] = a[4] - b[4]; + out[5] = a[5] - b[5]; + out[6] = a[6] - b[6]; + out[7] = a[7] - b[7]; + out[8] = a[8] - b[8]; + out[9] = a[9] - b[9]; + out[10] = a[10] - b[10]; + out[11] = a[11] - b[11]; + out[12] = a[12] - b[12]; + out[13] = a[13] - b[13]; + out[14] = a[14] - b[14]; + out[15] = a[15] - b[15]; + return out; +}; + +/** + * Alias for {@link mat4.subtract} + * @function + */ +mat4.sub = mat4.subtract; + +/** + * Multiply each element of the matrix by a scalar. + * + * @param {mat4} out the receiving matrix + * @param {mat4} a the matrix to scale + * @param {Number} b amount to scale the matrix's elements by + * @returns {mat4} out + */ +mat4.multiplyScalar = function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + out[4] = a[4] * b; + out[5] = a[5] * b; + out[6] = a[6] * b; + out[7] = a[7] * b; + out[8] = a[8] * b; + out[9] = a[9] * b; + out[10] = a[10] * b; + out[11] = a[11] * b; + out[12] = a[12] * b; + out[13] = a[13] * b; + out[14] = a[14] * b; + out[15] = a[15] * b; + return out; +}; + +/** + * Adds two mat4's after multiplying each element of the second operand by a scalar value. + * + * @param {mat4} out the receiving vector + * @param {mat4} a the first operand + * @param {mat4} b the second operand + * @param {Number} scale the amount to scale b's elements by before adding + * @returns {mat4} out + */ +mat4.multiplyScalarAndAdd = function(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale); + out[1] = a[1] + (b[1] * scale); + out[2] = a[2] + (b[2] * scale); + out[3] = a[3] + (b[3] * scale); + out[4] = a[4] + (b[4] * scale); + out[5] = a[5] + (b[5] * scale); + out[6] = a[6] + (b[6] * scale); + out[7] = a[7] + (b[7] * scale); + out[8] = a[8] + (b[8] * scale); + out[9] = a[9] + (b[9] * scale); + out[10] = a[10] + (b[10] * scale); + out[11] = a[11] + (b[11] * scale); + out[12] = a[12] + (b[12] * scale); + out[13] = a[13] + (b[13] * scale); + out[14] = a[14] + (b[14] * scale); + out[15] = a[15] + (b[15] * scale); + return out; +}; + +/** + * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) + * + * @param {mat4} a The first matrix. + * @param {mat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat4.exactEquals = function (a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && + a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && + a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && + a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; +}; + +/** + * Returns whether or not the matrices have approximately the same elements in the same position. + * + * @param {mat4} a The first matrix. + * @param {mat4} b The second matrix. + * @returns {Boolean} True if the matrices are equal, false otherwise. + */ +mat4.equals = function (a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], + a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7], + a8 = a[8], a9 = a[9], a10 = a[10], a11 = a[11], + a12 = a[12], a13 = a[13], a14 = a[14], a15 = a[15]; + + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], + b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], + b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], + b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; + + return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3)) && + Math.abs(a4 - b4) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a4), Math.abs(b4)) && + Math.abs(a5 - b5) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a5), Math.abs(b5)) && + Math.abs(a6 - b6) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a6), Math.abs(b6)) && + Math.abs(a7 - b7) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a7), Math.abs(b7)) && + Math.abs(a8 - b8) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a8), Math.abs(b8)) && + Math.abs(a9 - b9) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a9), Math.abs(b9)) && + Math.abs(a10 - b10) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a10), Math.abs(b10)) && + Math.abs(a11 - b11) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a11), Math.abs(b11)) && + Math.abs(a12 - b12) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a12), Math.abs(b12)) && + Math.abs(a13 - b13) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a13), Math.abs(b13)) && + Math.abs(a14 - b14) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a14), Math.abs(b14)) && + Math.abs(a15 - b15) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a15), Math.abs(b15))); +}; + + + +module.exports = mat4; diff --git a/node_modules/gl-matrix/src/gl-matrix/quat.js b/node_modules/gl-matrix/src/gl-matrix/quat.js new file mode 100755 index 00000000..1a7a31f0 --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/quat.js @@ -0,0 +1,600 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); +var mat3 = require("./mat3.js"); +var vec3 = require("./vec3.js"); +var vec4 = require("./vec4.js"); + +/** + * @class Quaternion + * @name quat + */ +var quat = {}; + +/** + * Creates a new identity quat + * + * @returns {quat} a new quaternion + */ +quat.create = function() { + var out = new glMatrix.ARRAY_TYPE(4); + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +}; + +/** + * Sets a quaternion to represent the shortest rotation from one + * vector to another. + * + * Both vectors are assumed to be unit length. + * + * @param {quat} out the receiving quaternion. + * @param {vec3} a the initial vector + * @param {vec3} b the destination vector + * @returns {quat} out + */ +quat.rotationTo = (function() { + var tmpvec3 = vec3.create(); + var xUnitVec3 = vec3.fromValues(1,0,0); + var yUnitVec3 = vec3.fromValues(0,1,0); + + return function(out, a, b) { + var dot = vec3.dot(a, b); + if (dot < -0.999999) { + vec3.cross(tmpvec3, xUnitVec3, a); + if (vec3.length(tmpvec3) < 0.000001) + vec3.cross(tmpvec3, yUnitVec3, a); + vec3.normalize(tmpvec3, tmpvec3); + quat.setAxisAngle(out, tmpvec3, Math.PI); + return out; + } else if (dot > 0.999999) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; + } else { + vec3.cross(tmpvec3, a, b); + out[0] = tmpvec3[0]; + out[1] = tmpvec3[1]; + out[2] = tmpvec3[2]; + out[3] = 1 + dot; + return quat.normalize(out, out); + } + }; +})(); + +/** + * Sets the specified quaternion with values corresponding to the given + * axes. Each axis is a vec3 and is expected to be unit length and + * perpendicular to all other specified axes. + * + * @param {vec3} view the vector representing the viewing direction + * @param {vec3} right the vector representing the local "right" direction + * @param {vec3} up the vector representing the local "up" direction + * @returns {quat} out + */ +quat.setAxes = (function() { + var matr = mat3.create(); + + return function(out, view, right, up) { + matr[0] = right[0]; + matr[3] = right[1]; + matr[6] = right[2]; + + matr[1] = up[0]; + matr[4] = up[1]; + matr[7] = up[2]; + + matr[2] = -view[0]; + matr[5] = -view[1]; + matr[8] = -view[2]; + + return quat.normalize(out, quat.fromMat3(out, matr)); + }; +})(); + +/** + * Creates a new quat initialized with values from an existing quaternion + * + * @param {quat} a quaternion to clone + * @returns {quat} a new quaternion + * @function + */ +quat.clone = vec4.clone; + +/** + * Creates a new quat initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} a new quaternion + * @function + */ +quat.fromValues = vec4.fromValues; + +/** + * Copy the values from one quat to another + * + * @param {quat} out the receiving quaternion + * @param {quat} a the source quaternion + * @returns {quat} out + * @function + */ +quat.copy = vec4.copy; + +/** + * Set the components of a quat to the given values + * + * @param {quat} out the receiving quaternion + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {quat} out + * @function + */ +quat.set = vec4.set; + +/** + * Set a quat to the identity quaternion + * + * @param {quat} out the receiving quaternion + * @returns {quat} out + */ +quat.identity = function(out) { + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 1; + return out; +}; + +/** + * Sets a quat from the given angle and rotation axis, + * then returns it. + * + * @param {quat} out the receiving quaternion + * @param {vec3} axis the axis around which to rotate + * @param {Number} rad the angle in radians + * @returns {quat} out + **/ +quat.setAxisAngle = function(out, axis, rad) { + rad = rad * 0.5; + var s = Math.sin(rad); + out[0] = s * axis[0]; + out[1] = s * axis[1]; + out[2] = s * axis[2]; + out[3] = Math.cos(rad); + return out; +}; + +/** + * Gets the rotation axis and angle for a given + * quaternion. If a quaternion is created with + * setAxisAngle, this method will return the same + * values as providied in the original parameter list + * OR functionally equivalent values. + * Example: The quaternion formed by axis [0, 0, 1] and + * angle -90 is the same as the quaternion formed by + * [0, 0, 1] and 270. This method favors the latter. + * @param {vec3} out_axis Vector receiving the axis of rotation + * @param {quat} q Quaternion to be decomposed + * @return {Number} Angle, in radians, of the rotation + */ +quat.getAxisAngle = function(out_axis, q) { + var rad = Math.acos(q[3]) * 2.0; + var s = Math.sin(rad / 2.0); + if (s != 0.0) { + out_axis[0] = q[0] / s; + out_axis[1] = q[1] / s; + out_axis[2] = q[2] / s; + } else { + // If s is zero, return any axis (no rotation - axis does not matter) + out_axis[0] = 1; + out_axis[1] = 0; + out_axis[2] = 0; + } + return rad; +}; + +/** + * Adds two quat's + * + * @param {quat} out the receiving quaternion + * @param {quat} a the first operand + * @param {quat} b the second operand + * @returns {quat} out + * @function + */ +quat.add = vec4.add; + +/** + * Multiplies two quat's + * + * @param {quat} out the receiving quaternion + * @param {quat} a the first operand + * @param {quat} b the second operand + * @returns {quat} out + */ +quat.multiply = function(out, a, b) { + var ax = a[0], ay = a[1], az = a[2], aw = a[3], + bx = b[0], by = b[1], bz = b[2], bw = b[3]; + + out[0] = ax * bw + aw * bx + ay * bz - az * by; + out[1] = ay * bw + aw * by + az * bx - ax * bz; + out[2] = az * bw + aw * bz + ax * by - ay * bx; + out[3] = aw * bw - ax * bx - ay * by - az * bz; + return out; +}; + +/** + * Alias for {@link quat.multiply} + * @function + */ +quat.mul = quat.multiply; + +/** + * Scales a quat by a scalar number + * + * @param {quat} out the receiving vector + * @param {quat} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {quat} out + * @function + */ +quat.scale = vec4.scale; + +/** + * Rotates a quaternion by the given angle about the X axis + * + * @param {quat} out quat receiving operation result + * @param {quat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ +quat.rotateX = function (out, a, rad) { + rad *= 0.5; + + var ax = a[0], ay = a[1], az = a[2], aw = a[3], + bx = Math.sin(rad), bw = Math.cos(rad); + + out[0] = ax * bw + aw * bx; + out[1] = ay * bw + az * bx; + out[2] = az * bw - ay * bx; + out[3] = aw * bw - ax * bx; + return out; +}; + +/** + * Rotates a quaternion by the given angle about the Y axis + * + * @param {quat} out quat receiving operation result + * @param {quat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ +quat.rotateY = function (out, a, rad) { + rad *= 0.5; + + var ax = a[0], ay = a[1], az = a[2], aw = a[3], + by = Math.sin(rad), bw = Math.cos(rad); + + out[0] = ax * bw - az * by; + out[1] = ay * bw + aw * by; + out[2] = az * bw + ax * by; + out[3] = aw * bw - ay * by; + return out; +}; + +/** + * Rotates a quaternion by the given angle about the Z axis + * + * @param {quat} out quat receiving operation result + * @param {quat} a quat to rotate + * @param {number} rad angle (in radians) to rotate + * @returns {quat} out + */ +quat.rotateZ = function (out, a, rad) { + rad *= 0.5; + + var ax = a[0], ay = a[1], az = a[2], aw = a[3], + bz = Math.sin(rad), bw = Math.cos(rad); + + out[0] = ax * bw + ay * bz; + out[1] = ay * bw - ax * bz; + out[2] = az * bw + aw * bz; + out[3] = aw * bw - az * bz; + return out; +}; + +/** + * Calculates the W component of a quat from the X, Y, and Z components. + * Assumes that quaternion is 1 unit in length. + * Any existing W component will be ignored. + * + * @param {quat} out the receiving quaternion + * @param {quat} a quat to calculate W component of + * @returns {quat} out + */ +quat.calculateW = function (out, a) { + var x = a[0], y = a[1], z = a[2]; + + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); + return out; +}; + +/** + * Calculates the dot product of two quat's + * + * @param {quat} a the first operand + * @param {quat} b the second operand + * @returns {Number} dot product of a and b + * @function + */ +quat.dot = vec4.dot; + +/** + * Performs a linear interpolation between two quat's + * + * @param {quat} out the receiving quaternion + * @param {quat} a the first operand + * @param {quat} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {quat} out + * @function + */ +quat.lerp = vec4.lerp; + +/** + * Performs a spherical linear interpolation between two quat + * + * @param {quat} out the receiving quaternion + * @param {quat} a the first operand + * @param {quat} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {quat} out + */ +quat.slerp = function (out, a, b, t) { + // benchmarks: + // http://jsperf.com/quaternion-slerp-implementations + + var ax = a[0], ay = a[1], az = a[2], aw = a[3], + bx = b[0], by = b[1], bz = b[2], bw = b[3]; + + var omega, cosom, sinom, scale0, scale1; + + // calc cosine + cosom = ax * bx + ay * by + az * bz + aw * bw; + // adjust signs (if necessary) + if ( cosom < 0.0 ) { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + // calculate coefficients + if ( (1.0 - cosom) > 0.000001 ) { + // standard case (slerp) + omega = Math.acos(cosom); + sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } + // calculate final values + out[0] = scale0 * ax + scale1 * bx; + out[1] = scale0 * ay + scale1 * by; + out[2] = scale0 * az + scale1 * bz; + out[3] = scale0 * aw + scale1 * bw; + + return out; +}; + +/** + * Performs a spherical linear interpolation with two control points + * + * @param {quat} out the receiving quaternion + * @param {quat} a the first operand + * @param {quat} b the second operand + * @param {quat} c the third operand + * @param {quat} d the fourth operand + * @param {Number} t interpolation amount + * @returns {quat} out + */ +quat.sqlerp = (function () { + var temp1 = quat.create(); + var temp2 = quat.create(); + + return function (out, a, b, c, d, t) { + quat.slerp(temp1, a, d, t); + quat.slerp(temp2, b, c, t); + quat.slerp(out, temp1, temp2, 2 * t * (1 - t)); + + return out; + }; +}()); + +/** + * Calculates the inverse of a quat + * + * @param {quat} out the receiving quaternion + * @param {quat} a quat to calculate inverse of + * @returns {quat} out + */ +quat.invert = function(out, a) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], + dot = a0*a0 + a1*a1 + a2*a2 + a3*a3, + invDot = dot ? 1.0/dot : 0; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + out[0] = -a0*invDot; + out[1] = -a1*invDot; + out[2] = -a2*invDot; + out[3] = a3*invDot; + return out; +}; + +/** + * Calculates the conjugate of a quat + * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. + * + * @param {quat} out the receiving quaternion + * @param {quat} a quat to calculate conjugate of + * @returns {quat} out + */ +quat.conjugate = function (out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = a[3]; + return out; +}; + +/** + * Calculates the length of a quat + * + * @param {quat} a vector to calculate length of + * @returns {Number} length of a + * @function + */ +quat.length = vec4.length; + +/** + * Alias for {@link quat.length} + * @function + */ +quat.len = quat.length; + +/** + * Calculates the squared length of a quat + * + * @param {quat} a vector to calculate squared length of + * @returns {Number} squared length of a + * @function + */ +quat.squaredLength = vec4.squaredLength; + +/** + * Alias for {@link quat.squaredLength} + * @function + */ +quat.sqrLen = quat.squaredLength; + +/** + * Normalize a quat + * + * @param {quat} out the receiving quaternion + * @param {quat} a quaternion to normalize + * @returns {quat} out + * @function + */ +quat.normalize = vec4.normalize; + +/** + * Creates a quaternion from the given 3x3 rotation matrix. + * + * NOTE: The resultant quaternion is not normalized, so you should be sure + * to renormalize the quaternion yourself where necessary. + * + * @param {quat} out the receiving quaternion + * @param {mat3} m rotation matrix + * @returns {quat} out + * @function + */ +quat.fromMat3 = function(out, m) { + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if ( fTrace > 0.0 ) { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + out[3] = 0.5 * fRoot; + fRoot = 0.5/fRoot; // 1/(4w) + out[0] = (m[5]-m[7])*fRoot; + out[1] = (m[6]-m[2])*fRoot; + out[2] = (m[1]-m[3])*fRoot; + } else { + // |w| <= 1/2 + var i = 0; + if ( m[4] > m[0] ) + i = 1; + if ( m[8] > m[i*3+i] ) + i = 2; + var j = (i+1)%3; + var k = (i+2)%3; + + fRoot = Math.sqrt(m[i*3+i]-m[j*3+j]-m[k*3+k] + 1.0); + out[i] = 0.5 * fRoot; + fRoot = 0.5 / fRoot; + out[3] = (m[j*3+k] - m[k*3+j]) * fRoot; + out[j] = (m[j*3+i] + m[i*3+j]) * fRoot; + out[k] = (m[k*3+i] + m[i*3+k]) * fRoot; + } + + return out; +}; + +/** + * Returns a string representation of a quatenion + * + * @param {quat} vec vector to represent as a string + * @returns {String} string representation of the vector + */ +quat.str = function (a) { + return 'quat(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')'; +}; + +/** + * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) + * + * @param {quat} a The first quaternion. + * @param {quat} b The second quaternion. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +quat.exactEquals = vec4.exactEquals; + +/** + * Returns whether or not the quaternions have approximately the same elements in the same position. + * + * @param {quat} a The first vector. + * @param {quat} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +quat.equals = vec4.equals; + +module.exports = quat; diff --git a/node_modules/gl-matrix/src/gl-matrix/vec2.js b/node_modules/gl-matrix/src/gl-matrix/vec2.js new file mode 100755 index 00000000..a2d77d58 --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/vec2.js @@ -0,0 +1,587 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); + +/** + * @class 2 Dimensional Vector + * @name vec2 + */ +var vec2 = {}; + +/** + * Creates a new, empty vec2 + * + * @returns {vec2} a new 2D vector + */ +vec2.create = function() { + var out = new glMatrix.ARRAY_TYPE(2); + out[0] = 0; + out[1] = 0; + return out; +}; + +/** + * Creates a new vec2 initialized with values from an existing vector + * + * @param {vec2} a vector to clone + * @returns {vec2} a new 2D vector + */ +vec2.clone = function(a) { + var out = new glMatrix.ARRAY_TYPE(2); + out[0] = a[0]; + out[1] = a[1]; + return out; +}; + +/** + * Creates a new vec2 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} a new 2D vector + */ +vec2.fromValues = function(x, y) { + var out = new glMatrix.ARRAY_TYPE(2); + out[0] = x; + out[1] = y; + return out; +}; + +/** + * Copy the values from one vec2 to another + * + * @param {vec2} out the receiving vector + * @param {vec2} a the source vector + * @returns {vec2} out + */ +vec2.copy = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; +}; + +/** + * Set the components of a vec2 to the given values + * + * @param {vec2} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @returns {vec2} out + */ +vec2.set = function(out, x, y) { + out[0] = x; + out[1] = y; + return out; +}; + +/** + * Adds two vec2's + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {vec2} out + */ +vec2.add = function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; +}; + +/** + * Subtracts vector b from vector a + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {vec2} out + */ +vec2.subtract = function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; +}; + +/** + * Alias for {@link vec2.subtract} + * @function + */ +vec2.sub = vec2.subtract; + +/** + * Multiplies two vec2's + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {vec2} out + */ +vec2.multiply = function(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + return out; +}; + +/** + * Alias for {@link vec2.multiply} + * @function + */ +vec2.mul = vec2.multiply; + +/** + * Divides two vec2's + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {vec2} out + */ +vec2.divide = function(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + return out; +}; + +/** + * Alias for {@link vec2.divide} + * @function + */ +vec2.div = vec2.divide; + +/** + * Math.ceil the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to ceil + * @returns {vec2} out + */ +vec2.ceil = function (out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + return out; +}; + +/** + * Math.floor the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to floor + * @returns {vec2} out + */ +vec2.floor = function (out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + return out; +}; + +/** + * Returns the minimum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {vec2} out + */ +vec2.min = function(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + return out; +}; + +/** + * Returns the maximum of two vec2's + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {vec2} out + */ +vec2.max = function(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + return out; +}; + +/** + * Math.round the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to round + * @returns {vec2} out + */ +vec2.round = function (out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + return out; +}; + +/** + * Scales a vec2 by a scalar number + * + * @param {vec2} out the receiving vector + * @param {vec2} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec2} out + */ +vec2.scale = function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; +}; + +/** + * Adds two vec2's after scaling the second operand by a scalar value + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec2} out + */ +vec2.scaleAndAdd = function(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale); + out[1] = a[1] + (b[1] * scale); + return out; +}; + +/** + * Calculates the euclidian distance between two vec2's + * + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {Number} distance between a and b + */ +vec2.distance = function(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return Math.sqrt(x*x + y*y); +}; + +/** + * Alias for {@link vec2.distance} + * @function + */ +vec2.dist = vec2.distance; + +/** + * Calculates the squared euclidian distance between two vec2's + * + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {Number} squared distance between a and b + */ +vec2.squaredDistance = function(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1]; + return x*x + y*y; +}; + +/** + * Alias for {@link vec2.squaredDistance} + * @function + */ +vec2.sqrDist = vec2.squaredDistance; + +/** + * Calculates the length of a vec2 + * + * @param {vec2} a vector to calculate length of + * @returns {Number} length of a + */ +vec2.length = function (a) { + var x = a[0], + y = a[1]; + return Math.sqrt(x*x + y*y); +}; + +/** + * Alias for {@link vec2.length} + * @function + */ +vec2.len = vec2.length; + +/** + * Calculates the squared length of a vec2 + * + * @param {vec2} a vector to calculate squared length of + * @returns {Number} squared length of a + */ +vec2.squaredLength = function (a) { + var x = a[0], + y = a[1]; + return x*x + y*y; +}; + +/** + * Alias for {@link vec2.squaredLength} + * @function + */ +vec2.sqrLen = vec2.squaredLength; + +/** + * Negates the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to negate + * @returns {vec2} out + */ +vec2.negate = function(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; +}; + +/** + * Returns the inverse of the components of a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to invert + * @returns {vec2} out + */ +vec2.inverse = function(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + return out; +}; + +/** + * Normalize a vec2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a vector to normalize + * @returns {vec2} out + */ +vec2.normalize = function(out, a) { + var x = a[0], + y = a[1]; + var len = x*x + y*y; + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + out[0] = a[0] * len; + out[1] = a[1] * len; + } + return out; +}; + +/** + * Calculates the dot product of two vec2's + * + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {Number} dot product of a and b + */ +vec2.dot = function (a, b) { + return a[0] * b[0] + a[1] * b[1]; +}; + +/** + * Computes the cross product of two vec2's + * Note that the cross product must by definition produce a 3D vector + * + * @param {vec3} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @returns {vec3} out + */ +vec2.cross = function(out, a, b) { + var z = a[0] * b[1] - a[1] * b[0]; + out[0] = out[1] = 0; + out[2] = z; + return out; +}; + +/** + * Performs a linear interpolation between two vec2's + * + * @param {vec2} out the receiving vector + * @param {vec2} a the first operand + * @param {vec2} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {vec2} out + */ +vec2.lerp = function (out, a, b, t) { + var ax = a[0], + ay = a[1]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + return out; +}; + +/** + * Generates a random vector with the given scale + * + * @param {vec2} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec2} out + */ +vec2.random = function (out, scale) { + scale = scale || 1.0; + var r = glMatrix.RANDOM() * 2.0 * Math.PI; + out[0] = Math.cos(r) * scale; + out[1] = Math.sin(r) * scale; + return out; +}; + +/** + * Transforms the vec2 with a mat2 + * + * @param {vec2} out the receiving vector + * @param {vec2} a the vector to transform + * @param {mat2} m matrix to transform with + * @returns {vec2} out + */ +vec2.transformMat2 = function(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y; + out[1] = m[1] * x + m[3] * y; + return out; +}; + +/** + * Transforms the vec2 with a mat2d + * + * @param {vec2} out the receiving vector + * @param {vec2} a the vector to transform + * @param {mat2d} m matrix to transform with + * @returns {vec2} out + */ +vec2.transformMat2d = function(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; +}; + +/** + * Transforms the vec2 with a mat3 + * 3rd vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {vec2} a the vector to transform + * @param {mat3} m matrix to transform with + * @returns {vec2} out + */ +vec2.transformMat3 = function(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[3] * y + m[6]; + out[1] = m[1] * x + m[4] * y + m[7]; + return out; +}; + +/** + * Transforms the vec2 with a mat4 + * 3rd vector component is implicitly '0' + * 4th vector component is implicitly '1' + * + * @param {vec2} out the receiving vector + * @param {vec2} a the vector to transform + * @param {mat4} m matrix to transform with + * @returns {vec2} out + */ +vec2.transformMat4 = function(out, a, m) { + var x = a[0], + y = a[1]; + out[0] = m[0] * x + m[4] * y + m[12]; + out[1] = m[1] * x + m[5] * y + m[13]; + return out; +}; + +/** + * Perform some operation over an array of vec2s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ +vec2.forEach = (function() { + var vec = vec2.create(); + + return function(a, stride, offset, count, fn, arg) { + var i, l; + if(!stride) { + stride = 2; + } + + if(!offset) { + offset = 0; + } + + if(count) { + l = Math.min((count * stride) + offset, a.length); + } else { + l = a.length; + } + + for(i = offset; i < l; i += stride) { + vec[0] = a[i]; vec[1] = a[i+1]; + fn(vec, vec, arg); + a[i] = vec[0]; a[i+1] = vec[1]; + } + + return a; + }; +})(); + +/** + * Returns a string representation of a vector + * + * @param {vec2} vec vector to represent as a string + * @returns {String} string representation of the vector + */ +vec2.str = function (a) { + return 'vec2(' + a[0] + ', ' + a[1] + ')'; +}; + +/** + * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) + * + * @param {vec2} a The first vector. + * @param {vec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +vec2.exactEquals = function (a, b) { + return a[0] === b[0] && a[1] === b[1]; +}; + +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {vec2} a The first vector. + * @param {vec2} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +vec2.equals = function (a, b) { + var a0 = a[0], a1 = a[1]; + var b0 = b[0], b1 = b[1]; + return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1))); +}; + +module.exports = vec2; diff --git a/node_modules/gl-matrix/src/gl-matrix/vec3.js b/node_modules/gl-matrix/src/gl-matrix/vec3.js new file mode 100755 index 00000000..b2cc6522 --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/vec3.js @@ -0,0 +1,777 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); + +/** + * @class 3 Dimensional Vector + * @name vec3 + */ +var vec3 = {}; + +/** + * Creates a new, empty vec3 + * + * @returns {vec3} a new 3D vector + */ +vec3.create = function() { + var out = new glMatrix.ARRAY_TYPE(3); + out[0] = 0; + out[1] = 0; + out[2] = 0; + return out; +}; + +/** + * Creates a new vec3 initialized with values from an existing vector + * + * @param {vec3} a vector to clone + * @returns {vec3} a new 3D vector + */ +vec3.clone = function(a) { + var out = new glMatrix.ARRAY_TYPE(3); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +}; + +/** + * Creates a new vec3 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} a new 3D vector + */ +vec3.fromValues = function(x, y, z) { + var out = new glMatrix.ARRAY_TYPE(3); + out[0] = x; + out[1] = y; + out[2] = z; + return out; +}; + +/** + * Copy the values from one vec3 to another + * + * @param {vec3} out the receiving vector + * @param {vec3} a the source vector + * @returns {vec3} out + */ +vec3.copy = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + return out; +}; + +/** + * Set the components of a vec3 to the given values + * + * @param {vec3} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @returns {vec3} out + */ +vec3.set = function(out, x, y, z) { + out[0] = x; + out[1] = y; + out[2] = z; + return out; +}; + +/** + * Adds two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +vec3.add = function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + return out; +}; + +/** + * Subtracts vector b from vector a + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +vec3.subtract = function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + return out; +}; + +/** + * Alias for {@link vec3.subtract} + * @function + */ +vec3.sub = vec3.subtract; + +/** + * Multiplies two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +vec3.multiply = function(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + return out; +}; + +/** + * Alias for {@link vec3.multiply} + * @function + */ +vec3.mul = vec3.multiply; + +/** + * Divides two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +vec3.divide = function(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + return out; +}; + +/** + * Alias for {@link vec3.divide} + * @function + */ +vec3.div = vec3.divide; + +/** + * Math.ceil the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to ceil + * @returns {vec3} out + */ +vec3.ceil = function (out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + return out; +}; + +/** + * Math.floor the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to floor + * @returns {vec3} out + */ +vec3.floor = function (out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + return out; +}; + +/** + * Returns the minimum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +vec3.min = function(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + return out; +}; + +/** + * Returns the maximum of two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +vec3.max = function(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + return out; +}; + +/** + * Math.round the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to round + * @returns {vec3} out + */ +vec3.round = function (out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + return out; +}; + +/** + * Scales a vec3 by a scalar number + * + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec3} out + */ +vec3.scale = function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + return out; +}; + +/** + * Adds two vec3's after scaling the second operand by a scalar value + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec3} out + */ +vec3.scaleAndAdd = function(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale); + out[1] = a[1] + (b[1] * scale); + out[2] = a[2] + (b[2] * scale); + return out; +}; + +/** + * Calculates the euclidian distance between two vec3's + * + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {Number} distance between a and b + */ +vec3.distance = function(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2]; + return Math.sqrt(x*x + y*y + z*z); +}; + +/** + * Alias for {@link vec3.distance} + * @function + */ +vec3.dist = vec3.distance; + +/** + * Calculates the squared euclidian distance between two vec3's + * + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {Number} squared distance between a and b + */ +vec3.squaredDistance = function(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2]; + return x*x + y*y + z*z; +}; + +/** + * Alias for {@link vec3.squaredDistance} + * @function + */ +vec3.sqrDist = vec3.squaredDistance; + +/** + * Calculates the length of a vec3 + * + * @param {vec3} a vector to calculate length of + * @returns {Number} length of a + */ +vec3.length = function (a) { + var x = a[0], + y = a[1], + z = a[2]; + return Math.sqrt(x*x + y*y + z*z); +}; + +/** + * Alias for {@link vec3.length} + * @function + */ +vec3.len = vec3.length; + +/** + * Calculates the squared length of a vec3 + * + * @param {vec3} a vector to calculate squared length of + * @returns {Number} squared length of a + */ +vec3.squaredLength = function (a) { + var x = a[0], + y = a[1], + z = a[2]; + return x*x + y*y + z*z; +}; + +/** + * Alias for {@link vec3.squaredLength} + * @function + */ +vec3.sqrLen = vec3.squaredLength; + +/** + * Negates the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to negate + * @returns {vec3} out + */ +vec3.negate = function(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + return out; +}; + +/** + * Returns the inverse of the components of a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to invert + * @returns {vec3} out + */ +vec3.inverse = function(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + return out; +}; + +/** + * Normalize a vec3 + * + * @param {vec3} out the receiving vector + * @param {vec3} a vector to normalize + * @returns {vec3} out + */ +vec3.normalize = function(out, a) { + var x = a[0], + y = a[1], + z = a[2]; + var len = x*x + y*y + z*z; + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + out[0] = a[0] * len; + out[1] = a[1] * len; + out[2] = a[2] * len; + } + return out; +}; + +/** + * Calculates the dot product of two vec3's + * + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {Number} dot product of a and b + */ +vec3.dot = function (a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; +}; + +/** + * Computes the cross product of two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @returns {vec3} out + */ +vec3.cross = function(out, a, b) { + var ax = a[0], ay = a[1], az = a[2], + bx = b[0], by = b[1], bz = b[2]; + + out[0] = ay * bz - az * by; + out[1] = az * bx - ax * bz; + out[2] = ax * by - ay * bx; + return out; +}; + +/** + * Performs a linear interpolation between two vec3's + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {vec3} out + */ +vec3.lerp = function (out, a, b, t) { + var ax = a[0], + ay = a[1], + az = a[2]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + return out; +}; + +/** + * Performs a hermite interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {vec3} c the third operand + * @param {vec3} d the fourth operand + * @param {Number} t interpolation amount between the two inputs + * @returns {vec3} out + */ +vec3.hermite = function (out, a, b, c, d, t) { + var factorTimes2 = t * t, + factor1 = factorTimes2 * (2 * t - 3) + 1, + factor2 = factorTimes2 * (t - 2) + t, + factor3 = factorTimes2 * (t - 1), + factor4 = factorTimes2 * (3 - 2 * t); + + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + + return out; +}; + +/** + * Performs a bezier interpolation with two control points + * + * @param {vec3} out the receiving vector + * @param {vec3} a the first operand + * @param {vec3} b the second operand + * @param {vec3} c the third operand + * @param {vec3} d the fourth operand + * @param {Number} t interpolation amount between the two inputs + * @returns {vec3} out + */ +vec3.bezier = function (out, a, b, c, d, t) { + var inverseFactor = 1 - t, + inverseFactorTimesTwo = inverseFactor * inverseFactor, + factorTimes2 = t * t, + factor1 = inverseFactorTimesTwo * inverseFactor, + factor2 = 3 * t * inverseFactorTimesTwo, + factor3 = 3 * factorTimes2 * inverseFactor, + factor4 = factorTimes2 * t; + + out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; + out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; + out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; + + return out; +}; + +/** + * Generates a random vector with the given scale + * + * @param {vec3} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec3} out + */ +vec3.random = function (out, scale) { + scale = scale || 1.0; + + var r = glMatrix.RANDOM() * 2.0 * Math.PI; + var z = (glMatrix.RANDOM() * 2.0) - 1.0; + var zScale = Math.sqrt(1.0-z*z) * scale; + + out[0] = Math.cos(r) * zScale; + out[1] = Math.sin(r) * zScale; + out[2] = z * scale; + return out; +}; + +/** + * Transforms the vec3 with a mat4. + * 4th vector component is implicitly '1' + * + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to transform + * @param {mat4} m matrix to transform with + * @returns {vec3} out + */ +vec3.transformMat4 = function(out, a, m) { + var x = a[0], y = a[1], z = a[2], + w = m[3] * x + m[7] * y + m[11] * z + m[15]; + w = w || 1.0; + out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return out; +}; + +/** + * Transforms the vec3 with a mat3. + * + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to transform + * @param {mat4} m the 3x3 matrix to transform with + * @returns {vec3} out + */ +vec3.transformMat3 = function(out, a, m) { + var x = a[0], y = a[1], z = a[2]; + out[0] = x * m[0] + y * m[3] + z * m[6]; + out[1] = x * m[1] + y * m[4] + z * m[7]; + out[2] = x * m[2] + y * m[5] + z * m[8]; + return out; +}; + +/** + * Transforms the vec3 with a quat + * + * @param {vec3} out the receiving vector + * @param {vec3} a the vector to transform + * @param {quat} q quaternion to transform with + * @returns {vec3} out + */ +vec3.transformQuat = function(out, a, q) { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + + var x = a[0], y = a[1], z = a[2], + qx = q[0], qy = q[1], qz = q[2], qw = q[3], + + // calculate quat * vec + ix = qw * x + qy * z - qz * y, + iy = qw * y + qz * x - qx * z, + iz = qw * z + qx * y - qy * x, + iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + return out; +}; + +/** + * Rotate a 3D vector around the x-axis + * @param {vec3} out The receiving vec3 + * @param {vec3} a The vec3 point to rotate + * @param {vec3} b The origin of the rotation + * @param {Number} c The angle of rotation + * @returns {vec3} out + */ +vec3.rotateX = function(out, a, b, c){ + var p = [], r=[]; + //Translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; + + //perform rotation + r[0] = p[0]; + r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c); + r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c); + + //translate to correct position + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + + return out; +}; + +/** + * Rotate a 3D vector around the y-axis + * @param {vec3} out The receiving vec3 + * @param {vec3} a The vec3 point to rotate + * @param {vec3} b The origin of the rotation + * @param {Number} c The angle of rotation + * @returns {vec3} out + */ +vec3.rotateY = function(out, a, b, c){ + var p = [], r=[]; + //Translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; + + //perform rotation + r[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c); + r[1] = p[1]; + r[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c); + + //translate to correct position + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + + return out; +}; + +/** + * Rotate a 3D vector around the z-axis + * @param {vec3} out The receiving vec3 + * @param {vec3} a The vec3 point to rotate + * @param {vec3} b The origin of the rotation + * @param {Number} c The angle of rotation + * @returns {vec3} out + */ +vec3.rotateZ = function(out, a, b, c){ + var p = [], r=[]; + //Translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; + + //perform rotation + r[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c); + r[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c); + r[2] = p[2]; + + //translate to correct position + out[0] = r[0] + b[0]; + out[1] = r[1] + b[1]; + out[2] = r[2] + b[2]; + + return out; +}; + +/** + * Perform some operation over an array of vec3s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ +vec3.forEach = (function() { + var vec = vec3.create(); + + return function(a, stride, offset, count, fn, arg) { + var i, l; + if(!stride) { + stride = 3; + } + + if(!offset) { + offset = 0; + } + + if(count) { + l = Math.min((count * stride) + offset, a.length); + } else { + l = a.length; + } + + for(i = offset; i < l; i += stride) { + vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2]; + fn(vec, vec, arg); + a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2]; + } + + return a; + }; +})(); + +/** + * Get the angle between two 3D vectors + * @param {vec3} a The first operand + * @param {vec3} b The second operand + * @returns {Number} The angle in radians + */ +vec3.angle = function(a, b) { + + var tempA = vec3.fromValues(a[0], a[1], a[2]); + var tempB = vec3.fromValues(b[0], b[1], b[2]); + + vec3.normalize(tempA, tempA); + vec3.normalize(tempB, tempB); + + var cosine = vec3.dot(tempA, tempB); + + if(cosine > 1.0){ + return 0; + } else { + return Math.acos(cosine); + } +}; + +/** + * Returns a string representation of a vector + * + * @param {vec3} vec vector to represent as a string + * @returns {String} string representation of the vector + */ +vec3.str = function (a) { + return 'vec3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')'; +}; + +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {vec3} a The first vector. + * @param {vec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +vec3.exactEquals = function (a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; +}; + +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {vec3} a The first vector. + * @param {vec3} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +vec3.equals = function (a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2]; + var b0 = b[0], b1 = b[1], b2 = b[2]; + return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2))); +}; + +module.exports = vec3; diff --git a/node_modules/gl-matrix/src/gl-matrix/vec4.js b/node_modules/gl-matrix/src/gl-matrix/vec4.js new file mode 100755 index 00000000..f19529f6 --- /dev/null +++ b/node_modules/gl-matrix/src/gl-matrix/vec4.js @@ -0,0 +1,609 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var glMatrix = require("./common.js"); + +/** + * @class 4 Dimensional Vector + * @name vec4 + */ +var vec4 = {}; + +/** + * Creates a new, empty vec4 + * + * @returns {vec4} a new 4D vector + */ +vec4.create = function() { + var out = new glMatrix.ARRAY_TYPE(4); + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + return out; +}; + +/** + * Creates a new vec4 initialized with values from an existing vector + * + * @param {vec4} a vector to clone + * @returns {vec4} a new 4D vector + */ +vec4.clone = function(a) { + var out = new glMatrix.ARRAY_TYPE(4); + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +}; + +/** + * Creates a new vec4 initialized with the given values + * + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} a new 4D vector + */ +vec4.fromValues = function(x, y, z, w) { + var out = new glMatrix.ARRAY_TYPE(4); + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +}; + +/** + * Copy the values from one vec4 to another + * + * @param {vec4} out the receiving vector + * @param {vec4} a the source vector + * @returns {vec4} out + */ +vec4.copy = function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + return out; +}; + +/** + * Set the components of a vec4 to the given values + * + * @param {vec4} out the receiving vector + * @param {Number} x X component + * @param {Number} y Y component + * @param {Number} z Z component + * @param {Number} w W component + * @returns {vec4} out + */ +vec4.set = function(out, x, y, z, w) { + out[0] = x; + out[1] = y; + out[2] = z; + out[3] = w; + return out; +}; + +/** + * Adds two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +vec4.add = function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + out[2] = a[2] + b[2]; + out[3] = a[3] + b[3]; + return out; +}; + +/** + * Subtracts vector b from vector a + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +vec4.subtract = function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + out[2] = a[2] - b[2]; + out[3] = a[3] - b[3]; + return out; +}; + +/** + * Alias for {@link vec4.subtract} + * @function + */ +vec4.sub = vec4.subtract; + +/** + * Multiplies two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +vec4.multiply = function(out, a, b) { + out[0] = a[0] * b[0]; + out[1] = a[1] * b[1]; + out[2] = a[2] * b[2]; + out[3] = a[3] * b[3]; + return out; +}; + +/** + * Alias for {@link vec4.multiply} + * @function + */ +vec4.mul = vec4.multiply; + +/** + * Divides two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +vec4.divide = function(out, a, b) { + out[0] = a[0] / b[0]; + out[1] = a[1] / b[1]; + out[2] = a[2] / b[2]; + out[3] = a[3] / b[3]; + return out; +}; + +/** + * Alias for {@link vec4.divide} + * @function + */ +vec4.div = vec4.divide; + +/** + * Math.ceil the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to ceil + * @returns {vec4} out + */ +vec4.ceil = function (out, a) { + out[0] = Math.ceil(a[0]); + out[1] = Math.ceil(a[1]); + out[2] = Math.ceil(a[2]); + out[3] = Math.ceil(a[3]); + return out; +}; + +/** + * Math.floor the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to floor + * @returns {vec4} out + */ +vec4.floor = function (out, a) { + out[0] = Math.floor(a[0]); + out[1] = Math.floor(a[1]); + out[2] = Math.floor(a[2]); + out[3] = Math.floor(a[3]); + return out; +}; + +/** + * Returns the minimum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +vec4.min = function(out, a, b) { + out[0] = Math.min(a[0], b[0]); + out[1] = Math.min(a[1], b[1]); + out[2] = Math.min(a[2], b[2]); + out[3] = Math.min(a[3], b[3]); + return out; +}; + +/** + * Returns the maximum of two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {vec4} out + */ +vec4.max = function(out, a, b) { + out[0] = Math.max(a[0], b[0]); + out[1] = Math.max(a[1], b[1]); + out[2] = Math.max(a[2], b[2]); + out[3] = Math.max(a[3], b[3]); + return out; +}; + +/** + * Math.round the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to round + * @returns {vec4} out + */ +vec4.round = function (out, a) { + out[0] = Math.round(a[0]); + out[1] = Math.round(a[1]); + out[2] = Math.round(a[2]); + out[3] = Math.round(a[3]); + return out; +}; + +/** + * Scales a vec4 by a scalar number + * + * @param {vec4} out the receiving vector + * @param {vec4} a the vector to scale + * @param {Number} b amount to scale the vector by + * @returns {vec4} out + */ +vec4.scale = function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + out[2] = a[2] * b; + out[3] = a[3] * b; + return out; +}; + +/** + * Adds two vec4's after scaling the second operand by a scalar value + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @param {Number} scale the amount to scale b by before adding + * @returns {vec4} out + */ +vec4.scaleAndAdd = function(out, a, b, scale) { + out[0] = a[0] + (b[0] * scale); + out[1] = a[1] + (b[1] * scale); + out[2] = a[2] + (b[2] * scale); + out[3] = a[3] + (b[3] * scale); + return out; +}; + +/** + * Calculates the euclidian distance between two vec4's + * + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {Number} distance between a and b + */ +vec4.distance = function(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2], + w = b[3] - a[3]; + return Math.sqrt(x*x + y*y + z*z + w*w); +}; + +/** + * Alias for {@link vec4.distance} + * @function + */ +vec4.dist = vec4.distance; + +/** + * Calculates the squared euclidian distance between two vec4's + * + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {Number} squared distance between a and b + */ +vec4.squaredDistance = function(a, b) { + var x = b[0] - a[0], + y = b[1] - a[1], + z = b[2] - a[2], + w = b[3] - a[3]; + return x*x + y*y + z*z + w*w; +}; + +/** + * Alias for {@link vec4.squaredDistance} + * @function + */ +vec4.sqrDist = vec4.squaredDistance; + +/** + * Calculates the length of a vec4 + * + * @param {vec4} a vector to calculate length of + * @returns {Number} length of a + */ +vec4.length = function (a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + return Math.sqrt(x*x + y*y + z*z + w*w); +}; + +/** + * Alias for {@link vec4.length} + * @function + */ +vec4.len = vec4.length; + +/** + * Calculates the squared length of a vec4 + * + * @param {vec4} a vector to calculate squared length of + * @returns {Number} squared length of a + */ +vec4.squaredLength = function (a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + return x*x + y*y + z*z + w*w; +}; + +/** + * Alias for {@link vec4.squaredLength} + * @function + */ +vec4.sqrLen = vec4.squaredLength; + +/** + * Negates the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to negate + * @returns {vec4} out + */ +vec4.negate = function(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + out[2] = -a[2]; + out[3] = -a[3]; + return out; +}; + +/** + * Returns the inverse of the components of a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to invert + * @returns {vec4} out + */ +vec4.inverse = function(out, a) { + out[0] = 1.0 / a[0]; + out[1] = 1.0 / a[1]; + out[2] = 1.0 / a[2]; + out[3] = 1.0 / a[3]; + return out; +}; + +/** + * Normalize a vec4 + * + * @param {vec4} out the receiving vector + * @param {vec4} a vector to normalize + * @returns {vec4} out + */ +vec4.normalize = function(out, a) { + var x = a[0], + y = a[1], + z = a[2], + w = a[3]; + var len = x*x + y*y + z*z + w*w; + if (len > 0) { + len = 1 / Math.sqrt(len); + out[0] = x * len; + out[1] = y * len; + out[2] = z * len; + out[3] = w * len; + } + return out; +}; + +/** + * Calculates the dot product of two vec4's + * + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @returns {Number} dot product of a and b + */ +vec4.dot = function (a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; +}; + +/** + * Performs a linear interpolation between two vec4's + * + * @param {vec4} out the receiving vector + * @param {vec4} a the first operand + * @param {vec4} b the second operand + * @param {Number} t interpolation amount between the two inputs + * @returns {vec4} out + */ +vec4.lerp = function (out, a, b, t) { + var ax = a[0], + ay = a[1], + az = a[2], + aw = a[3]; + out[0] = ax + t * (b[0] - ax); + out[1] = ay + t * (b[1] - ay); + out[2] = az + t * (b[2] - az); + out[3] = aw + t * (b[3] - aw); + return out; +}; + +/** + * Generates a random vector with the given scale + * + * @param {vec4} out the receiving vector + * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned + * @returns {vec4} out + */ +vec4.random = function (out, scale) { + scale = scale || 1.0; + + //TODO: This is a pretty awful way of doing this. Find something better. + out[0] = glMatrix.RANDOM(); + out[1] = glMatrix.RANDOM(); + out[2] = glMatrix.RANDOM(); + out[3] = glMatrix.RANDOM(); + vec4.normalize(out, out); + vec4.scale(out, out, scale); + return out; +}; + +/** + * Transforms the vec4 with a mat4. + * + * @param {vec4} out the receiving vector + * @param {vec4} a the vector to transform + * @param {mat4} m matrix to transform with + * @returns {vec4} out + */ +vec4.transformMat4 = function(out, a, m) { + var x = a[0], y = a[1], z = a[2], w = a[3]; + out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return out; +}; + +/** + * Transforms the vec4 with a quat + * + * @param {vec4} out the receiving vector + * @param {vec4} a the vector to transform + * @param {quat} q quaternion to transform with + * @returns {vec4} out + */ +vec4.transformQuat = function(out, a, q) { + var x = a[0], y = a[1], z = a[2], + qx = q[0], qy = q[1], qz = q[2], qw = q[3], + + // calculate quat * vec + ix = qw * x + qy * z - qz * y, + iy = qw * y + qz * x - qx * z, + iz = qw * z + qx * y - qy * x, + iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; + out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; + out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; + out[3] = a[3]; + return out; +}; + +/** + * Perform some operation over an array of vec4s. + * + * @param {Array} a the array of vectors to iterate over + * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed + * @param {Number} offset Number of elements to skip at the beginning of the array + * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array + * @param {Function} fn Function to call for each vector in the array + * @param {Object} [arg] additional argument to pass to fn + * @returns {Array} a + * @function + */ +vec4.forEach = (function() { + var vec = vec4.create(); + + return function(a, stride, offset, count, fn, arg) { + var i, l; + if(!stride) { + stride = 4; + } + + if(!offset) { + offset = 0; + } + + if(count) { + l = Math.min((count * stride) + offset, a.length); + } else { + l = a.length; + } + + for(i = offset; i < l; i += stride) { + vec[0] = a[i]; vec[1] = a[i+1]; vec[2] = a[i+2]; vec[3] = a[i+3]; + fn(vec, vec, arg); + a[i] = vec[0]; a[i+1] = vec[1]; a[i+2] = vec[2]; a[i+3] = vec[3]; + } + + return a; + }; +})(); + +/** + * Returns a string representation of a vector + * + * @param {vec4} vec vector to represent as a string + * @returns {String} string representation of the vector + */ +vec4.str = function (a) { + return 'vec4(' + a[0] + ', ' + a[1] + ', ' + a[2] + ', ' + a[3] + ')'; +}; + +/** + * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) + * + * @param {vec4} a The first vector. + * @param {vec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +vec4.exactEquals = function (a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; +}; + +/** + * Returns whether or not the vectors have approximately the same elements in the same position. + * + * @param {vec4} a The first vector. + * @param {vec4} b The second vector. + * @returns {Boolean} True if the vectors are equal, false otherwise. + */ +vec4.equals = function (a, b) { + var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; + return (Math.abs(a0 - b0) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a0), Math.abs(b0)) && + Math.abs(a1 - b1) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a1), Math.abs(b1)) && + Math.abs(a2 - b2) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a2), Math.abs(b2)) && + Math.abs(a3 - b3) <= glMatrix.EPSILON*Math.max(1.0, Math.abs(a3), Math.abs(b3))); +}; + +module.exports = vec4; diff --git a/node_modules/gl-matrix/webpack.config.js b/node_modules/gl-matrix/webpack.config.js new file mode 100755 index 00000000..b9eace3a --- /dev/null +++ b/node_modules/gl-matrix/webpack.config.js @@ -0,0 +1,47 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var fs = require('fs'); +var webpack = require('webpack'); + +var entryFile = './src/gl-matrix.js'; + +// Read the comments from the top of the main gl-matrix file and append them to +// the minified version. +var header = ''; +var mainFile = fs.readFileSync(entryFile, { encoding: 'utf8' }); +if (mainFile) { + var headerIndex = mainFile.indexOf('\/\/ END HEADER'); + if (headerIndex >= 0) { + header = mainFile.substr(0, headerIndex); + } +} + +module.exports = { + entry: entryFile, + output: { + path: __dirname + '/dist', + filename: 'gl-matrix.js', + libraryTarget: 'umd' + }, + plugins: [ + new webpack.BannerPlugin(header, { raw: true }), + ] +}; \ No newline at end of file diff --git a/node_modules/gl-matrix/webpack.config.min.js b/node_modules/gl-matrix/webpack.config.min.js new file mode 100755 index 00000000..c7f91092 --- /dev/null +++ b/node_modules/gl-matrix/webpack.config.min.js @@ -0,0 +1,28 @@ +/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. */ + +var webpack = require('webpack'); +module.exports = require('./webpack.config.js'); + +module.exports.plugins.unshift( + new webpack.optimize.UglifyJsPlugin() +); + +module.exports.output.filename = 'gl-matrix-min.js'; \ No newline at end of file diff --git a/node_modules/glob-base/LICENSE b/node_modules/glob-base/LICENSE new file mode 100755 index 00000000..65f90aca --- /dev/null +++ b/node_modules/glob-base/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/glob-base/README.md b/node_modules/glob-base/README.md new file mode 100755 index 00000000..1da2e82f --- /dev/null +++ b/node_modules/glob-base/README.md @@ -0,0 +1,158 @@ +# glob-base [![NPM version](https://badge.fury.io/js/glob-base.svg)](http://badge.fury.io/js/glob-base) [![Build Status](https://travis-ci.org/jonschlinkert/glob-base.svg)](https://travis-ci.org/jonschlinkert/glob-base) + +> Returns an object with the (non-glob) base path and the actual pattern. + +Use [glob-parent](https://github.com/es128/glob-parent) if you just want the base path. + +## Install with [npm](npmjs.org) + +```bash +npm i glob-base --save +``` + +## Related projects +* [glob-parent](https://github.com/es128/glob-parent): Strips glob magic from a string to provide the parent path +* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks. +* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens. +* [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern. +* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification. +* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to use. +* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch. + +## Usage + +```js +var globBase = require('glob-base'); + +globBase('a/b/.git/'); +//=> { base: 'a/b/.git/', isGlob: false, glob: '' }) + +globBase('a/b/**/e'); +//=> { base: 'a/b', isGlob: true, glob: '**/e' } + +globBase('a/b/*.{foo,bar}'); +//=> { base: 'a/b', isGlob: true, glob: '*.{foo,bar}' } + +globBase('a/b/.git/**'); +//=> { base: 'a/b/.git', isGlob: true, glob: '**' } + +globBase('a/b/c/*.md'); +//=> { base: 'a/b/c', isGlob: true, glob: '*.md' } + +globBase('a/b/c/.*.md'); +//=> { base: 'a/b/c', isGlob: true, glob: '.*.md' } + +globBase('a/b/{c,d}'); +//=> { base: 'a/b', isGlob: true, glob: '{c,d}' } + +globBase('!*.min.js'); +//=> { base: '.', isGlob: true, glob: '!*.min.js' } + +globBase('!foo'); +//=> { base: '.', isGlob: true, glob: '!foo' } + +globBase('!foo/(a|b).min.js'); +//=> { base: '.', isGlob: true, glob: '!foo/(a|b).min.js' } + +globBase(''); +//=> { base: '.', isGlob: false, glob: '' } + +globBase('**/*.md'); +//=> { base: '.', isGlob: true, glob: '**/*.md' } + +globBase('**/*.min.js'); +//=> { base: '.', isGlob: true, glob: '**/*.min.js' } + +globBase('**/.*'); +//=> { base: '.', isGlob: true, glob: '**/.*' } + +globBase('**/d'); +//=> { base: '.', isGlob: true, glob: '**/d' } + +globBase('*.*'); +//=> { base: '.', isGlob: true, glob: '*.*' } + +globBase('*.min.js'); +//=> { base: '.', isGlob: true, glob: '*.min.js' } + +globBase('*/*'); +//=> { base: '.', isGlob: true, glob: '*/*' } + +globBase('*b'); +//=> { base: '.', isGlob: true, glob: '*b' } + +globBase('.'); +//=> { base: '.', isGlob: false, glob: '.' } + +globBase('.*'); +//=> { base: '.', isGlob: true, glob: '.*' } + +globBase('./*'); +//=> { base: '.', isGlob: true, glob: '*' } + +globBase('/a'); +//=> { base: '/', isGlob: false, glob: 'a' } + +globBase('@(a|b)/e.f.g/'); +//=> { base: '.', isGlob: true, glob: '@(a|b)/e.f.g/' } + +globBase('[a-c]b*'); +//=> { base: '.', isGlob: true, glob: '[a-c]b*' } + +globBase('a'); +//=> { base: '.', isGlob: false, glob: 'a' } + +globBase('a.min.js'); +//=> { base: '.', isGlob: false, glob: 'a.min.js' } + +globBase('a/'); +//=> { base: 'a/', isGlob: false, glob: '' } + +globBase('a/**/j/**/z/*.md'); +//=> { base: 'a', isGlob: true, glob: '**/j/**/z/*.md' } + +globBase('a/*/c/*.md'); +//=> { base: 'a', isGlob: true, glob: '*/c/*.md' } + +globBase('a/?/c.md'); +//=> { base: 'a', isGlob: true, glob: '?/c.md' } + +globBase('a/??/c.js'); +//=> { base: 'a', isGlob: true, glob: '??/c.js' } + +globBase('a?b'); +//=> { base: '.', isGlob: true, glob: 'a?b' } + +globBase('bb'); +//=> { base: '.', isGlob: false, glob: 'bb' } + +globBase('c.md'); +//=> { base: '.', isGlob: false, glob: 'c.md' } +``` + +## Running tests +Install dev dependencies. + +```bash +npm i -d && npm test +``` + + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/glob-base/issues) + + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 08, 2015._ diff --git a/node_modules/glob-base/index.js b/node_modules/glob-base/index.js new file mode 100755 index 00000000..564b4a88 --- /dev/null +++ b/node_modules/glob-base/index.js @@ -0,0 +1,51 @@ +/*! + * glob-base + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var path = require('path'); +var parent = require('glob-parent'); +var isGlob = require('is-glob'); + +module.exports = function globBase(pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('glob-base expects a string.'); + } + + var res = {}; + res.base = parent(pattern); + res.isGlob = isGlob(pattern); + + if (res.base !== '.') { + res.glob = pattern.substr(res.base.length); + if (res.glob.charAt(0) === '/') { + res.glob = res.glob.substr(1); + } + } else { + res.glob = pattern; + } + + if (!res.isGlob) { + res.base = dirname(pattern); + res.glob = res.base !== '.' + ? pattern.substr(res.base.length) + : pattern; + } + + if (res.glob.substr(0, 2) === './') { + res.glob = res.glob.substr(2); + } + if (res.glob.charAt(0) === '/') { + res.glob = res.glob.substr(1); + } + return res; +}; + +function dirname(glob) { + if (glob.slice(-1) === '/') return glob; + return path.dirname(glob); +} diff --git a/node_modules/glob-base/package.json b/node_modules/glob-base/package.json new file mode 100755 index 00000000..426a18f9 --- /dev/null +++ b/node_modules/glob-base/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "glob-base@^0.3.0", + "scope": null, + "escapedName": "glob-base", + "name": "glob-base", + "rawSpec": "^0.3.0", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/parse-glob" + ] + ], + "_from": "glob-base@>=0.3.0 <0.4.0", + "_id": "glob-base@0.3.0", + "_inCache": true, + "_location": "/glob-base", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "es128", + "email": "elan.shanker+npm@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "glob-base@^0.3.0", + "scope": null, + "escapedName": "glob-base", + "name": "glob-base", + "rawSpec": "^0.3.0", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "_shasum": "dbb164f6221b1c0b1ccf82aea328b497df0ea3c4", + "_shrinkwrap": null, + "_spec": "glob-base@^0.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/parse-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/glob-base/issues" + }, + "dependencies": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "description": "Returns an object with the (non-glob) base path and the actual pattern.", + "devDependencies": { + "mocha": "*", + "should": "^5.1.0" + }, + "directories": {}, + "dist": { + "shasum": "dbb164f6221b1c0b1ccf82aea328b497df0ea3c4", + "tarball": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "adbc0ab07ec8a85f76ffd1b54dd41cdb9d1d0b83", + "homepage": "https://github.com/jonschlinkert/glob-base", + "keywords": [ + "base", + "directory", + "dirname", + "expression", + "glob", + "parent", + "path", + "pattern", + "regex", + "regular", + "root" + ], + "license": { + "type": "MIT", + "url": "https://github.com/jonschlinkert/glob-base/blob/master/LICENSE" + }, + "main": "index.js", + "maintainers": [ + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + }, + { + "name": "es128", + "email": "elan.shanker+npm@gmail.com" + }, + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "glob-base", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/glob-base.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.3.0" +} diff --git a/node_modules/glob-parent/.npmignore b/node_modules/glob-parent/.npmignore new file mode 100755 index 00000000..33e391f0 --- /dev/null +++ b/node_modules/glob-parent/.npmignore @@ -0,0 +1,4 @@ +node_modules +.DS_Store +npm-debug.log +coverage diff --git a/node_modules/glob-parent/.travis.yml b/node_modules/glob-parent/.travis.yml new file mode 100755 index 00000000..18fc42f6 --- /dev/null +++ b/node_modules/glob-parent/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "4" + - "iojs-v3" + - "iojs-v2" + - "iojs-v1" + - "0.12" + - "0.10" diff --git a/node_modules/glob-parent/LICENSE b/node_modules/glob-parent/LICENSE new file mode 100755 index 00000000..734076d8 --- /dev/null +++ b/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md new file mode 100755 index 00000000..ff5310d3 --- /dev/null +++ b/node_modules/glob-parent/README.md @@ -0,0 +1,43 @@ +glob-parent [![Build Status](https://travis-ci.org/es128/glob-parent.svg)](https://travis-ci.org/es128/glob-parent) [![Coverage Status](https://img.shields.io/coveralls/es128/glob-parent.svg)](https://coveralls.io/r/es128/glob-parent?branch=master) +====== +Javascript module to extract the non-magic parent path from a glob string. + +[![NPM](https://nodei.co/npm/glob-parent.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/glob-parent/) +[![NPM](https://nodei.co/npm-dl/glob-parent.png?height=3&months=9)](https://nodei.co/npm-dl/glob-parent/) + +Usage +----- +```sh +npm install glob-parent --save +``` + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) + +``` + +Change Log +---------- +[See release notes page on GitHub](https://github.com/es128/glob-parent/releases) + +License +------- +[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE) diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js new file mode 100755 index 00000000..61615f1a --- /dev/null +++ b/node_modules/glob-parent/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var path = require('path'); +var isglob = require('is-glob'); + +module.exports = function globParent(str) { + str += 'a'; // preserves full path in case of trailing path separator + do {str = path.dirname(str)} while (isglob(str)); + return str; +}; diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json new file mode 100755 index 00000000..83674f5e --- /dev/null +++ b/node_modules/glob-parent/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "glob-parent@^2.0.0", + "scope": null, + "escapedName": "glob-parent", + "name": "glob-parent", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chokidar" + ] + ], + "_from": "glob-parent@>=2.0.0 <3.0.0", + "_id": "glob-parent@2.0.0", + "_inCache": true, + "_location": "/glob-parent", + "_nodeVersion": "3.0.0", + "_npmUser": { + "name": "es128", + "email": "elan.shanker+npm@gmail.com" + }, + "_npmVersion": "2.13.3", + "_phantomChildren": {}, + "_requested": { + "raw": "glob-parent@^2.0.0", + "scope": null, + "escapedName": "glob-parent", + "name": "glob-parent", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chokidar", + "/glob-base" + ], + "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "_shasum": "81383d72db054fcccf5336daa902f182f6edbb28", + "_shrinkwrap": null, + "_spec": "glob-parent@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chokidar", + "author": { + "name": "Elan Shanker" + }, + "bugs": { + "url": "https://github.com/es128/glob-parent/issues" + }, + "dependencies": { + "is-glob": "^2.0.0" + }, + "description": "Strips glob magic from a string to provide the parent path", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.5", + "mocha": "^2.1.0" + }, + "directories": {}, + "dist": { + "shasum": "81383d72db054fcccf5336daa902f182f6edbb28", + "tarball": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" + }, + "gitHead": "a956910c7ccb5eafd1b3fe900ceb6335cc5b6d3d", + "homepage": "https://github.com/es128/glob-parent", + "keywords": [ + "glob", + "parent", + "strip", + "path", + "directory", + "base" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "es128", + "email": "elan.shanker+npm@gmail.com" + } + ], + "name": "glob-parent", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/es128/glob-parent.git" + }, + "scripts": { + "test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls" + }, + "version": "2.0.0" +} diff --git a/node_modules/glob-parent/test.js b/node_modules/glob-parent/test.js new file mode 100755 index 00000000..01156d2f --- /dev/null +++ b/node_modules/glob-parent/test.js @@ -0,0 +1,28 @@ +'use strict'; + +var gp = require('./'); +var assert = require('assert'); + +describe('glob-parent', function() { + it('should strip glob magic to return parent path', function() { + assert.equal(gp('path/to/*.js'), 'path/to'); + assert.equal(gp('/root/path/to/*.js'), '/root/path/to'); + assert.equal(gp('/*.js'), '/'); + assert.equal(gp('*.js'), '.'); + assert.equal(gp('**/*.js'), '.'); + assert.equal(gp('path/{to,from}'), 'path'); + assert.equal(gp('path/!(to|from)'), 'path'); + assert.equal(gp('path/?(to|from)'), 'path'); + assert.equal(gp('path/+(to|from)'), 'path'); + assert.equal(gp('path/*(to|from)'), 'path'); + assert.equal(gp('path/@(to|from)'), 'path'); + assert.equal(gp('path/**/*'), 'path'); + assert.equal(gp('path/**/subdir/foo.*'), 'path'); + }); + + it('should return parent dirname from non-glob paths', function() { + assert.equal(gp('path/foo/bar.js'), 'path/foo'); + assert.equal(gp('path/foo/'), 'path/foo'); + assert.equal(gp('path/foo'), 'path'); + }); +}); diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE new file mode 100755 index 00000000..19129e31 --- /dev/null +++ b/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md new file mode 100755 index 00000000..baa1d1ba --- /dev/null +++ b/node_modules/glob/README.md @@ -0,0 +1,368 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/node_modules/glob/changelog.md b/node_modules/glob/changelog.md new file mode 100755 index 00000000..41636771 --- /dev/null +++ b/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js new file mode 100755 index 00000000..66651bb3 --- /dev/null +++ b/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js new file mode 100755 index 00000000..bfdd7a11 --- /dev/null +++ b/node_modules/glob/glob.js @@ -0,0 +1,792 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json new file mode 100755 index 00000000..4e279f90 --- /dev/null +++ b/node_modules/glob/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + { + "raw": "glob@^7.0.5", + "scope": null, + "escapedName": "glob", + "name": "glob", + "rawSpec": "^7.0.5", + "spec": ">=7.0.5 <8.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/rimraf" + ] + ], + "_from": "glob@>=7.0.5 <8.0.0", + "_id": "glob@7.1.1", + "_inCache": true, + "_location": "/glob", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/glob-7.1.1.tgz_1475876991562_0.924720095237717" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "glob@^7.0.5", + "scope": null, + "escapedName": "glob", + "name": "glob", + "rawSpec": "^7.0.5", + "spec": ">=7.0.5 <8.0.0", + "type": "range" + }, + "_requiredBy": [ + "/rimraf" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "_shasum": "805211df04faaf1c63a3600306cdf5ade50b2ec8", + "_shrinkwrap": null, + "_spec": "glob@^7.0.5", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/rimraf", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^7.1.2", + "tick": "0.0.6" + }, + "directories": {}, + "dist": { + "shasum": "805211df04faaf1c63a3600306cdf5ade50b2ec8", + "tarball": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "gitHead": "bc8d43b736a98a9e289fdfceee9266cff35e5742", + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.1.1" +} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js new file mode 100755 index 00000000..c952134b --- /dev/null +++ b/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/globals/globals.json b/node_modules/globals/globals.json new file mode 100755 index 00000000..0bb6547c --- /dev/null +++ b/node_modules/globals/globals.json @@ -0,0 +1,1291 @@ +{ + "builtin": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "System": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "es5": { + "Array": false, + "Boolean": false, + "constructor": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "propertyIsEnumerable": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false + }, + "es6": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "System": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, + "browser": { + "addEventListener": false, + "alert": false, + "AnalyserNode": false, + "Animation": false, + "AnimationEffectReadOnly": false, + "AnimationEffectTiming": false, + "AnimationEffectTimingReadOnly": false, + "AnimationEvent": false, + "AnimationPlaybackEvent": false, + "AnimationTimeline": false, + "applicationCache": false, + "ApplicationCache": false, + "ApplicationCacheErrorEvent": false, + "atob": false, + "Attr": false, + "Audio": false, + "AudioBuffer": false, + "AudioBufferSourceNode": false, + "AudioContext": false, + "AudioDestinationNode": false, + "AudioListener": false, + "AudioNode": false, + "AudioParam": false, + "AudioProcessingEvent": false, + "AutocompleteErrorEvent": false, + "BarProp": false, + "BatteryManager": false, + "BeforeUnloadEvent": false, + "BiquadFilterNode": false, + "Blob": false, + "blur": false, + "btoa": false, + "Cache": false, + "caches": false, + "CacheStorage": false, + "cancelAnimationFrame": false, + "CanvasGradient": false, + "CanvasPattern": false, + "CanvasRenderingContext2D": false, + "CDATASection": false, + "ChannelMergerNode": false, + "ChannelSplitterNode": false, + "CharacterData": false, + "clearInterval": false, + "clearTimeout": false, + "clientInformation": false, + "ClientRect": false, + "ClientRectList": false, + "ClipboardEvent": false, + "close": false, + "closed": false, + "CloseEvent": false, + "Comment": false, + "CompositionEvent": false, + "confirm": false, + "console": false, + "ConvolverNode": false, + "Credential": false, + "CredentialsContainer": false, + "crypto": false, + "Crypto": false, + "CryptoKey": false, + "CSS": false, + "CSSAnimation": false, + "CSSFontFaceRule": false, + "CSSImportRule": false, + "CSSKeyframeRule": false, + "CSSKeyframesRule": false, + "CSSMediaRule": false, + "CSSPageRule": false, + "CSSRule": false, + "CSSRuleList": false, + "CSSStyleDeclaration": false, + "CSSStyleRule": false, + "CSSStyleSheet": false, + "CSSSupportsRule": false, + "CSSTransition": false, + "CSSUnknownRule": false, + "CSSViewportRule": false, + "customElements": false, + "CustomEvent": false, + "DataTransfer": false, + "DataTransferItem": false, + "DataTransferItemList": false, + "Debug": false, + "defaultStatus": false, + "defaultstatus": false, + "DelayNode": false, + "DeviceMotionEvent": false, + "DeviceOrientationEvent": false, + "devicePixelRatio": false, + "dispatchEvent": false, + "document": false, + "Document": false, + "DocumentFragment": false, + "DocumentTimeline": false, + "DocumentType": false, + "DOMError": false, + "DOMException": false, + "DOMImplementation": false, + "DOMParser": false, + "DOMSettableTokenList": false, + "DOMStringList": false, + "DOMStringMap": false, + "DOMTokenList": false, + "DragEvent": false, + "DynamicsCompressorNode": false, + "Element": false, + "ElementTimeControl": false, + "ErrorEvent": false, + "event": false, + "Event": false, + "EventSource": false, + "EventTarget": false, + "external": false, + "FederatedCredential": false, + "fetch": false, + "File": false, + "FileError": false, + "FileList": false, + "FileReader": false, + "find": false, + "focus": false, + "FocusEvent": false, + "FontFace": false, + "FormData": false, + "frameElement": false, + "frames": false, + "GainNode": false, + "Gamepad": false, + "GamepadButton": false, + "GamepadEvent": false, + "getComputedStyle": false, + "getSelection": false, + "HashChangeEvent": false, + "Headers": false, + "history": false, + "History": false, + "HTMLAllCollection": false, + "HTMLAnchorElement": false, + "HTMLAppletElement": false, + "HTMLAreaElement": false, + "HTMLAudioElement": false, + "HTMLBaseElement": false, + "HTMLBlockquoteElement": false, + "HTMLBodyElement": false, + "HTMLBRElement": false, + "HTMLButtonElement": false, + "HTMLCanvasElement": false, + "HTMLCollection": false, + "HTMLContentElement": false, + "HTMLDataListElement": false, + "HTMLDetailsElement": false, + "HTMLDialogElement": false, + "HTMLDirectoryElement": false, + "HTMLDivElement": false, + "HTMLDListElement": false, + "HTMLDocument": false, + "HTMLElement": false, + "HTMLEmbedElement": false, + "HTMLFieldSetElement": false, + "HTMLFontElement": false, + "HTMLFormControlsCollection": false, + "HTMLFormElement": false, + "HTMLFrameElement": false, + "HTMLFrameSetElement": false, + "HTMLHeadElement": false, + "HTMLHeadingElement": false, + "HTMLHRElement": false, + "HTMLHtmlElement": false, + "HTMLIFrameElement": false, + "HTMLImageElement": false, + "HTMLInputElement": false, + "HTMLIsIndexElement": false, + "HTMLKeygenElement": false, + "HTMLLabelElement": false, + "HTMLLayerElement": false, + "HTMLLegendElement": false, + "HTMLLIElement": false, + "HTMLLinkElement": false, + "HTMLMapElement": false, + "HTMLMarqueeElement": false, + "HTMLMediaElement": false, + "HTMLMenuElement": false, + "HTMLMetaElement": false, + "HTMLMeterElement": false, + "HTMLModElement": false, + "HTMLObjectElement": false, + "HTMLOListElement": false, + "HTMLOptGroupElement": false, + "HTMLOptionElement": false, + "HTMLOptionsCollection": false, + "HTMLOutputElement": false, + "HTMLParagraphElement": false, + "HTMLParamElement": false, + "HTMLPictureElement": false, + "HTMLPreElement": false, + "HTMLProgressElement": false, + "HTMLQuoteElement": false, + "HTMLScriptElement": false, + "HTMLSelectElement": false, + "HTMLShadowElement": false, + "HTMLSourceElement": false, + "HTMLSpanElement": false, + "HTMLStyleElement": false, + "HTMLTableCaptionElement": false, + "HTMLTableCellElement": false, + "HTMLTableColElement": false, + "HTMLTableElement": false, + "HTMLTableRowElement": false, + "HTMLTableSectionElement": false, + "HTMLTemplateElement": false, + "HTMLTextAreaElement": false, + "HTMLTitleElement": false, + "HTMLTrackElement": false, + "HTMLUListElement": false, + "HTMLUnknownElement": false, + "HTMLVideoElement": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBEnvironment": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "Image": false, + "ImageBitmap": false, + "ImageData": false, + "indexedDB": false, + "innerHeight": false, + "innerWidth": false, + "InputEvent": false, + "InputMethodContext": false, + "IntersectionObserver": false, + "IntersectionObserverEntry": false, + "Intl": false, + "KeyboardEvent": false, + "KeyframeEffect": false, + "KeyframeEffectReadOnly": false, + "length": false, + "localStorage": false, + "location": false, + "Location": false, + "locationbar": false, + "matchMedia": false, + "MediaElementAudioSourceNode": false, + "MediaEncryptedEvent": false, + "MediaError": false, + "MediaKeyError": false, + "MediaKeyEvent": false, + "MediaKeyMessageEvent": false, + "MediaKeys": false, + "MediaKeySession": false, + "MediaKeyStatusMap": false, + "MediaKeySystemAccess": false, + "MediaList": false, + "MediaQueryList": false, + "MediaQueryListEvent": false, + "MediaSource": false, + "MediaRecorder": false, + "MediaStream": false, + "MediaStreamAudioDestinationNode": false, + "MediaStreamAudioSourceNode": false, + "MediaStreamEvent": false, + "MediaStreamTrack": false, + "menubar": false, + "MessageChannel": false, + "MessageEvent": false, + "MessagePort": false, + "MIDIAccess": false, + "MIDIConnectionEvent": false, + "MIDIInput": false, + "MIDIInputMap": false, + "MIDIMessageEvent": false, + "MIDIOutput": false, + "MIDIOutputMap": false, + "MIDIPort": false, + "MimeType": false, + "MimeTypeArray": false, + "MouseEvent": false, + "moveBy": false, + "moveTo": false, + "MutationEvent": false, + "MutationObserver": false, + "MutationRecord": false, + "name": false, + "NamedNodeMap": false, + "navigator": false, + "Navigator": false, + "Node": false, + "NodeFilter": false, + "NodeIterator": false, + "NodeList": false, + "Notification": false, + "OfflineAudioCompletionEvent": false, + "OfflineAudioContext": false, + "offscreenBuffering": false, + "onbeforeunload": true, + "onblur": true, + "onerror": true, + "onfocus": true, + "onload": true, + "onresize": true, + "onunload": true, + "open": false, + "openDatabase": false, + "opener": false, + "opera": false, + "Option": false, + "OscillatorNode": false, + "outerHeight": false, + "outerWidth": false, + "PageTransitionEvent": false, + "pageXOffset": false, + "pageYOffset": false, + "parent": false, + "PasswordCredential": false, + "Path2D": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "PeriodicWave": false, + "Permissions": false, + "PermissionStatus": false, + "personalbar": false, + "Plugin": false, + "PluginArray": false, + "PopStateEvent": false, + "postMessage": false, + "print": false, + "ProcessingInstruction": false, + "ProgressEvent": false, + "PromiseRejectionEvent": false, + "prompt": false, + "PushManager": false, + "PushSubscription": false, + "RadioNodeList": false, + "Range": false, + "ReadableByteStream": false, + "ReadableStream": false, + "removeEventListener": false, + "Request": false, + "requestAnimationFrame": false, + "requestIdleCallback": false, + "resizeBy": false, + "resizeTo": false, + "Response": false, + "RTCIceCandidate": false, + "RTCSessionDescription": false, + "RTCPeerConnection": false, + "screen": false, + "Screen": false, + "screenLeft": false, + "ScreenOrientation": false, + "screenTop": false, + "screenX": false, + "screenY": false, + "ScriptProcessorNode": false, + "scroll": false, + "scrollbars": false, + "scrollBy": false, + "scrollTo": false, + "scrollX": false, + "scrollY": false, + "SecurityPolicyViolationEvent": false, + "Selection": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerRegistration": false, + "sessionStorage": false, + "setInterval": false, + "setTimeout": false, + "ShadowRoot": false, + "SharedKeyframeList": false, + "SharedWorker": false, + "showModalDialog": false, + "SiteBoundCredential": false, + "speechSynthesis": false, + "SpeechSynthesisEvent": false, + "SpeechSynthesisUtterance": false, + "status": false, + "statusbar": false, + "stop": false, + "Storage": false, + "StorageEvent": false, + "styleMedia": false, + "StyleSheet": false, + "StyleSheetList": false, + "SubtleCrypto": false, + "SVGAElement": false, + "SVGAltGlyphDefElement": false, + "SVGAltGlyphElement": false, + "SVGAltGlyphItemElement": false, + "SVGAngle": false, + "SVGAnimateColorElement": false, + "SVGAnimatedAngle": false, + "SVGAnimatedBoolean": false, + "SVGAnimatedEnumeration": false, + "SVGAnimatedInteger": false, + "SVGAnimatedLength": false, + "SVGAnimatedLengthList": false, + "SVGAnimatedNumber": false, + "SVGAnimatedNumberList": false, + "SVGAnimatedPathData": false, + "SVGAnimatedPoints": false, + "SVGAnimatedPreserveAspectRatio": false, + "SVGAnimatedRect": false, + "SVGAnimatedString": false, + "SVGAnimatedTransformList": false, + "SVGAnimateElement": false, + "SVGAnimateMotionElement": false, + "SVGAnimateTransformElement": false, + "SVGAnimationElement": false, + "SVGCircleElement": false, + "SVGClipPathElement": false, + "SVGColor": false, + "SVGColorProfileElement": false, + "SVGColorProfileRule": false, + "SVGComponentTransferFunctionElement": false, + "SVGCSSRule": false, + "SVGCursorElement": false, + "SVGDefsElement": false, + "SVGDescElement": false, + "SVGDiscardElement": false, + "SVGDocument": false, + "SVGElement": false, + "SVGElementInstance": false, + "SVGElementInstanceList": false, + "SVGEllipseElement": false, + "SVGEvent": false, + "SVGExternalResourcesRequired": false, + "SVGFEBlendElement": false, + "SVGFEColorMatrixElement": false, + "SVGFEComponentTransferElement": false, + "SVGFECompositeElement": false, + "SVGFEConvolveMatrixElement": false, + "SVGFEDiffuseLightingElement": false, + "SVGFEDisplacementMapElement": false, + "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, + "SVGFEFloodElement": false, + "SVGFEFuncAElement": false, + "SVGFEFuncBElement": false, + "SVGFEFuncGElement": false, + "SVGFEFuncRElement": false, + "SVGFEGaussianBlurElement": false, + "SVGFEImageElement": false, + "SVGFEMergeElement": false, + "SVGFEMergeNodeElement": false, + "SVGFEMorphologyElement": false, + "SVGFEOffsetElement": false, + "SVGFEPointLightElement": false, + "SVGFESpecularLightingElement": false, + "SVGFESpotLightElement": false, + "SVGFETileElement": false, + "SVGFETurbulenceElement": false, + "SVGFilterElement": false, + "SVGFilterPrimitiveStandardAttributes": false, + "SVGFitToViewBox": false, + "SVGFontElement": false, + "SVGFontFaceElement": false, + "SVGFontFaceFormatElement": false, + "SVGFontFaceNameElement": false, + "SVGFontFaceSrcElement": false, + "SVGFontFaceUriElement": false, + "SVGForeignObjectElement": false, + "SVGGElement": false, + "SVGGeometryElement": false, + "SVGGlyphElement": false, + "SVGGlyphRefElement": false, + "SVGGradientElement": false, + "SVGGraphicsElement": false, + "SVGHKernElement": false, + "SVGICCColor": false, + "SVGImageElement": false, + "SVGLangSpace": false, + "SVGLength": false, + "SVGLengthList": false, + "SVGLinearGradientElement": false, + "SVGLineElement": false, + "SVGLocatable": false, + "SVGMarkerElement": false, + "SVGMaskElement": false, + "SVGMatrix": false, + "SVGMetadataElement": false, + "SVGMissingGlyphElement": false, + "SVGMPathElement": false, + "SVGNumber": false, + "SVGNumberList": false, + "SVGPaint": false, + "SVGPathElement": false, + "SVGPathSeg": false, + "SVGPathSegArcAbs": false, + "SVGPathSegArcRel": false, + "SVGPathSegClosePath": false, + "SVGPathSegCurvetoCubicAbs": false, + "SVGPathSegCurvetoCubicRel": false, + "SVGPathSegCurvetoCubicSmoothAbs": false, + "SVGPathSegCurvetoCubicSmoothRel": false, + "SVGPathSegCurvetoQuadraticAbs": false, + "SVGPathSegCurvetoQuadraticRel": false, + "SVGPathSegCurvetoQuadraticSmoothAbs": false, + "SVGPathSegCurvetoQuadraticSmoothRel": false, + "SVGPathSegLinetoAbs": false, + "SVGPathSegLinetoHorizontalAbs": false, + "SVGPathSegLinetoHorizontalRel": false, + "SVGPathSegLinetoRel": false, + "SVGPathSegLinetoVerticalAbs": false, + "SVGPathSegLinetoVerticalRel": false, + "SVGPathSegList": false, + "SVGPathSegMovetoAbs": false, + "SVGPathSegMovetoRel": false, + "SVGPatternElement": false, + "SVGPoint": false, + "SVGPointList": false, + "SVGPolygonElement": false, + "SVGPolylineElement": false, + "SVGPreserveAspectRatio": false, + "SVGRadialGradientElement": false, + "SVGRect": false, + "SVGRectElement": false, + "SVGRenderingIntent": false, + "SVGScriptElement": false, + "SVGSetElement": false, + "SVGStopElement": false, + "SVGStringList": false, + "SVGStylable": false, + "SVGStyleElement": false, + "SVGSVGElement": false, + "SVGSwitchElement": false, + "SVGSymbolElement": false, + "SVGTests": false, + "SVGTextContentElement": false, + "SVGTextElement": false, + "SVGTextPathElement": false, + "SVGTextPositioningElement": false, + "SVGTitleElement": false, + "SVGTransform": false, + "SVGTransformable": false, + "SVGTransformList": false, + "SVGTRefElement": false, + "SVGTSpanElement": false, + "SVGUnitTypes": false, + "SVGURIReference": false, + "SVGUseElement": false, + "SVGViewElement": false, + "SVGViewSpec": false, + "SVGVKernElement": false, + "SVGZoomAndPan": false, + "SVGZoomEvent": false, + "Text": false, + "TextDecoder": false, + "TextEncoder": false, + "TextEvent": false, + "TextMetrics": false, + "TextTrack": false, + "TextTrackCue": false, + "TextTrackCueList": false, + "TextTrackList": false, + "TimeEvent": false, + "TimeRanges": false, + "toolbar": false, + "top": false, + "Touch": false, + "TouchEvent": false, + "TouchList": false, + "TrackEvent": false, + "TransitionEvent": false, + "TreeWalker": false, + "UIEvent": false, + "URL": false, + "URLSearchParams": false, + "ValidityState": false, + "VTTCue": false, + "WaveShaperNode": false, + "WebGLActiveInfo": false, + "WebGLBuffer": false, + "WebGLContextEvent": false, + "WebGLFramebuffer": false, + "WebGLProgram": false, + "WebGLRenderbuffer": false, + "WebGLRenderingContext": false, + "WebGLShader": false, + "WebGLShaderPrecisionFormat": false, + "WebGLTexture": false, + "WebGLUniformLocation": false, + "WebSocket": false, + "WheelEvent": false, + "window": false, + "Window": false, + "Worker": false, + "XDomainRequest": false, + "XMLDocument": false, + "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestProgressEvent": false, + "XMLHttpRequestUpload": false, + "XMLSerializer": false, + "XPathEvaluator": false, + "XPathException": false, + "XPathExpression": false, + "XPathNamespace": false, + "XPathNSResolver": false, + "XPathResult": false, + "XSLTProcessor": false + }, + "worker": { + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "clearInterval": false, + "clearTimeout": false, + "close": true, + "console": false, + "fetch": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, + "importScripts": true, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onlanguagechange": true, + "onmessage": true, + "onoffline": true, + "ononline": true, + "onrejectionhandled": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "Request": false, + "Response": false, + "self": true, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "Worker": false, + "XMLHttpRequest": false + }, + "node": { + "__dirname": false, + "__filename": false, + "arguments": false, + "Buffer": false, + "clearImmediate": false, + "clearInterval": false, + "clearTimeout": false, + "console": false, + "exports": true, + "GLOBAL": false, + "global": false, + "Intl": false, + "module": false, + "process": false, + "require": false, + "root": false, + "setImmediate": false, + "setInterval": false, + "setTimeout": false + }, + "commonjs": { + "exports": true, + "module": false, + "require": false, + "global": false + }, + "amd": { + "define": false, + "require": false + }, + "mocha": { + "after": false, + "afterEach": false, + "before": false, + "beforeEach": false, + "context": false, + "describe": false, + "it": false, + "mocha": false, + "run": false, + "setup": false, + "specify": false, + "suite": false, + "suiteSetup": false, + "suiteTeardown": false, + "teardown": false, + "test": false, + "xcontext": false, + "xdescribe": false, + "xit": false, + "xspecify": false + }, + "jasmine": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "describe": false, + "expect": false, + "fail": false, + "fdescribe": false, + "fit": false, + "it": false, + "jasmine": false, + "pending": false, + "runs": false, + "spyOn": false, + "waits": false, + "waitsFor": false, + "xdescribe": false, + "xit": false + }, + "jest": { + "afterAll": false, + "afterEach": false, + "beforeAll": false, + "beforeEach": false, + "check": false, + "describe": false, + "expect": false, + "gen": false, + "it": false, + "fdescribe": false, + "fit": false, + "jest": false, + "pit": false, + "require": false, + "test": false, + "xdescribe": false, + "xit": false, + "xtest": false + }, + "qunit": { + "asyncTest": false, + "deepEqual": false, + "equal": false, + "expect": false, + "module": false, + "notDeepEqual": false, + "notEqual": false, + "notOk": false, + "notPropEqual": false, + "notStrictEqual": false, + "ok": false, + "propEqual": false, + "QUnit": false, + "raises": false, + "start": false, + "stop": false, + "strictEqual": false, + "test": false, + "throws": false + }, + "phantomjs": { + "console": true, + "exports": true, + "phantom": true, + "require": true, + "WebPage": true + }, + "couch": { + "emit": false, + "exports": false, + "getRow": false, + "log": false, + "module": false, + "provides": false, + "require": false, + "respond": false, + "send": false, + "start": false, + "sum": false + }, + "rhino": { + "defineClass": false, + "deserialize": false, + "gc": false, + "help": false, + "importClass": false, + "importPackage": false, + "java": false, + "load": false, + "loadClass": false, + "Packages": false, + "print": false, + "quit": false, + "readFile": false, + "readUrl": false, + "runCommand": false, + "seal": false, + "serialize": false, + "spawn": false, + "sync": false, + "toint32": false, + "version": false + }, + "nashorn": { + "__DIR__": false, + "__FILE__": false, + "__LINE__": false, + "com": false, + "edu": false, + "exit": false, + "Java": false, + "java": false, + "javafx": false, + "JavaImporter": false, + "javax": false, + "JSAdapter": false, + "load": false, + "loadWithNewGlobal": false, + "org": false, + "Packages": false, + "print": false, + "quit": false + }, + "wsh": { + "ActiveXObject": true, + "Enumerator": true, + "GetObject": true, + "ScriptEngine": true, + "ScriptEngineBuildVersion": true, + "ScriptEngineMajorVersion": true, + "ScriptEngineMinorVersion": true, + "VBArray": true, + "WScript": true, + "WSH": true, + "XDomainRequest": true + }, + "jquery": { + "$": false, + "jQuery": false + }, + "yui": { + "Y": false, + "YUI": false, + "YUI_config": false + }, + "shelljs": { + "cat": false, + "cd": false, + "chmod": false, + "config": false, + "cp": false, + "dirs": false, + "echo": false, + "env": false, + "error": false, + "exec": false, + "exit": false, + "find": false, + "grep": false, + "ls": false, + "ln": false, + "mkdir": false, + "mv": false, + "popd": false, + "pushd": false, + "pwd": false, + "rm": false, + "sed": false, + "set": false, + "target": false, + "tempdir": false, + "test": false, + "touch": false, + "which": false + }, + "prototypejs": { + "$": false, + "$$": false, + "$A": false, + "$break": false, + "$continue": false, + "$F": false, + "$H": false, + "$R": false, + "$w": false, + "Abstract": false, + "Ajax": false, + "Autocompleter": false, + "Builder": false, + "Class": false, + "Control": false, + "Draggable": false, + "Draggables": false, + "Droppables": false, + "Effect": false, + "Element": false, + "Enumerable": false, + "Event": false, + "Field": false, + "Form": false, + "Hash": false, + "Insertion": false, + "ObjectRange": false, + "PeriodicalExecuter": false, + "Position": false, + "Prototype": false, + "Scriptaculous": false, + "Selector": false, + "Sortable": false, + "SortableObserver": false, + "Sound": false, + "Template": false, + "Toggle": false, + "Try": false + }, + "meteor": { + "$": false, + "_": false, + "Accounts": false, + "AccountsClient": false, + "AccountsServer": false, + "AccountsCommon": false, + "App": false, + "Assets": false, + "Blaze": false, + "check": false, + "Cordova": false, + "DDP": false, + "DDPServer": false, + "DDPRateLimiter": false, + "Deps": false, + "EJSON": false, + "Email": false, + "HTTP": false, + "Log": false, + "Match": false, + "Meteor": false, + "Mongo": false, + "MongoInternals": false, + "Npm": false, + "Package": false, + "Plugin": false, + "process": false, + "Random": false, + "ReactiveDict": false, + "ReactiveVar": false, + "Router": false, + "ServiceConfiguration": false, + "Session": false, + "share": false, + "Spacebars": false, + "Template": false, + "Tinytest": false, + "Tracker": false, + "UI": false, + "Utils": false, + "WebApp": false, + "WebAppInternals": false + }, + "mongo": { + "_isWindows": false, + "_rand": false, + "BulkWriteResult": false, + "cat": false, + "cd": false, + "connect": false, + "db": false, + "getHostName": false, + "getMemInfo": false, + "hostname": false, + "ISODate": false, + "listFiles": false, + "load": false, + "ls": false, + "md5sumFile": false, + "mkdir": false, + "Mongo": false, + "NumberInt": false, + "NumberLong": false, + "ObjectId": false, + "PlanCache": false, + "print": false, + "printjson": false, + "pwd": false, + "quit": false, + "removeFile": false, + "rs": false, + "sh": false, + "UUID": false, + "version": false, + "WriteResult": false + }, + "applescript": { + "$": false, + "Application": false, + "Automation": false, + "console": false, + "delay": false, + "Library": false, + "ObjC": false, + "ObjectSpecifier": false, + "Path": false, + "Progress": false, + "Ref": false + }, + "serviceworker": { + "caches": false, + "Cache": false, + "CacheStorage": false, + "Client": false, + "clients": false, + "Clients": false, + "ExtendableEvent": false, + "ExtendableMessageEvent": false, + "FetchEvent": false, + "importScripts": false, + "registration": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerGlobalScope": false, + "ServiceWorkerMessageEvent": false, + "ServiceWorkerRegistration": false, + "skipWaiting": false, + "WindowClient": false + }, + "atomtest": { + "advanceClock": false, + "fakeClearInterval": false, + "fakeClearTimeout": false, + "fakeSetInterval": false, + "fakeSetTimeout": false, + "resetTimeouts": false, + "waitsForPromise": false + }, + "embertest": { + "andThen": false, + "click": false, + "currentPath": false, + "currentRouteName": false, + "currentURL": false, + "fillIn": false, + "find": false, + "findWithAssert": false, + "keyEvent": false, + "pauseTest": false, + "resumeTest": false, + "triggerEvent": false, + "visit": false + }, + "protractor": { + "$": false, + "$$": false, + "browser": false, + "By": false, + "by": false, + "DartObject": false, + "element": false, + "protractor": false + }, + "shared-node-browser": { + "clearInterval": false, + "clearTimeout": false, + "console": false, + "setInterval": false, + "setTimeout": false + }, + "webextensions": { + "browser": false, + "chrome": false, + "opr": false + }, + "greasemonkey": { + "GM_addStyle": false, + "GM_deleteValue": false, + "GM_getResourceText": false, + "GM_getResourceURL": false, + "GM_getValue": false, + "GM_info": false, + "GM_listValues": false, + "GM_log": false, + "GM_openInTab": false, + "GM_registerMenuCommand": false, + "GM_setClipboard": false, + "GM_setValue": false, + "GM_xmlhttpRequest": false, + "unsafeWindow": false + } +} diff --git a/node_modules/globals/index.js b/node_modules/globals/index.js new file mode 100755 index 00000000..a02ef248 --- /dev/null +++ b/node_modules/globals/index.js @@ -0,0 +1 @@ +module.exports = require('./globals.json'); diff --git a/node_modules/globals/license b/node_modules/globals/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/globals/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/globals/package.json b/node_modules/globals/package.json new file mode 100755 index 00000000..ee0d4280 --- /dev/null +++ b/node_modules/globals/package.json @@ -0,0 +1,115 @@ +{ + "_args": [ + [ + { + "raw": "globals@^9.0.0", + "scope": null, + "escapedName": "globals", + "name": "globals", + "rawSpec": "^9.0.0", + "spec": ">=9.0.0 <10.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-traverse" + ] + ], + "_from": "globals@>=9.0.0 <10.0.0", + "_id": "globals@9.17.0", + "_inCache": true, + "_location": "/globals", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/globals-9.17.0.tgz_1490427430895_0.24591433047316968" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "globals@^9.0.0", + "scope": null, + "escapedName": "globals", + "name": "globals", + "rawSpec": "^9.0.0", + "spec": ">=9.0.0 <10.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-traverse" + ], + "_resolved": "https://registry.npmjs.org/globals/-/globals-9.17.0.tgz", + "_shasum": "0c0ca696d9b9bb694d2e5470bd37777caad50286", + "_shrinkwrap": null, + "_spec": "globals@^9.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-traverse", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/globals/issues" + }, + "dependencies": {}, + "description": "Global identifiers from different JavaScript environments", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "0c0ca696d9b9bb694d2e5470bd37777caad50286", + "tarball": "https://registry.npmjs.org/globals/-/globals-9.17.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "globals.json" + ], + "gitHead": "49b918ba1e72d831247a3f92cd8c59acc763a6bf", + "homepage": "https://github.com/sindresorhus/globals#readme", + "keywords": [ + "globals", + "global", + "identifiers", + "variables", + "vars", + "jshint", + "eslint", + "environments" + ], + "license": "MIT", + "maintainers": [ + { + "name": "byk", + "email": "ben@byk.im" + }, + { + "name": "lo1tuma", + "email": "schreck.mathias@gmail.com" + }, + { + "name": "nzakas", + "email": "nicholas@nczconsulting.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "globals", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/globals.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "9.17.0" +} diff --git a/node_modules/globals/readme.md b/node_modules/globals/readme.md new file mode 100755 index 00000000..5314bbb9 --- /dev/null +++ b/node_modules/globals/readme.md @@ -0,0 +1,41 @@ +# globals [![Build Status](https://travis-ci.org/sindresorhus/globals.svg?branch=master)](https://travis-ci.org/sindresorhus/globals) + +> Global identifiers from different JavaScript environments + +Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged. + +It's just a [JSON file](globals.json), so use it in whatever environment you like. + +**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + + +## Install + +``` +$ npm install --save globals +``` + + +## Usage + +```js +var globals = require('globals'); + +console.log(globals.browser); +/* +{ + addEventListener: false, + applicationCache: false, + ArrayBuffer: false, + atob: false, + ... +} +*/ +``` + +Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE new file mode 100755 index 00000000..9d2c8036 --- /dev/null +++ b/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md new file mode 100755 index 00000000..5273a50a --- /dev/null +++ b/node_modules/graceful-fs/README.md @@ -0,0 +1,133 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/node_modules/graceful-fs/fs.js b/node_modules/graceful-fs/fs.js new file mode 100755 index 00000000..8ad4a383 --- /dev/null +++ b/node_modules/graceful-fs/fs.js @@ -0,0 +1,21 @@ +'use strict' + +var fs = require('fs') + +module.exports = clone(fs) + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js new file mode 100755 index 00000000..33b30d2e --- /dev/null +++ b/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,262 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var queue = [] + +var util = require('util') + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(queue) + require('assert').equal(queue.length, 0) + }) +} + +module.exports = patch(require('./fs.js')) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { + module.exports = patch(fs) +} + +// Always patch fs.close/closeSync, because we want to +// retry() whenever a close happens *anywhere* in the program. +// This is essential when multiple graceful-fs instances are +// in play at the same time. +module.exports.close = +fs.close = (function (fs$close) { return function (fd, cb) { + return fs$close.call(fs, fd, function (err) { + if (!err) + retry() + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) +}})(fs.close) + +module.exports.closeSync = +fs.closeSync = (function (fs$closeSync) { return function (fd) { + // Note that graceful-fs also retries when fs.closeSync() fails. + // Looks like a bug to me, although it's probably a harmless one. + var rval = fs$closeSync.apply(fs, arguments) + retry() + return rval +}})(fs.closeSync) + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + fs.FileReadStream = ReadStream; // Legacy name. + fs.FileWriteStream = WriteStream; // Legacy name. + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) + + return go$readdir(args) + + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + } + } + + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + + var fs$WriteStream = fs.WriteStream + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + + fs.ReadStream = ReadStream + fs.WriteStream = WriteStream + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + queue.push(elem) +} + +function retry () { + var elem = queue.shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js new file mode 100755 index 00000000..d617b50f --- /dev/null +++ b/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json new file mode 100755 index 00000000..55dcf30f --- /dev/null +++ b/node_modules/graceful-fs/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "graceful-fs@^4.1.2", + "scope": null, + "escapedName": "graceful-fs", + "name": "graceful-fs", + "rawSpec": "^4.1.2", + "spec": ">=4.1.2 <5.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/enhanced-resolve" + ] + ], + "_from": "graceful-fs@>=4.1.2 <5.0.0", + "_id": "graceful-fs@4.1.11", + "_inCache": true, + "_location": "/graceful-fs", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/graceful-fs-4.1.11.tgz_1479843029430_0.2122855328489095" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "graceful-fs@^4.1.2", + "scope": null, + "escapedName": "graceful-fs", + "name": "graceful-fs", + "rawSpec": "^4.1.2", + "spec": ">=4.1.2 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/enhanced-resolve", + "/readdirp", + "/watchpack" + ], + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "_shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658", + "_shrinkwrap": null, + "_spec": "graceful-fs@^4.1.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/enhanced-resolve", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "dependencies": {}, + "description": "A drop-in replacement for fs, making various improvements.", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^5.4.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658", + "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" + }, + "engines": { + "node": ">=0.4.0" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js" + ], + "gitHead": "65cf80d1fd3413b823c16c626c1e7c326452bee5", + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "main": "graceful-fs.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "graceful-fs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/node-graceful-fs.git" + }, + "scripts": { + "test": "node test.js | tap -" + }, + "version": "4.1.11" +} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js new file mode 100755 index 00000000..4c6aca78 --- /dev/null +++ b/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,330 @@ +var fs = require('./fs.js') +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + }})(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) +} + +function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } +} + +function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + +function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + +function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, cb) { + return orig.call(fs, target, function (er, stats) { + if (!stats) return cb.apply(this, arguments) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + if (cb) cb.apply(this, arguments) + }) + } +} + +function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target) { + var stats = orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } +} + +// ENOSYS means that the fs doesn't support the op. Just ignore +// that, because it doesn't matter. +// +// if there's no getuid, or if getuid() is something other +// than 0, and the error is EINVAL or EPERM, then just ignore +// it. +// +// This specific case is a silent failure in cp, install, tar, +// and most other unix tools that manage permissions. +// +// When running as root, or if other types of errors are +// encountered, then it's strict. +function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false +} diff --git a/node_modules/has-ansi/index.js b/node_modules/has-ansi/index.js new file mode 100755 index 00000000..98fae067 --- /dev/null +++ b/node_modules/has-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); +var re = new RegExp(ansiRegex().source); // remove the `g` flag +module.exports = re.test.bind(re); diff --git a/node_modules/has-ansi/license b/node_modules/has-ansi/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/has-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-ansi/package.json b/node_modules/has-ansi/package.json new file mode 100755 index 00000000..bdb5464f --- /dev/null +++ b/node_modules/has-ansi/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "has-ansi@^2.0.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chalk" + ] + ], + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_id": "has-ansi@2.0.0", + "_inCache": true, + "_location": "/has-ansi", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "has-ansi@^2.0.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_shrinkwrap": null, + "_spec": "has-ansi@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "description": "Check if a string has ANSI escape codes", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "homepage": "https://github.com/sindresorhus/has-ansi", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "has-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "2.0.0" +} diff --git a/node_modules/has-ansi/readme.md b/node_modules/has-ansi/readme.md new file mode 100755 index 00000000..02bc7c23 --- /dev/null +++ b/node_modules/has-ansi/readme.md @@ -0,0 +1,36 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## Related + +- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module +- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/has-flag/index.js b/node_modules/has-flag/index.js new file mode 100755 index 00000000..fdcb342f --- /dev/null +++ b/node_modules/has-flag/index.js @@ -0,0 +1,10 @@ +'use strict'; +module.exports = function (flag, argv) { + argv = argv || process.argv; + + var terminatorPos = argv.indexOf('--'); + var prefix = /^--/.test(flag) ? '' : '--'; + var pos = argv.indexOf(prefix + flag); + + return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true); +}; diff --git a/node_modules/has-flag/license b/node_modules/has-flag/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/has-flag/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-flag/package.json b/node_modules/has-flag/package.json new file mode 100755 index 00000000..a730a3e8 --- /dev/null +++ b/node_modules/has-flag/package.json @@ -0,0 +1,119 @@ +{ + "_args": [ + [ + { + "raw": "has-flag@^1.0.0", + "scope": null, + "escapedName": "has-flag", + "name": "has-flag", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack/node_modules/supports-color" + ] + ], + "_from": "has-flag@>=1.0.0 <2.0.0", + "_id": "has-flag@1.0.0", + "_inCache": true, + "_location": "/has-flag", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "has-flag@^1.0.0", + "scope": null, + "escapedName": "has-flag", + "name": "has-flag", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack-dev-server/supports-color", + "/webpack/supports-color" + ], + "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "_shasum": "9d9e793165ce017a00f00418c43f942a7b1d11fa", + "_shrinkwrap": null, + "_spec": "has-flag@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack/node_modules/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-flag/issues" + }, + "dependencies": {}, + "description": "Check if argv has a specific flag", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "9d9e793165ce017a00f00418c43f942a7b1d11fa", + "tarball": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "621de2782d538f28f99f0bb85b158799cb3ae5cf", + "homepage": "https://github.com/sindresorhus/has-flag#readme", + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "minimist", + "optimist" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "has-flag", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-flag.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/has-flag/readme.md b/node_modules/has-flag/readme.md new file mode 100755 index 00000000..ea5c8179 --- /dev/null +++ b/node_modules/has-flag/readme.md @@ -0,0 +1,64 @@ +# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) + +> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag + +Correctly stops looking after an `--` argument terminator. + + +## Install + +``` +$ npm install --save has-flag +``` + + +## Usage + +```js +// foo.js +var hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` + +``` +$ node foo.js --unicorn --foo=bar -- --rainbow +``` + + +## API + +### hasFlag(flag, [argv]) + +Returns a boolean whether the flag exists. + +#### flag + +Type: `string` + +CLI flag to look for. The `--` prefix is optional. + +#### argv + +Type: `array` +Default: `process.argv` + +CLI arguments. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/home-or-tmp/index.js b/node_modules/home-or-tmp/index.js new file mode 100755 index 00000000..bb67e9bc --- /dev/null +++ b/node_modules/home-or-tmp/index.js @@ -0,0 +1,5 @@ +'use strict'; +var osHomedir = require('os-homedir'); +var osTmpdir = require('os-tmpdir'); + +module.exports = osHomedir() || osTmpdir(); diff --git a/node_modules/home-or-tmp/license b/node_modules/home-or-tmp/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/home-or-tmp/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/home-or-tmp/package.json b/node_modules/home-or-tmp/package.json new file mode 100755 index 00000000..2e1aed81 --- /dev/null +++ b/node_modules/home-or-tmp/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "home-or-tmp@^2.0.0", + "scope": null, + "escapedName": "home-or-tmp", + "name": "home-or-tmp", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-register" + ] + ], + "_from": "home-or-tmp@>=2.0.0 <3.0.0", + "_id": "home-or-tmp@2.0.0", + "_inCache": true, + "_location": "/home-or-tmp", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "home-or-tmp@^2.0.0", + "scope": null, + "escapedName": "home-or-tmp", + "name": "home-or-tmp", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-register" + ], + "_resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "_shasum": "e36c3f2d2cae7d746a857e38d18d5f32a7882db8", + "_shrinkwrap": null, + "_spec": "home-or-tmp@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-register", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/home-or-tmp/issues" + }, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + }, + "description": "Get the user home directory with fallback to the system temp directory", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "e36c3f2d2cae7d746a857e38d18d5f32a7882db8", + "tarball": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "dd1411a0b2531a4e2c592ae733fd45dd0f9c7163", + "homepage": "https://github.com/sindresorhus/home-or-tmp", + "keywords": [ + "user", + "home", + "homedir", + "dir", + "directory", + "folder", + "path", + "tmp", + "temp", + "temporary", + "fallback", + "graceful", + "userprofile" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "home-or-tmp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/home-or-tmp.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "2.0.0" +} diff --git a/node_modules/home-or-tmp/readme.md b/node_modules/home-or-tmp/readme.md new file mode 100755 index 00000000..13ca6976 --- /dev/null +++ b/node_modules/home-or-tmp/readme.md @@ -0,0 +1,32 @@ +# home-or-tmp [![Build Status](https://travis-ci.org/sindresorhus/home-or-tmp.svg?branch=master)](https://travis-ci.org/sindresorhus/home-or-tmp) + +> Get the user home directory with fallback to the system temp directory + +Useful in cases where the home directory either isn't set or doesn't exist. + + +## Install + +``` +$ npm install --save home-or-tmp +``` + + +## Usage + +```js +var homeOrTmp = require('home-or-tmp'); + +console.log(homeOrTmp); +//=> '/Users/sindresorhus' + +// and if there's no home directory: + +console.log(homeOrTmp); +//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T' +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/http-errors/HISTORY.md b/node_modules/http-errors/HISTORY.md new file mode 100755 index 00000000..94b6b29a --- /dev/null +++ b/node_modules/http-errors/HISTORY.md @@ -0,0 +1,118 @@ +2017-02-20 / 1.6.1 +================== + + * deps: setprototypeof@1.0.3 + - Fix shim for old browsers + +2017-02-14 / 1.6.0 +================== + + * Accept custom 4xx and 5xx status codes in factory + * Add deprecation message to `"I'mateapot"` export + * Deprecate passing status code as anything except first argument in factory + * Deprecate using non-error status codes + * Make `message` property enumerable for `HttpError`s + +2016-11-16 / 1.5.1 +================== + + * deps: inherits@2.0.3 + - Fix issue loading in browser + * deps: setprototypeof@1.0.2 + * deps: statuses@'>= 1.3.1 < 2' + +2016-05-18 / 1.5.0 +================== + + * Support new code `421 Misdirected Request` + * Use `setprototypeof` module to replace `__proto__` setting + * deps: statuses@'>= 1.3.0 < 2' + - Add `421 Misdirected Request` + - perf: enable strict mode + * perf: enable strict mode + +2016-01-28 / 1.4.0 +================== + + * Add `HttpError` export, for `err instanceof createError.HttpError` + * deps: inherits@2.0.1 + * deps: statuses@'>= 1.2.1 < 2' + - Fix message for status 451 + - Remove incorrect nginx status code + +2015-02-02 / 1.3.1 +================== + + * Fix regression where status can be overwritten in `createError` `props` + +2015-02-01 / 1.3.0 +================== + + * Construct errors using defined constructors from `createError` + * Fix error names that are not identifiers + - `createError["I'mateapot"]` is now `createError.ImATeapot` + * Set a meaningful `name` property on constructed errors + +2014-12-09 / 1.2.8 +================== + + * Fix stack trace from exported function + * Remove `arguments.callee` usage + +2014-10-14 / 1.2.7 +================== + + * Remove duplicate line + +2014-10-02 / 1.2.6 +================== + + * Fix `expose` to be `true` for `ClientError` constructor + +2014-09-28 / 1.2.5 +================== + + * deps: statuses@1 + +2014-09-21 / 1.2.4 +================== + + * Fix dependency version to work with old `npm`s + +2014-09-21 / 1.2.3 +================== + + * deps: statuses@~1.1.0 + +2014-09-21 / 1.2.2 +================== + + * Fix publish error + +2014-09-21 / 1.2.1 +================== + + * Support Node.js 0.6 + * Use `inherits` instead of `util` + +2014-09-09 / 1.2.0 +================== + + * Fix the way inheriting functions + * Support `expose` being provided in properties argument + +2014-09-08 / 1.1.0 +================== + + * Default status to 500 + * Support provided `error` to extend + +2014-09-08 / 1.0.1 +================== + + * Fix accepting string message + +2014-09-08 / 1.0.0 +================== + + * Initial release diff --git a/node_modules/http-errors/LICENSE b/node_modules/http-errors/LICENSE new file mode 100755 index 00000000..82af4df5 --- /dev/null +++ b/node_modules/http-errors/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/http-errors/README.md b/node_modules/http-errors/README.md new file mode 100755 index 00000000..79663d82 --- /dev/null +++ b/node_modules/http-errors/README.md @@ -0,0 +1,135 @@ +# http-errors + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create HTTP errors for Express, Koa, Connect, etc. with ease. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install http-errors +``` + +## Example + +```js +var createError = require('http-errors') +var express = require('express') +var app = express() + +app.use(function (req, res, next) { + if (!req.user) return next(createError(401, 'Please login to view this page.')) + next() +}) +``` + +## API + +This is the current API, currently extracted from Koa and subject to change. + +All errors inherit from JavaScript `Error` and the exported `createError.HttpError`. + +### Error Properties + +- `expose` - can be used to signal if `message` should be sent to the client, + defaulting to `false` when `status` >= 500 +- `headers` - can be an object of header names to values to be sent to the + client, defaulting to `undefined`. When defined, the key names should all + be lower-cased +- `message` - the traditional error message, which should be kept short and all + single line +- `status` - the status code of the error, mirroring `statusCode` for general + compatibility +- `statusCode` - the status code of the error, defaulting to `500` + +### createError([status], [message], [properties]) + + + +```js +var err = createError(404, 'This video does not exist!') +``` + +- `status: 500` - the status code as a number +- `message` - the message of the error, defaulting to node's text for that status code. +- `properties` - custom properties to attach to the object + +### new createError\[code || name\](\[msg]\)) + + + +```js +var err = new createError.NotFound() +``` + +- `code` - the status code as a number +- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`. + +#### List of all constructors + +|Status Code|Constructor Name | +|-----------|-----------------------------| +|400 |BadRequest | +|401 |Unauthorized | +|402 |PaymentRequired | +|403 |Forbidden | +|404 |NotFound | +|405 |MethodNotAllowed | +|406 |NotAcceptable | +|407 |ProxyAuthenticationRequired | +|408 |RequestTimeout | +|409 |Conflict | +|410 |Gone | +|411 |LengthRequired | +|412 |PreconditionFailed | +|413 |PayloadTooLarge | +|414 |URITooLong | +|415 |UnsupportedMediaType | +|416 |RangeNotSatisfiable | +|417 |ExpectationFailed | +|418 |ImATeapot | +|421 |MisdirectedRequest | +|422 |UnprocessableEntity | +|423 |Locked | +|424 |FailedDependency | +|425 |UnorderedCollection | +|426 |UpgradeRequired | +|428 |PreconditionRequired | +|429 |TooManyRequests | +|431 |RequestHeaderFieldsTooLarge | +|451 |UnavailableForLegalReasons | +|500 |InternalServerError | +|501 |NotImplemented | +|502 |BadGateway | +|503 |ServiceUnavailable | +|504 |GatewayTimeout | +|505 |HTTPVersionNotSupported | +|506 |VariantAlsoNegotiates | +|507 |InsufficientStorage | +|508 |LoopDetected | +|509 |BandwidthLimitExceeded | +|510 |NotExtended | +|511 |NetworkAuthenticationRequired| + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/http-errors.svg +[npm-url]: https://npmjs.org/package/http-errors +[node-version-image]: https://img.shields.io/node/v/http-errors.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg +[travis-url]: https://travis-ci.org/jshttp/http-errors +[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg +[coveralls-url]: https://coveralls.io/r/jshttp/http-errors +[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg +[downloads-url]: https://npmjs.org/package/http-errors diff --git a/node_modules/http-errors/index.js b/node_modules/http-errors/index.js new file mode 100755 index 00000000..9509303e --- /dev/null +++ b/node_modules/http-errors/index.js @@ -0,0 +1,260 @@ +/*! + * http-errors + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var deprecate = require('depd')('http-errors') +var setPrototypeOf = require('setprototypeof') +var statuses = require('statuses') +var inherits = require('inherits') + +/** + * Module exports. + * @public + */ + +module.exports = createError +module.exports.HttpError = createHttpErrorConstructor() + +// Populate exports for all constructors +populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError) + +/** + * Get the code class of a status code. + * @private + */ + +function codeClass (status) { + return Number(String(status).charAt(0) + '00') +} + +/** + * Create a new HTTP Error. + * + * @returns {Error} + * @public + */ + +function createError () { + // so much arity going on ~_~ + var err + var msg + var status = 500 + var props = {} + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i] + if (arg instanceof Error) { + err = arg + status = err.status || err.statusCode || status + continue + } + switch (typeof arg) { + case 'string': + msg = arg + break + case 'number': + status = arg + if (i !== 0) { + deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)') + } + break + case 'object': + props = arg + break + } + } + + if (typeof status === 'number' && (status < 400 || status >= 600)) { + deprecate('non-error status code; use only 4xx or 5xx status codes') + } + + if (typeof status !== 'number' || + (!statuses[status] && (status < 400 || status >= 600))) { + status = 500 + } + + // constructor + var HttpError = createError[status] || createError[codeClass(status)] + + if (!err) { + // create error + err = HttpError + ? new HttpError(msg) + : new Error(msg || statuses[status]) + Error.captureStackTrace(err, createError) + } + + if (!HttpError || !(err instanceof HttpError) || err.status !== status) { + // add properties to generic error + err.expose = status < 500 + err.status = err.statusCode = status + } + + for (var key in props) { + if (key !== 'status' && key !== 'statusCode') { + err[key] = props[key] + } + } + + return err +} + +/** + * Create HTTP error abstract base class. + * @private + */ + +function createHttpErrorConstructor () { + function HttpError () { + throw new TypeError('cannot construct abstract class') + } + + inherits(HttpError, Error) + + return HttpError +} + +/** + * Create a constructor for a client error. + * @private + */ + +function createClientErrorConstructor (HttpError, name, code) { + var className = name.match(/Error$/) ? name : name + 'Error' + + function ClientError (message) { + // create the error object + var msg = message != null ? message : statuses[code] + var err = new Error(msg) + + // capture a stack trace to the construction point + Error.captureStackTrace(err, ClientError) + + // adjust the [[Prototype]] + setPrototypeOf(err, ClientError.prototype) + + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) + + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) + + return err + } + + inherits(ClientError, HttpError) + + ClientError.prototype.status = code + ClientError.prototype.statusCode = code + ClientError.prototype.expose = true + + return ClientError +} + +/** + * Create a constructor for a server error. + * @private + */ + +function createServerErrorConstructor (HttpError, name, code) { + var className = name.match(/Error$/) ? name : name + 'Error' + + function ServerError (message) { + // create the error object + var msg = message != null ? message : statuses[code] + var err = new Error(msg) + + // capture a stack trace to the construction point + Error.captureStackTrace(err, ServerError) + + // adjust the [[Prototype]] + setPrototypeOf(err, ServerError.prototype) + + // redefine the error message + Object.defineProperty(err, 'message', { + enumerable: true, + configurable: true, + value: msg, + writable: true + }) + + // redefine the error name + Object.defineProperty(err, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) + + return err + } + + inherits(ServerError, HttpError) + + ServerError.prototype.status = code + ServerError.prototype.statusCode = code + ServerError.prototype.expose = false + + return ServerError +} + +/** + * Populate the exports object with constructors for every error class. + * @private + */ + +function populateConstructorExports (exports, codes, HttpError) { + codes.forEach(function forEachCode (code) { + var CodeError + var name = toIdentifier(statuses[code]) + + switch (codeClass(code)) { + case 400: + CodeError = createClientErrorConstructor(HttpError, name, code) + break + case 500: + CodeError = createServerErrorConstructor(HttpError, name, code) + break + } + + if (CodeError) { + // export the constructor + exports[code] = CodeError + exports[name] = CodeError + } + }) + + // backwards-compatibility + exports["I'mateapot"] = deprecate.function(exports.ImATeapot, + '"I\'mateapot"; use "ImATeapot" instead') +} + +/** + * Convert a string of words to a JavaScript identifier. + * @private + */ + +function toIdentifier (str) { + return str.split(' ').map(function (token) { + return token.slice(0, 1).toUpperCase() + token.slice(1) + }).join('').replace(/[^ _0-9a-z]/gi, '') +} diff --git a/node_modules/http-errors/package.json b/node_modules/http-errors/package.json new file mode 100755 index 00000000..87f246d5 --- /dev/null +++ b/node_modules/http-errors/package.json @@ -0,0 +1,131 @@ +{ + "_args": [ + [ + { + "raw": "http-errors@~1.6.1", + "scope": null, + "escapedName": "http-errors", + "name": "http-errors", + "rawSpec": "~1.6.1", + "spec": ">=1.6.1 <1.7.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/send" + ] + ], + "_from": "http-errors@>=1.6.1 <1.7.0", + "_id": "http-errors@1.6.1", + "_inCache": true, + "_location": "/http-errors", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/http-errors-1.6.1.tgz_1487647400122_0.1305304525885731" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "http-errors@~1.6.1", + "scope": null, + "escapedName": "http-errors", + "name": "http-errors", + "rawSpec": "~1.6.1", + "spec": ">=1.6.1 <1.7.0", + "type": "range" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz", + "_shasum": "5f8b8ed98aca545656bf572997387f904a722257", + "_shrinkwrap": null, + "_spec": "http-errors@~1.6.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/send", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/jshttp/http-errors/issues" + }, + "contributors": [ + { + "name": "Alan Plum", + "email": "me@pluma.io" + }, + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": { + "depd": "1.1.0", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": ">= 1.3.1 < 2" + }, + "description": "Create HTTP error objects", + "devDependencies": { + "eslint": "3.16.0", + "eslint-config-standard": "6.2.1", + "eslint-plugin-markdown": "1.0.0-beta.3", + "eslint-plugin-promise": "3.4.2", + "eslint-plugin-standard": "2.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "5f8b8ed98aca545656bf572997387f904a722257", + "tarball": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "index.js", + "HISTORY.md", + "LICENSE", + "README.md" + ], + "gitHead": "d8d95dbc84c913a594b7fca07096697412af7edd", + "homepage": "https://github.com/jshttp/http-errors#readme", + "keywords": [ + "http", + "error" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "egeste", + "email": "npm@egeste.net" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + } + ], + "name": "http-errors", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/http-errors.git" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "1.6.1" +} diff --git a/node_modules/http-proxy-middleware/CHANGELOG.md b/node_modules/http-proxy-middleware/CHANGELOG.md new file mode 100755 index 00000000..d578d65f --- /dev/null +++ b/node_modules/http-proxy-middleware/CHANGELOG.md @@ -0,0 +1,97 @@ +# Changelog + +## [v0.17.4](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.4) +- fix(ntlm authentication): fixed bug preventing proxying with ntlm authentication. ([#132](https://github.com/chimurai/http-proxy-middleware/pull/149)) (Thanks: [EladBezalel](https://github.com/EladBezalel), [oshri551](https://github.com/oshri551)) + + +## [v0.17.3](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.3) +- fix(onError): improve default proxy error handling. http status codes (504, 502 and 500). ([#132](https://github.com/chimurai/http-proxy-middleware/pull/132)) ([graingert](https://github.com/graingert)) + +## [v0.17.2](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.2) +- feat(logging): improve error message & add link to Node errors page. ([#106](https://github.com/chimurai/http-proxy-middleware/pull/106)) ([cloudmu](https://github.com/cloudmu)) +- feat(pathRewrite): path can be empty string. ([#110](https://github.com/chimurai/http-proxy-middleware/pull/110)) ([sunnylqm](https://github.com/sunnylqm)) +- bug(websocket): memory leak when option 'ws:true' is used. ([#114](https://github.com/chimurai/http-proxy-middleware/pull/114)) ([julbra](https://github.com/julbra)) +- chore(package.json): reduce package size. ([#109](https://github.com/chimurai/http-proxy-middleware/pull/109)) + +## [v0.17.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.1) +- fix(Express sub Router): 404 on non-proxy routes ([#94](https://github.com/chimurai/http-proxy-middleware/issues/94)) + +## [v0.17.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.0) +- fix(context matching): Use [RFC 3986 path](https://tools.ietf.org/html/rfc3986#section-3.3) in context matching. (excludes query parameters) + +## [v0.16.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.16.0) +- deprecated(proxyTable): renamed `proxyTable` to `router`. +- feat(router): support for custom `router` function. + +## [v0.15.2](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.15.2) +- fix(websocket): fixes websocket upgrade. + +## [v0.15.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.15.1) +- feat(pathRewrite): expose `req` object to pathRewrite function. +- fix(websocket): fixes websocket upgrade when both config.ws and external .upgrade() are used. + +## [v0.15.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.15.0) +- feat(pathRewrite): support for custom pathRewrite function. + +## [v0.14.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.14.0) +- feat(proxy): support proxy creation without context. +- fix(connect mounting): use connect's `path` configuration to mount proxy. + +## [v0.13.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.13.0) +- feat(context): custom context matcher; when simple `path` matching is not sufficient. + +## [v0.12.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.12.0) +- add option `onProxyReqWs` (subscribe to http-proxy `proxyReqWs` event) +- add option `onOpen` (subscribe to http-proxy `open` event) +- add option `onClose` (subscribe to http-proxy `close` event) + +## [v0.11.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.11.0) +- improved logging + +## [v0.10.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.10.0) +- feat(proxyTable) - added proxyTable support for WebSockets. +- fixed(proxyTable) - ensure original path (not rewritten path) is being used when `proxyTable` is used in conjunction with `pathRewrite`. + +## [v0.9.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.9.1) +- fix server crash when socket error not handled correctly. + +## [v0.9.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.9.0) +- support subscribing to http-proxy `proxyReq` event ([trbngr](https://github.com/trbngr)) +- add `logLevel` and `logProvider` support + +## [v0.8.2](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.8.2) +- fix proxyError handler ([mTazelaar](https://github.com/mTazelaar)) + +## [v0.8.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.8.1) +- fix pathRewrite when `agent` is configured + +## [v0.8.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.8.0) +- support external websocket upgrade +- fix websocket shorthand + +## [v0.7.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.7.0) +- support shorthand syntax +- fix express/connect mounting + +## [v0.6.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.6.0) +- support proxyTable + +## [v0.5.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.5.0) +- support subscribing to http-proxy `error` event +- support subscribing to http-proxy `proxyRes` event + +## [v0.4.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.4.0) +- support websocket + +## [v0.3.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.3.0) +- support wildcard / glob + +## [v0.2.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.2.0) +- support multiple paths + +## [v0.1.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.1.0) +- support path rewrite +- deprecate proxyHost option + +## [v0.0.5](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.0.5) +- initial release diff --git a/node_modules/http-proxy-middleware/LICENSE b/node_modules/http-proxy-middleware/LICENSE new file mode 100755 index 00000000..44a4027d --- /dev/null +++ b/node_modules/http-proxy-middleware/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Steven Chim + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/http-proxy-middleware/README.md b/node_modules/http-proxy-middleware/README.md new file mode 100755 index 00000000..1cd68443 --- /dev/null +++ b/node_modules/http-proxy-middleware/README.md @@ -0,0 +1,447 @@ +# http-proxy-middleware + +[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware) +[![Coveralls](https://img.shields.io/coveralls/chimurai/http-proxy-middleware.svg?style=flat-square)](https://coveralls.io/r/chimurai/http-proxy-middleware) +[![dependency Status](https://img.shields.io/david/chimurai/http-proxy-middleware.svg?style=flat-square)](https://david-dm.org/chimurai/http-proxy-middleware#info=dependencies) +[![dependency Status](https://snyk.io/test/npm/http-proxy-middleware/badge.svg)](https://snyk.io/test/npm/http-proxy-middleware) + +Node.js proxying made simple. Configure proxy middleware with ease for [connect](https://github.com/senchalabs/connect), [express](https://github.com/strongloop/express), [browser-sync](https://github.com/BrowserSync/browser-sync) and [many more](#compatible-servers). + +Powered by the popular Nodejitsu [`http-proxy`](https://github.com/nodejitsu/node-http-proxy). [![GitHub stars](https://img.shields.io/github/stars/nodejitsu/node-http-proxy.svg?style=social&label=Star)](https://github.com/nodejitsu/node-http-proxy) + +## TL;DR + +Proxy `/api` requests to `http://www.example.org` + +```javascript +var express = require('express'); +var proxy = require('http-proxy-middleware'); + +var app = express(); + +app.use('/api', proxy({target: 'http://www.example.org', changeOrigin: true})); +app.listen(3000); + +// http://localhost:3000/api/foo/bar -> http://www.example.org/api/foo/bar +``` + +_All_ `http-proxy` [options](https://github.com/nodejitsu/node-http-proxy#options) can be used, along with some extra `http-proxy-middleware` [options](#options). + +:bulb: **Tip:** Set the option `changeOrigin` to `true` for [name-based virtual hosted sites](http://en.wikipedia.org/wiki/Virtual_hosting#Name-based). + +## Table of Contents + + + +- [Install](#install) +- [Core concept](#core-concept) +- [Example](#example) +- [Context matching](#context-matching) +- [Options](#options) + - [http-proxy-middleware options](#http-proxy-middleware-options) + - [http-proxy events](#http-proxy-events) + - [http-proxy options](#http-proxy-options) +- [Shorthand](#shorthand) + - [app.use\(path, proxy\)](#appusepath-proxy) +- [WebSocket](#websocket) + - [External WebSocket upgrade](#external-websocket-upgrade) +- [Working examples](#working-examples) +- [Recipes](#recipes) +- [Compatible servers](#compatible-servers) +- [Tests](#tests) +- [Changelog](#changelog) +- [License](#license) + + + + +## Install + +```javascript +$ npm install --save-dev http-proxy-middleware +``` + +## Core concept + +Proxy middleware configuration. + +#### proxy([context,] config) + +```javascript +var proxy = require('http-proxy-middleware'); + +var apiProxy = proxy('/api', {target: 'http://www.example.org'}); +// \____/ \_____________________________/ +// | | +// context options + +// 'apiProxy' is now ready to be used as middleware in a server. +``` +* **context**: Determine which requests should be proxied to the target host. + (more on [context matching](#context-matching)) +* **options.target**: target host to proxy to. _(protocol + host)_ + +(full list of [`http-proxy-middleware` configuration options](#options)) + +#### proxy(uri [, config]) + +``` javascript +// shorthand syntax for the example above: +var apiProxy = proxy('http://www.example.org/api'); + +``` +More about the [shorthand configuration](#shorthand). + +## Example + +An example with `express` server. + +```javascript +// include dependencies +var express = require('express'); +var proxy = require('http-proxy-middleware'); + +// proxy middleware options +var options = { + target: 'http://www.example.org', // target host + changeOrigin: true, // needed for virtual hosted sites + ws: true, // proxy websockets + pathRewrite: { + '^/api/old-path' : '/api/new-path', // rewrite path + '^/api/remove/path' : '/path' // remove base path + }, + router: { + // when request.headers.host == 'dev.localhost:3000', + // override target 'http://www.example.org' to 'http://localhost:8000' + 'dev.localhost:3000' : 'http://localhost:8000' + } + }; + +// create the proxy (without context) +var exampleProxy = proxy(options); + +// mount `exampleProxy` in web server +var app = express(); + app.use('/api', exampleProxy); + app.listen(3000); +``` + +## Context matching + +Providing an alternative way to decide which requests should be proxied; In case you are not able to use the server's [`path` parameter](http://expressjs.com/en/4x/api.html#app.use) to mount the proxy or when you need more flexibility. + +The [RFC 3986 `path`](https://tools.ietf.org/html/rfc3986#section-3.3) is be used for context matching. + +``` + foo://example.com:8042/over/there?name=ferret#nose + \_/ \______________/\_________/ \_________/ \__/ + | | | | | + scheme authority path query fragment +``` + +* **path matching** + - `proxy({...})` - matches any path, all requests will be proxied. + - `proxy('/', {...})` - matches any path, all requests will be proxied. + - `proxy('/api', {...})` - matches paths starting with `/api` + +* **multiple path matching** + - `proxy(['/api', '/ajax', '/someotherpath'], {...})` + +* **wildcard path matching** + + For fine-grained control you can use wildcard matching. Glob pattern matching is done by _micromatch_. Visit [micromatch](https://www.npmjs.com/package/micromatch) or [glob](https://www.npmjs.com/package/glob) for more globbing examples. + - `proxy('**', {...})` matches any path, all requests will be proxied. + - `proxy('**/*.html', {...})` matches any path which ends with `.html` + - `proxy('/*.html', {...})` matches paths directly under path-absolute + - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api` + - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns + - `proxy(['/api/**', '!**/bad.json'], {...})` exclusion + +* **custom matching** + + For full control you can provide a custom function to determine which requests should be proxied or not. + ```javascript + /** + * @return {Boolean} + */ + var filter = function (pathname, req) { + return (pathname.match('^/api') && req.method === 'GET'); + }; + + var apiProxy = proxy(filter, {target: 'http://www.example.org'}) + ``` + +## Options + +### http-proxy-middleware options + +* **option.pathRewrite**: object/function, rewrite target's url path. Object-keys will be used as _RegExp_ to match paths. + ```javascript + // rewrite path + pathRewrite: {'^/old/api' : '/new/api'} + + // remove path + pathRewrite: {'^/remove/api' : ''} + + // add base path + pathRewrite: {'^/' : '/basepath/'} + + // custom rewriting + pathRewrite: function (path, req) { return path.replace('/api', '/base/api') } + ``` + +* **option.router**: object/function, re-target `option.target` for specific requests. + ```javascript + // Use `host` and/or `path` to match requests. First match will be used. + // The order of the configuration matters. + router: { + 'integration.localhost:3000' : 'http://localhost:8001', // host only + 'staging.localhost:3000' : 'http://localhost:8002', // host only + 'localhost:3000/api' : 'http://localhost:8003', // host + path + '/rest' : 'http://localhost:8004' // path only + } + + // Custom router function + router: function(req) { + return 'http://localhost:8004'; + } + ``` + +* **option.logLevel**: string, ['debug', 'info', 'warn', 'error', 'silent']. Default: `'info'` + +* **option.logProvider**: function, modify or replace log provider. Default: `console`. + ```javascript + // simple replace + function logProvider(provider) { + // replace the default console log provider. + return require('winston'); + } + ``` + + ```javascript + // verbose replacement + function logProvider(provider) { + var logger = new (require('winston').Logger)(); + + var myCustomProvider = { + log: logger.log, + debug: logger.debug, + info: logger.info, + warn: logger.warn, + error: logger.error + } + return myCustomProvider; + } + ``` +* (DEPRECATED) **option.proxyHost**: Use `option.changeOrigin = true` instead. +* (DEPRECATED) **option.proxyTable**: Use `option.router` instead. + + +### http-proxy events + +Subscribe to [http-proxy events](https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events): + +* **option.onError**: function, subscribe to http-proxy's `error` event for custom error handling. + ```javascript + function onError(err, req, res) { + res.writeHead(500, { + 'Content-Type': 'text/plain' + }); + res.end('Something went wrong. And we are reporting a custom error message.'); + } + ``` + +* **option.onProxyRes**: function, subscribe to http-proxy's `proxyRes` event. + ```javascript + function onProxyRes(proxyRes, req, res) { + proxyRes.headers['x-added'] = 'foobar'; // add new header to response + delete proxyRes.headers['x-removed']; // remove header from response + } + ``` + +* **option.onProxyReq**: function, subscribe to http-proxy's `proxyReq` event. + ```javascript + function onProxyReq(proxyReq, req, res) { + // add custom header to request + proxyReq.setHeader('x-added', 'foobar'); + // or log the req + } + ``` + +* **option.onProxyReqWs**: function, subscribe to http-proxy's `proxyReqWs` event. + ```javascript + function onProxyReqWs(proxyReq, req, socket, options, head) { + // add custom header + proxyReq.setHeader('X-Special-Proxy-Header', 'foobar'); + } + ``` + +* **option.onOpen**: function, subscribe to http-proxy's `open` event. + ```javascript + function onOpen(proxySocket) { + // listen for messages coming FROM the target here + proxySocket.on('data', hybiParseAndLogMessage); + } + ``` + +* **option.onClose**: function, subscribe to http-proxy's `close` event. + ```javascript + function onClose(res, socket, head) { + // view disconnected websocket connections + console.log('Client disconnected'); + } + ``` + +### http-proxy options + +The following options are provided by the underlying [http-proxy](https://github.com/nodejitsu/node-http-proxy#options) library. + +* **option.target**: url string to be parsed with the url module +* **option.forward**: url string to be parsed with the url module +* **option.agent**: object to be passed to http(s).request (see Node's [https agent](http://nodejs.org/api/https.html#https_class_https_agent) and [http agent](http://nodejs.org/api/http.html#http_class_http_agent) objects) +* **option.ssl**: object to be passed to https.createServer() +* **option.ws**: true/false: if you want to proxy websockets +* **option.xfwd**: true/false, adds x-forward headers +* **option.secure**: true/false, if you want to verify the SSL Certs +* **option.toProxy**: true/false, passes the absolute URL as the `path` (useful for proxying to proxies) +* **option.prependPath**: true/false, Default: true - specify whether you want to prepend the target's path to the proxy path +* **option.ignorePath**: true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request (note: you will have to append / manually if required). +* **option.localAddress** : Local interface string to bind for outgoing connections +* **option.changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL +* **option.auth** : Basic authentication i.e. 'user:password' to compute an Authorization header. +* **option.hostRewrite**: rewrites the location hostname on (301/302/307/308) redirects. +* **option.autoRewrite**: rewrites the location host/port on (301/302/307/308) redirects based on requested host/port. Default: false. +* **option.protocolRewrite**: rewrites the location protocol on (301/302/307/308) redirects to 'http' or 'https'. Default: null. +* **option.cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values: + * `false` (default): disable cookie rewriting + * String: new domain, for example `cookieDomainRewrite: "new.domain"`. To remove the domain, use `cookieDomainRewrite: ""`. + * Object: mapping of domains to new domains, use `"*"` to match all domains. + For example keep one domain unchanged, rewrite one domain and remove other domains: + ``` + cookieDomainRewrite: { + "unchanged.domain": "unchanged.domain", + "old.domain": "new.domain", + "*": "" + } + ``` +* **option.headers**: object, adds [request headers](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields). (Example: `{host:'www.example.org'}`) +* **option.proxyTimeout**: timeout (in millis) when proxy receives no response from target + + + +## Shorthand + +Use the shorthand syntax when verbose configuration is not needed. The `context` and `option.target` will be automatically configured when shorthand is used. Options can still be used if needed. + +```javascript +proxy('http://www.example.org:8000/api'); +// proxy('/api', {target: 'http://www.example.org:8000'}); + + +proxy('http://www.example.org:8000/api/books/*/**.json'); +// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'}); + + +proxy('http://www.example.org:8000/api', {changeOrigin:true}); +// proxy('/api', {target: 'http://www.example.org:8000', changeOrigin: true}); +``` + +### app.use(path, proxy) + +If you want to use the server's `app.use` `path` parameter to match requests; +Create and mount the proxy without the http-proxy-middleware `context` parameter: +```javascript +app.use('/api', proxy({target:'http://www.example.org', changeOrigin:true})); +``` + +`app.use` documentation: +* express: http://expressjs.com/en/4x/api.html#app.use +* connect: https://github.com/senchalabs/connect#mount-middleware + +## WebSocket + +```javascript +// verbose api +proxy('/', {target:'http://echo.websocket.org', ws:true}); + +// shorthand +proxy('http://echo.websocket.org', {ws:true}); + +// shorter shorthand +proxy('ws://echo.websocket.org'); +``` + +### External WebSocket upgrade + +In the previous WebSocket examples, http-proxy-middleware relies on a initial http request in order to listen to the http `upgrade` event. If you need to proxy WebSockets without the initial http request, you can subscribe to the server's http `upgrade` event manually. +```javascript +var wsProxy = proxy('ws://echo.websocket.org', {changeOrigin:true}); + +var app = express(); + app.use(wsProxy); + +var server = app.listen(3000); + server.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade' +``` + + +## Working examples + +View and play around with [working examples](https://github.com/chimurai/http-proxy-middleware/tree/master/examples). + +* Browser-Sync ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/browser-sync/index.js)) +* express ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/express/index.js)) +* connect ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/connect/index.js)) +* WebSocket ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/websocket/index.js)) + +## Recipes + +View the [recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes) for common use cases. + +## Compatible servers + +`http-proxy-middleware` is compatible with the following servers: +* [connect](https://www.npmjs.com/package/connect) +* [express](https://www.npmjs.com/package/express) +* [browser-sync](https://www.npmjs.com/package/browser-sync) +* [lite-server](https://www.npmjs.com/package/lite-server) +* [grunt-contrib-connect](https://www.npmjs.com/package/grunt-contrib-connect) +* [grunt-browser-sync](https://www.npmjs.com/package/grunt-browser-sync) +* [gulp-connect](https://www.npmjs.com/package/gulp-connect) +* [gulp-webserver](https://www.npmjs.com/package/gulp-webserver) + +Sample implementations can be found in the [server recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes/servers.md). + +## Tests + +Run the test suite: + +```bash +# install dependencies +$ npm install +``` + +unit testing + +```bash +# unit tests +$ npm test +``` + +coverage + +```bash +# code coverage +$ npm run cover +``` + +## Changelog + +- [View changelog](https://github.com/chimurai/http-proxy-middleware/blob/master/CHANGELOG.md) + + +## License + +The MIT License (MIT) + +Copyright (c) 2015-2017 Steven Chim diff --git a/node_modules/http-proxy-middleware/index.js b/node_modules/http-proxy-middleware/index.js new file mode 100755 index 00000000..b847ba1e --- /dev/null +++ b/node_modules/http-proxy-middleware/index.js @@ -0,0 +1,5 @@ +var HPM = require('./lib'); + +module.exports = function(context, opts) { + return new HPM(context, opts); +}; diff --git a/node_modules/http-proxy-middleware/lib/config-factory.js b/node_modules/http-proxy-middleware/lib/config-factory.js new file mode 100755 index 00000000..66058fdf --- /dev/null +++ b/node_modules/http-proxy-middleware/lib/config-factory.js @@ -0,0 +1,126 @@ +var _ = require('lodash'); +var url = require('url'); +var logger = require('./logger').getInstance(); + +module.exports = { + createConfig: createConfig +}; + +function createConfig(context, opts) { + // structure of config object to be returned + var config = { + context: undefined, + options: {} + }; + + // app.use('/api', proxy({target:'http://localhost:9000'})); + if (isContextless(context, opts)) { + config.context = '/'; + config.options = _.assign(config.options, context); + } + // app.use('/api', proxy('http://localhost:9000')); + // app.use(proxy('http://localhost:9000/api')); + else if (isStringShortHand(context)) { + var oUrl = url.parse(context); + var target = [oUrl.protocol, '//', oUrl.host].join(''); + + config.context = oUrl.pathname || '/'; + config.options = _.assign(config.options, {target: target}, opts); + + if (oUrl.protocol === 'ws:' || oUrl.protocol === 'wss:') { + config.options.ws = true; + } + // app.use('/api', proxy({target:'http://localhost:9000'})); + } else { + config.context = context; + config.options = _.assign(config.options, opts); + } + + configureLogger(config.options); + + if (!config.options.target) { + throw new Error('[HPM] Missing "target" option. Example: {target: "http://www.example.org"}'); + } + + // Legacy option.proxyHost + config.options = mapLegacyProxyHostOption(config.options); + + // Legacy option.proxyTable > option.router + config.options = mapLegacyProxyTableOption(config.options); + + return config; +} + +/** + * Checks if a String only target/config is provided. + * This can be just the host or with the optional path. + * + * @example + * app.use('/api', proxy('http://localhost:9000')); + app.use(proxy('http://localhost:9000/api')); + * + * @param {String} context [description] + * @return {Boolean} [description] + */ +function isStringShortHand(context) { + if (_.isString(context)) { + return (url.parse(context).host) ? true : false; + } +} + +/** + * Checks if a Object only config is provided, without a context. + * In this case the all paths will be proxied. + * + * @example + * app.use('/api', proxy({target:'http://localhost:9000'})); + * + * @param {Object} context [description] + * @param {*} opts [description] + * @return {Boolean} [description] + */ +function isContextless(context, opts) { + return (_.isPlainObject(context) && _.isEmpty(opts)); +} + +function mapLegacyProxyHostOption(options) { + // set options.headers.host when option.proxyHost is provided + if (options.proxyHost) { + logger.warn('*************************************'); + logger.warn('[HPM] Deprecated "option.proxyHost"'); + logger.warn(' Use "option.changeOrigin" or "option.headers.host" instead'); + logger.warn(' "option.proxyHost" will be removed in future release.'); + logger.warn('*************************************'); + + options.headers = options.headers || {}; + options.headers.host = options.proxyHost; + } + + return options; +} + +// Warn deprecated proxyTable api usage +function mapLegacyProxyTableOption(options) { + if (options.proxyTable) { + logger.warn('*************************************'); + logger.warn('[HPM] Deprecated "option.proxyTable"'); + logger.warn(' Use "option.router" instead'); + logger.warn(' "option.proxyTable" will be removed in future release.'); + logger.warn('*************************************'); + + options.router = _.clone(options.proxyTable); + _.omit(options, 'proxyTable'); + } + + return options; +} + +function configureLogger(options) { + if (options.logLevel) { + logger.setLevel(options.logLevel); + } + + if (options.logProvider) { + logger.setProvider(options.logProvider); + } +} diff --git a/node_modules/http-proxy-middleware/lib/context-matcher.js b/node_modules/http-proxy-middleware/lib/context-matcher.js new file mode 100755 index 00000000..90f62aaa --- /dev/null +++ b/node_modules/http-proxy-middleware/lib/context-matcher.js @@ -0,0 +1,94 @@ +var _ = require('lodash'); +var url = require('url'); +var isGlob = require('is-glob'); +var micromatch = require('micromatch'); + +module.exports = { + match: matchContext +}; + +function matchContext(context, uri, req) { + + // single path + if (isStringPath(context)) { + return matchSingleStringPath(context, uri); + } + + // single glob path + if (isGlobPath(context)) { + return matchSingleGlobPath(context, uri); + } + + // multi path + if (Array.isArray(context)) { + if (context.every(isStringPath)) { + return matchMultiPath(context, uri); + } + if (context.every(isGlobPath)) { + return matchMultiGlobPath(context, uri); + } + + throw new Error('[HPM] Invalid context. Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"]'); + } + + // custom matching + if (_.isFunction(context)) { + var pathname = getUrlPathName(uri); + return context(pathname, req); + } + + throw new Error('[HPM] Invalid context. Expecting something like: "/api" or ["/api", "/ajax"]'); +} + +/** + * @param {String} context '/api' + * @param {String} uri 'http://example.org/api/b/c/d.html' + * @return {Boolean} + */ +function matchSingleStringPath(context, uri) { + var pathname = getUrlPathName(uri); + return pathname.indexOf(context) === 0; +} + +function matchSingleGlobPath(pattern, uri) { + var pathname = getUrlPathName(uri); + var matches = micromatch(pathname, pattern); + return matches && (matches.length > 0); +} + +function matchMultiGlobPath(patternList, uri) { + return matchSingleGlobPath(patternList, uri); +} + +/** + * @param {String} context ['/api', '/ajax'] + * @param {String} uri 'http://example.org/api/b/c/d.html' + * @return {Boolean} + */ +function matchMultiPath(contextList, uri) { + for (var i = 0; i < contextList.length; i++) { + var context = contextList[i]; + if (matchSingleStringPath(context, uri)) { + return true; + } + } + return false; +} + +/** + * Parses URI and returns RFC 3986 path + * + * @param {String} uri from req.url + * @return {String} RFC 3986 path + */ +function getUrlPathName(uri) { + return uri && url.parse(uri).pathname; +} + +function isStringPath(context) { + return _.isString(context) && !isGlob(context); +} + +function isGlobPath(context) { + return isGlob(context); +} diff --git a/node_modules/http-proxy-middleware/lib/handlers.js b/node_modules/http-proxy-middleware/lib/handlers.js new file mode 100755 index 00000000..b1e59015 --- /dev/null +++ b/node_modules/http-proxy-middleware/lib/handlers.js @@ -0,0 +1,74 @@ +var _ = require('lodash'); +var logger = require('./logger').getInstance(); + +module.exports = { + init: init, + getHandlers: getProxyEventHandlers +}; + +function init(proxy, opts) { + var handlers = getProxyEventHandlers(opts); + + _.forIn(handlers, function(handler, eventName) { + proxy.on(eventName, handlers[eventName]); + }); + + logger.debug('[HPM] Subscribed to http-proxy events: ', _.keys(handlers)); +} + +function getProxyEventHandlers(opts) { + // https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events + var proxyEvents = ['error', 'proxyReq', 'proxyReqWs', 'proxyRes', 'open', 'close']; + var handlers = {}; + + _.forEach(proxyEvents, function(event) { + // all handlers for the http-proxy events are prefixed with 'on'. + // loop through options and try to find these handlers + // and add them to the handlers object for subscription in init(). + var eventName = _.camelCase('on ' + event); + var fnHandler = _.get(opts, eventName); + + if (_.isFunction(fnHandler)) { + handlers[event] = fnHandler; + } + }); + + // add default error handler in absence of error handler + if (!_.isFunction(handlers.error)) { + handlers.error = defaultErrorHandler; + } + + // add default close handler in absence of close handler + if (!_.isFunction(handlers.close)) { + handlers.close = logClose; + } + + return handlers; +}; + +function defaultErrorHandler(err, req, res) { + var host = (req.headers && req.headers.host); + var code = err.code; + + if (res.writeHead && !res.headersSent) { + if (/HPE_INVALID/.test(code)) { + res.writeHead(502); + } else { + switch(code) { + case 'ECONNRESET': + case 'ENOTFOUND': + case 'ECONNREFUSED': + res.writeHead(504); + break; + default: res.writeHead(500); + } + } + } + + res.end('Error occured while trying to proxy to: ' + host + req.url); +} + +function logClose(req, socket, head) { + // view disconnected websocket connections + logger.info('[HPM] Client disconnected'); +} diff --git a/node_modules/http-proxy-middleware/lib/index.js b/node_modules/http-proxy-middleware/lib/index.js new file mode 100755 index 00000000..a413d92e --- /dev/null +++ b/node_modules/http-proxy-middleware/lib/index.js @@ -0,0 +1,147 @@ +var _ = require('lodash'); +var httpProxy = require('http-proxy'); +var configFactory = require('./config-factory'); +var handlers = require('./handlers'); +var contextMatcher = require('./context-matcher'); +var PathRewriter = require('./path-rewriter'); +var Router = require('./router'); +var logger = require('./logger').getInstance(); +var getArrow = require('./logger').getArrow; + +module.exports = HttpProxyMiddleware; + +function HttpProxyMiddleware(context, opts) { + // https://github.com/chimurai/http-proxy-middleware/issues/57 + var wsUpgradeDebounced = _.debounce(handleUpgrade); + var wsInitialized = false; + var config = configFactory.createConfig(context, opts); + var proxyOptions = config.options; + + // create proxy + var proxy = httpProxy.createProxyServer({}); + logger.info('[HPM] Proxy created:', config.context, ' -> ', proxyOptions.target); + + var pathRewriter = PathRewriter.create(proxyOptions.pathRewrite); // returns undefined when "pathRewrite" is not provided + + // attach handler to http-proxy events + handlers.init(proxy, proxyOptions); + + // log errors for debug purpose + proxy.on('error', logError); + + // https://github.com/chimurai/http-proxy-middleware/issues/19 + // expose function to upgrade externally + middleware.upgrade = wsUpgradeDebounced; + + return middleware; + + function middleware(req, res, next) { + if (shouldProxy(config.context, req)) { + var activeProxyOptions = prepareProxyRequest(req); + proxy.web(req, res, activeProxyOptions); + } else { + next(); + } + + if (proxyOptions.ws === true) { + // use initial request to access the server object to subscribe to http upgrade event + catchUpgradeRequest(req.connection.server); + } + } + + function catchUpgradeRequest(server) { + // subscribe once; don't subscribe on every request... + // https://github.com/chimurai/http-proxy-middleware/issues/113 + if (!wsInitialized) { + server.on('upgrade', wsUpgradeDebounced); + wsInitialized = true; + } + } + + function handleUpgrade(req, socket, head) { + // set to initialized when used externally + wsInitialized = true; + + if (shouldProxy(config.context, req)) { + var activeProxyOptions = prepareProxyRequest(req); + proxy.ws(req, socket, head, activeProxyOptions); + logger.info('[HPM] Upgrading to WebSocket'); + } + } + + /** + * Determine whether request should be proxied. + * + * @private + * @return {Boolean} + */ + function shouldProxy(context, req) { + var path = (req.originalUrl || req.url); + return contextMatcher.match(context, path, req); + } + + /** + * Apply option.router and option.pathRewrite + * Order matters: + Router uses original path for routing; + NOT the modified path, after it has been rewritten by pathRewrite + */ + function prepareProxyRequest(req) { + // https://github.com/chimurai/http-proxy-middleware/issues/17 + // https://github.com/chimurai/http-proxy-middleware/issues/94 + req.url = (req.originalUrl || req.url); + + // store uri before it gets rewritten for logging + var originalPath = req.url; + var newProxyOptions = _.assign({}, proxyOptions); + + // Apply in order: + // 1. option.router + // 2. option.pathRewrite + __applyRouter(req, newProxyOptions); + __applyPathRewrite(req, pathRewriter); + + // debug logging for both http(s) and websockets + if (proxyOptions.logLevel === 'debug') { + var arrow = getArrow(originalPath, req.url, proxyOptions.target, newProxyOptions.target); + logger.debug('[HPM] %s %s %s %s', req.method, originalPath, arrow, newProxyOptions.target); + } + + return newProxyOptions; + } + + // Modify option.target when router present. + function __applyRouter(req, options) { + var newTarget; + + if (options.router) { + newTarget = Router.getTarget(req, options); + + if (newTarget) { + logger.debug('[HPM] Router new target: %s -> "%s"', options.target, newTarget); + options.target = newTarget; + } + } + } + + // rewrite path + function __applyPathRewrite(req, pathRewriter) { + if (pathRewriter) { + var path = pathRewriter(req.url, req); + + if (typeof path === 'string') { + req.url = path; + } else { + logger.info('[HPM] pathRewrite: No rewritten path found. (%s)', req.url); + } + } + } + + function logError(err, req, res) { + var hostname = (req.headers && req.headers.host) || (req.hostname || req.host); // (websocket) || (node0.10 || node 4/5) + var target = proxyOptions.target.host || proxyOptions.target; + var errReference = 'https://nodejs.org/api/errors.html#errors_common_system_errors'; // link to Node Common Systems Errors page + + logger.error('[HPM] Error occurred while trying to proxy request %s from %s to %s (%s) (%s)', req.url, hostname, target, err.code, errReference); + } +}; diff --git a/node_modules/http-proxy-middleware/lib/logger.js b/node_modules/http-proxy-middleware/lib/logger.js new file mode 100755 index 00000000..be73680b --- /dev/null +++ b/node_modules/http-proxy-middleware/lib/logger.js @@ -0,0 +1,158 @@ +var util = require('util'); +var _ = require('lodash'); + +var loggerInstance; + +var defaultProvider = { + log: console.log, + debug: console.log, // use .log(); since console does not have .debug() + info: console.info, + warn: console.warn, + error: console.error +}; + +// log level 'weight' +var LEVELS = { + debug: 10, + info: 20, + warn: 30, + error: 50, + silent: 80 +}; + +module.exports = { + // singleton + getInstance: function() { + if (!loggerInstance) { + loggerInstance = new Logger(); + } + + return loggerInstance; + }, + getArrow: getArrow +}; + +function Logger() { + var logLevel; + var provider; + + var api = { + log: log, + debug: debug, + info: info, + warn: warn, + error: error, + setLevel: function(v) { + if (isValidLevel(v)) { + logLevel = v; + } + }, + setProvider: function(fn) { + if (fn && isValidProvider(fn)) { + provider = fn(defaultProvider); + } + } + }; + + init(); + + return api; + + function init() { + api.setLevel('info'); + api.setProvider(function() { + return defaultProvider; + }); + } + + // log will log messages, regardless of logLevels + function log() { + provider.log(_interpolate.apply(null, arguments)); + } + + function debug() { + if (_showLevel('debug')) { + provider.debug(_interpolate.apply(null, arguments)); + } + } + + function info() { + if (_showLevel('info')) { + provider.info(_interpolate.apply(null, arguments)); + } + } + + function warn() { + if (_showLevel('warn')) { + provider.warn(_interpolate.apply(null, arguments)); + } + } + + function error() { + if (_showLevel('error')) { + provider.error(_interpolate.apply(null, arguments)); + } + } + + /** + * Decide to log or not to log, based on the log levels 'weight' + * @param {String} showLevel [debug, info, warn, error, silent] + * @return {Boolean} + */ + function _showLevel(showLevel) { + var result = false; + var currentLogLevel = LEVELS[logLevel]; + + if (currentLogLevel && (currentLogLevel <= LEVELS[showLevel])) { + result = true; + } + + return result; + } + + // make sure logged messages and its data are return interpolated + // make it possible for additional log data, such date/time or custom prefix. + function _interpolate() { + var fn = _.spread(util.format); + var result = fn(_.slice(arguments)); + + return result; + } + + function isValidProvider(fnProvider) { + var result = true; + + if (fnProvider && !_.isFunction(fnProvider)) { + throw new Error('[HPM] Log provider config error. Expecting a function.'); + } + + return result; + } + + function isValidLevel(levelName) { + var validLevels = _.keys(LEVELS); + var isValid = _.includes(validLevels, levelName); + + if (!isValid) { + throw new Error('[HPM] Log level error. Invalid logLevel.'); + } + + return isValid; + } +} + +/** + * -> normal proxy + * => router + * ~> pathRewrite + * ≈> router + pathRewrite + */ +function getArrow(originalPath, newPath, originalTarget, newTarget) { + var arrow = ['>']; + var isNewTarget = (originalTarget !== newTarget); // router + var isNewPath = (originalPath !== newPath); // pathRewrite + + if (isNewPath && !isNewTarget) {arrow.unshift('~');} else if (!isNewPath && isNewTarget) {arrow.unshift('=');} else if (isNewPath && isNewTarget) {arrow.unshift('≈');} else {arrow.unshift('-');} + + return arrow.join(''); +} diff --git a/node_modules/http-proxy-middleware/lib/path-rewriter.js b/node_modules/http-proxy-middleware/lib/path-rewriter.js new file mode 100755 index 00000000..3b5bba91 --- /dev/null +++ b/node_modules/http-proxy-middleware/lib/path-rewriter.js @@ -0,0 +1,72 @@ +var _ = require('lodash'); +var logger = require('./logger').getInstance(); + +module.exports = { + create: createPathRewriter +}; + +/** + * Create rewrite function, to cache parsed rewrite rules. + * + * @returns {function} Function to rewrite paths; This function should accept `path` (request.url) as parameter + */ +function createPathRewriter(rewriteConfig) { + var rulesCache; + + if (!isValidRewriteConfig(rewriteConfig)) { + return; + } + + if (_.isFunction(rewriteConfig)) { + var customRewriteFn = rewriteConfig; + return customRewriteFn; + } else { + rulesCache = parsePathRewriteRules(rewriteConfig); + return rewritePath; + } + + function rewritePath(path) { + var result = path; + + _.forEach(rulesCache, function(rule) { + if (rule.regex.test(path)) { + result = result.replace(rule.regex, rule.value); + logger.debug('[HPM] Rewriting path from "%s" to "%s"', path, result); + return false; + } + }); + + return result; + } +} + +function isValidRewriteConfig(rewriteConfig) { + if (_.isFunction(rewriteConfig)) { + return true; + } else if (!_.isEmpty(rewriteConfig) && _.isPlainObject(rewriteConfig)) { + return true; + } else if (_.isUndefined(rewriteConfig) || + _.isNull(rewriteConfig) || + _.isEqual(rewriteConfig, {})) { + return false; + } else { + throw new Error('[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function'); + } +} + +function parsePathRewriteRules(rewriteConfig) { + var rules = []; + + if (_.isPlainObject(rewriteConfig)) { + _.forIn(rewriteConfig, function(value, key) { + rules.push({ + regex: new RegExp(key), + value: rewriteConfig[key] + }); + logger.info('[HPM] Proxy rewrite rule created: "%s" ~> "%s"', key, rewriteConfig[key]); + }); + } + + return rules; +} + diff --git a/node_modules/http-proxy-middleware/lib/router.js b/node_modules/http-proxy-middleware/lib/router.js new file mode 100755 index 00000000..37107dbd --- /dev/null +++ b/node_modules/http-proxy-middleware/lib/router.js @@ -0,0 +1,53 @@ +var _ = require('lodash'); +var logger = require('./logger.js').getInstance(); + +module.exports = { + getTarget: getTarget +}; + +function getTarget(req, config) { + var newTarget; + var router = config.router; + + if (_.isPlainObject(router)) { + newTarget = getTargetFromProxyTable(req, router); + } else if (_.isFunction(router)) { + newTarget = router(req); + } + + return newTarget; +} + +function getTargetFromProxyTable(req, table) { + var result; + var host = req.headers.host; + var path = req.url; + + var hostAndPath = host + path; + + _.forIn(table, function(value, key) { + if (containsPath(key)) { + + if (hostAndPath.indexOf(key) > -1) { // match 'localhost:3000/api' + result = table[key]; + logger.debug('[HPM] Router table match: "%s"', key); + return false; + } + } else { + + if (key === host) { // match 'localhost:3000' + result = table[key]; + logger.debug('[HPM] Router table match: "%s"', host); + return false; + } + + } + + }); + + return result; +} + +function containsPath(v) { + return v.indexOf('/') > -1; +} diff --git a/node_modules/http-proxy-middleware/node_modules/is-extglob/LICENSE b/node_modules/http-proxy-middleware/node_modules/is-extglob/LICENSE new file mode 100755 index 00000000..842218cf --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/http-proxy-middleware/node_modules/is-extglob/README.md b/node_modules/http-proxy-middleware/node_modules/is-extglob/README.md new file mode 100755 index 00000000..0416af5c --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/http-proxy-middleware/node_modules/is-extglob/index.js b/node_modules/http-proxy-middleware/node_modules/is-extglob/index.js new file mode 100755 index 00000000..c1d986fc --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/node_modules/http-proxy-middleware/node_modules/is-extglob/package.json b/node_modules/http-proxy-middleware/node_modules/is-extglob/package.json new file mode 100755 index 00000000..090abe37 --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-extglob/package.json @@ -0,0 +1,136 @@ +{ + "_args": [ + [ + { + "raw": "is-extglob@^2.1.0", + "scope": null, + "escapedName": "is-extglob", + "name": "is-extglob", + "rawSpec": "^2.1.0", + "spec": ">=2.1.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy-middleware/node_modules/is-glob" + ] + ], + "_from": "is-extglob@>=2.1.0 <3.0.0", + "_id": "is-extglob@2.1.1", + "_inCache": true, + "_location": "/http-proxy-middleware/is-extglob", + "_nodeVersion": "6.9.2", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/is-extglob-2.1.1.tgz_1481429063759_0.21102957101538777" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "is-extglob@^2.1.0", + "scope": null, + "escapedName": "is-extglob", + "name": "is-extglob", + "rawSpec": "^2.1.0", + "spec": ">=2.1.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/http-proxy-middleware/is-glob" + ], + "_resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "_shasum": "a88c02535791f02ed37c76a1b9ea9773c833f8c2", + "_shrinkwrap": null, + "_spec": "is-extglob@^2.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy-middleware/node_modules/is-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "dependencies": {}, + "description": "Returns true if a string has an extglob.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "directories": {}, + "dist": { + "shasum": "a88c02535791f02ed37c76a1b9ea9773c833f8c2", + "tarball": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "10a74787acbe79abf02141c5d487950d1b197b15", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "is-extglob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extglob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.1" +} diff --git a/node_modules/http-proxy-middleware/node_modules/is-glob/LICENSE b/node_modules/http-proxy-middleware/node_modules/is-glob/LICENSE new file mode 100755 index 00000000..39245ac1 --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/http-proxy-middleware/node_modules/is-glob/README.md b/node_modules/http-proxy-middleware/node_modules/is-glob/README.md new file mode 100755 index 00000000..6f4404fe --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-glob/README.md @@ -0,0 +1,142 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-glob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-glob) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +isGlob('abc/?.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +isGlob('abc/\\?.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +## About + +### Related projects + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
      | +| --- | --- | +| 40 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [tuvistavie](https://github.com/tuvistavie) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-glob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/http-proxy-middleware/node_modules/is-glob/index.js b/node_modules/http-proxy-middleware/node_modules/is-glob/index.js new file mode 100755 index 00000000..2ecbe2a7 --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-glob/index.js @@ -0,0 +1,25 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob = require('is-extglob'); + +module.exports = function isGlob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) return true; + + var regex = /(\\).|([*?]|\[.*\]|\{.*\}|\(.*\|.*\)|^!)/; + var match; + + while ((match = regex.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + return false; +}; diff --git a/node_modules/http-proxy-middleware/node_modules/is-glob/package.json b/node_modules/http-proxy-middleware/node_modules/is-glob/package.json new file mode 100755 index 00000000..0dca9035 --- /dev/null +++ b/node_modules/http-proxy-middleware/node_modules/is-glob/package.json @@ -0,0 +1,158 @@ +{ + "_args": [ + [ + { + "raw": "is-glob@^3.1.0", + "scope": null, + "escapedName": "is-glob", + "name": "is-glob", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy-middleware" + ] + ], + "_from": "is-glob@>=3.1.0 <4.0.0", + "_id": "is-glob@3.1.0", + "_inCache": true, + "_location": "/http-proxy-middleware/is-glob", + "_nodeVersion": "6.7.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/is-glob-3.1.0.tgz_1476311825972_0.002021018648520112" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "is-glob@^3.1.0", + "scope": null, + "escapedName": "is-glob", + "name": "is-glob", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/http-proxy-middleware" + ], + "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "_shasum": "7ba5ae24217804ac70707b96922567486cc3e84a", + "_shrinkwrap": null, + "_spec": "is-glob@^3.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy-middleware", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-glob/issues" + }, + "contributors": [ + { + "name": "Daniel Perez", + "email": "daniel@claudetech.com", + "url": "http://tuvistavie.com" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "is-extglob": "^2.1.0" + }, + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "directories": {}, + "dist": { + "shasum": "7ba5ae24217804ac70707b96922567486cc3e84a", + "tarball": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "4537576b5747e03db2f78235c98ec27755ace63c", + "homepage": "https://github.com/jonschlinkert/is-glob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "is-glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + }, + "version": "3.1.0" +} diff --git a/node_modules/http-proxy-middleware/package.json b/node_modules/http-proxy-middleware/package.json new file mode 100755 index 00000000..edc68ba1 --- /dev/null +++ b/node_modules/http-proxy-middleware/package.json @@ -0,0 +1,122 @@ +{ + "_args": [ + [ + { + "raw": "http-proxy-middleware@~0.17.1", + "scope": null, + "escapedName": "http-proxy-middleware", + "name": "http-proxy-middleware", + "rawSpec": "~0.17.1", + "spec": ">=0.17.1 <0.18.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server" + ] + ], + "_from": "http-proxy-middleware@>=0.17.1 <0.18.0", + "_id": "http-proxy-middleware@0.17.4", + "_inCache": true, + "_location": "/http-proxy-middleware", + "_nodeVersion": "7.7.1", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/http-proxy-middleware-0.17.4.tgz_1488496050141_0.13289726292714477" + }, + "_npmUser": { + "name": "chimurai", + "email": "stevenchim@gmail.com" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "http-proxy-middleware@~0.17.1", + "scope": null, + "escapedName": "http-proxy-middleware", + "name": "http-proxy-middleware", + "rawSpec": "~0.17.1", + "spec": ">=0.17.1 <0.18.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack-dev-server" + ], + "_resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz", + "_shasum": "642e8848851d66f09d4f124912846dbaeb41b833", + "_shrinkwrap": null, + "_spec": "http-proxy-middleware@~0.17.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server", + "author": { + "name": "Steven Chim" + }, + "bugs": { + "url": "https://github.com/chimurai/http-proxy-middleware/issues" + }, + "dependencies": { + "http-proxy": "^1.16.2", + "is-glob": "^3.1.0", + "lodash": "^4.17.2", + "micromatch": "^2.3.11" + }, + "description": "The one-liner node.js proxy middleware for connect, express and browser-sync", + "devDependencies": { + "browser-sync": "^2.18.2", + "chai": "^3.5.0", + "connect": "^3.5.0", + "coveralls": "^2.11.15", + "express": "^4.14.0", + "istanbul": "^0.4.5", + "istanbul-coveralls": "^1.0.3", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "1.2.0", + "opn": "^4.0.2", + "ws": "^1.1.1" + }, + "directories": {}, + "dist": { + "shasum": "642e8848851d66f09d4f124912846dbaeb41b833", + "tarball": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz" + }, + "files": [ + "index.js", + "lib" + ], + "gitHead": "cb5e084e71bc3202fe4f711f2f5edf4e29355d99", + "homepage": "https://github.com/chimurai/http-proxy-middleware", + "keywords": [ + "reverse", + "proxy", + "middleware", + "http", + "https", + "connect", + "express", + "browser-sync", + "gulp", + "grunt-contrib-connect", + "websocket", + "ws", + "cors" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "chimurai", + "email": "stevenchim@gmail.com" + } + ], + "name": "http-proxy-middleware", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chimurai/http-proxy-middleware.git" + }, + "scripts": { + "clean": "rm -rf coverage", + "cover": "npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive", + "coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean", + "test": "mocha --recursive --colors --reporter spec" + }, + "version": "0.17.4" +} diff --git a/node_modules/http-proxy/.npmignore b/node_modules/http-proxy/.npmignore new file mode 100755 index 00000000..081a48c6 --- /dev/null +++ b/node_modules/http-proxy/.npmignore @@ -0,0 +1,7 @@ +test +examples +doc +benchmark +.travis.yml +CHANGELOG.md +UPGRADING.md \ No newline at end of file diff --git a/node_modules/http-proxy/LICENSE b/node_modules/http-proxy/LICENSE new file mode 100755 index 00000000..84820c00 --- /dev/null +++ b/node_modules/http-proxy/LICENSE @@ -0,0 +1,23 @@ + + node-http-proxy + + Copyright (c) 2010-2016 Charlie Robbins, Jarrett Cruger & the Contributors. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/http-proxy/README.md b/node_modules/http-proxy/README.md new file mode 100755 index 00000000..49c49a39 --- /dev/null +++ b/node_modules/http-proxy/README.md @@ -0,0 +1,493 @@ +

      + +

      + +node-http-proxy +======= + +

      + +    + + +

      + +`node-http-proxy` is an HTTP programmable proxying library that supports +websockets. It is suitable for implementing components such as reverse +proxies and load balancers. + +### Table of Contents + * [Installation](#installation) + * [Upgrading from 0.8.x ?](#upgrading-from-08x-) + * [Core Concept](#core-concept) + * [Use Cases](#use-cases) + * [Setup a basic stand-alone proxy server](#setup-a-basic-stand-alone-proxy-server) + * [Setup a stand-alone proxy server with custom server logic](#setup-a-stand-alone-proxy-server-with-custom-server-logic) + * [Setup a stand-alone proxy server with proxy request header re-writing](#setup-a-stand-alone-proxy-server-with-proxy-request-header-re-writing) + * [Modify a response from a proxied server](#modify-a-response-from-a-proxied-server) + * [Setup a stand-alone proxy server with latency](#setup-a-stand-alone-proxy-server-with-latency) + * [Using HTTPS](#using-https) + * [Proxying WebSockets](#proxying-websockets) + * [Options](#options) + * [Listening for proxy events](#listening-for-proxy-events) + * [Shutdown](#shutdown) + * [Miscellaneous](#miscellaneous) + * [Test](#test) + * [ProxyTable API](#proxytable-api) + * [Logo](#logo) + * [Contributing and Issues](#contributing-and-issues) + * [License](#license) + +### Installation + +`npm install http-proxy --save` + +**[Back to top](#table-of-contents)** + +### Upgrading from 0.8.x ? + +Click [here](UPGRADING.md) + +**[Back to top](#table-of-contents)** + +### Core Concept + +A new proxy is created by calling `createProxyServer` and passing +an `options` object as argument ([valid properties are available here](lib/http-proxy.js#L33-L50)) + +```javascript +var httpProxy = require('http-proxy'); + +var proxy = httpProxy.createProxyServer(options); // See (†) +``` +†Unless listen(..) is invoked on the object, this does not create a webserver. See below. + +An object will be returned with four methods: + +* web `req, res, [options]` (used for proxying regular HTTP(S) requests) +* ws `req, socket, head, [options]` (used for proxying WS(S) requests) +* listen `port` (a function that wraps the object in a webserver, for your convenience) +* close `[callback]` (a function that closes the inner webserver and stops listening on given port) + +It is then possible to proxy requests by calling these functions + +```javascript +http.createServer(function(req, res) { + proxy.web(req, res, { target: 'http://mytarget.com:8080' }); +}); +``` + +Errors can be listened on either using the Event Emitter API + +```javascript +proxy.on('error', function(e) { + ... +}); +``` + +or using the callback API + +```javascript +proxy.web(req, res, { target: 'http://mytarget.com:8080' }, function(e) { ... }); +``` + +When a request is proxied it follows two different pipelines ([available here](lib/http-proxy/passes)) +which apply transformations to both the `req` and `res` object. +The first pipeline (incoming) is responsible for the creation and manipulation of the stream that connects your client to the target. +The second pipeline (outgoing) is responsible for the creation and manipulation of the stream that, from your target, returns data +to the client. + +**[Back to top](#table-of-contents)** + +### Use Cases + +#### Setup a basic stand-alone proxy server + +```js +var http = require('http'), + httpProxy = require('http-proxy'); +// +// Create your proxy server and set the target in the options. +// +httpProxy.createProxyServer({target:'http://localhost:9000'}).listen(8000); // See (†) + +// +// Create your target server +// +http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2)); + res.end(); +}).listen(9000); +``` +†Invoking listen(..) triggers the creation of a web server. Otherwise, just the proxy instance is created. + +**[Back to top](#table-of-contents)** + +#### Setup a stand-alone proxy server with custom server logic +This example show how you can proxy a request using your own HTTP server +and also you can put your own logic to handle the request. + +```js +var http = require('http'), + httpProxy = require('http-proxy'); + +// +// Create a proxy server with custom application logic +// +var proxy = httpProxy.createProxyServer({}); + +// +// Create your custom server and just call `proxy.web()` to proxy +// a web request to the target passed in the options +// also you can use `proxy.ws()` to proxy a websockets request +// +var server = http.createServer(function(req, res) { + // You can define here your custom logic to handle the request + // and then proxy the request. + proxy.web(req, res, { target: 'http://127.0.0.1:5060' }); +}); + +console.log("listening on port 5050") +server.listen(5050); +``` + +**[Back to top](#table-of-contents)** + +#### Setup a stand-alone proxy server with proxy request header re-writing +This example shows how you can proxy a request using your own HTTP server that +modifies the outgoing proxy request by adding a special header. + +```js +var http = require('http'), + httpProxy = require('http-proxy'); + +// +// Create a proxy server with custom application logic +// +var proxy = httpProxy.createProxyServer({}); + +// To modify the proxy connection before data is sent, you can listen +// for the 'proxyReq' event. When the event is fired, you will receive +// the following arguments: +// (http.ClientRequest proxyReq, http.IncomingMessage req, +// http.ServerResponse res, Object options). This mechanism is useful when +// you need to modify the proxy request before the proxy connection +// is made to the target. +// +proxy.on('proxyReq', function(proxyReq, req, res, options) { + proxyReq.setHeader('X-Special-Proxy-Header', 'foobar'); +}); + +var server = http.createServer(function(req, res) { + // You can define here your custom logic to handle the request + // and then proxy the request. + proxy.web(req, res, { + target: 'http://127.0.0.1:5060' + }); +}); + +console.log("listening on port 5050") +server.listen(5050); +``` + +**[Back to top](#table-of-contents)** + +#### Modify a response from a proxied server +Sometimes when you have received a HTML/XML document from the server of origin you would like to modify it before forwarding it on. + +[Harmon](https://github.com/No9/harmon) allows you to do this in a streaming style so as to keep the pressure on the proxy to a minimum. + +**[Back to top](#table-of-contents)** + +#### Setup a stand-alone proxy server with latency + +```js +var http = require('http'), + httpProxy = require('http-proxy'); + +// +// Create a proxy server with latency +// +var proxy = httpProxy.createProxyServer(); + +// +// Create your server that makes an operation that waits a while +// and then proxies the request +// +http.createServer(function (req, res) { + // This simulates an operation that takes 500ms to execute + setTimeout(function () { + proxy.web(req, res, { + target: 'http://localhost:9008' + }); + }, 500); +}).listen(8008); + +// +// Create your target server +// +http.createServer(function (req, res) { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2)); + res.end(); +}).listen(9008); +``` + +**[Back to top](#table-of-contents)** + +#### Using HTTPS +You can activate the validation of a secure SSL certificate to the target connection (avoid self signed certs), just set `secure: true` in the options. + +##### HTTPS -> HTTP + +```js +// +// Create the HTTPS proxy server in front of a HTTP server +// +httpProxy.createServer({ + target: { + host: 'localhost', + port: 9009 + }, + ssl: { + key: fs.readFileSync('valid-ssl-key.pem', 'utf8'), + cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8') + } +}).listen(8009); +``` + +##### HTTPS -> HTTPS + +```js +// +// Create the proxy server listening on port 443 +// +httpProxy.createServer({ + ssl: { + key: fs.readFileSync('valid-ssl-key.pem', 'utf8'), + cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8') + }, + target: 'https://localhost:9010', + secure: true // Depends on your needs, could be false. +}).listen(443); +``` + +**[Back to top](#table-of-contents)** + +#### Proxying WebSockets +You can activate the websocket support for the proxy using `ws:true` in the options. + +```js +// +// Create a proxy server for websockets +// +httpProxy.createServer({ + target: 'ws://localhost:9014', + ws: true +}).listen(8014); +``` + +Also you can proxy the websocket requests just calling the `ws(req, socket, head)` method. + +```js +// +// Setup our server to proxy standard HTTP requests +// +var proxy = new httpProxy.createProxyServer({ + target: { + host: 'localhost', + port: 9015 + } +}); +var proxyServer = http.createServer(function (req, res) { + proxy.web(req, res); +}); + +// +// Listen to the `upgrade` event and proxy the +// WebSocket requests as well. +// +proxyServer.on('upgrade', function (req, socket, head) { + proxy.ws(req, socket, head); +}); + +proxyServer.listen(8015); +``` + +**[Back to top](#table-of-contents)** + +### Options + +`httpProxy.createProxyServer` supports the following options: + +* **target**: url string to be parsed with the url module +* **forward**: url string to be parsed with the url module +* **agent**: object to be passed to http(s).request (see Node's [https agent](http://nodejs.org/api/https.html#https_class_https_agent) and [http agent](http://nodejs.org/api/http.html#http_class_http_agent) objects) +* **ssl**: object to be passed to https.createServer() +* **ws**: true/false, if you want to proxy websockets +* **xfwd**: true/false, adds x-forward headers +* **secure**: true/false, if you want to verify the SSL Certs +* **toProxy**: true/false, passes the absolute URL as the `path` (useful for proxying to proxies) +* **prependPath**: true/false, Default: true - specify whether you want to prepend the target's path to the proxy path +* **ignorePath**: true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request (note: you will have to append / manually if required). +* **localAddress**: Local interface string to bind for outgoing connections +* **changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL +* **preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key +* **auth**: Basic authentication i.e. 'user:password' to compute an Authorization header. +* **hostRewrite**: rewrites the location hostname on (201/301/302/307/308) redirects. +* **autoRewrite**: rewrites the location host/port on (201/301/302/307/308) redirects based on requested host/port. Default: false. +* **protocolRewrite**: rewrites the location protocol on (201/301/302/307/308) redirects to 'http' or 'https'. Default: null. +* **cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values: + * `false` (default): disable cookie rewriting + * String: new domain, for example `cookieDomainRewrite: "new.domain"`. To remove the domain, use `cookieDomainRewrite: ""`. + * Object: mapping of domains to new domains, use `"*"` to match all domains. + For example keep one domain unchanged, rewrite one domain and remove other domains: + ``` + cookieDomainRewrite: { + "unchanged.domain": "unchanged.domain", + "old.domain": "new.domain", + "*": "" + } + ``` +* **headers**: object with extra headers to be added to target requests. +* **proxyTimeout**: timeout (in millis) when proxy receives no response from target + +**NOTE:** +`options.ws` and `options.ssl` are optional. +`options.target` and `options.forward` cannot both be missing + +If you are using the `proxyServer.listen` method, the following options are also applicable: + + * **ssl**: object to be passed to https.createServer() + * **ws**: true/false, if you want to proxy websockets + +**[Back to top](#table-of-contents)** + +### Listening for proxy events + +* `error`: The error event is emitted if the request to the target fail. **We do not do any error handling of messages passed between client and proxy, and messages passed between proxy and target, so it is recommended that you listen on errors and handle them.** +* `proxyReq`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "web" connections +* `proxyReqWs`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "websocket" connections +* `proxyRes`: This event is emitted if the request to the target got a response. +* `open`: This event is emitted once the proxy websocket was created and piped into the target websocket. +* `close`: This event is emitted once the proxy websocket was closed. +* (DEPRECATED) `proxySocket`: Deprecated in favor of `open`. + +```js +var httpProxy = require('http-proxy'); +// Error example +// +// Http Proxy Server with bad target +// +var proxy = httpProxy.createServer({ + target:'http://localhost:9005' +}); + +proxy.listen(8005); + +// +// Listen for the `error` event on `proxy`. +proxy.on('error', function (err, req, res) { + res.writeHead(500, { + 'Content-Type': 'text/plain' + }); + + res.end('Something went wrong. And we are reporting a custom error message.'); +}); + +// +// Listen for the `proxyRes` event on `proxy`. +// +proxy.on('proxyRes', function (proxyRes, req, res) { + console.log('RAW Response from the target', JSON.stringify(proxyRes.headers, true, 2)); +}); + +// +// Listen for the `open` event on `proxy`. +// +proxy.on('open', function (proxySocket) { + // listen for messages coming FROM the target here + proxySocket.on('data', hybiParseAndLogMessage); +}); + +// +// Listen for the `close` event on `proxy`. +// +proxy.on('close', function (res, socket, head) { + // view disconnected websocket connections + console.log('Client disconnected'); +}); +``` + +**[Back to top](#table-of-contents)** + +### Shutdown + +* When testing or running server within another program it may be necessary to close the proxy. +* This will stop the proxy from accepting new connections. + +```js +var proxy = new httpProxy.createProxyServer({ + target: { + host: 'localhost', + port: 1337 + } +}); + +proxy.close(); +``` + +**[Back to top](#table-of-contents)** + +### Miscellaneous + +#### ProxyTable API + +A proxy table API is available through this add-on [module](https://github.com/donasaur/http-proxy-rules), which lets you define a set of rules to translate matching routes to target routes that the reverse proxy will talk to. + +#### Test + +``` +$ npm test +``` + +#### Logo + +Logo created by [Diego Pasquali](http://dribbble.com/diegopq) + +**[Back to top](#table-of-contents)** + +### Contributing and Issues + +* Search on Google/Github +* If you can't find anything, open an issue +* If you feel comfortable about fixing the issue, fork the repo +* Commit to your local branch (which must be different from `master`) +* Submit your Pull Request (be sure to include tests and update documentation) + +**[Back to top](#table-of-contents)** + +### License + +>The MIT License (MIT) +> +>Copyright (c) 2010 - 2016 Charlie Robbins, Jarrett Cruger & the Contributors. +> +>Permission is hereby granted, free of charge, to any person obtaining a copy +>of this software and associated documentation files (the "Software"), to deal +>in the Software without restriction, including without limitation the rights +>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +>copies of the Software, and to permit persons to whom the Software is +>furnished to do so, subject to the following conditions: +> +>The above copyright notice and this permission notice shall be included in +>all copies or substantial portions of the Software. +> +>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +>THE SOFTWARE. diff --git a/node_modules/http-proxy/index.js b/node_modules/http-proxy/index.js new file mode 100755 index 00000000..e6fac858 --- /dev/null +++ b/node_modules/http-proxy/index.js @@ -0,0 +1,13 @@ +/*! + * Caron dimonio, con occhi di bragia + * loro accennando, tutte le raccoglie; + * batte col remo qualunque s’adagia + * + * Charon the demon, with the eyes of glede, + * Beckoning to them, collects them all together, + * Beats with his oar whoever lags behind + * + * Dante - The Divine Comedy (Canto III) + */ + +module.exports = require('./lib/http-proxy'); \ No newline at end of file diff --git a/node_modules/http-proxy/lib/http-proxy.js b/node_modules/http-proxy/lib/http-proxy.js new file mode 100755 index 00000000..7dab7a48 --- /dev/null +++ b/node_modules/http-proxy/lib/http-proxy.js @@ -0,0 +1,66 @@ + // Use explicit /index.js to help browserify negociation in require '/lib/http-proxy' (!) +var ProxyServer = require('./http-proxy/index.js').Server; + + +/** + * Creates the proxy server. + * + * Examples: + * + * httpProxy.createProxyServer({ .. }, 8000) + * // => '{ web: [Function], ws: [Function] ... }' + * + * @param {Object} Options Config object passed to the proxy + * + * @return {Object} Proxy Proxy object with handlers for `ws` and `web` requests + * + * @api public + */ + + +function createProxyServer(options) { + /* + * `options` is needed and it must have the following layout: + * + * { + * target : + * forward: + * agent : + * ssl : + * ws : + * xfwd : + * secure : + * toProxy: + * prependPath: + * ignorePath: + * localAddress : + * changeOrigin: + * preserveHeaderKeyCase: + * auth : Basic authentication i.e. 'user:password' to compute an Authorization header. + * hostRewrite: rewrites the location hostname on (301/302/307/308) redirects, Default: null. + * autoRewrite: rewrites the location host/port on (301/302/307/308) redirects based on requested host/port. Default: false. + * protocolRewrite: rewrites the location protocol on (301/302/307/308) redirects to 'http' or 'https'. Default: null. + * } + * + * NOTE: `options.ws` and `options.ssl` are optional. + * `options.target and `options.forward` cannot be + * both missing + * } + */ + + return new ProxyServer(options); +} + + +ProxyServer.createProxyServer = createProxyServer; +ProxyServer.createServer = createProxyServer; +ProxyServer.createProxy = createProxyServer; + + + + +/** + * Export the proxy "Server" as the main export. + */ +module.exports = ProxyServer; + diff --git a/node_modules/http-proxy/lib/http-proxy/common.js b/node_modules/http-proxy/lib/http-proxy/common.js new file mode 100755 index 00000000..aa970023 --- /dev/null +++ b/node_modules/http-proxy/lib/http-proxy/common.js @@ -0,0 +1,249 @@ +var common = exports, + url = require('url'), + extend = require('util')._extend, + required = require('requires-port'); + +var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i, + isSSL = /^https|wss/, + cookieDomainRegex = /(;\s*domain=)([^;]+)/i; + +/** + * Simple Regex for testing if protocol is https + */ +common.isSSL = isSSL; +/** + * Copies the right headers from `options` and `req` to + * `outgoing` which is then used to fire the proxied + * request. + * + * Examples: + * + * common.setupOutgoing(outgoing, options, req) + * // => { host: ..., hostname: ...} + * + * @param {Object} Outgoing Base object to be filled with required properties + * @param {Object} Options Config object passed to the proxy + * @param {ClientRequest} Req Request Object + * @param {String} Forward String to select forward or target + *  + * @return {Object} Outgoing Object with all required properties set + * + * @api private + */ + +common.setupOutgoing = function(outgoing, options, req, forward) { + outgoing.port = options[forward || 'target'].port || + (isSSL.test(options[forward || 'target'].protocol) ? 443 : 80); + + ['host', 'hostname', 'socketPath', 'pfx', 'key', + 'passphrase', 'cert', 'ca', 'ciphers', 'secureProtocol'].forEach( + function(e) { outgoing[e] = options[forward || 'target'][e]; } + ); + + outgoing.method = req.method; + outgoing.headers = extend({}, req.headers); + + if (options.headers){ + extend(outgoing.headers, options.headers); + } + + if (options.auth) { + outgoing.auth = options.auth; + } + + if (options.ca) { + outgoing.ca = options.ca; + } + + if (isSSL.test(options[forward || 'target'].protocol)) { + outgoing.rejectUnauthorized = (typeof options.secure === "undefined") ? true : options.secure; + } + + + outgoing.agent = options.agent || false; + outgoing.localAddress = options.localAddress; + + // + // Remark: If we are false and not upgrading, set the connection: close. This is the right thing to do + // as node core doesn't handle this COMPLETELY properly yet. + // + if (!outgoing.agent) { + outgoing.headers = outgoing.headers || {}; + if (typeof outgoing.headers.connection !== 'string' + || !upgradeHeader.test(outgoing.headers.connection) + ) { outgoing.headers.connection = 'close'; } + } + + + // the final path is target path + relative path requested by user: + var target = options[forward || 'target']; + var targetPath = target && options.prependPath !== false + ? (target.path || '') + : ''; + + // + // Remark: Can we somehow not use url.parse as a perf optimization? + // + var outgoingPath = !options.toProxy + ? (url.parse(req.url).path || '') + : req.url; + + // + // Remark: ignorePath will just straight up ignore whatever the request's + // path is. This can be labeled as FOOT-GUN material if you do not know what + // you are doing and are using conflicting options. + // + outgoingPath = !options.ignorePath ? outgoingPath : ''; + + outgoing.path = common.urlJoin(targetPath, outgoingPath); + + if (options.changeOrigin) { + outgoing.headers.host = + required(outgoing.port, options[forward || 'target'].protocol) && !hasPort(outgoing.host) + ? outgoing.host + ':' + outgoing.port + : outgoing.host; + } + return outgoing; +}; + +/** + * Set the proper configuration for sockets, + * set no delay and set keep alive, also set + * the timeout to 0. + * + * Examples: + * + * common.setupSocket(socket) + * // => Socket + * + * @param {Socket} Socket instance to setup + *  + * @return {Socket} Return the configured socket. + * + * @api private + */ + +common.setupSocket = function(socket) { + socket.setTimeout(0); + socket.setNoDelay(true); + + socket.setKeepAlive(true, 0); + + return socket; +}; + +/** + * Get the port number from the host. Or guess it based on the connection type. + * + * @param {Request} req Incoming HTTP request. + * + * @return {String} The port number. + * + * @api private + */ +common.getPort = function(req) { + var res = req.headers.host ? req.headers.host.match(/:(\d+)/) : ''; + + return res ? + res[1] : + common.hasEncryptedConnection(req) ? '443' : '80'; +}; + +/** + * Check if the request has an encrypted connection. + * + * @param {Request} req Incoming HTTP request. + * + * @return {Boolean} Whether the connection is encrypted or not. + * + * @api private + */ +common.hasEncryptedConnection = function(req) { + return Boolean(req.connection.encrypted || req.connection.pair); +}; + +/** + * OS-agnostic join (doesn't break on URLs like path.join does on Windows)> + * + * @return {String} The generated path. + * + * @api private + */ + +common.urlJoin = function() { + // + // We do not want to mess with the query string. All we want to touch is the path. + // + var args = Array.prototype.slice.call(arguments), + lastIndex = args.length - 1, + last = args[lastIndex], + lastSegs = last.split('?'), + retSegs; + + args[lastIndex] = lastSegs.shift(); + + // + // Join all strings, but remove empty strings so we don't get extra slashes from + // joining e.g. ['', 'am'] + // + retSegs = [ + args.filter(Boolean).join('/') + .replace(/\/+/g, '/') + .replace('http:/', 'http://') + .replace('https:/', 'https://') + ]; + + // Only join the query string if it exists so we don't have trailing a '?' + // on every request + + // Handle case where there could be multiple ? in the URL. + retSegs.push.apply(retSegs, lastSegs); + + return retSegs.join('?') +}; + +/** + * Rewrites or removes the domain of a cookie header + * + * @param {String|Array} Header + * @param {Object} Config, mapping of domain to rewritten domain. + * '*' key to match any domain, null value to remove the domain. + * + * @api private + */ +common.rewriteCookieDomain = function rewriteCookieDomain(header, config) { + if (Array.isArray(header)) { + return header.map(function (headerElement) { + return rewriteCookieDomain(headerElement, config); + }); + } + return header.replace(cookieDomainRegex, function(match, prefix, previousDomain) { + var newDomain; + if (previousDomain in config) { + newDomain = config[previousDomain]; + } else if ('*' in config) { + newDomain = config['*']; + } else { + //no match, return previous domain + return match; + } + if (newDomain) { + //replace domain + return prefix + newDomain; + } else { + //remove domain + return ''; + } + }); +}; + +/** + * Check the host and see if it potentially has a port in it (keep it simple) + * + * @returns {Boolean} Whether we have one or not + * + * @api private + */ +function hasPort(host) { + return !!~host.indexOf(':'); +}; diff --git a/node_modules/http-proxy/lib/http-proxy/index.js b/node_modules/http-proxy/lib/http-proxy/index.js new file mode 100755 index 00000000..caaa10bd --- /dev/null +++ b/node_modules/http-proxy/lib/http-proxy/index.js @@ -0,0 +1,184 @@ +var httpProxy = module.exports, + extend = require('util')._extend, + parse_url = require('url').parse, + EE3 = require('eventemitter3'), + http = require('http'), + https = require('https'), + web = require('./passes/web-incoming'), + ws = require('./passes/ws-incoming'); + +httpProxy.Server = ProxyServer; + +/** + * Returns a function that creates the loader for + * either `ws` or `web`'s passes. + * + * Examples: + * + * httpProxy.createRightProxy('ws') + * // => [Function] + * + * @param {String} Type Either 'ws' or 'web' + *  + * @return {Function} Loader Function that when called returns an iterator for the right passes + * + * @api private + */ + +function createRightProxy(type) { + + return function(options) { + return function(req, res /*, [head], [opts] */) { + var passes = (type === 'ws') ? this.wsPasses : this.webPasses, + args = [].slice.call(arguments), + cntr = args.length - 1, + head, cbl; + + /* optional args parse begin */ + if(typeof args[cntr] === 'function') { + cbl = args[cntr]; + + cntr--; + } + + if( + !(args[cntr] instanceof Buffer) && + args[cntr] !== res + ) { + //Copy global options + options = extend({}, options); + //Overwrite with request options + extend(options, args[cntr]); + + cntr--; + } + + if(args[cntr] instanceof Buffer) { + head = args[cntr]; + } + + /* optional args parse end */ + + ['target', 'forward'].forEach(function(e) { + if (typeof options[e] === 'string') + options[e] = parse_url(options[e]); + }); + + if (!options.target && !options.forward) { + return this.emit('error', new Error('Must provide a proper URL as target')); + } + + for(var i=0; i < passes.length; i++) { + /** + * Call of passes functions + * pass(req, res, options, head) + * + * In WebSockets case the `res` variable + * refer to the connection socket + * pass(req, socket, options, head) + */ + if(passes[i](req, res, options, head, this, cbl)) { // passes can return a truthy value to halt the loop + break; + } + } + }; + }; +} +httpProxy.createRightProxy = createRightProxy; + +function ProxyServer(options) { + EE3.call(this); + + options = options || {}; + options.prependPath = options.prependPath === false ? false : true; + + this.web = this.proxyRequest = createRightProxy('web')(options); + this.ws = this.proxyWebsocketRequest = createRightProxy('ws')(options); + this.options = options; + + this.webPasses = Object.keys(web).map(function(pass) { + return web[pass]; + }); + + this.wsPasses = Object.keys(ws).map(function(pass) { + return ws[pass]; + }); + + this.on('error', this.onError, this); + +} + +require('util').inherits(ProxyServer, EE3); + +ProxyServer.prototype.onError = function (err) { + // + // Remark: Replicate node core behavior using EE3 + // so we force people to handle their own errors + // + if(this.listeners('error').length === 1) { + throw err; + } +}; + +ProxyServer.prototype.listen = function(port, hostname) { + var self = this, + closure = function(req, res) { self.web(req, res); }; + + this._server = this.options.ssl ? + https.createServer(this.options.ssl, closure) : + http.createServer(closure); + + if(this.options.ws) { + this._server.on('upgrade', function(req, socket, head) { self.ws(req, socket, head); }); + } + + this._server.listen(port, hostname); + + return this; +}; + +ProxyServer.prototype.close = function(callback) { + var self = this; + if (this._server) { + this._server.close(done); + } + + // Wrap callback to nullify server after all open connections are closed. + function done() { + self._server = null; + if (callback) { + callback.apply(null, arguments); + } + }; +}; + +ProxyServer.prototype.before = function(type, passName, callback) { + if (type !== 'ws' && type !== 'web') { + throw new Error('type must be `web` or `ws`'); + } + var passes = (type === 'ws') ? this.wsPasses : this.webPasses, + i = false; + + passes.forEach(function(v, idx) { + if(v.name === passName) i = idx; + }) + + if(i === false) throw new Error('No such pass'); + + passes.splice(i, 0, callback); +}; +ProxyServer.prototype.after = function(type, passName, callback) { + if (type !== 'ws' && type !== 'web') { + throw new Error('type must be `web` or `ws`'); + } + var passes = (type === 'ws') ? this.wsPasses : this.webPasses, + i = false; + + passes.forEach(function(v, idx) { + if(v.name === passName) i = idx; + }) + + if(i === false) throw new Error('No such pass'); + + passes.splice(i++, 0, callback); +}; diff --git a/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js b/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js new file mode 100755 index 00000000..5cb0b03d --- /dev/null +++ b/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js @@ -0,0 +1,180 @@ +var http = require('http'), + https = require('https'), + web_o = require('./web-outgoing'), + common = require('../common'); + +web_o = Object.keys(web_o).map(function(pass) { + return web_o[pass]; +}); + +/*! + * Array of passes. + * + * A `pass` is just a function that is executed on `req, res, options` + * so that you can easily add new checks while still keeping the base + * flexible. + */ + + +module.exports = { + + /** + * Sets `content-length` to '0' if request is of DELETE type. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + deleteLength: function deleteLength(req, res, options) { + if((req.method === 'DELETE' || req.method === 'OPTIONS') + && !req.headers['content-length']) { + req.headers['content-length'] = '0'; + delete req.headers['transfer-encoding']; + } + }, + + /** + * Sets timeout in request socket if it was specified in options. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + timeout: function timeout(req, res, options) { + if(options.timeout) { + req.socket.setTimeout(options.timeout); + } + }, + + /** + * Sets `x-forwarded-*` headers if specified in config. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + XHeaders: function XHeaders(req, res, options) { + if(!options.xfwd) return; + + var encrypted = req.isSpdy || common.hasEncryptedConnection(req); + var values = { + for : req.connection.remoteAddress || req.socket.remoteAddress, + port : common.getPort(req), + proto: encrypted ? 'https' : 'http' + }; + + ['for', 'port', 'proto'].forEach(function(header) { + req.headers['x-forwarded-' + header] = + (req.headers['x-forwarded-' + header] || '') + + (req.headers['x-forwarded-' + header] ? ',' : '') + + values[header]; + }); + + req.headers['x-forwarded-host'] = req.headers['host'] || ''; + }, + + /** + * Does the actual proxying. If `forward` is enabled fires up + * a ForwardStream, same happens for ProxyStream. The request + * just dies otherwise. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + stream: function stream(req, res, options, _, server, clb) { + + // And we begin! + server.emit('start', req, res, options.target || options.forward); + + if(options.forward) { + // If forward enable, so just pipe the request + var forwardReq = (options.forward.protocol === 'https:' ? https : http).request( + common.setupOutgoing(options.ssl || {}, options, req, 'forward') + ); + + // error handler (e.g. ECONNRESET, ECONNREFUSED) + // Handle errors on incoming request as well as it makes sense to + var forwardError = createErrorHandler(forwardReq, options.forward); + req.on('error', forwardError); + forwardReq.on('error', forwardError); + + (options.buffer || req).pipe(forwardReq); + if(!options.target) { return res.end(); } + } + + // Request initalization + var proxyReq = (options.target.protocol === 'https:' ? https : http).request( + common.setupOutgoing(options.ssl || {}, options, req) + ); + + // Enable developers to modify the proxyReq before headers are sent + proxyReq.on('socket', function(socket) { + if(server) { server.emit('proxyReq', proxyReq, req, res, options); } + }); + + // allow outgoing socket to timeout so that we could + // show an error page at the initial request + if(options.proxyTimeout) { + proxyReq.setTimeout(options.proxyTimeout, function() { + proxyReq.abort(); + }); + } + + // Ensure we abort proxy if request is aborted + req.on('aborted', function () { + proxyReq.abort(); + }); + + // handle errors in proxy and incoming request, just like for forward proxy + var proxyError = createErrorHandler(proxyReq, options.target); + req.on('error', proxyError); + proxyReq.on('error', proxyError); + + function createErrorHandler(proxyReq, url) { + return function proxyError(err) { + if (req.socket.destroyed && err.code === 'ECONNRESET') { + server.emit('econnreset', err, req, res, url); + return proxyReq.abort(); + } + + if (clb) { + clb(err, req, res, url); + } else { + server.emit('error', err, req, res, url); + } + } + } + + (options.buffer || req).pipe(proxyReq); + + proxyReq.on('response', function(proxyRes) { + if(server) { server.emit('proxyRes', proxyRes, req, res); } + for(var i=0; i < web_o.length; i++) { + if(web_o[i](req, res, proxyRes, options)) { break; } + } + + // Allow us to listen when the proxy has completed + proxyRes.on('end', function () { + server.emit('end', req, res, proxyRes); + }); + + proxyRes.pipe(res); + }); + + //proxyReq.end(); + } + +}; diff --git a/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js b/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js new file mode 100755 index 00000000..cff86a70 --- /dev/null +++ b/node_modules/http-proxy/lib/http-proxy/passes/web-outgoing.js @@ -0,0 +1,138 @@ +var url = require('url'), + common = require('../common'); + + +var redirectRegex = /^201|30(1|2|7|8)$/; + +/*! + * Array of passes. + * + * A `pass` is just a function that is executed on `req, res, options` + * so that you can easily add new checks while still keeping the base + * flexible. + */ + +module.exports = { // <-- + + /** + * If is a HTTP 1.0 request, remove chunk headers + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * + * @api private + */ + removeChunked: function removeChunked(req, res, proxyRes) { + if (req.httpVersion === '1.0') { + delete proxyRes.headers['transfer-encoding']; + } + }, + + /** + * If is a HTTP 1.0 request, set the correct connection header + * or if connection header not present, then use `keep-alive` + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * + * @api private + */ + setConnection: function setConnection(req, res, proxyRes) { + if (req.httpVersion === '1.0') { + proxyRes.headers.connection = req.headers.connection || 'close'; + } else if (req.httpVersion !== '2.0' && !proxyRes.headers.connection) { + proxyRes.headers.connection = req.headers.connection || 'keep-alive'; + } + }, + + setRedirectHostRewrite: function setRedirectHostRewrite(req, res, proxyRes, options) { + if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) + && proxyRes.headers['location'] + && redirectRegex.test(proxyRes.statusCode)) { + var target = url.parse(options.target); + var u = url.parse(proxyRes.headers['location']); + + // make sure the redirected host matches the target host before rewriting + if (target.host != u.host) { + return; + } + + if (options.hostRewrite) { + u.host = options.hostRewrite; + } else if (options.autoRewrite) { + u.host = req.headers['host']; + } + if (options.protocolRewrite) { + u.protocol = options.protocolRewrite; + } + + proxyRes.headers['location'] = u.format(); + } + }, + /** + * Copy headers from proxyResponse to response + * set each header in response object. + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * @param {Object} Options options.cookieDomainRewrite: Config to rewrite cookie domain + * + * @api private + */ + writeHeaders: function writeHeaders(req, res, proxyRes, options) { + var rewriteCookieDomainConfig = options.cookieDomainRewrite, + preserveHeaderKeyCase = options.preserveHeaderKeyCase, + rawHeaderKeyMap, + setHeader = function(key, header) { + if (header == undefined) return; + if (rewriteCookieDomainConfig && key.toLowerCase() === 'set-cookie') { + header = common.rewriteCookieDomain(header, rewriteCookieDomainConfig); + } + res.setHeader(String(key).trim(), header); + }; + + if (typeof rewriteCookieDomainConfig === 'string') { //also test for '' + rewriteCookieDomainConfig = { '*': rewriteCookieDomainConfig }; + } + + // message.rawHeaders is added in: v0.11.6 + // https://nodejs.org/api/http.html#http_message_rawheaders + if (preserveHeaderKeyCase && proxyRes.rawHeaders != undefined) { + rawHeaderKeyMap = {}; + for (var i = 0; i < proxyRes.rawHeaders.length; i += 2) { + var key = proxyRes.rawHeaders[i]; + rawHeaderKeyMap[key.toLowerCase()] = key; + } + } + + Object.keys(proxyRes.headers).forEach(function(key) { + var header = proxyRes.headers[key]; + if (preserveHeaderKeyCase && rawHeaderKeyMap) { + key = rawHeaderKeyMap[key] || key; + } + setHeader(key, header); + }); + }, + + /** + * Set the statusCode from the proxyResponse + * + * @param {ClientRequest} Req Request object + * @param {IncomingMessage} Res Response object + * @param {proxyResponse} Res Response object from the proxy request + * + * @api private + */ + writeStatusCode: function writeStatusCode(req, res, proxyRes) { + // From Node.js docs: response.writeHead(statusCode[, statusMessage][, headers]) + if(proxyRes.statusMessage) { + res.writeHead(proxyRes.statusCode, proxyRes.statusMessage); + } else { + res.writeHead(proxyRes.statusCode); + } + } + +}; diff --git a/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js b/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js new file mode 100755 index 00000000..cf3796cd --- /dev/null +++ b/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js @@ -0,0 +1,156 @@ +var http = require('http'), + https = require('https'), + common = require('../common'); + +/*! + * Array of passes. + * + * A `pass` is just a function that is executed on `req, socket, options` + * so that you can easily add new checks while still keeping the base + * flexible. + */ + +/* + * Websockets Passes + * + */ + + +module.exports = { + /** + * WebSocket requests must have the `GET` method and + * the `upgrade:websocket` header + * + * @param {ClientRequest} Req Request object + * @param {Socket} Websocket + * + * @api private + */ + + checkMethodAndHeader : function checkMethodAndHeader(req, socket) { + if (req.method !== 'GET' || !req.headers.upgrade) { + socket.destroy(); + return true; + } + + if (req.headers.upgrade.toLowerCase() !== 'websocket') { + socket.destroy(); + return true; + } + }, + + /** + * Sets `x-forwarded-*` headers if specified in config. + * + * @param {ClientRequest} Req Request object + * @param {Socket} Websocket + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + + XHeaders : function XHeaders(req, socket, options) { + if(!options.xfwd) return; + + var values = { + for : req.connection.remoteAddress || req.socket.remoteAddress, + port : common.getPort(req), + proto: common.hasEncryptedConnection(req) ? 'wss' : 'ws' + }; + + ['for', 'port', 'proto'].forEach(function(header) { + req.headers['x-forwarded-' + header] = + (req.headers['x-forwarded-' + header] || '') + + (req.headers['x-forwarded-' + header] ? ',' : '') + + values[header]; + }); + }, + + /** + * Does the actual proxying. Make the request and upgrade it + * send the Switching Protocols request and pipe the sockets. + * + * @param {ClientRequest} Req Request object + * @param {Socket} Websocket + * @param {Object} Options Config object passed to the proxy + * + * @api private + */ + stream : function stream(req, socket, options, head, server, clb) { + common.setupSocket(socket); + + if (head && head.length) socket.unshift(head); + + + var proxyReq = (common.isSSL.test(options.target.protocol) ? https : http).request( + common.setupOutgoing(options.ssl || {}, options, req) + ); + + // Enable developers to modify the proxyReq before headers are sent + if (server) { server.emit('proxyReqWs', proxyReq, req, socket, options, head); } + + // Error Handler + proxyReq.on('error', onOutgoingError); + proxyReq.on('response', function (res) { + // if upgrade event isn't going to happen, close the socket + if (!res.upgrade) socket.end(); + }); + + proxyReq.on('upgrade', function(proxyRes, proxySocket, proxyHead) { + proxySocket.on('error', onOutgoingError); + + // Allow us to listen when the websocket has completed + proxySocket.on('end', function () { + server.emit('close', proxyRes, proxySocket, proxyHead); + }); + + // The pipe below will end proxySocket if socket closes cleanly, but not + // if it errors (eg, vanishes from the net and starts returning + // EHOSTUNREACH). We need to do that explicitly. + socket.on('error', function () { + proxySocket.end(); + }); + + common.setupSocket(proxySocket); + + if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead); + + // + // Remark: Handle writing the headers to the socket when switching protocols + // Also handles when a header is an array + // + socket.write( + Object.keys(proxyRes.headers).reduce(function (head, key) { + var value = proxyRes.headers[key]; + + if (!Array.isArray(value)) { + head.push(key + ': ' + value); + return head; + } + + for (var i = 0; i < value.length; i++) { + head.push(key + ': ' + value[i]); + } + return head; + }, ['HTTP/1.1 101 Switching Protocols']) + .join('\r\n') + '\r\n\r\n' + ); + + proxySocket.pipe(socket).pipe(proxySocket); + + server.emit('open', proxySocket); + server.emit('proxySocket', proxySocket); //DEPRECATED. + }); + + return proxyReq.end(); // XXX: CHECK IF THIS IS THIS CORRECT + + function onOutgoingError(err) { + if (clb) { + clb(err, req, socket); + } else { + server.emit('error', err, req, socket); + } + socket.end(); + } + } +}; diff --git a/node_modules/http-proxy/package.json b/node_modules/http-proxy/package.json new file mode 100755 index 00000000..eea47150 --- /dev/null +++ b/node_modules/http-proxy/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "http-proxy@^1.16.2", + "scope": null, + "escapedName": "http-proxy", + "name": "http-proxy", + "rawSpec": "^1.16.2", + "spec": ">=1.16.2 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy-middleware" + ] + ], + "_from": "http-proxy@>=1.16.2 <2.0.0", + "_id": "http-proxy@1.16.2", + "_inCache": true, + "_location": "/http-proxy", + "_nodeVersion": "6.9.1", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/http-proxy-1.16.2.tgz_1481039349196_0.5866330966819078" + }, + "_npmUser": { + "name": "jcrugzz", + "email": "jcrugzz@gmail.com" + }, + "_npmVersion": "3.10.8", + "_phantomChildren": {}, + "_requested": { + "raw": "http-proxy@^1.16.2", + "scope": null, + "escapedName": "http-proxy", + "name": "http-proxy", + "rawSpec": "^1.16.2", + "spec": ">=1.16.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/http-proxy-middleware" + ], + "_resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", + "_shasum": "06dff292952bf64dbe8471fa9df73066d4f37742", + "_shrinkwrap": null, + "_spec": "http-proxy@^1.16.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/http-proxy-middleware", + "author": { + "name": "Charlie Robbins", + "email": "charlie.robbins@gmail.com" + }, + "bugs": { + "url": "https://github.com/nodejitsu/node-http-proxy/issues" + }, + "dependencies": { + "eventemitter3": "1.x.x", + "requires-port": "1.x.x" + }, + "description": "HTTP proxying for the masses", + "devDependencies": { + "async": "*", + "blanket": "*", + "coveralls": "*", + "dox": "*", + "expect.js": "*", + "mocha": "*", + "mocha-lcov-reporter": "*", + "semver": "^5.0.3", + "socket.io": "*", + "socket.io-client": "*", + "sse": "0.0.6", + "ws": "^0.8.0" + }, + "directories": {}, + "dist": { + "shasum": "06dff292952bf64dbe8471fa9df73066d4f37742", + "tarball": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "gitHead": "c1fb596b856df971d291585ccf105233f7deca51", + "homepage": "https://github.com/nodejitsu/node-http-proxy#readme", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "indexzero", + "email": "charlie.robbins@gmail.com" + }, + { + "name": "cronopio", + "email": "aristizabal.daniel@gmail.com" + }, + { + "name": "yawnt", + "email": "yawn.localhost@gmail.com" + }, + { + "name": "jcrugzz", + "email": "jcrugzz@gmail.com" + } + ], + "name": "http-proxy", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/nodejitsu/node-http-proxy.git" + }, + "scripts": { + "coveralls": "mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js", + "test": "mocha test/*-test.js", + "test-cov": "mocha --require blanket -R html-cov > cov/coverage.html" + }, + "version": "1.16.2" +} diff --git a/node_modules/https-browserify/LICENSE b/node_modules/https-browserify/LICENSE new file mode 100755 index 00000000..ee27ba4b --- /dev/null +++ b/node_modules/https-browserify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/https-browserify/index.js b/node_modules/https-browserify/index.js new file mode 100755 index 00000000..85355325 --- /dev/null +++ b/node_modules/https-browserify/index.js @@ -0,0 +1,14 @@ +var http = require('http'); + +var https = module.exports; + +for (var key in http) { + if (http.hasOwnProperty(key)) https[key] = http[key]; +}; + +https.request = function (params, cb) { + if (!params) params = {}; + params.scheme = 'https'; + params.protocol = 'https:'; + return http.request.call(this, params, cb); +} diff --git a/node_modules/https-browserify/package.json b/node_modules/https-browserify/package.json new file mode 100755 index 00000000..43111116 --- /dev/null +++ b/node_modules/https-browserify/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + { + "raw": "https-browserify@0.0.1", + "scope": null, + "escapedName": "https-browserify", + "name": "https-browserify", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "https-browserify@0.0.1", + "_id": "https-browserify@0.0.1", + "_inCache": true, + "_location": "/https-browserify", + "_nodeVersion": "1.8.4", + "_npmUser": { + "name": "feross", + "email": "feross@feross.org" + }, + "_npmVersion": "2.9.0", + "_phantomChildren": {}, + "_requested": { + "raw": "https-browserify@0.0.1", + "scope": null, + "escapedName": "https-browserify", + "name": "https-browserify", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "_shasum": "3f91365cabe60b77ed0ebba24b454e3e09d95a82", + "_shrinkwrap": null, + "_spec": "https-browserify@0.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/https-browserify/issues" + }, + "dependencies": {}, + "description": "https module compatability for browserify", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "3f91365cabe60b77ed0ebba24b454e3e09d95a82", + "tarball": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz" + }, + "gitHead": "7ce43143cc6dd3e5576a977fd49d7e25f35bfdb8", + "homepage": "https://github.com/substack/https-browserify", + "keywords": [ + "https", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "feross", + "email": "feross@feross.org" + }, + { + "name": "ptarjan", + "email": "npm@paulisageek.com" + }, + { + "name": "substack", + "email": "substack@gmail.com" + } + ], + "name": "https-browserify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/https-browserify.git" + }, + "scripts": {}, + "version": "0.0.1" +} diff --git a/node_modules/https-browserify/readme.markdown b/node_modules/https-browserify/readme.markdown new file mode 100755 index 00000000..8638614f --- /dev/null +++ b/node_modules/https-browserify/readme.markdown @@ -0,0 +1,22 @@ +# https-browserify + +https module compatability for browserify + +# example + +``` js +var https = require('https-browserify'); +var r = https.request('https://github.com'); +r.on('request', function (res) { + console.log(res); +}); +``` + +# methods + +The API is the same as the client portion of the +[node core https module](http://nodejs.org/docs/latest/api/https.html). + +# license + +MIT diff --git a/node_modules/i/.npmignore b/node_modules/i/.npmignore new file mode 100755 index 00000000..435e4bbb --- /dev/null +++ b/node_modules/i/.npmignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log +*.swp diff --git a/node_modules/i/.travis.yml b/node_modules/i/.travis.yml new file mode 100755 index 00000000..2f1969ed --- /dev/null +++ b/node_modules/i/.travis.yml @@ -0,0 +1,14 @@ +sudo: false +language: node_js +node_js: + - '5' + - '4' + - '3' + - '2' + - '1' + - '0.12' + - '0.10' + - '0.8' +notifications: + email: + on_success: never diff --git a/node_modules/i/LICENSE b/node_modules/i/LICENSE new file mode 100755 index 00000000..c9b44cb8 --- /dev/null +++ b/node_modules/i/LICENSE @@ -0,0 +1,18 @@ +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/i/README.md b/node_modules/i/README.md new file mode 100755 index 00000000..37ca2093 --- /dev/null +++ b/node_modules/i/README.md @@ -0,0 +1,176 @@ +# inflect + +customizable inflections for nodejs + +**NOTE: 0.3.2 was accidentally unpublished from the server and npm doesn't allow me to publish it back. Please upgrade to 0.3.3** + +## Installation + +```bash +npm install i +``` + +## Usage + +Require the module before using + +```js +var inflect = require('i')(); +``` + +All the below api functions can be called directly on a string + +```js +inflect.titleize('messages to store') // === 'Messages To Store' +'messages to store'.titleize // === 'Messages To Store' +``` + +only if `true` is passed while initiating + +```js +var inflect = require('i')(true); +``` + +### Pluralize + +```js +inflect.pluralize('person'); // === 'people' +inflect.pluralize('octopus'); // === 'octopi' +inflect.pluralize('Hat'); // === 'Hats' +``` + +### Singularize + +```js +inflect.singularize('people'); // === 'person' +inflect.singularize('octopi'); // === 'octopus' +inflect.singularize('Hats'); // === 'Hat' +``` + +### Camelize + +```js +inflect.camelize('message_properties'); // === 'MessageProperties' +inflect.camelize('message_properties', false); // === 'messageProperties' +``` + +### Underscore + +```js +inflect.underscore('MessageProperties'); // === 'message_properties' +inflect.underscore('messageProperties'); // === 'message_properties' +``` + +### Humanize + +```js +inflect.humanize('message_id'); // === 'Message' +``` + +### Dasherize + +```js +inflect.dasherize('message_properties'); // === 'message-properties' +inflect.dasherize('Message Properties'); // === 'Message Properties' +``` + +### Titleize + +```js +inflect.titleize('message_properties'); // === 'Message Properties' +inflect.titleize('message properties to keep'); // === 'Message Properties to Keep' +``` + +### Demodulize + +```js +inflect.demodulize('Message.Bus.Properties'); // === 'Properties' +``` + +### Tableize + +```js +inflect.tableize('MessageBusProperty'); // === 'message_bus_properties' +``` + +### Classify + +```js +inflect.classify('message_bus_properties'); // === 'MessageBusProperty' +``` + +### Foreign key + +```js +inflect.foreign_key('MessageBusProperty'); // === 'message_bus_property_id' +inflect.foreign_key('MessageBusProperty', false); // === 'message_bus_propertyid' +``` + +### Ordinalize + +```js +inflect.ordinalize( '1' ); // === '1st' +``` + +## Custom rules for inflection + +### Custom plural + +We can use regexp in any of these custom rules + +```js +inflect.inflections.plural('person', 'guys'); +inflect.pluralize('person'); // === 'guys' +inflect.singularize('guys'); // === 'guy' +``` + +### Custom singular + +```js +inflect.inflections.singular('guys', 'person') +inflect.singularize('guys'); // === 'person' +inflect.pluralize('person'); // === 'people' +``` + +### Custom irregular + +```js +inflect.inflections.irregular('person', 'guys') +inflect.pluralize('person'); // === 'guys' +inflect.singularize('guys'); // === 'person' +``` + +### Custom human + +```js +inflect.inflections.human(/^(.*)_cnt$/i, '$1_count'); +inflect.inflections.humanize('jargon_cnt'); // === 'Jargon count' +``` + +### Custom uncountable + +```js +inflect.inflections.uncountable('oil') +inflect.pluralize('oil'); // === 'oil' +inflect.singularize('oil'); // === 'oil' +``` + +## Contributors +Here is a list of [Contributors](http://github.com/pksunkara/inflect/contributors) + +### TODO + +- More obscure test cases + +__I accept pull requests and guarantee a reply back within a day__ + +## License +MIT/X11 + +## Bug Reports +Report [here](http://github.com/pksunkara/inflect/issues). __Guaranteed reply within a day__. + +## Contact +Pavan Kumar Sunkara (pavan.sss1991@gmail.com) + +Follow me on [github](https://github.com/users/follow?target=pksunkara), [twitter](http://twitter.com/pksunkara) diff --git a/node_modules/i/lib/defaults.js b/node_modules/i/lib/defaults.js new file mode 100755 index 00000000..05bdaf29 --- /dev/null +++ b/node_modules/i/lib/defaults.js @@ -0,0 +1,68 @@ +// Default inflections +module.exports = function (inflect) { + + inflect.plural(/$/, 's'); + inflect.plural(/s$/i, 's'); + inflect.plural(/(ax|test)is$/i, '$1es'); + inflect.plural(/(octop|vir)us$/i, '$1i'); + inflect.plural(/(octop|vir)i$/i, '$1i'); + inflect.plural(/(alias|status)$/i, '$1es'); + inflect.plural(/(bu)s$/i, '$1ses'); + inflect.plural(/(buffal|tomat)o$/i, '$1oes'); + inflect.plural(/([ti])um$/i, '$1a'); + inflect.plural(/([ti])a$/i, '$1a'); + inflect.plural(/sis$/i, 'ses'); + inflect.plural(/(?:([^fa])fe|(?:(oa)f)|([lr])f)$/i, '$1ves'); + inflect.plural(/(hive)$/i, '$1s'); + inflect.plural(/([^aeiouy]|qu)y$/i, '$1ies'); + inflect.plural(/(x|ch|ss|sh)$/i, '$1es'); + inflect.plural(/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'); + inflect.plural(/([m|l])ouse$/i, '$1ice'); + inflect.plural(/([m|l])ice$/i, '$1ice'); + inflect.plural(/^(ox)$/i, '$1en'); + inflect.plural(/^(oxen)$/i, '$1'); + inflect.plural(/(quiz)$/i, '$1zes'); + + inflect.singular(/s$/i, ''); + inflect.singular(/(n)ews$/i, '$1ews'); + inflect.singular(/([ti])a$/i, '$1um'); + inflect.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '$1sis'); + inflect.singular(/(^analy)ses$/i, '$1sis'); + inflect.singular(/([^f])ves$/i, '$1fe'); + inflect.singular(/(hive)s$/i, '$1'); + inflect.singular(/(tive)s$/i, '$1'); + inflect.singular(/(oave)s$/i, 'oaf'); + inflect.singular(/([lr])ves$/i, '$1f'); + inflect.singular(/([^aeiouy]|qu)ies$/i, '$1y'); + inflect.singular(/(s)eries$/i, '$1eries'); + inflect.singular(/(m)ovies$/i, '$1ovie'); + inflect.singular(/(x|ch|ss|sh)es$/i, '$1'); + inflect.singular(/([m|l])ice$/i, '$1ouse'); + inflect.singular(/(bus)es$/i, '$1'); + inflect.singular(/(o)es$/i, '$1'); + inflect.singular(/(shoe)s$/i, '$1'); + inflect.singular(/(cris|ax|test)es$/i, '$1is'); + inflect.singular(/(octop|vir)i$/i, '$1us'); + inflect.singular(/(alias|status)es$/i, '$1'); + inflect.singular(/^(ox)en/i, '$1'); + inflect.singular(/(vert|ind)ices$/i, '$1ex'); + inflect.singular(/(matr)ices$/i, '$1ix'); + inflect.singular(/(quiz)zes$/i, '$1'); + inflect.singular(/(database)s$/i, '$1'); + + inflect.irregular('child', 'children'); + inflect.irregular('person', 'people'); + inflect.irregular('man', 'men'); + inflect.irregular('child', 'children'); + inflect.irregular('sex', 'sexes'); + inflect.irregular('move', 'moves'); + inflect.irregular('cow', 'kine'); + inflect.irregular('zombie', 'zombies'); + inflect.irregular('oaf', 'oafs', true); + inflect.irregular('jefe', 'jefes'); + inflect.irregular('save', 'saves'); + inflect.irregular('safe', 'safes'); + inflect.irregular('fife', 'fifes'); + + inflect.uncountable(['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'jeans', 'sushi']); +} diff --git a/node_modules/i/lib/inflect.js b/node_modules/i/lib/inflect.js new file mode 100755 index 00000000..5e0cc704 --- /dev/null +++ b/node_modules/i/lib/inflect.js @@ -0,0 +1,11 @@ +// Requiring modules + +module.exports = function (attach) { + var methods = require('./methods'); + + if (attach) { + require('./native')(methods); + } + + return methods +}; diff --git a/node_modules/i/lib/inflections.js b/node_modules/i/lib/inflections.js new file mode 100755 index 00000000..1972551f --- /dev/null +++ b/node_modules/i/lib/inflections.js @@ -0,0 +1,120 @@ +// A singleton instance of this class is yielded by Inflector.inflections, which can then be used to specify additional +// inflection rules. Examples: +// +// BulletSupport.Inflector.inflect ($) -> +// $.plural /^(ox)$/i, '$1en' +// $.singular /^(ox)en/i, '$1' +// +// $.irregular 'octopus', 'octopi' +// +// $.uncountable "equipment" +// +// New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the +// pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may +// already have been loaded. + +var util = require('./util'); + +var Inflections = function () { + this.plurals = []; + this.singulars = []; + this.uncountables = []; + this.humans = []; + require('./defaults')(this); + return this; +}; + +// Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression. +// The replacement should always be a string that may include references to the matched data from the rule. +Inflections.prototype.plural = function (rule, replacement) { + if (typeof rule == 'string') { + this.uncountables = util.array.del(this.uncountables, rule); + } + this.uncountables = util.array.del(this.uncountables, replacement); + this.plurals.unshift([rule, replacement]); +}; + +// Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression. +// The replacement should always be a string that may include references to the matched data from the rule. +Inflections.prototype.singular = function (rule, replacement) { + if (typeof rule == 'string') { + this.uncountables = util.array.del(this.uncountables, rule); + } + this.uncountables = util.array.del(this.uncountables, replacement); + this.singulars.unshift([rule, replacement]); +}; + +// Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used +// for strings, not regular expressions. You simply pass the irregular in singular and plural form. +// +// irregular 'octopus', 'octopi' +// irregular 'person', 'people' +Inflections.prototype.irregular = function (singular, plural, fullMatchRequired) { + this.uncountables = util.array.del(this.uncountables, singular); + this.uncountables = util.array.del(this.uncountables, plural); + var prefix = ""; + if (fullMatchRequired) { + prefix = "^"; + } + if (singular[0].toUpperCase() == plural[0].toUpperCase()) { + this.plural(new RegExp("(" + prefix + singular[0] + ")" + singular.slice(1) + "$", "i"), '$1' + plural.slice(1)); + this.plural(new RegExp("(" + prefix + plural[0] + ")" + plural.slice(1) + "$", "i"), '$1' + plural.slice(1)); + this.singular(new RegExp("(" + prefix + plural[0] + ")" + plural.slice(1) + "$", "i"), '$1' + singular.slice(1)); + } else { + this.plural(new RegExp(prefix + (singular[0].toUpperCase()) + singular.slice(1) + "$"), plural[0].toUpperCase() + plural.slice(1)); + this.plural(new RegExp(prefix + (singular[0].toLowerCase()) + singular.slice(1) + "$"), plural[0].toLowerCase() + plural.slice(1)); + this.plural(new RegExp(prefix + (plural[0].toUpperCase()) + plural.slice(1) + "$"), plural[0].toUpperCase() + plural.slice(1)); + this.plural(new RegExp(prefix + (plural[0].toLowerCase()) + plural.slice(1) + "$"), plural[0].toLowerCase() + plural.slice(1)); + this.singular(new RegExp(prefix + (plural[0].toUpperCase()) + plural.slice(1) + "$"), singular[0].toUpperCase() + singular.slice(1)); + this.singular(new RegExp(prefix + (plural[0].toLowerCase()) + plural.slice(1) + "$"), singular[0].toLowerCase() + singular.slice(1)); + } +}; + +// Specifies a humanized form of a string by a regular expression rule or by a string mapping. +// When using a regular expression based replacement, the normal humanize formatting is called after the replacement. +// When a string is used, the human form should be specified as desired (example: 'The name', not 'the_name') +// +// human /(.*)_cnt$/i, '$1_count' +// human "legacy_col_person_name", "Name" +Inflections.prototype.human = function (rule, replacement) { + this.humans.unshift([rule, replacement]); +} + +// Add uncountable words that shouldn't be attempted inflected. +// +// uncountable "money" +// uncountable ["money", "information"] +Inflections.prototype.uncountable = function (words) { + this.uncountables = this.uncountables.concat(words); +} + +// Clears the loaded inflections within a given scope (default is _'all'_). +// Give the scope as a symbol of the inflection type, the options are: _'plurals'_, +// _'singulars'_, _'uncountables'_, _'humans'_. +// +// clear 'all' +// clear 'plurals' +Inflections.prototype.clear = function (scope) { + if (scope == null) scope = 'all'; + switch (scope) { + case 'all': + this.plurals = []; + this.singulars = []; + this.uncountables = []; + this.humans = []; + default: + this[scope] = []; + } +} + +// Clears the loaded inflections and initializes them to [default](../inflections.html) +Inflections.prototype.default = function () { + this.plurals = []; + this.singulars = []; + this.uncountables = []; + this.humans = []; + require('./defaults')(this); + return this; +}; + +module.exports = new Inflections(); diff --git a/node_modules/i/lib/methods.js b/node_modules/i/lib/methods.js new file mode 100755 index 00000000..6f6beebd --- /dev/null +++ b/node_modules/i/lib/methods.js @@ -0,0 +1,232 @@ +// The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without, +// and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept +// in inflections.coffee +// +// If you discover an incorrect inflection and require it for your application, you'll need +// to correct it yourself (explained below). + +var util = require('./util'); + +var inflect = module.exports; + +// Import [inflections](inflections.html) instance +inflect.inflections = require('./inflections') + +// Gives easy access to add inflections to this class +inflect.inflect = function (inflections_function) { + inflections_function(inflect.inflections); +}; + +// By default, _camelize_ converts strings to UpperCamelCase. If the argument to _camelize_ +// is set to _false_ then _camelize_ produces lowerCamelCase. +// +// _camelize_ will also convert '/' to '.' which is useful for converting paths to namespaces. +// +// "bullet_record".camelize() // => "BulletRecord" +// "bullet_record".camelize(false) // => "bulletRecord" +// "bullet_record/errors".camelize() // => "BulletRecord.Errors" +// "bullet_record/errors".camelize(false) // => "bulletRecord.Errors" +// +// As a rule of thumb you can think of _camelize_ as the inverse of _underscore_, +// though there are cases where that does not hold: +// +// "SSLError".underscore.camelize // => "SslError" +inflect.camelize = function(lower_case_and_underscored_word, first_letter_in_uppercase) { + var result; + if (first_letter_in_uppercase == null) first_letter_in_uppercase = true; + result = util.string.gsub(lower_case_and_underscored_word, /\/(.?)/, function($) { + return "." + (util.string.upcase($[1])); + }); + result = util.string.gsub(result, /(?:_)(.)/, function($) { + return util.string.upcase($[1]); + }); + if (first_letter_in_uppercase) { + return util.string.upcase(result); + } else { + return util.string.downcase(result); + } +}; + +// Makes an underscored, lowercase form from the expression in the string. +// +// Changes '.' to '/' to convert namespaces to paths. +// +// "BulletRecord".underscore() // => "bullet_record" +// "BulletRecord.Errors".underscore() // => "bullet_record/errors" +// +// As a rule of thumb you can think of +underscore+ as the inverse of +camelize+, +// though there are cases where that does not hold: +// +// "SSLError".underscore().camelize() // => "SslError" +inflect.underscore = function (camel_cased_word) { + var self; + self = util.string.gsub(camel_cased_word, /\./, '/'); + self = util.string.gsub(self, /([A-Z]+)([A-Z][a-z])/, "$1_$2"); + self = util.string.gsub(self, /([a-z\d])([A-Z])/, "$1_$2"); + self = util.string.gsub(self, /-/, '_'); + return self.toLowerCase(); +}; + +// Replaces underscores with dashes in the string. +// +// "puni_puni".dasherize() // => "puni-puni" +inflect.dasherize = function (underscored_word) { + return util.string.gsub(underscored_word, /_/, '-'); +}; + +// Removes the module part from the expression in the string. +// +// "BulletRecord.String.Inflections".demodulize() // => "Inflections" +// "Inflections".demodulize() // => "Inflections" +inflect.demodulize = function (class_name_in_module) { + return util.string.gsub(class_name_in_module, /^.*\./, ''); +}; + +// Creates a foreign key name from a class name. +// _separate_class_name_and_id_with_underscore_ sets whether +// the method should put '_' between the name and 'id'. +// +// "Message".foreign_key() // => "message_id" +// "Message".foreign_key(false) // => "messageid" +// "Admin::Post".foreign_key() // => "post_id" +inflect.foreign_key = function (class_name, separate_class_name_and_id_with_underscore) { + if (separate_class_name_and_id_with_underscore == null) { + separate_class_name_and_id_with_underscore = true; + } + return inflect.underscore(inflect.demodulize(class_name)) + (separate_class_name_and_id_with_underscore ? "_id" : "id"); +}; + +// Turns a number into an ordinal string used to denote the position in an +// ordered sequence such as 1st, 2nd, 3rd, 4th. +// +// ordinalize(1) // => "1st" +// ordinalize(2) // => "2nd" +// ordinalize(1002) // => "1002nd" +// ordinalize(1003) // => "1003rd" +// ordinalize(-11) // => "-11th" +// ordinalize(-1021) // => "-1021st" +inflect.ordinalize = function (number) { + var _ref; + number = parseInt(number); + if ((_ref = Math.abs(number) % 100) === 11 || _ref === 12 || _ref === 13) { + return "" + number + "th"; + } else { + switch (Math.abs(number) % 10) { + case 1: + return "" + number + "st"; + case 2: + return "" + number + "nd"; + case 3: + return "" + number + "rd"; + default: + return "" + number + "th"; + } + } +}; + +// Checks a given word for uncountability +// +// "money".uncountability() // => true +// "my money".uncountability() // => true +inflect.uncountability = function (word) { + return inflect.inflections.uncountables.some(function(ele, ind, arr) { + return word.match(new RegExp("(\\b|_)" + ele + "$", 'i')) != null; + }); +}; + +// Returns the plural form of the word in the string. +// +// "post".pluralize() // => "posts" +// "octopus".pluralize() // => "octopi" +// "sheep".pluralize() // => "sheep" +// "words".pluralize() // => "words" +// "CamelOctopus".pluralize() // => "CamelOctopi" +inflect.pluralize = function (word) { + var plural, result; + result = word; + if (word === '' || inflect.uncountability(word)) { + return result; + } else { + for (var i = 0; i < inflect.inflections.plurals.length; i++) { + plural = inflect.inflections.plurals[i]; + result = util.string.gsub(result, plural[0], plural[1]); + if (word.match(plural[0]) != null) break; + } + return result; + } +}; + +// The reverse of _pluralize_, returns the singular form of a word in a string. +// +// "posts".singularize() // => "post" +// "octopi".singularize() // => "octopus" +// "sheep".singularize() // => "sheep" +// "word".singularize() // => "word" +// "CamelOctopi".singularize() // => "CamelOctopus" +inflect.singularize = function (word) { + var result, singular; + result = word; + if (word === '' || inflect.uncountability(word)) { + return result; + } else { + for (var i = 0; i < inflect.inflections.singulars.length; i++) { + singular = inflect.inflections.singulars[i]; + result = util.string.gsub(result, singular[0], singular[1]); + if (word.match(singular[0])) break; + } + return result; + } +}; + +// Capitalizes the first word and turns underscores into spaces and strips a +// trailing "_id", if any. Like _titleize_, this is meant for creating pretty output. +// +// "employee_salary".humanize() // => "Employee salary" +// "author_id".humanize() // => "Author" +inflect.humanize = function (lower_case_and_underscored_word) { + var human, result; + result = lower_case_and_underscored_word; + for (var i = 0; i < inflect.inflections.humans.length; i++) { + human = inflect.inflections.humans[i]; + result = util.string.gsub(result, human[0], human[1]); + } + result = util.string.gsub(result, /_id$/, ""); + result = util.string.gsub(result, /_/, " "); + return util.string.capitalize(result, true); +}; + +// Capitalizes all the words and replaces some characters in the string to create +// a nicer looking title. _titleize_ is meant for creating pretty output. It is not +// used in the Bullet internals. +// +// +// "man from the boondocks".titleize() // => "Man From The Boondocks" +// "x-men: the last stand".titleize() // => "X Men: The Last Stand" +inflect.titleize = function (word) { + var self; + self = inflect.humanize(inflect.underscore(word)); + return util.string.capitalize(self); +}; + +// Create the name of a table like Bullet does for models to table names. This method +// uses the _pluralize_ method on the last word in the string. +// +// "RawScaledScorer".tableize() // => "raw_scaled_scorers" +// "egg_and_ham".tableize() // => "egg_and_hams" +// "fancyCategory".tableize() // => "fancy_categories" +inflect.tableize = function (class_name) { + return inflect.pluralize(inflect.underscore(class_name)); +}; + +// Create a class name from a plural table name like Bullet does for table names to models. +// Note that this returns a string and not a Class. +// +// "egg_and_hams".classify() // => "EggAndHam" +// "posts".classify() // => "Post" +// +// Singular names are not handled correctly: +// +// "business".classify() // => "Busines" +inflect.classify = function (table_name) { + return inflect.camelize(inflect.singularize(util.string.gsub(table_name, /.*\./, ''))); +} diff --git a/node_modules/i/lib/native.js b/node_modules/i/lib/native.js new file mode 100755 index 00000000..d2c8de10 --- /dev/null +++ b/node_modules/i/lib/native.js @@ -0,0 +1,26 @@ +module.exports = function (obj) { + + var addProperty = function (method, func) { + String.prototype.__defineGetter__(method, func); + } + + var stringPrototypeBlacklist = [ + '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', + 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', + 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', + 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'gsub' + ]; + + Object.keys(obj).forEach(function (key) { + if (key != 'inflect' && key != 'inflections') { + if (stringPrototypeBlacklist.indexOf(key) !== -1) { + console.log('warn: You should not override String.prototype.' + key); + } else { + addProperty(key, function () { + return obj[key](this); + }); + } + } + }); + +} diff --git a/node_modules/i/lib/util.js b/node_modules/i/lib/util.js new file mode 100755 index 00000000..87ebd3ef --- /dev/null +++ b/node_modules/i/lib/util.js @@ -0,0 +1,136 @@ +// Some utility functions in js + +var u = module.exports = { + array: { + // Returns a copy of the array with the value removed once + // + // [1, 2, 3, 1].del 1 #=> [2, 3, 1] + // [1, 2, 3].del 4 #=> [1, 2, 3] + del: function (arr, val) { + var index = arr.indexOf(val); + if (index != -1) { + if (index == 0) { + return arr.slice(1) + } else { + return arr.slice(0, index).concat(arr.slice(index+1)); + } + } else { + return arr; + } + }, + + // Returns the first element of the array + // + // [1, 2, 3].first() #=> 1 + first: function(arr) { + return arr[0]; + }, + + // Returns the last element of the array + // + // [1, 2, 3].last() #=> 3 + last: function(arr) { + return arr[arr.length-1]; + } + }, + string: { + // Returns a copy of str with all occurrences of pattern replaced with either replacement or the return value of a function. + // The pattern will typically be a Regexp; if it is a String then no regular expression metacharacters will be interpreted + // (that is /\d/ will match a digit, but ‘\d’ will match a backslash followed by a ‘d’). + // + // In the function form, the current match object is passed in as a parameter to the function, and variables such as + // $[1], $[2], $[3] (where $ is the match object) will be set appropriately. The value returned by the function will be + // substituted for the match on each call. + // + // The result inherits any tainting in the original string or any supplied replacement string. + // + // "hello".gsub /[aeiou]/, '*' #=> "h*ll*" + // "hello".gsub /[aeiou]/, '<$1>' #=> "hll" + // "hello".gsub /[aeiou]/, ($) { + // "<#{$[1]}>" #=> "hll" + // + gsub: function (str, pattern, replacement) { + var i, match, matchCmpr, matchCmprPrev, replacementStr, result, self; + if (!((pattern != null) && (replacement != null))) return u.string.value(str); + result = ''; + self = str; + while (self.length > 0) { + if ((match = self.match(pattern))) { + result += self.slice(0, match.index); + if (typeof replacement === 'function') { + match[1] = match[1] || match[0]; + result += replacement(match); + } else if (replacement.match(/\$[1-9]/)) { + matchCmprPrev = match; + matchCmpr = u.array.del(match, void 0); + while (matchCmpr !== matchCmprPrev) { + matchCmprPrev = matchCmpr; + matchCmpr = u.array.del(matchCmpr, void 0); + } + match[1] = match[1] || match[0]; + replacementStr = replacement; + for (i = 1; i <= 9; i++) { + if (matchCmpr[i]) { + replacementStr = u.string.gsub(replacementStr, new RegExp("\\\$" + i), matchCmpr[i]); + } + } + result += replacementStr; + } else { + result += replacement; + } + self = self.slice(match.index + match[0].length); + } else { + result += self; + self = ''; + } + } + return result; + }, + + // Returns a copy of the String with the first letter being upper case + // + // "hello".upcase #=> "Hello" + upcase: function(str) { + var self = u.string.gsub(str, /_([a-z])/, function ($) { + return "_" + $[1].toUpperCase(); + }); + self = u.string.gsub(self, /\/([a-z])/, function ($) { + return "/" + $[1].toUpperCase(); + }); + return self[0].toUpperCase() + self.substr(1); + }, + + // Returns a copy of capitalized string + // + // "employee salary" #=> "Employee Salary" + capitalize: function (str, spaces) { + var self = str.toLowerCase(); + if(!spaces) { + self = u.string.gsub(self, /\s([a-z])/, function ($) { + return " " + $[1].toUpperCase(); + }); + } + return self[0].toUpperCase() + self.substr(1); + }, + + // Returns a copy of the String with the first letter being lower case + // + // "HELLO".downcase #=> "hELLO" + downcase: function(str) { + var self = u.string.gsub(str, /_([A-Z])/, function ($) { + return "_" + $[1].toLowerCase(); + }); + self = u.string.gsub(self, /\/([A-Z])/, function ($) { + return "/" + $[1].toLowerCase(); + }); + return self[0].toLowerCase() + self.substr(1); + }, + + // Returns a string value for the String object + // + // "hello".value() #=> "hello" + value: function (str) { + return str.substr(0); + } + } +} diff --git a/node_modules/i/package.json b/node_modules/i/package.json new file mode 100755 index 00000000..2a0047ad --- /dev/null +++ b/node_modules/i/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "i@0.3.x", + "scope": null, + "escapedName": "i", + "name": "i", + "rawSpec": "0.3.x", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/utile" + ] + ], + "_from": "i@>=0.3.0 <0.4.0", + "_id": "i@0.3.5", + "_inCache": true, + "_location": "/i", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/i-0.3.5.tgz_1462355680372_0.1744775390252471" + }, + "_npmUser": { + "name": "pksunkara", + "email": "pavan.sss1991@gmail.com" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "raw": "i@0.3.x", + "scope": null, + "escapedName": "i", + "name": "i", + "rawSpec": "0.3.x", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/utile" + ], + "_resolved": "https://registry.npmjs.org/i/-/i-0.3.5.tgz", + "_shasum": "1d2b854158ec8169113c6cb7f6b6801e99e211d5", + "_shrinkwrap": null, + "_spec": "i@0.3.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/utile", + "author": { + "name": "Pavan Kumar Sunkara", + "email": "pavan.sss1991@gmail.com", + "url": "pksunkara.github.com" + }, + "bugs": { + "url": "https://github.com/pksunkara/inflect/issues" + }, + "contributors": [ + { + "name": "Pavan Kumar Sunkara", + "email": "pavan.sss1991@gmail.com" + } + ], + "dependencies": {}, + "description": "custom inflections for nodejs", + "devDependencies": { + "vows": "0.7.0" + }, + "directories": {}, + "dist": { + "shasum": "1d2b854158ec8169113c6cb7f6b6801e99e211d5", + "tarball": "https://registry.npmjs.org/i/-/i-0.3.5.tgz" + }, + "engines": { + "node": ">=0.4" + }, + "gitHead": "bbcadd57a182007ab158acea511515b815385d4d", + "homepage": "http://pksunkara.github.com/inflect", + "keywords": [ + "singular", + "plural", + "camelize", + "underscore", + "dasherize", + "demodulize", + "ordinalize", + "uncountable", + "pluralize", + "singularize", + "titleize", + "tableize", + "classify", + "foreign_key" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/pksunkara/inflect/raw/master/LICENSE" + } + ], + "main": "./lib/inflect", + "maintainers": [ + { + "name": "pksunkara", + "email": "pavan.sss1991@gmail.com" + } + ], + "name": "i", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/pksunkara/inflect.git" + }, + "scripts": { + "test": "vows --spec $(find test -name '*-test.js')" + }, + "version": "0.3.5" +} diff --git a/node_modules/i/test/inflector/cases.js b/node_modules/i/test/inflector/cases.js new file mode 100755 index 00000000..a818f9a6 --- /dev/null +++ b/node_modules/i/test/inflector/cases.js @@ -0,0 +1,230 @@ +(function() { + + module.exports = { + SingularToPlural: { + "search": "searches", + "switch": "switches", + "fix": "fixes", + "box": "boxes", + "process": "processes", + "address": "addresses", + "case": "cases", + "stack": "stacks", + "wish": "wishes", + "fish": "fish", + "jeans": "jeans", + "funky jeans": "funky jeans", + "my money": "my money", + "category": "categories", + "query": "queries", + "ability": "abilities", + "agency": "agencies", + "movie": "movies", + "archive": "archives", + "index": "indices", + "wife": "wives", + "safe": "saves", + "half": "halves", + "move": "moves", + "salesperson": "salespeople", + "person": "people", + "spokesman": "spokesmen", + "man": "men", + "woman": "women", + "basis": "bases", + "diagnosis": "diagnoses", + "diagnosis_a": "diagnosis_as", + "datum": "data", + "medium": "media", + "stadium": "stadia", + "analysis": "analyses", + "node_child": "node_children", + "child": "children", + "experience": "experiences", + "day": "days", + "comment": "comments", + "foobar": "foobars", + "newsletter": "newsletters", + "old_news": "old_news", + "news": "news", + "series": "series", + "species": "species", + "quiz": "quizzes", + "perspective": "perspectives", + "ox": "oxen", + "photo": "photos", + "buffalo": "buffaloes", + "tomato": "tomatoes", + "dwarf": "dwarves", + "elf": "elves", + "information": "information", + "equipment": "equipment", + "bus": "buses", + "status": "statuses", + "status_code": "status_codes", + "mouse": "mice", + "louse": "lice", + "house": "houses", + "octopus": "octopi", + "virus": "viri", + "alias": "aliases", + "portfolio": "portfolios", + "vertex": "vertices", + "matrix": "matrices", + "matrix_fu": "matrix_fus", + "axis": "axes", + "testis": "testes", + "crisis": "crises", + "rice": "rice", + "shoe": "shoes", + "horse": "horses", + "prize": "prizes", + "edge": "edges", + "cow": "kine", + "database": "databases", + "safe": "safes", + "belief": "beliefs", + "gaffe": "gaffes", + "cafe": "cafes", + "caffe": "caffes", + "life": "lives", + "wife": "wives", + "save": "saves", + "fife": "fifes", + "carafe": "carafes", + "giraffe": "giraffes", + "elf": "elves", + "calf": "calves", + "bookshelf": "bookshelves", + "wolf": "wolves", + "half": "halves", + "meatloaf": "meatloaves", + "loaf": "loaves", + "oaf": "oafs", + "jefe": "jefes", + "afterlife": "afterlives", + }, + CamelToUnderscore: { + "Product": "product", + "SpecialGuest": "special_guest", + "ApplicationController": "application_controller", + "Area51Controller": "area51_controller" + }, + UnderscoreToLowerCamel: { + "product": "product", + "Widget": "widget", + "special_guest": "specialGuest", + "application_controller": "applicationController", + "area51_controller": "area51Controller" + }, + CamelToUnderscoreWithoutReverse: { + "HTMLTidy": "html_tidy", + "HTMLTidyGenerator": "html_tidy_generator", + "FreeBSD": "free_bsd", + "HTML": "html" + }, + CamelWithModuleToUnderscoreWithSlash: { + "Admin.Product": "admin/product", + "Users.Commission.Department": "users/commission/department", + "UsersSection.CommissionDepartment": "users_section/commission_department" + }, + ClassNameToForeignKeyWithUnderscore: { + "Person": "person_id", + "MyApplication.Billing.Account": "account_id" + }, + ClassNameToForeignKeyWithoutUnderscore: { + "Person": "personid", + "MyApplication.Billing.Account": "accountid" + }, + ClassNameToTableName: { + "PrimarySpokesman": "primary_spokesmen", + "NodeChild": "node_children" + }, + UnderscoreToHuman: { + "employee_salary": "Employee salary", + "employee_id": "Employee", + "underground": "Underground" + }, + MixtureToTitleCase: { + 'bullet_record': 'Bullet Record', + 'BulletRecord': 'Bullet Record', + 'bullet web service': 'Bullet Web Service', + 'Bullet Web Service': 'Bullet Web Service', + 'Bullet web service': 'Bullet Web Service', + 'bulletwebservice': 'Bulletwebservice', + 'Bulletwebservice': 'Bulletwebservice', + "pavan's code": "Pavan's Code", + "Pavan's code": "Pavan's Code", + "pavan's Code": "Pavan's Code" + }, + OrdinalNumbers: { + "-1": "-1st", + "-2": "-2nd", + "-3": "-3rd", + "-4": "-4th", + "-5": "-5th", + "-6": "-6th", + "-7": "-7th", + "-8": "-8th", + "-9": "-9th", + "-10": "-10th", + "-11": "-11th", + "-12": "-12th", + "-13": "-13th", + "-14": "-14th", + "-20": "-20th", + "-21": "-21st", + "-22": "-22nd", + "-23": "-23rd", + "-24": "-24th", + "-100": "-100th", + "-101": "-101st", + "-102": "-102nd", + "-103": "-103rd", + "-104": "-104th", + "-110": "-110th", + "-111": "-111th", + "-112": "-112th", + "-113": "-113th", + "-1000": "-1000th", + "-1001": "-1001st", + "0": "0th", + "1": "1st", + "2": "2nd", + "3": "3rd", + "4": "4th", + "5": "5th", + "6": "6th", + "7": "7th", + "8": "8th", + "9": "9th", + "10": "10th", + "11": "11th", + "12": "12th", + "13": "13th", + "14": "14th", + "20": "20th", + "21": "21st", + "22": "22nd", + "23": "23rd", + "24": "24th", + "100": "100th", + "101": "101st", + "102": "102nd", + "103": "103rd", + "104": "104th", + "110": "110th", + "111": "111th", + "112": "112th", + "113": "113th", + "1000": "1000th", + "1001": "1001st" + }, + UnderscoresToDashes: { + "street": "street", + "street_address": "street-address", + "person_street_address": "person-street-address" + } + }; + +}).call(this); diff --git a/node_modules/i/test/inflector/inflections-test.js b/node_modules/i/test/inflector/inflections-test.js new file mode 100755 index 00000000..be8d9605 --- /dev/null +++ b/node_modules/i/test/inflector/inflections-test.js @@ -0,0 +1,87 @@ +(function() { + var assert, vows; + + vows = require('vows'); + + assert = require('assert'); + + vows.describe('Module Inflector inflections').addBatch({ + 'Test inflector inflections': { + topic: require('../../lib/inflections'), + 'clear': { + 'single': function(topic) { + topic.uncountables = [1, 2, 3]; + topic.humans = [1, 2, 3]; + topic.clear('uncountables'); + assert.isEmpty(topic.uncountables); + return assert.deepEqual(topic.humans, [1, 2, 3]); + }, + 'all': function(topic) { + assert.deepEqual(topic.humans, [1, 2, 3]); + topic.uncountables = [1, 2, 3]; + topic.clear(); + assert.isEmpty(topic.uncountables); + return assert.isEmpty(topic.humans); + } + }, + 'uncountable': { + 'one item': function(topic) { + topic.clear(); + assert.isEmpty(topic.uncountables); + topic.uncountable('money'); + return assert.deepEqual(topic.uncountables, ['money']); + }, + 'many items': function(topic) { + topic.clear(); + assert.isEmpty(topic.uncountables); + topic.uncountable(['money', 'rice']); + return assert.deepEqual(topic.uncountables, ['money', 'rice']); + } + }, + 'human': function(topic) { + topic.clear(); + assert.isEmpty(topic.humans); + topic.human("legacy_col_person_name", "Name"); + return assert.deepEqual(topic.humans, [["legacy_col_person_name", "Name"]]); + }, + 'plural': function(topic) { + topic.clear(); + assert.isEmpty(topic.plurals); + topic.plural('ox', 'oxen'); + assert.deepEqual(topic.plurals, [['ox', 'oxen']]); + topic.uncountable('money'); + assert.deepEqual(topic.uncountables, ['money']); + topic.uncountable('monies'); + topic.plural('money', 'monies'); + assert.deepEqual(topic.plurals, [['money', 'monies'], ['ox', 'oxen']]); + return assert.isEmpty(topic.uncountables); + }, + 'singular': function(topic) { + topic.clear(); + assert.isEmpty(topic.singulars); + topic.singular('ox', 'oxen'); + assert.deepEqual(topic.singulars, [['ox', 'oxen']]); + topic.uncountable('money'); + assert.deepEqual(topic.uncountables, ['money']); + topic.uncountable('monies'); + topic.singular('money', 'monies'); + assert.deepEqual(topic.singulars, [['money', 'monies'], ['ox', 'oxen']]); + return assert.isEmpty(topic.uncountables); + }, + 'irregular': function(topic) { + topic.clear(); + topic.uncountable(['octopi', 'octopus']); + assert.deepEqual(topic.uncountables, ['octopi', 'octopus']); + topic.irregular('octopus', 'octopi'); + assert.isEmpty(topic.uncountables); + assert.equal(topic.singulars[0][0].toString(), /(o)ctopi$/i.toString()); + assert.equal(topic.singulars[0][1], '$1ctopus'); + assert.equal(topic.plurals[0][0].toString(), /(o)ctopi$/i.toString()); + assert.equal(topic.plurals[0][1], '$1ctopi'); + assert.equal(topic.plurals[1][0].toString(), /(o)ctopus$/i.toString()); + return assert.equal(topic.plurals[1][1].toString(), '$1ctopi'); + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/i/test/inflector/methods-test.js b/node_modules/i/test/inflector/methods-test.js new file mode 100755 index 00000000..d49d4140 --- /dev/null +++ b/node_modules/i/test/inflector/methods-test.js @@ -0,0 +1,345 @@ +(function() { + var assert, cases, vows, util; + + vows = require('vows'); + + assert = require('assert'); + + util = require('../../lib/util'); + + cases = require('./cases'); + + vows.describe('Module Inflector methods').addBatch({ + 'Test inflector method': { + topic: require('../../lib/methods'), + 'camelize': { + 'word': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.CamelToUnderscore; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.camelize(words[i]), i)); + } + return _results; + }, + 'word with first letter lower': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoreToLowerCamel; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.camelize(i, false), words[i])); + } + return _results; + }, + 'path': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.CamelWithModuleToUnderscoreWithSlash; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.camelize(words[i]), i)); + } + return _results; + }, + 'path with first letter lower': function(topic) { + return assert.equal(topic.camelize('bullet_record/errors', false), 'bulletRecord.Errors'); + } + }, + 'underscore': { + 'word': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.CamelToUnderscore; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.underscore(i), words[i]); + } + words = cases.CamelToUnderscoreWithoutReverse; + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.underscore(i), words[i])); + } + return _results; + }, + 'path': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.CamelWithModuleToUnderscoreWithSlash; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.underscore(i), words[i])); + } + return _results; + }, + 'from dasherize': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoresToDashes; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.underscore(topic.dasherize(i)), i)); + } + return _results; + } + }, + 'dasherize': { + 'underscored_word': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoresToDashes; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.dasherize(i), words[i])); + } + return _results; + } + }, + 'demodulize': { + 'module name': function(topic) { + return assert.equal(topic.demodulize('BulletRecord.CoreExtensions.Inflections'), 'Inflections'); + }, + 'isolated module name': function(topic) { + return assert.equal(topic.demodulize('Inflections'), 'Inflections'); + } + }, + 'foreign_key': { + 'normal': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.ClassNameToForeignKeyWithoutUnderscore; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.foreign_key(i, false), words[i])); + } + return _results; + }, + 'with_underscore': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.ClassNameToForeignKeyWithUnderscore; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.foreign_key(i), words[i])); + } + return _results; + } + }, + 'ordinalize': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.OrdinalNumbers; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.ordinalize(i), words[i])); + } + return _results; + } + } + }).addBatch({ + 'Test inflector inflection methods': { + topic: function() { + var Inflector; + Inflector = require('../../lib/methods'); + Inflector.inflections["default"](); + return Inflector; + }, + 'pluralize': { + 'empty': function(topic) { + return assert.equal(topic.pluralize(''), ''); + }, + 'uncountable': function(topic) { + return assert.equal(topic.pluralize('money'), 'money'); + }, + 'normal': function(topic) { + topic.inflections.irregular('octopus', 'octopi'); + return assert.equal(topic.pluralize('octopus'), 'octopi'); + }, + 'cases': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.SingularToPlural; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.pluralize(i), words[i]); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.pluralize(util.string.capitalize(i)), util.string.capitalize(words[i]))); + } + return _results; + }, + 'cases plural': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.SingularToPlural; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.pluralize(words[i]), words[i]); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.pluralize(util.string.capitalize(words[i])), util.string.capitalize(words[i]))); + } + return _results; + } + }, + 'singuralize': { + 'empty': function(topic) { + return assert.equal(topic.singularize(''), ''); + }, + 'uncountable': function(topic) { + return assert.equal(topic.singularize('money'), 'money'); + }, + 'normal': function(topic) { + topic.inflections.irregular('octopus', 'octopi'); + return assert.equal(topic.singularize('octopi'), 'octopus'); + }, + 'cases': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.SingularToPlural; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.singularize(words[i]), i); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.singularize(util.string.capitalize(words[i])), util.string.capitalize(i))); + } + return _results; + } + }, + 'uncountablility': { + 'normal': function(topic) { + var i, words, _i, _j, _k, _len, _len2, _len3, _results; + words = topic.inflections.uncountables; + for (_i = 0, _len = words.length; _i < _len; _i++) { + i = words[_i]; + assert.equal(topic.singularize(i), i); + } + for (_j = 0, _len2 = words.length; _j < _len2; _j++) { + i = words[_j]; + assert.equal(topic.pluralize(i), i); + } + _results = []; + for (_k = 0, _len3 = words.length; _k < _len3; _k++) { + i = words[_k]; + _results.push(assert.equal(topic.singularize(i), topic.pluralize(i))); + } + return _results; + }, + 'greedy': function(topic) { + var countable_word, uncountable_word; + uncountable_word = "ors"; + countable_word = "sponsor"; + topic.inflections.uncountable(uncountable_word); + assert.equal(topic.singularize(uncountable_word), uncountable_word); + assert.equal(topic.pluralize(uncountable_word), uncountable_word); + assert.equal(topic.pluralize(uncountable_word), topic.singularize(uncountable_word)); + assert.equal(topic.singularize(countable_word), 'sponsor'); + assert.equal(topic.pluralize(countable_word), 'sponsors'); + return assert.equal(topic.singularize(topic.pluralize(countable_word)), 'sponsor'); + } + }, + 'humanize': { + 'normal': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.UnderscoreToHuman; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.humanize(i), words[i])); + } + return _results; + }, + 'with rule': function(topic) { + topic.inflections.human(/^(.*)_cnt$/i, '$1_count'); + topic.inflections.human(/^prefix_(.*)$/i, '$1'); + assert.equal(topic.humanize('jargon_cnt'), 'Jargon count'); + return assert.equal(topic.humanize('prefix_request'), 'Request'); + }, + 'with string': function(topic) { + topic.inflections.human('col_rpted_bugs', 'Reported bugs'); + assert.equal(topic.humanize('col_rpted_bugs'), 'Reported bugs'); + return assert.equal(topic.humanize('COL_rpted_bugs'), 'Col rpted bugs'); + }, + 'with _id': function(topic) { + return assert.equal(topic.humanize('author_id'), 'Author'); + } + }, + 'titleize': { + 'normal': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.MixtureToTitleCase; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.titleize(i), words[i])); + } + return _results; + }, + 'with hyphens': function(topic) { + return assert.equal(topic.titleize('x-men: the last stand'), 'X Men: The Last Stand'); + }, + 'with ampersands': function(topic) { + return assert.equal(topic.titleize('garfunkel & oates'), 'Garfunkel & Oates'); + } + }, + 'tableize': function(topic) { + var i, words, _i, _len, _ref, _results; + words = cases.ClassNameToTableName; + _ref = Object.keys(words); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + _results.push(assert.equal(topic.tableize(i), words[i])); + } + return _results; + }, + 'classify': { + 'underscore': function(topic) { + var i, words, _i, _j, _len, _len2, _ref, _ref2, _results; + words = cases.ClassNameToTableName; + _ref = Object.keys(words); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + i = _ref[_i]; + assert.equal(topic.classify(words[i]), i); + } + _ref2 = Object.keys(words); + _results = []; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + i = _ref2[_j]; + _results.push(assert.equal(topic.classify('table_prefix.' + words[i]), i)); + } + return _results; + }, + 'normal': function(topic) { + topic.inflections.irregular('octopus', 'octopi'); + return assert.equal(topic.classify('octopi'), 'Octopus'); + } + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/i/test/utils/array-test.js b/node_modules/i/test/utils/array-test.js new file mode 100755 index 00000000..95ba2bc5 --- /dev/null +++ b/node_modules/i/test/utils/array-test.js @@ -0,0 +1,39 @@ +(function() { + var assert, vows, util; + + vows = require('vows'); + + assert = require('assert'); + + util = require('../../lib/util'); + + vows.describe('Module core extension Array').addBatch({ + 'Testing del': { + topic: ['a', 'b', 'c'], + 'element exists': { + 'first element': function(topic) { + return assert.deepEqual(util.array.del(topic, 'a'), ['b', 'c']); + }, + 'middle element': function(topic) { + return assert.deepEqual(util.array.del(topic, 'b'), ['a', 'c']); + }, + 'last element': function(topic) { + return assert.deepEqual(util.array.del(topic, 'c'), ['a', 'b']); + } + }, + 'element does not exist': function(topic) { + return assert.deepEqual(util.array.del(topic, 'd'), ['a', 'b', 'c']); + } + }, + 'Testing utils': { + topic: ['a', 'b', 'c'], + 'first': function(topic) { + return assert.equal(util.array.first(topic), 'a'); + }, + 'last': function(topic) { + return assert.equal(util.array.last(topic), 'c'); + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/i/test/utils/string-test.js b/node_modules/i/test/utils/string-test.js new file mode 100755 index 00000000..e9322331 --- /dev/null +++ b/node_modules/i/test/utils/string-test.js @@ -0,0 +1,88 @@ +(function() { + var assert, vows, util; + + vows = require('vows'); + + assert = require('assert'); + + util = require('../../lib/util'); + + vows.describe('Module core extension String').addBatch({ + 'Testing value': { + topic: 'bullet', + 'join the keys': function(topic) { + return assert.equal(util.string.value(topic), 'bullet'); + } + }, + 'Testing gsub': { + topic: 'bullet', + 'when no args': function(topic) { + return assert.equal(util.string.gsub(topic), 'bullet'); + }, + 'when only 1 arg': function(topic) { + return assert.equal(util.string.gsub(topic, /./), 'bullet'); + }, + 'when given proper args': function(topic) { + return assert.equal(util.string.gsub(topic, /[aeiou]/, '*'), 'b*ll*t'); + }, + 'when replacement is a function': { + 'with many groups': function(topic) { + var str; + str = util.string.gsub(topic, /([aeiou])(.)/, function($) { + return "<" + $[1] + ">" + $[2]; + }); + return assert.equal(str, 'bllt'); + }, + 'with no groups': function(topic) { + var str; + str = util.string.gsub(topic, /[aeiou]/, function($) { + return "<" + $[1] + ">"; + }); + return assert.equal(str, 'bllt'); + } + }, + 'when replacement is special': { + 'with many groups': function(topic) { + return assert.equal(util.string.gsub(topic, /([aeiou])(.)/, '<$1>$2'), 'bllt'); + }, + 'with no groups': function(topic) { + return assert.equal(util.string.gsub(topic, /[aeiou]/, '<$1>'), 'bllt'); + } + } + }, + 'Testing capitalize': { + topic: 'employee salary', + 'normal': function(topic) { + return assert.equal(util.string.capitalize(topic), 'Employee Salary'); + } + }, + 'Testing upcase': { + topic: 'bullet', + 'only first letter should be upcase': function(topic) { + return assert.equal(util.string.upcase(topic), 'Bullet'); + }, + 'letter after underscore': function(topic) { + return assert.equal(util.string.upcase('bullet_record'), 'Bullet_Record'); + }, + 'letter after slash': function(topic) { + return assert.equal(util.string.upcase('bullet_record/errors'), 'Bullet_Record/Errors'); + }, + 'no letter after space': function(topic) { + return assert.equal(util.string.upcase('employee salary'), 'Employee salary'); + } + }, + 'Testing downcase': { + topic: 'BULLET', + 'only first letter should be downcase': function(topic) { + return assert.equal(util.string.downcase(topic), 'bULLET'); + }, + 'letter after underscore': function(topic) { + return assert.equal(util.string.downcase('BULLET_RECORD'), 'bULLET_rECORD'); + }, + 'letter after slash': function(topic) { + return assert.equal(util.string.downcase('BULLET_RECORD/ERRORS'), 'bULLET_rECORD/eRRORS'); + } + } + })["export"](module); + +}).call(this); diff --git a/node_modules/ieee754/.travis.yml b/node_modules/ieee754/.travis.yml new file mode 100755 index 00000000..6c45b34d --- /dev/null +++ b/node_modules/ieee754/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: +- 'node' +env: + global: + - secure: f3NrmOV/A7oACn47J1mkIpH8Sn/LINtluZvo/9pGo3Ss4+D2lyt7UawpedHtnYgU9WEyjPSi7pDWopUrIzusQ2trLYRJr8WAOEyHlgaepDyy4BW3ghGMKHMsS05kilYLP8nu1sRd6y1AcUYKw+kUrrSPanI7kViWVQ5d5DuwXO8= + - secure: a6teILh33z5fbGQbh5/EkFfAyXfa2fPJG1upy9K+jLAbG4WZxXD+YmXG9Tz33/2NJm6UplGfTJ8IQEXgxEfAFk3ao3xfKxzm3i64XxtroSlXIFNSiQKogxDfLEtWDoNNCodPHaV3ATEqxGJ5rkkUeU1+ROWW0sjG5JR26k8/Hfg= diff --git a/node_modules/ieee754/.zuul.yml b/node_modules/ieee754/.zuul.yml new file mode 100755 index 00000000..b5ba0c4a --- /dev/null +++ b/node_modules/ieee754/.zuul.yml @@ -0,0 +1,20 @@ +ui: tape +scripts: + - "./test/_polyfill.js" +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: latest + - name: ie + version: 11 + - name: microsoftedge + version: latest + - name: opera + version: latest + - name: android + version: latest + - name: iphone + version: latest diff --git a/node_modules/ieee754/LICENSE b/node_modules/ieee754/LICENSE new file mode 100755 index 00000000..f37a2ebe --- /dev/null +++ b/node_modules/ieee754/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2008, Fair Oaks Labs, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/ieee754/README.md b/node_modules/ieee754/README.md new file mode 100755 index 00000000..11f4d40c --- /dev/null +++ b/node_modules/ieee754/README.md @@ -0,0 +1,47 @@ +# ieee754 [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[travis-image]: https://img.shields.io/travis/feross/ieee754/master.svg +[travis-url]: https://travis-ci.org/feross/ieee754 +[npm-image]: https://img.shields.io/npm/v/ieee754.svg +[npm-url]: https://npmjs.org/package/ieee754 +[downloads-image]: https://img.shields.io/npm/dm/ieee754.svg +[saucelabs-image]: https://saucelabs.com/browser-matrix/ieee754.svg +[saucelabs-url]: https://saucelabs.com/u/ieee754 + +### Read/write IEEE754 floating point numbers from/to a Buffer or array-like object. + +## install + +``` +npm install ieee754 +``` + +## methods + +`var ieee754 = require('ieee754')` + +The `ieee754` object has the following functions: + +``` +ieee754.read = function (buffer, offset, isLE, mLen, nBytes) +ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) +``` + +The arguments mean the following: + +- buffer = the buffer +- offset = offset into the buffer +- value = value to set (only for `write`) +- isLe = is little endian? +- mLen = mantissa length +- nBytes = number of bytes + +## what is ieee754? + +The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation. [Read more](http://en.wikipedia.org/wiki/IEEE_floating_point). + +## license + +BSD 3 Clause. Copyright (c) 2008, Fair Oaks Labs, Inc. diff --git a/node_modules/ieee754/index.js b/node_modules/ieee754/index.js new file mode 100755 index 00000000..95e190c4 --- /dev/null +++ b/node_modules/ieee754/index.js @@ -0,0 +1,84 @@ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} diff --git a/node_modules/ieee754/package.json b/node_modules/ieee754/package.json new file mode 100755 index 00000000..814b9f1f --- /dev/null +++ b/node_modules/ieee754/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "ieee754@^1.1.4", + "scope": null, + "escapedName": "ieee754", + "name": "ieee754", + "rawSpec": "^1.1.4", + "spec": ">=1.1.4 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/buffer" + ] + ], + "_from": "ieee754@>=1.1.4 <2.0.0", + "_id": "ieee754@1.1.8", + "_inCache": true, + "_location": "/ieee754", + "_nodeVersion": "6.7.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ieee754-1.1.8.tgz_1475481601035_0.6688473029062152" + }, + "_npmUser": { + "name": "feross", + "email": "feross@feross.org" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "ieee754@^1.1.4", + "scope": null, + "escapedName": "ieee754", + "name": "ieee754", + "rawSpec": "^1.1.4", + "spec": ">=1.1.4 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/buffer" + ], + "_resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "_shasum": "be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4", + "_shrinkwrap": null, + "_spec": "ieee754@^1.1.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/buffer", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/ieee754/issues" + }, + "contributors": [ + { + "name": "Romain Beauxis", + "email": "toots@rastageeks.org" + } + ], + "dependencies": {}, + "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object", + "devDependencies": { + "standard": "*", + "tape": "^4.0.0", + "zuul": "^3.0.0" + }, + "directories": {}, + "dist": { + "shasum": "be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4", + "tarball": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz" + }, + "gitHead": "53d3f869cc527852156b8307353c55addc3e03ae", + "homepage": "https://github.com/feross/ieee754#readme", + "keywords": [ + "IEEE 754", + "buffer", + "convert", + "floating point", + "ieee754" + ], + "license": "BSD-3-Clause", + "main": "index.js", + "maintainers": [ + { + "name": "feross", + "email": "feross@feross.org" + } + ], + "name": "ieee754", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/feross/ieee754.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "zuul -- test/*.js", + "test-browser-local": "zuul --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "version": "1.1.8" +} diff --git a/node_modules/ieee754/test/basic.js b/node_modules/ieee754/test/basic.js new file mode 100755 index 00000000..58fae2bf --- /dev/null +++ b/node_modules/ieee754/test/basic.js @@ -0,0 +1,23 @@ +var ieee754 = require('../') +var test = require('tape') + +var EPSILON = 0.00001 + +test('read float', function (t) { + var buf = new Buffer(4) + buf.writeFloatLE(42.42, 0) + var num = ieee754.read(buf, 0, true, 23, 4) + t.ok(Math.abs(num - 42.42) < EPSILON) + + t.end() +}) + +test('write float', function (t) { + var buf = new Buffer(4) + ieee754.write(buf, 42.42, 0, true, 23, 4) + + var num = buf.readFloatLE(0) + t.ok(Math.abs(num - 42.42) < EPSILON) + + t.end() +}) diff --git a/node_modules/indexof/.npmignore b/node_modules/indexof/.npmignore new file mode 100755 index 00000000..48a2e246 --- /dev/null +++ b/node_modules/indexof/.npmignore @@ -0,0 +1,2 @@ +components +build diff --git a/node_modules/indexof/Makefile b/node_modules/indexof/Makefile new file mode 100755 index 00000000..3f6119d2 --- /dev/null +++ b/node_modules/indexof/Makefile @@ -0,0 +1,11 @@ + +build: components index.js + @component build + +components: + @Component install + +clean: + rm -fr build components template.js + +.PHONY: clean diff --git a/node_modules/indexof/Readme.md b/node_modules/indexof/Readme.md new file mode 100755 index 00000000..99c8dfc8 --- /dev/null +++ b/node_modules/indexof/Readme.md @@ -0,0 +1,15 @@ + +# indexOf + + Lame indexOf thing, thanks microsoft + +## Example + +```js +var index = require('indexof'); +index(arr, obj); +``` + +## License + + MIT \ No newline at end of file diff --git a/node_modules/indexof/component.json b/node_modules/indexof/component.json new file mode 100755 index 00000000..e3430d75 --- /dev/null +++ b/node_modules/indexof/component.json @@ -0,0 +1,10 @@ +{ + "name": "indexof", + "description": "Microsoft sucks", + "version": "0.0.1", + "keywords": ["index", "array", "indexOf"], + "dependencies": {}, + "scripts": [ + "index.js" + ] +} \ No newline at end of file diff --git a/node_modules/indexof/index.js b/node_modules/indexof/index.js new file mode 100755 index 00000000..9d9667b2 --- /dev/null +++ b/node_modules/indexof/index.js @@ -0,0 +1,10 @@ + +var indexOf = [].indexOf; + +module.exports = function(arr, obj){ + if (indexOf) return arr.indexOf(obj); + for (var i = 0; i < arr.length; ++i) { + if (arr[i] === obj) return i; + } + return -1; +}; \ No newline at end of file diff --git a/node_modules/indexof/package.json b/node_modules/indexof/package.json new file mode 100755 index 00000000..8c1118a7 --- /dev/null +++ b/node_modules/indexof/package.json @@ -0,0 +1,66 @@ +{ + "_args": [ + [ + { + "raw": "indexof@0.0.1", + "scope": null, + "escapedName": "indexof", + "name": "indexof", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/vm-browserify" + ] + ], + "_from": "indexof@0.0.1", + "_id": "indexof@0.0.1", + "_inCache": true, + "_location": "/indexof", + "_phantomChildren": {}, + "_requested": { + "raw": "indexof@0.0.1", + "scope": null, + "escapedName": "indexof", + "name": "indexof", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/vm-browserify" + ], + "_resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "_shasum": "82dc336d232b9062179d05ab3293a66059fd435d", + "_shrinkwrap": null, + "_spec": "indexof@0.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/vm-browserify", + "component": { + "scripts": { + "indexof/index.js": "index.js" + } + }, + "dependencies": {}, + "description": "Microsoft sucks", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "82dc336d232b9062179d05ab3293a66059fd435d", + "tarball": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" + }, + "keywords": [ + "index", + "array", + "indexOf" + ], + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "name": "indexof", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "version": "0.0.1" +} diff --git a/node_modules/inflight/LICENSE b/node_modules/inflight/LICENSE new file mode 100755 index 00000000..05eeeb88 --- /dev/null +++ b/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/inflight/README.md b/node_modules/inflight/README.md new file mode 100755 index 00000000..6dc89291 --- /dev/null +++ b/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js new file mode 100755 index 00000000..48202b3c --- /dev/null +++ b/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json new file mode 100755 index 00000000..42f07280 --- /dev/null +++ b/node_modules/inflight/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "inflight@^1.0.4", + "scope": null, + "escapedName": "inflight", + "name": "inflight", + "rawSpec": "^1.0.4", + "spec": ">=1.0.4 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/glob" + ] + ], + "_from": "inflight@>=1.0.4 <2.0.0", + "_id": "inflight@1.0.6", + "_inCache": true, + "_location": "/inflight", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inflight-1.0.6.tgz_1476330807696_0.10388551792129874" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "inflight@^1.0.4", + "scope": null, + "escapedName": "inflight", + "name": "inflight", + "rawSpec": "^1.0.4", + "spec": ">=1.0.4 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "_shrinkwrap": null, + "_spec": "inflight@^1.0.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "description": "Add callbacks to requests in flight to avoid async duplication", + "devDependencies": { + "tap": "^7.1.2" + }, + "directories": {}, + "dist": { + "shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" + }, + "files": [ + "inflight.js" + ], + "gitHead": "a547881738c8f57b27795e584071d67cf6ac1a57", + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "inflight", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/inflight.git" + }, + "scripts": { + "test": "tap test.js --100" + }, + "version": "1.0.6" +} diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE new file mode 100755 index 00000000..dea3013d --- /dev/null +++ b/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md new file mode 100755 index 00000000..b1c56658 --- /dev/null +++ b/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js new file mode 100755 index 00000000..3b94763a --- /dev/null +++ b/node_modules/inherits/inherits.js @@ -0,0 +1,7 @@ +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js new file mode 100755 index 00000000..c1e78a75 --- /dev/null +++ b/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json new file mode 100755 index 00000000..de548fff --- /dev/null +++ b/node_modules/inherits/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "inherits@~2.0.1", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "~2.0.1", + "spec": ">=2.0.1 <2.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream" + ] + ], + "_from": "inherits@>=2.0.1 <2.1.0", + "_id": "inherits@2.0.3", + "_inCache": true, + "_location": "/inherits", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "inherits@~2.0.1", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "~2.0.1", + "spec": ">=2.0.1 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/browserify-aes", + "/chokidar", + "/duplexify", + "/glob", + "/http-errors", + "/multistream", + "/pumpify", + "/readable-stream", + "/serve-index/http-errors", + "/sockjs-client", + "/stream-browserify", + "/stream-http" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_shrinkwrap": null, + "_spec": "inherits@~2.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "dependencies": {}, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^7.1.0" + }, + "directories": {}, + "dist": { + "shasum": "633c2c83e3da42a502f52466022480f4208261de", + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f", + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "inherits", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.0.3" +} diff --git a/node_modules/interpret/CHANGELOG b/node_modules/interpret/CHANGELOG new file mode 100755 index 00000000..9f94ae5a --- /dev/null +++ b/node_modules/interpret/CHANGELOG @@ -0,0 +1,98 @@ +v0.6.6: + date: 2015-09-21 + changes: + - add support for ts-node (formerly typescript-node) +v0.6.5: + date: 2015-07-22 + changes: + - add support for typescript 1.5 via typescript-node +v0.6.4: + date: 2015-07-07 + changes: + - add support for earlgrey +v0.6.3: + date: 2015-07-03 + changes: + - prefer babel/core to babel +v0.6.2: + date: 2015-05-20 + changes: + - update module list for iced coffee-script +v0.6.1: + date: 2015-05-20 + changes: + - Fix toml loader. +v0.6.0: + date: 2015-05-19 + changes: + - Combine fallbacks and loaders into `extensions`. + - Provide implementation guidance. +v0.5.1: + date: 2015-03-01 + changes: + - Add support for CirruScript. +v0.5.0: + date: 2015-02-27 + changes: + - Refactor es6 support via Babel (formerly 6to5) +v0.4.3: + date: 2015-02-09 + changes: + - Switch support from typescript-require to typescript-register. +v0.4.2: + date: 2015-01-16 + changes: + - Add support for wisp. +v0.4.1: + date: 2015-01-10 + changes: + - Add support for 6to5 (es6) +v0.4.0: + date: 2014-01-09 + changes: + - Add support for fallback (legacy) modules + - Add support for module configurations +v0.3.10: + date: 2014-12-17 + changes: + - Add support for json5. +v0.3.9: + date: 2014-12-08 + changes: + - Add support for literate iced coffee. +v0.3.8: + date: 2014-11-20 + changes: + - Add support for [cjsx](https://github.com/jsdf/coffee-react). +v0.3.7: + date: 2014-09-08 + changes: + - Add support for [TypeScript](http://www.typescriptlang.org/). +v0.3.6: + date: 2014-08-25 + changes: + - Add support for coffee.md. +v0.3.5: + date: 2014-07-03 + changes: + - Add support for jsx. +v0.3.4: + date: 2014-06-27 + changes: + - Make .js first jsVariant entry. +v0.3.3: + date: 2014-06-02 + changes: + - Fix casing on livescript dependency. +v0.3.0: + date: 2014-04-20 + changes: + - Simplify loading of coffee-script and iced-coffee-script. +v0.2.0: + date: 2014-04-20 + changes: + - Move module loading into rechoir. +v0.1.0: + date: 2014-04-20 + changes: + - Initial public release. diff --git a/node_modules/interpret/LICENSE b/node_modules/interpret/LICENSE new file mode 100755 index 00000000..a55f5b74 --- /dev/null +++ b/node_modules/interpret/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2014 Tyler Kellen + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/interpret/README.md b/node_modules/interpret/README.md new file mode 100755 index 00000000..5b897ff3 --- /dev/null +++ b/node_modules/interpret/README.md @@ -0,0 +1,92 @@ +# interpret +> A dictionary of file extensions and associated module loaders. + +[![NPM](https://nodei.co/npm/interpret.png)](https://nodei.co/npm/interpret/) + +## What is it +This is used by [Liftoff](http://github.com/tkellen/node-liftoff) to automatically require dependencies for configuration files, and by [rechoir](http://github.com/tkellen/node-rechoir) for registering module loaders. + +## API + +### extensions +Map file types to modules which provide a [require.extensions] loader. + +```js +{ + '.babel.js': { + module: 'babel/register', + register: function (module) { + module({ + // register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353 + // which only captures the final extension (.babel.js -> .js) + extensions: '.js' + }) + } + }, + '.cirru': 'cirru-script/lib/register', + '.cjsx': 'node-cjsx/register', + '.co': 'coco', + '.coffee': ['coffee-script/register', 'coffee-script'], + '.coffee.md': ['coffee-script/register', 'coffee-script'], + '.csv': 'require-csv', + '.eg': 'earlgrey/register', + '.iced': ['iced-coffee-script/register', 'iced-coffee-script'], + '.iced.md': 'iced-coffee-script/register', + '.ini': 'require-ini', + '.js': null, + '.json': null, + '.json5': 'json5/lib/require', + '.jsx': [ + { + module: 'babel/register', + register: function (module) { + module({ + extensions: '.jsx' + }); + }, + }, + { + module: 'node-jsx', + register: function (module) { + module.install({ + extension: '.jsx', + harmony: true + }); + } + } + ], + '.litcoffee': ['coffee-script/register', 'coffee-script'], + '.liticed': 'iced-coffee-script/register', + '.ls': ['livescript', 'LiveScript'], + '.node': null, + '.toml': { + module: 'toml-require', + register: function (module) { + module.install(); + } + }, + '.ts': ['typescript-node/register', 'typescript-register', 'typescript-require'], + '.tsx': ['typescript-node/register'], + '.wisp': 'wisp/engine/node', + '.xml': 'require-xml', + '.yaml': 'require-yaml', + '.yml': 'require-yaml' +}; +``` + +### jsVariants +Same as above, but only include the extensions which are javascript variants. + +## How to use it + +Consumers should use the exported `extensions` or `jsVariants` object to determine which module should be loaded for a given extension. If a matching extension is found, consumers should do the following: + +1. If the value is null, do nothing. + +2. If the value is a string, try to require it. + +3. If the value is an object, try to require the `module` property. If successful, the `register` property (a function) should be called with the module passed as the first argument. + +4. If the value is an array, iterate over it, attempting step #2 or #3 until one of the attempts does not throw. + +[require.extensions]: http://nodejs.org/api/globals.html#globals_require_extensions diff --git a/node_modules/interpret/index.js b/node_modules/interpret/index.js new file mode 100755 index 00000000..3e498ff4 --- /dev/null +++ b/node_modules/interpret/index.js @@ -0,0 +1,105 @@ +const extensions = { + '.babel.js': [ + { + module: 'babel-core/register', + register: function (module) { + module({ + // register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353 + // which only captures the final extension (.babel.js -> .js) + extensions: '.js' + }); + } + }, + { + module: 'babel/register', + register: function (module) { + module({ + extensions: '.js' + }); + } + } + ], + '.cirru': 'cirru-script/lib/register', + '.cjsx': 'node-cjsx/register', + '.co': 'coco', + '.coffee': ['coffee-script/register', 'coffee-script'], + '.coffee.md': ['coffee-script/register', 'coffee-script'], + '.csv': 'require-csv', + '.eg': 'earlgrey/register', + '.iced': ['iced-coffee-script/register', 'iced-coffee-script'], + '.iced.md': 'iced-coffee-script/register', + '.ini': 'require-ini', + '.js': null, + '.json': null, + '.json5': 'json5/lib/require', + '.jsx': [ + { + module: 'babel-core/register', + register: function (module) { + module({ + extensions: '.jsx' + }); + } + }, + { + module: 'babel/register', + register: function (module) { + module({ + extensions: '.jsx' + }); + }, + }, + { + module: 'node-jsx', + register: function (module) { + module.install({ + extension: '.jsx', + harmony: true + }); + } + } + ], + '.litcoffee': ['coffee-script/register', 'coffee-script'], + '.liticed': 'iced-coffee-script/register', + '.ls': ['livescript', 'LiveScript'], + '.node': null, + '.toml': { + module: 'toml-require', + register: function (module) { + module.install(); + } + }, + '.ts': ['ts-node/register', 'typescript-node/register', 'typescript-register', 'typescript-require'], + '.tsx': ['ts-node/register', 'typescript-node/register'], + '.wisp': 'wisp/engine/node', + '.xml': 'require-xml', + '.yaml': 'require-yaml', + '.yml': 'require-yaml' +}; + +const jsVariantExtensions = [ + '.js', + '.babel.js', + '.cirru', + '.cjsx', + '.co', + '.coffee', + '.coffee.md', + '.eg', + '.iced', + '.iced.md', + '.jsx', + '.litcoffee', + '.liticed', + '.ls', + '.ts', + '.wisp' +]; + +module.exports = { + extensions: extensions, + jsVariants: jsVariantExtensions.reduce(function (result, ext) { + result[ext] = extensions[ext]; + return result; + }, {}) +}; diff --git a/node_modules/interpret/package.json b/node_modules/interpret/package.json new file mode 100755 index 00000000..0ab9889b --- /dev/null +++ b/node_modules/interpret/package.json @@ -0,0 +1,115 @@ +{ + "_args": [ + [ + { + "raw": "interpret@^0.6.4", + "scope": null, + "escapedName": "interpret", + "name": "interpret", + "rawSpec": "^0.6.4", + "spec": ">=0.6.4 <0.7.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack" + ] + ], + "_from": "interpret@>=0.6.4 <0.7.0", + "_id": "interpret@0.6.6", + "_inCache": true, + "_location": "/interpret", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "tkellen", + "email": "tyler@sleekcode.net" + }, + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "raw": "interpret@^0.6.4", + "scope": null, + "escapedName": "interpret", + "name": "interpret", + "rawSpec": "^0.6.4", + "spec": ">=0.6.4 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", + "_shasum": "fecd7a18e7ce5ca6abfb953e1f86213a49f1625b", + "_shrinkwrap": null, + "_spec": "interpret@^0.6.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack", + "author": { + "name": "Tyler Kellen", + "url": "http://goingslowly.com/" + }, + "bugs": { + "url": "https://github.com/tkellen/node-interpret/issues" + }, + "dependencies": {}, + "description": "A dictionary of file extensions and associated module loaders.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "fecd7a18e7ce5ca6abfb953e1f86213a49f1625b", + "tarball": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz" + }, + "gitHead": "a4056f7e7996effb277ce9cead87f9e73ecf72ae", + "homepage": "https://github.com/tkellen/node-interpret", + "keywords": [ + "cirru-script", + "cjsx", + "co", + "coco", + "coffee-script", + "coffee", + "coffee.md", + "csv", + "earlgrey", + "es", + "es6", + "iced", + "iced.md", + "iced-coffee-script", + "ini", + "js", + "json", + "json5", + "jsx", + "react", + "litcoffee", + "liticed", + "ls", + "livescript", + "toml", + "ts", + "typescript", + "wisp", + "xml", + "yaml", + "yml" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "tkellen", + "email": "tyler@sleekcode.net" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "interpret", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/tkellen/node-interpret.git" + }, + "scripts": {}, + "version": "0.6.6" +} diff --git a/node_modules/invariant/CHANGELOG.md b/node_modules/invariant/CHANGELOG.md new file mode 100755 index 00000000..5326f1a0 --- /dev/null +++ b/node_modules/invariant/CHANGELOG.md @@ -0,0 +1,33 @@ +2.1.1 / 2015-09-20 +================== + + * Use correct SPDX license. + * Test "browser.js" using browserify. + * Switch from "envify" to "loose-envify". + +2.1.0 / 2015-06-03 +================== + + * Add "envify" as a dependency. + * Fixed license field in "package.json". + +2.0.0 / 2015-02-21 +================== + + * Switch to using the "browser" field. There are now browser and server versions that respect the "format" in production. + +1.0.2 / 2014-09-24 +================== + + * Added tests, npmignore and gitignore. + * Clarifications in README. + +1.0.1 / 2014-09-24 +================== + + * Actually include 'invariant.js'. + +1.0.0 / 2014-09-24 +================== + + * Initial release. diff --git a/node_modules/invariant/LICENSE b/node_modules/invariant/LICENSE new file mode 100755 index 00000000..35b4e8fa --- /dev/null +++ b/node_modules/invariant/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016, Andres Suarez +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of invariant nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/invariant/README.md b/node_modules/invariant/README.md new file mode 100755 index 00000000..96aac6d3 --- /dev/null +++ b/node_modules/invariant/README.md @@ -0,0 +1,37 @@ +# invariant + +[![Build Status](https://travis-ci.org/zertosh/invariant.svg?branch=master)](https://travis-ci.org/zertosh/invariant) + +A mirror of Facebook's `invariant` (e.g. [React](https://github.com/facebook/react/blob/v0.13.3/src/vendor/core/invariant.js), [flux](https://github.com/facebook/flux/blob/2.0.2/src/invariant.js)). + +A way to provide descriptive errors in development but generic errors in production. + +## Install + +With [npm](http://npmjs.org) do: + +```sh +npm install invariant +``` + +## `invariant(condition, message)` + +```js +var invariant = require('invariant'); + +invariant(someTruthyVal, 'This will not throw'); +// No errors + +invariant(someFalseyVal, 'This will throw an error with this message'); +// Error: Invariant Violation: This will throw an error with this message +``` + +**Note:** When `process.env.NODE_ENV` is not `production`, the message is required. If omitted, `invariant` will throw regardless of the truthiness of the condition. When `process.env.NODE_ENV` is `production`, the message is optional – so they can be minified away. + +### Browser + +When used with [browserify](https://github.com/substack/node-browserify), it'll use `browser.js` (instead of `invariant.js`) and the [envify](https://github.com/hughsk/envify) transform will inline the value of `process.env.NODE_ENV`. + +### Node + +The node version is optimized around the performance implications of accessing `process.env`. The value of `process.env.NODE_ENV` is cached, and repeatedly used instead of reading `proces.env`. See [Server rendering is slower with npm react #812](https://github.com/facebook/react/issues/812) diff --git a/node_modules/invariant/browser.js b/node_modules/invariant/browser.js new file mode 100755 index 00000000..29ead504 --- /dev/null +++ b/node_modules/invariant/browser.js @@ -0,0 +1,51 @@ +/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var invariant = function(condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +}; + +module.exports = invariant; diff --git a/node_modules/invariant/invariant.js b/node_modules/invariant/invariant.js new file mode 100755 index 00000000..1859a2a5 --- /dev/null +++ b/node_modules/invariant/invariant.js @@ -0,0 +1,53 @@ +/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var NODE_ENV = process.env.NODE_ENV; + +var invariant = function(condition, format, a, b, c, d, e, f) { + if (NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +}; + +module.exports = invariant; diff --git a/node_modules/invariant/invariant.js.flow b/node_modules/invariant/invariant.js.flow new file mode 100755 index 00000000..361c5192 --- /dev/null +++ b/node_modules/invariant/invariant.js.flow @@ -0,0 +1,7 @@ +/* @flow */ + +declare module.exports: ( + condition: any, + format?: string, + ...args: Array +) => void; diff --git a/node_modules/invariant/package.json b/node_modules/invariant/package.json new file mode 100755 index 00000000..3c975fcc --- /dev/null +++ b/node_modules/invariant/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "invariant@^2.2.0", + "scope": null, + "escapedName": "invariant", + "name": "invariant", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-traverse" + ] + ], + "_from": "invariant@>=2.2.0 <3.0.0", + "_id": "invariant@2.2.2", + "_inCache": true, + "_location": "/invariant", + "_nodeVersion": "6.3.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/invariant-2.2.2.tgz_1479211323359_0.31182572920806706" + }, + "_npmUser": { + "name": "zertosh", + "email": "zertosh@gmail.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "invariant@^2.2.0", + "scope": null, + "escapedName": "invariant", + "name": "invariant", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-traverse" + ], + "_resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "_shasum": "9e1f56ac0acdb6bf303306f338be3b204ae60360", + "_shrinkwrap": null, + "_spec": "invariant@^2.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-traverse", + "author": { + "name": "Andres Suarez", + "email": "zertosh@gmail.com" + }, + "browser": "browser.js", + "browserify": { + "transform": [ + "loose-envify" + ] + }, + "bugs": { + "url": "https://github.com/zertosh/invariant/issues" + }, + "dependencies": { + "loose-envify": "^1.0.0" + }, + "description": "invariant", + "devDependencies": { + "browserify": "^11.0.1", + "flow-bin": "^0.35.0", + "tap": "^1.4.0" + }, + "directories": {}, + "dist": { + "shasum": "9e1f56ac0acdb6bf303306f338be3b204ae60360", + "tarball": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz" + }, + "files": [ + "browser.js", + "invariant.js", + "invariant.js.flow" + ], + "gitHead": "49ae54d5a09c99a447e7dafa46bd3aa8f6923d98", + "homepage": "https://github.com/zertosh/invariant#readme", + "keywords": [ + "test", + "invariant" + ], + "license": "BSD-3-Clause", + "main": "invariant.js", + "maintainers": [ + { + "name": "cpojer", + "email": "christoph.pojer@gmail.com" + }, + { + "name": "zertosh", + "email": "zertosh@gmail.com" + } + ], + "name": "invariant", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/zertosh/invariant.git" + }, + "scripts": { + "test": "NODE_ENV=production tap test/*.js && NODE_ENV=development tap test/*.js" + }, + "version": "2.2.2" +} diff --git a/node_modules/ipaddr.js/.npmignore b/node_modules/ipaddr.js/.npmignore new file mode 100755 index 00000000..7a1537ba --- /dev/null +++ b/node_modules/ipaddr.js/.npmignore @@ -0,0 +1,2 @@ +.idea +node_modules diff --git a/node_modules/ipaddr.js/.travis.yml b/node_modules/ipaddr.js/.travis.yml new file mode 100755 index 00000000..aa3d14ac --- /dev/null +++ b/node_modules/ipaddr.js/.travis.yml @@ -0,0 +1,10 @@ +language: node_js + +node_js: + - "0.10" + - "0.11" + - "0.12" + - "4.0" + - "4.1" + - "4.2" + - "5" diff --git a/node_modules/ipaddr.js/Cakefile b/node_modules/ipaddr.js/Cakefile new file mode 100755 index 00000000..7fd355a7 --- /dev/null +++ b/node_modules/ipaddr.js/Cakefile @@ -0,0 +1,18 @@ +fs = require 'fs' +CoffeeScript = require 'coffee-script' +nodeunit = require 'nodeunit' +UglifyJS = require 'uglify-js' + +task 'build', 'build the JavaScript files from CoffeeScript source', build = (cb) -> + source = fs.readFileSync 'src/ipaddr.coffee' + fs.writeFileSync 'lib/ipaddr.js', CoffeeScript.compile source.toString() + + invoke 'test' + invoke 'compress' + +task 'test', 'run the bundled tests', (cb) -> + nodeunit.reporters.default.run ['test'] + +task 'compress', 'uglify the resulting javascript', (cb) -> + result = UglifyJS.minify('lib/ipaddr.js') + fs.writeFileSync('ipaddr.min.js', result.code) diff --git a/node_modules/ipaddr.js/LICENSE b/node_modules/ipaddr.js/LICENSE new file mode 100755 index 00000000..3493f0df --- /dev/null +++ b/node_modules/ipaddr.js/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2011 Peter Zotov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/ipaddr.js/README.md b/node_modules/ipaddr.js/README.md new file mode 100755 index 00000000..1d2b42dc --- /dev/null +++ b/node_modules/ipaddr.js/README.md @@ -0,0 +1,211 @@ +# ipaddr.js — an IPv6 and IPv4 address manipulation library [![Build Status](https://travis-ci.org/whitequark/ipaddr.js.svg)](https://travis-ci.org/whitequark/ipaddr.js) + +ipaddr.js is a small (1.9K minified and gzipped) library for manipulating +IP addresses in JavaScript environments. It runs on both CommonJS runtimes +(e.g. [nodejs]) and in a web browser. + +ipaddr.js allows you to verify and parse string representation of an IP +address, match it against a CIDR range or range list, determine if it falls +into some reserved ranges (examples include loopback and private ranges), +and convert between IPv4 and IPv4-mapped IPv6 addresses. + +[nodejs]: http://nodejs.org + +## Installation + +`npm install ipaddr.js` + +or + +`bower install ipaddr.js` + +## API + +ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS, +it is exported from the module: + +```js +var ipaddr = require('ipaddr.js'); +``` + +The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4. + +### Global methods + +There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and +`ipaddr.process`. All of them receive a string as a single parameter. + +The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or +IPv6 address, and `false` otherwise. It does not throw any exceptions. + +The `ipaddr.parse` method returns an object representing the IP address, +or throws an `Error` if the passed string is not a valid representation of an +IP address. + +The `ipaddr.process` method works just like the `ipaddr.parse` one, but it +automatically converts IPv4-mapped IPv6 addresses to their IPv4 couterparts +before returning. It is useful when you have a Node.js instance listening +on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its +equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4 +connections on your IPv6-only socket, but the remote address will be mangled. +Use `ipaddr.process` method to automatically demangle it. + +### Object representation + +Parsing methods return an object which descends from `ipaddr.IPv6` or +`ipaddr.IPv4`. These objects share some properties, but most of them differ. + +#### Shared properties + +One can determine the type of address by calling `addr.kind()`. It will return +either `"ipv6"` or `"ipv4"`. + +An address can be converted back to its string representation with `addr.toString()`. +Note that this method: + * does not return the original string used to create the object (in fact, there is + no way of getting that string) + * returns a compact representation (when it is applicable) + +A `match(range, bits)` method can be used to check if the address falls into a +certain CIDR range. +Note that an address can be (obviously) matched only against an address of the same type. + +For example: + +```js +var addr = ipaddr.parse("2001:db8:1234::1"); +var range = ipaddr.parse("2001:db8::"); + +addr.match(range, 32); // => true +``` + +Alternatively, `match` can also be called as `match([range, bits])`. In this way, +it can be used together with the `parseCIDR(string)` method, which parses an IP +address together with a CIDR range. + +For example: + +```js +var addr = ipaddr.parse("2001:db8:1234::1"); + +addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true +``` + +A `range()` method returns one of predefined names for several special ranges defined +by IP protocols. The exact names (and their respective CIDR ranges) can be looked up +in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"` +(the default one) and `"reserved"`. + +You can match against your own range list by using +`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with both +IPv6 and IPv4 addresses, and accepts a name-to-subnet map as the range list. For example: + +```js +var rangeList = { + documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ], + tunnelProviders: [ + [ ipaddr.parse('2001:470::'), 32 ], // he.net + [ ipaddr.parse('2001:5c0::'), 32 ] // freenet6 + ] +}; +ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "he.net" +``` + +The addresses can be converted to their byte representation with `toByteArray()`. +(Actually, JavaScript mostly does not know about byte buffers. They are emulated with +arrays of numbers, each in range of 0..255.) + +```js +var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com +bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, , 0x00, 0x68 ] +``` + +The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them +have the same interface for both protocols, and are similar to global methods. + +`ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address +for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser. + +`ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format. + +[IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186 +[IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71 + +#### IPv6 properties + +Sometimes you will want to convert IPv6 not to a compact string representation (with +the `::` substitution); the `toNormalizedString()` method will return an address where +all zeroes are explicit. + +For example: + +```js +var addr = ipaddr.parse("2001:0db8::0001"); +addr.toString(); // => "2001:db8::1" +addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1" +``` + +The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped +one, and `toIPv4Address()` will return an IPv4 object address. + +To access the underlying binary representation of the address, use `addr.parts`. + +```js +var addr = ipaddr.parse("2001:db8:10::1234:DEAD"); +addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead] +``` + +#### IPv4 properties + +`toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address. + +To access the underlying representation of the address, use `addr.octets`. + +```js +var addr = ipaddr.parse("192.168.1.1"); +addr.octets // => [192, 168, 1, 1] +``` + +`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or +false if the netmask is not valid. + +```js +ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28 +ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null +``` + +#### Conversion + +IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays. + +The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object +if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values, +while for IPv6 it has to be an array of sixteen 8-bit values. + +For example: +```js +var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]); +addr.toString(); // => "127.0.0.1" +``` + +or + +```js +var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) +addr.toString(); // => "2001:db8::1" +``` + +Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB). + +For example: +```js +var addr = ipaddr.parse("127.0.0.1"); +addr.toByteArray(); // => [0x7f, 0, 0, 1] +``` + +or + +```js +var addr = ipaddr.parse("2001:db8::1"); +addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] +``` diff --git a/node_modules/ipaddr.js/bower.json b/node_modules/ipaddr.js/bower.json new file mode 100755 index 00000000..2f5093e9 --- /dev/null +++ b/node_modules/ipaddr.js/bower.json @@ -0,0 +1,29 @@ +{ + "name": "ipaddr.js", + "version": "1.3.0", + "homepage": "https://github.com/whitequark/ipaddr.js", + "authors": [ + "whitequark " + ], + "description": "IP address manipulation library in JavaScript (CoffeeScript, actually)", + "main": "lib/ipaddr.js", + "moduleType": [ + "globals", + "node" + ], + "keywords": [ + "javscript", + "ip", + "address", + "ipv4", + "ipv6" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/ipaddr.js/ipaddr.min.js b/node_modules/ipaddr.js/ipaddr.min.js new file mode 100755 index 00000000..d90a4804 --- /dev/null +++ b/node_modules/ipaddr.js/ipaddr.min.js @@ -0,0 +1 @@ +(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if(o=n-e,o<0&&(o=0),r[i]>>o!=t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(e in t)for(i=t[e],!i[0]||i[0]instanceof Array||(i=[i]),a=0,s=i.length;a=0;t=a+=-1){if(!((n=this.octets[t])in o))return null;if(i=o[n],e&&0!==i)return null;8!==i&&(e=!0),r+=i}return 32-r},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(o=t.slice(1,6),a=[],r=0,e=o.length;r4294967295||a<0)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;r<=24;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r){var t,n,e,i,o,a;if(16===r.length)for(this.parts=[],t=e=0;e<=14;t=e+=2)this.parts.push(r[t]<<8|r[t+1]);else{if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=r}for(a=this.parts,i=0,o=a.length;i>8),r.push(255&t);return r},r.prototype.toNormalizedString=function(){var r;return function(){var t,n,e,i;for(e=this.parts,i=[],t=0,n=e.length;t>8,255&r,n>>8,255&n])},r}(),i="(?:[0-9a-f]+::?)+",o={native:new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+n+"\\."+n+"\\."+n+"\\."+n+"$","i")},r=function(r,t){var n,e,i,o,a;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for(n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(a=t-n,o=":";a--;)o+="0:";return r=r.replace("::",o),":"===r[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),function(){var t,n,e,o;for(e=r.split(":"),o=[],t=0,n=e.length;t=0&&t<=32)return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv6.parseCIDR=function(r){var t,n;if((n=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]))>=0&&t<=128)return[this.parse(n[1]),t];throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){try{return t.IPv6.parseCIDR(r)}catch(n){n;try{return t.IPv4.parseCIDR(r)}catch(r){throw r,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.fromByteArray=function(r){var n;if(4===(n=r.length))return new t.IPv4(r);if(16===n)return new t.IPv6(r);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file diff --git a/node_modules/ipaddr.js/lib/ipaddr.js b/node_modules/ipaddr.js/lib/ipaddr.js new file mode 100755 index 00000000..8bef4077 --- /dev/null +++ b/node_modules/ipaddr.js/lib/ipaddr.js @@ -0,0 +1,535 @@ +(function() { + var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root; + + ipaddr = {}; + + root = this; + + if ((typeof module !== "undefined" && module !== null) && module.exports) { + module.exports = ipaddr; + } else { + root['ipaddr'] = ipaddr; + } + + matchCIDR = function(first, second, partSize, cidrBits) { + var part, shift; + if (first.length !== second.length) { + throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); + } + part = 0; + while (cidrBits > 0) { + shift = partSize - cidrBits; + if (shift < 0) { + shift = 0; + } + if (first[part] >> shift !== second[part] >> shift) { + return false; + } + cidrBits -= partSize; + part += 1; + } + return true; + }; + + ipaddr.subnetMatch = function(address, rangeList, defaultName) { + var rangeName, rangeSubnets, subnet, _i, _len; + if (defaultName == null) { + defaultName = 'unicast'; + } + for (rangeName in rangeList) { + rangeSubnets = rangeList[rangeName]; + if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { + rangeSubnets = [rangeSubnets]; + } + for (_i = 0, _len = rangeSubnets.length; _i < _len; _i++) { + subnet = rangeSubnets[_i]; + if (address.match.apply(address, subnet)) { + return rangeName; + } + } + } + return defaultName; + }; + + ipaddr.IPv4 = (function() { + function IPv4(octets) { + var octet, _i, _len; + if (octets.length !== 4) { + throw new Error("ipaddr: ipv4 octet count should be 4"); + } + for (_i = 0, _len = octets.length; _i < _len; _i++) { + octet = octets[_i]; + if (!((0 <= octet && octet <= 255))) { + throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); + } + } + this.octets = octets; + } + + IPv4.prototype.kind = function() { + return 'ipv4'; + }; + + IPv4.prototype.toString = function() { + return this.octets.join("."); + }; + + IPv4.prototype.toByteArray = function() { + return this.octets.slice(0); + }; + + IPv4.prototype.match = function(other, cidrRange) { + var _ref; + if (cidrRange === void 0) { + _ref = other, other = _ref[0], cidrRange = _ref[1]; + } + if (other.kind() !== 'ipv4') { + throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); + } + return matchCIDR(this.octets, other.octets, 8, cidrRange); + }; + + IPv4.prototype.SpecialRanges = { + unspecified: [[new IPv4([0, 0, 0, 0]), 8]], + broadcast: [[new IPv4([255, 255, 255, 255]), 32]], + multicast: [[new IPv4([224, 0, 0, 0]), 4]], + linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], + loopback: [[new IPv4([127, 0, 0, 0]), 8]], + carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], + "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]], + reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]] + }; + + IPv4.prototype.range = function() { + return ipaddr.subnetMatch(this, this.SpecialRanges); + }; + + IPv4.prototype.toIPv4MappedAddress = function() { + return ipaddr.IPv6.parse("::ffff:" + (this.toString())); + }; + + IPv4.prototype.prefixLengthFromSubnetMask = function() { + var cidr, i, octet, stop, zeros, zerotable, _i; + zerotable = { + 0: 8, + 128: 7, + 192: 6, + 224: 5, + 240: 4, + 248: 3, + 252: 2, + 254: 1, + 255: 0 + }; + cidr = 0; + stop = false; + for (i = _i = 3; _i >= 0; i = _i += -1) { + octet = this.octets[i]; + if (octet in zerotable) { + zeros = zerotable[octet]; + if (stop && zeros !== 0) { + return null; + } + if (zeros !== 8) { + stop = true; + } + cidr += zeros; + } else { + return null; + } + } + return 32 - cidr; + }; + + return IPv4; + + })(); + + ipv4Part = "(0?\\d+|0x[a-f0-9]+)"; + + ipv4Regexes = { + fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'), + longValue: new RegExp("^" + ipv4Part + "$", 'i') + }; + + ipaddr.IPv4.parser = function(string) { + var match, parseIntAuto, part, shift, value; + parseIntAuto = function(string) { + if (string[0] === "0" && string[1] !== "x") { + return parseInt(string, 8); + } else { + return parseInt(string); + } + }; + if (match = string.match(ipv4Regexes.fourOctet)) { + return (function() { + var _i, _len, _ref, _results; + _ref = match.slice(1, 6); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + part = _ref[_i]; + _results.push(parseIntAuto(part)); + } + return _results; + })(); + } else if (match = string.match(ipv4Regexes.longValue)) { + value = parseIntAuto(match[1]); + if (value > 0xffffffff || value < 0) { + throw new Error("ipaddr: address outside defined range"); + } + return ((function() { + var _i, _results; + _results = []; + for (shift = _i = 0; _i <= 24; shift = _i += 8) { + _results.push((value >> shift) & 0xff); + } + return _results; + })()).reverse(); + } else { + return null; + } + }; + + ipaddr.IPv6 = (function() { + function IPv6(parts) { + var i, part, _i, _j, _len, _ref; + if (parts.length === 16) { + this.parts = []; + for (i = _i = 0; _i <= 14; i = _i += 2) { + this.parts.push((parts[i] << 8) | parts[i + 1]); + } + } else if (parts.length === 8) { + this.parts = parts; + } else { + throw new Error("ipaddr: ipv6 part count should be 8 or 16"); + } + _ref = this.parts; + for (_j = 0, _len = _ref.length; _j < _len; _j++) { + part = _ref[_j]; + if (!((0 <= part && part <= 0xffff))) { + throw new Error("ipaddr: ipv6 part should fit in 16 bits"); + } + } + } + + IPv6.prototype.kind = function() { + return 'ipv6'; + }; + + IPv6.prototype.toString = function() { + var compactStringParts, part, pushPart, state, stringParts, _i, _len; + stringParts = (function() { + var _i, _len, _ref, _results; + _ref = this.parts; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + part = _ref[_i]; + _results.push(part.toString(16)); + } + return _results; + }).call(this); + compactStringParts = []; + pushPart = function(part) { + return compactStringParts.push(part); + }; + state = 0; + for (_i = 0, _len = stringParts.length; _i < _len; _i++) { + part = stringParts[_i]; + switch (state) { + case 0: + if (part === '0') { + pushPart(''); + } else { + pushPart(part); + } + state = 1; + break; + case 1: + if (part === '0') { + state = 2; + } else { + pushPart(part); + } + break; + case 2: + if (part !== '0') { + pushPart(''); + pushPart(part); + state = 3; + } + break; + case 3: + pushPart(part); + } + } + if (state === 2) { + pushPart(''); + pushPart(''); + } + return compactStringParts.join(":"); + }; + + IPv6.prototype.toByteArray = function() { + var bytes, part, _i, _len, _ref; + bytes = []; + _ref = this.parts; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + part = _ref[_i]; + bytes.push(part >> 8); + bytes.push(part & 0xff); + } + return bytes; + }; + + IPv6.prototype.toNormalizedString = function() { + var part; + return ((function() { + var _i, _len, _ref, _results; + _ref = this.parts; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + part = _ref[_i]; + _results.push(part.toString(16)); + } + return _results; + }).call(this)).join(":"); + }; + + IPv6.prototype.match = function(other, cidrRange) { + var _ref; + if (cidrRange === void 0) { + _ref = other, other = _ref[0], cidrRange = _ref[1]; + } + if (other.kind() !== 'ipv6') { + throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); + } + return matchCIDR(this.parts, other.parts, 16, cidrRange); + }; + + IPv6.prototype.SpecialRanges = { + unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128], + linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10], + multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8], + loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128], + uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7], + ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96], + rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96], + rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96], + '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16], + teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32], + reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]] + }; + + IPv6.prototype.range = function() { + return ipaddr.subnetMatch(this, this.SpecialRanges); + }; + + IPv6.prototype.isIPv4MappedAddress = function() { + return this.range() === 'ipv4Mapped'; + }; + + IPv6.prototype.toIPv4Address = function() { + var high, low, _ref; + if (!this.isIPv4MappedAddress()) { + throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); + } + _ref = this.parts.slice(-2), high = _ref[0], low = _ref[1]; + return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]); + }; + + return IPv6; + + })(); + + ipv6Part = "(?:[0-9a-f]+::?)+"; + + ipv6Regexes = { + "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?$", 'i'), + transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + ("" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$"), 'i') + }; + + expandIPv6 = function(string, parts) { + var colonCount, lastColon, part, replacement, replacementCount; + if (string.indexOf('::') !== string.lastIndexOf('::')) { + return null; + } + colonCount = 0; + lastColon = -1; + while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) { + colonCount++; + } + if (string.substr(0, 2) === '::') { + colonCount--; + } + if (string.substr(-2, 2) === '::') { + colonCount--; + } + if (colonCount > parts) { + return null; + } + replacementCount = parts - colonCount; + replacement = ':'; + while (replacementCount--) { + replacement += '0:'; + } + string = string.replace('::', replacement); + if (string[0] === ':') { + string = string.slice(1); + } + if (string[string.length - 1] === ':') { + string = string.slice(0, -1); + } + return (function() { + var _i, _len, _ref, _results; + _ref = string.split(":"); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + part = _ref[_i]; + _results.push(parseInt(part, 16)); + } + return _results; + })(); + }; + + ipaddr.IPv6.parser = function(string) { + var match, octet, octets, parts, _i, _len; + if (string.match(ipv6Regexes['native'])) { + return expandIPv6(string, 8); + } else if (match = string.match(ipv6Regexes['transitional'])) { + parts = expandIPv6(match[1].slice(0, -1), 6); + if (parts) { + octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; + for (_i = 0, _len = octets.length; _i < _len; _i++) { + octet = octets[_i]; + if (!((0 <= octet && octet <= 255))) { + return null; + } + } + parts.push(octets[0] << 8 | octets[1]); + parts.push(octets[2] << 8 | octets[3]); + return parts; + } + } + return null; + }; + + ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) { + return this.parser(string) !== null; + }; + + ipaddr.IPv4.isValid = function(string) { + var e; + try { + new this(this.parser(string)); + return true; + } catch (_error) { + e = _error; + return false; + } + }; + + ipaddr.IPv4.isValidFourPartDecimal = function(string) { + if (ipaddr.IPv4.isValid(string) && string.match(/^\d+(\.\d+){3}$/)) { + return true; + } else { + return false; + } + }; + + ipaddr.IPv6.isValid = function(string) { + var e; + if (typeof string === "string" && string.indexOf(":") === -1) { + return false; + } + try { + new this(this.parser(string)); + return true; + } catch (_error) { + e = _error; + return false; + } + }; + + ipaddr.IPv4.parse = ipaddr.IPv6.parse = function(string) { + var parts; + parts = this.parser(string); + if (parts === null) { + throw new Error("ipaddr: string is not formatted like ip address"); + } + return new this(parts); + }; + + ipaddr.IPv4.parseCIDR = function(string) { + var maskLength, match; + if (match = string.match(/^(.+)\/(\d+)$/)) { + maskLength = parseInt(match[2]); + if (maskLength >= 0 && maskLength <= 32) { + return [this.parse(match[1]), maskLength]; + } + } + throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); + }; + + ipaddr.IPv6.parseCIDR = function(string) { + var maskLength, match; + if (match = string.match(/^(.+)\/(\d+)$/)) { + maskLength = parseInt(match[2]); + if (maskLength >= 0 && maskLength <= 128) { + return [this.parse(match[1]), maskLength]; + } + } + throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); + }; + + ipaddr.isValid = function(string) { + return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string); + }; + + ipaddr.parse = function(string) { + if (ipaddr.IPv6.isValid(string)) { + return ipaddr.IPv6.parse(string); + } else if (ipaddr.IPv4.isValid(string)) { + return ipaddr.IPv4.parse(string); + } else { + throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); + } + }; + + ipaddr.parseCIDR = function(string) { + var e; + try { + return ipaddr.IPv6.parseCIDR(string); + } catch (_error) { + e = _error; + try { + return ipaddr.IPv4.parseCIDR(string); + } catch (_error) { + e = _error; + throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); + } + } + }; + + ipaddr.fromByteArray = function(bytes) { + var length; + length = bytes.length; + if (length === 4) { + return new ipaddr.IPv4(bytes); + } else if (length === 16) { + return new ipaddr.IPv6(bytes); + } else { + throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); + } + }; + + ipaddr.process = function(string) { + var addr; + addr = this.parse(string); + if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) { + return addr.toIPv4Address(); + } else { + return addr; + } + }; + +}).call(this); diff --git a/node_modules/ipaddr.js/package.json b/node_modules/ipaddr.js/package.json new file mode 100755 index 00000000..4f68f2cc --- /dev/null +++ b/node_modules/ipaddr.js/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + { + "raw": "ipaddr.js@1.3.0", + "scope": null, + "escapedName": "ipaddr.js", + "name": "ipaddr.js", + "rawSpec": "1.3.0", + "spec": "1.3.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/proxy-addr" + ] + ], + "_from": "ipaddr.js@1.3.0", + "_id": "ipaddr.js@1.3.0", + "_inCache": true, + "_location": "/ipaddr.js", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ipaddr.js-1.3.0.tgz_1489544932893_0.961968986550346" + }, + "_npmUser": { + "name": "whitequark", + "email": "whitequark@whitequark.org" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "raw": "ipaddr.js@1.3.0", + "scope": null, + "escapedName": "ipaddr.js", + "name": "ipaddr.js", + "rawSpec": "1.3.0", + "spec": "1.3.0", + "type": "version" + }, + "_requiredBy": [ + "/proxy-addr" + ], + "_resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.3.0.tgz", + "_shasum": "1e03a52fdad83a8bbb2b25cbf4998b4cffcd3dec", + "_shrinkwrap": null, + "_spec": "ipaddr.js@1.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/proxy-addr", + "author": { + "name": "whitequark", + "email": "whitequark@whitequark.org" + }, + "bugs": { + "url": "https://github.com/whitequark/ipaddr.js/issues" + }, + "dependencies": {}, + "description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.", + "devDependencies": { + "coffee-script": "~1.6", + "nodeunit": ">=0.8.2 <0.8.7", + "uglify-js": "latest" + }, + "directories": { + "lib": "./lib" + }, + "dist": { + "shasum": "1e03a52fdad83a8bbb2b25cbf4998b4cffcd3dec", + "tarball": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.3.0.tgz" + }, + "engines": { + "node": ">= 0.10" + }, + "gitHead": "9c557556e495a2c60a3c656e4f9f8b3a1e14dedc", + "homepage": "https://github.com/whitequark/ipaddr.js#readme", + "keywords": [ + "ip", + "ipv4", + "ipv6" + ], + "license": "MIT", + "main": "./lib/ipaddr", + "maintainers": [ + { + "name": "whitequark", + "email": "whitequark@whitequark.org" + } + ], + "name": "ipaddr.js", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/whitequark/ipaddr.js.git" + }, + "scripts": { + "test": "cake build test" + }, + "version": "1.3.0" +} diff --git a/node_modules/ipaddr.js/src/ipaddr.coffee b/node_modules/ipaddr.js/src/ipaddr.coffee new file mode 100755 index 00000000..941014c8 --- /dev/null +++ b/node_modules/ipaddr.js/src/ipaddr.coffee @@ -0,0 +1,460 @@ +# Define the main object +ipaddr = {} + +root = this + +# Export for both the CommonJS and browser-like environment +if module? && module.exports + module.exports = ipaddr +else + root['ipaddr'] = ipaddr + +# A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher. +matchCIDR = (first, second, partSize, cidrBits) -> + if first.length != second.length + throw new Error "ipaddr: cannot match CIDR for objects with different lengths" + + part = 0 + while cidrBits > 0 + shift = partSize - cidrBits + shift = 0 if shift < 0 + + if first[part] >> shift != second[part] >> shift + return false + + cidrBits -= partSize + part += 1 + + return true + +# An utility function to ease named range matching. See examples below. +ipaddr.subnetMatch = (address, rangeList, defaultName='unicast') -> + for rangeName, rangeSubnets of rangeList + # ECMA5 Array.isArray isn't available everywhere + if rangeSubnets[0] && !(rangeSubnets[0] instanceof Array) + rangeSubnets = [ rangeSubnets ] + + for subnet in rangeSubnets + return rangeName if address.match.apply(address, subnet) + + return defaultName + +# An IPv4 address (RFC791). +class ipaddr.IPv4 + # Constructs a new IPv4 address from an array of four octets + # in network order (MSB first) + # Verifies the input. + constructor: (octets) -> + if octets.length != 4 + throw new Error "ipaddr: ipv4 octet count should be 4" + + for octet in octets + if !(0 <= octet <= 255) + throw new Error "ipaddr: ipv4 octet should fit in 8 bits" + + @octets = octets + + # The 'kind' method exists on both IPv4 and IPv6 classes. + kind: -> + return 'ipv4' + + # Returns the address in convenient, decimal-dotted format. + toString: -> + return @octets.join "." + + # Returns an array of byte-sized values in network order (MSB first) + toByteArray: -> + return @octets.slice(0) # octets.clone + + # Checks if this address matches other one within given CIDR range. + match: (other, cidrRange) -> + if cidrRange == undefined + [other, cidrRange] = other + + if other.kind() != 'ipv4' + throw new Error "ipaddr: cannot match ipv4 address with non-ipv4 one" + + return matchCIDR(this.octets, other.octets, 8, cidrRange) + + # Special IPv4 address ranges. + # See also https://en.wikipedia.org/wiki/Reserved_IP_addresses + SpecialRanges: + unspecified: [ + [ new IPv4([0, 0, 0, 0]), 8 ] + ] + broadcast: [ + [ new IPv4([255, 255, 255, 255]), 32 ] + ] + multicast: [ # RFC3171 + [ new IPv4([224, 0, 0, 0]), 4 ] + ] + linkLocal: [ # RFC3927 + [ new IPv4([169, 254, 0, 0]), 16 ] + ] + loopback: [ # RFC5735 + [ new IPv4([127, 0, 0, 0]), 8 ] + ] + carrierGradeNat: [ # RFC6598 + [ new IPv4([100, 64, 0, 0]), 10 ] + ] + private: [ # RFC1918 + [ new IPv4([10, 0, 0, 0]), 8 ] + [ new IPv4([172, 16, 0, 0]), 12 ] + [ new IPv4([192, 168, 0, 0]), 16 ] + ] + reserved: [ # Reserved and testing-only ranges; RFCs 5735, 5737, 2544, 1700 + [ new IPv4([192, 0, 0, 0]), 24 ] + [ new IPv4([192, 0, 2, 0]), 24 ] + [ new IPv4([192, 88, 99, 0]), 24 ] + [ new IPv4([198, 51, 100, 0]), 24 ] + [ new IPv4([203, 0, 113, 0]), 24 ] + [ new IPv4([240, 0, 0, 0]), 4 ] + ] + + # Checks if the address corresponds to one of the special ranges. + range: -> + return ipaddr.subnetMatch(this, @SpecialRanges) + + # Convrets this IPv4 address to an IPv4-mapped IPv6 address. + toIPv4MappedAddress: -> + return ipaddr.IPv6.parse "::ffff:#{@toString()}" + + # returns a number of leading ones in IPv4 address, making sure that + # the rest is a solid sequence of 0's (valid netmask) + # returns either the CIDR length or null if mask is not valid + prefixLengthFromSubnetMask: -> + # number of zeroes in octet + zerotable = + 0: 8 + 128: 7 + 192: 6 + 224: 5 + 240: 4 + 248: 3 + 252: 2 + 254: 1 + 255: 0 + + cidr = 0 + # non-zero encountered stop scanning for zeroes + stop = false + for i in [3..0] by -1 + octet = @octets[i] + if octet of zerotable + zeros = zerotable[octet] + if stop and zeros != 0 + return null + unless zeros == 8 + stop = true + cidr += zeros + else + return null + return 32 - cidr + +# A list of regular expressions that match arbitrary IPv4 addresses, +# for which a number of weird notations exist. +# Note that an address like 0010.0xa5.1.1 is considered legal. +ipv4Part = "(0?\\d+|0x[a-f0-9]+)" +ipv4Regexes = + fourOctet: new RegExp "^#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}$", 'i' + longValue: new RegExp "^#{ipv4Part}$", 'i' + +# Classful variants (like a.b, where a is an octet, and b is a 24-bit +# value representing last three octets; this corresponds to a class C +# address) are omitted due to classless nature of modern Internet. +ipaddr.IPv4.parser = (string) -> + parseIntAuto = (string) -> + if string[0] == "0" && string[1] != "x" + parseInt(string, 8) + else + parseInt(string) + + # parseInt recognizes all that octal & hexadecimal weirdness for us + if match = string.match(ipv4Regexes.fourOctet) + return (parseIntAuto(part) for part in match[1..5]) + else if match = string.match(ipv4Regexes.longValue) + value = parseIntAuto(match[1]) + if value > 0xffffffff || value < 0 + throw new Error "ipaddr: address outside defined range" + return ((value >> shift) & 0xff for shift in [0..24] by 8).reverse() + else + return null + +# An IPv6 address (RFC2460) +class ipaddr.IPv6 + # Constructs an IPv6 address from an array of eight 16-bit parts + # or sixteen 8-bit parts in network order (MSB first). + # Throws an error if the input is invalid. + constructor: (parts) -> + if parts.length == 16 + @parts = [] + for i in [0..14] by 2 + @parts.push((parts[i] << 8) | parts[i + 1]) + else if parts.length == 8 + @parts = parts + else + throw new Error "ipaddr: ipv6 part count should be 8 or 16" + + for part in @parts + if !(0 <= part <= 0xffff) + throw new Error "ipaddr: ipv6 part should fit in 16 bits" + + # The 'kind' method exists on both IPv4 and IPv6 classes. + kind: -> + return 'ipv6' + + # Returns the address in compact, human-readable format like + # 2001:db8:8:66::1 + toString: -> + stringParts = (part.toString(16) for part in @parts) + + compactStringParts = [] + pushPart = (part) -> compactStringParts.push part + + state = 0 + for part in stringParts + switch state + when 0 + if part == '0' + pushPart('') + else + pushPart(part) + + state = 1 + when 1 + if part == '0' + state = 2 + else + pushPart(part) + when 2 + unless part == '0' + pushPart('') + pushPart(part) + state = 3 + when 3 + pushPart(part) + + if state == 2 + pushPart('') + pushPart('') + + return compactStringParts.join ":" + + # Returns an array of byte-sized values in network order (MSB first) + toByteArray: -> + bytes = [] + for part in @parts + bytes.push(part >> 8) + bytes.push(part & 0xff) + + return bytes + + # Returns the address in expanded format with all zeroes included, like + # 2001:db8:8:66:0:0:0:1 + toNormalizedString: -> + return (part.toString(16) for part in @parts).join ":" + + # Checks if this address matches other one within given CIDR range. + match: (other, cidrRange) -> + if cidrRange == undefined + [other, cidrRange] = other + + if other.kind() != 'ipv6' + throw new Error "ipaddr: cannot match ipv6 address with non-ipv6 one" + + return matchCIDR(this.parts, other.parts, 16, cidrRange) + + # Special IPv6 ranges + SpecialRanges: + unspecified: [ new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128 ] # RFC4291, here and after + linkLocal: [ new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10 ] + multicast: [ new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8 ] + loopback: [ new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128 ] + uniqueLocal: [ new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7 ] + ipv4Mapped: [ new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96 ] + rfc6145: [ new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96 ] # RFC6145 + rfc6052: [ new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96 ] # RFC6052 + '6to4': [ new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16 ] # RFC3056 + teredo: [ new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32 ] # RFC6052, RFC6146 + reserved: [ + [ new IPv6([ 0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32 ] # RFC4291 + ] + + # Checks if the address corresponds to one of the special ranges. + range: -> + return ipaddr.subnetMatch(this, @SpecialRanges) + + # Checks if this address is an IPv4-mapped IPv6 address. + isIPv4MappedAddress: -> + return @range() == 'ipv4Mapped' + + # Converts this address to IPv4 address if it is an IPv4-mapped IPv6 address. + # Throws an error otherwise. + toIPv4Address: -> + unless @isIPv4MappedAddress() + throw new Error "ipaddr: trying to convert a generic ipv6 address to ipv4" + + [high, low] = @parts[-2..-1] + + return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]) + +# IPv6-matching regular expressions. +# For IPv6, the task is simpler: it is enough to match the colon-delimited +# hexadecimal IPv6 and a transitional variant with dotted-decimal IPv4 at +# the end. +ipv6Part = "(?:[0-9a-f]+::?)+" +ipv6Regexes = + native: new RegExp "^(::)?(#{ipv6Part})?([0-9a-f]+)?(::)?$", 'i' + transitional: new RegExp "^((?:#{ipv6Part})|(?:::)(?:#{ipv6Part})?)" + + "#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}$", 'i' + +# Expand :: in an IPv6 address or address part consisting of `parts` groups. +expandIPv6 = (string, parts) -> + # More than one '::' means invalid adddress + if string.indexOf('::') != string.lastIndexOf('::') + return null + + # How many parts do we already have? + colonCount = 0 + lastColon = -1 + while (lastColon = string.indexOf(':', lastColon + 1)) >= 0 + colonCount++ + + # 0::0 is two parts more than :: + colonCount-- if string.substr(0, 2) == '::' + colonCount-- if string.substr(-2, 2) == '::' + + # The following loop would hang if colonCount > parts + if colonCount > parts + return null + + # replacement = ':' + '0:' * (parts - colonCount) + replacementCount = parts - colonCount + replacement = ':' + while replacementCount-- + replacement += '0:' + + # Insert the missing zeroes + string = string.replace('::', replacement) + + # Trim any garbage which may be hanging around if :: was at the edge in + # the source string + string = string[1..-1] if string[0] == ':' + string = string[0..-2] if string[string.length-1] == ':' + + return (parseInt(part, 16) for part in string.split(":")) + +# Parse an IPv6 address. +ipaddr.IPv6.parser = (string) -> + if string.match(ipv6Regexes['native']) + return expandIPv6(string, 8) + + else if match = string.match(ipv6Regexes['transitional']) + parts = expandIPv6(match[1][0..-2], 6) + if parts + octets = [parseInt(match[2]), parseInt(match[3]), + parseInt(match[4]), parseInt(match[5])] + for octet in octets + if !(0 <= octet <= 255) + return null + + parts.push(octets[0] << 8 | octets[1]) + parts.push(octets[2] << 8 | octets[3]) + return parts + + return null + +# Checks if a given string is formatted like IPv4/IPv6 address. +ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = (string) -> + return @parser(string) != null + +# Checks if a given string is a valid IPv4/IPv6 address. +ipaddr.IPv4.isValid = (string) -> + try + new this(@parser(string)) + return true + catch e + return false + +ipaddr.IPv4.isValidFourPartDecimal = (string) -> + if ipaddr.IPv4.isValid(string) and string.match(/^\d+(\.\d+){3}$/) + return true + else + return false + +ipaddr.IPv6.isValid = (string) -> + # Since IPv6.isValid is always called first, this shortcut + # provides a substantial performance gain. + if typeof string == "string" and string.indexOf(":") == -1 + return false + + try + new this(@parser(string)) + return true + catch e + return false + +# Tries to parse and validate a string with IPv4/IPv6 address. +# Throws an error if it fails. +ipaddr.IPv4.parse = ipaddr.IPv6.parse = (string) -> + parts = @parser(string) + if parts == null + throw new Error "ipaddr: string is not formatted like ip address" + + return new this(parts) + +ipaddr.IPv4.parseCIDR = (string) -> + if match = string.match(/^(.+)\/(\d+)$/) + maskLength = parseInt(match[2]) + if maskLength >= 0 and maskLength <= 32 + return [@parse(match[1]), maskLength] + + throw new Error "ipaddr: string is not formatted like an IPv4 CIDR range" + +ipaddr.IPv6.parseCIDR = (string) -> + if match = string.match(/^(.+)\/(\d+)$/) + maskLength = parseInt(match[2]) + if maskLength >= 0 and maskLength <= 128 + return [@parse(match[1]), maskLength] + + throw new Error "ipaddr: string is not formatted like an IPv6 CIDR range" + +# Checks if the address is valid IP address +ipaddr.isValid = (string) -> + return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string) + +# Try to parse an address and throw an error if it is impossible +ipaddr.parse = (string) -> + if ipaddr.IPv6.isValid(string) + return ipaddr.IPv6.parse(string) + else if ipaddr.IPv4.isValid(string) + return ipaddr.IPv4.parse(string) + else + throw new Error "ipaddr: the address has neither IPv6 nor IPv4 format" + +ipaddr.parseCIDR = (string) -> + try + return ipaddr.IPv6.parseCIDR(string) + catch e + try + return ipaddr.IPv4.parseCIDR(string) + catch e + throw new Error "ipaddr: the address has neither IPv6 nor IPv4 CIDR format" + +# Try to parse an array in network order (MSB first) for IPv4 and IPv6 +ipaddr.fromByteArray = (bytes) -> + length = bytes.length + if length == 4 + return new ipaddr.IPv4(bytes) + else if length == 16 + return new ipaddr.IPv6(bytes) + else + throw new Error "ipaddr: the binary input is neither an IPv6 nor IPv4 address" + +# Parse an address and return plain IPv4 address if it is an IPv4-mapped address +ipaddr.process = (string) -> + addr = @parse(string) + if addr.kind() == 'ipv6' && addr.isIPv4MappedAddress() + return addr.toIPv4Address() + else + return addr diff --git a/node_modules/ipaddr.js/test/ipaddr.test.coffee b/node_modules/ipaddr.js/test/ipaddr.test.coffee new file mode 100755 index 00000000..34ec7d96 --- /dev/null +++ b/node_modules/ipaddr.js/test/ipaddr.test.coffee @@ -0,0 +1,346 @@ +ipaddr = require '../lib/ipaddr' + +module.exports = + 'should define main classes': (test) -> + test.ok(ipaddr.IPv4?, 'defines IPv4 class') + test.ok(ipaddr.IPv6?, 'defines IPv6 class') + test.done() + + 'can construct IPv4 from octets': (test) -> + test.doesNotThrow -> + new ipaddr.IPv4([192, 168, 1, 2]) + test.done() + + 'refuses to construct invalid IPv4': (test) -> + test.throws -> + new ipaddr.IPv4([300, 1, 2, 3]) + test.throws -> + new ipaddr.IPv4([8, 8, 8]) + test.done() + + 'converts IPv4 to string correctly': (test) -> + addr = new ipaddr.IPv4([192, 168, 1, 1]) + test.equal(addr.toString(), '192.168.1.1') + test.done() + + 'returns correct kind for IPv4': (test) -> + addr = new ipaddr.IPv4([1, 2, 3, 4]) + test.equal(addr.kind(), 'ipv4') + test.done() + + 'allows to access IPv4 octets': (test) -> + addr = new ipaddr.IPv4([42, 0, 0, 0]) + test.equal(addr.octets[0], 42) + test.done() + + 'checks IPv4 address format': (test) -> + test.equal(ipaddr.IPv4.isIPv4('192.168.007.0xa'), true) + test.equal(ipaddr.IPv4.isIPv4('1024.0.0.1'), true) + test.equal(ipaddr.IPv4.isIPv4('8.0xa.wtf.6'), false) + test.done() + + 'validates IPv4 addresses': (test) -> + test.equal(ipaddr.IPv4.isValid('192.168.007.0xa'), true) + test.equal(ipaddr.IPv4.isValid('1024.0.0.1'), false) + test.equal(ipaddr.IPv4.isValid('8.0xa.wtf.6'), false) + test.done() + + 'parses IPv4 in several weird formats': (test) -> + test.deepEqual(ipaddr.IPv4.parse('192.168.1.1').octets, [192, 168, 1, 1]) + test.deepEqual(ipaddr.IPv4.parse('0xc0.168.1.1').octets, [192, 168, 1, 1]) + test.deepEqual(ipaddr.IPv4.parse('192.0250.1.1').octets, [192, 168, 1, 1]) + test.deepEqual(ipaddr.IPv4.parse('0xc0a80101').octets, [192, 168, 1, 1]) + test.deepEqual(ipaddr.IPv4.parse('030052000401').octets, [192, 168, 1, 1]) + test.deepEqual(ipaddr.IPv4.parse('3232235777').octets, [192, 168, 1, 1]) + test.done() + + 'barfs at invalid IPv4': (test) -> + test.throws -> + ipaddr.IPv4.parse('10.0.0.wtf') + test.done() + + 'matches IPv4 CIDR correctly': (test) -> + addr = new ipaddr.IPv4([10, 5, 0, 1]) + test.equal(addr.match(ipaddr.IPv4.parse('0.0.0.0'), 0), true) + test.equal(addr.match(ipaddr.IPv4.parse('11.0.0.0'), 8), false) + test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.0'), 8), true) + test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.1'), 8), true) + test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.10'), 8), true) + test.equal(addr.match(ipaddr.IPv4.parse('10.5.5.0'), 16), true) + test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 16), false) + test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 15), true) + test.equal(addr.match(ipaddr.IPv4.parse('10.5.0.2'), 32), false) + test.equal(addr.match(addr, 32), true) + test.done() + + 'parses IPv4 CIDR correctly': (test) -> + addr = new ipaddr.IPv4([10, 5, 0, 1]) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('0.0.0.0/0')), true) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('11.0.0.0/8')), false) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.0/8')), true) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.1/8')), true) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.10/8')), true) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.5.0/16')), true) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/16')), false) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/15')), true) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.2/32')), false) + test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.1/32')), true) + test.throws -> + ipaddr.IPv4.parseCIDR('10.5.0.1') + test.throws -> + ipaddr.IPv4.parseCIDR('0.0.0.0/-1') + test.throws -> + ipaddr.IPv4.parseCIDR('0.0.0.0/33') + test.done() + + 'detects reserved IPv4 networks': (test) -> + test.equal(ipaddr.IPv4.parse('0.0.0.0').range(), 'unspecified') + test.equal(ipaddr.IPv4.parse('0.1.0.0').range(), 'unspecified') + test.equal(ipaddr.IPv4.parse('10.1.0.1').range(), 'private') + test.equal(ipaddr.IPv4.parse('100.64.0.0').range(), 'carrierGradeNat') + test.equal(ipaddr.IPv4.parse('100.127.255.255').range(), 'carrierGradeNat') + test.equal(ipaddr.IPv4.parse('192.168.2.1').range(), 'private') + test.equal(ipaddr.IPv4.parse('224.100.0.1').range(), 'multicast') + test.equal(ipaddr.IPv4.parse('169.254.15.0').range(), 'linkLocal') + test.equal(ipaddr.IPv4.parse('127.1.1.1').range(), 'loopback') + test.equal(ipaddr.IPv4.parse('255.255.255.255').range(), 'broadcast') + test.equal(ipaddr.IPv4.parse('240.1.2.3').range(), 'reserved') + test.equal(ipaddr.IPv4.parse('8.8.8.8').range(), 'unicast') + test.done() + + 'checks the conventional IPv4 address format': (test) -> + test.equal(ipaddr.IPv4.isValidFourPartDecimal('192.168.1.1'), true) + test.equal(ipaddr.IPv4.isValidFourPartDecimal('0xc0.168.1.1'), false) + test.done() + + 'can construct IPv6 from 16bit parts': (test) -> + test.doesNotThrow -> + new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) + test.done() + + 'can construct IPv6 from 8bit parts': (test) -> + test.doesNotThrow -> + new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) + test.deepEqual(new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]), + new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1])) + test.done() + + 'refuses to construct invalid IPv6': (test) -> + test.throws -> + new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 0, 1]) + test.throws -> + new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 1]) + test.throws -> + new ipaddr.IPv6([0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) + test.done() + + 'converts IPv6 to string correctly': (test) -> + addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) + test.equal(addr.toNormalizedString(), '2001:db8:f53a:0:0:0:0:1') + test.equal(addr.toString(), '2001:db8:f53a::1') + test.equal(new ipaddr.IPv6([0, 0, 0, 0, 0, 0, 0, 1]).toString(), '::1') + test.equal(new ipaddr.IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]).toString(), '2001:db8::') + test.done() + + 'returns correct kind for IPv6': (test) -> + addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) + test.equal(addr.kind(), 'ipv6') + test.done() + + 'allows to access IPv6 address parts': (test) -> + addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 42, 0, 1]) + test.equal(addr.parts[5], 42) + test.done() + + 'checks IPv6 address format': (test) -> + test.equal(ipaddr.IPv6.isIPv6('2001:db8:F53A::1'), true) + test.equal(ipaddr.IPv6.isIPv6('200001::1'), true) + test.equal(ipaddr.IPv6.isIPv6('::ffff:192.168.1.1'), true) + test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1'), false) + test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1:0'), false) + test.equal(ipaddr.IPv6.isIPv6('fe80::wtf'), false) + test.done() + + 'validates IPv6 addresses': (test) -> + test.equal(ipaddr.IPv6.isValid('2001:db8:F53A::1'), true) + test.equal(ipaddr.IPv6.isValid('200001::1'), false) + test.equal(ipaddr.IPv6.isValid('::ffff:192.168.1.1'), true) + test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1'), false) + test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1:0'), false) + test.equal(ipaddr.IPv6.isValid('::ffff:222.1.41.9000'), false) + test.equal(ipaddr.IPv6.isValid('2001:db8::F53A::1'), false) + test.equal(ipaddr.IPv6.isValid('fe80::wtf'), false) + test.equal(ipaddr.IPv6.isValid('2002::2:'), false) + test.equal(ipaddr.IPv6.isValid(undefined), false) + test.done() + + 'parses IPv6 in different formats': (test) -> + test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A:0:0:0:0:1').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]) + test.deepEqual(ipaddr.IPv6.parse('fe80::10').parts, [0xfe80, 0, 0, 0, 0, 0, 0, 0x10]) + test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A::').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 0]) + test.deepEqual(ipaddr.IPv6.parse('::1').parts, [0, 0, 0, 0, 0, 0, 0, 1]) + test.deepEqual(ipaddr.IPv6.parse('::').parts, [0, 0, 0, 0, 0, 0, 0, 0]) + test.done() + + 'barfs at invalid IPv6': (test) -> + test.throws -> + ipaddr.IPv6.parse('fe80::0::1') + test.done() + + 'matches IPv6 CIDR correctly': (test) -> + addr = ipaddr.IPv6.parse('2001:db8:f53a::1') + test.equal(addr.match(ipaddr.IPv6.parse('::'), 0), true) + test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53a::1:1'), 64), true) + test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53b::1:1'), 48), false) + test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f531::1:1'), 44), true) + test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f500::1'), 40), true) + test.equal(addr.match(ipaddr.IPv6.parse('2001:db9:f500::1'), 40), false) + test.equal(addr.match(addr, 128), true) + test.done() + + 'parses IPv6 CIDR correctly': (test) -> + addr = ipaddr.IPv6.parse('2001:db8:f53a::1') + test.equal(addr.match(ipaddr.IPv6.parseCIDR('::/0')), true) + test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1:1/64')), true) + test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53b::1:1/48')), false) + test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f531::1:1/44')), true) + test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f500::1/40')), true) + test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db9:f500::1/40')), false) + test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/128')), true) + test.throws -> + ipaddr.IPv6.parseCIDR('2001:db8:f53a::1') + test.throws -> + ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/-1') + test.throws -> + ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/129') + test.done() + + 'converts between IPv4-mapped IPv6 addresses and IPv4 addresses': (test) -> + addr = ipaddr.IPv4.parse('77.88.21.11') + mapped = addr.toIPv4MappedAddress() + test.deepEqual(mapped.parts, [0, 0, 0, 0, 0, 0xffff, 0x4d58, 0x150b]) + test.deepEqual(mapped.toIPv4Address().octets, addr.octets) + test.done() + + 'refuses to convert non-IPv4-mapped IPv6 address to IPv4 address': (test) -> + test.throws -> + ipaddr.IPv6.parse('2001:db8::1').toIPv4Address() + test.done() + + 'detects reserved IPv6 networks': (test) -> + test.equal(ipaddr.IPv6.parse('::').range(), 'unspecified') + test.equal(ipaddr.IPv6.parse('fe80::1234:5678:abcd:0123').range(), 'linkLocal') + test.equal(ipaddr.IPv6.parse('ff00::1234').range(), 'multicast') + test.equal(ipaddr.IPv6.parse('::1').range(), 'loopback') + test.equal(ipaddr.IPv6.parse('fc00::').range(), 'uniqueLocal') + test.equal(ipaddr.IPv6.parse('::ffff:192.168.1.10').range(), 'ipv4Mapped') + test.equal(ipaddr.IPv6.parse('::ffff:0:192.168.1.10').range(), 'rfc6145') + test.equal(ipaddr.IPv6.parse('64:ff9b::1234').range(), 'rfc6052') + test.equal(ipaddr.IPv6.parse('2002:1f63:45e8::1').range(), '6to4') + test.equal(ipaddr.IPv6.parse('2001::4242').range(), 'teredo') + test.equal(ipaddr.IPv6.parse('2001:db8::3210').range(), 'reserved') + test.equal(ipaddr.IPv6.parse('2001:470:8:66::1').range(), 'unicast') + test.done() + + 'is able to determine IP address type': (test) -> + test.equal(ipaddr.parse('8.8.8.8').kind(), 'ipv4') + test.equal(ipaddr.parse('2001:db8:3312::1').kind(), 'ipv6') + test.done() + + 'throws an error if tried to parse an invalid address': (test) -> + test.throws -> + ipaddr.parse('::some.nonsense') + test.done() + + 'correctly processes IPv4-mapped addresses': (test) -> + test.equal(ipaddr.process('8.8.8.8').kind(), 'ipv4') + test.equal(ipaddr.process('2001:db8:3312::1').kind(), 'ipv6') + test.equal(ipaddr.process('::ffff:192.168.1.1').kind(), 'ipv4') + test.done() + + 'correctly converts IPv6 and IPv4 addresses to byte arrays': (test) -> + test.deepEqual(ipaddr.parse('1.2.3.4').toByteArray(), + [0x1, 0x2, 0x3, 0x4]); + # Fuck yeah. The first byte of Google's IPv6 address is 42. 42! + test.deepEqual(ipaddr.parse('2a00:1450:8007::68').toByteArray(), + [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68 ]) + test.done() + + 'correctly parses 1 as an IPv4 address': (test) -> + test.equal(ipaddr.IPv6.isValid('1'), false) + test.equal(ipaddr.IPv4.isValid('1'), true) + test.deepEqual(new ipaddr.IPv4([0, 0, 0, 1]), ipaddr.parse('1')) + test.done() + + 'correctly detects IPv4 and IPv6 CIDR addresses': (test) -> + test.deepEqual([ipaddr.IPv6.parse('fc00::'), 64], + ipaddr.parseCIDR('fc00::/64')) + test.deepEqual([ipaddr.IPv4.parse('1.2.3.4'), 5], + ipaddr.parseCIDR('1.2.3.4/5')) + test.done() + + 'does not consider a very large or very small number a valid IP address': (test) -> + test.equal(ipaddr.isValid('4999999999'), false) + test.equal(ipaddr.isValid('-1'), false) + test.done() + + 'does not hang on ::8:8:8:8:8:8:8:8:8': (test) -> + test.equal(ipaddr.IPv6.isValid('::8:8:8:8:8:8:8:8:8'), false) + test.done() + + 'subnetMatch does not fail on empty range': (test) -> + ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {}, false) + ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {subnet: []}, false) + test.done() + + 'subnetMatch returns default subnet on empty range': (test) -> + test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {}, false), false) + test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {subnet: []}, false), false) + test.done() + + 'is able to determine IP address type from byte array input': (test) -> + test.equal(ipaddr.fromByteArray([0x7f, 0, 0, 1]).kind(), 'ipv4') + test.equal(ipaddr.fromByteArray([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]).kind(), 'ipv6') + test.throws -> + ipaddr.fromByteArray([1]) + test.done() + + 'prefixLengthFromSubnetMask returns proper CIDR notation for standard IPv4 masks': (test) -> + test.equal(ipaddr.IPv4.parse('255.255.255.255').prefixLengthFromSubnetMask(), 32) + test.equal(ipaddr.IPv4.parse('255.255.255.254').prefixLengthFromSubnetMask(), 31) + test.equal(ipaddr.IPv4.parse('255.255.255.252').prefixLengthFromSubnetMask(), 30) + test.equal(ipaddr.IPv4.parse('255.255.255.248').prefixLengthFromSubnetMask(), 29) + test.equal(ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask(), 28) + test.equal(ipaddr.IPv4.parse('255.255.255.224').prefixLengthFromSubnetMask(), 27) + test.equal(ipaddr.IPv4.parse('255.255.255.192').prefixLengthFromSubnetMask(), 26) + test.equal(ipaddr.IPv4.parse('255.255.255.128').prefixLengthFromSubnetMask(), 25) + test.equal(ipaddr.IPv4.parse('255.255.255.0').prefixLengthFromSubnetMask(), 24) + test.equal(ipaddr.IPv4.parse('255.255.254.0').prefixLengthFromSubnetMask(), 23) + test.equal(ipaddr.IPv4.parse('255.255.252.0').prefixLengthFromSubnetMask(), 22) + test.equal(ipaddr.IPv4.parse('255.255.248.0').prefixLengthFromSubnetMask(), 21) + test.equal(ipaddr.IPv4.parse('255.255.240.0').prefixLengthFromSubnetMask(), 20) + test.equal(ipaddr.IPv4.parse('255.255.224.0').prefixLengthFromSubnetMask(), 19) + test.equal(ipaddr.IPv4.parse('255.255.192.0').prefixLengthFromSubnetMask(), 18) + test.equal(ipaddr.IPv4.parse('255.255.128.0').prefixLengthFromSubnetMask(), 17) + test.equal(ipaddr.IPv4.parse('255.255.0.0').prefixLengthFromSubnetMask(), 16) + test.equal(ipaddr.IPv4.parse('255.254.0.0').prefixLengthFromSubnetMask(), 15) + test.equal(ipaddr.IPv4.parse('255.252.0.0').prefixLengthFromSubnetMask(), 14) + test.equal(ipaddr.IPv4.parse('255.248.0.0').prefixLengthFromSubnetMask(), 13) + test.equal(ipaddr.IPv4.parse('255.240.0.0').prefixLengthFromSubnetMask(), 12) + test.equal(ipaddr.IPv4.parse('255.224.0.0').prefixLengthFromSubnetMask(), 11) + test.equal(ipaddr.IPv4.parse('255.192.0.0').prefixLengthFromSubnetMask(), 10) + test.equal(ipaddr.IPv4.parse('255.128.0.0').prefixLengthFromSubnetMask(), 9) + test.equal(ipaddr.IPv4.parse('255.0.0.0').prefixLengthFromSubnetMask(), 8) + test.equal(ipaddr.IPv4.parse('254.0.0.0').prefixLengthFromSubnetMask(), 7) + test.equal(ipaddr.IPv4.parse('252.0.0.0').prefixLengthFromSubnetMask(), 6) + test.equal(ipaddr.IPv4.parse('248.0.0.0').prefixLengthFromSubnetMask(), 5) + test.equal(ipaddr.IPv4.parse('240.0.0.0').prefixLengthFromSubnetMask(), 4) + test.equal(ipaddr.IPv4.parse('224.0.0.0').prefixLengthFromSubnetMask(), 3) + test.equal(ipaddr.IPv4.parse('192.0.0.0').prefixLengthFromSubnetMask(), 2) + test.equal(ipaddr.IPv4.parse('128.0.0.0').prefixLengthFromSubnetMask(), 1) + test.equal(ipaddr.IPv4.parse('0.0.0.0').prefixLengthFromSubnetMask(), 0) + # negative cases + test.equal(ipaddr.IPv4.parse('192.168.255.0').prefixLengthFromSubnetMask(), null) + test.equal(ipaddr.IPv4.parse('255.0.255.0').prefixLengthFromSubnetMask(), null) + test.done() + diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js new file mode 100755 index 00000000..6c8c7e72 --- /dev/null +++ b/node_modules/is-binary-path/index.js @@ -0,0 +1,12 @@ +'use strict'; +var path = require('path'); +var binaryExtensions = require('binary-extensions'); +var exts = Object.create(null); + +binaryExtensions.forEach(function (el) { + exts[el] = true; +}); + +module.exports = function (filepath) { + return path.extname(filepath).slice(1).toLowerCase() in exts; +}; diff --git a/node_modules/is-binary-path/license b/node_modules/is-binary-path/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/is-binary-path/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-binary-path/package.json b/node_modules/is-binary-path/package.json new file mode 100755 index 00000000..79c6b456 --- /dev/null +++ b/node_modules/is-binary-path/package.json @@ -0,0 +1,110 @@ +{ + "_args": [ + [ + { + "raw": "is-binary-path@^1.0.0", + "scope": null, + "escapedName": "is-binary-path", + "name": "is-binary-path", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chokidar" + ] + ], + "_from": "is-binary-path@>=1.0.0 <2.0.0", + "_id": "is-binary-path@1.0.1", + "_inCache": true, + "_location": "/is-binary-path", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "is-binary-path@^1.0.0", + "scope": null, + "escapedName": "is-binary-path", + "name": "is-binary-path", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chokidar" + ], + "_resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "_shasum": "75f16642b480f187a711c814161fd3a4a7655898", + "_shrinkwrap": null, + "_spec": "is-binary-path@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chokidar", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-binary-path/issues" + }, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "description": "Check if a filepath is a binary file", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "75f16642b480f187a711c814161fd3a4a7655898", + "tarball": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "ed26bd7be5e29dad159c2771cb99dd48913f9de0", + "homepage": "https://github.com/sindresorhus/is-binary-path", + "keywords": [ + "bin", + "binary", + "ext", + "extensions", + "extension", + "file", + "path", + "check", + "detect", + "is" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "paulmillr", + "email": "paul@paulmillr.com" + }, + { + "name": "es128", + "email": "elan.shanker+npm@gmail.com" + } + ], + "name": "is-binary-path", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-binary-path.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/is-binary-path/readme.md b/node_modules/is-binary-path/readme.md new file mode 100755 index 00000000..a17d6a24 --- /dev/null +++ b/node_modules/is-binary-path/readme.md @@ -0,0 +1,34 @@ +# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) + +> Check if a filepath is a binary file + + +## Install + +``` +$ npm install --save is-binary-path +``` + + +## Usage + +```js +var isBinaryPath = require('is-binary-path'); + +isBinaryPath('src/unicorn.png'); +//=> true + +isBinaryPath('src/unicorn.txt'); +//=> false +``` + + +## Related + +- [`binary-extensions`](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions +- [`is-text-path`](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/is-buffer/.npmignore b/node_modules/is-buffer/.npmignore new file mode 100755 index 00000000..9cdaef92 --- /dev/null +++ b/node_modules/is-buffer/.npmignore @@ -0,0 +1,2 @@ +.travis.yml +.zuul.yml diff --git a/node_modules/is-buffer/LICENSE b/node_modules/is-buffer/LICENSE new file mode 100755 index 00000000..0c068cee --- /dev/null +++ b/node_modules/is-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-buffer/README.md b/node_modules/is-buffer/README.md new file mode 100755 index 00000000..cb6f356d --- /dev/null +++ b/node_modules/is-buffer/README.md @@ -0,0 +1,49 @@ +# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] + +#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer)) + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/is-buffer +[npm-image]: https://img.shields.io/npm/v/is-buffer.svg +[npm-url]: https://npmjs.org/package/is-buffer +[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg +[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg +[saucelabs-url]: https://saucelabs.com/u/is-buffer + +## Why not use `Buffer.isBuffer`? + +This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)). + +It's future-proof and works in node too! + +## install + +```bash +npm install is-buffer +``` + +## usage + +```js +var isBuffer = require('is-buffer') + +isBuffer(new Buffer(4)) // true + +isBuffer(undefined) // false +isBuffer(null) // false +isBuffer('') // false +isBuffer(true) // false +isBuffer(false) // false +isBuffer(0) // false +isBuffer(1) // false +isBuffer(1.0) // false +isBuffer('string') // false +isBuffer({}) // false +isBuffer(function foo () {}) // false +``` + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/is-buffer/index.js b/node_modules/is-buffer/index.js new file mode 100755 index 00000000..36c808ea --- /dev/null +++ b/node_modules/is-buffer/index.js @@ -0,0 +1,21 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) +} diff --git a/node_modules/is-buffer/package.json b/node_modules/is-buffer/package.json new file mode 100755 index 00000000..afb2d181 --- /dev/null +++ b/node_modules/is-buffer/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "is-buffer@^1.0.2", + "scope": null, + "escapedName": "is-buffer", + "name": "is-buffer", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/kind-of" + ] + ], + "_from": "is-buffer@>=1.0.2 <2.0.0", + "_id": "is-buffer@1.1.5", + "_inCache": true, + "_location": "/is-buffer", + "_nodeVersion": "6.9.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/is-buffer-1.1.5.tgz_1489193465717_0.9356542676687241" + }, + "_npmUser": { + "name": "feross", + "email": "feross@feross.org" + }, + "_npmVersion": "3.10.10", + "_phantomChildren": {}, + "_requested": { + "raw": "is-buffer@^1.0.2", + "scope": null, + "escapedName": "is-buffer", + "name": "is-buffer", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/kind-of" + ], + "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "_shasum": "1f3b26ef613b214b88cbca23cc6c01d87961eecc", + "_shrinkwrap": null, + "_spec": "is-buffer@^1.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/kind-of", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org/" + }, + "bugs": { + "url": "https://github.com/feross/is-buffer/issues" + }, + "dependencies": {}, + "description": "Determine if an object is a Buffer", + "devDependencies": { + "standard": "*", + "tape": "^4.0.0", + "zuul": "^3.0.0" + }, + "directories": {}, + "dist": { + "shasum": "1f3b26ef613b214b88cbca23cc6c01d87961eecc", + "tarball": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz" + }, + "gitHead": "56dc50e7b271c7d2968269430cbd4f717bbcf6c0", + "homepage": "https://github.com/feross/is-buffer#readme", + "keywords": [ + "buffer", + "buffers", + "type", + "core buffer", + "browser buffer", + "browserify", + "typed array", + "uint32array", + "int16array", + "int32array", + "float32array", + "float64array", + "browser", + "arraybuffer", + "dataview" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "feross", + "email": "feross@feross.org" + } + ], + "name": "is-buffer", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/feross/is-buffer.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "zuul -- test/*.js", + "test-browser-local": "zuul --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "testling": { + "files": "test/*.js" + }, + "version": "1.1.5" +} diff --git a/node_modules/is-buffer/test/basic.js b/node_modules/is-buffer/test/basic.js new file mode 100755 index 00000000..43b7c823 --- /dev/null +++ b/node_modules/is-buffer/test/basic.js @@ -0,0 +1,25 @@ +var buffer = require('buffer') +var isBuffer = require('../') +var test = require('tape') + +test('is-buffer', function (t) { + t.equal(isBuffer(new Buffer(4)), true, 'new Buffer(4)') + t.equal(isBuffer(buffer.SlowBuffer(100)), true, 'SlowBuffer(100)') + + t.equal(isBuffer(undefined), false, 'undefined') + t.equal(isBuffer(null), false, 'null') + t.equal(isBuffer(''), false, 'empty string') + t.equal(isBuffer(true), false, 'true') + t.equal(isBuffer(false), false, 'false') + t.equal(isBuffer(0), false, '0') + t.equal(isBuffer(1), false, '1') + t.equal(isBuffer(1.0), false, '1.0') + t.equal(isBuffer('string'), false, 'string') + t.equal(isBuffer({}), false, '{}') + t.equal(isBuffer([]), false, '[]') + t.equal(isBuffer(function foo () {}), false, 'function foo () {}') + t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }') + t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }') + + t.end() +}) diff --git a/node_modules/is-dotfile/LICENSE b/node_modules/is-dotfile/LICENSE new file mode 100755 index 00000000..33754dae --- /dev/null +++ b/node_modules/is-dotfile/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-dotfile/README.md b/node_modules/is-dotfile/README.md new file mode 100755 index 00000000..d17b55cc --- /dev/null +++ b/node_modules/is-dotfile/README.md @@ -0,0 +1,74 @@ +# is-dotfile [![NPM version](https://badge.fury.io/js/is-dotfile.svg)](http://badge.fury.io/js/is-dotfile) + +> Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-dotfile --save +``` + +## Usage + +```js +var isDotfile = require('is-dotfile'); +``` + +**false** + +All of the following return `false`: + +```js +isDotfile('a/b/c.js'); +isDotfile('/.git/foo'); +isDotfile('a/b/c/.git/foo'); +//=> false +``` + +**true** + +All of the following return `true`: + +```js +isDotfile('a/b/.gitignore'); +isDotfile('.gitignore'); +isDotfile('/.gitignore'); +//=> true +``` + +## Related projects + +* [dotfile-regex](https://www.npmjs.com/package/dotfile-regex): Regular expresson for matching dotfiles. | [homepage](https://github.com/regexps/dotfile-regex) +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob) +* [is-dotdir](https://www.npmjs.com/package/is-dotdir): Returns true if a path is a dot-directory. | [homepage](https://github.com/jonschlinkert/is-dotdir) +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-dotfile/issues/new). + +## Authors + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 20, 2015._ \ No newline at end of file diff --git a/node_modules/is-dotfile/index.js b/node_modules/is-dotfile/index.js new file mode 100755 index 00000000..5a0a0caa --- /dev/null +++ b/node_modules/is-dotfile/index.js @@ -0,0 +1,15 @@ +/*! + * is-dotfile + * + * Copyright (c) 2015 Jon Schlinkert, contributors. + * Licensed under the MIT license. + */ + +module.exports = function(str) { + if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) { + return true; + } + + var last = str.lastIndexOf('/'); + return last !== -1 ? str.charCodeAt(last + 1) === 46 /* . */ : false; +}; diff --git a/node_modules/is-dotfile/package.json b/node_modules/is-dotfile/package.json new file mode 100755 index 00000000..e209e1d2 --- /dev/null +++ b/node_modules/is-dotfile/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "is-dotfile@^1.0.0", + "scope": null, + "escapedName": "is-dotfile", + "name": "is-dotfile", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/parse-glob" + ] + ], + "_from": "is-dotfile@>=1.0.0 <2.0.0", + "_id": "is-dotfile@1.0.2", + "_inCache": true, + "_location": "/is-dotfile", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "raw": "is-dotfile@^1.0.0", + "scope": null, + "escapedName": "is-dotfile", + "name": "is-dotfile", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", + "_shasum": "2c132383f39199f8edc268ca01b9b007d205cc4d", + "_shrinkwrap": null, + "_spec": "is-dotfile@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/parse-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-dotfile/issues" + }, + "dependencies": {}, + "description": "Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory.", + "devDependencies": { + "benchmarked": "^0.1.3", + "dotfile-regex": "^0.1.2", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "2c132383f39199f8edc268ca01b9b007d205cc4d", + "tarball": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "df258600b0afa6403a2a840f2ec486c9d350492f", + "homepage": "https://github.com/jonschlinkert/is-dotfile", + "keywords": [ + "detect", + "dot", + "dotfile", + "expression", + "file", + "filepath", + "find", + "fs", + "is", + "match", + "path", + "regex", + "regexp", + "regular" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "is-dotfile", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-dotfile.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "has-glob", + "is-glob", + "dotfile-regex", + "is-dotdir" + ] + } + }, + "version": "1.0.2" +} diff --git a/node_modules/is-equal-shallow/LICENSE b/node_modules/is-equal-shallow/LICENSE new file mode 100755 index 00000000..65f90aca --- /dev/null +++ b/node_modules/is-equal-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-equal-shallow/README.md b/node_modules/is-equal-shallow/README.md new file mode 100755 index 00000000..11422761 --- /dev/null +++ b/node_modules/is-equal-shallow/README.md @@ -0,0 +1,90 @@ +# is-equal-shallow [![NPM version](https://badge.fury.io/js/is-equal-shallow.svg)](http://badge.fury.io/js/is-equal-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/is-equal-shallow.svg)](https://travis-ci.org/jonschlinkert/is-equal-shallow) + +> Does a shallow comparison of two objects, returning false if the keys or values differ. + +The purpose of this lib is to do the fastest comparison possible of two objects when the values will predictably be primitives. + +* only compares objects. +* only compares the first level of each object +* values must be primitives. If a value is not a primitive, even if the values are the same, `false` is returned. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-equal-shallow --save +``` + +## Usage + +```js +var equals = require('is-equal-shallow'); +equals(object_a, object_b); +``` + +**Examples** + +```js +equals({a: true, b: true}, {a: true, b: true}); +//=> 'true' + +equals({a: true, b: false}, {c: false, b: false}); +//=> 'false' + +equals({a: true, b: false}, {a: false, b: false}); +//=> 'false' +``` + +Strict comparison for equality: + +```js +equals({a: true, b: true}, {a: true, b: 'true'}); +//=> 'false' +``` + +When values are not primitives, `false` is always returned: + +```js +equals({ b: {}}, { b: {}}); +//=> 'false' + +equals({ b: []}, { b: []}); +//=> 'false' +``` + +## Related projects + +Other object utils: + +* [clone-deep](https://github.com/jonschlinkert/clone-deep): Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-equal-shallow/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 22, 2015._ \ No newline at end of file diff --git a/node_modules/is-equal-shallow/index.js b/node_modules/is-equal-shallow/index.js new file mode 100755 index 00000000..1006eef1 --- /dev/null +++ b/node_modules/is-equal-shallow/index.js @@ -0,0 +1,27 @@ +/*! + * is-equal-shallow + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isPrimitive = require('is-primitive'); + +module.exports = function isEqual(a, b) { + if (!a && !b) { return true; } + if (!a && b || a && !b) { return false; } + + var numKeysA = 0, numKeysB = 0, key; + for (key in b) { + numKeysB++; + if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) { + return false; + } + } + for (key in a) { + numKeysA++; + } + return numKeysA === numKeysB; +}; diff --git a/node_modules/is-equal-shallow/package.json b/node_modules/is-equal-shallow/package.json new file mode 100755 index 00000000..c140d1cd --- /dev/null +++ b/node_modules/is-equal-shallow/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "is-equal-shallow@^0.1.3", + "scope": null, + "escapedName": "is-equal-shallow", + "name": "is-equal-shallow", + "rawSpec": "^0.1.3", + "spec": ">=0.1.3 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/regex-cache" + ] + ], + "_from": "is-equal-shallow@>=0.1.3 <0.2.0", + "_id": "is-equal-shallow@0.1.3", + "_inCache": true, + "_location": "/is-equal-shallow", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "is-equal-shallow@^0.1.3", + "scope": null, + "escapedName": "is-equal-shallow", + "name": "is-equal-shallow", + "rawSpec": "^0.1.3", + "spec": ">=0.1.3 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/regex-cache" + ], + "_resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "_shasum": "2238098fc221de0bcfa5d9eac4c45d638aa1c534", + "_shrinkwrap": null, + "_spec": "is-equal-shallow@^0.1.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/regex-cache", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-equal-shallow/issues" + }, + "dependencies": { + "is-primitive": "^2.0.0" + }, + "description": "Does a shallow comparison of two objects, returning false if the keys or values differ.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "2238098fc221de0bcfa5d9eac4c45d638aa1c534", + "tarball": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "dceb47dd9c9c21066958116e3b54b3c8c251ee4a", + "homepage": "https://github.com/jonschlinkert/is-equal-shallow", + "keywords": [ + "compare", + "comparison", + "equal", + "equals", + "is", + "is-equal", + "key", + "object", + "same", + "shallow", + "value" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "is-equal-shallow", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/is-equal-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "verbiage": { + "related": { + "description": "Other object utils:", + "list": [ + "is-plain-object", + "isobject", + "for-in", + "for-own", + "clone-deep" + ] + } + }, + "version": "0.1.3" +} diff --git a/node_modules/is-extendable/LICENSE b/node_modules/is-extendable/LICENSE new file mode 100755 index 00000000..65f90aca --- /dev/null +++ b/node_modules/is-extendable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extendable/README.md b/node_modules/is-extendable/README.md new file mode 100755 index 00000000..e4cfaebc --- /dev/null +++ b/node_modules/is-extendable/README.md @@ -0,0 +1,72 @@ +# is-extendable [![NPM version](https://badge.fury.io/js/is-extendable.svg)](http://badge.fury.io/js/is-extendable) + +> Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?" + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-extendable --save +``` + +## Usage + +```js +var isExtendable = require('is-extendable'); +``` + +Returns true if the value is any of the following: + +* `array` +* `regexp` +* `plain object` +* `function` +* `date` +* `error` + +## Notes + +All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: + +* the value is not a primitive, or +* that the object is an `object`, `function` + +Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. + +## Related projects + +* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._ \ No newline at end of file diff --git a/node_modules/is-extendable/index.js b/node_modules/is-extendable/index.js new file mode 100755 index 00000000..4ee71a44 --- /dev/null +++ b/node_modules/is-extendable/index.js @@ -0,0 +1,13 @@ +/*! + * is-extendable + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +module.exports = function isExtendable(val) { + return typeof val !== 'undefined' && val !== null + && (typeof val === 'object' || typeof val === 'function'); +}; diff --git a/node_modules/is-extendable/package.json b/node_modules/is-extendable/package.json new file mode 100755 index 00000000..b54a51da --- /dev/null +++ b/node_modules/is-extendable/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + { + "raw": "is-extendable@^0.1.1", + "scope": null, + "escapedName": "is-extendable", + "name": "is-extendable", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/object.omit" + ] + ], + "_from": "is-extendable@>=0.1.1 <0.2.0", + "_id": "is-extendable@0.1.1", + "_inCache": true, + "_location": "/is-extendable", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "is-extendable@^0.1.1", + "scope": null, + "escapedName": "is-extendable", + "name": "is-extendable", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/object.omit" + ], + "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "_shasum": "62b110e289a471418e3ec36a617d472e301dfc89", + "_shrinkwrap": null, + "_spec": "is-extendable@^0.1.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/object.omit", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extendable/issues" + }, + "dependencies": {}, + "description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "62b110e289a471418e3ec36a617d472e301dfc89", + "tarball": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "c36a0732e6a76931c6f66c5931d1f3e54fa44380", + "homepage": "https://github.com/jonschlinkert/is-extendable", + "keywords": [ + "array", + "assign", + "check", + "date", + "extend", + "extensible", + "function", + "is", + "object", + "regex", + "test" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "is-extendable", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extendable.git" + }, + "scripts": { + "test": "mocha" + }, + "verbiage": { + "related": { + "list": [ + "isobject", + "is-plain-object", + "kind-of", + "is-extendable", + "is-equal-shallow", + "extend-shallow", + "assign-deep" + ] + } + }, + "version": "0.1.1" +} diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100755 index 00000000..fa30c4cb --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100755 index 00000000..80e7128d --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,75 @@ +# is-extglob [![NPM version](https://badge.fury.io/js/is-extglob.svg)](http://badge.fury.io/js/is-extglob) [![Build Status](https://travis-ci.org/jonschlinkert/is-extglob.svg)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install with [npm](npmjs.org) + +```bash +npm i is-extglob --save +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## Related +* [extglob](https://github.com/jonschlinkert/extglob): Extended globs. extglobs add the expressive power of regular expressions to glob patterns. +* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks. +* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens. + +## Run tests +Install dev dependencies. + +```bash +npm i -d && npm test +``` + + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extglob/issues) + + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 06, 2015._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100755 index 00000000..803047f7 --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,11 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + return typeof str === 'string' + && /[@?!+*]\(/.test(str); +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100755 index 00000000..3f3ebe77 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,110 @@ +{ + "_args": [ + [ + { + "raw": "is-extglob@^1.0.0", + "scope": null, + "escapedName": "is-extglob", + "name": "is-extglob", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch" + ] + ], + "_from": "is-extglob@>=1.0.0 <2.0.0", + "_id": "is-extglob@1.0.0", + "_inCache": true, + "_location": "/is-extglob", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "raw": "is-extglob@^1.0.0", + "scope": null, + "escapedName": "is-extglob", + "name": "is-extglob", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/extglob", + "/is-glob", + "/micromatch", + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "_shasum": "ac468177c4943405a092fc8f29760c6ffc6206c0", + "_shrinkwrap": null, + "_spec": "is-extglob@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "dependencies": {}, + "description": "Returns true if a string has an extglob.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "ac468177c4943405a092fc8f29760c6ffc6206c0", + "tarball": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-extglob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "extglob", + "expression", + "glob", + "globbing", + "globstar", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "is-extglob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extglob.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js", + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/node_modules/is-finite/index.js b/node_modules/is-finite/index.js new file mode 100755 index 00000000..80673875 --- /dev/null +++ b/node_modules/is-finite/index.js @@ -0,0 +1,6 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = Number.isFinite || function (val) { + return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity); +}; diff --git a/node_modules/is-finite/license b/node_modules/is-finite/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/is-finite/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-finite/package.json b/node_modules/is-finite/package.json new file mode 100755 index 00000000..d79e516b --- /dev/null +++ b/node_modules/is-finite/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "is-finite@^1.0.0", + "scope": null, + "escapedName": "is-finite", + "name": "is-finite", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/repeating" + ] + ], + "_from": "is-finite@>=1.0.0 <2.0.0", + "_id": "is-finite@1.0.2", + "_inCache": true, + "_location": "/is-finite", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/is-finite-1.0.2.tgz_1475221456713_0.784205764066428" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "is-finite@^1.0.0", + "scope": null, + "escapedName": "is-finite", + "name": "is-finite", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/repeating" + ], + "_resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "_shasum": "cc6677695602be550ef11e8b4aa6305342b6d0aa", + "_shrinkwrap": null, + "_spec": "is-finite@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/repeating", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-finite/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "ES2015 Number.isFinite() ponyfill", + "devDependencies": { + "ava": "*" + }, + "directories": {}, + "dist": { + "shasum": "cc6677695602be550ef11e8b4aa6305342b6d0aa", + "tarball": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "43f8bb814834d8573d11ba4a631d19006d0c8897", + "homepage": "https://github.com/sindresorhus/is-finite#readme", + "keywords": [ + "es2015", + "ponyfill", + "polyfill", + "shim", + "number", + "finite", + "is" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-finite", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-finite.git" + }, + "scripts": { + "test": "ava" + }, + "version": "1.0.2" +} diff --git a/node_modules/is-finite/readme.md b/node_modules/is-finite/readme.md new file mode 100755 index 00000000..567710ca --- /dev/null +++ b/node_modules/is-finite/readme.md @@ -0,0 +1,28 @@ +# is-finite [![Build Status](https://travis-ci.org/sindresorhus/is-finite.svg?branch=master)](https://travis-ci.org/sindresorhus/is-finite) + +> ES2015 [`Number.isFinite()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) [ponyfill](https://ponyfill.com) + + +## Install + +```sh +$ npm install --save is-finite +``` + + +## Usage + +```js +var numIsFinite = require('is-finite'); + +numIsFinite(4); +//=> true + +numIsFinite(Infinity); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100755 index 00000000..fa30c4cb --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100755 index 00000000..b1625429 --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,105 @@ +# is-glob [![NPM version](https://badge.fury.io/js/is-glob.svg)](http://badge.fury.io/js/is-glob) [![Build Status](https://travis-ci.org/jonschlinkert/is-glob.svg)](https://travis-ci.org/jonschlinkert/is-glob) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Also take a look at [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-glob --save +``` + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +isGlob('abc/?.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +## Related + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob) +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) +* [is-posix-bracket](https://www.npmjs.com/package/is-posix-bracket): Returns true if the given string is a POSIX bracket expression (POSIX character class). | [homepage](https://github.com/jonschlinkert/is-posix-bracket) +* [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Run tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-glob/issues/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 02, 2015._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100755 index 00000000..ef27bba4 --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,14 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob = require('is-extglob'); + +module.exports = function isGlob(str) { + return typeof str === 'string' + && (/[*!?{}(|)[\]]/.test(str) + || isExtglob(str)); +}; \ No newline at end of file diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100755 index 00000000..f11a2055 --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,127 @@ +{ + "_args": [ + [ + { + "raw": "is-glob@^2.0.0", + "scope": null, + "escapedName": "is-glob", + "name": "is-glob", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chokidar" + ] + ], + "_from": "is-glob@>=2.0.0 <3.0.0", + "_id": "is-glob@2.0.1", + "_inCache": true, + "_location": "/is-glob", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "is-glob@^2.0.0", + "scope": null, + "escapedName": "is-glob", + "name": "is-glob", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chokidar", + "/glob-base", + "/glob-parent", + "/micromatch", + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "_shasum": "d096f926a3ded5600f3fdfd91198cb0888c2d863", + "_shrinkwrap": null, + "_spec": "is-glob@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/chokidar", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-glob/issues" + }, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "d096f926a3ded5600f3fdfd91198cb0888c2d863", + "tarball": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "d7db1b2dd559b3d5a73f89dbe72d9e9f4d6587d7", + "homepage": "https://github.com/jonschlinkert/is-glob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "extglob", + "expression", + "glob", + "globbing", + "globstar", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "is-glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "has-glob", + "is-extglob", + "is-posix-bracket", + "is-valid-glob", + "micromatch" + ] + } + }, + "version": "2.0.1" +} diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE new file mode 100755 index 00000000..fa30c4cb --- /dev/null +++ b/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md new file mode 100755 index 00000000..8395f913 --- /dev/null +++ b/node_modules/is-number/README.md @@ -0,0 +1,103 @@ +# is-number [![NPM version](https://badge.fury.io/js/is-number.svg)](http://badge.fury.io/js/is-number) [![Build Status](https://travis-ci.org/jonschlinkert/is-number.svg)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a number. comprehensive tests. + +To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-number --save +``` + +## Usage + +```js +var isNumber = require('is-number'); +``` + +### true + +See the [tests](./test.js) for more examples. + +```js +isNumber(5e3) //=> 'true' +isNumber(0xff) //=> 'true' +isNumber(-1.1) //=> 'true' +isNumber(0) //=> 'true' +isNumber(1) //=> 'true' +isNumber(1.1) //=> 'true' +isNumber(10) //=> 'true' +isNumber(10.10) //=> 'true' +isNumber(100) //=> 'true' +isNumber('-1.1') //=> 'true' +isNumber('0') //=> 'true' +isNumber('012') //=> 'true' +isNumber('0xff') //=> 'true' +isNumber('1') //=> 'true' +isNumber('1.1') //=> 'true' +isNumber('10') //=> 'true' +isNumber('10.10') //=> 'true' +isNumber('100') //=> 'true' +isNumber('5e3') //=> 'true' +isNumber(parseInt('012')) //=> 'true' +isNumber(parseFloat('012')) //=> 'true' +``` + +### False + +See the [tests](./test.js) for more examples. + +```js +isNumber('foo') //=> 'false' +isNumber([1]) //=> 'false' +isNumber([]) //=> 'false' +isNumber(function () {}) //=> 'false' +isNumber(Infinity) //=> 'false' +isNumber(NaN) //=> 'false' +isNumber(new Array('abc')) //=> 'false' +isNumber(new Array(2)) //=> 'false' +isNumber(new Buffer('abc')) //=> 'false' +isNumber(null) //=> 'false' +isNumber(undefined) //=> 'false' +isNumber({abc: 'abc'}) //=> 'false' +``` + +## Other projects + +* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even) +* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even) +* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd) +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive) +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) +* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-number/issues/new). + +## Run tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 22, 2015._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js new file mode 100755 index 00000000..96ec66d5 --- /dev/null +++ b/node_modules/is-number/index.js @@ -0,0 +1,19 @@ +/*! + * is-number + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isNumber(num) { + var type = typeOf(num); + if (type !== 'number' && type !== 'string') { + return false; + } + var n = +num; + return (n - n + 1) >= 0 && num !== ''; +}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json new file mode 100755 index 00000000..29824cfa --- /dev/null +++ b/node_modules/is-number/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "is-number@^2.1.0", + "scope": null, + "escapedName": "is-number", + "name": "is-number", + "rawSpec": "^2.1.0", + "spec": ">=2.1.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fill-range" + ] + ], + "_from": "is-number@>=2.1.0 <3.0.0", + "_id": "is-number@2.1.0", + "_inCache": true, + "_location": "/is-number", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "raw": "is-number@^2.1.0", + "scope": null, + "escapedName": "is-number", + "name": "is-number", + "rawSpec": "^2.1.0", + "spec": ">=2.1.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fill-range", + "/randomatic" + ], + "_resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "_shasum": "01fcbbb393463a548f2f466cce16dece49db908f", + "_shrinkwrap": null, + "_spec": "is-number@^2.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "dependencies": { + "kind-of": "^3.0.2" + }, + "description": "Returns true if the value is a number. comprehensive tests.", + "devDependencies": { + "benchmarked": "^0.1.3", + "chalk": "^0.5.1", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "01fcbbb393463a548f2f466cce16dece49db908f", + "tarball": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "d06c6e2cc048d3cad016cb8dfb055bb14d86fffa", + "homepage": "https://github.com/jonschlinkert/is-number", + "keywords": [ + "check", + "coerce", + "coercion", + "integer", + "is", + "is number", + "is-number", + "istype", + "kind of", + "math", + "number", + "test", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "is-number", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-number.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "kind-of", + "is-primitive", + "even", + "odd", + "is-even", + "is-odd" + ] + } + }, + "version": "2.1.0" +} diff --git a/node_modules/is-posix-bracket/LICENSE b/node_modules/is-posix-bracket/LICENSE new file mode 100755 index 00000000..1e49edf8 --- /dev/null +++ b/node_modules/is-posix-bracket/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-posix-bracket/README.md b/node_modules/is-posix-bracket/README.md new file mode 100755 index 00000000..1d06a4d9 --- /dev/null +++ b/node_modules/is-posix-bracket/README.md @@ -0,0 +1,88 @@ +# is-posix-bracket [![NPM version](https://img.shields.io/npm/v/is-posix-bracket.svg?style=flat)](https://www.npmjs.com/package/is-posix-bracket) [![NPM downloads](https://img.shields.io/npm/dm/is-posix-bracket.svg?style=flat)](https://npmjs.org/package/is-posix-bracket) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-posix-bracket.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-posix-bracket) + +> Returns true if the given string is a POSIX bracket expression (POSIX character class). + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install is-posix-bracket --save +``` + +## Usage + +```js +var isPosixBracket = require('is-posix-bracket'); + +isPosixBracket('[foo:]]'); +//=> false +isPosixBracket('[xdigit:]]'); +//=> false +isPosixBracket('[[:xdigit:]]'); +//=> true +isPosixBracket('[[:xdigit:]]'); +//=> true +isPosixBracket('[[:alpha:]123]'); +//=> true +isPosixBracket('[[:alpha:]123]'); +//=> true +isPosixBracket('[a-c[:digit:]x-z]'); +//=> true +isPosixBracket('[:al:]'); +//=> true +isPosixBracket('[abc[:punct:][0-9]'); +//=> true +``` + +## Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://www.npmjs.com/package/braces) | [homepage](https://github.com/jonschlinkert/braces) +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets) +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-posix-bracket/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-posix-bracket/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v, on April 05, 2016._ \ No newline at end of file diff --git a/node_modules/is-posix-bracket/index.js b/node_modules/is-posix-bracket/index.js new file mode 100755 index 00000000..7cf1de55 --- /dev/null +++ b/node_modules/is-posix-bracket/index.js @@ -0,0 +1,10 @@ +/*! + * is-posix-bracket + * + * Copyright (c) 2015-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isPosixBracket(str) { + return typeof str === 'string' && /\[([:.=+])(?:[^\[\]]|)+\1\]/.test(str); +}; diff --git a/node_modules/is-posix-bracket/package.json b/node_modules/is-posix-bracket/package.json new file mode 100755 index 00000000..b5757a20 --- /dev/null +++ b/node_modules/is-posix-bracket/package.json @@ -0,0 +1,131 @@ +{ + "_args": [ + [ + { + "raw": "is-posix-bracket@^0.1.0", + "scope": null, + "escapedName": "is-posix-bracket", + "name": "is-posix-bracket", + "rawSpec": "^0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/expand-brackets" + ] + ], + "_from": "is-posix-bracket@>=0.1.0 <0.2.0", + "_id": "is-posix-bracket@0.1.1", + "_inCache": true, + "_location": "/is-posix-bracket", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/is-posix-bracket-0.1.1.tgz_1459834297811_0.5273812564555556" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "raw": "is-posix-bracket@^0.1.0", + "scope": null, + "escapedName": "is-posix-bracket", + "name": "is-posix-bracket", + "rawSpec": "^0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/expand-brackets" + ], + "_resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "_shasum": "3334dc79774368e92f016e6fbc0a88f5cd6e6bc4", + "_shrinkwrap": null, + "_spec": "is-posix-bracket@^0.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/expand-brackets", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-posix-bracket/issues" + }, + "dependencies": {}, + "description": "Returns true if the given string is a POSIX bracket expression (POSIX character class).", + "devDependencies": { + "gulp-format-md": "^0.1.7", + "mocha": "^2.4.5" + }, + "directories": {}, + "dist": { + "shasum": "3334dc79774368e92f016e6fbc0a88f5cd6e6bc4", + "tarball": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "43972556cfdbb681a15072da75c97952c4e4deba", + "homepage": "https://github.com/jonschlinkert/is-posix-bracket", + "keywords": [ + "braces", + "brackets", + "character", + "character-class", + "class", + "expression", + "posix", + "regex", + "regexp", + "regular" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "is-posix-bracket", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-posix-bracket.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "braces", + "expand-brackets", + "is-extglob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.1" +} diff --git a/node_modules/is-primitive/LICENSE b/node_modules/is-primitive/LICENSE new file mode 100755 index 00000000..fa30c4cb --- /dev/null +++ b/node_modules/is-primitive/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-primitive/README.md b/node_modules/is-primitive/README.md new file mode 100755 index 00000000..e1c30642 --- /dev/null +++ b/node_modules/is-primitive/README.md @@ -0,0 +1,57 @@ +# is-primitive [![NPM version](https://badge.fury.io/js/is-primitive.svg)](http://badge.fury.io/js/is-primitive) [![Build Status](https://travis-ci.org/jonschlinkert/is-primitive.svg)](https://travis-ci.org/jonschlinkert/is-primitive) + +> Returns `true` if the value is a primitive. + +## Install with [npm](npmjs.org) + +```bash +npm i is-primitive --save +``` + +## Running tests +Install dev dependencies. + +```bash +npm i -d && npm test +``` + +## Usage + +```js +var isPrimitive = require('is-primitive'); +isPrimitive('abc'); +//=> true + +isPrimitive(42); +//=> true + +isPrimitive(false); +//=> true + +isPrimitive(true); +//=> true + +isPrimitive({}); +//=> false + +isPrimitive([]); +//=> false + +isPrimitive(function(){}); +//=> false +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2014-2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 16, 2015._ \ No newline at end of file diff --git a/node_modules/is-primitive/index.js b/node_modules/is-primitive/index.js new file mode 100755 index 00000000..55f11cf0 --- /dev/null +++ b/node_modules/is-primitive/index.js @@ -0,0 +1,13 @@ +/*! + * is-primitive + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +// see http://jsperf.com/testing-value-is-primitive/7 +module.exports = function isPrimitive(value) { + return value == null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/is-primitive/package.json b/node_modules/is-primitive/package.json new file mode 100755 index 00000000..c614709b --- /dev/null +++ b/node_modules/is-primitive/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + { + "raw": "is-primitive@^2.0.0", + "scope": null, + "escapedName": "is-primitive", + "name": "is-primitive", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/regex-cache" + ] + ], + "_from": "is-primitive@>=2.0.0 <3.0.0", + "_id": "is-primitive@2.0.0", + "_inCache": true, + "_location": "/is-primitive", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "raw": "is-primitive@^2.0.0", + "scope": null, + "escapedName": "is-primitive", + "name": "is-primitive", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/is-equal-shallow", + "/regex-cache" + ], + "_resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "_shasum": "207bab91638499c07b2adf240a41a87210034575", + "_shrinkwrap": null, + "_spec": "is-primitive@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/regex-cache", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-primitive/issues" + }, + "dependencies": {}, + "description": "Returns `true` if the value is a primitive. ", + "devDependencies": { + "mocha": "*", + "should": "^4.0.4" + }, + "directories": {}, + "dist": { + "shasum": "207bab91638499c07b2adf240a41a87210034575", + "tarball": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "c512b7c95fb049aa9b1f039ddc0670611b66cce2", + "homepage": "https://github.com/jonschlinkert/is-primitive", + "keywords": [ + "boolean", + "check", + "number", + "primitive", + "string", + "symbol", + "type", + "typeof", + "util" + ], + "license": { + "type": "MIT", + "url": "https://github.com/jonschlinkert/is-primitive/blob/master/LICENSE" + }, + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "is-primitive", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/is-primitive.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.0" +} diff --git a/node_modules/isarray/.npmignore b/node_modules/isarray/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/isarray/.travis.yml b/node_modules/isarray/.travis.yml new file mode 100755 index 00000000..cc4dba29 --- /dev/null +++ b/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/isarray/Makefile b/node_modules/isarray/Makefile new file mode 100755 index 00000000..787d56e1 --- /dev/null +++ b/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/node_modules/isarray/README.md b/node_modules/isarray/README.md new file mode 100755 index 00000000..16d2c59c --- /dev/null +++ b/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/isarray/component.json b/node_modules/isarray/component.json new file mode 100755 index 00000000..9e31b683 --- /dev/null +++ b/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/node_modules/isarray/index.js b/node_modules/isarray/index.js new file mode 100755 index 00000000..a57f6349 --- /dev/null +++ b/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/isarray/package.json b/node_modules/isarray/package.json new file mode 100755 index 00000000..9f34e5bf --- /dev/null +++ b/node_modules/isarray/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "isarray@~1.0.0", + "scope": null, + "escapedName": "isarray", + "name": "isarray", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream" + ] + ], + "_from": "isarray@>=1.0.0 <1.1.0", + "_id": "isarray@1.0.0", + "_inCache": true, + "_location": "/isarray", + "_nodeVersion": "5.1.0", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "isarray@~1.0.0", + "scope": null, + "escapedName": "isarray", + "name": "isarray", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/buffer", + "/isobject", + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_shrinkwrap": null, + "_spec": "isarray@~1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "dependencies": {}, + "description": "Array#isArray for older browsers", + "devDependencies": { + "tape": "~2.13.4" + }, + "directories": {}, + "dist": { + "shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "tarball": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "browser", + "isarray", + "array" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "isarray", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.0" +} diff --git a/node_modules/isarray/test.js b/node_modules/isarray/test.js new file mode 100755 index 00000000..e0c3444d --- /dev/null +++ b/node_modules/isarray/test.js @@ -0,0 +1,20 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); + diff --git a/node_modules/isobject/LICENSE b/node_modules/isobject/LICENSE new file mode 100755 index 00000000..39245ac1 --- /dev/null +++ b/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/isobject/README.md b/node_modules/isobject/README.md new file mode 100755 index 00000000..9dd897aa --- /dev/null +++ b/node_modules/isobject/README.md @@ -0,0 +1,112 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat)](https://travis-ci.org/jonschlinkert/isobject) + +Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject --save +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` + +Install with [bower](http://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## Related projects + +You might also be interested in these projects: + +[merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep) + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow) +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/isobject/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/isobject/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 25, 2016._ \ No newline at end of file diff --git a/node_modules/isobject/index.js b/node_modules/isobject/index.js new file mode 100755 index 00000000..aa0dce0b --- /dev/null +++ b/node_modules/isobject/index.js @@ -0,0 +1,14 @@ +/*! + * isobject + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isArray = require('isarray'); + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && isArray(val) === false; +}; diff --git a/node_modules/isobject/package.json b/node_modules/isobject/package.json new file mode 100755 index 00000000..07df2a4e --- /dev/null +++ b/node_modules/isobject/package.json @@ -0,0 +1,137 @@ +{ + "_args": [ + [ + { + "raw": "isobject@^2.0.0", + "scope": null, + "escapedName": "isobject", + "name": "isobject", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fill-range" + ] + ], + "_from": "isobject@>=2.0.0 <3.0.0", + "_id": "isobject@2.1.0", + "_inCache": true, + "_location": "/isobject", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/isobject-2.1.0.tgz_1461618425262_0.8524945541284978" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "raw": "isobject@^2.0.0", + "scope": null, + "escapedName": "isobject", + "name": "isobject", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fill-range" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "_shasum": "f065561096a3f1da2ef46272f815c840d87e0c89", + "_shrinkwrap": null, + "_spec": "isobject@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "dependencies": { + "isarray": "1.0.0" + }, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "directories": {}, + "dist": { + "shasum": "f065561096a3f1da2ef46272f815c840d87e0c89", + "tarball": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "d693ec8d31b02b42a19b2d806407a4ecb2f9fb73", + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "isobject", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "merge-deep", + "extend-shallow", + "is-plain-object", + "kind-of" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "2.1.0" +} diff --git a/node_modules/isstream/.jshintrc b/node_modules/isstream/.jshintrc new file mode 100755 index 00000000..c8ef3ca4 --- /dev/null +++ b/node_modules/isstream/.jshintrc @@ -0,0 +1,59 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": false + , "passfail": false +} \ No newline at end of file diff --git a/node_modules/isstream/.npmignore b/node_modules/isstream/.npmignore new file mode 100755 index 00000000..aa1ec1ea --- /dev/null +++ b/node_modules/isstream/.npmignore @@ -0,0 +1 @@ +*.tgz diff --git a/node_modules/isstream/.travis.yml b/node_modules/isstream/.travis.yml new file mode 100755 index 00000000..1fec2ab9 --- /dev/null +++ b/node_modules/isstream/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" +branches: + only: + - master +notifications: + email: + - rod@vagg.org +script: npm test diff --git a/node_modules/isstream/LICENSE.md b/node_modules/isstream/LICENSE.md new file mode 100755 index 00000000..43f7153f --- /dev/null +++ b/node_modules/isstream/LICENSE.md @@ -0,0 +1,11 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2015 Rod Vagg +--------------------------- + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/isstream/README.md b/node_modules/isstream/README.md new file mode 100755 index 00000000..06770e82 --- /dev/null +++ b/node_modules/isstream/README.md @@ -0,0 +1,66 @@ +# isStream + +[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream) + +**Test if an object is a `Stream`** + +[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/) + +The missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**. + +## Usage: + +```js +var isStream = require('isstream') +var Stream = require('stream') + +isStream(new Stream()) // true + +isStream({}) // false + +isStream(new Stream.Readable()) // true +isStream(new Stream.Writable()) // true +isStream(new Stream.Duplex()) // true +isStream(new Stream.Transform()) // true +isStream(new Stream.PassThrough()) // true +``` + +## But wait! There's more! + +You can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes. + +```js +var isReadable = require('isstream').isReadable +var isWritable = require('isstream').isWritable +var isDuplex = require('isstream').isDuplex +var Stream = require('stream') + +isReadable(new Stream()) // false +isWritable(new Stream()) // false +isDuplex(new Stream()) // false + +isReadable(new Stream.Readable()) // true +isReadable(new Stream.Writable()) // false +isReadable(new Stream.Duplex()) // true +isReadable(new Stream.Transform()) // true +isReadable(new Stream.PassThrough()) // true + +isWritable(new Stream.Readable()) // false +isWritable(new Stream.Writable()) // true +isWritable(new Stream.Duplex()) // true +isWritable(new Stream.Transform()) // true +isWritable(new Stream.PassThrough()) // true + +isDuplex(new Stream.Readable()) // false +isDuplex(new Stream.Writable()) // false +isDuplex(new Stream.Duplex()) // true +isDuplex(new Stream.Transform()) // true +isDuplex(new Stream.PassThrough()) // true +``` + +*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).* + + +## License + +**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/node_modules/isstream/isstream.js b/node_modules/isstream/isstream.js new file mode 100755 index 00000000..a1d104a7 --- /dev/null +++ b/node_modules/isstream/isstream.js @@ -0,0 +1,27 @@ +var stream = require('stream') + + +function isStream (obj) { + return obj instanceof stream.Stream +} + + +function isReadable (obj) { + return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' +} + + +function isWritable (obj) { + return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' +} + + +function isDuplex (obj) { + return isReadable(obj) && isWritable(obj) +} + + +module.exports = isStream +module.exports.isReadable = isReadable +module.exports.isWritable = isWritable +module.exports.isDuplex = isDuplex diff --git a/node_modules/isstream/package.json b/node_modules/isstream/package.json new file mode 100755 index 00000000..a5791711 --- /dev/null +++ b/node_modules/isstream/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + { + "raw": "isstream@0.1.x", + "scope": null, + "escapedName": "isstream", + "name": "isstream", + "rawSpec": "0.1.x", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/winston" + ] + ], + "_from": "isstream@>=0.1.0 <0.2.0", + "_id": "isstream@0.1.2", + "_inCache": true, + "_location": "/isstream", + "_nodeVersion": "1.4.3", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "2.6.1", + "_phantomChildren": {}, + "_requested": { + "raw": "isstream@0.1.x", + "scope": null, + "escapedName": "isstream", + "name": "isstream", + "rawSpec": "0.1.x", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/winston" + ], + "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "_shrinkwrap": null, + "_spec": "isstream@0.1.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/winston", + "author": { + "name": "Rod Vagg", + "email": "rod@vagg.org" + }, + "bugs": { + "url": "https://github.com/rvagg/isstream/issues" + }, + "dependencies": {}, + "description": "Determine if an object is a Stream", + "devDependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "tape": "~2.12.3" + }, + "directories": {}, + "dist": { + "shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "tarball": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + }, + "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc", + "homepage": "https://github.com/rvagg/isstream", + "keywords": [ + "stream", + "type", + "streams", + "readable-stream", + "hippo" + ], + "license": "MIT", + "main": "isstream.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "isstream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/isstream.git" + }, + "scripts": { + "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + }, + "version": "0.1.2" +} diff --git a/node_modules/isstream/test.js b/node_modules/isstream/test.js new file mode 100755 index 00000000..8c950c55 --- /dev/null +++ b/node_modules/isstream/test.js @@ -0,0 +1,168 @@ +var tape = require('tape') + , EE = require('events').EventEmitter + , util = require('util') + + + , isStream = require('./') + , isReadable = require('./').isReadable + , isWritable = require('./').isWritable + , isDuplex = require('./').isDuplex + + , CoreStreams = require('stream') + , ReadableStream10 = require('./readable-stream-1.0/') + , ReadableStream11 = require('./readable-stream-1.1/') + + +function test (pass, type, stream) { + tape('isStream(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isStream(stream), type) + }) +} + + +function testReadable (pass, type, stream) { + tape('isReadable(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isReadable(stream), type) + }) +} + + +function testWritable (pass, type, stream) { + tape('isWritable(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isWritable(stream), type) + }) +} + + +function testDuplex (pass, type, stream) { + tape('isDuplex(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isDuplex(stream), type) + }) +} + + +[ undefined, null, '', true, false, 0, 1, 1.0, 'string', {}, function foo () {} ].forEach(function (o) { + test(false, 'non-stream / primitive: ' + (JSON.stringify(o) || (o && o.toString()) || o), o) +}) + + +test(false, 'fake stream obj', { pipe: function () {} }) + + +;(function () { + + // looks like a stream! + + function Stream () { + EE.call(this) + } + util.inherits(Stream, EE) + Stream.prototype.pipe = function () {} + Stream.Stream = Stream + + test(false, 'fake stream "new Stream()"', new Stream()) + +}()) + + +test(true, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +test(true, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +test(true, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +test(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +test(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +test(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +test(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +test(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +test(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +test(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +test(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +test(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +test(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +test(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +test(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +test(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +testReadable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +testReadable(true, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +testReadable(false, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +testReadable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +testReadable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +testReadable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +testReadable(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +testReadable(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +testReadable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +testReadable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +testReadable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +testReadable(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +testReadable(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +testReadable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +testReadable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +testReadable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +testWritable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +testWritable(false, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +testWritable(true, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +testWritable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +testWritable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +testWritable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +testWritable(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +testWritable(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +testWritable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +testWritable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +testWritable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +testWritable(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +testWritable(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +testWritable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +testWritable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +testWritable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +testDuplex(false, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +testDuplex(false, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +testDuplex(false, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +testDuplex(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +testDuplex(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +testDuplex(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +testDuplex(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +testDuplex(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +testDuplex(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +testDuplex(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +testDuplex(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +testDuplex(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +testDuplex(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +testDuplex(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +testDuplex(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +testDuplex(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +;[ CoreStreams, ReadableStream10, ReadableStream11 ].forEach(function (p) { + [ 'Stream', 'Readable', 'Writable', 'Duplex', 'Transform', 'PassThrough' ].forEach(function (k) { + if (!p[k]) + return + + function SubStream () { + p[k].call(this) + } + util.inherits(SubStream, p[k]) + + test(true, 'Stream subclass: ' + p.name + '.' + k, new SubStream()) + + }) +}) + + + diff --git a/node_modules/js-tokens/CHANGELOG.md b/node_modules/js-tokens/CHANGELOG.md new file mode 100755 index 00000000..c3398e3f --- /dev/null +++ b/node_modules/js-tokens/CHANGELOG.md @@ -0,0 +1,129 @@ +### Version 3.0.1 (2017-01-30) ### + +- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched + correctly. + + +### Version 3.0.0 (2017-01-11) ### + +This release contains one breaking change, that should [improve performance in +V8][v8-perf]: + +> So how can you, as a JavaScript developer, ensure that your RegExps are fast? +> If you are not interested in hooking into RegExp internals, make sure that +> neither the RegExp instance, nor its prototype is modified in order to get the +> best performance: +> +> ```js +> var re = /./g; +> re.exec(''); // Fast path. +> re.new_property = 'slow'; +> ``` + +This module used to export a single regex, with `.matchToToken` bolted +on, just like in the above example. This release changes the exports of +the module to avoid this issue. + +Before: + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens") +var matchToToken = jsTokens.matchToToken +``` + +After: + +```js +import jsTokens, {matchToToken} from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +var matchToToken = require("js-tokens").matchToToken +``` + +[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html + + +### Version 2.0.0 (2016-06-19) ### + +- Added: Support for ES2016. In other words, support for the `**` exponentiation + operator. + +These are the breaking changes: + +- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. +- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. + + +### Version 1.0.3 (2016-03-27) ### + +- Improved: Made the regex ever so slightly smaller. +- Updated: The readme. + + +### Version 1.0.2 (2015-10-18) ### + +- Improved: Limited npm package contents for a smaller download. Thanks to + @zertosh! + + +### Version 1.0.1 (2015-06-20) ### + +- Fixed: Declared an undeclared variable. + + +### Version 1.0.0 (2015-02-26) ### + +- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That + type is now equivalent to the Punctuator token in the ECMAScript + specification. (Backwards-incompatible change.) +- Fixed: A `-` followed by a number is now correctly matched as a punctuator + followed by a number. It used to be matched as just a number, but there is no + such thing as negative number literals. (Possibly backwards-incompatible + change.) + + +### Version 0.4.1 (2015-02-21) ### + +- Added: Support for the regex `u` flag. + + +### Version 0.4.0 (2015-02-21) ### + +- Improved: `jsTokens.matchToToken` performance. +- Added: Support for octal and binary number literals. +- Added: Support for template strings. + + +### Version 0.3.1 (2015-01-06) ### + +- Fixed: Support for unicode spaces. They used to be allowed in names (which is + very confusing), and some unicode newlines were wrongly allowed in strings and + regexes. + + +### Version 0.3.0 (2014-12-19) ### + +- Changed: The `jsTokens.names` array has been replaced with the + `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no + longer part of the public API; instead use said function. See this [gist] for + an example. (Backwards-incompatible change.) +- Changed: The empty string is now considered an “invalid” token, instead an + “empty” token (its own group). (Backwards-incompatible change.) +- Removed: component support. (Backwards-incompatible change.) + +[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 + + +### Version 0.2.0 (2014-06-19) ### + +- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own + category (“functionArrow”), for simplicity. (Backwards-incompatible change.) +- Added: ES6 splats (`...`) are now matched as an operator (instead of three + punctuations). (Backwards-incompatible change.) + + +### Version 0.1.0 (2014-03-08) ### + +- Initial release. diff --git a/node_modules/js-tokens/LICENSE b/node_modules/js-tokens/LICENSE new file mode 100755 index 00000000..748f42e8 --- /dev/null +++ b/node_modules/js-tokens/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2016, 2017 Simon Lydell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/js-tokens/README.md b/node_modules/js-tokens/README.md new file mode 100755 index 00000000..0c805c22 --- /dev/null +++ b/node_modules/js-tokens/README.md @@ -0,0 +1,222 @@ +Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) +======== + +A regex that tokenizes JavaScript. + +```js +var jsTokens = require("js-tokens").default + +var jsString = "var foo=opts.foo;\n..." + +jsString.match(jsTokens) +// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] +``` + + +Installation +============ + +`npm install js-tokens` + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +``` + + +Usage +===== + +### `jsTokens` ### + +A regex with the `g` flag that matches JavaScript tokens. + +The regex _always_ matches, even invalid JavaScript and the empty string. + +The next match is always directly after the previous. + +### `var token = matchToToken(match)` ### + +```js +import {matchToToken} from "js-tokens" +// or: +var matchToToken = require("js-tokens").matchToToken +``` + +Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: +String, value: String}` object. The following types are available: + +- string +- comment +- regex +- number +- name +- punctuator +- whitespace +- invalid + +Multi-line comments and strings also have a `closed` property indicating if the +token was closed or not (see below). + +Comments and strings both come in several flavors. To distinguish them, check if +the token starts with `//`, `/*`, `'`, `"` or `` ` ``. + +Names are ECMAScript IdentifierNames, that is, including both identifiers and +keywords. You may use [is-keyword-js] to tell them apart. + +Whitespace includes both line terminators and other whitespace. + +[is-keyword-js]: https://github.com/crissdev/is-keyword-js + + +ECMAScript support +================== + +The intention is to always support the latest stable ECMAScript version. + +If adding support for a newer version requires changes, a new version with a +major verion bump will be released. + +Currently, [ECMAScript 2016] is supported. + +[ECMAScript 2016]: http://www.ecma-international.org/ecma-262/7.0/index.html + + +Invalid code handling +===================== + +Unterminated strings are still matched as strings. JavaScript strings cannot +contain (unescaped) newlines, so unterminated strings simply end at the end of +the line. Unterminated template strings can contain unescaped newlines, though, +so they go on to the end of input. + +Unterminated multi-line comments are also still matched as comments. They +simply go on to the end of the input. + +Unterminated regex literals are likely matched as division and whatever is +inside the regex. + +Invalid ASCII characters have their own capturing group. + +Invalid non-ASCII characters are treated as names, to simplify the matching of +names (except unicode spaces which are treated as whitespace). + +Regex literals may contain invalid regex syntax. They are still matched as +regex literals. They may also contain repeated regex flags, to keep the regex +simple. + +Strings may contain invalid escape sequences. + + +Limitations +=========== + +Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be +perfect. But that’s not the point either. + +You may compare jsTokens with [esprima] by using `esprima-compare.js`. +See `npm run esprima-compare`! + +[esprima]: http://esprima.org/ + +### Template string interpolation ### + +Template strings are matched as single tokens, from the starting `` ` `` to the +ending `` ` ``, including interpolations (whose tokens are not matched +individually). + +Matching template string interpolations requires recursive balancing of `{` and +`}`—something that JavaScript regexes cannot do. Only one level of nesting is +supported. + +### Division and regex literals collision ### + +Consider this example: + +```js +var g = 9.82 +var number = bar / 2/g + +var regex = / 2/g +``` + +A human can easily understand that in the `number` line we’re dealing with +division, and in the `regex` line we’re dealing with a regex literal. How come? +Because humans can look at the whole code to put the `/` characters in context. +A JavaScript regex cannot. It only sees forwards. + +When the `jsTokens` regex scans throught the above, it will see the following +at the end of both the `number` and `regex` rows: + +```js +/ 2/g +``` + +It is then impossible to know if that is a regex literal, or part of an +expression dealing with division. + +Here is a similar case: + +```js +foo /= 2/g +foo(/= 2/g) +``` + +The first line divides the `foo` variable with `2/g`. The second line calls the +`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only +sees forwards, it cannot tell the two cases apart. + +There are some cases where we _can_ tell division and regex literals apart, +though. + +First off, we have the simple cases where there’s only one slash in the line: + +```js +var foo = 2/g +foo /= 2 +``` + +Regex literals cannot contain newlines, so the above cases are correctly +identified as division. Things are only problematic when there are more than +one non-comment slash in a single line. + +Secondly, not every character is a valid regex flag. + +```js +var number = bar / 2/e +``` + +The above example is also correctly identified as division, because `e` is not a +valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` +(any letter) as flags, but it is not worth it since it increases the amount of +ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are +allowed. This means that the above example will be identified as division as +long as you don’t rename the `e` variable to some permutation of `gmiyu` 1 to 5 +characters long. + +Lastly, we can look _forward_ for information. + +- If the token following what looks like a regex literal is not valid after a + regex literal, but is valid in a division expression, then the regex literal + is treated as division instead. For example, a flagless regex cannot be + followed by a string, number or name, but all of those three can be the + denominator of a division. +- Generally, if what looks like a regex literal is followed by an operator, the + regex literal is treated as division instead. This is because regexes are + seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division + could likely be part of such an expression. + +Please consult the regex source and the test cases for precise information on +when regex or division is matched (should you need to know). In short, you +could sum it up as: + +If the end of a statement looks like a regex literal (even if it isn’t), it +will be treated as one. Otherwise it should work as expected (if you write sane +code). + + +License +======= + +[MIT](LICENSE). diff --git a/node_modules/js-tokens/index.js b/node_modules/js-tokens/index.js new file mode 100755 index 00000000..a3c8a0d7 --- /dev/null +++ b/node_modules/js-tokens/index.js @@ -0,0 +1,23 @@ +// Copyright 2014, 2015, 2016, 2017 Simon Lydell +// License: MIT. (See LICENSE.) + +Object.defineProperty(exports, "__esModule", { + value: true +}) + +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0]} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} diff --git a/node_modules/js-tokens/package.json b/node_modules/js-tokens/package.json new file mode 100755 index 00000000..ab10a5a2 --- /dev/null +++ b/node_modules/js-tokens/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "js-tokens@^3.0.0", + "scope": null, + "escapedName": "js-tokens", + "name": "js-tokens", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-code-frame" + ] + ], + "_from": "js-tokens@>=3.0.0 <4.0.0", + "_id": "js-tokens@3.0.1", + "_inCache": true, + "_location": "/js-tokens", + "_nodeVersion": "7.2.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/js-tokens-3.0.1.tgz_1485800902865_0.11822547880001366" + }, + "_npmUser": { + "name": "lydell", + "email": "simon.lydell@gmail.com" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "js-tokens@^3.0.0", + "scope": null, + "escapedName": "js-tokens", + "name": "js-tokens", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-code-frame", + "/loose-envify" + ], + "_resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz", + "_shasum": "08e9f132484a2c45a30907e9dc4d5567b7f114d7", + "_shrinkwrap": null, + "_spec": "js-tokens@^3.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-code-frame", + "author": { + "name": "Simon Lydell" + }, + "bugs": { + "url": "https://github.com/lydell/js-tokens/issues" + }, + "dependencies": {}, + "description": "A regex that tokenizes JavaScript.", + "devDependencies": { + "coffee-script": "~1.12.2", + "esprima": "^3.1.3", + "everything.js": "^1.0.3", + "mocha": "^3.2.0" + }, + "directories": {}, + "dist": { + "shasum": "08e9f132484a2c45a30907e9dc4d5567b7f114d7", + "tarball": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "54549dd979142c78cf629b51f9f06e8133c529f9", + "homepage": "https://github.com/lydell/js-tokens#readme", + "keywords": [ + "JavaScript", + "js", + "token", + "tokenize", + "regex" + ], + "license": "MIT", + "maintainers": [ + { + "name": "lydell", + "email": "simon.lydell@gmail.com" + } + ], + "name": "js-tokens", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lydell/js-tokens.git" + }, + "scripts": { + "build": "node generate-index.js", + "dev": "npm run build && npm test", + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", + "test": "mocha --ui tdd" + }, + "version": "3.0.1" +} diff --git a/node_modules/jsesc/LICENSE-MIT.txt b/node_modules/jsesc/LICENSE-MIT.txt new file mode 100755 index 00000000..a41e0a7e --- /dev/null +++ b/node_modules/jsesc/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsesc/bin/jsesc b/node_modules/jsesc/bin/jsesc new file mode 100755 index 00000000..e9a541db --- /dev/null +++ b/node_modules/jsesc/bin/jsesc @@ -0,0 +1,148 @@ +#!/usr/bin/env node +(function() { + + var fs = require('fs'); + var stringEscape = require('../jsesc.js'); + var strings = process.argv.splice(2); + var stdin = process.stdin; + var data; + var timeout; + var isObject = false; + var options = {}; + var log = console.log; + + var main = function() { + var option = strings[0]; + + if (/^(?:-h|--help|undefined)$/.test(option)) { + log( + 'jsesc v%s - https://mths.be/jsesc', + stringEscape.version + ); + log([ + '\nUsage:\n', + '\tjsesc [string]', + '\tjsesc [-s | --single-quotes] [string]', + '\tjsesc [-d | --double-quotes] [string]', + '\tjsesc [-w | --wrap] [string]', + '\tjsesc [-e | --escape-everything] [string]', + '\tjsesc [-t | --escape-etago] [string]', + '\tjsesc [-6 | --es6] [string]', + '\tjsesc [-l | --lowercase-hex] [string]', + '\tjsesc [-j | --json] [string]', + '\tjsesc [-o | --object] [stringified_object]', // `JSON.parse()` the argument + '\tjsesc [-p | --pretty] [string]', // `compact: false` + '\tjsesc [-v | --version]', + '\tjsesc [-h | --help]', + '\nExamples:\n', + '\tjsesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tjsesc --json \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tjsesc --json --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tjsesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | jsesc' + ].join('\n')); + return process.exit(1); + } + + if (/^(?:-v|--version)$/.test(option)) { + log('v%s', stringEscape.version); + return process.exit(1); + } + + strings.forEach(function(string) { + // Process options + if (/^(?:-s|--single-quotes)$/.test(string)) { + options.quotes = 'single'; + return; + } + if (/^(?:-d|--double-quotes)$/.test(string)) { + options.quotes = 'double'; + return; + } + if (/^(?:-w|--wrap)$/.test(string)) { + options.wrap = true; + return; + } + if (/^(?:-e|--escape-everything)$/.test(string)) { + options.escapeEverything = true; + return; + } + if (/^(?:-t|--escape-etago)$/.test(string)) { + options.escapeEtago = true; + return; + } + if (/^(?:-6|--es6)$/.test(string)) { + options.es6 = true; + return; + } + if (/^(?:-l|--lowercase-hex)$/.test(string)) { + options.lowercaseHex = true; + return; + } + if (/^(?:-j|--json)$/.test(string)) { + options.json = true; + return; + } + if (/^(?:-o|--object)$/.test(string)) { + isObject = true; + return; + } + if (/^(?:-p|--pretty)$/.test(string)) { + isObject = true; + options.compact = false; + return; + } + + // Process string(s) + var result; + try { + if (isObject) { + string = JSON.parse(string); + } + result = stringEscape(string, options); + log(result); + } catch(error) { + log(error.message + '\n'); + log('Error: failed to escape.'); + log('If you think this is a bug in jsesc, please report it:'); + log('https://github.com/mathiasbynens/jsesc/issues/new'); + log( + '\nStack trace using jsesc@%s:\n', + stringEscape.version + ); + log(error.stack); + return process.exit(1); + } + }); + // Return with exit status 0 outside of the `forEach` loop, in case + // multiple strings were passed in. + return process.exit(0); + + }; + + if (stdin.isTTY) { + // handle shell arguments + main(); + } else { + // Either the script is called from within a non-TTY context, + // or `stdin` content is being piped in. + if (!process.stdout.isTTY) { // called from a non-TTY context + timeout = setTimeout(function() { + // if no piped data arrived after a while, handle shell arguments + main(); + }, 250); + } + + data = ''; + stdin.on('data', function(chunk) { + clearTimeout(timeout); + data += chunk; + }); + stdin.on('end', function() { + strings.push(data.trim()); + main(); + }); + stdin.resume(); + } + +}()); diff --git a/node_modules/jsesc/jsesc.js b/node_modules/jsesc/jsesc.js new file mode 100755 index 00000000..460353f8 --- /dev/null +++ b/node_modules/jsesc/jsesc.js @@ -0,0 +1,345 @@ +/*! https://mths.be/jsesc v1.3.0 by @mathias */ +;(function(root) { + + // Detect free variables `exports` + var freeExports = typeof exports == 'object' && exports; + + // Detect free variable `module` + var freeModule = typeof module == 'object' && module && + module.exports == freeExports && module; + + // Detect free variable `global`, from Node.js or Browserified code, + // and use it as `root` + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + var forOwn = function(object, callback) { + var key; + for (key in object) { + if (hasOwnProperty.call(object, key)) { + callback(key, object[key]); + } + } + }; + + var extend = function(destination, source) { + if (!source) { + return destination; + } + forOwn(source, function(key, value) { + destination[key] = value; + }); + return destination; + }; + + var forEach = function(array, callback) { + var length = array.length; + var index = -1; + while (++index < length) { + callback(array[index]); + } + }; + + var toString = object.toString; + var isArray = function(value) { + return toString.call(value) == '[object Array]'; + }; + var isObject = function(value) { + // This is a very simple check, but it’s good enough for what we need. + return toString.call(value) == '[object Object]'; + }; + var isString = function(value) { + return typeof value == 'string' || + toString.call(value) == '[object String]'; + }; + var isNumber = function(value) { + return typeof value == 'number' || + toString.call(value) == '[object Number]'; + }; + var isFunction = function(value) { + // In a perfect world, the `typeof` check would be sufficient. However, + // in Chrome 1–12, `typeof /x/ == 'object'`, and in IE 6–8 + // `typeof alert == 'object'` and similar for other host objects. + return typeof value == 'function' || + toString.call(value) == '[object Function]'; + }; + var isMap = function(value) { + return toString.call(value) == '[object Map]'; + }; + var isSet = function(value) { + return toString.call(value) == '[object Set]'; + }; + + /*--------------------------------------------------------------------------*/ + + // https://mathiasbynens.be/notes/javascript-escapes#single + var singleEscapes = { + '"': '\\"', + '\'': '\\\'', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t' + // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. + // '\v': '\\x0B' + }; + var regexSingleEscape = /["'\\\b\f\n\r\t]/; + + var regexDigit = /[0-9]/; + var regexWhitelist = /[ !#-&\(-\[\]-~]/; + + var jsesc = function(argument, options) { + // Handle options + var defaults = { + 'escapeEverything': false, + 'escapeEtago': false, + 'quotes': 'single', + 'wrap': false, + 'es6': false, + 'json': false, + 'compact': true, + 'lowercaseHex': false, + 'numbers': 'decimal', + 'indent': '\t', + '__indent__': '', + '__inline1__': false, + '__inline2__': false + }; + var json = options && options.json; + if (json) { + defaults.quotes = 'double'; + defaults.wrap = true; + } + options = extend(defaults, options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var compact = options.compact; + var indent = options.indent; + var lowercaseHex = options.lowercaseHex; + var oldIndent = ''; + var inline1 = options.__inline1__; + var inline2 = options.__inline2__; + var newLine = compact ? '' : '\n'; + var result; + var isEmpty = true; + var useBinNumbers = options.numbers == 'binary'; + var useOctNumbers = options.numbers == 'octal'; + var useDecNumbers = options.numbers == 'decimal'; + var useHexNumbers = options.numbers == 'hexadecimal'; + + if (json && argument && isFunction(argument.toJSON)) { + argument = argument.toJSON(); + } + + if (!isString(argument)) { + if (isMap(argument)) { + if (argument.size == 0) { + return 'new Map()'; + } + if (!compact) { + options.__inline1__ = true; + } + return 'new Map(' + jsesc(Array.from(argument), options) + ')'; + } + if (isSet(argument)) { + if (argument.size == 0) { + return 'new Set()'; + } + return 'new Set(' + jsesc(Array.from(argument), options) + ')'; + } + if (isArray(argument)) { + result = []; + options.wrap = true; + if (inline1) { + options.__inline1__ = false; + options.__inline2__ = true; + } else { + oldIndent = options.__indent__; + indent += oldIndent; + options.__indent__ = indent; + } + forEach(argument, function(value) { + isEmpty = false; + if (inline2) { + options.__inline2__ = false; + } + result.push( + (compact || inline2 ? '' : indent) + + jsesc(value, options) + ); + }); + if (isEmpty) { + return '[]'; + } + if (inline2) { + return '[' + result.join(', ') + ']'; + } + return '[' + newLine + result.join(',' + newLine) + newLine + + (compact ? '' : oldIndent) + ']'; + } else if (isNumber(argument)) { + if (json) { + // Some number values (e.g. `Infinity`) cannot be represented in JSON. + return JSON.stringify(argument); + } + if (useDecNumbers) { + return String(argument); + } + if (useHexNumbers) { + var tmp = argument.toString(16); + if (!lowercaseHex) { + tmp = tmp.toUpperCase(); + } + return '0x' + tmp; + } + if (useBinNumbers) { + return '0b' + argument.toString(2); + } + if (useOctNumbers) { + return '0o' + argument.toString(8); + } + } else if (!isObject(argument)) { + if (json) { + // For some values (e.g. `undefined`, `function` objects), + // `JSON.stringify(value)` returns `undefined` (which isn’t valid + // JSON) instead of `'null'`. + return JSON.stringify(argument) || 'null'; + } + return String(argument); + } else { // it’s an object + result = []; + options.wrap = true; + oldIndent = options.__indent__; + indent += oldIndent; + options.__indent__ = indent; + forOwn(argument, function(key, value) { + isEmpty = false; + result.push( + (compact ? '' : indent) + + jsesc(key, options) + ':' + + (compact ? '' : ' ') + + jsesc(value, options) + ); + }); + if (isEmpty) { + return '{}'; + } + return '{' + newLine + result.join(',' + newLine) + newLine + + (compact ? '' : oldIndent) + '}'; + } + } + + var string = argument; + // Loop over each code unit in the string and escape it + var index = -1; + var length = string.length; + var first; + var second; + var codePoint; + result = ''; + while (++index < length) { + var character = string.charAt(index); + if (options.es6) { + first = string.charCodeAt(index); + if ( // check if it’s the start of a surrogate pair + first >= 0xD800 && first <= 0xDBFF && // high surrogate + length > index + 1 // there is a next code unit + ) { + second = string.charCodeAt(index + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + var hexadecimal = codePoint.toString(16); + if (!lowercaseHex) { + hexadecimal = hexadecimal.toUpperCase(); + } + result += '\\u{' + hexadecimal + '}'; + index++; + continue; + } + } + } + if (!options.escapeEverything) { + if (regexWhitelist.test(character)) { + // It’s a printable ASCII character that is not `"`, `'` or `\`, + // so don’t escape it. + result += character; + continue; + } + if (character == '"') { + result += quote == character ? '\\"' : character; + continue; + } + if (character == '\'') { + result += quote == character ? '\\\'' : character; + continue; + } + } + if ( + character == '\0' && + !json && + !regexDigit.test(string.charAt(index + 1)) + ) { + result += '\\0'; + continue; + } + if (regexSingleEscape.test(character)) { + // no need for a `hasOwnProperty` check here + result += singleEscapes[character]; + continue; + } + var charCode = character.charCodeAt(0); + var hexadecimal = charCode.toString(16); + if (!lowercaseHex) { + hexadecimal = hexadecimal.toUpperCase(); + } + var longhand = hexadecimal.length > 2 || json; + var escaped = '\\' + (longhand ? 'u' : 'x') + + ('0000' + hexadecimal).slice(longhand ? -4 : -2); + result += escaped; + continue; + } + if (options.wrap) { + result = quote + result + quote; + } + if (options.escapeEtago) { + // https://mathiasbynens.be/notes/etago + return result.replace(/<\/(script|style)/gi, '<\\/$1'); + } + return result; + }; + + jsesc.version = '1.3.0'; + + /*--------------------------------------------------------------------------*/ + + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define(function() { + return jsesc; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = jsesc; + } else { // in Narwhal or RingoJS v0.7.0- + freeExports.jsesc = jsesc; + } + } else { // in Rhino or a web browser + root.jsesc = jsesc; + } + +}(this)); diff --git a/node_modules/jsesc/man/jsesc.1 b/node_modules/jsesc/man/jsesc.1 new file mode 100755 index 00000000..2655ee7a --- /dev/null +++ b/node_modules/jsesc/man/jsesc.1 @@ -0,0 +1,94 @@ +.Dd May 13, 2016 +.Dt jsesc 1 +.Sh NAME +.Nm jsesc +.Nd escape strings for use in JavaScript string literals +.Sh SYNOPSIS +.Nm +.Op Fl s | -single-quotes Ar string +.br +.Op Fl d | -double-quotes Ar string +.br +.Op Fl w | -wrap Ar string +.br +.Op Fl e | -escape-everything Ar string +.br +.Op Fl 6 | -es6 Ar string +.br +.Op Fl l | -lowercase-hex Ar string +.br +.Op Fl j | -json Ar string +.br +.Op Fl p | -object Ar string +.br +.Op Fl p | -pretty Ar string +.br +.Op Fl v | -version +.br +.Op Fl h | -help +.Sh DESCRIPTION +.Nm +escapes strings for use in JavaScript string literals while generating the shortest possible valid ASCII-only output. +.Sh OPTIONS +.Bl -ohang -offset +.It Sy "-s, --single-quotes" +Escape any occurrences of ' in the input string as \\', so that the output can be used in a JavaScript string literal wrapped in single quotes. +.It Sy "-d, --double-quotes" +Escape any occurrences of " in the input string as \\", so that the output can be used in a JavaScript string literal wrapped in double quotes. +.It Sy "-w, --wrap" +Make sure the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified using the +.Ar -s | --single-quotes +or +.Ar -d | --double-quotes +settings. +.It Sy "-6, --es6" +Escape any astral Unicode symbols using ECMAScript 6 Unicode code point escape sequences. +.It Sy "-e, --escape-everything" +Escape all the symbols in the output, even printable ASCII symbols. +.It Sy "-j, --json" +Make sure the output is valid JSON. Hexadecimal character escape sequences and the \\v or \\0 escape sequences will not be used. Setting this flag enables the +.Ar -d | --double-quotes +and +.Ar -w | --wrap +settings. +.It Sy "-o, --object" +Treat the input as a JavaScript object rather than a string. Accepted values are flat arrays containing only string values, and flat objects containing only string values. +.It Sy "-p, --pretty" +Pretty-print the output for objects, using whitespace to make it more readable. Setting this flag enables the +.It Sy "-l, --lowercase-hex" +Use lowercase for alphabetical hexadecimal digits in escape sequences. +.Ar -o | --object +setting. +.It Sy "-v, --version" +Print jsesc's version. +.It Sy "-h, --help" +Show the help screen. +.El +.Sh EXIT STATUS +The +.Nm jsesc +utility exits with one of the following values: +.Pp +.Bl -tag -width flag -compact +.It Li 0 +.Nm +successfully escaped the given string and printed the result. +.It Li 1 +.Nm +wasn't instructed to escape anything (for example, the +.Ar --help +flag was set); or, an error occurred. +.El +.Sh EXAMPLES +.Bl -ohang -offset +.It Sy "jsesc 'foo bar baz'" +Print an escaped version of the given string. +.It Sy echo\ 'foo bar baz'\ |\ jsesc +Print an escaped version of the string that gets piped in. +.El +.Sh BUGS +jsesc's bug tracker is located at . +.Sh AUTHOR +Mathias Bynens +.Sh WWW + diff --git a/node_modules/jsesc/package.json b/node_modules/jsesc/package.json new file mode 100755 index 00000000..56ef917e --- /dev/null +++ b/node_modules/jsesc/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "jsesc@^1.3.0", + "scope": null, + "escapedName": "jsesc", + "name": "jsesc", + "rawSpec": "^1.3.0", + "spec": ">=1.3.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-generator" + ] + ], + "_from": "jsesc@>=1.3.0 <2.0.0", + "_id": "jsesc@1.3.0", + "_inCache": true, + "_location": "/jsesc", + "_nodeVersion": "6.1.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/jsesc-1.3.0.tgz_1464619777756_0.3163749815430492" + }, + "_npmUser": { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + "_npmVersion": "3.8.6", + "_phantomChildren": {}, + "_requested": { + "raw": "jsesc@^1.3.0", + "scope": null, + "escapedName": "jsesc", + "name": "jsesc", + "rawSpec": "^1.3.0", + "spec": ">=1.3.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-generator" + ], + "_resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "_shasum": "46c3fec8c1892b12b0833db9bc7622176dbab34b", + "_shrinkwrap": null, + "_spec": "jsesc@^1.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-generator", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bin": { + "jsesc": "bin/jsesc" + }, + "bugs": { + "url": "https://github.com/mathiasbynens/jsesc/issues" + }, + "dependencies": {}, + "description": "A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.", + "devDependencies": { + "coveralls": "^2.11.6", + "grunt": "^0.4.5", + "grunt-shell": "^1.1.2", + "grunt-template": "^0.2.3", + "istanbul": "^0.4.2", + "qunit-extras": "^1.4.5", + "qunitjs": "~1.11.0", + "regenerate": "^1.2.1", + "requirejs": "^2.1.22" + }, + "directories": {}, + "dist": { + "shasum": "46c3fec8c1892b12b0833db9bc7622176dbab34b", + "tarball": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz" + }, + "files": [ + "LICENSE-MIT.txt", + "jsesc.js", + "bin/", + "man/" + ], + "gitHead": "2c43a8a223e297155b2b2ccca344df4d6ee4233c", + "homepage": "https://mths.be/jsesc", + "keywords": [ + "string", + "escape", + "javascript", + "tool" + ], + "license": "MIT", + "main": "jsesc.js", + "maintainers": [ + { + "name": "mathias", + "email": "mathias@qiwi.be" + } + ], + "man": [ + "man/jsesc.1" + ], + "name": "jsesc", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mathiasbynens/jsesc.git" + }, + "scripts": { + "build": "grunt template", + "test": "node tests/tests.js" + }, + "version": "1.3.0" +} diff --git a/node_modules/json-stringify-safe/.npmignore b/node_modules/json-stringify-safe/.npmignore new file mode 100755 index 00000000..17d6b367 --- /dev/null +++ b/node_modules/json-stringify-safe/.npmignore @@ -0,0 +1 @@ +/*.tgz diff --git a/node_modules/json-stringify-safe/CHANGELOG.md b/node_modules/json-stringify-safe/CHANGELOG.md new file mode 100755 index 00000000..42bcb60a --- /dev/null +++ b/node_modules/json-stringify-safe/CHANGELOG.md @@ -0,0 +1,14 @@ +## Unreleased +- Fixes stringify to only take ancestors into account when checking + circularity. + It previously assumed every visited object was circular which led to [false + positives][issue9]. + Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago. +- Fixes calling the `replacer` function in the proper context (`thisArg`). +- Fixes calling the `cycleReplacer` function in the proper context (`thisArg`). +- Speeds serializing by a factor of + Big-O(h-my-god-it-linearly-searched-every-object) it had ever seen. Searching + only the ancestors for a circular references speeds up things considerably. + +[must]: https://github.com/moll/js-must +[issue9]: https://github.com/isaacs/json-stringify-safe/issues/9 diff --git a/node_modules/json-stringify-safe/LICENSE b/node_modules/json-stringify-safe/LICENSE new file mode 100755 index 00000000..19129e31 --- /dev/null +++ b/node_modules/json-stringify-safe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/json-stringify-safe/Makefile b/node_modules/json-stringify-safe/Makefile new file mode 100755 index 00000000..36088c72 --- /dev/null +++ b/node_modules/json-stringify-safe/Makefile @@ -0,0 +1,35 @@ +NODE_OPTS = +TEST_OPTS = + +love: + @echo "Feel like makin' love." + +test: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS) + +spec: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS) + +autotest: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS) + +autospec: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS) + +pack: + @file=$$(npm pack); echo "$$file"; tar tf "$$file" + +publish: + npm publish + +tag: + git tag "v$$(node -e 'console.log(require("./package").version)')" + +clean: + rm -f *.tgz + npm prune --production + +.PHONY: love +.PHONY: test spec autotest autospec +.PHONY: pack publish tag +.PHONY: clean diff --git a/node_modules/json-stringify-safe/README.md b/node_modules/json-stringify-safe/README.md new file mode 100755 index 00000000..a11f302a --- /dev/null +++ b/node_modules/json-stringify-safe/README.md @@ -0,0 +1,52 @@ +# json-stringify-safe + +Like JSON.stringify, but doesn't throw on circular references. + +## Usage + +Takes the same arguments as `JSON.stringify`. + +```javascript +var stringify = require('json-stringify-safe'); +var circularObj = {}; +circularObj.circularRef = circularObj; +circularObj.list = [ circularObj, circularObj ]; +console.log(stringify(circularObj, null, 2)); +``` + +Output: + +```json +{ + "circularRef": "[Circular]", + "list": [ + "[Circular]", + "[Circular]" + ] +} +``` + +## Details + +``` +stringify(obj, serializer, indent, decycler) +``` + +The first three arguments are the same as to JSON.stringify. The last +is an argument that's only used when the object has been seen already. + +The default `decycler` function returns the string `'[Circular]'`. +If, for example, you pass in `function(k,v){}` (return nothing) then it +will prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`, +then cyclical objects will always be represented as `{"foo":"bar"}` in +the result. + +``` +stringify.getSerialize(serializer, decycler) +``` + +Returns a serializer that can be used elsewhere. This is the actual +function that's passed to JSON.stringify. + +**Note** that the function returned from `getSerialize` is stateful for now, so +do **not** use it more than once. diff --git a/node_modules/json-stringify-safe/package.json b/node_modules/json-stringify-safe/package.json new file mode 100755 index 00000000..0de9b411 --- /dev/null +++ b/node_modules/json-stringify-safe/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "json-stringify-safe@^5.0.1", + "scope": null, + "escapedName": "json-stringify-safe", + "name": "json-stringify-safe", + "rawSpec": "^5.0.1", + "spec": ">=5.0.1 <6.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/ndjson" + ] + ], + "_from": "json-stringify-safe@>=5.0.1 <6.0.0", + "_id": "json-stringify-safe@5.0.1", + "_inCache": true, + "_location": "/json-stringify-safe", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "json-stringify-safe@^5.0.1", + "scope": null, + "escapedName": "json-stringify-safe", + "name": "json-stringify-safe", + "rawSpec": "^5.0.1", + "spec": ">=5.0.1 <6.0.0", + "type": "range" + }, + "_requiredBy": [ + "/ndjson" + ], + "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "_shrinkwrap": null, + "_spec": "json-stringify-safe@^5.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/ndjson", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/json-stringify-safe/issues" + }, + "contributors": [ + { + "name": "Andri Möll", + "email": "andri@dot.ee", + "url": "http://themoll.com" + } + ], + "dependencies": {}, + "description": "Like JSON.stringify, but doesn't blow up on circular refs.", + "devDependencies": { + "mocha": ">= 2.1.0 < 3", + "must": ">= 0.12 < 0.13", + "sinon": ">= 1.12.2 < 2" + }, + "directories": {}, + "dist": { + "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "tarball": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5", + "homepage": "https://github.com/isaacs/json-stringify-safe", + "keywords": [ + "json", + "stringify", + "circular", + "safe" + ], + "license": "ISC", + "main": "stringify.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "moll", + "email": "andri@dot.ee" + } + ], + "name": "json-stringify-safe", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/json-stringify-safe.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "5.0.1" +} diff --git a/node_modules/json-stringify-safe/stringify.js b/node_modules/json-stringify-safe/stringify.js new file mode 100755 index 00000000..124a4521 --- /dev/null +++ b/node_modules/json-stringify-safe/stringify.js @@ -0,0 +1,27 @@ +exports = module.exports = stringify +exports.getSerialize = serializer + +function stringify(obj, replacer, spaces, cycleReplacer) { + return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) +} + +function serializer(replacer, cycleReplacer) { + var stack = [], keys = [] + + if (cycleReplacer == null) cycleReplacer = function(key, value) { + if (stack[0] === value) return "[Circular ~]" + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" + } + + return function(key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this) + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) + if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) + } + else stack.push(value) + + return replacer == null ? value : replacer.call(this, key, value) + } +} diff --git a/node_modules/json-stringify-safe/test/mocha.opts b/node_modules/json-stringify-safe/test/mocha.opts new file mode 100755 index 00000000..2544e586 --- /dev/null +++ b/node_modules/json-stringify-safe/test/mocha.opts @@ -0,0 +1,2 @@ +--recursive +--require must diff --git a/node_modules/json-stringify-safe/test/stringify_test.js b/node_modules/json-stringify-safe/test/stringify_test.js new file mode 100755 index 00000000..5b325831 --- /dev/null +++ b/node_modules/json-stringify-safe/test/stringify_test.js @@ -0,0 +1,246 @@ +var Sinon = require("sinon") +var stringify = require("..") +function jsonify(obj) { return JSON.stringify(obj, null, 2) } + +describe("Stringify", function() { + it("must stringify circular objects", function() { + var obj = {name: "Alice"} + obj.self = obj + var json = stringify(obj, null, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + }) + + it("must stringify circular objects with intermediaries", function() { + var obj = {name: "Alice"} + obj.identity = {self: obj} + var json = stringify(obj, null, 2) + json.must.eql(jsonify({name: "Alice", identity: {self: "[Circular ~]"}})) + }) + + it("must stringify circular objects deeper", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + obj.child.self = obj.child + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + child: {name: "Bob", self: "[Circular ~.child]"} + })) + }) + + it("must stringify circular objects deeper with intermediaries", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + obj.child.identity = {self: obj.child} + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + child: {name: "Bob", identity: {self: "[Circular ~.child]"}} + })) + }) + + it("must stringify circular objects in an array", function() { + var obj = {name: "Alice"} + obj.self = [obj, obj] + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", self: ["[Circular ~]", "[Circular ~]"] + })) + }) + + it("must stringify circular objects deeper in an array", function() { + var obj = {name: "Alice", children: [{name: "Bob"}, {name: "Eve"}]} + obj.children[0].self = obj.children[0] + obj.children[1].self = obj.children[1] + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + children: [ + {name: "Bob", self: "[Circular ~.children.0]"}, + {name: "Eve", self: "[Circular ~.children.1]"} + ] + })) + }) + + it("must stringify circular arrays", function() { + var obj = [] + obj.push(obj) + obj.push(obj) + var json = stringify(obj, null, 2) + json.must.eql(jsonify(["[Circular ~]", "[Circular ~]"])) + }) + + it("must stringify circular arrays with intermediaries", function() { + var obj = [] + obj.push({name: "Alice", self: obj}) + obj.push({name: "Bob", self: obj}) + + stringify(obj, null, 2).must.eql(jsonify([ + {name: "Alice", self: "[Circular ~]"}, + {name: "Bob", self: "[Circular ~]"} + ])) + }) + + it("must stringify repeated objects in objects", function() { + var obj = {} + var alice = {name: "Alice"} + obj.alice1 = alice + obj.alice2 = alice + + stringify(obj, null, 2).must.eql(jsonify({ + alice1: {name: "Alice"}, + alice2: {name: "Alice"} + })) + }) + + it("must stringify repeated objects in arrays", function() { + var alice = {name: "Alice"} + var obj = [alice, alice] + var json = stringify(obj, null, 2) + json.must.eql(jsonify([{name: "Alice"}, {name: "Alice"}])) + }) + + it("must call given decycler and use its output", function() { + var obj = {} + obj.a = obj + obj.b = obj + + var decycle = Sinon.spy(function() { return decycle.callCount }) + var json = stringify(obj, null, 2, decycle) + json.must.eql(jsonify({a: 1, b: 2}, null, 2)) + + decycle.callCount.must.equal(2) + decycle.thisValues[0].must.equal(obj) + decycle.args[0][0].must.equal("a") + decycle.args[0][1].must.equal(obj) + decycle.thisValues[1].must.equal(obj) + decycle.args[1][0].must.equal("b") + decycle.args[1][1].must.equal(obj) + }) + + it("must call replacer and use its output", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + + var replacer = Sinon.spy(bangString) + var json = stringify(obj, replacer, 2) + json.must.eql(jsonify({name: "Alice!", child: {name: "Bob!"}})) + + replacer.callCount.must.equal(4) + replacer.args[0][0].must.equal("") + replacer.args[0][1].must.equal(obj) + replacer.thisValues[1].must.equal(obj) + replacer.args[1][0].must.equal("name") + replacer.args[1][1].must.equal("Alice") + replacer.thisValues[2].must.equal(obj) + replacer.args[2][0].must.equal("child") + replacer.args[2][1].must.equal(obj.child) + replacer.thisValues[3].must.equal(obj.child) + replacer.args[3][0].must.equal("name") + replacer.args[3][1].must.equal("Bob") + }) + + it("must call replacer after describing circular references", function() { + var obj = {name: "Alice"} + obj.self = obj + + var replacer = Sinon.spy(bangString) + var json = stringify(obj, replacer, 2) + json.must.eql(jsonify({name: "Alice!", self: "[Circular ~]!"})) + + replacer.callCount.must.equal(3) + replacer.args[0][0].must.equal("") + replacer.args[0][1].must.equal(obj) + replacer.thisValues[1].must.equal(obj) + replacer.args[1][0].must.equal("name") + replacer.args[1][1].must.equal("Alice") + replacer.thisValues[2].must.equal(obj) + replacer.args[2][0].must.equal("self") + replacer.args[2][1].must.equal("[Circular ~]") + }) + + it("must call given decycler and use its output for nested objects", + function() { + var obj = {} + obj.a = obj + obj.b = {self: obj} + + var decycle = Sinon.spy(function() { return decycle.callCount }) + var json = stringify(obj, null, 2, decycle) + json.must.eql(jsonify({a: 1, b: {self: 2}})) + + decycle.callCount.must.equal(2) + decycle.args[0][0].must.equal("a") + decycle.args[0][1].must.equal(obj) + decycle.args[1][0].must.equal("self") + decycle.args[1][1].must.equal(obj) + }) + + it("must use decycler's output when it returned null", function() { + var obj = {a: "b"} + obj.self = obj + obj.selves = [obj, obj] + + function decycle() { return null } + stringify(obj, null, 2, decycle).must.eql(jsonify({ + a: "b", + self: null, + selves: [null, null] + })) + }) + + it("must use decycler's output when it returned undefined", function() { + var obj = {a: "b"} + obj.self = obj + obj.selves = [obj, obj] + + function decycle() {} + stringify(obj, null, 2, decycle).must.eql(jsonify({ + a: "b", + selves: [null, null] + })) + }) + + it("must throw given a decycler that returns a cycle", function() { + var obj = {} + obj.self = obj + var err + function identity(key, value) { return value } + try { stringify(obj, null, 2, identity) } catch (ex) { err = ex } + err.must.be.an.instanceof(TypeError) + }) + + describe(".getSerialize", function() { + it("must stringify circular objects", function() { + var obj = {a: "b"} + obj.circularRef = obj + obj.list = [obj, obj] + + var json = JSON.stringify(obj, stringify.getSerialize(), 2) + json.must.eql(jsonify({ + "a": "b", + "circularRef": "[Circular ~]", + "list": ["[Circular ~]", "[Circular ~]"] + })) + }) + + // This is the behavior as of Mar 3, 2015. + // The serializer function keeps state inside the returned function and + // so far I'm not sure how to not do that. JSON.stringify's replacer is not + // called _after_ serialization. + xit("must return a function that could be called twice", function() { + var obj = {name: "Alice"} + obj.self = obj + + var json + var serializer = stringify.getSerialize() + + json = JSON.stringify(obj, serializer, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + + json = JSON.stringify(obj, serializer, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + }) + }) +}) + +function bangString(key, value) { + return typeof value == "string" ? value + "!" : value +} diff --git a/node_modules/json3/LICENSE b/node_modules/json3/LICENSE new file mode 100755 index 00000000..c0de33a8 --- /dev/null +++ b/node_modules/json3/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2012-2014 Kit Cambridge. +http://kitcambridge.be/ + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/json3/README.md b/node_modules/json3/README.md new file mode 100755 index 00000000..9aa7935d --- /dev/null +++ b/node_modules/json3/README.md @@ -0,0 +1,152 @@ +# JSON 3 # + +![JSON 3 Logo](http://bestiejs.github.io/json3/page/logo.png) + +[![Build Status](https://secure.travis-ci.org/bestiejs/json3.png?branch=gh-pages)](http://travis-ci.org/bestiejs/json3) + +**JSON 3** is a modern JSON implementation compatible with a variety of JavaScript platforms, including Internet Explorer 6, Opera 7, Safari 2, and Netscape 6. The current version is **3.3.2**. + +- [Development Version](http://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.js) *(43 KB; uncompressed with comments)* +- [Production Version](http://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js) *(3.5 KB; compressed and `gzip`-ped)* + +Special thanks to [cdnjs](http://cdnjs.com/libraries/json3/) and [jsDelivr](http://www.jsdelivr.com/#!json3) for hosting CDN copies of JSON 3. + +[JSON](http://json.org/) is a language-independent data interchange format based on a loose subset of the JavaScript grammar. Originally popularized by [Douglas Crockford](http://www.crockford.com/), the format was standardized in the [fifth edition](http://es5.github.com/) of the ECMAScript specification. The 5.1 edition, ratified in June 2011, incorporates several modifications to the grammar pertaining to the serialization of dates. + +JSON 3 exposes two functions: `stringify()` for [serializing](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON/stringify) a JavaScript value to JSON, and `parse()` for [producing](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON/parse) a JavaScript value from a JSON source string. It is a **drop-in replacement** for [JSON 2](http://json.org/js). The functions behave exactly as described in the ECMAScript spec, **except** for the date serialization discrepancy noted below. + +The JSON 3 parser does **not** use `eval` or regular expressions. This provides security and performance benefits in obsolete and mobile environments, where the margin is particularly significant. The complete [benchmark suite](http://jsperf.com/json3) is available on [jsPerf](http://jsperf.com/). + +The project is [hosted on GitHub](http://git.io/json3), along with the [unit tests](http://bestiejs.github.io/json3/test/test_browser.html). It is part of the [BestieJS](https://github.com/bestiejs) family, a collection of best-in-class JavaScript libraries that promote cross-platform support, specification precedents, unit testing, and plenty of documentation. + +# Changes from JSON 2 # + +JSON 3... + +* Correctly serializes primitive wrapper objects. +* Throws a `TypeError` when serializing cyclic structures (JSON 2 recurses until the call stack overflows). +* Utilizes **feature tests** to detect broken or incomplete *native* JSON implementations (JSON 2 only checks for the presence of the native functions). The tests are only executed once at runtime, so there is no additional performance cost when parsing or serializing values. + +**As of v3.2.3**, JSON 3 is compatible with [Prototype](http://prototypejs.org) 1.6.1 and older. + +In contrast to JSON 2, JSON 3 **does not**... + +* Add `toJSON()` methods to the `Boolean`, `Number`, and `String` prototypes. These are not part of any standard, and are made redundant by the design of the `stringify()` implementation. +* Add `toJSON()` or `toISOString()` methods to `Date.prototype`. See the note about date serialization below. + +## Date Serialization + +**JSON 3 deviates from the specification in one important way**: it does not define `Date#toISOString()` or `Date#toJSON()`. This preserves CommonJS compatibility and avoids polluting native prototypes. Instead, date serialization is performed internally by the `stringify()` implementation: if a date object does not define a custom `toJSON()` method, it is serialized as a [simplified ISO 8601 date-time string](http://es5.github.com/#x15.9.1.15). + +**Several native `Date#toJSON()` implementations produce date time strings that do *not* conform to the grammar outlined in the spec**. For instance, all versions of Safari 4, as well as JSON 2, fail to serialize extended years correctly. Furthermore, JSON 2 and older implementations omit the milliseconds from the date-time string (optional in ES 5, but required in 5.1). Finally, in all versions of Safari 4 and 5, serializing an invalid date will produce the string `"Invalid Date"`, rather than `null`. Because these environments exhibit other serialization bugs, however, JSON 3 will override the native `stringify()` implementation. + +Portions of the date serialization code are adapted from the [`date-shim`](https://github.com/Yaffle/date-shim) project. + +# Usage # + +## Web Browsers + + + + +**When used in a web browser**, JSON 3 exposes an additional `JSON3` object containing the `noConflict()` and `runInContext()` functions, as well as aliases to the `stringify()` and `parse()` functions. + +### `noConflict` and `runInContext` + +* `JSON3.noConflict()` restores the original value of the global `JSON` object and returns a reference to the `JSON3` object. +* `JSON3.runInContext([context, exports])` initializes JSON 3 using the given `context` object (e.g., `window`, `global`, etc.), or the global object if omitted. If an `exports` object is specified, the `stringify()`, `parse()`, and `runInContext()` functions will be attached to it instead of a new object. + +### Asynchronous Module Loaders + +JSON 3 is defined as an [anonymous module](https://github.com/amdjs/amdjs-api/wiki/AMD#define-function-) for compatibility with [RequireJS](http://requirejs.org/), [`curl.js`](https://github.com/cujojs/curl), and other asynchronous module loaders. + + + + +To avoid issues with third-party scripts, **JSON 3 is exported to the global scope even when used with a module loader**. If this behavior is undesired, `JSON3.noConflict()` can be used to restore the global `JSON` object to its original value. + +## CommonJS Environments + + var JSON3 = require("./path/to/json3"); + JSON3.parse("[1, 2, 3]"); + // => [1, 2, 3] + +## JavaScript Engines + + load("path/to/json3.js"); + JSON.stringify({"Hello": 123, "Good-bye": 456}, ["Hello"], "\t"); + // => '{\n\t"Hello": 123\n}' + +# Compatibility # + +JSON 3 has been **tested** with the following web browsers, CommonJS environments, and JavaScript engines. + +## Web Browsers + +- Windows [Internet Explorer](http://www.microsoft.com/windows/internet-explorer), version 6.0 and higher +- Mozilla [Firefox](http://www.mozilla.com/firefox), version 1.0 and higher +- Apple [Safari](http://www.apple.com/safari), version 2.0 and higher +- [Opera](http://www.opera.com) 7.02 and higher +- [Mozilla](http://sillydog.org/narchive/gecko.php) 1.0, [Netscape](http://sillydog.org/narchive/) 6.2.3, and [SeaMonkey](http://www.seamonkey-project.org/) 1.0 and higher + +## CommonJS Environments + +- [Node](http://nodejs.org/) 0.2.6 and higher +- [RingoJS](http://ringojs.org/) 0.4 and higher +- [Narwhal](http://narwhaljs.org/) 0.3.2 and higher + +## JavaScript Engines + +- Mozilla [Rhino](http://www.mozilla.org/rhino) 1.5R5 and higher +- WebKit [JSC](https://trac.webkit.org/wiki/JSC) +- Google [V8](http://code.google.com/p/v8) + +## Known Incompatibilities + +* Attempting to serialize the `arguments` object may produce inconsistent results across environments due to specification version differences. As a workaround, please convert the `arguments` object to an array first: `JSON.stringify([].slice.call(arguments, 0))`. + +## Required Native Methods + +JSON 3 assumes that the following methods exist and function as described in the ECMAScript specification: + +- The `Number`, `String`, `Array`, `Object`, `Date`, `SyntaxError`, and `TypeError` constructors. +- `String.fromCharCode` +- `Object#toString` +- `Function#call` +- `Math.floor` +- `Number#toString` +- `Date#valueOf` +- `String.prototype`: `indexOf`, `charCodeAt`, `charAt`, `slice`. +- `Array.prototype`: `push`, `pop`, `join`. + +# Contribute # + +Check out a working copy of the JSON 3 source code with [Git](http://git-scm.com/): + + $ git clone git://github.com/bestiejs/json3.git + $ cd json3 + +If you'd like to contribute a feature or bug fix, you can [fork](http://help.github.com/fork-a-repo/) JSON 3, commit your changes, and [send a pull request](http://help.github.com/send-pull-requests/). Please make sure to update the unit tests in the `test` directory as well. + +Alternatively, you can use the [GitHub issue tracker](https://github.com/bestiejs/json3/issues) to submit bug reports, feature requests, and questions, or send tweets to [@kitcambridge](http://twitter.com/kitcambridge). + +JSON 3 is released under the [MIT License](http://kit.mit-license.org/). diff --git a/node_modules/json3/lib/json3.js b/node_modules/json3/lib/json3.js new file mode 100755 index 00000000..4817c9e7 --- /dev/null +++ b/node_modules/json3/lib/json3.js @@ -0,0 +1,902 @@ +/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */ +;(function () { + // Detect the `define` function exposed by asynchronous module loaders. The + // strict `define` check is necessary for compatibility with `r.js`. + var isLoader = typeof define === "function" && define.amd; + + // A set of types used to distinguish objects from primitives. + var objectTypes = { + "function": true, + "object": true + }; + + // Detect the `exports` object exposed by CommonJS implementations. + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + // Use the `global` object exposed by Node (including Browserify via + // `insert-module-globals`), Narwhal, and Ringo as the default context, + // and the `window` object in browsers. Rhino exports a `global` function + // instead. + var root = objectTypes[typeof window] && window || this, + freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == "object" && global; + + if (freeGlobal && (freeGlobal["global"] === freeGlobal || freeGlobal["window"] === freeGlobal || freeGlobal["self"] === freeGlobal)) { + root = freeGlobal; + } + + // Public: Initializes JSON 3 using the given `context` object, attaching the + // `stringify` and `parse` functions to the specified `exports` object. + function runInContext(context, exports) { + context || (context = root["Object"]()); + exports || (exports = root["Object"]()); + + // Native constructor aliases. + var Number = context["Number"] || root["Number"], + String = context["String"] || root["String"], + Object = context["Object"] || root["Object"], + Date = context["Date"] || root["Date"], + SyntaxError = context["SyntaxError"] || root["SyntaxError"], + TypeError = context["TypeError"] || root["TypeError"], + Math = context["Math"] || root["Math"], + nativeJSON = context["JSON"] || root["JSON"]; + + // Delegate to the native `stringify` and `parse` implementations. + if (typeof nativeJSON == "object" && nativeJSON) { + exports.stringify = nativeJSON.stringify; + exports.parse = nativeJSON.parse; + } + + // Convenience aliases. + var objectProto = Object.prototype, + getClass = objectProto.toString, + isProperty, forEach, undef; + + // Test the `Date#getUTC*` methods. Based on work by @Yaffle. + var isExtended = new Date(-3509827334573292); + try { + // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical + // results for certain dates in Opera >= 10.53. + isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 && + // Safari < 2.0.2 stores the internal millisecond time value correctly, + // but clips the values returned by the date methods to the range of + // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]). + isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708; + } catch (exception) {} + + // Internal: Determines whether the native `JSON.stringify` and `parse` + // implementations are spec-compliant. Based on work by Ken Snyder. + function has(name) { + if (has[name] !== undef) { + // Return cached feature test result. + return has[name]; + } + var isSupported; + if (name == "bug-string-char-index") { + // IE <= 7 doesn't support accessing string characters using square + // bracket notation. IE 8 only supports this for primitives. + isSupported = "a"[0] != "a"; + } else if (name == "json") { + // Indicates whether both `JSON.stringify` and `JSON.parse` are + // supported. + isSupported = has("json-stringify") && has("json-parse"); + } else { + var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'; + // Test `JSON.stringify`. + if (name == "json-stringify") { + var stringify = exports.stringify, stringifySupported = typeof stringify == "function" && isExtended; + if (stringifySupported) { + // A test function object with a custom `toJSON` method. + (value = function () { + return 1; + }).toJSON = value; + try { + stringifySupported = + // Firefox 3.1b1 and b2 serialize string, number, and boolean + // primitives as object literals. + stringify(0) === "0" && + // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object + // literals. + stringify(new Number()) === "0" && + stringify(new String()) == '""' && + // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or + // does not define a canonical JSON representation (this applies to + // objects with `toJSON` properties as well, *unless* they are nested + // within an object or array). + stringify(getClass) === undef && + // IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and + // FF 3.1b3 pass this test. + stringify(undef) === undef && + // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s, + // respectively, if the value is omitted entirely. + stringify() === undef && + // FF 3.1b1, 2 throw an error if the given value is not a number, + // string, array, object, Boolean, or `null` literal. This applies to + // objects with custom `toJSON` methods as well, unless they are nested + // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON` + // methods entirely. + stringify(value) === "1" && + stringify([value]) == "[1]" && + // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of + // `"[null]"`. + stringify([undef]) == "[null]" && + // YUI 3.0.0b1 fails to serialize `null` literals. + stringify(null) == "null" && + // FF 3.1b1, 2 halts serialization if an array contains a function: + // `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3 + // elides non-JSON values from objects and arrays, unless they + // define custom `toJSON` methods. + stringify([undef, getClass, null]) == "[null,null,null]" && + // Simple serialization test. FF 3.1b1 uses Unicode escape sequences + // where character escape codes are expected (e.g., `\b` => `\u0008`). + stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized && + // FF 3.1b1 and b2 ignore the `filter` and `width` arguments. + stringify(null, value) === "1" && + stringify([1, 2], null, 1) == "[\n 1,\n 2\n]" && + // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly + // serialize extended years. + stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' && + // The milliseconds are optional in ES 5, but required in 5.1. + stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' && + // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative + // four-digit years instead of six-digit years. Credits: @Yaffle. + stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' && + // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond + // values less than 1000. Credits: @Yaffle. + stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"'; + } catch (exception) { + stringifySupported = false; + } + } + isSupported = stringifySupported; + } + // Test `JSON.parse`. + if (name == "json-parse") { + var parse = exports.parse; + if (typeof parse == "function") { + try { + // FF 3.1b1, b2 will throw an exception if a bare literal is provided. + // Conforming implementations should also coerce the initial argument to + // a string prior to parsing. + if (parse("0") === 0 && !parse(false)) { + // Simple parsing test. + value = parse(serialized); + var parseSupported = value["a"].length == 5 && value["a"][0] === 1; + if (parseSupported) { + try { + // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings. + parseSupported = !parse('"\t"'); + } catch (exception) {} + if (parseSupported) { + try { + // FF 4.0 and 4.0.1 allow leading `+` signs and leading + // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow + // certain octal literals. + parseSupported = parse("01") !== 1; + } catch (exception) {} + } + if (parseSupported) { + try { + // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal + // points. These environments, along with FF 3.1b1 and 2, + // also allow trailing commas in JSON objects and arrays. + parseSupported = parse("1.") !== 1; + } catch (exception) {} + } + } + } + } catch (exception) { + parseSupported = false; + } + } + isSupported = parseSupported; + } + } + return has[name] = !!isSupported; + } + + if (!has("json")) { + // Common `[[Class]]` name aliases. + var functionClass = "[object Function]", + dateClass = "[object Date]", + numberClass = "[object Number]", + stringClass = "[object String]", + arrayClass = "[object Array]", + booleanClass = "[object Boolean]"; + + // Detect incomplete support for accessing string characters by index. + var charIndexBuggy = has("bug-string-char-index"); + + // Define additional utility methods if the `Date` methods are buggy. + if (!isExtended) { + var floor = Math.floor; + // A mapping between the months of the year and the number of days between + // January 1st and the first of the respective month. + var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; + // Internal: Calculates the number of days between the Unix epoch and the + // first day of the given month. + var getDay = function (year, month) { + return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400); + }; + } + + // Internal: Determines if a property is a direct property of the given + // object. Delegates to the native `Object#hasOwnProperty` method. + if (!(isProperty = objectProto.hasOwnProperty)) { + isProperty = function (property) { + var members = {}, constructor; + if ((members.__proto__ = null, members.__proto__ = { + // The *proto* property cannot be set multiple times in recent + // versions of Firefox and SeaMonkey. + "toString": 1 + }, members).toString != getClass) { + // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but + // supports the mutable *proto* property. + isProperty = function (property) { + // Capture and break the object's prototype chain (see section 8.6.2 + // of the ES 5.1 spec). The parenthesized expression prevents an + // unsafe transformation by the Closure Compiler. + var original = this.__proto__, result = property in (this.__proto__ = null, this); + // Restore the original prototype chain. + this.__proto__ = original; + return result; + }; + } else { + // Capture a reference to the top-level `Object` constructor. + constructor = members.constructor; + // Use the `constructor` property to simulate `Object#hasOwnProperty` in + // other environments. + isProperty = function (property) { + var parent = (this.constructor || constructor).prototype; + return property in this && !(property in parent && this[property] === parent[property]); + }; + } + members = null; + return isProperty.call(this, property); + }; + } + + // Internal: Normalizes the `for...in` iteration algorithm across + // environments. Each enumerated key is yielded to a `callback` function. + forEach = function (object, callback) { + var size = 0, Properties, members, property; + + // Tests for bugs in the current environment's `for...in` algorithm. The + // `valueOf` property inherits the non-enumerable flag from + // `Object.prototype` in older versions of IE, Netscape, and Mozilla. + (Properties = function () { + this.valueOf = 0; + }).prototype.valueOf = 0; + + // Iterate over a new instance of the `Properties` class. + members = new Properties(); + for (property in members) { + // Ignore all properties inherited from `Object.prototype`. + if (isProperty.call(members, property)) { + size++; + } + } + Properties = members = null; + + // Normalize the iteration algorithm. + if (!size) { + // A list of non-enumerable properties inherited from `Object.prototype`. + members = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"]; + // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable + // properties. + forEach = function (object, callback) { + var isFunction = getClass.call(object) == functionClass, property, length; + var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty; + for (property in object) { + // Gecko <= 1.0 enumerates the `prototype` property of functions under + // certain conditions; IE does not. + if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) { + callback(property); + } + } + // Manually invoke the callback for each non-enumerable property. + for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property)); + }; + } else if (size == 2) { + // Safari <= 2.0.4 enumerates shadowed properties twice. + forEach = function (object, callback) { + // Create a set of iterated properties. + var members = {}, isFunction = getClass.call(object) == functionClass, property; + for (property in object) { + // Store each property name to prevent double enumeration. The + // `prototype` property of functions is not enumerated due to cross- + // environment inconsistencies. + if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) { + callback(property); + } + } + }; + } else { + // No bugs detected; use the standard `for...in` algorithm. + forEach = function (object, callback) { + var isFunction = getClass.call(object) == functionClass, property, isConstructor; + for (property in object) { + if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) { + callback(property); + } + } + // Manually invoke the callback for the `constructor` property due to + // cross-environment inconsistencies. + if (isConstructor || isProperty.call(object, (property = "constructor"))) { + callback(property); + } + }; + } + return forEach(object, callback); + }; + + // Public: Serializes a JavaScript `value` as a JSON string. The optional + // `filter` argument may specify either a function that alters how object and + // array members are serialized, or an array of strings and numbers that + // indicates which properties should be serialized. The optional `width` + // argument may be either a string or number that specifies the indentation + // level of the output. + if (!has("json-stringify")) { + // Internal: A map of control characters and their escaped equivalents. + var Escapes = { + 92: "\\\\", + 34: '\\"', + 8: "\\b", + 12: "\\f", + 10: "\\n", + 13: "\\r", + 9: "\\t" + }; + + // Internal: Converts `value` into a zero-padded string such that its + // length is at least equal to `width`. The `width` must be <= 6. + var leadingZeroes = "000000"; + var toPaddedString = function (width, value) { + // The `|| 0` expression is necessary to work around a bug in + // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`. + return (leadingZeroes + (value || 0)).slice(-width); + }; + + // Internal: Double-quotes a string `value`, replacing all ASCII control + // characters (characters with code unit values between 0 and 31) with + // their escaped equivalents. This is an implementation of the + // `Quote(value)` operation defined in ES 5.1 section 15.12.3. + var unicodePrefix = "\\u00"; + var quote = function (value) { + var result = '"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10; + var symbols = useCharIndex && (charIndexBuggy ? value.split("") : value); + for (; index < length; index++) { + var charCode = value.charCodeAt(index); + // If the character is a control character, append its Unicode or + // shorthand escape sequence; otherwise, append the character as-is. + switch (charCode) { + case 8: case 9: case 10: case 12: case 13: case 34: case 92: + result += Escapes[charCode]; + break; + default: + if (charCode < 32) { + result += unicodePrefix + toPaddedString(2, charCode.toString(16)); + break; + } + result += useCharIndex ? symbols[index] : value.charAt(index); + } + } + return result + '"'; + }; + + // Internal: Recursively serializes an object. Implements the + // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations. + var serialize = function (property, object, callback, properties, whitespace, indentation, stack) { + var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result; + try { + // Necessary for host object support. + value = object[property]; + } catch (exception) {} + if (typeof value == "object" && value) { + className = getClass.call(value); + if (className == dateClass && !isProperty.call(value, "toJSON")) { + if (value > -1 / 0 && value < 1 / 0) { + // Dates are serialized according to the `Date#toJSON` method + // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15 + // for the ISO 8601 date time string format. + if (getDay) { + // Manually compute the year, month, date, hours, minutes, + // seconds, and milliseconds if the `getUTC*` methods are + // buggy. Adapted from @Yaffle's `date-shim` project. + date = floor(value / 864e5); + for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++); + for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++); + date = 1 + date - getDay(year, month); + // The `time` value specifies the time within the day (see ES + // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used + // to compute `A modulo B`, as the `%` operator does not + // correspond to the `modulo` operation for negative numbers. + time = (value % 864e5 + 864e5) % 864e5; + // The hours, minutes, seconds, and milliseconds are obtained by + // decomposing the time within the day. See section 15.9.1.10. + hours = floor(time / 36e5) % 24; + minutes = floor(time / 6e4) % 60; + seconds = floor(time / 1e3) % 60; + milliseconds = time % 1e3; + } else { + year = value.getUTCFullYear(); + month = value.getUTCMonth(); + date = value.getUTCDate(); + hours = value.getUTCHours(); + minutes = value.getUTCMinutes(); + seconds = value.getUTCSeconds(); + milliseconds = value.getUTCMilliseconds(); + } + // Serialize extended years correctly. + value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) + + "-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) + + // Months, dates, hours, minutes, and seconds should have two + // digits; milliseconds should have three. + "T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) + + // Milliseconds are optional in ES 5.0, but required in 5.1. + "." + toPaddedString(3, milliseconds) + "Z"; + } else { + value = null; + } + } else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) { + // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the + // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3 + // ignores all `toJSON` methods on these objects unless they are + // defined directly on an instance. + value = value.toJSON(property); + } + } + if (callback) { + // If a replacement function was provided, call it to obtain the value + // for serialization. + value = callback.call(object, property, value); + } + if (value === null) { + return "null"; + } + className = getClass.call(value); + if (className == booleanClass) { + // Booleans are represented literally. + return "" + value; + } else if (className == numberClass) { + // JSON numbers must be finite. `Infinity` and `NaN` are serialized as + // `"null"`. + return value > -1 / 0 && value < 1 / 0 ? "" + value : "null"; + } else if (className == stringClass) { + // Strings are double-quoted and escaped. + return quote("" + value); + } + // Recursively serialize objects and arrays. + if (typeof value == "object") { + // Check for cyclic structures. This is a linear search; performance + // is inversely proportional to the number of unique nested objects. + for (length = stack.length; length--;) { + if (stack[length] === value) { + // Cyclic structures cannot be serialized by `JSON.stringify`. + throw TypeError(); + } + } + // Add the object to the stack of traversed objects. + stack.push(value); + results = []; + // Save the current indentation level and indent one additional level. + prefix = indentation; + indentation += whitespace; + if (className == arrayClass) { + // Recursively serialize array elements. + for (index = 0, length = value.length; index < length; index++) { + element = serialize(index, value, callback, properties, whitespace, indentation, stack); + results.push(element === undef ? "null" : element); + } + result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]"; + } else { + // Recursively serialize object members. Members are selected from + // either a user-specified list of property names, or the object + // itself. + forEach(properties || value, function (property) { + var element = serialize(property, value, callback, properties, whitespace, indentation, stack); + if (element !== undef) { + // According to ES 5.1 section 15.12.3: "If `gap` {whitespace} + // is not the empty string, let `member` {quote(property) + ":"} + // be the concatenation of `member` and the `space` character." + // The "`space` character" refers to the literal space + // character, not the `space` {width} argument provided to + // `JSON.stringify`. + results.push(quote(property) + ":" + (whitespace ? " " : "") + element); + } + }); + result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}"; + } + // Remove the object from the traversed object stack. + stack.pop(); + return result; + } + }; + + // Public: `JSON.stringify`. See ES 5.1 section 15.12.3. + exports.stringify = function (source, filter, width) { + var whitespace, callback, properties, className; + if (objectTypes[typeof filter] && filter) { + if ((className = getClass.call(filter)) == functionClass) { + callback = filter; + } else if (className == arrayClass) { + // Convert the property names array into a makeshift set. + properties = {}; + for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1)); + } + } + if (width) { + if ((className = getClass.call(width)) == numberClass) { + // Convert the `width` to an integer and create a string containing + // `width` number of space characters. + if ((width -= width % 1) > 0) { + for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " "); + } + } else if (className == stringClass) { + whitespace = width.length <= 10 ? width : width.slice(0, 10); + } + } + // Opera <= 7.54u2 discards the values associated with empty string keys + // (`""`) only if they are used directly within an object member list + // (e.g., `!("" in { "": 1})`). + return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []); + }; + } + + // Public: Parses a JSON source string. + if (!has("json-parse")) { + var fromCharCode = String.fromCharCode; + + // Internal: A map of escaped control characters and their unescaped + // equivalents. + var Unescapes = { + 92: "\\", + 34: '"', + 47: "/", + 98: "\b", + 116: "\t", + 110: "\n", + 102: "\f", + 114: "\r" + }; + + // Internal: Stores the parser state. + var Index, Source; + + // Internal: Resets the parser state and throws a `SyntaxError`. + var abort = function () { + Index = Source = null; + throw SyntaxError(); + }; + + // Internal: Returns the next token, or `"$"` if the parser has reached + // the end of the source string. A token may be a string, number, `null` + // literal, or Boolean literal. + var lex = function () { + var source = Source, length = source.length, value, begin, position, isSigned, charCode; + while (Index < length) { + charCode = source.charCodeAt(Index); + switch (charCode) { + case 9: case 10: case 13: case 32: + // Skip whitespace tokens, including tabs, carriage returns, line + // feeds, and space characters. + Index++; + break; + case 123: case 125: case 91: case 93: case 58: case 44: + // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at + // the current position. + value = charIndexBuggy ? source.charAt(Index) : source[Index]; + Index++; + return value; + case 34: + // `"` delimits a JSON string; advance to the next character and + // begin parsing the string. String tokens are prefixed with the + // sentinel `@` character to distinguish them from punctuators and + // end-of-string tokens. + for (value = "@", Index++; Index < length;) { + charCode = source.charCodeAt(Index); + if (charCode < 32) { + // Unescaped ASCII control characters (those with a code unit + // less than the space character) are not permitted. + abort(); + } else if (charCode == 92) { + // A reverse solidus (`\`) marks the beginning of an escaped + // control character (including `"`, `\`, and `/`) or Unicode + // escape sequence. + charCode = source.charCodeAt(++Index); + switch (charCode) { + case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114: + // Revive escaped control characters. + value += Unescapes[charCode]; + Index++; + break; + case 117: + // `\u` marks the beginning of a Unicode escape sequence. + // Advance to the first character and validate the + // four-digit code point. + begin = ++Index; + for (position = Index + 4; Index < position; Index++) { + charCode = source.charCodeAt(Index); + // A valid sequence comprises four hexdigits (case- + // insensitive) that form a single hexadecimal value. + if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) { + // Invalid Unicode escape sequence. + abort(); + } + } + // Revive the escaped character. + value += fromCharCode("0x" + source.slice(begin, Index)); + break; + default: + // Invalid escape sequence. + abort(); + } + } else { + if (charCode == 34) { + // An unescaped double-quote character marks the end of the + // string. + break; + } + charCode = source.charCodeAt(Index); + begin = Index; + // Optimize for the common case where a string is valid. + while (charCode >= 32 && charCode != 92 && charCode != 34) { + charCode = source.charCodeAt(++Index); + } + // Append the string as-is. + value += source.slice(begin, Index); + } + } + if (source.charCodeAt(Index) == 34) { + // Advance to the next character and return the revived string. + Index++; + return value; + } + // Unterminated string. + abort(); + default: + // Parse numbers and literals. + begin = Index; + // Advance past the negative sign, if one is specified. + if (charCode == 45) { + isSigned = true; + charCode = source.charCodeAt(++Index); + } + // Parse an integer or floating-point value. + if (charCode >= 48 && charCode <= 57) { + // Leading zeroes are interpreted as octal literals. + if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) { + // Illegal octal literal. + abort(); + } + isSigned = false; + // Parse the integer component. + for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++); + // Floats cannot contain a leading decimal point; however, this + // case is already accounted for by the parser. + if (source.charCodeAt(Index) == 46) { + position = ++Index; + // Parse the decimal component. + for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++); + if (position == Index) { + // Illegal trailing decimal. + abort(); + } + Index = position; + } + // Parse exponents. The `e` denoting the exponent is + // case-insensitive. + charCode = source.charCodeAt(Index); + if (charCode == 101 || charCode == 69) { + charCode = source.charCodeAt(++Index); + // Skip past the sign following the exponent, if one is + // specified. + if (charCode == 43 || charCode == 45) { + Index++; + } + // Parse the exponential component. + for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++); + if (position == Index) { + // Illegal empty exponent. + abort(); + } + Index = position; + } + // Coerce the parsed value to a JavaScript number. + return +source.slice(begin, Index); + } + // A negative sign may only precede numbers. + if (isSigned) { + abort(); + } + // `true`, `false`, and `null` literals. + if (source.slice(Index, Index + 4) == "true") { + Index += 4; + return true; + } else if (source.slice(Index, Index + 5) == "false") { + Index += 5; + return false; + } else if (source.slice(Index, Index + 4) == "null") { + Index += 4; + return null; + } + // Unrecognized token. + abort(); + } + } + // Return the sentinel `$` character if the parser has reached the end + // of the source string. + return "$"; + }; + + // Internal: Parses a JSON `value` token. + var get = function (value) { + var results, hasMembers; + if (value == "$") { + // Unexpected end of input. + abort(); + } + if (typeof value == "string") { + if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") { + // Remove the sentinel `@` character. + return value.slice(1); + } + // Parse object and array literals. + if (value == "[") { + // Parses a JSON array, returning a new JavaScript array. + results = []; + for (;; hasMembers || (hasMembers = true)) { + value = lex(); + // A closing square bracket marks the end of the array literal. + if (value == "]") { + break; + } + // If the array literal contains elements, the current token + // should be a comma separating the previous element from the + // next. + if (hasMembers) { + if (value == ",") { + value = lex(); + if (value == "]") { + // Unexpected trailing `,` in array literal. + abort(); + } + } else { + // A `,` must separate each array element. + abort(); + } + } + // Elisions and leading commas are not permitted. + if (value == ",") { + abort(); + } + results.push(get(value)); + } + return results; + } else if (value == "{") { + // Parses a JSON object, returning a new JavaScript object. + results = {}; + for (;; hasMembers || (hasMembers = true)) { + value = lex(); + // A closing curly brace marks the end of the object literal. + if (value == "}") { + break; + } + // If the object literal contains members, the current token + // should be a comma separator. + if (hasMembers) { + if (value == ",") { + value = lex(); + if (value == "}") { + // Unexpected trailing `,` in object literal. + abort(); + } + } else { + // A `,` must separate each object member. + abort(); + } + } + // Leading commas are not permitted, object property names must be + // double-quoted strings, and a `:` must separate each property + // name and value. + if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") { + abort(); + } + results[value.slice(1)] = get(lex()); + } + return results; + } + // Unexpected token encountered. + abort(); + } + return value; + }; + + // Internal: Updates a traversed object member. + var update = function (source, property, callback) { + var element = walk(source, property, callback); + if (element === undef) { + delete source[property]; + } else { + source[property] = element; + } + }; + + // Internal: Recursively traverses a parsed JSON object, invoking the + // `callback` function for each value. This is an implementation of the + // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2. + var walk = function (source, property, callback) { + var value = source[property], length; + if (typeof value == "object" && value) { + // `forEach` can't be used to traverse an array in Opera <= 8.54 + // because its `Object#hasOwnProperty` implementation returns `false` + // for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`). + if (getClass.call(value) == arrayClass) { + for (length = value.length; length--;) { + update(value, length, callback); + } + } else { + forEach(value, function (property) { + update(value, property, callback); + }); + } + } + return callback.call(source, property, value); + }; + + // Public: `JSON.parse`. See ES 5.1 section 15.12.2. + exports.parse = function (source, callback) { + var result, value; + Index = 0; + Source = "" + source; + result = get(lex()); + // If a JSON string contains multiple tokens, it is invalid. + if (lex() != "$") { + abort(); + } + // Reset the parser state. + Index = Source = null; + return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result; + }; + } + } + + exports["runInContext"] = runInContext; + return exports; + } + + if (freeExports && !isLoader) { + // Export for CommonJS environments. + runInContext(root, freeExports); + } else { + // Export for web browsers and JavaScript engines. + var nativeJSON = root.JSON, + previousJSON = root["JSON3"], + isRestored = false; + + var JSON3 = runInContext(root, (root["JSON3"] = { + // Public: Restores the original value of the global `JSON` object and + // returns a reference to the `JSON3` object. + "noConflict": function () { + if (!isRestored) { + isRestored = true; + root.JSON = nativeJSON; + root["JSON3"] = previousJSON; + nativeJSON = previousJSON = null; + } + return JSON3; + } + })); + + root.JSON = { + "parse": JSON3.parse, + "stringify": JSON3.stringify + }; + } + + // Export for asynchronous module loaders. + if (isLoader) { + define(function () { + return JSON3; + }); + } +}).call(this); diff --git a/node_modules/json3/lib/json3.min.js b/node_modules/json3/lib/json3.min.js new file mode 100755 index 00000000..5f896fa0 --- /dev/null +++ b/node_modules/json3/lib/json3.min.js @@ -0,0 +1,17 @@ +/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */ +(function(){function N(p,r){function q(a){if(q[a]!==w)return q[a];var c;if("bug-string-char-index"==a)c="a"!="a"[0];else if("json"==a)c=q("json-stringify")&&q("json-parse");else{var e;if("json-stringify"==a){c=r.stringify;var b="function"==typeof c&&s;if(b){(e=function(){return 1}).toJSON=e;try{b="0"===c(0)&&"0"===c(new t)&&'""'==c(new A)&&c(u)===w&&c(w)===w&&c()===w&&"1"===c(e)&&"[1]"==c([e])&&"[null]"==c([w])&&"null"==c(null)&&"[null,null,null]"==c([w,u,null])&&'{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'== +c({a:[e,!0,!1,null,"\x00\b\n\f\r\t"]})&&"1"===c(null,e)&&"[\n 1,\n 2\n]"==c([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==c(new C(-864E13))&&'"+275760-09-13T00:00:00.000Z"'==c(new C(864E13))&&'"-000001-01-01T00:00:00.000Z"'==c(new C(-621987552E5))&&'"1969-12-31T23:59:59.999Z"'==c(new C(-1))}catch(f){b=!1}}c=b}if("json-parse"==a){c=r.parse;if("function"==typeof c)try{if(0===c("0")&&!c(!1)){e=c('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}');var n=5==e.a.length&&1===e.a[0];if(n){try{n=!c('"\t"')}catch(d){}if(n)try{n= +1!==c("01")}catch(g){}if(n)try{n=1!==c("1.")}catch(m){}}}}catch(X){n=!1}c=n}}return q[a]=!!c}p||(p=k.Object());r||(r=k.Object());var t=p.Number||k.Number,A=p.String||k.String,H=p.Object||k.Object,C=p.Date||k.Date,G=p.SyntaxError||k.SyntaxError,K=p.TypeError||k.TypeError,L=p.Math||k.Math,I=p.JSON||k.JSON;"object"==typeof I&&I&&(r.stringify=I.stringify,r.parse=I.parse);var H=H.prototype,u=H.toString,v,B,w,s=new C(-0xc782b5b800cec);try{s=-109252==s.getUTCFullYear()&&0===s.getUTCMonth()&&1===s.getUTCDate()&& +10==s.getUTCHours()&&37==s.getUTCMinutes()&&6==s.getUTCSeconds()&&708==s.getUTCMilliseconds()}catch(Q){}if(!q("json")){var D=q("bug-string-char-index");if(!s)var x=L.floor,M=[0,31,59,90,120,151,181,212,243,273,304,334],E=function(a,c){return M[c]+365*(a-1970)+x((a-1969+(c=+(1d){c+="\\u00"+y(2,d.toString(16));break}c+=f?n[b]:a.charAt(b)}}return c+'"'},O=function(a,c,b,h,f,n,d){var g,m,k,l,p,r,s,t,q;try{g=c[a]}catch(z){}if("object"==typeof g&&g)if(m=u.call(g),"[object Date]"!=m||v.call(g, +"toJSON"))"function"==typeof g.toJSON&&("[object Number]"!=m&&"[object String]"!=m&&"[object Array]"!=m||v.call(g,"toJSON"))&&(g=g.toJSON(a));else if(g>-1/0&&g<1/0){if(E){l=x(g/864E5);for(m=x(l/365.2425)+1970-1;E(m+1,0)<=l;m++);for(k=x((l-E(m,0))/30.42);E(m,k+1)<=l;k++);l=1+l-E(m,k);p=(g%864E5+864E5)%864E5;r=x(p/36E5)%24;s=x(p/6E4)%60;t=x(p/1E3)%60;p%=1E3}else m=g.getUTCFullYear(),k=g.getUTCMonth(),l=g.getUTCDate(),r=g.getUTCHours(),s=g.getUTCMinutes(),t=g.getUTCSeconds(),p=g.getUTCMilliseconds(); +g=(0>=m||1E4<=m?(0>m?"-":"+")+y(6,0>m?-m:m):y(4,m))+"-"+y(2,k+1)+"-"+y(2,l)+"T"+y(2,r)+":"+y(2,s)+":"+y(2,t)+"."+y(3,p)+"Z"}else g=null;b&&(g=b.call(c,a,g));if(null===g)return"null";m=u.call(g);if("[object Boolean]"==m)return""+g;if("[object Number]"==m)return g>-1/0&&g<1/0?""+g:"null";if("[object String]"==m)return R(""+g);if("object"==typeof g){for(a=d.length;a--;)if(d[a]===g)throw K();d.push(g);q=[];c=n;n+=f;if("[object Array]"==m){k=0;for(a=g.length;k=b.length?b:b.slice(0,10));return O("",(l={},l[""]=a,l),f,n,h,"",[])}}if(!q("json-parse")){var V=A.fromCharCode,W={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},b,J,l=function(){b=J=null;throw G();},z=function(){for(var a=J,c=a.length,e,h,f,k,d;bd)l();else if(92==d)switch(d=a.charCodeAt(++b),d){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=W[d];b++;break;case 117:h=++b;for(f=b+4;b=d||97<=d&&102>=d||65<=d&&70>=d||l();e+=V("0x"+a.slice(h,b));break;default:l()}else{if(34==d)break;d=a.charCodeAt(b);for(h=b;32<=d&&92!=d&&34!=d;)d=a.charCodeAt(++b);e+=a.slice(h,b)}if(34==a.charCodeAt(b))return b++,e;l();default:h= +b;45==d&&(k=!0,d=a.charCodeAt(++b));if(48<=d&&57>=d){for(48==d&&(d=a.charCodeAt(b+1),48<=d&&57>=d)&&l();b=d);b++);if(46==a.charCodeAt(b)){for(f=++b;f=d);f++);f==b&&l();b=f}d=a.charCodeAt(b);if(101==d||69==d){d=a.charCodeAt(++b);43!=d&&45!=d||b++;for(f=b;f=d);f++);f==b&&l();b=f}return+a.slice(h,b)}k&&l();if("true"==a.slice(b,b+4))return b+=4,!0;if("false"==a.slice(b,b+5))return b+=5,!1;if("null"==a.slice(b, +b+4))return b+=4,null;l()}return"$"},P=function(a){var c,b;"$"==a&&l();if("string"==typeof a){if("@"==(D?a.charAt(0):a[0]))return a.slice(1);if("["==a){for(c=[];;b||(b=!0)){a=z();if("]"==a)break;b&&(","==a?(a=z(),"]"==a&&l()):l());","==a&&l();c.push(P(a))}return c}if("{"==a){for(c={};;b||(b=!0)){a=z();if("}"==a)break;b&&(","==a?(a=z(),"}"==a&&l()):l());","!=a&&"string"==typeof a&&"@"==(D?a.charAt(0):a[0])&&":"==z()||l();c[a.slice(1)]=P(z())}return c}l()}return a},T=function(a,b,e){e=S(a,b,e);e=== +w?delete a[b]:a[b]=e},S=function(a,b,e){var h=a[b],f;if("object"==typeof h&&h)if("[object Array]"==u.call(h))for(f=h.length;f--;)T(h,f,e);else B(h,function(a){T(h,a,e)});return e.call(a,b,h)};r.parse=function(a,c){var e,h;b=0;J=""+a;e=P(z());"$"!=z()&&l();b=J=null;return c&&"[object Function]"==u.call(c)?S((h={},h[""]=e,h),"",c):e}}}r.runInContext=N;return r}var K=typeof define==="function"&&define.amd,F={"function":!0,object:!0},G=F[typeof exports]&&exports&&!exports.nodeType&&exports,k=F[typeof window]&& +window||this,t=G&&F[typeof module]&&module&&!module.nodeType&&"object"==typeof global&&global;!t||t.global!==t&&t.window!==t&&t.self!==t||(k=t);if(G&&!K)N(k,G);else{var L=k.JSON,Q=k.JSON3,M=!1,A=N(k,k.JSON3={noConflict:function(){M||(M=!0,k.JSON=L,k.JSON3=Q,L=Q=null);return A}});k.JSON={parse:A.parse,stringify:A.stringify}}K&&define(function(){return A})}).call(this); diff --git a/node_modules/json3/package.json b/node_modules/json3/package.json new file mode 100755 index 00000000..e8b812b3 --- /dev/null +++ b/node_modules/json3/package.json @@ -0,0 +1,148 @@ +{ + "_args": [ + [ + { + "raw": "json3@^3.3.2", + "scope": null, + "escapedName": "json3", + "name": "json3", + "rawSpec": "^3.3.2", + "spec": ">=3.3.2 <4.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/sockjs-client" + ] + ], + "_from": "json3@>=3.3.2 <4.0.0", + "_id": "json3@3.3.2", + "_inCache": true, + "_location": "/json3", + "_npmUser": { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": {}, + "_requested": { + "raw": "json3@^3.3.2", + "scope": null, + "escapedName": "json3", + "name": "json3", + "rawSpec": "^3.3.2", + "spec": ">=3.3.2 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/sockjs-client" + ], + "_resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "_shasum": "3c0434743df93e2f5c42aee7b19bcb483575f4e1", + "_shrinkwrap": null, + "_spec": "json3@^3.3.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/sockjs-client", + "author": { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + "bugs": { + "url": "https://github.com/bestiejs/json3/issues" + }, + "contributors": [ + { + "name": "Mangled Deutz", + "email": "olivier@webitup.fr", + "url": "http://tech.roxee.tv/" + }, + { + "name": "Øyvind Sean Kinsey", + "email": "oyvind@kinsey.no", + "url": "http://fb.me/ok" + }, + { + "name": "Oskar Schöldström", + "email": "public@oxy.fi", + "url": "http://oxy.fi/" + }, + { + "name": "Kiryl Yermakou", + "email": "rma4ok@gmail.com", + "url": "https://github.com/rma4ok" + } + ], + "dependencies": {}, + "description": "A modern JSON implementation compatible with nearly all JavaScript platforms.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "3c0434743df93e2f5c42aee7b19bcb483575f4e1", + "tarball": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz" + }, + "files": [ + "README.md", + "LICENSE", + "lib/json3.js", + "lib/json3.min.js" + ], + "homepage": "http://bestiejs.github.io/json3", + "jam": { + "main": "./lib/json3.js", + "includes": [ + "README.md", + "LICENSE", + "lib/json3.js", + "lib/json3.min.js" + ] + }, + "keywords": [ + "json", + "spec", + "ecma", + "es5", + "lexer", + "parser", + "stringify" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://kit.mit-license.org/" + } + ], + "main": "./lib/json3", + "maintainers": [ + { + "name": "kitcambridge", + "email": "kitcambridge@me.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + } + ], + "name": "json3", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/bestiejs/json3.git" + }, + "scripts": { + "test": "node test/test_*.js" + }, + "version": "3.3.2", + "volo": { + "type": "directory", + "ignore": [ + ".*", + "build.js", + "index.html", + "component.json", + "bower.json", + "benchmark", + "page", + "test", + "vendor" + ] + } +} diff --git a/node_modules/json5/CHANGELOG.md b/node_modules/json5/CHANGELOG.md new file mode 100755 index 00000000..6db820cb --- /dev/null +++ b/node_modules/json5/CHANGELOG.md @@ -0,0 +1,169 @@ +### v0.5.1 [[code][c0.5.1], [diff][d0.5.1]] + +[c0.5.1]: https://github.com/aseemk/json5/tree/v0.5.1 +[d0.5.1]: https://github.com/aseemk/json5/compare/v0.5.0...v0.5.1 + +This release includes a minor fix for indentations when stringifying empty +arrays. + +- Fix: Indents no longer appear in empty arrays when stringified. ([#134]) + + +### v0.5.0 [[code][c0.5.0], [diff][d0.5.0]] + +[c0.5.0]: https://github.com/aseemk/json5/tree/v0.5.0 +[d0.5.0]: https://github.com/aseemk/json5/compare/v0.4.0...v0.5.0 + +This release includes major internal changes and public API enhancements. + +- **Major:** JSON5 officially supports Node.js v4 LTS and v5. Support for + Node.js v0.6 and v0.8 have been dropped, while support for v0.10 and v0.12 + remain. + +- Fix: YUI Compressor no longer fails when compressing json5.js. ([#97]) + +- New: `parse` and the CLI provide line and column numbers when displaying error + messages. ([#101]; awesome work by [@amb26].) + + +### v0.4.0 [[code][c0.4.0], [diff][d0.4.0]] + +[c0.4.0]: https://github.com/aseemk/json5/tree/v0.4.0 +[d0.4.0]: https://github.com/aseemk/json5/compare/v0.2.0...v0.4.0 + +Note that v0.3.0 was tagged, but never published to npm, so this v0.4.0 +changelog entry includes v0.3.0 features. + +This is a massive release that adds `stringify` support, among other things. + +- **Major:** `JSON5.stringify()` now exists! + This method is analogous to the native `JSON.stringify()`; + it just avoids quoting keys where possible. + See the [usage documentation](./README.md#usage) for more. + ([#32]; huge thanks and props [@aeisenberg]!) + +- New: `NaN` and `-NaN` are now allowed number literals. + ([#30]; thanks [@rowanhill].) + +- New: Duplicate object keys are now allowed; the last value is used. + This is the same behavior as JSON. ([#57]; thanks [@jordanbtucker].) + +- Fix: Properly handle various whitespace and newline cases now. + E.g. JSON5 now properly supports escaped CR and CRLF newlines in strings, + and JSON5 now accepts the same whitespace as JSON (stricter than ES5). + ([#58], [#60], and [#63]; thanks [@jordanbtucker].) + +- New: Negative hexadecimal numbers (e.g. `-0xC8`) are allowed again. + (They were disallowed in v0.2.0; see below.) + It turns out they *are* valid in ES5, so JSON5 supports them now too. + ([#36]; thanks [@jordanbtucker]!) + + +### v0.2.0 [[code][c0.2.0], [diff][d0.2.0]] + +[c0.2.0]: https://github.com/aseemk/json5/tree/v0.2.0 +[d0.2.0]: https://github.com/aseemk/json5/compare/v0.1.0...v0.2.0 + +This release fixes some bugs and adds some more utility features to help you +express data more easily: + +- **Breaking:** Negative hexadecimal numbers (e.g. `-0xC8`) are rejected now. + While V8 (e.g. Chrome and Node) supported them, it turns out they're invalid + in ES5. This has been [fixed in V8][v8-hex-fix] (and by extension, Chrome + and Node), so JSON5 officially rejects them now, too. ([#36]) + +- New: Trailing decimal points in decimal numbers are allowed again. + (They were disallowed in v0.1.0; see below.) + They're allowed by ES5, and differentiating between integers and floats may + make sense on some platforms. ([#16]; thanks [@Midar].) + +- New: `Infinity` and `-Infinity` are now allowed number literals. + ([#30]; thanks [@pepkin88].) + +- New: Plus signs (`+`) in front of numbers are now allowed, since it can + be helpful in some contexts to explicitly mark numbers as positive. + (E.g. when a property represents changes or deltas.) + +- Fix: unescaped newlines in strings are rejected now. + ([#24]; thanks [@Midar].) + + +### v0.1.0 [[code][c0.1.0], [diff][d0.1.0]] + +[c0.1.0]: https://github.com/aseemk/json5/tree/v0.1.0 +[d0.1.0]: https://github.com/aseemk/json5/compare/v0.0.1...v0.1.0 + +This release tightens JSON5 support and adds helpful utility features: + +- New: Support hexadecimal numbers. (Thanks [@MaxNanasy].) + +- Fix: Reject octal numbers properly now. Previously, they were accepted but + improperly parsed as base-10 numbers. (Thanks [@MaxNanasy].) + +- **Breaking:** Reject "noctal" numbers now (base-10 numbers that begin with a + leading zero). These are disallowed by both JSON5 and JSON, as well as by + ES5's strict mode. (Thanks [@MaxNanasy].) + +- New: Support leading decimal points in decimal numbers. + (Thanks [@MaxNanasy].) + +- **Breaking:** Reject trailing decimal points in decimal numbers now. These + are disallowed by both JSON5 and JSON. (Thanks [@MaxNanasy].) + +- **Breaking:** Reject omitted elements in arrays now. These are disallowed by + both JSON5 and JSON. + +- Fix: Throw proper `SyntaxError` instances on errors now. + +- New: Add Node.js `require()` hook. Register via `json5/lib/require`. + +- New: Add Node.js `json5` executable to compile JSON5 files to JSON. + + +### v0.0.1 [[code][c0.0.1], [diff][d0.0.1]] + +[c0.0.1]: https://github.com/aseemk/json5/tree/v0.0.1 +[d0.0.1]: https://github.com/aseemk/json5/compare/v0.0.0...v0.0.1 + +This was the first implementation of this JSON5 parser. + +- Support unquoted object keys, including reserved words. Unicode characters + and escape sequences sequences aren't yet supported. + +- Support single-quoted strings. + +- Support multi-line strings. + +- Support trailing commas in arrays and objects. + +- Support comments, both inline and block. + + +### v0.0.0 [[code](https://github.com/aseemk/json5/tree/v0.0.0)] + +Let's consider this to be Douglas Crockford's original [json_parse.js] — a +parser for the regular JSON format. + + +[json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js +[v8-hex-fix]: http://code.google.com/p/v8/issues/detail?id=2240 + +[@MaxNanasy]: https://github.com/MaxNanasy +[@Midar]: https://github.com/Midar +[@pepkin88]: https://github.com/pepkin88 +[@rowanhill]: https://github.com/rowanhill +[@aeisenberg]: https://github.com/aeisenberg +[@jordanbtucker]: https://github.com/jordanbtucker +[@amb26]: https://github.com/amb26 + +[#16]: https://github.com/aseemk/json5/issues/16 +[#24]: https://github.com/aseemk/json5/issues/24 +[#30]: https://github.com/aseemk/json5/issues/30 +[#32]: https://github.com/aseemk/json5/issues/32 +[#36]: https://github.com/aseemk/json5/issues/36 +[#57]: https://github.com/aseemk/json5/issues/57 +[#58]: https://github.com/aseemk/json5/pull/58 +[#60]: https://github.com/aseemk/json5/pull/60 +[#63]: https://github.com/aseemk/json5/pull/63 +[#97]: https://github.com/aseemk/json5/pull/97 +[#101]: https://github.com/aseemk/json5/pull/101 diff --git a/node_modules/json5/LICENSE.md b/node_modules/json5/LICENSE.md new file mode 100755 index 00000000..861df26e --- /dev/null +++ b/node_modules/json5/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012-2016 Aseem Kishore, and [others](https://github.com/aseemk/json5/contributors). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/json5/README.md b/node_modules/json5/README.md new file mode 100755 index 00000000..a4285148 --- /dev/null +++ b/node_modules/json5/README.md @@ -0,0 +1,286 @@ +# JSON5 – Modern JSON + +[![Build Status](https://travis-ci.org/json5/json5.svg)](https://travis-ci.org/json5/json5) + +JSON is an excellent data format, but we think it can be better. + +**JSON5 is a proposed extension to JSON** that aims to make it easier for +*humans to write and maintain* by hand. It does this by adding some minimal +syntax features directly from ECMAScript 5. + +JSON5 remains a **strict subset of JavaScript**, adds **no new data types**, +and **works with all existing JSON content**. + +JSON5 is *not* an official successor to JSON, and JSON5 content may *not* +work with existing JSON parsers. For this reason, JSON5 files use a new .json5 +extension. *(TODO: new MIME type needed too.)* + +The code here is a **reference JavaScript implementation** for both Node.js +and all browsers. It’s based directly off of Douglas Crockford’s own [JSON +implementation][json_parse.js], and it’s both robust and secure. + + +## Why + +JSON isn’t the friendliest to *write*. Keys need to be quoted, objects and +arrays can’t have trailing commas, and comments aren’t allowed — even though +none of these are the case with regular JavaScript today. + +That was fine when JSON’s goal was to be a great data format, but JSON’s usage +has expanded beyond *machines*. JSON is now used for writing [configs][ex1], +[manifests][ex2], even [tests][ex3] — all by *humans*. + +[ex1]: http://plovr.com/docs.html +[ex2]: https://www.npmjs.org/doc/files/package.json.html +[ex3]: http://code.google.com/p/fuzztester/wiki/JSONFileFormat + +There are other formats that are human-friendlier, like YAML, but changing +from JSON to a completely different format is undesirable in many cases. +JSON5’s aim is to remain close to JSON and JavaScript. + + +## Features + +The following is the exact list of additions to JSON’s syntax introduced by +JSON5. **All of these are optional**, and **all of these come from ES5**. + +### Objects + +- Object keys can be unquoted if they’re valid [identifiers][mdn_variables]. + Yes, even reserved keywords (like `default`) are valid unquoted keys in ES5 + [[§11.1.5](http://es5.github.com/#x11.1.5), [§7.6](http://es5.github.com/#x7.6)]. + ([More info](https://mathiasbynens.be/notes/javascript-identifiers)) + + *(TODO: Unicode characters and escape sequences aren’t yet supported in this + implementation.)* + +- Object keys can also be single-quoted. + +- Objects can have trailing commas. + +[mdn_variables]: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables + +### Arrays + +- Arrays can have trailing commas. + +### Strings + +- Strings can be single-quoted. + +- Strings can be split across multiple lines; just prefix each newline with a + backslash. [ES5 [§7.8.4](http://es5.github.com/#x7.8.4)] + +### Numbers + +- Numbers can be hexadecimal (base 16). + +- Numbers can begin or end with a (leading or trailing) decimal point. + +- Numbers can include `Infinity`, `-Infinity`, `NaN`, and `-NaN`. + +- Numbers can begin with an explicit plus sign. + +### Comments + +- Both inline (single-line) and block (multi-line) comments are allowed. + + +## Example + +The following is a contrived example, but it illustrates most of the features: + +```js +{ + foo: 'bar', + while: true, + + this: 'is a \ +multi-line string', + + // this is an inline comment + here: 'is another', // inline comment + + /* this is a block comment + that continues on another line */ + + hex: 0xDEADbeef, + half: .5, + delta: +10, + to: Infinity, // and beyond! + + finally: 'a trailing comma', + oh: [ + "we shouldn't forget", + 'arrays can have', + 'trailing commas too', + ], +} +``` + +This implementation’s own [package.json5](package.json5) is more realistic: + +```js +// This file is written in JSON5 syntax, naturally, but npm needs a regular +// JSON file, so compile via `npm run build`. Be sure to keep both in sync! + +{ + name: 'json5', + version: '0.5.0', + description: 'JSON for the ES5 era.', + keywords: ['json', 'es5'], + author: 'Aseem Kishore ', + contributors: [ + // TODO: Should we remove this section in favor of GitHub's list? + // https://github.com/aseemk/json5/contributors + 'Max Nanasy ', + 'Andrew Eisenberg ', + 'Jordan Tucker ', + ], + main: 'lib/json5.js', + bin: 'lib/cli.js', + files: ["lib/"], + dependencies: {}, + devDependencies: { + gulp: "^3.9.1", + 'gulp-jshint': "^2.0.0", + jshint: "^2.9.1", + 'jshint-stylish': "^2.1.0", + mocha: "^2.4.5" + }, + scripts: { + build: 'node ./lib/cli.js -c package.json5', + test: 'mocha --ui exports --reporter spec', + // TODO: Would it be better to define these in a mocha.opts file? + }, + homepage: 'http://json5.org/', + license: 'MIT', + repository: { + type: 'git', + url: 'https://github.com/aseemk/json5.git', + }, +} +``` + + +## Community + +Join the [Google Group](http://groups.google.com/group/json5) if you’re +interested in JSON5 news, updates, and general discussion. +Don’t worry, it’s very low-traffic. + +The [GitHub wiki](https://github.com/aseemk/json5/wiki) is a good place to track +JSON5 support and usage. Contribute freely there! + +[GitHub Issues](https://github.com/aseemk/json5/issues) is the place to +formally propose feature requests and report bugs. Questions and general +feedback are better directed at the Google Group. + + +## Usage + +This JavaScript implementation of JSON5 simply provides a `JSON5` object just +like the native ES5 `JSON` object. + +To use from Node: + +```sh +npm install json5 +``` + +```js +var JSON5 = require('json5'); +``` + +To use in the browser (adds the `JSON5` object to the global namespace): + +```html + +``` + +Then in both cases, you can simply replace native `JSON` calls with `JSON5`: + +```js +var obj = JSON5.parse('{unquoted:"key",trailing:"comma",}'); +var str = JSON5.stringify(obj); +``` + +`JSON5.parse` supports all of the JSON5 features listed above (*TODO: except +Unicode*), as well as the native [`reviver` argument][json-parse]. + +[json-parse]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse + +`JSON5.stringify` mainly avoids quoting keys where possible, but we hope to +keep expanding it in the future (e.g. to also output trailing commas). +It supports the native [`replacer` and `space` arguments][json-stringify], +as well. *(TODO: Any implemented `toJSON` methods aren’t used today.)* + +[json-stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify + + +### Extras + +If you’re running this on Node, you can also register a JSON5 `require()` hook +to let you `require()` `.json5` files just like you can `.json` files: + +```js +require('json5/lib/require'); +require('./path/to/foo'); // tries foo.json5 after foo.js, foo.json, etc. +require('./path/to/bar.json5'); +``` + +This module also provides a `json5` executable (requires Node) for converting +JSON5 files to JSON: + +```sh +json5 -c path/to/foo.json5 # generates path/to/foo.json +``` + + +## Development + +```sh +git clone git://github.com/aseemk/json5.git +cd json5 +npm install +npm test +``` + +As the `package.json5` file states, be sure to run `npm run build` on changes +to `package.json5`, since npm requires `package.json`. + +Feel free to [file issues](https://github.com/aseemk/json5/issues) and submit +[pull requests](https://github.com/aseemk/json5/pulls) — contributions are +welcome. If you do submit a pull request, please be sure to add or update the +tests, and ensure that `npm test` continues to pass. + + +## License + +MIT. See [LICENSE.md](./LICENSE.md) for details. + + +## Credits + +[Michael Bolin](http://bolinfest.com/) independently arrived at and published +some of these same ideas with awesome explanations and detail. +Recommended reading: +[Suggested Improvements to JSON](http://bolinfest.com/essays/json.html) + +[Douglas Crockford](http://www.crockford.com/) of course designed and built +JSON, but his state machine diagrams on the [JSON website](http://json.org/), +as cheesy as it may sound, gave me motivation and confidence that building a +new parser to implement these ideas this was within my reach! +This code is also modeled directly off of Doug’s open-source [json_parse.js][] +parser. I’m super grateful for that clean and well-documented code. + +[json_parse.js]: https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js + +[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific +supporter, contributing multiple patches and ideas. Thanks Max! + +[Andrew Eisenberg](https://github.com/aeisenberg) has contributed the +`stringify` method. + +[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely +with ES5 and is actively maintaining this project. diff --git a/node_modules/json5/lib/cli.js b/node_modules/json5/lib/cli.js new file mode 100755 index 00000000..9b72f6d1 --- /dev/null +++ b/node_modules/json5/lib/cli.js @@ -0,0 +1,41 @@ +#!/usr/bin/env node + +// cli.js +// JSON5 command-line interface. +// +// This is pretty minimal for now; just supports compiling files via `-c`. +// TODO More useful functionality, like output path, watch, etc.? + +var FS = require('fs'); +var JSON5 = require('./json5'); +var Path = require('path'); + +var USAGE = [ + 'Usage: json5 -c path/to/file.json5 ...', + 'Compiles JSON5 files into sibling JSON files with the same basenames.', +].join('\n'); + +// if valid, args look like [node, json5, -c, file1, file2, ...] +var args = process.argv; + +if (args.length < 4 || args[2] !== '-c') { + console.error(USAGE); + process.exit(1); +} + +var cwd = process.cwd(); +var files = args.slice(3); + +// iterate over each file and convert JSON5 files to JSON: +files.forEach(function (file) { + var path = Path.resolve(cwd, file); + var basename = Path.basename(path, '.json5'); + var dirname = Path.dirname(path); + + var json5 = FS.readFileSync(path, 'utf8'); + var obj = JSON5.parse(json5); + var json = JSON.stringify(obj, null, 4); // 4 spaces; TODO configurable? + + path = Path.join(dirname, basename + '.json'); + FS.writeFileSync(path, json, 'utf8'); +}); diff --git a/node_modules/json5/lib/json5.js b/node_modules/json5/lib/json5.js new file mode 100755 index 00000000..4a4590d0 --- /dev/null +++ b/node_modules/json5/lib/json5.js @@ -0,0 +1,770 @@ +// json5.js +// Modern JSON. See README.md for details. +// +// This file is based directly off of Douglas Crockford's json_parse.js: +// https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js + +var JSON5 = (typeof exports === 'object' ? exports : {}); + +JSON5.parse = (function () { + "use strict"; + +// This is a function that can parse a JSON5 text, producing a JavaScript +// data structure. It is a simple, recursive descent parser. It does not use +// eval or regular expressions, so it can be used as a model for implementing +// a JSON5 parser in other languages. + +// We are defining the function inside of another function to avoid creating +// global variables. + + var at, // The index of the current character + lineNumber, // The current line number + columnNumber, // The current column number + ch, // The current character + escapee = { + "'": "'", + '"': '"', + '\\': '\\', + '/': '/', + '\n': '', // Replace escaped newlines in strings w/ empty string + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + ws = [ + ' ', + '\t', + '\r', + '\n', + '\v', + '\f', + '\xA0', + '\uFEFF' + ], + text, + + renderChar = function (chr) { + return chr === '' ? 'EOF' : "'" + chr + "'"; + }, + + error = function (m) { + +// Call error when something is wrong. + + var error = new SyntaxError(); + // beginning of message suffix to agree with that provided by Gecko - see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse + error.message = m + " at line " + lineNumber + " column " + columnNumber + " of the JSON5 data. Still to read: " + JSON.stringify(text.substring(at - 1, at + 19)); + error.at = at; + // These two property names have been chosen to agree with the ones in Gecko, the only popular + // environment which seems to supply this info on JSON.parse + error.lineNumber = lineNumber; + error.columnNumber = columnNumber; + throw error; + }, + + next = function (c) { + +// If a c parameter is provided, verify that it matches the current character. + + if (c && c !== ch) { + error("Expected " + renderChar(c) + " instead of " + renderChar(ch)); + } + +// Get the next character. When there are no more characters, +// return the empty string. + + ch = text.charAt(at); + at++; + columnNumber++; + if (ch === '\n' || ch === '\r' && peek() !== '\n') { + lineNumber++; + columnNumber = 0; + } + return ch; + }, + + peek = function () { + +// Get the next character without consuming it or +// assigning it to the ch varaible. + + return text.charAt(at); + }, + + identifier = function () { + +// Parse an identifier. Normally, reserved words are disallowed here, but we +// only use this for unquoted object keys, where reserved words are allowed, +// so we don't check for those here. References: +// - http://es5.github.com/#x7.6 +// - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables +// - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm +// TODO Identifiers can have Unicode "letters" in them; add support for those. + + var key = ch; + + // Identifiers must start with a letter, _ or $. + if ((ch !== '_' && ch !== '$') && + (ch < 'a' || ch > 'z') && + (ch < 'A' || ch > 'Z')) { + error("Bad identifier as unquoted key"); + } + + // Subsequent characters can contain digits. + while (next() && ( + ch === '_' || ch === '$' || + (ch >= 'a' && ch <= 'z') || + (ch >= 'A' && ch <= 'Z') || + (ch >= '0' && ch <= '9'))) { + key += ch; + } + + return key; + }, + + number = function () { + +// Parse a number value. + + var number, + sign = '', + string = '', + base = 10; + + if (ch === '-' || ch === '+') { + sign = ch; + next(ch); + } + + // support for Infinity (could tweak to allow other words): + if (ch === 'I') { + number = word(); + if (typeof number !== 'number' || isNaN(number)) { + error('Unexpected word for number'); + } + return (sign === '-') ? -number : number; + } + + // support for NaN + if (ch === 'N' ) { + number = word(); + if (!isNaN(number)) { + error('expected word to be NaN'); + } + // ignore sign as -NaN also is NaN + return number; + } + + if (ch === '0') { + string += ch; + next(); + if (ch === 'x' || ch === 'X') { + string += ch; + next(); + base = 16; + } else if (ch >= '0' && ch <= '9') { + error('Octal literal'); + } + } + + switch (base) { + case 10: + while (ch >= '0' && ch <= '9' ) { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + break; + case 16: + while (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f') { + string += ch; + next(); + } + break; + } + + if(sign === '-') { + number = -string; + } else { + number = +string; + } + + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + +// Parse a string value. + + var hex, + i, + string = '', + delim, // double quote or single quote + uffff; + +// When parsing for string values, we must look for ' or " and \ characters. + + if (ch === '"' || ch === "'") { + delim = ch; + while (next()) { + if (ch === delim) { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (ch === '\r') { + if (peek() === '\n') { + next(); + } + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else if (ch === '\n') { + // unescaped newlines are invalid; see: + // https://github.com/aseemk/json5/issues/24 + // TODO this feels special-cased; are there other + // invalid unescaped chars? + break; + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + inlineComment = function () { + +// Skip an inline comment, assuming this is one. The current character should +// be the second / character in the // pair that begins this inline comment. +// To finish the inline comment, we look for a newline or the end of the text. + + if (ch !== '/') { + error("Not an inline comment"); + } + + do { + next(); + if (ch === '\n' || ch === '\r') { + next(); + return; + } + } while (ch); + }, + + blockComment = function () { + +// Skip a block comment, assuming this is one. The current character should be +// the * character in the /* pair that begins this block comment. +// To finish the block comment, we look for an ending */ pair of characters, +// but we also watch for the end of text before the comment is terminated. + + if (ch !== '*') { + error("Not a block comment"); + } + + do { + next(); + while (ch === '*') { + next('*'); + if (ch === '/') { + next('/'); + return; + } + } + } while (ch); + + error("Unterminated block comment"); + }, + + comment = function () { + +// Skip a comment, whether inline or block-level, assuming this is one. +// Comments always begin with a / character. + + if (ch !== '/') { + error("Not a comment"); + } + + next('/'); + + if (ch === '/') { + inlineComment(); + } else if (ch === '*') { + blockComment(); + } else { + error("Unrecognized comment"); + } + }, + + white = function () { + +// Skip whitespace and comments. +// Note that we're detecting comments by only a single / character. +// This works since regular expressions are not valid JSON(5), but this will +// break if there are other valid values that begin with a / character! + + while (ch) { + if (ch === '/') { + comment(); + } else if (ws.indexOf(ch) >= 0) { + next(); + } else { + return; + } + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + case 'I': + next('I'); + next('n'); + next('f'); + next('i'); + next('n'); + next('i'); + next('t'); + next('y'); + return Infinity; + case 'N': + next( 'N' ); + next( 'a' ); + next( 'N' ); + return NaN; + } + error("Unexpected " + renderChar(ch)); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + while (ch) { + if (ch === ']') { + next(']'); + return array; // Potentially empty array + } + // ES5 allows omitting elements in arrays, e.g. [,] and + // [,null]. We don't allow this in JSON5. + if (ch === ',') { + error("Missing array element"); + } else { + array.push(value()); + } + white(); + // If there's no comma after this value, this needs to + // be the end of the array. + if (ch !== ',') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + while (ch) { + if (ch === '}') { + next('}'); + return object; // Potentially empty object + } + + // Keys can be unquoted. If they are, they need to be + // valid JS identifiers. + if (ch === '"' || ch === "'") { + key = string(); + } else { + key = identifier(); + } + + white(); + next(':'); + object[key] = value(); + white(); + // If there's no comma after this pair, this needs to be + // the end of the object. + if (ch !== ',') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + + value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + case "'": + return string(); + case '-': + case '+': + case '.': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } + }; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + + return function (source, reviver) { + var result; + + text = String(source); + at = 0; + lineNumber = 1; + columnNumber = 1; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + +// If there is a reviver function, we recursively walk the new structure, +// passing each name/value pair to the reviver function for possible +// transformation, starting with a temporary root object that holds the result +// in an empty key. If there is not a reviver function, we simply return the +// result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; + }; +}()); + +// JSON5 stringify will not quote keys where appropriate +JSON5.stringify = function (obj, replacer, space) { + if (replacer && (typeof(replacer) !== "function" && !isArray(replacer))) { + throw new Error('Replacer must be a function or an array'); + } + var getReplacedValueOrUndefined = function(holder, key, isTopLevel) { + var value = holder[key]; + + // Replace the value with its toJSON value first, if possible + if (value && value.toJSON && typeof value.toJSON === "function") { + value = value.toJSON(); + } + + // If the user-supplied replacer if a function, call it. If it's an array, check objects' string keys for + // presence in the array (removing the key/value pair from the resulting JSON if the key is missing). + if (typeof(replacer) === "function") { + return replacer.call(holder, key, value); + } else if(replacer) { + if (isTopLevel || isArray(holder) || replacer.indexOf(key) >= 0) { + return value; + } else { + return undefined; + } + } else { + return value; + } + }; + + function isWordChar(c) { + return (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + c === '_' || c === '$'; + } + + function isWordStart(c) { + return (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + c === '_' || c === '$'; + } + + function isWord(key) { + if (typeof key !== 'string') { + return false; + } + if (!isWordStart(key[0])) { + return false; + } + var i = 1, length = key.length; + while (i < length) { + if (!isWordChar(key[i])) { + return false; + } + i++; + } + return true; + } + + // export for use in tests + JSON5.isWord = isWord; + + // polyfills + function isArray(obj) { + if (Array.isArray) { + return Array.isArray(obj); + } else { + return Object.prototype.toString.call(obj) === '[object Array]'; + } + } + + function isDate(obj) { + return Object.prototype.toString.call(obj) === '[object Date]'; + } + + var objStack = []; + function checkForCircular(obj) { + for (var i = 0; i < objStack.length; i++) { + if (objStack[i] === obj) { + throw new TypeError("Converting circular structure to JSON"); + } + } + } + + function makeIndent(str, num, noNewLine) { + if (!str) { + return ""; + } + // indentation no more than 10 chars + if (str.length > 10) { + str = str.substring(0, 10); + } + + var indent = noNewLine ? "" : "\n"; + for (var i = 0; i < num; i++) { + indent += str; + } + + return indent; + } + + var indentStr; + if (space) { + if (typeof space === "string") { + indentStr = space; + } else if (typeof space === "number" && space >= 0) { + indentStr = makeIndent(" ", space, true); + } else { + // ignore space parameter + } + } + + // Copied from Crokford's implementation of JSON + // See https://github.com/douglascrockford/JSON-js/blob/e39db4b7e6249f04a195e7dd0840e610cc9e941e/json2.js#L195 + // Begin + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }; + function escapeString(string) { + +// If the string contains no control characters, no quote characters, and no +// backslash characters, then we can safely slap some quotes around it. +// Otherwise we must also replace the offending characters with safe escape +// sequences. + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? + c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } + // End + + function internalStringify(holder, key, isTopLevel) { + var buffer, res; + + // Replace the value, if necessary + var obj_part = getReplacedValueOrUndefined(holder, key, isTopLevel); + + if (obj_part && !isDate(obj_part)) { + // unbox objects + // don't unbox dates, since will turn it into number + obj_part = obj_part.valueOf(); + } + switch(typeof obj_part) { + case "boolean": + return obj_part.toString(); + + case "number": + if (isNaN(obj_part) || !isFinite(obj_part)) { + return "null"; + } + return obj_part.toString(); + + case "string": + return escapeString(obj_part.toString()); + + case "object": + if (obj_part === null) { + return "null"; + } else if (isArray(obj_part)) { + checkForCircular(obj_part); + buffer = "["; + objStack.push(obj_part); + + for (var i = 0; i < obj_part.length; i++) { + res = internalStringify(obj_part, i, false); + buffer += makeIndent(indentStr, objStack.length); + if (res === null || typeof res === "undefined") { + buffer += "null"; + } else { + buffer += res; + } + if (i < obj_part.length-1) { + buffer += ","; + } else if (indentStr) { + buffer += "\n"; + } + } + objStack.pop(); + if (obj_part.length) { + buffer += makeIndent(indentStr, objStack.length, true) + } + buffer += "]"; + } else { + checkForCircular(obj_part); + buffer = "{"; + var nonEmpty = false; + objStack.push(obj_part); + for (var prop in obj_part) { + if (obj_part.hasOwnProperty(prop)) { + var value = internalStringify(obj_part, prop, false); + isTopLevel = false; + if (typeof value !== "undefined" && value !== null) { + buffer += makeIndent(indentStr, objStack.length); + nonEmpty = true; + key = isWord(prop) ? prop : escapeString(prop); + buffer += key + ":" + (indentStr ? ' ' : '') + value + ","; + } + } + } + objStack.pop(); + if (nonEmpty) { + buffer = buffer.substring(0, buffer.length-1) + makeIndent(indentStr, objStack.length) + "}"; + } else { + buffer = '{}'; + } + } + return buffer; + default: + // functions and undefined should be ignored + return undefined; + } + } + + // special case...when undefined is used inside of + // a compound object/array, return null. + // but when top-level, return undefined + var topLevelHolder = {"":obj}; + if (obj === undefined) { + return getReplacedValueOrUndefined(topLevelHolder, '', true); + } + return internalStringify(topLevelHolder, '', true); +}; diff --git a/node_modules/json5/lib/require.js b/node_modules/json5/lib/require.js new file mode 100755 index 00000000..73e56fe9 --- /dev/null +++ b/node_modules/json5/lib/require.js @@ -0,0 +1,18 @@ +// require.js +// Node.js only: adds a require() hook for .json5 files, just like the native +// hook for .json files. +// +// Usage: +// require('json5/require'); +// require('./foo'); // will check foo.json5 after foo.js, foo.json, etc. +// require('./bar.json5'); + +var FS = require('fs'); +var JSON5 = require('./json5'); + +// Modeled off of (v0.6.18 link; check latest too): +// https://github.com/joyent/node/blob/v0.6.18/lib/module.js#L468-L472 +require.extensions['.json5'] = function (module, filename) { + var content = FS.readFileSync(filename, 'utf8'); + module.exports = JSON5.parse(content); +}; diff --git a/node_modules/json5/package.json b/node_modules/json5/package.json new file mode 100755 index 00000000..4aa31daa --- /dev/null +++ b/node_modules/json5/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "json5@^0.5.0", + "scope": null, + "escapedName": "json5", + "name": "json5", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core" + ] + ], + "_from": "json5@>=0.5.0 <0.6.0", + "_id": "json5@0.5.1", + "_inCache": true, + "_location": "/json5", + "_nodeVersion": "6.9.1", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/json5-0.5.1.tgz_1480284434295_0.5308296058792621" + }, + "_npmUser": { + "name": "jordanbtucker", + "email": "jordanbtucker@gmail.com" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "json5@^0.5.0", + "scope": null, + "escapedName": "json5", + "name": "json5", + "rawSpec": "^0.5.0", + "spec": ">=0.5.0 <0.6.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-core", + "/loader-utils" + ], + "_resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "_shasum": "1eade7acc012034ad84e2396767ead9fa5495821", + "_shrinkwrap": null, + "_spec": "json5@^0.5.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core", + "author": { + "name": "Aseem Kishore", + "email": "aseem.kishore@gmail.com" + }, + "bin": { + "json5": "lib/cli.js" + }, + "bugs": { + "url": "https://github.com/aseemk/json5/issues" + }, + "contributors": [ + { + "name": "Max Nanasy", + "email": "max.nanasy@gmail.com" + }, + { + "name": "Andrew Eisenberg", + "email": "andrew@eisenberg.as" + }, + { + "name": "Jordan Tucker", + "email": "jordanbtucker@gmail.com" + } + ], + "dependencies": {}, + "description": "JSON for the ES5 era.", + "devDependencies": { + "gulp": "^3.9.1", + "gulp-jshint": "^2.0.1", + "jshint": "^2.9.3", + "jshint-stylish": "^2.2.1", + "mocha": "^3.1.0" + }, + "directories": {}, + "dist": { + "shasum": "1eade7acc012034ad84e2396767ead9fa5495821", + "tarball": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz" + }, + "files": [ + "lib/" + ], + "gitHead": "6be6a70e250e6fbbf42db75cd1f6a1aadeeeeb07", + "homepage": "http://json5.org/", + "keywords": [ + "json", + "es5" + ], + "license": "MIT", + "main": "lib/json5.js", + "maintainers": [ + { + "name": "aseemk", + "email": "aseem.kishore@gmail.com" + }, + { + "name": "jordanbtucker", + "email": "jordanbtucker@gmail.com" + } + ], + "name": "json5", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/aseemk/json5.git" + }, + "scripts": { + "build": "node ./lib/cli.js -c package.json5", + "test": "mocha --ui exports --reporter spec" + }, + "version": "0.5.1" +} diff --git a/node_modules/jsonify/README.markdown b/node_modules/jsonify/README.markdown new file mode 100755 index 00000000..71d9a93b --- /dev/null +++ b/node_modules/jsonify/README.markdown @@ -0,0 +1,34 @@ +jsonify +======= + +This module provides Douglas Crockford's JSON implementation without modifying +any globals. + +`stringify` and `parse` are merely exported without respect to whether or not a +global `JSON` object exists. + +methods +======= + +var json = require('jsonify'); + +json.parse(source, reviver) +--------------------------- + +Return a new javascript object from a parse of the `source` string. + +If a `reviver` function is specified, walk the structure passing each name/value +pair to `reviver.call(parent, key, value)` to transform the `value` before +parsing it. + +json.stringify(value, replacer, space) +-------------------------------------- + +Return a string representation for `value`. + +If `replacer` is specified, walk the structure passing each name/value pair to +`replacer.call(parent, key, value)` to transform the `value` before stringifying +it. + +If `space` is a number, indent the result by that many spaces. +If `space` is a string, use `space` as the indentation. diff --git a/node_modules/jsonify/index.js b/node_modules/jsonify/index.js new file mode 100755 index 00000000..f728a160 --- /dev/null +++ b/node_modules/jsonify/index.js @@ -0,0 +1,2 @@ +exports.parse = require('./lib/parse'); +exports.stringify = require('./lib/stringify'); diff --git a/node_modules/jsonify/lib/parse.js b/node_modules/jsonify/lib/parse.js new file mode 100755 index 00000000..30e2f014 --- /dev/null +++ b/node_modules/jsonify/lib/parse.js @@ -0,0 +1,273 @@ +var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + +value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } +}; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + +module.exports = function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + + // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; +}; diff --git a/node_modules/jsonify/lib/stringify.js b/node_modules/jsonify/lib/stringify.js new file mode 100755 index 00000000..13458708 --- /dev/null +++ b/node_modules/jsonify/lib/stringify.js @@ -0,0 +1,154 @@ +var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + +function quote(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; +} + +function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } +} + +module.exports = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); +}; diff --git a/node_modules/jsonify/package.json b/node_modules/jsonify/package.json new file mode 100755 index 00000000..637e1465 --- /dev/null +++ b/node_modules/jsonify/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + { + "raw": "jsonify@~0.0.0", + "scope": null, + "escapedName": "jsonify", + "name": "jsonify", + "rawSpec": "~0.0.0", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/shell-quote" + ] + ], + "_defaultsLoaded": true, + "_engineSupported": true, + "_from": "jsonify@>=0.0.0 <0.1.0", + "_id": "jsonify@0.0.0", + "_inCache": true, + "_location": "/jsonify", + "_nodeVersion": "v0.5.0-pre", + "_npmVersion": "1.0.10", + "_phantomChildren": {}, + "_requested": { + "raw": "jsonify@~0.0.0", + "scope": null, + "escapedName": "jsonify", + "name": "jsonify", + "rawSpec": "~0.0.0", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/shell-quote" + ], + "_resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "_shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", + "_shrinkwrap": null, + "_spec": "jsonify@~0.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/shell-quote", + "author": { + "name": "Douglas Crockford", + "url": "http://crockford.com/" + }, + "bugs": { + "url": "https://github.com/substack/jsonify/issues" + }, + "dependencies": {}, + "description": "JSON without touching any globals", + "devDependencies": { + "garbage": "0.0.x", + "tap": "0.0.x" + }, + "directories": { + "lib": ".", + "test": "test" + }, + "dist": { + "shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", + "tarball": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/substack/jsonify#readme", + "keywords": [ + "json", + "browser" + ], + "license": "Public Domain", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "jsonify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/jsonify.git" + }, + "scripts": { + "test": "tap test" + }, + "version": "0.0.0" +} diff --git a/node_modules/jsonify/test/parse.js b/node_modules/jsonify/test/parse.js new file mode 100755 index 00000000..e2313f55 --- /dev/null +++ b/node_modules/jsonify/test/parse.js @@ -0,0 +1,16 @@ +var test = require('tap').test; +var json = require('../'); +var garbage = require('garbage'); + +test('parse', function (t) { + for (var i = 0; i < 50; i++) { + var s = JSON.stringify(garbage(50)); + + t.deepEqual( + json.parse(s), + JSON.parse(s) + ); + } + + t.end(); +}); diff --git a/node_modules/jsonify/test/stringify.js b/node_modules/jsonify/test/stringify.js new file mode 100755 index 00000000..89b0b670 --- /dev/null +++ b/node_modules/jsonify/test/stringify.js @@ -0,0 +1,15 @@ +var test = require('tap').test; +var json = require('../'); +var garbage = require('garbage'); + +test('stringify', function (t) { + for (var i = 0; i < 50; i++) { + var obj = garbage(50); + t.equal( + json.stringify(obj), + JSON.stringify(obj) + ); + } + + t.end(); +}); diff --git a/node_modules/kind-of/LICENSE b/node_modules/kind-of/LICENSE new file mode 100755 index 00000000..39245ac1 --- /dev/null +++ b/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/kind-of/README.md b/node_modules/kind-of/README.md new file mode 100755 index 00000000..193d3283 --- /dev/null +++ b/node_modules/kind-of/README.md @@ -0,0 +1,258 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +## Install + +Install with [bower](http://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` + +## About + +### Related projects + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
      | +| --- | --- | +| 49 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [pdehaan](https://github.com/pdehaan) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/kind-of/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 07, 2016._ \ No newline at end of file diff --git a/node_modules/kind-of/index.js b/node_modules/kind-of/index.js new file mode 100755 index 00000000..85083862 --- /dev/null +++ b/node_modules/kind-of/index.js @@ -0,0 +1,116 @@ +var isBuffer = require('is-buffer'); +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + // primitivies + if (typeof val === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (typeof val === 'string' || val instanceof String) { + return 'string'; + } + if (typeof val === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (typeof val === 'function' || val instanceof Function) { + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + var type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + + // buffer + if (typeof Buffer !== 'undefined' && isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; diff --git a/node_modules/kind-of/package.json b/node_modules/kind-of/package.json new file mode 100755 index 00000000..6f59c0d8 --- /dev/null +++ b/node_modules/kind-of/package.json @@ -0,0 +1,176 @@ +{ + "_args": [ + [ + { + "raw": "kind-of@^3.0.2", + "scope": null, + "escapedName": "kind-of", + "name": "kind-of", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/align-text" + ] + ], + "_from": "kind-of@>=3.0.2 <4.0.0", + "_id": "kind-of@3.1.0", + "_inCache": true, + "_location": "/kind-of", + "_nodeVersion": "6.7.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/kind-of-3.1.0.tgz_1481093733086_0.6179714468307793" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "kind-of@^3.0.2", + "scope": null, + "escapedName": "kind-of", + "name": "kind-of", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/align-text", + "/is-number", + "/micromatch", + "/randomatic" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz", + "_shasum": "475d698a5e49ff5e53d14e3e732429dc8bf4cf47", + "_shrinkwrap": null, + "_spec": "kind-of@^3.0.2", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/align-text", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "contributors": [ + { + "name": "David Fox-Powell", + "email": "dtothefp@gmail.com", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Miguel Mota", + "email": "miguel@mota.email", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "is-buffer": "^1.0.2" + }, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^0.2.5", + "browserify": "^13.1.0", + "glob": "^7.0.5", + "gulp-format-md": "^0.1.9", + "mocha": "^2.5.3", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "475d698a5e49ff5e53d14e3e732429dc8bf4cf47", + "tarball": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "eb57ad426b39f25902260f315a1f4ae50d2f760e", + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "kind-of", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.1.0" +} diff --git a/node_modules/lazy-cache/LICENSE b/node_modules/lazy-cache/LICENSE new file mode 100755 index 00000000..1e49edf8 --- /dev/null +++ b/node_modules/lazy-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/lazy-cache/README.md b/node_modules/lazy-cache/README.md new file mode 100755 index 00000000..33b5a4dd --- /dev/null +++ b/node_modules/lazy-cache/README.md @@ -0,0 +1,147 @@ +# lazy-cache [![NPM version](https://img.shields.io/npm/v/lazy-cache.svg?style=flat)](https://www.npmjs.com/package/lazy-cache) [![NPM downloads](https://img.shields.io/npm/dm/lazy-cache.svg?style=flat)](https://npmjs.org/package/lazy-cache) [![Build Status](https://img.shields.io/travis/jonschlinkert/lazy-cache.svg?style=flat)](https://travis-ci.org/jonschlinkert/lazy-cache) + +> Cache requires to be lazy-loaded when needed. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install lazy-cache --save +``` + +If you use webpack and are experiencing issues, try using [unlazy-loader](https://github.com/doowb/unlazy-loader), a webpack loader that fixes the bug that prevents webpack from working with native javascript getters. + +## Usage + +```js +var utils = require('lazy-cache')(require); +``` + +**Use as a property on `lazy`** + +The module is also added as a property to the `lazy` function +so it can be called without having to call a function first. + +```js +var utils = require('lazy-cache')(require); + +// `npm install glob` +utils('glob'); + +// glob sync +console.log(utils.glob.sync('*.js')); + +// glob async +utils.glob('*.js', function (err, files) { + console.log(files); +}); +``` + +**Use as a function** + +```js +var utils = require('lazy-cache')(require); +var glob = utils('glob'); + +// `glob` is a now a function that may be called when needed +glob().sync('foo/*.js'); +``` + +## Aliases + +An alias may be passed as the second argument if you don't want to use the automatically camel-cased variable name. + +**Example** + +```js +var utils = require('lazy-cache')(require); + +// alias `ansi-yellow` as `yellow` +utils('ansi-yellow', 'yellow'); +console.log(utils.yellow('foo')); +``` + +## Browserify usage + +**Example** + +```js +var utils = require('lazy-cache')(require); +// temporarily re-assign `require` to trick browserify +var fn = require; +require = utils; +// list module dependencies (here, `require` is actually `lazy-cache`) +require('glob'); +require = fn; // restore the native `require` function + +/** + * Now you can use glob with the `utils.glob` variable + */ + +// sync +console.log(utils.glob.sync('*.js')); + +// async +utils.glob('*.js', function (err, files) { + console.log(files.join('\n')); +}); +``` + +## Kill switch + +In certain rare edge cases it may be necessary to unlazy all lazy-cached dependencies (5 reported cases after ~30 million downloads). + +To force lazy-cache to immediately invoke all dependencies, do: + +```js +process.env.UNLAZY = true; +``` + +## Related projects + +You might also be interested in these projects: + +[lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/lazy-cache/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/lazy-cache/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 22, 2016._ \ No newline at end of file diff --git a/node_modules/lazy-cache/index.js b/node_modules/lazy-cache/index.js new file mode 100755 index 00000000..da7897d0 --- /dev/null +++ b/node_modules/lazy-cache/index.js @@ -0,0 +1,67 @@ +'use strict'; + +/** + * Cache results of the first function call to ensure only calling once. + * + * ```js + * var utils = require('lazy-cache')(require); + * // cache the call to `require('ansi-yellow')` + * utils('ansi-yellow', 'yellow'); + * // use `ansi-yellow` + * console.log(utils.yellow('this is yellow')); + * ``` + * + * @param {Function} `fn` Function that will be called only once. + * @return {Function} Function that can be called to get the cached function + * @api public + */ + +function lazyCache(fn) { + var cache = {}; + var proxy = function(mod, name) { + name = name || camelcase(mod); + + // check both boolean and string in case `process.env` cases to string + if (process.env.UNLAZY === 'true' || process.env.UNLAZY === true || process.env.TRAVIS) { + cache[name] = fn(mod); + } + + Object.defineProperty(proxy, name, { + enumerable: true, + configurable: true, + get: getter + }); + + function getter() { + if (cache.hasOwnProperty(name)) { + return cache[name]; + } + return (cache[name] = fn(mod)); + } + return getter; + }; + return proxy; +} + +/** + * Used to camelcase the name to be stored on the `lazy` object. + * + * @param {String} `str` String containing `_`, `.`, `-` or whitespace that will be camelcased. + * @return {String} camelcased string. + */ + +function camelcase(str) { + if (str.length === 1) { + return str.toLowerCase(); + } + str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase(); + return str.replace(/[\W_]+(\w|$)/g, function(_, ch) { + return ch.toUpperCase(); + }); +} + +/** + * Expose `lazyCache` + */ + +module.exports = lazyCache; diff --git a/node_modules/lazy-cache/package.json b/node_modules/lazy-cache/package.json new file mode 100755 index 00000000..42fe0212 --- /dev/null +++ b/node_modules/lazy-cache/package.json @@ -0,0 +1,129 @@ +{ + "_args": [ + [ + { + "raw": "lazy-cache@^1.0.3", + "scope": null, + "escapedName": "lazy-cache", + "name": "lazy-cache", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/center-align" + ] + ], + "_from": "lazy-cache@>=1.0.3 <2.0.0", + "_id": "lazy-cache@1.0.4", + "_inCache": true, + "_location": "/lazy-cache", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lazy-cache-1.0.4.tgz_1461378859142_0.0996799839194864" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "raw": "lazy-cache@^1.0.3", + "scope": null, + "escapedName": "lazy-cache", + "name": "lazy-cache", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/center-align" + ], + "_resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "_shasum": "a1d78fc3a50474cb80845d3b3b6e1da49a446e8e", + "_shrinkwrap": null, + "_spec": "lazy-cache@^1.0.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/center-align", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/lazy-cache/issues" + }, + "dependencies": {}, + "description": "Cache requires to be lazy-loaded when needed.", + "devDependencies": { + "ansi-yellow": "^0.1.1", + "glob": "^7.0.3", + "gulp-format-md": "^0.1.8", + "mocha": "^2.4.5" + }, + "directories": {}, + "dist": { + "shasum": "a1d78fc3a50474cb80845d3b3b6e1da49a446e8e", + "tarball": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "d081ffbda147391083a6856fafb1c5d82308f80c", + "homepage": "https://github.com/jonschlinkert/lazy-cache", + "keywords": [ + "cache", + "caching", + "dependencies", + "dependency", + "lazy", + "require", + "requires" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "lazy-cache", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/lazy-cache.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "lint-deps" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "1.0.4" +} diff --git a/node_modules/loader-utils/LICENSE b/node_modules/loader-utils/LICENSE new file mode 100755 index 00000000..c4bdf1b8 --- /dev/null +++ b/node_modules/loader-utils/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 - 2015 Tobias Koppers + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/loader-utils/README.md b/node_modules/loader-utils/README.md new file mode 100755 index 00000000..305fa902 --- /dev/null +++ b/node_modules/loader-utils/README.md @@ -0,0 +1,217 @@ +# loader-utils + +## Methods + +### `getLoaderConfig` + +Recommended way to retrieve the loader config: + +```javascript +// inside your loader +config = loaderUtils.getLoaderConfig(this, "myLoader"); +``` + +Tries to read the loader config from the `webpack.config.js` under the given property name (`"myLoader"` in this case) and merges the result with the loader query. For example, if your `webpack.config.js` had this property... + +```javascript +cheesecakeLoader: { + type: "delicious", + slices: 4 +} +``` + +...and your loader was called with `?slices=8`, `getLoaderConfig(this, "cheesecakeLoader")` would return + +```javascript +{ + type: "delicious", + slices: 8 +} +``` + +It is recommended that you use the camelCased loader name as your default config property name. + +### `parseQuery` + +``` javascript +var query = loaderUtils.parseQuery(this.query); +assert(typeof query == "object"); +if(query.flag) + // ... +``` + +``` text +null -> {} +? -> {} +?flag -> { flag: true } +?+flag -> { flag: true } +?-flag -> { flag: false } +?xyz=test -> { xyz: "test" } +?xyz[]=a -> { xyz: ["a"] } +?flag1&flag2 -> { flag1: true, flag2: true } +?+flag1,-flag2 -> { flag1: true, flag2: false } +?xyz[]=a,xyz[]=b -> { xyz: ["a", "b"] } +?a%2C%26b=c%2C%26d -> { "a,&b": "c,&d" } +?{json:5,data:{a:1}} -> { json: 5, data: { a: 1 } } +``` + +### `stringifyRequest` + +Turns a request into a string that can be used inside `require()` or `import` while avoiding absolute paths. +Use it instead of `JSON.stringify(...)` if you're generating code inside a loader. + +**Why is this necessary?** Since webpack calculates the hash before module paths are translated into module ids, we must avoid absolute paths to ensure +consistent hashes across different compilations. + +This function: + +- resolves absolute requests into relative requests if the request and the module are on the same hard drive +- replaces `\` with `/` if the request and the module are on the same hard drive +- won't change the path at all if the request and the module are on different hard drives +- applies `JSON.stringify` to the result + +```javascript +loaderUtils.stringifyRequest(this, "./test.js"); +// "\"./test.js\"" + +loaderUtils.stringifyRequest(this, ".\\test.js"); +// "\"./test.js\"" + +loaderUtils.stringifyRequest(this, "test"); +// "\"test\"" + +loaderUtils.stringifyRequest(this, "test/lib/index.js"); +// "\"test/lib/index.js\"" + +loaderUtils.stringifyRequest(this, "otherLoader?andConfig!test?someConfig"); +// "\"otherLoader?andConfig!test?someConfig\"" + +loaderUtils.stringifyRequest(this, require.resolve("test")); +// "\"../node_modules/some-loader/lib/test.js\"" + +loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); +// "\"../../test.js\"" (on Windows, in case the module and the request are on the same drive) + +loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); +// "\"C:\\module\\test.js\"" (on Windows, in case the module and the request are on different drives) + +loaderUtils.stringifyRequest(this, "\\\\network-drive\\test.js"); +// "\"\\\\network-drive\\\\test.js\"" (on Windows, in case the module and the request are on different drives) +``` + +### `urlToRequest` + +Converts some resource URL to a webpack module request. + +```javascript +var url = "path/to/module.js"; +var request = loaderUtils.urlToRequest(url); // "./path/to/module.js" +``` + +#### Module URLs + +Any URL containing a `~` will be interpreted as a module request. Anything after the `~` will be considered the request path. + +```javascript +var url = "~path/to/module.js"; +var request = loaderUtils.urlToRequest(url); // "path/to/module.js" +``` + +#### Root-relative URLs + +URLs that are root-relative (start with `/`) can be resolved relative to some arbitrary path by using the `root` parameter: + +```javascript +var url = "/path/to/module.js"; +var root = "./root"; +var request = loaderUtils.urlToRequest(url, root); // "./root/path/to/module.js" +``` + +To convert a root-relative URL into a module URL, specify a `root` value that starts with `~`: + +```javascript +var url = "/path/to/module.js"; +var root = "~"; +var request = loaderUtils.urlToRequest(url, root); // "path/to/module.js" +``` + +### `interpolateName` + +Interpolates a filename template using multiple placeholders and/or a regular expression. +The template and regular expression are set as query params called `name` and `regExp` on the current loader's context. + +```javascript +var interpolatedName = loaderUtils.interpolateName(loaderContext, name, options); +``` + +The following tokens are replaced in the `name` parameter: + +* `[ext]` the extension of the resource +* `[name]` the basename of the resource +* `[path]` the path of the resource relative to the `context` query parameter or option. +* `[folder]` the folder of the resource is in. +* `[emoji]` a random emoji representation of `options.content` +* `[emoji:]` same as above, but with a customizable number of emojis +* `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the md5 hash) +* `[:hash::]` optionally one can configure + * other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512` + * other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` + * and `length` the length in chars +* `[N]` the N-th match obtained from matching the current file name against `options.regExp` + +Examples + +``` javascript +// loaderContext.resourcePath = "/app/js/javascript.js" +loaderUtils.interpolateName(loaderContext, "js/[hash].script.[ext]", { content: ... }); +// => js/9473fdd0d880a43c21b7778d34872157.script.js + +// loaderContext.resourcePath = "/app/page.html" +loaderUtils.interpolateName(loaderContext, "html-[hash:6].html", { content: ... }); +// => html-9473fd.html + +// loaderContext.resourcePath = "/app/flash.txt" +loaderUtils.interpolateName(loaderContext, "[hash]", { content: ... }); +// => c31e9820c001c9c4a86bce33ce43b679 + +// loaderContext.resourcePath = "/app/img/image.gif" +loaderUtils.interpolateName(loaderContext, "[emoji]", { content: ... }); +// => 👍 + +// loaderContext.resourcePath = "/app/img/image.gif" +loaderUtils.interpolateName(loaderContext, "[emoji:4]", { content: ... }); +// => 🙍🏢📤🐝 + +// loaderContext.resourcePath = "/app/img/image.png" +loaderUtils.interpolateName(loaderContext, "[sha512:hash:base64:7].[ext]", { content: ... }); +// => 2BKDTjl.png +// use sha512 hash instead of md5 and with only 7 chars of base64 + +// loaderContext.resourcePath = "/app/img/myself.png" +// loaderContext.query.name = +loaderUtils.interpolateName(loaderContext, "picture.png"); +// => picture.png + +// loaderContext.resourcePath = "/app/dir/file.png" +loaderUtils.interpolateName(loaderContext, "[path][name].[ext]?[hash]", { content: ... }); +// => /app/dir/file.png?9473fdd0d880a43c21b7778d34872157 + +// loaderContext.resourcePath = "/app/js/page-home.js" +loaderUtils.interpolateName(loaderContext, "script-[1].[ext]", { regExp: "page-(.*)\\.js", content: ... }); +// => script-home.js +``` + +### `getHashDigest` + +``` javascript +var digestString = loaderUtils.getHashDigest(buffer, hashType, digestType, maxLength); +``` + +* `buffer` the content that should be hashed +* `hashType` one of `sha1`, `md5`, `sha256`, `sha512` or any other node.js supported hash type +* `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` +* `maxLength` the maximum length in chars + +## License + +MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/loader-utils/index.js b/node_modules/loader-utils/index.js new file mode 100755 index 00000000..49e1d18f --- /dev/null +++ b/node_modules/loader-utils/index.js @@ -0,0 +1,331 @@ +var JSON5 = require("json5"); +var path = require("path"); +var util = require("util"); +var os = require("os"); +var assign = require("object-assign"); +var emojiRegex = /[\uD800-\uDFFF]./; +var emojiList = require("emojis-list").filter(function(emoji) { + return emojiRegex.test(emoji) +}); +var matchAbsolutePath = /^\/|^[A-Z]:[/\\]|^\\\\/i; // node 0.10 does not support path.isAbsolute() +var matchAbsoluteWin32Path = /^[A-Z]:[/\\]|^\\\\/i; +var matchRelativePath = /^\.\.?[/\\]/; + +var baseEncodeTables = { + 26: "abcdefghijklmnopqrstuvwxyz", + 32: "123456789abcdefghjkmnpqrstuvwxyz", // no 0lio + 36: "0123456789abcdefghijklmnopqrstuvwxyz", + 49: "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no lIO + 52: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 58: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", // no 0lIO + 62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + 64: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_" +}; +var emojiCache = {}; +var parseQueryDeprecationWarning = util.deprecate(function() {}, + "loaderUtils.parseQuery() received a non-string value which can be problematic, " + + "see https://github.com/webpack/loader-utils/issues/56" + os.EOL + + "parseQuery() will be replaced with getOptions() in the next major version of loader-utils." +); + +function encodeStringToEmoji(content, length) { + if (emojiCache[content]) return emojiCache[content]; + length = length || 1; + var emojis = []; + do { + var index = Math.floor(Math.random() * emojiList.length); + emojis.push(emojiList[index]); + emojiList.splice(index, 1); + } while (--length > 0); + var emojiEncoding = emojis.join(''); + emojiCache[content] = emojiEncoding; + return emojiEncoding; +} + +function encodeBufferToBase(buffer, base) { + var encodeTable = baseEncodeTables[base]; + if (!encodeTable) throw new Error("Unknown encoding base" + base); + + var readLength = buffer.length; + + var Big = require('big.js'); + Big.RM = Big.DP = 0; + var b = new Big(0); + for (var i = readLength - 1; i >= 0; i--) { + b = b.times(256).plus(buffer[i]); + } + + var output = ""; + while (b.gt(0)) { + output = encodeTable[b.mod(base)] + output; + b = b.div(base); + } + + Big.DP = 20; + Big.RM = 1; + + return output; +} + +exports.parseQuery = function parseQuery(query) { + var specialValues = { + 'null': null, + 'true': true, + 'false': false + }; + if(!query) return {}; + if(typeof query !== "string") { + parseQueryDeprecationWarning(); + return query; + } + if(query.substr(0, 1) !== "?") + throw new Error("a valid query string passed to parseQuery should begin with '?'"); + query = query.substr(1); + var queryLength = query.length; + if(query.substr(0, 1) === "{" && query.substr(-1) === "}") { + return JSON5.parse(query); + } + var queryArgs = query.split(/[,\&]/g); + var result = {}; + queryArgs.forEach(function(arg) { + var idx = arg.indexOf("="); + if(idx >= 0) { + var name = arg.substr(0, idx); + var value = decodeURIComponent(arg.substr(idx+1)); + if (specialValues.hasOwnProperty(value)) { + value = specialValues[value]; + } + if(name.substr(-2) === "[]") { + name = decodeURIComponent(name.substr(0, name.length-2)); + if(!Array.isArray(result[name])) + result[name] = []; + result[name].push(value); + } else { + name = decodeURIComponent(name); + result[name] = value; + } + } else { + if(arg.substr(0, 1) === "-") { + result[decodeURIComponent(arg.substr(1))] = false; + } else if(arg.substr(0, 1) === "+") { + result[decodeURIComponent(arg.substr(1))] = true; + } else { + result[decodeURIComponent(arg)] = true; + } + } + }); + return result; +}; + +exports.getLoaderConfig = function(loaderContext, defaultConfigKey) { + var query = exports.parseQuery(loaderContext.query); + var configKey = query.config || defaultConfigKey; + if (configKey) { + var config = loaderContext.options[configKey] || {}; + delete query.config; + return assign({}, config, query); + } + + return query; +}; + +exports.stringifyRequest = function(loaderContext, request) { + var splitted = request.split("!"); + var context = loaderContext.context || (loaderContext.options && loaderContext.options.context); + return JSON.stringify(splitted.map(function(part) { + // First, separate singlePath from query, because the query might contain paths again + var splittedPart = part.match(/^(.*?)(\?.*)/); + var singlePath = splittedPart ? splittedPart[1] : part; + var query = splittedPart ? splittedPart[2] : ""; + if(matchAbsolutePath.test(singlePath) && context) { + singlePath = path.relative(context, singlePath); + if(matchAbsolutePath.test(singlePath)) { + // If singlePath still matches an absolute path, singlePath was on a different drive than context. + // In this case, we leave the path platform-specific without replacing any separators. + // @see https://github.com/webpack/loader-utils/pull/14 + return singlePath + query; + } + if(matchRelativePath.test(singlePath) === false) { + // Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules). + singlePath = "./" + singlePath; + } + } + return singlePath.replace(/\\/g, "/") + query; + }).join("!")); +}; + +function dotRequest(obj) { + return obj.request; +} + +exports.getRemainingRequest = function(loaderContext) { + if(loaderContext.remainingRequest) + return loaderContext.remainingRequest; + var request = loaderContext.loaders.slice(loaderContext.loaderIndex+1).map(dotRequest).concat([loaderContext.resource]); + return request.join("!"); +}; + +exports.getCurrentRequest = function(loaderContext) { + if(loaderContext.currentRequest) + return loaderContext.currentRequest; + var request = loaderContext.loaders.slice(loaderContext.loaderIndex).map(dotRequest).concat([loaderContext.resource]); + return request.join("!"); +}; + +exports.isUrlRequest = function(url, root) { + // An URL is not an request if + // 1. it's a Data Url + // 2. it's an absolute url or and protocol-relative + // 3. it's some kind of url for a template + if(/^data:|^chrome-extension:|^(https?:)?\/\/|^[\{\}\[\]#*;,'§\$%&\(=?`´\^°<>]/.test(url)) return false; + // 4. It's also not an request if root isn't set and it's a root-relative url + if((root === undefined || root === false) && /^\//.test(url)) return false; + return true; +}; + +exports.urlToRequest = function(url, root) { + var moduleRequestRegex = /^[^?]*~/; + var request; + + if(matchAbsoluteWin32Path.test(url)) { + // absolute windows path, keep it + request = url; + } else if(root !== undefined && root !== false && /^\//.test(url)) { + // if root is set and the url is root-relative + switch(typeof root) { + // 1. root is a string: root is prefixed to the url + case "string": + // special case: `~` roots convert to module request + if (moduleRequestRegex.test(root)) { + request = root.replace(/([^~\/])$/, "$1/") + url.slice(1); + } else { + request = root + url; + } + break; + // 2. root is `true`: absolute paths are allowed + // *nix only, windows-style absolute paths are always allowed as they doesn't start with a `/` + case "boolean": + request = url; + break; + default: + throw new Error("Unexpected parameters to loader-utils 'urlToRequest': url = " + url + ", root = " + root + "."); + } + } else if(/^\.\.?\//.test(url)) { + // A relative url stays + request = url; + } else { + // every other url is threaded like a relative url + request = "./" + url; + } + + // A `~` makes the url an module + if (moduleRequestRegex.test(request)) { + request = request.replace(moduleRequestRegex, ""); + } + + return request; +}; + +exports.parseString = function parseString(str) { + try { + if(str[0] === '"') return JSON.parse(str); + if(str[0] === "'" && str.substr(str.length - 1) === "'") { + return parseString(str.replace(/\\.|"/g, function(x) { + if(x === '"') return '\\"'; + return x; + }).replace(/^'|'$/g, '"')); + } + return JSON.parse('"' + str + '"'); + } catch(e) { + return str; + } +}; + +exports.getHashDigest = function getHashDigest(buffer, hashType, digestType, maxLength) { + hashType = hashType || "md5"; + maxLength = maxLength || 9999; + var hash = require("crypto").createHash(hashType); + hash.update(buffer); + if (digestType === "base26" || digestType === "base32" || digestType === "base36" || + digestType === "base49" || digestType === "base52" || digestType === "base58" || + digestType === "base62" || digestType === "base64") { + return encodeBufferToBase(hash.digest(), digestType.substr(4)).substr(0, maxLength); + } else { + return hash.digest(digestType || "hex").substr(0, maxLength); + } +}; + +exports.interpolateName = function interpolateName(loaderContext, name, options) { + var filename; + if (typeof name === "function") { + filename = name(loaderContext.resourcePath); + } else { + filename = name || "[hash].[ext]"; + } + var context = options.context; + var content = options.content; + var regExp = options.regExp; + var ext = "bin"; + var basename = "file"; + var directory = ""; + var folder = ""; + if(loaderContext.resourcePath) { + var resourcePath = loaderContext.resourcePath; + var idx = resourcePath.lastIndexOf("."); + var i = resourcePath.lastIndexOf("\\"); + var j = resourcePath.lastIndexOf("/"); + var p = i < 0 ? j : j < 0 ? i : i < j ? i : j; + if(idx >= 0) { + ext = resourcePath.substr(idx+1); + resourcePath = resourcePath.substr(0, idx); + } + if(p >= 0) { + basename = resourcePath.substr(p+1); + resourcePath = resourcePath.substr(0, p+1); + } + if (typeof context !== 'undefined') { + directory = path.relative(context, resourcePath + "_").replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + directory = directory.substr(0, directory.length-1); + } + else { + directory = resourcePath.replace(/\\/g, "/").replace(/\.\.(\/)?/g, "_$1"); + } + if (directory.length === 1) { + directory = ""; + } else if (directory.length > 1) { + folder = path.basename(directory); + } + } + var url = filename; + if(content) { + // Match hash template + url = url.replace(/\[(?:(\w+):)?hash(?::([a-z]+\d*))?(?::(\d+))?\]/ig, function() { + return exports.getHashDigest(content, arguments[1], arguments[2], parseInt(arguments[3], 10)); + }).replace(/\[emoji(?::(\d+))?\]/ig, function() { + return encodeStringToEmoji(content, arguments[1]); + }); + } + url = url.replace(/\[ext\]/ig, function() { + return ext; + }).replace(/\[name\]/ig, function() { + return basename; + }).replace(/\[path\]/ig, function() { + return directory; + }).replace(/\[folder\]/ig, function() { + return folder; + }); + if(regExp && loaderContext.resourcePath) { + var re = new RegExp(regExp); + var match = loaderContext.resourcePath.match(re); + if(match) { + for (var i = 0; i < match.length; i++) { + var re = new RegExp("\\[" + i + "\\]", "ig"); + url = url.replace(re, match[i]); + } + } + } + if(typeof loaderContext.options === "object" && typeof loaderContext.options.customInterpolateName === "function") { + url = loaderContext.options.customInterpolateName.call(loaderContext, url, name, options); + } + return url; +}; diff --git a/node_modules/loader-utils/package.json b/node_modules/loader-utils/package.json new file mode 100755 index 00000000..0e88fc0d --- /dev/null +++ b/node_modules/loader-utils/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "loader-utils@^0.2.16", + "scope": null, + "escapedName": "loader-utils", + "name": "loader-utils", + "rawSpec": "^0.2.16", + "spec": ">=0.2.16 <0.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-loader" + ] + ], + "_from": "loader-utils@>=0.2.16 <0.3.0", + "_id": "loader-utils@0.2.17", + "_inCache": true, + "_location": "/loader-utils", + "_nodeVersion": "7.1.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/loader-utils-0.2.17.tgz_1487631410094_0.04626395273953676" + }, + "_npmUser": { + "name": "jhnns", + "email": "mail@johannesewald.de" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "loader-utils@^0.2.16", + "scope": null, + "escapedName": "loader-utils", + "name": "loader-utils", + "rawSpec": "^0.2.16", + "spec": ">=0.2.16 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-loader", + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "_shasum": "f86e6374d43205a6e6c60e9196f17c0299bfb348", + "_shrinkwrap": null, + "_spec": "loader-utils@^0.2.16", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-loader", + "author": { + "name": "Tobias Koppers @sokra" + }, + "bugs": { + "url": "https://github.com/webpack/loader-utils/issues" + }, + "dependencies": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + }, + "description": "utils for webpack loaders", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.14", + "mocha": "^1.21.4" + }, + "directories": {}, + "dist": { + "shasum": "f86e6374d43205a6e6c60e9196f17c0299bfb348", + "tarball": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "00b9d0848bd7216e184beacbf6582dc5ee51ff80", + "homepage": "https://github.com/webpack/loader-utils#readme", + "license": "MIT", + "maintainers": [ + { + "name": "jhnns", + "email": "mail@johannesewald.de" + }, + { + "name": "sokra", + "email": "tobias.koppers@googlemail.com" + } + ], + "name": "loader-utils", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/webpack/loader-utils.git" + }, + "scripts": { + "cover": "istanbul cover -x *.runtime.js node_modules/mocha/bin/_mocha", + "publish-patch": "mocha && npm version patch && git push && git push --tags && npm publish", + "test": "mocha", + "travis": "npm run cover -- --report lcovonly" + }, + "version": "0.2.17" +} diff --git a/node_modules/lodash/LICENSE b/node_modules/lodash/LICENSE new file mode 100755 index 00000000..c6f2f614 --- /dev/null +++ b/node_modules/lodash/LICENSE @@ -0,0 +1,47 @@ +Copyright JS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash/README.md b/node_modules/lodash/README.md new file mode 100755 index 00000000..acdd128c --- /dev/null +++ b/node_modules/lodash/README.md @@ -0,0 +1,39 @@ +# lodash v4.17.4 + +The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. + +## Installation + +Using npm: +```shell +$ npm i -g npm +$ npm i --save lodash +``` + +In Node.js: +```js +// Load the full build. +var _ = require('lodash'); +// Load the core build. +var _ = require('lodash/core'); +// Load the FP build for immutable auto-curried iteratee-first data-last methods. +var fp = require('lodash/fp'); + +// Load method categories. +var array = require('lodash/array'); +var object = require('lodash/fp/object'); + +// Cherry-pick methods for smaller browserify/rollup/webpack bundles. +var at = require('lodash/at'); +var curryN = require('lodash/fp/curryN'); +``` + +See the [package source](https://github.com/lodash/lodash/tree/4.17.4-npm) for more details. + +**Note:**
      +Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. + +## Support + +Tested in Chrome 54-55, Firefox 49-50, IE 11, Edge 14, Safari 9-10, Node.js 6-7, & PhantomJS 2.1.1.
      +Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/node_modules/lodash/_DataView.js b/node_modules/lodash/_DataView.js new file mode 100755 index 00000000..ac2d57ca --- /dev/null +++ b/node_modules/lodash/_DataView.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; diff --git a/node_modules/lodash/_Hash.js b/node_modules/lodash/_Hash.js new file mode 100755 index 00000000..b504fe34 --- /dev/null +++ b/node_modules/lodash/_Hash.js @@ -0,0 +1,32 @@ +var hashClear = require('./_hashClear'), + hashDelete = require('./_hashDelete'), + hashGet = require('./_hashGet'), + hashHas = require('./_hashHas'), + hashSet = require('./_hashSet'); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; diff --git a/node_modules/lodash/_LazyWrapper.js b/node_modules/lodash/_LazyWrapper.js new file mode 100755 index 00000000..81786c7f --- /dev/null +++ b/node_modules/lodash/_LazyWrapper.js @@ -0,0 +1,28 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ +function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; +} + +// Ensure `LazyWrapper` is an instance of `baseLodash`. +LazyWrapper.prototype = baseCreate(baseLodash.prototype); +LazyWrapper.prototype.constructor = LazyWrapper; + +module.exports = LazyWrapper; diff --git a/node_modules/lodash/_ListCache.js b/node_modules/lodash/_ListCache.js new file mode 100755 index 00000000..26895c3a --- /dev/null +++ b/node_modules/lodash/_ListCache.js @@ -0,0 +1,32 @@ +var listCacheClear = require('./_listCacheClear'), + listCacheDelete = require('./_listCacheDelete'), + listCacheGet = require('./_listCacheGet'), + listCacheHas = require('./_listCacheHas'), + listCacheSet = require('./_listCacheSet'); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; diff --git a/node_modules/lodash/_LodashWrapper.js b/node_modules/lodash/_LodashWrapper.js new file mode 100755 index 00000000..c1e4d9df --- /dev/null +++ b/node_modules/lodash/_LodashWrapper.js @@ -0,0 +1,22 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ +function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; +} + +LodashWrapper.prototype = baseCreate(baseLodash.prototype); +LodashWrapper.prototype.constructor = LodashWrapper; + +module.exports = LodashWrapper; diff --git a/node_modules/lodash/_Map.js b/node_modules/lodash/_Map.js new file mode 100755 index 00000000..b73f29a0 --- /dev/null +++ b/node_modules/lodash/_Map.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; diff --git a/node_modules/lodash/_MapCache.js b/node_modules/lodash/_MapCache.js new file mode 100755 index 00000000..4a4eea7b --- /dev/null +++ b/node_modules/lodash/_MapCache.js @@ -0,0 +1,32 @@ +var mapCacheClear = require('./_mapCacheClear'), + mapCacheDelete = require('./_mapCacheDelete'), + mapCacheGet = require('./_mapCacheGet'), + mapCacheHas = require('./_mapCacheHas'), + mapCacheSet = require('./_mapCacheSet'); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; diff --git a/node_modules/lodash/_Promise.js b/node_modules/lodash/_Promise.js new file mode 100755 index 00000000..247b9e1b --- /dev/null +++ b/node_modules/lodash/_Promise.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; diff --git a/node_modules/lodash/_Set.js b/node_modules/lodash/_Set.js new file mode 100755 index 00000000..b3c8dcbf --- /dev/null +++ b/node_modules/lodash/_Set.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; diff --git a/node_modules/lodash/_SetCache.js b/node_modules/lodash/_SetCache.js new file mode 100755 index 00000000..6468b064 --- /dev/null +++ b/node_modules/lodash/_SetCache.js @@ -0,0 +1,27 @@ +var MapCache = require('./_MapCache'), + setCacheAdd = require('./_setCacheAdd'), + setCacheHas = require('./_setCacheHas'); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; diff --git a/node_modules/lodash/_Stack.js b/node_modules/lodash/_Stack.js new file mode 100755 index 00000000..80b2cf1b --- /dev/null +++ b/node_modules/lodash/_Stack.js @@ -0,0 +1,27 @@ +var ListCache = require('./_ListCache'), + stackClear = require('./_stackClear'), + stackDelete = require('./_stackDelete'), + stackGet = require('./_stackGet'), + stackHas = require('./_stackHas'), + stackSet = require('./_stackSet'); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; diff --git a/node_modules/lodash/_Symbol.js b/node_modules/lodash/_Symbol.js new file mode 100755 index 00000000..a013f7c5 --- /dev/null +++ b/node_modules/lodash/_Symbol.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; diff --git a/node_modules/lodash/_Uint8Array.js b/node_modules/lodash/_Uint8Array.js new file mode 100755 index 00000000..2fb30e15 --- /dev/null +++ b/node_modules/lodash/_Uint8Array.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; diff --git a/node_modules/lodash/_WeakMap.js b/node_modules/lodash/_WeakMap.js new file mode 100755 index 00000000..567f86c6 --- /dev/null +++ b/node_modules/lodash/_WeakMap.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; diff --git a/node_modules/lodash/_addMapEntry.js b/node_modules/lodash/_addMapEntry.js new file mode 100755 index 00000000..5a692121 --- /dev/null +++ b/node_modules/lodash/_addMapEntry.js @@ -0,0 +1,15 @@ +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +module.exports = addMapEntry; diff --git a/node_modules/lodash/_addSetEntry.js b/node_modules/lodash/_addSetEntry.js new file mode 100755 index 00000000..1a07b708 --- /dev/null +++ b/node_modules/lodash/_addSetEntry.js @@ -0,0 +1,15 @@ +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +module.exports = addSetEntry; diff --git a/node_modules/lodash/_apply.js b/node_modules/lodash/_apply.js new file mode 100755 index 00000000..36436dda --- /dev/null +++ b/node_modules/lodash/_apply.js @@ -0,0 +1,21 @@ +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; diff --git a/node_modules/lodash/_arrayAggregator.js b/node_modules/lodash/_arrayAggregator.js new file mode 100755 index 00000000..d96c3ca4 --- /dev/null +++ b/node_modules/lodash/_arrayAggregator.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; +} + +module.exports = arrayAggregator; diff --git a/node_modules/lodash/_arrayEach.js b/node_modules/lodash/_arrayEach.js new file mode 100755 index 00000000..2c5f5796 --- /dev/null +++ b/node_modules/lodash/_arrayEach.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; diff --git a/node_modules/lodash/_arrayEachRight.js b/node_modules/lodash/_arrayEachRight.js new file mode 100755 index 00000000..976ca5c2 --- /dev/null +++ b/node_modules/lodash/_arrayEachRight.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEachRight; diff --git a/node_modules/lodash/_arrayEvery.js b/node_modules/lodash/_arrayEvery.js new file mode 100755 index 00000000..e26a9184 --- /dev/null +++ b/node_modules/lodash/_arrayEvery.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; diff --git a/node_modules/lodash/_arrayFilter.js b/node_modules/lodash/_arrayFilter.js new file mode 100755 index 00000000..75ea2544 --- /dev/null +++ b/node_modules/lodash/_arrayFilter.js @@ -0,0 +1,25 @@ +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; diff --git a/node_modules/lodash/_arrayIncludes.js b/node_modules/lodash/_arrayIncludes.js new file mode 100755 index 00000000..3737a6d9 --- /dev/null +++ b/node_modules/lodash/_arrayIncludes.js @@ -0,0 +1,17 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; diff --git a/node_modules/lodash/_arrayIncludesWith.js b/node_modules/lodash/_arrayIncludesWith.js new file mode 100755 index 00000000..235fd975 --- /dev/null +++ b/node_modules/lodash/_arrayIncludesWith.js @@ -0,0 +1,22 @@ +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; diff --git a/node_modules/lodash/_arrayLikeKeys.js b/node_modules/lodash/_arrayLikeKeys.js new file mode 100755 index 00000000..b2ec9ce7 --- /dev/null +++ b/node_modules/lodash/_arrayLikeKeys.js @@ -0,0 +1,49 @@ +var baseTimes = require('./_baseTimes'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isIndex = require('./_isIndex'), + isTypedArray = require('./isTypedArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; diff --git a/node_modules/lodash/_arrayMap.js b/node_modules/lodash/_arrayMap.js new file mode 100755 index 00000000..22b22464 --- /dev/null +++ b/node_modules/lodash/_arrayMap.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; diff --git a/node_modules/lodash/_arrayPush.js b/node_modules/lodash/_arrayPush.js new file mode 100755 index 00000000..7d742b38 --- /dev/null +++ b/node_modules/lodash/_arrayPush.js @@ -0,0 +1,20 @@ +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; diff --git a/node_modules/lodash/_arrayReduce.js b/node_modules/lodash/_arrayReduce.js new file mode 100755 index 00000000..de8b79b2 --- /dev/null +++ b/node_modules/lodash/_arrayReduce.js @@ -0,0 +1,26 @@ +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +module.exports = arrayReduce; diff --git a/node_modules/lodash/_arrayReduceRight.js b/node_modules/lodash/_arrayReduceRight.js new file mode 100755 index 00000000..22d8976d --- /dev/null +++ b/node_modules/lodash/_arrayReduceRight.js @@ -0,0 +1,24 @@ +/** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; +} + +module.exports = arrayReduceRight; diff --git a/node_modules/lodash/_arraySample.js b/node_modules/lodash/_arraySample.js new file mode 100755 index 00000000..fcab0105 --- /dev/null +++ b/node_modules/lodash/_arraySample.js @@ -0,0 +1,15 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ +function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; +} + +module.exports = arraySample; diff --git a/node_modules/lodash/_arraySampleSize.js b/node_modules/lodash/_arraySampleSize.js new file mode 100755 index 00000000..8c7e364f --- /dev/null +++ b/node_modules/lodash/_arraySampleSize.js @@ -0,0 +1,17 @@ +var baseClamp = require('./_baseClamp'), + copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); +} + +module.exports = arraySampleSize; diff --git a/node_modules/lodash/_arrayShuffle.js b/node_modules/lodash/_arrayShuffle.js new file mode 100755 index 00000000..46313a39 --- /dev/null +++ b/node_modules/lodash/_arrayShuffle.js @@ -0,0 +1,15 @@ +var copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); +} + +module.exports = arrayShuffle; diff --git a/node_modules/lodash/_arraySome.js b/node_modules/lodash/_arraySome.js new file mode 100755 index 00000000..6fd02fd4 --- /dev/null +++ b/node_modules/lodash/_arraySome.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; diff --git a/node_modules/lodash/_asciiSize.js b/node_modules/lodash/_asciiSize.js new file mode 100755 index 00000000..11d29c33 --- /dev/null +++ b/node_modules/lodash/_asciiSize.js @@ -0,0 +1,12 @@ +var baseProperty = require('./_baseProperty'); + +/** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +var asciiSize = baseProperty('length'); + +module.exports = asciiSize; diff --git a/node_modules/lodash/_asciiToArray.js b/node_modules/lodash/_asciiToArray.js new file mode 100755 index 00000000..8e3dd5b4 --- /dev/null +++ b/node_modules/lodash/_asciiToArray.js @@ -0,0 +1,12 @@ +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +module.exports = asciiToArray; diff --git a/node_modules/lodash/_asciiWords.js b/node_modules/lodash/_asciiWords.js new file mode 100755 index 00000000..d765f0f7 --- /dev/null +++ b/node_modules/lodash/_asciiWords.js @@ -0,0 +1,15 @@ +/** Used to match words composed of alphanumeric characters. */ +var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + +/** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function asciiWords(string) { + return string.match(reAsciiWord) || []; +} + +module.exports = asciiWords; diff --git a/node_modules/lodash/_assignMergeValue.js b/node_modules/lodash/_assignMergeValue.js new file mode 100755 index 00000000..cb1185e9 --- /dev/null +++ b/node_modules/lodash/_assignMergeValue.js @@ -0,0 +1,20 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignMergeValue; diff --git a/node_modules/lodash/_assignValue.js b/node_modules/lodash/_assignValue.js new file mode 100755 index 00000000..40839575 --- /dev/null +++ b/node_modules/lodash/_assignValue.js @@ -0,0 +1,28 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; diff --git a/node_modules/lodash/_assocIndexOf.js b/node_modules/lodash/_assocIndexOf.js new file mode 100755 index 00000000..5b77a2bd --- /dev/null +++ b/node_modules/lodash/_assocIndexOf.js @@ -0,0 +1,21 @@ +var eq = require('./eq'); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; diff --git a/node_modules/lodash/_baseAggregator.js b/node_modules/lodash/_baseAggregator.js new file mode 100755 index 00000000..4bc9e91f --- /dev/null +++ b/node_modules/lodash/_baseAggregator.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; +} + +module.exports = baseAggregator; diff --git a/node_modules/lodash/_baseAssign.js b/node_modules/lodash/_baseAssign.js new file mode 100755 index 00000000..e5c4a1a5 --- /dev/null +++ b/node_modules/lodash/_baseAssign.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keys = require('./keys'); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; diff --git a/node_modules/lodash/_baseAssignIn.js b/node_modules/lodash/_baseAssignIn.js new file mode 100755 index 00000000..6624f900 --- /dev/null +++ b/node_modules/lodash/_baseAssignIn.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keysIn = require('./keysIn'); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; diff --git a/node_modules/lodash/_baseAssignValue.js b/node_modules/lodash/_baseAssignValue.js new file mode 100755 index 00000000..d6f66ef3 --- /dev/null +++ b/node_modules/lodash/_baseAssignValue.js @@ -0,0 +1,25 @@ +var defineProperty = require('./_defineProperty'); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; diff --git a/node_modules/lodash/_baseAt.js b/node_modules/lodash/_baseAt.js new file mode 100755 index 00000000..90e4237a --- /dev/null +++ b/node_modules/lodash/_baseAt.js @@ -0,0 +1,23 @@ +var get = require('./get'); + +/** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ +function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; +} + +module.exports = baseAt; diff --git a/node_modules/lodash/_baseClamp.js b/node_modules/lodash/_baseClamp.js new file mode 100755 index 00000000..a1c56929 --- /dev/null +++ b/node_modules/lodash/_baseClamp.js @@ -0,0 +1,22 @@ +/** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +module.exports = baseClamp; diff --git a/node_modules/lodash/_baseClone.js b/node_modules/lodash/_baseClone.js new file mode 100755 index 00000000..7c27a37d --- /dev/null +++ b/node_modules/lodash/_baseClone.js @@ -0,0 +1,153 @@ +var Stack = require('./_Stack'), + arrayEach = require('./_arrayEach'), + assignValue = require('./_assignValue'), + baseAssign = require('./_baseAssign'), + baseAssignIn = require('./_baseAssignIn'), + cloneBuffer = require('./_cloneBuffer'), + copyArray = require('./_copyArray'), + copySymbols = require('./_copySymbols'), + copySymbolsIn = require('./_copySymbolsIn'), + getAllKeys = require('./_getAllKeys'), + getAllKeysIn = require('./_getAllKeysIn'), + getTag = require('./_getTag'), + initCloneArray = require('./_initCloneArray'), + initCloneByTag = require('./_initCloneByTag'), + initCloneObject = require('./_initCloneObject'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isObject = require('./isObject'), + keys = require('./keys'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; diff --git a/node_modules/lodash/_baseConforms.js b/node_modules/lodash/_baseConforms.js new file mode 100755 index 00000000..947e20d4 --- /dev/null +++ b/node_modules/lodash/_baseConforms.js @@ -0,0 +1,18 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ +function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; +} + +module.exports = baseConforms; diff --git a/node_modules/lodash/_baseConformsTo.js b/node_modules/lodash/_baseConformsTo.js new file mode 100755 index 00000000..e449cb84 --- /dev/null +++ b/node_modules/lodash/_baseConformsTo.js @@ -0,0 +1,27 @@ +/** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ +function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; +} + +module.exports = baseConformsTo; diff --git a/node_modules/lodash/_baseCreate.js b/node_modules/lodash/_baseCreate.js new file mode 100755 index 00000000..ffa6a52a --- /dev/null +++ b/node_modules/lodash/_baseCreate.js @@ -0,0 +1,30 @@ +var isObject = require('./isObject'); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; diff --git a/node_modules/lodash/_baseDelay.js b/node_modules/lodash/_baseDelay.js new file mode 100755 index 00000000..1486d697 --- /dev/null +++ b/node_modules/lodash/_baseDelay.js @@ -0,0 +1,21 @@ +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ +function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); +} + +module.exports = baseDelay; diff --git a/node_modules/lodash/_baseDifference.js b/node_modules/lodash/_baseDifference.js new file mode 100755 index 00000000..343ac19f --- /dev/null +++ b/node_modules/lodash/_baseDifference.js @@ -0,0 +1,67 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; diff --git a/node_modules/lodash/_baseEach.js b/node_modules/lodash/_baseEach.js new file mode 100755 index 00000000..512c0676 --- /dev/null +++ b/node_modules/lodash/_baseEach.js @@ -0,0 +1,14 @@ +var baseForOwn = require('./_baseForOwn'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; diff --git a/node_modules/lodash/_baseEachRight.js b/node_modules/lodash/_baseEachRight.js new file mode 100755 index 00000000..0a8feeca --- /dev/null +++ b/node_modules/lodash/_baseEachRight.js @@ -0,0 +1,14 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEachRight = createBaseEach(baseForOwnRight, true); + +module.exports = baseEachRight; diff --git a/node_modules/lodash/_baseEvery.js b/node_modules/lodash/_baseEvery.js new file mode 100755 index 00000000..fa52f7bc --- /dev/null +++ b/node_modules/lodash/_baseEvery.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; diff --git a/node_modules/lodash/_baseExtremum.js b/node_modules/lodash/_baseExtremum.js new file mode 100755 index 00000000..9d6aa77e --- /dev/null +++ b/node_modules/lodash/_baseExtremum.js @@ -0,0 +1,32 @@ +var isSymbol = require('./isSymbol'); + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +module.exports = baseExtremum; diff --git a/node_modules/lodash/_baseFill.js b/node_modules/lodash/_baseFill.js new file mode 100755 index 00000000..46ef9c76 --- /dev/null +++ b/node_modules/lodash/_baseFill.js @@ -0,0 +1,32 @@ +var toInteger = require('./toInteger'), + toLength = require('./toLength'); + +/** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ +function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; +} + +module.exports = baseFill; diff --git a/node_modules/lodash/_baseFilter.js b/node_modules/lodash/_baseFilter.js new file mode 100755 index 00000000..46784773 --- /dev/null +++ b/node_modules/lodash/_baseFilter.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; diff --git a/node_modules/lodash/_baseFindIndex.js b/node_modules/lodash/_baseFindIndex.js new file mode 100755 index 00000000..e3f5d8aa --- /dev/null +++ b/node_modules/lodash/_baseFindIndex.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; diff --git a/node_modules/lodash/_baseFindKey.js b/node_modules/lodash/_baseFindKey.js new file mode 100755 index 00000000..2e430f3a --- /dev/null +++ b/node_modules/lodash/_baseFindKey.js @@ -0,0 +1,23 @@ +/** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ +function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; +} + +module.exports = baseFindKey; diff --git a/node_modules/lodash/_baseFlatten.js b/node_modules/lodash/_baseFlatten.js new file mode 100755 index 00000000..4b1e009b --- /dev/null +++ b/node_modules/lodash/_baseFlatten.js @@ -0,0 +1,38 @@ +var arrayPush = require('./_arrayPush'), + isFlattenable = require('./_isFlattenable'); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; diff --git a/node_modules/lodash/_baseFor.js b/node_modules/lodash/_baseFor.js new file mode 100755 index 00000000..d946590f --- /dev/null +++ b/node_modules/lodash/_baseFor.js @@ -0,0 +1,16 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; diff --git a/node_modules/lodash/_baseForOwn.js b/node_modules/lodash/_baseForOwn.js new file mode 100755 index 00000000..503d5234 --- /dev/null +++ b/node_modules/lodash/_baseForOwn.js @@ -0,0 +1,16 @@ +var baseFor = require('./_baseFor'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; diff --git a/node_modules/lodash/_baseForOwnRight.js b/node_modules/lodash/_baseForOwnRight.js new file mode 100755 index 00000000..a4b10e6c --- /dev/null +++ b/node_modules/lodash/_baseForOwnRight.js @@ -0,0 +1,16 @@ +var baseForRight = require('./_baseForRight'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); +} + +module.exports = baseForOwnRight; diff --git a/node_modules/lodash/_baseForRight.js b/node_modules/lodash/_baseForRight.js new file mode 100755 index 00000000..32842cd8 --- /dev/null +++ b/node_modules/lodash/_baseForRight.js @@ -0,0 +1,15 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseForRight = createBaseFor(true); + +module.exports = baseForRight; diff --git a/node_modules/lodash/_baseFunctions.js b/node_modules/lodash/_baseFunctions.js new file mode 100755 index 00000000..d23bc9b4 --- /dev/null +++ b/node_modules/lodash/_baseFunctions.js @@ -0,0 +1,19 @@ +var arrayFilter = require('./_arrayFilter'), + isFunction = require('./isFunction'); + +/** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ +function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); +} + +module.exports = baseFunctions; diff --git a/node_modules/lodash/_baseGet.js b/node_modules/lodash/_baseGet.js new file mode 100755 index 00000000..a194913d --- /dev/null +++ b/node_modules/lodash/_baseGet.js @@ -0,0 +1,24 @@ +var castPath = require('./_castPath'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; diff --git a/node_modules/lodash/_baseGetAllKeys.js b/node_modules/lodash/_baseGetAllKeys.js new file mode 100755 index 00000000..8ad204ea --- /dev/null +++ b/node_modules/lodash/_baseGetAllKeys.js @@ -0,0 +1,20 @@ +var arrayPush = require('./_arrayPush'), + isArray = require('./isArray'); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; diff --git a/node_modules/lodash/_baseGetTag.js b/node_modules/lodash/_baseGetTag.js new file mode 100755 index 00000000..b927ccc1 --- /dev/null +++ b/node_modules/lodash/_baseGetTag.js @@ -0,0 +1,28 @@ +var Symbol = require('./_Symbol'), + getRawTag = require('./_getRawTag'), + objectToString = require('./_objectToString'); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; diff --git a/node_modules/lodash/_baseGt.js b/node_modules/lodash/_baseGt.js new file mode 100755 index 00000000..502d273c --- /dev/null +++ b/node_modules/lodash/_baseGt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +module.exports = baseGt; diff --git a/node_modules/lodash/_baseHas.js b/node_modules/lodash/_baseHas.js new file mode 100755 index 00000000..1b730321 --- /dev/null +++ b/node_modules/lodash/_baseHas.js @@ -0,0 +1,19 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); +} + +module.exports = baseHas; diff --git a/node_modules/lodash/_baseHasIn.js b/node_modules/lodash/_baseHasIn.js new file mode 100755 index 00000000..2e0d0426 --- /dev/null +++ b/node_modules/lodash/_baseHasIn.js @@ -0,0 +1,13 @@ +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; diff --git a/node_modules/lodash/_baseInRange.js b/node_modules/lodash/_baseInRange.js new file mode 100755 index 00000000..ec956661 --- /dev/null +++ b/node_modules/lodash/_baseInRange.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ +function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); +} + +module.exports = baseInRange; diff --git a/node_modules/lodash/_baseIndexOf.js b/node_modules/lodash/_baseIndexOf.js new file mode 100755 index 00000000..167e706e --- /dev/null +++ b/node_modules/lodash/_baseIndexOf.js @@ -0,0 +1,20 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictIndexOf = require('./_strictIndexOf'); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; diff --git a/node_modules/lodash/_baseIndexOfWith.js b/node_modules/lodash/_baseIndexOfWith.js new file mode 100755 index 00000000..f815fe0d --- /dev/null +++ b/node_modules/lodash/_baseIndexOfWith.js @@ -0,0 +1,23 @@ +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith; diff --git a/node_modules/lodash/_baseIntersection.js b/node_modules/lodash/_baseIntersection.js new file mode 100755 index 00000000..c1d250c2 --- /dev/null +++ b/node_modules/lodash/_baseIntersection.js @@ -0,0 +1,74 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; diff --git a/node_modules/lodash/_baseInverter.js b/node_modules/lodash/_baseInverter.js new file mode 100755 index 00000000..fbc337f0 --- /dev/null +++ b/node_modules/lodash/_baseInverter.js @@ -0,0 +1,21 @@ +var baseForOwn = require('./_baseForOwn'); + +/** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ +function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; +} + +module.exports = baseInverter; diff --git a/node_modules/lodash/_baseInvoke.js b/node_modules/lodash/_baseInvoke.js new file mode 100755 index 00000000..49bcf3c3 --- /dev/null +++ b/node_modules/lodash/_baseInvoke.js @@ -0,0 +1,24 @@ +var apply = require('./_apply'), + castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ +function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); +} + +module.exports = baseInvoke; diff --git a/node_modules/lodash/_baseIsArguments.js b/node_modules/lodash/_baseIsArguments.js new file mode 100755 index 00000000..b3562cca --- /dev/null +++ b/node_modules/lodash/_baseIsArguments.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; diff --git a/node_modules/lodash/_baseIsArrayBuffer.js b/node_modules/lodash/_baseIsArrayBuffer.js new file mode 100755 index 00000000..a2c4f30a --- /dev/null +++ b/node_modules/lodash/_baseIsArrayBuffer.js @@ -0,0 +1,17 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +var arrayBufferTag = '[object ArrayBuffer]'; + +/** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ +function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; +} + +module.exports = baseIsArrayBuffer; diff --git a/node_modules/lodash/_baseIsDate.js b/node_modules/lodash/_baseIsDate.js new file mode 100755 index 00000000..ba67c785 --- /dev/null +++ b/node_modules/lodash/_baseIsDate.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var dateTag = '[object Date]'; + +/** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ +function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; +} + +module.exports = baseIsDate; diff --git a/node_modules/lodash/_baseIsEqual.js b/node_modules/lodash/_baseIsEqual.js new file mode 100755 index 00000000..00a68a4f --- /dev/null +++ b/node_modules/lodash/_baseIsEqual.js @@ -0,0 +1,28 @@ +var baseIsEqualDeep = require('./_baseIsEqualDeep'), + isObjectLike = require('./isObjectLike'); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; diff --git a/node_modules/lodash/_baseIsEqualDeep.js b/node_modules/lodash/_baseIsEqualDeep.js new file mode 100755 index 00000000..e3cfd6a8 --- /dev/null +++ b/node_modules/lodash/_baseIsEqualDeep.js @@ -0,0 +1,83 @@ +var Stack = require('./_Stack'), + equalArrays = require('./_equalArrays'), + equalByTag = require('./_equalByTag'), + equalObjects = require('./_equalObjects'), + getTag = require('./_getTag'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isTypedArray = require('./isTypedArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; diff --git a/node_modules/lodash/_baseIsMap.js b/node_modules/lodash/_baseIsMap.js new file mode 100755 index 00000000..02a4021c --- /dev/null +++ b/node_modules/lodash/_baseIsMap.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; diff --git a/node_modules/lodash/_baseIsMatch.js b/node_modules/lodash/_baseIsMatch.js new file mode 100755 index 00000000..72494bed --- /dev/null +++ b/node_modules/lodash/_baseIsMatch.js @@ -0,0 +1,62 @@ +var Stack = require('./_Stack'), + baseIsEqual = require('./_baseIsEqual'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; diff --git a/node_modules/lodash/_baseIsNaN.js b/node_modules/lodash/_baseIsNaN.js new file mode 100755 index 00000000..316f1eb1 --- /dev/null +++ b/node_modules/lodash/_baseIsNaN.js @@ -0,0 +1,12 @@ +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; diff --git a/node_modules/lodash/_baseIsNative.js b/node_modules/lodash/_baseIsNative.js new file mode 100755 index 00000000..87023304 --- /dev/null +++ b/node_modules/lodash/_baseIsNative.js @@ -0,0 +1,47 @@ +var isFunction = require('./isFunction'), + isMasked = require('./_isMasked'), + isObject = require('./isObject'), + toSource = require('./_toSource'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; diff --git a/node_modules/lodash/_baseIsRegExp.js b/node_modules/lodash/_baseIsRegExp.js new file mode 100755 index 00000000..6cd7c1ae --- /dev/null +++ b/node_modules/lodash/_baseIsRegExp.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var regexpTag = '[object RegExp]'; + +/** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ +function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; +} + +module.exports = baseIsRegExp; diff --git a/node_modules/lodash/_baseIsSet.js b/node_modules/lodash/_baseIsSet.js new file mode 100755 index 00000000..6dee3671 --- /dev/null +++ b/node_modules/lodash/_baseIsSet.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; diff --git a/node_modules/lodash/_baseIsTypedArray.js b/node_modules/lodash/_baseIsTypedArray.js new file mode 100755 index 00000000..1edb32ff --- /dev/null +++ b/node_modules/lodash/_baseIsTypedArray.js @@ -0,0 +1,60 @@ +var baseGetTag = require('./_baseGetTag'), + isLength = require('./isLength'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; diff --git a/node_modules/lodash/_baseIteratee.js b/node_modules/lodash/_baseIteratee.js new file mode 100755 index 00000000..995c2575 --- /dev/null +++ b/node_modules/lodash/_baseIteratee.js @@ -0,0 +1,31 @@ +var baseMatches = require('./_baseMatches'), + baseMatchesProperty = require('./_baseMatchesProperty'), + identity = require('./identity'), + isArray = require('./isArray'), + property = require('./property'); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; diff --git a/node_modules/lodash/_baseKeys.js b/node_modules/lodash/_baseKeys.js new file mode 100755 index 00000000..45e9e6f3 --- /dev/null +++ b/node_modules/lodash/_baseKeys.js @@ -0,0 +1,30 @@ +var isPrototype = require('./_isPrototype'), + nativeKeys = require('./_nativeKeys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; diff --git a/node_modules/lodash/_baseKeysIn.js b/node_modules/lodash/_baseKeysIn.js new file mode 100755 index 00000000..ea8a0a17 --- /dev/null +++ b/node_modules/lodash/_baseKeysIn.js @@ -0,0 +1,33 @@ +var isObject = require('./isObject'), + isPrototype = require('./_isPrototype'), + nativeKeysIn = require('./_nativeKeysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; diff --git a/node_modules/lodash/_baseLodash.js b/node_modules/lodash/_baseLodash.js new file mode 100755 index 00000000..f76c790e --- /dev/null +++ b/node_modules/lodash/_baseLodash.js @@ -0,0 +1,10 @@ +/** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ +function baseLodash() { + // No operation performed. +} + +module.exports = baseLodash; diff --git a/node_modules/lodash/_baseLt.js b/node_modules/lodash/_baseLt.js new file mode 100755 index 00000000..8674d294 --- /dev/null +++ b/node_modules/lodash/_baseLt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ +function baseLt(value, other) { + return value < other; +} + +module.exports = baseLt; diff --git a/node_modules/lodash/_baseMap.js b/node_modules/lodash/_baseMap.js new file mode 100755 index 00000000..0bf5cead --- /dev/null +++ b/node_modules/lodash/_baseMap.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'), + isArrayLike = require('./isArrayLike'); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; diff --git a/node_modules/lodash/_baseMatches.js b/node_modules/lodash/_baseMatches.js new file mode 100755 index 00000000..e56582ad --- /dev/null +++ b/node_modules/lodash/_baseMatches.js @@ -0,0 +1,22 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'), + matchesStrictComparable = require('./_matchesStrictComparable'); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; diff --git a/node_modules/lodash/_baseMatchesProperty.js b/node_modules/lodash/_baseMatchesProperty.js new file mode 100755 index 00000000..24afd893 --- /dev/null +++ b/node_modules/lodash/_baseMatchesProperty.js @@ -0,0 +1,33 @@ +var baseIsEqual = require('./_baseIsEqual'), + get = require('./get'), + hasIn = require('./hasIn'), + isKey = require('./_isKey'), + isStrictComparable = require('./_isStrictComparable'), + matchesStrictComparable = require('./_matchesStrictComparable'), + toKey = require('./_toKey'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; diff --git a/node_modules/lodash/_baseMean.js b/node_modules/lodash/_baseMean.js new file mode 100755 index 00000000..fa9e00a0 --- /dev/null +++ b/node_modules/lodash/_baseMean.js @@ -0,0 +1,20 @@ +var baseSum = require('./_baseSum'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ +function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; +} + +module.exports = baseMean; diff --git a/node_modules/lodash/_baseMerge.js b/node_modules/lodash/_baseMerge.js new file mode 100755 index 00000000..f4cb8c69 --- /dev/null +++ b/node_modules/lodash/_baseMerge.js @@ -0,0 +1,41 @@ +var Stack = require('./_Stack'), + assignMergeValue = require('./_assignMergeValue'), + baseFor = require('./_baseFor'), + baseMergeDeep = require('./_baseMergeDeep'), + isObject = require('./isObject'), + keysIn = require('./keysIn'); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +module.exports = baseMerge; diff --git a/node_modules/lodash/_baseMergeDeep.js b/node_modules/lodash/_baseMergeDeep.js new file mode 100755 index 00000000..42b405a3 --- /dev/null +++ b/node_modules/lodash/_baseMergeDeep.js @@ -0,0 +1,93 @@ +var assignMergeValue = require('./_assignMergeValue'), + cloneBuffer = require('./_cloneBuffer'), + cloneTypedArray = require('./_cloneTypedArray'), + copyArray = require('./_copyArray'), + initCloneObject = require('./_initCloneObject'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLikeObject = require('./isArrayLikeObject'), + isBuffer = require('./isBuffer'), + isFunction = require('./isFunction'), + isObject = require('./isObject'), + isPlainObject = require('./isPlainObject'), + isTypedArray = require('./isTypedArray'), + toPlainObject = require('./toPlainObject'); + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = object[key], + srcValue = source[key], + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +module.exports = baseMergeDeep; diff --git a/node_modules/lodash/_baseNth.js b/node_modules/lodash/_baseNth.js new file mode 100755 index 00000000..0403c2a3 --- /dev/null +++ b/node_modules/lodash/_baseNth.js @@ -0,0 +1,20 @@ +var isIndex = require('./_isIndex'); + +/** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ +function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; +} + +module.exports = baseNth; diff --git a/node_modules/lodash/_baseOrderBy.js b/node_modules/lodash/_baseOrderBy.js new file mode 100755 index 00000000..d8a46ab2 --- /dev/null +++ b/node_modules/lodash/_baseOrderBy.js @@ -0,0 +1,34 @@ +var arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseMap = require('./_baseMap'), + baseSortBy = require('./_baseSortBy'), + baseUnary = require('./_baseUnary'), + compareMultiple = require('./_compareMultiple'), + identity = require('./identity'); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; diff --git a/node_modules/lodash/_basePick.js b/node_modules/lodash/_basePick.js new file mode 100755 index 00000000..09b458a6 --- /dev/null +++ b/node_modules/lodash/_basePick.js @@ -0,0 +1,19 @@ +var basePickBy = require('./_basePickBy'), + hasIn = require('./hasIn'); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; diff --git a/node_modules/lodash/_basePickBy.js b/node_modules/lodash/_basePickBy.js new file mode 100755 index 00000000..85be68c8 --- /dev/null +++ b/node_modules/lodash/_basePickBy.js @@ -0,0 +1,30 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'), + castPath = require('./_castPath'); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; diff --git a/node_modules/lodash/_baseProperty.js b/node_modules/lodash/_baseProperty.js new file mode 100755 index 00000000..496281ec --- /dev/null +++ b/node_modules/lodash/_baseProperty.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; diff --git a/node_modules/lodash/_basePropertyDeep.js b/node_modules/lodash/_basePropertyDeep.js new file mode 100755 index 00000000..1e5aae50 --- /dev/null +++ b/node_modules/lodash/_basePropertyDeep.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; diff --git a/node_modules/lodash/_basePropertyOf.js b/node_modules/lodash/_basePropertyOf.js new file mode 100755 index 00000000..46173999 --- /dev/null +++ b/node_modules/lodash/_basePropertyOf.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = basePropertyOf; diff --git a/node_modules/lodash/_basePullAll.js b/node_modules/lodash/_basePullAll.js new file mode 100755 index 00000000..305720ed --- /dev/null +++ b/node_modules/lodash/_basePullAll.js @@ -0,0 +1,51 @@ +var arrayMap = require('./_arrayMap'), + baseIndexOf = require('./_baseIndexOf'), + baseIndexOfWith = require('./_baseIndexOfWith'), + baseUnary = require('./_baseUnary'), + copyArray = require('./_copyArray'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ +function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; +} + +module.exports = basePullAll; diff --git a/node_modules/lodash/_basePullAt.js b/node_modules/lodash/_basePullAt.js new file mode 100755 index 00000000..c3e9e710 --- /dev/null +++ b/node_modules/lodash/_basePullAt.js @@ -0,0 +1,37 @@ +var baseUnset = require('./_baseUnset'), + isIndex = require('./_isIndex'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ +function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; +} + +module.exports = basePullAt; diff --git a/node_modules/lodash/_baseRandom.js b/node_modules/lodash/_baseRandom.js new file mode 100755 index 00000000..94f76a76 --- /dev/null +++ b/node_modules/lodash/_baseRandom.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeRandom = Math.random; + +/** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ +function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); +} + +module.exports = baseRandom; diff --git a/node_modules/lodash/_baseRange.js b/node_modules/lodash/_baseRange.js new file mode 100755 index 00000000..0fb8e419 --- /dev/null +++ b/node_modules/lodash/_baseRange.js @@ -0,0 +1,28 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ +function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; +} + +module.exports = baseRange; diff --git a/node_modules/lodash/_baseReduce.js b/node_modules/lodash/_baseReduce.js new file mode 100755 index 00000000..5a1f8b57 --- /dev/null +++ b/node_modules/lodash/_baseReduce.js @@ -0,0 +1,23 @@ +/** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ +function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; +} + +module.exports = baseReduce; diff --git a/node_modules/lodash/_baseRepeat.js b/node_modules/lodash/_baseRepeat.js new file mode 100755 index 00000000..ee44c31a --- /dev/null +++ b/node_modules/lodash/_baseRepeat.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +module.exports = baseRepeat; diff --git a/node_modules/lodash/_baseRest.js b/node_modules/lodash/_baseRest.js new file mode 100755 index 00000000..d0dc4bdd --- /dev/null +++ b/node_modules/lodash/_baseRest.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; diff --git a/node_modules/lodash/_baseSample.js b/node_modules/lodash/_baseSample.js new file mode 100755 index 00000000..58582b91 --- /dev/null +++ b/node_modules/lodash/_baseSample.js @@ -0,0 +1,15 @@ +var arraySample = require('./_arraySample'), + values = require('./values'); + +/** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ +function baseSample(collection) { + return arraySample(values(collection)); +} + +module.exports = baseSample; diff --git a/node_modules/lodash/_baseSampleSize.js b/node_modules/lodash/_baseSampleSize.js new file mode 100755 index 00000000..5c90ec51 --- /dev/null +++ b/node_modules/lodash/_baseSampleSize.js @@ -0,0 +1,18 @@ +var baseClamp = require('./_baseClamp'), + shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); +} + +module.exports = baseSampleSize; diff --git a/node_modules/lodash/_baseSet.js b/node_modules/lodash/_baseSet.js new file mode 100755 index 00000000..612a24cc --- /dev/null +++ b/node_modules/lodash/_baseSet.js @@ -0,0 +1,47 @@ +var assignValue = require('./_assignValue'), + castPath = require('./_castPath'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; diff --git a/node_modules/lodash/_baseSetData.js b/node_modules/lodash/_baseSetData.js new file mode 100755 index 00000000..c409947d --- /dev/null +++ b/node_modules/lodash/_baseSetData.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + metaMap = require('./_metaMap'); + +/** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; +}; + +module.exports = baseSetData; diff --git a/node_modules/lodash/_baseSetToString.js b/node_modules/lodash/_baseSetToString.js new file mode 100755 index 00000000..89eaca38 --- /dev/null +++ b/node_modules/lodash/_baseSetToString.js @@ -0,0 +1,22 @@ +var constant = require('./constant'), + defineProperty = require('./_defineProperty'), + identity = require('./identity'); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; diff --git a/node_modules/lodash/_baseShuffle.js b/node_modules/lodash/_baseShuffle.js new file mode 100755 index 00000000..023077ac --- /dev/null +++ b/node_modules/lodash/_baseShuffle.js @@ -0,0 +1,15 @@ +var shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function baseShuffle(collection) { + return shuffleSelf(values(collection)); +} + +module.exports = baseShuffle; diff --git a/node_modules/lodash/_baseSlice.js b/node_modules/lodash/_baseSlice.js new file mode 100755 index 00000000..786f6c99 --- /dev/null +++ b/node_modules/lodash/_baseSlice.js @@ -0,0 +1,31 @@ +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; diff --git a/node_modules/lodash/_baseSome.js b/node_modules/lodash/_baseSome.js new file mode 100755 index 00000000..58f3f447 --- /dev/null +++ b/node_modules/lodash/_baseSome.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; diff --git a/node_modules/lodash/_baseSortBy.js b/node_modules/lodash/_baseSortBy.js new file mode 100755 index 00000000..a25c92ed --- /dev/null +++ b/node_modules/lodash/_baseSortBy.js @@ -0,0 +1,21 @@ +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; diff --git a/node_modules/lodash/_baseSortedIndex.js b/node_modules/lodash/_baseSortedIndex.js new file mode 100755 index 00000000..638c366c --- /dev/null +++ b/node_modules/lodash/_baseSortedIndex.js @@ -0,0 +1,42 @@ +var baseSortedIndexBy = require('./_baseSortedIndexBy'), + identity = require('./identity'), + isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + +/** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); +} + +module.exports = baseSortedIndex; diff --git a/node_modules/lodash/_baseSortedIndexBy.js b/node_modules/lodash/_baseSortedIndexBy.js new file mode 100755 index 00000000..bb22e36d --- /dev/null +++ b/node_modules/lodash/_baseSortedIndexBy.js @@ -0,0 +1,64 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeMin = Math.min; + +/** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); +} + +module.exports = baseSortedIndexBy; diff --git a/node_modules/lodash/_baseSortedUniq.js b/node_modules/lodash/_baseSortedUniq.js new file mode 100755 index 00000000..802159a3 --- /dev/null +++ b/node_modules/lodash/_baseSortedUniq.js @@ -0,0 +1,30 @@ +var eq = require('./eq'); + +/** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; +} + +module.exports = baseSortedUniq; diff --git a/node_modules/lodash/_baseSum.js b/node_modules/lodash/_baseSum.js new file mode 100755 index 00000000..a9e84c13 --- /dev/null +++ b/node_modules/lodash/_baseSum.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ +function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; +} + +module.exports = baseSum; diff --git a/node_modules/lodash/_baseTimes.js b/node_modules/lodash/_baseTimes.js new file mode 100755 index 00000000..0603fc37 --- /dev/null +++ b/node_modules/lodash/_baseTimes.js @@ -0,0 +1,20 @@ +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; diff --git a/node_modules/lodash/_baseToNumber.js b/node_modules/lodash/_baseToNumber.js new file mode 100755 index 00000000..04859f39 --- /dev/null +++ b/node_modules/lodash/_baseToNumber.js @@ -0,0 +1,24 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ +function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; +} + +module.exports = baseToNumber; diff --git a/node_modules/lodash/_baseToPairs.js b/node_modules/lodash/_baseToPairs.js new file mode 100755 index 00000000..bff19912 --- /dev/null +++ b/node_modules/lodash/_baseToPairs.js @@ -0,0 +1,18 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; diff --git a/node_modules/lodash/_baseToString.js b/node_modules/lodash/_baseToString.js new file mode 100755 index 00000000..ada6ad29 --- /dev/null +++ b/node_modules/lodash/_baseToString.js @@ -0,0 +1,37 @@ +var Symbol = require('./_Symbol'), + arrayMap = require('./_arrayMap'), + isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; diff --git a/node_modules/lodash/_baseUnary.js b/node_modules/lodash/_baseUnary.js new file mode 100755 index 00000000..98639e92 --- /dev/null +++ b/node_modules/lodash/_baseUnary.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; diff --git a/node_modules/lodash/_baseUniq.js b/node_modules/lodash/_baseUniq.js new file mode 100755 index 00000000..aea459dc --- /dev/null +++ b/node_modules/lodash/_baseUniq.js @@ -0,0 +1,72 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + cacheHas = require('./_cacheHas'), + createSet = require('./_createSet'), + setToArray = require('./_setToArray'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseUniq; diff --git a/node_modules/lodash/_baseUnset.js b/node_modules/lodash/_baseUnset.js new file mode 100755 index 00000000..eefc6e37 --- /dev/null +++ b/node_modules/lodash/_baseUnset.js @@ -0,0 +1,20 @@ +var castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; diff --git a/node_modules/lodash/_baseUpdate.js b/node_modules/lodash/_baseUpdate.js new file mode 100755 index 00000000..92a62377 --- /dev/null +++ b/node_modules/lodash/_baseUpdate.js @@ -0,0 +1,18 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'); + +/** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); +} + +module.exports = baseUpdate; diff --git a/node_modules/lodash/_baseValues.js b/node_modules/lodash/_baseValues.js new file mode 100755 index 00000000..b95faadc --- /dev/null +++ b/node_modules/lodash/_baseValues.js @@ -0,0 +1,19 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; diff --git a/node_modules/lodash/_baseWhile.js b/node_modules/lodash/_baseWhile.js new file mode 100755 index 00000000..07eac61b --- /dev/null +++ b/node_modules/lodash/_baseWhile.js @@ -0,0 +1,26 @@ +var baseSlice = require('./_baseSlice'); + +/** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ +function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); +} + +module.exports = baseWhile; diff --git a/node_modules/lodash/_baseWrapperValue.js b/node_modules/lodash/_baseWrapperValue.js new file mode 100755 index 00000000..443e0df5 --- /dev/null +++ b/node_modules/lodash/_baseWrapperValue.js @@ -0,0 +1,25 @@ +var LazyWrapper = require('./_LazyWrapper'), + arrayPush = require('./_arrayPush'), + arrayReduce = require('./_arrayReduce'); + +/** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ +function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); +} + +module.exports = baseWrapperValue; diff --git a/node_modules/lodash/_baseXor.js b/node_modules/lodash/_baseXor.js new file mode 100755 index 00000000..8e69338b --- /dev/null +++ b/node_modules/lodash/_baseXor.js @@ -0,0 +1,36 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseUniq = require('./_baseUniq'); + +/** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ +function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); +} + +module.exports = baseXor; diff --git a/node_modules/lodash/_baseZipObject.js b/node_modules/lodash/_baseZipObject.js new file mode 100755 index 00000000..401f85be --- /dev/null +++ b/node_modules/lodash/_baseZipObject.js @@ -0,0 +1,23 @@ +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; diff --git a/node_modules/lodash/_cacheHas.js b/node_modules/lodash/_cacheHas.js new file mode 100755 index 00000000..2dec8926 --- /dev/null +++ b/node_modules/lodash/_cacheHas.js @@ -0,0 +1,13 @@ +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; diff --git a/node_modules/lodash/_castArrayLikeObject.js b/node_modules/lodash/_castArrayLikeObject.js new file mode 100755 index 00000000..92c75fa1 --- /dev/null +++ b/node_modules/lodash/_castArrayLikeObject.js @@ -0,0 +1,14 @@ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; diff --git a/node_modules/lodash/_castFunction.js b/node_modules/lodash/_castFunction.js new file mode 100755 index 00000000..98c91ae6 --- /dev/null +++ b/node_modules/lodash/_castFunction.js @@ -0,0 +1,14 @@ +var identity = require('./identity'); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; diff --git a/node_modules/lodash/_castPath.js b/node_modules/lodash/_castPath.js new file mode 100755 index 00000000..017e4c1b --- /dev/null +++ b/node_modules/lodash/_castPath.js @@ -0,0 +1,21 @@ +var isArray = require('./isArray'), + isKey = require('./_isKey'), + stringToPath = require('./_stringToPath'), + toString = require('./toString'); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; diff --git a/node_modules/lodash/_castRest.js b/node_modules/lodash/_castRest.js new file mode 100755 index 00000000..213c66f1 --- /dev/null +++ b/node_modules/lodash/_castRest.js @@ -0,0 +1,14 @@ +var baseRest = require('./_baseRest'); + +/** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +var castRest = baseRest; + +module.exports = castRest; diff --git a/node_modules/lodash/_castSlice.js b/node_modules/lodash/_castSlice.js new file mode 100755 index 00000000..071faeba --- /dev/null +++ b/node_modules/lodash/_castSlice.js @@ -0,0 +1,18 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +module.exports = castSlice; diff --git a/node_modules/lodash/_charsEndIndex.js b/node_modules/lodash/_charsEndIndex.js new file mode 100755 index 00000000..07908ff3 --- /dev/null +++ b/node_modules/lodash/_charsEndIndex.js @@ -0,0 +1,19 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsEndIndex; diff --git a/node_modules/lodash/_charsStartIndex.js b/node_modules/lodash/_charsStartIndex.js new file mode 100755 index 00000000..b17afd25 --- /dev/null +++ b/node_modules/lodash/_charsStartIndex.js @@ -0,0 +1,20 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ +function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsStartIndex; diff --git a/node_modules/lodash/_cloneArrayBuffer.js b/node_modules/lodash/_cloneArrayBuffer.js new file mode 100755 index 00000000..c3d8f6e3 --- /dev/null +++ b/node_modules/lodash/_cloneArrayBuffer.js @@ -0,0 +1,16 @@ +var Uint8Array = require('./_Uint8Array'); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; diff --git a/node_modules/lodash/_cloneBuffer.js b/node_modules/lodash/_cloneBuffer.js new file mode 100755 index 00000000..27c48109 --- /dev/null +++ b/node_modules/lodash/_cloneBuffer.js @@ -0,0 +1,35 @@ +var root = require('./_root'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; diff --git a/node_modules/lodash/_cloneDataView.js b/node_modules/lodash/_cloneDataView.js new file mode 100755 index 00000000..9c9b7b05 --- /dev/null +++ b/node_modules/lodash/_cloneDataView.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; diff --git a/node_modules/lodash/_cloneMap.js b/node_modules/lodash/_cloneMap.js new file mode 100755 index 00000000..334b73e9 --- /dev/null +++ b/node_modules/lodash/_cloneMap.js @@ -0,0 +1,22 @@ +var addMapEntry = require('./_addMapEntry'), + arrayReduce = require('./_arrayReduce'), + mapToArray = require('./_mapToArray'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +module.exports = cloneMap; diff --git a/node_modules/lodash/_cloneRegExp.js b/node_modules/lodash/_cloneRegExp.js new file mode 100755 index 00000000..64a30dfb --- /dev/null +++ b/node_modules/lodash/_cloneRegExp.js @@ -0,0 +1,17 @@ +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; diff --git a/node_modules/lodash/_cloneSet.js b/node_modules/lodash/_cloneSet.js new file mode 100755 index 00000000..713a2f76 --- /dev/null +++ b/node_modules/lodash/_cloneSet.js @@ -0,0 +1,22 @@ +var addSetEntry = require('./_addSetEntry'), + arrayReduce = require('./_arrayReduce'), + setToArray = require('./_setToArray'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +module.exports = cloneSet; diff --git a/node_modules/lodash/_cloneSymbol.js b/node_modules/lodash/_cloneSymbol.js new file mode 100755 index 00000000..bede39f5 --- /dev/null +++ b/node_modules/lodash/_cloneSymbol.js @@ -0,0 +1,18 @@ +var Symbol = require('./_Symbol'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; diff --git a/node_modules/lodash/_cloneTypedArray.js b/node_modules/lodash/_cloneTypedArray.js new file mode 100755 index 00000000..7aad84d4 --- /dev/null +++ b/node_modules/lodash/_cloneTypedArray.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; diff --git a/node_modules/lodash/_compareAscending.js b/node_modules/lodash/_compareAscending.js new file mode 100755 index 00000000..8dc27910 --- /dev/null +++ b/node_modules/lodash/_compareAscending.js @@ -0,0 +1,41 @@ +var isSymbol = require('./isSymbol'); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; diff --git a/node_modules/lodash/_compareMultiple.js b/node_modules/lodash/_compareMultiple.js new file mode 100755 index 00000000..ad61f0fb --- /dev/null +++ b/node_modules/lodash/_compareMultiple.js @@ -0,0 +1,44 @@ +var compareAscending = require('./_compareAscending'); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; diff --git a/node_modules/lodash/_composeArgs.js b/node_modules/lodash/_composeArgs.js new file mode 100755 index 00000000..1ce40f4f --- /dev/null +++ b/node_modules/lodash/_composeArgs.js @@ -0,0 +1,39 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; +} + +module.exports = composeArgs; diff --git a/node_modules/lodash/_composeArgsRight.js b/node_modules/lodash/_composeArgsRight.js new file mode 100755 index 00000000..8dc588d0 --- /dev/null +++ b/node_modules/lodash/_composeArgsRight.js @@ -0,0 +1,41 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; +} + +module.exports = composeArgsRight; diff --git a/node_modules/lodash/_copyArray.js b/node_modules/lodash/_copyArray.js new file mode 100755 index 00000000..cd94d5d0 --- /dev/null +++ b/node_modules/lodash/_copyArray.js @@ -0,0 +1,20 @@ +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; diff --git a/node_modules/lodash/_copyObject.js b/node_modules/lodash/_copyObject.js new file mode 100755 index 00000000..2f2a5c23 --- /dev/null +++ b/node_modules/lodash/_copyObject.js @@ -0,0 +1,40 @@ +var assignValue = require('./_assignValue'), + baseAssignValue = require('./_baseAssignValue'); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; diff --git a/node_modules/lodash/_copySymbols.js b/node_modules/lodash/_copySymbols.js new file mode 100755 index 00000000..c35944ab --- /dev/null +++ b/node_modules/lodash/_copySymbols.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbols = require('./_getSymbols'); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; diff --git a/node_modules/lodash/_copySymbolsIn.js b/node_modules/lodash/_copySymbolsIn.js new file mode 100755 index 00000000..fdf20a73 --- /dev/null +++ b/node_modules/lodash/_copySymbolsIn.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbolsIn = require('./_getSymbolsIn'); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; diff --git a/node_modules/lodash/_coreJsData.js b/node_modules/lodash/_coreJsData.js new file mode 100755 index 00000000..f8e5b4e3 --- /dev/null +++ b/node_modules/lodash/_coreJsData.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; diff --git a/node_modules/lodash/_countHolders.js b/node_modules/lodash/_countHolders.js new file mode 100755 index 00000000..718fcdaa --- /dev/null +++ b/node_modules/lodash/_countHolders.js @@ -0,0 +1,21 @@ +/** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ +function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; +} + +module.exports = countHolders; diff --git a/node_modules/lodash/_createAggregator.js b/node_modules/lodash/_createAggregator.js new file mode 100755 index 00000000..0be42c41 --- /dev/null +++ b/node_modules/lodash/_createAggregator.js @@ -0,0 +1,23 @@ +var arrayAggregator = require('./_arrayAggregator'), + baseAggregator = require('./_baseAggregator'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ +function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; +} + +module.exports = createAggregator; diff --git a/node_modules/lodash/_createAssigner.js b/node_modules/lodash/_createAssigner.js new file mode 100755 index 00000000..1f904c51 --- /dev/null +++ b/node_modules/lodash/_createAssigner.js @@ -0,0 +1,37 @@ +var baseRest = require('./_baseRest'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; diff --git a/node_modules/lodash/_createBaseEach.js b/node_modules/lodash/_createBaseEach.js new file mode 100755 index 00000000..d24fdd1b --- /dev/null +++ b/node_modules/lodash/_createBaseEach.js @@ -0,0 +1,32 @@ +var isArrayLike = require('./isArrayLike'); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; diff --git a/node_modules/lodash/_createBaseFor.js b/node_modules/lodash/_createBaseFor.js new file mode 100755 index 00000000..94cbf297 --- /dev/null +++ b/node_modules/lodash/_createBaseFor.js @@ -0,0 +1,25 @@ +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; diff --git a/node_modules/lodash/_createBind.js b/node_modules/lodash/_createBind.js new file mode 100755 index 00000000..07cb99f4 --- /dev/null +++ b/node_modules/lodash/_createBind.js @@ -0,0 +1,28 @@ +var createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} + +module.exports = createBind; diff --git a/node_modules/lodash/_createCaseFirst.js b/node_modules/lodash/_createCaseFirst.js new file mode 100755 index 00000000..fe8ea483 --- /dev/null +++ b/node_modules/lodash/_createCaseFirst.js @@ -0,0 +1,33 @@ +var castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringToArray = require('./_stringToArray'), + toString = require('./toString'); + +/** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ +function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; +} + +module.exports = createCaseFirst; diff --git a/node_modules/lodash/_createCompounder.js b/node_modules/lodash/_createCompounder.js new file mode 100755 index 00000000..8d4cee2c --- /dev/null +++ b/node_modules/lodash/_createCompounder.js @@ -0,0 +1,24 @@ +var arrayReduce = require('./_arrayReduce'), + deburr = require('./deburr'), + words = require('./words'); + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]"; + +/** Used to match apostrophes. */ +var reApos = RegExp(rsApos, 'g'); + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; +} + +module.exports = createCompounder; diff --git a/node_modules/lodash/_createCtor.js b/node_modules/lodash/_createCtor.js new file mode 100755 index 00000000..9047aa5f --- /dev/null +++ b/node_modules/lodash/_createCtor.js @@ -0,0 +1,37 @@ +var baseCreate = require('./_baseCreate'), + isObject = require('./isObject'); + +/** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ +function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; +} + +module.exports = createCtor; diff --git a/node_modules/lodash/_createCurry.js b/node_modules/lodash/_createCurry.js new file mode 100755 index 00000000..f06c2cdd --- /dev/null +++ b/node_modules/lodash/_createCurry.js @@ -0,0 +1,46 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + createHybrid = require('./_createHybrid'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; +} + +module.exports = createCurry; diff --git a/node_modules/lodash/_createFind.js b/node_modules/lodash/_createFind.js new file mode 100755 index 00000000..8859ff89 --- /dev/null +++ b/node_modules/lodash/_createFind.js @@ -0,0 +1,25 @@ +var baseIteratee = require('./_baseIteratee'), + isArrayLike = require('./isArrayLike'), + keys = require('./keys'); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; diff --git a/node_modules/lodash/_createFlow.js b/node_modules/lodash/_createFlow.js new file mode 100755 index 00000000..baaddbf5 --- /dev/null +++ b/node_modules/lodash/_createFlow.js @@ -0,0 +1,78 @@ +var LodashWrapper = require('./_LodashWrapper'), + flatRest = require('./_flatRest'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + isArray = require('./isArray'), + isLaziable = require('./_isLaziable'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ +function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); +} + +module.exports = createFlow; diff --git a/node_modules/lodash/_createHybrid.js b/node_modules/lodash/_createHybrid.js new file mode 100755 index 00000000..b671bd11 --- /dev/null +++ b/node_modules/lodash/_createHybrid.js @@ -0,0 +1,92 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + countHolders = require('./_countHolders'), + createCtor = require('./_createCtor'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + reorder = require('./_reorder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_ARY_FLAG = 128, + WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; +} + +module.exports = createHybrid; diff --git a/node_modules/lodash/_createInverter.js b/node_modules/lodash/_createInverter.js new file mode 100755 index 00000000..6c0c5629 --- /dev/null +++ b/node_modules/lodash/_createInverter.js @@ -0,0 +1,17 @@ +var baseInverter = require('./_baseInverter'); + +/** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ +function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; +} + +module.exports = createInverter; diff --git a/node_modules/lodash/_createMathOperation.js b/node_modules/lodash/_createMathOperation.js new file mode 100755 index 00000000..f1e238ac --- /dev/null +++ b/node_modules/lodash/_createMathOperation.js @@ -0,0 +1,38 @@ +var baseToNumber = require('./_baseToNumber'), + baseToString = require('./_baseToString'); + +/** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ +function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; +} + +module.exports = createMathOperation; diff --git a/node_modules/lodash/_createOver.js b/node_modules/lodash/_createOver.js new file mode 100755 index 00000000..3b945516 --- /dev/null +++ b/node_modules/lodash/_createOver.js @@ -0,0 +1,27 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + baseUnary = require('./_baseUnary'), + flatRest = require('./_flatRest'); + +/** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ +function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); +} + +module.exports = createOver; diff --git a/node_modules/lodash/_createPadding.js b/node_modules/lodash/_createPadding.js new file mode 100755 index 00000000..2124612b --- /dev/null +++ b/node_modules/lodash/_createPadding.js @@ -0,0 +1,33 @@ +var baseRepeat = require('./_baseRepeat'), + baseToString = require('./_baseToString'), + castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringSize = require('./_stringSize'), + stringToArray = require('./_stringToArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +module.exports = createPadding; diff --git a/node_modules/lodash/_createPartial.js b/node_modules/lodash/_createPartial.js new file mode 100755 index 00000000..e16c248b --- /dev/null +++ b/node_modules/lodash/_createPartial.js @@ -0,0 +1,43 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ +function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; +} + +module.exports = createPartial; diff --git a/node_modules/lodash/_createRange.js b/node_modules/lodash/_createRange.js new file mode 100755 index 00000000..9f52c779 --- /dev/null +++ b/node_modules/lodash/_createRange.js @@ -0,0 +1,30 @@ +var baseRange = require('./_baseRange'), + isIterateeCall = require('./_isIterateeCall'), + toFinite = require('./toFinite'); + +/** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ +function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; +} + +module.exports = createRange; diff --git a/node_modules/lodash/_createRecurry.js b/node_modules/lodash/_createRecurry.js new file mode 100755 index 00000000..eb29fb24 --- /dev/null +++ b/node_modules/lodash/_createRecurry.js @@ -0,0 +1,56 @@ +var isLaziable = require('./_isLaziable'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); +} + +module.exports = createRecurry; diff --git a/node_modules/lodash/_createRelationalOperation.js b/node_modules/lodash/_createRelationalOperation.js new file mode 100755 index 00000000..a17c6b5e --- /dev/null +++ b/node_modules/lodash/_createRelationalOperation.js @@ -0,0 +1,20 @@ +var toNumber = require('./toNumber'); + +/** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ +function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; +} + +module.exports = createRelationalOperation; diff --git a/node_modules/lodash/_createRound.js b/node_modules/lodash/_createRound.js new file mode 100755 index 00000000..bf9b713f --- /dev/null +++ b/node_modules/lodash/_createRound.js @@ -0,0 +1,33 @@ +var toInteger = require('./toInteger'), + toNumber = require('./toNumber'), + toString = require('./toString'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; +} + +module.exports = createRound; diff --git a/node_modules/lodash/_createSet.js b/node_modules/lodash/_createSet.js new file mode 100755 index 00000000..0f644eea --- /dev/null +++ b/node_modules/lodash/_createSet.js @@ -0,0 +1,19 @@ +var Set = require('./_Set'), + noop = require('./noop'), + setToArray = require('./_setToArray'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +module.exports = createSet; diff --git a/node_modules/lodash/_createToPairs.js b/node_modules/lodash/_createToPairs.js new file mode 100755 index 00000000..568417af --- /dev/null +++ b/node_modules/lodash/_createToPairs.js @@ -0,0 +1,30 @@ +var baseToPairs = require('./_baseToPairs'), + getTag = require('./_getTag'), + mapToArray = require('./_mapToArray'), + setToPairs = require('./_setToPairs'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; diff --git a/node_modules/lodash/_createWrap.js b/node_modules/lodash/_createWrap.js new file mode 100755 index 00000000..33f0633e --- /dev/null +++ b/node_modules/lodash/_createWrap.js @@ -0,0 +1,106 @@ +var baseSetData = require('./_baseSetData'), + createBind = require('./_createBind'), + createCurry = require('./_createCurry'), + createHybrid = require('./_createHybrid'), + createPartial = require('./_createPartial'), + getData = require('./_getData'), + mergeData = require('./_mergeData'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'), + toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); +} + +module.exports = createWrap; diff --git a/node_modules/lodash/_customDefaultsAssignIn.js b/node_modules/lodash/_customDefaultsAssignIn.js new file mode 100755 index 00000000..1f49e6fc --- /dev/null +++ b/node_modules/lodash/_customDefaultsAssignIn.js @@ -0,0 +1,29 @@ +var eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ +function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; +} + +module.exports = customDefaultsAssignIn; diff --git a/node_modules/lodash/_customDefaultsMerge.js b/node_modules/lodash/_customDefaultsMerge.js new file mode 100755 index 00000000..4cab3175 --- /dev/null +++ b/node_modules/lodash/_customDefaultsMerge.js @@ -0,0 +1,28 @@ +var baseMerge = require('./_baseMerge'), + isObject = require('./isObject'); + +/** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ +function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; +} + +module.exports = customDefaultsMerge; diff --git a/node_modules/lodash/_customOmitClone.js b/node_modules/lodash/_customOmitClone.js new file mode 100755 index 00000000..968db2ef --- /dev/null +++ b/node_modules/lodash/_customOmitClone.js @@ -0,0 +1,16 @@ +var isPlainObject = require('./isPlainObject'); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; diff --git a/node_modules/lodash/_deburrLetter.js b/node_modules/lodash/_deburrLetter.js new file mode 100755 index 00000000..3e531edc --- /dev/null +++ b/node_modules/lodash/_deburrLetter.js @@ -0,0 +1,71 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map Latin Unicode letters to basic Latin letters. */ +var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' +}; + +/** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ +var deburrLetter = basePropertyOf(deburredLetters); + +module.exports = deburrLetter; diff --git a/node_modules/lodash/_defineProperty.js b/node_modules/lodash/_defineProperty.js new file mode 100755 index 00000000..b6116d92 --- /dev/null +++ b/node_modules/lodash/_defineProperty.js @@ -0,0 +1,11 @@ +var getNative = require('./_getNative'); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; diff --git a/node_modules/lodash/_equalArrays.js b/node_modules/lodash/_equalArrays.js new file mode 100755 index 00000000..f6a3b7c9 --- /dev/null +++ b/node_modules/lodash/_equalArrays.js @@ -0,0 +1,83 @@ +var SetCache = require('./_SetCache'), + arraySome = require('./_arraySome'), + cacheHas = require('./_cacheHas'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; diff --git a/node_modules/lodash/_equalByTag.js b/node_modules/lodash/_equalByTag.js new file mode 100755 index 00000000..71919e86 --- /dev/null +++ b/node_modules/lodash/_equalByTag.js @@ -0,0 +1,112 @@ +var Symbol = require('./_Symbol'), + Uint8Array = require('./_Uint8Array'), + eq = require('./eq'), + equalArrays = require('./_equalArrays'), + mapToArray = require('./_mapToArray'), + setToArray = require('./_setToArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; diff --git a/node_modules/lodash/_equalObjects.js b/node_modules/lodash/_equalObjects.js new file mode 100755 index 00000000..17421f37 --- /dev/null +++ b/node_modules/lodash/_equalObjects.js @@ -0,0 +1,89 @@ +var getAllKeys = require('./_getAllKeys'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; diff --git a/node_modules/lodash/_escapeHtmlChar.js b/node_modules/lodash/_escapeHtmlChar.js new file mode 100755 index 00000000..7ca68ee6 --- /dev/null +++ b/node_modules/lodash/_escapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map characters to HTML entities. */ +var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; + +/** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +var escapeHtmlChar = basePropertyOf(htmlEscapes); + +module.exports = escapeHtmlChar; diff --git a/node_modules/lodash/_escapeStringChar.js b/node_modules/lodash/_escapeStringChar.js new file mode 100755 index 00000000..44eca96c --- /dev/null +++ b/node_modules/lodash/_escapeStringChar.js @@ -0,0 +1,22 @@ +/** Used to escape characters for inclusion in compiled string literals. */ +var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; +} + +module.exports = escapeStringChar; diff --git a/node_modules/lodash/_flatRest.js b/node_modules/lodash/_flatRest.js new file mode 100755 index 00000000..94ab6cca --- /dev/null +++ b/node_modules/lodash/_flatRest.js @@ -0,0 +1,16 @@ +var flatten = require('./flatten'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; diff --git a/node_modules/lodash/_freeGlobal.js b/node_modules/lodash/_freeGlobal.js new file mode 100755 index 00000000..bbec998f --- /dev/null +++ b/node_modules/lodash/_freeGlobal.js @@ -0,0 +1,4 @@ +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; diff --git a/node_modules/lodash/_getAllKeys.js b/node_modules/lodash/_getAllKeys.js new file mode 100755 index 00000000..a9ce6995 --- /dev/null +++ b/node_modules/lodash/_getAllKeys.js @@ -0,0 +1,16 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbols = require('./_getSymbols'), + keys = require('./keys'); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; diff --git a/node_modules/lodash/_getAllKeysIn.js b/node_modules/lodash/_getAllKeysIn.js new file mode 100755 index 00000000..1b466784 --- /dev/null +++ b/node_modules/lodash/_getAllKeysIn.js @@ -0,0 +1,17 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbolsIn = require('./_getSymbolsIn'), + keysIn = require('./keysIn'); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; diff --git a/node_modules/lodash/_getData.js b/node_modules/lodash/_getData.js new file mode 100755 index 00000000..a1fe7b77 --- /dev/null +++ b/node_modules/lodash/_getData.js @@ -0,0 +1,15 @@ +var metaMap = require('./_metaMap'), + noop = require('./noop'); + +/** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; + +module.exports = getData; diff --git a/node_modules/lodash/_getFuncName.js b/node_modules/lodash/_getFuncName.js new file mode 100755 index 00000000..21e15b33 --- /dev/null +++ b/node_modules/lodash/_getFuncName.js @@ -0,0 +1,31 @@ +var realNames = require('./_realNames'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ +function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; +} + +module.exports = getFuncName; diff --git a/node_modules/lodash/_getHolder.js b/node_modules/lodash/_getHolder.js new file mode 100755 index 00000000..65e94b5c --- /dev/null +++ b/node_modules/lodash/_getHolder.js @@ -0,0 +1,13 @@ +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getHolder(func) { + var object = func; + return object.placeholder; +} + +module.exports = getHolder; diff --git a/node_modules/lodash/_getMapData.js b/node_modules/lodash/_getMapData.js new file mode 100755 index 00000000..17f63032 --- /dev/null +++ b/node_modules/lodash/_getMapData.js @@ -0,0 +1,18 @@ +var isKeyable = require('./_isKeyable'); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; diff --git a/node_modules/lodash/_getMatchData.js b/node_modules/lodash/_getMatchData.js new file mode 100755 index 00000000..2cc70f91 --- /dev/null +++ b/node_modules/lodash/_getMatchData.js @@ -0,0 +1,24 @@ +var isStrictComparable = require('./_isStrictComparable'), + keys = require('./keys'); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; diff --git a/node_modules/lodash/_getNative.js b/node_modules/lodash/_getNative.js new file mode 100755 index 00000000..97a622b8 --- /dev/null +++ b/node_modules/lodash/_getNative.js @@ -0,0 +1,17 @@ +var baseIsNative = require('./_baseIsNative'), + getValue = require('./_getValue'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; diff --git a/node_modules/lodash/_getPrototype.js b/node_modules/lodash/_getPrototype.js new file mode 100755 index 00000000..e8086121 --- /dev/null +++ b/node_modules/lodash/_getPrototype.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; diff --git a/node_modules/lodash/_getRawTag.js b/node_modules/lodash/_getRawTag.js new file mode 100755 index 00000000..49a95c9c --- /dev/null +++ b/node_modules/lodash/_getRawTag.js @@ -0,0 +1,46 @@ +var Symbol = require('./_Symbol'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; diff --git a/node_modules/lodash/_getSymbols.js b/node_modules/lodash/_getSymbols.js new file mode 100755 index 00000000..7d6eafeb --- /dev/null +++ b/node_modules/lodash/_getSymbols.js @@ -0,0 +1,30 @@ +var arrayFilter = require('./_arrayFilter'), + stubArray = require('./stubArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; diff --git a/node_modules/lodash/_getSymbolsIn.js b/node_modules/lodash/_getSymbolsIn.js new file mode 100755 index 00000000..cec0855a --- /dev/null +++ b/node_modules/lodash/_getSymbolsIn.js @@ -0,0 +1,25 @@ +var arrayPush = require('./_arrayPush'), + getPrototype = require('./_getPrototype'), + getSymbols = require('./_getSymbols'), + stubArray = require('./stubArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; diff --git a/node_modules/lodash/_getTag.js b/node_modules/lodash/_getTag.js new file mode 100755 index 00000000..deaf89d5 --- /dev/null +++ b/node_modules/lodash/_getTag.js @@ -0,0 +1,58 @@ +var DataView = require('./_DataView'), + Map = require('./_Map'), + Promise = require('./_Promise'), + Set = require('./_Set'), + WeakMap = require('./_WeakMap'), + baseGetTag = require('./_baseGetTag'), + toSource = require('./_toSource'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; diff --git a/node_modules/lodash/_getValue.js b/node_modules/lodash/_getValue.js new file mode 100755 index 00000000..5f7d7736 --- /dev/null +++ b/node_modules/lodash/_getValue.js @@ -0,0 +1,13 @@ +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; diff --git a/node_modules/lodash/_getView.js b/node_modules/lodash/_getView.js new file mode 100755 index 00000000..df1e5d44 --- /dev/null +++ b/node_modules/lodash/_getView.js @@ -0,0 +1,33 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ +function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; +} + +module.exports = getView; diff --git a/node_modules/lodash/_getWrapDetails.js b/node_modules/lodash/_getWrapDetails.js new file mode 100755 index 00000000..3bcc6e48 --- /dev/null +++ b/node_modules/lodash/_getWrapDetails.js @@ -0,0 +1,17 @@ +/** Used to match wrap detail comments. */ +var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + +/** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ +function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; +} + +module.exports = getWrapDetails; diff --git a/node_modules/lodash/_hasPath.js b/node_modules/lodash/_hasPath.js new file mode 100755 index 00000000..93dbde15 --- /dev/null +++ b/node_modules/lodash/_hasPath.js @@ -0,0 +1,39 @@ +var castPath = require('./_castPath'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isIndex = require('./_isIndex'), + isLength = require('./isLength'), + toKey = require('./_toKey'); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; diff --git a/node_modules/lodash/_hasUnicode.js b/node_modules/lodash/_hasUnicode.js new file mode 100755 index 00000000..cb6ca15f --- /dev/null +++ b/node_modules/lodash/_hasUnicode.js @@ -0,0 +1,26 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +module.exports = hasUnicode; diff --git a/node_modules/lodash/_hasUnicodeWord.js b/node_modules/lodash/_hasUnicodeWord.js new file mode 100755 index 00000000..a35d6e50 --- /dev/null +++ b/node_modules/lodash/_hasUnicodeWord.js @@ -0,0 +1,15 @@ +/** Used to detect strings that need a more robust regexp to match words. */ +var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + +/** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ +function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); +} + +module.exports = hasUnicodeWord; diff --git a/node_modules/lodash/_hashClear.js b/node_modules/lodash/_hashClear.js new file mode 100755 index 00000000..5d4b70cc --- /dev/null +++ b/node_modules/lodash/_hashClear.js @@ -0,0 +1,15 @@ +var nativeCreate = require('./_nativeCreate'); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; diff --git a/node_modules/lodash/_hashDelete.js b/node_modules/lodash/_hashDelete.js new file mode 100755 index 00000000..ea9dabf1 --- /dev/null +++ b/node_modules/lodash/_hashDelete.js @@ -0,0 +1,17 @@ +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; diff --git a/node_modules/lodash/_hashGet.js b/node_modules/lodash/_hashGet.js new file mode 100755 index 00000000..1fc2f34b --- /dev/null +++ b/node_modules/lodash/_hashGet.js @@ -0,0 +1,30 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; diff --git a/node_modules/lodash/_hashHas.js b/node_modules/lodash/_hashHas.js new file mode 100755 index 00000000..281a5517 --- /dev/null +++ b/node_modules/lodash/_hashHas.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; diff --git a/node_modules/lodash/_hashSet.js b/node_modules/lodash/_hashSet.js new file mode 100755 index 00000000..e1055283 --- /dev/null +++ b/node_modules/lodash/_hashSet.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; diff --git a/node_modules/lodash/_initCloneArray.js b/node_modules/lodash/_initCloneArray.js new file mode 100755 index 00000000..aef02120 --- /dev/null +++ b/node_modules/lodash/_initCloneArray.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; diff --git a/node_modules/lodash/_initCloneByTag.js b/node_modules/lodash/_initCloneByTag.js new file mode 100755 index 00000000..e7b77edc --- /dev/null +++ b/node_modules/lodash/_initCloneByTag.js @@ -0,0 +1,80 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'), + cloneDataView = require('./_cloneDataView'), + cloneMap = require('./_cloneMap'), + cloneRegExp = require('./_cloneRegExp'), + cloneSet = require('./_cloneSet'), + cloneSymbol = require('./_cloneSymbol'), + cloneTypedArray = require('./_cloneTypedArray'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; diff --git a/node_modules/lodash/_initCloneObject.js b/node_modules/lodash/_initCloneObject.js new file mode 100755 index 00000000..5a13e64a --- /dev/null +++ b/node_modules/lodash/_initCloneObject.js @@ -0,0 +1,18 @@ +var baseCreate = require('./_baseCreate'), + getPrototype = require('./_getPrototype'), + isPrototype = require('./_isPrototype'); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; diff --git a/node_modules/lodash/_insertWrapDetails.js b/node_modules/lodash/_insertWrapDetails.js new file mode 100755 index 00000000..e7908086 --- /dev/null +++ b/node_modules/lodash/_insertWrapDetails.js @@ -0,0 +1,23 @@ +/** Used to match wrap detail comments. */ +var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; + +/** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ +function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); +} + +module.exports = insertWrapDetails; diff --git a/node_modules/lodash/_isFlattenable.js b/node_modules/lodash/_isFlattenable.js new file mode 100755 index 00000000..4cc2c249 --- /dev/null +++ b/node_modules/lodash/_isFlattenable.js @@ -0,0 +1,20 @@ +var Symbol = require('./_Symbol'), + isArguments = require('./isArguments'), + isArray = require('./isArray'); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; diff --git a/node_modules/lodash/_isIndex.js b/node_modules/lodash/_isIndex.js new file mode 100755 index 00000000..e123dde8 --- /dev/null +++ b/node_modules/lodash/_isIndex.js @@ -0,0 +1,22 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; diff --git a/node_modules/lodash/_isIterateeCall.js b/node_modules/lodash/_isIterateeCall.js new file mode 100755 index 00000000..a0bb5a9c --- /dev/null +++ b/node_modules/lodash/_isIterateeCall.js @@ -0,0 +1,30 @@ +var eq = require('./eq'), + isArrayLike = require('./isArrayLike'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; diff --git a/node_modules/lodash/_isKey.js b/node_modules/lodash/_isKey.js new file mode 100755 index 00000000..ff08b068 --- /dev/null +++ b/node_modules/lodash/_isKey.js @@ -0,0 +1,29 @@ +var isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; diff --git a/node_modules/lodash/_isKeyable.js b/node_modules/lodash/_isKeyable.js new file mode 100755 index 00000000..39f1828d --- /dev/null +++ b/node_modules/lodash/_isKeyable.js @@ -0,0 +1,15 @@ +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; diff --git a/node_modules/lodash/_isLaziable.js b/node_modules/lodash/_isLaziable.js new file mode 100755 index 00000000..a57c4f2d --- /dev/null +++ b/node_modules/lodash/_isLaziable.js @@ -0,0 +1,28 @@ +var LazyWrapper = require('./_LazyWrapper'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + lodash = require('./wrapperLodash'); + +/** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ +function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; +} + +module.exports = isLaziable; diff --git a/node_modules/lodash/_isMaskable.js b/node_modules/lodash/_isMaskable.js new file mode 100755 index 00000000..eb98d09f --- /dev/null +++ b/node_modules/lodash/_isMaskable.js @@ -0,0 +1,14 @@ +var coreJsData = require('./_coreJsData'), + isFunction = require('./isFunction'), + stubFalse = require('./stubFalse'); + +/** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ +var isMaskable = coreJsData ? isFunction : stubFalse; + +module.exports = isMaskable; diff --git a/node_modules/lodash/_isMasked.js b/node_modules/lodash/_isMasked.js new file mode 100755 index 00000000..4b0f21ba --- /dev/null +++ b/node_modules/lodash/_isMasked.js @@ -0,0 +1,20 @@ +var coreJsData = require('./_coreJsData'); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; diff --git a/node_modules/lodash/_isPrototype.js b/node_modules/lodash/_isPrototype.js new file mode 100755 index 00000000..0f29498d --- /dev/null +++ b/node_modules/lodash/_isPrototype.js @@ -0,0 +1,18 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; diff --git a/node_modules/lodash/_isStrictComparable.js b/node_modules/lodash/_isStrictComparable.js new file mode 100755 index 00000000..b59f40b8 --- /dev/null +++ b/node_modules/lodash/_isStrictComparable.js @@ -0,0 +1,15 @@ +var isObject = require('./isObject'); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; diff --git a/node_modules/lodash/_iteratorToArray.js b/node_modules/lodash/_iteratorToArray.js new file mode 100755 index 00000000..47685664 --- /dev/null +++ b/node_modules/lodash/_iteratorToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ +function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; +} + +module.exports = iteratorToArray; diff --git a/node_modules/lodash/_lazyClone.js b/node_modules/lodash/_lazyClone.js new file mode 100755 index 00000000..d8a51f87 --- /dev/null +++ b/node_modules/lodash/_lazyClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ +function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; +} + +module.exports = lazyClone; diff --git a/node_modules/lodash/_lazyReverse.js b/node_modules/lodash/_lazyReverse.js new file mode 100755 index 00000000..c5b52190 --- /dev/null +++ b/node_modules/lodash/_lazyReverse.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'); + +/** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ +function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; +} + +module.exports = lazyReverse; diff --git a/node_modules/lodash/_lazyValue.js b/node_modules/lodash/_lazyValue.js new file mode 100755 index 00000000..371ca8d2 --- /dev/null +++ b/node_modules/lodash/_lazyValue.js @@ -0,0 +1,69 @@ +var baseWrapperValue = require('./_baseWrapperValue'), + getView = require('./_getView'), + isArray = require('./isArray'); + +/** Used to indicate the type of lazy iteratees. */ +var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ +function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; +} + +module.exports = lazyValue; diff --git a/node_modules/lodash/_listCacheClear.js b/node_modules/lodash/_listCacheClear.js new file mode 100755 index 00000000..acbe39a5 --- /dev/null +++ b/node_modules/lodash/_listCacheClear.js @@ -0,0 +1,13 @@ +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; diff --git a/node_modules/lodash/_listCacheDelete.js b/node_modules/lodash/_listCacheDelete.js new file mode 100755 index 00000000..b1384ade --- /dev/null +++ b/node_modules/lodash/_listCacheDelete.js @@ -0,0 +1,35 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; diff --git a/node_modules/lodash/_listCacheGet.js b/node_modules/lodash/_listCacheGet.js new file mode 100755 index 00000000..f8192fc3 --- /dev/null +++ b/node_modules/lodash/_listCacheGet.js @@ -0,0 +1,19 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; diff --git a/node_modules/lodash/_listCacheHas.js b/node_modules/lodash/_listCacheHas.js new file mode 100755 index 00000000..2adf6714 --- /dev/null +++ b/node_modules/lodash/_listCacheHas.js @@ -0,0 +1,16 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; diff --git a/node_modules/lodash/_listCacheSet.js b/node_modules/lodash/_listCacheSet.js new file mode 100755 index 00000000..5855c95e --- /dev/null +++ b/node_modules/lodash/_listCacheSet.js @@ -0,0 +1,26 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; diff --git a/node_modules/lodash/_mapCacheClear.js b/node_modules/lodash/_mapCacheClear.js new file mode 100755 index 00000000..bc9ca204 --- /dev/null +++ b/node_modules/lodash/_mapCacheClear.js @@ -0,0 +1,21 @@ +var Hash = require('./_Hash'), + ListCache = require('./_ListCache'), + Map = require('./_Map'); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; diff --git a/node_modules/lodash/_mapCacheDelete.js b/node_modules/lodash/_mapCacheDelete.js new file mode 100755 index 00000000..946ca3c9 --- /dev/null +++ b/node_modules/lodash/_mapCacheDelete.js @@ -0,0 +1,18 @@ +var getMapData = require('./_getMapData'); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; diff --git a/node_modules/lodash/_mapCacheGet.js b/node_modules/lodash/_mapCacheGet.js new file mode 100755 index 00000000..f29f55cf --- /dev/null +++ b/node_modules/lodash/_mapCacheGet.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; diff --git a/node_modules/lodash/_mapCacheHas.js b/node_modules/lodash/_mapCacheHas.js new file mode 100755 index 00000000..a1214c02 --- /dev/null +++ b/node_modules/lodash/_mapCacheHas.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; diff --git a/node_modules/lodash/_mapCacheSet.js b/node_modules/lodash/_mapCacheSet.js new file mode 100755 index 00000000..73468492 --- /dev/null +++ b/node_modules/lodash/_mapCacheSet.js @@ -0,0 +1,22 @@ +var getMapData = require('./_getMapData'); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; diff --git a/node_modules/lodash/_mapToArray.js b/node_modules/lodash/_mapToArray.js new file mode 100755 index 00000000..fe3dd531 --- /dev/null +++ b/node_modules/lodash/_mapToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; diff --git a/node_modules/lodash/_matchesStrictComparable.js b/node_modules/lodash/_matchesStrictComparable.js new file mode 100755 index 00000000..f608af9e --- /dev/null +++ b/node_modules/lodash/_matchesStrictComparable.js @@ -0,0 +1,20 @@ +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; diff --git a/node_modules/lodash/_memoizeCapped.js b/node_modules/lodash/_memoizeCapped.js new file mode 100755 index 00000000..7f71c8fb --- /dev/null +++ b/node_modules/lodash/_memoizeCapped.js @@ -0,0 +1,26 @@ +var memoize = require('./memoize'); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; diff --git a/node_modules/lodash/_mergeData.js b/node_modules/lodash/_mergeData.js new file mode 100755 index 00000000..cb570f97 --- /dev/null +++ b/node_modules/lodash/_mergeData.js @@ -0,0 +1,90 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + replaceHolders = require('./_replaceHolders'); + +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ +function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; +} + +module.exports = mergeData; diff --git a/node_modules/lodash/_metaMap.js b/node_modules/lodash/_metaMap.js new file mode 100755 index 00000000..0157a0b0 --- /dev/null +++ b/node_modules/lodash/_metaMap.js @@ -0,0 +1,6 @@ +var WeakMap = require('./_WeakMap'); + +/** Used to store function metadata. */ +var metaMap = WeakMap && new WeakMap; + +module.exports = metaMap; diff --git a/node_modules/lodash/_nativeCreate.js b/node_modules/lodash/_nativeCreate.js new file mode 100755 index 00000000..c7aede85 --- /dev/null +++ b/node_modules/lodash/_nativeCreate.js @@ -0,0 +1,6 @@ +var getNative = require('./_getNative'); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; diff --git a/node_modules/lodash/_nativeKeys.js b/node_modules/lodash/_nativeKeys.js new file mode 100755 index 00000000..479a104a --- /dev/null +++ b/node_modules/lodash/_nativeKeys.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; diff --git a/node_modules/lodash/_nativeKeysIn.js b/node_modules/lodash/_nativeKeysIn.js new file mode 100755 index 00000000..00ee5059 --- /dev/null +++ b/node_modules/lodash/_nativeKeysIn.js @@ -0,0 +1,20 @@ +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; diff --git a/node_modules/lodash/_nodeUtil.js b/node_modules/lodash/_nodeUtil.js new file mode 100755 index 00000000..14e179fe --- /dev/null +++ b/node_modules/lodash/_nodeUtil.js @@ -0,0 +1,22 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; diff --git a/node_modules/lodash/_objectToString.js b/node_modules/lodash/_objectToString.js new file mode 100755 index 00000000..c614ec09 --- /dev/null +++ b/node_modules/lodash/_objectToString.js @@ -0,0 +1,22 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; diff --git a/node_modules/lodash/_overArg.js b/node_modules/lodash/_overArg.js new file mode 100755 index 00000000..651c5c55 --- /dev/null +++ b/node_modules/lodash/_overArg.js @@ -0,0 +1,15 @@ +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; diff --git a/node_modules/lodash/_overRest.js b/node_modules/lodash/_overRest.js new file mode 100755 index 00000000..c7cdef33 --- /dev/null +++ b/node_modules/lodash/_overRest.js @@ -0,0 +1,36 @@ +var apply = require('./_apply'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; diff --git a/node_modules/lodash/_parent.js b/node_modules/lodash/_parent.js new file mode 100755 index 00000000..f174328f --- /dev/null +++ b/node_modules/lodash/_parent.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'), + baseSlice = require('./_baseSlice'); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; diff --git a/node_modules/lodash/_reEscape.js b/node_modules/lodash/_reEscape.js new file mode 100755 index 00000000..7f47eda6 --- /dev/null +++ b/node_modules/lodash/_reEscape.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEscape = /<%-([\s\S]+?)%>/g; + +module.exports = reEscape; diff --git a/node_modules/lodash/_reEvaluate.js b/node_modules/lodash/_reEvaluate.js new file mode 100755 index 00000000..6adfc312 --- /dev/null +++ b/node_modules/lodash/_reEvaluate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEvaluate = /<%([\s\S]+?)%>/g; + +module.exports = reEvaluate; diff --git a/node_modules/lodash/_reInterpolate.js b/node_modules/lodash/_reInterpolate.js new file mode 100755 index 00000000..d02ff0b2 --- /dev/null +++ b/node_modules/lodash/_reInterpolate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reInterpolate = /<%=([\s\S]+?)%>/g; + +module.exports = reInterpolate; diff --git a/node_modules/lodash/_realNames.js b/node_modules/lodash/_realNames.js new file mode 100755 index 00000000..aa0d5292 --- /dev/null +++ b/node_modules/lodash/_realNames.js @@ -0,0 +1,4 @@ +/** Used to lookup unminified function names. */ +var realNames = {}; + +module.exports = realNames; diff --git a/node_modules/lodash/_reorder.js b/node_modules/lodash/_reorder.js new file mode 100755 index 00000000..a3502b05 --- /dev/null +++ b/node_modules/lodash/_reorder.js @@ -0,0 +1,29 @@ +var copyArray = require('./_copyArray'), + isIndex = require('./_isIndex'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ +function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; +} + +module.exports = reorder; diff --git a/node_modules/lodash/_replaceHolders.js b/node_modules/lodash/_replaceHolders.js new file mode 100755 index 00000000..74360ec4 --- /dev/null +++ b/node_modules/lodash/_replaceHolders.js @@ -0,0 +1,29 @@ +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ +function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; +} + +module.exports = replaceHolders; diff --git a/node_modules/lodash/_root.js b/node_modules/lodash/_root.js new file mode 100755 index 00000000..d2852bed --- /dev/null +++ b/node_modules/lodash/_root.js @@ -0,0 +1,9 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; diff --git a/node_modules/lodash/_setCacheAdd.js b/node_modules/lodash/_setCacheAdd.js new file mode 100755 index 00000000..1081a744 --- /dev/null +++ b/node_modules/lodash/_setCacheAdd.js @@ -0,0 +1,19 @@ +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; diff --git a/node_modules/lodash/_setCacheHas.js b/node_modules/lodash/_setCacheHas.js new file mode 100755 index 00000000..9a492556 --- /dev/null +++ b/node_modules/lodash/_setCacheHas.js @@ -0,0 +1,14 @@ +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; diff --git a/node_modules/lodash/_setData.js b/node_modules/lodash/_setData.js new file mode 100755 index 00000000..e5cf3eb9 --- /dev/null +++ b/node_modules/lodash/_setData.js @@ -0,0 +1,20 @@ +var baseSetData = require('./_baseSetData'), + shortOut = require('./_shortOut'); + +/** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var setData = shortOut(baseSetData); + +module.exports = setData; diff --git a/node_modules/lodash/_setToArray.js b/node_modules/lodash/_setToArray.js new file mode 100755 index 00000000..b87f0741 --- /dev/null +++ b/node_modules/lodash/_setToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; diff --git a/node_modules/lodash/_setToPairs.js b/node_modules/lodash/_setToPairs.js new file mode 100755 index 00000000..36ad37a0 --- /dev/null +++ b/node_modules/lodash/_setToPairs.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; diff --git a/node_modules/lodash/_setToString.js b/node_modules/lodash/_setToString.js new file mode 100755 index 00000000..6ca84196 --- /dev/null +++ b/node_modules/lodash/_setToString.js @@ -0,0 +1,14 @@ +var baseSetToString = require('./_baseSetToString'), + shortOut = require('./_shortOut'); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; diff --git a/node_modules/lodash/_setWrapToString.js b/node_modules/lodash/_setWrapToString.js new file mode 100755 index 00000000..decdc449 --- /dev/null +++ b/node_modules/lodash/_setWrapToString.js @@ -0,0 +1,21 @@ +var getWrapDetails = require('./_getWrapDetails'), + insertWrapDetails = require('./_insertWrapDetails'), + setToString = require('./_setToString'), + updateWrapDetails = require('./_updateWrapDetails'); + +/** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ +function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); +} + +module.exports = setWrapToString; diff --git a/node_modules/lodash/_shortOut.js b/node_modules/lodash/_shortOut.js new file mode 100755 index 00000000..3300a079 --- /dev/null +++ b/node_modules/lodash/_shortOut.js @@ -0,0 +1,37 @@ +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; diff --git a/node_modules/lodash/_shuffleSelf.js b/node_modules/lodash/_shuffleSelf.js new file mode 100755 index 00000000..8bcc4f5c --- /dev/null +++ b/node_modules/lodash/_shuffleSelf.js @@ -0,0 +1,28 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ +function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; +} + +module.exports = shuffleSelf; diff --git a/node_modules/lodash/_stackClear.js b/node_modules/lodash/_stackClear.js new file mode 100755 index 00000000..ce8e5a92 --- /dev/null +++ b/node_modules/lodash/_stackClear.js @@ -0,0 +1,15 @@ +var ListCache = require('./_ListCache'); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; diff --git a/node_modules/lodash/_stackDelete.js b/node_modules/lodash/_stackDelete.js new file mode 100755 index 00000000..ff9887ab --- /dev/null +++ b/node_modules/lodash/_stackDelete.js @@ -0,0 +1,18 @@ +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; diff --git a/node_modules/lodash/_stackGet.js b/node_modules/lodash/_stackGet.js new file mode 100755 index 00000000..1cdf0040 --- /dev/null +++ b/node_modules/lodash/_stackGet.js @@ -0,0 +1,14 @@ +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; diff --git a/node_modules/lodash/_stackHas.js b/node_modules/lodash/_stackHas.js new file mode 100755 index 00000000..16a3ad11 --- /dev/null +++ b/node_modules/lodash/_stackHas.js @@ -0,0 +1,14 @@ +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; diff --git a/node_modules/lodash/_stackSet.js b/node_modules/lodash/_stackSet.js new file mode 100755 index 00000000..b790ac5f --- /dev/null +++ b/node_modules/lodash/_stackSet.js @@ -0,0 +1,34 @@ +var ListCache = require('./_ListCache'), + Map = require('./_Map'), + MapCache = require('./_MapCache'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; diff --git a/node_modules/lodash/_strictIndexOf.js b/node_modules/lodash/_strictIndexOf.js new file mode 100755 index 00000000..0486a495 --- /dev/null +++ b/node_modules/lodash/_strictIndexOf.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; diff --git a/node_modules/lodash/_strictLastIndexOf.js b/node_modules/lodash/_strictLastIndexOf.js new file mode 100755 index 00000000..d7310dcc --- /dev/null +++ b/node_modules/lodash/_strictLastIndexOf.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; +} + +module.exports = strictLastIndexOf; diff --git a/node_modules/lodash/_stringSize.js b/node_modules/lodash/_stringSize.js new file mode 100755 index 00000000..17ef462a --- /dev/null +++ b/node_modules/lodash/_stringSize.js @@ -0,0 +1,18 @@ +var asciiSize = require('./_asciiSize'), + hasUnicode = require('./_hasUnicode'), + unicodeSize = require('./_unicodeSize'); + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); +} + +module.exports = stringSize; diff --git a/node_modules/lodash/_stringToArray.js b/node_modules/lodash/_stringToArray.js new file mode 100755 index 00000000..d161158c --- /dev/null +++ b/node_modules/lodash/_stringToArray.js @@ -0,0 +1,18 @@ +var asciiToArray = require('./_asciiToArray'), + hasUnicode = require('./_hasUnicode'), + unicodeToArray = require('./_unicodeToArray'); + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +module.exports = stringToArray; diff --git a/node_modules/lodash/_stringToPath.js b/node_modules/lodash/_stringToPath.js new file mode 100755 index 00000000..db7b0f7d --- /dev/null +++ b/node_modules/lodash/_stringToPath.js @@ -0,0 +1,28 @@ +var memoizeCapped = require('./_memoizeCapped'); + +/** Used to match property names within property paths. */ +var reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; diff --git a/node_modules/lodash/_toKey.js b/node_modules/lodash/_toKey.js new file mode 100755 index 00000000..c6d645c4 --- /dev/null +++ b/node_modules/lodash/_toKey.js @@ -0,0 +1,21 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; diff --git a/node_modules/lodash/_toSource.js b/node_modules/lodash/_toSource.js new file mode 100755 index 00000000..a020b386 --- /dev/null +++ b/node_modules/lodash/_toSource.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; diff --git a/node_modules/lodash/_unescapeHtmlChar.js b/node_modules/lodash/_unescapeHtmlChar.js new file mode 100755 index 00000000..a71fecb3 --- /dev/null +++ b/node_modules/lodash/_unescapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map HTML entities to characters. */ +var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; + +/** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ +var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + +module.exports = unescapeHtmlChar; diff --git a/node_modules/lodash/_unicodeSize.js b/node_modules/lodash/_unicodeSize.js new file mode 100755 index 00000000..68137ec2 --- /dev/null +++ b/node_modules/lodash/_unicodeSize.js @@ -0,0 +1,44 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; +} + +module.exports = unicodeSize; diff --git a/node_modules/lodash/_unicodeToArray.js b/node_modules/lodash/_unicodeToArray.js new file mode 100755 index 00000000..2a725c06 --- /dev/null +++ b/node_modules/lodash/_unicodeToArray.js @@ -0,0 +1,40 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +module.exports = unicodeToArray; diff --git a/node_modules/lodash/_unicodeWords.js b/node_modules/lodash/_unicodeWords.js new file mode 100755 index 00000000..d8b822ad --- /dev/null +++ b/node_modules/lodash/_unicodeWords.js @@ -0,0 +1,69 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]", + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)', + rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; + +/** Used to match complex or compound words. */ +var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji +].join('|'), 'g'); + +/** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function unicodeWords(string) { + return string.match(reUnicodeWord) || []; +} + +module.exports = unicodeWords; diff --git a/node_modules/lodash/_updateWrapDetails.js b/node_modules/lodash/_updateWrapDetails.js new file mode 100755 index 00000000..8759fbdf --- /dev/null +++ b/node_modules/lodash/_updateWrapDetails.js @@ -0,0 +1,46 @@ +var arrayEach = require('./_arrayEach'), + arrayIncludes = require('./_arrayIncludes'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + +/** Used to associate wrap methods with their bit flags. */ +var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] +]; + +/** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ +function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); +} + +module.exports = updateWrapDetails; diff --git a/node_modules/lodash/_wrapperClone.js b/node_modules/lodash/_wrapperClone.js new file mode 100755 index 00000000..7bb58a2e --- /dev/null +++ b/node_modules/lodash/_wrapperClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + LodashWrapper = require('./_LodashWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ +function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; +} + +module.exports = wrapperClone; diff --git a/node_modules/lodash/add.js b/node_modules/lodash/add.js new file mode 100755 index 00000000..f0695156 --- /dev/null +++ b/node_modules/lodash/add.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Adds two numbers. + * + * @static + * @memberOf _ + * @since 3.4.0 + * @category Math + * @param {number} augend The first number in an addition. + * @param {number} addend The second number in an addition. + * @returns {number} Returns the total. + * @example + * + * _.add(6, 4); + * // => 10 + */ +var add = createMathOperation(function(augend, addend) { + return augend + addend; +}, 0); + +module.exports = add; diff --git a/node_modules/lodash/after.js b/node_modules/lodash/after.js new file mode 100755 index 00000000..3900c979 --- /dev/null +++ b/node_modules/lodash/after.js @@ -0,0 +1,42 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ +function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; +} + +module.exports = after; diff --git a/node_modules/lodash/array.js b/node_modules/lodash/array.js new file mode 100755 index 00000000..af688d3e --- /dev/null +++ b/node_modules/lodash/array.js @@ -0,0 +1,67 @@ +module.exports = { + 'chunk': require('./chunk'), + 'compact': require('./compact'), + 'concat': require('./concat'), + 'difference': require('./difference'), + 'differenceBy': require('./differenceBy'), + 'differenceWith': require('./differenceWith'), + 'drop': require('./drop'), + 'dropRight': require('./dropRight'), + 'dropRightWhile': require('./dropRightWhile'), + 'dropWhile': require('./dropWhile'), + 'fill': require('./fill'), + 'findIndex': require('./findIndex'), + 'findLastIndex': require('./findLastIndex'), + 'first': require('./first'), + 'flatten': require('./flatten'), + 'flattenDeep': require('./flattenDeep'), + 'flattenDepth': require('./flattenDepth'), + 'fromPairs': require('./fromPairs'), + 'head': require('./head'), + 'indexOf': require('./indexOf'), + 'initial': require('./initial'), + 'intersection': require('./intersection'), + 'intersectionBy': require('./intersectionBy'), + 'intersectionWith': require('./intersectionWith'), + 'join': require('./join'), + 'last': require('./last'), + 'lastIndexOf': require('./lastIndexOf'), + 'nth': require('./nth'), + 'pull': require('./pull'), + 'pullAll': require('./pullAll'), + 'pullAllBy': require('./pullAllBy'), + 'pullAllWith': require('./pullAllWith'), + 'pullAt': require('./pullAt'), + 'remove': require('./remove'), + 'reverse': require('./reverse'), + 'slice': require('./slice'), + 'sortedIndex': require('./sortedIndex'), + 'sortedIndexBy': require('./sortedIndexBy'), + 'sortedIndexOf': require('./sortedIndexOf'), + 'sortedLastIndex': require('./sortedLastIndex'), + 'sortedLastIndexBy': require('./sortedLastIndexBy'), + 'sortedLastIndexOf': require('./sortedLastIndexOf'), + 'sortedUniq': require('./sortedUniq'), + 'sortedUniqBy': require('./sortedUniqBy'), + 'tail': require('./tail'), + 'take': require('./take'), + 'takeRight': require('./takeRight'), + 'takeRightWhile': require('./takeRightWhile'), + 'takeWhile': require('./takeWhile'), + 'union': require('./union'), + 'unionBy': require('./unionBy'), + 'unionWith': require('./unionWith'), + 'uniq': require('./uniq'), + 'uniqBy': require('./uniqBy'), + 'uniqWith': require('./uniqWith'), + 'unzip': require('./unzip'), + 'unzipWith': require('./unzipWith'), + 'without': require('./without'), + 'xor': require('./xor'), + 'xorBy': require('./xorBy'), + 'xorWith': require('./xorWith'), + 'zip': require('./zip'), + 'zipObject': require('./zipObject'), + 'zipObjectDeep': require('./zipObjectDeep'), + 'zipWith': require('./zipWith') +}; diff --git a/node_modules/lodash/ary.js b/node_modules/lodash/ary.js new file mode 100755 index 00000000..70c87d09 --- /dev/null +++ b/node_modules/lodash/ary.js @@ -0,0 +1,29 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_ARY_FLAG = 128; + +/** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ +function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); +} + +module.exports = ary; diff --git a/node_modules/lodash/assign.js b/node_modules/lodash/assign.js new file mode 100755 index 00000000..909db26a --- /dev/null +++ b/node_modules/lodash/assign.js @@ -0,0 +1,58 @@ +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), + keys = require('./keys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; diff --git a/node_modules/lodash/assignIn.js b/node_modules/lodash/assignIn.js new file mode 100755 index 00000000..e663473a --- /dev/null +++ b/node_modules/lodash/assignIn.js @@ -0,0 +1,40 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ +var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); +}); + +module.exports = assignIn; diff --git a/node_modules/lodash/assignInWith.js b/node_modules/lodash/assignInWith.js new file mode 100755 index 00000000..68fcc0b0 --- /dev/null +++ b/node_modules/lodash/assignInWith.js @@ -0,0 +1,38 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); +}); + +module.exports = assignInWith; diff --git a/node_modules/lodash/assignWith.js b/node_modules/lodash/assignWith.js new file mode 100755 index 00000000..7dc6c761 --- /dev/null +++ b/node_modules/lodash/assignWith.js @@ -0,0 +1,37 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keys = require('./keys'); + +/** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); +}); + +module.exports = assignWith; diff --git a/node_modules/lodash/at.js b/node_modules/lodash/at.js new file mode 100755 index 00000000..781ee9e5 --- /dev/null +++ b/node_modules/lodash/at.js @@ -0,0 +1,23 @@ +var baseAt = require('./_baseAt'), + flatRest = require('./_flatRest'); + +/** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ +var at = flatRest(baseAt); + +module.exports = at; diff --git a/node_modules/lodash/attempt.js b/node_modules/lodash/attempt.js new file mode 100755 index 00000000..624d0152 --- /dev/null +++ b/node_modules/lodash/attempt.js @@ -0,0 +1,35 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + isError = require('./isError'); + +/** + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the `func` result or error object. + * @example + * + * // Avoid throwing errors for invalid selectors. + * var elements = _.attempt(function(selector) { + * return document.querySelectorAll(selector); + * }, '>_>'); + * + * if (_.isError(elements)) { + * elements = []; + * } + */ +var attempt = baseRest(function(func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } +}); + +module.exports = attempt; diff --git a/node_modules/lodash/before.js b/node_modules/lodash/before.js new file mode 100755 index 00000000..a3e0a16c --- /dev/null +++ b/node_modules/lodash/before.js @@ -0,0 +1,40 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ +function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; +} + +module.exports = before; diff --git a/node_modules/lodash/bind.js b/node_modules/lodash/bind.js new file mode 100755 index 00000000..b1076e93 --- /dev/null +++ b/node_modules/lodash/bind.js @@ -0,0 +1,57 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ +var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); +}); + +// Assign default placeholders. +bind.placeholder = {}; + +module.exports = bind; diff --git a/node_modules/lodash/bindAll.js b/node_modules/lodash/bindAll.js new file mode 100755 index 00000000..a35706de --- /dev/null +++ b/node_modules/lodash/bindAll.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseAssignValue = require('./_baseAssignValue'), + bind = require('./bind'), + flatRest = require('./_flatRest'), + toKey = require('./_toKey'); + +/** + * Binds methods of an object to the object itself, overwriting the existing + * method. + * + * **Note:** This method doesn't set the "length" property of bound functions. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} methodNames The object method names to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'click': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); + * // => Logs 'clicked docs' when clicked. + */ +var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { + key = toKey(key); + baseAssignValue(object, key, bind(object[key], object)); + }); + return object; +}); + +module.exports = bindAll; diff --git a/node_modules/lodash/bindKey.js b/node_modules/lodash/bindKey.js new file mode 100755 index 00000000..f7fd64cd --- /dev/null +++ b/node_modules/lodash/bindKey.js @@ -0,0 +1,68 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ +var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); +}); + +// Assign default placeholders. +bindKey.placeholder = {}; + +module.exports = bindKey; diff --git a/node_modules/lodash/camelCase.js b/node_modules/lodash/camelCase.js new file mode 100755 index 00000000..d7390def --- /dev/null +++ b/node_modules/lodash/camelCase.js @@ -0,0 +1,29 @@ +var capitalize = require('./capitalize'), + createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ +var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); +}); + +module.exports = camelCase; diff --git a/node_modules/lodash/capitalize.js b/node_modules/lodash/capitalize.js new file mode 100755 index 00000000..3e1600e7 --- /dev/null +++ b/node_modules/lodash/capitalize.js @@ -0,0 +1,23 @@ +var toString = require('./toString'), + upperFirst = require('./upperFirst'); + +/** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ +function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); +} + +module.exports = capitalize; diff --git a/node_modules/lodash/castArray.js b/node_modules/lodash/castArray.js new file mode 100755 index 00000000..e470bdb9 --- /dev/null +++ b/node_modules/lodash/castArray.js @@ -0,0 +1,44 @@ +var isArray = require('./isArray'); + +/** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ +function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; +} + +module.exports = castArray; diff --git a/node_modules/lodash/ceil.js b/node_modules/lodash/ceil.js new file mode 100755 index 00000000..56c8722c --- /dev/null +++ b/node_modules/lodash/ceil.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded up to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round up. + * @param {number} [precision=0] The precision to round up to. + * @returns {number} Returns the rounded up number. + * @example + * + * _.ceil(4.006); + * // => 5 + * + * _.ceil(6.004, 2); + * // => 6.01 + * + * _.ceil(6040, -2); + * // => 6100 + */ +var ceil = createRound('ceil'); + +module.exports = ceil; diff --git a/node_modules/lodash/chain.js b/node_modules/lodash/chain.js new file mode 100755 index 00000000..f6cd6475 --- /dev/null +++ b/node_modules/lodash/chain.js @@ -0,0 +1,38 @@ +var lodash = require('./wrapperLodash'); + +/** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ +function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; +} + +module.exports = chain; diff --git a/node_modules/lodash/chunk.js b/node_modules/lodash/chunk.js new file mode 100755 index 00000000..5b562fef --- /dev/null +++ b/node_modules/lodash/chunk.js @@ -0,0 +1,50 @@ +var baseSlice = require('./_baseSlice'), + isIterateeCall = require('./_isIterateeCall'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ +function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; +} + +module.exports = chunk; diff --git a/node_modules/lodash/clamp.js b/node_modules/lodash/clamp.js new file mode 100755 index 00000000..91a72c97 --- /dev/null +++ b/node_modules/lodash/clamp.js @@ -0,0 +1,39 @@ +var baseClamp = require('./_baseClamp'), + toNumber = require('./toNumber'); + +/** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ +function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); +} + +module.exports = clamp; diff --git a/node_modules/lodash/clone.js b/node_modules/lodash/clone.js new file mode 100755 index 00000000..dd439d63 --- /dev/null +++ b/node_modules/lodash/clone.js @@ -0,0 +1,36 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); +} + +module.exports = clone; diff --git a/node_modules/lodash/cloneDeep.js b/node_modules/lodash/cloneDeep.js new file mode 100755 index 00000000..4425fbe8 --- /dev/null +++ b/node_modules/lodash/cloneDeep.js @@ -0,0 +1,29 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); +} + +module.exports = cloneDeep; diff --git a/node_modules/lodash/cloneDeepWith.js b/node_modules/lodash/cloneDeepWith.js new file mode 100755 index 00000000..fd9c6c05 --- /dev/null +++ b/node_modules/lodash/cloneDeepWith.js @@ -0,0 +1,40 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ +function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneDeepWith; diff --git a/node_modules/lodash/cloneWith.js b/node_modules/lodash/cloneWith.js new file mode 100755 index 00000000..d2f4e756 --- /dev/null +++ b/node_modules/lodash/cloneWith.js @@ -0,0 +1,42 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ +function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneWith; diff --git a/node_modules/lodash/collection.js b/node_modules/lodash/collection.js new file mode 100755 index 00000000..77fe837f --- /dev/null +++ b/node_modules/lodash/collection.js @@ -0,0 +1,30 @@ +module.exports = { + 'countBy': require('./countBy'), + 'each': require('./each'), + 'eachRight': require('./eachRight'), + 'every': require('./every'), + 'filter': require('./filter'), + 'find': require('./find'), + 'findLast': require('./findLast'), + 'flatMap': require('./flatMap'), + 'flatMapDeep': require('./flatMapDeep'), + 'flatMapDepth': require('./flatMapDepth'), + 'forEach': require('./forEach'), + 'forEachRight': require('./forEachRight'), + 'groupBy': require('./groupBy'), + 'includes': require('./includes'), + 'invokeMap': require('./invokeMap'), + 'keyBy': require('./keyBy'), + 'map': require('./map'), + 'orderBy': require('./orderBy'), + 'partition': require('./partition'), + 'reduce': require('./reduce'), + 'reduceRight': require('./reduceRight'), + 'reject': require('./reject'), + 'sample': require('./sample'), + 'sampleSize': require('./sampleSize'), + 'shuffle': require('./shuffle'), + 'size': require('./size'), + 'some': require('./some'), + 'sortBy': require('./sortBy') +}; diff --git a/node_modules/lodash/commit.js b/node_modules/lodash/commit.js new file mode 100755 index 00000000..fe4db717 --- /dev/null +++ b/node_modules/lodash/commit.js @@ -0,0 +1,33 @@ +var LodashWrapper = require('./_LodashWrapper'); + +/** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ +function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); +} + +module.exports = wrapperCommit; diff --git a/node_modules/lodash/compact.js b/node_modules/lodash/compact.js new file mode 100755 index 00000000..031fab4e --- /dev/null +++ b/node_modules/lodash/compact.js @@ -0,0 +1,31 @@ +/** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ +function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = compact; diff --git a/node_modules/lodash/concat.js b/node_modules/lodash/concat.js new file mode 100755 index 00000000..1da48a4f --- /dev/null +++ b/node_modules/lodash/concat.js @@ -0,0 +1,43 @@ +var arrayPush = require('./_arrayPush'), + baseFlatten = require('./_baseFlatten'), + copyArray = require('./_copyArray'), + isArray = require('./isArray'); + +/** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ +function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); +} + +module.exports = concat; diff --git a/node_modules/lodash/cond.js b/node_modules/lodash/cond.js new file mode 100755 index 00000000..64555986 --- /dev/null +++ b/node_modules/lodash/cond.js @@ -0,0 +1,60 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ +function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, + toIteratee = baseIteratee; + + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + + return baseRest(function(args) { + var index = -1; + while (++index < length) { + var pair = pairs[index]; + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } + }); +} + +module.exports = cond; diff --git a/node_modules/lodash/conforms.js b/node_modules/lodash/conforms.js new file mode 100755 index 00000000..5501a949 --- /dev/null +++ b/node_modules/lodash/conforms.js @@ -0,0 +1,35 @@ +var baseClone = require('./_baseClone'), + baseConforms = require('./_baseConforms'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes the predicate properties of `source` with + * the corresponding property values of a given object, returning `true` if + * all predicates return truthy, else `false`. + * + * **Note:** The created function is equivalent to `_.conformsTo` with + * `source` partially applied. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } + * ]; + * + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] + */ +function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); +} + +module.exports = conforms; diff --git a/node_modules/lodash/conformsTo.js b/node_modules/lodash/conformsTo.js new file mode 100755 index 00000000..b8a93ebf --- /dev/null +++ b/node_modules/lodash/conformsTo.js @@ -0,0 +1,32 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ +function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); +} + +module.exports = conformsTo; diff --git a/node_modules/lodash/constant.js b/node_modules/lodash/constant.js new file mode 100755 index 00000000..655ece3f --- /dev/null +++ b/node_modules/lodash/constant.js @@ -0,0 +1,26 @@ +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; diff --git a/node_modules/lodash/core.js b/node_modules/lodash/core.js new file mode 100755 index 00000000..88c263f8 --- /dev/null +++ b/node_modules/lodash/core.js @@ -0,0 +1,3836 @@ +/** + * @license + * Lodash (Custom Build) + * Build: `lodash core -o ./dist/lodash.core.js` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.4'; + + /** Error message constants. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + numberTag = '[object Number]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + + /** Used to match HTML entities and HTML characters. */ + var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /*--------------------------------------------------------------------------*/ + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + array.push.apply(array, values); + return array; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return baseMap(props, function(key) { + return object[key]; + }); + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Built-in value references. */ + var objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsFinite = root.isFinite, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + return value instanceof LodashWrapper + ? value + : new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + } + + LodashWrapper.prototype = baseCreate(lodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + object[key] = value; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !false) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return baseFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + return objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + var baseIsArguments = noop; + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : baseGetTag(object), + othTag = othIsArr ? arrayTag : baseGetTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + stack || (stack = []); + var objStack = find(stack, function(entry) { + return entry[0] == object; + }); + var othStack = find(stack, function(entry) { + return entry[0] == other; + }); + if (objStack && othStack) { + return objStack[1] == other; + } + stack.push([object, other]); + stack.push([other, object]); + if (isSameTag && !objIsObj) { + var result = (objIsArr) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + stack.pop(); + return result; + } + } + if (!isSameTag) { + return false; + } + var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(func) { + if (typeof func == 'function') { + return func; + } + if (func == null) { + return identity; + } + return (typeof func == 'object' ? baseMatches : baseProperty)(func); + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var props = nativeKeys(source); + return function(object) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length]; + if (!(key in object && + baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) + )) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return reduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source) { + return baseSlice(source, 0, source.length); + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + return reduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = false; + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = false; + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return fn.apply(isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + var compared; + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!baseSome(other, function(othValue, othIndex) { + if (!indexOf(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var result = true; + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + var compared; + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value); + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return func.apply(this, otherArgs); + }; + } + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = identity; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + return baseFilter(array, Boolean); + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; + } else { + fromIndex = 0; + } + var index = (fromIndex || 0) - 1, + isReflexive = value === value; + + while (++index < length) { + var other = array[index]; + if ((isReflexive ? other === value : other !== other)) { + return index; + } + } + return -1; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + start = start == null ? 0 : +start; + end = end === undefined ? length : +end; + return length ? baseSlice(array, start, end) : []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseEvery(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + return baseFilter(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return baseEach(collection, baseIteratee(iteratee)); + } + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + return baseMap(collection, baseIteratee(iteratee)); + } + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + collection = isArrayLike(collection) ? collection : nativeKeys(collection); + return collection.length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseSome(collection, baseIteratee(predicate)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + function sortBy(collection, iteratee) { + var index = 0; + iteratee = baseIteratee(iteratee); + + return baseMap(baseMap(collection, function(value, key, collection) { + return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; + }).sort(function(object, other) { + return compareAscending(object.criteria, other.criteria) || (object.index - other.index); + }), baseProperty('value')); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); + }); + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + if (!isObject(value)) { + return value; + } + return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = baseIsDate; + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || + isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + return !nativeKeys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = baseIsRegExp; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!isArrayLike(value)) { + return values(value); + } + return value.length ? copyArray(value) : []; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + var toInteger = Number; + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + var toNumber = Number; + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + if (typeof value == 'string') { + return value; + } + return value == null ? '' : (value + ''); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + copyObject(source, nativeKeys(source), object); + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, nativeKeysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : assign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(args) { + args.push(undefined, customDefaultsAssignIn); + return assignInWith.apply(undefined, args); + }); + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasOwnProperty.call(object, path); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = nativeKeys; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + var keysIn = nativeKeysIn; + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + var value = object == null ? undefined : object[path]; + if (value === undefined) { + value = defaultValue; + } + return isFunction(value) ? value.call(object) : value; + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /*------------------------------------------------------------------------*/ + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ + var iteratee = baseIteratee; + + /** + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; + * + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + */ + function matches(source) { + return baseMatches(assign({}, source)); + } + + /** + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. + * @example + * + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); + * } + * + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] + * + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] + */ + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && + !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + + baseEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + + return object; + } + + /** + * Reverts the `_` variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + return this; + } + + /** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ + function noop() { + // No operation performed. + } + + /** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + /*------------------------------------------------------------------------*/ + + /** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ + function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; + } + + /** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */ + function min(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseLt) + : undefined; + } + + /*------------------------------------------------------------------------*/ + + // Add methods that return wrapped values in chain sequences. + lodash.assignIn = assignIn; + lodash.before = before; + lodash.bind = bind; + lodash.chain = chain; + lodash.compact = compact; + lodash.concat = concat; + lodash.create = create; + lodash.defaults = defaults; + lodash.defer = defer; + lodash.delay = delay; + lodash.filter = filter; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.iteratee = iteratee; + lodash.keys = keys; + lodash.map = map; + lodash.matches = matches; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.once = once; + lodash.pick = pick; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.tap = tap; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.values = values; + + // Add aliases. + lodash.extend = assignIn; + + // Add methods to `lodash.prototype`. + mixin(lodash, lodash); + + /*------------------------------------------------------------------------*/ + + // Add methods that return unwrapped values in chain sequences. + lodash.clone = clone; + lodash.escape = escape; + lodash.every = every; + lodash.find = find; + lodash.forEach = forEach; + lodash.has = has; + lodash.head = head; + lodash.identity = identity; + lodash.indexOf = indexOf; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isBoolean = isBoolean; + lodash.isDate = isDate; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isNaN = isNaN; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isRegExp = isRegExp; + lodash.isString = isString; + lodash.isUndefined = isUndefined; + lodash.last = last; + lodash.max = max; + lodash.min = min; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.reduce = reduce; + lodash.result = result; + lodash.size = size; + lodash.some = some; + lodash.uniqueId = uniqueId; + + // Add aliases. + lodash.each = forEach; + lodash.first = head; + + mixin(lodash, (function() { + var source = {}; + baseForOwn(lodash, function(func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }()), { 'chain': false }); + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + // Add `Array` methods to `lodash.prototype`. + baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); + + lodash.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + return this[chainName](function(value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + + // Add chain sequence methods to the `lodash` wrapper. + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + + /*--------------------------------------------------------------------------*/ + + // Some AMD build optimizers, like r.js, check for condition patterns like: + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = lodash; + + // Define as an anonymous module so, through path mapping, it can be + // referenced as the "underscore" module. + define(function() { + return lodash; + }); + } + // Check for `exports` after `define` in case a build optimizer adds it. + else if (freeModule) { + // Export for Node.js. + (freeModule.exports = lodash)._ = lodash; + // Export for CommonJS support. + freeExports._ = lodash; + } + else { + // Export to the global object. + root._ = lodash; + } +}.call(this)); diff --git a/node_modules/lodash/core.min.js b/node_modules/lodash/core.min.js new file mode 100755 index 00000000..b909d31c --- /dev/null +++ b/node_modules/lodash/core.min.js @@ -0,0 +1,29 @@ +/** + * @license + * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash core -o ./dist/lodash.core.js` + */ +;(function(){function n(n){return K(n)&&pn.call(n,"callee")&&!bn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?nn:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); +return setTimeout(function(){n.apply(nn,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++et}function y(n,t,r,e,u){return n===t||(null==n||null==t||!K(n)&&!K(t)?n!==n&&t!==t:b(n,t,r,e,y,u))}function b(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){ +return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=B(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=M(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=R(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, +r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?Y:(typeof n=="object"?d:r)(n)}function _(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;for(var c=-1,f=true,a=2&r?[]:nn;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn)}function J(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=nn),r}}function M(n,t){return n===t||n!==n&&t!==t}function U(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!V(n)}function V(n){return!!H(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n); +}function H(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function K(n){return null!=n&&typeof n=="object"}function L(n){return typeof n=="number"||K(n)&&"[object Number]"==hn.call(n)}function Q(n){return typeof n=="string"||!Nn(n)&&K(n)&&"[object String]"==hn.call(n)}function W(n){return typeof n=="string"?n:null==n?"":n+""}function X(n){return null==n?[]:u(n,In(n))}function Y(n){return n}function Z(n,r,e){var u=In(r),o=h(r,u);null!=e||H(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,In(r))); +var i=!(H(e)&&"chain"in e&&!e.chain),c=V(n);return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var nn,tn=1/0,rn=/[&<>"']/g,en=RegExp(rn.source),un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ +return function(t){return null==n?nn:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,yn=Object.create,bn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return H(t)?yn?yn(t):(n.prototype=t,t=new n,n.prototype=nn,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i; +var mn=function(n,t){return function(r,e){if(null==r)return r;if(!U(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ +var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } +}); + +module.exports = countBy; diff --git a/node_modules/lodash/create.js b/node_modules/lodash/create.js new file mode 100755 index 00000000..919edb85 --- /dev/null +++ b/node_modules/lodash/create.js @@ -0,0 +1,43 @@ +var baseAssign = require('./_baseAssign'), + baseCreate = require('./_baseCreate'); + +/** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); +} + +module.exports = create; diff --git a/node_modules/lodash/curry.js b/node_modules/lodash/curry.js new file mode 100755 index 00000000..918db1a4 --- /dev/null +++ b/node_modules/lodash/curry.js @@ -0,0 +1,57 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8; + +/** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; +} + +// Assign default placeholders. +curry.placeholder = {}; + +module.exports = curry; diff --git a/node_modules/lodash/curryRight.js b/node_modules/lodash/curryRight.js new file mode 100755 index 00000000..c85b6f33 --- /dev/null +++ b/node_modules/lodash/curryRight.js @@ -0,0 +1,54 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_RIGHT_FLAG = 16; + +/** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ +function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; +} + +// Assign default placeholders. +curryRight.placeholder = {}; + +module.exports = curryRight; diff --git a/node_modules/lodash/date.js b/node_modules/lodash/date.js new file mode 100755 index 00000000..cbf5b410 --- /dev/null +++ b/node_modules/lodash/date.js @@ -0,0 +1,3 @@ +module.exports = { + 'now': require('./now') +}; diff --git a/node_modules/lodash/debounce.js b/node_modules/lodash/debounce.js new file mode 100755 index 00000000..04d7dfd3 --- /dev/null +++ b/node_modules/lodash/debounce.js @@ -0,0 +1,188 @@ +var isObject = require('./isObject'), + now = require('./now'), + toNumber = require('./toNumber'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; diff --git a/node_modules/lodash/deburr.js b/node_modules/lodash/deburr.js new file mode 100755 index 00000000..f85e314a --- /dev/null +++ b/node_modules/lodash/deburr.js @@ -0,0 +1,45 @@ +var deburrLetter = require('./_deburrLetter'), + toString = require('./toString'); + +/** Used to match Latin Unicode letters (excluding mathematical operators). */ +var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + +/** Used to compose unicode character classes. */ +var rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboRange + ']'; + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; diff --git a/node_modules/lodash/defaultTo.js b/node_modules/lodash/defaultTo.js new file mode 100755 index 00000000..5b333592 --- /dev/null +++ b/node_modules/lodash/defaultTo.js @@ -0,0 +1,25 @@ +/** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 + */ +function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; +} + +module.exports = defaultTo; diff --git a/node_modules/lodash/defaults.js b/node_modules/lodash/defaults.js new file mode 100755 index 00000000..6b75ee08 --- /dev/null +++ b/node_modules/lodash/defaults.js @@ -0,0 +1,32 @@ +var apply = require('./_apply'), + assignInWith = require('./assignInWith'), + baseRest = require('./_baseRest'), + customDefaultsAssignIn = require('./_customDefaultsAssignIn'); + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(args) { + args.push(undefined, customDefaultsAssignIn); + return apply(assignInWith, undefined, args); +}); + +module.exports = defaults; diff --git a/node_modules/lodash/defaultsDeep.js b/node_modules/lodash/defaultsDeep.js new file mode 100755 index 00000000..9b5fa3ee --- /dev/null +++ b/node_modules/lodash/defaultsDeep.js @@ -0,0 +1,30 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + customDefaultsMerge = require('./_customDefaultsMerge'), + mergeWith = require('./mergeWith'); + +/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ +var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); +}); + +module.exports = defaultsDeep; diff --git a/node_modules/lodash/defer.js b/node_modules/lodash/defer.js new file mode 100755 index 00000000..f6d6c6fa --- /dev/null +++ b/node_modules/lodash/defer.js @@ -0,0 +1,26 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'); + +/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ +var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); +}); + +module.exports = defer; diff --git a/node_modules/lodash/delay.js b/node_modules/lodash/delay.js new file mode 100755 index 00000000..bd554796 --- /dev/null +++ b/node_modules/lodash/delay.js @@ -0,0 +1,28 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'), + toNumber = require('./toNumber'); + +/** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ +var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); +}); + +module.exports = delay; diff --git a/node_modules/lodash/difference.js b/node_modules/lodash/difference.js new file mode 100755 index 00000000..fa28bb30 --- /dev/null +++ b/node_modules/lodash/difference.js @@ -0,0 +1,33 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; diff --git a/node_modules/lodash/differenceBy.js b/node_modules/lodash/differenceBy.js new file mode 100755 index 00000000..2cd63e7e --- /dev/null +++ b/node_modules/lodash/differenceBy.js @@ -0,0 +1,44 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ +var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = differenceBy; diff --git a/node_modules/lodash/differenceWith.js b/node_modules/lodash/differenceWith.js new file mode 100755 index 00000000..c0233f4b --- /dev/null +++ b/node_modules/lodash/differenceWith.js @@ -0,0 +1,40 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ +var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; +}); + +module.exports = differenceWith; diff --git a/node_modules/lodash/divide.js b/node_modules/lodash/divide.js new file mode 100755 index 00000000..8cae0cd1 --- /dev/null +++ b/node_modules/lodash/divide.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ +var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; +}, 1); + +module.exports = divide; diff --git a/node_modules/lodash/drop.js b/node_modules/lodash/drop.js new file mode 100755 index 00000000..d5c3cbaa --- /dev/null +++ b/node_modules/lodash/drop.js @@ -0,0 +1,38 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; diff --git a/node_modules/lodash/dropRight.js b/node_modules/lodash/dropRight.js new file mode 100755 index 00000000..441fe996 --- /dev/null +++ b/node_modules/lodash/dropRight.js @@ -0,0 +1,39 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; diff --git a/node_modules/lodash/dropRightWhile.js b/node_modules/lodash/dropRightWhile.js new file mode 100755 index 00000000..9ad36a04 --- /dev/null +++ b/node_modules/lodash/dropRightWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true, true) + : []; +} + +module.exports = dropRightWhile; diff --git a/node_modules/lodash/dropWhile.js b/node_modules/lodash/dropWhile.js new file mode 100755 index 00000000..903ef568 --- /dev/null +++ b/node_modules/lodash/dropWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true) + : []; +} + +module.exports = dropWhile; diff --git a/node_modules/lodash/each.js b/node_modules/lodash/each.js new file mode 100755 index 00000000..8800f420 --- /dev/null +++ b/node_modules/lodash/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/node_modules/lodash/eachRight.js b/node_modules/lodash/eachRight.js new file mode 100755 index 00000000..3252b2ab --- /dev/null +++ b/node_modules/lodash/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/node_modules/lodash/endsWith.js b/node_modules/lodash/endsWith.js new file mode 100755 index 00000000..76fc866e --- /dev/null +++ b/node_modules/lodash/endsWith.js @@ -0,0 +1,43 @@ +var baseClamp = require('./_baseClamp'), + baseToString = require('./_baseToString'), + toInteger = require('./toInteger'), + toString = require('./toString'); + +/** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ +function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; +} + +module.exports = endsWith; diff --git a/node_modules/lodash/entries.js b/node_modules/lodash/entries.js new file mode 100755 index 00000000..7a88df20 --- /dev/null +++ b/node_modules/lodash/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/node_modules/lodash/entriesIn.js b/node_modules/lodash/entriesIn.js new file mode 100755 index 00000000..f6c6331c --- /dev/null +++ b/node_modules/lodash/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/node_modules/lodash/eq.js b/node_modules/lodash/eq.js new file mode 100755 index 00000000..a9406880 --- /dev/null +++ b/node_modules/lodash/eq.js @@ -0,0 +1,37 @@ +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; diff --git a/node_modules/lodash/escape.js b/node_modules/lodash/escape.js new file mode 100755 index 00000000..9247e002 --- /dev/null +++ b/node_modules/lodash/escape.js @@ -0,0 +1,43 @@ +var escapeHtmlChar = require('./_escapeHtmlChar'), + toString = require('./toString'); + +/** Used to match HTML entities and HTML characters. */ +var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + +/** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ +function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; +} + +module.exports = escape; diff --git a/node_modules/lodash/escapeRegExp.js b/node_modules/lodash/escapeRegExp.js new file mode 100755 index 00000000..0a58c69f --- /dev/null +++ b/node_modules/lodash/escapeRegExp.js @@ -0,0 +1,32 @@ +var toString = require('./toString'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +module.exports = escapeRegExp; diff --git a/node_modules/lodash/every.js b/node_modules/lodash/every.js new file mode 100755 index 00000000..25080dac --- /dev/null +++ b/node_modules/lodash/every.js @@ -0,0 +1,56 @@ +var arrayEvery = require('./_arrayEvery'), + baseEvery = require('./_baseEvery'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = every; diff --git a/node_modules/lodash/extend.js b/node_modules/lodash/extend.js new file mode 100755 index 00000000..e00166c2 --- /dev/null +++ b/node_modules/lodash/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/node_modules/lodash/extendWith.js b/node_modules/lodash/extendWith.js new file mode 100755 index 00000000..dbdcb3b4 --- /dev/null +++ b/node_modules/lodash/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/node_modules/lodash/fill.js b/node_modules/lodash/fill.js new file mode 100755 index 00000000..ae13aa1c --- /dev/null +++ b/node_modules/lodash/fill.js @@ -0,0 +1,45 @@ +var baseFill = require('./_baseFill'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ +function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); +} + +module.exports = fill; diff --git a/node_modules/lodash/filter.js b/node_modules/lodash/filter.js new file mode 100755 index 00000000..52616be8 --- /dev/null +++ b/node_modules/lodash/filter.js @@ -0,0 +1,48 @@ +var arrayFilter = require('./_arrayFilter'), + baseFilter = require('./_baseFilter'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; diff --git a/node_modules/lodash/find.js b/node_modules/lodash/find.js new file mode 100755 index 00000000..de732ccb --- /dev/null +++ b/node_modules/lodash/find.js @@ -0,0 +1,42 @@ +var createFind = require('./_createFind'), + findIndex = require('./findIndex'); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; diff --git a/node_modules/lodash/findIndex.js b/node_modules/lodash/findIndex.js new file mode 100755 index 00000000..4689069f --- /dev/null +++ b/node_modules/lodash/findIndex.js @@ -0,0 +1,55 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; diff --git a/node_modules/lodash/findKey.js b/node_modules/lodash/findKey.js new file mode 100755 index 00000000..cac0248a --- /dev/null +++ b/node_modules/lodash/findKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwn = require('./_baseForOwn'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ +function findKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); +} + +module.exports = findKey; diff --git a/node_modules/lodash/findLast.js b/node_modules/lodash/findLast.js new file mode 100755 index 00000000..70b4271d --- /dev/null +++ b/node_modules/lodash/findLast.js @@ -0,0 +1,25 @@ +var createFind = require('./_createFind'), + findLastIndex = require('./findLastIndex'); + +/** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ +var findLast = createFind(findLastIndex); + +module.exports = findLast; diff --git a/node_modules/lodash/findLastIndex.js b/node_modules/lodash/findLastIndex.js new file mode 100755 index 00000000..7da3431f --- /dev/null +++ b/node_modules/lodash/findLastIndex.js @@ -0,0 +1,59 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ +function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index, true); +} + +module.exports = findLastIndex; diff --git a/node_modules/lodash/findLastKey.js b/node_modules/lodash/findLastKey.js new file mode 100755 index 00000000..66fb9fbc --- /dev/null +++ b/node_modules/lodash/findLastKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwnRight = require('./_baseForOwnRight'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ +function findLastKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); +} + +module.exports = findLastKey; diff --git a/node_modules/lodash/first.js b/node_modules/lodash/first.js new file mode 100755 index 00000000..53f4ad13 --- /dev/null +++ b/node_modules/lodash/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/node_modules/lodash/flatMap.js b/node_modules/lodash/flatMap.js new file mode 100755 index 00000000..e6685068 --- /dev/null +++ b/node_modules/lodash/flatMap.js @@ -0,0 +1,29 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); +} + +module.exports = flatMap; diff --git a/node_modules/lodash/flatMapDeep.js b/node_modules/lodash/flatMapDeep.js new file mode 100755 index 00000000..4653d603 --- /dev/null +++ b/node_modules/lodash/flatMapDeep.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); +} + +module.exports = flatMapDeep; diff --git a/node_modules/lodash/flatMapDepth.js b/node_modules/lodash/flatMapDepth.js new file mode 100755 index 00000000..6d72005c --- /dev/null +++ b/node_modules/lodash/flatMapDepth.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'), + toInteger = require('./toInteger'); + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ +function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); +} + +module.exports = flatMapDepth; diff --git a/node_modules/lodash/flatten.js b/node_modules/lodash/flatten.js new file mode 100755 index 00000000..3f09f7f7 --- /dev/null +++ b/node_modules/lodash/flatten.js @@ -0,0 +1,22 @@ +var baseFlatten = require('./_baseFlatten'); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; diff --git a/node_modules/lodash/flattenDeep.js b/node_modules/lodash/flattenDeep.js new file mode 100755 index 00000000..8ad585cf --- /dev/null +++ b/node_modules/lodash/flattenDeep.js @@ -0,0 +1,25 @@ +var baseFlatten = require('./_baseFlatten'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ +function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; +} + +module.exports = flattenDeep; diff --git a/node_modules/lodash/flattenDepth.js b/node_modules/lodash/flattenDepth.js new file mode 100755 index 00000000..441fdcc2 --- /dev/null +++ b/node_modules/lodash/flattenDepth.js @@ -0,0 +1,33 @@ +var baseFlatten = require('./_baseFlatten'), + toInteger = require('./toInteger'); + +/** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); +} + +module.exports = flattenDepth; diff --git a/node_modules/lodash/flip.js b/node_modules/lodash/flip.js new file mode 100755 index 00000000..c28dd789 --- /dev/null +++ b/node_modules/lodash/flip.js @@ -0,0 +1,28 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ +function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); +} + +module.exports = flip; diff --git a/node_modules/lodash/floor.js b/node_modules/lodash/floor.js new file mode 100755 index 00000000..ab6dfa28 --- /dev/null +++ b/node_modules/lodash/floor.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded down to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round down. + * @param {number} [precision=0] The precision to round down to. + * @returns {number} Returns the rounded down number. + * @example + * + * _.floor(4.006); + * // => 4 + * + * _.floor(0.046, 2); + * // => 0.04 + * + * _.floor(4060, -2); + * // => 4000 + */ +var floor = createRound('floor'); + +module.exports = floor; diff --git a/node_modules/lodash/flow.js b/node_modules/lodash/flow.js new file mode 100755 index 00000000..74b6b62d --- /dev/null +++ b/node_modules/lodash/flow.js @@ -0,0 +1,27 @@ +var createFlow = require('./_createFlow'); + +/** + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flowRight + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow([_.add, square]); + * addSquare(1, 2); + * // => 9 + */ +var flow = createFlow(); + +module.exports = flow; diff --git a/node_modules/lodash/flowRight.js b/node_modules/lodash/flowRight.js new file mode 100755 index 00000000..11461410 --- /dev/null +++ b/node_modules/lodash/flowRight.js @@ -0,0 +1,26 @@ +var createFlow = require('./_createFlow'); + +/** + * This method is like `_.flow` except that it creates a function that + * invokes the given functions from right to left. + * + * @static + * @since 3.0.0 + * @memberOf _ + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flow + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight([square, _.add]); + * addSquare(1, 2); + * // => 9 + */ +var flowRight = createFlow(true); + +module.exports = flowRight; diff --git a/node_modules/lodash/forEach.js b/node_modules/lodash/forEach.js new file mode 100755 index 00000000..c64eaa73 --- /dev/null +++ b/node_modules/lodash/forEach.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseEach = require('./_baseEach'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; diff --git a/node_modules/lodash/forEachRight.js b/node_modules/lodash/forEachRight.js new file mode 100755 index 00000000..7390ebaf --- /dev/null +++ b/node_modules/lodash/forEachRight.js @@ -0,0 +1,31 @@ +var arrayEachRight = require('./_arrayEachRight'), + baseEachRight = require('./_baseEachRight'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ +function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEachRight; diff --git a/node_modules/lodash/forIn.js b/node_modules/lodash/forIn.js new file mode 100755 index 00000000..583a5963 --- /dev/null +++ b/node_modules/lodash/forIn.js @@ -0,0 +1,39 @@ +var baseFor = require('./_baseFor'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ +function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, castFunction(iteratee), keysIn); +} + +module.exports = forIn; diff --git a/node_modules/lodash/forInRight.js b/node_modules/lodash/forInRight.js new file mode 100755 index 00000000..4aedf58a --- /dev/null +++ b/node_modules/lodash/forInRight.js @@ -0,0 +1,37 @@ +var baseForRight = require('./_baseForRight'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ +function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, castFunction(iteratee), keysIn); +} + +module.exports = forInRight; diff --git a/node_modules/lodash/forOwn.js b/node_modules/lodash/forOwn.js new file mode 100755 index 00000000..94eed840 --- /dev/null +++ b/node_modules/lodash/forOwn.js @@ -0,0 +1,36 @@ +var baseForOwn = require('./_baseForOwn'), + castFunction = require('./_castFunction'); + +/** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} + +module.exports = forOwn; diff --git a/node_modules/lodash/forOwnRight.js b/node_modules/lodash/forOwnRight.js new file mode 100755 index 00000000..86f338f0 --- /dev/null +++ b/node_modules/lodash/forOwnRight.js @@ -0,0 +1,34 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + castFunction = require('./_castFunction'); + +/** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ +function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, castFunction(iteratee)); +} + +module.exports = forOwnRight; diff --git a/node_modules/lodash/fp.js b/node_modules/lodash/fp.js new file mode 100755 index 00000000..e372dbbd --- /dev/null +++ b/node_modules/lodash/fp.js @@ -0,0 +1,2 @@ +var _ = require('./lodash.min').runInContext(); +module.exports = require('./fp/_baseConvert')(_, _); diff --git a/node_modules/lodash/fp/F.js b/node_modules/lodash/fp/F.js new file mode 100755 index 00000000..a05a63ad --- /dev/null +++ b/node_modules/lodash/fp/F.js @@ -0,0 +1 @@ +module.exports = require('./stubFalse'); diff --git a/node_modules/lodash/fp/T.js b/node_modules/lodash/fp/T.js new file mode 100755 index 00000000..e2ba8ea5 --- /dev/null +++ b/node_modules/lodash/fp/T.js @@ -0,0 +1 @@ +module.exports = require('./stubTrue'); diff --git a/node_modules/lodash/fp/__.js b/node_modules/lodash/fp/__.js new file mode 100755 index 00000000..4af98deb --- /dev/null +++ b/node_modules/lodash/fp/__.js @@ -0,0 +1 @@ +module.exports = require('./placeholder'); diff --git a/node_modules/lodash/fp/_baseConvert.js b/node_modules/lodash/fp/_baseConvert.js new file mode 100755 index 00000000..7af27655 --- /dev/null +++ b/node_modules/lodash/fp/_baseConvert.js @@ -0,0 +1,568 @@ +var mapping = require('./_mapping'), + fallbackHolder = require('./placeholder'); + +/** Built-in value reference. */ +var push = Array.prototype.push; + +/** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ +function baseArity(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; +} + +/** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ +function baseAry(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; +} + +/** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ +function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; + } + return result; +} + +/** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ +function createCloner(func) { + return function(object) { + return func({}, object); + }; +} + +/** + * A specialized version of `_.spread` which flattens the spread array into + * the arguments of the invoked `func`. + * + * @private + * @param {Function} func The function to spread arguments over. + * @param {number} start The start position of the spread. + * @returns {Function} Returns the new function. + */ +function flatSpread(func, start) { + return function() { + var length = arguments.length, + lastIndex = length - 1, + args = Array(length); + + while (length--) { + args[length] = arguments[length]; + } + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + push.apply(otherArgs, array); + } + if (start != lastIndex) { + push.apply(otherArgs, args.slice(start + 1)); + } + return func.apply(this, otherArgs); + }; +} + +/** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ +function wrapImmutable(func, cloner) { + return function() { + var length = arguments.length; + if (!length) { + return; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; +} + +/** + * The base implementation of `convert` which accepts a `util` object of methods + * required to perform conversions. + * + * @param {Object} util The util object. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. + * @returns {Function|Object} Returns the converted function or object. + */ +function baseConvert(util, name, func, options) { + var setPlaceholder, + isLib = typeof name == 'function', + isObj = name === Object(name); + + if (isObj) { + options = func; + func = name; + name = undefined; + } + if (func == null) { + throw new TypeError; + } + options || (options = {}); + + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + placeholder = isLib ? func : fallbackHolder, + pristine = isLib ? func.runInContext() : undefined; + + var helpers = isLib ? func : { + 'ary': util.ary, + 'assign': util.assign, + 'clone': util.clone, + 'curry': util.curry, + 'forEach': util.forEach, + 'isArray': util.isArray, + 'isFunction': util.isFunction, + 'iteratee': util.iteratee, + 'keys': util.keys, + 'rearg': util.rearg, + 'toInteger': util.toInteger, + 'toPath': util.toPath + }; + + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isFunction = helpers.isFunction, + keys = helpers.keys, + rearg = helpers.rearg, + toInteger = helpers.toInteger, + toPath = helpers.toPath; + + var aryMethodKeys = keys(mapping.aryMethod); + + var wrappers = { + 'castArray': function(castArray) { + return function() { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, + 'iteratee': function(iteratee) { + return function() { + var func = arguments[0], + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; + + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); + } + return result; + }; + }, + 'mixin': function(mixin) { + return function(source) { + var func = this; + if (!isFunction(func)) { + return mixin(func, Object(source)); + } + var pairs = []; + each(keys(source), function(key) { + if (isFunction(source[key])) { + pairs.push([key, func.prototype[key]]); + } + }); + + mixin(func, Object(source)); + + each(pairs, function(pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; + } else { + delete func.prototype[pair[0]]; + } + }); + return func; + }; + }, + 'nthArg': function(nthArg) { + return function(n) { + var arity = n < 0 ? 1 : (toInteger(n) + 1); + return curry(nthArg(n), arity); + }; + }, + 'rearg': function(rearg) { + return function(func, indexes) { + var arity = indexes ? indexes.length : 0; + return curry(rearg(func, indexes), arity); + }; + }, + 'runInContext': function(runInContext) { + return function(context) { + return baseConvert(util, runInContext(context), options); + }; + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Casts `func` to a function with an arity capped iteratee if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @returns {Function} Returns the cast function. + */ + function castCap(name, func) { + if (config.cap) { + var indexes = mapping.iterateeRearg[name]; + if (indexes) { + return iterateeRearg(func, indexes); + } + var n = !isLib && mapping.iterateeAry[name]; + if (n) { + return iterateeAry(func, n); + } + } + return func; + } + + /** + * Casts `func` to a curried function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castCurry(name, func, n) { + return (forceCurry || (config.curry && n > 1)) + ? curry(func, n) + : func; + } + + /** + * Casts `func` to a fixed arity function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity cap. + * @returns {Function} Returns the cast function. + */ + function castFixed(name, func, n) { + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { + var data = mapping.methodSpread[name], + start = data && data.start; + + return start === undefined ? ary(func, n) : flatSpread(func, start); + } + return func; + } + + /** + * Casts `func` to an rearged function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castRearg(name, func, n) { + return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) + ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) + : func; + } + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null) { + nested[path[index]] = clone(index == lastIndex ? value : Object(value)); + } + nested = nested[key]; + } + return result; + } + + /** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var realName = mapping.aliasToReal[name] || name, + methodName = mapping.remap[realName] || realName, + oldOptions = options; + + return function(options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[methodName] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, realName, newFunc, newOptions); + }; + } + + /** + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. + * + * @private + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function iterateeAry(func, n) { + return overArg(func, function(func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); + } + + /** + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function() { + var length = arguments.length; + if (!length) { + return func(); + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); + }; + } + + /** + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. + * + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. + */ + function wrap(name, func) { + var result, + realName = mapping.aliasToReal[name] || name, + wrapped = func, + wrapper = wrappers[realName]; + + if (wrapper) { + wrapped = wrapper(func); + } + else if (config.immutable) { + if (mapping.mutate.array[realName]) { + wrapped = wrapImmutable(func, cloneArray); + } + else if (mapping.mutate.object[realName]) { + wrapped = wrapImmutable(func, createCloner(func)); + } + else if (mapping.mutate.set[realName]) { + wrapped = wrapImmutable(func, cloneByPath); + } + } + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(otherName) { + if (realName == otherName) { + var data = mapping.methodSpread[realName], + afterRearg = data && data.afterRearg; + + result = afterRearg + ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) + : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); + + result = castCap(realName, result); + result = castCurry(realName, result, aryKey); + return false; + } + }); + return !result; + }); + + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function() { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(realName, func); + if (mapping.placeholder[realName]) { + setPlaceholder = true; + result.placeholder = func.placeholder = placeholder; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + if (!isObj) { + return wrap(name, func); + } + var _ = func; + + // Convert methods by ary cap. + var pairs = []; + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(key) { + var func = _[mapping.remap[key] || key]; + if (func) { + pairs.push([key, wrap(key, func)]); + } + }); + }); + + // Convert remaining methods. + each(keys(_), function(key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. + each(pairs, function(pair) { + _[pair[0]] = pair[1]; + }); + + _.convert = convertLib; + if (setPlaceholder) { + _.placeholder = placeholder; + } + // Assign aliases. + each(keys(_), function(key) { + each(mapping.realToAlias[key] || [], function(alias) { + _[alias] = _[key]; + }); + }); + + return _; +} + +module.exports = baseConvert; diff --git a/node_modules/lodash/fp/_convertBrowser.js b/node_modules/lodash/fp/_convertBrowser.js new file mode 100755 index 00000000..bde030dc --- /dev/null +++ b/node_modules/lodash/fp/_convertBrowser.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'); + +/** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Function} lodash The lodash function to convert. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ +function browserConvert(lodash, options) { + return baseConvert(lodash, lodash, options); +} + +if (typeof _ == 'function' && typeof _.runInContext == 'function') { + _ = browserConvert(_.runInContext()); +} +module.exports = browserConvert; diff --git a/node_modules/lodash/fp/_falseOptions.js b/node_modules/lodash/fp/_falseOptions.js new file mode 100755 index 00000000..773235e3 --- /dev/null +++ b/node_modules/lodash/fp/_falseOptions.js @@ -0,0 +1,7 @@ +module.exports = { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false +}; diff --git a/node_modules/lodash/fp/_mapping.js b/node_modules/lodash/fp/_mapping.js new file mode 100755 index 00000000..8f5ddf2d --- /dev/null +++ b/node_modules/lodash/fp/_mapping.js @@ -0,0 +1,368 @@ +/** Used to map aliases to their real names. */ +exports.aliasToReal = { + + // Lodash aliases. + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'entries': 'toPairs', + 'entriesIn': 'toPairsIn', + 'extend': 'assignIn', + 'extendAll': 'assignInAll', + 'extendAllWith': 'assignInAllWith', + 'extendWith': 'assignInWith', + 'first': 'head', + + // Methods that are curried variants of others. + 'conforms': 'conformsTo', + 'matches': 'isMatch', + 'property': 'get', + + // Ramda aliases. + '__': 'placeholder', + 'F': 'stubFalse', + 'T': 'stubTrue', + 'all': 'every', + 'allPass': 'overEvery', + 'always': 'constant', + 'any': 'some', + 'anyPass': 'overSome', + 'apply': 'spread', + 'assoc': 'set', + 'assocPath': 'set', + 'complement': 'negate', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'unset', + 'dissocPath': 'unset', + 'dropLast': 'dropRight', + 'dropLastWhile': 'dropRightWhile', + 'equals': 'isEqual', + 'identical': 'eq', + 'indexBy': 'keyBy', + 'init': 'initial', + 'invertObj': 'invert', + 'juxt': 'over', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'paths': 'at', + 'pickAll': 'pick', + 'pipe': 'flow', + 'pluck': 'map', + 'prop': 'get', + 'propEq': 'matchesProperty', + 'propOr': 'getOr', + 'props': 'at', + 'symmetricDifference': 'xor', + 'symmetricDifferenceBy': 'xorBy', + 'symmetricDifferenceWith': 'xorWith', + 'takeLast': 'takeRight', + 'takeLastWhile': 'takeRightWhile', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'where': 'conformsTo', + 'whereEq': 'isMatch', + 'zipObj': 'zipObject' +}; + +/** Used to map ary to method names. */ +exports.aryMethod = { + '1': [ + 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', + 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', + 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', + 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', + 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', + 'uniqueId', 'words', 'zipAll' + ], + '2': [ + 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', + 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', + 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', + 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', + 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', + 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', + 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', + 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', + 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', + 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', + 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', + 'zipObjectDeep' + ], + '3': [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', + 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', + 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', + 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', + 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', + 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', + 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', + 'xorWith', 'zipWith' + ], + '4': [ + 'fill', 'setWith', 'updateWith' + ] +}; + +/** Used to map ary to rearg configs. */ +exports.aryRearg = { + '2': [1, 0], + '3': [2, 0, 1], + '4': [3, 2, 0, 1] +}; + +/** Used to map method names to their iteratee ary. */ +exports.iterateeAry = { + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findFrom': 1, + 'findIndex': 1, + 'findIndexFrom': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastFrom': 1, + 'findLastIndex': 1, + 'findLastIndexFrom': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'flatMapDeep': 1, + 'flatMapDepth': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 +}; + +/** Used to map method names to iteratee rearg configs. */ +exports.iterateeRearg = { + 'mapKeys': [1], + 'reduceRight': [1, 0] +}; + +/** Used to map method names to rearg configs. */ +exports.methodRearg = { + 'assignInAllWith': [1, 0], + 'assignInWith': [1, 2, 0], + 'assignAllWith': [1, 0], + 'assignWith': [1, 2, 0], + 'differenceBy': [1, 2, 0], + 'differenceWith': [1, 2, 0], + 'getOr': [2, 1, 0], + 'intersectionBy': [1, 2, 0], + 'intersectionWith': [1, 2, 0], + 'isEqualWith': [1, 2, 0], + 'isMatchWith': [2, 1, 0], + 'mergeAllWith': [1, 0], + 'mergeWith': [1, 2, 0], + 'padChars': [2, 1, 0], + 'padCharsEnd': [2, 1, 0], + 'padCharsStart': [2, 1, 0], + 'pullAllBy': [2, 1, 0], + 'pullAllWith': [2, 1, 0], + 'rangeStep': [1, 2, 0], + 'rangeStepRight': [1, 2, 0], + 'setWith': [3, 1, 2, 0], + 'sortedIndexBy': [2, 1, 0], + 'sortedLastIndexBy': [2, 1, 0], + 'unionBy': [1, 2, 0], + 'unionWith': [1, 2, 0], + 'updateWith': [3, 1, 2, 0], + 'xorBy': [1, 2, 0], + 'xorWith': [1, 2, 0], + 'zipWith': [1, 2, 0] +}; + +/** Used to map method names to spread configs. */ +exports.methodSpread = { + 'assignAll': { 'start': 0 }, + 'assignAllWith': { 'start': 0 }, + 'assignInAll': { 'start': 0 }, + 'assignInAllWith': { 'start': 0 }, + 'defaultsAll': { 'start': 0 }, + 'defaultsDeepAll': { 'start': 0 }, + 'invokeArgs': { 'start': 2 }, + 'invokeArgsMap': { 'start': 2 }, + 'mergeAll': { 'start': 0 }, + 'mergeAllWith': { 'start': 0 }, + 'partial': { 'start': 1 }, + 'partialRight': { 'start': 1 }, + 'without': { 'start': 1 }, + 'zipAll': { 'start': 0 } +}; + +/** Used to identify methods which mutate arrays or objects. */ +exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAllWith': true, + 'pullAt': true, + 'remove': true, + 'reverse': true + }, + 'object': { + 'assign': true, + 'assignAll': true, + 'assignAllWith': true, + 'assignIn': true, + 'assignInAll': true, + 'assignInAllWith': true, + 'assignInWith': true, + 'assignWith': true, + 'defaults': true, + 'defaultsAll': true, + 'defaultsDeep': true, + 'defaultsDeepAll': true, + 'merge': true, + 'mergeAll': true, + 'mergeAllWith': true, + 'mergeWith': true, + }, + 'set': { + 'set': true, + 'setWith': true, + 'unset': true, + 'update': true, + 'updateWith': true + } +}; + +/** Used to track methods with placeholder support */ +exports.placeholder = { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true +}; + +/** Used to map real names to their aliases. */ +exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + } + return result; +}()); + +/** Used to map method names to other names. */ +exports.remap = { + 'assignAll': 'assign', + 'assignAllWith': 'assignWith', + 'assignInAll': 'assignIn', + 'assignInAllWith': 'assignInWith', + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'defaultsAll': 'defaults', + 'defaultsDeepAll': 'defaultsDeep', + 'findFrom': 'find', + 'findIndexFrom': 'findIndex', + 'findLastFrom': 'findLast', + 'findLastIndexFrom': 'findLastIndex', + 'getOr': 'get', + 'includesFrom': 'includes', + 'indexOfFrom': 'indexOf', + 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', + 'lastIndexOfFrom': 'lastIndexOf', + 'mergeAll': 'merge', + 'mergeAllWith': 'mergeWith', + 'padChars': 'pad', + 'padCharsEnd': 'padEnd', + 'padCharsStart': 'padStart', + 'propertyOf': 'get', + 'rangeStep': 'range', + 'rangeStepRight': 'rangeRight', + 'restFrom': 'rest', + 'spreadFrom': 'spread', + 'trimChars': 'trim', + 'trimCharsEnd': 'trimEnd', + 'trimCharsStart': 'trimStart', + 'zipAll': 'zip' +}; + +/** Used to track methods that skip fixing their arity. */ +exports.skipFixed = { + 'castArray': true, + 'flow': true, + 'flowRight': true, + 'iteratee': true, + 'mixin': true, + 'rearg': true, + 'runInContext': true +}; + +/** Used to track methods that skip rearranging arguments. */ +exports.skipRearg = { + 'add': true, + 'assign': true, + 'assignIn': true, + 'bind': true, + 'bindKey': true, + 'concat': true, + 'difference': true, + 'divide': true, + 'eq': true, + 'gt': true, + 'gte': true, + 'isEqual': true, + 'lt': true, + 'lte': true, + 'matchesProperty': true, + 'merge': true, + 'multiply': true, + 'overArgs': true, + 'partial': true, + 'partialRight': true, + 'propertyOf': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'subtract': true, + 'zip': true, + 'zipObject': true, + 'zipObjectDeep': true +}; diff --git a/node_modules/lodash/fp/_util.js b/node_modules/lodash/fp/_util.js new file mode 100755 index 00000000..70844630 --- /dev/null +++ b/node_modules/lodash/fp/_util.js @@ -0,0 +1,14 @@ +module.exports = { + 'ary': require('../ary'), + 'assign': require('../_baseAssign'), + 'clone': require('../clone'), + 'curry': require('../curry'), + 'forEach': require('../_arrayEach'), + 'isArray': require('../isArray'), + 'isFunction': require('../isFunction'), + 'iteratee': require('../iteratee'), + 'keys': require('../_baseKeys'), + 'rearg': require('../rearg'), + 'toInteger': require('../toInteger'), + 'toPath': require('../toPath') +}; diff --git a/node_modules/lodash/fp/add.js b/node_modules/lodash/fp/add.js new file mode 100755 index 00000000..816eeece --- /dev/null +++ b/node_modules/lodash/fp/add.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('add', require('../add')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/after.js b/node_modules/lodash/fp/after.js new file mode 100755 index 00000000..21a0167a --- /dev/null +++ b/node_modules/lodash/fp/after.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('after', require('../after')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/all.js b/node_modules/lodash/fp/all.js new file mode 100755 index 00000000..d0839f77 --- /dev/null +++ b/node_modules/lodash/fp/all.js @@ -0,0 +1 @@ +module.exports = require('./every'); diff --git a/node_modules/lodash/fp/allPass.js b/node_modules/lodash/fp/allPass.js new file mode 100755 index 00000000..79b73ef8 --- /dev/null +++ b/node_modules/lodash/fp/allPass.js @@ -0,0 +1 @@ +module.exports = require('./overEvery'); diff --git a/node_modules/lodash/fp/always.js b/node_modules/lodash/fp/always.js new file mode 100755 index 00000000..98877030 --- /dev/null +++ b/node_modules/lodash/fp/always.js @@ -0,0 +1 @@ +module.exports = require('./constant'); diff --git a/node_modules/lodash/fp/any.js b/node_modules/lodash/fp/any.js new file mode 100755 index 00000000..900ac25e --- /dev/null +++ b/node_modules/lodash/fp/any.js @@ -0,0 +1 @@ +module.exports = require('./some'); diff --git a/node_modules/lodash/fp/anyPass.js b/node_modules/lodash/fp/anyPass.js new file mode 100755 index 00000000..2774ab37 --- /dev/null +++ b/node_modules/lodash/fp/anyPass.js @@ -0,0 +1 @@ +module.exports = require('./overSome'); diff --git a/node_modules/lodash/fp/apply.js b/node_modules/lodash/fp/apply.js new file mode 100755 index 00000000..2b757129 --- /dev/null +++ b/node_modules/lodash/fp/apply.js @@ -0,0 +1 @@ +module.exports = require('./spread'); diff --git a/node_modules/lodash/fp/array.js b/node_modules/lodash/fp/array.js new file mode 100755 index 00000000..fe939c2c --- /dev/null +++ b/node_modules/lodash/fp/array.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../array')); diff --git a/node_modules/lodash/fp/ary.js b/node_modules/lodash/fp/ary.js new file mode 100755 index 00000000..8edf1877 --- /dev/null +++ b/node_modules/lodash/fp/ary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ary', require('../ary')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assign.js b/node_modules/lodash/fp/assign.js new file mode 100755 index 00000000..23f47af1 --- /dev/null +++ b/node_modules/lodash/fp/assign.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assign', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignAll.js b/node_modules/lodash/fp/assignAll.js new file mode 100755 index 00000000..b1d36c7e --- /dev/null +++ b/node_modules/lodash/fp/assignAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAll', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignAllWith.js b/node_modules/lodash/fp/assignAllWith.js new file mode 100755 index 00000000..21e836e6 --- /dev/null +++ b/node_modules/lodash/fp/assignAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAllWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignIn.js b/node_modules/lodash/fp/assignIn.js new file mode 100755 index 00000000..6e7c65fa --- /dev/null +++ b/node_modules/lodash/fp/assignIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignIn', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInAll.js b/node_modules/lodash/fp/assignInAll.js new file mode 100755 index 00000000..7ba75dba --- /dev/null +++ b/node_modules/lodash/fp/assignInAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAll', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInAllWith.js b/node_modules/lodash/fp/assignInAllWith.js new file mode 100755 index 00000000..e766903d --- /dev/null +++ b/node_modules/lodash/fp/assignInAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAllWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInWith.js b/node_modules/lodash/fp/assignInWith.js new file mode 100755 index 00000000..acb59236 --- /dev/null +++ b/node_modules/lodash/fp/assignInWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignWith.js b/node_modules/lodash/fp/assignWith.js new file mode 100755 index 00000000..eb925212 --- /dev/null +++ b/node_modules/lodash/fp/assignWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assoc.js b/node_modules/lodash/fp/assoc.js new file mode 100755 index 00000000..7648820c --- /dev/null +++ b/node_modules/lodash/fp/assoc.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/node_modules/lodash/fp/assocPath.js b/node_modules/lodash/fp/assocPath.js new file mode 100755 index 00000000..7648820c --- /dev/null +++ b/node_modules/lodash/fp/assocPath.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/node_modules/lodash/fp/at.js b/node_modules/lodash/fp/at.js new file mode 100755 index 00000000..cc39d257 --- /dev/null +++ b/node_modules/lodash/fp/at.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('at', require('../at')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/attempt.js b/node_modules/lodash/fp/attempt.js new file mode 100755 index 00000000..26ca42ea --- /dev/null +++ b/node_modules/lodash/fp/attempt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('attempt', require('../attempt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/before.js b/node_modules/lodash/fp/before.js new file mode 100755 index 00000000..7a2de65d --- /dev/null +++ b/node_modules/lodash/fp/before.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('before', require('../before')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bind.js b/node_modules/lodash/fp/bind.js new file mode 100755 index 00000000..5cbe4f30 --- /dev/null +++ b/node_modules/lodash/fp/bind.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bind', require('../bind')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bindAll.js b/node_modules/lodash/fp/bindAll.js new file mode 100755 index 00000000..6b4a4a0f --- /dev/null +++ b/node_modules/lodash/fp/bindAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindAll', require('../bindAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bindKey.js b/node_modules/lodash/fp/bindKey.js new file mode 100755 index 00000000..6a46c6b1 --- /dev/null +++ b/node_modules/lodash/fp/bindKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindKey', require('../bindKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/camelCase.js b/node_modules/lodash/fp/camelCase.js new file mode 100755 index 00000000..87b77b49 --- /dev/null +++ b/node_modules/lodash/fp/camelCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('camelCase', require('../camelCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/capitalize.js b/node_modules/lodash/fp/capitalize.js new file mode 100755 index 00000000..cac74e14 --- /dev/null +++ b/node_modules/lodash/fp/capitalize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('capitalize', require('../capitalize'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/castArray.js b/node_modules/lodash/fp/castArray.js new file mode 100755 index 00000000..8681c099 --- /dev/null +++ b/node_modules/lodash/fp/castArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('castArray', require('../castArray')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/ceil.js b/node_modules/lodash/fp/ceil.js new file mode 100755 index 00000000..f416b729 --- /dev/null +++ b/node_modules/lodash/fp/ceil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ceil', require('../ceil')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/chain.js b/node_modules/lodash/fp/chain.js new file mode 100755 index 00000000..604fe398 --- /dev/null +++ b/node_modules/lodash/fp/chain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chain', require('../chain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/chunk.js b/node_modules/lodash/fp/chunk.js new file mode 100755 index 00000000..871ab085 --- /dev/null +++ b/node_modules/lodash/fp/chunk.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chunk', require('../chunk')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/clamp.js b/node_modules/lodash/fp/clamp.js new file mode 100755 index 00000000..3b06c01c --- /dev/null +++ b/node_modules/lodash/fp/clamp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clamp', require('../clamp')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/clone.js b/node_modules/lodash/fp/clone.js new file mode 100755 index 00000000..cadb59c9 --- /dev/null +++ b/node_modules/lodash/fp/clone.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clone', require('../clone'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneDeep.js b/node_modules/lodash/fp/cloneDeep.js new file mode 100755 index 00000000..a6107aac --- /dev/null +++ b/node_modules/lodash/fp/cloneDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneDeepWith.js b/node_modules/lodash/fp/cloneDeepWith.js new file mode 100755 index 00000000..6f01e44a --- /dev/null +++ b/node_modules/lodash/fp/cloneDeepWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeepWith', require('../cloneDeepWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneWith.js b/node_modules/lodash/fp/cloneWith.js new file mode 100755 index 00000000..aa885781 --- /dev/null +++ b/node_modules/lodash/fp/cloneWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneWith', require('../cloneWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/collection.js b/node_modules/lodash/fp/collection.js new file mode 100755 index 00000000..fc8b328a --- /dev/null +++ b/node_modules/lodash/fp/collection.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../collection')); diff --git a/node_modules/lodash/fp/commit.js b/node_modules/lodash/fp/commit.js new file mode 100755 index 00000000..130a894f --- /dev/null +++ b/node_modules/lodash/fp/commit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('commit', require('../commit'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/compact.js b/node_modules/lodash/fp/compact.js new file mode 100755 index 00000000..ce8f7a1a --- /dev/null +++ b/node_modules/lodash/fp/compact.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('compact', require('../compact'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/complement.js b/node_modules/lodash/fp/complement.js new file mode 100755 index 00000000..93eb462b --- /dev/null +++ b/node_modules/lodash/fp/complement.js @@ -0,0 +1 @@ +module.exports = require('./negate'); diff --git a/node_modules/lodash/fp/compose.js b/node_modules/lodash/fp/compose.js new file mode 100755 index 00000000..1954e942 --- /dev/null +++ b/node_modules/lodash/fp/compose.js @@ -0,0 +1 @@ +module.exports = require('./flowRight'); diff --git a/node_modules/lodash/fp/concat.js b/node_modules/lodash/fp/concat.js new file mode 100755 index 00000000..e59346ad --- /dev/null +++ b/node_modules/lodash/fp/concat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('concat', require('../concat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cond.js b/node_modules/lodash/fp/cond.js new file mode 100755 index 00000000..6a0120ef --- /dev/null +++ b/node_modules/lodash/fp/cond.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cond', require('../cond'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/conforms.js b/node_modules/lodash/fp/conforms.js new file mode 100755 index 00000000..3247f64a --- /dev/null +++ b/node_modules/lodash/fp/conforms.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/node_modules/lodash/fp/conformsTo.js b/node_modules/lodash/fp/conformsTo.js new file mode 100755 index 00000000..aa7f41ec --- /dev/null +++ b/node_modules/lodash/fp/conformsTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('conformsTo', require('../conformsTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/constant.js b/node_modules/lodash/fp/constant.js new file mode 100755 index 00000000..9e406fc0 --- /dev/null +++ b/node_modules/lodash/fp/constant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('constant', require('../constant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/contains.js b/node_modules/lodash/fp/contains.js new file mode 100755 index 00000000..594722af --- /dev/null +++ b/node_modules/lodash/fp/contains.js @@ -0,0 +1 @@ +module.exports = require('./includes'); diff --git a/node_modules/lodash/fp/convert.js b/node_modules/lodash/fp/convert.js new file mode 100755 index 00000000..4795dc42 --- /dev/null +++ b/node_modules/lodash/fp/convert.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'), + util = require('./_util'); + +/** + * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. If `name` is an object its methods + * will be converted. + * + * @param {string} name The name of the function to wrap. + * @param {Function} [func] The function to wrap. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function|Object} Returns the converted function or object. + */ +function convert(name, func, options) { + return baseConvert(util, name, func, options); +} + +module.exports = convert; diff --git a/node_modules/lodash/fp/countBy.js b/node_modules/lodash/fp/countBy.js new file mode 100755 index 00000000..dfa46432 --- /dev/null +++ b/node_modules/lodash/fp/countBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('countBy', require('../countBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/create.js b/node_modules/lodash/fp/create.js new file mode 100755 index 00000000..752025fb --- /dev/null +++ b/node_modules/lodash/fp/create.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('create', require('../create')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curry.js b/node_modules/lodash/fp/curry.js new file mode 100755 index 00000000..b0b4168c --- /dev/null +++ b/node_modules/lodash/fp/curry.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curry', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryN.js b/node_modules/lodash/fp/curryN.js new file mode 100755 index 00000000..2ae7d00a --- /dev/null +++ b/node_modules/lodash/fp/curryN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryN', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryRight.js b/node_modules/lodash/fp/curryRight.js new file mode 100755 index 00000000..cb619eb5 --- /dev/null +++ b/node_modules/lodash/fp/curryRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRight', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryRightN.js b/node_modules/lodash/fp/curryRightN.js new file mode 100755 index 00000000..2495afc8 --- /dev/null +++ b/node_modules/lodash/fp/curryRightN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRightN', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/date.js b/node_modules/lodash/fp/date.js new file mode 100755 index 00000000..82cb952b --- /dev/null +++ b/node_modules/lodash/fp/date.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../date')); diff --git a/node_modules/lodash/fp/debounce.js b/node_modules/lodash/fp/debounce.js new file mode 100755 index 00000000..26122293 --- /dev/null +++ b/node_modules/lodash/fp/debounce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('debounce', require('../debounce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/deburr.js b/node_modules/lodash/fp/deburr.js new file mode 100755 index 00000000..96463ab8 --- /dev/null +++ b/node_modules/lodash/fp/deburr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('deburr', require('../deburr'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultTo.js b/node_modules/lodash/fp/defaultTo.js new file mode 100755 index 00000000..d6b52a44 --- /dev/null +++ b/node_modules/lodash/fp/defaultTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultTo', require('../defaultTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaults.js b/node_modules/lodash/fp/defaults.js new file mode 100755 index 00000000..e1a8e6e7 --- /dev/null +++ b/node_modules/lodash/fp/defaults.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaults', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsAll.js b/node_modules/lodash/fp/defaultsAll.js new file mode 100755 index 00000000..238fcc3c --- /dev/null +++ b/node_modules/lodash/fp/defaultsAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsAll', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsDeep.js b/node_modules/lodash/fp/defaultsDeep.js new file mode 100755 index 00000000..1f172ff9 --- /dev/null +++ b/node_modules/lodash/fp/defaultsDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeep', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsDeepAll.js b/node_modules/lodash/fp/defaultsDeepAll.js new file mode 100755 index 00000000..6835f2f0 --- /dev/null +++ b/node_modules/lodash/fp/defaultsDeepAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeepAll', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defer.js b/node_modules/lodash/fp/defer.js new file mode 100755 index 00000000..ec7990fe --- /dev/null +++ b/node_modules/lodash/fp/defer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defer', require('../defer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/delay.js b/node_modules/lodash/fp/delay.js new file mode 100755 index 00000000..556dbd56 --- /dev/null +++ b/node_modules/lodash/fp/delay.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('delay', require('../delay')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/difference.js b/node_modules/lodash/fp/difference.js new file mode 100755 index 00000000..2d037654 --- /dev/null +++ b/node_modules/lodash/fp/difference.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('difference', require('../difference')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/differenceBy.js b/node_modules/lodash/fp/differenceBy.js new file mode 100755 index 00000000..2f914910 --- /dev/null +++ b/node_modules/lodash/fp/differenceBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceBy', require('../differenceBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/differenceWith.js b/node_modules/lodash/fp/differenceWith.js new file mode 100755 index 00000000..bcf5ad2e --- /dev/null +++ b/node_modules/lodash/fp/differenceWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceWith', require('../differenceWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dissoc.js b/node_modules/lodash/fp/dissoc.js new file mode 100755 index 00000000..7ec7be19 --- /dev/null +++ b/node_modules/lodash/fp/dissoc.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/node_modules/lodash/fp/dissocPath.js b/node_modules/lodash/fp/dissocPath.js new file mode 100755 index 00000000..7ec7be19 --- /dev/null +++ b/node_modules/lodash/fp/dissocPath.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/node_modules/lodash/fp/divide.js b/node_modules/lodash/fp/divide.js new file mode 100755 index 00000000..82048c5e --- /dev/null +++ b/node_modules/lodash/fp/divide.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('divide', require('../divide')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/drop.js b/node_modules/lodash/fp/drop.js new file mode 100755 index 00000000..2fa9b4fa --- /dev/null +++ b/node_modules/lodash/fp/drop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('drop', require('../drop')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropLast.js b/node_modules/lodash/fp/dropLast.js new file mode 100755 index 00000000..174e5255 --- /dev/null +++ b/node_modules/lodash/fp/dropLast.js @@ -0,0 +1 @@ +module.exports = require('./dropRight'); diff --git a/node_modules/lodash/fp/dropLastWhile.js b/node_modules/lodash/fp/dropLastWhile.js new file mode 100755 index 00000000..be2a9d24 --- /dev/null +++ b/node_modules/lodash/fp/dropLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./dropRightWhile'); diff --git a/node_modules/lodash/fp/dropRight.js b/node_modules/lodash/fp/dropRight.js new file mode 100755 index 00000000..e98881fc --- /dev/null +++ b/node_modules/lodash/fp/dropRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRight', require('../dropRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropRightWhile.js b/node_modules/lodash/fp/dropRightWhile.js new file mode 100755 index 00000000..cacaa701 --- /dev/null +++ b/node_modules/lodash/fp/dropRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRightWhile', require('../dropRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropWhile.js b/node_modules/lodash/fp/dropWhile.js new file mode 100755 index 00000000..285f864d --- /dev/null +++ b/node_modules/lodash/fp/dropWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropWhile', require('../dropWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/each.js b/node_modules/lodash/fp/each.js new file mode 100755 index 00000000..8800f420 --- /dev/null +++ b/node_modules/lodash/fp/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/node_modules/lodash/fp/eachRight.js b/node_modules/lodash/fp/eachRight.js new file mode 100755 index 00000000..3252b2ab --- /dev/null +++ b/node_modules/lodash/fp/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/node_modules/lodash/fp/endsWith.js b/node_modules/lodash/fp/endsWith.js new file mode 100755 index 00000000..17dc2a49 --- /dev/null +++ b/node_modules/lodash/fp/endsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('endsWith', require('../endsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/entries.js b/node_modules/lodash/fp/entries.js new file mode 100755 index 00000000..7a88df20 --- /dev/null +++ b/node_modules/lodash/fp/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/node_modules/lodash/fp/entriesIn.js b/node_modules/lodash/fp/entriesIn.js new file mode 100755 index 00000000..f6c6331c --- /dev/null +++ b/node_modules/lodash/fp/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/node_modules/lodash/fp/eq.js b/node_modules/lodash/fp/eq.js new file mode 100755 index 00000000..9a3d21bf --- /dev/null +++ b/node_modules/lodash/fp/eq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('eq', require('../eq')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/equals.js b/node_modules/lodash/fp/equals.js new file mode 100755 index 00000000..e6a5ce0c --- /dev/null +++ b/node_modules/lodash/fp/equals.js @@ -0,0 +1 @@ +module.exports = require('./isEqual'); diff --git a/node_modules/lodash/fp/escape.js b/node_modules/lodash/fp/escape.js new file mode 100755 index 00000000..52c1fbba --- /dev/null +++ b/node_modules/lodash/fp/escape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escape', require('../escape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/escapeRegExp.js b/node_modules/lodash/fp/escapeRegExp.js new file mode 100755 index 00000000..369b2eff --- /dev/null +++ b/node_modules/lodash/fp/escapeRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/every.js b/node_modules/lodash/fp/every.js new file mode 100755 index 00000000..95c2776c --- /dev/null +++ b/node_modules/lodash/fp/every.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('every', require('../every')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/extend.js b/node_modules/lodash/fp/extend.js new file mode 100755 index 00000000..e00166c2 --- /dev/null +++ b/node_modules/lodash/fp/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/node_modules/lodash/fp/extendAll.js b/node_modules/lodash/fp/extendAll.js new file mode 100755 index 00000000..cc55b64f --- /dev/null +++ b/node_modules/lodash/fp/extendAll.js @@ -0,0 +1 @@ +module.exports = require('./assignInAll'); diff --git a/node_modules/lodash/fp/extendAllWith.js b/node_modules/lodash/fp/extendAllWith.js new file mode 100755 index 00000000..6679d208 --- /dev/null +++ b/node_modules/lodash/fp/extendAllWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInAllWith'); diff --git a/node_modules/lodash/fp/extendWith.js b/node_modules/lodash/fp/extendWith.js new file mode 100755 index 00000000..dbdcb3b4 --- /dev/null +++ b/node_modules/lodash/fp/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/node_modules/lodash/fp/fill.js b/node_modules/lodash/fp/fill.js new file mode 100755 index 00000000..b2d47e84 --- /dev/null +++ b/node_modules/lodash/fp/fill.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fill', require('../fill')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/filter.js b/node_modules/lodash/fp/filter.js new file mode 100755 index 00000000..796d501c --- /dev/null +++ b/node_modules/lodash/fp/filter.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('filter', require('../filter')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/find.js b/node_modules/lodash/fp/find.js new file mode 100755 index 00000000..f805d336 --- /dev/null +++ b/node_modules/lodash/fp/find.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('find', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findFrom.js b/node_modules/lodash/fp/findFrom.js new file mode 100755 index 00000000..da8275e8 --- /dev/null +++ b/node_modules/lodash/fp/findFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findFrom', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findIndex.js b/node_modules/lodash/fp/findIndex.js new file mode 100755 index 00000000..8c15fd11 --- /dev/null +++ b/node_modules/lodash/fp/findIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndex', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findIndexFrom.js b/node_modules/lodash/fp/findIndexFrom.js new file mode 100755 index 00000000..32e98cb9 --- /dev/null +++ b/node_modules/lodash/fp/findIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndexFrom', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findKey.js b/node_modules/lodash/fp/findKey.js new file mode 100755 index 00000000..475bcfa8 --- /dev/null +++ b/node_modules/lodash/fp/findKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findKey', require('../findKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLast.js b/node_modules/lodash/fp/findLast.js new file mode 100755 index 00000000..093fe94e --- /dev/null +++ b/node_modules/lodash/fp/findLast.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLast', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastFrom.js b/node_modules/lodash/fp/findLastFrom.js new file mode 100755 index 00000000..76c38fba --- /dev/null +++ b/node_modules/lodash/fp/findLastFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastFrom', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastIndex.js b/node_modules/lodash/fp/findLastIndex.js new file mode 100755 index 00000000..36986df0 --- /dev/null +++ b/node_modules/lodash/fp/findLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndex', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastIndexFrom.js b/node_modules/lodash/fp/findLastIndexFrom.js new file mode 100755 index 00000000..34c8176c --- /dev/null +++ b/node_modules/lodash/fp/findLastIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndexFrom', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastKey.js b/node_modules/lodash/fp/findLastKey.js new file mode 100755 index 00000000..5f81b604 --- /dev/null +++ b/node_modules/lodash/fp/findLastKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastKey', require('../findLastKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/first.js b/node_modules/lodash/fp/first.js new file mode 100755 index 00000000..53f4ad13 --- /dev/null +++ b/node_modules/lodash/fp/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/node_modules/lodash/fp/flatMap.js b/node_modules/lodash/fp/flatMap.js new file mode 100755 index 00000000..d01dc4d0 --- /dev/null +++ b/node_modules/lodash/fp/flatMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMap', require('../flatMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatMapDeep.js b/node_modules/lodash/fp/flatMapDeep.js new file mode 100755 index 00000000..569c42eb --- /dev/null +++ b/node_modules/lodash/fp/flatMapDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDeep', require('../flatMapDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatMapDepth.js b/node_modules/lodash/fp/flatMapDepth.js new file mode 100755 index 00000000..6eb68fde --- /dev/null +++ b/node_modules/lodash/fp/flatMapDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDepth', require('../flatMapDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatten.js b/node_modules/lodash/fp/flatten.js new file mode 100755 index 00000000..30425d89 --- /dev/null +++ b/node_modules/lodash/fp/flatten.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatten', require('../flatten'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flattenDeep.js b/node_modules/lodash/fp/flattenDeep.js new file mode 100755 index 00000000..aed5db27 --- /dev/null +++ b/node_modules/lodash/fp/flattenDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flattenDepth.js b/node_modules/lodash/fp/flattenDepth.js new file mode 100755 index 00000000..ad65e378 --- /dev/null +++ b/node_modules/lodash/fp/flattenDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDepth', require('../flattenDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flip.js b/node_modules/lodash/fp/flip.js new file mode 100755 index 00000000..0547e7b4 --- /dev/null +++ b/node_modules/lodash/fp/flip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flip', require('../flip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/floor.js b/node_modules/lodash/fp/floor.js new file mode 100755 index 00000000..a6cf3358 --- /dev/null +++ b/node_modules/lodash/fp/floor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('floor', require('../floor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flow.js b/node_modules/lodash/fp/flow.js new file mode 100755 index 00000000..cd83677a --- /dev/null +++ b/node_modules/lodash/fp/flow.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flow', require('../flow')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flowRight.js b/node_modules/lodash/fp/flowRight.js new file mode 100755 index 00000000..972a5b9b --- /dev/null +++ b/node_modules/lodash/fp/flowRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flowRight', require('../flowRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forEach.js b/node_modules/lodash/fp/forEach.js new file mode 100755 index 00000000..2f494521 --- /dev/null +++ b/node_modules/lodash/fp/forEach.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEach', require('../forEach')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forEachRight.js b/node_modules/lodash/fp/forEachRight.js new file mode 100755 index 00000000..3ff97336 --- /dev/null +++ b/node_modules/lodash/fp/forEachRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEachRight', require('../forEachRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forIn.js b/node_modules/lodash/fp/forIn.js new file mode 100755 index 00000000..9341749b --- /dev/null +++ b/node_modules/lodash/fp/forIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forIn', require('../forIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forInRight.js b/node_modules/lodash/fp/forInRight.js new file mode 100755 index 00000000..cecf8bbf --- /dev/null +++ b/node_modules/lodash/fp/forInRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forInRight', require('../forInRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forOwn.js b/node_modules/lodash/fp/forOwn.js new file mode 100755 index 00000000..246449e9 --- /dev/null +++ b/node_modules/lodash/fp/forOwn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwn', require('../forOwn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forOwnRight.js b/node_modules/lodash/fp/forOwnRight.js new file mode 100755 index 00000000..c5e826e0 --- /dev/null +++ b/node_modules/lodash/fp/forOwnRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwnRight', require('../forOwnRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/fromPairs.js b/node_modules/lodash/fp/fromPairs.js new file mode 100755 index 00000000..f8cc5968 --- /dev/null +++ b/node_modules/lodash/fp/fromPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fromPairs', require('../fromPairs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/function.js b/node_modules/lodash/fp/function.js new file mode 100755 index 00000000..dfe69b1f --- /dev/null +++ b/node_modules/lodash/fp/function.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../function')); diff --git a/node_modules/lodash/fp/functions.js b/node_modules/lodash/fp/functions.js new file mode 100755 index 00000000..09d1bb1b --- /dev/null +++ b/node_modules/lodash/fp/functions.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functions', require('../functions'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/functionsIn.js b/node_modules/lodash/fp/functionsIn.js new file mode 100755 index 00000000..2cfeb83e --- /dev/null +++ b/node_modules/lodash/fp/functionsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/get.js b/node_modules/lodash/fp/get.js new file mode 100755 index 00000000..6d3a3286 --- /dev/null +++ b/node_modules/lodash/fp/get.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('get', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/getOr.js b/node_modules/lodash/fp/getOr.js new file mode 100755 index 00000000..7dbf771f --- /dev/null +++ b/node_modules/lodash/fp/getOr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('getOr', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/groupBy.js b/node_modules/lodash/fp/groupBy.js new file mode 100755 index 00000000..fc0bc78a --- /dev/null +++ b/node_modules/lodash/fp/groupBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('groupBy', require('../groupBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/gt.js b/node_modules/lodash/fp/gt.js new file mode 100755 index 00000000..9e57c808 --- /dev/null +++ b/node_modules/lodash/fp/gt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gt', require('../gt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/gte.js b/node_modules/lodash/fp/gte.js new file mode 100755 index 00000000..45847863 --- /dev/null +++ b/node_modules/lodash/fp/gte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gte', require('../gte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/has.js b/node_modules/lodash/fp/has.js new file mode 100755 index 00000000..b9012983 --- /dev/null +++ b/node_modules/lodash/fp/has.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('has', require('../has')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/hasIn.js b/node_modules/lodash/fp/hasIn.js new file mode 100755 index 00000000..b3c3d1a3 --- /dev/null +++ b/node_modules/lodash/fp/hasIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('hasIn', require('../hasIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/head.js b/node_modules/lodash/fp/head.js new file mode 100755 index 00000000..2694f0a2 --- /dev/null +++ b/node_modules/lodash/fp/head.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('head', require('../head'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/identical.js b/node_modules/lodash/fp/identical.js new file mode 100755 index 00000000..85563f4a --- /dev/null +++ b/node_modules/lodash/fp/identical.js @@ -0,0 +1 @@ +module.exports = require('./eq'); diff --git a/node_modules/lodash/fp/identity.js b/node_modules/lodash/fp/identity.js new file mode 100755 index 00000000..096415a5 --- /dev/null +++ b/node_modules/lodash/fp/identity.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('identity', require('../identity'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/inRange.js b/node_modules/lodash/fp/inRange.js new file mode 100755 index 00000000..202d940b --- /dev/null +++ b/node_modules/lodash/fp/inRange.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('inRange', require('../inRange')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/includes.js b/node_modules/lodash/fp/includes.js new file mode 100755 index 00000000..11467805 --- /dev/null +++ b/node_modules/lodash/fp/includes.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includes', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/includesFrom.js b/node_modules/lodash/fp/includesFrom.js new file mode 100755 index 00000000..683afdb4 --- /dev/null +++ b/node_modules/lodash/fp/includesFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includesFrom', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/indexBy.js b/node_modules/lodash/fp/indexBy.js new file mode 100755 index 00000000..7e64bc0f --- /dev/null +++ b/node_modules/lodash/fp/indexBy.js @@ -0,0 +1 @@ +module.exports = require('./keyBy'); diff --git a/node_modules/lodash/fp/indexOf.js b/node_modules/lodash/fp/indexOf.js new file mode 100755 index 00000000..524658eb --- /dev/null +++ b/node_modules/lodash/fp/indexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOf', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/indexOfFrom.js b/node_modules/lodash/fp/indexOfFrom.js new file mode 100755 index 00000000..d99c822f --- /dev/null +++ b/node_modules/lodash/fp/indexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOfFrom', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/init.js b/node_modules/lodash/fp/init.js new file mode 100755 index 00000000..2f88d8b0 --- /dev/null +++ b/node_modules/lodash/fp/init.js @@ -0,0 +1 @@ +module.exports = require('./initial'); diff --git a/node_modules/lodash/fp/initial.js b/node_modules/lodash/fp/initial.js new file mode 100755 index 00000000..b732ba0b --- /dev/null +++ b/node_modules/lodash/fp/initial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('initial', require('../initial'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersection.js b/node_modules/lodash/fp/intersection.js new file mode 100755 index 00000000..52936d56 --- /dev/null +++ b/node_modules/lodash/fp/intersection.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersection', require('../intersection')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersectionBy.js b/node_modules/lodash/fp/intersectionBy.js new file mode 100755 index 00000000..72629f27 --- /dev/null +++ b/node_modules/lodash/fp/intersectionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionBy', require('../intersectionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersectionWith.js b/node_modules/lodash/fp/intersectionWith.js new file mode 100755 index 00000000..e064f400 --- /dev/null +++ b/node_modules/lodash/fp/intersectionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionWith', require('../intersectionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invert.js b/node_modules/lodash/fp/invert.js new file mode 100755 index 00000000..2d5d1f0d --- /dev/null +++ b/node_modules/lodash/fp/invert.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invert', require('../invert')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invertBy.js b/node_modules/lodash/fp/invertBy.js new file mode 100755 index 00000000..63ca97ec --- /dev/null +++ b/node_modules/lodash/fp/invertBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invertBy', require('../invertBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invertObj.js b/node_modules/lodash/fp/invertObj.js new file mode 100755 index 00000000..f1d842e4 --- /dev/null +++ b/node_modules/lodash/fp/invertObj.js @@ -0,0 +1 @@ +module.exports = require('./invert'); diff --git a/node_modules/lodash/fp/invoke.js b/node_modules/lodash/fp/invoke.js new file mode 100755 index 00000000..fcf17f0d --- /dev/null +++ b/node_modules/lodash/fp/invoke.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invoke', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeArgs.js b/node_modules/lodash/fp/invokeArgs.js new file mode 100755 index 00000000..d3f2953f --- /dev/null +++ b/node_modules/lodash/fp/invokeArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgs', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeArgsMap.js b/node_modules/lodash/fp/invokeArgsMap.js new file mode 100755 index 00000000..eaa9f84f --- /dev/null +++ b/node_modules/lodash/fp/invokeArgsMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgsMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeMap.js b/node_modules/lodash/fp/invokeMap.js new file mode 100755 index 00000000..6515fd73 --- /dev/null +++ b/node_modules/lodash/fp/invokeMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArguments.js b/node_modules/lodash/fp/isArguments.js new file mode 100755 index 00000000..1d93c9e5 --- /dev/null +++ b/node_modules/lodash/fp/isArguments.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArguments', require('../isArguments'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArray.js b/node_modules/lodash/fp/isArray.js new file mode 100755 index 00000000..ba7ade8d --- /dev/null +++ b/node_modules/lodash/fp/isArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArray', require('../isArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayBuffer.js b/node_modules/lodash/fp/isArrayBuffer.js new file mode 100755 index 00000000..5088513f --- /dev/null +++ b/node_modules/lodash/fp/isArrayBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayLike.js b/node_modules/lodash/fp/isArrayLike.js new file mode 100755 index 00000000..8f1856bf --- /dev/null +++ b/node_modules/lodash/fp/isArrayLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayLikeObject.js b/node_modules/lodash/fp/isArrayLikeObject.js new file mode 100755 index 00000000..21084984 --- /dev/null +++ b/node_modules/lodash/fp/isArrayLikeObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isBoolean.js b/node_modules/lodash/fp/isBoolean.js new file mode 100755 index 00000000..9339f75b --- /dev/null +++ b/node_modules/lodash/fp/isBoolean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isBuffer.js b/node_modules/lodash/fp/isBuffer.js new file mode 100755 index 00000000..e60b1238 --- /dev/null +++ b/node_modules/lodash/fp/isBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isDate.js b/node_modules/lodash/fp/isDate.js new file mode 100755 index 00000000..dc41d089 --- /dev/null +++ b/node_modules/lodash/fp/isDate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isDate', require('../isDate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isElement.js b/node_modules/lodash/fp/isElement.js new file mode 100755 index 00000000..18ee039a --- /dev/null +++ b/node_modules/lodash/fp/isElement.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isElement', require('../isElement'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEmpty.js b/node_modules/lodash/fp/isEmpty.js new file mode 100755 index 00000000..0f4ae841 --- /dev/null +++ b/node_modules/lodash/fp/isEmpty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEqual.js b/node_modules/lodash/fp/isEqual.js new file mode 100755 index 00000000..41383865 --- /dev/null +++ b/node_modules/lodash/fp/isEqual.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqual', require('../isEqual')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEqualWith.js b/node_modules/lodash/fp/isEqualWith.js new file mode 100755 index 00000000..029ff5cd --- /dev/null +++ b/node_modules/lodash/fp/isEqualWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqualWith', require('../isEqualWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isError.js b/node_modules/lodash/fp/isError.js new file mode 100755 index 00000000..3dfd81cc --- /dev/null +++ b/node_modules/lodash/fp/isError.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isError', require('../isError'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isFinite.js b/node_modules/lodash/fp/isFinite.js new file mode 100755 index 00000000..0b647b84 --- /dev/null +++ b/node_modules/lodash/fp/isFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFinite', require('../isFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isFunction.js b/node_modules/lodash/fp/isFunction.js new file mode 100755 index 00000000..ff8e5c45 --- /dev/null +++ b/node_modules/lodash/fp/isFunction.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFunction', require('../isFunction'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isInteger.js b/node_modules/lodash/fp/isInteger.js new file mode 100755 index 00000000..67af4ff6 --- /dev/null +++ b/node_modules/lodash/fp/isInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isInteger', require('../isInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isLength.js b/node_modules/lodash/fp/isLength.js new file mode 100755 index 00000000..fc101c5a --- /dev/null +++ b/node_modules/lodash/fp/isLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isLength', require('../isLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMap.js b/node_modules/lodash/fp/isMap.js new file mode 100755 index 00000000..a209aa66 --- /dev/null +++ b/node_modules/lodash/fp/isMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMap', require('../isMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMatch.js b/node_modules/lodash/fp/isMatch.js new file mode 100755 index 00000000..6264ca17 --- /dev/null +++ b/node_modules/lodash/fp/isMatch.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatch', require('../isMatch')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMatchWith.js b/node_modules/lodash/fp/isMatchWith.js new file mode 100755 index 00000000..d95f3193 --- /dev/null +++ b/node_modules/lodash/fp/isMatchWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatchWith', require('../isMatchWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNaN.js b/node_modules/lodash/fp/isNaN.js new file mode 100755 index 00000000..66a978f1 --- /dev/null +++ b/node_modules/lodash/fp/isNaN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNaN', require('../isNaN'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNative.js b/node_modules/lodash/fp/isNative.js new file mode 100755 index 00000000..3d775ba9 --- /dev/null +++ b/node_modules/lodash/fp/isNative.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNative', require('../isNative'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNil.js b/node_modules/lodash/fp/isNil.js new file mode 100755 index 00000000..5952c028 --- /dev/null +++ b/node_modules/lodash/fp/isNil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNil', require('../isNil'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNull.js b/node_modules/lodash/fp/isNull.js new file mode 100755 index 00000000..f201a354 --- /dev/null +++ b/node_modules/lodash/fp/isNull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNull', require('../isNull'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNumber.js b/node_modules/lodash/fp/isNumber.js new file mode 100755 index 00000000..a2b5fa04 --- /dev/null +++ b/node_modules/lodash/fp/isNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNumber', require('../isNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isObject.js b/node_modules/lodash/fp/isObject.js new file mode 100755 index 00000000..231ace03 --- /dev/null +++ b/node_modules/lodash/fp/isObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObject', require('../isObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isObjectLike.js b/node_modules/lodash/fp/isObjectLike.js new file mode 100755 index 00000000..f16082e6 --- /dev/null +++ b/node_modules/lodash/fp/isObjectLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isPlainObject.js b/node_modules/lodash/fp/isPlainObject.js new file mode 100755 index 00000000..b5bea90d --- /dev/null +++ b/node_modules/lodash/fp/isPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isRegExp.js b/node_modules/lodash/fp/isRegExp.js new file mode 100755 index 00000000..12a1a3d7 --- /dev/null +++ b/node_modules/lodash/fp/isRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSafeInteger.js b/node_modules/lodash/fp/isSafeInteger.js new file mode 100755 index 00000000..7230f552 --- /dev/null +++ b/node_modules/lodash/fp/isSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSet.js b/node_modules/lodash/fp/isSet.js new file mode 100755 index 00000000..35c01f6f --- /dev/null +++ b/node_modules/lodash/fp/isSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSet', require('../isSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isString.js b/node_modules/lodash/fp/isString.js new file mode 100755 index 00000000..1fd0679e --- /dev/null +++ b/node_modules/lodash/fp/isString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isString', require('../isString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSymbol.js b/node_modules/lodash/fp/isSymbol.js new file mode 100755 index 00000000..38676956 --- /dev/null +++ b/node_modules/lodash/fp/isSymbol.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isTypedArray.js b/node_modules/lodash/fp/isTypedArray.js new file mode 100755 index 00000000..85679538 --- /dev/null +++ b/node_modules/lodash/fp/isTypedArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isUndefined.js b/node_modules/lodash/fp/isUndefined.js new file mode 100755 index 00000000..ddbca31c --- /dev/null +++ b/node_modules/lodash/fp/isUndefined.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isWeakMap.js b/node_modules/lodash/fp/isWeakMap.js new file mode 100755 index 00000000..ef60c613 --- /dev/null +++ b/node_modules/lodash/fp/isWeakMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isWeakSet.js b/node_modules/lodash/fp/isWeakSet.js new file mode 100755 index 00000000..c99bfaa6 --- /dev/null +++ b/node_modules/lodash/fp/isWeakSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/iteratee.js b/node_modules/lodash/fp/iteratee.js new file mode 100755 index 00000000..9f0f7173 --- /dev/null +++ b/node_modules/lodash/fp/iteratee.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('iteratee', require('../iteratee')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/join.js b/node_modules/lodash/fp/join.js new file mode 100755 index 00000000..a220e003 --- /dev/null +++ b/node_modules/lodash/fp/join.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('join', require('../join')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/juxt.js b/node_modules/lodash/fp/juxt.js new file mode 100755 index 00000000..f71e04e0 --- /dev/null +++ b/node_modules/lodash/fp/juxt.js @@ -0,0 +1 @@ +module.exports = require('./over'); diff --git a/node_modules/lodash/fp/kebabCase.js b/node_modules/lodash/fp/kebabCase.js new file mode 100755 index 00000000..60737f17 --- /dev/null +++ b/node_modules/lodash/fp/kebabCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keyBy.js b/node_modules/lodash/fp/keyBy.js new file mode 100755 index 00000000..9a6a85d4 --- /dev/null +++ b/node_modules/lodash/fp/keyBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keyBy', require('../keyBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keys.js b/node_modules/lodash/fp/keys.js new file mode 100755 index 00000000..e12bb07f --- /dev/null +++ b/node_modules/lodash/fp/keys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keys', require('../keys'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keysIn.js b/node_modules/lodash/fp/keysIn.js new file mode 100755 index 00000000..f3eb36a8 --- /dev/null +++ b/node_modules/lodash/fp/keysIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keysIn', require('../keysIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lang.js b/node_modules/lodash/fp/lang.js new file mode 100755 index 00000000..08cc9c14 --- /dev/null +++ b/node_modules/lodash/fp/lang.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../lang')); diff --git a/node_modules/lodash/fp/last.js b/node_modules/lodash/fp/last.js new file mode 100755 index 00000000..0f716993 --- /dev/null +++ b/node_modules/lodash/fp/last.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('last', require('../last'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lastIndexOf.js b/node_modules/lodash/fp/lastIndexOf.js new file mode 100755 index 00000000..ddf39c30 --- /dev/null +++ b/node_modules/lodash/fp/lastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOf', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lastIndexOfFrom.js b/node_modules/lodash/fp/lastIndexOfFrom.js new file mode 100755 index 00000000..1ff6a0b5 --- /dev/null +++ b/node_modules/lodash/fp/lastIndexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOfFrom', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lowerCase.js b/node_modules/lodash/fp/lowerCase.js new file mode 100755 index 00000000..ea64bc15 --- /dev/null +++ b/node_modules/lodash/fp/lowerCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lowerFirst.js b/node_modules/lodash/fp/lowerFirst.js new file mode 100755 index 00000000..539720a3 --- /dev/null +++ b/node_modules/lodash/fp/lowerFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lt.js b/node_modules/lodash/fp/lt.js new file mode 100755 index 00000000..a31d21ec --- /dev/null +++ b/node_modules/lodash/fp/lt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lt', require('../lt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lte.js b/node_modules/lodash/fp/lte.js new file mode 100755 index 00000000..d795d10e --- /dev/null +++ b/node_modules/lodash/fp/lte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lte', require('../lte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/map.js b/node_modules/lodash/fp/map.js new file mode 100755 index 00000000..cf987943 --- /dev/null +++ b/node_modules/lodash/fp/map.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('map', require('../map')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mapKeys.js b/node_modules/lodash/fp/mapKeys.js new file mode 100755 index 00000000..16845870 --- /dev/null +++ b/node_modules/lodash/fp/mapKeys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapKeys', require('../mapKeys')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mapValues.js b/node_modules/lodash/fp/mapValues.js new file mode 100755 index 00000000..40049727 --- /dev/null +++ b/node_modules/lodash/fp/mapValues.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapValues', require('../mapValues')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/matches.js b/node_modules/lodash/fp/matches.js new file mode 100755 index 00000000..29d1e1e4 --- /dev/null +++ b/node_modules/lodash/fp/matches.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/node_modules/lodash/fp/matchesProperty.js b/node_modules/lodash/fp/matchesProperty.js new file mode 100755 index 00000000..4575bd24 --- /dev/null +++ b/node_modules/lodash/fp/matchesProperty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('matchesProperty', require('../matchesProperty')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/math.js b/node_modules/lodash/fp/math.js new file mode 100755 index 00000000..e8f50f79 --- /dev/null +++ b/node_modules/lodash/fp/math.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../math')); diff --git a/node_modules/lodash/fp/max.js b/node_modules/lodash/fp/max.js new file mode 100755 index 00000000..a66acac2 --- /dev/null +++ b/node_modules/lodash/fp/max.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('max', require('../max'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/maxBy.js b/node_modules/lodash/fp/maxBy.js new file mode 100755 index 00000000..d083fd64 --- /dev/null +++ b/node_modules/lodash/fp/maxBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('maxBy', require('../maxBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mean.js b/node_modules/lodash/fp/mean.js new file mode 100755 index 00000000..31172460 --- /dev/null +++ b/node_modules/lodash/fp/mean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mean', require('../mean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/meanBy.js b/node_modules/lodash/fp/meanBy.js new file mode 100755 index 00000000..556f25ed --- /dev/null +++ b/node_modules/lodash/fp/meanBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('meanBy', require('../meanBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/memoize.js b/node_modules/lodash/fp/memoize.js new file mode 100755 index 00000000..638eec63 --- /dev/null +++ b/node_modules/lodash/fp/memoize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('memoize', require('../memoize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/merge.js b/node_modules/lodash/fp/merge.js new file mode 100755 index 00000000..ac66adde --- /dev/null +++ b/node_modules/lodash/fp/merge.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('merge', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeAll.js b/node_modules/lodash/fp/mergeAll.js new file mode 100755 index 00000000..a3674d67 --- /dev/null +++ b/node_modules/lodash/fp/mergeAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAll', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeAllWith.js b/node_modules/lodash/fp/mergeAllWith.js new file mode 100755 index 00000000..4bd4206d --- /dev/null +++ b/node_modules/lodash/fp/mergeAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAllWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeWith.js b/node_modules/lodash/fp/mergeWith.js new file mode 100755 index 00000000..00d44d5e --- /dev/null +++ b/node_modules/lodash/fp/mergeWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/method.js b/node_modules/lodash/fp/method.js new file mode 100755 index 00000000..f4060c68 --- /dev/null +++ b/node_modules/lodash/fp/method.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('method', require('../method')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/methodOf.js b/node_modules/lodash/fp/methodOf.js new file mode 100755 index 00000000..61399056 --- /dev/null +++ b/node_modules/lodash/fp/methodOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('methodOf', require('../methodOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/min.js b/node_modules/lodash/fp/min.js new file mode 100755 index 00000000..d12c6b40 --- /dev/null +++ b/node_modules/lodash/fp/min.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('min', require('../min'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/minBy.js b/node_modules/lodash/fp/minBy.js new file mode 100755 index 00000000..fdb9e24d --- /dev/null +++ b/node_modules/lodash/fp/minBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('minBy', require('../minBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mixin.js b/node_modules/lodash/fp/mixin.js new file mode 100755 index 00000000..332e6fbf --- /dev/null +++ b/node_modules/lodash/fp/mixin.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mixin', require('../mixin')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/multiply.js b/node_modules/lodash/fp/multiply.js new file mode 100755 index 00000000..4dcf0b0d --- /dev/null +++ b/node_modules/lodash/fp/multiply.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('multiply', require('../multiply')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nAry.js b/node_modules/lodash/fp/nAry.js new file mode 100755 index 00000000..f262a76c --- /dev/null +++ b/node_modules/lodash/fp/nAry.js @@ -0,0 +1 @@ +module.exports = require('./ary'); diff --git a/node_modules/lodash/fp/negate.js b/node_modules/lodash/fp/negate.js new file mode 100755 index 00000000..8b6dc7c5 --- /dev/null +++ b/node_modules/lodash/fp/negate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('negate', require('../negate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/next.js b/node_modules/lodash/fp/next.js new file mode 100755 index 00000000..140155e2 --- /dev/null +++ b/node_modules/lodash/fp/next.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('next', require('../next'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/noop.js b/node_modules/lodash/fp/noop.js new file mode 100755 index 00000000..b9e32cc8 --- /dev/null +++ b/node_modules/lodash/fp/noop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('noop', require('../noop'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/now.js b/node_modules/lodash/fp/now.js new file mode 100755 index 00000000..6de2068a --- /dev/null +++ b/node_modules/lodash/fp/now.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('now', require('../now'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nth.js b/node_modules/lodash/fp/nth.js new file mode 100755 index 00000000..da4fda74 --- /dev/null +++ b/node_modules/lodash/fp/nth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nth', require('../nth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nthArg.js b/node_modules/lodash/fp/nthArg.js new file mode 100755 index 00000000..fce31659 --- /dev/null +++ b/node_modules/lodash/fp/nthArg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nthArg', require('../nthArg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/number.js b/node_modules/lodash/fp/number.js new file mode 100755 index 00000000..5c10b884 --- /dev/null +++ b/node_modules/lodash/fp/number.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../number')); diff --git a/node_modules/lodash/fp/object.js b/node_modules/lodash/fp/object.js new file mode 100755 index 00000000..ae39a134 --- /dev/null +++ b/node_modules/lodash/fp/object.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../object')); diff --git a/node_modules/lodash/fp/omit.js b/node_modules/lodash/fp/omit.js new file mode 100755 index 00000000..fd685291 --- /dev/null +++ b/node_modules/lodash/fp/omit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omit', require('../omit')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/omitAll.js b/node_modules/lodash/fp/omitAll.js new file mode 100755 index 00000000..144cf4b9 --- /dev/null +++ b/node_modules/lodash/fp/omitAll.js @@ -0,0 +1 @@ +module.exports = require('./omit'); diff --git a/node_modules/lodash/fp/omitBy.js b/node_modules/lodash/fp/omitBy.js new file mode 100755 index 00000000..90df7380 --- /dev/null +++ b/node_modules/lodash/fp/omitBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omitBy', require('../omitBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/once.js b/node_modules/lodash/fp/once.js new file mode 100755 index 00000000..f8f0a5c7 --- /dev/null +++ b/node_modules/lodash/fp/once.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('once', require('../once'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/orderBy.js b/node_modules/lodash/fp/orderBy.js new file mode 100755 index 00000000..848e2107 --- /dev/null +++ b/node_modules/lodash/fp/orderBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('orderBy', require('../orderBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/over.js b/node_modules/lodash/fp/over.js new file mode 100755 index 00000000..01eba7b9 --- /dev/null +++ b/node_modules/lodash/fp/over.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('over', require('../over')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overArgs.js b/node_modules/lodash/fp/overArgs.js new file mode 100755 index 00000000..738556f0 --- /dev/null +++ b/node_modules/lodash/fp/overArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overArgs', require('../overArgs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overEvery.js b/node_modules/lodash/fp/overEvery.js new file mode 100755 index 00000000..9f5a032d --- /dev/null +++ b/node_modules/lodash/fp/overEvery.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overEvery', require('../overEvery')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overSome.js b/node_modules/lodash/fp/overSome.js new file mode 100755 index 00000000..15939d58 --- /dev/null +++ b/node_modules/lodash/fp/overSome.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overSome', require('../overSome')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pad.js b/node_modules/lodash/fp/pad.js new file mode 100755 index 00000000..f1dea4a9 --- /dev/null +++ b/node_modules/lodash/fp/pad.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pad', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padChars.js b/node_modules/lodash/fp/padChars.js new file mode 100755 index 00000000..d6e0804c --- /dev/null +++ b/node_modules/lodash/fp/padChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padChars', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padCharsEnd.js b/node_modules/lodash/fp/padCharsEnd.js new file mode 100755 index 00000000..d4ab79ad --- /dev/null +++ b/node_modules/lodash/fp/padCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padCharsStart.js b/node_modules/lodash/fp/padCharsStart.js new file mode 100755 index 00000000..a08a3000 --- /dev/null +++ b/node_modules/lodash/fp/padCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padEnd.js b/node_modules/lodash/fp/padEnd.js new file mode 100755 index 00000000..a8522ec3 --- /dev/null +++ b/node_modules/lodash/fp/padEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padStart.js b/node_modules/lodash/fp/padStart.js new file mode 100755 index 00000000..f4ca79d4 --- /dev/null +++ b/node_modules/lodash/fp/padStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/parseInt.js b/node_modules/lodash/fp/parseInt.js new file mode 100755 index 00000000..27314ccb --- /dev/null +++ b/node_modules/lodash/fp/parseInt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('parseInt', require('../parseInt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partial.js b/node_modules/lodash/fp/partial.js new file mode 100755 index 00000000..5d460159 --- /dev/null +++ b/node_modules/lodash/fp/partial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partial', require('../partial')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partialRight.js b/node_modules/lodash/fp/partialRight.js new file mode 100755 index 00000000..7f05fed0 --- /dev/null +++ b/node_modules/lodash/fp/partialRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partialRight', require('../partialRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partition.js b/node_modules/lodash/fp/partition.js new file mode 100755 index 00000000..2ebcacc1 --- /dev/null +++ b/node_modules/lodash/fp/partition.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partition', require('../partition')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/path.js b/node_modules/lodash/fp/path.js new file mode 100755 index 00000000..b29cfb21 --- /dev/null +++ b/node_modules/lodash/fp/path.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/pathEq.js b/node_modules/lodash/fp/pathEq.js new file mode 100755 index 00000000..36c027a3 --- /dev/null +++ b/node_modules/lodash/fp/pathEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/node_modules/lodash/fp/pathOr.js b/node_modules/lodash/fp/pathOr.js new file mode 100755 index 00000000..4ab58209 --- /dev/null +++ b/node_modules/lodash/fp/pathOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/node_modules/lodash/fp/paths.js b/node_modules/lodash/fp/paths.js new file mode 100755 index 00000000..1eb7950a --- /dev/null +++ b/node_modules/lodash/fp/paths.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/node_modules/lodash/fp/pick.js b/node_modules/lodash/fp/pick.js new file mode 100755 index 00000000..197393de --- /dev/null +++ b/node_modules/lodash/fp/pick.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pick', require('../pick')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pickAll.js b/node_modules/lodash/fp/pickAll.js new file mode 100755 index 00000000..a8ecd461 --- /dev/null +++ b/node_modules/lodash/fp/pickAll.js @@ -0,0 +1 @@ +module.exports = require('./pick'); diff --git a/node_modules/lodash/fp/pickBy.js b/node_modules/lodash/fp/pickBy.js new file mode 100755 index 00000000..d832d16b --- /dev/null +++ b/node_modules/lodash/fp/pickBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pickBy', require('../pickBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pipe.js b/node_modules/lodash/fp/pipe.js new file mode 100755 index 00000000..b2e1e2cc --- /dev/null +++ b/node_modules/lodash/fp/pipe.js @@ -0,0 +1 @@ +module.exports = require('./flow'); diff --git a/node_modules/lodash/fp/placeholder.js b/node_modules/lodash/fp/placeholder.js new file mode 100755 index 00000000..1ce17393 --- /dev/null +++ b/node_modules/lodash/fp/placeholder.js @@ -0,0 +1,6 @@ +/** + * The default argument placeholder value for methods. + * + * @type {Object} + */ +module.exports = {}; diff --git a/node_modules/lodash/fp/plant.js b/node_modules/lodash/fp/plant.js new file mode 100755 index 00000000..eca8f32b --- /dev/null +++ b/node_modules/lodash/fp/plant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('plant', require('../plant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pluck.js b/node_modules/lodash/fp/pluck.js new file mode 100755 index 00000000..0d1e1abf --- /dev/null +++ b/node_modules/lodash/fp/pluck.js @@ -0,0 +1 @@ +module.exports = require('./map'); diff --git a/node_modules/lodash/fp/prop.js b/node_modules/lodash/fp/prop.js new file mode 100755 index 00000000..b29cfb21 --- /dev/null +++ b/node_modules/lodash/fp/prop.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/propEq.js b/node_modules/lodash/fp/propEq.js new file mode 100755 index 00000000..36c027a3 --- /dev/null +++ b/node_modules/lodash/fp/propEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/node_modules/lodash/fp/propOr.js b/node_modules/lodash/fp/propOr.js new file mode 100755 index 00000000..4ab58209 --- /dev/null +++ b/node_modules/lodash/fp/propOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/node_modules/lodash/fp/property.js b/node_modules/lodash/fp/property.js new file mode 100755 index 00000000..b29cfb21 --- /dev/null +++ b/node_modules/lodash/fp/property.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/propertyOf.js b/node_modules/lodash/fp/propertyOf.js new file mode 100755 index 00000000..f6273ee4 --- /dev/null +++ b/node_modules/lodash/fp/propertyOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('propertyOf', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/props.js b/node_modules/lodash/fp/props.js new file mode 100755 index 00000000..1eb7950a --- /dev/null +++ b/node_modules/lodash/fp/props.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/node_modules/lodash/fp/pull.js b/node_modules/lodash/fp/pull.js new file mode 100755 index 00000000..8d7084f0 --- /dev/null +++ b/node_modules/lodash/fp/pull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pull', require('../pull')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAll.js b/node_modules/lodash/fp/pullAll.js new file mode 100755 index 00000000..98d5c9a7 --- /dev/null +++ b/node_modules/lodash/fp/pullAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAll', require('../pullAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAllBy.js b/node_modules/lodash/fp/pullAllBy.js new file mode 100755 index 00000000..876bc3bf --- /dev/null +++ b/node_modules/lodash/fp/pullAllBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllBy', require('../pullAllBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAllWith.js b/node_modules/lodash/fp/pullAllWith.js new file mode 100755 index 00000000..f71ba4d7 --- /dev/null +++ b/node_modules/lodash/fp/pullAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllWith', require('../pullAllWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAt.js b/node_modules/lodash/fp/pullAt.js new file mode 100755 index 00000000..e8b3bb61 --- /dev/null +++ b/node_modules/lodash/fp/pullAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAt', require('../pullAt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/random.js b/node_modules/lodash/fp/random.js new file mode 100755 index 00000000..99d852e4 --- /dev/null +++ b/node_modules/lodash/fp/random.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('random', require('../random')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/range.js b/node_modules/lodash/fp/range.js new file mode 100755 index 00000000..a6bb5911 --- /dev/null +++ b/node_modules/lodash/fp/range.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('range', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeRight.js b/node_modules/lodash/fp/rangeRight.js new file mode 100755 index 00000000..fdb712f9 --- /dev/null +++ b/node_modules/lodash/fp/rangeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeStep.js b/node_modules/lodash/fp/rangeStep.js new file mode 100755 index 00000000..d72dfc20 --- /dev/null +++ b/node_modules/lodash/fp/rangeStep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStep', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeStepRight.js b/node_modules/lodash/fp/rangeStepRight.js new file mode 100755 index 00000000..8b2a67bc --- /dev/null +++ b/node_modules/lodash/fp/rangeStepRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStepRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rearg.js b/node_modules/lodash/fp/rearg.js new file mode 100755 index 00000000..678e02a3 --- /dev/null +++ b/node_modules/lodash/fp/rearg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rearg', require('../rearg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reduce.js b/node_modules/lodash/fp/reduce.js new file mode 100755 index 00000000..4cef0a00 --- /dev/null +++ b/node_modules/lodash/fp/reduce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduce', require('../reduce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reduceRight.js b/node_modules/lodash/fp/reduceRight.js new file mode 100755 index 00000000..caf5bb51 --- /dev/null +++ b/node_modules/lodash/fp/reduceRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduceRight', require('../reduceRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reject.js b/node_modules/lodash/fp/reject.js new file mode 100755 index 00000000..c1632738 --- /dev/null +++ b/node_modules/lodash/fp/reject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reject', require('../reject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/remove.js b/node_modules/lodash/fp/remove.js new file mode 100755 index 00000000..e9d13273 --- /dev/null +++ b/node_modules/lodash/fp/remove.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('remove', require('../remove')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/repeat.js b/node_modules/lodash/fp/repeat.js new file mode 100755 index 00000000..08470f24 --- /dev/null +++ b/node_modules/lodash/fp/repeat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('repeat', require('../repeat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/replace.js b/node_modules/lodash/fp/replace.js new file mode 100755 index 00000000..2227db62 --- /dev/null +++ b/node_modules/lodash/fp/replace.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('replace', require('../replace')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rest.js b/node_modules/lodash/fp/rest.js new file mode 100755 index 00000000..c1f3d64b --- /dev/null +++ b/node_modules/lodash/fp/rest.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rest', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/restFrom.js b/node_modules/lodash/fp/restFrom.js new file mode 100755 index 00000000..714e42b5 --- /dev/null +++ b/node_modules/lodash/fp/restFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('restFrom', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/result.js b/node_modules/lodash/fp/result.js new file mode 100755 index 00000000..f86ce071 --- /dev/null +++ b/node_modules/lodash/fp/result.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('result', require('../result')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reverse.js b/node_modules/lodash/fp/reverse.js new file mode 100755 index 00000000..07c9f5e4 --- /dev/null +++ b/node_modules/lodash/fp/reverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reverse', require('../reverse')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/round.js b/node_modules/lodash/fp/round.js new file mode 100755 index 00000000..4c0e5c82 --- /dev/null +++ b/node_modules/lodash/fp/round.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('round', require('../round')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sample.js b/node_modules/lodash/fp/sample.js new file mode 100755 index 00000000..6bea1254 --- /dev/null +++ b/node_modules/lodash/fp/sample.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sample', require('../sample'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sampleSize.js b/node_modules/lodash/fp/sampleSize.js new file mode 100755 index 00000000..359ed6fc --- /dev/null +++ b/node_modules/lodash/fp/sampleSize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sampleSize', require('../sampleSize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/seq.js b/node_modules/lodash/fp/seq.js new file mode 100755 index 00000000..d8f42b0a --- /dev/null +++ b/node_modules/lodash/fp/seq.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../seq')); diff --git a/node_modules/lodash/fp/set.js b/node_modules/lodash/fp/set.js new file mode 100755 index 00000000..0b56a56c --- /dev/null +++ b/node_modules/lodash/fp/set.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('set', require('../set')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/setWith.js b/node_modules/lodash/fp/setWith.js new file mode 100755 index 00000000..0b584952 --- /dev/null +++ b/node_modules/lodash/fp/setWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('setWith', require('../setWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/shuffle.js b/node_modules/lodash/fp/shuffle.js new file mode 100755 index 00000000..aa3a1ca5 --- /dev/null +++ b/node_modules/lodash/fp/shuffle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('shuffle', require('../shuffle'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/size.js b/node_modules/lodash/fp/size.js new file mode 100755 index 00000000..7490136e --- /dev/null +++ b/node_modules/lodash/fp/size.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('size', require('../size'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/slice.js b/node_modules/lodash/fp/slice.js new file mode 100755 index 00000000..15945d32 --- /dev/null +++ b/node_modules/lodash/fp/slice.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('slice', require('../slice')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/snakeCase.js b/node_modules/lodash/fp/snakeCase.js new file mode 100755 index 00000000..a0ff7808 --- /dev/null +++ b/node_modules/lodash/fp/snakeCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/some.js b/node_modules/lodash/fp/some.js new file mode 100755 index 00000000..a4fa2d00 --- /dev/null +++ b/node_modules/lodash/fp/some.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('some', require('../some')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortBy.js b/node_modules/lodash/fp/sortBy.js new file mode 100755 index 00000000..e0790ad5 --- /dev/null +++ b/node_modules/lodash/fp/sortBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortBy', require('../sortBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndex.js b/node_modules/lodash/fp/sortedIndex.js new file mode 100755 index 00000000..364a0543 --- /dev/null +++ b/node_modules/lodash/fp/sortedIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndex', require('../sortedIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndexBy.js b/node_modules/lodash/fp/sortedIndexBy.js new file mode 100755 index 00000000..9593dbd1 --- /dev/null +++ b/node_modules/lodash/fp/sortedIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexBy', require('../sortedIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndexOf.js b/node_modules/lodash/fp/sortedIndexOf.js new file mode 100755 index 00000000..c9084cab --- /dev/null +++ b/node_modules/lodash/fp/sortedIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexOf', require('../sortedIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndex.js b/node_modules/lodash/fp/sortedLastIndex.js new file mode 100755 index 00000000..47fe241a --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndex', require('../sortedLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndexBy.js b/node_modules/lodash/fp/sortedLastIndexBy.js new file mode 100755 index 00000000..0f9a3473 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndexOf.js b/node_modules/lodash/fp/sortedLastIndexOf.js new file mode 100755 index 00000000..0d4d9327 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedUniq.js b/node_modules/lodash/fp/sortedUniq.js new file mode 100755 index 00000000..882d2837 --- /dev/null +++ b/node_modules/lodash/fp/sortedUniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedUniqBy.js b/node_modules/lodash/fp/sortedUniqBy.js new file mode 100755 index 00000000..033db91c --- /dev/null +++ b/node_modules/lodash/fp/sortedUniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniqBy', require('../sortedUniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/split.js b/node_modules/lodash/fp/split.js new file mode 100755 index 00000000..14de1a7e --- /dev/null +++ b/node_modules/lodash/fp/split.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('split', require('../split')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/spread.js b/node_modules/lodash/fp/spread.js new file mode 100755 index 00000000..2d11b707 --- /dev/null +++ b/node_modules/lodash/fp/spread.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spread', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/spreadFrom.js b/node_modules/lodash/fp/spreadFrom.js new file mode 100755 index 00000000..0b630df1 --- /dev/null +++ b/node_modules/lodash/fp/spreadFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spreadFrom', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/startCase.js b/node_modules/lodash/fp/startCase.js new file mode 100755 index 00000000..ada98c94 --- /dev/null +++ b/node_modules/lodash/fp/startCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startCase', require('../startCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/startsWith.js b/node_modules/lodash/fp/startsWith.js new file mode 100755 index 00000000..985e2f29 --- /dev/null +++ b/node_modules/lodash/fp/startsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startsWith', require('../startsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/string.js b/node_modules/lodash/fp/string.js new file mode 100755 index 00000000..773b0370 --- /dev/null +++ b/node_modules/lodash/fp/string.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../string')); diff --git a/node_modules/lodash/fp/stubArray.js b/node_modules/lodash/fp/stubArray.js new file mode 100755 index 00000000..cd604cb4 --- /dev/null +++ b/node_modules/lodash/fp/stubArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubArray', require('../stubArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubFalse.js b/node_modules/lodash/fp/stubFalse.js new file mode 100755 index 00000000..32966645 --- /dev/null +++ b/node_modules/lodash/fp/stubFalse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubFalse', require('../stubFalse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubObject.js b/node_modules/lodash/fp/stubObject.js new file mode 100755 index 00000000..c6c8ec47 --- /dev/null +++ b/node_modules/lodash/fp/stubObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubObject', require('../stubObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubString.js b/node_modules/lodash/fp/stubString.js new file mode 100755 index 00000000..701051e8 --- /dev/null +++ b/node_modules/lodash/fp/stubString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubString', require('../stubString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubTrue.js b/node_modules/lodash/fp/stubTrue.js new file mode 100755 index 00000000..9249082c --- /dev/null +++ b/node_modules/lodash/fp/stubTrue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/subtract.js b/node_modules/lodash/fp/subtract.js new file mode 100755 index 00000000..d32b16d4 --- /dev/null +++ b/node_modules/lodash/fp/subtract.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('subtract', require('../subtract')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sum.js b/node_modules/lodash/fp/sum.js new file mode 100755 index 00000000..5cce12b3 --- /dev/null +++ b/node_modules/lodash/fp/sum.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sum', require('../sum'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sumBy.js b/node_modules/lodash/fp/sumBy.js new file mode 100755 index 00000000..c8826565 --- /dev/null +++ b/node_modules/lodash/fp/sumBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sumBy', require('../sumBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/symmetricDifference.js b/node_modules/lodash/fp/symmetricDifference.js new file mode 100755 index 00000000..78c16add --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifference.js @@ -0,0 +1 @@ +module.exports = require('./xor'); diff --git a/node_modules/lodash/fp/symmetricDifferenceBy.js b/node_modules/lodash/fp/symmetricDifferenceBy.js new file mode 100755 index 00000000..298fc7ff --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifferenceBy.js @@ -0,0 +1 @@ +module.exports = require('./xorBy'); diff --git a/node_modules/lodash/fp/symmetricDifferenceWith.js b/node_modules/lodash/fp/symmetricDifferenceWith.js new file mode 100755 index 00000000..70bc6faf --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifferenceWith.js @@ -0,0 +1 @@ +module.exports = require('./xorWith'); diff --git a/node_modules/lodash/fp/tail.js b/node_modules/lodash/fp/tail.js new file mode 100755 index 00000000..f122f0ac --- /dev/null +++ b/node_modules/lodash/fp/tail.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tail', require('../tail'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/take.js b/node_modules/lodash/fp/take.js new file mode 100755 index 00000000..9af98a7b --- /dev/null +++ b/node_modules/lodash/fp/take.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('take', require('../take')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeLast.js b/node_modules/lodash/fp/takeLast.js new file mode 100755 index 00000000..e98c84a1 --- /dev/null +++ b/node_modules/lodash/fp/takeLast.js @@ -0,0 +1 @@ +module.exports = require('./takeRight'); diff --git a/node_modules/lodash/fp/takeLastWhile.js b/node_modules/lodash/fp/takeLastWhile.js new file mode 100755 index 00000000..5367968a --- /dev/null +++ b/node_modules/lodash/fp/takeLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./takeRightWhile'); diff --git a/node_modules/lodash/fp/takeRight.js b/node_modules/lodash/fp/takeRight.js new file mode 100755 index 00000000..b82950a6 --- /dev/null +++ b/node_modules/lodash/fp/takeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRight', require('../takeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeRightWhile.js b/node_modules/lodash/fp/takeRightWhile.js new file mode 100755 index 00000000..8ffb0a28 --- /dev/null +++ b/node_modules/lodash/fp/takeRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRightWhile', require('../takeRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeWhile.js b/node_modules/lodash/fp/takeWhile.js new file mode 100755 index 00000000..28136644 --- /dev/null +++ b/node_modules/lodash/fp/takeWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeWhile', require('../takeWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/tap.js b/node_modules/lodash/fp/tap.js new file mode 100755 index 00000000..d33ad6ec --- /dev/null +++ b/node_modules/lodash/fp/tap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tap', require('../tap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/template.js b/node_modules/lodash/fp/template.js new file mode 100755 index 00000000..74857e1c --- /dev/null +++ b/node_modules/lodash/fp/template.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('template', require('../template')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/templateSettings.js b/node_modules/lodash/fp/templateSettings.js new file mode 100755 index 00000000..7bcc0a82 --- /dev/null +++ b/node_modules/lodash/fp/templateSettings.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/throttle.js b/node_modules/lodash/fp/throttle.js new file mode 100755 index 00000000..77fff142 --- /dev/null +++ b/node_modules/lodash/fp/throttle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('throttle', require('../throttle')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/thru.js b/node_modules/lodash/fp/thru.js new file mode 100755 index 00000000..d42b3b1d --- /dev/null +++ b/node_modules/lodash/fp/thru.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('thru', require('../thru')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/times.js b/node_modules/lodash/fp/times.js new file mode 100755 index 00000000..0dab06da --- /dev/null +++ b/node_modules/lodash/fp/times.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('times', require('../times')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toArray.js b/node_modules/lodash/fp/toArray.js new file mode 100755 index 00000000..f0c360ac --- /dev/null +++ b/node_modules/lodash/fp/toArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toArray', require('../toArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toFinite.js b/node_modules/lodash/fp/toFinite.js new file mode 100755 index 00000000..3a47687d --- /dev/null +++ b/node_modules/lodash/fp/toFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toFinite', require('../toFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toInteger.js b/node_modules/lodash/fp/toInteger.js new file mode 100755 index 00000000..e0af6a75 --- /dev/null +++ b/node_modules/lodash/fp/toInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toInteger', require('../toInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toIterator.js b/node_modules/lodash/fp/toIterator.js new file mode 100755 index 00000000..65e6baa9 --- /dev/null +++ b/node_modules/lodash/fp/toIterator.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toIterator', require('../toIterator'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toJSON.js b/node_modules/lodash/fp/toJSON.js new file mode 100755 index 00000000..2d718d0b --- /dev/null +++ b/node_modules/lodash/fp/toJSON.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toJSON', require('../toJSON'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toLength.js b/node_modules/lodash/fp/toLength.js new file mode 100755 index 00000000..b97cdd93 --- /dev/null +++ b/node_modules/lodash/fp/toLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLength', require('../toLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toLower.js b/node_modules/lodash/fp/toLower.js new file mode 100755 index 00000000..616ef36a --- /dev/null +++ b/node_modules/lodash/fp/toLower.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLower', require('../toLower'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toNumber.js b/node_modules/lodash/fp/toNumber.js new file mode 100755 index 00000000..d0c6f4d3 --- /dev/null +++ b/node_modules/lodash/fp/toNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toNumber', require('../toNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPairs.js b/node_modules/lodash/fp/toPairs.js new file mode 100755 index 00000000..af783786 --- /dev/null +++ b/node_modules/lodash/fp/toPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairs', require('../toPairs'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPairsIn.js b/node_modules/lodash/fp/toPairsIn.js new file mode 100755 index 00000000..66504abf --- /dev/null +++ b/node_modules/lodash/fp/toPairsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPath.js b/node_modules/lodash/fp/toPath.js new file mode 100755 index 00000000..b4d5e50f --- /dev/null +++ b/node_modules/lodash/fp/toPath.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPath', require('../toPath'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPlainObject.js b/node_modules/lodash/fp/toPlainObject.js new file mode 100755 index 00000000..278bb863 --- /dev/null +++ b/node_modules/lodash/fp/toPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toSafeInteger.js b/node_modules/lodash/fp/toSafeInteger.js new file mode 100755 index 00000000..367a26fd --- /dev/null +++ b/node_modules/lodash/fp/toSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toString.js b/node_modules/lodash/fp/toString.js new file mode 100755 index 00000000..cec4f8e2 --- /dev/null +++ b/node_modules/lodash/fp/toString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toString', require('../toString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toUpper.js b/node_modules/lodash/fp/toUpper.js new file mode 100755 index 00000000..54f9a560 --- /dev/null +++ b/node_modules/lodash/fp/toUpper.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toUpper', require('../toUpper'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/transform.js b/node_modules/lodash/fp/transform.js new file mode 100755 index 00000000..759d088f --- /dev/null +++ b/node_modules/lodash/fp/transform.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('transform', require('../transform')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trim.js b/node_modules/lodash/fp/trim.js new file mode 100755 index 00000000..e6319a74 --- /dev/null +++ b/node_modules/lodash/fp/trim.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trim', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimChars.js b/node_modules/lodash/fp/trimChars.js new file mode 100755 index 00000000..c9294de4 --- /dev/null +++ b/node_modules/lodash/fp/trimChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimChars', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimCharsEnd.js b/node_modules/lodash/fp/trimCharsEnd.js new file mode 100755 index 00000000..284bc2f8 --- /dev/null +++ b/node_modules/lodash/fp/trimCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimCharsStart.js b/node_modules/lodash/fp/trimCharsStart.js new file mode 100755 index 00000000..ff0ee65d --- /dev/null +++ b/node_modules/lodash/fp/trimCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimEnd.js b/node_modules/lodash/fp/trimEnd.js new file mode 100755 index 00000000..71908805 --- /dev/null +++ b/node_modules/lodash/fp/trimEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimStart.js b/node_modules/lodash/fp/trimStart.js new file mode 100755 index 00000000..fda902c3 --- /dev/null +++ b/node_modules/lodash/fp/trimStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/truncate.js b/node_modules/lodash/fp/truncate.js new file mode 100755 index 00000000..d265c1de --- /dev/null +++ b/node_modules/lodash/fp/truncate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('truncate', require('../truncate')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unapply.js b/node_modules/lodash/fp/unapply.js new file mode 100755 index 00000000..c5dfe779 --- /dev/null +++ b/node_modules/lodash/fp/unapply.js @@ -0,0 +1 @@ +module.exports = require('./rest'); diff --git a/node_modules/lodash/fp/unary.js b/node_modules/lodash/fp/unary.js new file mode 100755 index 00000000..286c945f --- /dev/null +++ b/node_modules/lodash/fp/unary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unary', require('../unary'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unescape.js b/node_modules/lodash/fp/unescape.js new file mode 100755 index 00000000..fddcb46e --- /dev/null +++ b/node_modules/lodash/fp/unescape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unescape', require('../unescape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/union.js b/node_modules/lodash/fp/union.js new file mode 100755 index 00000000..ef8228d7 --- /dev/null +++ b/node_modules/lodash/fp/union.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('union', require('../union')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unionBy.js b/node_modules/lodash/fp/unionBy.js new file mode 100755 index 00000000..603687a1 --- /dev/null +++ b/node_modules/lodash/fp/unionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionBy', require('../unionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unionWith.js b/node_modules/lodash/fp/unionWith.js new file mode 100755 index 00000000..65bb3a79 --- /dev/null +++ b/node_modules/lodash/fp/unionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionWith', require('../unionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniq.js b/node_modules/lodash/fp/uniq.js new file mode 100755 index 00000000..bc185249 --- /dev/null +++ b/node_modules/lodash/fp/uniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniq', require('../uniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqBy.js b/node_modules/lodash/fp/uniqBy.js new file mode 100755 index 00000000..634c6a8b --- /dev/null +++ b/node_modules/lodash/fp/uniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqBy', require('../uniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqWith.js b/node_modules/lodash/fp/uniqWith.js new file mode 100755 index 00000000..0ec601a9 --- /dev/null +++ b/node_modules/lodash/fp/uniqWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqWith', require('../uniqWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqueId.js b/node_modules/lodash/fp/uniqueId.js new file mode 100755 index 00000000..aa8fc2f7 --- /dev/null +++ b/node_modules/lodash/fp/uniqueId.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqueId', require('../uniqueId')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unnest.js b/node_modules/lodash/fp/unnest.js new file mode 100755 index 00000000..5d34060a --- /dev/null +++ b/node_modules/lodash/fp/unnest.js @@ -0,0 +1 @@ +module.exports = require('./flatten'); diff --git a/node_modules/lodash/fp/unset.js b/node_modules/lodash/fp/unset.js new file mode 100755 index 00000000..ea203a0f --- /dev/null +++ b/node_modules/lodash/fp/unset.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unset', require('../unset')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unzip.js b/node_modules/lodash/fp/unzip.js new file mode 100755 index 00000000..cc364b3c --- /dev/null +++ b/node_modules/lodash/fp/unzip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzip', require('../unzip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unzipWith.js b/node_modules/lodash/fp/unzipWith.js new file mode 100755 index 00000000..182eaa10 --- /dev/null +++ b/node_modules/lodash/fp/unzipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzipWith', require('../unzipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/update.js b/node_modules/lodash/fp/update.js new file mode 100755 index 00000000..b8ce2cc9 --- /dev/null +++ b/node_modules/lodash/fp/update.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('update', require('../update')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/updateWith.js b/node_modules/lodash/fp/updateWith.js new file mode 100755 index 00000000..d5e8282d --- /dev/null +++ b/node_modules/lodash/fp/updateWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('updateWith', require('../updateWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/upperCase.js b/node_modules/lodash/fp/upperCase.js new file mode 100755 index 00000000..c886f202 --- /dev/null +++ b/node_modules/lodash/fp/upperCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperCase', require('../upperCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/upperFirst.js b/node_modules/lodash/fp/upperFirst.js new file mode 100755 index 00000000..d8c04df5 --- /dev/null +++ b/node_modules/lodash/fp/upperFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/useWith.js b/node_modules/lodash/fp/useWith.js new file mode 100755 index 00000000..d8b3df5a --- /dev/null +++ b/node_modules/lodash/fp/useWith.js @@ -0,0 +1 @@ +module.exports = require('./overArgs'); diff --git a/node_modules/lodash/fp/util.js b/node_modules/lodash/fp/util.js new file mode 100755 index 00000000..18c00bae --- /dev/null +++ b/node_modules/lodash/fp/util.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../util')); diff --git a/node_modules/lodash/fp/value.js b/node_modules/lodash/fp/value.js new file mode 100755 index 00000000..555eec7a --- /dev/null +++ b/node_modules/lodash/fp/value.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('value', require('../value'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/valueOf.js b/node_modules/lodash/fp/valueOf.js new file mode 100755 index 00000000..f968807d --- /dev/null +++ b/node_modules/lodash/fp/valueOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valueOf', require('../valueOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/values.js b/node_modules/lodash/fp/values.js new file mode 100755 index 00000000..2dfc5613 --- /dev/null +++ b/node_modules/lodash/fp/values.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('values', require('../values'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/valuesIn.js b/node_modules/lodash/fp/valuesIn.js new file mode 100755 index 00000000..a1b2bb87 --- /dev/null +++ b/node_modules/lodash/fp/valuesIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/where.js b/node_modules/lodash/fp/where.js new file mode 100755 index 00000000..3247f64a --- /dev/null +++ b/node_modules/lodash/fp/where.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/node_modules/lodash/fp/whereEq.js b/node_modules/lodash/fp/whereEq.js new file mode 100755 index 00000000..29d1e1e4 --- /dev/null +++ b/node_modules/lodash/fp/whereEq.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/node_modules/lodash/fp/without.js b/node_modules/lodash/fp/without.js new file mode 100755 index 00000000..bad9e125 --- /dev/null +++ b/node_modules/lodash/fp/without.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('without', require('../without')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/words.js b/node_modules/lodash/fp/words.js new file mode 100755 index 00000000..4a901414 --- /dev/null +++ b/node_modules/lodash/fp/words.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('words', require('../words')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrap.js b/node_modules/lodash/fp/wrap.js new file mode 100755 index 00000000..e93bd8a1 --- /dev/null +++ b/node_modules/lodash/fp/wrap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrap', require('../wrap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperAt.js b/node_modules/lodash/fp/wrapperAt.js new file mode 100755 index 00000000..8f0a310f --- /dev/null +++ b/node_modules/lodash/fp/wrapperAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperChain.js b/node_modules/lodash/fp/wrapperChain.js new file mode 100755 index 00000000..2a48ea2b --- /dev/null +++ b/node_modules/lodash/fp/wrapperChain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperLodash.js b/node_modules/lodash/fp/wrapperLodash.js new file mode 100755 index 00000000..a7162d08 --- /dev/null +++ b/node_modules/lodash/fp/wrapperLodash.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperReverse.js b/node_modules/lodash/fp/wrapperReverse.js new file mode 100755 index 00000000..e1481aab --- /dev/null +++ b/node_modules/lodash/fp/wrapperReverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperValue.js b/node_modules/lodash/fp/wrapperValue.js new file mode 100755 index 00000000..8eb9112f --- /dev/null +++ b/node_modules/lodash/fp/wrapperValue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xor.js b/node_modules/lodash/fp/xor.js new file mode 100755 index 00000000..29e28194 --- /dev/null +++ b/node_modules/lodash/fp/xor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xor', require('../xor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xorBy.js b/node_modules/lodash/fp/xorBy.js new file mode 100755 index 00000000..b355686d --- /dev/null +++ b/node_modules/lodash/fp/xorBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorBy', require('../xorBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xorWith.js b/node_modules/lodash/fp/xorWith.js new file mode 100755 index 00000000..8e05739a --- /dev/null +++ b/node_modules/lodash/fp/xorWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorWith', require('../xorWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zip.js b/node_modules/lodash/fp/zip.js new file mode 100755 index 00000000..69e147a4 --- /dev/null +++ b/node_modules/lodash/fp/zip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zip', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipAll.js b/node_modules/lodash/fp/zipAll.js new file mode 100755 index 00000000..efa8ccbf --- /dev/null +++ b/node_modules/lodash/fp/zipAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipAll', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipObj.js b/node_modules/lodash/fp/zipObj.js new file mode 100755 index 00000000..f4a34531 --- /dev/null +++ b/node_modules/lodash/fp/zipObj.js @@ -0,0 +1 @@ +module.exports = require('./zipObject'); diff --git a/node_modules/lodash/fp/zipObject.js b/node_modules/lodash/fp/zipObject.js new file mode 100755 index 00000000..462dbb68 --- /dev/null +++ b/node_modules/lodash/fp/zipObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObject', require('../zipObject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipObjectDeep.js b/node_modules/lodash/fp/zipObjectDeep.js new file mode 100755 index 00000000..53a5d338 --- /dev/null +++ b/node_modules/lodash/fp/zipObjectDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObjectDeep', require('../zipObjectDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipWith.js b/node_modules/lodash/fp/zipWith.js new file mode 100755 index 00000000..c5cf9e21 --- /dev/null +++ b/node_modules/lodash/fp/zipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipWith', require('../zipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fromPairs.js b/node_modules/lodash/fromPairs.js new file mode 100755 index 00000000..ee7940d2 --- /dev/null +++ b/node_modules/lodash/fromPairs.js @@ -0,0 +1,28 @@ +/** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ +function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; +} + +module.exports = fromPairs; diff --git a/node_modules/lodash/function.js b/node_modules/lodash/function.js new file mode 100755 index 00000000..b0fc6d93 --- /dev/null +++ b/node_modules/lodash/function.js @@ -0,0 +1,25 @@ +module.exports = { + 'after': require('./after'), + 'ary': require('./ary'), + 'before': require('./before'), + 'bind': require('./bind'), + 'bindKey': require('./bindKey'), + 'curry': require('./curry'), + 'curryRight': require('./curryRight'), + 'debounce': require('./debounce'), + 'defer': require('./defer'), + 'delay': require('./delay'), + 'flip': require('./flip'), + 'memoize': require('./memoize'), + 'negate': require('./negate'), + 'once': require('./once'), + 'overArgs': require('./overArgs'), + 'partial': require('./partial'), + 'partialRight': require('./partialRight'), + 'rearg': require('./rearg'), + 'rest': require('./rest'), + 'spread': require('./spread'), + 'throttle': require('./throttle'), + 'unary': require('./unary'), + 'wrap': require('./wrap') +}; diff --git a/node_modules/lodash/functions.js b/node_modules/lodash/functions.js new file mode 100755 index 00000000..9722928f --- /dev/null +++ b/node_modules/lodash/functions.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keys = require('./keys'); + +/** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ +function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); +} + +module.exports = functions; diff --git a/node_modules/lodash/functionsIn.js b/node_modules/lodash/functionsIn.js new file mode 100755 index 00000000..f00345d0 --- /dev/null +++ b/node_modules/lodash/functionsIn.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keysIn = require('./keysIn'); + +/** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ +function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); +} + +module.exports = functionsIn; diff --git a/node_modules/lodash/get.js b/node_modules/lodash/get.js new file mode 100755 index 00000000..8805ff92 --- /dev/null +++ b/node_modules/lodash/get.js @@ -0,0 +1,33 @@ +var baseGet = require('./_baseGet'); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; diff --git a/node_modules/lodash/groupBy.js b/node_modules/lodash/groupBy.js new file mode 100755 index 00000000..babf4f6b --- /dev/null +++ b/node_modules/lodash/groupBy.js @@ -0,0 +1,41 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ +var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } +}); + +module.exports = groupBy; diff --git a/node_modules/lodash/gt.js b/node_modules/lodash/gt.js new file mode 100755 index 00000000..3a662828 --- /dev/null +++ b/node_modules/lodash/gt.js @@ -0,0 +1,29 @@ +var baseGt = require('./_baseGt'), + createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ +var gt = createRelationalOperation(baseGt); + +module.exports = gt; diff --git a/node_modules/lodash/gte.js b/node_modules/lodash/gte.js new file mode 100755 index 00000000..4180a687 --- /dev/null +++ b/node_modules/lodash/gte.js @@ -0,0 +1,30 @@ +var createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ +var gte = createRelationalOperation(function(value, other) { + return value >= other; +}); + +module.exports = gte; diff --git a/node_modules/lodash/has.js b/node_modules/lodash/has.js new file mode 100755 index 00000000..34df55e8 --- /dev/null +++ b/node_modules/lodash/has.js @@ -0,0 +1,35 @@ +var baseHas = require('./_baseHas'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ +function has(object, path) { + return object != null && hasPath(object, path, baseHas); +} + +module.exports = has; diff --git a/node_modules/lodash/hasIn.js b/node_modules/lodash/hasIn.js new file mode 100755 index 00000000..06a36865 --- /dev/null +++ b/node_modules/lodash/hasIn.js @@ -0,0 +1,34 @@ +var baseHasIn = require('./_baseHasIn'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; diff --git a/node_modules/lodash/head.js b/node_modules/lodash/head.js new file mode 100755 index 00000000..dee9d1f1 --- /dev/null +++ b/node_modules/lodash/head.js @@ -0,0 +1,23 @@ +/** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ +function head(array) { + return (array && array.length) ? array[0] : undefined; +} + +module.exports = head; diff --git a/node_modules/lodash/identity.js b/node_modules/lodash/identity.js new file mode 100755 index 00000000..2d5d963c --- /dev/null +++ b/node_modules/lodash/identity.js @@ -0,0 +1,21 @@ +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; diff --git a/node_modules/lodash/inRange.js b/node_modules/lodash/inRange.js new file mode 100755 index 00000000..f20728d9 --- /dev/null +++ b/node_modules/lodash/inRange.js @@ -0,0 +1,55 @@ +var baseInRange = require('./_baseInRange'), + toFinite = require('./toFinite'), + toNumber = require('./toNumber'); + +/** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ +function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); +} + +module.exports = inRange; diff --git a/node_modules/lodash/includes.js b/node_modules/lodash/includes.js new file mode 100755 index 00000000..ae0deedc --- /dev/null +++ b/node_modules/lodash/includes.js @@ -0,0 +1,53 @@ +var baseIndexOf = require('./_baseIndexOf'), + isArrayLike = require('./isArrayLike'), + isString = require('./isString'), + toInteger = require('./toInteger'), + values = require('./values'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; diff --git a/node_modules/lodash/index.js b/node_modules/lodash/index.js new file mode 100755 index 00000000..5d063e21 --- /dev/null +++ b/node_modules/lodash/index.js @@ -0,0 +1 @@ +module.exports = require('./lodash'); \ No newline at end of file diff --git a/node_modules/lodash/indexOf.js b/node_modules/lodash/indexOf.js new file mode 100755 index 00000000..3c644af2 --- /dev/null +++ b/node_modules/lodash/indexOf.js @@ -0,0 +1,42 @@ +var baseIndexOf = require('./_baseIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ +function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); +} + +module.exports = indexOf; diff --git a/node_modules/lodash/initial.js b/node_modules/lodash/initial.js new file mode 100755 index 00000000..f47fc509 --- /dev/null +++ b/node_modules/lodash/initial.js @@ -0,0 +1,22 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; +} + +module.exports = initial; diff --git a/node_modules/lodash/intersection.js b/node_modules/lodash/intersection.js new file mode 100755 index 00000000..a94c1351 --- /dev/null +++ b/node_modules/lodash/intersection.js @@ -0,0 +1,30 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; diff --git a/node_modules/lodash/intersectionBy.js b/node_modules/lodash/intersectionBy.js new file mode 100755 index 00000000..31461aae --- /dev/null +++ b/node_modules/lodash/intersectionBy.js @@ -0,0 +1,45 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ +var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = intersectionBy; diff --git a/node_modules/lodash/intersectionWith.js b/node_modules/lodash/intersectionWith.js new file mode 100755 index 00000000..63cabfaa --- /dev/null +++ b/node_modules/lodash/intersectionWith.js @@ -0,0 +1,41 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ +var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; +}); + +module.exports = intersectionWith; diff --git a/node_modules/lodash/invert.js b/node_modules/lodash/invert.js new file mode 100755 index 00000000..21d10aba --- /dev/null +++ b/node_modules/lodash/invert.js @@ -0,0 +1,27 @@ +var constant = require('./constant'), + createInverter = require('./_createInverter'), + identity = require('./identity'); + +/** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ +var invert = createInverter(function(result, value, key) { + result[value] = key; +}, constant(identity)); + +module.exports = invert; diff --git a/node_modules/lodash/invertBy.js b/node_modules/lodash/invertBy.js new file mode 100755 index 00000000..e5ba0f70 --- /dev/null +++ b/node_modules/lodash/invertBy.js @@ -0,0 +1,44 @@ +var baseIteratee = require('./_baseIteratee'), + createInverter = require('./_createInverter'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ +var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } +}, baseIteratee); + +module.exports = invertBy; diff --git a/node_modules/lodash/invoke.js b/node_modules/lodash/invoke.js new file mode 100755 index 00000000..97d51eb5 --- /dev/null +++ b/node_modules/lodash/invoke.js @@ -0,0 +1,24 @@ +var baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'); + +/** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ +var invoke = baseRest(baseInvoke); + +module.exports = invoke; diff --git a/node_modules/lodash/invokeMap.js b/node_modules/lodash/invokeMap.js new file mode 100755 index 00000000..8da5126c --- /dev/null +++ b/node_modules/lodash/invokeMap.js @@ -0,0 +1,41 @@ +var apply = require('./_apply'), + baseEach = require('./_baseEach'), + baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'), + isArrayLike = require('./isArrayLike'); + +/** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ +var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; +}); + +module.exports = invokeMap; diff --git a/node_modules/lodash/isArguments.js b/node_modules/lodash/isArguments.js new file mode 100755 index 00000000..8b9ed66c --- /dev/null +++ b/node_modules/lodash/isArguments.js @@ -0,0 +1,36 @@ +var baseIsArguments = require('./_baseIsArguments'), + isObjectLike = require('./isObjectLike'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; diff --git a/node_modules/lodash/isArray.js b/node_modules/lodash/isArray.js new file mode 100755 index 00000000..88ab55fd --- /dev/null +++ b/node_modules/lodash/isArray.js @@ -0,0 +1,26 @@ +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; diff --git a/node_modules/lodash/isArrayBuffer.js b/node_modules/lodash/isArrayBuffer.js new file mode 100755 index 00000000..12904a64 --- /dev/null +++ b/node_modules/lodash/isArrayBuffer.js @@ -0,0 +1,27 @@ +var baseIsArrayBuffer = require('./_baseIsArrayBuffer'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer; + +/** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ +var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + +module.exports = isArrayBuffer; diff --git a/node_modules/lodash/isArrayLike.js b/node_modules/lodash/isArrayLike.js new file mode 100755 index 00000000..0f966805 --- /dev/null +++ b/node_modules/lodash/isArrayLike.js @@ -0,0 +1,33 @@ +var isFunction = require('./isFunction'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; diff --git a/node_modules/lodash/isArrayLikeObject.js b/node_modules/lodash/isArrayLikeObject.js new file mode 100755 index 00000000..6c4812a8 --- /dev/null +++ b/node_modules/lodash/isArrayLikeObject.js @@ -0,0 +1,33 @@ +var isArrayLike = require('./isArrayLike'), + isObjectLike = require('./isObjectLike'); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; diff --git a/node_modules/lodash/isBoolean.js b/node_modules/lodash/isBoolean.js new file mode 100755 index 00000000..a43ed4b8 --- /dev/null +++ b/node_modules/lodash/isBoolean.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]'; + +/** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ +function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); +} + +module.exports = isBoolean; diff --git a/node_modules/lodash/isBuffer.js b/node_modules/lodash/isBuffer.js new file mode 100755 index 00000000..c103cc74 --- /dev/null +++ b/node_modules/lodash/isBuffer.js @@ -0,0 +1,38 @@ +var root = require('./_root'), + stubFalse = require('./stubFalse'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; diff --git a/node_modules/lodash/isDate.js b/node_modules/lodash/isDate.js new file mode 100755 index 00000000..7f0209fc --- /dev/null +++ b/node_modules/lodash/isDate.js @@ -0,0 +1,27 @@ +var baseIsDate = require('./_baseIsDate'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsDate = nodeUtil && nodeUtil.isDate; + +/** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ +var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + +module.exports = isDate; diff --git a/node_modules/lodash/isElement.js b/node_modules/lodash/isElement.js new file mode 100755 index 00000000..76ae29c3 --- /dev/null +++ b/node_modules/lodash/isElement.js @@ -0,0 +1,25 @@ +var isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ +function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); +} + +module.exports = isElement; diff --git a/node_modules/lodash/isEmpty.js b/node_modules/lodash/isEmpty.js new file mode 100755 index 00000000..3597294a --- /dev/null +++ b/node_modules/lodash/isEmpty.js @@ -0,0 +1,77 @@ +var baseKeys = require('./_baseKeys'), + getTag = require('./_getTag'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLike = require('./isArrayLike'), + isBuffer = require('./isBuffer'), + isPrototype = require('./_isPrototype'), + isTypedArray = require('./isTypedArray'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; diff --git a/node_modules/lodash/isEqual.js b/node_modules/lodash/isEqual.js new file mode 100755 index 00000000..5e23e76c --- /dev/null +++ b/node_modules/lodash/isEqual.js @@ -0,0 +1,35 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; diff --git a/node_modules/lodash/isEqualWith.js b/node_modules/lodash/isEqualWith.js new file mode 100755 index 00000000..21bdc7ff --- /dev/null +++ b/node_modules/lodash/isEqualWith.js @@ -0,0 +1,41 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ +function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; +} + +module.exports = isEqualWith; diff --git a/node_modules/lodash/isError.js b/node_modules/lodash/isError.js new file mode 100755 index 00000000..b4f41e00 --- /dev/null +++ b/node_modules/lodash/isError.js @@ -0,0 +1,36 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** `Object#toString` result references. */ +var domExcTag = '[object DOMException]', + errorTag = '[object Error]'; + +/** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ +function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); +} + +module.exports = isError; diff --git a/node_modules/lodash/isFinite.js b/node_modules/lodash/isFinite.js new file mode 100755 index 00000000..601842bc --- /dev/null +++ b/node_modules/lodash/isFinite.js @@ -0,0 +1,36 @@ +var root = require('./_root'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite; + +/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ +function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); +} + +module.exports = isFinite; diff --git a/node_modules/lodash/isFunction.js b/node_modules/lodash/isFunction.js new file mode 100755 index 00000000..907a8cd8 --- /dev/null +++ b/node_modules/lodash/isFunction.js @@ -0,0 +1,37 @@ +var baseGetTag = require('./_baseGetTag'), + isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; diff --git a/node_modules/lodash/isInteger.js b/node_modules/lodash/isInteger.js new file mode 100755 index 00000000..66aa87d5 --- /dev/null +++ b/node_modules/lodash/isInteger.js @@ -0,0 +1,33 @@ +var toInteger = require('./toInteger'); + +/** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ +function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); +} + +module.exports = isInteger; diff --git a/node_modules/lodash/isLength.js b/node_modules/lodash/isLength.js new file mode 100755 index 00000000..3a95caa9 --- /dev/null +++ b/node_modules/lodash/isLength.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; diff --git a/node_modules/lodash/isMap.js b/node_modules/lodash/isMap.js new file mode 100755 index 00000000..44f8517e --- /dev/null +++ b/node_modules/lodash/isMap.js @@ -0,0 +1,27 @@ +var baseIsMap = require('./_baseIsMap'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; diff --git a/node_modules/lodash/isMatch.js b/node_modules/lodash/isMatch.js new file mode 100755 index 00000000..9773a18c --- /dev/null +++ b/node_modules/lodash/isMatch.js @@ -0,0 +1,36 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ +function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); +} + +module.exports = isMatch; diff --git a/node_modules/lodash/isMatchWith.js b/node_modules/lodash/isMatchWith.js new file mode 100755 index 00000000..187b6a61 --- /dev/null +++ b/node_modules/lodash/isMatchWith.js @@ -0,0 +1,41 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ +function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); +} + +module.exports = isMatchWith; diff --git a/node_modules/lodash/isNaN.js b/node_modules/lodash/isNaN.js new file mode 100755 index 00000000..7d0d783b --- /dev/null +++ b/node_modules/lodash/isNaN.js @@ -0,0 +1,38 @@ +var isNumber = require('./isNumber'); + +/** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ +function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; +} + +module.exports = isNaN; diff --git a/node_modules/lodash/isNative.js b/node_modules/lodash/isNative.js new file mode 100755 index 00000000..f0cb8d58 --- /dev/null +++ b/node_modules/lodash/isNative.js @@ -0,0 +1,40 @@ +var baseIsNative = require('./_baseIsNative'), + isMaskable = require('./_isMaskable'); + +/** Error message constants. */ +var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.'; + +/** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); +} + +module.exports = isNative; diff --git a/node_modules/lodash/isNil.js b/node_modules/lodash/isNil.js new file mode 100755 index 00000000..79f05052 --- /dev/null +++ b/node_modules/lodash/isNil.js @@ -0,0 +1,25 @@ +/** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ +function isNil(value) { + return value == null; +} + +module.exports = isNil; diff --git a/node_modules/lodash/isNull.js b/node_modules/lodash/isNull.js new file mode 100755 index 00000000..c0a374d7 --- /dev/null +++ b/node_modules/lodash/isNull.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; diff --git a/node_modules/lodash/isNumber.js b/node_modules/lodash/isNumber.js new file mode 100755 index 00000000..cd34ee46 --- /dev/null +++ b/node_modules/lodash/isNumber.js @@ -0,0 +1,38 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; + +/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); +} + +module.exports = isNumber; diff --git a/node_modules/lodash/isObject.js b/node_modules/lodash/isObject.js new file mode 100755 index 00000000..1dc89391 --- /dev/null +++ b/node_modules/lodash/isObject.js @@ -0,0 +1,31 @@ +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; diff --git a/node_modules/lodash/isObjectLike.js b/node_modules/lodash/isObjectLike.js new file mode 100755 index 00000000..301716b5 --- /dev/null +++ b/node_modules/lodash/isObjectLike.js @@ -0,0 +1,29 @@ +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; diff --git a/node_modules/lodash/isPlainObject.js b/node_modules/lodash/isPlainObject.js new file mode 100755 index 00000000..23873731 --- /dev/null +++ b/node_modules/lodash/isPlainObject.js @@ -0,0 +1,62 @@ +var baseGetTag = require('./_baseGetTag'), + getPrototype = require('./_getPrototype'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; diff --git a/node_modules/lodash/isRegExp.js b/node_modules/lodash/isRegExp.js new file mode 100755 index 00000000..76c9b6e9 --- /dev/null +++ b/node_modules/lodash/isRegExp.js @@ -0,0 +1,27 @@ +var baseIsRegExp = require('./_baseIsRegExp'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; + +/** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ +var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + +module.exports = isRegExp; diff --git a/node_modules/lodash/isSafeInteger.js b/node_modules/lodash/isSafeInteger.js new file mode 100755 index 00000000..2a48526e --- /dev/null +++ b/node_modules/lodash/isSafeInteger.js @@ -0,0 +1,37 @@ +var isInteger = require('./isInteger'); + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ +function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; +} + +module.exports = isSafeInteger; diff --git a/node_modules/lodash/isSet.js b/node_modules/lodash/isSet.js new file mode 100755 index 00000000..ab88bdf8 --- /dev/null +++ b/node_modules/lodash/isSet.js @@ -0,0 +1,27 @@ +var baseIsSet = require('./_baseIsSet'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; diff --git a/node_modules/lodash/isString.js b/node_modules/lodash/isString.js new file mode 100755 index 00000000..627eb9c3 --- /dev/null +++ b/node_modules/lodash/isString.js @@ -0,0 +1,30 @@ +var baseGetTag = require('./_baseGetTag'), + isArray = require('./isArray'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; diff --git a/node_modules/lodash/isSymbol.js b/node_modules/lodash/isSymbol.js new file mode 100755 index 00000000..dfb60b97 --- /dev/null +++ b/node_modules/lodash/isSymbol.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; diff --git a/node_modules/lodash/isTypedArray.js b/node_modules/lodash/isTypedArray.js new file mode 100755 index 00000000..da3f8dd1 --- /dev/null +++ b/node_modules/lodash/isTypedArray.js @@ -0,0 +1,27 @@ +var baseIsTypedArray = require('./_baseIsTypedArray'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; diff --git a/node_modules/lodash/isUndefined.js b/node_modules/lodash/isUndefined.js new file mode 100755 index 00000000..377d121a --- /dev/null +++ b/node_modules/lodash/isUndefined.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; diff --git a/node_modules/lodash/isWeakMap.js b/node_modules/lodash/isWeakMap.js new file mode 100755 index 00000000..8d36f663 --- /dev/null +++ b/node_modules/lodash/isWeakMap.js @@ -0,0 +1,28 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakMapTag = '[object WeakMap]'; + +/** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ +function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; +} + +module.exports = isWeakMap; diff --git a/node_modules/lodash/isWeakSet.js b/node_modules/lodash/isWeakSet.js new file mode 100755 index 00000000..e628b261 --- /dev/null +++ b/node_modules/lodash/isWeakSet.js @@ -0,0 +1,28 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakSetTag = '[object WeakSet]'; + +/** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ +function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; +} + +module.exports = isWeakSet; diff --git a/node_modules/lodash/iteratee.js b/node_modules/lodash/iteratee.js new file mode 100755 index 00000000..61b73a8c --- /dev/null +++ b/node_modules/lodash/iteratee.js @@ -0,0 +1,53 @@ +var baseClone = require('./_baseClone'), + baseIteratee = require('./_baseIteratee'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ +function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); +} + +module.exports = iteratee; diff --git a/node_modules/lodash/join.js b/node_modules/lodash/join.js new file mode 100755 index 00000000..45de079f --- /dev/null +++ b/node_modules/lodash/join.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeJoin = arrayProto.join; + +/** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ +function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); +} + +module.exports = join; diff --git a/node_modules/lodash/kebabCase.js b/node_modules/lodash/kebabCase.js new file mode 100755 index 00000000..8a52be64 --- /dev/null +++ b/node_modules/lodash/kebabCase.js @@ -0,0 +1,28 @@ +var createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ +var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); +}); + +module.exports = kebabCase; diff --git a/node_modules/lodash/keyBy.js b/node_modules/lodash/keyBy.js new file mode 100755 index 00000000..acc007a0 --- /dev/null +++ b/node_modules/lodash/keyBy.js @@ -0,0 +1,36 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ +var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); +}); + +module.exports = keyBy; diff --git a/node_modules/lodash/keys.js b/node_modules/lodash/keys.js new file mode 100755 index 00000000..d143c718 --- /dev/null +++ b/node_modules/lodash/keys.js @@ -0,0 +1,37 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeys = require('./_baseKeys'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; diff --git a/node_modules/lodash/keysIn.js b/node_modules/lodash/keysIn.js new file mode 100755 index 00000000..a62308f2 --- /dev/null +++ b/node_modules/lodash/keysIn.js @@ -0,0 +1,32 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeysIn = require('./_baseKeysIn'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; diff --git a/node_modules/lodash/lang.js b/node_modules/lodash/lang.js new file mode 100755 index 00000000..a3962169 --- /dev/null +++ b/node_modules/lodash/lang.js @@ -0,0 +1,58 @@ +module.exports = { + 'castArray': require('./castArray'), + 'clone': require('./clone'), + 'cloneDeep': require('./cloneDeep'), + 'cloneDeepWith': require('./cloneDeepWith'), + 'cloneWith': require('./cloneWith'), + 'conformsTo': require('./conformsTo'), + 'eq': require('./eq'), + 'gt': require('./gt'), + 'gte': require('./gte'), + 'isArguments': require('./isArguments'), + 'isArray': require('./isArray'), + 'isArrayBuffer': require('./isArrayBuffer'), + 'isArrayLike': require('./isArrayLike'), + 'isArrayLikeObject': require('./isArrayLikeObject'), + 'isBoolean': require('./isBoolean'), + 'isBuffer': require('./isBuffer'), + 'isDate': require('./isDate'), + 'isElement': require('./isElement'), + 'isEmpty': require('./isEmpty'), + 'isEqual': require('./isEqual'), + 'isEqualWith': require('./isEqualWith'), + 'isError': require('./isError'), + 'isFinite': require('./isFinite'), + 'isFunction': require('./isFunction'), + 'isInteger': require('./isInteger'), + 'isLength': require('./isLength'), + 'isMap': require('./isMap'), + 'isMatch': require('./isMatch'), + 'isMatchWith': require('./isMatchWith'), + 'isNaN': require('./isNaN'), + 'isNative': require('./isNative'), + 'isNil': require('./isNil'), + 'isNull': require('./isNull'), + 'isNumber': require('./isNumber'), + 'isObject': require('./isObject'), + 'isObjectLike': require('./isObjectLike'), + 'isPlainObject': require('./isPlainObject'), + 'isRegExp': require('./isRegExp'), + 'isSafeInteger': require('./isSafeInteger'), + 'isSet': require('./isSet'), + 'isString': require('./isString'), + 'isSymbol': require('./isSymbol'), + 'isTypedArray': require('./isTypedArray'), + 'isUndefined': require('./isUndefined'), + 'isWeakMap': require('./isWeakMap'), + 'isWeakSet': require('./isWeakSet'), + 'lt': require('./lt'), + 'lte': require('./lte'), + 'toArray': require('./toArray'), + 'toFinite': require('./toFinite'), + 'toInteger': require('./toInteger'), + 'toLength': require('./toLength'), + 'toNumber': require('./toNumber'), + 'toPlainObject': require('./toPlainObject'), + 'toSafeInteger': require('./toSafeInteger'), + 'toString': require('./toString') +}; diff --git a/node_modules/lodash/last.js b/node_modules/lodash/last.js new file mode 100755 index 00000000..cad1eafa --- /dev/null +++ b/node_modules/lodash/last.js @@ -0,0 +1,20 @@ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; diff --git a/node_modules/lodash/lastIndexOf.js b/node_modules/lodash/lastIndexOf.js new file mode 100755 index 00000000..dabfb613 --- /dev/null +++ b/node_modules/lodash/lastIndexOf.js @@ -0,0 +1,46 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictLastIndexOf = require('./_strictLastIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ +function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); +} + +module.exports = lastIndexOf; diff --git a/node_modules/lodash/lodash.js b/node_modules/lodash/lodash.js new file mode 100755 index 00000000..b39ddce6 --- /dev/null +++ b/node_modules/lodash/lodash.js @@ -0,0 +1,17084 @@ +/** + * @license + * Lodash + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.4'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)', + rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ + function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; + } + + /** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ + function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; + } + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = object[key], + srcValue = source[key], + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ + function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ + function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

      ' + func(text) + '

      '; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

      fred, barney, & pebbles

      ' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(args) { + args.push(undefined, customDefaultsAssignIn); + return apply(assignInWith, undefined, args); + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' + + + + diff --git a/node_modules/mute-stream/coverage/lcov-report/__root__/mute.js.html b/node_modules/mute-stream/coverage/lcov-report/__root__/mute.js.html new file mode 100755 index 00000000..375a8326 --- /dev/null +++ b/node_modules/mute-stream/coverage/lcov-report/__root__/mute.js.html @@ -0,0 +1,500 @@ + + + + Code coverage report for mute.js + + + + + + + +
      +
      +

      + all files / __root__/ mute.js +

      +
      +
      + 77.03% + Statements + 57/74 +
      +
      + 57.14% + Branches + 28/49 +
      +
      + 93.33% + Functions + 14/15 +
      +
      + 79.1% + Lines + 53/67 +
      +
      +
      +
      +
      
      +
      +
      1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +  + +  +  +  + + + + + + + +  +  +  +  + + +  +  + +  + +  +  +  +  + +10× +  +  + + +  +  + +  +  +  +  +  +  + + +  +  + +  +  +  +  +  +  + + +  +  +  +  +  +  + + +  +  +  +  +  +  +  + +  + +  +  +  +  + +  + +  +  +  +  +  + + + +  +  + + +  +  + + +  +  + +25× +13× + +  +  +  +  +  +  +  +  + +  +  +  +  +  + +  +  +20× +  +  + + + +  +  + +  +  + + +  +  + +  +  +  +  +  +  + + + + 
      var Stream = require('stream')
      + 
      +module.exports = MuteStream
      + 
      +// var out = new MuteStream(process.stdout)
      +// argument auto-pipes
      +function MuteStream (opts) {
      +  Stream.apply(this)
      +  opts = opts || {}
      +  this.writable = this.readable = true
      +  this.muted = false
      +  this.on('pipe', this._onpipe)
      +  this.replace = opts.replace
      + 
      +  // For readline-type situations
      +  // This much at the start of a line being redrawn after a ctrl char
      +  // is seen (such as backspace) won't be redrawn as the replacement
      +  this._prompt = opts.prompt || null
      +  this._hadControl = false
      +}
      + 
      +MuteStream.prototype = Object.create(Stream.prototype)
      + 
      +Object.defineProperty(MuteStream.prototype, 'constructor', {
      +  value: MuteStream,
      +  enumerable: false
      +})
      + 
      +MuteStream.prototype.mute = function () {
      +  this.muted = true
      +}
      + 
      +MuteStream.prototype.unmute = function () {
      +  this.muted = false
      +}
      + 
      +Object.defineProperty(MuteStream.prototype, '_onpipe', {
      +  value: onPipe,
      +  enumerable: false,
      +  writable: true,
      +  configurable: true
      +})
      + 
      +function onPipe (src) {
      +  this._src = src
      +}
      + 
      +Object.defineProperty(MuteStream.prototype, 'isTTY', {
      +  get: getIsTTY,
      +  set: setIsTTY,
      +  enumerable: true,
      +  configurable: true
      +})
      + 
      +function getIsTTY () {
      +  return( (this._dest) ? this._dest.isTTY
      +        : (this._src) ? this._src.isTTY
      +        : false
      +        )
      +}
      + 
      +// basically just get replace the getter/setter with a regular value
      +function setIsTTY (isTTY) {
      +  Object.defineProperty(this, 'isTTY', {
      +    value: isTTY,
      +    enumerable: true,
      +    writable: true,
      +    configurable: true
      +  })
      +}
      + 
      +Object.defineProperty(MuteStream.prototype, 'rows', {
      +  get: function () {
      +    return( this._dest ? this._dest.rows
      +          : this._src ? this._src.rows
      +          : undefined )
      +  }, enumerable: true, configurable: true })
      + 
      +Object.defineProperty(MuteStream.prototype, 'columns', {
      +  get: function () {
      +    return( this._dest ? this._dest.columns
      +          : this._src ? this._src.columns
      +          : undefined )
      +  }, enumerable: true, configurable: true })
      + 
      + 
      +MuteStream.prototype.pipe = function (dest, options) {
      +  this._dest = dest
      +  return Stream.prototype.pipe.call(this, dest, options)
      +}
      + 
      +MuteStream.prototype.pause = function () {
      +  Eif (this._src) return this._src.pause()
      +}
      + 
      +MuteStream.prototype.resume = function () {
      +  Eif (this._src) return this._src.resume()
      +}
      + 
      +MuteStream.prototype.write = function (c) {
      +  if (this.muted) {
      +    if (!this.replace) return true
      +    Iif (c.match(/^\u001b/)) {
      +      if(c.indexOf(this._prompt) === 0) {
      +        c = c.substr(this._prompt.length);
      +        c = c.replace(/./g, this.replace);
      +        c = this._prompt + c;
      +      }
      +      this._hadControl = true
      +      return this.emit('data', c)
      +    } else {
      +      Iif (this._prompt && this._hadControl &&
      +          c.indexOf(this._prompt) === 0) {
      +        this._hadControl = false
      +        this.emit('data', this._prompt)
      +        c = c.substr(this._prompt.length)
      +      }
      +      c = c.toString().replace(/./g, this.replace)
      +    }
      +  }
      +  this.emit('data', c)
      +}
      + 
      +MuteStream.prototype.end = function (c) {
      +  Eif (this.muted) {
      +    Iif (c && this.replace) {
      +      c = c.toString().replace(/./g, this.replace)
      +    } else {
      +      c = null
      +    }
      +  }
      +  Iif (c) this.emit('data', c)
      +  this.emit('end')
      +}
      + 
      +function proxy (fn) { return function () {
      +  var d = this._dest
      +  var s = this._src
      +  if (d && d[fn]) d[fn].apply(d, arguments)
      +  if (s && s[fn]) s[fn].apply(s, arguments)
      +}}
      + 
      +MuteStream.prototype.destroy = proxy('destroy')
      +MuteStream.prototype.destroySoon = proxy('destroySoon')
      +MuteStream.prototype.close = proxy('close')
      + 
      +
      +
      + + + + + + + diff --git a/node_modules/mute-stream/coverage/lcov-report/base.css b/node_modules/mute-stream/coverage/lcov-report/base.css new file mode 100755 index 00000000..0c0571da --- /dev/null +++ b/node_modules/mute-stream/coverage/lcov-report/base.css @@ -0,0 +1,212 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px;; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } + + +.medium .chart { border:1px solid #666; } +.medium .cover-fill { background: #666; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } +.medium { background: #eaeaea; } + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/node_modules/mute-stream/coverage/lcov-report/index.html b/node_modules/mute-stream/coverage/lcov-report/index.html new file mode 100755 index 00000000..17d7a760 --- /dev/null +++ b/node_modules/mute-stream/coverage/lcov-report/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for All files + + + + + + + +
      +
      +

      + / +

      +
      +
      + 77.03% + Statements + 57/74 +
      +
      + 57.14% + Branches + 28/49 +
      +
      + 93.33% + Functions + 14/15 +
      +
      + 79.1% + Lines + 53/67 +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      FileStatementsBranchesFunctionsLines
      __root__/
      77.03%57/7457.14%28/4993.33%14/1579.1%53/67
      +
      +
      + + + + + + + diff --git a/node_modules/mute-stream/coverage/lcov-report/prettify.css b/node_modules/mute-stream/coverage/lcov-report/prettify.css new file mode 100755 index 00000000..b317a7cd --- /dev/null +++ b/node_modules/mute-stream/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/node_modules/mute-stream/coverage/lcov-report/prettify.js b/node_modules/mute-stream/coverage/lcov-report/prettify.js new file mode 100755 index 00000000..ef51e038 --- /dev/null +++ b/node_modules/mute-stream/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/node_modules/mute-stream/coverage/lcov-report/sort-arrow-sprite.png b/node_modules/mute-stream/coverage/lcov-report/sort-arrow-sprite.png new file mode 100755 index 00000000..03f704a6 Binary files /dev/null and b/node_modules/mute-stream/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/node_modules/mute-stream/coverage/lcov-report/sorter.js b/node_modules/mute-stream/coverage/lcov-report/sorter.js new file mode 100755 index 00000000..6c5034e4 --- /dev/null +++ b/node_modules/mute-stream/coverage/lcov-report/sorter.js @@ -0,0 +1,158 @@ +var addSorting = (function () { + "use strict"; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { return document.querySelector('.coverage-summary'); } + // returns the thead element of the summary table + function getTableHeader() { return getTable().querySelector('thead tr'); } + // returns the tbody element of the summary table + function getTableBody() { return getTable().querySelector('tbody'); } + // returns the th element for nth column + function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/node_modules/mute-stream/coverage/lcov.info b/node_modules/mute-stream/coverage/lcov.info new file mode 100755 index 00000000..5f2a58e4 --- /dev/null +++ b/node_modules/mute-stream/coverage/lcov.info @@ -0,0 +1,155 @@ +TN: +SF:./mute.js +FN:7,MuteStream +FN:29,(anonymous_2) +FN:33,(anonymous_3) +FN:44,onPipe +FN:55,getIsTTY +FN:63,setIsTTY +FN:73,(anonymous_7) +FN:80,(anonymous_8) +FN:87,(anonymous_9) +FN:92,(anonymous_10) +FN:96,(anonymous_11) +FN:100,(anonymous_12) +FN:124,(anonymous_13) +FN:136,proxy +FN:136,(anonymous_15) +FNF:15 +FNH:14 +FNDA:7,MuteStream +FNDA:10,(anonymous_2) +FNDA:6,(anonymous_3) +FNDA:5,onPipe +FNDA:8,getIsTTY +FNDA:2,setIsTTY +FNDA:5,(anonymous_7) +FNDA:5,(anonymous_8) +FNDA:2,(anonymous_9) +FNDA:2,(anonymous_10) +FNDA:2,(anonymous_11) +FNDA:25,(anonymous_12) +FNDA:2,(anonymous_13) +FNDA:3,proxy +FNDA:0,(anonymous_15) +DA:1,1 +DA:3,1 +DA:7,1 +DA:8,7 +DA:9,7 +DA:10,7 +DA:11,7 +DA:12,7 +DA:13,7 +DA:18,7 +DA:19,7 +DA:22,1 +DA:24,1 +DA:29,1 +DA:30,10 +DA:33,1 +DA:34,6 +DA:37,1 +DA:44,1 +DA:45,5 +DA:48,1 +DA:55,1 +DA:56,8 +DA:63,1 +DA:64,2 +DA:72,1 +DA:74,5 +DA:79,1 +DA:81,5 +DA:87,1 +DA:88,2 +DA:89,2 +DA:92,1 +DA:93,2 +DA:96,1 +DA:97,2 +DA:100,1 +DA:101,25 +DA:102,13 +DA:103,8 +DA:104,0 +DA:105,0 +DA:106,0 +DA:107,0 +DA:109,0 +DA:110,0 +DA:112,8 +DA:114,0 +DA:115,0 +DA:116,0 +DA:118,8 +DA:121,20 +DA:124,1 +DA:125,2 +DA:126,2 +DA:127,0 +DA:129,2 +DA:132,2 +DA:133,2 +DA:136,3 +DA:137,0 +DA:138,0 +DA:139,0 +DA:140,0 +DA:143,1 +DA:144,1 +DA:145,1 +LF:67 +LH:53 +BRDA:9,1,0,7 +BRDA:9,1,1,5 +BRDA:18,2,0,7 +BRDA:18,2,1,7 +BRDA:56,3,0,3 +BRDA:56,3,1,5 +BRDA:57,4,0,3 +BRDA:57,4,1,2 +BRDA:74,5,0,4 +BRDA:74,5,1,1 +BRDA:75,6,0,0 +BRDA:75,6,1,1 +BRDA:81,7,0,4 +BRDA:81,7,1,1 +BRDA:82,8,0,0 +BRDA:82,8,1,1 +BRDA:93,9,0,2 +BRDA:93,9,1,0 +BRDA:97,10,0,2 +BRDA:97,10,1,0 +BRDA:101,11,0,13 +BRDA:101,11,1,12 +BRDA:102,12,0,5 +BRDA:102,12,1,8 +BRDA:103,13,0,0 +BRDA:103,13,1,8 +BRDA:104,14,0,0 +BRDA:104,14,1,0 +BRDA:112,15,0,0 +BRDA:112,15,1,8 +BRDA:112,16,0,8 +BRDA:112,16,1,0 +BRDA:112,16,2,0 +BRDA:125,17,0,2 +BRDA:125,17,1,0 +BRDA:126,18,0,0 +BRDA:126,18,1,2 +BRDA:126,19,0,2 +BRDA:126,19,1,1 +BRDA:132,20,0,0 +BRDA:132,20,1,2 +BRDA:139,21,0,0 +BRDA:139,21,1,0 +BRDA:139,22,0,0 +BRDA:139,22,1,0 +BRDA:140,23,0,0 +BRDA:140,23,1,0 +BRDA:140,24,0,0 +BRDA:140,24,1,0 +BRF:49 +BRH:28 +end_of_record diff --git a/node_modules/mute-stream/mute.js b/node_modules/mute-stream/mute.js new file mode 100755 index 00000000..a24fc099 --- /dev/null +++ b/node_modules/mute-stream/mute.js @@ -0,0 +1,145 @@ +var Stream = require('stream') + +module.exports = MuteStream + +// var out = new MuteStream(process.stdout) +// argument auto-pipes +function MuteStream (opts) { + Stream.apply(this) + opts = opts || {} + this.writable = this.readable = true + this.muted = false + this.on('pipe', this._onpipe) + this.replace = opts.replace + + // For readline-type situations + // This much at the start of a line being redrawn after a ctrl char + // is seen (such as backspace) won't be redrawn as the replacement + this._prompt = opts.prompt || null + this._hadControl = false +} + +MuteStream.prototype = Object.create(Stream.prototype) + +Object.defineProperty(MuteStream.prototype, 'constructor', { + value: MuteStream, + enumerable: false +}) + +MuteStream.prototype.mute = function () { + this.muted = true +} + +MuteStream.prototype.unmute = function () { + this.muted = false +} + +Object.defineProperty(MuteStream.prototype, '_onpipe', { + value: onPipe, + enumerable: false, + writable: true, + configurable: true +}) + +function onPipe (src) { + this._src = src +} + +Object.defineProperty(MuteStream.prototype, 'isTTY', { + get: getIsTTY, + set: setIsTTY, + enumerable: true, + configurable: true +}) + +function getIsTTY () { + return( (this._dest) ? this._dest.isTTY + : (this._src) ? this._src.isTTY + : false + ) +} + +// basically just get replace the getter/setter with a regular value +function setIsTTY (isTTY) { + Object.defineProperty(this, 'isTTY', { + value: isTTY, + enumerable: true, + writable: true, + configurable: true + }) +} + +Object.defineProperty(MuteStream.prototype, 'rows', { + get: function () { + return( this._dest ? this._dest.rows + : this._src ? this._src.rows + : undefined ) + }, enumerable: true, configurable: true }) + +Object.defineProperty(MuteStream.prototype, 'columns', { + get: function () { + return( this._dest ? this._dest.columns + : this._src ? this._src.columns + : undefined ) + }, enumerable: true, configurable: true }) + + +MuteStream.prototype.pipe = function (dest, options) { + this._dest = dest + return Stream.prototype.pipe.call(this, dest, options) +} + +MuteStream.prototype.pause = function () { + if (this._src) return this._src.pause() +} + +MuteStream.prototype.resume = function () { + if (this._src) return this._src.resume() +} + +MuteStream.prototype.write = function (c) { + if (this.muted) { + if (!this.replace) return true + if (c.match(/^\u001b/)) { + if(c.indexOf(this._prompt) === 0) { + c = c.substr(this._prompt.length); + c = c.replace(/./g, this.replace); + c = this._prompt + c; + } + this._hadControl = true + return this.emit('data', c) + } else { + if (this._prompt && this._hadControl && + c.indexOf(this._prompt) === 0) { + this._hadControl = false + this.emit('data', this._prompt) + c = c.substr(this._prompt.length) + } + c = c.toString().replace(/./g, this.replace) + } + } + this.emit('data', c) +} + +MuteStream.prototype.end = function (c) { + if (this.muted) { + if (c && this.replace) { + c = c.toString().replace(/./g, this.replace) + } else { + c = null + } + } + if (c) this.emit('data', c) + this.emit('end') +} + +function proxy (fn) { return function () { + var d = this._dest + var s = this._src + if (d && d[fn]) d[fn].apply(d, arguments) + if (s && s[fn]) s[fn].apply(s, arguments) +}} + +MuteStream.prototype.destroy = proxy('destroy') +MuteStream.prototype.destroySoon = proxy('destroySoon') +MuteStream.prototype.close = proxy('close') diff --git a/node_modules/mute-stream/package.json b/node_modules/mute-stream/package.json new file mode 100755 index 00000000..a7cb0cc6 --- /dev/null +++ b/node_modules/mute-stream/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "mute-stream@~0.0.4", + "scope": null, + "escapedName": "mute-stream", + "name": "mute-stream", + "rawSpec": "~0.0.4", + "spec": ">=0.0.4 <0.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/read" + ] + ], + "_from": "mute-stream@>=0.0.4 <0.1.0", + "_id": "mute-stream@0.0.7", + "_inCache": true, + "_location": "/mute-stream", + "_nodeVersion": "8.0.0-pre", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/mute-stream-0.0.7.tgz_1483483671377_0.22980716335587204" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "mute-stream@~0.0.4", + "scope": null, + "escapedName": "mute-stream", + "name": "mute-stream", + "rawSpec": "~0.0.4", + "spec": ">=0.0.4 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/read" + ], + "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "_shasum": "3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab", + "_shrinkwrap": null, + "_spec": "mute-stream@~0.0.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/read", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/mute-stream/issues" + }, + "dependencies": {}, + "description": "Bytes go in, but they don't come out (when muted).", + "devDependencies": { + "tap": "^5.4.4" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab", + "tarball": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz" + }, + "gitHead": "304d9f7b277175b03c5ae828c326a211e3139778", + "homepage": "https://github.com/isaacs/mute-stream#readme", + "keywords": [ + "mute", + "stream", + "pipe" + ], + "license": "ISC", + "main": "mute.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "mute-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/mute-stream.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "0.0.7" +} diff --git a/node_modules/mute-stream/test/basic.js b/node_modules/mute-stream/test/basic.js new file mode 100755 index 00000000..41f9e10c --- /dev/null +++ b/node_modules/mute-stream/test/basic.js @@ -0,0 +1,207 @@ +var Stream = require('stream') +var tap = require('tap') +var MS = require('../mute.js') + +// some marker objects +var END = {} +var PAUSE = {} +var RESUME = {} + +function PassThrough () { + Stream.call(this) + this.readable = this.writable = true +} + +PassThrough.prototype = Object.create(Stream.prototype, { + constructor: { + value: PassThrough + }, + write: { + value: function (c) { + this.emit('data', c) + return true + } + }, + end: { + value: function (c) { + if (c) this.write(c) + this.emit('end') + } + }, + pause: { + value: function () { + this.emit('pause') + } + }, + resume: { + value: function () { + this.emit('resume') + } + } +}) + +tap.test('incoming', function (t) { + var ms = new MS + var str = new PassThrough + str.pipe(ms) + + var expect = ['foo', 'boo', END] + ms.on('data', function (c) { + t.equal(c, expect.shift()) + }) + ms.on('end', function () { + t.equal(END, expect.shift()) + t.end() + }) + str.write('foo') + ms.mute() + str.write('bar') + ms.unmute() + str.write('boo') + ms.mute() + str.write('blaz') + str.end('grelb') +}) + +tap.test('outgoing', function (t) { + var ms = new MS + var str = new PassThrough + ms.pipe(str) + + var expect = ['foo', 'boo', END] + str.on('data', function (c) { + t.equal(c, expect.shift()) + }) + str.on('end', function () { + t.equal(END, expect.shift()) + t.end() + }) + + ms.write('foo') + ms.mute() + ms.write('bar') + ms.unmute() + ms.write('boo') + ms.mute() + ms.write('blaz') + ms.end('grelb') +}) + +tap.test('isTTY', function (t) { + var str = new PassThrough + str.isTTY = true + str.columns=80 + str.rows=24 + + var ms = new MS + t.equal(ms.isTTY, false) + t.equal(ms.columns, undefined) + t.equal(ms.rows, undefined) + ms.pipe(str) + t.equal(ms.isTTY, true) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) + str.isTTY = false + t.equal(ms.isTTY, false) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) + str.isTTY = true + t.equal(ms.isTTY, true) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) + ms.isTTY = false + t.equal(ms.isTTY, false) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) + + ms = new MS + t.equal(ms.isTTY, false) + str.pipe(ms) + t.equal(ms.isTTY, true) + str.isTTY = false + t.equal(ms.isTTY, false) + str.isTTY = true + t.equal(ms.isTTY, true) + ms.isTTY = false + t.equal(ms.isTTY, false) + + t.end() +}) + +tap.test('pause/resume incoming', function (t) { + var str = new PassThrough + var ms = new MS + str.on('pause', function () { + t.equal(PAUSE, expect.shift()) + }) + str.on('resume', function () { + t.equal(RESUME, expect.shift()) + }) + var expect = [PAUSE, RESUME, PAUSE, RESUME] + str.pipe(ms) + ms.pause() + ms.resume() + ms.pause() + ms.resume() + t.equal(expect.length, 0, 'saw all events') + t.end() +}) + +tap.test('replace with *', function (t) { + var str = new PassThrough + var ms = new MS({replace: '*'}) + str.pipe(ms) + var expect = ['foo', '*****', 'bar', '***', 'baz', 'boo', '**', '****'] + + ms.on('data', function (c) { + t.equal(c, expect.shift()) + }) + + str.write('foo') + ms.mute() + str.write('12345') + ms.unmute() + str.write('bar') + ms.mute() + str.write('baz') + ms.unmute() + str.write('baz') + str.write('boo') + ms.mute() + str.write('xy') + str.write('xyzΩ') + + t.equal(expect.length, 0) + t.end() +}) + +tap.test('replace with ~YARG~', function (t) { + var str = new PassThrough + var ms = new MS({replace: '~YARG~'}) + str.pipe(ms) + var expect = ['foo', '~YARG~~YARG~~YARG~~YARG~~YARG~', 'bar', + '~YARG~~YARG~~YARG~', 'baz', 'boo', '~YARG~~YARG~', + '~YARG~~YARG~~YARG~~YARG~'] + + ms.on('data', function (c) { + t.equal(c, expect.shift()) + }) + + // also throw some unicode in there, just for good measure. + str.write('foo') + ms.mute() + str.write('ΩΩ') + ms.unmute() + str.write('bar') + ms.mute() + str.write('Ω') + ms.unmute() + str.write('baz') + str.write('boo') + ms.mute() + str.write('Ω') + str.write('ΩΩ') + + t.equal(expect.length, 0) + t.end() +}) diff --git a/node_modules/nan/CHANGELOG.md b/node_modules/nan/CHANGELOG.md new file mode 100755 index 00000000..fb8087ce --- /dev/null +++ b/node_modules/nan/CHANGELOG.md @@ -0,0 +1,453 @@ +# NAN ChangeLog + +**Version 2.6.2: current Node 7.9.0, Node 12: 0.12.18, Node 10: 0.10.48, iojs: 3.3.1** + +### 2.6.2 Apr 12 2017 + + - Bugfix: Fix v8::JSON::Parse() deprecation warning. 87f6a3c65815fa062296a994cc863e2fa124867d + +### 2.6.1 Apr 6 2017 + + - Bugfix: nan_json.h: fix build breakage in Node 6 ac8d47dc3c10bfbf3f15a6b951633120c0ee6d51 + +### 2.6.0 Apr 6 2017 + + - Feature: nan: add support for JSON::Parse & Stringify b533226c629cce70e1932a873bb6f849044a56c5 + +### 2.5.1 Jan 23 2017 + + - Bugfix: Fix disappearing handle for private value 6a80995694f162ef63dbc9948fbefd45d4485aa0 + - Bugfix: Add missing scopes a93b8bae6bc7d32a170db6e89228b7f60ee57112 + - Bugfix: Use string::data instead of string::front in NewOneByteString d5f920371e67e1f3b268295daee6e83af86b6e50 + +### 2.5.0 Dec 21 2016 + + - Feature: Support Private accessors a86255cb357e8ad8ccbf1f6a4a901c921e39a178 + - Bugfix: Abort in delete operators that shouldn't be called 0fe38215ff8581703967dfd26c12793feb960018 + +### 2.4.0 Jul 10 2016 + + - Feature: Rewrite Callback to add Callback::Reset c4cf44d61f8275cd5f7b0c911d7a806d4004f649 + - Feature: AsyncProgressWorker: add template types for .send 1242c9a11a7ed481c8f08ec06316385cacc513d0 + - Bugfix: Add constness to old Persistent comparison operators bd43cb9982c7639605d60fd073efe8cae165d9b2 + +### 2.3.5 May 31 2016 + + - Bugfix: Replace NAN_INLINE with 'inline' keyword. 71819d8725f822990f439479c9aba3b240804909 + +### 2.3.4 May 31 2016 + + - Bugfix: Remove V8 deprecation warnings 0592fb0a47f3a1c7763087ebea8e1138829f24f9 + - Bugfix: Fix new versions not to use WeakCallbackInfo::IsFirstPass 615c19d9e03d4be2049c10db0151edbc3b229246 + - Bugfix: Make ObjectWrap::handle() const d19af99595587fe7a26bd850af6595c2a7145afc + - Bugfix: Fix compilation errors related to 0592fb0a47f3a1c7763087ebea8e1138829f24f9 e9191c525b94f652718325e28610a1adcf90fed8 + +### 2.3.3 May 4 2016 + + - Bugfix: Refactor SetMethod() to deal with v8::Templates (#566) b9083cf6d5de6ebe6bcb49c7502fbb7c0d9ddda8 + +### 2.3.2 Apr 27 2016 + + - Bugfix: Fix compilation on outdated versions due to Handle removal f8b7c875d04d425a41dfd4f3f8345bc3a11e6c52 + +### 2.3.1 Apr 27 2016 + + - Bugfix: Don't use deprecated v8::Template::Set() in SetMethod a90951e9ea70fa1b3836af4b925322919159100e + +### 2.3.0 Apr 27 2016 + + - Feature: added Signal() for invoking async callbacks without sending data from AsyncProgressWorker d8adba45f20e077d00561b20199133620c990b38 + - Bugfix: Don't use deprecated v8::Template::Set() 00dacf0a4b86027415867fa7f1059acc499dcece + +### 2.2.1 Mar 29 2016 + + - Bugfix: Use NewFromUnsigned in ReturnValue::Set(uint32_t i) for pre_12 3a18f9bdce29826e0e4c217854bc476918241a58 + - Performance: Remove unneeeded nullptr checks b715ef44887931c94f0d1605b3b1a4156eebece9 + +### 2.2.0 Jan 9 2016 + + - Feature: Add Function::Call wrapper 4c157474dacf284d125c324177b45aa5dabc08c6 + - Feature: Rename GC*logueCallback to GCCallback for > 4.0 3603435109f981606d300eb88004ca101283acec + - Bugfix: Fix Global::Pass for old versions 367e82a60fbaa52716232cc89db1cc3f685d77d9 + - Bugfix: Remove weird MaybeLocal wrapping of what already is a MaybeLocal 23b4590db10c2ba66aee2338aebe9751c4cb190b + +### 2.1.0 Oct 8 2015 + + - Deprecation: Deprecate NanErrnoException in favor of ErrnoException 0af1ca4cf8b3f0f65ed31bc63a663ab3319da55c + - Feature: added helper class for accessing contents of typedarrays 17b51294c801e534479d5463697a73462d0ca555 + - Feature: [Maybe types] Add MakeMaybe(...) 48d7b53d9702b0c7a060e69ea10fea8fb48d814d + - Feature: new: allow utf16 string with length 66ac6e65c8ab9394ef588adfc59131b3b9d8347b + - Feature: Introduce SetCallHandler and SetCallAsFunctionHandler 7764a9a115d60ba10dc24d86feb0fbc9b4f75537 + - Bugfix: Enable creating Locals from Globals under Node 0.10. 9bf9b8b190821af889790fdc18ace57257e4f9ff + - Bugfix: Fix issue #462 where PropertyCallbackInfo data is not stored safely. 55f50adedd543098526c7b9f4fffd607d3f9861f + +### 2.0.9 Sep 8 2015 + + - Bugfix: EscapableHandleScope in Nan::NewBuffer for Node 0.8 and 0.10 b1654d7 + +### 2.0.8 Aug 28 2015 + + - Work around duplicate linking bug in clang 11902da + +### 2.0.7 Aug 26 2015 + + - Build: Repackage + +### 2.0.6 Aug 26 2015 + + - Bugfix: Properly handle null callback in FunctionTemplate factory 6e99cb1 + - Bugfix: Remove unused static std::map instances 525bddc + - Bugfix: Make better use of maybe versions of APIs bfba85b + - Bugfix: Fix shadowing issues with handle in ObjectWrap 0a9072d + +### 2.0.5 Aug 10 2015 + + - Bugfix: Reimplement weak callback in ObjectWrap 98d38c1 + - Bugfix: Make sure callback classes are not assignable, copyable or movable 81f9b1d + +### 2.0.4 Aug 6 2015 + + - Build: Repackage + +### 2.0.3 Aug 6 2015 + + - Bugfix: Don't use clang++ / g++ syntax extension. 231450e + +### 2.0.2 Aug 6 2015 + + - Build: Repackage + +### 2.0.1 Aug 6 2015 + + - Bugfix: Add workaround for missing REPLACE_INVALID_UTF8 60d6687 + - Bugfix: Reimplement ObjectWrap from scratch to prevent memory leaks 6484601 + - Bugfix: Fix Persistent leak in FunctionCallbackInfo and PropertyCallbackInfo 641ef5f + - Bugfix: Add missing overload for Nan::NewInstance that takes argc/argv 29450ed + +### 2.0.0 Jul 31 2015 + + - Change: Renamed identifiers with leading underscores b5932b4 + - Change: Replaced NanObjectWrapHandle with class NanObjectWrap 464f1e1 + - Change: Replace NanScope and NanEscpableScope macros with classes 47751c4 + - Change: Rename NanNewBufferHandle to NanNewBuffer 6745f99 + - Change: Rename NanBufferUse to NanNewBuffer 3e8b0a5 + - Change: Rename NanNewBuffer to NanCopyBuffer d6af78d + - Change: Remove Nan prefix from all names 72d1f67 + - Change: Update Buffer API for new upstream changes d5d3291 + - Change: Rename Scope and EscapableScope to HandleScope and EscapableHandleScope 21a7a6a + - Change: Get rid of Handles e6c0daf + - Feature: Support io.js 3 with V8 4.4 + - Feature: Introduce NanPersistent 7fed696 + - Feature: Introduce NanGlobal 4408da1 + - Feature: Added NanTryCatch 10f1ca4 + - Feature: Update for V8 v4.3 4b6404a + - Feature: Introduce NanNewOneByteString c543d32 + - Feature: Introduce namespace Nan 67ed1b1 + - Removal: Remove NanLocker and NanUnlocker dd6e401 + - Removal: Remove string converters, except NanUtf8String, which now follows the node implementation b5d00a9 + - Removal: Remove NanReturn* macros d90a25c + - Removal: Remove HasInstance e8f84fe + + +### 1.9.0 Jul 31 2015 + + - Feature: Added `NanFatalException` 81d4a2c + - Feature: Added more error types 4265f06 + - Feature: Added dereference and function call operators to NanCallback c4b2ed0 + - Feature: Added indexed GetFromPersistent and SaveToPersistent edd510c + - Feature: Added more overloads of SaveToPersistent and GetFromPersistent 8b1cef6 + - Feature: Added NanErrnoException dd87d9e + - Correctness: Prevent assign, copy, and move for classes that do not support it 1f55c59, 4b808cb, c96d9b2, fba4a29, 3357130 + - Deprecation: Deprecate `NanGetPointerSafe` and `NanSetPointerSafe` 81d4a2c + - Deprecation: Deprecate `NanBooleanOptionValue` and `NanUInt32OptionValue` 0ad254b + +### 1.8.4 Apr 26 2015 + + - Build: Repackage + +### 1.8.3 Apr 26 2015 + + - Bugfix: Include missing header 1af8648 + +### 1.8.2 Apr 23 2015 + + - Build: Repackage + +### 1.8.1 Apr 23 2015 + + - Bugfix: NanObjectWrapHandle should take a pointer 155f1d3 + +### 1.8.0 Apr 23 2015 + + - Feature: Allow primitives with NanReturnValue 2e4475e + - Feature: Added comparison operators to NanCallback 55b075e + - Feature: Backport thread local storage 15bb7fa + - Removal: Remove support for signatures with arguments 8a2069d + - Correcteness: Replaced NanObjectWrapHandle macro with function 0bc6d59 + +### 1.7.0 Feb 28 2015 + + - Feature: Made NanCallback::Call accept optional target 8d54da7 + - Feature: Support atom-shell 0.21 0b7f1bb + +### 1.6.2 Feb 6 2015 + + - Bugfix: NanEncode: fix argument type for node::Encode on io.js 2be8639 + +### 1.6.1 Jan 23 2015 + + - Build: version bump + +### 1.5.3 Jan 23 2015 + + - Build: repackage + +### 1.6.0 Jan 23 2015 + + - Deprecated `NanNewContextHandle` in favor of `NanNew` 49259af + - Support utility functions moved in newer v8 versions (Node 0.11.15, io.js 1.0) a0aa179 + - Added `NanEncode`, `NanDecodeBytes` and `NanDecodeWrite` 75e6fb9 + +### 1.5.2 Jan 23 2015 + + - Bugfix: Fix non-inline definition build error with clang++ 21d96a1, 60fadd4 + - Bugfix: Readded missing String constructors 18d828f + - Bugfix: Add overload handling NanNew(..) 5ef813b + - Bugfix: Fix uv_work_cb versioning 997e4ae + - Bugfix: Add function factory and test 4eca89c + - Bugfix: Add object template factory and test cdcb951 + - Correctness: Lifted an io.js related typedef c9490be + - Correctness: Make explicit downcasts of String lengths 00074e6 + - Windows: Limit the scope of disabled warning C4530 83d7deb + +### 1.5.1 Jan 15 2015 + + - Build: version bump + +### 1.4.3 Jan 15 2015 + + - Build: version bump + +### 1.4.2 Jan 15 2015 + + - Feature: Support io.js 0dbc5e8 + +### 1.5.0 Jan 14 2015 + + - Feature: Support io.js b003843 + - Correctness: Improved NanNew internals 9cd4f6a + - Feature: Implement progress to NanAsyncWorker 8d6a160 + +### 1.4.1 Nov 8 2014 + + - Bugfix: Handle DEBUG definition correctly + - Bugfix: Accept int as Boolean + +### 1.4.0 Nov 1 2014 + + - Feature: Added NAN_GC_CALLBACK 6a5c245 + - Performance: Removed unnecessary local handle creation 18a7243, 41fe2f8 + - Correctness: Added constness to references in NanHasInstance 02c61cd + - Warnings: Fixed spurious warnings from -Wundef and -Wshadow, 541b122, 99d8cb6 + - Windoze: Shut Visual Studio up when compiling 8d558c1 + - License: Switch to plain MIT from custom hacked MIT license 11de983 + - Build: Added test target to Makefile e232e46 + - Performance: Removed superfluous scope in NanAsyncWorker f4b7821 + - Sugar/Feature: Added NanReturnThis() and NanReturnHolder() shorthands 237a5ff, d697208 + - Feature: Added suitable overload of NanNew for v8::Integer::NewFromUnsigned b27b450 + +### 1.3.0 Aug 2 2014 + + - Added NanNew(std::string) + - Added NanNew(std::string&) + - Added NanAsciiString helper class + - Added NanUtf8String helper class + - Added NanUcs2String helper class + - Deprecated NanRawString() + - Deprecated NanCString() + - Added NanGetIsolateData(v8::Isolate *isolate) + - Added NanMakeCallback(v8::Handle target, v8::Handle func, int argc, v8::Handle* argv) + - Added NanMakeCallback(v8::Handle target, v8::Handle symbol, int argc, v8::Handle* argv) + - Added NanMakeCallback(v8::Handle target, const char* method, int argc, v8::Handle* argv) + - Added NanSetTemplate(v8::Handle templ, v8::Handle name , v8::Handle value, v8::PropertyAttribute attributes) + - Added NanSetPrototypeTemplate(v8::Local templ, v8::Handle name, v8::Handle value, v8::PropertyAttribute attributes) + - Added NanSetInstanceTemplate(v8::Local templ, const char *name, v8::Handle value) + - Added NanSetInstanceTemplate(v8::Local templ, v8::Handle name, v8::Handle value, v8::PropertyAttribute attributes) + +### 1.2.0 Jun 5 2014 + + - Add NanSetPrototypeTemplate + - Changed NAN_WEAK_CALLBACK internals, switched _NanWeakCallbackData to class, + introduced _NanWeakCallbackDispatcher + - Removed -Wno-unused-local-typedefs from test builds + - Made test builds Windows compatible ('Sleep()') + +### 1.1.2 May 28 2014 + + - Release to fix more stuff-ups in 1.1.1 + +### 1.1.1 May 28 2014 + + - Release to fix version mismatch in nan.h and lack of changelog entry for 1.1.0 + +### 1.1.0 May 25 2014 + + - Remove nan_isolate, use v8::Isolate::GetCurrent() internally instead + - Additional explicit overloads for NanNew(): (char*,int), (uint8_t*[,int]), + (uint16_t*[,int), double, int, unsigned int, bool, v8::String::ExternalStringResource*, + v8::String::ExternalAsciiStringResource* + - Deprecate NanSymbol() + - Added SetErrorMessage() and ErrorMessage() to NanAsyncWorker + +### 1.0.0 May 4 2014 + + - Heavy API changes for V8 3.25 / Node 0.11.13 + - Use cpplint.py + - Removed NanInitPersistent + - Removed NanPersistentToLocal + - Removed NanFromV8String + - Removed NanMakeWeak + - Removed NanNewLocal + - Removed NAN_WEAK_CALLBACK_OBJECT + - Removed NAN_WEAK_CALLBACK_DATA + - Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions + - Introduce NanUndefined, NanNull, NanTrue and NanFalse + - Introduce NanEscapableScope and NanEscapeScope + - Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node) + - Introduce NanMakeCallback for node::MakeCallback + - Introduce NanSetTemplate + - Introduce NanGetCurrentContext + - Introduce NanCompileScript and NanRunScript + - Introduce NanAdjustExternalMemory + - Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback + - Introduce NanGetHeapStatistics + - Rename NanAsyncWorker#SavePersistent() to SaveToPersistent() + +### 0.8.0 Jan 9 2014 + + - NanDispose -> NanDisposePersistent, deprecate NanDispose + - Extract _NAN_*_RETURN_TYPE, pull up NAN_*() + +### 0.7.1 Jan 9 2014 + + - Fixes to work against debug builds of Node + - Safer NanPersistentToLocal (avoid reinterpret_cast) + - Speed up common NanRawString case by only extracting flattened string when necessary + +### 0.7.0 Dec 17 2013 + + - New no-arg form of NanCallback() constructor. + - NanCallback#Call takes Handle rather than Local + - Removed deprecated NanCallback#Run method, use NanCallback#Call instead + - Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS + - Restore (unofficial) Node 0.6 compatibility at NanCallback#Call() + - Introduce NanRawString() for char* (or appropriate void*) from v8::String + (replacement for NanFromV8String) + - Introduce NanCString() for null-terminated char* from v8::String + +### 0.6.0 Nov 21 2013 + + - Introduce NanNewLocal(v8::Handle value) for use in place of + v8::Local::New(...) since v8 started requiring isolate in Node 0.11.9 + +### 0.5.2 Nov 16 2013 + + - Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public + +### 0.5.1 Nov 12 2013 + + - Use node::MakeCallback() instead of direct v8::Function::Call() + +### 0.5.0 Nov 11 2013 + + - Added @TooTallNate as collaborator + - New, much simpler, "include_dirs" for binding.gyp + - Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros + +### 0.4.4 Nov 2 2013 + + - Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+ + +### 0.4.3 Nov 2 2013 + + - Include node_object_wrap.h, removed from node.h for Node 0.11.8. + +### 0.4.2 Nov 2 2013 + + - Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for + Node 0.11.8 release. + +### 0.4.1 Sep 16 2013 + + - Added explicit `#include ` as it was removed from node.h for v0.11.8 + +### 0.4.0 Sep 2 2013 + + - Added NAN_INLINE and NAN_DEPRECATED and made use of them + - Added NanError, NanTypeError and NanRangeError + - Cleaned up code + +### 0.3.2 Aug 30 2013 + + - Fix missing scope declaration in GetFromPersistent() and SaveToPersistent + in NanAsyncWorker + +### 0.3.1 Aug 20 2013 + + - fix "not all control paths return a value" compile warning on some platforms + +### 0.3.0 Aug 19 2013 + + - Made NAN work with NPM + - Lots of fixes to NanFromV8String, pulling in features from new Node core + - Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API + - Added optional error number argument for NanThrowError() + - Added NanInitPersistent() + - Added NanReturnNull() and NanReturnEmptyString() + - Added NanLocker and NanUnlocker + - Added missing scopes + - Made sure to clear disposed Persistent handles + - Changed NanAsyncWorker to allocate error messages on the heap + - Changed NanThrowError(Local) to NanThrowError(Handle) + - Fixed leak in NanAsyncWorker when errmsg is used + +### 0.2.2 Aug 5 2013 + + - Fixed usage of undefined variable with node::BASE64 in NanFromV8String() + +### 0.2.1 Aug 5 2013 + + - Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for + NanFromV8String() + +### 0.2.0 Aug 5 2013 + + - Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR, + NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY + - Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS, + _NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS, + _NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS, + _NAN_PROPERTY_QUERY_ARGS + - Added NanGetInternalFieldPointer, NanSetInternalFieldPointer + - Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT, + NAN_WEAK_CALLBACK_DATA, NanMakeWeak + - Renamed THROW_ERROR to _NAN_THROW_ERROR + - Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*) + - Added NanBufferUse(char*, uint32_t) + - Added NanNewContextHandle(v8::ExtensionConfiguration*, + v8::Handle, v8::Handle) + - Fixed broken NanCallback#GetFunction() + - Added optional encoding and size arguments to NanFromV8String() + - Added NanGetPointerSafe() and NanSetPointerSafe() + - Added initial test suite (to be expanded) + - Allow NanUInt32OptionValue to convert any Number object + +### 0.1.0 Jul 21 2013 + + - Added `NAN_GETTER`, `NAN_SETTER` + - Added `NanThrowError` with single Local argument + - Added `NanNewBufferHandle` with single uint32_t argument + - Added `NanHasInstance(Persistent&, Handle)` + - Added `Local NanCallback#GetFunction()` + - Added `NanCallback#Call(int, Local[])` + - Deprecated `NanCallback#Run(int, Local[])` in favour of Call diff --git a/node_modules/nan/LICENSE.md b/node_modules/nan/LICENSE.md new file mode 100755 index 00000000..d4d2da7a --- /dev/null +++ b/node_modules/nan/LICENSE.md @@ -0,0 +1,13 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2017 NAN contributors +----------------------------------- + +*NAN contributors listed at * + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nan/README.md b/node_modules/nan/README.md new file mode 100755 index 00000000..79504c0e --- /dev/null +++ b/node_modules/nan/README.md @@ -0,0 +1,424 @@ +Native Abstractions for Node.js +=============================== + +**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10, 0.12, 1, 2, 3, 4, 5, 6 and 7.** + +***Current version: 2.6.2*** + +*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)* + +[![NPM](https://nodei.co/npm/nan.png?downloads=true&downloadRank=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6&height=3)](https://nodei.co/npm/nan/) + +[![Build Status](https://api.travis-ci.org/nodejs/nan.svg?branch=master)](http://travis-ci.org/nodejs/nan) +[![Build status](https://ci.appveyor.com/api/projects/status/kh73pbm9dsju7fgh)](https://ci.appveyor.com/project/RodVagg/nan) + +Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.12 to 4.0, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle. + +This project also contains some helper utilities that make addon development a bit more pleasant. + + * **[News & Updates](#news)** + * **[Usage](#usage)** + * **[Example](#example)** + * **[API](#api)** + * **[Tests](#tests)** + * **[Governance & Contributing](#governance)** + + + +## News & Updates + + + +## Usage + +Simply add **NAN** as a dependency in the *package.json* of your Node addon: + +``` bash +$ npm install --save nan +``` + +Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files: + +``` python +"include_dirs" : [ + "` when compiling your addon. + + + +## Example + +Just getting started with Nan? Take a look at the **[Node Add-on Examples](https://github.com/nodejs/node-addon-examples)**. + +Refer to a [quick-start **Nan** Boilerplate](https://github.com/fcanas/node-native-boilerplate) for a ready-to-go project that utilizes basic Nan functionality. + +For a simpler example, see the **[async pi estimation example](https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**. + +Yet another example is **[nan-example-eol](https://github.com/CodeCharmLtd/nan-example-eol)**. It shows newline detection implemented as a native addon. + +Also take a look at our comprehensive **[C++ test suite](https://github.com/nodejs/nan/tree/master/test/cpp)** which has a plethora of code snippets for your pasting pleasure. + + + +## API + +Additional to the NAN documentation below, please consult: + +* [The V8 Getting Started * Guide](https://github.com/v8/v8/wiki/Getting%20Started%20with%20Embedding) +* [The V8 Embedders * Guide](https://github.com/v8/v8/wiki/Embedder%27s%20Guide) +* [V8 API Documentation](http://v8docs.nodesource.com/) +* [Node Add-on Documentation](https://nodejs.org/api/addons.html) + + + +### JavaScript-accessible methods + +A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://developers.google.com/v8/embed#templates) for further information. + +In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type. + +* **Method argument types** + - Nan::FunctionCallbackInfo + - Nan::PropertyCallbackInfo + - Nan::ReturnValue +* **Method declarations** + - Method declaration + - Getter declaration + - Setter declaration + - Property getter declaration + - Property setter declaration + - Property enumerator declaration + - Property deleter declaration + - Property query declaration + - Index getter declaration + - Index setter declaration + - Index enumerator declaration + - Index deleter declaration + - Index query declaration +* Method and template helpers + - Nan::SetMethod() + - Nan::SetPrototypeMethod() + - Nan::SetAccessor() + - Nan::SetNamedPropertyHandler() + - Nan::SetIndexedPropertyHandler() + - Nan::SetTemplate() + - Nan::SetPrototypeTemplate() + - Nan::SetInstanceTemplate() + - Nan::SetCallHandler() + - Nan::SetCallAsFunctionHandler() + +### Scopes + +A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works. + +A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope. + +The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these. + + - Nan::HandleScope + - Nan::EscapableHandleScope + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection). + +### Persistent references + +An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed. + +Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported. + + - Nan::PersistentBase & v8::PersistentBase + - Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits + - Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits + - Nan::Persistent + - Nan::Global + - Nan::WeakCallbackInfo + - Nan::WeakCallbackType + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles). + +### New + +NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8. + + - Nan::New() + - Nan::Undefined() + - Nan::Null() + - Nan::True() + - Nan::False() + - Nan::EmptyString() + + +### Converters + +NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN. + + - Nan::To() + +### Maybe Types + +The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_. + +* **Maybe Types** + - Nan::MaybeLocal + - Nan::Maybe + - Nan::Nothing + - Nan::Just +* **Maybe Helpers** + - Nan::Call() + - Nan::ToDetailString() + - Nan::ToArrayIndex() + - Nan::Equals() + - Nan::NewInstance() + - Nan::GetFunction() + - Nan::Set() + - Nan::ForceSet() + - Nan::Get() + - Nan::GetPropertyAttributes() + - Nan::Has() + - Nan::Delete() + - Nan::GetPropertyNames() + - Nan::GetOwnPropertyNames() + - Nan::SetPrototype() + - Nan::ObjectProtoToString() + - Nan::HasOwnProperty() + - Nan::HasRealNamedProperty() + - Nan::HasRealIndexedProperty() + - Nan::HasRealNamedCallbackProperty() + - Nan::GetRealNamedPropertyInPrototypeChain() + - Nan::GetRealNamedProperty() + - Nan::CallAsFunction() + - Nan::CallAsConstructor() + - Nan::GetSourceLine() + - Nan::GetLineNumber() + - Nan::GetStartColumn() + - Nan::GetEndColumn() + - Nan::CloneElementAt() + - Nan::HasPrivate() + - Nan::GetPrivate() + - Nan::SetPrivate() + - Nan::DeletePrivate() + - Nan::MakeMaybe() + +### Script + +NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8. + + - Nan::CompileScript() + - Nan::RunScript() + + +### JSON + +The _JSON_ object provides the c++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object. + + - Nan::JSON.Parse + - Nan::JSON.Stringify + +Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-7.4/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments. + +### Errors + +NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted. + +Note that an Error object is simply a specialized form of `v8::Value`. + +Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information. + + - Nan::Error() + - Nan::RangeError() + - Nan::ReferenceError() + - Nan::SyntaxError() + - Nan::TypeError() + - Nan::ThrowError() + - Nan::ThrowRangeError() + - Nan::ThrowReferenceError() + - Nan::ThrowSyntaxError() + - Nan::ThrowTypeError() + - Nan::FatalException() + - Nan::ErrnoException() + - Nan::TryCatch + + +### Buffers + +NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility. + + - Nan::NewBuffer() + - Nan::CopyBuffer() + - Nan::FreeCallback() + +### Nan::Callback + +`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution. + + - Nan::Callback + +### Asynchronous work helpers + +`Nan::AsyncWorker` and `Nan::AsyncProgressWorker` are helper classes that make working with asynchronous code easier. + + - Nan::AsyncWorker + - Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker + - Nan::AsyncQueueWorker + +### Strings & Bytes + +Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing. + + - Nan::Encoding + - Nan::Encode() + - Nan::DecodeBytes() + - Nan::DecodeWrite() + + +### Object Wrappers + +The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects. + + - Nan::ObjectWrap + + +### V8 internals + +The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods. + + - NAN_GC_CALLBACK() + - Nan::AddGCEpilogueCallback() + - Nan::RemoveGCEpilogueCallback() + - Nan::AddGCPrologueCallback() + - Nan::RemoveGCPrologueCallback() + - Nan::GetHeapStatistics() + - Nan::SetCounterFunction() + - Nan::SetCreateHistogramFunction() + - Nan::SetAddHistogramSampleFunction() + - Nan::IdleNotification() + - Nan::LowMemoryNotification() + - Nan::ContextDisposedNotification() + - Nan::GetInternalFieldPointer() + - Nan::SetInternalFieldPointer() + - Nan::AdjustExternalMemory() + + +### Miscellaneous V8 Helpers + + - Nan::Utf8String + - Nan::GetCurrentContext() + - Nan::SetIsolateData() + - Nan::GetIsolateData() + - Nan::TypedArrayContents + + +### Miscellaneous Node Helpers + + - Nan::MakeCallback() + - NAN_MODULE_INIT() + - Nan::Export() + + + + + + +### Tests + +To run the NAN tests do: + +``` sh +npm install +npm run-script rebuild-tests +npm test +``` + +Or just: + +``` sh +npm install +make test +``` + + + +## Governance & Contributing + +NAN is governed by the [io.js](https://iojs.org/) Addon API Working Group + +### Addon API Working Group (WG) + +The NAN project is jointly governed by a Working Group which is responsible for high-level guidance of the project. + +Members of the WG are also known as Collaborators, there is no distinction between the two, unlike other io.js projects. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project [README.md](./README.md#collaborators). + +Individuals making significant and valuable contributions are made members of the WG and given commit-access to the project. These individuals are identified by the WG and their addition to the WG is discussed via GitHub and requires unanimous consensus amongst those WG members participating in the discussion with a quorum of 50% of WG members required for acceptance of the vote. + +_Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly. + +For the current list of WG members / Collaborators, see the project [README.md](./README.md#collaborators). + +### Consensus Seeking Process + +The WG follows a [Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision making model. + +Modifications of the contents of the NAN repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the WG. All pull requests must be reviewed and accepted by a WG member with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing WG member, an additional WG member is required for sign-off. Consensus should be sought if additional WG members participate and there is disagreement around a particular modification. + +If a change proposal cannot reach a consensus, a WG member can call for a vote amongst the members of the WG. Simple majority wins. + + + +## Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + + + +### WG Members / Collaborators + + + + + + + + + +
      Rod VaggGitHub/rvaggTwitter/@rvagg
      Benjamin ByholmGitHub/kkoopa-
      Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
      Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
      Brett LawsonGitHub/brett19Twitter/@brett19x
      Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
      David SiegelGitHub/agnatTwitter/@agnat
      + +## Licence & copyright + +Copyright (c) 2017 NAN WG Members / Collaborators (listed above). + +Native Abstractions for Node.js is licensed under an MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/node_modules/nan/doc/asyncworker.md b/node_modules/nan/doc/asyncworker.md new file mode 100755 index 00000000..53a78dd4 --- /dev/null +++ b/node_modules/nan/doc/asyncworker.md @@ -0,0 +1,103 @@ +## Asynchronous work helpers + +`Nan::AsyncWorker` and `Nan::AsyncProgressWorker` are helper classes that make working with asynchronous code easier. + + - Nan::AsyncWorker + - Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker + - Nan::AsyncQueueWorker + + +### Nan::AsyncWorker + +`Nan::AsyncWorker` is an _abstract_ class that you can subclass to have much of the annoying asynchronous queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the asynchronous work is in progress. + +Definition: + +```c++ +class AsyncWorker { + public: + explicit AsyncWorker(Callback *callback_); + + virtual ~AsyncWorker(); + + virtual void WorkComplete(); + + void SaveToPersistent(const char *key, const v8::Local &value); + + void SaveToPersistent(const v8::Local &key, + const v8::Local &value); + + void SaveToPersistent(uint32_t index, + const v8::Local &value); + + v8::Local GetFromPersistent(const char *key) const; + + v8::Local GetFromPersistent(const v8::Local &key) const; + + v8::Local GetFromPersistent(uint32_t index) const; + + virtual void Execute() = 0; + + uv_work_t request; + + virtual void Destroy(); + + protected: + Persistent persistentHandle; + + Callback *callback; + + virtual void HandleOKCallback(); + + virtual void HandleErrorCallback(); + + void SetErrorMessage(const char *msg); + + const char* ErrorMessage(); +}; +``` + + +### Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker + +`Nan::AsyncProgressWorkerBase` is an _abstract_ class template that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript. + +Previously the definiton of `Nan::AsyncProgressWorker` only allowed sending `const char` data. Now extending `Nan::AsyncProgressWorker` will yield an instance of the implicit `Nan::AsyncProgressWorkerBase` template with type `` for compatibility. + +Definition: + +```c++ +template +class AsyncProgressWorkerBase : public AsyncWorker { + public: + explicit AsyncProgressWorker(Callback *callback_); + + virtual ~AsyncProgressWorker(); + + void WorkProgress(); + + class ExecutionProgress { + public: + void Signal() const; + void Send(const T* data, size_t size) const; + }; + + virtual void Execute(const ExecutionProgress& progress) = 0; + + virtual void HandleProgressCallback(const T *data, size_t size) = 0; + + virtual void Destroy(); + +typedef AsyncProgressWorkerBase AsyncProgressWorker; +``` + + +### Nan::AsyncQueueWorker + +`Nan::AsyncQueueWorker` will run a `Nan::AsyncWorker` asynchronously via libuv. Both the `execute` and `after_work` steps are taken care of for you. Most of the logic for this is embedded in `Nan::AsyncWorker`. + +Definition: + +```c++ +void AsyncQueueWorker(AsyncWorker *); +``` diff --git a/node_modules/nan/doc/buffers.md b/node_modules/nan/doc/buffers.md new file mode 100755 index 00000000..8d8d25cf --- /dev/null +++ b/node_modules/nan/doc/buffers.md @@ -0,0 +1,54 @@ +## Buffers + +NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility. + + - Nan::NewBuffer() + - Nan::CopyBuffer() + - Nan::FreeCallback() + + +### Nan::NewBuffer() + +Allocate a new `node::Buffer` object with the specified size and optional data. Calls `node::Buffer::New()`. + +Note that when creating a `Buffer` using `Nan::NewBuffer()` and an existing `char*`, it is assumed that the ownership of the pointer is being transferred to the new `Buffer` for management. +When a `node::Buffer` instance is garbage collected and a `FreeCallback` has not been specified, `data` will be disposed of via a call to `free()`. +You _must not_ free the memory space manually once you have created a `Buffer` in this way. + +Signature: + +```c++ +Nan::MaybeLocal Nan::NewBuffer(uint32_t size) +Nan::MaybeLocal Nan::NewBuffer(char* data, uint32_t size) +Nan::MaybeLocal Nan::NewBuffer(char *data, + size_t length, + Nan::FreeCallback callback, + void *hint) +``` + + + +### Nan::CopyBuffer() + +Similar to [`Nan::NewBuffer()`](#api_nan_new_buffer) except that an implicit memcpy will occur within Node. Calls `node::Buffer::Copy()`. + +Management of the `char*` is left to the user, you should manually free the memory space if necessary as the new `Buffer` will have its own copy. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CopyBuffer(const char *data, uint32_t size) +``` + + + +### Nan::FreeCallback() + +A free callback that can be provided to [`Nan::NewBuffer()`](#api_nan_new_buffer). +The supplied callback will be invoked when the `Buffer` undergoes garbage collection. + +Signature: + +```c++ +typedef void (*FreeCallback)(char *data, void *hint); +``` diff --git a/node_modules/nan/doc/callback.md b/node_modules/nan/doc/callback.md new file mode 100755 index 00000000..46de1d71 --- /dev/null +++ b/node_modules/nan/doc/callback.md @@ -0,0 +1,56 @@ +## Nan::Callback + +`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution. + + - Nan::Callback + + +### Nan::Callback + +```c++ +class Callback { + public: + Callback(); + + explicit Callback(const v8::Local &fn); + + ~Callback(); + + bool operator==(const Callback &other) const; + + bool operator!=(const Callback &other) const; + + v8::Local operator*() const; + + v8::Local operator()(v8::Local target, + int argc = 0, + v8::Local argv[] = 0) const; + + v8::Local operator()(int argc = 0, + v8::Local argv[] = 0) const; + + void SetFunction(const v8::Local &fn); + + v8::Local GetFunction() const; + + bool IsEmpty() const; + + void Reset(const v8::Local &fn); + + void Reset(); + + v8::Local Call(v8::Local target, + int argc, + v8::Local argv[]) const; + + v8::Local Call(int argc, v8::Local argv[]) const; +}; +``` + +Example usage: + +```c++ +v8::Local function; +Nan::Callback callback(function); +callback.Call(0, 0); +``` diff --git a/node_modules/nan/doc/converters.md b/node_modules/nan/doc/converters.md new file mode 100755 index 00000000..d20861b5 --- /dev/null +++ b/node_modules/nan/doc/converters.md @@ -0,0 +1,41 @@ +## Converters + +NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN. + + - Nan::To() + + +### Nan::To() + +Converts a `v8::Local` to a different subtype of `v8::Value` or to a native data type. Returns a `Nan::MaybeLocal<>` or a `Nan::Maybe<>` accordingly. + +See [maybe_types.md](./maybe_types.md) for more information on `Nan::Maybe` types. + +Signatures: + +```c++ +// V8 types +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); + +// Native types +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +``` + +### Example + +```c++ +v8::Local val; +Nan::MaybeLocal str = Nan::To(val); +Nan::Maybe d = Nan::To(val); +``` + diff --git a/node_modules/nan/doc/errors.md b/node_modules/nan/doc/errors.md new file mode 100755 index 00000000..aac6e087 --- /dev/null +++ b/node_modules/nan/doc/errors.md @@ -0,0 +1,226 @@ +## Errors + +NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted. + +Note that an Error object is simply a specialized form of `v8::Value`. + +Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information. + + - Nan::Error() + - Nan::RangeError() + - Nan::ReferenceError() + - Nan::SyntaxError() + - Nan::TypeError() + - Nan::ThrowError() + - Nan::ThrowRangeError() + - Nan::ThrowReferenceError() + - Nan::ThrowSyntaxError() + - Nan::ThrowTypeError() + - Nan::FatalException() + - Nan::ErrnoException() + - Nan::TryCatch + + + +### Nan::Error() + +Create a new Error object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an Error object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::Error(const char *msg); +v8::Local Nan::Error(v8::Local msg); +``` + + + +### Nan::RangeError() + +Create a new RangeError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an RangeError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::RangeError(const char *msg); +v8::Local Nan::RangeError(v8::Local msg); +``` + + + +### Nan::ReferenceError() + +Create a new ReferenceError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an ReferenceError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::ReferenceError(const char *msg); +v8::Local Nan::ReferenceError(v8::Local msg); +``` + + + +### Nan::SyntaxError() + +Create a new SyntaxError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an SyntaxError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::SyntaxError(const char *msg); +v8::Local Nan::SyntaxError(v8::Local msg); +``` + + + +### Nan::TypeError() + +Create a new TypeError object using the [v8::Exception](https://v8docs.nodesource.com/io.js-3.0/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an TypeError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::TypeError(const char *msg); +v8::Local Nan::TypeError(v8::Local msg); +``` + + + +### Nan::ThrowError() + +Throw an Error object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new Error object will be created. + +Signature: + +```c++ +void Nan::ThrowError(const char *msg); +void Nan::ThrowError(v8::Local msg); +void Nan::ThrowError(v8::Local error); +``` + + + +### Nan::ThrowRangeError() + +Throw an RangeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new RangeError object will be created. + +Signature: + +```c++ +void Nan::ThrowRangeError(const char *msg); +void Nan::ThrowRangeError(v8::Local msg); +void Nan::ThrowRangeError(v8::Local error); +``` + + + +### Nan::ThrowReferenceError() + +Throw an ReferenceError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new ReferenceError object will be created. + +Signature: + +```c++ +void Nan::ThrowReferenceError(const char *msg); +void Nan::ThrowReferenceError(v8::Local msg); +void Nan::ThrowReferenceError(v8::Local error); +``` + + + +### Nan::ThrowSyntaxError() + +Throw an SyntaxError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new SyntaxError object will be created. + +Signature: + +```c++ +void Nan::ThrowSyntaxError(const char *msg); +void Nan::ThrowSyntaxError(v8::Local msg); +void Nan::ThrowSyntaxError(v8::Local error); +``` + + + +### Nan::ThrowTypeError() + +Throw an TypeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new TypeError object will be created. + +Signature: + +```c++ +void Nan::ThrowTypeError(const char *msg); +void Nan::ThrowTypeError(v8::Local msg); +void Nan::ThrowTypeError(v8::Local error); +``` + + +### Nan::FatalException() + +Replaces `node::FatalException()` which has a different API across supported versions of Node. For use with [`Nan::TryCatch`](#api_nan_try_catch). + +Signature: + +```c++ +void Nan::FatalException(const Nan::TryCatch& try_catch); +``` + + +### Nan::ErrnoException() + +Replaces `node::ErrnoException()` which has a different API across supported versions of Node. + +Signature: + +```c++ +v8::Local Nan::ErrnoException(int errorno, + const char* syscall = NULL, + const char* message = NULL, + const char* path = NULL); +``` + + + +### Nan::TryCatch + +A simple wrapper around [`v8::TryCatch`](https://v8docs.nodesource.com/io.js-3.0/d4/dc6/classv8_1_1_try_catch.html) compatible with all supported versions of V8. Can be used as a direct replacement in most cases. See also [`Nan::FatalException()`](#api_nan_fatal_exception) for an internal use compatible with `node::FatalException`. + +Signature: + +```c++ +class Nan::TryCatch { + public: + Nan::TryCatch(); + + bool HasCaught() const; + + bool CanContinue() const; + + v8::Local ReThrow(); + + v8::Local Exception() const; + + // Nan::MaybeLocal for older versions of V8 + v8::MaybeLocal StackTrace() const; + + v8::Local Message() const; + + void Reset(); + + void SetVerbose(bool value); + + void SetCaptureMessage(bool value); +}; +``` + diff --git a/node_modules/nan/doc/json.md b/node_modules/nan/doc/json.md new file mode 100755 index 00000000..c916c4d1 --- /dev/null +++ b/node_modules/nan/doc/json.md @@ -0,0 +1,62 @@ +## JSON + +The _JSON_ object provides the c++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object. + + - Nan::JSON.Parse + - Nan::JSON.Stringify + +Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-7.4/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments. + + + +### Nan::JSON.Parse + +A simple wrapper around [`v8::JSON::Parse`](https://v8docs.nodesource.com/node-7.4/da/d6f/classv8_1_1_j_s_o_n.html#a936310d2540fb630ed37d3ee3ffe4504). + +Definition: + +```c++ +Nan::MaybeLocal Nan::JSON::Parse(v8::Local json_string); +``` + +Use `JSON.Parse(json_string)` to parse a string into a `v8::Value`. + +Example: + +```c++ +v8::Local json_string = Nan::New("{ \"JSON\": \"object\" }").ToLocalChecked(); + +Nan::JSON NanJSON; +Nan::MaybeLocal result = NanJSON.Parse(json_string); +if (!result.IsEmpty()) { + v8::Local val = result.ToLocalChecked(); +} +``` + + + +### Nan::JSON.Stringify + +A simple wrapper around [`v8::JSON::Stringify`](https://v8docs.nodesource.com/node-7.4/da/d6f/classv8_1_1_j_s_o_n.html#a44b255c3531489ce43f6110209138860). + +Definition: + +```c++ +Nan::MaybeLocal Nan::JSON::Stringify(v8::Local json_object, v8::Local gap = v8::Local()); +``` + +Use `JSON.Stringify(value)` to stringify a `v8::Object`. + +Example: + +```c++ +// using `v8::Local val` from the `JSON::Parse` example +v8::Local obj = Nan::To(val).ToLocalChecked(); + +Nan::JSON NanJSON; +Nan::MaybeLocal result = NanJSON.Stringify(obj); +if (!result.IsEmpty()) { + v8::Local stringified = result.ToLocalChecked(); +} +``` + diff --git a/node_modules/nan/doc/maybe_types.md b/node_modules/nan/doc/maybe_types.md new file mode 100755 index 00000000..818861d7 --- /dev/null +++ b/node_modules/nan/doc/maybe_types.md @@ -0,0 +1,560 @@ +## Maybe Types + +The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_. + +* **Maybe Types** + - Nan::MaybeLocal + - Nan::Maybe + - Nan::Nothing + - Nan::Just +* **Maybe Helpers** + - Nan::Call() + - Nan::ToDetailString() + - Nan::ToArrayIndex() + - Nan::Equals() + - Nan::NewInstance() + - Nan::GetFunction() + - Nan::Set() + - Nan::ForceSet() + - Nan::Get() + - Nan::GetPropertyAttributes() + - Nan::Has() + - Nan::Delete() + - Nan::GetPropertyNames() + - Nan::GetOwnPropertyNames() + - Nan::SetPrototype() + - Nan::ObjectProtoToString() + - Nan::HasOwnProperty() + - Nan::HasRealNamedProperty() + - Nan::HasRealIndexedProperty() + - Nan::HasRealNamedCallbackProperty() + - Nan::GetRealNamedPropertyInPrototypeChain() + - Nan::GetRealNamedProperty() + - Nan::CallAsFunction() + - Nan::CallAsConstructor() + - Nan::GetSourceLine() + - Nan::GetLineNumber() + - Nan::GetStartColumn() + - Nan::GetEndColumn() + - Nan::CloneElementAt() + - Nan::HasPrivate() + - Nan::GetPrivate() + - Nan::SetPrivate() + - Nan::DeletePrivate() + - Nan::MakeMaybe() + + +### Nan::MaybeLocal + +A `Nan::MaybeLocal` is a wrapper around [`v8::Local`](https://v8docs.nodesource.com/io.js-3.0/de/deb/classv8_1_1_local.html) that enforces a check that determines whether the `v8::Local` is empty before it can be used. + +If an API method returns a `Nan::MaybeLocal`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, an empty `Nan::MaybeLocal` is returned. + +Definition: + +```c++ +template class Nan::MaybeLocal { + public: + MaybeLocal(); + + template MaybeLocal(v8::Local that); + + bool IsEmpty() const; + + template bool ToLocal(v8::Local *out); + + // Will crash if the MaybeLocal<> is empty. + v8::Local ToLocalChecked(); + + template v8::Local FromMaybe(v8::Local default_value) const; +}; +``` + +See the documentation for [`v8::MaybeLocal`](https://v8docs.nodesource.com/io.js-3.0/d8/d7d/classv8_1_1_maybe_local.html) for further details. + + +### Nan::Maybe + +A simple `Nan::Maybe` type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html. + +If an API method returns a `Nan::Maybe<>`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, a "Nothing" value is returned. + +Definition: + +```c++ +template class Nan::Maybe { + public: + bool IsNothing() const; + bool IsJust() const; + + // Will crash if the Maybe<> is nothing. + T FromJust(); + + T FromMaybe(const T& default_value); + + bool operator==(const Maybe &other); + + bool operator!=(const Maybe &other); +}; +``` + +See the documentation for [`v8::Maybe`](https://v8docs.nodesource.com/io.js-3.0/d9/d4b/classv8_1_1_maybe.html) for further details. + + +### Nan::Nothing + +Construct an empty `Nan::Maybe` type representing _nothing_. + +```c++ +template Nan::Maybe Nan::Nothing(); +``` + + +### Nan::Just + +Construct a `Nan::Maybe` type representing _just_ a value. + +```c++ +template Nan::Maybe Nan::Just(const T &t); +``` + + +### Nan::Call() + +A helper method for calling [`v8::Function#Call()`](https://v8docs.nodesource.com/io.js-3.0/d5/d54/classv8_1_1_function.html#a468a89f737af0612db10132799c827c0) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::Call(v8::Local fun, v8::Local recv, int argc, v8::Local argv[]); +``` + + + +### Nan::ToDetailString() + +A helper method for calling [`v8::Value#ToDetailString()`](https://v8docs.nodesource.com/io.js-3.0/dc/d0a/classv8_1_1_value.html#a2f9770296dc2c8d274bc8cc0dca243e5) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::ToDetailString(v8::Local val); +``` + + + +### Nan::ToArrayIndex() + +A helper method for calling [`v8::Value#ToArrayIndex()`](https://v8docs.nodesource.com/io.js-3.0/dc/d0a/classv8_1_1_value.html#acc5bbef3c805ec458470c0fcd6f13493) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::ToArrayIndex(v8::Local val); +``` + + + +### Nan::Equals() + +A helper method for calling [`v8::Value#Equals()`](https://v8docs.nodesource.com/io.js-3.0/dc/d0a/classv8_1_1_value.html#a0d9616ab2de899d4e3047c30a10c9285) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Equals(v8::Local a, v8::Local(b)); +``` + + + +### Nan::NewInstance() + +A helper method for calling [`v8::Function#NewInstance()`](https://v8docs.nodesource.com/io.js-3.0/d5/d54/classv8_1_1_function.html#a691b13f7a553069732cbacf5ac8c62ec) and [`v8::ObjectTemplate#NewInstance()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#ad605a7543cfbc5dab54cdb0883d14ae4) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::NewInstance(v8::Local h); +Nan::MaybeLocal Nan::NewInstance(v8::Local h, int argc, v8::Local argv[]); +Nan::MaybeLocal Nan::NewInstance(v8::Local h); +``` + + + +### Nan::GetFunction() + +A helper method for calling [`v8::FunctionTemplate#GetFunction()`](https://v8docs.nodesource.com/io.js-3.0/d8/d83/classv8_1_1_function_template.html#a56d904662a86eca78da37d9bb0ed3705) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetFunction(v8::Local t); +``` + + + +### Nan::Set() + +A helper method for calling [`v8::Object#Set()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a67604ea3734f170c66026064ea808f20) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Set(v8::Local obj, + v8::Local key, + v8::Local value) +Nan::Maybe Nan::Set(v8::Local obj, + uint32_t index, + v8::Local value); +``` + + + +### Nan::ForceSet() + +A helper method for calling [`v8::Object#ForceSet()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a796b7b682896fb64bf1872747734e836) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::ForceSet(v8::Local obj, + v8::Local key, + v8::Local value, + v8::PropertyAttribute attribs = v8::None); +``` + + + +### Nan::Get() + +A helper method for calling [`v8::Object#Get()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a2565f03e736694f6b1e1cf22a0b4eac2) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::Get(v8::Local obj, + v8::Local key); +Nan::MaybeLocal Nan::Get(v8::Local obj, uint32_t index); +``` + + + +### Nan::GetPropertyAttributes() + +A helper method for calling [`v8::Object#GetPropertyAttributes()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a9b898894da3d1db2714fd9325a54fe57) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetPropertyAttributes( + v8::Local obj, + v8::Local key); +``` + + + +### Nan::Has() + +A helper method for calling [`v8::Object#Has()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab3c3d89ea7c2f9afd08965bd7299a41d) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Has(v8::Local obj, v8::Local key); +Nan::Maybe Nan::Has(v8::Local obj, uint32_t index); +``` + + + +### Nan::Delete() + +A helper method for calling [`v8::Object#Delete()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a2fa0f5a592582434ed1ceceff7d891ef) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Delete(v8::Local obj, + v8::Local key); +Nan::Maybe Nan::Delete(v8::Local obj, uint32_t index); +``` + + + +### Nan::GetPropertyNames() + +A helper method for calling [`v8::Object#GetPropertyNames()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#aced885270cfd2c956367b5eedc7fbfe8) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetPropertyNames(v8::Local obj); +``` + + + +### Nan::GetOwnPropertyNames() + +A helper method for calling [`v8::Object#GetOwnPropertyNames()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a79a6e4d66049b9aa648ed4dfdb23e6eb) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetOwnPropertyNames(v8::Local obj); +``` + + + +### Nan::SetPrototype() + +A helper method for calling [`v8::Object#SetPrototype()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a442706b22fceda6e6d1f632122a9a9f4) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::SetPrototype(v8::Local obj, + v8::Local prototype); +``` + + + +### Nan::ObjectProtoToString() + +A helper method for calling [`v8::Object#ObjectProtoToString()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab7a92b4dcf822bef72f6c0ac6fea1f0b) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::ObjectProtoToString(v8::Local obj); +``` + + + +### Nan::HasOwnProperty() + +A helper method for calling [`v8::Object#HasOwnProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab7b7245442ca6de1e1c145ea3fd653ff) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasOwnProperty(v8::Local obj, + v8::Local key); +``` + + + +### Nan::HasRealNamedProperty() + +A helper method for calling [`v8::Object#HasRealNamedProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ad8b80a59c9eb3c1e6c3cd6c84571f767) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasRealNamedProperty(v8::Local obj, + v8::Local key); +``` + + + +### Nan::HasRealIndexedProperty() + +A helper method for calling [`v8::Object#HasRealIndexedProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#af94fc1135a5e74a2193fb72c3a1b9855) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasRealIndexedProperty(v8::Local obj, + uint32_t index); +``` + + + +### Nan::HasRealNamedCallbackProperty() + +A helper method for calling [`v8::Object#HasRealNamedCallbackProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#af743b7ea132b89f84d34d164d0668811) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasRealNamedCallbackProperty( + v8::Local obj, + v8::Local key); +``` + + + +### Nan::GetRealNamedPropertyInPrototypeChain() + +A helper method for calling [`v8::Object#GetRealNamedPropertyInPrototypeChain()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a8700b1862e6b4783716964ba4d5e6172) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetRealNamedPropertyInPrototypeChain( + v8::Local obj, + v8::Local key); +``` + + + +### Nan::GetRealNamedProperty() + +A helper method for calling [`v8::Object#GetRealNamedProperty()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a84471a824576a5994fdd0ffcbf99ccc0) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetRealNamedProperty(v8::Local obj, + v8::Local key); +``` + + + +### Nan::CallAsFunction() + +A helper method for calling [`v8::Object#CallAsFunction()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a9ef18be634e79b4f0cdffa1667a29f58) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CallAsFunction(v8::Local obj, + v8::Local recv, + int argc, + v8::Local argv[]); +``` + + + +### Nan::CallAsConstructor() + +A helper method for calling [`v8::Object#CallAsConstructor()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a50d571de50d0b0dfb28795619d07a01b) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CallAsConstructor(v8::Local obj, + int argc, + v8::Local argv[]); +``` + + + +### Nan::GetSourceLine() + +A helper method for calling [`v8::Message#GetSourceLine()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#a849f7a6c41549d83d8159825efccd23a) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetSourceLine(v8::Local msg); +``` + + + +### Nan::GetLineNumber() + +A helper method for calling [`v8::Message#GetLineNumber()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#adbe46c10a88a6565f2732a2d2adf99b9) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetLineNumber(v8::Local msg); +``` + + + +### Nan::GetStartColumn() + +A helper method for calling [`v8::Message#GetStartColumn()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#a60ede616ba3822d712e44c7a74487ba6) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetStartColumn(v8::Local msg); +``` + + + +### Nan::GetEndColumn() + +A helper method for calling [`v8::Message#GetEndColumn()`](https://v8docs.nodesource.com/io.js-3.0/d9/d28/classv8_1_1_message.html#aaa004cf19e529da980bc19fcb76d93be) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetEndColumn(v8::Local msg); +``` + + + +### Nan::CloneElementAt() + +A helper method for calling [`v8::Array#CloneElementAt()`](https://v8docs.nodesource.com/io.js-3.0/d3/d32/classv8_1_1_array.html#a1d3a878d4c1c7cae974dd50a1639245e) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CloneElementAt(v8::Local array, uint32_t index); +``` + + +### Nan::HasPrivate() + +A helper method for calling [`v8::Object#HasPrivate()`](https://v8docs.nodesource.com/node-7.2/db/d85/classv8_1_1_object.html#af68a0b98066cfdeb8f943e98a40ba08d) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasPrivate(v8::Local object, v8::Local key); +``` + + +### Nan::GetPrivate() + +A helper method for calling [`v8::Object#GetPrivate()`](https://v8docs.nodesource.com/node-7.2/db/d85/classv8_1_1_object.html#a169f2da506acbec34deadd9149a1925a) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetPrivate(v8::Local object, v8::Local key); +``` + + +### Nan::SetPrivate() + +A helper method for calling [`v8::Object#SetPrivate()`](https://v8docs.nodesource.com/node-7.2/db/d85/classv8_1_1_object.html#ace1769b0f3b86bfe9fda1010916360ee) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::SetPrivate(v8::Local object, v8::Local key, v8::Local value); +``` + + +### Nan::DeletePrivate() + +A helper method for calling [`v8::Object#DeletePrivate()`](https://v8docs.nodesource.com/node-7.2/db/d85/classv8_1_1_object.html#a138bb32a304f3982be02ad499693b8fd) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::DeletePrivate(v8::Local object, v8::Local key); +``` + + +### Nan::MakeMaybe() + +Wraps a `v8::Local<>` in a `Nan::MaybeLocal<>`. When called with a `Nan::MaybeLocal<>` it just returns its argument. This is useful in generic template code that builds on NAN. + +Synopsis: + +```c++ + MaybeLocal someNumber = MakeMaybe(New(3.141592654)); + MaybeLocal someString = MakeMaybe(New("probably")); +``` + +Signature: + +```c++ +template class MaybeMaybe> +Nan::MaybeLocal Nan::MakeMaybe(MaybeMaybe v); +``` diff --git a/node_modules/nan/doc/methods.md b/node_modules/nan/doc/methods.md new file mode 100755 index 00000000..0411a705 --- /dev/null +++ b/node_modules/nan/doc/methods.md @@ -0,0 +1,659 @@ +## JavaScript-accessible methods + +A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://developers.google.com/v8/embed#templates) for further information. + +In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type. + +* **Method argument types** + - Nan::FunctionCallbackInfo + - Nan::PropertyCallbackInfo + - Nan::ReturnValue +* **Method declarations** + - Method declaration + - Getter declaration + - Setter declaration + - Property getter declaration + - Property setter declaration + - Property enumerator declaration + - Property deleter declaration + - Property query declaration + - Index getter declaration + - Index setter declaration + - Index enumerator declaration + - Index deleter declaration + - Index query declaration +* Method and template helpers + - Nan::SetMethod() + - Nan::SetPrototypeMethod() + - Nan::SetAccessor() + - Nan::SetNamedPropertyHandler() + - Nan::SetIndexedPropertyHandler() + - Nan::SetTemplate() + - Nan::SetPrototypeTemplate() + - Nan::SetInstanceTemplate() + - Nan::SetCallHandler() + - Nan::SetCallAsFunctionHandler() + + +### Nan::FunctionCallbackInfo + +`Nan::FunctionCallbackInfo` should be used in place of [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/dd/d0d/classv8_1_1_function_callback_info.html), even with older versions of Node where `v8::FunctionCallbackInfo` does not exist. + +Definition: + +```c++ +template class FunctionCallbackInfo { + public: + ReturnValue GetReturnValue() const; + v8::Local Callee(); + v8::Local Data(); + v8::Local Holder(); + bool IsConstructCall(); + int Length() const; + v8::Local operator[](int i) const; + v8::Local This() const; + v8::Isolate *GetIsolate() const; +}; +``` + +See the [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/dd/d0d/classv8_1_1_function_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from methods. + + +### Nan::PropertyCallbackInfo + +`Nan::PropertyCallbackInfo` should be used in place of [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/d7/dc5/classv8_1_1_property_callback_info.html), even with older versions of Node where `v8::PropertyCallbackInfo` does not exist. + +Definition: + +```c++ +template class PropertyCallbackInfo : public PropertyCallbackInfoBase { + public: + ReturnValue GetReturnValue() const; + v8::Isolate* GetIsolate() const; + v8::Local Data() const; + v8::Local This() const; + v8::Local Holder() const; +}; +``` + +See the [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/d7/dc5/classv8_1_1_property_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from property accessor methods. + + +### Nan::ReturnValue + +`Nan::ReturnValue` is used in place of [`v8::ReturnValue`](https://v8docs.nodesource.com/io.js-3.0/da/da7/classv8_1_1_return_value.html) on both [`Nan::FunctionCallbackInfo`](#api_nan_function_callback_info) and [`Nan::PropertyCallbackInfo`](#api_nan_property_callback_info) as the return type of `GetReturnValue()`. + +Example usage: + +```c++ +void EmptyArray(const Nan::FunctionCallbackInfo& info) { + info.GetReturnValue().Set(Nan::New()); +} +``` + +Definition: + +```c++ +template class ReturnValue { + public: + // Handle setters + template void Set(const v8::Local &handle); + template void Set(const Nan::Global &handle); + + // Fast primitive setters + void Set(bool value); + void Set(double i); + void Set(int32_t i); + void Set(uint32_t i); + + // Fast JS primitive setters + void SetNull(); + void SetUndefined(); + void SetEmptyString(); + + // Convenience getter for isolate + v8::Isolate *GetIsolate() const; +}; +``` + +See the documentation on [`v8::ReturnValue`](https://v8docs.nodesource.com/io.js-3.0/da/da7/classv8_1_1_return_value.html) for further information on this. + + +### Method declaration + +JavaScript-accessible methods should be declared with the following signature to form a `Nan::FunctionCallback`: + +```c++ +typedef void(*FunctionCallback)(const FunctionCallbackInfo&); +``` + +Example: + +```c++ +void MethodName(const Nan::FunctionCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a method as one is implicitly created for you. + +**Example usage** + +```c++ +// .h: +class Foo : public Nan::ObjectWrap { + ... + + static void Bar(const Nan::FunctionCallbackInfo& info); + static void Baz(const Nan::FunctionCallbackInfo& info); +} + + +// .cc: +void Foo::Bar(const Nan::FunctionCallbackInfo& info) { + ... +} + +void Foo::Baz(const Nan::FunctionCallbackInfo& info) { + ... +} +``` + +A helper macro `NAN_METHOD(methodname)` exists, compatible with NAN v1 method declarations. + +**Example usage with `NAN_METHOD(methodname)`** + +```c++ +// .h: +class Foo : public Nan::ObjectWrap { + ... + + static NAN_METHOD(Bar); + static NAN_METHOD(Baz); +} + + +// .cc: +NAN_METHOD(Foo::Bar) { + ... +} + +NAN_METHOD(Foo::Baz) { + ... +} +``` + +Use [`Nan::SetPrototypeMethod`](#api_nan_set_prototype_method) to attach a method to a JavaScript function prototype or [`Nan::SetMethod`](#api_nan_set_method) to attach a method directly on a JavaScript object. + + +### Getter declaration + +JavaScript-accessible getters should be declared with the following signature to form a `Nan::GetterCallback`: + +```c++ +typedef void(*GetterCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void GetterName(v8::Local property, + const Nan::PropertyCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a getter as one is implicitly created for you. + +A helper macro `NAN_GETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors). + + +### Setter declaration + +JavaScript-accessible setters should be declared with the following signature to form a Nan::SetterCallback: + +```c++ +typedef void(*SetterCallback)(v8::Local, + v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void SetterName(v8::Local property, + v8::Local value, + const Nan::PropertyCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a setter as one is implicitly created for you. + +A helper macro `NAN_SETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors). + + +### Property getter declaration + +JavaScript-accessible property getters should be declared with the following signature to form a Nan::PropertyGetterCallback: + +```c++ +typedef void(*PropertyGetterCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyGetterName(v8::Local property, + const Nan::PropertyCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a property getter as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_GETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property setter declaration + +JavaScript-accessible property setters should be declared with the following signature to form a Nan::PropertySetterCallback: + +```c++ +typedef void(*PropertySetterCallback)(v8::Local, + v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertySetterName(v8::Local property, + v8::Local value, + const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property setter as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_SETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property enumerator declaration + +JavaScript-accessible property enumerators should be declared with the following signature to form a Nan::PropertyEnumeratorCallback: + +```c++ +typedef void(*PropertyEnumeratorCallback)(const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyEnumeratorName(const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property enumerator as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property deleter declaration + +JavaScript-accessible property deleters should be declared with the following signature to form a Nan::PropertyDeleterCallback: + +```c++ +typedef void(*PropertyDeleterCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyDeleterName(v8::Local property, + const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property deleter as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_DELETER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property query declaration + +JavaScript-accessible property query methods should be declared with the following signature to form a Nan::PropertyQueryCallback: + +```c++ +typedef void(*PropertyQueryCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyQueryName(v8::Local property, + const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property query method as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_QUERY(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index getter declaration + +JavaScript-accessible index getter methods should be declared with the following signature to form a Nan::IndexGetterCallback: + +```c++ +typedef void(*IndexGetterCallback)(uint32_t, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexGetterName(uint32_t index, const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index getter as one is implicitly created for you. + +A helper macro `NAN_INDEX_GETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index setter declaration + +JavaScript-accessible index setter methods should be declared with the following signature to form a Nan::IndexSetterCallback: + +```c++ +typedef void(*IndexSetterCallback)(uint32_t, + v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexSetterName(uint32_t index, + v8::Local value, + const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index setter as one is implicitly created for you. + +A helper macro `NAN_INDEX_SETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index enumerator declaration + +JavaScript-accessible index enumerator methods should be declared with the following signature to form a Nan::IndexEnumeratorCallback: + +```c++ +typedef void(*IndexEnumeratorCallback)(const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexEnumeratorName(const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index enumerator as one is implicitly created for you. + +A helper macro `NAN_INDEX_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index deleter declaration + +JavaScript-accessible index deleter methods should be declared with the following signature to form a Nan::IndexDeleterCallback: + +```c++ +typedef void(*IndexDeleterCallback)(uint32_t, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexDeleterName(uint32_t index, const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index deleter as one is implicitly created for you. + +A helper macro `NAN_INDEX_DELETER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index query declaration + +JavaScript-accessible index query methods should be declared with the following signature to form a Nan::IndexQueryCallback: + +```c++ +typedef void(*IndexQueryCallback)(uint32_t, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexQueryName(uint32_t index, const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index query method as one is implicitly created for you. + +A helper macro `NAN_INDEX_QUERY(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Nan::SetMethod() + +Sets a method with a given name directly on a JavaScript object where the method has the `Nan::FunctionCallback` signature (see Method declaration). + +Signature: + +```c++ +void Nan::SetMethod(v8::Local recv, + const char *name, + Nan::FunctionCallback callback) +void Nan::SetMethod(v8::Local templ, + const char *name, + Nan::FunctionCallback callback) +``` + + +### Nan::SetPrototypeMethod() + +Sets a method with a given name on a `FunctionTemplate`'s prototype where the method has the `Nan::FunctionCallback` signature (see Method declaration). + +Signature: + +```c++ +void Nan::SetPrototypeMethod(v8::Local recv, + const char* name, + Nan::FunctionCallback callback) +``` + + +### Nan::SetAccessor() + +Sets getters and setters for a property with a given name on an `ObjectTemplate` or a plain `Object`. Accepts getters with the `Nan::GetterCallback` signature (see Getter declaration) and setters with the `Nan::SetterCallback` signature (see Setter declaration). + +Signature: + +```c++ +void SetAccessor(v8::Local tpl, + v8::Local name, + Nan::GetterCallback getter, + Nan::SetterCallback setter = 0, + v8::Local data = v8::Local(), + v8::AccessControl settings = v8::DEFAULT, + v8::PropertyAttribute attribute = v8::None, + imp::Sig signature = imp::Sig()); +bool SetAccessor(v8::Local obj, + v8::Local name, + Nan::GetterCallback getter, + Nan::SetterCallback setter = 0, + v8::Local data = v8::Local(), + v8::AccessControl settings = v8::DEFAULT, + v8::PropertyAttribute attribute = v8::None) +``` + +See the V8 [`ObjectTemplate#SetAccessor()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#aa90691622f01269c6a11391d372ca0c5) and [`Object#SetAccessor()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#a3f9dee085f5ec346465f1dc924325043) for further information about how to use `Nan::SetAccessor()`. + + +### Nan::SetNamedPropertyHandler() + +Sets named property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts: + +* Property getters with the `Nan::PropertyGetterCallback` signature (see Property getter declaration) +* Property setters with the `Nan::PropertySetterCallback` signature (see Property setter declaration) +* Property query methods with the `Nan::PropertyQueryCallback` signature (see Property query declaration) +* Property deleters with the `Nan::PropertyDeleterCallback` signature (see Property deleter declaration) +* Property enumerators with the `Nan::PropertyEnumeratorCallback` signature (see Property enumerator declaration) + +Signature: + +```c++ +void SetNamedPropertyHandler(v8::Local tpl, + Nan::PropertyGetterCallback getter, + Nan::PropertySetterCallback setter = 0, + Nan::PropertyQueryCallback query = 0, + Nan::PropertyDeleterCallback deleter = 0, + Nan::PropertyEnumeratorCallback enumerator = 0, + v8::Local data = v8::Local()) +``` + +See the V8 [`ObjectTemplate#SetNamedPropertyHandler()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#a34d1cc45b642cd131706663801aadd76) for further information about how to use `Nan::SetNamedPropertyHandler()`. + + +### Nan::SetIndexedPropertyHandler() + +Sets indexed property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts: + +* Indexed property getters with the `Nan::IndexGetterCallback` signature (see Index getter declaration) +* Indexed property setters with the `Nan::IndexSetterCallback` signature (see Index setter declaration) +* Indexed property query methods with the `Nan::IndexQueryCallback` signature (see Index query declaration) +* Indexed property deleters with the `Nan::IndexDeleterCallback` signature (see Index deleter declaration) +* Indexed property enumerators with the `Nan::IndexEnumeratorCallback` signature (see Index enumerator declaration) + +Signature: + +```c++ +void SetIndexedPropertyHandler(v8::Local tpl, + Nan::IndexGetterCallback getter, + Nan::IndexSetterCallback setter = 0, + Nan::IndexQueryCallback query = 0, + Nan::IndexDeleterCallback deleter = 0, + Nan::IndexEnumeratorCallback enumerator = 0, + v8::Local data = v8::Local()) +``` + +See the V8 [`ObjectTemplate#SetIndexedPropertyHandler()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#ac0234cbede45d51778bb5f6a32a9e125) for further information about how to use `Nan::SetIndexedPropertyHandler()`. + + +### Nan::SetTemplate() + +Adds properties on an `Object`'s or `Function`'s template. + +Signature: + +```c++ +void Nan::SetTemplate(v8::Local templ, + const char *name, + v8::Local value); +void Nan::SetTemplate(v8::Local templ, + v8::Local name, + v8::Local value, + v8::PropertyAttribute attributes) +``` + +Calls the `Template`'s [`Set()`](https://v8docs.nodesource.com/io.js-3.0/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf). + + +### Nan::SetPrototypeTemplate() + +Adds properties on an `Object`'s or `Function`'s prototype template. + +Signature: + +```c++ +void Nan::SetPrototypeTemplate(v8::Local templ, + const char *name, + v8::Local value); +void Nan::SetPrototypeTemplate(v8::Local templ, + v8::Local name, + v8::Local value, + v8::PropertyAttribute attributes) +``` + +Calls the `FunctionTemplate`'s _PrototypeTemplate's_ [`Set()`](https://v8docs.nodesource.com/io.js-3.0/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf). + + +### Nan::SetInstanceTemplate() + +Use to add instance properties on `FunctionTemplate`'s. + +Signature: + +```c++ +void Nan::SetInstanceTemplate(v8::Local templ, + const char *name, + v8::Local value); +void Nan::SetInstanceTemplate(v8::Local templ, + v8::Local name, + v8::Local value, + v8::PropertyAttribute attributes) +``` + +Calls the `FunctionTemplate`'s _InstanceTemplate's_ [`Set()`](https://v8docs.nodesource.com/io.js-3.0/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf). + + +### Nan::SetCallHandler() + +Set the call-handler callback for a `v8::FunctionTemplate`. +This callback is called whenever the function created from this FunctionTemplate is called. + +Signature: + +```c++ +void Nan::SetCallHandler(v8::Local templ, Nan::FunctionCallback callback, v8::Local data = v8::Local()) +``` + +Calls the `FunctionTemplate`'s [`SetCallHandler()`](https://v8docs.nodesource.com/io.js-3.0/d8/d83/classv8_1_1_function_template.html#a26cf14e36aa1a47091b98536d08ea821). + + +### Nan::SetCallAsFunctionHandler() + +Sets the callback to be used when calling instances created from the `v8::ObjectTemplate` as a function. +If no callback is set, instances behave like normal JavaScript objects that cannot be called as a function. + +Signature: + +```c++ +void Nan::SetCallAsFunctionHandler(v8::Local templ, Nan::FunctionCallback callback, v8::Local data = v8::Local()) +``` + +Calls the `ObjectTemplate`'s [`SetCallAsFunctionHandler()`](https://v8docs.nodesource.com/io.js-3.0/db/d5f/classv8_1_1_object_template.html#ae0a0e72fb0c5e5f32e255fe5bcc7316a). + diff --git a/node_modules/nan/doc/new.md b/node_modules/nan/doc/new.md new file mode 100755 index 00000000..c0734bd7 --- /dev/null +++ b/node_modules/nan/doc/new.md @@ -0,0 +1,147 @@ +## New + +NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8. + + - Nan::New() + - Nan::Undefined() + - Nan::Null() + - Nan::True() + - Nan::False() + - Nan::EmptyString() + + + +### Nan::New() + +`Nan::New()` should be used to instantiate new JavaScript objects. + +Refer to the specific V8 type in the [V8 documentation](https://v8docs.nodesource.com/io.js-3.0/d1/d83/classv8_1_1_data.html) for information on the types of arguments required for instantiation. + +Signatures: + +Return types are mostly omitted from the signatures for simplicity. In most cases the type will be contained within a `v8::Local`. The following types will be contained within a `Nan::MaybeLocal`: `v8::String`, `v8::Date`, `v8::RegExp`, `v8::Script`, `v8::UnboundScript`. + +Empty objects: + +```c++ +Nan::New(); +``` + +Generic single and multiple-argument: + +```c++ +Nan::New(A0 arg0); +Nan::New(A0 arg0, A1 arg1); +Nan::New(A0 arg0, A1 arg1, A2 arg2); +Nan::New(A0 arg0, A1 arg1, A2 arg2, A3 arg3); +``` + +For creating `v8::FunctionTemplate` and `v8::Function` objects: + +_The definition of `Nan::FunctionCallback` can be found in the [Method declaration](./methods.md#api_nan_method) documentation._ + +```c++ +Nan::New(Nan::FunctionCallback callback, + v8::Local data = v8::Local()); +Nan::New(Nan::FunctionCallback callback, + v8::Local data = v8::Local(), + A2 a2 = A2()); +``` + +Native number types: + +```c++ +v8::Local Nan::New(bool value); +v8::Local Nan::New(int32_t value); +v8::Local Nan::New(uint32_t value); +v8::Local Nan::New(double value); +``` + +String types: + +```c++ +Nan::MaybeLocal Nan::New(std::string const& value); +Nan::MaybeLocal Nan::New(const char * value, int length); +Nan::MaybeLocal Nan::New(const char * value); +Nan::MaybeLocal Nan::New(const uint16_t * value); +Nan::MaybeLocal Nan::New(const uint16_t * value, int length); +``` + +Specialized types: + +```c++ +v8::Local Nan::New(v8::String::ExternalStringResource * value); +v8::Local Nan::New(Nan::ExternalOneByteStringResource * value); +v8::Local Nan::New(v8::Local pattern, v8::RegExp::Flags flags); +``` + +Note that `Nan::ExternalOneByteStringResource` maps to [`v8::String::ExternalOneByteStringResource`](https://v8docs.nodesource.com/io.js-3.0/d9/db3/classv8_1_1_string_1_1_external_one_byte_string_resource.html), and `v8::String::ExternalAsciiStringResource` in older versions of V8. + + + +### Nan::Undefined() + +A helper method to reference the `v8::Undefined` object in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::Undefined() +``` + + +### Nan::Null() + +A helper method to reference the `v8::Null` object in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::Null() +``` + + +### Nan::True() + +A helper method to reference the `v8::Boolean` object representing the `true` value in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::True() +``` + + +### Nan::False() + +A helper method to reference the `v8::Boolean` object representing the `false` value in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::False() +``` + + +### Nan::EmptyString() + +Call [`v8::String::Empty`](https://v8docs.nodesource.com/io.js-3.0/d2/db3/classv8_1_1_string.html#a7c1bc8886115d7ee46f1d571dd6ebc6d) to reference the empty string in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::EmptyString() +``` + + + +### Nan::NewOneByteString() + +An implementation of [`v8::String::NewFromOneByte()`](https://v8docs.nodesource.com/io.js-3.0/d2/db3/classv8_1_1_string.html#a5264d50b96d2c896ce525a734dc10f09) provided for consistent availability and API across supported versions of V8. Allocates a new string from Latin-1 data. + +Signature: + +```c++ +Nan::MaybeLocal Nan::NewOneByteString(const uint8_t * value, + int length = -1) +``` diff --git a/node_modules/nan/doc/node_misc.md b/node_modules/nan/doc/node_misc.md new file mode 100755 index 00000000..8aa080f5 --- /dev/null +++ b/node_modules/nan/doc/node_misc.md @@ -0,0 +1,63 @@ +## Miscellaneous Node Helpers + + - Nan::MakeCallback() + - NAN_MODULE_INIT() + - Nan::Export() + + + +### Nan::MakeCallback() + +Wrappers around `node::MakeCallback()` providing a consistent API across all supported versions of Node. + +Use `MakeCallback()` rather than using `v8::Function#Call()` directly in order to properly process internal Node functionality including domains, async hooks, the microtask queue, and other debugging functionality. + +Signatures: + +```c++ +v8::Local Nan::MakeCallback(v8::Local target, + v8::Local func, + int argc, + v8::Local* argv); +v8::Local Nan::MakeCallback(v8::Local target, + v8::Local symbol, + int argc, + v8::Local* argv); +v8::Local Nan::MakeCallback(v8::Local target, + const char* method, + int argc, + v8::Local* argv); +``` + + + +### NAN_MODULE_INIT() + +Used to define the entry point function to a Node add-on. Creates a function with a given `name` that receives a `target` object representing the equivalent of the JavaScript `exports` object. + +See example below. + + +### Nan::Export() + +A simple helper to register a `v8::FunctionTemplate` from a JavaScript-accessible method (see [Methods](./methods.md)) as a property on an object. Can be used in a way similar to assigning properties to `module.exports` in JavaScript. + +Signature: + +```c++ +void Export(v8::Local target, const char *name, Nan::FunctionCallback f) +``` + +Also available as the shortcut `NAN_EXPORT` macro. + +Example: + +```c++ +NAN_METHOD(Foo) { + ... +} + +NAN_MODULE_INIT(Init) { + NAN_EXPORT(target, Foo); +} +``` diff --git a/node_modules/nan/doc/object_wrappers.md b/node_modules/nan/doc/object_wrappers.md new file mode 100755 index 00000000..e89832b6 --- /dev/null +++ b/node_modules/nan/doc/object_wrappers.md @@ -0,0 +1,263 @@ +## Object Wrappers + +The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects. + + - Nan::ObjectWrap + + + +### Nan::ObjectWrap() + +A reimplementation of `node::ObjectWrap` that adds some API not present in older versions of Node. Should be preferred over `node::ObjectWrap` in all cases for consistency. + +Definition: + +```c++ +class ObjectWrap { + public: + ObjectWrap(); + + virtual ~ObjectWrap(); + + template + static inline T* Unwrap(v8::Local handle); + + inline v8::Local handle(); + + inline Nan::Persistent& persistent(); + + protected: + inline void Wrap(v8::Local handle); + + inline void MakeWeak(); + + /* Ref() marks the object as being attached to an event loop. + * Refed objects will not be garbage collected, even if + * all references are lost. + */ + virtual void Ref(); + + /* Unref() marks an object as detached from the event loop. This is its + * default state. When an object with a "weak" reference changes from + * attached to detached state it will be freed. Be careful not to access + * the object after making this call as it might be gone! + * (A "weak reference" means an object that only has a + * persistant handle.) + * + * DO NOT CALL THIS FROM DESTRUCTOR + */ + virtual void Unref(); + + int refs_; // ro +}; +``` + +See the Node documentation on [Wrapping C++ Objects](https://nodejs.org/api/addons.html#addons_wrapping_c_objects) for more details. + +### This vs. Holder + +When calling `Unwrap`, it is important that the argument is indeed some JavaScript object which got wrapped by a `Wrap` call for this class or any derived class. +The `Signature` installed by [`Nan::SetPrototypeMethod()`](methods.md#api_nan_set_prototype_method) does ensure that `info.Holder()` is just such an instance. +In Node 0.12 and later, `info.This()` will also be of such a type, since otherwise the invocation will get rejected. +However, in Node 0.10 and before it was possible to invoke a method on a JavaScript object which just had the extension type in its prototype chain. +In such a situation, calling `Unwrap` on `info.This()` will likely lead to a failed assertion causing a crash, but could lead to even more serious corruption. + +On the other hand, calling `Unwrap` in an [accessor](methods.md#api_nan_set_accessor) should not use `Holder()` if the accessor is defined on the prototype. +So either define your accessors on the instance template, +or use `This()` after verifying that it is indeed a valid object. + +### Examples + +#### Basic + +```c++ +class MyObject : public Nan::ObjectWrap { + public: + static NAN_MODULE_INIT(Init) { + v8::Local tpl = Nan::New(New); + tpl->SetClassName(Nan::New("MyObject").ToLocalChecked()); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + Nan::SetPrototypeMethod(tpl, "getHandle", GetHandle); + Nan::SetPrototypeMethod(tpl, "getValue", GetValue); + + constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); + Nan::Set(target, Nan::New("MyObject").ToLocalChecked(), + Nan::GetFunction(tpl).ToLocalChecked()); + } + + private: + explicit MyObject(double value = 0) : value_(value) {} + ~MyObject() {} + + static NAN_METHOD(New) { + if (info.IsConstructCall()) { + double value = info[0]->IsUndefined() ? 0 : Nan::To(info[0]).FromJust(); + MyObject *obj = new MyObject(value); + obj->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); + } else { + const int argc = 1; + v8::Local argv[argc] = {info[0]}; + v8::Local cons = Nan::New(constructor()); + info.GetReturnValue().Set(cons->NewInstance(argc, argv)); + } + } + + static NAN_METHOD(GetHandle) { + MyObject* obj = Nan::ObjectWrap::Unwrap(info.Holder()); + info.GetReturnValue().Set(obj->handle()); + } + + static NAN_METHOD(GetValue) { + MyObject* obj = Nan::ObjectWrap::Unwrap(info.Holder()); + info.GetReturnValue().Set(obj->value_); + } + + static inline Nan::Persistent & constructor() { + static Nan::Persistent my_constructor; + return my_constructor; + } + + double value_; +}; + +NODE_MODULE(objectwrapper, MyObject::Init) +``` + +To use in Javascript: + +```Javascript +var objectwrapper = require('bindings')('objectwrapper'); + +var obj = new objectwrapper.MyObject(5); +console.log('Should be 5: ' + obj.getValue()); +``` + +#### Factory of wrapped objects + +```c++ +class MyFactoryObject : public Nan::ObjectWrap { + public: + static NAN_MODULE_INIT(Init) { + v8::Local tpl = Nan::New(New); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + Nan::SetPrototypeMethod(tpl, "getValue", GetValue); + + constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); + } + + static NAN_METHOD(NewInstance) { + v8::Local cons = Nan::New(constructor()); + double value = info[0]->IsNumber() ? Nan::To(info[0]).FromJust() : 0; + const int argc = 1; + v8::Local argv[1] = {Nan::New(value)}; + info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); + } + + // Needed for the next example: + inline double value() const { + return value_; + } + + private: + explicit MyFactoryObject(double value = 0) : value_(value) {} + ~MyFactoryObject() {} + + static NAN_METHOD(New) { + if (info.IsConstructCall()) { + double value = info[0]->IsNumber() ? Nan::To(info[0]).FromJust() : 0; + MyFactoryObject * obj = new MyFactoryObject(value); + obj->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); + } else { + const int argc = 1; + v8::Local argv[argc] = {info[0]}; + v8::Local cons = Nan::New(constructor()); + info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); + } + } + + static NAN_METHOD(GetValue) { + MyFactoryObject* obj = ObjectWrap::Unwrap(info.Holder()); + info.GetReturnValue().Set(obj->value_); + } + + static inline Nan::Persistent & constructor() { + static Nan::Persistent my_constructor; + return my_constructor; + } + + double value_; +}; + +NAN_MODULE_INIT(Init) { + MyFactoryObject::Init(target); + Nan::Set(target, + Nan::New("newFactoryObjectInstance").ToLocalChecked(), + Nan::GetFunction( + Nan::New(MyFactoryObject::NewInstance)).ToLocalChecked() + ); +} + +NODE_MODULE(wrappedobjectfactory, Init) +``` + +To use in Javascript: + +```Javascript +var wrappedobjectfactory = require('bindings')('wrappedobjectfactory'); + +var obj = wrappedobjectfactory.newFactoryObjectInstance(10); +console.log('Should be 10: ' + obj.getValue()); +``` + +#### Passing wrapped objects around + +Use the `MyFactoryObject` class above along with the following: + +```c++ +static NAN_METHOD(Sum) { + Nan::MaybeLocal maybe1 = Nan::To(info[0]); + Nan::MaybeLocal maybe2 = Nan::To(info[1]); + + // Quick check: + if (maybe1.IsEmpty() || maybe2.IsEmpty()) { + // return value is undefined by default + return; + } + + MyFactoryObject* obj1 = + Nan::ObjectWrap::Unwrap(maybe1.ToLocalChecked()); + MyFactoryObject* obj2 = + Nan::ObjectWrap::Unwrap(maybe2.ToLocalChecked()); + + info.GetReturnValue().Set(Nan::New(obj1->value() + obj2->value())); +} + +NAN_MODULE_INIT(Init) { + MyFactoryObject::Init(target); + Nan::Set(target, + Nan::New("newFactoryObjectInstance").ToLocalChecked(), + Nan::GetFunction( + Nan::New(MyFactoryObject::NewInstance)).ToLocalChecked() + ); + Nan::Set(target, + Nan::New("sum").ToLocalChecked(), + Nan::GetFunction(Nan::New(Sum)).ToLocalChecked() + ); +} + +NODE_MODULE(myaddon, Init) +``` + +To use in Javascript: + +```Javascript +var myaddon = require('bindings')('myaddon'); + +var obj1 = myaddon.newFactoryObjectInstance(5); +var obj2 = myaddon.newFactoryObjectInstance(10); +console.log('sum of object values: ' + myaddon.sum(obj1, obj2)); +``` diff --git a/node_modules/nan/doc/persistent.md b/node_modules/nan/doc/persistent.md new file mode 100755 index 00000000..743b44a4 --- /dev/null +++ b/node_modules/nan/doc/persistent.md @@ -0,0 +1,295 @@ +## Persistent references + +An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed. + +Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported. + + - Nan::PersistentBase & v8::PersistentBase + - Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits + - Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits + - Nan::Persistent + - Nan::Global + - Nan::WeakCallbackInfo + - Nan::WeakCallbackType + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles). + + +### Nan::PersistentBase & v8::PersistentBase + +A persistent handle contains a reference to a storage cell in V8 which holds an object value and which is updated by the garbage collector whenever the object is moved. A new storage cell can be created using the constructor or `Nan::PersistentBase::Reset()`. Existing handles can be disposed using an argument-less `Nan::PersistentBase::Reset()`. + +Definition: + +_(note: this is implemented as `Nan::PersistentBase` for older versions of V8 and the native `v8::PersistentBase` is used for newer versions of V8)_ + +```c++ +template class PersistentBase { + public: + /** + * If non-empty, destroy the underlying storage cell + */ + void Reset(); + + /** + * If non-empty, destroy the underlying storage cell and create a new one with + * the contents of another if it is also non-empty + */ + template void Reset(const v8::Local &other); + + /** + * If non-empty, destroy the underlying storage cell and create a new one with + * the contents of another if it is also non-empty + */ + template void Reset(const PersistentBase &other); + + /** + * If non-empty, destroy the underlying storage cell + * IsEmpty() will return true after this call. + */ + bool IsEmpty(); + + void Empty(); + + template bool operator==(const PersistentBase &that); + + template bool operator==(const v8::Local &that); + + template bool operator!=(const PersistentBase &that); + + template bool operator!=(const v8::Local &that); + + /** + * Install a finalization callback on this object. + * NOTE: There is no guarantee as to *when* or even *if* the callback is + * invoked. The invocation is performed solely on a best effort basis. + * As always, GC-based finalization should *not* be relied upon for any + * critical form of resource management! At the moment you can either + * specify a parameter for the callback or the location of two internal + * fields in the dying object. + */ + template + void SetWeak(P *parameter, + typename WeakCallbackInfo

      ::Callback callback, + WeakCallbackType type); + + void ClearWeak(); + + /** + * Marks the reference to this object independent. Garbage collector is free + * to ignore any object groups containing this object. Weak callback for an + * independent handle should not assume that it will be preceded by a global + * GC prologue callback or followed by a global GC epilogue callback. + */ + void MarkIndependent() const; + + bool IsIndependent() const; + + /** Checks if the handle holds the only reference to an object. */ + bool IsNearDeath() const; + + /** Returns true if the handle's reference is weak. */ + bool IsWeak() const +}; +``` + +See the V8 documentation for [`PersistentBase`](https://v8docs.nodesource.com/io.js-3.0/d4/dca/classv8_1_1_persistent_base.html) for further information. + +**Tip:** To get a `v8::Local` reference to the original object back from a `PersistentBase` or `Persistent` object: + +```c++ +v8::Local object = Nan::New(persistent); +``` + + +### Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits + +Default traits for `Nan::Persistent`. This class does not allow use of the a copy constructor or assignment operator. At present `kResetInDestructor` is not set, but that will change in a future version. + +Definition: + +_(note: this is implemented as `Nan::NonCopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_ + +```c++ +template class NonCopyablePersistentTraits { + public: + typedef Persistent > NonCopyablePersistent; + + static const bool kResetInDestructor = false; + + template + static void Copy(const Persistent &source, + NonCopyablePersistent *dest); + + template static void Uncompilable(); +}; +``` + +See the V8 documentation for [`NonCopyablePersistentTraits`](https://v8docs.nodesource.com/io.js-3.0/de/d73/classv8_1_1_non_copyable_persistent_traits.html) for further information. + + +### Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits + +A helper class of traits to allow copying and assignment of `Persistent`. This will clone the contents of storage cell, but not any of the flags, etc.. + +Definition: + +_(note: this is implemented as `Nan::CopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_ + +```c++ +template +class CopyablePersistentTraits { + public: + typedef Persistent > CopyablePersistent; + + static const bool kResetInDestructor = true; + + template + static void Copy(const Persistent &source, + CopyablePersistent *dest); +}; +``` + +See the V8 documentation for [`CopyablePersistentTraits`](https://v8docs.nodesource.com/io.js-3.0/da/d5c/structv8_1_1_copyable_persistent_traits.html) for further information. + + +### Nan::Persistent + +A type of `PersistentBase` which allows copy and assignment. Copy, assignment and destructor behavior is controlled by the traits class `M`. + +Definition: + +```c++ +template > +class Persistent; + +template class Persistent : public PersistentBase { + public: + /** + * A Persistent with no storage cell. + */ + Persistent(); + + /** + * Construct a Persistent from a v8::Local. When the v8::Local is non-empty, a + * new storage cell is created pointing to the same object, and no flags are + * set. + */ + template Persistent(v8::Local that); + + /** + * Construct a Persistent from a Persistent. When the Persistent is non-empty, + * a new storage cell is created pointing to the same object, and no flags are + * set. + */ + Persistent(const Persistent &that); + + /** + * The copy constructors and assignment operator create a Persistent exactly + * as the Persistent constructor, but the Copy function from the traits class + * is called, allowing the setting of flags based on the copied Persistent. + */ + Persistent &operator=(const Persistent &that); + + template + Persistent &operator=(const Persistent &that); + + /** + * The destructor will dispose the Persistent based on the kResetInDestructor + * flags in the traits class. Since not calling dispose can result in a + * memory leak, it is recommended to always set this flag. + */ + ~Persistent(); +}; +``` + +See the V8 documentation for [`Persistent`](https://v8docs.nodesource.com/io.js-3.0/d2/d78/classv8_1_1_persistent.html) for further information. + + +### Nan::Global + +A type of `PersistentBase` which has move semantics. + +```c++ +template class Global : public PersistentBase { + public: + /** + * A Global with no storage cell. + */ + Global(); + + /** + * Construct a Global from a v8::Local. When the v8::Local is non-empty, a new + * storage cell is created pointing to the same object, and no flags are set. + */ + template Global(v8::Local that); + /** + * Construct a Global from a PersistentBase. When the Persistent is non-empty, + * a new storage cell is created pointing to the same object, and no flags are + * set. + */ + template Global(const PersistentBase &that); + + /** + * Pass allows returning globals from functions, etc. + */ + Global Pass(); +}; +``` + +See the V8 documentation for [`Global`](https://v8docs.nodesource.com/io.js-3.0/d5/d40/classv8_1_1_global.html) for further information. + + +### Nan::WeakCallbackInfo + +`Nan::WeakCallbackInfo` is used as an argument when setting a persistent reference as weak. You may need to free any external resources attached to the object. It is a mirror of `v8:WeakCallbackInfo` as found in newer versions of V8. + +Definition: + +```c++ +template class WeakCallbackInfo { + public: + typedef void (*Callback)(const WeakCallbackInfo& data); + + v8::Isolate *GetIsolate() const; + + /** + * Get the parameter that was associated with the weak handle. + */ + T *GetParameter() const; + + /** + * Get pointer from internal field, index can be 0 or 1. + */ + void *GetInternalField(int index) const; +}; +``` + +Example usage: + +```c++ +void weakCallback(const WeakCallbackInfo &data) { + int *parameter = data.GetParameter(); + delete parameter; +} + +Persistent obj; +int *data = new int(0); +obj.SetWeak(data, callback, WeakCallbackType::kParameter); +``` + +See the V8 documentation for [`WeakCallbackInfo`](https://v8docs.nodesource.com/io.js-3.0/d8/d06/classv8_1_1_weak_callback_info.html) for further information. + + +### Nan::WeakCallbackType + +Represents the type of a weak callback. +A weak callback of type `kParameter` makes the supplied parameter to `Nan::PersistentBase::SetWeak` available through `WeakCallbackInfo::GetParameter`. +A weak callback of type `kInternalFields` uses up to two internal fields at indices 0 and 1 on the `Nan::PersistentBase` being made weak. +Note that only `v8::Object`s and derivatives can have internal fields. + +Definition: + +```c++ +enum class WeakCallbackType { kParameter, kInternalFields }; +``` diff --git a/node_modules/nan/doc/scopes.md b/node_modules/nan/doc/scopes.md new file mode 100755 index 00000000..060c8e4d --- /dev/null +++ b/node_modules/nan/doc/scopes.md @@ -0,0 +1,73 @@ +## Scopes + +A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works. + +A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope. + +The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these. + + - Nan::HandleScope + - Nan::EscapableHandleScope + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection). + + +### Nan::HandleScope + +A simple wrapper around [`v8::HandleScope`](https://v8docs.nodesource.com/io.js-3.0/d3/d95/classv8_1_1_handle_scope.html). + +Definition: + +```c++ +class Nan::HandleScope { + public: + Nan::HandleScope(); + static int NumberOfHandles(); +}; +``` + +Allocate a new `Nan::HandleScope` whenever you are creating new V8 JavaScript objects. Note that an implicit `HandleScope` is created for you on JavaScript-accessible methods so you do not need to insert one yourself. + +Example: + +```c++ +// new object is created, it needs a new scope: +void Pointless() { + Nan::HandleScope scope; + v8::Local obj = Nan::New(); +} + +// JavaScript-accessible method already has a HandleScope +NAN_METHOD(Pointless2) { + v8::Local obj = Nan::New(); +} +``` + + +### Nan::EscapableHandleScope + +Similar to [`Nan::HandleScope`](#api_nan_handle_scope) but should be used in cases where a function needs to return a V8 JavaScript type that has been created within it. + +Definition: + +```c++ +class Nan::EscapableHandleScope { + public: + Nan::EscapableHandleScope(); + static int NumberOfHandles(); + template v8::Local Escape(v8::Local value); +} +``` + +Use `Escape(value)` to return the object. + +Example: + +```c++ +v8::Local EmptyObj() { + Nan::EscapableHandleScope scope; + v8::Local obj = Nan::New(); + return scope.Escape(obj); +} +``` + diff --git a/node_modules/nan/doc/script.md b/node_modules/nan/doc/script.md new file mode 100755 index 00000000..1267b5e7 --- /dev/null +++ b/node_modules/nan/doc/script.md @@ -0,0 +1,38 @@ +## Script + +NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8. + + - Nan::CompileScript() + - Nan::RunScript() + + + +### Nan::CompileScript() + +A wrapper around [`v8::Script::Compile()`](https://v8docs.nodesource.com/io.js-3.0/da/da5/classv8_1_1_script_compiler.html#a93f5072a0db55d881b969e9fc98e564b). + +Note that `Nan::BoundScript` is an alias for `v8::Script`. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CompileScript( + v8::Local s, + const v8::ScriptOrigin& origin); +Nan::MaybeLocal Nan::CompileScript(v8::Local s); +``` + + + +### Nan::RunScript() + +Calls `script->Run()` or `script->BindToCurrentContext()->Run(Nan::GetCurrentContext())`. + +Note that `Nan::BoundScript` is an alias for `v8::Script` and `Nan::UnboundScript` is an alias for `v8::UnboundScript` where available and `v8::Script` on older versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::RunScript(v8::Local script) +Nan::MaybeLocal Nan::RunScript(v8::Local script) +``` diff --git a/node_modules/nan/doc/string_bytes.md b/node_modules/nan/doc/string_bytes.md new file mode 100755 index 00000000..7c1bd325 --- /dev/null +++ b/node_modules/nan/doc/string_bytes.md @@ -0,0 +1,62 @@ +## Strings & Bytes + +Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing. + + - Nan::Encoding + - Nan::Encode() + - Nan::DecodeBytes() + - Nan::DecodeWrite() + + + +### Nan::Encoding + +An enum representing the supported encoding types. A copy of `node::encoding` that is consistent across versions of Node. + +Definition: + +```c++ +enum Nan::Encoding { ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER } +``` + + + +### Nan::Encode() + +A wrapper around `node::Encode()` that provides a consistent implementation across supported versions of Node. + +Signature: + +```c++ +v8::Local Nan::Encode(const void *buf, + size_t len, + enum Nan::Encoding encoding = BINARY); +``` + + + +### Nan::DecodeBytes() + +A wrapper around `node::DecodeBytes()` that provides a consistent implementation across supported versions of Node. + +Signature: + +```c++ +ssize_t Nan::DecodeBytes(v8::Local val, + enum Nan::Encoding encoding = BINARY); +``` + + + +### Nan::DecodeWrite() + +A wrapper around `node::DecodeWrite()` that provides a consistent implementation across supported versions of Node. + +Signature: + +```c++ +ssize_t Nan::DecodeWrite(char *buf, + size_t len, + v8::Local val, + enum Nan::Encoding encoding = BINARY); +``` diff --git a/node_modules/nan/doc/v8_internals.md b/node_modules/nan/doc/v8_internals.md new file mode 100755 index 00000000..ce5f2308 --- /dev/null +++ b/node_modules/nan/doc/v8_internals.md @@ -0,0 +1,199 @@ +## V8 internals + +The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods. + + - NAN_GC_CALLBACK() + - Nan::AddGCEpilogueCallback() + - Nan::RemoveGCEpilogueCallback() + - Nan::AddGCPrologueCallback() + - Nan::RemoveGCPrologueCallback() + - Nan::GetHeapStatistics() + - Nan::SetCounterFunction() + - Nan::SetCreateHistogramFunction() + - Nan::SetAddHistogramSampleFunction() + - Nan::IdleNotification() + - Nan::LowMemoryNotification() + - Nan::ContextDisposedNotification() + - Nan::GetInternalFieldPointer() + - Nan::SetInternalFieldPointer() + - Nan::AdjustExternalMemory() + + + +### NAN_GC_CALLBACK(callbackname) + +Use `NAN_GC_CALLBACK` to declare your callbacks for `Nan::AddGCPrologueCallback()` and `Nan::AddGCEpilogueCallback()`. Your new method receives the arguments `v8::GCType type` and `v8::GCCallbackFlags flags`. + +```c++ +static Nan::Persistent callback; + +NAN_GC_CALLBACK(gcPrologueCallback) { + v8::Local argv[] = { Nan::New("prologue").ToLocalChecked() }; + Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(callback), 1, argv); +} + +NAN_METHOD(Hook) { + callback.Reset(args[0].As()); + Nan::AddGCPrologueCallback(gcPrologueCallback); + info.GetReturnValue().Set(info.Holder()); +} +``` + + +### Nan::AddGCEpilogueCallback() + +Signature: + +```c++ +void Nan::AddGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback, v8::GCType gc_type_filter = v8::kGCTypeAll) +``` + +Calls V8's [`AddGCEpilogueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a90d1860babc76059c62514b422f56960). + + +### Nan::RemoveGCEpilogueCallback() + +Signature: + +```c++ +void Nan::RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback) +``` + +Calls V8's [`RemoveGCEpilogueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a05c60859fd4b8e96bfcd451281ed6c7c). + + +### Nan::AddGCPrologueCallback() + +Signature: + +```c++ +void Nan::AddGCPrologueCallback(v8::Isolate::GCPrologueCallback, v8::GCType gc_type_filter callback) +``` + +Calls V8's [`AddGCPrologueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ab4b87b8f9f8e5bf95eba4009357e001f). + + +### Nan::RemoveGCPrologueCallback() + +Signature: + +```c++ +void Nan::RemoveGCPrologueCallback(v8::Isolate::GCPrologueCallback callback) +``` + +Calls V8's [`RemoveGCEpilogueCallback()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a9f6c51932811593f81ff30b949124186). + + +### Nan::GetHeapStatistics() + +Signature: + +```c++ +void Nan::GetHeapStatistics(v8::HeapStatistics *heap_statistics) +``` + +Calls V8's [`GetHeapStatistics()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a5593ac74687b713095c38987e5950b34). + + +### Nan::SetCounterFunction() + +Signature: + +```c++ +void Nan::SetCounterFunction(v8::CounterLookupCallback cb) +``` + +Calls V8's [`SetCounterFunction()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a045d7754e62fa0ec72ae6c259b29af94). + + +### Nan::SetCreateHistogramFunction() + +Signature: + +```c++ +void Nan::SetCreateHistogramFunction(v8::CreateHistogramCallback cb) +``` + +Calls V8's [`SetCreateHistogramFunction()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a542d67e85089cb3f92aadf032f99e732). + + +### Nan::SetAddHistogramSampleFunction() + +Signature: + +```c++ +void Nan::SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) +``` + +Calls V8's [`SetAddHistogramSampleFunction()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#aeb420b690bc2c216882d6fdd00ddd3ea). + + +### Nan::IdleNotification() + +Signature: + +```c++ +void Nan::IdleNotification(v8::HeapStatistics *heap_statistics) +``` + +Calls V8's [`IdleNotification()` or `IdleNotificationDeadline()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ad6a2a02657f5425ad460060652a5a118) depending on V8 version. + + +### Nan::LowMemoryNotification() + +Signature: + +```c++ +void Nan::LowMemoryNotification() +``` + +Calls V8's [`LowMemoryNotification()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a24647f61d6b41f69668094bdcd6ea91f). + + +### Nan::ContextDisposedNotification() + +Signature: + +```c++ +void Nan::ContextDisposedNotification() +``` + +Calls V8's [`ContextDisposedNotification()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ad7f5dc559866343fe6cd8db1f134d48b). + + +### Nan::GetInternalFieldPointer() + +Gets a pointer to the internal field with at `index` from a V8 `Object` handle. + +Signature: + +```c++ +void* Nan::GetInternalFieldPointer(v8::Local object, int index) +``` + +Calls the Object's [`GetAlignedPointerFromInternalField()` or `GetPointerFromInternalField()`](https://v8docs.nodesource.com/io.js-3.0/db/d85/classv8_1_1_object.html#ab3c57184263cf29963ef0017bec82281) depending on the version of V8. + + +### Nan::SetInternalFieldPointer() + +Sets the value of the internal field at `index` on a V8 `Object` handle. + +Signature: + +```c++ +void Nan::SetInternalFieldPointer(v8::Local object, int index, void* value) +``` + +Calls the Object's [`SetAlignedPointerInInternalField()` or `SetPointerInInternalField()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ad7f5dc559866343fe6cd8db1f134d48b) depending on the version of V8. + + +### Nan::AdjustExternalMemory() + +Signature: + +```c++ +int Nan::AdjustExternalMemory(int bytesChange) +``` + +Calls V8's [`AdjustAmountOfExternalAllocatedMemory()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#ae1a59cac60409d3922582c4af675473e). + diff --git a/node_modules/nan/doc/v8_misc.md b/node_modules/nan/doc/v8_misc.md new file mode 100755 index 00000000..64f736d6 --- /dev/null +++ b/node_modules/nan/doc/v8_misc.md @@ -0,0 +1,85 @@ +## Miscellaneous V8 Helpers + + - Nan::Utf8String + - Nan::GetCurrentContext() + - Nan::SetIsolateData() + - Nan::GetIsolateData() + - Nan::TypedArrayContents + + + +### Nan::Utf8String + +Converts an object to a UTF-8-encoded character array. If conversion to a string fails (e.g. due to an exception in the toString() method of the object) then the length() method returns 0 and the * operator returns NULL. The underlying memory used for this object is managed by the object. + +An implementation of [`v8::String::Utf8Value`](https://v8docs.nodesource.com/io.js-3.0/d4/d1b/classv8_1_1_string_1_1_utf8_value.html) that is consistent across all supported versions of V8. + +Definition: + +```c++ +class Nan::Utf8String { + public: + Nan::Utf8String(v8::Local from); + + int length() const; + + char* operator*(); + const char* operator*() const; +}; +``` + + +### Nan::GetCurrentContext() + +A call to [`v8::Isolate::GetCurrent()->GetCurrentContext()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a81c7a1ed7001ae2a65e89107f75fd053) that works across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::GetCurrentContext() +``` + + +### Nan::SetIsolateData() + +A helper to provide a consistent API to [`v8::Isolate#SetData()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#a7acadfe7965997e9c386a05f098fbe36). + +Signature: + +```c++ +void Nan::SetIsolateData(v8::Isolate *isolate, T *data) +``` + + + +### Nan::GetIsolateData() + +A helper to provide a consistent API to [`v8::Isolate#GetData()`](https://v8docs.nodesource.com/io.js-3.0/d5/dda/classv8_1_1_isolate.html#aabd223436bc1100a787dadaa024c6257). + +Signature: + +```c++ +T *Nan::GetIsolateData(v8::Isolate *isolate) +``` + + +### Nan::TypedArrayContents + +A helper class for accessing the contents of an ArrayBufferView (aka a typedarray) from C++. If the input array is not a valid typedarray, then the data pointer of TypedArrayContents will default to `NULL` and the length will be 0. If the data pointer is not compatible with the alignment requirements of type, an assertion error will fail. + +Note that you must store a reference to the `array` object while you are accessing its contents. + +Definition: + +```c++ +template +class Nan::TypedArrayContents { + public: + TypedArrayContents(v8::Local array); + + size_t length() const; + + T* const operator*(); + const T* const operator*() const; +}; +``` diff --git a/node_modules/nan/include_dirs.js b/node_modules/nan/include_dirs.js new file mode 100755 index 00000000..4f1dfb41 --- /dev/null +++ b/node_modules/nan/include_dirs.js @@ -0,0 +1 @@ +console.log(require('path').relative('.', __dirname)); diff --git a/node_modules/nan/nan.h b/node_modules/nan/nan.h new file mode 100755 index 00000000..80a918ae --- /dev/null +++ b/node_modules/nan/nan.h @@ -0,0 +1,2321 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors: + * - Rod Vagg + * - Benjamin Byholm + * - Trevor Norris + * - Nathan Rajlich + * - Brett Lawson + * - Ben Noordhuis + * - David Siegel + * - Michael Ira Krufky + * + * MIT License + * + * Version 2.6.2: current Node 7.9.0, Node 12: 0.12.18, Node 10: 0.10.48, iojs: 3.3.1 + * + * See https://github.com/nodejs/nan for the latest update to this file + **********************************************************************************/ + +#ifndef NAN_H_ +#define NAN_H_ + +#include + +#define NODE_0_10_MODULE_VERSION 11 +#define NODE_0_12_MODULE_VERSION 14 +#define ATOM_0_21_MODULE_VERSION 41 +#define IOJS_1_0_MODULE_VERSION 42 +#define IOJS_1_1_MODULE_VERSION 43 +#define IOJS_2_0_MODULE_VERSION 44 +#define IOJS_3_0_MODULE_VERSION 45 +#define NODE_4_0_MODULE_VERSION 46 +#define NODE_5_0_MODULE_VERSION 47 +#define NODE_6_0_MODULE_VERSION 48 +#define NODE_7_0_MODULE_VERSION 51 + +#ifdef _MSC_VER +# define NAN_HAS_CPLUSPLUS_11 (_MSC_VER >= 1800) +#else +# define NAN_HAS_CPLUSPLUS_11 (__cplusplus >= 201103L) +#endif + +#if NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION && !NAN_HAS_CPLUSPLUS_11 +# error This version of node/NAN/v8 requires a C++11 compiler +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(_MSC_VER) +# pragma warning( push ) +# pragma warning( disable : 4530 ) +# include +# include +# pragma warning( pop ) +#else +# include +# include +#endif + +// uv helpers +#ifdef UV_VERSION_MAJOR +# ifndef UV_VERSION_PATCH +# define UV_VERSION_PATCH 0 +# endif +# define NAUV_UVVERSION ((UV_VERSION_MAJOR << 16) | \ + (UV_VERSION_MINOR << 8) | \ + (UV_VERSION_PATCH)) +#else +# define NAUV_UVVERSION 0x000b00 +#endif + +#if NAUV_UVVERSION < 0x000b0b +# ifdef WIN32 +# include +# else +# include +# endif +#endif + +namespace Nan { + +#define NAN_INLINE inline // TODO(bnoordhuis) Remove in v3.0.0. + +#if defined(__GNUC__) && \ + !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS) +# define NAN_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) && \ + !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS) +# define NAN_DEPRECATED __declspec(deprecated) +#else +# define NAN_DEPRECATED +#endif + +#if NAN_HAS_CPLUSPLUS_11 +# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete; +# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete; +# define NAN_DISALLOW_MOVE(CLASS) \ + CLASS(CLASS&&) = delete; /* NOLINT(build/c++11) */ \ + void operator=(CLASS&&) = delete; +#else +# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&); +# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&); +# define NAN_DISALLOW_MOVE(CLASS) +#endif + +#define NAN_DISALLOW_ASSIGN_COPY(CLASS) \ + NAN_DISALLOW_ASSIGN(CLASS) \ + NAN_DISALLOW_COPY(CLASS) + +#define NAN_DISALLOW_ASSIGN_MOVE(CLASS) \ + NAN_DISALLOW_ASSIGN(CLASS) \ + NAN_DISALLOW_MOVE(CLASS) + +#define NAN_DISALLOW_COPY_MOVE(CLASS) \ + NAN_DISALLOW_COPY(CLASS) \ + NAN_DISALLOW_MOVE(CLASS) + +#define NAN_DISALLOW_ASSIGN_COPY_MOVE(CLASS) \ + NAN_DISALLOW_ASSIGN(CLASS) \ + NAN_DISALLOW_COPY(CLASS) \ + NAN_DISALLOW_MOVE(CLASS) + +#define TYPE_CHECK(T, S) \ + while (false) { \ + *(static_cast(0)) = static_cast(0); \ + } + +//=== RegistrationFunction ===================================================== + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + typedef v8::Handle ADDON_REGISTER_FUNCTION_ARGS_TYPE; +#else + typedef v8::Local ADDON_REGISTER_FUNCTION_ARGS_TYPE; +#endif + +#define NAN_MODULE_INIT(name) \ + void name(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target) + +//=== CallbackInfo ============================================================= + +#include "nan_callbacks.h" // NOLINT(build/include) + +//============================================================================== + +#if (NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION) +typedef v8::Script UnboundScript; +typedef v8::Script BoundScript; +#else +typedef v8::UnboundScript UnboundScript; +typedef v8::Script BoundScript; +#endif + +#if (NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION) +typedef v8::String::ExternalAsciiStringResource + ExternalOneByteStringResource; +#else +typedef v8::String::ExternalOneByteStringResource + ExternalOneByteStringResource; +#endif + +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) +template +class NonCopyablePersistentTraits : + public v8::NonCopyablePersistentTraits {}; +template +class CopyablePersistentTraits : + public v8::CopyablePersistentTraits {}; + +template +class PersistentBase : + public v8::PersistentBase {}; + +template > +class Persistent; +#else +template class NonCopyablePersistentTraits; +template class PersistentBase; +template class WeakCallbackData; +template > +class Persistent; +#endif // NODE_MODULE_VERSION + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +# include "nan_maybe_43_inl.h" // NOLINT(build/include) +#else +# include "nan_maybe_pre_43_inl.h" // NOLINT(build/include) +#endif + +#include "nan_converters.h" // NOLINT(build/include) +#include "nan_new.h" // NOLINT(build/include) + +#if NAUV_UVVERSION < 0x000b17 +#define NAUV_WORK_CB(func) \ + void func(uv_async_t *async, int) +#else +#define NAUV_WORK_CB(func) \ + void func(uv_async_t *async) +#endif + +#if NAUV_UVVERSION >= 0x000b0b + +typedef uv_key_t nauv_key_t; + +inline int nauv_key_create(nauv_key_t *key) { + return uv_key_create(key); +} + +inline void nauv_key_delete(nauv_key_t *key) { + uv_key_delete(key); +} + +inline void* nauv_key_get(nauv_key_t *key) { + return uv_key_get(key); +} + +inline void nauv_key_set(nauv_key_t *key, void *value) { + uv_key_set(key, value); +} + +#else + +/* Implement thread local storage for older versions of libuv. + * This is essentially a backport of libuv commit 5d2434bf + * written by Ben Noordhuis, adjusted for names and inline. + */ + +#ifndef WIN32 + +typedef pthread_key_t nauv_key_t; + +inline int nauv_key_create(nauv_key_t* key) { + return -pthread_key_create(key, NULL); +} + +inline void nauv_key_delete(nauv_key_t* key) { + if (pthread_key_delete(*key)) + abort(); +} + +inline void* nauv_key_get(nauv_key_t* key) { + return pthread_getspecific(*key); +} + +inline void nauv_key_set(nauv_key_t* key, void* value) { + if (pthread_setspecific(*key, value)) + abort(); +} + +#else + +typedef struct { + DWORD tls_index; +} nauv_key_t; + +inline int nauv_key_create(nauv_key_t* key) { + key->tls_index = TlsAlloc(); + if (key->tls_index == TLS_OUT_OF_INDEXES) + return UV_ENOMEM; + return 0; +} + +inline void nauv_key_delete(nauv_key_t* key) { + if (TlsFree(key->tls_index) == FALSE) + abort(); + key->tls_index = TLS_OUT_OF_INDEXES; +} + +inline void* nauv_key_get(nauv_key_t* key) { + void* value = TlsGetValue(key->tls_index); + if (value == NULL) + if (GetLastError() != ERROR_SUCCESS) + abort(); + return value; +} + +inline void nauv_key_set(nauv_key_t* key, void* value) { + if (TlsSetValue(key->tls_index, value) == FALSE) + abort(); +} + +#endif +#endif + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION +template +v8::Local New(v8::Handle); +#endif + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + typedef v8::WeakCallbackType WeakCallbackType; +#else +struct WeakCallbackType { + enum E {kParameter, kInternalFields}; + E type; + WeakCallbackType(E other) : type(other) {} // NOLINT(runtime/explicit) + inline bool operator==(E other) { return other == this->type; } + inline bool operator!=(E other) { return !operator==(other); } +}; +#endif + +template class WeakCallbackInfo; + +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +# include "nan_persistent_12_inl.h" // NOLINT(build/include) +#else +# include "nan_persistent_pre_12_inl.h" // NOLINT(build/include) +#endif + +namespace imp { + static const size_t kMaxLength = 0x3fffffff; + // v8::String::REPLACE_INVALID_UTF8 was introduced + // in node.js v0.10.29 and v0.8.27. +#if NODE_MAJOR_VERSION > 0 || \ + NODE_MINOR_VERSION > 10 || \ + NODE_MINOR_VERSION == 10 && NODE_PATCH_VERSION >= 29 || \ + NODE_MINOR_VERSION == 8 && NODE_PATCH_VERSION >= 27 + static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8; +#else + static const unsigned kReplaceInvalidUtf8 = 0; +#endif +} // end of namespace imp + +//=== HandleScope ============================================================== + +class HandleScope { + v8::HandleScope scope; + + public: +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + inline HandleScope() : scope(v8::Isolate::GetCurrent()) {} + inline static int NumberOfHandles() { + return v8::HandleScope::NumberOfHandles(v8::Isolate::GetCurrent()); + } +#else + inline HandleScope() : scope() {} + inline static int NumberOfHandles() { + return v8::HandleScope::NumberOfHandles(); + } +#endif + + private: + // Make it hard to create heap-allocated or illegal handle scopes by + // disallowing certain operations. + HandleScope(const HandleScope &); + void operator=(const HandleScope &); + void *operator new(size_t size); + void operator delete(void *, size_t) { + abort(); + } +}; + +class EscapableHandleScope { + public: +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + inline EscapableHandleScope() : scope(v8::Isolate::GetCurrent()) {} + + inline static int NumberOfHandles() { + return v8::EscapableHandleScope::NumberOfHandles(v8::Isolate::GetCurrent()); + } + + template + inline v8::Local Escape(v8::Local value) { + return scope.Escape(value); + } + + private: + v8::EscapableHandleScope scope; +#else + inline EscapableHandleScope() : scope() {} + + inline static int NumberOfHandles() { + return v8::HandleScope::NumberOfHandles(); + } + + template + inline v8::Local Escape(v8::Local value) { + return scope.Close(value); + } + + private: + v8::HandleScope scope; +#endif + + private: + // Make it hard to create heap-allocated or illegal handle scopes by + // disallowing certain operations. + EscapableHandleScope(const EscapableHandleScope &); + void operator=(const EscapableHandleScope &); + void *operator new(size_t size); + void operator delete(void *, size_t) { + abort(); + } +}; + +//=== TryCatch ================================================================= + +class TryCatch { + v8::TryCatch try_catch_; + friend void FatalException(const TryCatch&); + + public: +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + TryCatch() : try_catch_(v8::Isolate::GetCurrent()) {} +#endif + + inline bool HasCaught() const { return try_catch_.HasCaught(); } + + inline bool CanContinue() const { return try_catch_.CanContinue(); } + + inline v8::Local ReThrow() { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + return New(try_catch_.ReThrow()); +#else + return try_catch_.ReThrow(); +#endif + } + + inline v8::Local Exception() const { + return try_catch_.Exception(); + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + inline v8::MaybeLocal StackTrace() const { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(try_catch_.StackTrace(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); + } +#else + inline MaybeLocal StackTrace() const { + return try_catch_.StackTrace(); + } +#endif + + inline v8::Local Message() const { + return try_catch_.Message(); + } + + inline void Reset() { try_catch_.Reset(); } + + inline void SetVerbose(bool value) { try_catch_.SetVerbose(value); } + + inline void SetCaptureMessage(bool value) { + try_catch_.SetCaptureMessage(value); + } +}; + +//============ ================================================================= + +/* node 0.12 */ +#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION + inline + void SetCounterFunction(v8::CounterLookupCallback cb) { + v8::Isolate::GetCurrent()->SetCounterFunction(cb); + } + + inline + void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) { + v8::Isolate::GetCurrent()->SetCreateHistogramFunction(cb); + } + + inline + void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) { + v8::Isolate::GetCurrent()->SetAddHistogramSampleFunction(cb); + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + inline bool IdleNotification(int idle_time_in_ms) { + return v8::Isolate::GetCurrent()->IdleNotificationDeadline( + idle_time_in_ms * 0.001); + } +# else + inline bool IdleNotification(int idle_time_in_ms) { + return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms); + } +#endif + + inline void LowMemoryNotification() { + v8::Isolate::GetCurrent()->LowMemoryNotification(); + } + + inline void ContextDisposedNotification() { + v8::Isolate::GetCurrent()->ContextDisposedNotification(); + } +#else + inline + void SetCounterFunction(v8::CounterLookupCallback cb) { + v8::V8::SetCounterFunction(cb); + } + + inline + void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) { + v8::V8::SetCreateHistogramFunction(cb); + } + + inline + void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) { + v8::V8::SetAddHistogramSampleFunction(cb); + } + + inline bool IdleNotification(int idle_time_in_ms) { + return v8::V8::IdleNotification(idle_time_in_ms); + } + + inline void LowMemoryNotification() { + v8::V8::LowMemoryNotification(); + } + + inline void ContextDisposedNotification() { + v8::V8::ContextDisposedNotification(); + } +#endif + +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) // Node 0.12 + inline v8::Local Undefined() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::Undefined(v8::Isolate::GetCurrent()))); +# else + return v8::Undefined(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local Null() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::Null(v8::Isolate::GetCurrent()))); +# else + return v8::Null(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local True() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::True(v8::Isolate::GetCurrent()))); +# else + return v8::True(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local False() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::False(v8::Isolate::GetCurrent()))); +# else + return v8::False(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local EmptyString() { + return v8::String::Empty(v8::Isolate::GetCurrent()); + } + + inline int AdjustExternalMemory(int bc) { + return static_cast( + v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(bc)); + } + + inline void SetTemplate( + v8::Local templ + , const char *name + , v8::Local value) { + templ->Set(v8::Isolate::GetCurrent(), name, value); + } + + inline void SetTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes) { + templ->Set(name, value, attributes); + } + + inline v8::Local GetCurrentContext() { + return v8::Isolate::GetCurrent()->GetCurrentContext(); + } + + inline void* GetInternalFieldPointer( + v8::Local object + , int index) { + return object->GetAlignedPointerFromInternalField(index); + } + + inline void SetInternalFieldPointer( + v8::Local object + , int index + , void* value) { + object->SetAlignedPointerInInternalField(index, value); + } + +# define NAN_GC_CALLBACK(name) \ + void name(v8::Isolate *isolate, v8::GCType type, v8::GCCallbackFlags flags) + +#if NODE_MODULE_VERSION <= NODE_4_0_MODULE_VERSION + typedef v8::Isolate::GCEpilogueCallback GCEpilogueCallback; + typedef v8::Isolate::GCPrologueCallback GCPrologueCallback; +#else + typedef v8::Isolate::GCCallback GCEpilogueCallback; + typedef v8::Isolate::GCCallback GCPrologueCallback; +#endif + + inline void AddGCEpilogueCallback( + GCEpilogueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::Isolate::GetCurrent()->AddGCEpilogueCallback(callback, gc_type_filter); + } + + inline void RemoveGCEpilogueCallback( + GCEpilogueCallback callback) { + v8::Isolate::GetCurrent()->RemoveGCEpilogueCallback(callback); + } + + inline void AddGCPrologueCallback( + GCPrologueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::Isolate::GetCurrent()->AddGCPrologueCallback(callback, gc_type_filter); + } + + inline void RemoveGCPrologueCallback( + GCPrologueCallback callback) { + v8::Isolate::GetCurrent()->RemoveGCPrologueCallback(callback); + } + + inline void GetHeapStatistics( + v8::HeapStatistics *heap_statistics) { + v8::Isolate::GetCurrent()->GetHeapStatistics(heap_statistics); + } + +# define X(NAME) \ + inline v8::Local NAME(const char *msg) { \ + EscapableHandleScope scope; \ + return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline \ + v8::Local NAME(v8::Local msg) { \ + return v8::Exception::NAME(msg); \ + } \ + \ + inline void Throw ## NAME(const char *msg) { \ + HandleScope scope; \ + v8::Isolate::GetCurrent()->ThrowException( \ + v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline void Throw ## NAME(v8::Local msg) { \ + HandleScope scope; \ + v8::Isolate::GetCurrent()->ThrowException( \ + v8::Exception::NAME(msg)); \ + } + + X(Error) + X(RangeError) + X(ReferenceError) + X(SyntaxError) + X(TypeError) + +# undef X + + inline void ThrowError(v8::Local error) { + v8::Isolate::GetCurrent()->ThrowException(error); + } + + inline MaybeLocal NewBuffer( + char *data + , size_t length +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + , node::Buffer::FreeCallback callback +#else + , node::smalloc::FreeCallback callback +#endif + , void *hint + ) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(length <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::New( + v8::Isolate::GetCurrent(), data, length, callback, hint); +#else + return node::Buffer::New(v8::Isolate::GetCurrent(), data, length, callback, + hint); +#endif + } + + inline MaybeLocal CopyBuffer( + const char *data + , uint32_t size + ) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::Copy( + v8::Isolate::GetCurrent(), data, size); +#else + return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); +#endif + } + + inline MaybeLocal NewBuffer(uint32_t size) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::New( + v8::Isolate::GetCurrent(), size); +#else + return node::Buffer::New(v8::Isolate::GetCurrent(), size); +#endif + } + + inline MaybeLocal NewBuffer( + char* data + , uint32_t size + ) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); +#else + return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size); +#endif + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + inline MaybeLocal + NewOneByteString(const uint8_t * value, int length = -1) { + return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value, + v8::NewStringType::kNormal, length); + } + + inline MaybeLocal CompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source source(s, origin); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source) + .FromMaybe(v8::Local())); + } + + inline MaybeLocal CompileScript( + v8::Local s + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source source(s); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source) + .FromMaybe(v8::Local())); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(script->BindToCurrentContext() + ->Run(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(script->Run(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); + } +#else + inline MaybeLocal + NewOneByteString(const uint8_t * value, int length = -1) { + return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value, + v8::String::kNormalString, length); + } + + inline MaybeLocal CompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + v8::ScriptCompiler::Source source(s, origin); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); + } + + inline MaybeLocal CompileScript( + v8::Local s + ) { + v8::ScriptCompiler::Source source(s); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + EscapableHandleScope scope; + return scope.Escape(script->BindToCurrentContext()->Run()); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + return script->Run(); + } +#endif + + inline v8::Local MakeCallback( + v8::Local target + , v8::Local func + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(node::MakeCallback( + v8::Isolate::GetCurrent(), target, func, argc, argv))); +#else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, func, argc, argv); +#endif + } + + inline v8::Local MakeCallback( + v8::Local target + , v8::Local symbol + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(node::MakeCallback( + v8::Isolate::GetCurrent(), target, symbol, argc, argv))); +#else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, symbol, argc, argv); +#endif + } + + inline v8::Local MakeCallback( + v8::Local target + , const char* method + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(node::MakeCallback( + v8::Isolate::GetCurrent(), target, method, argc, argv))); +#else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, method, argc, argv); +#endif + } + + inline void FatalException(const TryCatch& try_catch) { + node::FatalException(v8::Isolate::GetCurrent(), try_catch.try_catch_); + } + + inline v8::Local ErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return node::ErrnoException(v8::Isolate::GetCurrent(), errorno, syscall, + message, path); + } + + NAN_DEPRECATED inline v8::Local NanErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return ErrnoException(errorno, syscall, message, path); + } + + template + inline void SetIsolateData( + v8::Isolate *isolate + , T *data + ) { + isolate->SetData(0, data); + } + + template + inline T *GetIsolateData( + v8::Isolate *isolate + ) { + return static_cast(isolate->GetData(0)); + } + +class Utf8String { + public: + inline explicit Utf8String(v8::Local from) : + length_(0), str_(str_st_) { + HandleScope scope; + if (!from.IsEmpty()) { + v8::Local string = from->ToString(); + if (!string.IsEmpty()) { + size_t len = 3 * string->Length() + 1; + assert(len <= INT_MAX); + if (len > sizeof (str_st_)) { + str_ = static_cast(malloc(len)); + assert(str_ != 0); + } + const int flags = + v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8; + length_ = string->WriteUtf8(str_, static_cast(len), 0, flags); + str_[length_] = '\0'; + } + } + } + + inline int length() const { + return length_; + } + + inline char* operator*() { return str_; } + inline const char* operator*() const { return str_; } + + inline ~Utf8String() { + if (str_ != str_st_) { + free(str_); + } + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String) + + int length_; + char *str_; + char str_st_[1024]; +}; + +#else // Node 0.8 and 0.10 + inline v8::Local Undefined() { + EscapableHandleScope scope; + return scope.Escape(New(v8::Undefined())); + } + + inline v8::Local Null() { + EscapableHandleScope scope; + return scope.Escape(New(v8::Null())); + } + + inline v8::Local True() { + EscapableHandleScope scope; + return scope.Escape(New(v8::True())); + } + + inline v8::Local False() { + EscapableHandleScope scope; + return scope.Escape(New(v8::False())); + } + + inline v8::Local EmptyString() { + return v8::String::Empty(); + } + + inline int AdjustExternalMemory(int bc) { + return static_cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(bc)); + } + + inline void SetTemplate( + v8::Local templ + , const char *name + , v8::Local value) { + templ->Set(name, value); + } + + inline void SetTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes) { + templ->Set(name, value, attributes); + } + + inline v8::Local GetCurrentContext() { + return v8::Context::GetCurrent(); + } + + inline void* GetInternalFieldPointer( + v8::Local object + , int index) { + return object->GetPointerFromInternalField(index); + } + + inline void SetInternalFieldPointer( + v8::Local object + , int index + , void* value) { + object->SetPointerInInternalField(index, value); + } + +# define NAN_GC_CALLBACK(name) \ + void name(v8::GCType type, v8::GCCallbackFlags flags) + + inline void AddGCEpilogueCallback( + v8::GCEpilogueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::V8::AddGCEpilogueCallback(callback, gc_type_filter); + } + inline void RemoveGCEpilogueCallback( + v8::GCEpilogueCallback callback) { + v8::V8::RemoveGCEpilogueCallback(callback); + } + inline void AddGCPrologueCallback( + v8::GCPrologueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::V8::AddGCPrologueCallback(callback, gc_type_filter); + } + inline void RemoveGCPrologueCallback( + v8::GCPrologueCallback callback) { + v8::V8::RemoveGCPrologueCallback(callback); + } + inline void GetHeapStatistics( + v8::HeapStatistics *heap_statistics) { + v8::V8::GetHeapStatistics(heap_statistics); + } + +# define X(NAME) \ + inline v8::Local NAME(const char *msg) { \ + EscapableHandleScope scope; \ + return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline \ + v8::Local NAME(v8::Local msg) { \ + return v8::Exception::NAME(msg); \ + } \ + \ + inline void Throw ## NAME(const char *msg) { \ + HandleScope scope; \ + v8::ThrowException(v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline \ + void Throw ## NAME(v8::Local errmsg) { \ + HandleScope scope; \ + v8::ThrowException(v8::Exception::NAME(errmsg)); \ + } + + X(Error) + X(RangeError) + X(ReferenceError) + X(SyntaxError) + X(TypeError) + +# undef X + + inline void ThrowError(v8::Local error) { + v8::ThrowException(error); + } + + inline MaybeLocal NewBuffer( + char *data + , size_t length + , node::Buffer::free_callback callback + , void *hint + ) { + EscapableHandleScope scope; + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(length <= imp::kMaxLength && "too large buffer"); + return scope.Escape( + New(node::Buffer::New(data, length, callback, hint)->handle_)); + } + + inline MaybeLocal CopyBuffer( + const char *data + , uint32_t size + ) { + EscapableHandleScope scope; + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION + return scope.Escape(New(node::Buffer::New(data, size)->handle_)); +#else + return scope.Escape( + New(node::Buffer::New(const_cast(data), size)->handle_)); +#endif + } + + inline MaybeLocal NewBuffer(uint32_t size) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + assert(size <= imp::kMaxLength && "too large buffer"); + return scope.Escape(New(node::Buffer::New(size)->handle_)); + } + + inline void FreeData(char *data, void *hint) { + (void) hint; // unused + delete[] data; + } + + inline MaybeLocal NewBuffer( + char* data + , uint32_t size + ) { + EscapableHandleScope scope; + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); + return scope.Escape( + New(node::Buffer::New(data, size, FreeData, NULL)->handle_)); + } + +namespace imp { +inline void +widenString(std::vector *ws, const uint8_t *s, int l) { + size_t len = static_cast(l); + if (l < 0) { + len = strlen(reinterpret_cast(s)); + } + assert(len <= INT_MAX && "string too long"); + ws->resize(len); + std::copy(s, s + len, ws->begin()); // NOLINT(build/include_what_you_use) +} +} // end of namespace imp + + inline MaybeLocal + NewOneByteString(const uint8_t * value, int length = -1) { + std::vector wideString; // NOLINT(build/include_what_you_use) + imp::widenString(&wideString, value, length); + return v8::String::New(wideString.data(), + static_cast(wideString.size())); + } + + inline MaybeLocal CompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + return v8::Script::Compile(s, const_cast(&origin)); + } + + inline MaybeLocal CompileScript( + v8::Local s + ) { + return v8::Script::Compile(s); + } + + inline + MaybeLocal RunScript(v8::Local script) { + return script->Run(); + } + + inline v8::Local MakeCallback( + v8::Local target + , v8::Local func + , int argc + , v8::Local* argv) { + v8::HandleScope scope; + return scope.Close(New(node::MakeCallback(target, func, argc, argv))); + } + + inline v8::Local MakeCallback( + v8::Local target + , v8::Local symbol + , int argc + , v8::Local* argv) { + v8::HandleScope scope; + return scope.Close(New(node::MakeCallback(target, symbol, argc, argv))); + } + + inline v8::Local MakeCallback( + v8::Local target + , const char* method + , int argc + , v8::Local* argv) { + v8::HandleScope scope; + return scope.Close(New(node::MakeCallback(target, method, argc, argv))); + } + + inline void FatalException(const TryCatch& try_catch) { + node::FatalException(const_cast(try_catch.try_catch_)); + } + + inline v8::Local ErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return node::ErrnoException(errorno, syscall, message, path); + } + + NAN_DEPRECATED inline v8::Local NanErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return ErrnoException(errorno, syscall, message, path); + } + + + template + inline void SetIsolateData( + v8::Isolate *isolate + , T *data + ) { + isolate->SetData(data); + } + + template + inline T *GetIsolateData( + v8::Isolate *isolate + ) { + return static_cast(isolate->GetData()); + } + +class Utf8String { + public: + inline explicit Utf8String(v8::Local from) : + length_(0), str_(str_st_) { + v8::HandleScope scope; + if (!from.IsEmpty()) { + v8::Local string = from->ToString(); + if (!string.IsEmpty()) { + size_t len = 3 * string->Length() + 1; + assert(len <= INT_MAX); + if (len > sizeof (str_st_)) { + str_ = static_cast(malloc(len)); + assert(str_ != 0); + } + const int flags = + v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8; + length_ = string->WriteUtf8(str_, static_cast(len), 0, flags); + str_[length_] = '\0'; + } + } + } + + inline int length() const { + return length_; + } + + inline char* operator*() { return str_; } + inline const char* operator*() const { return str_; } + + inline ~Utf8String() { + if (str_ != str_st_) { + free(str_); + } + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String) + + int length_; + char *str_; + char str_st_[1024]; +}; + +#endif // NODE_MODULE_VERSION + +typedef void (*FreeCallback)(char *data, void *hint); + +typedef const FunctionCallbackInfo& NAN_METHOD_ARGS_TYPE; +typedef void NAN_METHOD_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_GETTER_ARGS_TYPE; +typedef void NAN_GETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_SETTER_ARGS_TYPE; +typedef void NAN_SETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_GETTER_ARGS_TYPE; +typedef void NAN_PROPERTY_GETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_SETTER_ARGS_TYPE; +typedef void NAN_PROPERTY_SETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_ENUMERATOR_ARGS_TYPE; +typedef void NAN_PROPERTY_ENUMERATOR_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_DELETER_ARGS_TYPE; +typedef void NAN_PROPERTY_DELETER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_QUERY_ARGS_TYPE; +typedef void NAN_PROPERTY_QUERY_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_INDEX_GETTER_ARGS_TYPE; +typedef void NAN_INDEX_GETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_INDEX_SETTER_ARGS_TYPE; +typedef void NAN_INDEX_SETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_INDEX_ENUMERATOR_ARGS_TYPE; +typedef void NAN_INDEX_ENUMERATOR_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_INDEX_DELETER_ARGS_TYPE; +typedef void NAN_INDEX_DELETER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_INDEX_QUERY_ARGS_TYPE; +typedef void NAN_INDEX_QUERY_RETURN_TYPE; + +#define NAN_METHOD(name) \ + Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info) +#define NAN_GETTER(name) \ + Nan::NAN_GETTER_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_GETTER_ARGS_TYPE info) +#define NAN_SETTER(name) \ + Nan::NAN_SETTER_RETURN_TYPE name( \ + v8::Local property \ + , v8::Local value \ + , Nan::NAN_SETTER_ARGS_TYPE info) +#define NAN_PROPERTY_GETTER(name) \ + Nan::NAN_PROPERTY_GETTER_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_PROPERTY_GETTER_ARGS_TYPE info) +#define NAN_PROPERTY_SETTER(name) \ + Nan::NAN_PROPERTY_SETTER_RETURN_TYPE name( \ + v8::Local property \ + , v8::Local value \ + , Nan::NAN_PROPERTY_SETTER_ARGS_TYPE info) +#define NAN_PROPERTY_ENUMERATOR(name) \ + Nan::NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name( \ + Nan::NAN_PROPERTY_ENUMERATOR_ARGS_TYPE info) +#define NAN_PROPERTY_DELETER(name) \ + Nan::NAN_PROPERTY_DELETER_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_PROPERTY_DELETER_ARGS_TYPE info) +#define NAN_PROPERTY_QUERY(name) \ + Nan::NAN_PROPERTY_QUERY_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_PROPERTY_QUERY_ARGS_TYPE info) +# define NAN_INDEX_GETTER(name) \ + Nan::NAN_INDEX_GETTER_RETURN_TYPE name( \ + uint32_t index \ + , Nan::NAN_INDEX_GETTER_ARGS_TYPE info) +#define NAN_INDEX_SETTER(name) \ + Nan::NAN_INDEX_SETTER_RETURN_TYPE name( \ + uint32_t index \ + , v8::Local value \ + , Nan::NAN_INDEX_SETTER_ARGS_TYPE info) +#define NAN_INDEX_ENUMERATOR(name) \ + Nan::NAN_INDEX_ENUMERATOR_RETURN_TYPE \ + name(Nan::NAN_INDEX_ENUMERATOR_ARGS_TYPE info) +#define NAN_INDEX_DELETER(name) \ + Nan::NAN_INDEX_DELETER_RETURN_TYPE name( \ + uint32_t index \ + , Nan::NAN_INDEX_DELETER_ARGS_TYPE info) +#define NAN_INDEX_QUERY(name) \ + Nan::NAN_INDEX_QUERY_RETURN_TYPE name( \ + uint32_t index \ + , Nan::NAN_INDEX_QUERY_ARGS_TYPE info) + +class Callback { + public: + Callback() {} + + explicit Callback(const v8::Local &fn) : handle_(fn) {} + + ~Callback() { + handle_.Reset(); + } + + bool operator==(const Callback &other) const { + return handle_ == other.handle_; + } + + bool operator!=(const Callback &other) const { + return !operator==(other); + } + + inline + v8::Local operator*() const { return GetFunction(); } + + inline v8::Local operator()( + v8::Local target + , int argc = 0 + , v8::Local argv[] = 0) const { + return this->Call(target, argc, argv); + } + + inline v8::Local operator()( + int argc = 0 + , v8::Local argv[] = 0) const { + return this->Call(argc, argv); + } + + // TODO(kkoopa): remove + inline void SetFunction(const v8::Local &fn) { + Reset(fn); + } + + inline void Reset(const v8::Local &fn) { + handle_.Reset(fn); + } + + inline void Reset() { + handle_.Reset(); + } + + inline v8::Local GetFunction() const { + return New(handle_); + } + + inline bool IsEmpty() const { + return handle_.IsEmpty(); + } + + inline v8::Local + Call(v8::Local target + , int argc + , v8::Local argv[]) const { +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + return Call_(isolate, target, argc, argv); +#else + return Call_(target, argc, argv); +#endif + } + + inline v8::Local + Call(int argc, v8::Local argv[]) const { +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv)); +#else + v8::HandleScope scope; + return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv)); +#endif + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(Callback) + Persistent handle_; + +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + v8::Local Call_(v8::Isolate *isolate + , v8::Local target + , int argc + , v8::Local argv[]) const { + EscapableHandleScope scope; + + v8::Local callback = New(handle_); +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + return scope.Escape(New(node::MakeCallback( + isolate + , target + , callback + , argc + , argv + ))); +# else + return scope.Escape(node::MakeCallback( + isolate + , target + , callback + , argc + , argv + )); +# endif + } +#else + v8::Local Call_(v8::Local target + , int argc + , v8::Local argv[]) const { + EscapableHandleScope scope; + + v8::Local callback = New(handle_); + return scope.Escape(New(node::MakeCallback( + target + , callback + , argc + , argv + ))); + } +#endif +}; + +/* abstract */ class AsyncWorker { + public: + explicit AsyncWorker(Callback *callback_) + : callback(callback_), errmsg_(NULL) { + request.data = this; + + HandleScope scope; + v8::Local obj = New(); + persistentHandle.Reset(obj); + } + + virtual ~AsyncWorker() { + HandleScope scope; + + if (!persistentHandle.IsEmpty()) + persistentHandle.Reset(); + delete callback; + delete[] errmsg_; + } + + virtual void WorkComplete() { + HandleScope scope; + + if (errmsg_ == NULL) + HandleOKCallback(); + else + HandleErrorCallback(); + delete callback; + callback = NULL; + } + + inline void SaveToPersistent( + const char *key, const v8::Local &value) { + HandleScope scope; + New(persistentHandle)->Set(New(key).ToLocalChecked(), value); + } + + inline void SaveToPersistent( + const v8::Local &key, const v8::Local &value) { + HandleScope scope; + New(persistentHandle)->Set(key, value); + } + + inline void SaveToPersistent( + uint32_t index, const v8::Local &value) { + HandleScope scope; + New(persistentHandle)->Set(index, value); + } + + inline v8::Local GetFromPersistent(const char *key) const { + EscapableHandleScope scope; + return scope.Escape( + New(persistentHandle)->Get(New(key).ToLocalChecked())); + } + + inline v8::Local + GetFromPersistent(const v8::Local &key) const { + EscapableHandleScope scope; + return scope.Escape(New(persistentHandle)->Get(key)); + } + + inline v8::Local GetFromPersistent(uint32_t index) const { + EscapableHandleScope scope; + return scope.Escape(New(persistentHandle)->Get(index)); + } + + virtual void Execute() = 0; + + uv_work_t request; + + virtual void Destroy() { + delete this; + } + + protected: + Persistent persistentHandle; + Callback *callback; + + virtual void HandleOKCallback() { + HandleScope scope; + + callback->Call(0, NULL); + } + + virtual void HandleErrorCallback() { + HandleScope scope; + + v8::Local argv[] = { + v8::Exception::Error(New(ErrorMessage()).ToLocalChecked()) + }; + callback->Call(1, argv); + } + + void SetErrorMessage(const char *msg) { + delete[] errmsg_; + + size_t size = strlen(msg) + 1; + errmsg_ = new char[size]; + memcpy(errmsg_, msg, size); + } + + const char* ErrorMessage() const { + return errmsg_; + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(AsyncWorker) + char *errmsg_; +}; + + +template +/* abstract */ class AsyncProgressWorkerBase : public AsyncWorker { + public: + explicit AsyncProgressWorkerBase(Callback *callback_) + : AsyncWorker(callback_), asyncdata_(NULL), asyncsize_(0) { + async = new uv_async_t; + uv_async_init( + uv_default_loop() + , async + , AsyncProgress_ + ); + async->data = this; + + uv_mutex_init(&async_lock); + } + + virtual ~AsyncProgressWorkerBase() { + uv_mutex_destroy(&async_lock); + + delete[] asyncdata_; + } + + void WorkProgress() { + uv_mutex_lock(&async_lock); + T *data = asyncdata_; + size_t size = asyncsize_; + asyncdata_ = NULL; + uv_mutex_unlock(&async_lock); + + // Don't send progress events after we've already completed. + if (callback) { + HandleProgressCallback(data, size); + } + delete[] data; + } + + class ExecutionProgress { + friend class AsyncProgressWorkerBase; + public: + void Signal() const { + uv_async_send(that_->async); + } + + void Send(const T* data, size_t size) const { + that_->SendProgress_(data, size); + } + + private: + explicit ExecutionProgress(AsyncProgressWorkerBase *that) : that_(that) {} + NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress) + AsyncProgressWorkerBase* const that_; + }; + + virtual void Execute(const ExecutionProgress& progress) = 0; + virtual void HandleProgressCallback(const T *data, size_t size) = 0; + + virtual void Destroy() { + uv_close(reinterpret_cast(async), AsyncClose_); + } + + private: + void Execute() /*final override*/ { + ExecutionProgress progress(this); + Execute(progress); + } + + void SendProgress_(const T *data, size_t size) { + T *new_data = new T[size]; + { + T *it = new_data; + std::copy(data, data + size, it); + } + + uv_mutex_lock(&async_lock); + T *old_data = asyncdata_; + asyncdata_ = new_data; + asyncsize_ = size; + uv_mutex_unlock(&async_lock); + + delete[] old_data; + uv_async_send(async); + } + + inline static NAUV_WORK_CB(AsyncProgress_) { + AsyncProgressWorkerBase *worker = + static_cast(async->data); + worker->WorkProgress(); + } + + inline static void AsyncClose_(uv_handle_t* handle) { + AsyncProgressWorkerBase *worker = + static_cast(handle->data); + delete reinterpret_cast(handle); + delete worker; + } + + uv_async_t *async; + uv_mutex_t async_lock; + T *asyncdata_; + size_t asyncsize_; +}; + +// This ensures compatibility to the previous un-templated AsyncProgressWorker +// class definition. +typedef AsyncProgressWorkerBase AsyncProgressWorker; + +inline void AsyncExecute (uv_work_t* req) { + AsyncWorker *worker = static_cast(req->data); + worker->Execute(); +} + +inline void AsyncExecuteComplete (uv_work_t* req) { + AsyncWorker* worker = static_cast(req->data); + worker->WorkComplete(); + worker->Destroy(); +} + +inline void AsyncQueueWorker (AsyncWorker* worker) { + uv_queue_work( + uv_default_loop() + , &worker->request + , AsyncExecute + , reinterpret_cast(AsyncExecuteComplete) + ); +} + +namespace imp { + +inline +ExternalOneByteStringResource const* +GetExternalResource(v8::Local str) { +#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION + return str->GetExternalAsciiStringResource(); +#else + return str->GetExternalOneByteStringResource(); +#endif +} + +inline +bool +IsExternal(v8::Local str) { +#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION + return str->IsExternalAscii(); +#else + return str->IsExternalOneByte(); +#endif +} + +} // end of namespace imp + +enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; + +#if NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION +# include "nan_string_bytes.h" // NOLINT(build/include) +#endif + +inline v8::Local Encode( + const void *buf, size_t len, enum Encoding encoding = BINARY) { +#if (NODE_MODULE_VERSION >= ATOM_0_21_MODULE_VERSION) + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + node::encoding node_enc = static_cast(encoding); + + if (encoding == UCS2) { + return node::Encode( + isolate + , reinterpret_cast(buf) + , len / 2); + } else { + return node::Encode( + isolate + , reinterpret_cast(buf) + , len + , node_enc); + } +#elif (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + return node::Encode( + v8::Isolate::GetCurrent() + , buf, len + , static_cast(encoding)); +#else +# if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION + return node::Encode(buf, len, static_cast(encoding)); +# else + return imp::Encode(reinterpret_cast(buf), len, encoding); +# endif +#endif +} + +inline ssize_t DecodeBytes( + v8::Local val, enum Encoding encoding = BINARY) { +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + return node::DecodeBytes( + v8::Isolate::GetCurrent() + , val + , static_cast(encoding)); +#else +# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION) + if (encoding == BUFFER) { + return node::DecodeBytes(val, node::BINARY); + } +# endif + return node::DecodeBytes(val, static_cast(encoding)); +#endif +} + +inline ssize_t DecodeWrite( + char *buf + , size_t len + , v8::Local val + , enum Encoding encoding = BINARY) { +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + return node::DecodeWrite( + v8::Isolate::GetCurrent() + , buf + , len + , val + , static_cast(encoding)); +#else +# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION) + if (encoding == BUFFER) { + return node::DecodeWrite(buf, len, val, node::BINARY); + } +# endif + return node::DecodeWrite( + buf + , len + , val + , static_cast(encoding)); +#endif +} + +inline void SetPrototypeTemplate( + v8::Local templ + , const char *name + , v8::Local value +) { + HandleScope scope; + SetTemplate(templ->PrototypeTemplate(), name, value); +} + +inline void SetPrototypeTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes +) { + HandleScope scope; + SetTemplate(templ->PrototypeTemplate(), name, value, attributes); +} + +inline void SetInstanceTemplate( + v8::Local templ + , const char *name + , v8::Local value +) { + HandleScope scope; + SetTemplate(templ->InstanceTemplate(), name, value); +} + +inline void SetInstanceTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes +) { + HandleScope scope; + SetTemplate(templ->InstanceTemplate(), name, value, attributes); +} + +namespace imp { + +// Note(@agnat): Helper to distinguish different receiver types. The first +// version deals with receivers derived from v8::Template. The second version +// handles everything else. The final argument only serves as discriminator and +// is unused. +template +inline +void +SetMethodAux(T recv, + v8::Local name, + v8::Local tpl, + v8::Template *) { + recv->Set(name, tpl); +} + +template +inline +void +SetMethodAux(T recv, + v8::Local name, + v8::Local tpl, + ...) { + recv->Set(name, GetFunction(tpl).ToLocalChecked()); +} + +} // end of namespace imp + +template class HandleType> +inline void SetMethod( + HandleType recv + , const char *name + , FunctionCallback callback) { + HandleScope scope; + v8::Local t = New(callback); + v8::Local fn_name = New(name).ToLocalChecked(); + t->SetClassName(fn_name); + // Note(@agnat): Pass an empty T* as discriminator. See note on + // SetMethodAux(...) above + imp::SetMethodAux(recv, fn_name, t, static_cast(0)); +} + +inline void SetPrototypeMethod( + v8::Local recv + , const char* name, FunctionCallback callback) { + HandleScope scope; + v8::Local t = New( + callback + , v8::Local() + , New(recv)); + v8::Local fn_name = New(name).ToLocalChecked(); + recv->PrototypeTemplate()->Set(fn_name, t); + t->SetClassName(fn_name); +} + +//=== Accessors and Such ======================================================= + +inline void SetAccessor( + v8::Local tpl + , v8::Local name + , GetterCallback getter + , SetterCallback setter = 0 + , v8::Local data = v8::Local() + , v8::AccessControl settings = v8::DEFAULT + , v8::PropertyAttribute attribute = v8::None + , imp::Sig signature = imp::Sig()) { + HandleScope scope; + + imp::NativeGetter getter_ = + imp::GetterCallbackWrapper; + imp::NativeSetter setter_ = + setter ? imp::SetterCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kAccessorFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kGetterIndex + , New(reinterpret_cast(getter))); + + if (setter != 0) { + obj->SetInternalField( + imp::kSetterIndex + , New(reinterpret_cast(setter))); + } + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + + tpl->SetAccessor( + name + , getter_ + , setter_ + , obj + , settings + , attribute + , signature); +} + +inline bool SetAccessor( + v8::Local obj + , v8::Local name + , GetterCallback getter + , SetterCallback setter = 0 + , v8::Local data = v8::Local() + , v8::AccessControl settings = v8::DEFAULT + , v8::PropertyAttribute attribute = v8::None) { + HandleScope scope; + + imp::NativeGetter getter_ = + imp::GetterCallbackWrapper; + imp::NativeSetter setter_ = + setter ? imp::SetterCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kAccessorFieldCount); + v8::Local dataobj = NewInstance(otpl).ToLocalChecked(); + + dataobj->SetInternalField( + imp::kGetterIndex + , New(reinterpret_cast(getter))); + + if (!data.IsEmpty()) { + dataobj->SetInternalField(imp::kDataIndex, data); + } + + if (setter) { + dataobj->SetInternalField( + imp::kSetterIndex + , New(reinterpret_cast(setter))); + } + +#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) + return obj->SetAccessor( + GetCurrentContext() + , name + , getter_ + , setter_ + , dataobj + , settings + , attribute).FromMaybe(false); +#else + return obj->SetAccessor( + name + , getter_ + , setter_ + , dataobj + , settings + , attribute); +#endif +} + +inline void SetNamedPropertyHandler( + v8::Local tpl + , PropertyGetterCallback getter + , PropertySetterCallback setter = 0 + , PropertyQueryCallback query = 0 + , PropertyDeleterCallback deleter = 0 + , PropertyEnumeratorCallback enumerator = 0 + , v8::Local data = v8::Local()) { + HandleScope scope; + + imp::NativePropertyGetter getter_ = + imp::PropertyGetterCallbackWrapper; + imp::NativePropertySetter setter_ = + setter ? imp::PropertySetterCallbackWrapper : 0; + imp::NativePropertyQuery query_ = + query ? imp::PropertyQueryCallbackWrapper : 0; + imp::NativePropertyDeleter *deleter_ = + deleter ? imp::PropertyDeleterCallbackWrapper : 0; + imp::NativePropertyEnumerator enumerator_ = + enumerator ? imp::PropertyEnumeratorCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kPropertyFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + obj->SetInternalField( + imp::kPropertyGetterIndex + , New(reinterpret_cast(getter))); + + if (setter) { + obj->SetInternalField( + imp::kPropertySetterIndex + , New(reinterpret_cast(setter))); + } + + if (query) { + obj->SetInternalField( + imp::kPropertyQueryIndex + , New(reinterpret_cast(query))); + } + + if (deleter) { + obj->SetInternalField( + imp::kPropertyDeleterIndex + , New(reinterpret_cast(deleter))); + } + + if (enumerator) { + obj->SetInternalField( + imp::kPropertyEnumeratorIndex + , New(reinterpret_cast(enumerator))); + } + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + tpl->SetHandler(v8::NamedPropertyHandlerConfiguration( + getter_, setter_, query_, deleter_, enumerator_, obj)); +#else + tpl->SetNamedPropertyHandler( + getter_ + , setter_ + , query_ + , deleter_ + , enumerator_ + , obj); +#endif +} + +inline void SetIndexedPropertyHandler( + v8::Local tpl + , IndexGetterCallback getter + , IndexSetterCallback setter = 0 + , IndexQueryCallback query = 0 + , IndexDeleterCallback deleter = 0 + , IndexEnumeratorCallback enumerator = 0 + , v8::Local data = v8::Local()) { + HandleScope scope; + + imp::NativeIndexGetter getter_ = + imp::IndexGetterCallbackWrapper; + imp::NativeIndexSetter setter_ = + setter ? imp::IndexSetterCallbackWrapper : 0; + imp::NativeIndexQuery query_ = + query ? imp::IndexQueryCallbackWrapper : 0; + imp::NativeIndexDeleter deleter_ = + deleter ? imp::IndexDeleterCallbackWrapper : 0; + imp::NativeIndexEnumerator enumerator_ = + enumerator ? imp::IndexEnumeratorCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kIndexPropertyFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + obj->SetInternalField( + imp::kIndexPropertyGetterIndex + , New(reinterpret_cast(getter))); + + if (setter) { + obj->SetInternalField( + imp::kIndexPropertySetterIndex + , New(reinterpret_cast(setter))); + } + + if (query) { + obj->SetInternalField( + imp::kIndexPropertyQueryIndex + , New(reinterpret_cast(query))); + } + + if (deleter) { + obj->SetInternalField( + imp::kIndexPropertyDeleterIndex + , New(reinterpret_cast(deleter))); + } + + if (enumerator) { + obj->SetInternalField( + imp::kIndexPropertyEnumeratorIndex + , New(reinterpret_cast(enumerator))); + } + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + tpl->SetHandler(v8::IndexedPropertyHandlerConfiguration( + getter_, setter_, query_, deleter_, enumerator_, obj)); +#else + tpl->SetIndexedPropertyHandler( + getter_ + , setter_ + , query_ + , deleter_ + , enumerator_ + , obj); +#endif +} + +inline void SetCallHandler( + v8::Local tpl + , FunctionCallback callback + , v8::Local data = v8::Local()) { + HandleScope scope; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , New(reinterpret_cast(callback))); + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + + tpl->SetCallHandler(imp::FunctionCallbackWrapper, obj); +} + + +inline void SetCallAsFunctionHandler( + v8::Local tpl, + FunctionCallback callback, + v8::Local data = v8::Local()) { + HandleScope scope; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , New(reinterpret_cast(callback))); + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + + tpl->SetCallAsFunctionHandler(imp::FunctionCallbackWrapper, obj); +} + +//=== Weak Persistent Handling ================================================= + +#include "nan_weak.h" // NOLINT(build/include) + +//=== ObjectWrap =============================================================== + +#include "nan_object_wrap.h" // NOLINT(build/include) + +//=== HiddenValue/Private ====================================================== + +#include "nan_private.h" // NOLINT(build/include) + +//=== Export ================================================================== + +inline +void +Export(ADDON_REGISTER_FUNCTION_ARGS_TYPE target, const char *name, + FunctionCallback f) { + HandleScope scope; + + Set(target, New(name).ToLocalChecked(), + GetFunction(New(f)).ToLocalChecked()); +} + +//=== Tap Reverse Binding ===================================================== + +struct Tap { + explicit Tap(v8::Local t) : t_() { + HandleScope scope; + + t_.Reset(To(t).ToLocalChecked()); + } + + ~Tap() { t_.Reset(); } // not sure if neccessary + + inline void plan(int i) { + HandleScope scope; + v8::Local arg = New(i); + MakeCallback(New(t_), "plan", 1, &arg); + } + + inline void ok(bool isOk, const char *msg = NULL) { + HandleScope scope; + v8::Local args[2]; + args[0] = New(isOk); + if (msg) args[1] = New(msg).ToLocalChecked(); + MakeCallback(New(t_), "ok", msg ? 2 : 1, args); + } + + inline void pass(const char * msg = NULL) { + HandleScope scope; + v8::Local hmsg; + if (msg) hmsg = New(msg).ToLocalChecked(); + MakeCallback(New(t_), "pass", msg ? 1 : 0, &hmsg); + } + + private: + Persistent t_; +}; + +#define NAN_STRINGIZE2(x) #x +#define NAN_STRINGIZE(x) NAN_STRINGIZE2(x) +#define NAN_TEST_EXPRESSION(expression) \ + ( expression ), __FILE__ ":" NAN_STRINGIZE(__LINE__) ": " #expression + +#define NAN_EXPORT(target, function) Export(target, #function, function) + +#undef TYPE_CHECK + +//=== Generic Maybefication =================================================== + +namespace imp { + +template struct Maybefier; + +template struct Maybefier > { + inline static MaybeLocal convert(v8::Local v) { + return v; + } +}; + +template struct Maybefier > { + inline static MaybeLocal convert(MaybeLocal v) { + return v; + } +}; + +} // end of namespace imp + +template class MaybeMaybe> +inline MaybeLocal +MakeMaybe(MaybeMaybe v) { + return imp::Maybefier >::convert(v); +} + +//=== TypedArrayContents ======================================================= + +#include "nan_typedarray_contents.h" // NOLINT(build/include) + +//=== JSON ===================================================================== + +#include "nan_json.h" // NOLINT(build/include) + +} // end of namespace Nan + +#endif // NAN_H_ diff --git a/node_modules/nan/nan_callbacks.h b/node_modules/nan/nan_callbacks.h new file mode 100755 index 00000000..c612cee2 --- /dev/null +++ b/node_modules/nan/nan_callbacks.h @@ -0,0 +1,88 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CALLBACKS_H_ +#define NAN_CALLBACKS_H_ + +template class FunctionCallbackInfo; +template class PropertyCallbackInfo; +template class Global; + +typedef void(*FunctionCallback)(const FunctionCallbackInfo&); +typedef void(*GetterCallback) + (v8::Local, const PropertyCallbackInfo&); +typedef void(*SetterCallback)( + v8::Local, + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertyGetterCallback)( + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertySetterCallback)( + v8::Local, + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertyEnumeratorCallback) + (const PropertyCallbackInfo&); +typedef void(*PropertyDeleterCallback)( + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertyQueryCallback)( + v8::Local, + const PropertyCallbackInfo&); +typedef void(*IndexGetterCallback)( + uint32_t, + const PropertyCallbackInfo&); +typedef void(*IndexSetterCallback)( + uint32_t, + v8::Local, + const PropertyCallbackInfo&); +typedef void(*IndexEnumeratorCallback) + (const PropertyCallbackInfo&); +typedef void(*IndexDeleterCallback)( + uint32_t, + const PropertyCallbackInfo&); +typedef void(*IndexQueryCallback)( + uint32_t, + const PropertyCallbackInfo&); + +namespace imp { +typedef v8::Local Sig; + +static const int kDataIndex = 0; + +static const int kFunctionIndex = 1; +static const int kFunctionFieldCount = 2; + +static const int kGetterIndex = 1; +static const int kSetterIndex = 2; +static const int kAccessorFieldCount = 3; + +static const int kPropertyGetterIndex = 1; +static const int kPropertySetterIndex = 2; +static const int kPropertyEnumeratorIndex = 3; +static const int kPropertyDeleterIndex = 4; +static const int kPropertyQueryIndex = 5; +static const int kPropertyFieldCount = 6; + +static const int kIndexPropertyGetterIndex = 1; +static const int kIndexPropertySetterIndex = 2; +static const int kIndexPropertyEnumeratorIndex = 3; +static const int kIndexPropertyDeleterIndex = 4; +static const int kIndexPropertyQueryIndex = 5; +static const int kIndexPropertyFieldCount = 6; + +} // end of namespace imp + +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +# include "nan_callbacks_12_inl.h" // NOLINT(build/include) +#else +# include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include) +#endif + +#endif // NAN_CALLBACKS_H_ diff --git a/node_modules/nan/nan_callbacks_12_inl.h b/node_modules/nan/nan_callbacks_12_inl.h new file mode 100755 index 00000000..9c8bf7e2 --- /dev/null +++ b/node_modules/nan/nan_callbacks_12_inl.h @@ -0,0 +1,512 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CALLBACKS_12_INL_H_ +#define NAN_CALLBACKS_12_INL_H_ + +template +class ReturnValue { + v8::ReturnValue value_; + + public: + template + explicit inline ReturnValue(const v8::ReturnValue &value) : + value_(value) {} + template + explicit inline ReturnValue(const ReturnValue& that) + : value_(that.value_) { + TYPE_CHECK(T, S); + } + + // Handle setters + template inline void Set(const v8::Local &handle) { + TYPE_CHECK(T, S); + value_.Set(handle); + } + + template inline void Set(const Global &handle) { + TYPE_CHECK(T, S); +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && \ + (V8_MINOR_VERSION > 5 || (V8_MINOR_VERSION == 5 && \ + defined(V8_BUILD_NUMBER) && V8_BUILD_NUMBER >= 8)))) + value_.Set(handle); +#else + value_.Set(*reinterpret_cast*>(&handle)); + const_cast &>(handle).Reset(); +#endif + } + + // Fast primitive setters + inline void Set(bool value) { + TYPE_CHECK(T, v8::Boolean); + value_.Set(value); + } + + inline void Set(double i) { + TYPE_CHECK(T, v8::Number); + value_.Set(i); + } + + inline void Set(int32_t i) { + TYPE_CHECK(T, v8::Integer); + value_.Set(i); + } + + inline void Set(uint32_t i) { + TYPE_CHECK(T, v8::Integer); + value_.Set(i); + } + + // Fast JS primitive setters + inline void SetNull() { + TYPE_CHECK(T, v8::Primitive); + value_.SetNull(); + } + + inline void SetUndefined() { + TYPE_CHECK(T, v8::Primitive); + value_.SetUndefined(); + } + + inline void SetEmptyString() { + TYPE_CHECK(T, v8::String); + value_.SetEmptyString(); + } + + // Convenience getter for isolate + inline v8::Isolate *GetIsolate() const { + return value_.GetIsolate(); + } + + // Pointer setter: Uncompilable to prevent inadvertent misuse. + template + inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); } +}; + +template +class FunctionCallbackInfo { + const v8::FunctionCallbackInfo &info_; + const v8::Local data_; + + public: + explicit inline FunctionCallbackInfo( + const v8::FunctionCallbackInfo &info + , v8::Local data) : + info_(info) + , data_(data) {} + + inline ReturnValue GetReturnValue() const { + return ReturnValue(info_.GetReturnValue()); + } + + inline v8::Local Callee() const { return info_.Callee(); } + inline v8::Local Data() const { return data_; } + inline v8::Local Holder() const { return info_.Holder(); } + inline bool IsConstructCall() const { return info_.IsConstructCall(); } + inline int Length() const { return info_.Length(); } + inline v8::Local operator[](int i) const { return info_[i]; } + inline v8::Local This() const { return info_.This(); } + inline v8::Isolate *GetIsolate() const { return info_.GetIsolate(); } + + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kCalleeIndex = 5; + static const int kContextSaveIndex = 6; + static const int kArgsLength = 7; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo) +}; + +template +class PropertyCallbackInfo { + const v8::PropertyCallbackInfo &info_; + const v8::Local data_; + + public: + explicit inline PropertyCallbackInfo( + const v8::PropertyCallbackInfo &info + , const v8::Local data) : + info_(info) + , data_(data) {} + + inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); } + inline v8::Local Data() const { return data_; } + inline v8::Local This() const { return info_.This(); } + inline v8::Local Holder() const { return info_.Holder(); } + inline ReturnValue GetReturnValue() const { + return ReturnValue(info_.GetReturnValue()); + } + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kThisIndex = 5; + static const int kArgsLength = 6; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfo) +}; + +namespace imp { +static +void FunctionCallbackWrapper(const v8::FunctionCallbackInfo &info) { + v8::Local obj = info.Data().As(); + FunctionCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kFunctionIndex).As()->Value())); + FunctionCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + callback(cbinfo); +} + +typedef void (*NativeFunction)(const v8::FunctionCallbackInfo &); + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +static +void GetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + GetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kGetterIndex).As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (*NativeGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void SetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + SetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kSetterIndex).As()->Value())); + callback(property.As(), value, cbinfo); +} + +typedef void (*NativeSetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); +#else +static +void GetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + GetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kGetterIndex).As()->Value())); + callback(property, cbinfo); +} + +typedef void (*NativeGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void SetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + SetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kSetterIndex).As()->Value())); + callback(property, value, cbinfo); +} + +typedef void (*NativeSetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); +#endif + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +static +void PropertyGetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyGetterIndex) + .As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (*NativePropertyGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertySetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertySetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertySetterIndex) + .As()->Value())); + callback(property.As(), value, cbinfo); +} + +typedef void (*NativePropertySetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); + +static +void PropertyEnumeratorCallbackWrapper( + const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyEnumeratorCallback callback = + reinterpret_cast(reinterpret_cast( + obj->GetInternalField(kPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); +} + +typedef void (*NativePropertyEnumerator) + (const v8::PropertyCallbackInfo &); + +static +void PropertyDeleterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyDeleterIndex) + .As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (NativePropertyDeleter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertyQueryCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyQueryIndex) + .As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (*NativePropertyQuery) + (v8::Local, const v8::PropertyCallbackInfo &); +#else +static +void PropertyGetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyGetterIndex) + .As()->Value())); + callback(property, cbinfo); +} + +typedef void (*NativePropertyGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertySetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertySetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertySetterIndex) + .As()->Value())); + callback(property, value, cbinfo); +} + +typedef void (*NativePropertySetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); + +static +void PropertyEnumeratorCallbackWrapper( + const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyEnumeratorCallback callback = + reinterpret_cast(reinterpret_cast( + obj->GetInternalField(kPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); +} + +typedef void (*NativePropertyEnumerator) + (const v8::PropertyCallbackInfo &); + +static +void PropertyDeleterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyDeleterIndex) + .As()->Value())); + callback(property, cbinfo); +} + +typedef void (NativePropertyDeleter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertyQueryCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyQueryIndex) + .As()->Value())); + callback(property, cbinfo); +} + +typedef void (*NativePropertyQuery) + (v8::Local, const v8::PropertyCallbackInfo &); +#endif + +static +void IndexGetterCallbackWrapper( + uint32_t index, const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyGetterIndex) + .As()->Value())); + callback(index, cbinfo); +} + +typedef void (*NativeIndexGetter) + (uint32_t, const v8::PropertyCallbackInfo &); + +static +void IndexSetterCallbackWrapper( + uint32_t index + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexSetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertySetterIndex) + .As()->Value())); + callback(index, value, cbinfo); +} + +typedef void (*NativeIndexSetter)( + uint32_t + , v8::Local + , const v8::PropertyCallbackInfo &); + +static +void IndexEnumeratorCallbackWrapper( + const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexEnumeratorCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField( + kIndexPropertyEnumeratorIndex).As()->Value())); + callback(cbinfo); +} + +typedef void (*NativeIndexEnumerator) + (const v8::PropertyCallbackInfo &); + +static +void IndexDeleterCallbackWrapper( + uint32_t index, const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyDeleterIndex) + .As()->Value())); + callback(index, cbinfo); +} + +typedef void (*NativeIndexDeleter) + (uint32_t, const v8::PropertyCallbackInfo &); + +static +void IndexQueryCallbackWrapper( + uint32_t index, const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyQueryIndex) + .As()->Value())); + callback(index, cbinfo); +} + +typedef void (*NativeIndexQuery) + (uint32_t, const v8::PropertyCallbackInfo &); +} // end of namespace imp + +#endif // NAN_CALLBACKS_12_INL_H_ diff --git a/node_modules/nan/nan_callbacks_pre_12_inl.h b/node_modules/nan/nan_callbacks_pre_12_inl.h new file mode 100755 index 00000000..087ee52c --- /dev/null +++ b/node_modules/nan/nan_callbacks_pre_12_inl.h @@ -0,0 +1,520 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CALLBACKS_PRE_12_INL_H_ +#define NAN_CALLBACKS_PRE_12_INL_H_ + +namespace imp { +template class ReturnValueImp; +} // end of namespace imp + +template +class ReturnValue { + v8::Isolate *isolate_; + v8::Persistent *value_; + friend class imp::ReturnValueImp; + + public: + template + explicit inline ReturnValue(v8::Isolate *isolate, v8::Persistent *p) : + isolate_(isolate), value_(p) {} + template + explicit inline ReturnValue(const ReturnValue& that) + : isolate_(that.isolate_), value_(that.value_) { + TYPE_CHECK(T, S); + } + + // Handle setters + template inline void Set(const v8::Local &handle) { + TYPE_CHECK(T, S); + value_->Dispose(); + *value_ = v8::Persistent::New(handle); + } + + template inline void Set(const Global &handle) { + TYPE_CHECK(T, S); + value_->Dispose(); + *value_ = v8::Persistent::New(handle.persistent); + const_cast &>(handle).Reset(); + } + + // Fast primitive setters + inline void Set(bool value) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Boolean); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Boolean::New(value)); + } + + inline void Set(double i) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Number); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Number::New(i)); + } + + inline void Set(int32_t i) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Integer); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Int32::New(i)); + } + + inline void Set(uint32_t i) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Integer); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Uint32::NewFromUnsigned(i)); + } + + // Fast JS primitive setters + inline void SetNull() { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Primitive); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Null()); + } + + inline void SetUndefined() { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Primitive); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Undefined()); + } + + inline void SetEmptyString() { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::String); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::String::Empty()); + } + + // Convenience getter for isolate + inline v8::Isolate *GetIsolate() const { + return isolate_; + } + + // Pointer setter: Uncompilable to prevent inadvertent misuse. + template + inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); } +}; + +template +class FunctionCallbackInfo { + const v8::Arguments &args_; + v8::Local data_; + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline FunctionCallbackInfo( + const v8::Arguments &args + , v8::Local data) : + args_(args) + , data_(data) + , return_value_(args.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Undefined())) {} + + inline ~FunctionCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return ReturnValue(return_value_); + } + + inline v8::Local Callee() const { return args_.Callee(); } + inline v8::Local Data() const { return data_; } + inline v8::Local Holder() const { return args_.Holder(); } + inline bool IsConstructCall() const { return args_.IsConstructCall(); } + inline int Length() const { return args_.Length(); } + inline v8::Local operator[](int i) const { return args_[i]; } + inline v8::Local This() const { return args_.This(); } + inline v8::Isolate *GetIsolate() const { return args_.GetIsolate(); } + + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kCalleeIndex = 5; + static const int kContextSaveIndex = 6; + static const int kArgsLength = 7; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo) +}; + +template +class PropertyCallbackInfoBase { + const v8::AccessorInfo &info_; + const v8::Local data_; + + public: + explicit inline PropertyCallbackInfoBase( + const v8::AccessorInfo &info + , const v8::Local data) : + info_(info) + , data_(data) {} + + inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); } + inline v8::Local Data() const { return data_; } + inline v8::Local This() const { return info_.This(); } + inline v8::Local Holder() const { return info_.Holder(); } + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kThisIndex = 5; + static const int kArgsLength = 6; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfoBase) +}; + +template +class PropertyCallbackInfo : public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Undefined())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { return return_value_; } +}; + +template<> +class PropertyCallbackInfo : + public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Local())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return return_value_; + } +}; + +template<> +class PropertyCallbackInfo : + public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Local())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return return_value_; + } +}; + +template<> +class PropertyCallbackInfo : + public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Local())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return return_value_; + } +}; + +namespace imp { +template +class ReturnValueImp : public ReturnValue { + public: + explicit ReturnValueImp(ReturnValue that) : + ReturnValue(that) {} + inline v8::Handle Value() { + return *ReturnValue::value_; + } +}; + +static +v8::Handle FunctionCallbackWrapper(const v8::Arguments &args) { + v8::Local obj = args.Data().As(); + FunctionCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kFunctionIndex).As()->Value())); + FunctionCallbackInfo + cbinfo(args, obj->GetInternalField(kDataIndex)); + callback(cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeFunction)(const v8::Arguments &); + +static +v8::Handle GetterCallbackWrapper( + v8::Local property, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + GetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kGetterIndex).As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeGetter) + (v8::Local, const v8::AccessorInfo &); + +static +void SetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + SetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kSetterIndex).As()->Value())); + callback(property, value, cbinfo); +} + +typedef void (*NativeSetter) + (v8::Local, v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertyGetterCallbackWrapper( + v8::Local property, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyGetterIndex) + .As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertyGetter) + (v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertySetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertySetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertySetterIndex) + .As()->Value())); + callback(property, value, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertySetter) + (v8::Local, v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertyEnumeratorCallbackWrapper( + const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyEnumeratorCallback callback = + reinterpret_cast(reinterpret_cast( + obj->GetInternalField(kPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertyEnumerator) + (const v8::AccessorInfo &); + +static +v8::Handle PropertyDeleterCallbackWrapper( + v8::Local property + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyDeleterIndex) + .As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (NativePropertyDeleter) + (v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertyQueryCallbackWrapper( + v8::Local property, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyQueryIndex) + .As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertyQuery) + (v8::Local, const v8::AccessorInfo &); + +static +v8::Handle IndexGetterCallbackWrapper( + uint32_t index, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyGetterIndex) + .As()->Value())); + callback(index, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexGetter) + (uint32_t, const v8::AccessorInfo &); + +static +v8::Handle IndexSetterCallbackWrapper( + uint32_t index + , v8::Local value + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexSetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertySetterIndex) + .As()->Value())); + callback(index, value, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexSetter) + (uint32_t, v8::Local, const v8::AccessorInfo &); + +static +v8::Handle IndexEnumeratorCallbackWrapper( + const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexEnumeratorCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexEnumerator) + (const v8::AccessorInfo &); + +static +v8::Handle IndexDeleterCallbackWrapper( + uint32_t index, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyDeleterIndex) + .As()->Value())); + callback(index, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexDeleter) + (uint32_t, const v8::AccessorInfo &); + +static +v8::Handle IndexQueryCallbackWrapper( + uint32_t index, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyQueryIndex) + .As()->Value())); + callback(index, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexQuery) + (uint32_t, const v8::AccessorInfo &); +} // end of namespace imp + +#endif // NAN_CALLBACKS_PRE_12_INL_H_ diff --git a/node_modules/nan/nan_converters.h b/node_modules/nan/nan_converters.h new file mode 100755 index 00000000..9dbd1eca --- /dev/null +++ b/node_modules/nan/nan_converters.h @@ -0,0 +1,64 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CONVERTERS_H_ +#define NAN_CONVERTERS_H_ + +namespace imp { +template struct ToFactoryBase { + typedef MaybeLocal return_t; +}; +template struct ValueFactoryBase { typedef Maybe return_t; }; + +template struct ToFactory; + +#define X(TYPE) \ + template<> \ + struct ToFactory : ToFactoryBase { \ + static inline return_t convert(v8::Local val); \ + }; + +X(Boolean) +X(Number) +X(String) +X(Object) +X(Integer) +X(Uint32) +X(Int32) + +#undef X + +#define X(TYPE) \ + template<> \ + struct ToFactory : ValueFactoryBase { \ + static inline return_t convert(v8::Local val); \ + }; + +X(bool) +X(double) +X(int64_t) +X(uint32_t) +X(int32_t) + +#undef X +} // end of namespace imp + +template +inline +typename imp::ToFactory::return_t To(v8::Local val) { + return imp::ToFactory::convert(val); +} + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +# include "nan_converters_43_inl.h" +#else +# include "nan_converters_pre_43_inl.h" +#endif + +#endif // NAN_CONVERTERS_H_ diff --git a/node_modules/nan/nan_converters_43_inl.h b/node_modules/nan/nan_converters_43_inl.h new file mode 100755 index 00000000..0c7cd500 --- /dev/null +++ b/node_modules/nan/nan_converters_43_inl.h @@ -0,0 +1,48 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CONVERTERS_43_INL_H_ +#define NAN_CONVERTERS_43_INL_H_ + +#define X(TYPE) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ + v8::EscapableHandleScope scope(isolate); \ + return scope.Escape( \ + val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext()) \ + .FromMaybe(v8::Local())); \ +} + +X(Boolean) +X(Number) +X(String) +X(Object) +X(Integer) +X(Uint32) +X(Int32) + +#undef X + +#define X(TYPE, NAME) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ + v8::HandleScope scope(isolate); \ + return val->NAME ## Value(isolate->GetCurrentContext()); \ +} + +X(bool, Boolean) +X(double, Number) +X(int64_t, Integer) +X(uint32_t, Uint32) +X(int32_t, Int32) + +#undef X + +#endif // NAN_CONVERTERS_43_INL_H_ diff --git a/node_modules/nan/nan_converters_pre_43_inl.h b/node_modules/nan/nan_converters_pre_43_inl.h new file mode 100755 index 00000000..3391be22 --- /dev/null +++ b/node_modules/nan/nan_converters_pre_43_inl.h @@ -0,0 +1,42 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CONVERTERS_PRE_43_INL_H_ +#define NAN_CONVERTERS_PRE_43_INL_H_ + +#define X(TYPE) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + return val->To ## TYPE(); \ +} + +X(Boolean) +X(Number) +X(String) +X(Object) +X(Integer) +X(Uint32) +X(Int32) + +#undef X + +#define X(TYPE, NAME) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + return Just(val->NAME ## Value()); \ +} + +X(bool, Boolean) +X(double, Number) +X(int64_t, Integer) +X(uint32_t, Uint32) +X(int32_t, Int32) + +#undef X + +#endif // NAN_CONVERTERS_PRE_43_INL_H_ diff --git a/node_modules/nan/nan_implementation_12_inl.h b/node_modules/nan/nan_implementation_12_inl.h new file mode 100755 index 00000000..be80a45a --- /dev/null +++ b/node_modules/nan/nan_implementation_12_inl.h @@ -0,0 +1,399 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_IMPLEMENTATION_12_INL_H_ +#define NAN_IMPLEMENTATION_12_INL_H_ +//============================================================================== +// node v0.11 implementation +//============================================================================== + +namespace imp { + +//=== Array ==================================================================== + +Factory::return_t +Factory::New() { + return v8::Array::New(v8::Isolate::GetCurrent()); +} + +Factory::return_t +Factory::New(int length) { + return v8::Array::New(v8::Isolate::GetCurrent(), length); +} + +//=== Boolean ================================================================== + +Factory::return_t +Factory::New(bool value) { + return v8::Boolean::New(v8::Isolate::GetCurrent(), value); +} + +//=== Boolean Object =========================================================== + +Factory::return_t +Factory::New(bool value) { +#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) + return v8::BooleanObject::New( + v8::Isolate::GetCurrent(), value).As(); +#else + return v8::BooleanObject::New(value).As(); +#endif +} + +//=== Context ================================================================== + +Factory::return_t +Factory::New( v8::ExtensionConfiguration* extensions + , v8::Local tmpl + , v8::Local obj) { + return v8::Context::New(v8::Isolate::GetCurrent(), extensions, tmpl, obj); +} + +//=== Date ===================================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New(double value) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(v8::Date::New(isolate->GetCurrentContext(), value) + .FromMaybe(v8::Local()).As()); +} +#else +Factory::return_t +Factory::New(double value) { + return v8::Date::New(v8::Isolate::GetCurrent(), value).As(); +} +#endif + +//=== External ================================================================= + +Factory::return_t +Factory::New(void * value) { + return v8::External::New(v8::Isolate::GetCurrent(), value); +} + +//=== Function ================================================================= + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::Local tpl = v8::ObjectTemplate::New(isolate); + tpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(tpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , v8::External::New(isolate, reinterpret_cast(callback))); + + v8::Local val = v8::Local::New(isolate, data); + + if (!val.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, val); + } + + return scope.Escape(v8::Function::New( isolate + , imp::FunctionCallbackWrapper + , obj)); +} + +//=== Function Template ======================================================== + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data + , v8::Local signature) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + if (callback) { + v8::EscapableHandleScope scope(isolate); + v8::Local tpl = v8::ObjectTemplate::New(isolate); + tpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(tpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , v8::External::New(isolate, reinterpret_cast(callback))); + v8::Local val = v8::Local::New(isolate, data); + + if (!val.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, val); + } + + return scope.Escape(v8::FunctionTemplate::New( isolate + , imp::FunctionCallbackWrapper + , obj + , signature)); + } else { + return v8::FunctionTemplate::New(isolate, 0, data, signature); + } +} + +//=== Number =================================================================== + +Factory::return_t +Factory::New(double value) { + return v8::Number::New(v8::Isolate::GetCurrent(), value); +} + +//=== Number Object ============================================================ + +Factory::return_t +Factory::New(double value) { + return v8::NumberObject::New( v8::Isolate::GetCurrent() + , value).As(); +} + +//=== Integer, Int32 and Uint32 ================================================ + +template +typename IntegerFactory::return_t +IntegerFactory::New(int32_t value) { + return To(T::New(v8::Isolate::GetCurrent(), value)); +} + +template +typename IntegerFactory::return_t +IntegerFactory::New(uint32_t value) { + return To(T::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); +} + +Factory::return_t +Factory::New(int32_t value) { + return To( + v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); +} + +Factory::return_t +Factory::New(uint32_t value) { + return To( + v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); +} + +//=== Object =================================================================== + +Factory::return_t +Factory::New() { + return v8::Object::New(v8::Isolate::GetCurrent()); +} + +//=== Object Template ========================================================== + +Factory::return_t +Factory::New() { + return v8::ObjectTemplate::New(v8::Isolate::GetCurrent()); +} + +//=== RegExp =================================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New( + v8::Local pattern + , v8::RegExp::Flags flags) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + v8::RegExp::New(isolate->GetCurrentContext(), pattern, flags) + .FromMaybe(v8::Local())); +} +#else +Factory::return_t +Factory::New( + v8::Local pattern + , v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); +} +#endif + +//=== Script =================================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New( v8::Local source) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source src(source); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src) + .FromMaybe(v8::Local())); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source src(source, origin); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src) + .FromMaybe(v8::Local())); +} +#else +Factory::return_t +Factory::New( v8::Local source) { + v8::ScriptCompiler::Source src(source); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::ScriptCompiler::Source src(source, origin); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); +} +#endif + +//=== Signature ================================================================ + +Factory::return_t +Factory::New(Factory::FTH receiver) { + return v8::Signature::New(v8::Isolate::GetCurrent(), receiver); +} + +//=== String =================================================================== + +Factory::return_t +Factory::New() { + return v8::String::Empty(v8::Isolate::GetCurrent()); +} + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New(const char * value, int length) { + return v8::String::NewFromUtf8( + v8::Isolate::GetCurrent(), value, v8::NewStringType::kNormal, length); +} + +Factory::return_t +Factory::New(std::string const& value) { + assert(value.size() <= INT_MAX && "string too long"); + return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), + value.data(), v8::NewStringType::kNormal, static_cast(value.size())); +} + +Factory::return_t +Factory::New(const uint16_t * value, int length) { + return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value, + v8::NewStringType::kNormal, length); +} + +Factory::return_t +Factory::New(v8::String::ExternalStringResource * value) { + return v8::String::NewExternalTwoByte(v8::Isolate::GetCurrent(), value); +} + +Factory::return_t +Factory::New(ExternalOneByteStringResource * value) { + return v8::String::NewExternalOneByte(v8::Isolate::GetCurrent(), value); +} +#else +Factory::return_t +Factory::New(const char * value, int length) { + return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value, + v8::String::kNormalString, length); +} + +Factory::return_t +Factory::New( + std::string const& value) /* NOLINT(build/include_what_you_use) */ { + assert(value.size() <= INT_MAX && "string too long"); + return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value.data(), + v8::String::kNormalString, + static_cast(value.size())); +} + +Factory::return_t +Factory::New(const uint16_t * value, int length) { + return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value, + v8::String::kNormalString, length); +} + +Factory::return_t +Factory::New(v8::String::ExternalStringResource * value) { + return v8::String::NewExternal(v8::Isolate::GetCurrent(), value); +} + +Factory::return_t +Factory::New(ExternalOneByteStringResource * value) { + return v8::String::NewExternal(v8::Isolate::GetCurrent(), value); +} +#endif + +//=== String Object ============================================================ + +Factory::return_t +Factory::New(v8::Local value) { + return v8::StringObject::New(value).As(); +} + +//=== Unbound Script =========================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New(v8::Local source) { + v8::ScriptCompiler::Source src(source); + return v8::ScriptCompiler::CompileUnboundScript( + v8::Isolate::GetCurrent(), &src); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::ScriptCompiler::Source src(source, origin); + return v8::ScriptCompiler::CompileUnboundScript( + v8::Isolate::GetCurrent(), &src); +} +#else +Factory::return_t +Factory::New(v8::Local source) { + v8::ScriptCompiler::Source src(source); + return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::ScriptCompiler::Source src(source, origin); + return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src); +} +#endif + +} // end of namespace imp + +//=== Presistents and Handles ================================================== + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION +template +inline v8::Local New(v8::Handle h) { + return v8::Local::New(v8::Isolate::GetCurrent(), h); +} +#endif + +template +inline v8::Local New(v8::Persistent const& p) { + return v8::Local::New(v8::Isolate::GetCurrent(), p); +} + +template +inline v8::Local New(Persistent const& p) { + return v8::Local::New(v8::Isolate::GetCurrent(), p); +} + +template +inline v8::Local New(Global const& p) { + return v8::Local::New(v8::Isolate::GetCurrent(), p); +} + +#endif // NAN_IMPLEMENTATION_12_INL_H_ diff --git a/node_modules/nan/nan_implementation_pre_12_inl.h b/node_modules/nan/nan_implementation_pre_12_inl.h new file mode 100755 index 00000000..6afe94ca --- /dev/null +++ b/node_modules/nan/nan_implementation_pre_12_inl.h @@ -0,0 +1,263 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_IMPLEMENTATION_PRE_12_INL_H_ +#define NAN_IMPLEMENTATION_PRE_12_INL_H_ + +//============================================================================== +// node v0.10 implementation +//============================================================================== + +namespace imp { + +//=== Array ==================================================================== + +Factory::return_t +Factory::New() { + return v8::Array::New(); +} + +Factory::return_t +Factory::New(int length) { + return v8::Array::New(length); +} + +//=== Boolean ================================================================== + +Factory::return_t +Factory::New(bool value) { + return v8::Boolean::New(value)->ToBoolean(); +} + +//=== Boolean Object =========================================================== + +Factory::return_t +Factory::New(bool value) { + return v8::BooleanObject::New(value).As(); +} + +//=== Context ================================================================== + +Factory::return_t +Factory::New( v8::ExtensionConfiguration* extensions + , v8::Local tmpl + , v8::Local obj) { + v8::Persistent ctx = v8::Context::New(extensions, tmpl, obj); + v8::Local lctx = v8::Local::New(ctx); + ctx.Dispose(); + return lctx; +} + +//=== Date ===================================================================== + +Factory::return_t +Factory::New(double value) { + return v8::Date::New(value).As(); +} + +//=== External ================================================================= + +Factory::return_t +Factory::New(void * value) { + return v8::External::New(value); +} + +//=== Function ================================================================= + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data) { + v8::HandleScope scope; + + return scope.Close(Factory::New( + callback, data, v8::Local()) + ->GetFunction()); +} + + +//=== FunctionTemplate ========================================================= + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data + , v8::Local signature) { + if (callback) { + v8::HandleScope scope; + + v8::Local tpl = v8::ObjectTemplate::New(); + tpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = tpl->NewInstance(); + + obj->SetInternalField( + imp::kFunctionIndex + , v8::External::New(reinterpret_cast(callback))); + + v8::Local val = v8::Local::New(data); + + if (!val.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, val); + } + + // Note(agnat): Emulate length argument here. Unfortunately, I couldn't find + // a way. Have at it though... + return scope.Close( + v8::FunctionTemplate::New(imp::FunctionCallbackWrapper + , obj + , signature)); + } else { + return v8::FunctionTemplate::New(0, data, signature); + } +} + +//=== Number =================================================================== + +Factory::return_t +Factory::New(double value) { + return v8::Number::New(value); +} + +//=== Number Object ============================================================ + +Factory::return_t +Factory::New(double value) { + return v8::NumberObject::New(value).As(); +} + +//=== Integer, Int32 and Uint32 ================================================ + +template +typename IntegerFactory::return_t +IntegerFactory::New(int32_t value) { + return To(T::New(value)); +} + +template +typename IntegerFactory::return_t +IntegerFactory::New(uint32_t value) { + return To(T::NewFromUnsigned(value)); +} + +Factory::return_t +Factory::New(int32_t value) { + return To(v8::Uint32::NewFromUnsigned(value)); +} + +Factory::return_t +Factory::New(uint32_t value) { + return To(v8::Uint32::NewFromUnsigned(value)); +} + + +//=== Object =================================================================== + +Factory::return_t +Factory::New() { + return v8::Object::New(); +} + +//=== Object Template ========================================================== + +Factory::return_t +Factory::New() { + return v8::ObjectTemplate::New(); +} + +//=== RegExp =================================================================== + +Factory::return_t +Factory::New( + v8::Local pattern + , v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); +} + +//=== Script =================================================================== + +Factory::return_t +Factory::New( v8::Local source) { + return v8::Script::New(source); +} +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + return v8::Script::New(source, const_cast(&origin)); +} + +//=== Signature ================================================================ + +Factory::return_t +Factory::New(Factory::FTH receiver) { + return v8::Signature::New(receiver); +} + +//=== String =================================================================== + +Factory::return_t +Factory::New() { + return v8::String::Empty(); +} + +Factory::return_t +Factory::New(const char * value, int length) { + return v8::String::New(value, length); +} + +Factory::return_t +Factory::New( + std::string const& value) /* NOLINT(build/include_what_you_use) */ { + assert(value.size() <= INT_MAX && "string too long"); + return v8::String::New(value.data(), static_cast(value.size())); +} + +Factory::return_t +Factory::New(const uint16_t * value, int length) { + return v8::String::New(value, length); +} + +Factory::return_t +Factory::New(v8::String::ExternalStringResource * value) { + return v8::String::NewExternal(value); +} + +Factory::return_t +Factory::New(v8::String::ExternalAsciiStringResource * value) { + return v8::String::NewExternal(value); +} + +//=== String Object ============================================================ + +Factory::return_t +Factory::New(v8::Local value) { + return v8::StringObject::New(value).As(); +} + +} // end of namespace imp + +//=== Presistents and Handles ================================================== + +template +inline v8::Local New(v8::Handle h) { + return v8::Local::New(h); +} + +template +inline v8::Local New(v8::Persistent const& p) { + return v8::Local::New(p); +} + +template +inline v8::Local New(Persistent const& p) { + return v8::Local::New(p.persistent); +} + +template +inline v8::Local New(Global const& p) { + return v8::Local::New(p.persistent); +} + +#endif // NAN_IMPLEMENTATION_PRE_12_INL_H_ diff --git a/node_modules/nan/nan_json.h b/node_modules/nan/nan_json.h new file mode 100755 index 00000000..465614b8 --- /dev/null +++ b/node_modules/nan/nan_json.h @@ -0,0 +1,159 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_JSON_H_ +#define NAN_JSON_H_ + +#if NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION +#define NAN_JSON_H_NEED_PARSE 1 +#else +#define NAN_JSON_H_NEED_PARSE 0 +#endif // NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION + +#if NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION +#define NAN_JSON_H_NEED_STRINGIFY 0 +#else +#define NAN_JSON_H_NEED_STRINGIFY 1 +#endif // NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION + +class JSON { + public: + JSON() { +#if NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY + Nan::HandleScope scope; + + Nan::MaybeLocal maybe_global_json = Nan::Get( + Nan::GetCurrentContext()->Global(), + Nan::New("JSON").ToLocalChecked() + ); + + assert(!maybe_global_json.IsEmpty() && "global JSON is empty"); + v8::Local val_global_json = maybe_global_json.ToLocalChecked(); + + assert(val_global_json->IsObject() && "global JSON is not an object"); + Nan::MaybeLocal maybe_obj_global_json = + Nan::To(val_global_json); + + assert(!maybe_obj_global_json.IsEmpty() && "global JSON object is empty"); + v8::Local global_json = maybe_obj_global_json.ToLocalChecked(); + +#if NAN_JSON_H_NEED_PARSE + Nan::MaybeLocal maybe_parse_method = Nan::Get( + global_json, Nan::New("parse").ToLocalChecked() + ); + + assert(!maybe_parse_method.IsEmpty() && "JSON.parse is empty"); + v8::Local parse_method = maybe_parse_method.ToLocalChecked(); + + assert(parse_method->IsFunction() && "JSON.parse is not a function"); + parse_cb_.Reset(parse_method.As()); +#endif // NAN_JSON_H_NEED_PARSE + +#if NAN_JSON_H_NEED_STRINGIFY + Nan::MaybeLocal maybe_stringify_method = Nan::Get( + global_json, Nan::New("stringify").ToLocalChecked() + ); + + assert(!maybe_stringify_method.IsEmpty() && "JSON.stringify is empty"); + v8::Local stringify_method = + maybe_stringify_method.ToLocalChecked(); + + assert( + stringify_method->IsFunction() && "JSON.stringify is not a function" + ); + stringify_cb_.Reset(stringify_method.As()); +#endif // NAN_JSON_H_NEED_STRINGIFY +#endif // NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY + } + + inline + Nan::MaybeLocal Parse(v8::Local json_string) { + Nan::EscapableHandleScope scope; +#if NAN_JSON_H_NEED_PARSE + return scope.Escape(parse(json_string)); +#else + Nan::MaybeLocal result; +#if NODE_MODULE_VERSION == NODE_0_12_MODULE_VERSION + result = v8::JSON::Parse(json_string); +#else +#if NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION + v8::Local context_or_isolate = Nan::GetCurrentContext(); +#else + v8::Isolate* context_or_isolate = v8::Isolate::GetCurrent(); +#endif // NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION + result = v8::JSON::Parse(context_or_isolate, json_string); +#endif // NODE_MODULE_VERSION == NODE_0_12_MODULE_VERSION + if (result.IsEmpty()) return v8::Local(); + return scope.Escape(result.ToLocalChecked()); +#endif // NAN_JSON_H_NEED_PARSE + } + + inline + Nan::MaybeLocal Stringify(v8::Local json_object) { + Nan::EscapableHandleScope scope; + Nan::MaybeLocal result = +#if NAN_JSON_H_NEED_STRINGIFY + Nan::To(stringify(json_object)); +#else + v8::JSON::Stringify(Nan::GetCurrentContext(), json_object); +#endif // NAN_JSON_H_NEED_STRINGIFY + if (result.IsEmpty()) return v8::Local(); + return scope.Escape(result.ToLocalChecked()); + } + + inline + Nan::MaybeLocal Stringify(v8::Local json_object, + v8::Local gap) { + Nan::EscapableHandleScope scope; + Nan::MaybeLocal result = +#if NAN_JSON_H_NEED_STRINGIFY + Nan::To(stringify(json_object, gap)); +#else + v8::JSON::Stringify(Nan::GetCurrentContext(), json_object, gap); +#endif // NAN_JSON_H_NEED_STRINGIFY + if (result.IsEmpty()) return v8::Local(); + return scope.Escape(result.ToLocalChecked()); + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(JSON) +#if NAN_JSON_H_NEED_PARSE + Nan::Callback parse_cb_; +#endif // NAN_JSON_H_NEED_PARSE +#if NAN_JSON_H_NEED_STRINGIFY + Nan::Callback stringify_cb_; +#endif // NAN_JSON_H_NEED_STRINGIFY + +#if NAN_JSON_H_NEED_PARSE + inline v8::Local parse(v8::Local arg) { + assert(!parse_cb_.IsEmpty() && "parse_cb_ is empty"); + return parse_cb_.Call(1, &arg); + } +#endif // NAN_JSON_H_NEED_PARSE + +#if NAN_JSON_H_NEED_STRINGIFY + inline v8::Local stringify(v8::Local arg) { + assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty"); + return stringify_cb_.Call(1, &arg); + } + + inline v8::Local stringify(v8::Local arg, + v8::Local gap) { + assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty"); + + v8::Local argv[] = { + arg, + Nan::Null(), + gap + }; + return stringify_cb_.Call(3, argv); + } +#endif // NAN_JSON_H_NEED_STRINGIFY +}; + +#endif // NAN_JSON_H_ diff --git a/node_modules/nan/nan_maybe_43_inl.h b/node_modules/nan/nan_maybe_43_inl.h new file mode 100755 index 00000000..10eeb023 --- /dev/null +++ b/node_modules/nan/nan_maybe_43_inl.h @@ -0,0 +1,337 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_MAYBE_43_INL_H_ +#define NAN_MAYBE_43_INL_H_ + +template +using MaybeLocal = v8::MaybeLocal; + +template +using Maybe = v8::Maybe; + +template +inline Maybe Nothing() { + return v8::Nothing(); +} + +template +inline Maybe Just(const T& t) { + return v8::Just(t); +} + +inline +MaybeLocal ToDetailString(v8::Local val) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(val->ToDetailString(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal ToArrayIndex(v8::Local val) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(val->ToArrayIndex(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +Maybe Equals(v8::Local a, v8::Local(b)) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return a->Equals(isolate->GetCurrentContext(), b); +} + +inline +MaybeLocal NewInstance(v8::Local h) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(h->NewInstance(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal NewInstance( + v8::Local h + , int argc + , v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(h->NewInstance(isolate->GetCurrentContext(), argc, argv) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal NewInstance(v8::Local h) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(h->NewInstance(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + + +inline MaybeLocal GetFunction( + v8::Local t) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(t->GetFunction(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe Set( + v8::Local obj + , v8::Local key + , v8::Local value) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Set(isolate->GetCurrentContext(), key, value); +} + +inline Maybe Set( + v8::Local obj + , uint32_t index + , v8::Local value) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Set(isolate->GetCurrentContext(), index, value); +} + +inline Maybe ForceSet( + v8::Local obj + , v8::Local key + , v8::Local value + , v8::PropertyAttribute attribs = v8::None) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs); +} + +inline MaybeLocal Get( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->Get(isolate->GetCurrentContext(), key) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal Get(v8::Local obj, uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->Get(isolate->GetCurrentContext(), index) + .FromMaybe(v8::Local())); +} + +inline v8::PropertyAttribute GetPropertyAttributes( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->GetPropertyAttributes(isolate->GetCurrentContext(), key) + .FromJust(); +} + +inline Maybe Has( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Has(isolate->GetCurrentContext(), key); +} + +inline Maybe Has(v8::Local obj, uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Has(isolate->GetCurrentContext(), index); +} + +inline Maybe Delete( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Delete(isolate->GetCurrentContext(), key); +} + +inline +Maybe Delete(v8::Local obj, uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Delete(isolate->GetCurrentContext(), index); +} + +inline +MaybeLocal GetPropertyNames(v8::Local obj) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->GetPropertyNames(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal GetOwnPropertyNames(v8::Local obj) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->GetOwnPropertyNames(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe SetPrototype( + v8::Local obj + , v8::Local prototype) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->SetPrototype(isolate->GetCurrentContext(), prototype); +} + +inline MaybeLocal ObjectProtoToString( + v8::Local obj) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->ObjectProtoToString(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe HasOwnProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasOwnProperty(isolate->GetCurrentContext(), key); +} + +inline Maybe HasRealNamedProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasRealNamedProperty(isolate->GetCurrentContext(), key); +} + +inline Maybe HasRealIndexedProperty( + v8::Local obj + , uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasRealIndexedProperty(isolate->GetCurrentContext(), index); +} + +inline Maybe HasRealNamedCallbackProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasRealNamedCallbackProperty(isolate->GetCurrentContext(), key); +} + +inline MaybeLocal GetRealNamedPropertyInPrototypeChain( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->GetRealNamedPropertyInPrototypeChain( + isolate->GetCurrentContext(), key) + .FromMaybe(v8::Local())); +} + +inline MaybeLocal GetRealNamedProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + obj->GetRealNamedProperty(isolate->GetCurrentContext(), key) + .FromMaybe(v8::Local())); +} + +inline MaybeLocal CallAsFunction( + v8::Local obj + , v8::Local recv + , int argc + , v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + obj->CallAsFunction(isolate->GetCurrentContext(), recv, argc, argv) + .FromMaybe(v8::Local())); +} + +inline MaybeLocal CallAsConstructor( + v8::Local obj + , int argc, v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + obj->CallAsConstructor(isolate->GetCurrentContext(), argc, argv) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal GetSourceLine(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(msg->GetSourceLine(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe GetLineNumber(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return msg->GetLineNumber(isolate->GetCurrentContext()); +} + +inline Maybe GetStartColumn(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return msg->GetStartColumn(isolate->GetCurrentContext()); +} + +inline Maybe GetEndColumn(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return msg->GetEndColumn(isolate->GetCurrentContext()); +} + +inline MaybeLocal CloneElementAt( + v8::Local array + , uint32_t index) { +#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::Local context = isolate->GetCurrentContext(); + v8::Local elem; + v8::Local obj; + if (!array->Get(context, index).ToLocal(&elem)) { + return scope.Escape(obj); + } + if (!elem->ToObject(context).ToLocal(&obj)) { + return scope.Escape(v8::Local()); + } + return scope.Escape(obj->Clone()); +#else + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(array->CloneElementAt(isolate->GetCurrentContext(), index) + .FromMaybe(v8::Local())); +#endif +} + +inline MaybeLocal Call( + v8::Local fun + , v8::Local recv + , int argc + , v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(fun->Call(isolate->GetCurrentContext(), recv, argc, argv) + .FromMaybe(v8::Local())); +} + +#endif // NAN_MAYBE_43_INL_H_ diff --git a/node_modules/nan/nan_maybe_pre_43_inl.h b/node_modules/nan/nan_maybe_pre_43_inl.h new file mode 100755 index 00000000..d47181e7 --- /dev/null +++ b/node_modules/nan/nan_maybe_pre_43_inl.h @@ -0,0 +1,305 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_MAYBE_PRE_43_INL_H_ +#define NAN_MAYBE_PRE_43_INL_H_ + +template +class MaybeLocal { + public: + inline MaybeLocal() : val_(v8::Local()) {} + + template +# if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION + inline + MaybeLocal(v8::Local that) : val_(that) {} // NOLINT(runtime/explicit) +# else + inline + MaybeLocal(v8::Local that) : // NOLINT(runtime/explicit) + val_(*reinterpret_cast*>(&that)) {} +# endif + + inline bool IsEmpty() const { return val_.IsEmpty(); } + + template + inline bool ToLocal(v8::Local *out) const { + *out = val_; + return !IsEmpty(); + } + + inline v8::Local ToLocalChecked() const { +#if defined(V8_ENABLE_CHECKS) + assert(!IsEmpty() && "ToLocalChecked is Empty"); +#endif // V8_ENABLE_CHECKS + return val_; + } + + template + inline v8::Local FromMaybe(v8::Local default_value) const { + return IsEmpty() ? default_value : val_; + } + + private: + v8::Local val_; +}; + +template +class Maybe { + public: + inline bool IsNothing() const { return !has_value_; } + inline bool IsJust() const { return has_value_; } + + inline T FromJust() const { +#if defined(V8_ENABLE_CHECKS) + assert(IsJust() && "FromJust is Nothing"); +#endif // V8_ENABLE_CHECKS + return value_; + } + + inline T FromMaybe(const T& default_value) const { + return has_value_ ? value_ : default_value; + } + + inline bool operator==(const Maybe &other) const { + return (IsJust() == other.IsJust()) && + (!IsJust() || FromJust() == other.FromJust()); + } + + inline bool operator!=(const Maybe &other) const { + return !operator==(other); + } + + private: + Maybe() : has_value_(false) {} + explicit Maybe(const T& t) : has_value_(true), value_(t) {} + bool has_value_; + T value_; + + template + friend Maybe Nothing(); + template + friend Maybe Just(const U& u); +}; + +template +inline Maybe Nothing() { + return Maybe(); +} + +template +inline Maybe Just(const T& t) { + return Maybe(t); +} + +inline +MaybeLocal ToDetailString(v8::Handle val) { + return MaybeLocal(val->ToDetailString()); +} + +inline +MaybeLocal ToArrayIndex(v8::Handle val) { + return MaybeLocal(val->ToArrayIndex()); +} + +inline +Maybe Equals(v8::Handle a, v8::Handle(b)) { + return Just(a->Equals(b)); +} + +inline +MaybeLocal NewInstance(v8::Handle h) { + return MaybeLocal(h->NewInstance()); +} + +inline +MaybeLocal NewInstance( + v8::Local h + , int argc + , v8::Local argv[]) { + return MaybeLocal(h->NewInstance(argc, argv)); +} + +inline +MaybeLocal NewInstance(v8::Handle h) { + return MaybeLocal(h->NewInstance()); +} + +inline +MaybeLocal GetFunction(v8::Handle t) { + return MaybeLocal(t->GetFunction()); +} + +inline Maybe Set( + v8::Handle obj + , v8::Handle key + , v8::Handle value) { + return Just(obj->Set(key, value)); +} + +inline Maybe Set( + v8::Handle obj + , uint32_t index + , v8::Handle value) { + return Just(obj->Set(index, value)); +} + +inline Maybe ForceSet( + v8::Handle obj + , v8::Handle key + , v8::Handle value + , v8::PropertyAttribute attribs = v8::None) { + return Just(obj->ForceSet(key, value, attribs)); +} + +inline MaybeLocal Get( + v8::Handle obj + , v8::Handle key) { + return MaybeLocal(obj->Get(key)); +} + +inline MaybeLocal Get( + v8::Handle obj + , uint32_t index) { + return MaybeLocal(obj->Get(index)); +} + +inline Maybe GetPropertyAttributes( + v8::Handle obj + , v8::Handle key) { + return Just(obj->GetPropertyAttributes(key)); +} + +inline Maybe Has( + v8::Handle obj + , v8::Handle key) { + return Just(obj->Has(key)); +} + +inline Maybe Has( + v8::Handle obj + , uint32_t index) { + return Just(obj->Has(index)); +} + +inline Maybe Delete( + v8::Handle obj + , v8::Handle key) { + return Just(obj->Delete(key)); +} + +inline Maybe Delete( + v8::Handle obj + , uint32_t index) { + return Just(obj->Delete(index)); +} + +inline +MaybeLocal GetPropertyNames(v8::Handle obj) { + return MaybeLocal(obj->GetPropertyNames()); +} + +inline +MaybeLocal GetOwnPropertyNames(v8::Handle obj) { + return MaybeLocal(obj->GetOwnPropertyNames()); +} + +inline Maybe SetPrototype( + v8::Handle obj + , v8::Handle prototype) { + return Just(obj->SetPrototype(prototype)); +} + +inline MaybeLocal ObjectProtoToString( + v8::Handle obj) { + return MaybeLocal(obj->ObjectProtoToString()); +} + +inline Maybe HasOwnProperty( + v8::Handle obj + , v8::Handle key) { + return Just(obj->HasOwnProperty(key)); +} + +inline Maybe HasRealNamedProperty( + v8::Handle obj + , v8::Handle key) { + return Just(obj->HasRealNamedProperty(key)); +} + +inline Maybe HasRealIndexedProperty( + v8::Handle obj + , uint32_t index) { + return Just(obj->HasRealIndexedProperty(index)); +} + +inline Maybe HasRealNamedCallbackProperty( + v8::Handle obj + , v8::Handle key) { + return Just(obj->HasRealNamedCallbackProperty(key)); +} + +inline MaybeLocal GetRealNamedPropertyInPrototypeChain( + v8::Handle obj + , v8::Handle key) { + return MaybeLocal( + obj->GetRealNamedPropertyInPrototypeChain(key)); +} + +inline MaybeLocal GetRealNamedProperty( + v8::Handle obj + , v8::Handle key) { + return MaybeLocal(obj->GetRealNamedProperty(key)); +} + +inline MaybeLocal CallAsFunction( + v8::Handle obj + , v8::Handle recv + , int argc + , v8::Handle argv[]) { + return MaybeLocal(obj->CallAsFunction(recv, argc, argv)); +} + +inline MaybeLocal CallAsConstructor( + v8::Handle obj + , int argc + , v8::Local argv[]) { + return MaybeLocal(obj->CallAsConstructor(argc, argv)); +} + +inline +MaybeLocal GetSourceLine(v8::Handle msg) { + return MaybeLocal(msg->GetSourceLine()); +} + +inline Maybe GetLineNumber(v8::Handle msg) { + return Just(msg->GetLineNumber()); +} + +inline Maybe GetStartColumn(v8::Handle msg) { + return Just(msg->GetStartColumn()); +} + +inline Maybe GetEndColumn(v8::Handle msg) { + return Just(msg->GetEndColumn()); +} + +inline MaybeLocal CloneElementAt( + v8::Handle array + , uint32_t index) { + return MaybeLocal(array->CloneElementAt(index)); +} + +inline MaybeLocal Call( + v8::Local fun + , v8::Local recv + , int argc + , v8::Local argv[]) { + return MaybeLocal(fun->Call(recv, argc, argv)); +} + +#endif // NAN_MAYBE_PRE_43_INL_H_ diff --git a/node_modules/nan/nan_new.h b/node_modules/nan/nan_new.h new file mode 100755 index 00000000..628f40cb --- /dev/null +++ b/node_modules/nan/nan_new.h @@ -0,0 +1,340 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_NEW_H_ +#define NAN_NEW_H_ + +namespace imp { // scnr + +// TODO(agnat): Generalize +template v8::Local To(v8::Local i); + +template <> +inline +v8::Local +To(v8::Local i) { + return Nan::To(i).ToLocalChecked(); +} + +template <> +inline +v8::Local +To(v8::Local i) { + return Nan::To(i).ToLocalChecked(); +} + +template <> +inline +v8::Local +To(v8::Local i) { + return Nan::To(i).ToLocalChecked(); +} + +template struct FactoryBase { + typedef v8::Local return_t; +}; + +template struct MaybeFactoryBase { + typedef MaybeLocal return_t; +}; + +template struct Factory; + +template <> +struct Factory : FactoryBase { + static inline return_t New(); + static inline return_t New(int length); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(bool value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(bool value); +}; + +template <> +struct Factory : FactoryBase { + static inline + return_t + New( v8::ExtensionConfiguration* extensions = NULL + , v8::Local tmpl = v8::Local() + , v8::Local obj = v8::Local()); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New(double value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(void *value); +}; + +template <> +struct Factory : FactoryBase { + static inline + return_t + New( FunctionCallback callback + , v8::Local data = v8::Local()); +}; + +template <> +struct Factory : FactoryBase { + static inline + return_t + New( FunctionCallback callback = NULL + , v8::Local data = v8::Local() + , v8::Local signature = v8::Local()); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(double value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(double value); +}; + +template +struct IntegerFactory : FactoryBase { + typedef typename FactoryBase::return_t return_t; + static inline return_t New(int32_t value); + static inline return_t New(uint32_t value); +}; + +template <> +struct Factory : IntegerFactory {}; + +template <> +struct Factory : IntegerFactory {}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(int32_t value); + static inline return_t New(uint32_t value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New( + v8::Local pattern, v8::RegExp::Flags flags); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New( v8::Local source); + static inline return_t New( v8::Local source + , v8::ScriptOrigin const& origin); +}; + +template <> +struct Factory : FactoryBase { + typedef v8::Local FTH; + static inline return_t New(FTH receiver = FTH()); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New(); + static inline return_t New(const char *value, int length = -1); + static inline return_t New(const uint16_t *value, int length = -1); + static inline return_t New(std::string const& value); + + static inline return_t New(v8::String::ExternalStringResource * value); + static inline return_t New(ExternalOneByteStringResource * value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(v8::Local value); +}; + +} // end of namespace imp + +#if (NODE_MODULE_VERSION >= 12) + +namespace imp { + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New( v8::Local source); + static inline return_t New( v8::Local source + , v8::ScriptOrigin const& origin); +}; + +} // end of namespace imp + +# include "nan_implementation_12_inl.h" + +#else // NODE_MODULE_VERSION >= 12 + +# include "nan_implementation_pre_12_inl.h" + +#endif + +//=== API ====================================================================== + +template +typename imp::Factory::return_t +New() { + return imp::Factory::New(); +} + +template +typename imp::Factory::return_t +New(A0 arg0) { + return imp::Factory::New(arg0); +} + +template +typename imp::Factory::return_t +New(A0 arg0, A1 arg1) { + return imp::Factory::New(arg0, arg1); +} + +template +typename imp::Factory::return_t +New(A0 arg0, A1 arg1, A2 arg2) { + return imp::Factory::New(arg0, arg1, arg2); +} + +template +typename imp::Factory::return_t +New(A0 arg0, A1 arg1, A2 arg2, A3 arg3) { + return imp::Factory::New(arg0, arg1, arg2, arg3); +} + +// Note(agnat): When passing overloaded function pointers to template functions +// as generic arguments the compiler needs help in picking the right overload. +// These two functions handle New and New with +// all argument variations. + +// v8::Function and v8::FunctionTemplate with one or two arguments +template +typename imp::Factory::return_t +New( FunctionCallback callback + , v8::Local data = v8::Local()) { + return imp::Factory::New(callback, data); +} + +// v8::Function and v8::FunctionTemplate with three arguments +template +typename imp::Factory::return_t +New( FunctionCallback callback + , v8::Local data = v8::Local() + , A2 a2 = A2()) { + return imp::Factory::New(callback, data, a2); +} + +// Convenience + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION +template inline v8::Local New(v8::Handle h); +#endif + +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +template + inline v8::Local New(v8::Persistent const& p); +#else +template inline v8::Local New(v8::Persistent const& p); +#endif +template +inline v8::Local New(Persistent const& p); +template +inline v8::Local New(Global const& p); + +inline +imp::Factory::return_t +New(bool value) { + return New(value); +} + +inline +imp::Factory::return_t +New(int32_t value) { + return New(value); +} + +inline +imp::Factory::return_t +New(uint32_t value) { + return New(value); +} + +inline +imp::Factory::return_t +New(double value) { + return New(value); +} + +inline +imp::Factory::return_t +New(std::string const& value) { // NOLINT(build/include_what_you_use) + return New(value); +} + +inline +imp::Factory::return_t +New(const char * value, int length) { + return New(value, length); +} + +inline +imp::Factory::return_t +New(const uint16_t * value, int length) { + return New(value, length); +} + +inline +imp::Factory::return_t +New(const char * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(const uint16_t * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(v8::String::ExternalStringResource * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(ExternalOneByteStringResource * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(v8::Local pattern, v8::RegExp::Flags flags) { + return New(pattern, flags); +} + +#endif // NAN_NEW_H_ diff --git a/node_modules/nan/nan_object_wrap.h b/node_modules/nan/nan_object_wrap.h new file mode 100755 index 00000000..28281b0e --- /dev/null +++ b/node_modules/nan/nan_object_wrap.h @@ -0,0 +1,155 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_OBJECT_WRAP_H_ +#define NAN_OBJECT_WRAP_H_ + +class ObjectWrap { + public: + ObjectWrap() { + refs_ = 0; + } + + + virtual ~ObjectWrap() { + if (persistent().IsEmpty()) { + return; + } + + assert(persistent().IsNearDeath()); + persistent().ClearWeak(); + persistent().Reset(); + } + + + template + static inline T* Unwrap(v8::Local object) { + assert(!object.IsEmpty()); + assert(object->InternalFieldCount() > 0); + // Cast to ObjectWrap before casting to T. A direct cast from void + // to T won't work right when T has more than one base class. + void* ptr = GetInternalFieldPointer(object, 0); + ObjectWrap* wrap = static_cast(ptr); + return static_cast(wrap); + } + + + inline v8::Local handle() const { + return New(handle_); + } + + + inline Persistent& persistent() { + return handle_; + } + + + protected: + inline void Wrap(v8::Local object) { + assert(persistent().IsEmpty()); + assert(object->InternalFieldCount() > 0); + SetInternalFieldPointer(object, 0, this); + persistent().Reset(object); + MakeWeak(); + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + + inline void MakeWeak() { + persistent().v8::PersistentBase::SetWeak( + this, WeakCallback, v8::WeakCallbackType::kParameter); + persistent().MarkIndependent(); + } + +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + + inline void MakeWeak() { + persistent().v8::PersistentBase::SetWeak(this, WeakCallback); + persistent().MarkIndependent(); + } + +#else + + inline void MakeWeak() { + persistent().persistent.MakeWeak(this, WeakCallback); + persistent().MarkIndependent(); + } + +#endif + + /* Ref() marks the object as being attached to an event loop. + * Refed objects will not be garbage collected, even if + * all references are lost. + */ + virtual void Ref() { + assert(!persistent().IsEmpty()); + persistent().ClearWeak(); + refs_++; + } + + /* Unref() marks an object as detached from the event loop. This is its + * default state. When an object with a "weak" reference changes from + * attached to detached state it will be freed. Be careful not to access + * the object after making this call as it might be gone! + * (A "weak reference" means an object that only has a + * persistant handle.) + * + * DO NOT CALL THIS FROM DESTRUCTOR + */ + virtual void Unref() { + assert(!persistent().IsEmpty()); + assert(!persistent().IsWeak()); + assert(refs_ > 0); + if (--refs_ == 0) + MakeWeak(); + } + + int refs_; // ro + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap) +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + + static void + WeakCallback(v8::WeakCallbackInfo const& info) { + ObjectWrap* wrap = info.GetParameter(); + assert(wrap->refs_ == 0); + assert(wrap->handle_.IsNearDeath()); + wrap->handle_.Reset(); + delete wrap; + } + +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + + static void + WeakCallback(v8::WeakCallbackData const& data) { + ObjectWrap* wrap = data.GetParameter(); + assert(wrap->refs_ == 0); + assert(wrap->handle_.IsNearDeath()); + wrap->handle_.Reset(); + delete wrap; + } + +#else + + static void WeakCallback(v8::Persistent value, void *data) { + ObjectWrap *wrap = static_cast(data); + assert(wrap->refs_ == 0); + assert(wrap->handle_.IsNearDeath()); + wrap->handle_.Reset(); + delete wrap; + } + +#endif + Persistent handle_; +}; + + +#endif // NAN_OBJECT_WRAP_H_ diff --git a/node_modules/nan/nan_persistent_12_inl.h b/node_modules/nan/nan_persistent_12_inl.h new file mode 100755 index 00000000..a23d8995 --- /dev/null +++ b/node_modules/nan/nan_persistent_12_inl.h @@ -0,0 +1,132 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_PERSISTENT_12_INL_H_ +#define NAN_PERSISTENT_12_INL_H_ + +template class Persistent : + public v8::Persistent { + public: + inline Persistent() : v8::Persistent() {} + + template inline Persistent(v8::Local that) : + v8::Persistent(v8::Isolate::GetCurrent(), that) {} + + template + inline + Persistent(const v8::Persistent &that) : // NOLINT(runtime/explicit) + v8::Persistent(v8::Isolate::GetCurrent(), that) {} + + inline void Reset() { v8::PersistentBase::Reset(); } + + template + inline void Reset(const v8::Local &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void Reset(const v8::PersistentBase &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type); + + private: + inline T *operator*() const { return *PersistentBase::persistent; } + + template + inline void Copy(const Persistent &that) { + TYPE_CHECK(T, S); + + this->Reset(); + + if (!that.IsEmpty()) { + this->Reset(that); + M::Copy(that, this); + } + } +}; + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +template +class Global : public v8::Global { + public: + inline Global() : v8::Global() {} + + template inline Global(v8::Local that) : + v8::Global(v8::Isolate::GetCurrent(), that) {} + + template + inline + Global(const v8::PersistentBase &that) : // NOLINT(runtime/explicit) + v8::Global(v8::Isolate::GetCurrent(), that) {} + + inline void Reset() { v8::PersistentBase::Reset(); } + + template + inline void Reset(const v8::Local &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void Reset(const v8::PersistentBase &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type) { + reinterpret_cast*>(this)->SetWeak( + parameter, callback, type); + } +}; +#else +template +class Global : public v8::UniquePersistent { + public: + inline Global() : v8::UniquePersistent() {} + + template inline Global(v8::Local that) : + v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} + + template + inline + Global(const v8::PersistentBase &that) : // NOLINT(runtime/explicit) + v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} + + inline void Reset() { v8::PersistentBase::Reset(); } + + template + inline void Reset(const v8::Local &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void Reset(const v8::PersistentBase &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type) { + reinterpret_cast*>(this)->SetWeak( + parameter, callback, type); + } +}; +#endif + +#endif // NAN_PERSISTENT_12_INL_H_ diff --git a/node_modules/nan/nan_persistent_pre_12_inl.h b/node_modules/nan/nan_persistent_pre_12_inl.h new file mode 100755 index 00000000..f915746c --- /dev/null +++ b/node_modules/nan/nan_persistent_pre_12_inl.h @@ -0,0 +1,242 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_PERSISTENT_PRE_12_INL_H_ +#define NAN_PERSISTENT_PRE_12_INL_H_ + +template +class PersistentBase { + v8::Persistent persistent; + template + friend v8::Local New(const PersistentBase &p); + template + friend v8::Local New(const Persistent &p); + template + friend v8::Local New(const Global &p); + template friend class ReturnValue; + + public: + inline PersistentBase() : + persistent() {} + + inline void Reset() { + persistent.Dispose(); + persistent.Clear(); + } + + template + inline void Reset(const v8::Local &other) { + TYPE_CHECK(T, S); + + if (!persistent.IsEmpty()) { + persistent.Dispose(); + } + + if (other.IsEmpty()) { + persistent.Clear(); + } else { + persistent = v8::Persistent::New(other); + } + } + + template + inline void Reset(const PersistentBase &other) { + TYPE_CHECK(T, S); + + if (!persistent.IsEmpty()) { + persistent.Dispose(); + } + + if (other.IsEmpty()) { + persistent.Clear(); + } else { + persistent = v8::Persistent::New(other.persistent); + } + } + + inline bool IsEmpty() const { return persistent.IsEmpty(); } + + inline void Empty() { persistent.Clear(); } + + template + inline bool operator==(const PersistentBase &that) const { + return this->persistent == that.persistent; + } + + template + inline bool operator==(const v8::Local &that) const { + return this->persistent == that; + } + + template + inline bool operator!=(const PersistentBase &that) const { + return !operator==(that); + } + + template + inline bool operator!=(const v8::Local &that) const { + return !operator==(that); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type); + + inline void ClearWeak() { persistent.ClearWeak(); } + + inline void MarkIndependent() { persistent.MarkIndependent(); } + + inline bool IsIndependent() const { return persistent.IsIndependent(); } + + inline bool IsNearDeath() const { return persistent.IsNearDeath(); } + + inline bool IsWeak() const { return persistent.IsWeak(); } + + private: + inline explicit PersistentBase(v8::Persistent that) : + persistent(that) { } + inline explicit PersistentBase(T *val) : persistent(val) {} + template friend class Persistent; + template friend class Global; + friend class ObjectWrap; +}; + +template +class NonCopyablePersistentTraits { + public: + typedef Persistent > + NonCopyablePersistent; + static const bool kResetInDestructor = false; + template + inline static void Copy(const Persistent &source, + NonCopyablePersistent *dest) { + Uncompilable(); + } + + template inline static void Uncompilable() { + TYPE_CHECK(O, v8::Primitive); + } +}; + +template +struct CopyablePersistentTraits { + typedef Persistent > CopyablePersistent; + static const bool kResetInDestructor = true; + template + static inline void Copy(const Persistent &source, + CopyablePersistent *dest) {} +}; + +template class Persistent : + public PersistentBase { + public: + inline Persistent() {} + + template inline Persistent(v8::Handle that) + : PersistentBase(v8::Persistent::New(that)) { + TYPE_CHECK(T, S); + } + + inline Persistent(const Persistent &that) : PersistentBase() { + Copy(that); + } + + template + inline Persistent(const Persistent &that) : + PersistentBase() { + Copy(that); + } + + inline Persistent &operator=(const Persistent &that) { + Copy(that); + return *this; + } + + template + inline Persistent &operator=(const Persistent &that) { + Copy(that); + return *this; + } + + inline ~Persistent() { + if (M::kResetInDestructor) this->Reset(); + } + + private: + inline T *operator*() const { return *PersistentBase::persistent; } + + template + inline void Copy(const Persistent &that) { + TYPE_CHECK(T, S); + + this->Reset(); + + if (!that.IsEmpty()) { + this->persistent = v8::Persistent::New(that.persistent); + M::Copy(that, this); + } + } +}; + +template +class Global : public PersistentBase { + struct RValue { + inline explicit RValue(Global* obj) : object(obj) {} + Global* object; + }; + + public: + inline Global() : PersistentBase(0) { } + + template + inline Global(v8::Local that) // NOLINT(runtime/explicit) + : PersistentBase(v8::Persistent::New(that)) { + TYPE_CHECK(T, S); + } + + template + inline Global(const PersistentBase &that) // NOLINT(runtime/explicit) + : PersistentBase(that) { + TYPE_CHECK(T, S); + } + /** + * Move constructor. + */ + inline Global(RValue rvalue) // NOLINT(runtime/explicit) + : PersistentBase(rvalue.object->persistent) { + rvalue.object->Reset(); + } + inline ~Global() { this->Reset(); } + /** + * Move via assignment. + */ + template + inline Global &operator=(Global rhs) { + TYPE_CHECK(T, S); + this->Reset(rhs.persistent); + rhs.Reset(); + return *this; + } + /** + * Cast operator for moves. + */ + inline operator RValue() { return RValue(this); } + /** + * Pass allows returning uniques from functions, etc. + */ + Global Pass() { return Global(RValue(this)); } + + private: + Global(Global &); + void operator=(Global &); + template friend class ReturnValue; +}; + +#endif // NAN_PERSISTENT_PRE_12_INL_H_ diff --git a/node_modules/nan/nan_private.h b/node_modules/nan/nan_private.h new file mode 100755 index 00000000..03082cd7 --- /dev/null +++ b/node_modules/nan/nan_private.h @@ -0,0 +1,73 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_PRIVATE_H_ +#define NAN_PRIVATE_H_ + +inline Maybe +HasPrivate(v8::Local object, v8::Local key) { + HandleScope scope; +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::Local context = isolate->GetCurrentContext(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + return object->HasPrivate(context, private_key); +#else + return Just(!object->GetHiddenValue(key).IsEmpty()); +#endif +} + +inline MaybeLocal +GetPrivate(v8::Local object, v8::Local key) { +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::Local context = isolate->GetCurrentContext(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + v8::MaybeLocal v = object->GetPrivate(context, private_key); + return scope.Escape(v.ToLocalChecked()); +#else + EscapableHandleScope scope; + v8::Local v = object->GetHiddenValue(key); + if (v.IsEmpty()) { + v = Undefined(); + } + return scope.Escape(v); +#endif +} + +inline Maybe SetPrivate( + v8::Local object, + v8::Local key, + v8::Local value) { +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + HandleScope scope; + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::Local context = isolate->GetCurrentContext(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + return object->SetPrivate(context, private_key, value); +#else + return Just(object->SetHiddenValue(key, value)); +#endif +} + +inline Maybe DeletePrivate( + v8::Local object, + v8::Local key) { +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + HandleScope scope; + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + return object->DeletePrivate(isolate->GetCurrentContext(), private_key); +#else + return Just(object->DeleteHiddenValue(key)); +#endif +} + +#endif // NAN_PRIVATE_H_ + diff --git a/node_modules/nan/nan_string_bytes.h b/node_modules/nan/nan_string_bytes.h new file mode 100755 index 00000000..a2e6437d --- /dev/null +++ b/node_modules/nan/nan_string_bytes.h @@ -0,0 +1,305 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +#ifndef NAN_STRING_BYTES_H_ +#define NAN_STRING_BYTES_H_ + +// Decodes a v8::Local or Buffer to a raw char* + +namespace imp { + +using v8::Local; +using v8::Object; +using v8::String; +using v8::Value; + + +//// Base 64 //// + +#define base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4) + + + +//// HEX //// + +static bool contains_non_ascii_slow(const char* buf, size_t len) { + for (size_t i = 0; i < len; ++i) { + if (buf[i] & 0x80) return true; + } + return false; +} + + +static bool contains_non_ascii(const char* src, size_t len) { + if (len < 16) { + return contains_non_ascii_slow(src, len); + } + + const unsigned bytes_per_word = sizeof(void*); + const unsigned align_mask = bytes_per_word - 1; + const unsigned unaligned = reinterpret_cast(src) & align_mask; + + if (unaligned > 0) { + const unsigned n = bytes_per_word - unaligned; + if (contains_non_ascii_slow(src, n)) return true; + src += n; + len -= n; + } + + +#if defined(__x86_64__) || defined(_WIN64) + const uintptr_t mask = 0x8080808080808080ll; +#else + const uintptr_t mask = 0x80808080l; +#endif + + const uintptr_t* srcw = reinterpret_cast(src); + + for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) { + if (srcw[i] & mask) return true; + } + + const unsigned remainder = len & align_mask; + if (remainder > 0) { + const size_t offset = len - remainder; + if (contains_non_ascii_slow(src + offset, remainder)) return true; + } + + return false; +} + + +static void force_ascii_slow(const char* src, char* dst, size_t len) { + for (size_t i = 0; i < len; ++i) { + dst[i] = src[i] & 0x7f; + } +} + + +static void force_ascii(const char* src, char* dst, size_t len) { + if (len < 16) { + force_ascii_slow(src, dst, len); + return; + } + + const unsigned bytes_per_word = sizeof(void*); + const unsigned align_mask = bytes_per_word - 1; + const unsigned src_unalign = reinterpret_cast(src) & align_mask; + const unsigned dst_unalign = reinterpret_cast(dst) & align_mask; + + if (src_unalign > 0) { + if (src_unalign == dst_unalign) { + const unsigned unalign = bytes_per_word - src_unalign; + force_ascii_slow(src, dst, unalign); + src += unalign; + dst += unalign; + len -= src_unalign; + } else { + force_ascii_slow(src, dst, len); + return; + } + } + +#if defined(__x86_64__) || defined(_WIN64) + const uintptr_t mask = ~0x8080808080808080ll; +#else + const uintptr_t mask = ~0x80808080l; +#endif + + const uintptr_t* srcw = reinterpret_cast(src); + uintptr_t* dstw = reinterpret_cast(dst); + + for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) { + dstw[i] = srcw[i] & mask; + } + + const unsigned remainder = len & align_mask; + if (remainder > 0) { + const size_t offset = len - remainder; + force_ascii_slow(src + offset, dst + offset, remainder); + } +} + + +static size_t base64_encode(const char* src, + size_t slen, + char* dst, + size_t dlen) { + // We know how much we'll write, just make sure that there's space. + assert(dlen >= base64_encoded_size(slen) && + "not enough space provided for base64 encode"); + + dlen = base64_encoded_size(slen); + + unsigned a; + unsigned b; + unsigned c; + unsigned i; + unsigned k; + unsigned n; + + static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + + i = 0; + k = 0; + n = slen / 3 * 3; + + while (i < n) { + a = src[i + 0] & 0xff; + b = src[i + 1] & 0xff; + c = src[i + 2] & 0xff; + + dst[k + 0] = table[a >> 2]; + dst[k + 1] = table[((a & 3) << 4) | (b >> 4)]; + dst[k + 2] = table[((b & 0x0f) << 2) | (c >> 6)]; + dst[k + 3] = table[c & 0x3f]; + + i += 3; + k += 4; + } + + if (n != slen) { + switch (slen - n) { + case 1: + a = src[i + 0] & 0xff; + dst[k + 0] = table[a >> 2]; + dst[k + 1] = table[(a & 3) << 4]; + dst[k + 2] = '='; + dst[k + 3] = '='; + break; + + case 2: + a = src[i + 0] & 0xff; + b = src[i + 1] & 0xff; + dst[k + 0] = table[a >> 2]; + dst[k + 1] = table[((a & 3) << 4) | (b >> 4)]; + dst[k + 2] = table[(b & 0x0f) << 2]; + dst[k + 3] = '='; + break; + } + } + + return dlen; +} + + +static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) { + // We know how much we'll write, just make sure that there's space. + assert(dlen >= slen * 2 && + "not enough space provided for hex encode"); + + dlen = slen * 2; + for (uint32_t i = 0, k = 0; k < dlen; i += 1, k += 2) { + static const char hex[] = "0123456789abcdef"; + uint8_t val = static_cast(src[i]); + dst[k + 0] = hex[val >> 4]; + dst[k + 1] = hex[val & 15]; + } + + return dlen; +} + + + +static Local Encode(const char* buf, + size_t buflen, + enum Encoding encoding) { + assert(buflen <= node::Buffer::kMaxLength); + if (!buflen && encoding != BUFFER) + return New("").ToLocalChecked(); + + Local val; + switch (encoding) { + case BUFFER: + return CopyBuffer(buf, buflen).ToLocalChecked(); + + case ASCII: + if (contains_non_ascii(buf, buflen)) { + char* out = new char[buflen]; + force_ascii(buf, out, buflen); + val = New(out, buflen).ToLocalChecked(); + delete[] out; + } else { + val = New(buf, buflen).ToLocalChecked(); + } + break; + + case UTF8: + val = New(buf, buflen).ToLocalChecked(); + break; + + case BINARY: { + // TODO(isaacs) use ExternalTwoByteString? + const unsigned char *cbuf = reinterpret_cast(buf); + uint16_t * twobytebuf = new uint16_t[buflen]; + for (size_t i = 0; i < buflen; i++) { + // XXX is the following line platform independent? + twobytebuf[i] = cbuf[i]; + } + val = New(twobytebuf, buflen).ToLocalChecked(); + delete[] twobytebuf; + break; + } + + case BASE64: { + size_t dlen = base64_encoded_size(buflen); + char* dst = new char[dlen]; + + size_t written = base64_encode(buf, buflen, dst, dlen); + assert(written == dlen); + + val = New(dst, dlen).ToLocalChecked(); + delete[] dst; + break; + } + + case UCS2: { + const uint16_t* data = reinterpret_cast(buf); + val = New(data, buflen / 2).ToLocalChecked(); + break; + } + + case HEX: { + size_t dlen = buflen * 2; + char* dst = new char[dlen]; + size_t written = hex_encode(buf, buflen, dst, dlen); + assert(written == dlen); + + val = New(dst, dlen).ToLocalChecked(); + delete[] dst; + break; + } + + default: + assert(0 && "unknown encoding"); + break; + } + + return val; +} + +#undef base64_encoded_size + +} // end of namespace imp + +#endif // NAN_STRING_BYTES_H_ diff --git a/node_modules/nan/nan_typedarray_contents.h b/node_modules/nan/nan_typedarray_contents.h new file mode 100755 index 00000000..17c96818 --- /dev/null +++ b/node_modules/nan/nan_typedarray_contents.h @@ -0,0 +1,90 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_TYPEDARRAY_CONTENTS_H_ +#define NAN_TYPEDARRAY_CONTENTS_H_ + +template +class TypedArrayContents { + public: + inline explicit TypedArrayContents(v8::Local from) : + length_(0), data_(NULL) { + HandleScope scope; + + size_t length = 0; + void* data = NULL; + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + + if (from->IsArrayBufferView()) { + v8::Local array = + v8::Local::Cast(from); + + const size_t byte_length = array->ByteLength(); + const ptrdiff_t byte_offset = array->ByteOffset(); + v8::Local buffer = array->Buffer(); + + length = byte_length / sizeof(T); + data = static_cast(buffer->GetContents().Data()) + byte_offset; + } + +#else + + if (from->IsObject() && !from->IsNull()) { + v8::Local array = v8::Local::Cast(from); + + MaybeLocal buffer = Get(array, + New("buffer").ToLocalChecked()); + MaybeLocal byte_length = Get(array, + New("byteLength").ToLocalChecked()); + MaybeLocal byte_offset = Get(array, + New("byteOffset").ToLocalChecked()); + + if (!buffer.IsEmpty() && + !byte_length.IsEmpty() && byte_length.ToLocalChecked()->IsUint32() && + !byte_offset.IsEmpty() && byte_offset.ToLocalChecked()->IsUint32()) { + data = array->GetIndexedPropertiesExternalArrayData(); + if(data) { + length = byte_length.ToLocalChecked()->Uint32Value() / sizeof(T); + } + } + } + +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1900 || __cplusplus >= 201103L + assert(reinterpret_cast(data) % alignof (T) == 0); +#elif defined(_MSC_VER) && _MSC_VER >= 1600 || defined(__GNUC__) + assert(reinterpret_cast(data) % __alignof(T) == 0); +#else + assert(reinterpret_cast(data) % sizeof (T) == 0); +#endif + + length_ = length; + data_ = static_cast(data); + } + + inline size_t length() const { return length_; } + inline T* operator*() { return data_; } + inline const T* operator*() const { return data_; } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(TypedArrayContents) + + //Disable heap allocation + void *operator new(size_t size); + void operator delete(void *, size_t) { + abort(); + } + + size_t length_; + T* data_; +}; + +#endif // NAN_TYPEDARRAY_CONTENTS_H_ diff --git a/node_modules/nan/nan_weak.h b/node_modules/nan/nan_weak.h new file mode 100755 index 00000000..3f2d569d --- /dev/null +++ b/node_modules/nan/nan_weak.h @@ -0,0 +1,432 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_WEAK_H_ +#define NAN_WEAK_H_ + +static const int kInternalFieldsInWeakCallback = 2; +static const int kNoInternalFieldIndex = -1; + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ + v8::WeakCallbackInfo > const& +# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION +# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ + v8::PhantomCallbackData > const& +# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ + v8::PhantomCallbackData > const& +# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ + v8::InternalFieldsCallbackData, void> const& +# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +# define NAN_WEAK_CALLBACK_DATA_TYPE_ \ + v8::WeakCallbackData > const& +# define NAN_WEAK_CALLBACK_SIG_ NAN_WEAK_CALLBACK_DATA_TYPE_ +#else +# define NAN_WEAK_CALLBACK_DATA_TYPE_ void * +# define NAN_WEAK_CALLBACK_SIG_ \ + v8::Persistent, NAN_WEAK_CALLBACK_DATA_TYPE_ +#endif + +template +class WeakCallbackInfo { + public: + typedef void (*Callback)(const WeakCallbackInfo& data); + WeakCallbackInfo( + Persistent *persistent + , Callback callback + , void *parameter + , void *field1 = 0 + , void *field2 = 0) : + callback_(callback), isolate_(0), parameter_(parameter) { + std::memcpy(&persistent_, persistent, sizeof (v8::Persistent)); + internal_fields_[0] = field1; + internal_fields_[1] = field2; + } + inline v8::Isolate *GetIsolate() const { return isolate_; } + inline T *GetParameter() const { return static_cast(parameter_); } + inline void *GetInternalField(int index) const { + assert((index == 0 || index == 1) && "internal field index out of bounds"); + if (index == 0) { + return internal_fields_[0]; + } else { + return internal_fields_[1]; + } + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(WeakCallbackInfo) + Callback callback_; + v8::Isolate *isolate_; + void *parameter_; + void *internal_fields_[kInternalFieldsInWeakCallback]; + v8::Persistent persistent_; + template friend class Persistent; + template friend class PersistentBase; +#if NODE_MODULE_VERSION <= NODE_0_12_MODULE_VERSION +# if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + template + static void invoke(NAN_WEAK_CALLBACK_SIG_ data); + template + static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data); +# else + static void invoke(NAN_WEAK_CALLBACK_SIG_ data); + static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data); +# endif +#else +# if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + template + static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data); + template + static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data); +# else + static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data); + static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data); +# endif + static WeakCallbackInfo *unwrapparameter( + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data); + static WeakCallbackInfo *unwraptwofield( + NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data); +#endif +}; + + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + +template +template +void +WeakCallbackInfo::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrapparameter(data); + if (isFirstPass) { + cbinfo->persistent_.Reset(); + data.SetSecondPassCallback(invokeparameter); + } else { + cbinfo->callback_(*cbinfo); + delete cbinfo; + } +} + +template +template +void +WeakCallbackInfo::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwraptwofield(data); + if (isFirstPass) { + cbinfo->persistent_.Reset(); + data.SetSecondPassCallback(invoketwofield); + } else { + cbinfo->callback_(*cbinfo); + delete cbinfo; + } +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwrapparameter( + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetParameter()); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwraptwofield( + NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetInternalField(0)); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_ +#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +# elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + +template +void +WeakCallbackInfo::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrapparameter(data); + cbinfo->persistent_.Reset(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +void +WeakCallbackInfo::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwraptwofield(data); + cbinfo->persistent_.Reset(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwrapparameter( + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetParameter()); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwraptwofield( + NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetInternalField1()); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_ +#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + +template +template +void WeakCallbackInfo::invoke(NAN_WEAK_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrap(data); + cbinfo->persistent_.Reset(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +template +WeakCallbackInfo *WeakCallbackInfo::unwrap( + NAN_WEAK_CALLBACK_DATA_TYPE_ data) { + void *parameter = data.GetParameter(); + WeakCallbackInfo *cbinfo = + static_cast*>(parameter); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +#undef NAN_WEAK_CALLBACK_SIG_ +#undef NAN_WEAK_CALLBACK_DATA_TYPE_ +#else + +template +void WeakCallbackInfo::invoke(NAN_WEAK_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrap(data); + cbinfo->persistent_.Dispose(); + cbinfo->persistent_.Clear(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwrap( + NAN_WEAK_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data); + cbinfo->isolate_ = v8::Isolate::GetCurrent(); + return cbinfo; +} + +#undef NAN_WEAK_CALLBACK_SIG_ +#undef NAN_WEAK_CALLBACK_DATA_TYPE_ +#endif + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

      *wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetWeak( + wcbd + , WeakCallbackInfo

      ::template invokeparameter + , type); + } else { + v8::Local* self = reinterpret_cast*>(this); + assert((*self)->IsObject()); + int count = (*self)->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + (*self)->SetAlignedPointerInInternalField(0, wcbd); + v8::PersistentBase::SetWeak( + static_cast*>(0) + , WeakCallbackInfo

      ::template invoketwofield + , type); + } +} +#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

      *wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetPhantom( + wcbd + , WeakCallbackInfo

      ::invokeparameter); + } else { + v8::Local* self = reinterpret_cast*>(this); + assert((*self)->IsObject()); + int count = (*self)->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + (*self)->SetAlignedPointerInInternalField(0, wcbd); + v8::PersistentBase::SetPhantom( + static_cast*>(0) + , WeakCallbackInfo

      ::invoketwofield + , 0 + , count > 1 ? 1 : kNoInternalFieldIndex); + } +} +#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

      *wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetPhantom( + wcbd + , WeakCallbackInfo

      ::invokeparameter); + } else { + v8::Local* self = reinterpret_cast*>(this); + assert((*self)->IsObject()); + int count = (*self)->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + (*self)->SetAlignedPointerInInternalField(0, wcbd); + v8::PersistentBase::SetPhantom( + WeakCallbackInfo

      ::invoketwofield + , 0 + , count > 1 ? 1 : kNoInternalFieldIndex); + } +} +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

      *wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetWeak(wcbd, WeakCallbackInfo

      ::invoke); + } else { + v8::Local* self = reinterpret_cast*>(this); + assert((*self)->IsObject()); + int count = (*self)->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = (*self)->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + v8::PersistentBase::SetWeak(wcbd, WeakCallbackInfo

      ::invoke); + } +} +#else +template +template +inline void PersistentBase::SetWeak( + P *parameter + , typename WeakCallbackInfo

      ::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

      *wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , parameter); + persistent.MakeWeak(wcbd, WeakCallbackInfo

      ::invoke); + } else { + v8::Local* self = reinterpret_cast*>(this); + assert((*self)->IsObject()); + int count = (*self)->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = (*self)->GetPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

      ( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + persistent.MakeWeak(wcbd, WeakCallbackInfo

      ::invoke); + } +} +#endif + +#endif // NAN_WEAK_H_ diff --git a/node_modules/nan/package.json b/node_modules/nan/package.json new file mode 100755 index 00000000..d7014d66 --- /dev/null +++ b/node_modules/nan/package.json @@ -0,0 +1,136 @@ +{ + "_args": [ + [ + { + "raw": "nan@^2.3.0", + "scope": null, + "escapedName": "nan", + "name": "nan", + "rawSpec": "^2.3.0", + "spec": ">=2.3.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fsevents" + ] + ], + "_from": "nan@>=2.3.0 <3.0.0", + "_id": "nan@2.6.2", + "_inCache": true, + "_location": "/nan", + "_nodeVersion": "7.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/nan-2.6.2.tgz_1492029516320_0.2352329883724451" + }, + "_npmUser": { + "name": "kkoopa", + "email": "bbyholm@abo.fi" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "nan@^2.3.0", + "scope": null, + "escapedName": "nan", + "name": "nan", + "rawSpec": "^2.3.0", + "spec": ">=2.3.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fsevents" + ], + "_resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", + "_shasum": "e4ff34e6c95fdfb5aecc08de6596f43605a7db45", + "_shrinkwrap": null, + "_spec": "nan@^2.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fsevents", + "bugs": { + "url": "https://github.com/nodejs/nan/issues" + }, + "contributors": [ + { + "name": "Rod Vagg", + "email": "r@va.gg", + "url": "https://github.com/rvagg" + }, + { + "name": "Benjamin Byholm", + "email": "bbyholm@abo.fi", + "url": "https://github.com/kkoopa/" + }, + { + "name": "Trevor Norris", + "email": "trev.norris@gmail.com", + "url": "https://github.com/trevnorris" + }, + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "https://github.com/TooTallNate" + }, + { + "name": "Brett Lawson", + "email": "brett19@gmail.com", + "url": "https://github.com/brett19" + }, + { + "name": "Ben Noordhuis", + "email": "info@bnoordhuis.nl", + "url": "https://github.com/bnoordhuis" + }, + { + "name": "David Siegel", + "email": "david@artcom.de", + "url": "https://github.com/agnat" + }, + { + "name": "Michael Ira Krufky", + "email": "mkrufky@gmail.com", + "url": "https://github.com/mkrufky" + } + ], + "dependencies": {}, + "description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 7 compatibility", + "devDependencies": { + "bindings": "~1.2.1", + "commander": "^2.8.1", + "glob": "^5.0.14", + "node-gyp": "~3.0.1", + "readable-stream": "^2.1.4", + "tap": "~0.7.1", + "xtend": "~4.0.0" + }, + "directories": {}, + "dist": { + "shasum": "e4ff34e6c95fdfb5aecc08de6596f43605a7db45", + "tarball": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz" + }, + "gitHead": "f0b2f64c1e5317888f2e12fdefb2f105e7018552", + "homepage": "https://github.com/nodejs/nan#readme", + "license": "MIT", + "main": "include_dirs.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "kkoopa", + "email": "bbyholm@abo.fi" + } + ], + "name": "nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/nan.git" + }, + "scripts": { + "docs": "doc/.build.sh", + "rebuild-tests": "node-gyp rebuild --msvs_version=2013 --directory test", + "test": "tap --gc --stderr test/js/*-test.js" + }, + "version": "2.6.2" +} diff --git a/node_modules/nan/tools/1to2.js b/node_modules/nan/tools/1to2.js new file mode 100755 index 00000000..1e86be73 --- /dev/null +++ b/node_modules/nan/tools/1to2.js @@ -0,0 +1,412 @@ +#!/usr/bin/env node +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2017 NAN contributors + * + * MIT License + ********************************************************************/ + +var commander = require('commander'), + fs = require('fs'), + glob = require('glob'), + groups = [], + total = 0, + warning1 = '/* ERROR: Rewrite using Buffer */\n', + warning2 = '\\/\\* ERROR\\: Rewrite using Buffer \\*\\/\\n', + length, + i; + +fs.readFile(__dirname + '/package.json', 'utf8', function (err, data) { + if (err) { + throw err; + } + + commander + .version(JSON.parse(data).version) + .usage('[options] ') + .parse(process.argv); + + if (!process.argv.slice(2).length) { + commander.outputHelp(); + } +}); + +/* construct strings representing regular expressions + each expression contains a unique group allowing for identification of the match + the index of this key group, relative to the regular expression in question, + is indicated by the first array member */ + +/* simple substistutions, key group is the entire match, 0 */ +groups.push([0, [ + '_NAN_', + 'NODE_SET_METHOD', + 'NODE_SET_PROTOTYPE_METHOD', + 'NanAsciiString', + 'NanEscapeScope', + 'NanReturnValue', + 'NanUcs2String'].join('|')]); + +/* substitutions of parameterless macros, key group is 1 */ +groups.push([1, ['(', [ + 'NanEscapableScope', + 'NanReturnNull', + 'NanReturnUndefined', + 'NanScope'].join('|'), ')\\(\\)'].join('')]); + +/* replace TryCatch with NanTryCatch once, gobbling possible namespace, key group 2 */ +groups.push([2, '(?:(?:v8\\:\\:)?|(Nan)?)(TryCatch)']); + +/* NanNew("string") will likely not fail a ToLocalChecked(), key group 1 */ +groups.push([1, ['(NanNew)', '(\\("[^\\"]*"[^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]); + +/* Removed v8 APIs, warn that the code needs rewriting using node::Buffer, key group 2 */ +groups.push([2, ['(', warning2, ')?', '^.*?(', [ + 'GetIndexedPropertiesExternalArrayDataLength', + 'GetIndexedPropertiesExternalArrayData', + 'GetIndexedPropertiesExternalArrayDataType', + 'GetIndexedPropertiesPixelData', + 'GetIndexedPropertiesPixelDataLength', + 'HasIndexedPropertiesInExternalArrayData', + 'HasIndexedPropertiesInPixelData', + 'SetIndexedPropertiesToExternalArrayData', + 'SetIndexedPropertiesToPixelData'].join('|'), ')'].join('')]); + +/* No need for NanScope in V8-exposed methods, key group 2 */ +groups.push([2, ['((', [ + 'NAN_METHOD', + 'NAN_GETTER', + 'NAN_SETTER', + 'NAN_PROPERTY_GETTER', + 'NAN_PROPERTY_SETTER', + 'NAN_PROPERTY_ENUMERATOR', + 'NAN_PROPERTY_DELETER', + 'NAN_PROPERTY_QUERY', + 'NAN_INDEX_GETTER', + 'NAN_INDEX_SETTER', + 'NAN_INDEX_ENUMERATOR', + 'NAN_INDEX_DELETER', + 'NAN_INDEX_QUERY'].join('|'), ')\\([^\\)]*\\)\\s*\\{)\\s*NanScope\\(\\)\\s*;'].join('')]); + +/* v8::Value::ToXXXXXXX returns v8::MaybeLocal, key group 3 */ +groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->(', [ + 'Boolean', + 'Number', + 'String', + 'Object', + 'Integer', + 'Uint32', + 'Int32'].join('|'), ')\\('].join('')]); + +/* v8::Value::XXXXXXXValue returns v8::Maybe, key group 3 */ +groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->((?:', [ + 'Boolean', + 'Number', + 'Integer', + 'Uint32', + 'Int32'].join('|'), ')Value)\\('].join('')]); + +/* NAN_WEAK_CALLBACK macro was removed, write out callback definition, key group 1 */ +groups.push([1, '(NAN_WEAK_CALLBACK)\\(([^\\s\\)]+)\\)']); + +/* node::ObjectWrap and v8::Persistent have been replaced with Nan implementations, key group 1 */ +groups.push([1, ['(', [ + 'NanDisposePersistent', + 'NanObjectWrapHandle'].join('|'), ')\\s*\\(\\s*([^\\s\\)]+)'].join('')]); + +/* Since NanPersistent there is no need for NanMakeWeakPersistent, key group 1 */ +groups.push([1, '(NanMakeWeakPersistent)\\s*\\(\\s*([^\\s,]+)\\s*,\\s*']); + +/* Many methods of v8::Object and others now return v8::MaybeLocal, key group 3 */ +groups.push([3, ['([\\s])([^\\s]+)->(', [ + 'GetEndColumn', + 'GetFunction', + 'GetLineNumber', + 'NewInstance', + 'GetPropertyNames', + 'GetOwnPropertyNames', + 'GetSourceLine', + 'GetStartColumn', + 'ObjectProtoToString', + 'ToArrayIndex', + 'ToDetailString', + 'CallAsConstructor', + 'CallAsFunction', + 'CloneElementAt', + 'Delete', + 'ForceSet', + 'Get', + 'GetPropertyAttributes', + 'GetRealNamedProperty', + 'GetRealNamedPropertyInPrototypeChain', + 'Has', + 'HasOwnProperty', + 'HasRealIndexedProperty', + 'HasRealNamedCallbackProperty', + 'HasRealNamedProperty', + 'Set', + 'SetAccessor', + 'SetIndexedPropertyHandler', + 'SetNamedPropertyHandler', + 'SetPrototype'].join('|'), ')\\('].join('')]); + +/* You should get an error if any of these fail anyways, + or handle the error better, it is indicated either way, key group 2 */ +groups.push([2, ['NanNew(<(?:v8\\:\\:)?(', ['Date', 'String', 'RegExp'].join('|'), ')>)(\\([^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]); + +/* v8::Value::Equals now returns a v8::Maybe, key group 3 */ +groups.push([3, '([\\s\\(\\)])([^\\s\\(\\)]+)->(Equals)\\(([^\\s\\)]+)']); + +/* NanPersistent makes this unnecessary, key group 1 */ +groups.push([1, '(NanAssignPersistent)(?:]+>)?\\(([^,]+),\\s*']); + +/* args has been renamed to info, key group 2 */ +groups.push([2, '(\\W)(args)(\\W)']) + +/* node::ObjectWrap was replaced with NanObjectWrap, key group 2 */ +groups.push([2, '(\\W)(?:node\\:\\:)?(ObjectWrap)(\\W)']); + +/* v8::Persistent was replaced with NanPersistent, key group 2 */ +groups.push([2, '(\\W)(?:v8\\:\\:)?(Persistent)(\\W)']); + +/* counts the number of capturing groups in a well-formed regular expression, + ignoring non-capturing groups and escaped parentheses */ +function groupcount(s) { + var positive = s.match(/\((?!\?)/g), + negative = s.match(/\\\(/g); + return (positive ? positive.length : 0) - (negative ? negative.length : 0); +} + +/* compute the absolute position of each key group in the joined master RegExp */ +for (i = 1, length = groups.length; i < length; i++) { + total += groupcount(groups[i - 1][1]); + groups[i][0] += total; +} + +/* create the master RegExp, whis is the union of all the groups' expressions */ +master = new RegExp(groups.map(function (a) { return a[1]; }).join('|'), 'gm'); + +/* replacement function for String.replace, receives 21 arguments */ +function replace() { + /* simple expressions */ + switch (arguments[groups[0][0]]) { + case '_NAN_': + return 'NAN_'; + case 'NODE_SET_METHOD': + return 'NanSetMethod'; + case 'NODE_SET_PROTOTYPE_METHOD': + return 'NanSetPrototypeMethod'; + case 'NanAsciiString': + return 'NanUtf8String'; + case 'NanEscapeScope': + return 'scope.Escape'; + case 'NanReturnNull': + return 'info.GetReturnValue().SetNull'; + case 'NanReturnValue': + return 'info.GetReturnValue().Set'; + case 'NanUcs2String': + return 'v8::String::Value'; + default: + } + + /* macros without arguments */ + switch (arguments[groups[1][0]]) { + case 'NanEscapableScope': + return 'NanEscapableScope scope' + case 'NanReturnUndefined': + return 'return'; + case 'NanScope': + return 'NanScope scope'; + default: + } + + /* TryCatch, emulate negative backref */ + if (arguments[groups[2][0]] === 'TryCatch') { + return arguments[groups[2][0] - 1] ? arguments[0] : 'NanTryCatch'; + } + + /* NanNew("foo") --> NanNew("foo").ToLocalChecked() */ + if (arguments[groups[3][0]] === 'NanNew') { + return [arguments[0], '.ToLocalChecked()'].join(''); + } + + /* insert warning for removed functions as comment on new line above */ + switch (arguments[groups[4][0]]) { + case 'GetIndexedPropertiesExternalArrayData': + case 'GetIndexedPropertiesExternalArrayDataLength': + case 'GetIndexedPropertiesExternalArrayDataType': + case 'GetIndexedPropertiesPixelData': + case 'GetIndexedPropertiesPixelDataLength': + case 'HasIndexedPropertiesInExternalArrayData': + case 'HasIndexedPropertiesInPixelData': + case 'SetIndexedPropertiesToExternalArrayData': + case 'SetIndexedPropertiesToPixelData': + return arguments[groups[4][0] - 1] ? arguments[0] : [warning1, arguments[0]].join(''); + default: + } + + /* remove unnecessary NanScope() */ + switch (arguments[groups[5][0]]) { + case 'NAN_GETTER': + case 'NAN_METHOD': + case 'NAN_SETTER': + case 'NAN_INDEX_DELETER': + case 'NAN_INDEX_ENUMERATOR': + case 'NAN_INDEX_GETTER': + case 'NAN_INDEX_QUERY': + case 'NAN_INDEX_SETTER': + case 'NAN_PROPERTY_DELETER': + case 'NAN_PROPERTY_ENUMERATOR': + case 'NAN_PROPERTY_GETTER': + case 'NAN_PROPERTY_QUERY': + case 'NAN_PROPERTY_SETTER': + return arguments[groups[5][0] - 1]; + default: + } + + /* Value converstion */ + switch (arguments[groups[6][0]]) { + case 'Boolean': + case 'Int32': + case 'Integer': + case 'Number': + case 'Object': + case 'String': + case 'Uint32': + return [arguments[groups[6][0] - 2], 'NanTo(', arguments[groups[6][0] - 1]].join(''); + default: + } + + /* other value conversion */ + switch (arguments[groups[7][0]]) { + case 'BooleanValue': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + case 'Int32Value': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + case 'IntegerValue': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + case 'Uint32Value': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + default: + } + + /* NAN_WEAK_CALLBACK */ + if (arguments[groups[8][0]] === 'NAN_WEAK_CALLBACK') { + return ['template\nvoid ', + arguments[groups[8][0] + 1], '(const NanWeakCallbackInfo &data)'].join(''); + } + + /* use methods on NAN classes instead */ + switch (arguments[groups[9][0]]) { + case 'NanDisposePersistent': + return [arguments[groups[9][0] + 1], '.Reset('].join(''); + case 'NanObjectWrapHandle': + return [arguments[groups[9][0] + 1], '->handle('].join(''); + default: + } + + /* use method on NanPersistent instead */ + if (arguments[groups[10][0]] === 'NanMakeWeakPersistent') { + return arguments[groups[10][0] + 1] + '.SetWeak('; + } + + /* These return Maybes, the upper ones take no arguments */ + switch (arguments[groups[11][0]]) { + case 'GetEndColumn': + case 'GetFunction': + case 'GetLineNumber': + case 'GetOwnPropertyNames': + case 'GetPropertyNames': + case 'GetSourceLine': + case 'GetStartColumn': + case 'NewInstance': + case 'ObjectProtoToString': + case 'ToArrayIndex': + case 'ToDetailString': + return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1]].join(''); + case 'CallAsConstructor': + case 'CallAsFunction': + case 'CloneElementAt': + case 'Delete': + case 'ForceSet': + case 'Get': + case 'GetPropertyAttributes': + case 'GetRealNamedProperty': + case 'GetRealNamedPropertyInPrototypeChain': + case 'Has': + case 'HasOwnProperty': + case 'HasRealIndexedProperty': + case 'HasRealNamedCallbackProperty': + case 'HasRealNamedProperty': + case 'Set': + case 'SetAccessor': + case 'SetIndexedPropertyHandler': + case 'SetNamedPropertyHandler': + case 'SetPrototype': + return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1], ', '].join(''); + default: + } + + /* Automatic ToLocalChecked(), take it or leave it */ + switch (arguments[groups[12][0]]) { + case 'Date': + case 'String': + case 'RegExp': + return ['NanNew', arguments[groups[12][0] - 1], arguments[groups[12][0] + 1], '.ToLocalChecked()'].join(''); + default: + } + + /* NanEquals is now required for uniformity */ + if (arguments[groups[13][0]] === 'Equals') { + return [arguments[groups[13][0] - 1], 'NanEquals(', arguments[groups[13][0] - 1], ', ', arguments[groups[13][0] + 1]].join(''); + } + + /* use method on replacement class instead */ + if (arguments[groups[14][0]] === 'NanAssignPersistent') { + return [arguments[groups[14][0] + 1], '.Reset('].join(''); + } + + /* args --> info */ + if (arguments[groups[15][0]] === 'args') { + return [arguments[groups[15][0] - 1], 'info', arguments[groups[15][0] + 1]].join(''); + } + + /* ObjectWrap --> NanObjectWrap */ + if (arguments[groups[16][0]] === 'ObjectWrap') { + return [arguments[groups[16][0] - 1], 'NanObjectWrap', arguments[groups[16][0] + 1]].join(''); + } + + /* Persistent --> NanPersistent */ + if (arguments[groups[17][0]] === 'Persistent') { + return [arguments[groups[17][0] - 1], 'NanPersistent', arguments[groups[17][0] + 1]].join(''); + } + + /* This should not happen. A switch is probably missing a case if it does. */ + throw 'Unhandled match: ' + arguments[0]; +} + +/* reads a file, runs replacement and writes it back */ +function processFile(file) { + fs.readFile(file, {encoding: 'utf8'}, function (err, data) { + if (err) { + throw err; + } + + /* run replacement twice, might need more runs */ + fs.writeFile(file, data.replace(master, replace).replace(master, replace), function (err) { + if (err) { + throw err; + } + }); + }); +} + +/* process file names from command line and process the identified files */ +for (i = 2, length = process.argv.length; i < length; i++) { + glob(process.argv[i], function (err, matches) { + if (err) { + throw err; + } + matches.forEach(processFile); + }); +} diff --git a/node_modules/nan/tools/README.md b/node_modules/nan/tools/README.md new file mode 100755 index 00000000..7f07e4b8 --- /dev/null +++ b/node_modules/nan/tools/README.md @@ -0,0 +1,14 @@ +1to2 naively converts source code files from NAN 1 to NAN 2. There will be erroneous conversions, +false positives and missed opportunities. The input files are rewritten in place. Make sure that +you have backups. You will have to manually review the changes afterwards and do some touchups. + +```sh +$ tools/1to2.js + + Usage: 1to2 [options] + + Options: + + -h, --help output usage information + -V, --version output the version number +``` diff --git a/node_modules/nan/tools/package.json b/node_modules/nan/tools/package.json new file mode 100755 index 00000000..2dcdd789 --- /dev/null +++ b/node_modules/nan/tools/package.json @@ -0,0 +1,19 @@ +{ + "name": "1to2", + "version": "1.0.0", + "description": "NAN 1 -> 2 Migration Script", + "main": "1to2.js", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/nan.git" + }, + "contributors": [ + "Benjamin Byholm (https://github.com/kkoopa/)", + "Mathias Küsel (https://github.com/mathiask88/)" + ], + "dependencies": { + "glob": "~5.0.10", + "commander": "~2.8.1" + }, + "license": "MIT" +} diff --git a/node_modules/ncp/.npmignore b/node_modules/ncp/.npmignore new file mode 100755 index 00000000..3e6a4d79 --- /dev/null +++ b/node_modules/ncp/.npmignore @@ -0,0 +1,4 @@ +node_modules +.*.sw[op] +.DS_Store +test/*fixtures/out diff --git a/node_modules/ncp/.travis.yml b/node_modules/ncp/.travis.yml new file mode 100755 index 00000000..a6e21989 --- /dev/null +++ b/node_modules/ncp/.travis.yml @@ -0,0 +1,6 @@ +language: node_js + +node_js: + - 0.8 + - "0.10" + - "0.11" diff --git a/node_modules/ncp/LICENSE.md b/node_modules/ncp/LICENSE.md new file mode 100755 index 00000000..e2b9b413 --- /dev/null +++ b/node_modules/ncp/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +###Copyright (C) 2011 by Charlie McConnell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ncp/README.md b/node_modules/ncp/README.md new file mode 100755 index 00000000..94800324 --- /dev/null +++ b/node_modules/ncp/README.md @@ -0,0 +1,63 @@ +# ncp - Asynchronous recursive file & directory copying + +[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp) + +Think `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically. + +## Command Line usage + +Usage is simple: `ncp [source] [dest] [--limit=concurrency limit] +[--filter=filter] --stopOnErr` + +The 'filter' is a Regular Expression - matched files will be copied. + +The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time. + +'stoponerr' is a boolean flag that will tell `ncp` to stop immediately if any +errors arise, rather than attempting to continue while logging errors. The default behavior is to complete as many copies as possible, logging errors along the way. + +If there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue. + +## Programmatic usage + +Programmatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error. + +```javascript +var ncp = require('ncp').ncp; + +ncp.limit = 16; + +ncp(source, destination, function (err) { + if (err) { + return console.error(err); + } + console.log('done!'); +}); +``` + +You can also call ncp like `ncp(source, destination, options, callback)`. +`options` should be a dictionary. Currently, such options are available: + + * `options.filter` - a `RegExp` instance, against which each file name is + tested to determine whether to copy it or not, or a function taking single + parameter: copied file name, returning `true` or `false`, determining + whether to copy file or not. + + * `options.transform` - a function: `function (read, write) { read.pipe(write) }` + used to apply streaming transforms while copying. + + * `options.clobber` - boolean=true. if set to false, `ncp` will not overwrite + destination files that already exist. + + * `options.dereference` - boolean=false. If set to true, `ncp` will follow symbolic + links. For example, a symlink in the source tree pointing to a regular file + will become a regular file in the destination tree. Broken symlinks will result in + errors. + + * `options.stopOnErr` - boolean=false. If set to true, `ncp` will behave like `cp -r`, + and stop on the first error it encounters. By default, `ncp` continues copying, logging all + errors and returning an array. + + * `options.errs` - stream. If `options.stopOnErr` is `false`, a stream can be provided, and errors will be written to this stream. + +Please open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`. diff --git a/node_modules/ncp/bin/ncp b/node_modules/ncp/bin/ncp new file mode 100755 index 00000000..388eaba6 --- /dev/null +++ b/node_modules/ncp/bin/ncp @@ -0,0 +1,48 @@ +#!/usr/bin/env node + + + + +var ncp = require('../lib/ncp'), + args = process.argv.slice(2), + source, dest; + +if (args.length < 2) { + console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]'); + process.exit(1); +} + +// parse arguments the hard way +function startsWith(str, prefix) { + return str.substr(0, prefix.length) == prefix; +} + +var options = {}; +args.forEach(function (arg) { + if (startsWith(arg, "--limit=")) { + options.limit = parseInt(arg.split('=', 2)[1], 10); + } + if (startsWith(arg, "--filter=")) { + options.filter = new RegExp(arg.split('=', 2)[1]); + } + if (startsWith(arg, "--stoponerr")) { + options.stopOnErr = true; + } +}); + +ncp.ncp(args[0], args[1], options, function (err) { + if (Array.isArray(err)) { + console.error('There were errors during the copy.'); + err.forEach(function (err) { + console.error(err.stack || err.message); + }); + process.exit(1); + } + else if (err) { + console.error('An error has occurred.'); + console.error(err.stack || err.message); + process.exit(1); + } +}); + + diff --git a/node_modules/ncp/lib/ncp.js b/node_modules/ncp/lib/ncp.js new file mode 100755 index 00000000..bc25a052 --- /dev/null +++ b/node_modules/ncp/lib/ncp.js @@ -0,0 +1,266 @@ +var fs = require('fs'), + path = require('path'), + util = require('util'); + +const modern = /^v0\.1\d\.\d+/.test(process.version); + +module.exports = ncp; +ncp.ncp = ncp; + +function ncp (source, dest, options, callback) { + var cback = callback; + + if (!callback) { + cback = options; + options = {}; + } + + var basePath = process.cwd(), + currentPath = path.resolve(basePath, source), + targetPath = path.resolve(basePath, dest), + filter = options.filter, + rename = options.rename, + transform = options.transform, + clobber = options.clobber !== false, + modified = options.modified, + dereference = options.dereference, + errs = null, + eventName = modern ? 'finish' : 'close', + defer = modern ? setImmediate : process.nextTick, + started = 0, + finished = 0, + running = 0, + limit = options.limit || ncp.limit || 16; + + limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit; + + startCopy(currentPath); + + function startCopy(source) { + started++; + if (filter) { + if (filter instanceof RegExp) { + if (!filter.test(source)) { + return cb(true); + } + } + else if (typeof filter === 'function') { + if (!filter(source)) { + return cb(true); + } + } + } + return getStats(source); + } + + function getStats(source) { + var stat = dereference ? fs.stat : fs.lstat; + if (running >= limit) { + return defer(function () { + getStats(source); + }); + } + running++; + stat(source, function (err, stats) { + var item = {}; + if (err) { + return onError(err); + } + + // We need to get the mode from the stats object and preserve it. + item.name = source; + item.mode = stats.mode; + item.mtime = stats.mtime; //modified time + item.atime = stats.atime; //access time + + if (stats.isDirectory()) { + return onDir(item); + } + else if (stats.isFile()) { + return onFile(item); + } + else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source); + } + }); + } + + function onFile(file) { + var target = file.name.replace(currentPath, targetPath); + if(rename) { + target = rename(target); + } + isWritable(target, function (writable) { + if (writable) { + return copyFile(file, target); + } + if(clobber) { + rmFile(target, function () { + copyFile(file, target); + }); + } + if (modified) { + var stat = dereference ? fs.stat : fs.lstat; + stat(target, function(err, stats) { + //if souce modified time greater to target modified time copy file + if (file.mtime.getTime()>stats.mtime.getTime()) + copyFile(file, target); + else return cb(); + }); + } + else { + return cb(); + } + }); + } + + function copyFile(file, target) { + var readStream = fs.createReadStream(file.name), + writeStream = fs.createWriteStream(target, { mode: file.mode }); + + readStream.on('error', onError); + writeStream.on('error', onError); + + if(transform) { + transform(readStream, writeStream, file); + } else { + writeStream.on('open', function() { + readStream.pipe(writeStream); + }); + } + writeStream.once(eventName, function() { + if (modified) { + //target file modified date sync. + fs.utimesSync(target, file.atime, file.mtime); + cb(); + } + else cb(); + }); + } + + function rmFile(file, done) { + fs.unlink(file, function (err) { + if (err) { + return onError(err); + } + return done(); + }); + } + + function onDir(dir) { + var target = dir.name.replace(currentPath, targetPath); + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target); + } + copyDir(dir.name); + }); + } + + function mkDir(dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) { + return onError(err); + } + copyDir(dir.name); + }); + } + + function copyDir(dir) { + fs.readdir(dir, function (err, items) { + if (err) { + return onError(err); + } + items.forEach(function (item) { + startCopy(dir + '/' + item); + }); + return cb(); + }); + } + + function onLink(link) { + var target = link.replace(currentPath, targetPath); + fs.readlink(link, function (err, resolvedPath) { + if (err) { + return onError(err); + } + checkLink(resolvedPath, target); + }); + } + + function checkLink(resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath); + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target); + } + fs.readlink(target, function (err, targetDest) { + if (err) { + return onError(err); + } + if (dereference) { + targetDest = path.resolve(basePath, targetDest); + } + if (targetDest === resolvedPath) { + return cb(); + } + return rmFile(target, function () { + makeLink(resolvedPath, target); + }); + }); + }); + } + + function makeLink(linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) { + return onError(err); + } + return cb(); + }); + } + + function isWritable(path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true); + return done(false); + } + return done(false); + }); + } + + function onError(err) { + if (options.stopOnError) { + return cback(err); + } + else if (!errs && options.errs) { + errs = fs.createWriteStream(options.errs); + } + else if (!errs) { + errs = []; + } + if (typeof errs.write === 'undefined') { + errs.push(err); + } + else { + errs.write(err.stack + '\n\n'); + } + return cb(); + } + + function cb(skipped) { + if (!skipped) running--; + finished++; + if ((started === finished) && (running === 0)) { + if (cback !== undefined ) { + return errs ? cback(errs) : cback(null); + } + } + } +} + + diff --git a/node_modules/ncp/package.json b/node_modules/ncp/package.json new file mode 100755 index 00000000..1a4a428b --- /dev/null +++ b/node_modules/ncp/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "ncp@1.0.x", + "scope": null, + "escapedName": "ncp", + "name": "ncp", + "rawSpec": "1.0.x", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/utile" + ] + ], + "_from": "ncp@>=1.0.0 <1.1.0", + "_id": "ncp@1.0.1", + "_inCache": true, + "_location": "/ncp", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "avianflu", + "email": "charlie@charlieistheman.com" + }, + "_npmVersion": "2.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "ncp@1.0.x", + "scope": null, + "escapedName": "ncp", + "name": "ncp", + "rawSpec": "1.0.x", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/utile" + ], + "_resolved": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz", + "_shasum": "d15367e5cb87432ba117d2bf80fdf45aecfb4246", + "_shrinkwrap": null, + "_spec": "ncp@1.0.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/utile", + "author": { + "name": "AvianFlu", + "email": "charlie@charlieistheman.com" + }, + "bin": { + "ncp": "./bin/ncp" + }, + "bugs": { + "url": "https://github.com/AvianFlu/ncp/issues" + }, + "dependencies": {}, + "description": "Asynchronous recursive file copy utility.", + "devDependencies": { + "mocha": "1.15.x", + "read-dir-files": "0.0.x", + "rimraf": "1.0.x" + }, + "directories": {}, + "dist": { + "shasum": "d15367e5cb87432ba117d2bf80fdf45aecfb4246", + "tarball": "https://registry.npmjs.org/ncp/-/ncp-1.0.1.tgz" + }, + "engine": { + "node": ">=0.8" + }, + "gitHead": "e9e6fae157e94e6c55b8edae70779bf12b0d2476", + "homepage": "https://github.com/AvianFlu/ncp", + "keywords": [ + "cli", + "copy" + ], + "license": "MIT", + "main": "./lib/ncp.js", + "maintainers": [ + { + "name": "avianflu", + "email": "charlie@charlieistheman.com" + }, + { + "name": "mmalecki", + "email": "me@mmalecki.com" + } + ], + "name": "ncp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/AvianFlu/ncp.git" + }, + "scripts": { + "test": "mocha -R spec" + }, + "version": "1.0.1" +} diff --git a/node_modules/ncp/test/modified-files/out/a b/node_modules/ncp/test/modified-files/out/a new file mode 100755 index 00000000..29f446af --- /dev/null +++ b/node_modules/ncp/test/modified-files/out/a @@ -0,0 +1 @@ +test3 \ No newline at end of file diff --git a/node_modules/ncp/test/modified-files/src/a b/node_modules/ncp/test/modified-files/src/a new file mode 100755 index 00000000..29f446af --- /dev/null +++ b/node_modules/ncp/test/modified-files/src/a @@ -0,0 +1 @@ +test3 \ No newline at end of file diff --git a/node_modules/ncp/test/ncp.js b/node_modules/ncp/test/ncp.js new file mode 100755 index 00000000..bc6df223 --- /dev/null +++ b/node_modules/ncp/test/ncp.js @@ -0,0 +1,197 @@ + + +var assert = require('assert'), + fs = require('fs'), + path = require('path'), + rimraf = require('rimraf'), + readDirFiles = require('read-dir-files'), + util = require('util'), + ncp = require('../').ncp; + + + +describe('ncp', function () { + describe('regular files and directories', function () { + var fixtures = path.join(__dirname, 'regular-fixtures'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + before(function (cb) { + rimraf(out, function() { + ncp(src, out, cb); + }); + }); + + describe('when copying a directory of files', function () { + it('files are copied correctly', function (cb) { + readDirFiles(src, 'utf8', function (srcErr, srcFiles) { + readDirFiles(out, 'utf8', function (outErr, outFiles) { + assert.ifError(srcErr); + assert.deepEqual(srcFiles, outFiles); + cb(); + }); + }); + }); + }); + + describe('when copying files using filter', function () { + before(function (cb) { + var filter = function(name) { + return name.substr(name.length - 1) != 'a'; + }; + rimraf(out, function () { + ncp(src, out, {filter: filter}, cb); + }); + }); + + it('files are copied correctly', function (cb) { + readDirFiles(src, 'utf8', function (srcErr, srcFiles) { + function filter(files) { + for (var fileName in files) { + var curFile = files[fileName]; + if (curFile instanceof Object) + return filter(curFile); + if (fileName.substr(fileName.length - 1) == 'a') + delete files[fileName]; + } + } + filter(srcFiles); + readDirFiles(out, 'utf8', function (outErr, outFiles) { + assert.ifError(outErr); + assert.deepEqual(srcFiles, outFiles); + cb(); + }); + }); + }); + }); + + describe('when using clobber=false', function () { + it('the copy is completed successfully', function (cb) { + ncp(src, out, function() { + ncp(src, out, {clobber: false}, function(err) { + assert.ifError(err); + cb(); + }); + }); + }); + }); + + describe('when using transform', function () { + it('file descriptors are passed correctly', function (cb) { + ncp(src, out, { + transform: function(read,write,file) { + assert.notEqual(file.name, undefined); + assert.strictEqual(typeof file.mode,'number'); + read.pipe(write); + } + }, cb); + }); + }); + + describe('when using rename', function() { + it('output files are correctly redirected', function(cb) { + ncp(src, out, { + rename: function(target) { + if(path.basename(target) == 'a') return path.resolve(path.dirname(target), 'z'); + return target; + } + }, function(err) { + if(err) return cb(err); + + readDirFiles(src, 'utf8', function (srcErr, srcFiles) { + readDirFiles(out, 'utf8', function (outErr, outFiles) { + assert.ifError(srcErr); + assert.deepEqual(srcFiles.a, outFiles.z); + cb(); + }); + }); + }); + }); + }); + }); + + describe('symlink handling', function () { + var fixtures = path.join(__dirname, 'symlink-fixtures'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + beforeEach(function (cb) { + rimraf(out, cb); + }); + + it('copies symlinks by default', function (cb) { + ncp(src, out, function (err) { + if (err) return cb(err); + assert.equal(fs.readlinkSync(path.join(out, 'file-symlink')), 'foo'); + assert.equal(fs.readlinkSync(path.join(out, 'dir-symlink')), 'dir'); + cb(); + }) + }); + + it('copies file contents when dereference=true', function (cb) { + ncp(src, out, { dereference: true }, function (err) { + var fileSymlinkPath = path.join(out, 'file-symlink'); + assert.ok(fs.lstatSync(fileSymlinkPath).isFile()); + assert.equal(fs.readFileSync(fileSymlinkPath), 'foo contents'); + + var dirSymlinkPath = path.join(out, 'dir-symlink'); + assert.ok(fs.lstatSync(dirSymlinkPath).isDirectory()); + assert.deepEqual(fs.readdirSync(dirSymlinkPath), ['bar']); + + cb(); + }); + }); + }); + + describe('broken symlink handling', function () { + var fixtures = path.join(__dirname, 'broken-symlink-fixtures'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + beforeEach(function (cb) { + rimraf(out, cb); + }); + + it('copies broken symlinks by default', function (cb) { + ncp(src, out, function (err) { + if (err) return cb(err); + assert.equal(fs.readlinkSync(path.join(out, 'broken-symlink')), 'does-not-exist'); + cb(); + }) + }); + + it('returns an error when dereference=true', function (cb) { + ncp(src, out, {dereference: true}, function (err) { + assert.equal(err.length, 1); + assert.equal(err[0].code, 'ENOENT'); + cb(); + }); + }); + }); + + describe('modified files copies', function () { + var fixtures = path.join(__dirname, 'modified-files'), + src = path.join(fixtures, 'src'), + out = path.join(fixtures, 'out'); + + it('if file not exists copy file to target', function(cb) { + rimraf(out, function() { + ncp(src, out, {modified: true, clobber: false}, function (err) { + assert.equal(fs.existsSync(out), true); + cb(); + }); + }); + }); + + it('change source file mtime and copy', function(cb) { + fs.utimesSync(src+"/a", new Date().getTime()/1000, new Date('2015-01-01 00:00:00').getTime()/1000); + ncp(src, out, {modified: true, clobber: false}, function (err) { + fs.stat(out+"/a", function(err, stats) { + assert.equal(stats.mtime.getTime(), new Date('2015-01-01 00:00:00').getTime()); + cb(); + }); + }); + }); + + }); +}); \ No newline at end of file diff --git a/node_modules/ncp/test/regular-fixtures/src/a b/node_modules/ncp/test/regular-fixtures/src/a new file mode 100755 index 00000000..802992c4 --- /dev/null +++ b/node_modules/ncp/test/regular-fixtures/src/a @@ -0,0 +1 @@ +Hello world diff --git a/node_modules/ncp/test/regular-fixtures/src/b b/node_modules/ncp/test/regular-fixtures/src/b new file mode 100755 index 00000000..9f6bb185 --- /dev/null +++ b/node_modules/ncp/test/regular-fixtures/src/b @@ -0,0 +1 @@ +Hello ncp diff --git a/node_modules/ncp/test/regular-fixtures/src/c b/node_modules/ncp/test/regular-fixtures/src/c new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/ncp/test/regular-fixtures/src/d b/node_modules/ncp/test/regular-fixtures/src/d new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/ncp/test/regular-fixtures/src/e b/node_modules/ncp/test/regular-fixtures/src/e new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/ncp/test/regular-fixtures/src/f b/node_modules/ncp/test/regular-fixtures/src/f new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/ncp/test/regular-fixtures/src/sub/a b/node_modules/ncp/test/regular-fixtures/src/sub/a new file mode 100755 index 00000000..cf291b5e --- /dev/null +++ b/node_modules/ncp/test/regular-fixtures/src/sub/a @@ -0,0 +1 @@ +Hello nodejitsu diff --git a/node_modules/ncp/test/regular-fixtures/src/sub/b b/node_modules/ncp/test/regular-fixtures/src/sub/b new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/ncp/test/symlink-fixtures/src/dir/bar b/node_modules/ncp/test/symlink-fixtures/src/dir/bar new file mode 100755 index 00000000..fd06f5f9 --- /dev/null +++ b/node_modules/ncp/test/symlink-fixtures/src/dir/bar @@ -0,0 +1 @@ +bar contents \ No newline at end of file diff --git a/node_modules/ncp/test/symlink-fixtures/src/foo b/node_modules/ncp/test/symlink-fixtures/src/foo new file mode 100755 index 00000000..35fc0603 --- /dev/null +++ b/node_modules/ncp/test/symlink-fixtures/src/foo @@ -0,0 +1 @@ +foo contents \ No newline at end of file diff --git a/node_modules/ndjson/.npmignore b/node_modules/ndjson/.npmignore new file mode 100755 index 00000000..b512c09d --- /dev/null +++ b/node_modules/ndjson/.npmignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/node_modules/ndjson/cli.js b/node_modules/ndjson/cli.js new file mode 100755 index 00000000..7cc9b42a --- /dev/null +++ b/node_modules/ndjson/cli.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node + +var fs = require('fs') +var ndjson = require('./index.js') +var minimist = require('minimist') + +var args = minimist(process.argv.slice(2)) + +var inputStream + +var first = args._[0] +if (!first) { + console.error('Usage: ndjson [input] ') + process.exit(1) +} + +if (first === '-') inputStream = process.stdin +else inputStream = fs.createReadStream(first) + +var parse = ndjson.parse(args) +var serializer = ndjson.serialize(args) + +inputStream.pipe(parse).pipe(serializer).pipe(process.stdout) diff --git a/node_modules/ndjson/collaborators.md b/node_modules/ndjson/collaborators.md new file mode 100755 index 00000000..21497a28 --- /dev/null +++ b/node_modules/ndjson/collaborators.md @@ -0,0 +1,7 @@ +## Collaborators + +ldjson-stream is only possible due to the excellent work of the following collaborators: + + + +
      maxogdenGitHub/maxogden
      finnpGitHub/finnp
      diff --git a/node_modules/ndjson/index.js b/node_modules/ndjson/index.js new file mode 100755 index 00000000..15edcc7c --- /dev/null +++ b/node_modules/ndjson/index.js @@ -0,0 +1,31 @@ +var through = require('through2') +var split = require('split2') +var EOL = require('os').EOL +var stringify = require('json-stringify-safe') + +module.exports = parse +module.exports.serialize = module.exports.stringify = serialize +module.exports.parse = parse + +function parse (opts) { + opts = opts || {} + opts.strict = opts.strict !== false + + function parseRow (row) { + try { + if (row) return JSON.parse(row) + } catch (e) { + if (opts.strict) { + this.emit('error', new Error('Could not parse row ' + row.slice(0, 50) + '...')) + } + } + } + + return split(parseRow, opts) +} + +function serialize (opts) { + return through.obj(opts, function(obj, enc, cb) { + cb(null, stringify(obj) + EOL) + }) +} diff --git a/node_modules/ndjson/node_modules/minimist/.travis.yml b/node_modules/ndjson/node_modules/minimist/.travis.yml new file mode 100755 index 00000000..74c57bf1 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" +before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/ndjson/node_modules/minimist/LICENSE b/node_modules/ndjson/node_modules/minimist/LICENSE new file mode 100755 index 00000000..ee27ba4b --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ndjson/node_modules/minimist/example/parse.js b/node_modules/ndjson/node_modules/minimist/example/parse.js new file mode 100755 index 00000000..abff3e8e --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/node_modules/ndjson/node_modules/minimist/index.js b/node_modules/ndjson/node_modules/minimist/index.js new file mode 100755 index 00000000..6a0559d5 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/index.js @@ -0,0 +1,236 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {}, unknownFn: null }; + + if (typeof opts['unknown'] === 'function') { + flags.unknownFn = opts['unknown']; + } + + if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { + flags.allBools = true; + } else { + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function argDefined(key, arg) { + return (flags.allBools && /^--[^=]+$/.test(arg)) || + flags.strings[key] || flags.bools[key] || aliases[key]; + } + + function setArg (key, val, arg) { + if (arg && flags.unknownFn && !argDefined(key, arg)) { + if (flags.unknownFn(arg) === false) return; + } + + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } + } + + function aliasIsBoolean(key) { + return aliases[key].some(function (x) { + return flags.bools[x]; + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + var key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== 'false'; + } + setArg(key, value, arg); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, next, arg); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next, arg) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { + setArg(letters[j], next.split('=')[1], arg); + broken = true; + break; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next, arg); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2), arg); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, args[i+1], arg); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + } + else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + if (opts['--']) { + argv['--'] = new Array(); + notFlags.forEach(function(key) { + argv['--'].push(key); + }); + } + else { + notFlags.forEach(function(key) { + argv._.push(key); + }); + } + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + diff --git a/node_modules/ndjson/node_modules/minimist/package.json b/node_modules/ndjson/node_modules/minimist/package.json new file mode 100755 index 00000000..97fc6fa9 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "minimist@^1.2.0", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "^1.2.0", + "spec": ">=1.2.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/ndjson" + ] + ], + "_from": "minimist@>=1.2.0 <2.0.0", + "_id": "minimist@1.2.0", + "_inCache": true, + "_location": "/ndjson/minimist", + "_nodeVersion": "2.4.0", + "_npmUser": { + "name": "substack", + "email": "substack@gmail.com" + }, + "_npmVersion": "3.2.2", + "_phantomChildren": {}, + "_requested": { + "raw": "minimist@^1.2.0", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "^1.2.0", + "spec": ">=1.2.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/ndjson" + ], + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "_shasum": "a35008b20f41383eec1fb914f4cd5df79a264284", + "_shrinkwrap": null, + "_spec": "minimist@^1.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/ndjson", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "dependencies": {}, + "description": "parse argument options", + "devDependencies": { + "covert": "^1.0.0", + "tap": "~0.4.0", + "tape": "^3.5.0" + }, + "directories": {}, + "dist": { + "shasum": "a35008b20f41383eec1fb914f4cd5df79a264284", + "tarball": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz" + }, + "gitHead": "dc624482fcfec5bc669c68cdb861f00573ed4e64", + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "minimist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "version": "1.2.0" +} diff --git a/node_modules/ndjson/node_modules/minimist/readme.markdown b/node_modules/ndjson/node_modules/minimist/readme.markdown new file mode 100755 index 00000000..30a74cf8 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/readme.markdown @@ -0,0 +1,91 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a boolean, string or array of strings to always treat as +booleans. if `true` will treat all double hyphenated arguments without equal signs +as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values +* `opts.stopEarly` - when true, populate `argv._` with everything after the +first non-option +* `opts['--']` - when true, populate `argv._` with everything before the `--` +and `argv['--']` with everything after the `--`. Here's an example: +* `opts.unknown` - a function which is invoked with a command line parameter not +defined in the `opts` configuration object. If the function returns `false`, the +unknown option is not added to `argv`. + +``` +> require('./')('one two three -- four five --six'.split(' '), { '--': true }) +{ _: [ 'one', 'two', 'three' ], + '--': [ 'four', 'five', '--six' ] } +``` + +Note that with `opts['--']` set, parsing for arguments still stops after the +`--`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/node_modules/ndjson/node_modules/minimist/test/all_bool.js b/node_modules/ndjson/node_modules/minimist/test/all_bool.js new file mode 100755 index 00000000..ac835483 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/all_bool.js @@ -0,0 +1,32 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean true (default all --args to boolean)', function (t) { + var argv = parse(['moo', '--honk', 'cow'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); + +test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { + var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + tacos: 'good', + p: 55, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/bool.js b/node_modules/ndjson/node_modules/minimist/test/bool.js new file mode 100755 index 00000000..14b0717c --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/bool.js @@ -0,0 +1,166 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias array with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var alt = [ '--harp', 'derp' ]; + var opts = { + alias: { 'h': ['herp', 'harp'] }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var altPropertyArgv = parse(alt, opts); + var expected = { + harp: true, + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.same(altPropertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); + +test('boolean --boool=true', function (t) { + var parsed = parse(['--boool=true'], { + default: { + boool: false + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, true); + t.end(); +}); + +test('boolean --boool=false', function (t) { + var parsed = parse(['--boool=false'], { + default: { + boool: true + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, false); + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/dash.js b/node_modules/ndjson/node_modules/minimist/test/dash.js new file mode 100755 index 00000000..5a4fa5be --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/dash.js @@ -0,0 +1,31 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); + +test('move arguments after the -- into their own `--` array', function(t) { + t.plan(1); + t.deepEqual( + parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), + { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/default_bool.js b/node_modules/ndjson/node_modules/minimist/test/default_bool.js new file mode 100755 index 00000000..780a3112 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/default_bool.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); + +test('boolean default to null', function (t) { + var argv = parse([], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, null); + var argv = parse(['--maybe'], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, true); + t.end(); + +}) diff --git a/node_modules/ndjson/node_modules/minimist/test/dotted.js b/node_modules/ndjson/node_modules/minimist/test/dotted.js new file mode 100755 index 00000000..d8b3e856 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/dotted.js @@ -0,0 +1,22 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); + +test('dotted default with no alias', function (t) { + var argv = parse('', {default: {'a.b': 11}}); + t.equal(argv.a.b, 11); + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/kv_short.js b/node_modules/ndjson/node_modules/minimist/test/kv_short.js new file mode 100755 index 00000000..f813b305 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/kv_short.js @@ -0,0 +1,16 @@ +var parse = require('../'); +var test = require('tape'); + +test('short -k=v' , function (t) { + t.plan(1); + + var argv = parse([ '-b=123' ]); + t.deepEqual(argv, { b: 123, _: [] }); +}); + +test('multi short -k=v' , function (t) { + t.plan(1); + + var argv = parse([ '-a=whatever', '-b=robots' ]); + t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/long.js b/node_modules/ndjson/node_modules/minimist/test/long.js new file mode 100755 index 00000000..5d3a1e09 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/num.js b/node_modules/ndjson/node_modules/minimist/test/num.js new file mode 100755 index 00000000..2cc77f4d --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/num.js @@ -0,0 +1,36 @@ +var parse = require('../'); +var test = require('tape'); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('already a number', function (t) { + var argv = parse([ '-x', 1234, 789 ]); + t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/parse.js b/node_modules/ndjson/node_modules/minimist/test/parse.js new file mode 100755 index 00000000..7b4a2a17 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/parse.js @@ -0,0 +1,197 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function(t) { + var s = parse([ '-s' ], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse([ '--str' ], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse([ '-art' ], { + string: [ 'a', 't' ] + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + + +test('string and alias', function(t) { + var x = parse([ '--str', '000123' ], { + string: 's', + alias: { s: 'str' } + }); + + t.equal(x.str, '000123'); + t.equal(typeof x.str, 'string'); + t.equal(x.s, '000123'); + t.equal(typeof x.s, 'string'); + + var y = parse([ '-s', '000123' ], { + string: 'str', + alias: { str: 's' } + }); + + t.equal(y.str, '000123'); + t.equal(typeof y.str, 'string'); + t.equal(y.s, '000123'); + t.equal(typeof y.s, 'string'); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/parse_modified.js b/node_modules/ndjson/node_modules/minimist/test/parse_modified.js new file mode 100755 index 00000000..ab620dc5 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: [123] }); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/short.js b/node_modules/ndjson/node_modules/minimist/test/short.js new file mode 100755 index 00000000..d513a1c2 --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/stop_early.js b/node_modules/ndjson/node_modules/minimist/test/stop_early.js new file mode 100755 index 00000000..bdf9fbcb --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/stop_early.js @@ -0,0 +1,15 @@ +var parse = require('../'); +var test = require('tape'); + +test('stops parsing on the first non-option when stopEarly is set', function (t) { + var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { + stopEarly: true + }); + + t.deepEqual(argv, { + aaa: 'bbb', + _: ['ccc', '--ddd'] + }); + + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/unknown.js b/node_modules/ndjson/node_modules/minimist/test/unknown.js new file mode 100755 index 00000000..462a36bd --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/unknown.js @@ -0,0 +1,102 @@ +var parse = require('../'); +var test = require('tape'); + +test('boolean and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'true', '--derp', 'true' ]; + var regular = [ '--herp', 'true', '-d', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('flag boolean true any double hyphen argument is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { + boolean: true, + unknown: unknownFn + }); + t.same(unknown, ['--tacos=good', 'cow', '-p']); + t.same(argv, { + honk: true, + _: [] + }); + t.end(); +}); + +test('string and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; + var regular = [ '--herp', 'hello', '-d', 'moon' ]; + var opts = { + alias: { h: 'herp' }, + string: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('default and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello' ]; + var regular = [ '--herp', 'hello' ]; + var opts = { + default: { 'h': 'bar' }, + alias: { 'h': 'herp' }, + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, []); + t.end(); + unknownFn(); // exercise fn for 100% coverage +}); + +test('value following -- is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '--bad', '--', 'good', 'arg' ]; + var opts = { + '--': true, + unknown: unknownFn + }; + var argv = parse(aliased, opts); + + t.same(unknown, ['--bad']); + t.same(argv, { + '--': ['good', 'arg'], + '_': [] + }) + t.end(); +}); diff --git a/node_modules/ndjson/node_modules/minimist/test/whitespace.js b/node_modules/ndjson/node_modules/minimist/test/whitespace.js new file mode 100755 index 00000000..8a52a58c --- /dev/null +++ b/node_modules/ndjson/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/node_modules/ndjson/package.json b/node_modules/ndjson/package.json new file mode 100755 index 00000000..dc492b38 --- /dev/null +++ b/node_modules/ndjson/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "ndjson@^1.2.3", + "scope": null, + "escapedName": "ndjson", + "name": "ndjson", + "rawSpec": "^1.2.3", + "spec": ">=1.2.3 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket" + ] + ], + "_from": "ndjson@>=1.2.3 <2.0.0", + "_id": "ndjson@1.5.0", + "_inCache": true, + "_location": "/ndjson", + "_nodeVersion": "7.1.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ndjson-1.5.0.tgz_1480945705636_0.05483738542534411" + }, + "_npmUser": { + "name": "finnpauls", + "email": "derfinn@gmail.com" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "ndjson@^1.2.3", + "scope": null, + "escapedName": "ndjson", + "name": "ndjson", + "rawSpec": "^1.2.3", + "spec": ">=1.2.3 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gasket" + ], + "_resolved": "https://registry.npmjs.org/ndjson/-/ndjson-1.5.0.tgz", + "_shasum": "ae603b36b134bcec347b452422b0bf98d5832ec8", + "_shrinkwrap": null, + "_spec": "ndjson@^1.2.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket", + "author": { + "name": "max ogden" + }, + "bin": { + "ndjson": "cli.js" + }, + "bugs": { + "url": "https://github.com/maxogden/ndjson/issues" + }, + "dependencies": { + "json-stringify-safe": "^5.0.1", + "minimist": "^1.2.0", + "split2": "^2.1.0", + "through2": "^2.0.3" + }, + "description": "streaming newline delimited json parser + serializer", + "devDependencies": { + "concat-stream": "^1.5.0", + "tape": "^4.6.3" + }, + "directories": {}, + "dist": { + "shasum": "ae603b36b134bcec347b452422b0bf98d5832ec8", + "tarball": "https://registry.npmjs.org/ndjson/-/ndjson-1.5.0.tgz" + }, + "gitHead": "2bb834d45e1ff8894356e0f36e8d00dbf2c8a063", + "homepage": "https://github.com/maxogden/ndjson", + "keywords": [ + "ndjson", + "ldjson" + ], + "license": "BSD-3-Clause", + "main": "index.js", + "maintainers": [ + { + "name": "maxogden", + "email": "max+DONT+EMAIL+ME@maxogden.com" + }, + { + "name": "finnpauls", + "email": "derfinn@gmail.com" + } + ], + "name": "ndjson", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/maxogden/ndjson.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "1.5.0" +} diff --git a/node_modules/ndjson/readme.md b/node_modules/ndjson/readme.md new file mode 100755 index 00000000..19dc11be --- /dev/null +++ b/node_modules/ndjson/readme.md @@ -0,0 +1,55 @@ +# ndjson + +streaming [newline delimited json](https://en.wikipedia.org/wiki/Line_Delimited_JSON) parser + serializer. Available as a JS API or a command line tool + +[![NPM](https://nodei.co/npm/ndjson.png)](https://nodei.co/npm/ndjson/) + +## usage + +``` +var ndjson = require('ndjson') +``` + +#### ndjson.parse(opts) + +returns a transform stream that accepts newline delimited json and emits objects + +example newline delimited json: + +`data.txt`: + +``` +{"foo": "bar"} +{"hello": "world"} +``` + +If you want to discard non-valid JSON messages, you can call `ndjson.parse({strict: false})` + +usage: + +```js +fs.createReadStream('data.txt') + .pipe(ndjson.parse()) + .on('data', function(obj) { + // obj is a javascript object + }) +``` + +#### ndjson.serialize() / ndjson.stringify() + +returns a transform stream that accepts json objects and emits newline delimited json + +example usage: + +```js +var serialize = ndjson.serialize() +serialize.on('data', function(line) { + // line is a line of stringified JSON with a newline delimiter at the end +}) +serialize.write({"foo": "bar"}) +serialize.end() +``` + +### license + +BSD-3-Clause diff --git a/node_modules/ndjson/test.js b/node_modules/ndjson/test.js new file mode 100755 index 00000000..46b4b752 --- /dev/null +++ b/node_modules/ndjson/test.js @@ -0,0 +1,85 @@ +var test = require('tape') +var ndj = require('./') +var os = require('os') +var concat = require('concat-stream') + +test('.parse', function(t) { + var parser = ndj.parse() + parser.on('data', function(obj) { + t.equal(obj.hello, 'world') + t.end() + }) + + parser.write('{"hello": "world"}\n') +}) + +test('.parse twice', function(t) { + var parser = ndj.parse() + parser.once('data', function(obj) { + t.equal(obj.hello, 'world') + parser.once('data', function(obj) { + t.equal(obj.hola, 'mundo') + t.end() + }) + }) + + parser.write('{"hello": "world"}\n{"hola": "mundo"}\n') +}) + +test('.parse - strict:true error', function (t) { + var parser = ndj.parse({strict: true}) + try { + parser.write('{"no":"json"\n') + } catch(e) { + t.pass('error thrown') + t.end() + } +}) + +test('.parse - strict:true error event', function (t) { + var parser = ndj.parse({strict: true}) + parser.on('error', function (err) { + t.pass('error event called') + t.end() + }) + try { + parser.write('{"no":"json"\n') + } catch(e) { + t.fail('should not throw') + } +}) + +test('.parse - strict:false error', function (t) { + var parser = ndj.parse({strict: false}) + parser.once('data', function (data) { + t.ok(data.json, 'parse second one') + t.end() + }) + try { + parser.write('{"json":false\n{"json":true}\n') + } catch(e) { + t.fail('should not call an error') + } +}) + +test('.serialize', function(t) { + var serializer = ndj.serialize() + serializer.pipe(concat(function(data) { + t.equal(data, '{"hello":"world"}' + os.EOL) + t.end() + })) + serializer.write({hello: 'world'}) + serializer.end() +}) + +test('.serialize circular', function(t) { + var serializer = ndj.serialize() + serializer.pipe(concat(function(data) { + t.equal(data, '{"obj":"[Circular ~]"}' + os.EOL) + t.end() + })) + var obj = {} + obj.obj = obj + serializer.write(obj) + serializer.end() +}) diff --git a/node_modules/negotiator/HISTORY.md b/node_modules/negotiator/HISTORY.md new file mode 100755 index 00000000..10b69179 --- /dev/null +++ b/node_modules/negotiator/HISTORY.md @@ -0,0 +1,98 @@ +0.6.1 / 2016-05-02 +================== + + * perf: improve `Accept` parsing speed + * perf: improve `Accept-Charset` parsing speed + * perf: improve `Accept-Encoding` parsing speed + * perf: improve `Accept-Language` parsing speed + +0.6.0 / 2015-09-29 +================== + + * Fix including type extensions in parameters in `Accept` parsing + * Fix parsing `Accept` parameters with quoted equals + * Fix parsing `Accept` parameters with quoted semicolons + * Lazy-load modules from main entry point + * perf: delay type concatenation until needed + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove closures getting spec properties + * perf: remove a closure from media type parsing + * perf: remove property delete from media type parsing + +0.5.3 / 2015-05-10 +================== + + * Fix media type parameter matching to be case-insensitive + +0.5.2 / 2015-05-06 +================== + + * Fix comparing media types with quoted values + * Fix splitting media types with quoted commas + +0.5.1 / 2015-02-14 +================== + + * Fix preference sorting to be stable for long acceptable lists + +0.5.0 / 2014-12-18 +================== + + * Fix list return order when large accepted list + * Fix missing identity encoding when q=0 exists + * Remove dynamic building of Negotiator class + +0.4.9 / 2014-10-14 +================== + + * Fix error when media type has invalid parameter + +0.4.8 / 2014-09-28 +================== + + * Fix all negotiations to be case-insensitive + * Stable sort preferences of same quality according to client order + * Support Node.js 0.6 + +0.4.7 / 2014-06-24 +================== + + * Handle invalid provided languages + * Handle invalid provided media types + +0.4.6 / 2014-06-11 +================== + + * Order by specificity when quality is the same + +0.4.5 / 2014-05-29 +================== + + * Fix regression in empty header handling + +0.4.4 / 2014-05-29 +================== + + * Fix behaviors when headers are not present + +0.4.3 / 2014-04-16 +================== + + * Handle slashes on media params correctly + +0.4.2 / 2014-02-28 +================== + + * Fix media type sorting + * Handle media types params strictly + +0.4.1 / 2014-01-16 +================== + + * Use most specific matches + +0.4.0 / 2014-01-09 +================== + + * Remove preferred prefix from methods diff --git a/node_modules/negotiator/LICENSE b/node_modules/negotiator/LICENSE new file mode 100755 index 00000000..ea6b9e2e --- /dev/null +++ b/node_modules/negotiator/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Federico Romero +Copyright (c) 2012-2014 Isaac Z. Schlueter +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/negotiator/README.md b/node_modules/negotiator/README.md new file mode 100755 index 00000000..04a67ff7 --- /dev/null +++ b/node_modules/negotiator/README.md @@ -0,0 +1,203 @@ +# negotiator + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +An HTTP content negotiator for Node.js + +## Installation + +```sh +$ npm install negotiator +``` + +## API + +```js +var Negotiator = require('negotiator') +``` + +### Accept Negotiation + +```js +availableMediaTypes = ['text/html', 'text/plain', 'application/json'] + +// The negotiator constructor receives a request object +negotiator = new Negotiator(request) + +// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8' + +negotiator.mediaTypes() +// -> ['text/html', 'image/jpeg', 'application/*'] + +negotiator.mediaTypes(availableMediaTypes) +// -> ['text/html', 'application/json'] + +negotiator.mediaType(availableMediaTypes) +// -> 'text/html' +``` + +You can check a working example at `examples/accept.js`. + +#### Methods + +##### mediaType() + +Returns the most preferred media type from the client. + +##### mediaType(availableMediaType) + +Returns the most preferred media type from a list of available media types. + +##### mediaTypes() + +Returns an array of preferred media types ordered by the client preference. + +##### mediaTypes(availableMediaTypes) + +Returns an array of preferred media types ordered by priority from a list of +available media types. + +### Accept-Language Negotiation + +```js +negotiator = new Negotiator(request) + +availableLanguages = ['en', 'es', 'fr'] + +// Let's say Accept-Language header is 'en;q=0.8, es, pt' + +negotiator.languages() +// -> ['es', 'pt', 'en'] + +negotiator.languages(availableLanguages) +// -> ['es', 'en'] + +language = negotiator.language(availableLanguages) +// -> 'es' +``` + +You can check a working example at `examples/language.js`. + +#### Methods + +##### language() + +Returns the most preferred language from the client. + +##### language(availableLanguages) + +Returns the most preferred language from a list of available languages. + +##### languages() + +Returns an array of preferred languages ordered by the client preference. + +##### languages(availableLanguages) + +Returns an array of preferred languages ordered by priority from a list of +available languages. + +### Accept-Charset Negotiation + +```js +availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2' + +negotiator.charsets() +// -> ['utf-8', 'iso-8859-1', 'utf-7'] + +negotiator.charsets(availableCharsets) +// -> ['utf-8', 'iso-8859-1'] + +negotiator.charset(availableCharsets) +// -> 'utf-8' +``` + +You can check a working example at `examples/charset.js`. + +#### Methods + +##### charset() + +Returns the most preferred charset from the client. + +##### charset(availableCharsets) + +Returns the most preferred charset from a list of available charsets. + +##### charsets() + +Returns an array of preferred charsets ordered by the client preference. + +##### charsets(availableCharsets) + +Returns an array of preferred charsets ordered by priority from a list of +available charsets. + +### Accept-Encoding Negotiation + +```js +availableEncodings = ['identity', 'gzip'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5' + +negotiator.encodings() +// -> ['gzip', 'identity', 'compress'] + +negotiator.encodings(availableEncodings) +// -> ['gzip', 'identity'] + +negotiator.encoding(availableEncodings) +// -> 'gzip' +``` + +You can check a working example at `examples/encoding.js`. + +#### Methods + +##### encoding() + +Returns the most preferred encoding from the client. + +##### encoding(availableEncodings) + +Returns the most preferred encoding from a list of available encodings. + +##### encodings() + +Returns an array of preferred encodings ordered by the client preference. + +##### encodings(availableEncodings) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings. + +## See Also + +The [accepts](https://npmjs.org/package/accepts#readme) module builds on +this module and provides an alternative interface, mime type validation, +and more. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/negotiator.svg +[npm-url]: https://npmjs.org/package/negotiator +[node-version-image]: https://img.shields.io/node/v/negotiator.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/negotiator/master.svg +[travis-url]: https://travis-ci.org/jshttp/negotiator +[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master +[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg +[downloads-url]: https://npmjs.org/package/negotiator diff --git a/node_modules/negotiator/index.js b/node_modules/negotiator/index.js new file mode 100755 index 00000000..8d4f6a22 --- /dev/null +++ b/node_modules/negotiator/index.js @@ -0,0 +1,124 @@ +/*! + * negotiator + * Copyright(c) 2012 Federico Romero + * Copyright(c) 2012-2014 Isaac Z. Schlueter + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Cached loaded submodules. + * @private + */ + +var modules = Object.create(null); + +/** + * Module exports. + * @public + */ + +module.exports = Negotiator; +module.exports.Negotiator = Negotiator; + +/** + * Create a Negotiator instance from a request. + * @param {object} request + * @public + */ + +function Negotiator(request) { + if (!(this instanceof Negotiator)) { + return new Negotiator(request); + } + + this.request = request; +} + +Negotiator.prototype.charset = function charset(available) { + var set = this.charsets(available); + return set && set[0]; +}; + +Negotiator.prototype.charsets = function charsets(available) { + var preferredCharsets = loadModule('charset').preferredCharsets; + return preferredCharsets(this.request.headers['accept-charset'], available); +}; + +Negotiator.prototype.encoding = function encoding(available) { + var set = this.encodings(available); + return set && set[0]; +}; + +Negotiator.prototype.encodings = function encodings(available) { + var preferredEncodings = loadModule('encoding').preferredEncodings; + return preferredEncodings(this.request.headers['accept-encoding'], available); +}; + +Negotiator.prototype.language = function language(available) { + var set = this.languages(available); + return set && set[0]; +}; + +Negotiator.prototype.languages = function languages(available) { + var preferredLanguages = loadModule('language').preferredLanguages; + return preferredLanguages(this.request.headers['accept-language'], available); +}; + +Negotiator.prototype.mediaType = function mediaType(available) { + var set = this.mediaTypes(available); + return set && set[0]; +}; + +Negotiator.prototype.mediaTypes = function mediaTypes(available) { + var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes; + return preferredMediaTypes(this.request.headers.accept, available); +}; + +// Backwards compatibility +Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; +Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; +Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; +Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; +Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; +Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; +Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; +Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; + +/** + * Load the given module. + * @private + */ + +function loadModule(moduleName) { + var module = modules[moduleName]; + + if (module !== undefined) { + return module; + } + + // This uses a switch for static require analysis + switch (moduleName) { + case 'charset': + module = require('./lib/charset'); + break; + case 'encoding': + module = require('./lib/encoding'); + break; + case 'language': + module = require('./lib/language'); + break; + case 'mediaType': + module = require('./lib/mediaType'); + break; + default: + throw new Error('Cannot find module \'' + moduleName + '\''); + } + + // Store to prevent invoking require() + modules[moduleName] = module; + + return module; +} diff --git a/node_modules/negotiator/lib/charset.js b/node_modules/negotiator/lib/charset.js new file mode 100755 index 00000000..ac4217b4 --- /dev/null +++ b/node_modules/negotiator/lib/charset.js @@ -0,0 +1,169 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredCharsets; +module.exports.preferredCharsets = preferredCharsets; + +/** + * Module variables. + * @private + */ + +var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Charset header. + * @private + */ + +function parseAcceptCharset(accept) { + var accepts = accept.split(','); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var charset = parseCharset(accepts[i].trim(), i); + + if (charset) { + accepts[j++] = charset; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a charset from the Accept-Charset header. + * @private + */ + +function parseCharset(str, i) { + var match = simpleCharsetRegExp.exec(str); + if (!match) return null; + + var charset = match[1]; + var q = 1; + if (match[2]) { + var params = match[2].split(';') + for (var i = 0; i < params.length; i ++) { + var p = params[i].trim().split('='); + if (p[0] === 'q') { + q = parseFloat(p[1]); + break; + } + } + } + + return { + charset: charset, + q: q, + i: i + }; +} + +/** + * Get the priority of a charset. + * @private + */ + +function getCharsetPriority(charset, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(charset, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the charset. + * @private + */ + +function specify(charset, spec, index) { + var s = 0; + if(spec.charset.toLowerCase() === charset.toLowerCase()){ + s |= 1; + } else if (spec.charset !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +} + +/** + * Get the preferred charsets from an Accept-Charset header. + * @public + */ + +function preferredCharsets(accept, provided) { + // RFC 2616 sec 14.2: no header = * + var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all charsets + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullCharset); + } + + var priorities = provided.map(function getPriority(type, index) { + return getCharsetPriority(type, accepts, index); + }); + + // sorted list of accepted charsets + return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full charset string. + * @private + */ + +function getFullCharset(spec) { + return spec.charset; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/node_modules/negotiator/lib/encoding.js b/node_modules/negotiator/lib/encoding.js new file mode 100755 index 00000000..70ac3de6 --- /dev/null +++ b/node_modules/negotiator/lib/encoding.js @@ -0,0 +1,184 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredEncodings; +module.exports.preferredEncodings = preferredEncodings; + +/** + * Module variables. + * @private + */ + +var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Encoding header. + * @private + */ + +function parseAcceptEncoding(accept) { + var accepts = accept.split(','); + var hasIdentity = false; + var minQuality = 1; + + for (var i = 0, j = 0; i < accepts.length; i++) { + var encoding = parseEncoding(accepts[i].trim(), i); + + if (encoding) { + accepts[j++] = encoding; + hasIdentity = hasIdentity || specify('identity', encoding); + minQuality = Math.min(minQuality, encoding.q || 1); + } + } + + if (!hasIdentity) { + /* + * If identity doesn't explicitly appear in the accept-encoding header, + * it's added to the list of acceptable encoding with the lowest q + */ + accepts[j++] = { + encoding: 'identity', + q: minQuality, + i: i + }; + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse an encoding from the Accept-Encoding header. + * @private + */ + +function parseEncoding(str, i) { + var match = simpleEncodingRegExp.exec(str); + if (!match) return null; + + var encoding = match[1]; + var q = 1; + if (match[2]) { + var params = match[2].split(';'); + for (var i = 0; i < params.length; i ++) { + var p = params[i].trim().split('='); + if (p[0] === 'q') { + q = parseFloat(p[1]); + break; + } + } + } + + return { + encoding: encoding, + q: q, + i: i + }; +} + +/** + * Get the priority of an encoding. + * @private + */ + +function getEncodingPriority(encoding, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(encoding, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the encoding. + * @private + */ + +function specify(encoding, spec, index) { + var s = 0; + if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ + s |= 1; + } else if (spec.encoding !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred encodings from an Accept-Encoding header. + * @public + */ + +function preferredEncodings(accept, provided) { + var accepts = parseAcceptEncoding(accept || ''); + + if (!provided) { + // sorted list of all encodings + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullEncoding); + } + + var priorities = provided.map(function getPriority(type, index) { + return getEncodingPriority(type, accepts, index); + }); + + // sorted list of accepted encodings + return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full encoding string. + * @private + */ + +function getFullEncoding(spec) { + return spec.encoding; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/node_modules/negotiator/lib/language.js b/node_modules/negotiator/lib/language.js new file mode 100755 index 00000000..1bd2d0e1 --- /dev/null +++ b/node_modules/negotiator/lib/language.js @@ -0,0 +1,179 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredLanguages; +module.exports.preferredLanguages = preferredLanguages; + +/** + * Module variables. + * @private + */ + +var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Language header. + * @private + */ + +function parseAcceptLanguage(accept) { + var accepts = accept.split(','); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var langauge = parseLanguage(accepts[i].trim(), i); + + if (langauge) { + accepts[j++] = langauge; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a language from the Accept-Language header. + * @private + */ + +function parseLanguage(str, i) { + var match = simpleLanguageRegExp.exec(str); + if (!match) return null; + + var prefix = match[1], + suffix = match[2], + full = prefix; + + if (suffix) full += "-" + suffix; + + var q = 1; + if (match[3]) { + var params = match[3].split(';') + for (var i = 0; i < params.length; i ++) { + var p = params[i].split('='); + if (p[0] === 'q') q = parseFloat(p[1]); + } + } + + return { + prefix: prefix, + suffix: suffix, + q: q, + i: i, + full: full + }; +} + +/** + * Get the priority of a language. + * @private + */ + +function getLanguagePriority(language, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(language, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the language. + * @private + */ + +function specify(language, spec, index) { + var p = parseLanguage(language) + if (!p) return null; + var s = 0; + if(spec.full.toLowerCase() === p.full.toLowerCase()){ + s |= 4; + } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { + s |= 2; + } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { + s |= 1; + } else if (spec.full !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred languages from an Accept-Language header. + * @public + */ + +function preferredLanguages(accept, provided) { + // RFC 2616 sec 14.4: no header = * + var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all languages + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullLanguage); + } + + var priorities = provided.map(function getPriority(type, index) { + return getLanguagePriority(type, accepts, index); + }); + + // sorted list of accepted languages + return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full language string. + * @private + */ + +function getFullLanguage(spec) { + return spec.full; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/node_modules/negotiator/lib/mediaType.js b/node_modules/negotiator/lib/mediaType.js new file mode 100755 index 00000000..67309dd7 --- /dev/null +++ b/node_modules/negotiator/lib/mediaType.js @@ -0,0 +1,294 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredMediaTypes; +module.exports.preferredMediaTypes = preferredMediaTypes; + +/** + * Module variables. + * @private + */ + +var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept header. + * @private + */ + +function parseAccept(accept) { + var accepts = splitMediaTypes(accept); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var mediaType = parseMediaType(accepts[i].trim(), i); + + if (mediaType) { + accepts[j++] = mediaType; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a media type from the Accept header. + * @private + */ + +function parseMediaType(str, i) { + var match = simpleMediaTypeRegExp.exec(str); + if (!match) return null; + + var params = Object.create(null); + var q = 1; + var subtype = match[2]; + var type = match[1]; + + if (match[3]) { + var kvps = splitParameters(match[3]).map(splitKeyValuePair); + + for (var j = 0; j < kvps.length; j++) { + var pair = kvps[j]; + var key = pair[0].toLowerCase(); + var val = pair[1]; + + // get the value, unwrapping quotes + var value = val && val[0] === '"' && val[val.length - 1] === '"' + ? val.substr(1, val.length - 2) + : val; + + if (key === 'q') { + q = parseFloat(value); + break; + } + + // store parameter + params[key] = value; + } + } + + return { + type: type, + subtype: subtype, + params: params, + q: q, + i: i + }; +} + +/** + * Get the priority of a media type. + * @private + */ + +function getMediaTypePriority(type, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(type, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the media type. + * @private + */ + +function specify(type, spec, index) { + var p = parseMediaType(type); + var s = 0; + + if (!p) { + return null; + } + + if(spec.type.toLowerCase() == p.type.toLowerCase()) { + s |= 4 + } else if(spec.type != '*') { + return null; + } + + if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { + s |= 2 + } else if(spec.subtype != '*') { + return null; + } + + var keys = Object.keys(spec.params); + if (keys.length > 0) { + if (keys.every(function (k) { + return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); + })) { + s |= 1 + } else { + return null + } + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s, + } +} + +/** + * Get the preferred media types from an Accept header. + * @public + */ + +function preferredMediaTypes(accept, provided) { + // RFC 2616 sec 14.2: no header = */* + var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); + + if (!provided) { + // sorted list of all types + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullType); + } + + var priorities = provided.map(function getPriority(type, index) { + return getMediaTypePriority(type, accepts, index); + }); + + // sorted list of accepted types + return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full type string. + * @private + */ + +function getFullType(spec) { + return spec.type + '/' + spec.subtype; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} + +/** + * Count the number of quotes in a string. + * @private + */ + +function quoteCount(string) { + var count = 0; + var index = 0; + + while ((index = string.indexOf('"', index)) !== -1) { + count++; + index++; + } + + return count; +} + +/** + * Split a key value pair. + * @private + */ + +function splitKeyValuePair(str) { + var index = str.indexOf('='); + var key; + var val; + + if (index === -1) { + key = str; + } else { + key = str.substr(0, index); + val = str.substr(index + 1); + } + + return [key, val]; +} + +/** + * Split an Accept header into media types. + * @private + */ + +function splitMediaTypes(accept) { + var accepts = accept.split(','); + + for (var i = 1, j = 0; i < accepts.length; i++) { + if (quoteCount(accepts[j]) % 2 == 0) { + accepts[++j] = accepts[i]; + } else { + accepts[j] += ',' + accepts[i]; + } + } + + // trim accepts + accepts.length = j + 1; + + return accepts; +} + +/** + * Split a string of parameters. + * @private + */ + +function splitParameters(str) { + var parameters = str.split(';'); + + for (var i = 1, j = 0; i < parameters.length; i++) { + if (quoteCount(parameters[j]) % 2 == 0) { + parameters[++j] = parameters[i]; + } else { + parameters[j] += ';' + parameters[i]; + } + } + + // trim parameters + parameters.length = j + 1; + + for (var i = 0; i < parameters.length; i++) { + parameters[i] = parameters[i].trim(); + } + + return parameters; +} diff --git a/node_modules/negotiator/package.json b/node_modules/negotiator/package.json new file mode 100755 index 00000000..dcd019f3 --- /dev/null +++ b/node_modules/negotiator/package.json @@ -0,0 +1,125 @@ +{ + "_args": [ + [ + { + "raw": "negotiator@0.6.1", + "scope": null, + "escapedName": "negotiator", + "name": "negotiator", + "rawSpec": "0.6.1", + "spec": "0.6.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/accepts" + ] + ], + "_from": "negotiator@0.6.1", + "_id": "negotiator@0.6.1", + "_inCache": true, + "_location": "/negotiator", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/negotiator-0.6.1.tgz_1462250848695_0.027451182017102838" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "raw": "negotiator@0.6.1", + "scope": null, + "escapedName": "negotiator", + "name": "negotiator", + "rawSpec": "0.6.1", + "spec": "0.6.1", + "type": "version" + }, + "_requiredBy": [ + "/accepts" + ], + "_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "_shasum": "2b327184e8992101177b28563fb5e7102acd0ca9", + "_shrinkwrap": null, + "_spec": "negotiator@0.6.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/accepts", + "bugs": { + "url": "https://github.com/jshttp/negotiator/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Federico Romero", + "email": "federico.romero@outboxlabs.com" + }, + { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + } + ], + "dependencies": {}, + "description": "HTTP content negotiation", + "devDependencies": { + "istanbul": "0.4.3", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "2b327184e8992101177b28563fb5e7102acd0ca9", + "tarball": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "lib/", + "HISTORY.md", + "LICENSE", + "index.js", + "README.md" + ], + "gitHead": "751c381c32707f238143cd65d78520e16f4ef9e5", + "homepage": "https://github.com/jshttp/negotiator#readme", + "keywords": [ + "http", + "content negotiation", + "accept", + "accept-language", + "accept-encoding", + "accept-charset" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "federomero", + "email": "federomero@gmail.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + } + ], + "name": "negotiator", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/negotiator.git" + }, + "scripts": { + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "0.6.1" +} diff --git a/node_modules/node-libs-browser/README.md b/node_modules/node-libs-browser/README.md new file mode 100755 index 00000000..e65d8228 --- /dev/null +++ b/node_modules/node-libs-browser/README.md @@ -0,0 +1,67 @@ +# node-libs-browser + +The node core libs for in-browser usage. + +[![dependencies status](http://david-dm.org/webpack/node-libs-browser.png)](http://david-dm.org/webpack/node-libs-browser) + +Exports a hash [object] of absolute paths to each lib, keyed by lib names. Modules without browser replacements are `null`. + +Some modules have mocks in the `mock` directory. These are replacements with minimal functionality. + +| lib name | browser implementation | mock implementation | +|:--------:|:----------------------:|:-------------------:| +| assert | [defunctzombie/commonjs-assert](https://github.com/defunctzombie/commonjs-assert) | --- | +| buffer | [feross/buffer](https://github.com/feross/buffer) | [buffer.js](https://github.com/webpack/node-libs-browser/blob/master/mock/buffer.js) | +| child_process | --- | --- | +| cluster | --- | --- | +| console | [Raynos/console-browserify](https://github.com/Raynos/console-browserify) | [console.js](https://github.com/webpack/node-libs-browser/blob/master/mock/console.js) | +| constants | [juliangruber/constants-browserify](https://github.com/juliangruber/constants-browserify) | --- | +| crypto | [crypto-browserify/crypto-browserify](https://github.com/crypto-browserify/crypto-browserify) | --- | +| dgram | --- | --- | +| dns | --- | [dns.js](https://github.com/webpack/node-libs-browser/blob/master/mock/dns.js) | +| domain | [bevry/domain-browser](https://github.com/bevry/domain-browser) | --- | +| events | [Gozala/events](https://github.com/Gozala/events) | --- | +| fs | --- | --- | +| http | [substack/http-browserify](https://github.com/substack/http-browserify) | --- | +| https | [substack/https-browserify](https://github.com/substack/https-browserify) | --- | +| module | --- | --- | +| net | --- | [net.js](https://github.com/webpack/node-libs-browser/blob/master/mock/net.js) | +| os | [CoderPuppy/os-browserify](https://github.com/CoderPuppy/os-browserify) | --- | +| path | [substack/path-browserify](https://github.com/substack/path-browserify) | --- | +| process | [shtylman/node-process](https://github.com/shtylman/node-process) | [process.js](https://github.com/webpack/node-libs-browser/blob/master/mock/process.js) | +| punycode | [bestiejs/punycode.js](https://github.com/bestiejs/punycode.js) | --- | +| querystring | [mike-spainhower/querystring](https://github.com/mike-spainhower/querystring) | --- | +| readline | --- | --- | +| repl | --- | --- | +| stream | [substack/stream-browserify](https://github.com/substack/stream-browserify) | --- | +| string_decoder | [rvagg/string_decoder](https://github.com/rvagg/string_decoder) | --- | +| sys | [defunctzombie/node-util](https://github.com/defunctzombie/node-util) | --- | +| timers | [jryans/timers-browserify](https://github.com/jryans/timers-browserify) | --- | +| tls | --- | [tls.js](https://github.com/webpack/node-libs-browser/blob/master/mock/tls.js) | +| tty | [substack/tty-browserify](https://github.com/substack/tty-browserify) | [tty.js](https://github.com/webpack/node-libs-browser/blob/master/mock/tty.js) | +| url | [defunctzombie/node-url](https://github.com/defunctzombie/node-url) | --- | +| util | [defunctzombie/node-util](https://github.com/defunctzombie/node-util) | --- | +| vm | [substack/vm-browserify](https://github.com/substack/vm-browserify) | --- | +| zlib | [devongovett/browserify-zlib](https://github.com/devongovett/browserify-zlib) | --- | + +## Outdated versions + +### `buffer` + +The current `buffer` implementation uses feross/buffer@4.x because feross/buffer@5.x relies on [typed arrays](https://github.com/feross/buffer/commit/5daca86b7cd5d2b8ccb167534d47421029f639e9#commitcomment-19698936). +This will be dropped as soon as IE9 is not a typical browser target anymore. + +### `punycode` + +The current `punycode` implementation uses bestiejs/punycode.js@1.x because bestiejs/punycode.js@2.x requires modern JS engines that understand `const` and `let`. +It will be removed someday since it has already been [deprecated from the node API](https://nodejs.org/api/punycode.html). + +### `crypto` + +We locked `crypto-browserify` at `3.3.0` because `3.4.x` introduced a breaking change by requiring JSON files. We will not upgrade this module +for webpack 1 anymore since it will introduce a breaking change for all users that don't have the [json-loader](https://github.com/webpack/json-loader) configured. +You can, however, use a newer crypto-browserify version by configuring a [`resolve.alias`](http://webpack.github.io/docs/configuration.html#resolve-alias) and using the json-loader. + +## License + +MIT diff --git a/node_modules/node-libs-browser/index.js b/node_modules/node-libs-browser/index.js new file mode 100755 index 00000000..23c3185d --- /dev/null +++ b/node_modules/node-libs-browser/index.js @@ -0,0 +1,38 @@ +exports.assert = require.resolve('assert/'); +exports.buffer = require.resolve('buffer/'); +exports.child_process = null; +exports.cluster = null; +exports.console = require.resolve('console-browserify'); +exports.constants = require.resolve('constants-browserify'); +exports.crypto = require.resolve('crypto-browserify'); +exports.dgram = null; +exports.dns = null; +exports.domain = require.resolve('domain-browser'); +exports.events = require.resolve('events/'); +exports.fs = null; +exports.http = require.resolve('stream-http'); +exports.https = require.resolve('https-browserify'); +exports.module = null; +exports.net = null; +exports.os = require.resolve('os-browserify/browser.js'); +exports.path = require.resolve('path-browserify'); +exports.punycode = require.resolve('punycode/'); +exports.process = require.resolve('process/browser.js'); +exports.querystring = require.resolve('querystring-es3/'); +exports.readline = null; +exports.repl = null; +exports.stream = require.resolve('stream-browserify'); +exports._stream_duplex = require.resolve('readable-stream/duplex.js'); +exports._stream_passthrough = require.resolve('readable-stream/passthrough.js'); +exports._stream_readable = require.resolve('readable-stream/readable.js'); +exports._stream_transform = require.resolve('readable-stream/transform.js'); +exports._stream_writable = require.resolve('readable-stream/writable.js'); +exports.string_decoder = require.resolve('string_decoder/'); +exports.sys = require.resolve('util/util.js'); +exports.timers = require.resolve('timers-browserify'); +exports.tls = null; +exports.tty = require.resolve('tty-browserify'); +exports.url = require.resolve('url/'); +exports.util = require.resolve('util/util.js'); +exports.vm = require.resolve('vm-browserify'); +exports.zlib = require.resolve('browserify-zlib'); diff --git a/node_modules/node-libs-browser/mock/buffer.js b/node_modules/node-libs-browser/mock/buffer.js new file mode 100755 index 00000000..76a2d181 --- /dev/null +++ b/node_modules/node-libs-browser/mock/buffer.js @@ -0,0 +1,10 @@ +function Buffer() { + throw new Error("Buffer is not included."); +} +Buffer.isBuffer = function() { + return false; +}; + +exports.INSPECT_MAX_BYTES = 50; +exports.SlowBuffer = Buffer; +exports.Buffer = Buffer; diff --git a/node_modules/node-libs-browser/mock/console.js b/node_modules/node-libs-browser/mock/console.js new file mode 100755 index 00000000..2bc7d5f9 --- /dev/null +++ b/node_modules/node-libs-browser/mock/console.js @@ -0,0 +1,12 @@ +var console; +if (typeof global !== "undefined" && global.console) { + console = global.console +} else if (typeof window !== "undefined" && window.console) { + console = window.console +} else { + console = window.console = {} +} +module.exports = console; +for(var name in {log:1, info:1, error:1, warn:1, dir:1, trace:1, assert:1, time:1, timeEnd: 1}) + if(!console[name]) + console[name] = function() {}; diff --git a/node_modules/node-libs-browser/mock/dns.js b/node_modules/node-libs-browser/mock/dns.js new file mode 100755 index 00000000..f15a0040 --- /dev/null +++ b/node_modules/node-libs-browser/mock/dns.js @@ -0,0 +1,15 @@ +exports.lookup = exports.resolve4 = +exports.resolve6 = exports.resolveCname = +exports.resolveMx = exports.resolveNs = +exports.resolveTxt = exports.resolveSrv = +exports.resolveNaptr = exports.reverse = +exports.resolve = +function () { + if (!arguments.length) return; + + var callback = arguments[arguments.length - 1]; + if (callback && typeof callback === 'function') { + callback(null, '0.0.0.0') + } +} + diff --git a/node_modules/node-libs-browser/mock/empty.js b/node_modules/node-libs-browser/mock/empty.js new file mode 100755 index 00000000..e69de29b diff --git a/node_modules/node-libs-browser/mock/net.js b/node_modules/node-libs-browser/mock/net.js new file mode 100755 index 00000000..e42afc70 --- /dev/null +++ b/node_modules/node-libs-browser/mock/net.js @@ -0,0 +1,10 @@ +exports.createServer = +exports.createConnection = +exports.connect = +function () {}; + +exports.isIP = +exports.isIPv4 = +exports.isIPv6 = +function () { return true }; + diff --git a/node_modules/node-libs-browser/mock/process.js b/node_modules/node-libs-browser/mock/process.js new file mode 100755 index 00000000..04f79597 --- /dev/null +++ b/node_modules/node-libs-browser/mock/process.js @@ -0,0 +1,30 @@ +exports.nextTick = function nextTick(fn) { + setTimeout(fn, 0); +}; + +exports.platform = exports.arch = +exports.execPath = exports.title = 'browser'; +exports.pid = 1; +exports.browser = true; +exports.env = {}; +exports.argv = []; + +exports.binding = function (name) { + throw new Error('No such module. (Possibly not yet loaded)') +}; + +(function () { + var cwd = '/'; + var path; + exports.cwd = function () { return cwd }; + exports.chdir = function (dir) { + if (!path) path = require('path'); + cwd = path.resolve(dir, cwd); + }; +})(); + +exports.exit = exports.kill = +exports.umask = exports.dlopen = +exports.uptime = exports.memoryUsage = +exports.uvCounters = function() {}; +exports.features = {}; diff --git a/node_modules/node-libs-browser/mock/punycode.js b/node_modules/node-libs-browser/mock/punycode.js new file mode 100755 index 00000000..9f964a17 --- /dev/null +++ b/node_modules/node-libs-browser/mock/punycode.js @@ -0,0 +1,6 @@ +exports.ucs2 = {}; +exports.encode = exports.decode = +exports.ucs2.encode = exports.ucs2.decode = +exports.toUnicode = exports.toASCII = +function (s) { return s }; +exports.version = "0.0.0"; \ No newline at end of file diff --git a/node_modules/node-libs-browser/mock/tls.js b/node_modules/node-libs-browser/mock/tls.js new file mode 100755 index 00000000..65b3dba3 --- /dev/null +++ b/node_modules/node-libs-browser/mock/tls.js @@ -0,0 +1 @@ +// todo diff --git a/node_modules/node-libs-browser/mock/tty.js b/node_modules/node-libs-browser/mock/tty.js new file mode 100755 index 00000000..a674e0f7 --- /dev/null +++ b/node_modules/node-libs-browser/mock/tty.js @@ -0,0 +1,2 @@ +exports.isatty = function () {}; +exports.setRawMode = function () {}; diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/.npmignore b/node_modules/node-libs-browser/node_modules/string_decoder/.npmignore new file mode 100755 index 00000000..206320cc --- /dev/null +++ b/node_modules/node-libs-browser/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/LICENSE b/node_modules/node-libs-browser/node_modules/string_decoder/LICENSE new file mode 100755 index 00000000..6de584a4 --- /dev/null +++ b/node_modules/node-libs-browser/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/README.md b/node_modules/node-libs-browser/node_modules/string_decoder/README.md new file mode 100755 index 00000000..4d2aa001 --- /dev/null +++ b/node_modules/node-libs-browser/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** + +The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/index.js b/node_modules/node-libs-browser/node_modules/string_decoder/index.js new file mode 100755 index 00000000..b00e54fb --- /dev/null +++ b/node_modules/node-libs-browser/node_modules/string_decoder/index.js @@ -0,0 +1,221 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.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 true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/package.json b/node_modules/node-libs-browser/node_modules/string_decoder/package.json new file mode 100755 index 00000000..160994f1 --- /dev/null +++ b/node_modules/node-libs-browser/node_modules/string_decoder/package.json @@ -0,0 +1,87 @@ +{ + "_args": [ + [ + { + "raw": "string_decoder@^0.10.25", + "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "^0.10.25", + "spec": ">=0.10.25 <0.11.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "string_decoder@>=0.10.25 <0.11.0", + "_id": "string_decoder@0.10.31", + "_inCache": true, + "_location": "/node-libs-browser/string_decoder", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "raw": "string_decoder@^0.10.25", + "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "^0.10.25", + "spec": ">=0.10.25 <0.11.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_shrinkwrap": null, + "_spec": "string_decoder@^0.10.25", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "dependencies": {}, + "description": "The string_decoder module from Node core", + "devDependencies": { + "tap": "~0.4.8" + }, + "directories": {}, + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "string_decoder", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "version": "0.10.31" +} diff --git a/node_modules/node-libs-browser/package.json b/node_modules/node-libs-browser/package.json new file mode 100755 index 00000000..78052d75 --- /dev/null +++ b/node_modules/node-libs-browser/package.json @@ -0,0 +1,119 @@ +{ + "_args": [ + [ + { + "raw": "node-libs-browser@^0.7.0", + "scope": null, + "escapedName": "node-libs-browser", + "name": "node-libs-browser", + "rawSpec": "^0.7.0", + "spec": ">=0.7.0 <0.8.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack" + ] + ], + "_from": "node-libs-browser@>=0.7.0 <0.8.0", + "_id": "node-libs-browser@0.7.0", + "_inCache": true, + "_location": "/node-libs-browser", + "_nodeVersion": "7.1.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/node-libs-browser-0.7.0.tgz_1479993224871_0.8378041384276003" + }, + "_npmUser": { + "name": "jhnns", + "email": "mail@johannesewald.de" + }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, + "_requested": { + "raw": "node-libs-browser@^0.7.0", + "scope": null, + "escapedName": "node-libs-browser", + "name": "node-libs-browser", + "rawSpec": "^0.7.0", + "spec": ">=0.7.0 <0.8.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack" + ], + "_resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-0.7.0.tgz", + "_shasum": "3e272c0819e308935e26674408d7af0e1491b83b", + "_shrinkwrap": null, + "_spec": "node-libs-browser@^0.7.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack", + "author": { + "name": "Tobias Koppers @sokra" + }, + "bugs": { + "url": "https://github.com/webpack/node-libs-browser/issues" + }, + "dependencies": { + "assert": "^1.1.1", + "browserify-zlib": "^0.1.4", + "buffer": "^4.9.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "3.3.0", + "domain-browser": "^1.1.1", + "events": "^1.0.0", + "https-browserify": "0.0.1", + "os-browserify": "^0.2.0", + "path-browserify": "0.0.0", + "process": "^0.11.0", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.0.5", + "stream-browserify": "^2.0.1", + "stream-http": "^2.3.1", + "string_decoder": "^0.10.25", + "timers-browserify": "^2.0.2", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.10.3", + "vm-browserify": "0.0.4" + }, + "description": "The node core libs for in browser usage.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "3e272c0819e308935e26674408d7af0e1491b83b", + "tarball": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-0.7.0.tgz" + }, + "files": [ + "index.js", + "mock/" + ], + "gitHead": "628ad33f9301a213b03456aeec13d831bd561af3", + "homepage": "http://github.com/webpack/node-libs-browser", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jhnns", + "email": "mail@johannesewald.de" + }, + { + "name": "sokra", + "email": "tobias.koppers@googlemail.com" + }, + { + "name": "thelarkinn", + "email": "sean.larkin@cuw.edu" + } + ], + "name": "node-libs-browser", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/webpack/node-libs-browser.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "0.7.0" +} diff --git a/node_modules/normalize-path/LICENSE b/node_modules/normalize-path/LICENSE new file mode 100755 index 00000000..d734237b --- /dev/null +++ b/node_modules/normalize-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/normalize-path/README.md b/node_modules/normalize-path/README.md new file mode 100755 index 00000000..daa0edda --- /dev/null +++ b/node_modules/normalize-path/README.md @@ -0,0 +1,92 @@ +# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path) + +> Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save normalize-path +``` + +## Usage + +```js +var normalize = require('normalize-path'); + +normalize('\\foo\\bar\\baz\\'); +//=> '/foo/bar/baz' + +normalize('./foo/bar/baz/'); +//=> './foo/bar/baz' +``` + +Pass `false` as the last argument to **keep** trailing slashes: + +```js +normalize('./foo/bar/baz/', false); +//=> './foo/bar/baz/' + +normalize('foo\\bar\\baz\\', false); +//=> 'foo/bar/baz/' +``` + +## About + +### Related projects + +* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.") +* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.") +* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.") +* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.") +* [path-segments](https://www.npmjs.com/package/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc. | [homepage](https://github.com/jonschlinkert/path-segments "Get n specific segments of a file path, e.g. first 2, last 3, etc.") +* [rewrite-ext](https://www.npmjs.com/package/rewrite-ext): Automatically re-write the destination extension of a filepath based on the source extension. e.g… [more](https://github.com/jonschlinkert/rewrite-ext) | [homepage](https://github.com/jonschlinkert/rewrite-ext "Automatically re-write the destination extension of a filepath based on the source extension. e.g `.coffee` => `.js`. This will only rename the ext, no other path parts are modified.") +* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 31 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [phated](https://github.com/phated) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 29, 2017._ \ No newline at end of file diff --git a/node_modules/normalize-path/index.js b/node_modules/normalize-path/index.js new file mode 100755 index 00000000..4a4f8ccd --- /dev/null +++ b/node_modules/normalize-path/index.js @@ -0,0 +1,19 @@ +/*! + * normalize-path + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var removeTrailingSeparator = require('remove-trailing-separator'); + +module.exports = function normalizePath(str, stripTrailing) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + str = str.replace(/[\\\/]+/g, '/'); + if (stripTrailing !== false) { + str = removeTrailingSeparator(str); + } + return str; +}; diff --git a/node_modules/normalize-path/package.json b/node_modules/normalize-path/package.json new file mode 100755 index 00000000..c8afea5d --- /dev/null +++ b/node_modules/normalize-path/package.json @@ -0,0 +1,156 @@ +{ + "_args": [ + [ + { + "raw": "normalize-path@^2.0.1", + "scope": null, + "escapedName": "normalize-path", + "name": "normalize-path", + "rawSpec": "^2.0.1", + "spec": ">=2.0.1 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch" + ] + ], + "_from": "normalize-path@>=2.0.1 <3.0.0", + "_id": "normalize-path@2.1.1", + "_inCache": true, + "_location": "/normalize-path", + "_nodeVersion": "7.7.3", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/normalize-path-2.1.1.tgz_1490811684604_0.9070707836654037" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "normalize-path@^2.0.1", + "scope": null, + "escapedName": "normalize-path", + "name": "normalize-path", + "rawSpec": "^2.0.1", + "spec": ">=2.0.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "_shasum": "1ab28b556e198363a8c1a6f7e6fa20137fe6aed9", + "_shrinkwrap": null, + "_spec": "normalize-path@^2.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/normalize-path/issues" + }, + "contributors": [ + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://twitter.com/BlaineBublitz" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "description": "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.", + "devDependencies": { + "benchmarked": "^0.1.1", + "gulp-format-md": "^0.1.11", + "minimist": "^1.2.0", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "1ab28b556e198363a8c1a6f7e6fa20137fe6aed9", + "tarball": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "da1a45e7a514910ce39875b5327b1d0fa9be3d3e", + "homepage": "https://github.com/jonschlinkert/normalize-path", + "keywords": [ + "backslash", + "file", + "filepath", + "fix", + "forward", + "fp", + "fs", + "normalize", + "path", + "slash", + "slashes", + "trailing", + "unix", + "urix" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + }, + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "normalize-path", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/normalize-path.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "contains-path", + "ends-with", + "is-absolute", + "is-relative", + "parse-filepath", + "path-ends-with", + "path-segments", + "rewrite-ext", + "unixify" + ], + "description": "Other useful libraries for working with paths in node.js:" + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.1" +} diff --git a/node_modules/npm-execspawn/.npmignore b/node_modules/npm-execspawn/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/npm-execspawn/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/npm-execspawn/.travis.yml b/node_modules/npm-execspawn/.travis.yml new file mode 100755 index 00000000..17f94330 --- /dev/null +++ b/node_modules/npm-execspawn/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + +script: "npm test" diff --git a/node_modules/npm-execspawn/LICENSE b/node_modules/npm-execspawn/LICENSE new file mode 100755 index 00000000..4b30ed5d --- /dev/null +++ b/node_modules/npm-execspawn/LICENSE @@ -0,0 +1,20 @@ +Copyright 2013 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/npm-execspawn/README.md b/node_modules/npm-execspawn/README.md new file mode 100755 index 00000000..1802cb6e --- /dev/null +++ b/node_modules/npm-execspawn/README.md @@ -0,0 +1,42 @@ +# npm-execspawn + +Spawn locally installed npm dependencies with cross platform env and argument parsing support. + +``` +npm install npm-execspawn +``` + +[![build status](http://img.shields.io/travis/mafintosh/npm-execspawn.svg?style=flat)](http://travis-ci.org/mafintosh/npm-execspawn) + +## Usage + +First do + +``` +npm install browserify +``` + +Then + +``` js +var execspawn = require('npm-execspawn') + +var child = execspawn('browserify $FILENAME', {env:{FILENAME:'test.js'}}) +child.stderr.pipe(process.stderr) +child.stdout.pipe(process.stdout) +``` + +The above should browserify test.js and both windows and unix. +The options is passed directly to `child_process.spawn`. + +You can also pass in a arguments array + +``` js +execspawn('echo $0 $1 and $2', ['a', 'b', 'c']).stdout.pipe(process.stdout) +``` + +The above will print `echo a b and c` on all platforms. + +## License + +MIT \ No newline at end of file diff --git a/node_modules/npm-execspawn/bin.js b/node_modules/npm-execspawn/bin.js new file mode 100755 index 00000000..4c532622 --- /dev/null +++ b/node_modules/npm-execspawn/bin.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node +var execspawn = require('./') + +var child = execspawn(process.argv.slice(2).join(' ')) +process.stdin.on('readable', function () { + process.stdin.pipe(child.stdin) +}) +child.stdout.pipe(process.stdout) +child.stderr.pipe(process.stderr) +child.on('exit', function (code) { + process.exit(code) +}) \ No newline at end of file diff --git a/node_modules/npm-execspawn/index.js b/node_modules/npm-execspawn/index.js new file mode 100755 index 00000000..89b4f7a7 --- /dev/null +++ b/node_modules/npm-execspawn/index.js @@ -0,0 +1,44 @@ +var execspawn = require('execspawn') +var parse = require('shell-quote').parse +var xtend = require('xtend') +var path = require('path') +var debug = require('debug')('npm-execspawn') + +var PATH_SEP = process.platform === 'win32' ? ';' : ':' +var PATH_KEY = process.platform === 'win32' && !(process.env.PATH && !process.env.Path) ? 'Path' : 'PATH' +var ESCAPE_CHAR = process.platform === 'win32' ? '^' : '\\' + +var quote = function (s) { // lifted from shell-quote since we need different quote ordering for win support + if (/["'\s]/.test(s)) return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"' + if (/["\s]/.test(s) && !/'/.test(s)) return "'" + s.replace(/(['\\])/g, '\\$1') + "'" + return String(s).replace(/([\\$`()!#&*|])/g, '\\$1') +} + +var toString = function(cmd) { + return cmd.pattern || cmd.op || quote(cmd) +} + +var npmRunPath = function(cwd, PATH) { + var prev = cwd + var result = [] + while (true) { + result.push(path.join(cwd, 'node_modules/.bin')) + var parent = path.join(cwd, '..') + if (parent === cwd) return result.concat(PATH).join(PATH_SEP) + cwd = parent + } +} + +module.exports = function(cmd, args, opts) { + if (!Array.isArray(args)) return module.exports(cmd, [], args || opts) + if (!opts) opts = {} + if (!args) args = [] + + var env = opts.env || process.env + var parsed = parse(cmd, xtend(env, args, {'':'$'}), {escape: ESCAPE_CHAR}).map(toString).join(' ') + var override = {} + override[PATH_KEY] = npmRunPath(path.resolve(process.cwd(), opts.cwd || '.'), env[PATH_KEY] || process.env[PATH_KEY]) + + debug('execspawn', parsed) + return execspawn(parsed, xtend(opts, {env:xtend(env, override)})) +} diff --git a/node_modules/npm-execspawn/package.json b/node_modules/npm-execspawn/package.json new file mode 100755 index 00000000..4c23e35f --- /dev/null +++ b/node_modules/npm-execspawn/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "npm-execspawn@^1.0.6", + "scope": null, + "escapedName": "npm-execspawn", + "name": "npm-execspawn", + "rawSpec": "^1.0.6", + "spec": ">=1.0.6 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket" + ] + ], + "_from": "npm-execspawn@>=1.0.6 <2.0.0", + "_id": "npm-execspawn@1.3.0", + "_inCache": true, + "_location": "/npm-execspawn", + "_nodeVersion": "4.3.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/npm-execspawn-1.3.0.tgz_1458186249172_0.5240534176118672" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "raw": "npm-execspawn@^1.0.6", + "scope": null, + "escapedName": "npm-execspawn", + "name": "npm-execspawn", + "rawSpec": "^1.0.6", + "spec": ">=1.0.6 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gasket" + ], + "_resolved": "https://registry.npmjs.org/npm-execspawn/-/npm-execspawn-1.3.0.tgz", + "_shasum": "5b4860a8cf783465386a388a21a145d3f7125638", + "_shrinkwrap": null, + "_spec": "npm-execspawn@^1.0.6", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket", + "author": { + "name": "Mathias Buus" + }, + "bin": { + "npm-execspawn": "./bin.js" + }, + "bugs": { + "url": "https://github.com/mafintosh/npm-execspawn/issues" + }, + "dependencies": { + "debug": "^2.1.3", + "execspawn": "^1.0.0", + "shell-quote": "^1.5.0", + "xtend": "^3.0.0" + }, + "description": "Spawn locally installed npm dependencies with cross platform env and argument parsing support", + "devDependencies": { + "concat-stream": "^1.4.6", + "tape": "^2.13.3" + }, + "directories": {}, + "dist": { + "shasum": "5b4860a8cf783465386a388a21a145d3f7125638", + "tarball": "https://registry.npmjs.org/npm-execspawn/-/npm-execspawn-1.3.0.tgz" + }, + "gitHead": "49c6705dab00052de8ee3bf7b04b17939f2caffb", + "homepage": "https://github.com/mafintosh/npm-execspawn", + "keywords": [ + "npm", + "exec", + "spawn", + "run", + "path" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + { + "name": "maxogden", + "email": "max@maxogden.com" + } + ], + "name": "npm-execspawn", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/npm-execspawn.git" + }, + "scripts": { + "test": "node tests/test.js" + }, + "version": "1.3.0" +} diff --git a/node_modules/npm-execspawn/tests/echo.js b/node_modules/npm-execspawn/tests/echo.js new file mode 100755 index 00000000..9267d8c0 --- /dev/null +++ b/node_modules/npm-execspawn/tests/echo.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log(process.argv.slice(2).join(' ')) diff --git a/node_modules/npm-execspawn/tests/test.js b/node_modules/npm-execspawn/tests/test.js new file mode 100755 index 00000000..3e09a73c --- /dev/null +++ b/node_modules/npm-execspawn/tests/test.js @@ -0,0 +1,26 @@ +var os = require('os') +var path = require('path') +var tape = require('tape') +var execspawn = require('..') +var concat = require('concat-stream') + +tape('echo', function(t) { + execspawn('echo $0 $1 and $2', ['a', 'b', 'c']).stdout.pipe(concat(function(data) { + t.same(data.toString(), 'a b and c'+os.EOL) + t.end() + })) +}) + +tape('npm deps', function(t) { + execspawn('tape').on('exit', function(code) { + t.same(code, 0) + t.end() + }) +}) + +tape('works on windows paths', function(t) { + execspawn(path.join(__dirname, 'echo.js') + ' $0 $1 and $2', ['a', 'b', 'c']).stdout.pipe(concat(function(data) { + t.same(data.toString(), 'a b and c'+os.EOL) + t.end() + })) +}) diff --git a/node_modules/number-is-nan/index.js b/node_modules/number-is-nan/index.js new file mode 100755 index 00000000..79be4b9c --- /dev/null +++ b/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/node_modules/number-is-nan/license b/node_modules/number-is-nan/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/number-is-nan/package.json b/node_modules/number-is-nan/package.json new file mode 100755 index 00000000..2316c693 --- /dev/null +++ b/node_modules/number-is-nan/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/is-finite" + ] + ], + "_from": "number-is-nan@>=1.0.0 <2.0.0", + "_id": "number-is-nan@1.0.1", + "_inCache": true, + "_location": "/number-is-nan", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/number-is-nan-1.0.1.tgz_1475212313367_0.9480371843092144" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/is-finite" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "_shasum": "097b602b53422a522c1afb8790318336941a011d", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/is-finite", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES2015 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "*" + }, + "directories": {}, + "dist": { + "shasum": "097b602b53422a522c1afb8790318336941a011d", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "ed9cdac3f428cc929b61bb230da42c87477af4b9", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es2015", + "ecmascript", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "ava" + }, + "version": "1.0.1" +} diff --git a/node_modules/number-is-nan/readme.md b/node_modules/number-is-nan/readme.md new file mode 100755 index 00000000..24635087 --- /dev/null +++ b/node_modules/number-is-nan/readme.md @@ -0,0 +1,28 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100755 index 00000000..0930cf88 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100755 index 00000000..5a590f23 --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,119 @@ +{ + "_args": [ + [ + { + "raw": "object-assign@^4.0.1", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.0.1", + "spec": ">=4.0.1 <5.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-loader" + ] + ], + "_from": "object-assign@>=4.0.1 <5.0.0", + "_id": "object-assign@4.1.1", + "_inCache": true, + "_location": "/object-assign", + "_nodeVersion": "4.6.2", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/object-assign-4.1.1.tgz_1484580915042_0.07107710791751742" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "object-assign@^4.0.1", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.0.1", + "spec": ">=4.0.1 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-loader", + "/loader-utils" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", + "_shrinkwrap": null, + "_spec": "object-assign@^4.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-loader", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/object-assign/issues" + }, + "dependencies": {}, + "description": "ES2015 `Object.assign()` ponyfill", + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + }, + "directories": {}, + "dist": { + "shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", + "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "a89774b252c91612203876984bbd6addbe3b5a0e", + "homepage": "https://github.com/sindresorhus/object-assign#readme", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "license": "MIT", + "maintainers": [ + { + "name": "gaearon", + "email": "dan.abramov@gmail.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "spicyj", + "email": "ben@benalpert.com" + } + ], + "name": "object-assign", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/object-assign.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && ava" + }, + "version": "4.1.1" +} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100755 index 00000000..1be09d35 --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/object.omit/LICENSE b/node_modules/object.omit/LICENSE new file mode 100755 index 00000000..842218cf --- /dev/null +++ b/node_modules/object.omit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object.omit/README.md b/node_modules/object.omit/README.md new file mode 100755 index 00000000..246efe09 --- /dev/null +++ b/node_modules/object.omit/README.md @@ -0,0 +1,118 @@ +# object.omit [![NPM version](https://img.shields.io/npm/v/object.omit.svg?style=flat)](https://www.npmjs.com/package/object.omit) [![NPM monthly downloads](https://img.shields.io/npm/dm/object.omit.svg?style=flat)](https://npmjs.org/package/object.omit) [![NPM total downloads](https://img.shields.io/npm/dt/object.omit.svg?style=flat)](https://npmjs.org/package/object.omit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/object.omit.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/object.omit) + +> Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save object.omit +``` + +## Usage + +```js +var omit = require('object.omit'); +``` + +Pass a string `key` to omit: + +```js +omit({a: 'a', b: 'b', c: 'c'}, 'a') +//=> { b: 'b', c: 'c' } +``` + +Pass an array of `keys` to omit: + +```js +omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c']) +//=> { b: 'b' } +``` + +Returns the object if no keys are passed: + +```js +omit({a: 'a', b: 'b', c: 'c'}) +//=> {a: 'a', b: 'b', c: 'c'} +``` + +Returns an empty object if no value is passed. + +```js +omit() +//=> {} +``` + +### Filter function + +An optional filter function may be passed as the last argument, with or without keys passed on the arguments: + +**filter on keys** + +```js +var res = omit({a: 'a', b: 'b', c: 'c'}, function (val, key) { + return key === 'a'; +}); +//=> {a: 'a'} +``` + +**filter on values** + +```js +var fn = function() {}; +var obj = {a: 'a', b: 'b', c: fn}; + +var res = omit(obj, ['a'], function (val, key) { + return typeof val !== 'function'; +}); +//=> {b: 'b'} +``` + +## About + +### Related projects + +* [object.defaults](https://www.npmjs.com/package/object.defaults): Like `extend` but only copies missing properties/values to the target object. | [homepage](https://github.com/jonschlinkert/object.defaults "Like `extend` but only copies missing properties/values to the target object.") +* [object.filter](https://www.npmjs.com/package/object.filter): Create a new object filtered to have only properties for which the callback returns true. | [homepage](https://github.com/jonschlinkert/object.filter "Create a new object filtered to have only properties for which the callback returns true.") +* [object.pick](https://www.npmjs.com/package/object.pick): Returns a filtered copy of an object with only the specified keys, similar to `_.pick… [more](https://github.com/jonschlinkert/object.pick) | [homepage](https://github.com/jonschlinkert/object.pick "Returns a filtered copy of an object with only the specified keys, similar to`_.pick` from lodash / underscore.") +* [object.pluck](https://www.npmjs.com/package/object.pluck): Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with… [more](https://github.com/jonschlinkert/object.pluck) | [homepage](https://github.com/jonschlinkert/object.pluck "Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with values unmodified from those of the original object.") +* [object.reduce](https://www.npmjs.com/package/object.reduce): Reduces an object to a value that is the accumulated result of running each property… [more](https://github.com/jonschlinkert/object.reduce) | [homepage](https://github.com/jonschlinkert/object.reduce "Reduces an object to a value that is the accumulated result of running each property in the object through a callback.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/object.omit/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 27, 2016._ \ No newline at end of file diff --git a/node_modules/object.omit/index.js b/node_modules/object.omit/index.js new file mode 100755 index 00000000..503a3c30 --- /dev/null +++ b/node_modules/object.omit/index.js @@ -0,0 +1,40 @@ +/*! + * object.omit + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isObject = require('is-extendable'); +var forOwn = require('for-own'); + +module.exports = function omit(obj, keys) { + if (!isObject(obj)) return {}; + + keys = [].concat.apply([], [].slice.call(arguments, 1)); + var last = keys[keys.length - 1]; + var res = {}, fn; + + if (typeof last === 'function') { + fn = keys.pop(); + } + + var isFunction = typeof fn === 'function'; + if (!keys.length && !isFunction) { + return obj; + } + + forOwn(obj, function(value, key) { + if (keys.indexOf(key) === -1) { + + if (!isFunction) { + res[key] = value; + } else if (fn(value, key, obj)) { + res[key] = value; + } + } + }); + return res; +}; diff --git a/node_modules/object.omit/package.json b/node_modules/object.omit/package.json new file mode 100755 index 00000000..30c6e3b9 --- /dev/null +++ b/node_modules/object.omit/package.json @@ -0,0 +1,137 @@ +{ + "_args": [ + [ + { + "raw": "object.omit@^2.0.0", + "scope": null, + "escapedName": "object.omit", + "name": "object.omit", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch" + ] + ], + "_from": "object.omit@>=2.0.0 <3.0.0", + "_id": "object.omit@2.0.1", + "_inCache": true, + "_location": "/object.omit", + "_nodeVersion": "6.7.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/object.omit-2.0.1.tgz_1477549482527_0.48828932945616543" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "object.omit@^2.0.0", + "scope": null, + "escapedName": "object.omit", + "name": "object.omit", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "_shasum": "1a9c744829f39dbb858c76ca3579ae2a54ebd1fa", + "_shrinkwrap": null, + "_spec": "object.omit@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/object.omit/issues" + }, + "dependencies": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + }, + "description": "Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.1.2", + "should": "^11.1.1" + }, + "directories": {}, + "dist": { + "shasum": "1a9c744829f39dbb858c76ca3579ae2a54ebd1fa", + "tarball": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "6634673e6e88c65796f1df4bcb787dede6dc7ffc", + "homepage": "https://github.com/jonschlinkert/object.omit", + "keywords": [ + "clear", + "delete", + "key", + "object", + "omit", + "property", + "remove", + "value" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + } + ], + "name": "object.omit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/object.omit.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "object.defaults", + "object.filter", + "object.pick", + "object.pluck", + "object.reduce" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "2.0.1" +} diff --git a/node_modules/on-finished/HISTORY.md b/node_modules/on-finished/HISTORY.md new file mode 100755 index 00000000..98ff0e99 --- /dev/null +++ b/node_modules/on-finished/HISTORY.md @@ -0,0 +1,88 @@ +2.3.0 / 2015-05-26 +================== + + * Add defined behavior for HTTP `CONNECT` requests + * Add defined behavior for HTTP `Upgrade` requests + * deps: ee-first@1.1.1 + +2.2.1 / 2015-04-22 +================== + + * Fix `isFinished(req)` when data buffered + +2.2.0 / 2014-12-22 +================== + + * Add message object to callback arguments + +2.1.1 / 2014-10-22 +================== + + * Fix handling of pipelined requests + +2.1.0 / 2014-08-16 +================== + + * Check if `socket` is detached + * Return `undefined` for `isFinished` if state unknown + +2.0.0 / 2014-08-16 +================== + + * Add `isFinished` function + * Move to `jshttp` organization + * Remove support for plain socket argument + * Rename to `on-finished` + * Support both `req` and `res` as arguments + * deps: ee-first@1.0.5 + +1.2.2 / 2014-06-10 +================== + + * Reduce listeners added to emitters + - avoids "event emitter leak" warnings when used multiple times on same request + +1.2.1 / 2014-06-08 +================== + + * Fix returned value when already finished + +1.2.0 / 2014-06-05 +================== + + * Call callback when called on already-finished socket + +1.1.4 / 2014-05-27 +================== + + * Support node.js 0.8 + +1.1.3 / 2014-04-30 +================== + + * Make sure errors passed as instanceof `Error` + +1.1.2 / 2014-04-18 +================== + + * Default the `socket` to passed-in object + +1.1.1 / 2014-01-16 +================== + + * Rename module to `finished` + +1.1.0 / 2013-12-25 +================== + + * Call callback when called on already-errored socket + +1.0.1 / 2013-12-20 +================== + + * Actually pass the error to the callback + +1.0.0 / 2013-12-20 +================== + + * Initial release diff --git a/node_modules/on-finished/LICENSE b/node_modules/on-finished/LICENSE new file mode 100755 index 00000000..5931fd23 --- /dev/null +++ b/node_modules/on-finished/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-finished/README.md b/node_modules/on-finished/README.md new file mode 100755 index 00000000..a0e11574 --- /dev/null +++ b/node_modules/on-finished/README.md @@ -0,0 +1,154 @@ +# on-finished + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Execute a callback when a HTTP request closes, finishes, or errors. + +## Install + +```sh +$ npm install on-finished +``` + +## API + +```js +var onFinished = require('on-finished') +``` + +### onFinished(res, listener) + +Attach a listener to listen for the response to finish. The listener will +be invoked only once when the response finished. If the response finished +to an error, the first argument will contain the error. If the response +has already finished, the listener will be invoked. + +Listening to the end of a response would be used to close things associated +with the response, like open files. + +Listener is invoked as `listener(err, res)`. + +```js +onFinished(res, function (err, res) { + // clean up open fds, etc. + // err contains the error is request error'd +}) +``` + +### onFinished(req, listener) + +Attach a listener to listen for the request to finish. The listener will +be invoked only once when the request finished. If the request finished +to an error, the first argument will contain the error. If the request +has already finished, the listener will be invoked. + +Listening to the end of a request would be used to know when to continue +after reading the data. + +Listener is invoked as `listener(err, req)`. + +```js +var data = '' + +req.setEncoding('utf8') +res.on('data', function (str) { + data += str +}) + +onFinished(req, function (err, req) { + // data is read unless there is err +}) +``` + +### onFinished.isFinished(res) + +Determine if `res` is already finished. This would be useful to check and +not even start certain operations if the response has already finished. + +### onFinished.isFinished(req) + +Determine if `req` is already finished. This would be useful to check and +not even start certain operations if the request has already finished. + +## Special Node.js requests + +### HTTP CONNECT method + +The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: + +> The CONNECT method requests that the recipient establish a tunnel to +> the destination origin server identified by the request-target and, +> if successful, thereafter restrict its behavior to blind forwarding +> of packets, in both directions, until the tunnel is closed. Tunnels +> are commonly used to create an end-to-end virtual connection, through +> one or more proxies, which can then be secured using TLS (Transport +> Layer Security, [RFC5246]). + +In Node.js, these request objects come from the `'connect'` event on +the HTTP server. + +When this module is used on a HTTP `CONNECT` request, the request is +considered "finished" immediately, **due to limitations in the Node.js +interface**. This means if the `CONNECT` request contains a request entity, +the request will be considered "finished" even before it has been read. + +There is no such thing as a response object to a `CONNECT` request in +Node.js, so there is no support for for one. + +### HTTP Upgrade request + +The meaning of the `Upgrade` header from RFC 7230, section 6.1: + +> The "Upgrade" header field is intended to provide a simple mechanism +> for transitioning from HTTP/1.1 to some other protocol on the same +> connection. + +In Node.js, these request objects come from the `'upgrade'` event on +the HTTP server. + +When this module is used on a HTTP request with an `Upgrade` header, the +request is considered "finished" immediately, **due to limitations in the +Node.js interface**. This means if the `Upgrade` request contains a request +entity, the request will be considered "finished" even before it has been +read. + +There is no such thing as a response object to a `Upgrade` request in +Node.js, so there is no support for for one. + +## Example + +The following code ensures that file descriptors are always closed +once the response finishes. + +```js +var destroy = require('destroy') +var http = require('http') +var onFinished = require('on-finished') + +http.createServer(function onRequest(req, res) { + var stream = fs.createReadStream('package.json') + stream.pipe(res) + onFinished(res, function (err) { + destroy(stream) + }) +}) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/on-finished.svg +[npm-url]: https://npmjs.org/package/on-finished +[node-version-image]: https://img.shields.io/node/v/on-finished.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg +[travis-url]: https://travis-ci.org/jshttp/on-finished +[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master +[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg +[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/on-finished/index.js b/node_modules/on-finished/index.js new file mode 100755 index 00000000..9abd98f9 --- /dev/null +++ b/node_modules/on-finished/index.js @@ -0,0 +1,196 @@ +/*! + * on-finished + * Copyright(c) 2013 Jonathan Ong + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = onFinished +module.exports.isFinished = isFinished + +/** + * Module dependencies. + * @private + */ + +var first = require('ee-first') + +/** + * Variables. + * @private + */ + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } + +/** + * Invoke callback when the response has finished, useful for + * cleaning up resources afterwards. + * + * @param {object} msg + * @param {function} listener + * @return {object} + * @public + */ + +function onFinished(msg, listener) { + if (isFinished(msg) !== false) { + defer(listener, null, msg) + return msg + } + + // attach the listener to the message + attachListener(msg, listener) + + return msg +} + +/** + * Determine if message is already finished. + * + * @param {object} msg + * @return {boolean} + * @public + */ + +function isFinished(msg) { + var socket = msg.socket + + if (typeof msg.finished === 'boolean') { + // OutgoingMessage + return Boolean(msg.finished || (socket && !socket.writable)) + } + + if (typeof msg.complete === 'boolean') { + // IncomingMessage + return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) + } + + // don't know + return undefined +} + +/** + * Attach a finished listener to the message. + * + * @param {object} msg + * @param {function} callback + * @private + */ + +function attachFinishedListener(msg, callback) { + var eeMsg + var eeSocket + var finished = false + + function onFinish(error) { + eeMsg.cancel() + eeSocket.cancel() + + finished = true + callback(error) + } + + // finished on first message event + eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) + + function onSocket(socket) { + // remove listener + msg.removeListener('socket', onSocket) + + if (finished) return + if (eeMsg !== eeSocket) return + + // finished on first socket event + eeSocket = first([[socket, 'error', 'close']], onFinish) + } + + if (msg.socket) { + // socket already assigned + onSocket(msg.socket) + return + } + + // wait for socket to be assigned + msg.on('socket', onSocket) + + if (msg.socket === undefined) { + // node.js 0.8 patch + patchAssignSocket(msg, onSocket) + } +} + +/** + * Attach the listener to the message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function attachListener(msg, listener) { + var attached = msg.__onFinished + + // create a private single listener with queue + if (!attached || !attached.queue) { + attached = msg.__onFinished = createListener(msg) + attachFinishedListener(msg, attached) + } + + attached.queue.push(listener) +} + +/** + * Create listener on message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function createListener(msg) { + function listener(err) { + if (msg.__onFinished === listener) msg.__onFinished = null + if (!listener.queue) return + + var queue = listener.queue + listener.queue = null + + for (var i = 0; i < queue.length; i++) { + queue[i](err, msg) + } + } + + listener.queue = [] + + return listener +} + +/** + * Patch ServerResponse.prototype.assignSocket for node.js 0.8. + * + * @param {ServerResponse} res + * @param {function} callback + * @private + */ + +function patchAssignSocket(res, callback) { + var assignSocket = res.assignSocket + + if (typeof assignSocket !== 'function') return + + // res.on('socket', callback) is broken in 0.8 + res.assignSocket = function _assignSocket(socket) { + assignSocket.call(this, socket) + callback(socket) + } +} diff --git a/node_modules/on-finished/package.json b/node_modules/on-finished/package.json new file mode 100755 index 00000000..af42d17a --- /dev/null +++ b/node_modules/on-finished/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "on-finished@~2.3.0", + "scope": null, + "escapedName": "on-finished", + "name": "on-finished", + "rawSpec": "~2.3.0", + "spec": ">=2.3.0 <2.4.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "on-finished@>=2.3.0 <2.4.0", + "_id": "on-finished@2.3.0", + "_inCache": true, + "_location": "/on-finished", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "on-finished@~2.3.0", + "scope": null, + "escapedName": "on-finished", + "name": "on-finished", + "rawSpec": "~2.3.0", + "spec": ">=2.3.0 <2.4.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/finalhandler", + "/send" + ], + "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "_shasum": "20f1336481b083cd75337992a16971aa2d906947", + "_shrinkwrap": null, + "_spec": "on-finished@~2.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "bugs": { + "url": "https://github.com/jshttp/on-finished/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "dependencies": { + "ee-first": "1.1.1" + }, + "description": "Execute a callback when a request closes, finishes, or errors", + "devDependencies": { + "istanbul": "0.3.9", + "mocha": "2.2.5" + }, + "directories": {}, + "dist": { + "shasum": "20f1336481b083cd75337992a16971aa2d906947", + "tarball": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "gitHead": "34babcb58126a416fcf5205768204f2e12699dda", + "homepage": "https://github.com/jshttp/on-finished", + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + } + ], + "name": "on-finished", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/on-finished.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "2.3.0" +} diff --git a/node_modules/on-headers/HISTORY.md b/node_modules/on-headers/HISTORY.md new file mode 100755 index 00000000..e51ff017 --- /dev/null +++ b/node_modules/on-headers/HISTORY.md @@ -0,0 +1,16 @@ +1.0.1 / 2015-09-29 +================== + + * perf: enable strict mode + +1.0.0 / 2014-08-10 +================== + + * Honor `res.statusCode` change in `listener` + * Move to `jshttp` orgainzation + * Prevent `arguments`-related de-opt + +0.0.0 / 2014-05-13 +================== + + * Initial implementation diff --git a/node_modules/on-headers/LICENSE b/node_modules/on-headers/LICENSE new file mode 100755 index 00000000..b7dce6cf --- /dev/null +++ b/node_modules/on-headers/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-headers/README.md b/node_modules/on-headers/README.md new file mode 100755 index 00000000..48ed9aef --- /dev/null +++ b/node_modules/on-headers/README.md @@ -0,0 +1,76 @@ +# on-headers + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Execute a listener when a response is about to write headers. + +## Installation + +```sh +$ npm install on-headers +``` + +## API + +```js +var onHeaders = require('on-headers') +``` + +### onHeaders(res, listener) + +This will add the listener `listener` to fire when headers are emitted for `res`. +The listener is passed the `response` object as it's context (`this`). Headers are +considered to be emitted only once, right before they are sent to the client. + +When this is called multiple times on the same `res`, the `listener`s are fired +in the reverse order they were added. + +## Examples + +```js +var http = require('http') +var onHeaders = require('on-headers') + +http +.createServer(onRequest) +.listen(3000) + +function addPoweredBy() { + // set if not set by end of request + if (!this.getHeader('X-Powered-By')) { + this.setHeader('X-Powered-By', 'Node.js') + } +} + +function onRequest(req, res) { + onHeaders(res, addPoweredBy) + + res.setHeader('Content-Type', 'text/plain') + res.end('hello!') +} +``` + +## Testing + +```sh +$ npm test +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/on-headers.svg +[npm-url]: https://npmjs.org/package/on-headers +[node-version-image]: https://img.shields.io/node/v/on-headers.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/on-headers/master.svg +[travis-url]: https://travis-ci.org/jshttp/on-headers +[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-headers/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master +[downloads-image]: https://img.shields.io/npm/dm/on-headers.svg +[downloads-url]: https://npmjs.org/package/on-headers diff --git a/node_modules/on-headers/index.js b/node_modules/on-headers/index.js new file mode 100755 index 00000000..089f2b34 --- /dev/null +++ b/node_modules/on-headers/index.js @@ -0,0 +1,93 @@ +/*! + * on-headers + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Reference to Array slice. + */ + +var slice = Array.prototype.slice + +/** + * Execute a listener when a response is about to write headers. + * + * @param {Object} res + * @return {Function} listener + * @api public + */ + +module.exports = function onHeaders(res, listener) { + if (!res) { + throw new TypeError('argument res is required') + } + + if (typeof listener !== 'function') { + throw new TypeError('argument listener must be a function') + } + + res.writeHead = createWriteHead(res.writeHead, listener) +} + +function createWriteHead(prevWriteHead, listener) { + var fired = false; + + // return function with core name and argument list + return function writeHead(statusCode) { + // set headers from arguments + var args = setWriteHeadHeaders.apply(this, arguments); + + // fire listener + if (!fired) { + fired = true + listener.call(this) + + // pass-along an updated status code + if (typeof args[0] === 'number' && this.statusCode !== args[0]) { + args[0] = this.statusCode + args.length = 1 + } + } + + prevWriteHead.apply(this, args); + } +} + +function setWriteHeadHeaders(statusCode) { + var length = arguments.length + var headerIndex = length > 1 && typeof arguments[1] === 'string' + ? 2 + : 1 + + var headers = length >= headerIndex + 1 + ? arguments[headerIndex] + : undefined + + this.statusCode = statusCode + + // the following block is from node.js core + if (Array.isArray(headers)) { + // handle array case + for (var i = 0, len = headers.length; i < len; ++i) { + this.setHeader(headers[i][0], headers[i][1]) + } + } else if (headers) { + // handle object case + var keys = Object.keys(headers) + for (var i = 0; i < keys.length; i++) { + var k = keys[i] + if (k) this.setHeader(k, headers[k]) + } + } + + // copy leading arguments + var args = new Array(Math.min(length, headerIndex)) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + return args +} diff --git a/node_modules/on-headers/package.json b/node_modules/on-headers/package.json new file mode 100755 index 00000000..57cd37ae --- /dev/null +++ b/node_modules/on-headers/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "on-headers@~1.0.1", + "scope": null, + "escapedName": "on-headers", + "name": "on-headers", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression" + ] + ], + "_from": "on-headers@>=1.0.1 <1.1.0", + "_id": "on-headers@1.0.1", + "_inCache": true, + "_location": "/on-headers", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "on-headers@~1.0.1", + "scope": null, + "escapedName": "on-headers", + "name": "on-headers", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/compression" + ], + "_resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "_shasum": "928f5d0f470d49342651ea6794b0857c100693f7", + "_shrinkwrap": null, + "_spec": "on-headers@~1.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/compression", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "bugs": { + "url": "https://github.com/jshttp/on-headers/issues" + }, + "dependencies": {}, + "description": "Execute a listener when a response is about to write headers", + "devDependencies": { + "istanbul": "0.3.21", + "mocha": "2.3.3", + "supertest": "1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "928f5d0f470d49342651ea6794b0857c100693f7", + "tarball": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "ab0156a979d72353cfe666cccb3639e016b00280", + "homepage": "https://github.com/jshttp/on-headers", + "keywords": [ + "event", + "headers", + "http", + "onheaders" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + } + ], + "name": "on-headers", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/on-headers.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.0.1" +} diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE new file mode 100755 index 00000000..19129e31 --- /dev/null +++ b/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md new file mode 100755 index 00000000..a2981ea0 --- /dev/null +++ b/node_modules/once/README.md @@ -0,0 +1,51 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js new file mode 100755 index 00000000..2e1e721b --- /dev/null +++ b/node_modules/once/once.js @@ -0,0 +1,21 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} diff --git a/node_modules/once/package.json b/node_modules/once/package.json new file mode 100755 index 00000000..7b77aeea --- /dev/null +++ b/node_modules/once/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "once@~1.3.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "~1.3.0", + "spec": ">=1.3.0 <1.4.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/end-of-stream" + ] + ], + "_from": "once@>=1.3.0 <1.4.0", + "_id": "once@1.3.3", + "_inCache": true, + "_location": "/once", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "raw": "once@~1.3.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "~1.3.0", + "spec": ">=1.3.0 <1.4.0", + "type": "range" + }, + "_requiredBy": [ + "/end-of-stream", + "/glob", + "/inflight", + "/pump" + ], + "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "_shrinkwrap": null, + "_spec": "once@~1.3.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/end-of-stream", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/once/issues" + }, + "dependencies": { + "wrappy": "1" + }, + "description": "Run a function exactly one time", + "devDependencies": { + "tap": "^1.2.0" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "tarball": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" + }, + "files": [ + "once.js" + ], + "gitHead": "2ad558657e17fafd24803217ba854762842e4178", + "homepage": "https://github.com/isaacs/once#readme", + "keywords": [ + "once", + "function", + "one", + "single" + ], + "license": "ISC", + "main": "once.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "once", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.3.3" +} diff --git a/node_modules/open/.jshintignore b/node_modules/open/.jshintignore new file mode 100755 index 00000000..651665bb --- /dev/null +++ b/node_modules/open/.jshintignore @@ -0,0 +1,2 @@ +node_modules +.git diff --git a/node_modules/open/.jshintrc b/node_modules/open/.jshintrc new file mode 100755 index 00000000..765fb34a --- /dev/null +++ b/node_modules/open/.jshintrc @@ -0,0 +1,27 @@ +{ + "bitwise": true, + "curly": true, + "eqeqeq": true, + "forin": true, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": true, + "plusplus": false, + "regexp": false, + "undef": true, + "strict": false, + "trailing": true, + + "eqnull": true, + "laxcomma": true, + + "node": true, + + "onevar": true, + "white": true, + + "indent": 2 +} diff --git a/node_modules/open/.npmignore b/node_modules/open/.npmignore new file mode 100755 index 00000000..77356c31 --- /dev/null +++ b/node_modules/open/.npmignore @@ -0,0 +1 @@ +test diff --git a/node_modules/open/LICENSE b/node_modules/open/LICENSE new file mode 100755 index 00000000..42719e0a --- /dev/null +++ b/node_modules/open/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012 Jay Jordan + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/open/README.md b/node_modules/open/README.md new file mode 100755 index 00000000..4fc0d54e --- /dev/null +++ b/node_modules/open/README.md @@ -0,0 +1,33 @@ +# open + +Open a file or url in the user's preferred application. + +# Usage + +```javascript +var open = require("open"); +open("http://www.google.com"); +``` + +`open` taks an optional argument specifying the program to be used to open the +file or URL. + +```javascript +open("http://www.google.com", "firefox"); +``` + +# Installation + + npm install open + +# How it works + +- on `win32` uses `start` +- on `darwin` uses `open` +- otherwise uses the `xdg-open` script from [freedesktop.org](http://portland.freedesktop.org/xdg-utils-1.0/xdg-open.html) + +# Warning + +The same care should be taken when calling open as if you were calling +[child_process.exec](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) +directly. If it is an executable it will run in a new shell. diff --git a/node_modules/open/lib/open.js b/node_modules/open/lib/open.js new file mode 100755 index 00000000..ce4e9aaf --- /dev/null +++ b/node_modules/open/lib/open.js @@ -0,0 +1,63 @@ +var exec = require('child_process').exec + , path = require('path') + ; + + +/** + * open a file or uri using the default application for the file type. + * + * @return {ChildProcess} - the child process object. + * @param {string} target - the file/uri to open. + * @param {string} appName - (optional) the application to be used to open the + * file (for example, "chrome", "firefox") + * @param {function(Error)} callback - called with null on success, or + * an error object that contains a property 'code' with the exit + * code of the process. + */ + +module.exports = open; + +function open(target, appName, callback) { + var opener; + + if (typeof(appName) === 'function') { + callback = appName; + appName = null; + } + + switch (process.platform) { + case 'darwin': + if (appName) { + opener = 'open -a "' + escape(appName) + '"'; + } else { + opener = 'open'; + } + break; + case 'win32': + // if the first parameter to start is quoted, it uses that as the title + // so we pass a blank title so we can quote the file we are opening + if (appName) { + opener = 'start "" "' + escape(appName) + '"'; + } else { + opener = 'start ""'; + } + break; + default: + if (appName) { + opener = escape(appName); + } else { + // use Portlands xdg-open everywhere else + opener = path.join(__dirname, '../vendor/xdg-open'); + } + break; + } + + if (process.env.SUDO_USER) { + opener = 'sudo -u ' + process.env.SUDO_USER + ' ' + opener; + } + return exec(opener + ' "' + escape(target) + '"', callback); +} + +function escape(s) { + return s.replace(/"/g, '\\\"'); +} diff --git a/node_modules/open/package.json b/node_modules/open/package.json new file mode 100755 index 00000000..0af5c370 --- /dev/null +++ b/node_modules/open/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "open@0.0.5", + "scope": null, + "escapedName": "open", + "name": "open", + "rawSpec": "0.0.5", + "spec": "0.0.5", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server" + ] + ], + "_from": "open@0.0.5", + "_id": "open@0.0.5", + "_inCache": true, + "_location": "/open", + "_npmUser": { + "name": "pwnall", + "email": "costan@gmail.com" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": {}, + "_requested": { + "raw": "open@0.0.5", + "scope": null, + "escapedName": "open", + "name": "open", + "rawSpec": "0.0.5", + "spec": "0.0.5", + "type": "version" + }, + "_requiredBy": [ + "/webpack-dev-server" + ], + "_resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz", + "_shasum": "42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc", + "_shrinkwrap": null, + "_spec": "open@0.0.5", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-dev-server", + "author": { + "name": "J Jordan", + "email": "jjrdn@styosis.com" + }, + "bugs": { + "url": "https://github.com/pwnall/node-open/issues" + }, + "contributors": [ + { + "name": "Victor Costan", + "email": "victor@costan.us", + "url": "http://www.costan.us" + } + ], + "dependencies": {}, + "description": "open a file or url in the user's preferred application", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc", + "tarball": "https://registry.npmjs.org/open/-/open-0.0.5.tgz" + }, + "engines": { + "node": ">= 0.6.0" + }, + "homepage": "https://github.com/jjrdn/node-open", + "keywords": [ + "start", + "open", + "browser", + "editor", + "default" + ], + "license": "MIT", + "main": "lib/open.js", + "maintainers": [ + { + "name": "jjrdn", + "email": "jjrdn@styosis.com" + }, + { + "name": "pwnall", + "email": "costan@gmail.com" + } + ], + "name": "open", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/pwnall/node-open.git" + }, + "scripts": { + "test": "node_modules/mocha/bin/mocha" + }, + "version": "0.0.5" +} diff --git a/node_modules/open/vendor/xdg-open b/node_modules/open/vendor/xdg-open new file mode 100755 index 00000000..13caac1a --- /dev/null +++ b/node_modules/open/vendor/xdg-open @@ -0,0 +1,767 @@ +#!/bin/sh +#--------------------------------------------- +# xdg-open +# +# Utility script to open a URL in the registered default application. +# +# Refer to the usage() function below for usage. +# +# Copyright 2009-2010, Fathi Boudra +# Copyright 2009-2010, Rex Dieter +# Copyright 2006, Kevin Krammer +# Copyright 2006, Jeremy White +# +# LICENSE: +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +#--------------------------------------------- + +manualpage() +{ +cat << _MANUALPAGE +Name + + xdg-open -- opens a file or URL in the user's preferred + application + +Synopsis + + xdg-open { file | URL } + + xdg-open { --help | --manual | --version } + +Description + + xdg-open opens a file or URL in the user's preferred + application. If a URL is provided the URL will be opened in the + user's preferred web browser. If a file is provided the file + will be opened in the preferred application for files of that + type. xdg-open supports file, ftp, http and https URLs. + + xdg-open is for use inside a desktop session only. It is not + recommended to use xdg-open as root. + +Options + + --help + Show command synopsis. + + --manual + Show this manual page. + + --version + Show the xdg-utils version information. + +Exit Codes + + An exit code of 0 indicates success while a non-zero exit code + indicates failure. The following failure codes can be returned: + + 1 + Error in command line syntax. + + 2 + One of the files passed on the command line did not + exist. + + 3 + A required tool could not be found. + + 4 + The action failed. + +Examples + +xdg-open 'http://www.freedesktop.org/' + + Opens the freedesktop.org website in the user's default + browser. + +xdg-open /tmp/foobar.png + + Opens the PNG image file /tmp/foobar.png in the user's default + image viewing application. +_MANUALPAGE +} + +usage() +{ +cat << _USAGE + xdg-open -- opens a file or URL in the user's preferred + application + +Synopsis + + xdg-open { file | URL } + + xdg-open { --help | --manual | --version } + +_USAGE +} + +#@xdg-utils-common@ + +#---------------------------------------------------------------------------- +# Common utility functions included in all XDG wrapper scripts +#---------------------------------------------------------------------------- + +DEBUG() +{ + [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; + [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; + shift + echo "$@" >&2 +} + +# This handles backslashes but not quote marks. +first_word() +{ + read first rest + echo "$first" +} + +#------------------------------------------------------------- +# map a binary to a .desktop file +binary_to_desktop_file() +{ + search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + binary="`which "$1"`" + binary="`readlink -f "$binary"`" + base="`basename "$binary"`" + IFS=: + for dir in $search; do + unset IFS + [ "$dir" ] || continue + [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue + for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do + [ -r "$file" ] || continue + # Check to make sure it's worth the processing. + grep -q "^Exec.*$base" "$file" || continue + # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). + grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command="`which "$command"`" + if [ x"`readlink -f "$command"`" = x"$binary" ]; then + # Fix any double slashes that got added path composition + echo "$file" | sed -e 's,//*,/,g' + return + fi + done + done +} + +#------------------------------------------------------------- +# map a .desktop file to a binary +## FIXME: handle vendor dir case +desktop_file_to_binary() +{ + search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + desktop="`basename "$1"`" + IFS=: + for dir in $search; do + unset IFS + [ "$dir" ] && [ -d "$dir/applications" ] || continue + file="$dir/applications/$desktop" + [ -r "$file" ] || continue + # Remove any arguments (%F, %f, %U, %u, etc.). + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command="`which "$command"`" + readlink -f "$command" + return + done +} + +#------------------------------------------------------------- +# Exit script on successfully completing the desired operation + +exit_success() +{ + if [ $# -gt 0 ]; then + echo "$@" + echo + fi + + exit 0 +} + + +#----------------------------------------- +# Exit script on malformed arguments, not enough arguments +# or missing required option. +# prints usage information + +exit_failure_syntax() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + echo "Try 'xdg-open --help' for more information." >&2 + else + usage + echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." + fi + + exit 1 +} + +#------------------------------------------------------------- +# Exit script on missing file specified on command line + +exit_failure_file_missing() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 2 +} + +#------------------------------------------------------------- +# Exit script on failure to locate necessary tool applications + +exit_failure_operation_impossible() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 3 +} + +#------------------------------------------------------------- +# Exit script on failure returned by a tool application + +exit_failure_operation_failed() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 4 +} + +#------------------------------------------------------------ +# Exit script on insufficient permission to read a specified file + +exit_failure_file_permission_read() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 5 +} + +#------------------------------------------------------------ +# Exit script on insufficient permission to write a specified file + +exit_failure_file_permission_write() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 6 +} + +check_input_file() +{ + if [ ! -e "$1" ]; then + exit_failure_file_missing "file '$1' does not exist" + fi + if [ ! -r "$1" ]; then + exit_failure_file_permission_read "no permission to read file '$1'" + fi +} + +check_vendor_prefix() +{ + file_label="$2" + [ -n "$file_label" ] || file_label="filename" + file=`basename "$1"` + case "$file" in + [a-zA-Z]*-*) + return + ;; + esac + + echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 + echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 + echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 + echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 + exit 1 +} + +check_output_file() +{ + # if the file exists, check if it is writeable + # if it does not exists, check if we are allowed to write on the directory + if [ -e "$1" ]; then + if [ ! -w "$1" ]; then + exit_failure_file_permission_write "no permission to write to file '$1'" + fi + else + DIR=`dirname "$1"` + if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then + exit_failure_file_permission_write "no permission to create file '$1'" + fi + fi +} + +#---------------------------------------- +# Checks for shared commands, e.g. --help + +check_common_commands() +{ + while [ $# -gt 0 ] ; do + parm="$1" + shift + + case "$parm" in + --help) + usage + echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." + exit_success + ;; + + --manual) + manualpage + exit_success + ;; + + --version) + echo "xdg-open 1.1.0 rc1" + exit_success + ;; + esac + done +} + +check_common_commands "$@" + +[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; +if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then + # Be silent + xdg_redirect_output=" > /dev/null 2> /dev/null" +else + # All output to stderr + xdg_redirect_output=" >&2" +fi + +#-------------------------------------- +# Checks for known desktop environments +# set variable DE to the desktop environments name, lowercase + +detectDE() +{ + # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 + unset GREP_OPTIONS + + if [ -n "${XDG_CURRENT_DESKTOP}" ]; then + case "${XDG_CURRENT_DESKTOP}" in + GNOME) + DE=gnome; + ;; + KDE) + DE=kde; + ;; + LXDE) + DE=lxde; + ;; + XFCE) + DE=xfce + esac + fi + + if [ x"$DE" = x"" ]; then + # classic fallbacks + if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; + elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate; + elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; + elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; + elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce + fi + fi + + if [ x"$DE" = x"" ]; then + # fallback to checking $DESKTOP_SESSION + case "$DESKTOP_SESSION" in + gnome) + DE=gnome; + ;; + LXDE|Lubuntu) + DE=lxde; + ;; + xfce|xfce4|'Xfce Session') + DE=xfce; + ;; + esac + fi + + if [ x"$DE" = x"" ]; then + # fallback to uname output for other platforms + case "$(uname 2>/dev/null)" in + Darwin) + DE=darwin; + ;; + esac + fi + + if [ x"$DE" = x"gnome" ]; then + # gnome-default-applications-properties is only available in GNOME 2.x + # but not in GNOME 3.x + which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" + fi +} + +#---------------------------------------------------------------------------- +# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 +# It also always returns 1 in KDE 3.4 and earlier +# Simply return 0 in such case + +kfmclient_fix_exit_code() +{ + version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` + major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` + minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` + release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` + test "$major" -gt 3 && return $1 + test "$minor" -gt 5 && return $1 + test "$release" -gt 4 && return $1 + return 0 +} + +# This handles backslashes but not quote marks. +first_word() +{ + read first rest + echo "$first" +} + +last_word() +{ + read first rest + echo "$rest" +} + +open_darwin() +{ + open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_kde() +{ + if kde-open -v 2>/dev/null 1>&2; then + kde-open "$1" + else + if [ x"$KDE_SESSION_VERSION" = x"4" ]; then + kfmclient openURL "$1" + else + kfmclient exec "$1" + kfmclient_fix_exit_code $? + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_gnome() +{ + if gvfs-open --help 2>/dev/null 1>&2; then + gvfs-open "$1" + else + gnome-open "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_mate() +{ + if gvfs-open --help 2>/dev/null 1>&2; then + gvfs-open "$1" + else + mate-open "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_xfce() +{ + exo-open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +#----------------------------------------- +# Recursively search .desktop file + +search_desktop_file() +{ + local default="$1" + local dir="$2" + local arg="$3" + + local file="" + # look for both vendor-app.desktop, vendor/app.desktop + if [ -r "$dir/$default" ]; then + file="$dir/$default" + elif [ -r "$dir/`echo $default | sed -e 's|-|/|'`" ]; then + file="$dir/`echo $default | sed -e 's|-|/|'`" + fi + + if [ -r "$file" ] ; then + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command_exec=`which $command 2>/dev/null` + arguments="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | last_word`" + arg_one="`echo $arg | sed 's/&/\\\\&/g'`" + arguments_exec="`echo $arguments | sed -e 's*%[fFuU]*"'"$arg_one"'"*g'`" + + if [ -x "$command_exec" ] ; then + if echo $arguments | grep -iq '%[fFuU]' ; then + echo START $command_exec $arguments_exec + eval $command_exec $arguments_exec + else + echo START $command_exec $arguments_exec "$arg" + eval $command_exec $arguments_exec "$arg" + fi + + if [ $? -eq 0 ]; then + exit_success + fi + fi + fi + + for d in $dir/*/; do + [ -d "$d" ] && search_desktop_file "$default" "$d" "$arg" + done +} + + +open_generic_xdg_mime() +{ + filetype="$2" + default=`xdg-mime query default "$filetype"` + if [ -n "$default" ] ; then + xdg_user_dir="$XDG_DATA_HOME" + [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" + + xdg_system_dirs="$XDG_DATA_DIRS" + [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ + +DEBUG 3 "$xdg_user_dir:$xdg_system_dirs" + for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do + search_desktop_file "$default" "$x/applications/" "$1" + done + fi +} + +open_generic_xdg_file_mime() +{ + filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` + open_generic_xdg_mime "$1" "$filetype" +} + +open_generic_xdg_x_scheme_handler() +{ + scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`" + if [ -n $scheme ]; then + filetype="x-scheme-handler/$scheme" + open_generic_xdg_mime "$1" "$filetype" + fi +} + +open_generic() +{ + # Paths or file:// URLs + if (echo "$1" | grep -q '^file://' || + ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'); then + + local file="$1" + + # Decode URLs + if echo "$file" | grep -q '^file:///'; then + file=${file#file://} + file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" + fi + check_input_file "$file" + + open_generic_xdg_file_mime "$file" + + if [ -f /etc/debian_version ] && + which run-mailcap 2>/dev/null 1>&2; then + run-mailcap --action=view "$file" + if [ $? -eq 0 ]; then + exit_success + fi + fi + + if mimeopen -v 2>/dev/null 1>&2; then + mimeopen -L -n "$file" + if [ $? -eq 0 ]; then + exit_success + fi + fi + fi + + open_generic_xdg_x_scheme_handler "$1" + + IFS=":" + for browser in $BROWSER; do + if [ x"$browser" != x"" ]; then + + browser_with_arg=`printf "$browser" "$1" 2>/dev/null` + if [ $? -ne 0 ]; then + browser_with_arg=$browser; + fi + + if [ x"$browser_with_arg" = x"$browser" ]; then + eval '$browser $1'$xdg_redirect_output; + else eval '$browser_with_arg'$xdg_redirect_output; + fi + + if [ $? -eq 0 ]; then + exit_success; + fi + fi + done + + exit_failure_operation_impossible "no method available for opening '$1'" +} + +open_lxde() +{ + # pcmanfm only knows how to handle file:// urls and filepaths, it seems. + if (echo "$1" | grep -q '^file://' || + ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:') + then + local file="$(echo "$1" | sed 's%^file://%%')" + + # handle relative paths + if ! echo "$file" | grep -q '^/'; then + file="$(pwd)/$file" + fi + + pcmanfm "$file" + + else + open_generic "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +[ x"$1" != x"" ] || exit_failure_syntax + +url= +while [ $# -gt 0 ] ; do + parm="$1" + shift + + case "$parm" in + -*) + exit_failure_syntax "unexpected option '$parm'" + ;; + + *) + if [ -n "$url" ] ; then + exit_failure_syntax "unexpected argument '$parm'" + fi + url="$parm" + ;; + esac +done + +if [ -z "${url}" ] ; then + exit_failure_syntax "file or URL argument missing" +fi + +detectDE + +if [ x"$DE" = x"" ]; then + DE=generic +fi + +DEBUG 2 "Selected DE $DE" + +# if BROWSER variable is not set, check some well known browsers instead +if [ x"$BROWSER" = x"" ]; then + BROWSER=links2:elinks:links:lynx:w3m + if [ -n "$DISPLAY" ]; then + BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER + fi +fi + +case "$DE" in + kde) + open_kde "$url" + ;; + + gnome*) + open_gnome "$url" + ;; + + mate) + open_mate "$url" + ;; + + xfce) + open_xfce "$url" + ;; + + lxde) + open_lxde "$url" + ;; + + generic) + open_generic "$url" + ;; + + *) + exit_failure_operation_impossible "no method available for opening '$url'" + ;; +esac diff --git a/node_modules/optimist/.travis.yml b/node_modules/optimist/.travis.yml new file mode 100755 index 00000000..cc4dba29 --- /dev/null +++ b/node_modules/optimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/optimist/LICENSE b/node_modules/optimist/LICENSE new file mode 100755 index 00000000..432d1aeb --- /dev/null +++ b/node_modules/optimist/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/optimist/example/bool.js b/node_modules/optimist/example/bool.js new file mode 100755 index 00000000..a998fb7a --- /dev/null +++ b/node_modules/optimist/example/bool.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node +var util = require('util'); +var argv = require('optimist').argv; + +if (argv.s) { + util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); +} +console.log( + (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') +); diff --git a/node_modules/optimist/example/boolean_double.js b/node_modules/optimist/example/boolean_double.js new file mode 100755 index 00000000..a35a7e6d --- /dev/null +++ b/node_modules/optimist/example/boolean_double.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); diff --git a/node_modules/optimist/example/boolean_single.js b/node_modules/optimist/example/boolean_single.js new file mode 100755 index 00000000..017bb689 --- /dev/null +++ b/node_modules/optimist/example/boolean_single.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .boolean('v') + .argv +; +console.dir(argv.v); +console.dir(argv._); diff --git a/node_modules/optimist/example/default_hash.js b/node_modules/optimist/example/default_hash.js new file mode 100755 index 00000000..ade77681 --- /dev/null +++ b/node_modules/optimist/example/default_hash.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var argv = require('optimist') + .default({ x : 10, y : 10 }) + .argv +; + +console.log(argv.x + argv.y); diff --git a/node_modules/optimist/example/default_singles.js b/node_modules/optimist/example/default_singles.js new file mode 100755 index 00000000..d9b1ff45 --- /dev/null +++ b/node_modules/optimist/example/default_singles.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node +var argv = require('optimist') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); diff --git a/node_modules/optimist/example/divide.js b/node_modules/optimist/example/divide.js new file mode 100755 index 00000000..5e2ee82f --- /dev/null +++ b/node_modules/optimist/example/divide.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var argv = require('optimist') + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x','y']) + .argv; + +console.log(argv.x / argv.y); diff --git a/node_modules/optimist/example/line_count.js b/node_modules/optimist/example/line_count.js new file mode 100755 index 00000000..b5f95bf6 --- /dev/null +++ b/node_modules/optimist/example/line_count.js @@ -0,0 +1,20 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); diff --git a/node_modules/optimist/example/line_count_options.js b/node_modules/optimist/example/line_count_options.js new file mode 100755 index 00000000..d9ac7090 --- /dev/null +++ b/node_modules/optimist/example/line_count_options.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .options({ + file : { + demand : true, + alias : 'f', + description : 'Load a file' + }, + base : { + alias : 'b', + description : 'Numeric base to use for output', + default : 10, + }, + }) + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines.toString(argv.base)); +}); diff --git a/node_modules/optimist/example/line_count_wrap.js b/node_modules/optimist/example/line_count_wrap.js new file mode 100755 index 00000000..42675111 --- /dev/null +++ b/node_modules/optimist/example/line_count_wrap.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .wrap(80) + .demand('f') + .alias('f', [ 'file', 'filename' ]) + .describe('f', + "Load a file. It's pretty important." + + " Required even. So you'd better specify it." + ) + .alias('b', 'base') + .describe('b', 'Numeric base to display the number of lines in') + .default('b', 10) + .describe('x', 'Super-secret optional parameter which is secret') + .default('x', '') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines.toString(argv.base)); +}); diff --git a/node_modules/optimist/example/nonopt.js b/node_modules/optimist/example/nonopt.js new file mode 100755 index 00000000..ee633eed --- /dev/null +++ b/node_modules/optimist/example/nonopt.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); diff --git a/node_modules/optimist/example/reflect.js b/node_modules/optimist/example/reflect.js new file mode 100755 index 00000000..816b3e11 --- /dev/null +++ b/node_modules/optimist/example/reflect.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.dir(require('optimist').argv); diff --git a/node_modules/optimist/example/short.js b/node_modules/optimist/example/short.js new file mode 100755 index 00000000..1db0ad0f --- /dev/null +++ b/node_modules/optimist/example/short.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); diff --git a/node_modules/optimist/example/string.js b/node_modules/optimist/example/string.js new file mode 100755 index 00000000..a8e5aeb2 --- /dev/null +++ b/node_modules/optimist/example/string.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node +var argv = require('optimist') + .string('x', 'y') + .argv +; +console.dir([ argv.x, argv.y ]); + +/* Turns off numeric coercion: + ./node string.js -x 000123 -y 9876 + [ '000123', '9876' ] +*/ diff --git a/node_modules/optimist/example/usage-options.js b/node_modules/optimist/example/usage-options.js new file mode 100755 index 00000000..b9999776 --- /dev/null +++ b/node_modules/optimist/example/usage-options.js @@ -0,0 +1,19 @@ +var optimist = require('./../index'); + +var argv = optimist.usage('This is my awesome program', { + 'about': { + description: 'Provide some details about the author of this program', + required: true, + short: 'a', + }, + 'info': { + description: 'Provide some information about the node.js agains!!!!!!', + boolean: true, + short: 'i' + } +}).argv; + +optimist.showHelp(); + +console.log('\n\nInspecting options'); +console.dir(argv); \ No newline at end of file diff --git a/node_modules/optimist/example/xup.js b/node_modules/optimist/example/xup.js new file mode 100755 index 00000000..8f6ecd20 --- /dev/null +++ b/node_modules/optimist/example/xup.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node +var argv = require('optimist').argv; + +if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Buy more riffiwobbles'); +} +else { + console.log('Sell the xupptumblers'); +} + diff --git a/node_modules/optimist/index.js b/node_modules/optimist/index.js new file mode 100755 index 00000000..4da5a6d8 --- /dev/null +++ b/node_modules/optimist/index.js @@ -0,0 +1,343 @@ +var path = require('path'); +var minimist = require('minimist'); +var wordwrap = require('wordwrap'); + +/* Hack an instance of Argv with process.argv into Argv + so people can do + require('optimist')(['--beeble=1','-z','zizzle']).argv + to parse a list of args and + require('optimist').argv + to get a parsed version of process.argv. +*/ + +var inst = Argv(process.argv.slice(2)); +Object.keys(inst).forEach(function (key) { + Argv[key] = typeof inst[key] == 'function' + ? inst[key].bind(inst) + : inst[key]; +}); + +var exports = module.exports = Argv; +function Argv (processArgs, cwd) { + var self = {}; + if (!cwd) cwd = process.cwd(); + + self.$0 = process.argv + .slice(0,2) + .map(function (x) { + var b = rebase(cwd, x); + return x.match(/^\//) && b.length < x.length + ? b : x + }) + .join(' ') + ; + + if (process.env._ != undefined && process.argv[1] == process.env._) { + self.$0 = process.env._.replace( + path.dirname(process.execPath) + '/', '' + ); + } + + var options = { + boolean: [], + string: [], + alias: {}, + default: [] + }; + + self.boolean = function (bools) { + options.boolean.push.apply(options.boolean, [].concat(bools)); + return self; + }; + + self.string = function (strings) { + options.string.push.apply(options.string, [].concat(strings)); + return self; + }; + + self.default = function (key, value) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.default(k, key[k]); + }); + } + else { + options.default[key] = value; + } + return self; + }; + + self.alias = function (x, y) { + if (typeof x === 'object') { + Object.keys(x).forEach(function (key) { + self.alias(key, x[key]); + }); + } + else { + options.alias[x] = (options.alias[x] || []).concat(y); + } + return self; + }; + + var demanded = {}; + self.demand = function (keys) { + if (typeof keys == 'number') { + if (!demanded._) demanded._ = 0; + demanded._ += keys; + } + else if (Array.isArray(keys)) { + keys.forEach(function (key) { + self.demand(key); + }); + } + else { + demanded[keys] = true; + } + + return self; + }; + + var usage; + self.usage = function (msg, opts) { + if (!opts && typeof msg === 'object') { + opts = msg; + msg = null; + } + + usage = msg; + + if (opts) self.options(opts); + + return self; + }; + + function fail (msg) { + self.showHelp(); + if (msg) console.error(msg); + process.exit(1); + } + + var checks = []; + self.check = function (f) { + checks.push(f); + return self; + }; + + var descriptions = {}; + self.describe = function (key, desc) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.describe(k, key[k]); + }); + } + else { + descriptions[key] = desc; + } + return self; + }; + + self.parse = function (args) { + return parseArgs(args); + }; + + self.option = self.options = function (key, opt) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.options(k, key[k]); + }); + } + else { + if (opt.alias) self.alias(key, opt.alias); + if (opt.demand) self.demand(key); + if (typeof opt.default !== 'undefined') { + self.default(key, opt.default); + } + + if (opt.boolean || opt.type === 'boolean') { + self.boolean(key); + } + if (opt.string || opt.type === 'string') { + self.string(key); + } + + var desc = opt.describe || opt.description || opt.desc; + if (desc) { + self.describe(key, desc); + } + } + + return self; + }; + + var wrap = null; + self.wrap = function (cols) { + wrap = cols; + return self; + }; + + self.showHelp = function (fn) { + if (!fn) fn = console.error; + fn(self.help()); + }; + + self.help = function () { + var keys = Object.keys( + Object.keys(descriptions) + .concat(Object.keys(demanded)) + .concat(Object.keys(options.default)) + .reduce(function (acc, key) { + if (key !== '_') acc[key] = true; + return acc; + }, {}) + ); + + var help = keys.length ? [ 'Options:' ] : []; + + if (usage) { + help.unshift(usage.replace(/\$0/g, self.$0), ''); + } + + var switches = keys.reduce(function (acc, key) { + acc[key] = [ key ].concat(options.alias[key] || []) + .map(function (sw) { + return (sw.length > 1 ? '--' : '-') + sw + }) + .join(', ') + ; + return acc; + }, {}); + + var switchlen = longest(Object.keys(switches).map(function (s) { + return switches[s] || ''; + })); + + var desclen = longest(Object.keys(descriptions).map(function (d) { + return descriptions[d] || ''; + })); + + keys.forEach(function (key) { + var kswitch = switches[key]; + var desc = descriptions[key] || ''; + + if (wrap) { + desc = wordwrap(switchlen + 4, wrap)(desc) + .slice(switchlen + 4) + ; + } + + var spadding = new Array( + Math.max(switchlen - kswitch.length + 3, 0) + ).join(' '); + + var dpadding = new Array( + Math.max(desclen - desc.length + 1, 0) + ).join(' '); + + var type = null; + + if (options.boolean[key]) type = '[boolean]'; + if (options.string[key]) type = '[string]'; + + if (!wrap && dpadding.length > 0) { + desc += dpadding; + } + + var prelude = ' ' + kswitch + spadding; + var extra = [ + type, + demanded[key] + ? '[required]' + : null + , + options.default[key] !== undefined + ? '[default: ' + JSON.stringify(options.default[key]) + ']' + : null + , + ].filter(Boolean).join(' '); + + var body = [ desc, extra ].filter(Boolean).join(' '); + + if (wrap) { + var dlines = desc.split('\n'); + var dlen = dlines.slice(-1)[0].length + + (dlines.length === 1 ? prelude.length : 0) + + body = desc + (dlen + extra.length > wrap - 2 + ? '\n' + + new Array(wrap - extra.length + 1).join(' ') + + extra + : new Array(wrap - extra.length - dlen + 1).join(' ') + + extra + ); + } + + help.push(prelude + body); + }); + + help.push(''); + return help.join('\n'); + }; + + Object.defineProperty(self, 'argv', { + get : function () { return parseArgs(processArgs) }, + enumerable : true, + }); + + function parseArgs (args) { + var argv = minimist(args, options); + argv.$0 = self.$0; + + if (demanded._ && argv._.length < demanded._) { + fail('Not enough non-option arguments: got ' + + argv._.length + ', need at least ' + demanded._ + ); + } + + var missing = []; + Object.keys(demanded).forEach(function (key) { + if (!argv[key]) missing.push(key); + }); + + if (missing.length) { + fail('Missing required arguments: ' + missing.join(', ')); + } + + checks.forEach(function (f) { + try { + if (f(argv) === false) { + fail('Argument check failed: ' + f.toString()); + } + } + catch (err) { + fail(err) + } + }); + + return argv; + } + + function longest (xs) { + return Math.max.apply( + null, + xs.map(function (x) { return x.length }) + ); + } + + return self; +}; + +// rebase an absolute path to a relative one with respect to a base directory +// exported for tests +exports.rebase = rebase; +function rebase (base, dir) { + var ds = path.normalize(dir).split('/').slice(1); + var bs = path.normalize(base).split('/').slice(1); + + for (var i = 0; ds[i] && ds[i] == bs[i]; i++); + ds.splice(0, i); bs.splice(0, i); + + var p = path.normalize( + bs.map(function () { return '..' }).concat(ds).join('/') + ).replace(/\/$/,'').replace(/^$/, '.'); + return p.match(/^[.\/]/) ? p : './' + p; +}; diff --git a/node_modules/optimist/package.json b/node_modules/optimist/package.json new file mode 100755 index 00000000..b1ad90ae --- /dev/null +++ b/node_modules/optimist/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "optimist@~0.6.0", + "scope": null, + "escapedName": "optimist", + "name": "optimist", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack" + ] + ], + "_from": "optimist@>=0.6.0 <0.7.0", + "_id": "optimist@0.6.1", + "_inCache": true, + "_location": "/optimist", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "raw": "optimist@~0.6.0", + "scope": null, + "escapedName": "optimist", + "name": "optimist", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack", + "/webpack-dev-server" + ], + "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "_shasum": "da3ea74686fa21a19a111c326e90eb15a0196686", + "_shrinkwrap": null, + "_spec": "optimist@~0.6.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-optimist/issues" + }, + "dependencies": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "description": "Light-weight option parsing with an argv hash. No optstrings attached.", + "devDependencies": { + "hashish": "~0.0.4", + "tap": "~0.4.0" + }, + "directories": {}, + "dist": { + "shasum": "da3ea74686fa21a19a111c326e90eb15a0196686", + "tarball": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" + }, + "engine": { + "node": ">=0.4" + }, + "homepage": "https://github.com/substack/node-optimist", + "keywords": [ + "argument", + "args", + "option", + "parser", + "parsing", + "cli", + "command" + ], + "license": "MIT/X11", + "main": "./index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "optimist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/substack/node-optimist.git" + }, + "scripts": { + "test": "tap ./test/*.js" + }, + "version": "0.6.1" +} diff --git a/node_modules/optimist/readme.markdown b/node_modules/optimist/readme.markdown new file mode 100755 index 00000000..b74b4372 --- /dev/null +++ b/node_modules/optimist/readme.markdown @@ -0,0 +1,513 @@ +# DEPRECATION NOTICE + +I don't want to maintain this module anymore since I just use +[minimist](https://npmjs.org/package/minimist), the argument parsing engine, +directly instead nowadays. + +See [yargs](https://github.com/chevex/yargs) for the modern, pirate-themed +successor to optimist. + +[![yarrrrrrrgs!](http://i.imgur.com/4WFGVJ9.png)](https://github.com/chevex/yargs) + +You should also consider [nomnom](https://github.com/harthur/nomnom). + +optimist +======== + +Optimist is a node.js library for option parsing for people who hate option +parsing. More specifically, this module is for people who like all the --bells +and -whistlz of program usage but think optstrings are a waste of time. + +With optimist, option parsing doesn't have to suck (as much). + +[![build status](https://secure.travis-ci.org/substack/node-optimist.png)](http://travis-ci.org/substack/node-optimist) + +examples +======== + +With Optimist, the options are just a hash! No optstrings attached. +------------------------------------------------------------------- + +xup.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; + +if (argv.rif - 5 * argv.xup > 7.138) { + console.log('Buy more riffiwobbles'); +} +else { + console.log('Sell the xupptumblers'); +} +```` + +*** + + $ ./xup.js --rif=55 --xup=9.52 + Buy more riffiwobbles + + $ ./xup.js --rif 12 --xup 8.1 + Sell the xupptumblers + +![This one's optimistic.](http://substack.net/images/optimistic.png) + +But wait! There's more! You can do short options: +------------------------------------------------- + +short.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +```` + +*** + + $ ./short.js -x 10 -y 21 + (10,21) + +And booleans, both long and short (and grouped): +---------------------------------- + +bool.js: + +````javascript +#!/usr/bin/env node +var util = require('util'); +var argv = require('optimist').argv; + +if (argv.s) { + util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); +} +console.log( + (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') +); +```` + +*** + + $ ./bool.js -s + The cat says: meow + + $ ./bool.js -sp + The cat says: meow. + + $ ./bool.js -sp --fr + Le chat dit: miaou. + +And non-hypenated options too! Just use `argv._`! +------------------------------------------------- + +nonopt.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist').argv; +console.log('(%d,%d)', argv.x, argv.y); +console.log(argv._); +```` + +*** + + $ ./nonopt.js -x 6.82 -y 3.35 moo + (6.82,3.35) + [ 'moo' ] + + $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz + (0.54,1.12) + [ 'foo', 'bar', 'baz' ] + +Plus, Optimist comes with .usage() and .demand()! +------------------------------------------------- + +divide.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .usage('Usage: $0 -x [num] -y [num]') + .demand(['x','y']) + .argv; + +console.log(argv.x / argv.y); +```` + +*** + + $ ./divide.js -x 55 -y 11 + 5 + + $ node ./divide.js -x 4.91 -z 2.51 + Usage: node ./divide.js -x [num] -y [num] + + Options: + -x [required] + -y [required] + + Missing required arguments: y + +EVEN MORE HOLY COW +------------------ + +default_singles.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .default('x', 10) + .default('y', 10) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_singles.js -x 5 + 15 + +default_hash.js: + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .default({ x : 10, y : 10 }) + .argv +; +console.log(argv.x + argv.y); +```` + +*** + + $ ./default_hash.js -y 7 + 17 + +And if you really want to get all descriptive about it... +--------------------------------------------------------- + +boolean_single.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .boolean('v') + .argv +; +console.dir(argv); +```` + +*** + + $ ./boolean_single.js -v foo bar baz + true + [ 'bar', 'baz', 'foo' ] + +boolean_double.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .boolean(['x','y','z']) + .argv +; +console.dir([ argv.x, argv.y, argv.z ]); +console.dir(argv._); +```` + +*** + + $ ./boolean_double.js -x -z one two three + [ true, false, true ] + [ 'one', 'two', 'three' ] + +Optimist is here to help... +--------------------------- + +You can describe parameters for help messages and set aliases. Optimist figures +out how to format a handy help string automatically. + +line_count.js + +````javascript +#!/usr/bin/env node +var argv = require('optimist') + .usage('Count the lines in a file.\nUsage: $0') + .demand('f') + .alias('f', 'file') + .describe('f', 'Load a file') + .argv +; + +var fs = require('fs'); +var s = fs.createReadStream(argv.file); + +var lines = 0; +s.on('data', function (buf) { + lines += buf.toString().match(/\n/g).length; +}); + +s.on('end', function () { + console.log(lines); +}); +```` + +*** + + $ node line_count.js + Count the lines in a file. + Usage: node ./line_count.js + + Options: + -f, --file Load a file [required] + + Missing required arguments: f + + $ node line_count.js --file line_count.js + 20 + + $ node line_count.js -f line_count.js + 20 + +methods +======= + +By itself, + +````javascript +require('optimist').argv +````` + +will use `process.argv` array to construct the `argv` object. + +You can pass in the `process.argv` yourself: + +````javascript +require('optimist')([ '-x', '1', '-y', '2' ]).argv +```` + +or use .parse() to do the same thing: + +````javascript +require('optimist').parse([ '-x', '1', '-y', '2' ]) +```` + +The rest of these methods below come in just before the terminating `.argv`. + +.alias(key, alias) +------------------ + +Set key names as equivalent such that updates to a key will propagate to aliases +and vice-versa. + +Optionally `.alias()` can take an object that maps keys to aliases. + +.default(key, value) +-------------------- + +Set `argv[key]` to `value` if no option was specified on `process.argv`. + +Optionally `.default()` can take an object that maps keys to default values. + +.demand(key) +------------ + +If `key` is a string, show the usage information and exit if `key` wasn't +specified in `process.argv`. + +If `key` is a number, demand at least as many non-option arguments, which show +up in `argv._`. + +If `key` is an Array, demand each element. + +.describe(key, desc) +-------------------- + +Describe a `key` for the generated usage information. + +Optionally `.describe()` can take an object that maps keys to descriptions. + +.options(key, opt) +------------------ + +Instead of chaining together `.alias().demand().default()`, you can specify +keys in `opt` for each of the chainable methods. + +For example: + +````javascript +var argv = require('optimist') + .options('f', { + alias : 'file', + default : '/etc/passwd', + }) + .argv +; +```` + +is the same as + +````javascript +var argv = require('optimist') + .alias('f', 'file') + .default('f', '/etc/passwd') + .argv +; +```` + +Optionally `.options()` can take an object that maps keys to `opt` parameters. + +.usage(message) +--------------- + +Set a usage message to show which commands to use. Inside `message`, the string +`$0` will get interpolated to the current script name or node command for the +present script similar to how `$0` works in bash or perl. + +.check(fn) +---------- + +Check that certain conditions are met in the provided arguments. + +If `fn` throws or returns `false`, show the thrown error, usage information, and +exit. + +.boolean(key) +------------- + +Interpret `key` as a boolean. If a non-flag option follows `key` in +`process.argv`, that string won't get set as the value of `key`. + +If `key` never shows up as a flag in `process.arguments`, `argv[key]` will be +`false`. + +If `key` is an Array, interpret all the elements as booleans. + +.string(key) +------------ + +Tell the parser logic not to interpret `key` as a number or boolean. +This can be useful if you need to preserve leading zeros in an input. + +If `key` is an Array, interpret all the elements as strings. + +.wrap(columns) +-------------- + +Format usage output to wrap at `columns` many columns. + +.help() +------- + +Return the generated usage string. + +.showHelp(fn=console.error) +--------------------------- + +Print the usage data using `fn` for printing. + +.parse(args) +------------ + +Parse `args` instead of `process.argv`. Returns the `argv` object. + +.argv +----- + +Get the arguments as a plain old object. + +Arguments without a corresponding flag show up in the `argv._` array. + +The script name or node command is available at `argv.$0` similarly to how `$0` +works in bash or perl. + +parsing tricks +============== + +stop parsing +------------ + +Use `--` to stop parsing flags and stuff the remainder into `argv._`. + + $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4 + { _: [ '-c', '3', '-d', '4' ], + '$0': 'node ./examples/reflect.js', + a: 1, + b: 2 } + +negate fields +------------- + +If you want to explicity set a field to false instead of just leaving it +undefined or to override a default you can do `--no-key`. + + $ node examples/reflect.js -a --no-b + { _: [], + '$0': 'node ./examples/reflect.js', + a: true, + b: false } + +numbers +------- + +Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to +one. This way you can just `net.createConnection(argv.port)` and you can add +numbers out of `argv` with `+` without having that mean concatenation, +which is super frustrating. + +duplicates +---------- + +If you specify a flag multiple times it will get turned into an array containing +all the values in order. + + $ node examples/reflect.js -x 5 -x 8 -x 0 + { _: [], + '$0': 'node ./examples/reflect.js', + x: [ 5, 8, 0 ] } + +dot notation +------------ + +When you use dots (`.`s) in argument names, an implicit object path is assumed. +This lets you organize arguments into nested objects. + + $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5 + { _: [], + '$0': 'node ./examples/reflect.js', + foo: { bar: { baz: 33 }, quux: 5 } } + +short numbers +------------- + +Short numeric `head -n5` style argument work too: + + $ node reflect.js -n123 -m456 + { '3': true, + '6': true, + _: [], + '$0': 'node ./reflect.js', + n: 123, + m: 456 } + +installation +============ + +With [npm](http://github.com/isaacs/npm), just do: + npm install optimist + +or clone this project on github: + + git clone http://github.com/substack/node-optimist.git + +To run the tests with [expresso](http://github.com/visionmedia/expresso), +just do: + + expresso + +inspired By +=========== + +This module is loosely inspired by Perl's +[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm). diff --git a/node_modules/optimist/test/_.js b/node_modules/optimist/test/_.js new file mode 100755 index 00000000..d9c58b36 --- /dev/null +++ b/node_modules/optimist/test/_.js @@ -0,0 +1,71 @@ +var spawn = require('child_process').spawn; +var test = require('tap').test; + +test('dotSlashEmpty', testCmd('./bin.js', [])); + +test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ])); + +test('nodeEmpty', testCmd('node bin.js', [])); + +test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ])); + +test('whichNodeEmpty', function (t) { + var which = spawn('which', ['node']); + + which.stdout.on('data', function (buf) { + t.test( + testCmd(buf.toString().trim() + ' bin.js', []) + ); + t.end(); + }); + + which.stderr.on('data', function (err) { + assert.error(err); + t.end(); + }); +}); + +test('whichNodeArgs', function (t) { + var which = spawn('which', ['node']); + + which.stdout.on('data', function (buf) { + t.test( + testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ]) + ); + t.end(); + }); + + which.stderr.on('data', function (err) { + t.error(err); + t.end(); + }); +}); + +function testCmd (cmd, args) { + + return function (t) { + var to = setTimeout(function () { + assert.fail('Never got stdout data.') + }, 5000); + + var oldDir = process.cwd(); + process.chdir(__dirname + '/_'); + + var cmds = cmd.split(' '); + + var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String))); + process.chdir(oldDir); + + bin.stderr.on('data', function (err) { + t.error(err); + t.end(); + }); + + bin.stdout.on('data', function (buf) { + clearTimeout(to); + var _ = JSON.parse(buf.toString()); + t.same(_.map(String), args.map(String)); + t.end(); + }); + }; +} diff --git a/node_modules/optimist/test/_/argv.js b/node_modules/optimist/test/_/argv.js new file mode 100755 index 00000000..3d096062 --- /dev/null +++ b/node_modules/optimist/test/_/argv.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log(JSON.stringify(process.argv)); diff --git a/node_modules/optimist/test/_/bin.js b/node_modules/optimist/test/_/bin.js new file mode 100755 index 00000000..4a18d85f --- /dev/null +++ b/node_modules/optimist/test/_/bin.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node +var argv = require('../../index').argv +console.log(JSON.stringify(argv._)); diff --git a/node_modules/optimist/test/dash.js b/node_modules/optimist/test/dash.js new file mode 100755 index 00000000..af8ed6fc --- /dev/null +++ b/node_modules/optimist/test/dash.js @@ -0,0 +1,31 @@ +var optimist = require('../index'); +var test = require('tap').test; + +test('-', function (t) { + t.plan(5); + t.deepEqual( + fix(optimist.parse([ '-n', '-' ])), + { n: '-', _: [] } + ); + t.deepEqual( + fix(optimist.parse([ '-' ])), + { _: [ '-' ] } + ); + t.deepEqual( + fix(optimist.parse([ '-f-' ])), + { f: '-', _: [] } + ); + t.deepEqual( + fix(optimist([ '-b', '-' ]).boolean('b').argv), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + fix(optimist([ '-s', '-' ]).string('s').argv), + { s: '-', _: [] } + ); +}); + +function fix (obj) { + delete obj.$0; + return obj; +} diff --git a/node_modules/optimist/test/parse.js b/node_modules/optimist/test/parse.js new file mode 100755 index 00000000..d320f433 --- /dev/null +++ b/node_modules/optimist/test/parse.js @@ -0,0 +1,446 @@ +var optimist = require('../index'); +var path = require('path'); +var test = require('tap').test; + +var $0 = 'node ./' + path.relative(process.cwd(), __filename); + +test('short boolean', function (t) { + var parse = optimist.parse([ '-b' ]); + t.same(parse, { b : true, _ : [], $0 : $0 }); + t.same(typeof parse.b, 'boolean'); + t.end(); +}); + +test('long boolean', function (t) { + t.same( + optimist.parse([ '--bool' ]), + { bool : true, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('bare', function (t) { + t.same( + optimist.parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ], $0 : $0 } + ); + t.end(); +}); + +test('short group', function (t) { + t.same( + optimist.parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short group next', function (t) { + t.same( + optimist.parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short capture', function (t) { + t.same( + optimist.parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('short captures', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long capture sp', function (t) { + t.same( + optimist.parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long capture eq', function (t) { + t.same( + optimist.parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [], $0 : $0 } + ); + t.end() +}); + +test('long captures sp', function (t) { + t.same( + optimist.parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('long captures eq', function (t) { + t.same( + optimist.parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ], $0 : $0, + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.same( + optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ], $0 : $0, + } + ); + t.end(); +}); + +test('no', function (t) { + t.same( + optimist.parse([ '--no-moo' ]), + { moo : false, _ : [], $0 : $0 } + ); + t.end(); +}); + +test('multi', function (t) { + t.same( + optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [], $0 : $0 } + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.same( + optimist.parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ], + $0 : $0 + } + ); + t.end(); +}); + +test('nums', function (t) { + var argv = optimist.parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789', + ]); + t.same(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ], + $0 : $0 + }); + t.same(typeof argv.x, 'number'); + t.same(typeof argv.y, 'number'); + t.same(typeof argv.z, 'number'); + t.same(typeof argv.w, 'string'); + t.same(typeof argv.hex, 'number'); + t.same(typeof argv._[0], 'number'); + t.end(); +}); + +test('flag boolean', function (t) { + var parse = optimist([ '-t', 'moo' ]).boolean(['t']).argv; + t.same(parse, { t : true, _ : [ 'moo' ], $0 : $0 }); + t.same(typeof parse.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var parse = optimist(['--verbose', 'false', 'moo', '-t', 'true']) + .boolean(['t', 'verbose']).default('verbose', true).argv; + + t.same(parse, { + verbose: false, + t: true, + _: ['moo'], + $0 : $0 + }); + + t.same(typeof parse.verbose, 'boolean'); + t.same(typeof parse.t, 'boolean'); + t.end(); +}); + +test('flag boolean default false', function (t) { + var parse = optimist(['moo']) + .boolean(['t', 'verbose']) + .default('verbose', false) + .default('t', false).argv; + + t.same(parse, { + verbose: false, + t: false, + _: ['moo'], + $0 : $0 + }); + + t.same(typeof parse.verbose, 'boolean'); + t.same(typeof parse.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var parse = optimist([ '-x', '-z', 'one', 'two', 'three' ]) + .boolean(['x','y','z']).argv; + + t.same(parse, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ], + $0 : $0 + }); + + t.same(typeof parse.x, 'boolean'); + t.same(typeof parse.y, 'boolean'); + t.same(typeof parse.z, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = optimist.parse([ '-s', "X\nX" ]) + t.same(args, { _ : [], s : "X\nX", $0 : $0 }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = optimist.parse([ "--s=X\nX" ]) + t.same(args, { _ : [], s : "X\nX", $0 : $0 }); + t.end(); +}); + +test('strings' , function (t) { + var s = optimist([ '-s', '0001234' ]).string('s').argv.s; + t.same(s, '0001234'); + t.same(typeof s, 'string'); + + var x = optimist([ '-x', '56' ]).string('x').argv.x; + t.same(x, '56'); + t.same(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = optimist([ ' ', ' ' ]).string('_').argv._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + optimist.parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [], $0 : $0 } + ); + t.same( + optimist.parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [], $0 : $0 } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = optimist([ '-f', '11', '--zoom', '55' ]) + .alias('z', 'zoom') + .argv + ; + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = optimist([ '-f', '11', '--zoom', '55' ]) + .alias('z', [ 'zm', 'zoom' ]) + .argv + ; + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('boolean default true', function (t) { + var argv = optimist.options({ + sometrue: { + boolean: true, + default: true + } + }).argv; + + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = optimist.options({ + somefalse: { + boolean: true, + default: false + } + }).argv; + + t.equal(argv.somefalse, false); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = optimist([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]).argv; + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + }, + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); + +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .boolean('herp') + .alias('h', 'herp') + .argv; + var propertyArgv = optimist(regular) + .boolean('herp') + .alias('h', 'herp') + .argv; + var expected = { + herp: true, + h: true, + '_': [ 'derp' ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .options(opts) + .argv; + var propertyArgv = optimist(regular).options(opts).argv; + var expected = { + herp: true, + h: true, + '_': [ 'derp' ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = optimist(aliased) + .boolean('h') + .alias('h', 'herp') + .argv; + var propertyArgv = optimist(regular) + .boolean('h') + .alias('h', 'herp') + .argv; + var expected = { + herp: true, + h: true, + '_': [ ], + '$0': $0, + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = optimist(['--boool', '--other=true']).boolean('boool').argv; + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = optimist(['--boool', '--other=false']).boolean('boool').argv; + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/node_modules/optimist/test/parse_modified.js b/node_modules/optimist/test/parse_modified.js new file mode 100755 index 00000000..a57dc84e --- /dev/null +++ b/node_modules/optimist/test/parse_modified.js @@ -0,0 +1,14 @@ +var optimist = require('../'); +var test = require('tap').test; + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = optimist().boolean('b').parse([ '-b', '123' ]); + t.deepEqual(fix(argv), { b: true, _: ['123'] }); +}); + +function fix (obj) { + delete obj.$0; + return obj; +} diff --git a/node_modules/optimist/test/short.js b/node_modules/optimist/test/short.js new file mode 100755 index 00000000..b2c38ad8 --- /dev/null +++ b/node_modules/optimist/test/short.js @@ -0,0 +1,16 @@ +var optimist = require('../index'); +var test = require('tap').test; + +test('-n123', function (t) { + t.plan(1); + var parse = optimist.parse([ '-n123' ]); + t.equal(parse.n, 123); +}); + +test('-123', function (t) { + t.plan(3); + var parse = optimist.parse([ '-123', '456' ]); + t.equal(parse['1'], true); + t.equal(parse['2'], true); + t.equal(parse['3'], 456); +}); diff --git a/node_modules/optimist/test/usage.js b/node_modules/optimist/test/usage.js new file mode 100755 index 00000000..300454c1 --- /dev/null +++ b/node_modules/optimist/test/usage.js @@ -0,0 +1,292 @@ +var Hash = require('hashish'); +var optimist = require('../index'); +var test = require('tap').test; + +test('usageFail', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .demand(['x','y']) + .argv; + }); + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage -x NUM -y NUM', + 'Options:', + ' -x [required]', + ' -y [required]', + 'Missing required arguments: y', + ] + ); + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + + +test('usagePass', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .demand(['x','y']) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkPass', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(function (argv) { + if (!('x' in argv)) throw 'You forgot about -x'; + if (!('y' in argv)) throw 'You forgot about -y'; + }) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkFail', function (t) { + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(function (argv) { + if (!('x' in argv)) throw 'You forgot about -x'; + if (!('y' in argv)) throw 'You forgot about -y'; + }) + .argv; + }); + + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage -x NUM -y NUM', + 'You forgot about -y' + ] + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('checkCondPass', function (t) { + function checker (argv) { + return 'x' in argv && 'y' in argv; + } + + var r = checkUsage(function () { + return optimist('-x 10 -y 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(checker) + .argv; + }); + t.same(r, { + result : { x : 10, y : 20, _ : [], $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('checkCondFail', function (t) { + function checker (argv) { + return 'x' in argv && 'y' in argv; + } + + var r = checkUsage(function () { + return optimist('-x 10 -z 20'.split(' ')) + .usage('Usage: $0 -x NUM -y NUM') + .check(checker) + .argv; + }); + + t.same( + r.result, + { x : 10, z : 20, _ : [], $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/).join('\n'), + 'Usage: ./usage -x NUM -y NUM\n' + + 'Argument check failed: ' + checker.toString() + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('countPass', function (t) { + var r = checkUsage(function () { + return optimist('1 2 3 --moo'.split(' ')) + .usage('Usage: $0 [x] [y] [z] {OPTIONS}') + .demand(3) + .argv; + }); + t.same(r, { + result : { _ : [ '1', '2', '3' ], moo : true, $0 : './usage' }, + errors : [], + logs : [], + exit : false, + }); + t.end(); +}); + +test('countFail', function (t) { + var r = checkUsage(function () { + return optimist('1 2 --moo'.split(' ')) + .usage('Usage: $0 [x] [y] [z] {OPTIONS}') + .demand(3) + .argv; + }); + t.same( + r.result, + { _ : [ '1', '2' ], moo : true, $0 : './usage' } + ); + + t.same( + r.errors.join('\n').split(/\n+/), + [ + 'Usage: ./usage [x] [y] [z] {OPTIONS}', + 'Not enough non-option arguments: got 2, need at least 3', + ] + ); + + t.same(r.logs, []); + t.ok(r.exit); + t.end(); +}); + +test('defaultSingles', function (t) { + var r = checkUsage(function () { + return optimist('--foo 50 --baz 70 --powsy'.split(' ')) + .default('foo', 5) + .default('bar', 6) + .default('baz', 7) + .argv + ; + }); + t.same(r.result, { + foo : '50', + bar : 6, + baz : '70', + powsy : true, + _ : [], + $0 : './usage', + }); + t.end(); +}); + +test('defaultAliases', function (t) { + var r = checkUsage(function () { + return optimist('') + .alias('f', 'foo') + .default('f', 5) + .argv + ; + }); + t.same(r.result, { + f : '5', + foo : '5', + _ : [], + $0 : './usage', + }); + t.end(); +}); + +test('defaultHash', function (t) { + var r = checkUsage(function () { + return optimist('--foo 50 --baz 70'.split(' ')) + .default({ foo : 10, bar : 20, quux : 30 }) + .argv + ; + }); + t.same(r.result, { + _ : [], + $0 : './usage', + foo : 50, + baz : 70, + bar : 20, + quux : 30, + }); + t.end(); +}); + +test('rebase', function (t) { + t.equal( + optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'), + './foo/bar/baz' + ); + t.equal( + optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'), + '../../..' + ); + t.equal( + optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'), + '../pow/zoom.txt' + ); + t.end(); +}); + +function checkUsage (f) { + + var exit = false; + + process._exit = process.exit; + process._env = process.env; + process._argv = process.argv; + + process.exit = function (t) { exit = true }; + process.env = Hash.merge(process.env, { _ : 'node' }); + process.argv = [ './usage' ]; + + var errors = []; + var logs = []; + + console._error = console.error; + console.error = function (msg) { errors.push(msg) }; + console._log = console.log; + console.log = function (msg) { logs.push(msg) }; + + var result = f(); + + process.exit = process._exit; + process.env = process._env; + process.argv = process._argv; + + console.error = console._error; + console.log = console._log; + + return { + errors : errors, + logs : logs, + exit : exit, + result : result, + }; +}; diff --git a/node_modules/optimist/test/whitespace.js b/node_modules/optimist/test/whitespace.js new file mode 100755 index 00000000..90b90752 --- /dev/null +++ b/node_modules/optimist/test/whitespace.js @@ -0,0 +1,8 @@ +var optimist = require('../'); +var test = require('tap').test; + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = optimist.parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/node_modules/original/.npmignore b/node_modules/original/.npmignore new file mode 100755 index 00000000..648ea07f --- /dev/null +++ b/node_modules/original/.npmignore @@ -0,0 +1,3 @@ +node_modules +coverage +npm-debug.log diff --git a/node_modules/original/.travis.yml b/node_modules/original/.travis.yml new file mode 100755 index 00000000..0765106a --- /dev/null +++ b/node_modules/original/.travis.yml @@ -0,0 +1,19 @@ +sudo: false +language: node_js +node_js: + - "4" + - "iojs" + - "0.12" + - "0.10" +script: + - "npm run test-travis" +after_script: + - "npm install coveralls@2 && cat coverage/lcov.info | coveralls" +matrix: + fast_finish: true +notifications: + irc: + channels: + - "irc.freenode.org#unshift" + on_success: change + on_failure: change diff --git a/node_modules/original/LICENSE b/node_modules/original/LICENSE new file mode 100755 index 00000000..6dc9316a --- /dev/null +++ b/node_modules/original/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/original/README.md b/node_modules/original/README.md new file mode 100755 index 00000000..f144209b --- /dev/null +++ b/node_modules/original/README.md @@ -0,0 +1,51 @@ +# origin(al) + +[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](http://img.shields.io/npm/v/original.svg?style=flat-square)](http://browsenpm.org/package/original)[![Build Status](http://img.shields.io/travis/unshiftio/original/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/original)[![Dependencies](https://img.shields.io/david/unshiftio/original.svg?style=flat-square)](https://david-dm.org/unshiftio/original)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/original/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/original?branch=master)[![IRC channel](http://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](http://webchat.freenode.net/?channels=unshift) + +Original generates the origin URL for a given URL or URL object. In addition to +that it also comes with a simple `same` function to check if two URL's have the +same origin. + +## Install + +This module is browserify and node compatible and is therefor release in the npm +registry and can be installed using: + +``` +npm install --save original +``` + +## Usage + +In all the examples we assume that the module is loaded using: + +```js +'use strict'; + +var origin = require('original'); +``` + +To get the origin of a given URL simply call `origin` function with any given +URL to get origin. + +```js +var o = origin('https://google.com/foo/bar?path'); + +// o = https://google.com +``` + +To compare if two URL's share the same origin you can call the `same` method. + +```js +if (origin.same('https://google.com/foo', 'https://primus.io')) { + console.log('same'); +} else { + console.log('guess what, google.com and primus.io are not the same origin'); +} +``` + +And that's it. + +## License + +MIT diff --git a/node_modules/original/index.js b/node_modules/original/index.js new file mode 100755 index 00000000..3069f46f --- /dev/null +++ b/node_modules/original/index.js @@ -0,0 +1,46 @@ +'use strict'; + +var parse = require('url-parse'); + +/** + * Transform an URL to a valid origin value. + * + * @param {String|Object} url URL to transform to it's origin. + * @returns {String} The origin. + * @api public + */ +function origin(url) { + if ('string' === typeof url) url = parse(url); + + // + // 6.2. ASCII Serialization of an Origin + // http://tools.ietf.org/html/rfc6454#section-6.2 + // + if (!url.protocol || !url.hostname) return 'null'; + + // + // 4. Origin of a URI + // http://tools.ietf.org/html/rfc6454#section-4 + // + // States that url.scheme, host should be converted to lower case. This also + // makes it easier to match origins as everything is just lower case. + // + return (url.protocol +'//'+ url.host).toLowerCase(); +} + +/** + * Check if the origins are the same. + * + * @param {String} a URL or origin of a. + * @param {String} b URL or origin of b. + * @returns {Boolean} + * @api public + */ +origin.same = function same(a, b) { + return origin(a) === origin(b); +}; + +// +// Expose the origin +// +module.exports = origin; diff --git a/node_modules/original/node_modules/url-parse/.npmignore b/node_modules/original/node_modules/url-parse/.npmignore new file mode 100755 index 00000000..63c13160 --- /dev/null +++ b/node_modules/original/node_modules/url-parse/.npmignore @@ -0,0 +1,6 @@ +node_modules +coverage +.tern-port +browserified.js +npm-debug.log +dist diff --git a/node_modules/original/node_modules/url-parse/.travis.yml b/node_modules/original/node_modules/url-parse/.travis.yml new file mode 100755 index 00000000..d958dcdb --- /dev/null +++ b/node_modules/original/node_modules/url-parse/.travis.yml @@ -0,0 +1,29 @@ +sudo: false +language: node_js +matrix: + fast_finish: true + include: + - node_js: "0.10" + env: TASK=test-node + - node_js: "0.12" + env: TASK=test-node + - node_js: "iojs" + env: TASK=test-node + - node_js: "4" + env: TASK=test-node + - node_js: "4" + env: TASK=test-browser +env: + global: + - secure: edovUXd/s/VAVXTor0CT1XcGqAtBwGgLYN1zYq0JcNiJUgWFiZ5VGKYbKVpb6nKlwm0Fdi1xmByguSa6xLZllcXjtDgfXrkI1cQYmoVncJ63JpXNG+UKyy43BwnF2OqgUrAAOt/ic1YJr9kBe+IaRwDUsMxxIkuJ6Z8c4diX0HE= + - secure: IF01oyIKSs0C5dARdYRTilKnU1TG4zenjjEPClkQxAWIpUOxl9xcNJWDVEOPxJ/4pVt+pozyT80Rp7efh6ZiREJIQI1tUboBKSqZzSbnD5uViQNSbQ90PaDP0FIUc0IQ5o07W36rijBB0DTmtU1VofzN9PKkJO7XiSSXevI8RcM= +script: + - "npm run ${TASK}" +after_script: + - 'if [ "${TASK}" == "test-node" ]; then npm i coveralls@2 && cat coverage/lcov.info | coveralls; fi' +notifications: + irc: + channels: + - "irc.freenode.org#unshift" + on_success: change + on_failure: change diff --git a/node_modules/original/node_modules/url-parse/.zuul.yml b/node_modules/original/node_modules/url-parse/.zuul.yml new file mode 100755 index 00000000..cdafdf9b --- /dev/null +++ b/node_modules/original/node_modules/url-parse/.zuul.yml @@ -0,0 +1,21 @@ +ui: mocha-bdd +browsers: + - name: android + version: [oldest, latest] + - name: chrome + version: [oldest, latest] + - name: firefox + version: [oldest, latest] + - name: ie + version: oldest..latest + - name: iphone + version: [oldest, latest] + - name: opera + version: oldest..latest + - name: safari + version: oldest..latest + - name: microsoftedge + version: oldest..latest +capabilities: + record-screenshots: false + record-video: false diff --git a/node_modules/original/node_modules/url-parse/LICENSE b/node_modules/original/node_modules/url-parse/LICENSE new file mode 100755 index 00000000..6dc9316a --- /dev/null +++ b/node_modules/original/node_modules/url-parse/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/original/node_modules/url-parse/README.md b/node_modules/original/node_modules/url-parse/README.md new file mode 100755 index 00000000..b5fdd6df --- /dev/null +++ b/node_modules/original/node_modules/url-parse/README.md @@ -0,0 +1,122 @@ +# url-parse +[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](https://img.shields.io/npm/v/url-parse.svg?style=flat-square)](http://browsenpm.org/package/url-parse)[![Build Status](https://img.shields.io/travis/unshiftio/url-parse/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/url-parse)[![Dependencies](https://img.shields.io/david/unshiftio/url-parse.svg?style=flat-square)](https://david-dm.org/unshiftio/url-parse)[![Coverage Status](https://img.shields.io/coveralls/unshiftio/url-parse/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/url-parse?branch=master)[![IRC channel](https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](https://webchat.freenode.net/?channels=unshift) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/url-parse.svg)](https://saucelabs.com/u/url-parse) + +The `url-parse` method exposes two different API interfaces. The +[`url`](https://nodejs.org/api/url.html) interface that you know from Node.js +and the new [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) +interface that is available in the latest browsers. + +Since `0.1` we've moved away from using the DOM's `` element for URL parsing +and moving to a full Regular Expression solution. The main reason for this +change is to make the URL parser available in different JavaScript environments +as you don't always have access to the DOM like `Worker` environments. This +module still have a really small foot print as this module's main intention is +to be bundled with client-side code. The only problem however with a RegExp +based solution is that it required a lot of lookups causing major problems in +FireFox. So the last and the current solution was a pure string parsing +solution which chops up the URL in smaller pieces. + +In addition to URL parsing we also expose the bundled `querystringify` module. + +## Installation + +This module is designed to be used using either browserify or node.js it's +released in the public npm registry and can be installed using: + +``` +npm install url-parse +``` + +## Usage + +All examples assume that this library is bootstrapped using: + +```js +'use strict'; + +var URL = require('url-parse'); +``` + +To parse an URL simply call the `URL` method with the URL that needs to be +transformed in to an object. + +```js +var url = new URL('https://github.com/foo/bar'); +``` + +The `new` keyword is optional but it will save you an extra function invocation. +In the example above we've demonstrated the URL interface, but as said in the +module description we also support the node.js interface. So you could also use +the library in this way: + +```js +'use strict'; + +var parse = require('url-parse') + , url = parse('https://github.com/foo/bar', true); +``` + +The returned `url` instance contains the following properties: + +- `protocol`: Requested protocol without slashes (e.g. `http:`). +- `username`: Username of basic authentication. +- `password`: Password of basic authentication. +- `auth`: Authentication information portion (e.g. `username:password`). +- `host`: Host name with port number. +- `hostname`: Host name without port number. +- `port`: Optional port number. +- `pathname`: URL path. +- `query`: Parsed object containing query string, unless parsing is set to false. +- `hash`: The "fragment" portion of the URL including the pound-sign (`#`). +- `href`: The full URL. + +### URL.set(key, value) + +A simple helper function to change parts of the URL and propagating it through +all properties. When you set a new `host` you want the same value to be applied +to `port` if has a different port number, `hostname` so it has a correct name +again and `href` so you have a complete URL. + +```js +var parsed = parse('http://google.com/parse-things'); + +parsed.set('hostname', 'yahoo.com'); +console.log(parsed.href); // http://yahoo.com/parse-things +``` + +It's aware of default ports so you cannot set a port 80 on an URL which has +`http` as protocol. + +### URL.toString() + +The returned `url` object comes with a custom `toString` method which will +generate a full URL again when called. The method accepts an extra function +which will stringify the query string for you. If you don't supply a function we +will use our default method. + +```js +var location = url.toString(); // http://example.com/whatever/?qs=32 +``` + +You would rarely need to use this method as the full URL is also available as +`href` property. If you are using the `URL.set` method to make changes, this +will automatically update. + +## Testing + +The testing of this module is done in 3 different ways: + +1. We have unit tests setup which run under Node.js using the normal `npm test` + command. +2. Code coverage can be run manually using `npm run coverage` +3. For browser testing we use `testling` to startup a test server. We do assume + that you `testling` installed globally, if not please run `npm install -g + testling` and after that `testling -u` in the root of this repository. When + you visit the outputted URL all unit tests that were written from the Node + can now be ran inside browsers. + +## License + +[MIT](LICENSE) diff --git a/node_modules/original/node_modules/url-parse/fuzzy.js b/node_modules/original/node_modules/url-parse/fuzzy.js new file mode 100755 index 00000000..c0abe3c3 --- /dev/null +++ b/node_modules/original/node_modules/url-parse/fuzzy.js @@ -0,0 +1,124 @@ +'use strict'; + +var URL = require('./') + , url = new URL(''); + +/** + * A dictionary with all kind of different options that should generate a valid + * and parse-able URL. + * + * @type {Object} + * @api private + */ +var combinations = {}; + +combinations.protocol = [ + 'http:', + 'https:', + 'ws:', + 'wss:', + 'blob:'/*, + ''*/ +]; +combinations.username = ['foo', 'bar']; +combinations.password = combinations.username; +combinations.hostname = [ + 'example.com', + 'www.example.com', + 'travel.travel', + 'sub.sub.sub.domain.nl', + 'xn--n3h.com', + 'localhost', + '127.0.0.1', + '255.255.255.255'/*, + '3ffe:6a88:85a3:08d3:1319:8a2e:0370:7344', + '2001:2353::1428:57ab', + '2001:2353:0::0:1428:57ab', + '2001:2353:0:0:0:0:1428:57ab', + '2001:2353:0000:0000:0000::1428:57ab', + '2001:2353:0000:0000:0000:0000:1428:57ab', + '2001:2353:02de::0e13', + '2001:2353:2de::e13'*/ +]; +combinations.port = ['8080', '844', '3340']; +combinations.pathname = [ + '/', + '/bar', + '/bar/', + '/foo/bar', + '/foo.bar/foo', + '/fav.ico', + '/@3rd-Eden', + '/a/b/c/d/e/f/g/j/1/d/4/' +]; +combinations.query = ['foo=bar', + 'foo[]=bar&foo[]=foo', + 'email=foo@bar.travel', + 'q=' +]; +combinations.hash = [ + 'name', + 'moo-with-longer-name', + '/what/about/slashes?querystring', + '?querystring', + '!/google/urls', + 'use:foo@', + 'http://' +]; + +/** + * Get a random item from the given array. + * + * @param {String} name Name of the array we want to have a random item returned. + * @returns {Mixed} + * @api private + */ +function get(name) { + var data = combinations[name]; + + return data[Math.floor(Math.random() * data.length)]; +} + +/** + * Return a random boolean. + * + * @returns {Boolean} + * @api private + */ +function yep() { + return !!Math.round(Math.random() * 1); +} + +/** + * Generate the actual URL. + * + * @returns {Object} specification + * @api public + */ +module.exports = function generate() { + var spec = {} + , key; + + spec.protocol = get('protocol'); + spec.hostname = get('hostname'); + spec.pathname = get('pathname'); + + if (yep()) spec.port = get('port'); + if (yep()) spec.query = '?'+ get('query'); + if (yep()) spec.hash = '#'+ get('hash'); + if (yep()) { + spec.username = get('username'); + spec.password = get('password'); + } + + for (key in combinations) { + url[key] = ''; + } + + for (key in spec) { + url[key] = spec[key]; + } + + spec.href = url.toString(); + return spec; +}; diff --git a/node_modules/original/node_modules/url-parse/index.js b/node_modules/original/node_modules/url-parse/index.js new file mode 100755 index 00000000..b7c822dc --- /dev/null +++ b/node_modules/original/node_modules/url-parse/index.js @@ -0,0 +1,228 @@ +'use strict'; + +var required = require('requires-port') + , lolcation = require('./lolcation') + , qs = require('querystringify') + , relativere = /^\/(?!\/)/; + +/** + * These are the parse instructions for the URL parsers, it informs the parser + * about: + * + * 0. The char it Needs to parse, if it's a string it should be done using + * indexOf, RegExp using exec and NaN means set as current value. + * 1. The property we should set when parsing this value. + * 2. Indication if it's backwards or forward parsing, when set as number it's + * the value of extra chars that should be split off. + * 3. Inherit from location if non existing in the parser. + * 4. `toLowerCase` the resulting value. + */ +var instructions = [ + ['#', 'hash'], // Extract from the back. + ['?', 'query'], // Extract from the back. + ['//', 'protocol', 2, 1, 1], // Extract from the front. + ['/', 'pathname'], // Extract from the back. + ['@', 'auth', 1], // Extract from the front. + [NaN, 'host', undefined, 1, 1], // Set left over value. + [/\:(\d+)$/, 'port'], // RegExp the back. + [NaN, 'hostname', undefined, 1, 1] // Set left over. +]; + +/** + * The actual URL instance. Instead of returning an object we've opted-in to + * create an actual constructor as it's much more memory efficient and + * faster and it pleases my CDO. + * + * @constructor + * @param {String} address URL we want to parse. + * @param {Boolean|function} parser Parser for the query string. + * @param {Object} location Location defaults for relative paths. + * @api public + */ +function URL(address, location, parser) { + if (!(this instanceof URL)) { + return new URL(address, location, parser); + } + + var relative = relativere.test(address) + , parse, instruction, index, key + , type = typeof location + , url = this + , i = 0; + + // + // The following if statements allows this module two have compatibility with + // 2 different API: + // + // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments + // where the boolean indicates that the query string should also be parsed. + // + // 2. The `URL` interface of the browser which accepts a URL, object as + // arguments. The supplied object will be used as default values / fall-back + // for relative paths. + // + if ('object' !== type && 'string' !== type) { + parser = location; + location = null; + } + + if (parser && 'function' !== typeof parser) { + parser = qs.parse; + } + + location = lolcation(location); + + for (; i < instructions.length; i++) { + instruction = instructions[i]; + parse = instruction[0]; + key = instruction[1]; + + if (parse !== parse) { + url[key] = address; + } else if ('string' === typeof parse) { + if (~(index = address.indexOf(parse))) { + if ('number' === typeof instruction[2]) { + url[key] = address.slice(0, index); + address = address.slice(index + instruction[2]); + } else { + url[key] = address.slice(index); + address = address.slice(0, index); + } + } + } else if (index = parse.exec(address)) { + url[key] = index[1]; + address = address.slice(0, address.length - index[0].length); + } + + url[key] = url[key] || (instruction[3] || ('port' === key && relative) ? location[key] || '' : ''); + + // + // Hostname, host and protocol should be lowercased so they can be used to + // create a proper `origin`. + // + if (instruction[4]) { + url[key] = url[key].toLowerCase(); + } + } + + // + // Also parse the supplied query string in to an object. If we're supplied + // with a custom parser as function use that instead of the default build-in + // parser. + // + if (parser) url.query = parser(url.query); + + // + // We should not add port numbers if they are already the default port number + // for a given protocol. As the host also contains the port number we're going + // override it with the hostname which contains no port number. + // + if (!required(url.port, url.protocol)) { + url.host = url.hostname; + url.port = ''; + } + + // + // Parse down the `auth` for the username and password. + // + url.username = url.password = ''; + if (url.auth) { + instruction = url.auth.split(':'); + url.username = instruction[0] || ''; + url.password = instruction[1] || ''; + } + + // + // The href is just the compiled result. + // + url.href = url.toString(); +} + +/** + * This is convenience method for changing properties in the URL instance to + * insure that they all propagate correctly. + * + * @param {String} prop Property we need to adjust. + * @param {Mixed} value The newly assigned value. + * @returns {URL} + * @api public + */ +URL.prototype.set = function set(part, value, fn) { + var url = this; + + if ('query' === part) { + if ('string' === typeof value && value.length) { + value = (fn || qs.parse)(value); + } + + url[part] = value; + } else if ('port' === part) { + url[part] = value; + + if (!required(value, url.protocol)) { + url.host = url.hostname; + url[part] = ''; + } else if (value) { + url.host = url.hostname +':'+ value; + } + } else if ('hostname' === part) { + url[part] = value; + + if (url.port) value += ':'+ url.port; + url.host = value; + } else if ('host' === part) { + url[part] = value; + + if (/\:\d+/.test(value)) { + value = value.split(':'); + url.hostname = value[0]; + url.port = value[1]; + } + } else { + url[part] = value; + } + + url.href = url.toString(); + return url; +}; + +/** + * Transform the properties back in to a valid and full URL string. + * + * @param {Function} stringify Optional query stringify function. + * @returns {String} + * @api public + */ +URL.prototype.toString = function toString(stringify) { + if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify; + + var query + , url = this + , result = url.protocol +'//'; + + if (url.username) { + result += url.username; + if (url.password) result += ':'+ url.password; + result += '@'; + } + + result += url.hostname; + if (url.port) result += ':'+ url.port; + + result += url.pathname; + + query = 'object' === typeof url.query ? stringify(url.query) : url.query; + if (query) result += '?' !== query.charAt(0) ? '?'+ query : query; + + if (url.hash) result += url.hash; + + return result; +}; + +// +// Expose the URL parser and some additional properties that might be useful for +// others. +// +URL.qs = qs; +URL.location = lolcation; +module.exports = URL; diff --git a/node_modules/original/node_modules/url-parse/lolcation.js b/node_modules/original/node_modules/url-parse/lolcation.js new file mode 100755 index 00000000..d2518569 --- /dev/null +++ b/node_modules/original/node_modules/url-parse/lolcation.js @@ -0,0 +1,45 @@ +'use strict'; + +/** + * These properties should not be copied or inherited from. This is only needed + * for all non blob URL's as the a blob URL does not include a hash, only the + * origin. + * + * @type {Object} + * @private + */ +var ignore = { hash: 1, query: 1 } + , URL; + +/** + * The location object differs when your code is loaded through a normal page, + * Worker or through a worker using a blob. And with the blobble begins the + * trouble as the location object will contain the URL of the blob, not the + * location of the page where our code is loaded in. The actual origin is + * encoded in the `pathname` so we can thankfully generate a good "default" + * location from it so we can generate proper relative URL's again. + * + * @param {Object} loc Optional default location object. + * @returns {Object} lolcation object. + * @api public + */ +module.exports = function lolcation(loc) { + loc = loc || global.location || {}; + URL = URL || require('./'); + + var finaldestination = {} + , type = typeof loc + , key; + + if ('blob:' === loc.protocol) { + finaldestination = new URL(unescape(loc.pathname), {}); + } else if ('string' === type) { + finaldestination = new URL(loc, {}); + for (key in ignore) delete finaldestination[key]; + } else if ('object' === type) for (key in loc) { + if (key in ignore) continue; + finaldestination[key] = loc[key]; + } + + return finaldestination; +}; diff --git a/node_modules/original/node_modules/url-parse/package.json b/node_modules/original/node_modules/url-parse/package.json new file mode 100755 index 00000000..17fe2222 --- /dev/null +++ b/node_modules/original/node_modules/url-parse/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + { + "raw": "url-parse@1.0.x", + "scope": null, + "escapedName": "url-parse", + "name": "url-parse", + "rawSpec": "1.0.x", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/original" + ] + ], + "_from": "url-parse@>=1.0.0 <1.1.0", + "_id": "url-parse@1.0.5", + "_inCache": true, + "_location": "/original/url-parse", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + }, + "_npmVersion": "2.14.3", + "_phantomChildren": {}, + "_requested": { + "raw": "url-parse@1.0.x", + "scope": null, + "escapedName": "url-parse", + "name": "url-parse", + "rawSpec": "1.0.x", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/original" + ], + "_resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", + "_shasum": "0854860422afdcfefeb6c965c662d4800169927b", + "_shrinkwrap": null, + "_spec": "url-parse@1.0.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/original", + "author": { + "name": "Arnout Kazemier" + }, + "bugs": { + "url": "https://github.com/unshiftio/url-parse/issues" + }, + "dependencies": { + "querystringify": "0.0.x", + "requires-port": "1.0.x" + }, + "description": "Small footprint URL parser that works seamlessly across Node.js and browser environments", + "devDependencies": { + "assume": "1.3.x", + "browserify": "12.0.x", + "istanbul": "0.4.x", + "mocha": "2.3.x", + "pre-commit": "1.1.x", + "zuul": "3.7.x" + }, + "directories": {}, + "dist": { + "shasum": "0854860422afdcfefeb6c965c662d4800169927b", + "tarball": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz" + }, + "gitHead": "7926d56fc0ee9089bc296ed19e5106dd7f0d7b3b", + "homepage": "https://github.com/unshiftio/url-parse#readme", + "keywords": [ + "URL", + "parser", + "uri", + "url", + "parse", + "query", + "string", + "querystring", + "stringify" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "unshift", + "email": "npm@unshift.io" + }, + { + "name": "v1", + "email": "info@3rd-Eden.com" + }, + { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + } + ], + "name": "url-parse", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/unshiftio/url-parse.git" + }, + "scripts": { + "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", + "browserify": "mkdir -p dist && browserify index.js -s URLParse -o dist/url-parse.js", + "coverage": "istanbul cover _mocha -- test.js", + "test": "mocha test.js", + "test-browser": "zuul -- test.js", + "test-node": "istanbul cover _mocha --report lcovonly -- test.js", + "watch": "mocha --watch test.js" + }, + "version": "1.0.5" +} diff --git a/node_modules/original/node_modules/url-parse/test.js b/node_modules/original/node_modules/url-parse/test.js new file mode 100755 index 00000000..9770025d --- /dev/null +++ b/node_modules/original/node_modules/url-parse/test.js @@ -0,0 +1,408 @@ +describe('url-parse', function () { + 'use strict'; + + var assume = require('assume') + , parse = require('./'); + + it('exposes parse as a function', function () { + assume(parse).is.a('function'); + }); + + it('exposes the querystring module', function () { + assume(parse.qs).equals(require('querystringify')); + }); + + it('exposes the location function', function () { + assume(parse.location).equals(require('./lolcation')); + }); + + it('parses the query string into an object', function () { + var url = 'http://google.com/?foo=bar' + , data = parse(url, true); + + assume(data.query).is.a('object'); + assume(data.query.foo).equals('bar'); + + url = 'http://google.com/'; + data = parse(url, true); + + assume(data.query).is.a('object'); + assume(data.query).is.empty(); + }); + + it('does not add question mark to href if query string is empty', function () { + var url = 'http://google.com/' + , data = parse(url, true); + + assume(data.href).equals(url); + }); + + it('allows a custom function as parser', function () { + var url = 'http://google.com/?foo=bar' + , data = parse(url, function () { return '1337'; }); + + assume(data.query).equals('1337'); + }); + + it('allows a custom stringify function', function () { + var url = 'http://google.com/?foo=bar' + , data = parse(url, true) + , str; + + str = data.toString(function () { return 'lolcakes'; }); + assume(str).equals('http://google.com/?lolcakes'); + }); + + it('allows a custom location object', function () { + var url = '/foo?foo=bar' + , data = parse(url, parse('http://google.com')); + + assume(data.href).equals('http://google.com/foo?foo=bar'); + }); + + it('is blob: location aware', function () { + var blob = { + 'href': 'blob:https%3A//gist.github.com/3f272586-6dac-4e29-92d0-f674f2dde618', + 'pathname': 'https%3A//gist.github.com/3f272586-6dac-4e29-92d0-f674f2dde618', + 'origin': 'https://gist.github.com', + 'protocol': 'blob:', + 'hostname': '', + 'search': '', + 'hash': '', + 'host': '', + 'port': '' + }; + + var url = '/unshiftio/url-parse' + , data = parse(url, blob); + + assume(data.href).equals('https://gist.github.com/unshiftio/url-parse'); + }); + + it('converts protocol to lowercase', function () { + var url = 'HTTP://example.com'; + + assume(parse(url).protocol).equals('http:'); + }); + + it('can parse complex urls multiple times without errors', function () { + var url = 'https://www.mozilla.org/en-US/firefox/34.0/whatsnew/?oldversion=33.1'; + + for (var i = 0; i < 100; i++) { + parse(url); + } + }); + + it('converts hostname to lowercase', function () { + var url = 'HTTP://fOo.eXaMPle.com'; + + assume(parse(url).hostname).equals('foo.example.com'); + }); + + it('does not lowercase the path', function () { + var url = 'HTTP://X.COM/Y/Z'; + + assume(parse(url).pathname).equals('/Y/Z'); + }); + + it('removes default port numbers', function () { + var url = 'http://example.com:80' + , parsed = parse(url); + + assume(parsed.port).equals(''); + assume(parsed.host).equals('example.com'); + assume(parsed.hostname).equals('example.com'); + assume(parsed.href).equals('http://example.com'); + }); + + it('understands an / as pathname', function () { + var url = 'http://example.com:80/' + , parsed = parse(url); + + assume(parsed.port).equals(''); + assume(parsed.username).equals(''); + assume(parsed.password).equals(''); + assume(parsed.pathname).equals('/'); + assume(parsed.host).equals('example.com'); + assume(parsed.hostname).equals('example.com'); + assume(parsed.href).equals('http://example.com/'); + }); + + it('does not care about spaces', function () { + var url = 'http://x.com/path?that\'s#all, folks' + , parsed = parse(url); + + assume(parsed.port).equals(''); + assume(parsed.username).equals(''); + assume(parsed.password).equals(''); + assume(parsed.pathname).equals('/path'); + assume(parsed.hash).equal('#all, folks'); + assume(parsed.query).equal('?that\'s'); + assume(parsed.host).equals('x.com'); + assume(parsed.hostname).equals('x.com'); + }); + + it('accepts + in the url', function () { + var url = 'http://x.y.com+a/b/c' + , parsed = parse(url); + + assume(parsed.protocol).equals('http:'); + assume(parsed.host).equals('x.y.com+a'); + assume(parsed.hostname).equals('x.y.com+a'); + assume(parsed.pathname).equals('/b/c'); + }); + + describe('ip', function () { + // coap:// + // + it('parses ipv6', function () { + var url = 'http://[1080:0:0:0:8:800:200C:417A]:61616/foo/bar?q=z' + , parsed = parse(url); + + assume(parsed.port).equals('61616'); + assume(parsed.query).equals('?q=z'); + assume(parsed.protocol).equals('http:'); + assume(parsed.hostname).equals('[1080:0:0:0:8:800:200c:417a]'); + assume(parsed.pathname).equals('/foo/bar'); + assume(parsed.href).equals('http://[1080:0:0:0:8:800:200c:417a]:61616/foo/bar?q=z'); + }); + + it('parses ipv6 with auth', function () { + var url = 'http://user:password@[3ffe:2a00:100:7031::1]:8080' + , parsed = parse(url); + + assume(parsed.username).equals('user'); + assume(parsed.password).equals('password'); + assume(parsed.host).equals('[3ffe:2a00:100:7031::1]:8080'); + assume(parsed.hostname).equals('[3ffe:2a00:100:7031::1]'); + assume(parsed.href).equals(url); + }); + + it('parses ipv4', function () { + var url = 'http://222.148.142.13:61616/foo/bar?q=z' + , parsed = parse(url); + + assume(parsed.port).equals('61616'); + assume(parsed.query).equals('?q=z'); + assume(parsed.protocol).equals('http:'); + assume(parsed.hostname).equals('222.148.142.13'); + assume(parsed.pathname).equals('/foo/bar'); + assume(parsed.href).equals(url); + }); + }); + + describe('auth', function () { + it('does not lowercase the USER:PASS', function () { + var url = 'HTTP://USER:PASS@EXAMPLE.COM' + , parsed = parse(url); + + assume(parsed.username).equals('USER'); + assume(parsed.password).equals('PASS'); + assume(parsed.protocol).equals('http:'); + assume(parsed.host).equals('example.com'); + assume(parsed.hostname).equals('example.com'); + }); + + it('accepts @ in pathnames', function () { + var url = 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' + , parsed = parse(url); + + assume(parsed.pathname).equals('/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s='); + assume(parsed.username).equals(''); + assume(parsed.password).equals(''); + }); + + it('does not require passwords for auth', function () { + var url = 'http://user@www.example.com/' + , parsed = parse(url); + + assume(parsed.password).equals(''); + assume(parsed.pathname).equals('/'); + assume(parsed.username).equals('user'); + assume(parsed.protocol).equals('http:'); + assume(parsed.hostname).equals('www.example.com'); + assume(parsed.href).equals(url); + }); + }); + + it('accepts multiple ???', function () { + var url = 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s='; + assume(parse(url).query).equals('???&hl=en&src=api&x=2&y=2&z=3&s='); + }); + + it('accepts a string as source argument', function () { + var data = parse('/foo', 'http://sub.example.com/bar?foo=bar#hash'); + + assume(data.port).equals(''); + assume(data.host).equals('sub.example.com'); + assume(data.href).equals('http://sub.example.com/foo'); + }); + + describe('inheritance', function () { + it('does not inherit port numbers for non relative urls', function () { + var data = parse('http://localhost', parse('http://sub.example.com:808/')); + + assume(data.port).equals(''); + assume(data.host).equals('localhost'); + assume(data.href).equals('http://localhost'); + }); + + it('does inherit port numbers from relative urls', function () { + var data = parse('/foo', parse('http://sub.example.com:808/')); + + assume(data.port).equals('808'); + assume(data.hostname).equals('sub.example.com'); + assume(data.host).equals('sub.example.com:808'); + assume(data.href).equals('http://sub.example.com:808/foo'); + }); + + it('inherits protocol for relative protocols', function () { + var data = parse('//foo.com/foo', parse('http://sub.example.com:808/')); + + assume(data.port).equals(''); + assume(data.host).equals('foo.com'); + assume(data.protocol).equals('http:'); + assume(data.href).equals('http://foo.com/foo'); + }); + + it('does not inherit pathnames from the source', function () { + var data = parse('http://localhost', parse('http://foo:bar@sub.example.com/bar?foo=bar#hash')); + + assume(data.port).equals(''); + assume(data.host).equals('localhost'); + assume(data.href).equals('http://localhost'); + }); + + it('does not inherit hashes and query strings from source object', function () { + var data = parse('/foo', parse('http://sub.example.com/bar?foo=bar#hash')); + + assume(data.port).equals(''); + assume(data.host).equals('sub.example.com'); + assume(data.href).equals('http://sub.example.com/foo'); + }); + + it('does not inherit auth from source object', function () { + var from = parse('http://foo:bar@sub.example.com') + , data = parse('/foo', from); + + assume(data.port).equals(''); + assume(data.username).equals(''); + assume(data.password).equals(''); + assume(data.host).equals('sub.example.com'); + assume(data.href).equals('http://sub.example.com/foo'); + }); + }); + + describe('#set', function () { + it('correctly updates the host when setting port', function () { + var data = parse('http://google.com/foo'); + + assume(data.set('port', 8080)).equals(data); + + assume(data.host).equals('google.com:8080'); + assume(data.href).equals('http://google.com:8080/foo'); + }); + + it('removes querystring and hash', function () { + var data = parse('https://thisanurl.com/?swag=yolo#representing'); + + data.set('query', ''); + data.set('hash', ''); + + assume(data.href).equals('https://thisanurl.com/'); + }); + + it('only sets port when its not default', function () { + var data = parse('http://google.com/foo'); + + assume(data.set('port', 80)).equals(data); + + assume(data.host).equals('google.com'); + assume(data.href).equals('http://google.com/foo'); + + assume(data.set('port', 443)).equals(data); + assume(data.host).equals('google.com:443'); + assume(data.href).equals('http://google.com:443/foo'); + }); + + it('updates query with object', function () { + var data = parse('http://google.com/?foo=bar'); + + assume(data.set('query', { bar: 'foo' })).equals(data); + + assume(data.query.foo).equals(undefined); + assume(data.query.bar).equals('foo'); + + assume(data.href).equals('http://google.com/?bar=foo'); + }); + + it('updates query with a string', function () { + var data = parse('http://google.com/?foo=bar'); + + assume(data.set('query', 'bar=foo')).equals(data); + + assume(data.query.foo).equals(undefined); + assume(data.query.bar).equals('foo'); + + assume(data.href).equals('http://google.com/?bar=foo'); + + assume(data.set('query', '?baz=foo')).equals(data); + + assume(data.query.bar).equals(undefined); + assume(data.query.baz).equals('foo'); + + assume(data.href).equals('http://google.com/?baz=foo'); + }); + + it('updates the port when updating host', function () { + var data = parse('http://google.com/?foo=bar'); + + assume(data.set('host', 'yahoo.com:808')).equals(data); + + assume(data.hostname).equals('yahoo.com'); + assume(data.host).equals('yahoo.com:808'); + assume(data.port).equals('808'); + + assume(data.href).equals('http://yahoo.com:808/?foo=bar'); + }); + + it('updates the host when updating hostname', function () { + var data = parse('http://google.com:808/?foo=bar'); + + assume(data.set('hostname', 'yahoo.com')).equals(data); + + assume(data.hostname).equals('yahoo.com'); + assume(data.host).equals('yahoo.com:808'); + assume(data.port).equals('808'); + + assume(data.href).equals('http://yahoo.com:808/?foo=bar'); + }); + + it('updates other values', function () { + var data = parse('http://google.com/?foo=bar'); + + assume(data.set('protocol', 'https:')).equals(data); + assume(data.protocol).equals('https:'); + + assume(data.href).equals('https://google.com/?foo=bar'); + }); + }); + + describe('fuzzy', function () { + var fuzz = require('./fuzzy') + , times = 10; + + for (var i = 0; i < times; i++) { + (function (spec) { + it('parses: '+ spec.href, function () { + var url = parse(spec.href) + , prop; + + for (prop in spec) { + assume(url[prop]).equals(spec[prop]); + } + }); + })(fuzz()); + } + }); +}); diff --git a/node_modules/original/package.json b/node_modules/original/package.json new file mode 100755 index 00000000..6dbee473 --- /dev/null +++ b/node_modules/original/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "original@>=0.0.5", + "scope": null, + "escapedName": "original", + "name": "original", + "rawSpec": ">=0.0.5", + "spec": ">=0.0.5", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/eventsource" + ] + ], + "_from": "original@>=0.0.5", + "_id": "original@1.0.0", + "_inCache": true, + "_location": "/original", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + }, + "_npmVersion": "2.14.3", + "_phantomChildren": { + "querystringify": "0.0.4", + "requires-port": "1.0.0" + }, + "_requested": { + "raw": "original@>=0.0.5", + "scope": null, + "escapedName": "original", + "name": "original", + "rawSpec": ">=0.0.5", + "spec": ">=0.0.5", + "type": "range" + }, + "_requiredBy": [ + "/eventsource" + ], + "_resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", + "_shasum": "9147f93fa1696d04be61e01bd50baeaca656bd3b", + "_shrinkwrap": null, + "_spec": "original@>=0.0.5", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/eventsource", + "author": { + "name": "Arnout Kazemier" + }, + "bugs": { + "url": "https://github.com/unshiftio/original/issues" + }, + "dependencies": { + "url-parse": "1.0.x" + }, + "description": "Generate the origin from an URL or check if two URL/Origins are the same", + "devDependencies": { + "assume": "1.3.x", + "istanbul": "0.4.x", + "mocha": "2.3.x", + "pre-commit": "1.1.x" + }, + "directories": {}, + "dist": { + "shasum": "9147f93fa1696d04be61e01bd50baeaca656bd3b", + "tarball": "https://registry.npmjs.org/original/-/original-1.0.0.tgz" + }, + "gitHead": "ee5fb8a2bad22c67a64337897e0505d94cb23b6b", + "homepage": "https://github.com/unshiftio/original#readme", + "keywords": [ + "origin", + "url", + "parse" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "unshift", + "email": "npm@unshift.io" + }, + { + "name": "v1", + "email": "info@3rd-Eden.com" + }, + { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + } + ], + "name": "original", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/unshiftio/original.git" + }, + "scripts": { + "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", + "coverage": "istanbul cover _mocha -- test.js", + "test": "mocha test.js", + "test-travis": "istanbul cover _mocha --report lcovonly -- test.js", + "watch": "mocha --watch test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/original/test.js b/node_modules/original/test.js new file mode 100755 index 00000000..6f7c350e --- /dev/null +++ b/node_modules/original/test.js @@ -0,0 +1,92 @@ +describe('original', function () { + 'use strict'; + + var parse = require('url-parse') + , assume = require('assume') + , origin = require('./') + , same = origin.same; + + it('is exposed as a function', function () { + assume(origin).is.a('function'); + }); + + it('also accepts objects instead of strings', function () { + var o = origin(parse('http://google.com:80/pathname')); + assume(o).equals('http://google.com'); + }); + + it('also accepts origins as origin', function () { + var o = origin('http://google.com:80/pathname'); + + assume(origin(o)).equals(o); + }); + + it('lowercases the origin', function () { + var o = origin('hTtp://WwW.ExAMPLE.cOM:8080'); + + assume(o).equals('http://www.example.com:8080'); + + o = origin('https://www.EXAMPLE.com:8080'); + assume(o).equals('https://www.example.com:8080'); + + o = origin('HTTPS://WWW.example.COM:8080'); + assume(o).equals('https://www.example.com:8080'); + }); + + it('returns "null" if the protocol is not specified', function () { + var o = origin('www.example.com'); + + assume(o).equals('null'); + }); + + it('returns "null" if the hostname is not specified', function () { + var o = origin('http://'); + + assume(o).equals('null'); + }); + + it('removes default ports for http', function () { + var o = origin('http://google.com:80/pathname'); + assume(o).equals('http://google.com'); + + o = origin('http://google.com:80'); + assume(o).equals('http://google.com'); + + o = origin('http://google.com'); + assume(o).equals('http://google.com'); + + o = origin('https://google.com:443/pathname'); + assume(o).equals('https://google.com'); + + o = origin('http://google.com:443/pathname'); + assume(o).equals('http://google.com:443'); + + o = origin('https://google.com:80/pathname'); + assume(o).equals('https://google.com:80'); + + o = origin('file://google.com/pathname'); + assume(o).equals('file://google.com'); + }); + + it('removes default ports for ws', function () { + var o = origin('ws://google.com:80/pathname'); + assume(o).equals('ws://google.com'); + + o = origin('wss://google.com:443/pathname'); + assume(o).equals('wss://google.com'); + + o = origin('ws://google.com:443/pathname'); + assume(o).equals('ws://google.com:443'); + + o = origin('wss://google.com:80/pathname'); + assume(o).equals('wss://google.com:80'); + }); + + describe('.same', function () { + assume(origin.same).is.a('function'); + + it('equals', function () { + assume(same('http://google.com', 'http://google.com:80')).is.true(); + }); + }); +}); diff --git a/node_modules/os-browserify/.npmignore b/node_modules/os-browserify/.npmignore new file mode 100755 index 00000000..f356293e --- /dev/null +++ b/node_modules/os-browserify/.npmignore @@ -0,0 +1,14 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log diff --git a/node_modules/os-browserify/LICENSE b/node_modules/os-browserify/LICENSE new file mode 100755 index 00000000..7f3d479d --- /dev/null +++ b/node_modules/os-browserify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 CoderPuppy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/os-browserify/README.md b/node_modules/os-browserify/README.md new file mode 100755 index 00000000..4dd7d6eb --- /dev/null +++ b/node_modules/os-browserify/README.md @@ -0,0 +1,5 @@ +# os-browserify + +The [os](https://nodejs.org/api/os.html) module from node.js, but for browsers. + +When you `require('os')` in [browserify](http://github.com/substack/node-browserify), this module will be loaded. diff --git a/node_modules/os-browserify/browser.js b/node_modules/os-browserify/browser.js new file mode 100755 index 00000000..6a1ecb07 --- /dev/null +++ b/node_modules/os-browserify/browser.js @@ -0,0 +1,45 @@ +exports.endianness = function () { return 'LE' }; + +exports.hostname = function () { + if (typeof location !== 'undefined') { + return location.hostname + } + else return ''; +}; + +exports.loadavg = function () { return [] }; + +exports.uptime = function () { return 0 }; + +exports.freemem = function () { + return Number.MAX_VALUE; +}; + +exports.totalmem = function () { + return Number.MAX_VALUE; +}; + +exports.cpus = function () { return [] }; + +exports.type = function () { return 'Browser' }; + +exports.release = function () { + if (typeof navigator !== 'undefined') { + return navigator.appVersion; + } + return ''; +}; + +exports.networkInterfaces += exports.getNetworkInterfaces += function () { return {} }; + +exports.arch = function () { return 'javascript' }; + +exports.platform = function () { return 'browser' }; + +exports.tmpdir = exports.tmpDir = function () { + return '/tmp'; +}; + +exports.EOL = '\n'; diff --git a/node_modules/os-browserify/main.js b/node_modules/os-browserify/main.js new file mode 100755 index 00000000..5910697d --- /dev/null +++ b/node_modules/os-browserify/main.js @@ -0,0 +1 @@ +module.exports = require('os'); diff --git a/node_modules/os-browserify/package.json b/node_modules/os-browserify/package.json new file mode 100755 index 00000000..cef2d966 --- /dev/null +++ b/node_modules/os-browserify/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + { + "raw": "os-browserify@^0.2.0", + "scope": null, + "escapedName": "os-browserify", + "name": "os-browserify", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "os-browserify@>=0.2.0 <0.3.0", + "_id": "os-browserify@0.2.1", + "_inCache": true, + "_location": "/os-browserify", + "_nodeVersion": "5.9.1", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/os-browserify-0.2.1.tgz_1459319484624_0.4566183206625283" + }, + "_npmUser": { + "name": "drewyoung1", + "email": "coderpup@gmail.com" + }, + "_npmVersion": "3.7.3", + "_phantomChildren": {}, + "_requested": { + "raw": "os-browserify@^0.2.0", + "scope": null, + "escapedName": "os-browserify", + "name": "os-browserify", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", + "_shasum": "63fc4ccee5d2d7763d26bbf8601078e6c2e0044f", + "_shrinkwrap": null, + "_spec": "os-browserify@^0.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "CoderPuppy", + "email": "coderpup@gmail.com" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/CoderPuppy/os-browserify/issues" + }, + "dependencies": {}, + "description": "The [os](https://nodejs.org/api/os.html) module from node.js, but for browsers.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "63fc4ccee5d2d7763d26bbf8601078e6c2e0044f", + "tarball": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz" + }, + "gitHead": "af8f17481c8097e679ea24700c6bf18d497ba3a1", + "homepage": "https://github.com/CoderPuppy/os-browserify#readme", + "jspm": { + "map": { + "./main.js": { + "node": "@node/os", + "browser": "./browser.js" + } + } + }, + "license": "MIT", + "main": "main.js", + "maintainers": [ + { + "name": "coderpuppy", + "email": "coderpup@gmail.com" + }, + { + "name": "drewyoung1", + "email": "coderpup@gmail.com" + } + ], + "name": "os-browserify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/CoderPuppy/os-browserify.git" + }, + "scripts": {}, + "version": "0.2.1" +} diff --git a/node_modules/os-homedir/index.js b/node_modules/os-homedir/index.js new file mode 100755 index 00000000..33066166 --- /dev/null +++ b/node_modules/os-homedir/index.js @@ -0,0 +1,24 @@ +'use strict'; +var os = require('os'); + +function homedir() { + var env = process.env; + var home = env.HOME; + var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; + + if (process.platform === 'win32') { + return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; + } + + if (process.platform === 'darwin') { + return home || (user ? '/Users/' + user : null); + } + + if (process.platform === 'linux') { + return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); + } + + return home || null; +} + +module.exports = typeof os.homedir === 'function' ? os.homedir : homedir; diff --git a/node_modules/os-homedir/license b/node_modules/os-homedir/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/os-homedir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/os-homedir/package.json b/node_modules/os-homedir/package.json new file mode 100755 index 00000000..5188fc56 --- /dev/null +++ b/node_modules/os-homedir/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "os-homedir@^1.0.0", + "scope": null, + "escapedName": "os-homedir", + "name": "os-homedir", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/home-or-tmp" + ] + ], + "_from": "os-homedir@>=1.0.0 <2.0.0", + "_id": "os-homedir@1.0.2", + "_inCache": true, + "_location": "/os-homedir", + "_nodeVersion": "6.6.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/os-homedir-1.0.2.tgz_1475211519628_0.7873868853785098" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "os-homedir@^1.0.0", + "scope": null, + "escapedName": "os-homedir", + "name": "os-homedir", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/home-or-tmp" + ], + "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "_shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3", + "_shrinkwrap": null, + "_spec": "os-homedir@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/home-or-tmp", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/os-homedir/issues" + }, + "dependencies": {}, + "description": "Node.js 4 `os.homedir()` ponyfill", + "devDependencies": { + "ava": "*", + "path-exists": "^2.0.0", + "xo": "^0.16.0" + }, + "directories": {}, + "dist": { + "shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3", + "tarball": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "b1b0ae70a5965fef7005ff6509a5dd1a78c95e36", + "homepage": "https://github.com/sindresorhus/os-homedir#readme", + "keywords": [ + "builtin", + "core", + "ponyfill", + "polyfill", + "shim", + "os", + "homedir", + "home", + "dir", + "directory", + "folder", + "user", + "path" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "os-homedir", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/os-homedir.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/node_modules/os-homedir/readme.md b/node_modules/os-homedir/readme.md new file mode 100755 index 00000000..856ae615 --- /dev/null +++ b/node_modules/os-homedir/readme.md @@ -0,0 +1,31 @@ +# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir) + +> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save os-homedir +``` + + +## Usage + +```js +const osHomedir = require('os-homedir'); + +console.log(osHomedir()); +//=> '/Users/sindresorhus' +``` + + +## Related + +- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result +- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/os-tmpdir/index.js b/node_modules/os-tmpdir/index.js new file mode 100755 index 00000000..2077b1ce --- /dev/null +++ b/node_modules/os-tmpdir/index.js @@ -0,0 +1,25 @@ +'use strict'; +var isWindows = process.platform === 'win32'; +var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; + +// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 +module.exports = function () { + var path; + + if (isWindows) { + path = process.env.TEMP || + process.env.TMP || + (process.env.SystemRoot || process.env.windir) + '\\temp'; + } else { + path = process.env.TMPDIR || + process.env.TMP || + process.env.TEMP || + '/tmp'; + } + + if (trailingSlashRe.test(path)) { + path = path.slice(0, -1); + } + + return path; +}; diff --git a/node_modules/os-tmpdir/license b/node_modules/os-tmpdir/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/os-tmpdir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/os-tmpdir/package.json b/node_modules/os-tmpdir/package.json new file mode 100755 index 00000000..24d0675c --- /dev/null +++ b/node_modules/os-tmpdir/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "os-tmpdir@^1.0.1", + "scope": null, + "escapedName": "os-tmpdir", + "name": "os-tmpdir", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/home-or-tmp" + ] + ], + "_from": "os-tmpdir@>=1.0.1 <2.0.0", + "_id": "os-tmpdir@1.0.2", + "_inCache": true, + "_location": "/os-tmpdir", + "_nodeVersion": "6.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/os-tmpdir-1.0.2.tgz_1475211274587_0.14931037812493742" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "os-tmpdir@^1.0.1", + "scope": null, + "escapedName": "os-tmpdir", + "name": "os-tmpdir", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/home-or-tmp" + ], + "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", + "_shrinkwrap": null, + "_spec": "os-tmpdir@^1.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/home-or-tmp", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/os-tmpdir/issues" + }, + "dependencies": {}, + "description": "Node.js os.tmpdir() ponyfill", + "devDependencies": { + "ava": "*", + "xo": "^0.16.0" + }, + "directories": {}, + "dist": { + "shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", + "tarball": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "1abf9cf5611b4be7377060ea67054b45cbf6813c", + "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", + "keywords": [ + "built-in", + "core", + "ponyfill", + "polyfill", + "shim", + "os", + "tmpdir", + "tempdir", + "tmp", + "temp", + "dir", + "directory", + "env", + "environment" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "os-tmpdir", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/os-tmpdir.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/node_modules/os-tmpdir/readme.md b/node_modules/os-tmpdir/readme.md new file mode 100755 index 00000000..c09f7ed8 --- /dev/null +++ b/node_modules/os-tmpdir/readme.md @@ -0,0 +1,32 @@ +# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir) + +> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com) + +Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8). + + +## Install + +``` +$ npm install --save os-tmpdir +``` + + +## Usage + +```js +const osTmpdir = require('os-tmpdir'); + +osTmpdir(); +//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T' +``` + + +## API + +See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir). + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/pako/CHANGELOG.md b/node_modules/pako/CHANGELOG.md new file mode 100755 index 00000000..f9859227 --- /dev/null +++ b/node_modules/pako/CHANGELOG.md @@ -0,0 +1,90 @@ +1.0.2 / 2016-07-21 +------------------ + +- Fixed nasty bug in deflate (wrong `d_buf` offset), which could cause + broken data in some rare cases. +- Also released as 0.2.9 to give chance to old dependents, not updated to 1.x + version. + + +1.0.1 / 2016-04-01 +------------------ + +- Added dictionary support. Thanks to @dignifiedquire. + + +1.0.0 / 2016-02-17 +------------------ + +- Maintenance release (semver, coding style). + + +0.2.8 / 2015-09-14 +------------------ + +- Fixed regression after 0.2.4 for edge conditions in inflate wrapper (#65). + Added more tests to cover possible cases. + + +0.2.7 / 2015-06-09 +------------------ + +- Added Z_SYNC_FLUSH support. Thanks to @TinoLange. + + +0.2.6 / 2015-03-24 +------------------ + +- Allow ArrayBuffer input. + + +0.2.5 / 2014-07-19 +------------------ + +- Workaround for Chrome 38.0.2096.0 script parser bug, #30. + + +0.2.4 / 2014-07-07 +------------------ + +- Fixed bug in inflate wrapper, #29 + + +0.2.3 / 2014-06-09 +------------------ + +- Maintenance release, dependencies update. + + +0.2.2 / 2014-06-04 +------------------ + +- Fixed iOS 5.1 Safary issue with `apply(typed_array)`, #26. + + +0.2.1 / 2014-05-01 +------------------ + +- Fixed collision on switch dynamic/fixed tables. + + +0.2.0 / 2014-04-18 +------------------ + +- Added custom gzip headers support. +- Added strings support. +- Improved memory allocations for small chunks. +- ZStream properties rename/cleanup. +- More coverage tests. + + +0.1.1 / 2014-03-20 +------------------ + +- Bugfixes for inflate/deflate. + + +0.1.0 / 2014-03-15 +------------------ + +- First release. diff --git a/node_modules/pako/LICENSE b/node_modules/pako/LICENSE new file mode 100755 index 00000000..d082ae32 --- /dev/null +++ b/node_modules/pako/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2014-2016 by Vitaly Puzrin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pako/README.md b/node_modules/pako/README.md new file mode 100755 index 00000000..ef121e78 --- /dev/null +++ b/node_modules/pako/README.md @@ -0,0 +1,176 @@ +pako - zlib port to javascript, very fast! +========================================== + +[![Build Status](https://travis-ci.org/nodeca/pako.svg?branch=master)](https://travis-ci.org/nodeca/pako) +[![NPM version](https://img.shields.io/npm/v/pako.svg)](https://www.npmjs.org/package/pako) + +__Why pako is cool:__ + +- Almost as fast in modern JS engines as C implementation (see benchmarks). +- Works in browsers, you can browserify any separate component. +- Chunking support for big blobs. +- Results are binary equal to well known [zlib](http://www.zlib.net/) (now v1.2.8 ported). + +This project was done to understand how fast JS can be and is it necessary to +develop native C modules for CPU-intensive tasks. Enjoy the result! + + +__Famous projects, using pako:__ + +- [browserify](http://browserify.org/) (via [browserify-zlib](https://github.com/devongovett/browserify-zlib)) +- [JSZip](http://stuk.github.io/jszip/) +- [mincer](https://github.com/nodeca/mincer) +- [JS-Git](https://github.com/creationix/js-git) and + [Tedit](https://chrome.google.com/webstore/detail/tedit-development-environ/ooekdijbnbbjdfjocaiflnjgoohnblgf) + by [@creatronix](https://github.com/creationix) + + +__Benchmarks:__ + +``` +node v0.10.26, 1mb sample: + + deflate-dankogai x 4.73 ops/sec ±0.82% (15 runs sampled) + deflate-gildas x 4.58 ops/sec ±2.33% (15 runs sampled) + deflate-imaya x 3.22 ops/sec ±3.95% (12 runs sampled) + ! deflate-pako x 6.99 ops/sec ±0.51% (21 runs sampled) + deflate-pako-string x 5.89 ops/sec ±0.77% (18 runs sampled) + deflate-pako-untyped x 4.39 ops/sec ±1.58% (14 runs sampled) + * deflate-zlib x 14.71 ops/sec ±4.23% (59 runs sampled) + inflate-dankogai x 32.16 ops/sec ±0.13% (56 runs sampled) + inflate-imaya x 30.35 ops/sec ±0.92% (53 runs sampled) + ! inflate-pako x 69.89 ops/sec ±1.46% (71 runs sampled) + inflate-pako-string x 19.22 ops/sec ±1.86% (49 runs sampled) + inflate-pako-untyped x 17.19 ops/sec ±0.85% (32 runs sampled) + * inflate-zlib x 70.03 ops/sec ±1.64% (81 runs sampled) + +node v0.11.12, 1mb sample: + + deflate-dankogai x 5.60 ops/sec ±0.49% (17 runs sampled) + deflate-gildas x 5.06 ops/sec ±6.00% (16 runs sampled) + deflate-imaya x 3.52 ops/sec ±3.71% (13 runs sampled) + ! deflate-pako x 11.52 ops/sec ±0.22% (32 runs sampled) + deflate-pako-string x 9.53 ops/sec ±1.12% (27 runs sampled) + deflate-pako-untyped x 5.44 ops/sec ±0.72% (17 runs sampled) + * deflate-zlib x 14.05 ops/sec ±3.34% (63 runs sampled) + inflate-dankogai x 42.19 ops/sec ±0.09% (56 runs sampled) + inflate-imaya x 79.68 ops/sec ±1.07% (68 runs sampled) + ! inflate-pako x 97.52 ops/sec ±0.83% (80 runs sampled) + inflate-pako-string x 45.19 ops/sec ±1.69% (57 runs sampled) + inflate-pako-untyped x 24.35 ops/sec ±2.59% (40 runs sampled) + * inflate-zlib x 60.32 ops/sec ±1.36% (69 runs sampled) +``` + +zlib's test is partialy afferted by marshling (that make sense for inflate only). +You can change deflate level to 0 in benchmark source, to investigate details. +For deflate level 6 results can be considered as correct. + +__Install:__ + +node.js: + +``` +npm install pako +``` + +browser: + +``` +bower install pako +``` + + +Example & API +------------- + +Full docs - http://nodeca.github.io/pako/ + +```javascript +var pako = require('pako'); + +// Deflate +// +var input = new Uint8Array(); +//... fill input data here +var output = pako.deflate(input); + +// Inflate (simple wrapper can throw exception on broken stream) +// +var compressed = new Uint8Array(); +//... fill data to uncompress here +try { + var result = pako.inflate(compressed); +} catch (err) { + console.log(err); +} + +// +// Alternate interface for chunking & without exceptions +// + +var inflator = new pako.Inflate(); + +inflator.push(chunk1, false); +inflator.push(chunk2, false); +... +inflator.push(chunkN, true); // true -> last chunk + +if (inflator.err) { + console.log(inflator.msg); +} + +var output = inflator.result; + +``` + +Sometime you can wish to work with strings. For example, to send +big objects as json to server. Pako detects input data type. You can +force output to be string with option `{ to: 'string' }`. + +```javascript +var pako = require('pako'); + +var test = { my: 'super', puper: [456, 567], awesome: 'pako' }; + +var binaryString = pako.deflate(JSON.stringify(test), { to: 'string' }); + +// +// Here you can do base64 encode, make xhr requests and so on. +// + +var restored = JSON.parse(pako.inflate(binaryString, { to: 'string' })); +``` + + +Notes +----- + +Pako does not contain some specific zlib functions: + +- __deflate__ - methods `deflateCopy`, `deflateBound`, `deflateParams`, + `deflatePending`, `deflatePrime`, `deflateTune`. +- __inflate__ - methods `inflateCopy`, `inflateMark`, + `inflatePrime`, `inflateGetDictionary`, `inflateSync`, `inflateSyncPoint`, `inflateUndermine`. +- High level inflate/deflate wrappers (classes) may not support some flush + modes. Those should work: Z_NO_FLUSH, Z_FINISH, Z_SYNC_FLUSH. + + +Authors +------- + +- Andrey Tupitsin [@anrd83](https://github.com/andr83) +- Vitaly Puzrin [@puzrin](https://github.com/puzrin) + +Personal thanks to: + +- Vyacheslav Egorov ([@mraleph](https://github.com/mraleph)) for his awesome + tutorials about optimising JS code for v8, [IRHydra](http://mrale.ph/irhydra/) + tool and his advices. +- David Duponchel ([@dduponchel](https://github.com/dduponchel)) for help with + testing. + + +License +------- + +MIT diff --git a/node_modules/pako/dist/pako.js b/node_modules/pako/dist/pako.js new file mode 100755 index 00000000..6d6db944 --- /dev/null +++ b/node_modules/pako/dist/pako.js @@ -0,0 +1,6606 @@ +/* pako 0.2.9 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Array + * + * Chunks of output data, if [[Deflate#onData]] not overriden. + **/ + +/** + * Deflate.result -> Uint8Array|Array + * + * Compressed result, generated by default [[Deflate#onData]] + * and [[Deflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Deflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Deflate.err -> Number + * + * Error code after deflate finished. 0 (Z_OK) on success. + * You will not need it in real life, because deflate errors + * are possible only on wrong options or bad `onData` / `onEnd` + * custom handlers. + **/ + +/** + * Deflate.msg -> String + * + * Error message, if [[Deflate.err]] != 0 + **/ + + +/** + * new Deflate(options) + * - options (Object): zlib deflate options. + * + * Creates new deflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `level` + * - `windowBits` + * - `memLevel` + * - `strategy` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw deflate + * - `gzip` (Boolean) - create gzip wrapper + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * - `header` (Object) - custom header for gzip + * - `text` (Boolean) - true if compressed data believed to be text + * - `time` (Number) - modification time, unix timestamp + * - `os` (Number) - operation system code + * - `extra` (Array) - array of bytes with extra data (max 65536) + * - `name` (String) - file name (binary string) + * - `comment` (String) - comment (binary string) + * - `hcrc` (Boolean) - true if header crc should be added + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var deflate = new pako.Deflate({ level: 3}); + * + * deflate.push(chunk1, false); + * deflate.push(chunk2, true); // true -> last chunk + * + * if (deflate.err) { throw new Error(deflate.err); } + * + * console.log(deflate.result); + * ``` + **/ +function Deflate(options) { + if (!(this instanceof Deflate)) return new Deflate(options); + + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: '' + }, options || {}); + + var opt = this.options; + + if (opt.raw && (opt.windowBits > 0)) { + opt.windowBits = -opt.windowBits; + } + + else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { + opt.windowBits += 16; + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_deflate.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + + if (opt.dictionary) { + var dict; + // Convert data if needed + if (typeof opt.dictionary === 'string') { + // If we need to compress text, change encoding to utf8. + dict = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + + status = zlib_deflate.deflateSetDictionary(this.strm, dict); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + this._dict_set = true; + } +} + +/** + * Deflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be + * converted to utf8 byte sequence. + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with + * new compressed chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the compression context. + * + * On fail call [[Deflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * array format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Deflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + + if (this.ended) { return false; } + + _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // If we need to compress text, change encoding to utf8. + strm.input = strings.string2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ + + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { + if (this.options.to === 'string') { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + + // Finalize on the last chunk. + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === Z_SYNC_FLUSH) { + this.onEnd(Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Deflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Deflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Deflate#onEnd(status) -> Void + * - status (Number): deflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell deflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Deflate.prototype.onEnd = function (status) { + // On success - join + if (status === Z_OK) { + if (this.options.to === 'string') { + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * deflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * Compress `data` with deflate algorithm and `options`. + * + * Supported options are: + * + * - level + * - windowBits + * - memLevel + * - strategy + * - dictionary + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); + * + * console.log(pako.deflate(data)); + * ``` + **/ +function deflate(input, options) { + var deflator = new Deflate(options); + + deflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (deflator.err) { throw deflator.msg; } + + return deflator.result; +} + + +/** + * deflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); +} + + +/** + * gzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but create gzip wrapper instead of + * deflate one. + **/ +function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); +} + + +exports.Deflate = Deflate; +exports.deflate = deflate; +exports.deflateRaw = deflateRaw; +exports.gzip = gzip; + +},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(require,module,exports){ +'use strict'; + + +var zlib_inflate = require('./zlib/inflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var c = require('./zlib/constants'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); +var GZheader = require('./zlib/gzheader'); + +var toString = Object.prototype.toString; + +/** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + +/* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overriden. + **/ + +/** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Inflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + +/** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + +/** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ +function Inflate(options) { + if (!(this instanceof Inflate)) return new Inflate(options); + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new GZheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); +} + +/** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the decompression context. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Inflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status, _mode; + var next_out_utf8, tail, utf8str; + var dict; + + // Flag to properly process Z_BUF_ERROR on testing inflate call + // when we check that all output data was flushed. + var allowBufError = false; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status === c.Z_NEED_DICT && dictionary) { + // Convert data if needed + if (typeof dictionary === 'string') { + dict = strings.string2buf(dictionary); + } else if (toString.call(dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(dictionary); + } else { + dict = dictionary; + } + + status = zlib_inflate.inflateSetDictionary(this.strm, dict); + + } + + if (status === c.Z_BUF_ERROR && allowBufError === true) { + status = c.Z_OK; + allowBufError = false; + } + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + + // When no more input data, we should check that internal inflate buffers + // are flushed. The only way to do it when avail_out = 0 - run one more + // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. + // Here we set flag to process this error properly. + // + // NOTE. Deflate does not return error in this case and does not needs such + // logic. + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Inflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called either after you tell inflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Inflate.prototype.onEnd = function (status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 alligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ +function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg; } + + return inflator.result; +} + + +/** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); +} + + +/** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + +exports.Inflate = Inflate; +exports.inflate = inflate; +exports.inflateRaw = inflateRaw; +exports.ungzip = inflate; + +},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(require,module,exports){ +'use strict'; + + +var TYPED_OK = (typeof Uint8Array !== 'undefined') && + (typeof Uint16Array !== 'undefined') && + (typeof Int32Array !== 'undefined'); + + +exports.assign = function (obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { continue; } + + if (typeof source !== 'object') { + throw new TypeError(source + 'must be non-object'); + } + + for (var p in source) { + if (source.hasOwnProperty(p)) { + obj[p] = source[p]; + } + } + } + + return obj; +}; + + +// reduce buffer size, avoiding mem copy +exports.shrinkBuf = function (buf, size) { + if (buf.length === size) { return buf; } + if (buf.subarray) { return buf.subarray(0, size); } + buf.length = size; + return buf; +}; + + +var fnTyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + // Fallback to ordinary array + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + var i, l, len, pos, chunk, result; + + // calculate data length + len = 0; + for (i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + + // join chunks + result = new Uint8Array(len); + pos = 0; + for (i = 0, l = chunks.length; i < l; i++) { + chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + + return result; + } +}; + +var fnUntyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + return [].concat.apply([], chunks); + } +}; + + +// Enable/Disable typed arrays use, for testing +// +exports.setTyped = function (on) { + if (on) { + exports.Buf8 = Uint8Array; + exports.Buf16 = Uint16Array; + exports.Buf32 = Int32Array; + exports.assign(exports, fnTyped); + } else { + exports.Buf8 = Array; + exports.Buf16 = Array; + exports.Buf32 = Array; + exports.assign(exports, fnUntyped); + } +}; + +exports.setTyped(TYPED_OK); + +},{}],4:[function(require,module,exports){ +// String encode/decode helpers +'use strict'; + + +var utils = require('./common'); + + +// Quick check if we can use fast array to bin string conversion +// +// - apply(Array) can fail on Android 2.2 +// - apply(Uint8Array) can fail on iOS 5.1 Safary +// +var STR_APPLY_OK = true; +var STR_APPLY_UIA_OK = true; + +try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } +try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } + + +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new utils.Buf8(256); +for (var q = 0; q < 256; q++) { + _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +},{"./common":3}],5:[function(require,module,exports){ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It doesn't worth to make additional optimizationa as in original. +// Small size is preferable. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; + +},{}],6:[function(require,module,exports){ +'use strict'; + + +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; + +},{}],7:[function(require,module,exports){ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; + +},{}],8:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils/common'); +var trees = require('./trees'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var msg = require('./messages'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +var Z_NO_FLUSH = 0; +var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +//var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +//var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +//var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + + +/* compression levels */ +//var Z_NO_COMPRESSION = 0; +//var Z_BEST_SPEED = 1; +//var Z_BEST_COMPRESSION = 9; +var Z_DEFAULT_COMPRESSION = -1; + + +var Z_FILTERED = 1; +var Z_HUFFMAN_ONLY = 2; +var Z_RLE = 3; +var Z_FIXED = 4; +var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +//var Z_BINARY = 0; +//var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + + +/* The deflate compression method */ +var Z_DEFLATED = 8; + +/*============================================================================*/ + + +var MAX_MEM_LEVEL = 9; +/* Maximum value for memLevel in deflateInit2 */ +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_MEM_LEVEL = 8; + + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ +var LITERALS = 256; +/* number of literal bytes 0..255 */ +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ +var D_CODES = 30; +/* number of distance codes */ +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + +var PRESET_DICT = 0x20; + +var INIT_STATE = 42; +var EXTRA_STATE = 69; +var NAME_STATE = 73; +var COMMENT_STATE = 91; +var HCRC_STATE = 103; +var BUSY_STATE = 113; +var FINISH_STATE = 666; + +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ +var BS_BLOCK_DONE = 2; /* block flush performed */ +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ + +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. + +function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; +} + +function rank(f) { + return ((f) << 1) - ((f) > 4 ? 9 : 0); +} + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->output buffer and copying into it. + * (See also read_buf()). + */ +function flush_pending(strm) { + var s = strm.state; + + //_tr_flush_bits(s); + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { return; } + + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } +} + + +function flush_block_only(s, last) { + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); +} + + +function put_byte(s, b) { + s.pending_buf[s.pending++] = b; +} + + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +function putShortMSB(s, b) { +// put_byte(s, (Byte)(b >> 8)); +// put_byte(s, (Byte)(b & 0xff)); + s.pending_buf[s.pending++] = (b >>> 8) & 0xff; + s.pending_buf[s.pending++] = b & 0xff; +} + + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->input buffer and copying from it. + * (See also flush_pending()). + */ +function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + + if (len > size) { len = size; } + if (len === 0) { return 0; } + + strm.avail_in -= len; + + // zmemcpy(buf, strm->next_in, len); + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } + + else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + + strm.next_in += len; + strm.total_in += len; + + return len; +} + + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; /* max hash chain length */ + var scan = s.strstart; /* current string */ + var match; /* matched string */ + var len; /* length of current match */ + var best_len = s.prev_length; /* best match length so far */ + var nice_match = s.nice_match; /* stop if match long enough */ + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; + + var _win = s.window; // shortcut + + var wmask = s.w_mask; + var prev = s.prev; + + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (nice_match > s.lookahead) { nice_match = s.lookahead; } + + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + // Assert(cur_match < s->strstart, "no future"); + match = cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ + + if (_win[match + best_len] !== scan_end || + _win[match + best_len - 1] !== scan_end1 || + _win[match] !== _win[scan] || + _win[++match] !== _win[scan + 1]) { + continue; + } + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2; + match++; + // Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + /*jshint noempty:false*/ + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + scan < strend); + + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; +} + + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = s.window_size - s.lookahead - s.strstart; + + // JS ints have 32 bit, block below not needed + /* Deal with !@#$% 64K limit: */ + //if (sizeof(int) <= 2) { + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + // more = wsize; + // + // } else if (more == (unsigned)(-1)) { + // /* Very unlikely, but possible on 16 bit machine if + // * strstart == 0 && lookahead == 1 (input done a byte at time) + // */ + // more--; + // } + //} + + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + /* we now have strstart >= MAX_DIST */ + s.block_start -= _w_size; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = (m >= _w_size ? m - _w_size : 0); + } while (--n); + + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = (m >= _w_size ? m - _w_size : 0); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); + + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + //Assert(more >= 2, "more < 2"); + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; +//#if MIN_MATCH != 3 +// Call update_hash() MIN_MATCH-3 more times +//#endif + while (s.insert) { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ +// if (s.high_water < s.window_size) { +// var curr = s.strstart + s.lookahead; +// var init = 0; +// +// if (s.high_water < curr) { +// /* Previous high water mark below current data -- zero WIN_INIT +// * bytes or up to end of window, whichever is less. +// */ +// init = s.window_size - curr; +// if (init > WIN_INIT) +// init = WIN_INIT; +// zmemzero(s->window + curr, (unsigned)init); +// s->high_water = curr + init; +// } +// else if (s->high_water < (ulg)curr + WIN_INIT) { +// /* High water mark at or above current data, but below current data +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up +// * to end of window, whichever is less. +// */ +// init = (ulg)curr + WIN_INIT - s->high_water; +// if (init > s->window_size - s->high_water) +// init = s->window_size - s->high_water; +// zmemzero(s->window + s->high_water, (unsigned)init); +// s->high_water += init; +// } +// } +// +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, +// "not enough room for search"); +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +function deflate_stored(s, flush) { + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + var max_block_size = 0xffff; + + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s.lookahead <= 1) { + + //Assert(s->strstart < s->w_size+MAX_DIST(s) || + // s->block_start >= (long)s->w_size, "slide too late"); +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || +// s.block_start >= s.w_size)) { +// throw new Error("slide too late"); +// } + + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + + if (s.lookahead === 0) { + break; + } + /* flush the current block */ + } + //Assert(s->block_start >= 0L, "block gone"); +// if (s.block_start < 0) throw new Error("block gone"); + + s.strstart += s.lookahead; + s.lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + var max_start = s.block_start + max_block_size; + + if (s.strstart === 0 || s.strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + + + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + + s.insert = 0; + + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + + if (s.strstart > s.block_start) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_NEED_MORE; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +function deflate_fast(s, flush) { + var hash_head; /* head of the hash chain */ + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; /* flush the current block */ + } + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + } + if (s.match_length >= MIN_MATCH) { + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only + + /*** _tr_tally_dist(s, s.strstart - s.match_start, + s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { + s.match_length--; /* string at strstart already in table */ + do { + s.strstart++; + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s.match_length !== 0); + s.strstart++; + } else + { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; + +//#if MIN_MATCH != 3 +// Call UPDATE_HASH() MIN_MATCH-3 more times +//#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s.window[s.strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +function deflate_slow(s, flush) { + var hash_head; /* head of hash chain */ + var bflush; /* set if current block must be flushed */ + + var max_insert; + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + */ + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && + s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + + if (s.match_length <= 5 && + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + //check_match(s, s.strstart-1, s.prev_match, s.prev_length); + + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, + s.prev_length - MIN_MATCH, bflush);***/ + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + } else if (s.match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + if (bflush) { + /*** FLUSH_BLOCK_ONLY(s, 0) ***/ + flush_block_only(s, false); + /***/ + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + //Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s.match_available) { + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_BLOCK_DONE; +} + + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +function deflate_rle(s, flush) { + var bflush; /* set if current block must be flushed */ + var prev; /* byte at distance one to match */ + var scan, strend; /* scan goes up to strend for length of run */ + + var _win = s.window; + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + /*jshint noempty:false*/ + } while (prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s.match_length >= MIN_MATCH) { + //check_match(s, s.strstart, s.strstart - 1, s.match_length); + + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +function deflate_huff(s, flush) { + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s.match_length = 0; + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; +} + +var configuration_table; + +configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), /* 3 */ + + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ +]; + + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +function lm_init(s) { + s.window_size = 2 * s.w_size; + + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + + /* Set the default configuration parameters: + */ + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; +} + + +function DeflateState() { + this.strm = null; /* pointer back to this zlib stream */ + this.status = 0; /* as the name implies */ + this.pending_buf = null; /* output still pending */ + this.pending_buf_size = 0; /* size of pending_buf */ + this.pending_out = 0; /* next pending byte to output to the stream */ + this.pending = 0; /* nb of bytes in the pending buffer */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.gzhead = null; /* gzip header information to write */ + this.gzindex = 0; /* where in extra, name, or comment */ + this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.last_flush = -1; /* value of flush param for previous deflate call */ + + this.w_size = 0; /* LZ77 window size (32K by default) */ + this.w_bits = 0; /* log2(w_size) (8..16) */ + this.w_mask = 0; /* w_size - 1 */ + + this.window = null; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. + */ + + this.window_size = 0; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + this.prev = null; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + this.head = null; /* Heads of the hash chains or NIL. */ + + this.ins_h = 0; /* hash index of string to be inserted */ + this.hash_size = 0; /* number of elements in hash table */ + this.hash_bits = 0; /* log2(hash_size) */ + this.hash_mask = 0; /* hash_size-1 */ + + this.hash_shift = 0; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + this.block_start = 0; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + this.match_length = 0; /* length of best match */ + this.prev_match = 0; /* previous match */ + this.match_available = 0; /* set if previous match exists */ + this.strstart = 0; /* start of string to insert */ + this.match_start = 0; /* start of matching string */ + this.lookahead = 0; /* number of valid bytes ahead in window */ + + this.prev_length = 0; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + this.max_chain_length = 0; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + this.max_lazy_match = 0; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ + // That's alias to max_lazy_match, don't use directly + //this.max_insert_length = 0; + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + this.level = 0; /* compression level (1..9) */ + this.strategy = 0; /* favor or force Huffman coding*/ + + this.good_match = 0; + /* Use a faster search when the previous match is longer than this */ + + this.nice_match = 0; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + + /* Didn't use ct_data typedef below to suppress compiler warning */ + + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + // Use flat array of DOUBLE size, with interleaved fata, + // because JS does not support effective + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + + this.l_desc = null; /* desc. for literal tree */ + this.d_desc = null; /* desc. for distance tree */ + this.bl_desc = null; /* desc. for bit length tree */ + + //ush bl_count[MAX_BITS+1]; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + /* number of codes at each bit length for an optimal tree */ + + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); + + this.heap_len = 0; /* number of elements in the heap */ + this.heap_max = 0; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + this.l_buf = 0; /* buffer index for literals or lengths */ + + this.lit_bufsize = 0; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + this.last_lit = 0; /* running index in l_buf */ + + this.d_buf = 0; + /* Buffer index for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + this.opt_len = 0; /* bit length of current block with optimal trees */ + this.static_len = 0; /* bit length of current block with static trees */ + this.matches = 0; /* number of string matches in current block */ + this.insert = 0; /* bytes at end of window left to insert */ + + + this.bi_buf = 0; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + this.bi_valid = 0; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + // Used for window memory init. We safely ignore it for JS. That makes + // sense only for pointers and memory check tools. + //this.high_water = 0; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ +} + + +function deflateResetKeep(strm) { + var s; + + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + + s = strm.state; + s.pending = 0; + s.pending_out = 0; + + if (s.wrap < 0) { + s.wrap = -s.wrap; + /* was made negative by deflate(..., Z_FINISH); */ + } + s.status = (s.wrap ? INIT_STATE : BUSY_STATE); + strm.adler = (s.wrap === 2) ? + 0 // crc32(0, Z_NULL, 0) + : + 1; // adler32(0, Z_NULL, 0) + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; +} + + +function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; +} + + +function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + strm.state.gzhead = head; + return Z_OK; +} + + +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { // === Z_NULL + return Z_STREAM_ERROR; + } + var wrap = 1; + + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } + + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } + + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + + + if (windowBits === 8) { + windowBits = 9; + } + /* until 256-byte window bug fixed */ + + var s = new DeflateState(); + + strm.state = s; + s.strm = strm; + + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + + // Don't need mem init magic for JS. + //s.high_water = 0; /* nothing written to s->window yet */ + + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + s.pending_buf_size = s.lit_bufsize * 4; + + //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + //s->pending_buf = (uchf *) overlay; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + + // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) + //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s.d_buf = 1 * s.lit_bufsize; + + //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + s.l_buf = (1 + 2) * s.lit_bufsize; + + s.level = level; + s.strategy = strategy; + s.method = method; + + return deflateReset(strm); +} + +function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +} + + +function deflate(strm, flush) { + var old_flush, s; + var beg, val; // for gzip header write only + + if (!strm || !strm.state || + flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + + s = strm.state; + + if (!strm.output || + (!strm.input && strm.avail_in !== 0) || + (s.status === FINISH_STATE && flush !== Z_FINISH)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + + s.strm = strm; /* just in case */ + old_flush = s.last_flush; + s.last_flush = flush; + + /* Write the header */ + if (s.status === INIT_STATE) { + + if (s.wrap === 2) { // GZIP header + strm.adler = 0; //crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { // s->gzhead == Z_NULL + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } + else { + put_byte(s, (s.gzhead.text ? 1 : 0) + + (s.gzhead.hcrc ? 2 : 0) + + (!s.gzhead.extra ? 0 : 4) + + (!s.gzhead.name ? 0 : 8) + + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 0xff); + put_byte(s, (s.gzhead.time >> 8) & 0xff); + put_byte(s, (s.gzhead.time >> 16) & 0xff); + put_byte(s, (s.gzhead.time >> 24) & 0xff); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, s.gzhead.os & 0xff); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 0xff); + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + else // DEFLATE header + { + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + var level_flags = -1; + + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= (level_flags << 6); + if (s.strstart !== 0) { header |= PRESET_DICT; } + header += 31 - (header % 31); + + s.status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + strm.adler = 1; // adler32(0L, Z_NULL, 0); + } + } + +//#ifdef GZIP + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } + else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } + else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } + else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + strm.adler = 0; //crc32(0L, Z_NULL, 0); + s.status = BUSY_STATE; + } + } + else { + s.status = BUSY_STATE; + } + } +//#endif + + /* Flush as much pending output as possible */ + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s.last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && + flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm.avail_in !== 0 || s.lookahead !== 0 || + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : + (s.strategy === Z_RLE ? deflate_rle(s, flush) : + configuration_table[s.level].func(s, flush)); + + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + + trees._tr_stored_block(s, 0, 0, false); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush === Z_FULL_FLUSH) { + /*** CLEAR_HASH(s); ***/ /* forget history */ + zero(s.head); // Fill with NIL (= 0); + + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + //Assert(strm->avail_out > 0, "bug2"); + //if (strm.avail_out <= 0) { throw new Error("bug2");} + + if (flush !== Z_FINISH) { return Z_OK; } + if (s.wrap <= 0) { return Z_STREAM_END; } + + /* Write the trailer */ + if (s.wrap === 2) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + put_byte(s, (strm.adler >> 16) & 0xff); + put_byte(s, (strm.adler >> 24) & 0xff); + put_byte(s, strm.total_in & 0xff); + put_byte(s, (strm.total_in >> 8) & 0xff); + put_byte(s, (strm.total_in >> 16) & 0xff); + put_byte(s, (strm.total_in >> 24) & 0xff); + } + else + { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s.wrap > 0) { s.wrap = -s.wrap; } + /* write the trailer only once! */ + return s.pending !== 0 ? Z_OK : Z_STREAM_END; +} + +function deflateEnd(strm) { + var status; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + status = strm.state.status; + if (status !== INIT_STATE && + status !== EXTRA_STATE && + status !== NAME_STATE && + status !== COMMENT_STATE && + status !== HCRC_STATE && + status !== BUSY_STATE && + status !== FINISH_STATE + ) { + return err(strm, Z_STREAM_ERROR); + } + + strm.state = null; + + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; +} + + +/* ========================================================================= + * Initializes the compression dictionary from the given byte + * sequence without producing any compressed output. + */ +function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var s; + var str, n; + var wrap; + var avail; + var next; + var input; + var tmpDict; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + s = strm.state; + wrap = s.wrap; + + if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { + return Z_STREAM_ERROR; + } + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap === 1) { + /* adler32(strm->adler, dictionary, dictLength); */ + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + + s.wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s.w_size) { + if (wrap === 0) { /* already empty otherwise */ + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + /* use the tail */ + // dictionary = dictionary.slice(dictLength - s.w_size); + tmpDict = new utils.Buf8(s.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + /* insert dictionary into window and hash */ + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + str = s.strstart; + n = s.lookahead - (MIN_MATCH - 1); + do { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK; +} + + +exports.deflateInit = deflateInit; +exports.deflateInit2 = deflateInit2; +exports.deflateReset = deflateReset; +exports.deflateResetKeep = deflateResetKeep; +exports.deflateSetHeader = deflateSetHeader; +exports.deflate = deflate; +exports.deflateEnd = deflateEnd; +exports.deflateSetDictionary = deflateSetDictionary; +exports.deflateInfo = 'pako deflate (from Nodeca project)'; + +/* Not implemented +exports.deflateBound = deflateBound; +exports.deflateCopy = deflateCopy; +exports.deflateParams = deflateParams; +exports.deflatePending = deflatePending; +exports.deflatePrime = deflatePrime; +exports.deflateTune = deflateTune; +*/ + +},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(require,module,exports){ +'use strict'; + + +function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; +} + +module.exports = GZheader; + +},{}],10:[function(require,module,exports){ +'use strict'; + +// See state defs from inflate.js +var BAD = 30; /* got a data error -- remain here until reset */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state.mode === LEN + strm.avail_in >= 6 + strm.avail_out >= 258 + start >= strm.avail_out + state.bits < 8 + + On return, state.mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm.avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm.avail_out >= 258 for each loop to avoid checking for + output space. + */ +module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ +//#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ +//#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + // Use `s_window` instead `window`, avoid conflict with instrumentation tools + var s_window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); +//#ifdef INFLATE_STRICT + dmax = state.dmax; +//#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); +//#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } +//#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// if (len <= op - whave) { +// do { +// output[_out++] = 0; +// } while (--len); +// continue top; +// } +// len -= op - whave; +// do { +// output[_out++] = 0; +// } while (--op > whave); +// if (op === 0) { +// from = _out - dist; +// do { +// output[_out++] = output[from++]; +// } while (--len); +// continue top; +// } +//#endif + } + from = 0; // window index + from_source = s_window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + + +var utils = require('../utils/common'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var inflate_fast = require('./inffast'); +var inflate_table = require('./inftrees'); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +//var Z_NO_FLUSH = 0; +//var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +//var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + +/* The deflate compression method */ +var Z_DEFLATED = 8; + + +/* STATES ====================================================================*/ +/* ===========================================================================*/ + + +var HEAD = 1; /* i: waiting for magic header */ +var FLAGS = 2; /* i: waiting for method and flags (gzip) */ +var TIME = 3; /* i: waiting for modification time (gzip) */ +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ +var EXLEN = 5; /* i: waiting for extra length (gzip) */ +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ +var NAME = 7; /* i: waiting for end of file name (gzip) */ +var COMMENT = 8; /* i: waiting for end of comment (gzip) */ +var HCRC = 9; /* i: waiting for header crc (gzip) */ +var DICTID = 10; /* i: waiting for dictionary check value */ +var DICT = 11; /* waiting for inflateSetDictionary() call */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ +var STORED = 14; /* i: waiting for stored size (length and complement) */ +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ +var COPY = 16; /* i/o: waiting for input or output to copy stored block */ +var TABLE = 17; /* i: waiting for dynamic block table lengths */ +var LENLENS = 18; /* i: waiting for code length code lengths */ +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ +var LEN_ = 20; /* i: same as LEN below, but only first time in */ +var LEN = 21; /* i: waiting for length/lit/eob code */ +var LENEXT = 22; /* i: waiting for length extra bits */ +var DIST = 23; /* i: waiting for distance code */ +var DISTEXT = 24; /* i: waiting for distance extra bits */ +var MATCH = 25; /* o: waiting for output space to copy string */ +var LIT = 26; /* o: waiting for output space to write literal */ +var CHECK = 27; /* i: waiting for 32-bit check value */ +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ +var DONE = 29; /* finished check, done -- remain here until reset */ +var BAD = 30; /* got a data error -- remain here until reset */ +var MEM = 31; /* got an inflate() memory error -- remain here until reset */ +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + +/* ===========================================================================*/ + + + +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_WBITS = MAX_WBITS; + + +function zswap32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); +} + + +function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* + because we don't have pointers in js, we use lencode and distcode directly + as buffers so we don't need codes + */ + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ +} + +function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + +} + +function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); +} + +function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; +} + +function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); +} + + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +var virgin = true; + +var lenfix, distfix; // We have no pointers in JS, so keep tables separate + +function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; +} + + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; +} + +function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more conveniend processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = zswap32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// +//#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } +//#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state.lenbits = 9; + + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } +//#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +//#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// Trace((stderr, "inflate.c too far\n")); +// copy -= state.whave; +// if (copy > state.length) { copy = state.length; } +// if (copy > left) { copy = left; } +// left -= copy; +// state.length -= copy; +// do { +// output[put++] = 0; +// } while (--copy); +// if (state.length === 0) { state.mode = LEN; } +// break; +//#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' insdead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; +} + +function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; +} + +function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; +} + +function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var state; + var dictid; + var ret; + + /* check state */ + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + state = strm.state; + + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + + /* check for correct dictionary identifier */ + if (state.mode === DICT) { + dictid = 1; /* adler32(0, null, 0)*/ + /* dictid = adler32(dictid, dictionary, dictLength); */ + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + /* copy dictionary to window using updatewindow(), which will amend the + existing dictionary if appropriate */ + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + // Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +exports.inflateReset = inflateReset; +exports.inflateReset2 = inflateReset2; +exports.inflateResetKeep = inflateResetKeep; +exports.inflateInit = inflateInit; +exports.inflateInit2 = inflateInit2; +exports.inflate = inflate; +exports.inflateEnd = inflateEnd; +exports.inflateGetHeader = inflateGetHeader; +exports.inflateSetDictionary = inflateSetDictionary; +exports.inflateInfo = 'pako inflate (from Nodeca project)'; + +/* Not implemented +exports.inflateCopy = inflateCopy; +exports.inflateGetDictionary = inflateGetDictionary; +exports.inflateMark = inflateMark; +exports.inflatePrime = inflatePrime; +exports.inflateSync = inflateSync; +exports.inflateSyncPoint = inflateSyncPoint; +exports.inflateUndermine = inflateUndermine; +*/ + +},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(require,module,exports){ +'use strict'; + + +var utils = require('../utils/common'); + +var MAXBITS = 15; +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +]; + +var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 +]; + +var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 +]; + +var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 +]; + +module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) +{ + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; +// var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + var i = 0; + /* process all codes and make table entries */ + for (;;) { + i++; + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; + table.bits[low] = root; + table.val[low] = next - opts.table_index;*/ + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; +}; + +},{"../utils/common":3}],13:[function(require,module,exports){ +'use strict'; + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; + +},{}],14:[function(require,module,exports){ +'use strict'; + + +var utils = require('../utils/common'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +//var Z_FILTERED = 1; +//var Z_HUFFMAN_ONLY = 2; +//var Z_RLE = 3; +var Z_FIXED = 4; +//var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +var Z_BINARY = 0; +var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + +/*============================================================================*/ + + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + +// From zutil.h + +var STORED_BLOCK = 0; +var STATIC_TREES = 1; +var DYN_TREES = 2; +/* The three kinds of block type */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +/* The minimum and maximum match lengths */ + +// From deflate.h +/* =========================================================================== + * Internal compression state. + */ + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ + +var LITERALS = 256; +/* number of literal bytes 0..255 */ + +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ + +var D_CODES = 30; +/* number of distance codes */ + +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ + +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ + +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var Buf_size = 16; +/* size of bit buffer in bi_buf */ + + +/* =========================================================================== + * Constants + */ + +var MAX_BL_BITS = 7; +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +var END_BLOCK = 256; +/* end of block literal code */ + +var REP_3_6 = 16; +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +var REPZ_3_10 = 17; +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +var REPZ_11_138 = 18; +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +/* eslint-disable comma-spacing,array-bracket-spacing */ +var extra_lbits = /* extra bits for each length code */ + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; + +var extra_dbits = /* extra bits for each distance code */ + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; + +var extra_blbits = /* extra bits for each bit length code */ + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; + +var bl_order = + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +/* eslint-enable comma-spacing,array-bracket-spacing */ + +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +// We pre-fill arrays with 0 to avoid uninitialized gaps + +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ + +// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1 +var static_ltree = new Array((L_CODES + 2) * 2); +zero(static_ltree); +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +var static_dtree = new Array(D_CODES * 2); +zero(static_dtree); +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +var _dist_code = new Array(DIST_CODE_LEN); +zero(_dist_code); +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); +zero(_length_code); +/* length code for each normalized match length (0 == MIN_MATCH) */ + +var base_length = new Array(LENGTH_CODES); +zero(base_length); +/* First normalized length for each code (0 = MIN_MATCH) */ + +var base_dist = new Array(D_CODES); +zero(base_dist); +/* First normalized distance for each code (0 = distance of 1) */ + + +function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + + this.static_tree = static_tree; /* static tree or NULL */ + this.extra_bits = extra_bits; /* extra bits for each code or NULL */ + this.extra_base = extra_base; /* base index for extra_bits */ + this.elems = elems; /* max number of elements in the tree */ + this.max_length = max_length; /* max bit length for the codes */ + + // show if `static_tree` has data or dummy - needed for monomorphic objects + this.has_stree = static_tree && static_tree.length; +} + + +var static_l_desc; +var static_d_desc; +var static_bl_desc; + + +function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; /* the dynamic tree */ + this.max_code = 0; /* largest code with non zero frequency */ + this.stat_desc = stat_desc; /* the corresponding static tree */ +} + + + +function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; +} + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +function put_short(s, w) { +// put_byte(s, (uch)((w) & 0xff)); +// put_byte(s, (uch)((ush)(w) >> 8)); + s.pending_buf[s.pending++] = (w) & 0xff; + s.pending_buf[s.pending++] = (w >>> 8) & 0xff; +} + + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +function send_bits(s, value, length) { + if (s.bi_valid > (Buf_size - length)) { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + put_short(s, s.bi_buf); + s.bi_buf = value >> (Buf_size - s.bi_valid); + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + s.bi_valid += length; + } +} + + +function send_code(s, c, tree) { + send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); +} + + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; +} + + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 0xff; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } +} + + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +function gen_bitlen(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; /* heap index */ + var n, m; /* iterate over the tree elements */ + var bits; /* bit length */ + var xbits; /* extra bits */ + var f; /* frequency */ + var overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1]/*.Len*/ = bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) { continue; } /* not a leaf node */ + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]/*.Freq*/; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); + } + } + if (overflow === 0) { return; } + + // Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { bits--; } + s.bl_count[bits]--; /* move one leaf down the tree */ + s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ + s.bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { continue; } + if (tree[m * 2 + 1]/*.Len*/ !== bits) { + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; + tree[m * 2 + 1]/*.Len*/ = bits; + } + n--; + } + } +} + + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +function gen_codes(tree, max_code, bl_count) +// ct_data *tree; /* the tree to decorate */ +// int max_code; /* largest code with non zero frequency */ +// ushf *bl_count; /* number of codes at each bit length */ +{ + var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + var code = 0; /* running code value */ + var bits; /* bit index */ + var n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits - 1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n = 0; n < (1 << extra_lbits[code]); n++) { + _length_code[length++] = code; + } + } + //Assert (length == 256, "tr_static_init: length != 256"); + /* Note that the length 255 (match length 258) can be represented + * in two different ways: code 284 + 5 bits or code 285, so we + * overwrite length_code[255] to use the best encoding: + */ + _length_code[length - 1] = code; + + /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1 << extra_dbits[code]); n++) { + _dist_code[dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: dist != 256"); + dist >>= 7; /* from now on, all distances are divided by 128 */ + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { + _dist_code[256 + dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1]/*.Len*/ = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1]/*.Len*/ = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes(static_ltree, L_CODES + 1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n * 2 + 1]/*.Len*/ = 5; + static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); + } + + // Now data ready and we can init static trees + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + + //static_init_done = true; +} + + +/* =========================================================================== + * Initialize a new block. + */ +function init_block(s) { + var n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + + s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; +} + + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +function bi_windup(s) +{ + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + //put_byte(s, (Byte)s->bi_buf); + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +function copy_block(s, buf, len, header) +//DeflateState *s; +//charf *buf; /* the input data */ +//unsigned len; /* its length */ +//int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, len); + put_short(s, ~len); + } +// while (len--) { +// put_byte(s, *buf++); +// } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); +} + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +function pqdownheap(s, tree, k) +// deflate_state *s; +// ct_data *tree; /* the tree to restore */ +// int k; /* node to move down */ +{ + var v = s.heap[k]; + var j = k << 1; /* left son of k */ + while (j <= s.heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s.heap_len && + smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s.heap[j], s.depth)) { break; } + + /* Exchange v with the smallest son */ + s.heap[k] = s.heap[j]; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s.heap[k] = v; +} + + +// inlined manually +// var SMALLEST = 1; + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +function compress_block(s, ltree, dtree) +// deflate_state *s; +// const ct_data *ltree; /* literal tree */ +// const ct_data *dtree; /* distance tree */ +{ + var dist; /* distance of matched string */ + var lc; /* match length or unmatched char (if dist == 0) */ + var lx = 0; /* running index in l_buf */ + var code; /* the code to send */ + var extra; /* number of extra bits to send */ + + if (s.last_lit !== 0) { + do { + dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); + lc = s.pending_buf[s.l_buf + lx]; + lx++; + + if (dist === 0) { + send_code(s, lc, ltree); /* send a literal byte */ + //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + //Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + // "pendingBuf overflow"); + + } while (lx < s.last_lit); + } + + send_code(s, END_BLOCK, ltree); +} + + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +function build_tree(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; /* iterate over heap elements */ + var max_code = -1; /* largest code with non zero frequency */ + var node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n * 2]/*.Freq*/ !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + + } else { + tree[n * 2 + 1]/*.Len*/ = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); + tree[node * 2]/*.Freq*/ = 1; + s.depth[node] = 0; + s.opt_len--; + + if (has_stree) { + s.static_len -= stree[node * 2 + 1]/*.Len*/; + } + /* node is 0 or 1 so it does not have extra bits */ + } + desc.max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + //pqremove(s, tree, n); /* n = node of least frequency */ + /*** pqremove ***/ + n = s.heap[1/*SMALLEST*/]; + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1/*SMALLEST*/); + /***/ + + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ + + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ + s.heap[--s.heap_max] = m; + + /* Create a new node father of n and m */ + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; + + /* and insert the new node in the heap */ + s.heap[1/*SMALLEST*/] = node++; + pqdownheap(s, tree, 1/*SMALLEST*/); + + } while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes(tree, max_code, s.bl_count); +} + + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +function scan_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + s.bl_tree[curlen * 2]/*.Freq*/ += count; + + } else if (curlen !== 0) { + + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } + s.bl_tree[REP_3_6 * 2]/*.Freq*/++; + + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; + + } else { + s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; + } + + count = 0; + prevlen = curlen; + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +function send_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); + + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + //Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +function build_bl_tree(s) { + var max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, s.bl_desc); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { + break; + } + } + /* Update opt_len to include the bit length tree and counts */ + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + // s->opt_len, s->static_len)); + + return max_blindex; +} + + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +function send_all_trees(s, lcodes, dcodes, blcodes) +// deflate_state *s; +// int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + var rank; /* index in bl_order */ + + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + // "too many codes"); + //Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); + } + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +function detect_data_type(s) { + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + var black_mask = 0xf3ffc07f; + var n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { + return Z_BINARY; + } + } + + /* Check for textual ("white-listed") bytes. */ + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + } + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + + +var static_init_done = false; + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +function _tr_init(s) +{ + + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + + s.bi_buf = 0; + s.bi_valid = 0; + + /* Initialize the first block of the first file: */ + init_block(s); +} + + +/* =========================================================================== + * Send a stored block + */ +function _tr_stored_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ + copy_block(s, buf, stored_len, true); /* with header */ +} + + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); +} + + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +function _tr_flush_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block, or NULL if too old */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + var max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s.level > 0) { + + /* Check if the file is binary or text */ + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + + /* Construct the literal and distance trees */ + build_tree(s, s.l_desc); + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + + build_tree(s, s.d_desc); + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s.opt_len + 3 + 7) >>> 3; + static_lenb = (s.static_len + 3 + 7) >>> 3; + + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + // s->last_lit)); + + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } + + } else { + // Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + + if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { + /* 4: two words for the lengths */ + + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); + } + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + // s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +function _tr_tally(s, dist, lc) +// deflate_state *s; +// unsigned dist; /* distance of matched string */ +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + //var out_length, in_length, dcode; + + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; + + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; + s.last_lit++; + + if (dist === 0) { + /* lc is the unmatched char */ + s.dyn_ltree[lc * 2]/*.Freq*/++; + } else { + s.matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + //Assert((ush)dist < (ush)MAX_DIST(s) && + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility + +//#ifdef TRUNCATE_BLOCK +// /* Try to guess if it is profitable to stop the current block here */ +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { +// /* Compute an upper bound for the compressed length */ +// out_length = s.last_lit*8; +// in_length = s.strstart - s.block_start; +// +// for (dcode = 0; dcode < D_CODES; dcode++) { +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); +// } +// out_length >>>= 3; +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", +// // s->last_lit, in_length, out_length, +// // 100L - out_length*100L/in_length)); +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { +// return true; +// } +// } +//#endif + + return (s.last_lit === s.lit_bufsize - 1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +exports._tr_init = _tr_init; +exports._tr_stored_block = _tr_stored_block; +exports._tr_flush_block = _tr_flush_block; +exports._tr_tally = _tr_tally; +exports._tr_align = _tr_align; + +},{"../utils/common":3}],15:[function(require,module,exports){ +'use strict'; + + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; + +},{}],"/":[function(require,module,exports){ +// Top level file is just a mixin of submodules & constants +'use strict'; + +var assign = require('./lib/utils/common').assign; + +var deflate = require('./lib/deflate'); +var inflate = require('./lib/inflate'); +var constants = require('./lib/zlib/constants'); + +var pako = {}; + +assign(pako, deflate, inflate, constants); + +module.exports = pako; + +},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") +}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako.min.js b/node_modules/pako/dist/pako.min.js new file mode 100755 index 00000000..c2b86b63 --- /dev/null +++ b/node_modules/pako/dist/pako.min.js @@ -0,0 +1,3 @@ +/* pako 0.2.9 nodeca/pako */ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pako=t()}}(function(){return function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var d=a[s]={exports:{}};e[s][0].call(d.exports,function(t){var a=e[s][1][t];return n(a?a:t)},d,d.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==b)throw new Error(d[a]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===_.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=o.deflateSetDictionary(this.strm,n),a!==b)throw new Error(d[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}function s(t,e){return e=e||{},e.gzip=!0,n(t,e)}var o=t("./zlib/deflate"),l=t("./utils/common"),h=t("./utils/strings"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=Object.prototype.toString,u=0,c=4,b=0,g=1,m=2,w=-1,p=0,v=8;i.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:e===!0?c:u,"string"==typeof t?n.input=h.string2buf(t):"[object ArrayBuffer]"===_.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new l.Buf8(r),n.next_out=0,n.avail_out=r),a=o.deflate(n,i),a!==g&&a!==b)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||i!==c&&i!==m)||("string"===this.options.to?this.onData(h.buf2binstring(l.shrinkBuf(n.output,n.next_out))):this.onData(l.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&a!==g);return i===c?(a=o.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===b):i!==m||(this.onEnd(b),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===b&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=r,a.gzip=s},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=s.inflateInit2(this.strm,e.windowBits);if(a!==h.Z_OK)throw new Error(d[a]);this.header=new _,s.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}var s=t("./zlib/inflate"),o=t("./utils/common"),l=t("./utils/strings"),h=t("./zlib/constants"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=t("./zlib/gzheader"),u=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,r,d,f,_=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?h.Z_FINISH:h.Z_NO_FLUSH,"string"==typeof t?_.input=l.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?_.input=new Uint8Array(t):_.input=t,_.next_in=0,_.avail_in=_.input.length;do{if(0===_.avail_out&&(_.output=new o.Buf8(c),_.next_out=0,_.avail_out=c),a=s.inflate(_,h.Z_NO_FLUSH),a===h.Z_NEED_DICT&&b&&(f="string"==typeof b?l.string2buf(b):"[object ArrayBuffer]"===u.call(b)?new Uint8Array(b):b,a=s.inflateSetDictionary(this.strm,f)),a===h.Z_BUF_ERROR&&g===!0&&(a=h.Z_OK,g=!1),a!==h.Z_STREAM_END&&a!==h.Z_OK)return this.onEnd(a),this.ended=!0,!1;_.next_out&&(0!==_.avail_out&&a!==h.Z_STREAM_END&&(0!==_.avail_in||i!==h.Z_FINISH&&i!==h.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(_.output,_.next_out),r=_.next_out-n,d=l.buf2string(_.output,n),_.next_out=r,_.avail_out=c-r,r&&o.arraySet(_.output,_.output,n,r,0),this.onData(d)):this.onData(o.shrinkBuf(_.output,_.next_out)))),0===_.avail_in&&0===_.avail_out&&(g=!0)}while((_.avail_in>0||0===_.avail_out)&&a!==h.Z_STREAM_END);return a===h.Z_STREAM_END&&(i=h.Z_FINISH),i===h.Z_FINISH?(a=s.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h.Z_OK):i!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),_.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===h.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=r,a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var i in a)a.hasOwnProperty(i)&&(t[i]=a[i])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)return void t.set(e.subarray(a,a+i),n);for(var r=0;r=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for(e=e||t.length,e>t.length&&(e=t.length),a=e-1;a>=0&&128===(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";function i(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){s=a>2e3?2e3:a,a-=s;do n=n+e[i++]|0,r=r+n|0;while(--s);n%=65521,r%=65521}return n|r<<16|0}e.exports=i},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";function i(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}function n(t,e,a,i){var n=r,s=i+a;t^=-1;for(var o=i;o>>8^n[255&(t^e[o])];return t^-1}var r=i();e.exports=n},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=D[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(R.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,R.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=N(t.adler,e,n,a):2===t.state.wrap&&(t.adler=O(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+dt,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do;while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=dt-(_-r),r=_-dt,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}while((e=f[e&d])>l&&0!==--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-ft)){R.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,a=t.hash_size,e=a;do i=t.head[--e],t.head[e]=i>=s?i-s:0;while(--a);a=s,e=a;do i=t.prev[--e],t.prev[e]=i>=s?i-s:0;while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=ht)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===I)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-ft&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.strstart>t.block_start&&(o(t,!1),0===t.strm.avail_out)?vt:vt}function c(t,e){for(var a,i;;){if(t.lookahead=ht&&(t.ins_h=(t.ins_h<=ht)if(i=C._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=ht&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ht,i=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<=ht&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+dt;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(a=C._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function m(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===I)return vt;break}if(t.match_length=0,a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function w(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function p(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=Z[t.level].max_lazy,t.good_match=Z[t.level].good_length,t.nice_match=Z[t.level].nice_length,t.max_chain_length=Z[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=V,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new R.Buf16(2*ot),this.dyn_dtree=new R.Buf16(2*(2*rt+1)),this.bl_tree=new R.Buf16(2*(2*st+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(lt+1),this.heap=new R.Buf16(2*nt+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*nt+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Q,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ut:wt,t.adler=2===e.wrap?0:1,e.last_flush=I,C._tr_init(e),H):i(t,K)}function y(t){var e=k(t);return e===H&&p(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?K:(t.state.gzhead=e,H):K}function z(t,e,a,n,r,s){if(!t)return K;var o=1;if(e===Y&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>$||a!==V||n<8||n>15||e<0||e>9||s<0||s>W)return i(t,K);8===n&&(n=9);var l=new v;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<L||e<0)return t?i(t,K):K;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===pt&&e!==F)return i(t,0===t.avail_out?P:K);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===ut)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=O(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=ct):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,zt),o.status=wt);else{var _=V+(o.w_bits-8<<4)<<8,u=-1;u=o.strategy>=G||o.level<2?0:o.level<6?1:6===o.level?2:3,_|=u<<6,0!==o.strstart&&(_|=_t),_+=31-_%31,o.status=wt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===ct)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=bt)}else o.status=bt;if(o.status===bt)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=gt)}else o.status=gt;if(o.status===gt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=mt)}else o.status=mt;if(o.status===mt&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=wt)):o.status=wt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,H}else if(0===t.avail_in&&n(e)<=n(a)&&e!==F)return i(t,P);if(o.status===pt&&0!==t.avail_in)return i(t,P);if(0!==t.avail_in||0!==o.lookahead||e!==I&&o.status!==pt){var c=o.strategy===G?m(o,e):o.strategy===X?g(o,e):Z[o.level].func(o,e);if(c!==yt&&c!==xt||(o.status=pt),c===vt||c===yt)return 0===t.avail_out&&(o.last_flush=-1),H;if(c===kt&&(e===U?C._tr_align(o):e!==L&&(C._tr_stored_block(o,0,0,!1),e===T&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,H}return e!==F?H:o.wrap<=0?j:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?H:j)}function E(t){var e;return t&&t.state?(e=t.state.status,e!==ut&&e!==ct&&e!==bt&&e!==gt&&e!==mt&&e!==wt&&e!==pt?i(t,K):(t.state=null,e===wt?i(t,M):H)):K}function A(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return K;if(a=t.state,s=a.wrap,2===s||1===s&&a.status!==ut||a.lookahead)return K;for(1===s&&(t.adler=N(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new R.Buf8(a.w_size),R.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=ht;){i=a.strstart,n=a.lookahead-(ht-1);do a.ins_h=(a.ins_h<>>24,b>>>=y,g-=y,y=k>>>16&255,0===y)A[o++]=65535&k;else{if(!(16&y)){if(0===(64&y)){k=m[(65535&k)+(b&(1<>>=y,g-=y),g<15&&(b+=E[r++]<>>24,b>>>=y,g-=y,y=k>>>16&255,!(16&y)){if(0===(64&y)){k=w[(65535&k)+(b&(1<d){t.msg="invalid distance too far back",a.mode=i;break t}if(b>>>=y,g-=y,y=o-l,z>y){if(y=z-y,y>_&&a.sane){t.msg="invalid distance too far back",a.mode=i;break t}if(B=0,S=c,0===u){if(B+=f-y,y2;)A[o++]=S[B++],A[o++]=S[B++],A[o++]=S[B++],x-=3;x&&(A[o++]=S[B++],x>1&&(A[o++]=S[B++]))}else{B=o-z;do A[o++]=A[B++],A[o++]=A[B++],A[o++]=A[B++],x-=3;while(x>2);x&&(A[o++]=A[B++],x>1&&(A[o++]=A[B++]))}break}}break}}while(r>3,r-=x,g-=x<<3,b&=(1<>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new w.Buf16(320),this.work=new w.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=T,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new w.Buf32(bt),e.distcode=e.distdyn=new w.Buf32(gt),e.sane=1,e.back=-1,Z):N}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):N}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?N:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):N}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,a=o(t,e),a!==Z&&(t.state=null),a):N}function h(t){return l(t,wt)}function d(t){if(pt){var e;for(g=new w.Buf32(512),m=new w.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(z,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(B,t.lens,0,32,m,0,t.work,{bits:5}),pt=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function f(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(w.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(n=r.wsize-r.wnext,n>i&&(n=i),w.arraySet(r.window,e,a-i,n,r.wnext),i-=n,i?(w.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,a.check=v(a.check,Et,2,0),_=0,u=0,a.mode=F;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=_t;break}if((15&_)!==U){t.msg="unknown compression method",a.mode=_t;break}if(_>>>=4,u-=4,yt=(15&_)+8,0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=_t;break}a.dmax=1<>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=L;case L:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=v(a.check,Et,4,0)),_=0,u=0,a.mode=H;case H:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=j;case j:if(1024&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0}else a.head&&(a.head.extra=null);a.mode=K;case K:if(1024&a.flags&&(g=a.length,g>l&&(g=l),g&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),w.arraySet(a.head.extra,n,s,g,yt)),512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,a.length-=g),a.length))break t;a.length=0,a.mode=M;case M:if(2048&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt));while(yt&&g>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=X;break;case q:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<>>=7&u,u-=7&u,a.mode=ht;break}for(;u<3;){if(0===l)break t;l--,_+=n[s++]<>>=1,u-=1,3&_){case 0:a.mode=J;break;case 1:if(d(a),a.mode=at,e===A){_>>>=2,u-=2;break t}break;case 2:a.mode=$;break;case 3:t.msg="invalid block type",a.mode=_t}_>>>=2,u-=2;break;case J:for(_>>>=7&u,u-=7&u;u<32;){if(0===l)break t;l--,_+=n[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=_t;break}if(a.length=65535&_,_=0,u=0,a.mode=Q,e===A)break t;case Q:a.mode=V;case V:if(g=a.length){if(g>l&&(g=l),g>h&&(g=h),0===g)break t;w.arraySet(r,n,s,g,o),l-=g,s+=g,h-=g,o+=g,a.length-=g;break}a.mode=X;break;case $:for(;u<14;){if(0===l)break t; +l--,_+=n[s++]<>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Zr||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i>=7;i8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); diff --git a/node_modules/pako/dist/pako_deflate.js b/node_modules/pako/dist/pako_deflate.js new file mode 100755 index 00000000..a5f95720 --- /dev/null +++ b/node_modules/pako/dist/pako_deflate.js @@ -0,0 +1,3879 @@ +/* pako 0.2.9 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +},{"./common":1}],3:[function(require,module,exports){ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It doesn't worth to make additional optimizationa as in original. +// Small size is preferable. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; + +},{}],4:[function(require,module,exports){ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; + +},{}],5:[function(require,module,exports){ +'use strict'; + +var utils = require('../utils/common'); +var trees = require('./trees'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var msg = require('./messages'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +var Z_NO_FLUSH = 0; +var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +//var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +//var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +//var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + + +/* compression levels */ +//var Z_NO_COMPRESSION = 0; +//var Z_BEST_SPEED = 1; +//var Z_BEST_COMPRESSION = 9; +var Z_DEFAULT_COMPRESSION = -1; + + +var Z_FILTERED = 1; +var Z_HUFFMAN_ONLY = 2; +var Z_RLE = 3; +var Z_FIXED = 4; +var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +//var Z_BINARY = 0; +//var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + + +/* The deflate compression method */ +var Z_DEFLATED = 8; + +/*============================================================================*/ + + +var MAX_MEM_LEVEL = 9; +/* Maximum value for memLevel in deflateInit2 */ +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_MEM_LEVEL = 8; + + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ +var LITERALS = 256; +/* number of literal bytes 0..255 */ +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ +var D_CODES = 30; +/* number of distance codes */ +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + +var PRESET_DICT = 0x20; + +var INIT_STATE = 42; +var EXTRA_STATE = 69; +var NAME_STATE = 73; +var COMMENT_STATE = 91; +var HCRC_STATE = 103; +var BUSY_STATE = 113; +var FINISH_STATE = 666; + +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ +var BS_BLOCK_DONE = 2; /* block flush performed */ +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ + +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. + +function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; +} + +function rank(f) { + return ((f) << 1) - ((f) > 4 ? 9 : 0); +} + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->output buffer and copying into it. + * (See also read_buf()). + */ +function flush_pending(strm) { + var s = strm.state; + + //_tr_flush_bits(s); + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { return; } + + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } +} + + +function flush_block_only(s, last) { + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); +} + + +function put_byte(s, b) { + s.pending_buf[s.pending++] = b; +} + + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +function putShortMSB(s, b) { +// put_byte(s, (Byte)(b >> 8)); +// put_byte(s, (Byte)(b & 0xff)); + s.pending_buf[s.pending++] = (b >>> 8) & 0xff; + s.pending_buf[s.pending++] = b & 0xff; +} + + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->input buffer and copying from it. + * (See also flush_pending()). + */ +function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + + if (len > size) { len = size; } + if (len === 0) { return 0; } + + strm.avail_in -= len; + + // zmemcpy(buf, strm->next_in, len); + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } + + else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + + strm.next_in += len; + strm.total_in += len; + + return len; +} + + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; /* max hash chain length */ + var scan = s.strstart; /* current string */ + var match; /* matched string */ + var len; /* length of current match */ + var best_len = s.prev_length; /* best match length so far */ + var nice_match = s.nice_match; /* stop if match long enough */ + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; + + var _win = s.window; // shortcut + + var wmask = s.w_mask; + var prev = s.prev; + + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (nice_match > s.lookahead) { nice_match = s.lookahead; } + + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + // Assert(cur_match < s->strstart, "no future"); + match = cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ + + if (_win[match + best_len] !== scan_end || + _win[match + best_len - 1] !== scan_end1 || + _win[match] !== _win[scan] || + _win[++match] !== _win[scan + 1]) { + continue; + } + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2; + match++; + // Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + /*jshint noempty:false*/ + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + scan < strend); + + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; +} + + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = s.window_size - s.lookahead - s.strstart; + + // JS ints have 32 bit, block below not needed + /* Deal with !@#$% 64K limit: */ + //if (sizeof(int) <= 2) { + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + // more = wsize; + // + // } else if (more == (unsigned)(-1)) { + // /* Very unlikely, but possible on 16 bit machine if + // * strstart == 0 && lookahead == 1 (input done a byte at time) + // */ + // more--; + // } + //} + + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + /* we now have strstart >= MAX_DIST */ + s.block_start -= _w_size; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = (m >= _w_size ? m - _w_size : 0); + } while (--n); + + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = (m >= _w_size ? m - _w_size : 0); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); + + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + //Assert(more >= 2, "more < 2"); + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; +//#if MIN_MATCH != 3 +// Call update_hash() MIN_MATCH-3 more times +//#endif + while (s.insert) { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ +// if (s.high_water < s.window_size) { +// var curr = s.strstart + s.lookahead; +// var init = 0; +// +// if (s.high_water < curr) { +// /* Previous high water mark below current data -- zero WIN_INIT +// * bytes or up to end of window, whichever is less. +// */ +// init = s.window_size - curr; +// if (init > WIN_INIT) +// init = WIN_INIT; +// zmemzero(s->window + curr, (unsigned)init); +// s->high_water = curr + init; +// } +// else if (s->high_water < (ulg)curr + WIN_INIT) { +// /* High water mark at or above current data, but below current data +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up +// * to end of window, whichever is less. +// */ +// init = (ulg)curr + WIN_INIT - s->high_water; +// if (init > s->window_size - s->high_water) +// init = s->window_size - s->high_water; +// zmemzero(s->window + s->high_water, (unsigned)init); +// s->high_water += init; +// } +// } +// +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, +// "not enough room for search"); +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +function deflate_stored(s, flush) { + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + var max_block_size = 0xffff; + + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s.lookahead <= 1) { + + //Assert(s->strstart < s->w_size+MAX_DIST(s) || + // s->block_start >= (long)s->w_size, "slide too late"); +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || +// s.block_start >= s.w_size)) { +// throw new Error("slide too late"); +// } + + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + + if (s.lookahead === 0) { + break; + } + /* flush the current block */ + } + //Assert(s->block_start >= 0L, "block gone"); +// if (s.block_start < 0) throw new Error("block gone"); + + s.strstart += s.lookahead; + s.lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + var max_start = s.block_start + max_block_size; + + if (s.strstart === 0 || s.strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + + + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + + s.insert = 0; + + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + + if (s.strstart > s.block_start) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_NEED_MORE; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +function deflate_fast(s, flush) { + var hash_head; /* head of the hash chain */ + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; /* flush the current block */ + } + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + } + if (s.match_length >= MIN_MATCH) { + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only + + /*** _tr_tally_dist(s, s.strstart - s.match_start, + s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { + s.match_length--; /* string at strstart already in table */ + do { + s.strstart++; + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s.match_length !== 0); + s.strstart++; + } else + { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; + +//#if MIN_MATCH != 3 +// Call UPDATE_HASH() MIN_MATCH-3 more times +//#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s.window[s.strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +function deflate_slow(s, flush) { + var hash_head; /* head of hash chain */ + var bflush; /* set if current block must be flushed */ + + var max_insert; + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + */ + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && + s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + + if (s.match_length <= 5 && + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + //check_match(s, s.strstart-1, s.prev_match, s.prev_length); + + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, + s.prev_length - MIN_MATCH, bflush);***/ + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + } else if (s.match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + if (bflush) { + /*** FLUSH_BLOCK_ONLY(s, 0) ***/ + flush_block_only(s, false); + /***/ + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + //Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s.match_available) { + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_BLOCK_DONE; +} + + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +function deflate_rle(s, flush) { + var bflush; /* set if current block must be flushed */ + var prev; /* byte at distance one to match */ + var scan, strend; /* scan goes up to strend for length of run */ + + var _win = s.window; + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + /*jshint noempty:false*/ + } while (prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s.match_length >= MIN_MATCH) { + //check_match(s, s.strstart, s.strstart - 1, s.match_length); + + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +function deflate_huff(s, flush) { + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s.match_length = 0; + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; +} + +var configuration_table; + +configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), /* 3 */ + + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ +]; + + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +function lm_init(s) { + s.window_size = 2 * s.w_size; + + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + + /* Set the default configuration parameters: + */ + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; +} + + +function DeflateState() { + this.strm = null; /* pointer back to this zlib stream */ + this.status = 0; /* as the name implies */ + this.pending_buf = null; /* output still pending */ + this.pending_buf_size = 0; /* size of pending_buf */ + this.pending_out = 0; /* next pending byte to output to the stream */ + this.pending = 0; /* nb of bytes in the pending buffer */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.gzhead = null; /* gzip header information to write */ + this.gzindex = 0; /* where in extra, name, or comment */ + this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.last_flush = -1; /* value of flush param for previous deflate call */ + + this.w_size = 0; /* LZ77 window size (32K by default) */ + this.w_bits = 0; /* log2(w_size) (8..16) */ + this.w_mask = 0; /* w_size - 1 */ + + this.window = null; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. + */ + + this.window_size = 0; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + this.prev = null; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + this.head = null; /* Heads of the hash chains or NIL. */ + + this.ins_h = 0; /* hash index of string to be inserted */ + this.hash_size = 0; /* number of elements in hash table */ + this.hash_bits = 0; /* log2(hash_size) */ + this.hash_mask = 0; /* hash_size-1 */ + + this.hash_shift = 0; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + this.block_start = 0; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + this.match_length = 0; /* length of best match */ + this.prev_match = 0; /* previous match */ + this.match_available = 0; /* set if previous match exists */ + this.strstart = 0; /* start of string to insert */ + this.match_start = 0; /* start of matching string */ + this.lookahead = 0; /* number of valid bytes ahead in window */ + + this.prev_length = 0; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + this.max_chain_length = 0; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + this.max_lazy_match = 0; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ + // That's alias to max_lazy_match, don't use directly + //this.max_insert_length = 0; + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + this.level = 0; /* compression level (1..9) */ + this.strategy = 0; /* favor or force Huffman coding*/ + + this.good_match = 0; + /* Use a faster search when the previous match is longer than this */ + + this.nice_match = 0; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + + /* Didn't use ct_data typedef below to suppress compiler warning */ + + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + // Use flat array of DOUBLE size, with interleaved fata, + // because JS does not support effective + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + + this.l_desc = null; /* desc. for literal tree */ + this.d_desc = null; /* desc. for distance tree */ + this.bl_desc = null; /* desc. for bit length tree */ + + //ush bl_count[MAX_BITS+1]; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + /* number of codes at each bit length for an optimal tree */ + + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); + + this.heap_len = 0; /* number of elements in the heap */ + this.heap_max = 0; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + this.l_buf = 0; /* buffer index for literals or lengths */ + + this.lit_bufsize = 0; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + this.last_lit = 0; /* running index in l_buf */ + + this.d_buf = 0; + /* Buffer index for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + this.opt_len = 0; /* bit length of current block with optimal trees */ + this.static_len = 0; /* bit length of current block with static trees */ + this.matches = 0; /* number of string matches in current block */ + this.insert = 0; /* bytes at end of window left to insert */ + + + this.bi_buf = 0; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + this.bi_valid = 0; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + // Used for window memory init. We safely ignore it for JS. That makes + // sense only for pointers and memory check tools. + //this.high_water = 0; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ +} + + +function deflateResetKeep(strm) { + var s; + + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + + s = strm.state; + s.pending = 0; + s.pending_out = 0; + + if (s.wrap < 0) { + s.wrap = -s.wrap; + /* was made negative by deflate(..., Z_FINISH); */ + } + s.status = (s.wrap ? INIT_STATE : BUSY_STATE); + strm.adler = (s.wrap === 2) ? + 0 // crc32(0, Z_NULL, 0) + : + 1; // adler32(0, Z_NULL, 0) + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; +} + + +function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; +} + + +function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + strm.state.gzhead = head; + return Z_OK; +} + + +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { // === Z_NULL + return Z_STREAM_ERROR; + } + var wrap = 1; + + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } + + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } + + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + + + if (windowBits === 8) { + windowBits = 9; + } + /* until 256-byte window bug fixed */ + + var s = new DeflateState(); + + strm.state = s; + s.strm = strm; + + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + + // Don't need mem init magic for JS. + //s.high_water = 0; /* nothing written to s->window yet */ + + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + s.pending_buf_size = s.lit_bufsize * 4; + + //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + //s->pending_buf = (uchf *) overlay; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + + // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) + //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s.d_buf = 1 * s.lit_bufsize; + + //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + s.l_buf = (1 + 2) * s.lit_bufsize; + + s.level = level; + s.strategy = strategy; + s.method = method; + + return deflateReset(strm); +} + +function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +} + + +function deflate(strm, flush) { + var old_flush, s; + var beg, val; // for gzip header write only + + if (!strm || !strm.state || + flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + + s = strm.state; + + if (!strm.output || + (!strm.input && strm.avail_in !== 0) || + (s.status === FINISH_STATE && flush !== Z_FINISH)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + + s.strm = strm; /* just in case */ + old_flush = s.last_flush; + s.last_flush = flush; + + /* Write the header */ + if (s.status === INIT_STATE) { + + if (s.wrap === 2) { // GZIP header + strm.adler = 0; //crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { // s->gzhead == Z_NULL + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } + else { + put_byte(s, (s.gzhead.text ? 1 : 0) + + (s.gzhead.hcrc ? 2 : 0) + + (!s.gzhead.extra ? 0 : 4) + + (!s.gzhead.name ? 0 : 8) + + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 0xff); + put_byte(s, (s.gzhead.time >> 8) & 0xff); + put_byte(s, (s.gzhead.time >> 16) & 0xff); + put_byte(s, (s.gzhead.time >> 24) & 0xff); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, s.gzhead.os & 0xff); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 0xff); + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + else // DEFLATE header + { + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + var level_flags = -1; + + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= (level_flags << 6); + if (s.strstart !== 0) { header |= PRESET_DICT; } + header += 31 - (header % 31); + + s.status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + strm.adler = 1; // adler32(0L, Z_NULL, 0); + } + } + +//#ifdef GZIP + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } + else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } + else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } + else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + strm.adler = 0; //crc32(0L, Z_NULL, 0); + s.status = BUSY_STATE; + } + } + else { + s.status = BUSY_STATE; + } + } +//#endif + + /* Flush as much pending output as possible */ + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s.last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && + flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm.avail_in !== 0 || s.lookahead !== 0 || + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : + (s.strategy === Z_RLE ? deflate_rle(s, flush) : + configuration_table[s.level].func(s, flush)); + + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + + trees._tr_stored_block(s, 0, 0, false); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush === Z_FULL_FLUSH) { + /*** CLEAR_HASH(s); ***/ /* forget history */ + zero(s.head); // Fill with NIL (= 0); + + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + //Assert(strm->avail_out > 0, "bug2"); + //if (strm.avail_out <= 0) { throw new Error("bug2");} + + if (flush !== Z_FINISH) { return Z_OK; } + if (s.wrap <= 0) { return Z_STREAM_END; } + + /* Write the trailer */ + if (s.wrap === 2) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + put_byte(s, (strm.adler >> 16) & 0xff); + put_byte(s, (strm.adler >> 24) & 0xff); + put_byte(s, strm.total_in & 0xff); + put_byte(s, (strm.total_in >> 8) & 0xff); + put_byte(s, (strm.total_in >> 16) & 0xff); + put_byte(s, (strm.total_in >> 24) & 0xff); + } + else + { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s.wrap > 0) { s.wrap = -s.wrap; } + /* write the trailer only once! */ + return s.pending !== 0 ? Z_OK : Z_STREAM_END; +} + +function deflateEnd(strm) { + var status; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + status = strm.state.status; + if (status !== INIT_STATE && + status !== EXTRA_STATE && + status !== NAME_STATE && + status !== COMMENT_STATE && + status !== HCRC_STATE && + status !== BUSY_STATE && + status !== FINISH_STATE + ) { + return err(strm, Z_STREAM_ERROR); + } + + strm.state = null; + + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; +} + + +/* ========================================================================= + * Initializes the compression dictionary from the given byte + * sequence without producing any compressed output. + */ +function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var s; + var str, n; + var wrap; + var avail; + var next; + var input; + var tmpDict; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + s = strm.state; + wrap = s.wrap; + + if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { + return Z_STREAM_ERROR; + } + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap === 1) { + /* adler32(strm->adler, dictionary, dictLength); */ + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + + s.wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s.w_size) { + if (wrap === 0) { /* already empty otherwise */ + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + /* use the tail */ + // dictionary = dictionary.slice(dictLength - s.w_size); + tmpDict = new utils.Buf8(s.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + /* insert dictionary into window and hash */ + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + str = s.strstart; + n = s.lookahead - (MIN_MATCH - 1); + do { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK; +} + + +exports.deflateInit = deflateInit; +exports.deflateInit2 = deflateInit2; +exports.deflateReset = deflateReset; +exports.deflateResetKeep = deflateResetKeep; +exports.deflateSetHeader = deflateSetHeader; +exports.deflate = deflate; +exports.deflateEnd = deflateEnd; +exports.deflateSetDictionary = deflateSetDictionary; +exports.deflateInfo = 'pako deflate (from Nodeca project)'; + +/* Not implemented +exports.deflateBound = deflateBound; +exports.deflateCopy = deflateCopy; +exports.deflateParams = deflateParams; +exports.deflatePending = deflatePending; +exports.deflatePrime = deflatePrime; +exports.deflateTune = deflateTune; +*/ + +},{"../utils/common":1,"./adler32":3,"./crc32":4,"./messages":6,"./trees":7}],6:[function(require,module,exports){ +'use strict'; + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; + +},{}],7:[function(require,module,exports){ +'use strict'; + + +var utils = require('../utils/common'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +//var Z_FILTERED = 1; +//var Z_HUFFMAN_ONLY = 2; +//var Z_RLE = 3; +var Z_FIXED = 4; +//var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +var Z_BINARY = 0; +var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + +/*============================================================================*/ + + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + +// From zutil.h + +var STORED_BLOCK = 0; +var STATIC_TREES = 1; +var DYN_TREES = 2; +/* The three kinds of block type */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +/* The minimum and maximum match lengths */ + +// From deflate.h +/* =========================================================================== + * Internal compression state. + */ + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ + +var LITERALS = 256; +/* number of literal bytes 0..255 */ + +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ + +var D_CODES = 30; +/* number of distance codes */ + +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ + +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ + +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var Buf_size = 16; +/* size of bit buffer in bi_buf */ + + +/* =========================================================================== + * Constants + */ + +var MAX_BL_BITS = 7; +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +var END_BLOCK = 256; +/* end of block literal code */ + +var REP_3_6 = 16; +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +var REPZ_3_10 = 17; +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +var REPZ_11_138 = 18; +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +/* eslint-disable comma-spacing,array-bracket-spacing */ +var extra_lbits = /* extra bits for each length code */ + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; + +var extra_dbits = /* extra bits for each distance code */ + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; + +var extra_blbits = /* extra bits for each bit length code */ + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; + +var bl_order = + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +/* eslint-enable comma-spacing,array-bracket-spacing */ + +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +// We pre-fill arrays with 0 to avoid uninitialized gaps + +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ + +// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1 +var static_ltree = new Array((L_CODES + 2) * 2); +zero(static_ltree); +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +var static_dtree = new Array(D_CODES * 2); +zero(static_dtree); +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +var _dist_code = new Array(DIST_CODE_LEN); +zero(_dist_code); +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); +zero(_length_code); +/* length code for each normalized match length (0 == MIN_MATCH) */ + +var base_length = new Array(LENGTH_CODES); +zero(base_length); +/* First normalized length for each code (0 = MIN_MATCH) */ + +var base_dist = new Array(D_CODES); +zero(base_dist); +/* First normalized distance for each code (0 = distance of 1) */ + + +function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + + this.static_tree = static_tree; /* static tree or NULL */ + this.extra_bits = extra_bits; /* extra bits for each code or NULL */ + this.extra_base = extra_base; /* base index for extra_bits */ + this.elems = elems; /* max number of elements in the tree */ + this.max_length = max_length; /* max bit length for the codes */ + + // show if `static_tree` has data or dummy - needed for monomorphic objects + this.has_stree = static_tree && static_tree.length; +} + + +var static_l_desc; +var static_d_desc; +var static_bl_desc; + + +function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; /* the dynamic tree */ + this.max_code = 0; /* largest code with non zero frequency */ + this.stat_desc = stat_desc; /* the corresponding static tree */ +} + + + +function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; +} + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +function put_short(s, w) { +// put_byte(s, (uch)((w) & 0xff)); +// put_byte(s, (uch)((ush)(w) >> 8)); + s.pending_buf[s.pending++] = (w) & 0xff; + s.pending_buf[s.pending++] = (w >>> 8) & 0xff; +} + + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +function send_bits(s, value, length) { + if (s.bi_valid > (Buf_size - length)) { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + put_short(s, s.bi_buf); + s.bi_buf = value >> (Buf_size - s.bi_valid); + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + s.bi_valid += length; + } +} + + +function send_code(s, c, tree) { + send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); +} + + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; +} + + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 0xff; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } +} + + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +function gen_bitlen(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; /* heap index */ + var n, m; /* iterate over the tree elements */ + var bits; /* bit length */ + var xbits; /* extra bits */ + var f; /* frequency */ + var overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1]/*.Len*/ = bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) { continue; } /* not a leaf node */ + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]/*.Freq*/; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); + } + } + if (overflow === 0) { return; } + + // Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { bits--; } + s.bl_count[bits]--; /* move one leaf down the tree */ + s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ + s.bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { continue; } + if (tree[m * 2 + 1]/*.Len*/ !== bits) { + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; + tree[m * 2 + 1]/*.Len*/ = bits; + } + n--; + } + } +} + + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +function gen_codes(tree, max_code, bl_count) +// ct_data *tree; /* the tree to decorate */ +// int max_code; /* largest code with non zero frequency */ +// ushf *bl_count; /* number of codes at each bit length */ +{ + var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + var code = 0; /* running code value */ + var bits; /* bit index */ + var n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits - 1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n = 0; n < (1 << extra_lbits[code]); n++) { + _length_code[length++] = code; + } + } + //Assert (length == 256, "tr_static_init: length != 256"); + /* Note that the length 255 (match length 258) can be represented + * in two different ways: code 284 + 5 bits or code 285, so we + * overwrite length_code[255] to use the best encoding: + */ + _length_code[length - 1] = code; + + /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1 << extra_dbits[code]); n++) { + _dist_code[dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: dist != 256"); + dist >>= 7; /* from now on, all distances are divided by 128 */ + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { + _dist_code[256 + dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1]/*.Len*/ = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1]/*.Len*/ = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes(static_ltree, L_CODES + 1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n * 2 + 1]/*.Len*/ = 5; + static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); + } + + // Now data ready and we can init static trees + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + + //static_init_done = true; +} + + +/* =========================================================================== + * Initialize a new block. + */ +function init_block(s) { + var n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + + s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; +} + + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +function bi_windup(s) +{ + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + //put_byte(s, (Byte)s->bi_buf); + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +function copy_block(s, buf, len, header) +//DeflateState *s; +//charf *buf; /* the input data */ +//unsigned len; /* its length */ +//int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, len); + put_short(s, ~len); + } +// while (len--) { +// put_byte(s, *buf++); +// } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); +} + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +function pqdownheap(s, tree, k) +// deflate_state *s; +// ct_data *tree; /* the tree to restore */ +// int k; /* node to move down */ +{ + var v = s.heap[k]; + var j = k << 1; /* left son of k */ + while (j <= s.heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s.heap_len && + smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s.heap[j], s.depth)) { break; } + + /* Exchange v with the smallest son */ + s.heap[k] = s.heap[j]; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s.heap[k] = v; +} + + +// inlined manually +// var SMALLEST = 1; + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +function compress_block(s, ltree, dtree) +// deflate_state *s; +// const ct_data *ltree; /* literal tree */ +// const ct_data *dtree; /* distance tree */ +{ + var dist; /* distance of matched string */ + var lc; /* match length or unmatched char (if dist == 0) */ + var lx = 0; /* running index in l_buf */ + var code; /* the code to send */ + var extra; /* number of extra bits to send */ + + if (s.last_lit !== 0) { + do { + dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); + lc = s.pending_buf[s.l_buf + lx]; + lx++; + + if (dist === 0) { + send_code(s, lc, ltree); /* send a literal byte */ + //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + //Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + // "pendingBuf overflow"); + + } while (lx < s.last_lit); + } + + send_code(s, END_BLOCK, ltree); +} + + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +function build_tree(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; /* iterate over heap elements */ + var max_code = -1; /* largest code with non zero frequency */ + var node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n * 2]/*.Freq*/ !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + + } else { + tree[n * 2 + 1]/*.Len*/ = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); + tree[node * 2]/*.Freq*/ = 1; + s.depth[node] = 0; + s.opt_len--; + + if (has_stree) { + s.static_len -= stree[node * 2 + 1]/*.Len*/; + } + /* node is 0 or 1 so it does not have extra bits */ + } + desc.max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + //pqremove(s, tree, n); /* n = node of least frequency */ + /*** pqremove ***/ + n = s.heap[1/*SMALLEST*/]; + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1/*SMALLEST*/); + /***/ + + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ + + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ + s.heap[--s.heap_max] = m; + + /* Create a new node father of n and m */ + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; + + /* and insert the new node in the heap */ + s.heap[1/*SMALLEST*/] = node++; + pqdownheap(s, tree, 1/*SMALLEST*/); + + } while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes(tree, max_code, s.bl_count); +} + + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +function scan_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + s.bl_tree[curlen * 2]/*.Freq*/ += count; + + } else if (curlen !== 0) { + + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } + s.bl_tree[REP_3_6 * 2]/*.Freq*/++; + + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; + + } else { + s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; + } + + count = 0; + prevlen = curlen; + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +function send_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); + + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + //Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +function build_bl_tree(s) { + var max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, s.bl_desc); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { + break; + } + } + /* Update opt_len to include the bit length tree and counts */ + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + // s->opt_len, s->static_len)); + + return max_blindex; +} + + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +function send_all_trees(s, lcodes, dcodes, blcodes) +// deflate_state *s; +// int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + var rank; /* index in bl_order */ + + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + // "too many codes"); + //Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); + } + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +function detect_data_type(s) { + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + var black_mask = 0xf3ffc07f; + var n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { + return Z_BINARY; + } + } + + /* Check for textual ("white-listed") bytes. */ + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + } + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + + +var static_init_done = false; + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +function _tr_init(s) +{ + + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + + s.bi_buf = 0; + s.bi_valid = 0; + + /* Initialize the first block of the first file: */ + init_block(s); +} + + +/* =========================================================================== + * Send a stored block + */ +function _tr_stored_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ + copy_block(s, buf, stored_len, true); /* with header */ +} + + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); +} + + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +function _tr_flush_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block, or NULL if too old */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + var max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s.level > 0) { + + /* Check if the file is binary or text */ + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + + /* Construct the literal and distance trees */ + build_tree(s, s.l_desc); + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + + build_tree(s, s.d_desc); + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s.opt_len + 3 + 7) >>> 3; + static_lenb = (s.static_len + 3 + 7) >>> 3; + + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + // s->last_lit)); + + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } + + } else { + // Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + + if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { + /* 4: two words for the lengths */ + + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); + } + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + // s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +function _tr_tally(s, dist, lc) +// deflate_state *s; +// unsigned dist; /* distance of matched string */ +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + //var out_length, in_length, dcode; + + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; + + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; + s.last_lit++; + + if (dist === 0) { + /* lc is the unmatched char */ + s.dyn_ltree[lc * 2]/*.Freq*/++; + } else { + s.matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + //Assert((ush)dist < (ush)MAX_DIST(s) && + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility + +//#ifdef TRUNCATE_BLOCK +// /* Try to guess if it is profitable to stop the current block here */ +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { +// /* Compute an upper bound for the compressed length */ +// out_length = s.last_lit*8; +// in_length = s.strstart - s.block_start; +// +// for (dcode = 0; dcode < D_CODES; dcode++) { +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); +// } +// out_length >>>= 3; +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", +// // s->last_lit, in_length, out_length, +// // 100L - out_length*100L/in_length)); +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { +// return true; +// } +// } +//#endif + + return (s.last_lit === s.lit_bufsize - 1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +exports._tr_init = _tr_init; +exports._tr_stored_block = _tr_stored_block; +exports._tr_flush_block = _tr_flush_block; +exports._tr_tally = _tr_tally; +exports._tr_align = _tr_align; + +},{"../utils/common":1}],8:[function(require,module,exports){ +'use strict'; + + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; + +},{}],"/lib/deflate.js":[function(require,module,exports){ +'use strict'; + + +var zlib_deflate = require('./zlib/deflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); + +var toString = Object.prototype.toString; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + +var Z_NO_FLUSH = 0; +var Z_FINISH = 4; + +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_SYNC_FLUSH = 2; + +var Z_DEFAULT_COMPRESSION = -1; + +var Z_DEFAULT_STRATEGY = 0; + +var Z_DEFLATED = 8; + +/* ===========================================================================*/ + + +/** + * class Deflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[deflate]], + * [[deflateRaw]] and [[gzip]]. + **/ + +/* internal + * Deflate.chunks -> Array + * + * Chunks of output data, if [[Deflate#onData]] not overriden. + **/ + +/** + * Deflate.result -> Uint8Array|Array + * + * Compressed result, generated by default [[Deflate#onData]] + * and [[Deflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Deflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Deflate.err -> Number + * + * Error code after deflate finished. 0 (Z_OK) on success. + * You will not need it in real life, because deflate errors + * are possible only on wrong options or bad `onData` / `onEnd` + * custom handlers. + **/ + +/** + * Deflate.msg -> String + * + * Error message, if [[Deflate.err]] != 0 + **/ + + +/** + * new Deflate(options) + * - options (Object): zlib deflate options. + * + * Creates new deflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `level` + * - `windowBits` + * - `memLevel` + * - `strategy` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw deflate + * - `gzip` (Boolean) - create gzip wrapper + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * - `header` (Object) - custom header for gzip + * - `text` (Boolean) - true if compressed data believed to be text + * - `time` (Number) - modification time, unix timestamp + * - `os` (Number) - operation system code + * - `extra` (Array) - array of bytes with extra data (max 65536) + * - `name` (String) - file name (binary string) + * - `comment` (String) - comment (binary string) + * - `hcrc` (Boolean) - true if header crc should be added + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var deflate = new pako.Deflate({ level: 3}); + * + * deflate.push(chunk1, false); + * deflate.push(chunk2, true); // true -> last chunk + * + * if (deflate.err) { throw new Error(deflate.err); } + * + * console.log(deflate.result); + * ``` + **/ +function Deflate(options) { + if (!(this instanceof Deflate)) return new Deflate(options); + + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: '' + }, options || {}); + + var opt = this.options; + + if (opt.raw && (opt.windowBits > 0)) { + opt.windowBits = -opt.windowBits; + } + + else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { + opt.windowBits += 16; + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_deflate.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + + if (opt.dictionary) { + var dict; + // Convert data if needed + if (typeof opt.dictionary === 'string') { + // If we need to compress text, change encoding to utf8. + dict = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + + status = zlib_deflate.deflateSetDictionary(this.strm, dict); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + this._dict_set = true; + } +} + +/** + * Deflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be + * converted to utf8 byte sequence. + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with + * new compressed chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the compression context. + * + * On fail call [[Deflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * array format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Deflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + + if (this.ended) { return false; } + + _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // If we need to compress text, change encoding to utf8. + strm.input = strings.string2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ + + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { + if (this.options.to === 'string') { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + + // Finalize on the last chunk. + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === Z_SYNC_FLUSH) { + this.onEnd(Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Deflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Deflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Deflate#onEnd(status) -> Void + * - status (Number): deflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell deflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Deflate.prototype.onEnd = function (status) { + // On success - join + if (status === Z_OK) { + if (this.options.to === 'string') { + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * deflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * Compress `data` with deflate algorithm and `options`. + * + * Supported options are: + * + * - level + * - windowBits + * - memLevel + * - strategy + * - dictionary + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); + * + * console.log(pako.deflate(data)); + * ``` + **/ +function deflate(input, options) { + var deflator = new Deflate(options); + + deflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (deflator.err) { throw deflator.msg; } + + return deflator.result; +} + + +/** + * deflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); +} + + +/** + * gzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but create gzip wrapper instead of + * deflate one. + **/ +function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); +} + + +exports.Deflate = Deflate; +exports.deflate = deflate; +exports.deflateRaw = deflateRaw; +exports.gzip = gzip; + +},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js") +}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako_deflate.min.js b/node_modules/pako/dist/pako_deflate.min.js new file mode 100755 index 00000000..b307f853 --- /dev/null +++ b/node_modules/pako/dist/pako_deflate.min.js @@ -0,0 +1,2 @@ +/* pako 0.2.9 nodeca/pako */ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pako=t()}}(function(){return function t(e,a,n){function r(s,h){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!h&&l)return l(s,!0);if(i)return i(s,!0);var o=new Error("Cannot find module '"+s+"'");throw o.code="MODULE_NOT_FOUND",o}var _=a[s]={exports:{}};e[s][0].call(_.exports,function(t){var a=e[s][1][t];return r(a?a:t)},_,_.exports,t,e,a,n)}return a[s].exports}for(var i="function"==typeof require&&require,s=0;s=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;h[254]=h[254]=1,a.string2buf=function(t){var e,a,n,i,s,h=t.length,l=0;for(i=0;i>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return n(t,t.length)},a.binstring2buf=function(t){for(var e=new r.Buf8(t.length),a=0,n=e.length;a4)o[r++]=65533,a+=s-1;else{for(i&=2===s?31:3===s?15:7;s>1&&a1?o[r++]=65533:i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|1023&i)}return n(o,r)},a.utf8border=function(t,e){var a;for(e=e||t.length,e>t.length&&(e=t.length),a=e-1;a>=0&&128===(192&t[a]);)a--;return a<0?e:0===a?e:a+h[t[a]]>e?a:e}},{"./common":1}],3:[function(t,e,a){"use strict";function n(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){s=a>2e3?2e3:a,a-=s;do r=r+e[n++]|0,i=i+r|0;while(--s);r%=65521,i%=65521}return r|i<<16|0}e.exports=n},{}],4:[function(t,e,a){"use strict";function n(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}function r(t,e,a,n){var r=i,s=n+a;t^=-1;for(var h=n;h>>8^r[255&(t^e[h])];return t^-1}var i=n();e.exports=r},{}],5:[function(t,e,a){"use strict";function n(t,e){return t.msg=O[e],e}function r(t){return(t<<1)-(t>4?9:0)}function i(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(j.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function h(t,e){U._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function o(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function _(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,j.arraySet(e,t.input,t.next_in,r,a),1===t.state.wrap?t.adler=D(t.adler,e,r,a):2===t.state.wrap&&(t.adler=I(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)}function d(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-dt?t.strstart-(t.w_size-dt):0,o=t.window,_=t.w_mask,d=t.prev,u=t.strstart+_t,f=o[i+s-1],c=o[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do if(a=e,o[a+s]===c&&o[a+s-1]===f&&o[a]===o[i]&&o[++a]===o[i+1]){i+=2,a++;do;while(o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&is){if(t.match_start=e,s=n,n>=h)break;f=o[i+s-1],c=o[i+s]}}while((e=d[e&_])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead}function u(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-dt)){j.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,a=t.hash_size,e=a;do n=t.head[--e],t.head[e]=n>=s?n-s:0;while(--a);a=s,e=a;do n=t.prev[--e],t.prev[e]=n>=s?n-s:0;while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=_(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=ot)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(u(t),0===t.lookahead&&e===q)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,h(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-dt&&(h(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===N?(h(t,!0),0===t.strm.avail_out?kt:zt):t.strstart>t.block_start&&(h(t,!1),0===t.strm.avail_out)?vt:vt}function c(t,e){for(var a,n;;){if(t.lookahead=ot&&(t.ins_h=(t.ins_h<=ot)if(n=U._tr_tally(t,t.strstart-t.match_start,t.match_length-ot),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ot){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=ot&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ot-1)),t.prev_length>=ot&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-ot,n=U._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ot),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=r&&(t.ins_h=(t.ins_h<=ot&&t.strstart>0&&(r=t.strstart-1,n=s[r],n===s[++r]&&n===s[++r]&&n===s[++r])){i=t.strstart+_t;do;while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ot?(a=U._tr_tally(t,1,t.match_length-ot),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=U._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(h(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===N?(h(t,!0),0===t.strm.avail_out?kt:zt):t.last_lit&&(h(t,!1),0===t.strm.avail_out)?vt:yt}function m(t,e){for(var a;;){if(0===t.lookahead&&(u(t),0===t.lookahead)){if(e===q)return vt;break}if(t.match_length=0,a=U._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(h(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===N?(h(t,!0),0===t.strm.avail_out?kt:zt):t.last_lit&&(h(t,!1),0===t.strm.avail_out)?vt:yt}function b(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}function w(t){t.window_size=2*t.w_size,i(t.head),t.max_lazy_match=E[t.level].max_lazy,t.good_match=E[t.level].good_length,t.nice_match=E[t.level].nice_length,t.max_chain_length=E[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ot-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new j.Buf16(2*ht),this.dyn_dtree=new j.Buf16(2*(2*it+1)),this.bl_tree=new j.Buf16(2*(2*st+1)),i(this.dyn_ltree),i(this.dyn_dtree),i(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new j.Buf16(lt+1),this.heap=new j.Buf16(2*rt+1),i(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new j.Buf16(2*rt+1),i(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function y(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Y,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ft:bt,t.adler=2===e.wrap?0:1,e.last_flush=q,U._tr_init(e),H):n(t,K)}function k(t){var e=y(t);return e===H&&w(t.state),e}function z(t,e){return t&&t.state?2!==t.state.wrap?K:(t.state.gzhead=e,H):K}function x(t,e,a,r,i,s){if(!t)return K;var h=1;if(e===G&&(e=6),r<0?(h=0,r=-r):r>15&&(h=2,r-=16),i<1||i>$||a!==Z||r<8||r>15||e<0||e>9||s<0||s>W)return n(t,K);8===r&&(r=9);var l=new v;return t.state=l,l.strm=t,l.wrap=h,l.gzhead=null,l.w_bits=r,l.w_size=1<R||e<0)return t?n(t,K):K;if(h=t.state,!t.output||!t.input&&0!==t.avail_in||h.status===wt&&e!==N)return n(t,0===t.avail_out?P:K);if(h.strm=t,a=h.last_flush,h.last_flush=e,h.status===ft)if(2===h.wrap)t.adler=0,l(h,31),l(h,139),l(h,8),h.gzhead?(l(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),l(h,255&h.gzhead.time),l(h,h.gzhead.time>>8&255),l(h,h.gzhead.time>>16&255),l(h,h.gzhead.time>>24&255),l(h,9===h.level?2:h.strategy>=Q||h.level<2?4:0),l(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(l(h,255&h.gzhead.extra.length),l(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(t.adler=I(t.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=ct):(l(h,0),l(h,0),l(h,0),l(h,0),l(h,0),l(h,9===h.level?2:h.strategy>=Q||h.level<2?4:0),l(h,xt),h.status=bt);else{var u=Z+(h.w_bits-8<<4)<<8,f=-1;f=h.strategy>=Q||h.level<2?0:h.level<6?1:6===h.level?2:3,u|=f<<6,0!==h.strstart&&(u|=ut),u+=31-u%31,h.status=bt,o(h,u),0!==h.strstart&&(o(h,t.adler>>>16),o(h,65535&t.adler)),t.adler=1}if(h.status===ct)if(h.gzhead.extra){for(_=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>_&&(t.adler=I(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending!==h.pending_buf_size));)l(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>_&&(t.adler=I(t.adler,h.pending_buf,h.pending-_,_)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=pt)}else h.status=pt;if(h.status===pt)if(h.gzhead.name){_=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>_&&(t.adler=I(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending===h.pending_buf_size)){d=1;break}d=h.gzindex_&&(t.adler=I(t.adler,h.pending_buf,h.pending-_,_)),0===d&&(h.gzindex=0,h.status=gt)}else h.status=gt;if(h.status===gt)if(h.gzhead.comment){_=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>_&&(t.adler=I(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending===h.pending_buf_size)){d=1;break}d=h.gzindex_&&(t.adler=I(t.adler,h.pending_buf,h.pending-_,_)),0===d&&(h.status=mt)}else h.status=mt;if(h.status===mt&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&s(t),h.pending+2<=h.pending_buf_size&&(l(h,255&t.adler),l(h,t.adler>>8&255),t.adler=0,h.status=bt)):h.status=bt),0!==h.pending){if(s(t),0===t.avail_out)return h.last_flush=-1,H}else if(0===t.avail_in&&r(e)<=r(a)&&e!==N)return n(t,P);if(h.status===wt&&0!==t.avail_in)return n(t,P);if(0!==t.avail_in||0!==h.lookahead||e!==q&&h.status!==wt){var c=h.strategy===Q?m(h,e):h.strategy===V?g(h,e):E[h.level].func(h,e);if(c!==kt&&c!==zt||(h.status=wt),c===vt||c===kt)return 0===t.avail_out&&(h.last_flush=-1),H;if(c===yt&&(e===T?U._tr_align(h):e!==R&&(U._tr_stored_block(h,0,0,!1),e===L&&(i(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),s(t),0===t.avail_out))return h.last_flush=-1,H}return e!==N?H:h.wrap<=0?F:(2===h.wrap?(l(h,255&t.adler),l(h,t.adler>>8&255),l(h,t.adler>>16&255),l(h,t.adler>>24&255),l(h,255&t.total_in),l(h,t.total_in>>8&255),l(h,t.total_in>>16&255),l(h,t.total_in>>24&255)):(o(h,t.adler>>>16),o(h,65535&t.adler)),s(t),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?H:F)}function C(t){var e;return t&&t.state?(e=t.state.status,e!==ft&&e!==ct&&e!==pt&&e!==gt&&e!==mt&&e!==bt&&e!==wt?n(t,K):(t.state=null,e===bt?n(t,M):H)):K}function S(t,e){var a,n,r,s,h,l,o,_,d=e.length;if(!t||!t.state)return K;if(a=t.state,s=a.wrap,2===s||1===s&&a.status!==ft||a.lookahead)return K;for(1===s&&(t.adler=D(t.adler,e,d,0)),a.wrap=0,d>=a.w_size&&(0===s&&(i(a.head),a.strstart=0,a.block_start=0,a.insert=0),_=new j.Buf8(a.w_size),j.arraySet(_,e,d-a.w_size,a.w_size,0),e=_,d=a.w_size),h=t.avail_in,l=t.next_in,o=t.input,t.avail_in=d,t.next_in=0,t.input=e,u(a);a.lookahead>=ot;){n=a.strstart,r=a.lookahead-(ot-1);do a.ins_h=(a.ins_h<=0;)t[e]=0}function r(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function i(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function h(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<>>=1,a<<=1;while(--e>0);return a>>>1}function d(t){16===t.bi_valid?(h(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function u(t,e){var a,n,r,i,s,h,l=e.dyn_tree,o=e.max_code,_=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=V;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(i=c,p++),l[2*n+1]=i,n>o||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(_[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)r=t.heap[--a],r>o||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}function f(t,e,a){var n,r,i=new Array(V+1),s=0;for(n=1;n<=V;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=_(i[h]++,h))}}function c(){var t,e,a,n,i,s=new Array(V+1);for(a=0,n=0;n>=7;n8?h(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,n){g(t),n&&(h(t,a),h(t,~a)),D.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function b(t,e,a,n){var r=2*e,i=2*a;return t[r]>1;a>=1;a--)w(t,i,a);r=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],w(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,w(t,i,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],u(t,e),f(i,o,t.bl_count)}function k(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,o=4;for(0===s&&(l=138,o=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h=3&&0===t.bl_tree[2*rt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,n){var r;for(l(t,e-257,5),l(t,a-1,5),l(t,n-4,4),r=0;r>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return O;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return q;for(e=32;e0?(t.strm.data_type===T&&(t.strm.data_type=A(t)),y(t,t.l_desc),y(t,t.d_desc),s=x(t),r=t.opt_len+3+7>>>3,i=t.static_len+3+7>>>3,i<=r&&(r=i)):r=i=a+5,a+4<=r&&e!==-1?S(t,e,a,n):t.strategy===I||i===r?(l(t,(N<<1)+(n?1:0),3),v(t,st,ht)):(l(t,(R<<1)+(n?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),p(t),n&&g(t)}function U(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ot[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var D=t("../utils/common"),I=4,O=0,q=1,T=2,L=0,N=1,R=2,H=3,F=258,K=29,M=256,P=M+1+K,G=30,J=19,Q=2*P+1,V=15,W=16,X=7,Y=256,Z=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],nt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],it=512,st=new Array(2*(P+2));n(st);var ht=new Array(2*G);n(ht);var lt=new Array(it);n(lt);var ot=new Array(F-H+1);n(ot);var _t=new Array(K);n(_t);var dt=new Array(G);n(dt);var ut,ft,ct,pt=!1;a._tr_init=C,a._tr_stored_block=S,a._tr_flush_block=j,a._tr_tally=U,a._tr_align=E},{"../utils/common":1}],8:[function(t,e,a){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=n},{}],"/lib/deflate.js":[function(t,e,a){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.options=l.assign({level:b,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:w,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var a=h.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==p)throw new Error(_[a]);if(e.header&&h.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(r="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=h.deflateSetDictionary(this.strm,r),a!==p)throw new Error(_[a]);this._dict_set=!0}}function r(t,e){var a=new n(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function i(t,e){return e=e||{},e.raw=!0,r(t,e)}function s(t,e){return e=e||{},e.gzip=!0,r(t,e)}var h=t("./zlib/deflate"),l=t("./utils/common"),o=t("./utils/strings"),_=t("./zlib/messages"),d=t("./zlib/zstream"),u=Object.prototype.toString,f=0,c=4,p=0,g=1,m=2,b=-1,w=0,v=8;n.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;n=e===~~e?e:e===!0?c:f,"string"==typeof t?r.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new l.Buf8(i),r.next_out=0,r.avail_out=i),a=h.deflate(r,n),a!==g&&a!==p)return this.onEnd(a),this.ended=!0,!1;0!==r.avail_out&&(0!==r.avail_in||n!==c&&n!==m)||("string"===this.options.to?this.onData(o.buf2binstring(l.shrinkBuf(r.output,r.next_out))):this.onData(l.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||0===r.avail_out)&&a!==g);return n===c?(a=h.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===p):n!==m||(this.onEnd(p),r.avail_out=0,!0)},n.prototype.onData=function(t){this.chunks.push(t)},n.prototype.onEnd=function(t){t===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=n,a.deflate=r,a.deflateRaw=i,a.gzip=s},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js")}); diff --git a/node_modules/pako/dist/pako_inflate.js b/node_modules/pako/dist/pako_inflate.js new file mode 100755 index 00000000..c3e2e0e7 --- /dev/null +++ b/node_modules/pako/dist/pako_inflate.js @@ -0,0 +1,3127 @@ +/* pako 0.2.9 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +},{"./common":1}],3:[function(require,module,exports){ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It doesn't worth to make additional optimizationa as in original. +// Small size is preferable. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; + +},{}],4:[function(require,module,exports){ +'use strict'; + + +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; + +},{}],5:[function(require,module,exports){ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; + +},{}],6:[function(require,module,exports){ +'use strict'; + + +function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; +} + +module.exports = GZheader; + +},{}],7:[function(require,module,exports){ +'use strict'; + +// See state defs from inflate.js +var BAD = 30; /* got a data error -- remain here until reset */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state.mode === LEN + strm.avail_in >= 6 + strm.avail_out >= 258 + start >= strm.avail_out + state.bits < 8 + + On return, state.mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm.avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm.avail_out >= 258 for each loop to avoid checking for + output space. + */ +module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ +//#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ +//#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + // Use `s_window` instead `window`, avoid conflict with instrumentation tools + var s_window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); +//#ifdef INFLATE_STRICT + dmax = state.dmax; +//#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); +//#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } +//#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// if (len <= op - whave) { +// do { +// output[_out++] = 0; +// } while (--len); +// continue top; +// } +// len -= op - whave; +// do { +// output[_out++] = 0; +// } while (--op > whave); +// if (op === 0) { +// from = _out - dist; +// do { +// output[_out++] = output[from++]; +// } while (--len); +// continue top; +// } +//#endif + } + from = 0; // window index + from_source = s_window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; +}; + +},{}],8:[function(require,module,exports){ +'use strict'; + + +var utils = require('../utils/common'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var inflate_fast = require('./inffast'); +var inflate_table = require('./inftrees'); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +//var Z_NO_FLUSH = 0; +//var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +//var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + +/* The deflate compression method */ +var Z_DEFLATED = 8; + + +/* STATES ====================================================================*/ +/* ===========================================================================*/ + + +var HEAD = 1; /* i: waiting for magic header */ +var FLAGS = 2; /* i: waiting for method and flags (gzip) */ +var TIME = 3; /* i: waiting for modification time (gzip) */ +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ +var EXLEN = 5; /* i: waiting for extra length (gzip) */ +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ +var NAME = 7; /* i: waiting for end of file name (gzip) */ +var COMMENT = 8; /* i: waiting for end of comment (gzip) */ +var HCRC = 9; /* i: waiting for header crc (gzip) */ +var DICTID = 10; /* i: waiting for dictionary check value */ +var DICT = 11; /* waiting for inflateSetDictionary() call */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ +var STORED = 14; /* i: waiting for stored size (length and complement) */ +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ +var COPY = 16; /* i/o: waiting for input or output to copy stored block */ +var TABLE = 17; /* i: waiting for dynamic block table lengths */ +var LENLENS = 18; /* i: waiting for code length code lengths */ +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ +var LEN_ = 20; /* i: same as LEN below, but only first time in */ +var LEN = 21; /* i: waiting for length/lit/eob code */ +var LENEXT = 22; /* i: waiting for length extra bits */ +var DIST = 23; /* i: waiting for distance code */ +var DISTEXT = 24; /* i: waiting for distance extra bits */ +var MATCH = 25; /* o: waiting for output space to copy string */ +var LIT = 26; /* o: waiting for output space to write literal */ +var CHECK = 27; /* i: waiting for 32-bit check value */ +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ +var DONE = 29; /* finished check, done -- remain here until reset */ +var BAD = 30; /* got a data error -- remain here until reset */ +var MEM = 31; /* got an inflate() memory error -- remain here until reset */ +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + +/* ===========================================================================*/ + + + +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_WBITS = MAX_WBITS; + + +function zswap32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); +} + + +function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* + because we don't have pointers in js, we use lencode and distcode directly + as buffers so we don't need codes + */ + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ +} + +function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + +} + +function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); +} + +function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; +} + +function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); +} + + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +var virgin = true; + +var lenfix, distfix; // We have no pointers in JS, so keep tables separate + +function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; +} + + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; +} + +function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more conveniend processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = zswap32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// +//#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } +//#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state.lenbits = 9; + + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } +//#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +//#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// Trace((stderr, "inflate.c too far\n")); +// copy -= state.whave; +// if (copy > state.length) { copy = state.length; } +// if (copy > left) { copy = left; } +// left -= copy; +// state.length -= copy; +// do { +// output[put++] = 0; +// } while (--copy); +// if (state.length === 0) { state.mode = LEN; } +// break; +//#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' insdead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; +} + +function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; +} + +function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; +} + +function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var state; + var dictid; + var ret; + + /* check state */ + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + state = strm.state; + + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + + /* check for correct dictionary identifier */ + if (state.mode === DICT) { + dictid = 1; /* adler32(0, null, 0)*/ + /* dictid = adler32(dictid, dictionary, dictLength); */ + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + /* copy dictionary to window using updatewindow(), which will amend the + existing dictionary if appropriate */ + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + // Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +exports.inflateReset = inflateReset; +exports.inflateReset2 = inflateReset2; +exports.inflateResetKeep = inflateResetKeep; +exports.inflateInit = inflateInit; +exports.inflateInit2 = inflateInit2; +exports.inflate = inflate; +exports.inflateEnd = inflateEnd; +exports.inflateGetHeader = inflateGetHeader; +exports.inflateSetDictionary = inflateSetDictionary; +exports.inflateInfo = 'pako inflate (from Nodeca project)'; + +/* Not implemented +exports.inflateCopy = inflateCopy; +exports.inflateGetDictionary = inflateGetDictionary; +exports.inflateMark = inflateMark; +exports.inflatePrime = inflatePrime; +exports.inflateSync = inflateSync; +exports.inflateSyncPoint = inflateSyncPoint; +exports.inflateUndermine = inflateUndermine; +*/ + +},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(require,module,exports){ +'use strict'; + + +var utils = require('../utils/common'); + +var MAXBITS = 15; +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +]; + +var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 +]; + +var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 +]; + +var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 +]; + +module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) +{ + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; +// var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + var i = 0; + /* process all codes and make table entries */ + for (;;) { + i++; + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; + table.bits[low] = root; + table.val[low] = next - opts.table_index;*/ + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; +}; + +},{"../utils/common":1}],10:[function(require,module,exports){ +'use strict'; + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; + +},{}],"/lib/inflate.js":[function(require,module,exports){ +'use strict'; + + +var zlib_inflate = require('./zlib/inflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var c = require('./zlib/constants'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); +var GZheader = require('./zlib/gzheader'); + +var toString = Object.prototype.toString; + +/** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + +/* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overriden. + **/ + +/** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Inflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + +/** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + +/** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ +function Inflate(options) { + if (!(this instanceof Inflate)) return new Inflate(options); + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new GZheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); +} + +/** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the decompression context. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Inflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status, _mode; + var next_out_utf8, tail, utf8str; + var dict; + + // Flag to properly process Z_BUF_ERROR on testing inflate call + // when we check that all output data was flushed. + var allowBufError = false; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status === c.Z_NEED_DICT && dictionary) { + // Convert data if needed + if (typeof dictionary === 'string') { + dict = strings.string2buf(dictionary); + } else if (toString.call(dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(dictionary); + } else { + dict = dictionary; + } + + status = zlib_inflate.inflateSetDictionary(this.strm, dict); + + } + + if (status === c.Z_BUF_ERROR && allowBufError === true) { + status = c.Z_OK; + allowBufError = false; + } + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + + // When no more input data, we should check that internal inflate buffers + // are flushed. The only way to do it when avail_out = 0 - run one more + // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. + // Here we set flag to process this error properly. + // + // NOTE. Deflate does not return error in this case and does not needs such + // logic. + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Inflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called either after you tell inflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Inflate.prototype.onEnd = function (status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 alligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ +function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg; } + + return inflator.result; +} + + +/** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); +} + + +/** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + +exports.Inflate = Inflate; +exports.inflate = inflate; +exports.inflateRaw = inflateRaw; +exports.ungzip = inflate; + +},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js") +}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako_inflate.min.js b/node_modules/pako/dist/pako_inflate.min.js new file mode 100755 index 00000000..d423de90 --- /dev/null +++ b/node_modules/pako/dist/pako_inflate.min.js @@ -0,0 +1,2 @@ +/* pako 0.2.9 nodeca/pako */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.pako=e()}}(function(){return function e(t,i,n){function a(o,s){if(!i[o]){if(!t[o]){var f="function"==typeof require&&require;if(!s&&f)return f(o,!0);if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[o]={exports:{}};t[o][0].call(d.exports,function(e){var i=t[o][1][e];return a(i?i:e)},d,d.exports,e,t,i,n)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;s[254]=s[254]=1,i.string2buf=function(e){var t,i,n,r,o,s=e.length,f=0;for(r=0;r>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},i.buf2binstring=function(e){return n(e,e.length)},i.binstring2buf=function(e){for(var t=new a.Buf8(e.length),i=0,n=t.length;i4)l[a++]=65533,i+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&i1?l[a++]=65533:r<65536?l[a++]=r:(r-=65536,l[a++]=55296|r>>10&1023,l[a++]=56320|1023&r)}return n(l,a)},i.utf8border=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&128===(192&e[i]);)i--;return i<0?t:0===i?t:i+s[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){"use strict";function n(e,t,i,n){for(var a=65535&e|0,r=e>>>16&65535|0,o=0;0!==i;){o=i>2e3?2e3:i,i-=o;do a=a+t[n++]|0,r=r+a|0;while(--o);a%=65521,r%=65521}return a|r<<16|0}t.exports=n},{}],4:[function(e,t,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){"use strict";function n(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}function a(e,t,i,n){var a=r,o=n+i;e^=-1;for(var s=n;s>>8^a[255&(e^t[s])];return e^-1}var r=n();t.exports=a},{}],6:[function(e,t,i){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=n},{}],7:[function(e,t,i){"use strict";var n=30,a=12;t.exports=function(e,t){var i,r,o,s,f,l,d,u,c,h,b,w,m,k,_,g,v,p,x,y,S,E,B,Z,A;i=e.state,r=e.next_in,Z=e.input,o=r+(e.avail_in-5),s=e.next_out,A=e.output,f=s-(t-e.avail_out),l=s+(e.avail_out-257),d=i.dmax,u=i.wsize,c=i.whave,h=i.wnext,b=i.window,w=i.hold,m=i.bits,k=i.lencode,_=i.distcode,g=(1<>>24,w>>>=x,m-=x,x=p>>>16&255,0===x)A[s++]=65535&p;else{if(!(16&x)){if(0===(64&x)){p=k[(65535&p)+(w&(1<>>=x,m-=x),m<15&&(w+=Z[r++]<>>24,w>>>=x,m-=x,x=p>>>16&255,!(16&x)){if(0===(64&x)){p=_[(65535&p)+(w&(1<d){e.msg="invalid distance too far back",i.mode=n;break e}if(w>>>=x,m-=x,x=s-f,S>x){if(x=S-x,x>c&&i.sane){e.msg="invalid distance too far back",i.mode=n;break e}if(E=0,B=b,0===h){if(E+=u-x,x2;)A[s++]=B[E++],A[s++]=B[E++],A[s++]=B[E++],y-=3;y&&(A[s++]=B[E++],y>1&&(A[s++]=B[E++]))}else{E=s-S;do A[s++]=A[E++],A[s++]=A[E++],A[s++]=A[E++],y-=3;while(y>2);y&&(A[s++]=A[E++],y>1&&(A[s++]=A[E++]))}break}}break}}while(r>3,r-=y,m-=y<<3,w&=(1<>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new _.Buf16(320),this.work=new _.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=D,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new _.Buf32(we),t.distcode=t.distdyn=new _.Buf32(me),t.sane=1,t.back=-1,z):C}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,r(e)):C}function s(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?C:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,o(e))):C}function f(e,t){var i,n;return e?(n=new a,e.state=n,n.window=null,i=s(e,t),i!==z&&(e.state=null),i):C}function l(e){return f(e,_e)}function d(e){if(ge){var t;for(m=new _.Buf32(512),k=new _.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(x(S,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;x(E,e.lens,0,32,k,0,e.work,{bits:5}),ge=!1}e.lencode=m,e.lenbits=9,e.distcode=k,e.distbits=5}function u(e,t,i,n){var a,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(_.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>n&&(a=n),_.arraySet(r.window,t,i-n,a,r.wnext),n-=a,n?(_.arraySet(r.window,t,i-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,i.check=v(i.check,Ze,2,0),c=0,h=0,i.mode=F;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",i.mode=ce;break}if((15&c)!==U){e.msg="unknown compression method",i.mode=ce;break}if(c>>>=4,h-=4,xe=(15&c)+8,0===i.wbits)i.wbits=xe;else if(xe>i.wbits){e.msg="invalid window size",i.mode=ce;break}i.dmax=1<>8&1),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=v(i.check,Ze,2,0)),c=0,h=0,i.mode=L;case L:for(;h<32;){if(0===f)break e;f--,c+=a[o++]<>>8&255,Ze[2]=c>>>16&255,Ze[3]=c>>>24&255,i.check=v(i.check,Ze,4,0)),c=0,h=0,i.mode=H;case H:for(;h<16;){if(0===f)break e;f--,c+=a[o++]<>8),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=v(i.check,Ze,2,0)),c=0,h=0,i.mode=M;case M:if(1024&i.flags){for(;h<16;){if(0===f)break e;f--,c+=a[o++]<>>8&255,i.check=v(i.check,Ze,2,0)),c=0,h=0}else i.head&&(i.head.extra=null);i.mode=j;case j:if(1024&i.flags&&(m=i.length,m>f&&(m=f),m&&(i.head&&(xe=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),_.arraySet(i.head.extra,a,o,m,xe)),512&i.flags&&(i.check=v(i.check,a,m,o)),f-=m,o+=m,i.length-=m),i.length))break e;i.length=0,i.mode=K;case K:if(2048&i.flags){if(0===f)break e;m=0;do xe=a[o+m++],i.head&&xe&&i.length<65536&&(i.head.name+=String.fromCharCode(xe));while(xe&&m>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=X;break;case q:for(;h<32;){if(0===f)break e;f--,c+=a[o++]<>>=7&h,h-=7&h,i.mode=le;break}for(;h<3;){if(0===f)break e;f--,c+=a[o++]<>>=1,h-=1,3&c){case 0:i.mode=J;break;case 1:if(d(i),i.mode=ie,t===A){c>>>=2,h-=2;break e}break;case 2:i.mode=$;break;case 3:e.msg="invalid block type",i.mode=ce}c>>>=2,h-=2;break;case J:for(c>>>=7&h,h-=7&h;h<32;){if(0===f)break e;f--,c+=a[o++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=ce;break}if(i.length=65535&c,c=0,h=0,i.mode=Q,t===A)break e;case Q:i.mode=V;case V:if(m=i.length){if(m>f&&(m=f),m>l&&(m=l),0===m)break e;_.arraySet(r,a,o,m,s),f-=m,o+=m,l-=m,s+=m,i.length-=m;break}i.mode=X;break;case $:for(;h<14;){if(0===f)break e;f--,c+=a[o++]<>>=5,h-=5,i.ndist=(31&c)+1,c>>>=5,h-=5,i.ncode=(15&c)+4,c>>>=4,h-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=ce;break}i.have=0,i.mode=ee;case ee:for(;i.have>>=3,h-=3}for(;i.have<19;)i.lens[Ae[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,Se={bits:i.lenbits},ye=x(y,i.lens,0,19,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid code lengths set",i.mode=ce;break}i.have=0,i.mode=te;case te:for(;i.have>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=h);){if(0===f)break e;f--,c+=a[o++]<>>=me,h-=me,i.lens[i.have++]=_e;else{if(16===_e){for(Ee=me+2;h>>=me,h-=me,0===i.have){e.msg="invalid bit length repeat",i.mode=ce;break}xe=i.lens[i.have-1],m=3+(3&c),c>>>=2,h-=2}else if(17===_e){for(Ee=me+3;h>>=me,h-=me,xe=0,m=3+(7&c),c>>>=3,h-=3}else{for(Ee=me+7;h>>=me,h-=me,xe=0,m=11+(127&c),c>>>=7,h-=7}if(i.have+m>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=ce;break}for(;m--;)i.lens[i.have++]=xe}}if(i.mode===ce)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=ce;break}if(i.lenbits=9,Se={bits:i.lenbits},ye=x(S,i.lens,0,i.nlen,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid literal/lengths set",i.mode=ce;break}if(i.distbits=6,i.distcode=i.distdyn,Se={bits:i.distbits},ye=x(E,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,Se),i.distbits=Se.bits,ye){e.msg="invalid distances set",i.mode=ce;break}if(i.mode=ie,t===A)break e;case ie:i.mode=ne;case ne:if(f>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=f,i.hold=c,i.bits=h,p(e,w),s=e.next_out,r=e.output,l=e.avail_out,o=e.next_in,a=e.input,f=e.avail_in,c=i.hold,h=i.bits,i.mode===X&&(i.back=-1);break}for(i.back=0;Be=i.lencode[c&(1<>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=h);){if(0===f)break e;f--,c+=a[o++]<>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=h);){if(0===f)break e;f--,c+=a[o++]<>>=ge,h-=ge,i.back+=ge}if(c>>>=me,h-=me,i.back+=me,i.length=_e,0===ke){i.mode=fe;break}if(32&ke){i.back=-1,i.mode=X;break}if(64&ke){e.msg="invalid literal/length code",i.mode=ce;break}i.extra=15&ke,i.mode=ae;case ae:if(i.extra){for(Ee=i.extra;h>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=re;case re:for(;Be=i.distcode[c&(1<>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=h);){if(0===f)break e;f--,c+=a[o++]<>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=h);){if(0===f)break e;f--,c+=a[o++]<>>=ge,h-=ge,i.back+=ge}if(c>>>=me,h-=me,i.back+=me,64&ke){e.msg="invalid distance code",i.mode=ce;break}i.offset=_e,i.extra=15&ke,i.mode=oe;case oe:if(i.extra){for(Ee=i.extra;h>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=ce;break}i.mode=se;case se:if(0===l)break e;if(m=w-l,i.offset>m){if(m=i.offset-m,m>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=ce;break}m>i.wnext?(m-=i.wnext,k=i.wsize-m):k=i.wnext-m,m>i.length&&(m=i.length),we=i.window}else we=r,k=s-i.offset,m=i.length;m>l&&(m=l),l-=m,i.length-=m;do r[s++]=we[k++];while(--m);0===i.length&&(i.mode=ne);break;case fe:if(0===l)break e;r[s++]=i.length,l--,i.mode=ne;break;case le:if(i.wrap){for(;h<32;){if(0===f)break e;f--,c|=a[o++]<=1&&0===M[C];C--);if(O>C&&(O=C),0===C)return w[m++]=20971520,w[m++]=20971520,_.bits=1,0;for(N=1;N0&&(e===s||1!==C))return-1;for(j[1]=0,z=1;zr||e===l&&D>o)return 1;for(var Y=0;;){Y++,E=z-T,k[R]S?(B=K[P+k[R]],Z=L[H+k[R]]):(B=96,Z=0),g=1<>T)+v]=E<<24|B<<16|Z|0;while(0!==v);for(g=1<>=1;if(0!==g?(F&=g-1,F+=g):F=0,R++,0===--M[z]){if(z===C)break;z=t[i+k[R]]}if(z>O&&(F&x)!==p){for(0===T&&(T=O),y+=N,I=z-T,U=1<r||e===l&&D>o)return 1;p=F&x,w[p]=O<<24|I<<16|y-m|0}}return 0!==F&&(w[y+F]=z-T<<24|64<<16|0),_.bits=O,0}},{"../utils/common":1}],10:[function(e,t,i){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=n},{}],"/lib/inflate.js":[function(e,t,i){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var i=o.inflateInit2(this.strm,t.windowBits);if(i!==l.Z_OK)throw new Error(d[i]);this.header=new c,o.inflateGetHeader(this.strm,this.header)}function a(e,t){var i=new n(t);if(i.push(e,!0),i.err)throw i.msg;return i.result}function r(e,t){return t=t||{},t.raw=!0,a(e,t)}var o=e("./zlib/inflate"),s=e("./utils/common"),f=e("./utils/strings"),l=e("./zlib/constants"),d=e("./zlib/messages"),u=e("./zlib/zstream"),c=e("./zlib/gzheader"),h=Object.prototype.toString;n.prototype.push=function(e,t){var i,n,a,r,d,u,c=this.strm,b=this.options.chunkSize,w=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:t===!0?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof e?c.input=f.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?c.input=new Uint8Array(e):c.input=e,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new s.Buf8(b),c.next_out=0,c.avail_out=b),i=o.inflate(c,l.Z_NO_FLUSH),i===l.Z_NEED_DICT&&w&&(u="string"==typeof w?f.string2buf(w):"[object ArrayBuffer]"===h.call(w)?new Uint8Array(w):w,i=o.inflateSetDictionary(this.strm,u)),i===l.Z_BUF_ERROR&&m===!0&&(i=l.Z_OK,m=!1),i!==l.Z_STREAM_END&&i!==l.Z_OK)return this.onEnd(i),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&i!==l.Z_STREAM_END&&(0!==c.avail_in||n!==l.Z_FINISH&&n!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(a=f.utf8border(c.output,c.next_out),r=c.next_out-a,d=f.buf2string(c.output,a),c.next_out=r,c.avail_out=b-r,r&&s.arraySet(c.output,c.output,a,r,0),this.onData(d)):this.onData(s.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(m=!0)}while((c.avail_in>0||0===c.avail_out)&&i!==l.Z_STREAM_END);return i===l.Z_STREAM_END&&(n=l.Z_FINISH),n===l.Z_FINISH?(i=o.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===l.Z_OK):n!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),c.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=n,i.inflate=a,i.inflateRaw=r,i.ungzip=a},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}); diff --git a/node_modules/pako/index.js b/node_modules/pako/index.js new file mode 100755 index 00000000..cd072515 --- /dev/null +++ b/node_modules/pako/index.js @@ -0,0 +1,14 @@ +// Top level file is just a mixin of submodules & constants +'use strict'; + +var assign = require('./lib/utils/common').assign; + +var deflate = require('./lib/deflate'); +var inflate = require('./lib/inflate'); +var constants = require('./lib/zlib/constants'); + +var pako = {}; + +assign(pako, deflate, inflate, constants); + +module.exports = pako; diff --git a/node_modules/pako/lib/deflate.js b/node_modules/pako/lib/deflate.js new file mode 100755 index 00000000..11040d4e --- /dev/null +++ b/node_modules/pako/lib/deflate.js @@ -0,0 +1,400 @@ +'use strict'; + + +var zlib_deflate = require('./zlib/deflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); + +var toString = Object.prototype.toString; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + +var Z_NO_FLUSH = 0; +var Z_FINISH = 4; + +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_SYNC_FLUSH = 2; + +var Z_DEFAULT_COMPRESSION = -1; + +var Z_DEFAULT_STRATEGY = 0; + +var Z_DEFLATED = 8; + +/* ===========================================================================*/ + + +/** + * class Deflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[deflate]], + * [[deflateRaw]] and [[gzip]]. + **/ + +/* internal + * Deflate.chunks -> Array + * + * Chunks of output data, if [[Deflate#onData]] not overriden. + **/ + +/** + * Deflate.result -> Uint8Array|Array + * + * Compressed result, generated by default [[Deflate#onData]] + * and [[Deflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Deflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Deflate.err -> Number + * + * Error code after deflate finished. 0 (Z_OK) on success. + * You will not need it in real life, because deflate errors + * are possible only on wrong options or bad `onData` / `onEnd` + * custom handlers. + **/ + +/** + * Deflate.msg -> String + * + * Error message, if [[Deflate.err]] != 0 + **/ + + +/** + * new Deflate(options) + * - options (Object): zlib deflate options. + * + * Creates new deflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `level` + * - `windowBits` + * - `memLevel` + * - `strategy` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw deflate + * - `gzip` (Boolean) - create gzip wrapper + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * - `header` (Object) - custom header for gzip + * - `text` (Boolean) - true if compressed data believed to be text + * - `time` (Number) - modification time, unix timestamp + * - `os` (Number) - operation system code + * - `extra` (Array) - array of bytes with extra data (max 65536) + * - `name` (String) - file name (binary string) + * - `comment` (String) - comment (binary string) + * - `hcrc` (Boolean) - true if header crc should be added + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var deflate = new pako.Deflate({ level: 3}); + * + * deflate.push(chunk1, false); + * deflate.push(chunk2, true); // true -> last chunk + * + * if (deflate.err) { throw new Error(deflate.err); } + * + * console.log(deflate.result); + * ``` + **/ +function Deflate(options) { + if (!(this instanceof Deflate)) return new Deflate(options); + + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: '' + }, options || {}); + + var opt = this.options; + + if (opt.raw && (opt.windowBits > 0)) { + opt.windowBits = -opt.windowBits; + } + + else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { + opt.windowBits += 16; + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_deflate.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + + if (opt.dictionary) { + var dict; + // Convert data if needed + if (typeof opt.dictionary === 'string') { + // If we need to compress text, change encoding to utf8. + dict = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + + status = zlib_deflate.deflateSetDictionary(this.strm, dict); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + this._dict_set = true; + } +} + +/** + * Deflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be + * converted to utf8 byte sequence. + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with + * new compressed chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the compression context. + * + * On fail call [[Deflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * array format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Deflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + + if (this.ended) { return false; } + + _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // If we need to compress text, change encoding to utf8. + strm.input = strings.string2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ + + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { + if (this.options.to === 'string') { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + + // Finalize on the last chunk. + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === Z_SYNC_FLUSH) { + this.onEnd(Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Deflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Deflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Deflate#onEnd(status) -> Void + * - status (Number): deflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell deflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Deflate.prototype.onEnd = function (status) { + // On success - join + if (status === Z_OK) { + if (this.options.to === 'string') { + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * deflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * Compress `data` with deflate algorithm and `options`. + * + * Supported options are: + * + * - level + * - windowBits + * - memLevel + * - strategy + * - dictionary + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); + * + * console.log(pako.deflate(data)); + * ``` + **/ +function deflate(input, options) { + var deflator = new Deflate(options); + + deflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (deflator.err) { throw deflator.msg; } + + return deflator.result; +} + + +/** + * deflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); +} + + +/** + * gzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but create gzip wrapper instead of + * deflate one. + **/ +function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); +} + + +exports.Deflate = Deflate; +exports.deflate = deflate; +exports.deflateRaw = deflateRaw; +exports.gzip = gzip; diff --git a/node_modules/pako/lib/inflate.js b/node_modules/pako/lib/inflate.js new file mode 100755 index 00000000..0ed4999d --- /dev/null +++ b/node_modules/pako/lib/inflate.js @@ -0,0 +1,418 @@ +'use strict'; + + +var zlib_inflate = require('./zlib/inflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var c = require('./zlib/constants'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); +var GZheader = require('./zlib/gzheader'); + +var toString = Object.prototype.toString; + +/** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + +/* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overriden. + **/ + +/** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Inflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + +/** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + +/** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ +function Inflate(options) { + if (!(this instanceof Inflate)) return new Inflate(options); + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new GZheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); +} + +/** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the decompression context. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Inflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status, _mode; + var next_out_utf8, tail, utf8str; + var dict; + + // Flag to properly process Z_BUF_ERROR on testing inflate call + // when we check that all output data was flushed. + var allowBufError = false; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status === c.Z_NEED_DICT && dictionary) { + // Convert data if needed + if (typeof dictionary === 'string') { + dict = strings.string2buf(dictionary); + } else if (toString.call(dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(dictionary); + } else { + dict = dictionary; + } + + status = zlib_inflate.inflateSetDictionary(this.strm, dict); + + } + + if (status === c.Z_BUF_ERROR && allowBufError === true) { + status = c.Z_OK; + allowBufError = false; + } + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + + // When no more input data, we should check that internal inflate buffers + // are flushed. The only way to do it when avail_out = 0 - run one more + // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. + // Here we set flag to process this error properly. + // + // NOTE. Deflate does not return error in this case and does not needs such + // logic. + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Inflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called either after you tell inflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Inflate.prototype.onEnd = function (status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 alligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ +function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg; } + + return inflator.result; +} + + +/** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); +} + + +/** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + +exports.Inflate = Inflate; +exports.inflate = inflate; +exports.inflateRaw = inflateRaw; +exports.ungzip = inflate; diff --git a/node_modules/pako/lib/utils/common.js b/node_modules/pako/lib/utils/common.js new file mode 100755 index 00000000..1e159fec --- /dev/null +++ b/node_modules/pako/lib/utils/common.js @@ -0,0 +1,102 @@ +'use strict'; + + +var TYPED_OK = (typeof Uint8Array !== 'undefined') && + (typeof Uint16Array !== 'undefined') && + (typeof Int32Array !== 'undefined'); + + +exports.assign = function (obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { continue; } + + if (typeof source !== 'object') { + throw new TypeError(source + 'must be non-object'); + } + + for (var p in source) { + if (source.hasOwnProperty(p)) { + obj[p] = source[p]; + } + } + } + + return obj; +}; + + +// reduce buffer size, avoiding mem copy +exports.shrinkBuf = function (buf, size) { + if (buf.length === size) { return buf; } + if (buf.subarray) { return buf.subarray(0, size); } + buf.length = size; + return buf; +}; + + +var fnTyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + // Fallback to ordinary array + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + var i, l, len, pos, chunk, result; + + // calculate data length + len = 0; + for (i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + + // join chunks + result = new Uint8Array(len); + pos = 0; + for (i = 0, l = chunks.length; i < l; i++) { + chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + + return result; + } +}; + +var fnUntyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + return [].concat.apply([], chunks); + } +}; + + +// Enable/Disable typed arrays use, for testing +// +exports.setTyped = function (on) { + if (on) { + exports.Buf8 = Uint8Array; + exports.Buf16 = Uint16Array; + exports.Buf32 = Int32Array; + exports.assign(exports, fnTyped); + } else { + exports.Buf8 = Array; + exports.Buf16 = Array; + exports.Buf32 = Array; + exports.assign(exports, fnUntyped); + } +}; + +exports.setTyped(TYPED_OK); diff --git a/node_modules/pako/lib/utils/strings.js b/node_modules/pako/lib/utils/strings.js new file mode 100755 index 00000000..1a0499c3 --- /dev/null +++ b/node_modules/pako/lib/utils/strings.js @@ -0,0 +1,185 @@ +// String encode/decode helpers +'use strict'; + + +var utils = require('./common'); + + +// Quick check if we can use fast array to bin string conversion +// +// - apply(Array) can fail on Android 2.2 +// - apply(Uint8Array) can fail on iOS 5.1 Safary +// +var STR_APPLY_OK = true; +var STR_APPLY_UIA_OK = true; + +try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } +try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } + + +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new utils.Buf8(256); +for (var q = 0; q < 256; q++) { + _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; diff --git a/node_modules/pako/lib/zlib/adler32.js b/node_modules/pako/lib/zlib/adler32.js new file mode 100755 index 00000000..dcefe937 --- /dev/null +++ b/node_modules/pako/lib/zlib/adler32.js @@ -0,0 +1,32 @@ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It doesn't worth to make additional optimizationa as in original. +// Small size is preferable. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; diff --git a/node_modules/pako/lib/zlib/constants.js b/node_modules/pako/lib/zlib/constants.js new file mode 100755 index 00000000..ece67001 --- /dev/null +++ b/node_modules/pako/lib/zlib/constants.js @@ -0,0 +1,50 @@ +'use strict'; + + +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; diff --git a/node_modules/pako/lib/zlib/crc32.js b/node_modules/pako/lib/zlib/crc32.js new file mode 100755 index 00000000..0768b1c3 --- /dev/null +++ b/node_modules/pako/lib/zlib/crc32.js @@ -0,0 +1,41 @@ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; diff --git a/node_modules/pako/lib/zlib/deflate.js b/node_modules/pako/lib/zlib/deflate.js new file mode 100755 index 00000000..e461fb8b --- /dev/null +++ b/node_modules/pako/lib/zlib/deflate.js @@ -0,0 +1,1855 @@ +'use strict'; + +var utils = require('../utils/common'); +var trees = require('./trees'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var msg = require('./messages'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +var Z_NO_FLUSH = 0; +var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +//var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +//var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +//var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + + +/* compression levels */ +//var Z_NO_COMPRESSION = 0; +//var Z_BEST_SPEED = 1; +//var Z_BEST_COMPRESSION = 9; +var Z_DEFAULT_COMPRESSION = -1; + + +var Z_FILTERED = 1; +var Z_HUFFMAN_ONLY = 2; +var Z_RLE = 3; +var Z_FIXED = 4; +var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +//var Z_BINARY = 0; +//var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + + +/* The deflate compression method */ +var Z_DEFLATED = 8; + +/*============================================================================*/ + + +var MAX_MEM_LEVEL = 9; +/* Maximum value for memLevel in deflateInit2 */ +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_MEM_LEVEL = 8; + + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ +var LITERALS = 256; +/* number of literal bytes 0..255 */ +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ +var D_CODES = 30; +/* number of distance codes */ +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + +var PRESET_DICT = 0x20; + +var INIT_STATE = 42; +var EXTRA_STATE = 69; +var NAME_STATE = 73; +var COMMENT_STATE = 91; +var HCRC_STATE = 103; +var BUSY_STATE = 113; +var FINISH_STATE = 666; + +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ +var BS_BLOCK_DONE = 2; /* block flush performed */ +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ + +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. + +function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; +} + +function rank(f) { + return ((f) << 1) - ((f) > 4 ? 9 : 0); +} + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->output buffer and copying into it. + * (See also read_buf()). + */ +function flush_pending(strm) { + var s = strm.state; + + //_tr_flush_bits(s); + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { return; } + + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } +} + + +function flush_block_only(s, last) { + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); +} + + +function put_byte(s, b) { + s.pending_buf[s.pending++] = b; +} + + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +function putShortMSB(s, b) { +// put_byte(s, (Byte)(b >> 8)); +// put_byte(s, (Byte)(b & 0xff)); + s.pending_buf[s.pending++] = (b >>> 8) & 0xff; + s.pending_buf[s.pending++] = b & 0xff; +} + + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->input buffer and copying from it. + * (See also flush_pending()). + */ +function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + + if (len > size) { len = size; } + if (len === 0) { return 0; } + + strm.avail_in -= len; + + // zmemcpy(buf, strm->next_in, len); + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } + + else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + + strm.next_in += len; + strm.total_in += len; + + return len; +} + + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; /* max hash chain length */ + var scan = s.strstart; /* current string */ + var match; /* matched string */ + var len; /* length of current match */ + var best_len = s.prev_length; /* best match length so far */ + var nice_match = s.nice_match; /* stop if match long enough */ + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; + + var _win = s.window; // shortcut + + var wmask = s.w_mask; + var prev = s.prev; + + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (nice_match > s.lookahead) { nice_match = s.lookahead; } + + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + // Assert(cur_match < s->strstart, "no future"); + match = cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ + + if (_win[match + best_len] !== scan_end || + _win[match + best_len - 1] !== scan_end1 || + _win[match] !== _win[scan] || + _win[++match] !== _win[scan + 1]) { + continue; + } + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2; + match++; + // Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + /*jshint noempty:false*/ + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + scan < strend); + + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; +} + + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = s.window_size - s.lookahead - s.strstart; + + // JS ints have 32 bit, block below not needed + /* Deal with !@#$% 64K limit: */ + //if (sizeof(int) <= 2) { + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + // more = wsize; + // + // } else if (more == (unsigned)(-1)) { + // /* Very unlikely, but possible on 16 bit machine if + // * strstart == 0 && lookahead == 1 (input done a byte at time) + // */ + // more--; + // } + //} + + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + /* we now have strstart >= MAX_DIST */ + s.block_start -= _w_size; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = (m >= _w_size ? m - _w_size : 0); + } while (--n); + + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = (m >= _w_size ? m - _w_size : 0); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); + + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + //Assert(more >= 2, "more < 2"); + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; +//#if MIN_MATCH != 3 +// Call update_hash() MIN_MATCH-3 more times +//#endif + while (s.insert) { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ +// if (s.high_water < s.window_size) { +// var curr = s.strstart + s.lookahead; +// var init = 0; +// +// if (s.high_water < curr) { +// /* Previous high water mark below current data -- zero WIN_INIT +// * bytes or up to end of window, whichever is less. +// */ +// init = s.window_size - curr; +// if (init > WIN_INIT) +// init = WIN_INIT; +// zmemzero(s->window + curr, (unsigned)init); +// s->high_water = curr + init; +// } +// else if (s->high_water < (ulg)curr + WIN_INIT) { +// /* High water mark at or above current data, but below current data +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up +// * to end of window, whichever is less. +// */ +// init = (ulg)curr + WIN_INIT - s->high_water; +// if (init > s->window_size - s->high_water) +// init = s->window_size - s->high_water; +// zmemzero(s->window + s->high_water, (unsigned)init); +// s->high_water += init; +// } +// } +// +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, +// "not enough room for search"); +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +function deflate_stored(s, flush) { + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + var max_block_size = 0xffff; + + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s.lookahead <= 1) { + + //Assert(s->strstart < s->w_size+MAX_DIST(s) || + // s->block_start >= (long)s->w_size, "slide too late"); +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || +// s.block_start >= s.w_size)) { +// throw new Error("slide too late"); +// } + + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + + if (s.lookahead === 0) { + break; + } + /* flush the current block */ + } + //Assert(s->block_start >= 0L, "block gone"); +// if (s.block_start < 0) throw new Error("block gone"); + + s.strstart += s.lookahead; + s.lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + var max_start = s.block_start + max_block_size; + + if (s.strstart === 0 || s.strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + + + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + + s.insert = 0; + + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + + if (s.strstart > s.block_start) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_NEED_MORE; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +function deflate_fast(s, flush) { + var hash_head; /* head of the hash chain */ + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; /* flush the current block */ + } + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + } + if (s.match_length >= MIN_MATCH) { + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only + + /*** _tr_tally_dist(s, s.strstart - s.match_start, + s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { + s.match_length--; /* string at strstart already in table */ + do { + s.strstart++; + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s.match_length !== 0); + s.strstart++; + } else + { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; + +//#if MIN_MATCH != 3 +// Call UPDATE_HASH() MIN_MATCH-3 more times +//#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s.window[s.strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +function deflate_slow(s, flush) { + var hash_head; /* head of hash chain */ + var bflush; /* set if current block must be flushed */ + + var max_insert; + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + */ + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && + s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + + if (s.match_length <= 5 && + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + //check_match(s, s.strstart-1, s.prev_match, s.prev_length); + + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, + s.prev_length - MIN_MATCH, bflush);***/ + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + } else if (s.match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + if (bflush) { + /*** FLUSH_BLOCK_ONLY(s, 0) ***/ + flush_block_only(s, false); + /***/ + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + //Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s.match_available) { + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_BLOCK_DONE; +} + + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +function deflate_rle(s, flush) { + var bflush; /* set if current block must be flushed */ + var prev; /* byte at distance one to match */ + var scan, strend; /* scan goes up to strend for length of run */ + + var _win = s.window; + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + /*jshint noempty:false*/ + } while (prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s.match_length >= MIN_MATCH) { + //check_match(s, s.strstart, s.strstart - 1, s.match_length); + + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +function deflate_huff(s, flush) { + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s.match_length = 0; + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; +} + +var configuration_table; + +configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), /* 3 */ + + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ +]; + + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +function lm_init(s) { + s.window_size = 2 * s.w_size; + + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + + /* Set the default configuration parameters: + */ + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; +} + + +function DeflateState() { + this.strm = null; /* pointer back to this zlib stream */ + this.status = 0; /* as the name implies */ + this.pending_buf = null; /* output still pending */ + this.pending_buf_size = 0; /* size of pending_buf */ + this.pending_out = 0; /* next pending byte to output to the stream */ + this.pending = 0; /* nb of bytes in the pending buffer */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.gzhead = null; /* gzip header information to write */ + this.gzindex = 0; /* where in extra, name, or comment */ + this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.last_flush = -1; /* value of flush param for previous deflate call */ + + this.w_size = 0; /* LZ77 window size (32K by default) */ + this.w_bits = 0; /* log2(w_size) (8..16) */ + this.w_mask = 0; /* w_size - 1 */ + + this.window = null; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. + */ + + this.window_size = 0; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + this.prev = null; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + this.head = null; /* Heads of the hash chains or NIL. */ + + this.ins_h = 0; /* hash index of string to be inserted */ + this.hash_size = 0; /* number of elements in hash table */ + this.hash_bits = 0; /* log2(hash_size) */ + this.hash_mask = 0; /* hash_size-1 */ + + this.hash_shift = 0; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + this.block_start = 0; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + this.match_length = 0; /* length of best match */ + this.prev_match = 0; /* previous match */ + this.match_available = 0; /* set if previous match exists */ + this.strstart = 0; /* start of string to insert */ + this.match_start = 0; /* start of matching string */ + this.lookahead = 0; /* number of valid bytes ahead in window */ + + this.prev_length = 0; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + this.max_chain_length = 0; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + this.max_lazy_match = 0; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ + // That's alias to max_lazy_match, don't use directly + //this.max_insert_length = 0; + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + this.level = 0; /* compression level (1..9) */ + this.strategy = 0; /* favor or force Huffman coding*/ + + this.good_match = 0; + /* Use a faster search when the previous match is longer than this */ + + this.nice_match = 0; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + + /* Didn't use ct_data typedef below to suppress compiler warning */ + + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + // Use flat array of DOUBLE size, with interleaved fata, + // because JS does not support effective + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + + this.l_desc = null; /* desc. for literal tree */ + this.d_desc = null; /* desc. for distance tree */ + this.bl_desc = null; /* desc. for bit length tree */ + + //ush bl_count[MAX_BITS+1]; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + /* number of codes at each bit length for an optimal tree */ + + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); + + this.heap_len = 0; /* number of elements in the heap */ + this.heap_max = 0; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + this.l_buf = 0; /* buffer index for literals or lengths */ + + this.lit_bufsize = 0; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + this.last_lit = 0; /* running index in l_buf */ + + this.d_buf = 0; + /* Buffer index for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + this.opt_len = 0; /* bit length of current block with optimal trees */ + this.static_len = 0; /* bit length of current block with static trees */ + this.matches = 0; /* number of string matches in current block */ + this.insert = 0; /* bytes at end of window left to insert */ + + + this.bi_buf = 0; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + this.bi_valid = 0; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + // Used for window memory init. We safely ignore it for JS. That makes + // sense only for pointers and memory check tools. + //this.high_water = 0; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ +} + + +function deflateResetKeep(strm) { + var s; + + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + + s = strm.state; + s.pending = 0; + s.pending_out = 0; + + if (s.wrap < 0) { + s.wrap = -s.wrap; + /* was made negative by deflate(..., Z_FINISH); */ + } + s.status = (s.wrap ? INIT_STATE : BUSY_STATE); + strm.adler = (s.wrap === 2) ? + 0 // crc32(0, Z_NULL, 0) + : + 1; // adler32(0, Z_NULL, 0) + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; +} + + +function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; +} + + +function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + strm.state.gzhead = head; + return Z_OK; +} + + +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { // === Z_NULL + return Z_STREAM_ERROR; + } + var wrap = 1; + + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } + + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } + + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + + + if (windowBits === 8) { + windowBits = 9; + } + /* until 256-byte window bug fixed */ + + var s = new DeflateState(); + + strm.state = s; + s.strm = strm; + + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + + // Don't need mem init magic for JS. + //s.high_water = 0; /* nothing written to s->window yet */ + + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + s.pending_buf_size = s.lit_bufsize * 4; + + //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + //s->pending_buf = (uchf *) overlay; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + + // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) + //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s.d_buf = 1 * s.lit_bufsize; + + //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + s.l_buf = (1 + 2) * s.lit_bufsize; + + s.level = level; + s.strategy = strategy; + s.method = method; + + return deflateReset(strm); +} + +function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +} + + +function deflate(strm, flush) { + var old_flush, s; + var beg, val; // for gzip header write only + + if (!strm || !strm.state || + flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + + s = strm.state; + + if (!strm.output || + (!strm.input && strm.avail_in !== 0) || + (s.status === FINISH_STATE && flush !== Z_FINISH)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + + s.strm = strm; /* just in case */ + old_flush = s.last_flush; + s.last_flush = flush; + + /* Write the header */ + if (s.status === INIT_STATE) { + + if (s.wrap === 2) { // GZIP header + strm.adler = 0; //crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { // s->gzhead == Z_NULL + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } + else { + put_byte(s, (s.gzhead.text ? 1 : 0) + + (s.gzhead.hcrc ? 2 : 0) + + (!s.gzhead.extra ? 0 : 4) + + (!s.gzhead.name ? 0 : 8) + + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 0xff); + put_byte(s, (s.gzhead.time >> 8) & 0xff); + put_byte(s, (s.gzhead.time >> 16) & 0xff); + put_byte(s, (s.gzhead.time >> 24) & 0xff); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, s.gzhead.os & 0xff); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 0xff); + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + else // DEFLATE header + { + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + var level_flags = -1; + + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= (level_flags << 6); + if (s.strstart !== 0) { header |= PRESET_DICT; } + header += 31 - (header % 31); + + s.status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + strm.adler = 1; // adler32(0L, Z_NULL, 0); + } + } + +//#ifdef GZIP + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } + else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } + else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } + else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + strm.adler = 0; //crc32(0L, Z_NULL, 0); + s.status = BUSY_STATE; + } + } + else { + s.status = BUSY_STATE; + } + } +//#endif + + /* Flush as much pending output as possible */ + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s.last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && + flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm.avail_in !== 0 || s.lookahead !== 0 || + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : + (s.strategy === Z_RLE ? deflate_rle(s, flush) : + configuration_table[s.level].func(s, flush)); + + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + + trees._tr_stored_block(s, 0, 0, false); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush === Z_FULL_FLUSH) { + /*** CLEAR_HASH(s); ***/ /* forget history */ + zero(s.head); // Fill with NIL (= 0); + + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + //Assert(strm->avail_out > 0, "bug2"); + //if (strm.avail_out <= 0) { throw new Error("bug2");} + + if (flush !== Z_FINISH) { return Z_OK; } + if (s.wrap <= 0) { return Z_STREAM_END; } + + /* Write the trailer */ + if (s.wrap === 2) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + put_byte(s, (strm.adler >> 16) & 0xff); + put_byte(s, (strm.adler >> 24) & 0xff); + put_byte(s, strm.total_in & 0xff); + put_byte(s, (strm.total_in >> 8) & 0xff); + put_byte(s, (strm.total_in >> 16) & 0xff); + put_byte(s, (strm.total_in >> 24) & 0xff); + } + else + { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s.wrap > 0) { s.wrap = -s.wrap; } + /* write the trailer only once! */ + return s.pending !== 0 ? Z_OK : Z_STREAM_END; +} + +function deflateEnd(strm) { + var status; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + status = strm.state.status; + if (status !== INIT_STATE && + status !== EXTRA_STATE && + status !== NAME_STATE && + status !== COMMENT_STATE && + status !== HCRC_STATE && + status !== BUSY_STATE && + status !== FINISH_STATE + ) { + return err(strm, Z_STREAM_ERROR); + } + + strm.state = null; + + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; +} + + +/* ========================================================================= + * Initializes the compression dictionary from the given byte + * sequence without producing any compressed output. + */ +function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var s; + var str, n; + var wrap; + var avail; + var next; + var input; + var tmpDict; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + s = strm.state; + wrap = s.wrap; + + if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { + return Z_STREAM_ERROR; + } + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap === 1) { + /* adler32(strm->adler, dictionary, dictLength); */ + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + + s.wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s.w_size) { + if (wrap === 0) { /* already empty otherwise */ + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + /* use the tail */ + // dictionary = dictionary.slice(dictLength - s.w_size); + tmpDict = new utils.Buf8(s.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + /* insert dictionary into window and hash */ + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + str = s.strstart; + n = s.lookahead - (MIN_MATCH - 1); + do { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK; +} + + +exports.deflateInit = deflateInit; +exports.deflateInit2 = deflateInit2; +exports.deflateReset = deflateReset; +exports.deflateResetKeep = deflateResetKeep; +exports.deflateSetHeader = deflateSetHeader; +exports.deflate = deflate; +exports.deflateEnd = deflateEnd; +exports.deflateSetDictionary = deflateSetDictionary; +exports.deflateInfo = 'pako deflate (from Nodeca project)'; + +/* Not implemented +exports.deflateBound = deflateBound; +exports.deflateCopy = deflateCopy; +exports.deflateParams = deflateParams; +exports.deflatePending = deflatePending; +exports.deflatePrime = deflatePrime; +exports.deflateTune = deflateTune; +*/ diff --git a/node_modules/pako/lib/zlib/gzheader.js b/node_modules/pako/lib/zlib/gzheader.js new file mode 100755 index 00000000..300bdee8 --- /dev/null +++ b/node_modules/pako/lib/zlib/gzheader.js @@ -0,0 +1,40 @@ +'use strict'; + + +function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; +} + +module.exports = GZheader; diff --git a/node_modules/pako/lib/zlib/inffast.js b/node_modules/pako/lib/zlib/inffast.js new file mode 100755 index 00000000..a419f65d --- /dev/null +++ b/node_modules/pako/lib/zlib/inffast.js @@ -0,0 +1,326 @@ +'use strict'; + +// See state defs from inflate.js +var BAD = 30; /* got a data error -- remain here until reset */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state.mode === LEN + strm.avail_in >= 6 + strm.avail_out >= 258 + start >= strm.avail_out + state.bits < 8 + + On return, state.mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm.avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm.avail_out >= 258 for each loop to avoid checking for + output space. + */ +module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ +//#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ +//#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + // Use `s_window` instead `window`, avoid conflict with instrumentation tools + var s_window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); +//#ifdef INFLATE_STRICT + dmax = state.dmax; +//#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); +//#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } +//#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// if (len <= op - whave) { +// do { +// output[_out++] = 0; +// } while (--len); +// continue top; +// } +// len -= op - whave; +// do { +// output[_out++] = 0; +// } while (--op > whave); +// if (op === 0) { +// from = _out - dist; +// do { +// output[_out++] = output[from++]; +// } while (--len); +// continue top; +// } +//#endif + } + from = 0; // window index + from_source = s_window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; +}; diff --git a/node_modules/pako/lib/zlib/inflate.js b/node_modules/pako/lib/zlib/inflate.js new file mode 100755 index 00000000..3be8b62e --- /dev/null +++ b/node_modules/pako/lib/zlib/inflate.js @@ -0,0 +1,1538 @@ +'use strict'; + + +var utils = require('../utils/common'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var inflate_fast = require('./inffast'); +var inflate_table = require('./inftrees'); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +//var Z_NO_FLUSH = 0; +//var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +//var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + +/* The deflate compression method */ +var Z_DEFLATED = 8; + + +/* STATES ====================================================================*/ +/* ===========================================================================*/ + + +var HEAD = 1; /* i: waiting for magic header */ +var FLAGS = 2; /* i: waiting for method and flags (gzip) */ +var TIME = 3; /* i: waiting for modification time (gzip) */ +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ +var EXLEN = 5; /* i: waiting for extra length (gzip) */ +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ +var NAME = 7; /* i: waiting for end of file name (gzip) */ +var COMMENT = 8; /* i: waiting for end of comment (gzip) */ +var HCRC = 9; /* i: waiting for header crc (gzip) */ +var DICTID = 10; /* i: waiting for dictionary check value */ +var DICT = 11; /* waiting for inflateSetDictionary() call */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ +var STORED = 14; /* i: waiting for stored size (length and complement) */ +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ +var COPY = 16; /* i/o: waiting for input or output to copy stored block */ +var TABLE = 17; /* i: waiting for dynamic block table lengths */ +var LENLENS = 18; /* i: waiting for code length code lengths */ +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ +var LEN_ = 20; /* i: same as LEN below, but only first time in */ +var LEN = 21; /* i: waiting for length/lit/eob code */ +var LENEXT = 22; /* i: waiting for length extra bits */ +var DIST = 23; /* i: waiting for distance code */ +var DISTEXT = 24; /* i: waiting for distance extra bits */ +var MATCH = 25; /* o: waiting for output space to copy string */ +var LIT = 26; /* o: waiting for output space to write literal */ +var CHECK = 27; /* i: waiting for 32-bit check value */ +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ +var DONE = 29; /* finished check, done -- remain here until reset */ +var BAD = 30; /* got a data error -- remain here until reset */ +var MEM = 31; /* got an inflate() memory error -- remain here until reset */ +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + +/* ===========================================================================*/ + + + +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_WBITS = MAX_WBITS; + + +function zswap32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); +} + + +function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* + because we don't have pointers in js, we use lencode and distcode directly + as buffers so we don't need codes + */ + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ +} + +function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + +} + +function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); +} + +function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; +} + +function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); +} + + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +var virgin = true; + +var lenfix, distfix; // We have no pointers in JS, so keep tables separate + +function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; +} + + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; +} + +function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more conveniend processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = zswap32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// +//#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } +//#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state.lenbits = 9; + + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } +//#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +//#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// Trace((stderr, "inflate.c too far\n")); +// copy -= state.whave; +// if (copy > state.length) { copy = state.length; } +// if (copy > left) { copy = left; } +// left -= copy; +// state.length -= copy; +// do { +// output[put++] = 0; +// } while (--copy); +// if (state.length === 0) { state.mode = LEN; } +// break; +//#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' insdead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; +} + +function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; +} + +function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; +} + +function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var state; + var dictid; + var ret; + + /* check state */ + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + state = strm.state; + + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + + /* check for correct dictionary identifier */ + if (state.mode === DICT) { + dictid = 1; /* adler32(0, null, 0)*/ + /* dictid = adler32(dictid, dictionary, dictLength); */ + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + /* copy dictionary to window using updatewindow(), which will amend the + existing dictionary if appropriate */ + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + // Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +exports.inflateReset = inflateReset; +exports.inflateReset2 = inflateReset2; +exports.inflateResetKeep = inflateResetKeep; +exports.inflateInit = inflateInit; +exports.inflateInit2 = inflateInit2; +exports.inflate = inflate; +exports.inflateEnd = inflateEnd; +exports.inflateGetHeader = inflateGetHeader; +exports.inflateSetDictionary = inflateSetDictionary; +exports.inflateInfo = 'pako inflate (from Nodeca project)'; + +/* Not implemented +exports.inflateCopy = inflateCopy; +exports.inflateGetDictionary = inflateGetDictionary; +exports.inflateMark = inflateMark; +exports.inflatePrime = inflatePrime; +exports.inflateSync = inflateSync; +exports.inflateSyncPoint = inflateSyncPoint; +exports.inflateUndermine = inflateUndermine; +*/ diff --git a/node_modules/pako/lib/zlib/inftrees.js b/node_modules/pako/lib/zlib/inftrees.js new file mode 100755 index 00000000..16e4d520 --- /dev/null +++ b/node_modules/pako/lib/zlib/inftrees.js @@ -0,0 +1,327 @@ +'use strict'; + + +var utils = require('../utils/common'); + +var MAXBITS = 15; +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +]; + +var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 +]; + +var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 +]; + +var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 +]; + +module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) +{ + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; +// var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + var i = 0; + /* process all codes and make table entries */ + for (;;) { + i++; + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; + table.bits[low] = root; + table.val[low] = next - opts.table_index;*/ + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; +}; diff --git a/node_modules/pako/lib/zlib/messages.js b/node_modules/pako/lib/zlib/messages.js new file mode 100755 index 00000000..d022f0f0 --- /dev/null +++ b/node_modules/pako/lib/zlib/messages.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; diff --git a/node_modules/pako/lib/zlib/trees.js b/node_modules/pako/lib/zlib/trees.js new file mode 100755 index 00000000..cef5f156 --- /dev/null +++ b/node_modules/pako/lib/zlib/trees.js @@ -0,0 +1,1202 @@ +'use strict'; + + +var utils = require('../utils/common'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +//var Z_FILTERED = 1; +//var Z_HUFFMAN_ONLY = 2; +//var Z_RLE = 3; +var Z_FIXED = 4; +//var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +var Z_BINARY = 0; +var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + +/*============================================================================*/ + + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + +// From zutil.h + +var STORED_BLOCK = 0; +var STATIC_TREES = 1; +var DYN_TREES = 2; +/* The three kinds of block type */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +/* The minimum and maximum match lengths */ + +// From deflate.h +/* =========================================================================== + * Internal compression state. + */ + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ + +var LITERALS = 256; +/* number of literal bytes 0..255 */ + +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ + +var D_CODES = 30; +/* number of distance codes */ + +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ + +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ + +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var Buf_size = 16; +/* size of bit buffer in bi_buf */ + + +/* =========================================================================== + * Constants + */ + +var MAX_BL_BITS = 7; +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +var END_BLOCK = 256; +/* end of block literal code */ + +var REP_3_6 = 16; +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +var REPZ_3_10 = 17; +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +var REPZ_11_138 = 18; +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +/* eslint-disable comma-spacing,array-bracket-spacing */ +var extra_lbits = /* extra bits for each length code */ + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; + +var extra_dbits = /* extra bits for each distance code */ + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; + +var extra_blbits = /* extra bits for each bit length code */ + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; + +var bl_order = + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +/* eslint-enable comma-spacing,array-bracket-spacing */ + +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +// We pre-fill arrays with 0 to avoid uninitialized gaps + +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ + +// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1 +var static_ltree = new Array((L_CODES + 2) * 2); +zero(static_ltree); +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +var static_dtree = new Array(D_CODES * 2); +zero(static_dtree); +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +var _dist_code = new Array(DIST_CODE_LEN); +zero(_dist_code); +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); +zero(_length_code); +/* length code for each normalized match length (0 == MIN_MATCH) */ + +var base_length = new Array(LENGTH_CODES); +zero(base_length); +/* First normalized length for each code (0 = MIN_MATCH) */ + +var base_dist = new Array(D_CODES); +zero(base_dist); +/* First normalized distance for each code (0 = distance of 1) */ + + +function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + + this.static_tree = static_tree; /* static tree or NULL */ + this.extra_bits = extra_bits; /* extra bits for each code or NULL */ + this.extra_base = extra_base; /* base index for extra_bits */ + this.elems = elems; /* max number of elements in the tree */ + this.max_length = max_length; /* max bit length for the codes */ + + // show if `static_tree` has data or dummy - needed for monomorphic objects + this.has_stree = static_tree && static_tree.length; +} + + +var static_l_desc; +var static_d_desc; +var static_bl_desc; + + +function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; /* the dynamic tree */ + this.max_code = 0; /* largest code with non zero frequency */ + this.stat_desc = stat_desc; /* the corresponding static tree */ +} + + + +function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; +} + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +function put_short(s, w) { +// put_byte(s, (uch)((w) & 0xff)); +// put_byte(s, (uch)((ush)(w) >> 8)); + s.pending_buf[s.pending++] = (w) & 0xff; + s.pending_buf[s.pending++] = (w >>> 8) & 0xff; +} + + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +function send_bits(s, value, length) { + if (s.bi_valid > (Buf_size - length)) { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + put_short(s, s.bi_buf); + s.bi_buf = value >> (Buf_size - s.bi_valid); + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + s.bi_valid += length; + } +} + + +function send_code(s, c, tree) { + send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); +} + + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; +} + + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 0xff; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } +} + + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +function gen_bitlen(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; /* heap index */ + var n, m; /* iterate over the tree elements */ + var bits; /* bit length */ + var xbits; /* extra bits */ + var f; /* frequency */ + var overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1]/*.Len*/ = bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) { continue; } /* not a leaf node */ + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]/*.Freq*/; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); + } + } + if (overflow === 0) { return; } + + // Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { bits--; } + s.bl_count[bits]--; /* move one leaf down the tree */ + s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ + s.bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { continue; } + if (tree[m * 2 + 1]/*.Len*/ !== bits) { + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; + tree[m * 2 + 1]/*.Len*/ = bits; + } + n--; + } + } +} + + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +function gen_codes(tree, max_code, bl_count) +// ct_data *tree; /* the tree to decorate */ +// int max_code; /* largest code with non zero frequency */ +// ushf *bl_count; /* number of codes at each bit length */ +{ + var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + var code = 0; /* running code value */ + var bits; /* bit index */ + var n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits - 1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n = 0; n < (1 << extra_lbits[code]); n++) { + _length_code[length++] = code; + } + } + //Assert (length == 256, "tr_static_init: length != 256"); + /* Note that the length 255 (match length 258) can be represented + * in two different ways: code 284 + 5 bits or code 285, so we + * overwrite length_code[255] to use the best encoding: + */ + _length_code[length - 1] = code; + + /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1 << extra_dbits[code]); n++) { + _dist_code[dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: dist != 256"); + dist >>= 7; /* from now on, all distances are divided by 128 */ + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { + _dist_code[256 + dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1]/*.Len*/ = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1]/*.Len*/ = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes(static_ltree, L_CODES + 1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n * 2 + 1]/*.Len*/ = 5; + static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); + } + + // Now data ready and we can init static trees + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + + //static_init_done = true; +} + + +/* =========================================================================== + * Initialize a new block. + */ +function init_block(s) { + var n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + + s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; +} + + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +function bi_windup(s) +{ + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + //put_byte(s, (Byte)s->bi_buf); + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +function copy_block(s, buf, len, header) +//DeflateState *s; +//charf *buf; /* the input data */ +//unsigned len; /* its length */ +//int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, len); + put_short(s, ~len); + } +// while (len--) { +// put_byte(s, *buf++); +// } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); +} + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +function pqdownheap(s, tree, k) +// deflate_state *s; +// ct_data *tree; /* the tree to restore */ +// int k; /* node to move down */ +{ + var v = s.heap[k]; + var j = k << 1; /* left son of k */ + while (j <= s.heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s.heap_len && + smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s.heap[j], s.depth)) { break; } + + /* Exchange v with the smallest son */ + s.heap[k] = s.heap[j]; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s.heap[k] = v; +} + + +// inlined manually +// var SMALLEST = 1; + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +function compress_block(s, ltree, dtree) +// deflate_state *s; +// const ct_data *ltree; /* literal tree */ +// const ct_data *dtree; /* distance tree */ +{ + var dist; /* distance of matched string */ + var lc; /* match length or unmatched char (if dist == 0) */ + var lx = 0; /* running index in l_buf */ + var code; /* the code to send */ + var extra; /* number of extra bits to send */ + + if (s.last_lit !== 0) { + do { + dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); + lc = s.pending_buf[s.l_buf + lx]; + lx++; + + if (dist === 0) { + send_code(s, lc, ltree); /* send a literal byte */ + //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + //Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + // "pendingBuf overflow"); + + } while (lx < s.last_lit); + } + + send_code(s, END_BLOCK, ltree); +} + + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +function build_tree(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; /* iterate over heap elements */ + var max_code = -1; /* largest code with non zero frequency */ + var node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n * 2]/*.Freq*/ !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + + } else { + tree[n * 2 + 1]/*.Len*/ = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); + tree[node * 2]/*.Freq*/ = 1; + s.depth[node] = 0; + s.opt_len--; + + if (has_stree) { + s.static_len -= stree[node * 2 + 1]/*.Len*/; + } + /* node is 0 or 1 so it does not have extra bits */ + } + desc.max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + //pqremove(s, tree, n); /* n = node of least frequency */ + /*** pqremove ***/ + n = s.heap[1/*SMALLEST*/]; + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1/*SMALLEST*/); + /***/ + + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ + + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ + s.heap[--s.heap_max] = m; + + /* Create a new node father of n and m */ + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; + + /* and insert the new node in the heap */ + s.heap[1/*SMALLEST*/] = node++; + pqdownheap(s, tree, 1/*SMALLEST*/); + + } while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes(tree, max_code, s.bl_count); +} + + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +function scan_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + s.bl_tree[curlen * 2]/*.Freq*/ += count; + + } else if (curlen !== 0) { + + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } + s.bl_tree[REP_3_6 * 2]/*.Freq*/++; + + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; + + } else { + s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; + } + + count = 0; + prevlen = curlen; + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +function send_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); + + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + //Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +function build_bl_tree(s) { + var max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, s.bl_desc); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { + break; + } + } + /* Update opt_len to include the bit length tree and counts */ + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + // s->opt_len, s->static_len)); + + return max_blindex; +} + + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +function send_all_trees(s, lcodes, dcodes, blcodes) +// deflate_state *s; +// int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + var rank; /* index in bl_order */ + + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + // "too many codes"); + //Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); + } + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +function detect_data_type(s) { + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + var black_mask = 0xf3ffc07f; + var n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { + return Z_BINARY; + } + } + + /* Check for textual ("white-listed") bytes. */ + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + } + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + + +var static_init_done = false; + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +function _tr_init(s) +{ + + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + + s.bi_buf = 0; + s.bi_valid = 0; + + /* Initialize the first block of the first file: */ + init_block(s); +} + + +/* =========================================================================== + * Send a stored block + */ +function _tr_stored_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ + copy_block(s, buf, stored_len, true); /* with header */ +} + + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); +} + + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +function _tr_flush_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block, or NULL if too old */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + var max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s.level > 0) { + + /* Check if the file is binary or text */ + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + + /* Construct the literal and distance trees */ + build_tree(s, s.l_desc); + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + + build_tree(s, s.d_desc); + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s.opt_len + 3 + 7) >>> 3; + static_lenb = (s.static_len + 3 + 7) >>> 3; + + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + // s->last_lit)); + + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } + + } else { + // Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + + if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { + /* 4: two words for the lengths */ + + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); + } + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + // s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +function _tr_tally(s, dist, lc) +// deflate_state *s; +// unsigned dist; /* distance of matched string */ +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + //var out_length, in_length, dcode; + + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; + + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; + s.last_lit++; + + if (dist === 0) { + /* lc is the unmatched char */ + s.dyn_ltree[lc * 2]/*.Freq*/++; + } else { + s.matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + //Assert((ush)dist < (ush)MAX_DIST(s) && + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility + +//#ifdef TRUNCATE_BLOCK +// /* Try to guess if it is profitable to stop the current block here */ +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { +// /* Compute an upper bound for the compressed length */ +// out_length = s.last_lit*8; +// in_length = s.strstart - s.block_start; +// +// for (dcode = 0; dcode < D_CODES; dcode++) { +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); +// } +// out_length >>>= 3; +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", +// // s->last_lit, in_length, out_length, +// // 100L - out_length*100L/in_length)); +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { +// return true; +// } +// } +//#endif + + return (s.last_lit === s.lit_bufsize - 1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +exports._tr_init = _tr_init; +exports._tr_stored_block = _tr_stored_block; +exports._tr_flush_block = _tr_flush_block; +exports._tr_tally = _tr_tally; +exports._tr_align = _tr_align; diff --git a/node_modules/pako/lib/zlib/zstream.js b/node_modules/pako/lib/zlib/zstream.js new file mode 100755 index 00000000..2d93a391 --- /dev/null +++ b/node_modules/pako/lib/zlib/zstream.js @@ -0,0 +1,29 @@ +'use strict'; + + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; diff --git a/node_modules/pako/package.json b/node_modules/pako/package.json new file mode 100755 index 00000000..34d1e2e7 --- /dev/null +++ b/node_modules/pako/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + { + "raw": "pako@~0.2.0", + "scope": null, + "escapedName": "pako", + "name": "pako", + "rawSpec": "~0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/browserify-zlib" + ] + ], + "_from": "pako@>=0.2.0 <0.3.0", + "_id": "pako@0.2.9", + "_inCache": true, + "_location": "/pako", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/pako-0.2.9.tgz_1469133699053_0.013920168625190854" + }, + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + }, + "_npmVersion": "2.15.5", + "_phantomChildren": {}, + "_requested": { + "raw": "pako@~0.2.0", + "scope": null, + "escapedName": "pako", + "name": "pako", + "rawSpec": "~0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/browserify-zlib" + ], + "_resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "_shasum": "f3f7522f4ef782348da8161bad9ecfd51bf83a75", + "_shrinkwrap": null, + "_spec": "pako@~0.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/browserify-zlib", + "bugs": { + "url": "https://github.com/nodeca/pako/issues" + }, + "contributors": [ + { + "name": "Andrei Tuputcyn", + "url": "https://github.com/andr83" + }, + { + "name": "Vitaly Puzrin", + "url": "https://github.com/puzrin" + } + ], + "dependencies": {}, + "description": "zlib port to javascript - fast, modularized, with browser support", + "devDependencies": { + "ansi": "*", + "async": "*", + "benchmark": "*", + "browserify": "*", + "eslint": "^2.1.0", + "eslint-plugin-nodeca": "~1.0.3", + "grunt": "~0.4.4", + "grunt-cli": "~0.1.13", + "grunt-contrib-connect": "~0.9.0", + "grunt-saucelabs": "~8.6.0", + "istanbul": "*", + "lodash": "*", + "mocha": "1.21.5", + "ndoc": "*", + "uglify-js": "*" + }, + "directories": {}, + "dist": { + "shasum": "f3f7522f4ef782348da8161bad9ecfd51bf83a75", + "tarball": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz" + }, + "files": [ + "index.js", + "dist/", + "lib/" + ], + "gitHead": "85d145e616967f3720382f416da530c23c02ad13", + "homepage": "https://github.com/nodeca/pako", + "keywords": [ + "zlib", + "deflate", + "inflate", + "gzip" + ], + "license": "MIT", + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "name": "pako", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/nodeca/pako.git" + }, + "scripts": {}, + "version": "0.2.9" +} diff --git a/node_modules/parse-glob/LICENSE b/node_modules/parse-glob/LICENSE new file mode 100755 index 00000000..65f90aca --- /dev/null +++ b/node_modules/parse-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/parse-glob/README.md b/node_modules/parse-glob/README.md new file mode 100755 index 00000000..000ccd99 --- /dev/null +++ b/node_modules/parse-glob/README.md @@ -0,0 +1,115 @@ +# parse-glob [![NPM version](https://badge.fury.io/js/parse-glob.svg)](http://badge.fury.io/js/parse-glob) [![Build Status](https://travis-ci.org/jonschlinkert/parse-glob.svg)](https://travis-ci.org/jonschlinkert/parse-glob) + +> Parse a glob pattern into an object of tokens. + +**Changes from v1.0.0 to v3.0.4** + +* all path-related properties are now on the `path` object +* all boolean properties are now on the `is` object +* adds `base` property + +See the [properties](#properties) section for details. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i parse-glob --save +``` + +* parses 1,000+ glob patterns in 29ms (2.3 GHz Intel Core i7) +* Extensive [unit tests](./test.js) (more than 1,000 lines), covering wildcards, globstars, character classes, brace patterns, extglobs, dotfiles and other complex patterns. + +See the tests for [hundreds of examples](./test.js). + +## Usage + +```js +var parseGlob = require('parse-glob'); +``` + +**Example** + +```js +parseGlob('a/b/c/**/*.{yml,json}'); +``` + +**Returns:** + +```js +{ orig: 'a/b/c/**/*.{yml,json}', + is: + { glob: true, + negated: false, + extglob: false, + braces: true, + brackets: false, + globstar: true, + dotfile: false, + dotdir: false }, + glob: '**/*.{yml,json}', + base: 'a/b/c', + path: + { dirname: 'a/b/c/**/', + basename: '*.{yml,json}', + filename: '*', + extname: '.{yml,json}', + ext: '{yml,json}' } } +``` + +## Properties + +The object returned by parseGlob has the following properties: + +* `orig`: a copy of the original, unmodified glob pattern +* `is`: an object with boolean information about the glob: + - `glob`: true if the pattern actually a glob pattern + - `negated`: true if it's a negation pattern (`!**/foo.js`) + - `extglob`: true if it has extglobs (`@(foo|bar)`) + - `braces`: true if it has braces (`{1..2}` or `.{txt,md}`) + - `brackets`: true if it has POSIX brackets (`[[:alpha:]]`) + - `globstar`: true if the pattern has a globstar (double star, `**`) + - `dotfile`: true if the pattern should match dotfiles + - `dotdir`: true if the pattern should match dot-directories (like `.git`) +* `glob`: the glob pattern part of the string, if any +* `base`: the non-glob part of the string, if any +* `path`: file path segments + - `dirname`: directory + - `basename`: file name with extension + - `filename`: file name without extension + - `extname`: file extension with dot + - `ext`: file extension without dot + +## Related +* [glob-base](https://www.npmjs.com/package/glob-base): Returns an object with the (non-glob) base path and the actual pattern. | [homepage](https://github.com/jonschlinkert/glob-base) +* [glob-parent](https://www.npmjs.com/package/glob-parent): Strips glob magic from a string to provide the parent path | [homepage](https://github.com/es128/glob-parent) +* [glob-path-regex](https://www.npmjs.com/package/glob-path-regex): Regular expression for matching the parts of glob pattern. | [homepage](https://github.com/regexps/glob-path-regex) +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern. | [homepage](https://github.com/jonschlinkert/is-glob) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-glob/issues/new). + +## Tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2014-2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 22, 2015._ \ No newline at end of file diff --git a/node_modules/parse-glob/index.js b/node_modules/parse-glob/index.js new file mode 100755 index 00000000..4ab691af --- /dev/null +++ b/node_modules/parse-glob/index.js @@ -0,0 +1,156 @@ +/*! + * parse-glob + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isGlob = require('is-glob'); +var findBase = require('glob-base'); +var extglob = require('is-extglob'); +var dotfile = require('is-dotfile'); + +/** + * Expose `cache` + */ + +var cache = module.exports.cache = {}; + +/** + * Parse a glob pattern into tokens. + * + * When no paths or '**' are in the glob, we use a + * different strategy for parsing the filename, since + * file names can contain braces and other difficult + * patterns. such as: + * + * - `*.{a,b}` + * - `(**|*.js)` + */ + +module.exports = function parseGlob(glob) { + if (cache.hasOwnProperty(glob)) { + return cache[glob]; + } + + var tok = {}; + tok.orig = glob; + tok.is = {}; + + // unescape dots and slashes in braces/brackets + glob = escape(glob); + + var parsed = findBase(glob); + tok.is.glob = parsed.isGlob; + + tok.glob = parsed.glob; + tok.base = parsed.base; + var segs = /([^\/]*)$/.exec(glob); + + tok.path = {}; + tok.path.dirname = ''; + tok.path.basename = segs[1] || ''; + tok.path.dirname = glob.split(tok.path.basename).join('') || ''; + var basename = (tok.path.basename || '').split('.') || ''; + tok.path.filename = basename[0] || ''; + tok.path.extname = basename.slice(1).join('.') || ''; + tok.path.ext = ''; + + if (isGlob(tok.path.dirname) && !tok.path.basename) { + if (!/\/$/.test(tok.glob)) { + tok.path.basename = tok.glob; + } + tok.path.dirname = tok.base; + } + + if (glob.indexOf('/') === -1 && !tok.is.globstar) { + tok.path.dirname = ''; + tok.path.basename = tok.orig; + } + + var dot = tok.path.basename.indexOf('.'); + if (dot !== -1) { + tok.path.filename = tok.path.basename.slice(0, dot); + tok.path.extname = tok.path.basename.slice(dot); + } + + if (tok.path.extname.charAt(0) === '.') { + var exts = tok.path.extname.split('.'); + tok.path.ext = exts[exts.length - 1]; + } + + // unescape dots and slashes in braces/brackets + tok.glob = unescape(tok.glob); + tok.path.dirname = unescape(tok.path.dirname); + tok.path.basename = unescape(tok.path.basename); + tok.path.filename = unescape(tok.path.filename); + tok.path.extname = unescape(tok.path.extname); + + // Booleans + var is = (glob && tok.is.glob); + tok.is.negated = glob && glob.charAt(0) === '!'; + tok.is.extglob = glob && extglob(glob); + tok.is.braces = has(is, glob, '{'); + tok.is.brackets = has(is, glob, '[:'); + tok.is.globstar = has(is, glob, '**'); + tok.is.dotfile = dotfile(tok.path.basename) || dotfile(tok.path.filename); + tok.is.dotdir = dotdir(tok.path.dirname); + return (cache[glob] = tok); +} + +/** + * Returns true if the glob matches dot-directories. + * + * @param {Object} `tok` The tokens object + * @param {Object} `path` The path object + * @return {Object} + */ + +function dotdir(base) { + if (base.indexOf('/.') !== -1) { + return true; + } + if (base.charAt(0) === '.' && base.charAt(1) !== '/') { + return true; + } + return false; +} + +/** + * Returns true if the pattern has the given `ch`aracter(s) + * + * @param {Object} `glob` The glob pattern. + * @param {Object} `ch` The character to test for + * @return {Object} + */ + +function has(is, glob, ch) { + return is && glob.indexOf(ch) !== -1; +} + +/** + * Escape/unescape utils + */ + +function escape(str) { + var re = /\{([^{}]*?)}|\(([^()]*?)\)|\[([^\[\]]*?)\]/g; + return str.replace(re, function (outter, braces, parens, brackets) { + var inner = braces || parens || brackets; + if (!inner) { return outter; } + return outter.split(inner).join(esc(inner)); + }); +} + +function esc(str) { + str = str.split('/').join('__SLASH__'); + str = str.split('.').join('__DOT__'); + return str; +} + +function unescape(str) { + str = str.split('__SLASH__').join('/'); + str = str.split('__DOT__').join('.'); + return str; +} diff --git a/node_modules/parse-glob/package.json b/node_modules/parse-glob/package.json new file mode 100755 index 00000000..5ba0b751 --- /dev/null +++ b/node_modules/parse-glob/package.json @@ -0,0 +1,124 @@ +{ + "_args": [ + [ + { + "raw": "parse-glob@^3.0.4", + "scope": null, + "escapedName": "parse-glob", + "name": "parse-glob", + "rawSpec": "^3.0.4", + "spec": ">=3.0.4 <4.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch" + ] + ], + "_from": "parse-glob@>=3.0.4 <4.0.0", + "_id": "parse-glob@3.0.4", + "_inCache": true, + "_location": "/parse-glob", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "parse-glob@^3.0.4", + "scope": null, + "escapedName": "parse-glob", + "name": "parse-glob", + "rawSpec": "^3.0.4", + "spec": ">=3.0.4 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "_shasum": "b2c376cfb11f35513badd173ef0bb6e3a388391c", + "_shrinkwrap": null, + "_spec": "parse-glob@^3.0.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/parse-glob/issues" + }, + "dependencies": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "description": "Parse a glob pattern into an object of tokens.", + "devDependencies": { + "browserify": "^9.0.3", + "lodash": "^3.3.1", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "b2c376cfb11f35513badd173ef0bb6e3a388391c", + "tarball": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "9bfccb63acdeb3b1ed62035b3adef0e5081d8fc6", + "homepage": "https://github.com/jonschlinkert/parse-glob", + "keywords": [ + "glob", + "match", + "bash", + "expand", + "expansion", + "expression", + "file", + "files", + "filter", + "find", + "glob", + "globbing", + "globs", + "globstar", + "match", + "matcher", + "matches", + "matching", + "path", + "pattern", + "patterns", + "regex", + "regexp", + "regular", + "shell", + "wildcard" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "parse-glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/parse-glob.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js", + "test": "mocha" + }, + "version": "3.0.4" +} diff --git a/node_modules/parseurl/HISTORY.md b/node_modules/parseurl/HISTORY.md new file mode 100755 index 00000000..395041ee --- /dev/null +++ b/node_modules/parseurl/HISTORY.md @@ -0,0 +1,47 @@ +1.3.1 / 2016-01-17 +================== + + * perf: enable strict mode + +1.3.0 / 2014-08-09 +================== + + * Add `parseurl.original` for parsing `req.originalUrl` with fallback + * Return `undefined` if `req.url` is `undefined` + +1.2.0 / 2014-07-21 +================== + + * Cache URLs based on original value + * Remove no-longer-needed URL mis-parse work-around + * Simplify the "fast-path" `RegExp` + +1.1.3 / 2014-07-08 +================== + + * Fix typo + +1.1.2 / 2014-07-08 +================== + + * Seriously fix Node.js 0.8 compatibility + +1.1.1 / 2014-07-08 +================== + + * Fix Node.js 0.8 compatibility + +1.1.0 / 2014-07-08 +================== + + * Incorporate URL href-only parse fast-path + +1.0.1 / 2014-03-08 +================== + + * Add missing `require` + +1.0.0 / 2014-03-08 +================== + + * Genesis from `connect` diff --git a/node_modules/parseurl/LICENSE b/node_modules/parseurl/LICENSE new file mode 100755 index 00000000..ec7dfe7b --- /dev/null +++ b/node_modules/parseurl/LICENSE @@ -0,0 +1,24 @@ + +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parseurl/README.md b/node_modules/parseurl/README.md new file mode 100755 index 00000000..f4796ebb --- /dev/null +++ b/node_modules/parseurl/README.md @@ -0,0 +1,120 @@ +# parseurl + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Parse a URL with memoization. + +## Install + +```bash +$ npm install parseurl +``` + +## API + +```js +var parseurl = require('parseurl') +``` + +### parseurl(req) + +Parse the URL of the given request object (looks at the `req.url` property) +and return the result. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.url` does +not change will return a cached parsed object, rather than parsing again. + +### parseurl.original(req) + +Parse the original URL of the given request object and return the result. +This works by trying to parse `req.originalUrl` if it is a string, otherwise +parses `req.url`. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.originalUrl` +does not change will return a cached parsed object, rather than parsing again. + +## Benchmark + +```bash +$ npm run-script bench + +> parseurl@1.3.1 bench nodejs-parseurl +> node benchmark/index.js + +> node benchmark/fullurl.js + + Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" + + 1 test completed. + 2 tests completed. + 3 tests completed. + + fasturl x 1,290,780 ops/sec ±0.46% (195 runs sampled) + nativeurl x 56,401 ops/sec ±0.22% (196 runs sampled) + parseurl x 55,231 ops/sec ±0.22% (194 runs sampled) + +> node benchmark/pathquery.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" + + 1 test completed. + 2 tests completed. + 3 tests completed. + + fasturl x 1,986,668 ops/sec ±0.27% (190 runs sampled) + nativeurl x 98,740 ops/sec ±0.21% (195 runs sampled) + parseurl x 2,628,171 ops/sec ±0.36% (195 runs sampled) + +> node benchmark/samerequest.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object + + 1 test completed. + 2 tests completed. + 3 tests completed. + + fasturl x 2,184,468 ops/sec ±0.40% (194 runs sampled) + nativeurl x 99,437 ops/sec ±0.71% (194 runs sampled) + parseurl x 10,498,005 ops/sec ±0.61% (186 runs sampled) + +> node benchmark/simplepath.js + + Parsing URL "/foo/bar" + + 1 test completed. + 2 tests completed. + 3 tests completed. + + fasturl x 4,535,825 ops/sec ±0.27% (191 runs sampled) + nativeurl x 98,769 ops/sec ±0.54% (191 runs sampled) + parseurl x 4,164,865 ops/sec ±0.34% (192 runs sampled) + +> node benchmark/slash.js + + Parsing URL "/" + + 1 test completed. + 2 tests completed. + 3 tests completed. + + fasturl x 4,908,405 ops/sec ±0.42% (191 runs sampled) + nativeurl x 100,945 ops/sec ±0.59% (188 runs sampled) + parseurl x 4,333,208 ops/sec ±0.27% (194 runs sampled) +``` + +## License + + [MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/parseurl.svg +[npm-url]: https://npmjs.org/package/parseurl +[node-version-image]: https://img.shields.io/node/v/parseurl.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/pillarjs/parseurl/master.svg +[travis-url]: https://travis-ci.org/pillarjs/parseurl +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/parseurl/master.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master +[downloads-image]: https://img.shields.io/npm/dm/parseurl.svg +[downloads-url]: https://npmjs.org/package/parseurl diff --git a/node_modules/parseurl/index.js b/node_modules/parseurl/index.js new file mode 100755 index 00000000..56cc6ec7 --- /dev/null +++ b/node_modules/parseurl/index.js @@ -0,0 +1,138 @@ +/*! + * parseurl + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + */ + +var url = require('url') +var parse = url.parse +var Url = url.Url + +/** + * Pattern for a simple path case. + * See: https://github.com/joyent/node/pull/7878 + */ + +var simplePathRegExp = /^(\/\/?(?!\/)[^\?#\s]*)(\?[^#\s]*)?$/ + +/** + * Exports. + */ + +module.exports = parseurl +module.exports.original = originalurl + +/** + * Parse the `req` url with memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @api public + */ + +function parseurl(req) { + var url = req.url + + if (url === undefined) { + // URL is undefined + return undefined + } + + var parsed = req._parsedUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return req._parsedUrl = parsed +}; + +/** + * Parse the `req` original url with fallback and memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @api public + */ + +function originalurl(req) { + var url = req.originalUrl + + if (typeof url !== 'string') { + // Fallback + return parseurl(req) + } + + var parsed = req._parsedOriginalUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return req._parsedOriginalUrl = parsed +}; + +/** + * Parse the `str` url with fast-path short-cut. + * + * @param {string} str + * @return {Object} + * @api private + */ + +function fastparse(str) { + // Try fast path regexp + // See: https://github.com/joyent/node/pull/7878 + var simplePath = typeof str === 'string' && simplePathRegExp.exec(str) + + // Construct simple URL + if (simplePath) { + var pathname = simplePath[1] + var search = simplePath[2] || null + var url = Url !== undefined + ? new Url() + : {} + url.path = str + url.href = str + url.pathname = pathname + url.search = search + url.query = search && search.substr(1) + + return url + } + + return parse(str) +} + +/** + * Determine if parsed is still fresh for url. + * + * @param {string} url + * @param {object} parsedUrl + * @return {boolean} + * @api private + */ + +function fresh(url, parsedUrl) { + return typeof parsedUrl === 'object' + && parsedUrl !== null + && (Url === undefined || parsedUrl instanceof Url) + && parsedUrl._raw === url +} diff --git a/node_modules/parseurl/package.json b/node_modules/parseurl/package.json new file mode 100755 index 00000000..b73042e2 --- /dev/null +++ b/node_modules/parseurl/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "parseurl@~1.3.1", + "scope": null, + "escapedName": "parseurl", + "name": "parseurl", + "rawSpec": "~1.3.1", + "spec": ">=1.3.1 <1.4.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "parseurl@>=1.3.1 <1.4.0", + "_id": "parseurl@1.3.1", + "_inCache": true, + "_location": "/parseurl", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "parseurl@~1.3.1", + "scope": null, + "escapedName": "parseurl", + "name": "parseurl", + "rawSpec": "~1.3.1", + "spec": ">=1.3.1 <1.4.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/finalhandler", + "/serve-index", + "/serve-static" + ], + "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", + "_shasum": "c8ab8c9223ba34888aa64a297b28853bec18da56", + "_shrinkwrap": null, + "_spec": "parseurl@~1.3.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/pillarjs/parseurl/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "dependencies": {}, + "description": "parse a url with memoization", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.0.0", + "fast-url-parser": "1.1.3", + "istanbul": "0.4.2", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "c8ab8c9223ba34888aa64a297b28853bec18da56", + "tarball": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "6d22d376d75b927ab2b5347ce3a1d6735133dd43", + "homepage": "https://github.com/pillarjs/parseurl", + "license": "MIT", + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "mscdex", + "email": "mscdex@mscdex.net" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + } + ], + "name": "parseurl", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/pillarjs/parseurl.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "test": "mocha --check-leaks --bail --reporter spec test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" + }, + "version": "1.3.1" +} diff --git a/node_modules/path-browserify/LICENSE b/node_modules/path-browserify/LICENSE new file mode 100755 index 00000000..ee27ba4b --- /dev/null +++ b/node_modules/path-browserify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-browserify/index.js b/node_modules/path-browserify/index.js new file mode 100755 index 00000000..285e32d7 --- /dev/null +++ b/node_modules/path-browserify/index.js @@ -0,0 +1,224 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; diff --git a/node_modules/path-browserify/package.json b/node_modules/path-browserify/package.json new file mode 100755 index 00000000..66c9301f --- /dev/null +++ b/node_modules/path-browserify/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + { + "raw": "path-browserify@0.0.0", + "scope": null, + "escapedName": "path-browserify", + "name": "path-browserify", + "rawSpec": "0.0.0", + "spec": "0.0.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "path-browserify@0.0.0", + "_id": "path-browserify@0.0.0", + "_inCache": true, + "_location": "/path-browserify", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_npmVersion": "1.3.14", + "_phantomChildren": {}, + "_requested": { + "raw": "path-browserify@0.0.0", + "scope": null, + "escapedName": "path-browserify", + "name": "path-browserify", + "rawSpec": "0.0.0", + "spec": "0.0.0", + "type": "version" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "_shasum": "a0b870729aae214005b7d5032ec2cbbb0fb4451a", + "_shrinkwrap": null, + "_spec": "path-browserify@0.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/path-browserify/issues" + }, + "dependencies": {}, + "description": "the path module from node core for browsers", + "devDependencies": { + "tape": "~1.0.4" + }, + "directories": {}, + "dist": { + "shasum": "a0b870729aae214005b7d5032ec2cbbb0fb4451a", + "tarball": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz" + }, + "homepage": "https://github.com/substack/path-browserify", + "keywords": [ + "path", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "path-browserify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/path-browserify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "0.0.0" +} diff --git a/node_modules/path-browserify/readme.markdown b/node_modules/path-browserify/readme.markdown new file mode 100755 index 00000000..8ae1dd89 --- /dev/null +++ b/node_modules/path-browserify/readme.markdown @@ -0,0 +1,3 @@ +# path-browserify + +the path module from node core for browsers diff --git a/node_modules/path-exists/index.js b/node_modules/path-exists/index.js new file mode 100755 index 00000000..a7e680a7 --- /dev/null +++ b/node_modules/path-exists/index.js @@ -0,0 +1,24 @@ +'use strict'; +var fs = require('fs'); +var Promise = require('pinkie-promise'); + +module.exports = function (fp) { + var fn = typeof fs.access === 'function' ? fs.access : fs.stat; + + return new Promise(function (resolve) { + fn(fp, function (err) { + resolve(!err); + }); + }); +}; + +module.exports.sync = function (fp) { + var fn = typeof fs.accessSync === 'function' ? fs.accessSync : fs.statSync; + + try { + fn(fp); + return true; + } catch (err) { + return false; + } +}; diff --git a/node_modules/path-exists/license b/node_modules/path-exists/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/path-exists/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-exists/package.json b/node_modules/path-exists/package.json new file mode 100755 index 00000000..29dca77e --- /dev/null +++ b/node_modules/path-exists/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "path-exists@^2.0.0", + "scope": null, + "escapedName": "path-exists", + "name": "path-exists", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/find-up" + ] + ], + "_from": "path-exists@>=2.0.0 <3.0.0", + "_id": "path-exists@2.1.0", + "_inCache": true, + "_location": "/path-exists", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "raw": "path-exists@^2.0.0", + "scope": null, + "escapedName": "path-exists", + "name": "path-exists", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/find-up" + ], + "_resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "_shasum": "0feb6c64f0fc518d9a754dd5efb62c7022761f4b", + "_shrinkwrap": null, + "_spec": "path-exists@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/find-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-exists/issues" + }, + "dependencies": { + "pinkie-promise": "^2.0.0" + }, + "description": "Check if a path exists", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "0feb6c64f0fc518d9a754dd5efb62c7022761f4b", + "tarball": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "3af423661e78466764f87c5712263c5d7a1ce5b7", + "homepage": "https://github.com/sindresorhus/path-exists", + "keywords": [ + "path", + "exists", + "exist", + "file", + "filepath", + "fs", + "filesystem", + "file-system", + "access", + "stat" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "path-exists", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-exists.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.0" +} diff --git a/node_modules/path-exists/readme.md b/node_modules/path-exists/readme.md new file mode 100755 index 00000000..8fbcd68d --- /dev/null +++ b/node_modules/path-exists/readme.md @@ -0,0 +1,45 @@ +# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) + +> Check if a path exists + +Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. + +Never use this before handling a file though: + +> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. + + +## Install + +``` +$ npm install --save path-exists +``` + + +## Usage + +```js +// foo.js +var pathExists = require('path-exists'); + +pathExists('foo.js').then(function (exists) { + console.log(exists); + //=> true +}); +``` + + +## API + +### pathExists(path) + +Returns a promise that resolves to a boolean of whether the path exists. + +### pathExists.sync(path) + +Returns a boolean of whether the path exists. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js new file mode 100755 index 00000000..22aa6c35 --- /dev/null +++ b/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/path-is-absolute/license b/node_modules/path-is-absolute/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json new file mode 100755 index 00000000..98b5d59e --- /dev/null +++ b/node_modules/path-is-absolute/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + { + "raw": "path-is-absolute@^1.0.0", + "scope": null, + "escapedName": "path-is-absolute", + "name": "path-is-absolute", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core" + ] + ], + "_from": "path-is-absolute@>=1.0.0 <2.0.0", + "_id": "path-is-absolute@1.0.1", + "_inCache": true, + "_location": "/path-is-absolute", + "_nodeVersion": "6.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/path-is-absolute-1.0.1.tgz_1475210523565_0.9876507974695414" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "path-is-absolute@^1.0.0", + "scope": null, + "escapedName": "path-is-absolute", + "name": "path-is-absolute", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-core", + "/chokidar", + "/glob", + "/webpack-dev-middleware" + ], + "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "_shrinkwrap": null, + "_spec": "path-is-absolute@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "dependencies": {}, + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "devDependencies": { + "xo": "^0.16.0" + }, + "directories": {}, + "dist": { + "shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "edc91d348b21dac2ab65ea2fbec2868e2eff5eb6", + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "path-is-absolute", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "scripts": { + "test": "xo && node test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md new file mode 100755 index 00000000..8dbdf5fc --- /dev/null +++ b/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-to-regexp/History.md b/node_modules/path-to-regexp/History.md new file mode 100755 index 00000000..7f658784 --- /dev/null +++ b/node_modules/path-to-regexp/History.md @@ -0,0 +1,36 @@ +0.1.7 / 2015-07-28 +================== + + * Fixed regression with escaped round brackets and matching groups. + +0.1.6 / 2015-06-19 +================== + + * Replace `index` feature by outputting all parameters, unnamed and named. + +0.1.5 / 2015-05-08 +================== + + * Add an index property for position in match result. + +0.1.4 / 2015-03-05 +================== + + * Add license information + +0.1.3 / 2014-07-06 +================== + + * Better array support + * Improved support for trailing slash in non-ending mode + +0.1.0 / 2014-03-06 +================== + + * add options.end + +0.0.2 / 2013-02-10 +================== + + * Update to match current express + * add .license property to component.json diff --git a/node_modules/path-to-regexp/LICENSE b/node_modules/path-to-regexp/LICENSE new file mode 100755 index 00000000..983fbe8a --- /dev/null +++ b/node_modules/path-to-regexp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-to-regexp/Readme.md b/node_modules/path-to-regexp/Readme.md new file mode 100755 index 00000000..95452a6e --- /dev/null +++ b/node_modules/path-to-regexp/Readme.md @@ -0,0 +1,35 @@ +# Path-to-RegExp + +Turn an Express-style path string such as `/user/:name` into a regular expression. + +**Note:** This is a legacy branch. You should upgrade to `1.x`. + +## Usage + +```javascript +var pathToRegexp = require('path-to-regexp'); +``` + +### pathToRegexp(path, keys, options) + + - **path** A string in the express format, an array of such strings, or a regular expression + - **keys** An array to be populated with the keys present in the url. Once the function completes, this will be an array of strings. + - **options** + - **options.sensitive** Defaults to false, set this to true to make routes case sensitive + - **options.strict** Defaults to false, set this to true to make the trailing slash matter. + - **options.end** Defaults to true, set this to false to only match the prefix of the URL. + +```javascript +var keys = []; +var exp = pathToRegexp('/foo/:bar', keys); +//keys = ['bar'] +//exp = /^\/foo\/(?:([^\/]+?))\/?$/i +``` + +## Live Demo + +You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/). + +## License + + MIT diff --git a/node_modules/path-to-regexp/index.js b/node_modules/path-to-regexp/index.js new file mode 100755 index 00000000..500d1dad --- /dev/null +++ b/node_modules/path-to-regexp/index.js @@ -0,0 +1,129 @@ +/** + * Expose `pathtoRegexp`. + */ + +module.exports = pathtoRegexp; + +/** + * Match matching groups in a regular expression. + */ +var MATCHING_GROUP_REGEXP = /\((?!\?)/g; + +/** + * Normalize the given path string, + * returning a regular expression. + * + * An empty array should be passed, + * which will contain the placeholder + * key names. For example "/user/:id" will + * then contain ["id"]. + * + * @param {String|RegExp|Array} path + * @param {Array} keys + * @param {Object} options + * @return {RegExp} + * @api private + */ + +function pathtoRegexp(path, keys, options) { + options = options || {}; + keys = keys || []; + var strict = options.strict; + var end = options.end !== false; + var flags = options.sensitive ? '' : 'i'; + var extraOffset = 0; + var keysOffset = keys.length; + var i = 0; + var name = 0; + var m; + + if (path instanceof RegExp) { + while (m = MATCHING_GROUP_REGEXP.exec(path.source)) { + keys.push({ + name: name++, + optional: false, + offset: m.index + }); + } + + return path; + } + + if (Array.isArray(path)) { + // Map array parts into regexps and return their source. We also pass + // the same keys and options instance into every generation to get + // consistent matching groups before we join the sources together. + path = path.map(function (value) { + return pathtoRegexp(value, keys, options).source; + }); + + return new RegExp('(?:' + path.join('|') + ')', flags); + } + + path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?')) + .replace(/\/\(/g, '/(?:') + .replace(/([\/\.])/g, '\\$1') + .replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function (match, slash, format, key, capture, star, optional, offset) { + slash = slash || ''; + format = format || ''; + capture = capture || '([^\\/' + format + ']+?)'; + optional = optional || ''; + + keys.push({ + name: key, + optional: !!optional, + offset: offset + extraOffset + }); + + var result = '' + + (optional ? '' : slash) + + '(?:' + + format + (optional ? slash : '') + capture + + (star ? '((?:[\\/' + format + '].+?)?)' : '') + + ')' + + optional; + + extraOffset += result.length - match.length; + + return result; + }) + .replace(/\*/g, function (star, index) { + var len = keys.length + + while (len-- > keysOffset && keys[len].offset > index) { + keys[len].offset += 3; // Replacement length minus asterisk length. + } + + return '(.*)'; + }); + + // This is a workaround for handling unnamed matching groups. + while (m = MATCHING_GROUP_REGEXP.exec(path)) { + var escapeCount = 0; + var index = m.index; + + while (path.charAt(--index) === '\\') { + escapeCount++; + } + + // It's possible to escape the bracket. + if (escapeCount % 2 === 1) { + continue; + } + + if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) { + keys.splice(keysOffset + i, 0, { + name: name++, // Unnamed matching groups must be consistently linear. + optional: false, + offset: m.index + }); + } + + i++; + } + + // If the path is non-ending, match until the end or a slash. + path += (end ? '$' : (path[path.length - 1] === '/' ? '' : '(?=\\/|$)')); + + return new RegExp(path, flags); +}; diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json new file mode 100755 index 00000000..1b8745b0 --- /dev/null +++ b/node_modules/path-to-regexp/package.json @@ -0,0 +1,219 @@ +{ + "_args": [ + [ + { + "raw": "path-to-regexp@0.1.7", + "scope": null, + "escapedName": "path-to-regexp", + "name": "path-to-regexp", + "rawSpec": "0.1.7", + "spec": "0.1.7", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "path-to-regexp@0.1.7", + "_id": "path-to-regexp@0.1.7", + "_inCache": true, + "_location": "/path-to-regexp", + "_nodeVersion": "2.3.3", + "_npmUser": { + "name": "blakeembrey", + "email": "hello@blakeembrey.com" + }, + "_npmVersion": "2.13.2", + "_phantomChildren": {}, + "_requested": { + "raw": "path-to-regexp@0.1.7", + "scope": null, + "escapedName": "path-to-regexp", + "name": "path-to-regexp", + "rawSpec": "0.1.7", + "spec": "0.1.7", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "_shasum": "df604178005f522f15eb4490e7247a1bfaa67f8c", + "_shrinkwrap": null, + "_spec": "path-to-regexp@0.1.7", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "bugs": { + "url": "https://github.com/component/path-to-regexp/issues" + }, + "component": { + "scripts": { + "path-to-regexp": "index.js" + } + }, + "dependencies": {}, + "description": "Express style path to RegExp utility", + "devDependencies": { + "istanbul": "^0.2.6", + "mocha": "^1.17.1" + }, + "directories": {}, + "dist": { + "shasum": "df604178005f522f15eb4490e7247a1bfaa67f8c", + "tarball": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" + }, + "files": [ + "index.js", + "LICENSE" + ], + "gitHead": "039118d6c3c186d3f176c73935ca887a32a33d93", + "homepage": "https://github.com/component/path-to-regexp#readme", + "keywords": [ + "express", + "regexp" + ], + "license": "MIT", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "hughsk", + "email": "hughskennedy@gmail.com" + }, + { + "name": "timaschew", + "email": "timaschew@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dominicbarnes", + "email": "dominic@dbarnes.info" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + { + "name": "retrofox", + "email": "rdsuarez@gmail.com" + }, + { + "name": "coreh", + "email": "thecoreh@gmail.com" + }, + { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + }, + { + "name": "kelonye", + "email": "kelonyemitchel@gmail.com" + }, + { + "name": "mattmueller", + "email": "mattmuelle@gmail.com" + }, + { + "name": "yields", + "email": "yields@icloud.com" + }, + { + "name": "anthonyshort", + "email": "antshort@gmail.com" + }, + { + "name": "ianstormtaylor", + "email": "ian@ianstormtaylor.com" + }, + { + "name": "cristiandouce", + "email": "cristian@gravityonmars.com" + }, + { + "name": "swatinem", + "email": "arpad.borsos@googlemail.com" + }, + { + "name": "stagas", + "email": "gstagas@gmail.com" + }, + { + "name": "amasad", + "email": "amjad.masad@gmail.com" + }, + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "calvinfo", + "email": "calvin@calv.info" + }, + { + "name": "blakeembrey", + "email": "hello@blakeembrey.com" + }, + { + "name": "timoxley", + "email": "secoif@gmail.com" + }, + { + "name": "jonathanong", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "queckezz", + "email": "fabian.eichenberger@gmail.com" + }, + { + "name": "nami-doc", + "email": "vendethiel@hotmail.fr" + }, + { + "name": "clintwood", + "email": "clint@anotherway.co.za" + }, + { + "name": "thehydroimpulse", + "email": "dnfagnan@gmail.com" + }, + { + "name": "stephenmathieson", + "email": "me@stephenmathieson.com" + }, + { + "name": "trevorgerhardt", + "email": "trevorgerhardt@gmail.com" + }, + { + "name": "dfcreative", + "email": "df.creative@gmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + } + ], + "name": "path-to-regexp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/component/path-to-regexp.git" + }, + "scripts": { + "test": "istanbul cover _mocha -- -R spec" + }, + "version": "0.1.7" +} diff --git a/node_modules/path/LICENSE b/node_modules/path/LICENSE new file mode 100755 index 00000000..e3d4e695 --- /dev/null +++ b/node_modules/path/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/path/README.md b/node_modules/path/README.md new file mode 100755 index 00000000..f5227af4 --- /dev/null +++ b/node_modules/path/README.md @@ -0,0 +1,15 @@ +# path + +This is an exact copy of the NodeJS ’path’ module published to the NPM registry. + +[Documentation](http://nodejs.org/docs/latest/api/path.html) + +## Install + +```sh +$ npm install --save path +``` + +## License + +MIT diff --git a/node_modules/path/package.json b/node_modules/path/package.json new file mode 100755 index 00000000..dd53e4cf --- /dev/null +++ b/node_modules/path/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + { + "raw": "path@^0.11.14", + "scope": null, + "escapedName": "path", + "name": "path", + "rawSpec": "^0.11.14", + "spec": ">=0.11.14 <0.12.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-glsl-loader" + ] + ], + "_from": "path@>=0.11.14 <0.12.0", + "_id": "path@0.11.14", + "_inCache": true, + "_location": "/path", + "_npmUser": { + "name": "jinder", + "email": "jindersidhu@gmail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "path@^0.11.14", + "scope": null, + "escapedName": "path", + "name": "path", + "rawSpec": "^0.11.14", + "spec": ">=0.11.14 <0.12.0", + "type": "range" + }, + "_requiredBy": [ + "/webpack-glsl-loader" + ], + "_resolved": "https://registry.npmjs.org/path/-/path-0.11.14.tgz", + "_shasum": "cbc7569355cb3c83afeb4ace43ecff95231e5a7d", + "_shrinkwrap": null, + "_spec": "path@^0.11.14", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/webpack-glsl-loader", + "author": { + "name": "Joyent", + "url": "http://www.joyent.com" + }, + "bugs": { + "url": "https://github.com/jinder/path/issues" + }, + "dependencies": {}, + "description": "Node.JS path module", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "cbc7569355cb3c83afeb4ace43ecff95231e5a7d", + "tarball": "https://registry.npmjs.org/path/-/path-0.11.14.tgz" + }, + "gitHead": "a723663db8388017634a2d854aca09532b12befa", + "homepage": "http://nodejs.org/docs/latest/api/path.html", + "keywords": [ + "ender", + "path" + ], + "license": "MIT", + "main": "./path.js", + "maintainers": [ + { + "name": "coolaj86", + "email": "coolaj86@gmail.com" + }, + { + "name": "shtylman", + "email": "shtylman@gmail.com" + }, + { + "name": "jinder", + "email": "jindersidhu@gmail.com" + } + ], + "name": "path", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/jinder/path.git" + }, + "scripts": {}, + "version": "0.11.14" +} diff --git a/node_modules/path/path.js b/node_modules/path/path.js new file mode 100755 index 00000000..b32ce442 --- /dev/null +++ b/node_modules/path/path.js @@ -0,0 +1,522 @@ +var process = process || {}; +(function () { + "use strict"; + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + +var isWindows = process.platform === 'win32'; +var util = require('util'); + + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + + +if (isWindows) { + // Regex to split a windows path into three parts: [*, device, slash, + // tail] windows-only + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + + // Regex to split the tail part of the above into [*, dir, basename, ext] + var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + + // Function to split a filename into [root, dir, basename, ext] + // windows version + var splitPath = function(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; + }; + + var normalizeUNCRoot = function(device) { + return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); + }; + + // path.resolve([from ...], to) + // windows version + exports.resolve = function() { + var resolvedDevice = '', + resolvedTail = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1; i--) { + var path; + if (i >= 0) { + path = arguments[i]; + } else if (!resolvedDevice) { + path = process.cwd(); + } else { + // Windows has the concept of drive-specific current working + // directories. If we've resolved a drive letter but not yet an + // absolute path, get cwd for that drive. We're sure the device is not + // an unc path at this points, because unc paths are always absolute. + path = process.env['=' + resolvedDevice]; + // Verify that a drive-local cwd was found and that it actually points + // to our drive. If not, default to the drive's root. + if (!path || path.substr(0, 3).toLowerCase() !== + resolvedDevice.toLowerCase() + '\\') { + path = resolvedDevice + '\\'; + } + } + + // Skip empty and invalid entries + if (!util.isString(path)) { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + var result = splitDeviceRe.exec(path), + device = result[1] || '', + isUnc = device && device.charAt(1) !== ':', + isAbsolute = exports.isAbsolute(path), + tail = result[3]; + + if (device && + resolvedDevice && + device.toLowerCase() !== resolvedDevice.toLowerCase()) { + // This path points to another device so it is not applicable + continue; + } + + if (!resolvedDevice) { + resolvedDevice = device; + } + if (!resolvedAbsolute) { + resolvedTail = tail + '\\' + resolvedTail; + resolvedAbsolute = isAbsolute; + } + + if (resolvedDevice && resolvedAbsolute) { + break; + } + } + + // Convert slashes to backslashes when `resolvedDevice` points to an UNC + // root. Also squash multiple slashes into a single one where appropriate. + if (isUnc) { + resolvedDevice = normalizeUNCRoot(resolvedDevice); + } + + // At this point the path should be resolved to a full absolute path, + // but handle relative paths to be safe (might happen when process.cwd() + // fails) + + // Normalize the tail path + + function f(p) { + return !!p; + } + + resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/).filter(f), + !resolvedAbsolute).join('\\'); + + return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || + '.'; + }; + + // windows version + exports.normalize = function(path) { + var result = splitDeviceRe.exec(path), + device = result[1] || '', + isUnc = device && device.charAt(1) !== ':', + isAbsolute = exports.isAbsolute(path), + tail = result[3], + trailingSlash = /[\\\/]$/.test(tail); + + // If device is a drive letter, we'll normalize to lower case. + if (device && device.charAt(1) === ':') { + device = device[0].toLowerCase() + device.substr(1); + } + + // Normalize the tail path + tail = normalizeArray(tail.split(/[\\\/]+/).filter(function(p) { + return !!p; + }), !isAbsolute).join('\\'); + + if (!tail && !isAbsolute) { + tail = '.'; + } + if (tail && trailingSlash) { + tail += '\\'; + } + + // Convert slashes to backslashes when `device` points to an UNC root. + // Also squash multiple slashes into a single one where appropriate. + if (isUnc) { + device = normalizeUNCRoot(device); + } + + return device + (isAbsolute ? '\\' : '') + tail; + }; + + // windows version + exports.isAbsolute = function(path) { + var result = splitDeviceRe.exec(path), + device = result[1] || '', + isUnc = !!device && device.charAt(1) !== ':'; + // UNC paths are always absolute + return !!result[2] || isUnc; + }; + + // windows version + exports.join = function() { + function f(p) { + if (!util.isString(p)) { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + } + + var paths = Array.prototype.filter.call(arguments, f); + var joined = paths.join('\\'); + + // Make sure that the joined path doesn't start with two slashes, because + // normalize() will mistake it for an UNC path then. + // + // This step is skipped when it is very clear that the user actually + // intended to point at an UNC path. This is assumed when the first + // non-empty string arguments starts with exactly two slashes followed by + // at least one more non-slash character. + // + // Note that for normalize() to treat a path as an UNC path it needs to + // have at least 2 components, so we don't filter for that here. + // This means that the user can use join to construct UNC paths from + // a server name and a share name; for example: + // path.join('//server', 'share') -> '\\\\server\\share\') + if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { + joined = joined.replace(/^[\\\/]{2,}/, '\\'); + } + + return exports.normalize(joined); + }; + + // path.relative(from, to) + // it will solve the relative path from 'from' to 'to', for instance: + // from = 'C:\\orandea\\test\\aaa' + // to = 'C:\\orandea\\impl\\bbb' + // The output of the function should be: '..\\..\\impl\\bbb' + // windows version + exports.relative = function(from, to) { + from = exports.resolve(from); + to = exports.resolve(to); + + // windows is not case sensitive + var lowerFrom = from.toLowerCase(); + var lowerTo = to.toLowerCase(); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end + 1); + } + + var toParts = trim(to.split('\\')); + + var lowerFromParts = trim(lowerFrom.split('\\')); + var lowerToParts = trim(lowerTo.split('\\')); + + var length = Math.min(lowerFromParts.length, lowerToParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (lowerFromParts[i] !== lowerToParts[i]) { + samePartsLength = i; + break; + } + } + + if (samePartsLength == 0) { + return to; + } + + var outputParts = []; + for (var i = samePartsLength; i < lowerFromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('\\'); + }; + + exports.sep = '\\'; + exports.delimiter = ';'; + +} else /* posix */ { + + // Split a filename into [root, dir, basename, ext], unix version + // 'root' is just a slash, or nothing. + var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); + }; + + // path.resolve([from ...], to) + // posix version + exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (!util.isString(path)) { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(resolvedPath.split('/').filter(function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; + }; + + // path.normalize(path) + // posix version + exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = path[path.length - 1] === '/', + segments = path.split('/'), + nonEmptySegments = []; + + // Normalize the path + for (var i = 0; i < segments.length; i++) { + if (segments[i]) { + nonEmptySegments.push(segments[i]); + } + } + path = normalizeArray(nonEmptySegments, !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; + }; + + // posix version + exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; + }; + + // posix version + exports.join = function() { + var path = ''; + for (var i = 0; i < arguments.length; i++) { + var segment = arguments[i]; + if (!util.isString(segment)) { + throw new TypeError('Arguments to path.join must be strings'); + } + if (segment) { + if (!path) { + path += segment; + } else { + path += '/' + segment; + } + } + } + return exports.normalize(path); + }; + + + // path.relative(from, to) + // posix version + exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); + }; + + exports.sep = '/'; + exports.delimiter = ':'; +} + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + + +exports.exists = util.deprecate(function(path, callback) { + require('fs').exists(path, callback); +}, 'path.exists is now called `fs.exists`.'); + + +exports.existsSync = util.deprecate(function(path) { + return require('fs').existsSync(path); +}, 'path.existsSync is now called `fs.existsSync`.'); + + +if (isWindows) { + exports._makeLong = function(path) { + // Note: this will *probably* throw somewhere. + if (!util.isString(path)) + return path; + + if (!path) { + return ''; + } + + var resolvedPath = exports.resolve(path); + + if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { + // path is local filesystem path, which needs to be converted + // to long UNC path. + return '\\\\?\\' + resolvedPath; + } else if (/^\\\\[^?.]/.test(resolvedPath)) { + // path is network UNC path, which needs to be converted + // to long UNC path. + return '\\\\?\\UNC\\' + resolvedPath.substring(2); + } + + return path; + }; +} else { + exports._makeLong = function(path) { + return path; + }; +} +}()); diff --git a/node_modules/pbkdf2-compat/.npmignore b/node_modules/pbkdf2-compat/.npmignore new file mode 100755 index 00000000..da23d0d4 --- /dev/null +++ b/node_modules/pbkdf2-compat/.npmignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Deployed apps should consider commenting this line out: +# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git +node_modules diff --git a/node_modules/pbkdf2-compat/.travis.yml b/node_modules/pbkdf2-compat/.travis.yml new file mode 100755 index 00000000..4d695630 --- /dev/null +++ b/node_modules/pbkdf2-compat/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +before_install: + - "npm install npm -g" +node_js: + - "0.10" +env: + - TEST_SUITE=test + - TEST_SUITE=coveralls +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/pbkdf2-compat/LICENSE b/node_modules/pbkdf2-compat/LICENSE new file mode 100755 index 00000000..a115b524 --- /dev/null +++ b/node_modules/pbkdf2-compat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Daniel Cousens + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/pbkdf2-compat/README.md b/node_modules/pbkdf2-compat/README.md new file mode 100755 index 00000000..e03cef1a --- /dev/null +++ b/node_modules/pbkdf2-compat/README.md @@ -0,0 +1,22 @@ +# pbkdf2-compat + +[![build status](https://secure.travis-ci.org/dcousens/pbkdf2-compat.png)](http://travis-ci.org/dcousens/pbkdf2-compat) +[![Coverage Status](https://img.shields.io/coveralls/dcousens/pbkdf2-compat.svg)](https://coveralls.io/r/dcousens/pbkdf2-compat) +[![Version](http://img.shields.io/npm/v/pbkdf2-compat.svg)](https://www.npmjs.org/package/pbkdf2-compat) + +This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from `crypto.getHashes()` + + +## Usage + +``` +var compat = require('pbkd2f-compat') +var derivedKey = compat.pbkdf2Sync('password', 'salt', 1, 32, 'sha512') + +... +``` + + +## Credits + +This module is a derivative of https://github.com/cryptocoinjs/pbkdf2-sha256/, so thanks to [JP Richardson](https://github.com/cryptocoinjs/pbkdf2-sha256/) for laying the ground work. diff --git a/node_modules/pbkdf2-compat/index.js b/node_modules/pbkdf2-compat/index.js new file mode 100755 index 00000000..2af19318 --- /dev/null +++ b/node_modules/pbkdf2-compat/index.js @@ -0,0 +1,12 @@ +var crypto = require('crypto') + +var exportFn = require('./pbkdf2') +var exported = exportFn(crypto) + +module.exports = { + pbkdf2: exported.pbkdf2, + pbkdf2Sync: exported.pbkdf2Sync, + + // for crypto-browserify + __pbkdf2Export: exportFn +} diff --git a/node_modules/pbkdf2-compat/package.json b/node_modules/pbkdf2-compat/package.json new file mode 100755 index 00000000..22f4cf38 --- /dev/null +++ b/node_modules/pbkdf2-compat/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + { + "raw": "pbkdf2-compat@2.0.1", + "scope": null, + "escapedName": "pbkdf2-compat", + "name": "pbkdf2-compat", + "rawSpec": "2.0.1", + "spec": "2.0.1", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/crypto-browserify" + ] + ], + "_from": "pbkdf2-compat@2.0.1", + "_id": "pbkdf2-compat@2.0.1", + "_inCache": true, + "_location": "/pbkdf2-compat", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "dcousens", + "email": "email@dcousens.com" + }, + "_npmVersion": "2.0.2", + "_phantomChildren": {}, + "_requested": { + "raw": "pbkdf2-compat@2.0.1", + "scope": null, + "escapedName": "pbkdf2-compat", + "name": "pbkdf2-compat", + "rawSpec": "2.0.1", + "spec": "2.0.1", + "type": "version" + }, + "_requiredBy": [ + "/crypto-browserify" + ], + "_resolved": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz", + "_shasum": "b6e0c8fa99494d94e0511575802a59a5c142f288", + "_shrinkwrap": null, + "_spec": "pbkdf2-compat@2.0.1", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/crypto-browserify", + "author": { + "name": "Daniel Cousens" + }, + "bugs": { + "url": "https://github.com/dcousens/pbkdf2-compat/issues" + }, + "dependencies": {}, + "description": "Provides the functionality of PBKDF2 with the ability to use any natively supported Node crypto hashing algorithm.", + "devDependencies": { + "istanbul": "^0.3.2", + "mocha": "^1.21.4" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "b6e0c8fa99494d94e0511575802a59a5c142f288", + "tarball": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz" + }, + "gitHead": "d0d90f8acae63d0f069c03c0350935f2ddc14094", + "homepage": "https://github.com/dcousens/pbkdf2-compat", + "keywords": [ + "pbkdf2", + "kdf", + "salt", + "hash" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "dcousens", + "email": "email@dcousens.com" + } + ], + "name": "pbkdf2-compat", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/dcousens/pbkdf2-compat.git" + }, + "scripts": { + "coverage": "istanbul cover mocha -- test/*.js", + "test": "istanbul test mocha -- --reporter list test/*.js" + }, + "version": "2.0.1" +} diff --git a/node_modules/pbkdf2-compat/pbkdf2.js b/node_modules/pbkdf2-compat/pbkdf2.js new file mode 100755 index 00000000..cf8b2d8a --- /dev/null +++ b/node_modules/pbkdf2-compat/pbkdf2.js @@ -0,0 +1,84 @@ +module.exports = function(crypto) { + function pbkdf2(password, salt, iterations, keylen, digest, callback) { + if ('function' === typeof digest) { + callback = digest + digest = undefined + } + + if ('function' !== typeof callback) + throw new Error('No callback provided to pbkdf2') + + setTimeout(function() { + var result + + try { + result = pbkdf2Sync(password, salt, iterations, keylen, digest) + } catch (e) { + return callback(e) + } + + callback(undefined, result) + }) + } + + function pbkdf2Sync(password, salt, iterations, keylen, digest) { + if ('number' !== typeof iterations) + throw new TypeError('Iterations not a number') + + if (iterations < 0) + throw new TypeError('Bad iterations') + + if ('number' !== typeof keylen) + throw new TypeError('Key length not a number') + + if (keylen < 0) + throw new TypeError('Bad key length') + + digest = digest || 'sha1' + + if (!Buffer.isBuffer(password)) password = new Buffer(password) + if (!Buffer.isBuffer(salt)) salt = new Buffer(salt) + + var hLen, l = 1, r, T + var DK = new Buffer(keylen) + var block1 = new Buffer(salt.length + 4) + salt.copy(block1, 0, 0, salt.length) + + for (var i = 1; i <= l; i++) { + block1.writeUInt32BE(i, salt.length) + + var U = crypto.createHmac(digest, password).update(block1).digest() + + if (!hLen) { + hLen = U.length + T = new Buffer(hLen) + l = Math.ceil(keylen / hLen) + r = keylen - (l - 1) * hLen + + if (keylen > (Math.pow(2, 32) - 1) * hLen) + throw new TypeError('keylen exceeds maximum length') + } + + U.copy(T, 0, 0, hLen) + + for (var j = 1; j < iterations; j++) { + U = crypto.createHmac(digest, password).update(U).digest() + + for (var k = 0; k < hLen; k++) { + T[k] ^= U[k] + } + } + + var destPos = (i - 1) * hLen + var len = (i == l ? r : hLen) + T.copy(DK, destPos, 0, len) + } + + return DK + } + + return { + pbkdf2: pbkdf2, + pbkdf2Sync: pbkdf2Sync + } +} diff --git a/node_modules/pbkdf2-compat/test/fixtures.json b/node_modules/pbkdf2-compat/test/fixtures.json new file mode 100755 index 00000000..ff053ef2 --- /dev/null +++ b/node_modules/pbkdf2-compat/test/fixtures.json @@ -0,0 +1,111 @@ +{ + "valid": [ + { + "key": "password", + "salt": "salt", + "iterations": 1, + "dkLen": 32, + "results": { + "sha1": "0c60c80f961f0e71f3a9b524af6012062fe037a6e0f0eb94fe8fc46bdc637164", + "sha256": "120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b", + "sha512": "867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252" + } + }, + { + "key": "password", + "salt": "salt", + "iterations": 2, + "dkLen": 32, + "results": { + "sha1": "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957cae93136266537a8d7bf4b76", + "sha256": "ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43", + "sha512": "e1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f0040713f18aefdb866d53c" + } + }, + { + "key": "password", + "salt": "salt", + "iterations": 1, + "dkLen": 64, + "results": { + "sha1": "0c60c80f961f0e71f3a9b524af6012062fe037a6e0f0eb94fe8fc46bdc637164ac2e7a8e3f9d2e83ace57e0d50e5e1071367c179bc86c767fc3f78ddb561363f", + "sha256": "120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b4dbf3a2f3dad3377264bb7b8e8330d4efc7451418617dabef683735361cdc18c", + "sha512": "867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252c02d470a285a0501bad999bfe943c08f050235d7d68b1da55e63f73b60a57fce" + } + }, + { + "key": "password", + "salt": "salt", + "iterations": 2, + "dkLen": 64, + "results": { + "sha1": "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957cae93136266537a8d7bf4b76c51094cc1ae010b19923ddc4395cd064acb023ffd1edd5ef4be8ffe61426c28e", + "sha256": "ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43830651afcb5c862f0b249bd031f7a67520d136470f5ec271ece91c07773253d9", + "sha512": "e1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f0040713f18aefdb866d53cf76cab2868a39b9f7840edce4fef5a82be67335c77a6068e04112754f27ccf4e" + } + }, + { + "key": "password", + "salt": "salt", + "iterations": 4096, + "dkLen": 32, + "results": { + "sha1": "4b007901b765489abead49d926f721d065a429c12e463f6c4cd79401085b03db", + "sha256": "c5e478d59288c841aa530db6845c4c8d962893a001ce4e11a4963873aa98134a", + "sha512": "d197b1b33db0143e018b12f3d1d1479e6cdebdcc97c5c0f87f6902e072f457b5" + } + }, + { + "key": "passwordPASSWORDpassword", + "salt": "saltSALTsaltSALTsaltSALTsaltSALTsalt", + "iterations": 4096, + "dkLen": 40, + "results": { + "sha1": "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038b6b89a48612c5a25284e6605e12329", + "sha256": "348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9", + "sha512": "8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b868c005174dc4ee71115b59f9e60cd953" + } + }, + { + "key": "pass\u00000word", + "salt": "sa\u00000lt", + "iterations": 4096, + "dkLen": 16, + "results": { + "sha1": "345cbad979dfccb90cac5257bea6ea46", + "sha256": "1df6274d3c0bd2fc7f54fb46f149dda4", + "sha512": "336d14366099e8aac2c46c94a8f178d2" + } + } + ], + "invalid": [ + { + "key": "password", + "salt": "salt", + "iterations": "NaN", + "dkLen": 16, + "exception": "Iterations not a number" + }, + { + "key": "password", + "salt": "salt", + "iterations": -1, + "dkLen": 16, + "exception": "Bad iterations" + }, + { + "key": "password", + "salt": "salt", + "iterations": 1, + "dkLen": "NaN", + "exception": "Key length not a number" + }, + { + "key": "password", + "salt": "salt", + "iterations": 1, + "dkLen": -1, + "exception": "Bad key length" + } + ] +} diff --git a/node_modules/pbkdf2-compat/test/index.js b/node_modules/pbkdf2-compat/test/index.js new file mode 100755 index 00000000..f61ad2de --- /dev/null +++ b/node_modules/pbkdf2-compat/test/index.js @@ -0,0 +1,75 @@ +var assert = require('assert') +var compat = require('../') + +var fixtures = require('./fixtures') + +// SHA-1 vectors generated by Node.js +// SHA-256/SHA-512 test vectors from: +// https://stackoverflow.com/questions/5130513/pbkdf2-hmac-sha2-test-vectors +// https://stackoverflow.com/questions/15593184/pbkdf2-hmac-sha-512-test-vectors + +describe('pbkdf2-compat', function() { + describe('pbkdf2', function() { + ;['sha1', 'sha256', 'sha512'].forEach(function(algorithm) { + describe(algorithm, function() { + fixtures.valid.forEach(function(f, i) { + var expected = f.results[algorithm] + + it('Async test case ' + i + ' for ' + algorithm + ' matches ' + expected, function(done) { + compat.pbkdf2(f.key, f.salt, f.iterations, f.dkLen, algorithm, function(err, result) { + assert.equal(result.toString('hex'), expected) + + done() + }) + }) + }) + + fixtures.invalid.forEach(function(f) { + it('should throw ' + f.exception, function(done) { + compat.pbkdf2(f.key, f.salt, f.iterations, f.dkLen, f.algo, function(err) { + assert(new RegExp(f.exception).test(err)) + + done() + }) + }) + }) + }) + }) + + it('should throw if no callback is provided', function() { + assert.throws(function() { + compat.pbkdf2('password', 'salt', 1, 32, 'sha1') + }, /No callback provided to pbkdf2/) + }) + }) + + describe('pbkdf2Sync', function() { + it('defaults to sha1', function() { + var result = compat.pbkdf2Sync('password', 'salt', 1, 32) + + assert.equal(result.toString('hex'), "0c60c80f961f0e71f3a9b524af6012062fe037a6e0f0eb94fe8fc46bdc637164") + }) + + ;['sha1', 'sha256', 'sha512'].forEach(function(algorithm) { + describe(algorithm, function() { + fixtures.valid.forEach(function(f, i) { + var expected = f.results[algorithm] + + it('Test case ' + i + ' for ' + algorithm + ' matches ' + expected, function() { + var result = compat.pbkdf2Sync(f.key, f.salt, f.iterations, f.dkLen, algorithm) + + assert.equal(result.toString('hex'), expected) + }) + }) + + fixtures.invalid.forEach(function(f) { + it('should throw ' + f.exception, function() { + assert.throws(function() { + compat.pbkdf2Sync(f.key, f.salt, f.iterations, f.dkLen, f.algo) + }, new RegExp(f.exception)) + }) + }) + }) + }) + }) +}) diff --git a/node_modules/pinkie-promise/index.js b/node_modules/pinkie-promise/index.js new file mode 100755 index 00000000..777377a1 --- /dev/null +++ b/node_modules/pinkie-promise/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = typeof Promise === 'function' ? Promise : require('pinkie'); diff --git a/node_modules/pinkie-promise/license b/node_modules/pinkie-promise/license new file mode 100755 index 00000000..1aeb74fd --- /dev/null +++ b/node_modules/pinkie-promise/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pinkie-promise/package.json b/node_modules/pinkie-promise/package.json new file mode 100755 index 00000000..55db53a2 --- /dev/null +++ b/node_modules/pinkie-promise/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "pinkie-promise@^2.0.0", + "scope": null, + "escapedName": "pinkie-promise", + "name": "pinkie-promise", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/find-up" + ] + ], + "_from": "pinkie-promise@>=2.0.0 <3.0.0", + "_id": "pinkie-promise@2.0.1", + "_inCache": true, + "_location": "/pinkie-promise", + "_nodeVersion": "4.4.1", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/pinkie-promise-2.0.1.tgz_1460309839126_0.3422858319245279" + }, + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "2.14.20", + "_phantomChildren": {}, + "_requested": { + "raw": "pinkie-promise@^2.0.0", + "scope": null, + "escapedName": "pinkie-promise", + "name": "pinkie-promise", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/find-up", + "/path-exists" + ], + "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "_shasum": "2135d6dfa7a358c069ac9b178776288228450ffa", + "_shrinkwrap": null, + "_spec": "pinkie-promise@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/find-up", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/pinkie-promise/issues" + }, + "dependencies": { + "pinkie": "^2.0.0" + }, + "description": "ES2015 Promise ponyfill", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "2135d6dfa7a358c069ac9b178776288228450ffa", + "tarball": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "4a936c09c34ad591a25db93f1216d242de0d6184", + "homepage": "https://github.com/floatdrop/pinkie-promise", + "keywords": [ + "promise", + "promises", + "es2015", + "es6", + "polyfill", + "ponyfill" + ], + "license": "MIT", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + } + ], + "name": "pinkie-promise", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/pinkie-promise.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/pinkie-promise/readme.md b/node_modules/pinkie-promise/readme.md new file mode 100755 index 00000000..78477f42 --- /dev/null +++ b/node_modules/pinkie-promise/readme.md @@ -0,0 +1,28 @@ +# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise) + +> [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill + +Module exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill. + +## Install + +``` +$ npm install --save pinkie-promise +``` + +## Usage + +```js +var Promise = require('pinkie-promise'); + +new Promise(function (resolve) { resolve('unicorns'); }); +//=> Promise { 'unicorns' } +``` + +## Related + +- [pify](https://github.com/sindresorhus/pify) - Promisify a callback-style function + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/pinkie/index.js b/node_modules/pinkie/index.js new file mode 100755 index 00000000..14ce1bfe --- /dev/null +++ b/node_modules/pinkie/index.js @@ -0,0 +1,292 @@ +'use strict'; + +var PENDING = 'pending'; +var SETTLED = 'settled'; +var FULFILLED = 'fulfilled'; +var REJECTED = 'rejected'; +var NOOP = function () {}; +var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; + +var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; +var asyncQueue = []; +var asyncTimer; + +function asyncFlush() { + // run promise callbacks + for (var i = 0; i < asyncQueue.length; i++) { + asyncQueue[i][0](asyncQueue[i][1]); + } + + // reset async asyncQueue + asyncQueue = []; + asyncTimer = false; +} + +function asyncCall(callback, arg) { + asyncQueue.push([callback, arg]); + + if (!asyncTimer) { + asyncTimer = true; + asyncSetTimer(asyncFlush, 0); + } +} + +function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + + function rejectPromise(reason) { + reject(promise, reason); + } + + try { + resolver(resolvePromise, rejectPromise); + } catch (e) { + rejectPromise(e); + } +} + +function invokeCallback(subscriber) { + var owner = subscriber.owner; + var settled = owner._state; + var value = owner._data; + var callback = subscriber[settled]; + var promise = subscriber.then; + + if (typeof callback === 'function') { + settled = FULFILLED; + try { + value = callback(value); + } catch (e) { + reject(promise, e); + } + } + + if (!handleThenable(promise, value)) { + if (settled === FULFILLED) { + resolve(promise, value); + } + + if (settled === REJECTED) { + reject(promise, value); + } + } +} + +function handleThenable(promise, value) { + var resolved; + + try { + if (promise === value) { + throw new TypeError('A promises callback cannot return that same promise.'); + } + + if (value && (typeof value === 'function' || typeof value === 'object')) { + // then should be retrieved only once + var then = value.then; + + if (typeof then === 'function') { + then.call(value, function (val) { + if (!resolved) { + resolved = true; + + if (value === val) { + fulfill(promise, val); + } else { + resolve(promise, val); + } + } + }, function (reason) { + if (!resolved) { + resolved = true; + + reject(promise, reason); + } + }); + + return true; + } + } + } catch (e) { + if (!resolved) { + reject(promise, e); + } + + return true; + } + + return false; +} + +function resolve(promise, value) { + if (promise === value || !handleThenable(promise, value)) { + fulfill(promise, value); + } +} + +function fulfill(promise, value) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = value; + + asyncCall(publishFulfillment, promise); + } +} + +function reject(promise, reason) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = reason; + + asyncCall(publishRejection, promise); + } +} + +function publish(promise) { + promise._then = promise._then.forEach(invokeCallback); +} + +function publishFulfillment(promise) { + promise._state = FULFILLED; + publish(promise); +} + +function publishRejection(promise) { + promise._state = REJECTED; + publish(promise); + if (!promise._handled && isNode) { + global.process.emit('unhandledRejection', promise._data, promise); + } +} + +function notifyRejectionHandled(promise) { + global.process.emit('rejectionHandled', promise); +} + +/** + * @class + */ +function Promise(resolver) { + if (typeof resolver !== 'function') { + throw new TypeError('Promise resolver ' + resolver + ' is not a function'); + } + + if (this instanceof Promise === false) { + throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); + } + + this._then = []; + + invokeResolver(resolver, this); +} + +Promise.prototype = { + constructor: Promise, + + _state: PENDING, + _then: null, + _data: undefined, + _handled: false, + + then: function (onFulfillment, onRejection) { + var subscriber = { + owner: this, + then: new this.constructor(NOOP), + fulfilled: onFulfillment, + rejected: onRejection + }; + + if ((onRejection || onFulfillment) && !this._handled) { + this._handled = true; + if (this._state === REJECTED && isNode) { + asyncCall(notifyRejectionHandled, this); + } + } + + if (this._state === FULFILLED || this._state === REJECTED) { + // already resolved, call callback async + asyncCall(invokeCallback, subscriber); + } else { + // subscribe + this._then.push(subscriber); + } + + return subscriber.then; + }, + + catch: function (onRejection) { + return this.then(null, onRejection); + } +}; + +Promise.all = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.all().'); + } + + return new Promise(function (resolve, reject) { + var results = []; + var remaining = 0; + + function resolver(index) { + remaining++; + return function (value) { + results[index] = value; + if (!--remaining) { + resolve(results); + } + }; + } + + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolver(i), reject); + } else { + results[i] = promise; + } + } + + if (!remaining) { + resolve(results); + } + }); +}; + +Promise.race = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.race().'); + } + + return new Promise(function (resolve, reject) { + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolve, reject); + } else { + resolve(promise); + } + } + }); +}; + +Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); +}; + +Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); +}; + +module.exports = Promise; diff --git a/node_modules/pinkie/license b/node_modules/pinkie/license new file mode 100755 index 00000000..1aeb74fd --- /dev/null +++ b/node_modules/pinkie/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pinkie/package.json b/node_modules/pinkie/package.json new file mode 100755 index 00000000..8383448a --- /dev/null +++ b/node_modules/pinkie/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "pinkie@^2.0.0", + "scope": null, + "escapedName": "pinkie", + "name": "pinkie", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pinkie-promise" + ] + ], + "_from": "pinkie@>=2.0.0 <3.0.0", + "_id": "pinkie@2.0.4", + "_inCache": true, + "_location": "/pinkie", + "_nodeVersion": "4.2.4", + "_npmUser": { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "raw": "pinkie@^2.0.0", + "scope": null, + "escapedName": "pinkie", + "name": "pinkie", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/pinkie-promise" + ], + "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "_shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", + "_shrinkwrap": null, + "_spec": "pinkie@^2.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pinkie-promise", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/pinkie/issues" + }, + "dependencies": {}, + "description": "Itty bitty little widdle twinkie pinkie ES2015 Promise implementation", + "devDependencies": { + "core-assert": "^0.1.1", + "coveralls": "^2.11.4", + "mocha": "*", + "nyc": "^3.2.2", + "promises-aplus-tests": "*", + "xo": "^0.10.1" + }, + "directories": {}, + "dist": { + "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", + "tarball": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8d4a92447a5c62bff9f89756caeb4c9c8770579b", + "homepage": "https://github.com/floatdrop/pinkie", + "keywords": [ + "promise", + "promises", + "es2015", + "es6" + ], + "license": "MIT", + "maintainers": [ + { + "name": "floatdrop", + "email": "floatdrop@gmail.com" + } + ], + "name": "pinkie", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/pinkie.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && nyc mocha" + }, + "version": "2.0.4" +} diff --git a/node_modules/pinkie/readme.md b/node_modules/pinkie/readme.md new file mode 100755 index 00000000..1565f958 --- /dev/null +++ b/node_modules/pinkie/readme.md @@ -0,0 +1,83 @@ +

      +
      + pinkie +
      +
      +

      + +> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation + +[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master) + +There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality. + +This module is an exact Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in Node.js land (it should be browserify-able though). + + +## Install + +``` +$ npm install --save pinkie +``` + + +## Usage + +```js +var fs = require('fs'); +var Promise = require('pinkie'); + +new Promise(function (resolve, reject) { + fs.readFile('foo.json', 'utf8', function (err, data) { + if (err) { + reject(err); + return; + } + + resolve(data); + }); +}); +//=> Promise +``` + + +### API + +`pinkie` exports bare [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation and polyfills [Node.js rejection events](https://nodejs.org/api/process.html#process_event_unhandledrejection). In case you forgot: + +#### new Promise(executor) + +Returns new instance of `Promise`. + +##### executor + +*Required* +Type: `function` + +Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. + +#### pinkie.all(promises) + +Returns a promise that resolves when all of the promises in the `promises` Array argument have resolved. + +#### pinkie.race(promises) + +Returns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise. + +#### pinkie.reject(reason) + +Returns a Promise object that is rejected with the given `reason`. + +#### pinkie.resolve(value) + +Returns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`. + + +## Related + +- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module + + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/pkg-dir/index.js b/node_modules/pkg-dir/index.js new file mode 100755 index 00000000..ab09a3f1 --- /dev/null +++ b/node_modules/pkg-dir/index.js @@ -0,0 +1,14 @@ +'use strict'; +var path = require('path'); +var findUp = require('find-up'); + +module.exports = function (cwd) { + return findUp('package.json', {cwd: cwd}).then(function (fp) { + return fp ? path.dirname(fp) : null; + }); +}; + +module.exports.sync = function (cwd) { + var fp = findUp.sync('package.json', {cwd: cwd}); + return fp ? path.dirname(fp) : null; +}; diff --git a/node_modules/pkg-dir/license b/node_modules/pkg-dir/license new file mode 100755 index 00000000..654d0bfe --- /dev/null +++ b/node_modules/pkg-dir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pkg-dir/package.json b/node_modules/pkg-dir/package.json new file mode 100755 index 00000000..9e3d5c87 --- /dev/null +++ b/node_modules/pkg-dir/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "pkg-dir@^1.0.0", + "scope": null, + "escapedName": "pkg-dir", + "name": "pkg-dir", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/find-cache-dir" + ] + ], + "_from": "pkg-dir@>=1.0.0 <2.0.0", + "_id": "pkg-dir@1.0.0", + "_inCache": true, + "_location": "/pkg-dir", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "pkg-dir@^1.0.0", + "scope": null, + "escapedName": "pkg-dir", + "name": "pkg-dir", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/find-cache-dir" + ], + "_resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "_shasum": "7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4", + "_shrinkwrap": null, + "_spec": "pkg-dir@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/find-cache-dir", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pkg-dir/issues" + }, + "dependencies": { + "find-up": "^1.0.0" + }, + "description": "Find the root directory of a npm package", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4", + "tarball": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "a06a60b1a2cddf2f84912221477311327398da01", + "homepage": "https://github.com/sindresorhus/pkg-dir", + "keywords": [ + "package", + "json", + "root", + "npm", + "entry", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "pkg-dir", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pkg-dir.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.0" +} diff --git a/node_modules/pkg-dir/readme.md b/node_modules/pkg-dir/readme.md new file mode 100755 index 00000000..82bb8351 --- /dev/null +++ b/node_modules/pkg-dir/readme.md @@ -0,0 +1,63 @@ +# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir) + +> Find the root directory of a npm package + + +## Install + +``` +$ npm install --save pkg-dir +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + └── foo + ├── package.json + └── bar + ├── baz + └── example.js +``` + +```js +// example.js +var pkgDir = require('pkg-dir'); + +pkgDir(__dirname).then(function (rootPath) { + console.log(rootPath); + //=> '/Users/sindresorhus/foo' +}); +``` + + +## API + +### pkgDir([cwd]) + +Returns a promise that resolves to the package root path or `null`. + +### pkgDir.sync([cwd]) + +Returns the package root path or `null`. + +#### cwd + +Type: `string` +Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module +- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/pkginfo/.npmignore b/node_modules/pkginfo/.npmignore new file mode 100755 index 00000000..9303c347 --- /dev/null +++ b/node_modules/pkginfo/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/node_modules/pkginfo/LICENSE b/node_modules/pkginfo/LICENSE new file mode 100755 index 00000000..ed4a4e70 --- /dev/null +++ b/node_modules/pkginfo/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Charlie Robbins. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/pkginfo/README.md b/node_modules/pkginfo/README.md new file mode 100755 index 00000000..97d7a7f9 --- /dev/null +++ b/node_modules/pkginfo/README.md @@ -0,0 +1,80 @@ +# node-pkginfo + +An easy way to expose properties on a module from a package.json + +### Installing pkginfo +``` + npm install pkginfo +``` + +## Motivation +How often when writing node.js modules have you written the following line(s) of code? + +* Hard code your version string into your code + +``` js + exports.version = '0.1.0'; +``` + +* Programmatically expose the version from the package.json + +``` js + exports.version = require('/path/to/package.json').version; +``` + +In other words, how often have you wanted to expose basic information from your package.json onto your module programmatically? **WELL NOW YOU CAN!** + +## Usage + +Using `pkginfo` is idiot-proof, just require and invoke it. + +``` js + var pkginfo = require('pkginfo')(module); + + console.dir(module.exports); +``` + +By invoking the `pkginfo` module all of the properties in your `package.json` file will be automatically exposed on the callee module (i.e. the parent module of `pkginfo`). + +Here's a sample of the output: + +``` + { name: 'simple-app', + description: 'A test fixture for pkginfo', + version: '0.1.0', + author: 'Charlie Robbins ', + keywords: [ 'test', 'fixture' ], + main: './index.js', + scripts: { test: 'vows test/*-test.js --spec' }, + engines: { node: '>= 0.4.0' } } +``` + +### Expose specific properties +If you don't want to expose **all** properties on from your `package.json` on your module then simple pass those properties to the `pkginfo` function: + +``` js + var pkginfo = require('pkginfo')(module, 'version', 'author'); + + console.dir(module.exports); +``` + +``` + { version: '0.1.0', + author: 'Charlie Robbins ' } +``` + +If you're looking for further usage see the [examples][0] included in this repository. + +## Run Tests +Tests are written in [vows][1] and give complete coverage of all APIs. + +``` + npm install + npm test +``` + +[0]: https://github.com/indexzero/node-pkginfo/tree/master/examples +[1]: http://vowsjs.org + +#### Author: [Charlie Robbins](http://github.com/indexzero) +#### License: MIT diff --git a/node_modules/pkginfo/docs/docco.css b/node_modules/pkginfo/docs/docco.css new file mode 100755 index 00000000..bd541343 --- /dev/null +++ b/node_modules/pkginfo/docs/docco.css @@ -0,0 +1,194 @@ +/*--------------------- Layout and Typography ----------------------------*/ +body { + font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; + font-size: 15px; + line-height: 22px; + color: #252519; + margin: 0; padding: 0; +} +a { + color: #261a3b; +} + a:visited { + color: #261a3b; + } +p { + margin: 0 0 15px 0; +} +h4, h5, h6 { + color: #333; + margin: 6px 0 6px 0; + font-size: 13px; +} + h2, h3 { + margin-bottom: 0; + color: #000; + } + h1 { + margin-top: 40px; + margin-bottom: 15px; + color: #000; + } +#container { + position: relative; +} +#background { + position: fixed; + top: 0; left: 525px; right: 0; bottom: 0; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + z-index: -1; +} +#jump_to, #jump_page { + background: white; + -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777; + -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; + font: 10px Arial; + text-transform: uppercase; + cursor: pointer; + text-align: right; +} +#jump_to, #jump_wrapper { + position: fixed; + right: 0; top: 0; + padding: 5px 10px; +} + #jump_wrapper { + padding: 0; + display: none; + } + #jump_to:hover #jump_wrapper { + display: block; + } + #jump_page { + padding: 5px 0 3px; + margin: 0 0 25px 25px; + } + #jump_page .source { + display: block; + padding: 5px 10px; + text-decoration: none; + border-top: 1px solid #eee; + } + #jump_page .source:hover { + background: #f5f5ff; + } + #jump_page .source:first-child { + } +table td { + border: 0; + outline: 0; +} + td.docs, th.docs { + max-width: 450px; + min-width: 450px; + min-height: 5px; + padding: 10px 25px 1px 50px; + overflow-x: hidden; + vertical-align: top; + text-align: left; + } + .docs pre { + margin: 15px 0 15px; + padding-left: 15px; + } + .docs p tt, .docs p code { + background: #f8f8ff; + border: 1px solid #dedede; + font-size: 12px; + padding: 0 0.2em; + } + .pilwrap { + position: relative; + } + .pilcrow { + font: 12px Arial; + text-decoration: none; + color: #454545; + position: absolute; + top: 3px; left: -20px; + padding: 1px 2px; + opacity: 0; + -webkit-transition: opacity 0.2s linear; + } + td.docs:hover .pilcrow { + opacity: 1; + } + td.code, th.code { + padding: 14px 15px 16px 25px; + width: 100%; + vertical-align: top; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + } + pre, tt, code { + font-size: 12px; line-height: 18px; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; + margin: 0; padding: 0; + } + + +/*---------------------- Syntax Highlighting -----------------------------*/ +td.linenos { background-color: #f0f0f0; padding-right: 10px; } +span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } +body .hll { background-color: #ffffcc } +body .c { color: #408080; font-style: italic } /* Comment */ +body .err { border: 1px solid #FF0000 } /* Error */ +body .k { color: #954121 } /* Keyword */ +body .o { color: #666666 } /* Operator */ +body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +body .cp { color: #BC7A00 } /* Comment.Preproc */ +body .c1 { color: #408080; font-style: italic } /* Comment.Single */ +body .cs { color: #408080; font-style: italic } /* Comment.Special */ +body .gd { color: #A00000 } /* Generic.Deleted */ +body .ge { font-style: italic } /* Generic.Emph */ +body .gr { color: #FF0000 } /* Generic.Error */ +body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +body .gi { color: #00A000 } /* Generic.Inserted */ +body .go { color: #808080 } /* Generic.Output */ +body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +body .gs { font-weight: bold } /* Generic.Strong */ +body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +body .gt { color: #0040D0 } /* Generic.Traceback */ +body .kc { color: #954121 } /* Keyword.Constant */ +body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ +body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ +body .kp { color: #954121 } /* Keyword.Pseudo */ +body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ +body .kt { color: #B00040 } /* Keyword.Type */ +body .m { color: #666666 } /* Literal.Number */ +body .s { color: #219161 } /* Literal.String */ +body .na { color: #7D9029 } /* Name.Attribute */ +body .nb { color: #954121 } /* Name.Builtin */ +body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +body .no { color: #880000 } /* Name.Constant */ +body .nd { color: #AA22FF } /* Name.Decorator */ +body .ni { color: #999999; font-weight: bold } /* Name.Entity */ +body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +body .nf { color: #0000FF } /* Name.Function */ +body .nl { color: #A0A000 } /* Name.Label */ +body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +body .nt { color: #954121; font-weight: bold } /* Name.Tag */ +body .nv { color: #19469D } /* Name.Variable */ +body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +body .w { color: #bbbbbb } /* Text.Whitespace */ +body .mf { color: #666666 } /* Literal.Number.Float */ +body .mh { color: #666666 } /* Literal.Number.Hex */ +body .mi { color: #666666 } /* Literal.Number.Integer */ +body .mo { color: #666666 } /* Literal.Number.Oct */ +body .sb { color: #219161 } /* Literal.String.Backtick */ +body .sc { color: #219161 } /* Literal.String.Char */ +body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ +body .s2 { color: #219161 } /* Literal.String.Double */ +body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +body .sh { color: #219161 } /* Literal.String.Heredoc */ +body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +body .sx { color: #954121 } /* Literal.String.Other */ +body .sr { color: #BB6688 } /* Literal.String.Regex */ +body .s1 { color: #219161 } /* Literal.String.Single */ +body .ss { color: #19469D } /* Literal.String.Symbol */ +body .bp { color: #954121 } /* Name.Builtin.Pseudo */ +body .vc { color: #19469D } /* Name.Variable.Class */ +body .vg { color: #19469D } /* Name.Variable.Global */ +body .vi { color: #19469D } /* Name.Variable.Instance */ +body .il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/node_modules/pkginfo/docs/pkginfo.html b/node_modules/pkginfo/docs/pkginfo.html new file mode 100755 index 00000000..bf615fa9 --- /dev/null +++ b/node_modules/pkginfo/docs/pkginfo.html @@ -0,0 +1,101 @@ + pkginfo.js

      pkginfo.js

      /*
      + * pkginfo.js: Top-level include for the pkginfo module
      + *
      + * (C) 2011, Charlie Robbins
      + *
      + */
      + 
      +var fs = require('fs'),
      +    path = require('path');

      function pkginfo ([options, 'property', 'property' ..])

      + +

      @pmodule {Module} Parent module to read from.

      + +

      @options {Object|Array|string} Optional Options used when exposing properties.

      + +

      @arguments {string...} Optional Specified properties to expose.

      + +

      Exposes properties from the package.json file for the parent module on +it's exports. Valid usage:

      + +

      require('pkginfo')()

      + +

      require('pkginfo')('version', 'author');

      + +

      require('pkginfo')(['version', 'author']);

      + +

      require('pkginfo')({ include: ['version', 'author'] });

      var pkginfo = module.exports = function (pmodule, options) {
      +  var args = [].slice.call(arguments, 2).filter(function (arg) {
      +    return typeof arg === 'string';
      +  });
      +  

      Parse variable arguments

        if (Array.isArray(options)) {

      If the options passed in is an Array assume that +it is the Array of properties to expose from the +on the package.json file on the parent module.

          options = { include: options };
      +  }
      +  else if (typeof options === 'string') {

      Otherwise if the first argument is a string, then +assume that it is the first property to expose from +the package.json file on the parent module.

          options = { include: [options] };
      +  }
      +  

      Setup default options

        options = options || { include: [] };
      +  
      +  if (args.length > 0) {

      If additional string arguments have been passed in +then add them to the properties to expose on the +parent module.

          options.include = options.include.concat(args);
      +  }
      +  
      +  var pkg = pkginfo.read(pmodule, options.dir).package;
      +  Object.keys(pkg).forEach(function (key) {
      +    if (options.include.length > 0 && !~options.include.indexOf(key)) {
      +      return;
      +    }
      +    
      +    if (!pmodule.exports[key]) {
      +      pmodule.exports[key] = pkg[key];
      +    }
      +  });
      +  
      +  return pkginfo;
      +};

      function find (dir)

      + +

      @pmodule {Module} Parent module to read from.

      + +

      @dir {string} Optional Directory to start search from.

      + +

      Searches up the directory tree from dir until it finds a directory +which contains a package.json file.

      pkginfo.find = function (pmodule, dir) {
      +  dir = dir || pmodule.filename;
      +  dir = path.dirname(dir); 
      +  
      +  var files = fs.readdirSync(dir);
      +  
      +  if (~files.indexOf('package.json')) {
      +    return path.join(dir, 'package.json');
      +  }
      +  
      +  if (dir === '/') {
      +    throw new Error('Could not find package.json up from: ' + dir);
      +  }
      +  
      +  return pkginfo.find(dir);
      +};

      function read (pmodule, dir)

      + +

      @pmodule {Module} Parent module to read from.

      + +

      @dir {string} Optional Directory to start search from.

      + +

      Searches up the directory tree from dir until it finds a directory +which contains a package.json file and returns the package information.

      pkginfo.read = function (pmodule, dir) { 
      +  dir = pkginfo.find(pmodule, dir);
      +  
      +  var data = fs.readFileSync(dir).toString();
      +      
      +  return {
      +    dir: dir, 
      +    package: JSON.parse(data)
      +  };
      +};

      Call pkginfo on this module and expose version.

      pkginfo(module, {
      +  dir: __dirname,
      +  include: ['version'],
      +  target: pkginfo
      +});
      +
      +
      \ No newline at end of file diff --git a/node_modules/pkginfo/examples/all-properties.js b/node_modules/pkginfo/examples/all-properties.js new file mode 100755 index 00000000..fd1d831a --- /dev/null +++ b/node_modules/pkginfo/examples/all-properties.js @@ -0,0 +1,19 @@ +/* + * all-properties.js: Sample of including all properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/node_modules/pkginfo/examples/array-argument.js b/node_modules/pkginfo/examples/array-argument.js new file mode 100755 index 00000000..b1b68487 --- /dev/null +++ b/node_modules/pkginfo/examples/array-argument.js @@ -0,0 +1,20 @@ +/* + * array-argument.js: Sample of including specific properties from a package.json file + * using Array argument syntax. + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, ['version', 'author']); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/node_modules/pkginfo/examples/multiple-properties.js b/node_modules/pkginfo/examples/multiple-properties.js new file mode 100755 index 00000000..b4b5fd61 --- /dev/null +++ b/node_modules/pkginfo/examples/multiple-properties.js @@ -0,0 +1,19 @@ +/* + * multiple-properties.js: Sample of including multiple properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, 'version', 'author'); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/node_modules/pkginfo/examples/object-argument.js b/node_modules/pkginfo/examples/object-argument.js new file mode 100755 index 00000000..28420c85 --- /dev/null +++ b/node_modules/pkginfo/examples/object-argument.js @@ -0,0 +1,22 @@ +/* + * object-argument.js: Sample of including specific properties from a package.json file + * using Object argument syntax. + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, { + include: ['version', 'author'] + }); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/node_modules/pkginfo/examples/package.json b/node_modules/pkginfo/examples/package.json new file mode 100755 index 00000000..1f2f01c1 --- /dev/null +++ b/node_modules/pkginfo/examples/package.json @@ -0,0 +1,10 @@ +{ + "name": "simple-app", + "description": "A test fixture for pkginfo", + "version": "0.1.0", + "author": "Charlie Robbins ", + "keywords": ["test", "fixture"], + "main": "./index.js", + "scripts": { "test": "vows test/*-test.js --spec" }, + "engines": { "node": ">= 0.4.0" } +} diff --git a/node_modules/pkginfo/examples/single-property.js b/node_modules/pkginfo/examples/single-property.js new file mode 100755 index 00000000..4f445614 --- /dev/null +++ b/node_modules/pkginfo/examples/single-property.js @@ -0,0 +1,19 @@ +/* + * single-property.js: Sample of including a single specific properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + pkginfo = require('../lib/pkginfo')(module, 'version'); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/node_modules/pkginfo/examples/subdir/package.json b/node_modules/pkginfo/examples/subdir/package.json new file mode 100755 index 00000000..aa854102 --- /dev/null +++ b/node_modules/pkginfo/examples/subdir/package.json @@ -0,0 +1,11 @@ +{ + "name": "simple-app-subdir", + "description": "A test fixture for pkginfo", + "version": "0.1.0", + "author": "Charlie Robbins ", + "keywords": ["test", "fixture"], + "main": "./index.js", + "scripts": { "test": "vows test/*-test.js --spec" }, + "engines": { "node": ">= 0.4.0" }, + "subdironly": "true" +} diff --git a/node_modules/pkginfo/examples/target-dir.js b/node_modules/pkginfo/examples/target-dir.js new file mode 100755 index 00000000..88770e6f --- /dev/null +++ b/node_modules/pkginfo/examples/target-dir.js @@ -0,0 +1,20 @@ +/* + * multiple-properties.js: Sample of including multiple properties from a package.json file + * + * (C) 2011, Charlie Robbins + * + */ + +var util = require('util'), + path = require('path'), + pkginfo = require('../lib/pkginfo')(module, { dir: path.resolve(__dirname, 'subdir' )}); + +exports.someFunction = function () { + console.log('some of your custom logic here'); +}; + +console.log('Inspecting module:'); +console.dir(module.exports); + +console.log('\nAll exports exposed:'); +console.error(Object.keys(module.exports)); \ No newline at end of file diff --git a/node_modules/pkginfo/lib/pkginfo.js b/node_modules/pkginfo/lib/pkginfo.js new file mode 100755 index 00000000..a60652a8 --- /dev/null +++ b/node_modules/pkginfo/lib/pkginfo.js @@ -0,0 +1,133 @@ +/* + * pkginfo.js: Top-level include for the pkginfo module + * + * (C) 2011, Charlie Robbins + * + */ + +var path = require('path'); + +// +// ### function pkginfo ([options, 'property', 'property' ..]) +// #### @pmodule {Module} Parent module to read from. +// #### @options {Object|Array|string} **Optional** Options used when exposing properties. +// #### @arguments {string...} **Optional** Specified properties to expose. +// Exposes properties from the package.json file for the parent module on +// it's exports. Valid usage: +// +// `require('pkginfo')()` +// +// `require('pkginfo')('version', 'author');` +// +// `require('pkginfo')(['version', 'author']);` +// +// `require('pkginfo')({ include: ['version', 'author'] });` +// +var pkginfo = module.exports = function (pmodule, options) { + var args = [].slice.call(arguments, 2).filter(function (arg) { + return typeof arg === 'string'; + }); + + // + // **Parse variable arguments** + // + if (Array.isArray(options)) { + // + // If the options passed in is an Array assume that + // it is the Array of properties to expose from the + // on the package.json file on the parent module. + // + options = { include: options }; + } + else if (typeof options === 'string') { + // + // Otherwise if the first argument is a string, then + // assume that it is the first property to expose from + // the package.json file on the parent module. + // + options = { include: [options] }; + } + + // + // **Setup default options** + // + options = options || {}; + + // ensure that includes have been defined + options.include = options.include || []; + + if (args.length > 0) { + // + // If additional string arguments have been passed in + // then add them to the properties to expose on the + // parent module. + // + options.include = options.include.concat(args); + } + + var pkg = pkginfo.read(pmodule, options.dir).package; + Object.keys(pkg).forEach(function (key) { + if (options.include.length > 0 && !~options.include.indexOf(key)) { + return; + } + + if (!pmodule.exports[key]) { + pmodule.exports[key] = pkg[key]; + } + }); + + return pkginfo; +}; + +// +// ### function find (dir) +// #### @pmodule {Module} Parent module to read from. +// #### @dir {string} **Optional** Directory to start search from. +// Searches up the directory tree from `dir` until it finds a directory +// which contains a `package.json` file. +// +pkginfo.find = function (pmodule, dir) { + if (! dir) { + dir = path.dirname(pmodule.filename || pmodule.id); + } + + if (dir === '/') { + throw new Error('Could not find package.json up from ' + + (pmodule.filename || pmodule.id)); + } + else if (!dir || dir === '.') { + throw new Error('Cannot find package.json from unspecified directory'); + } + + var contents; + try { + contents = require(dir + '/package.json'); + } catch (error) {} + + if (contents) return contents; + + return pkginfo.find(pmodule, path.dirname(dir)); +}; + +// +// ### function read (pmodule, dir) +// #### @pmodule {Module} Parent module to read from. +// #### @dir {string} **Optional** Directory to start search from. +// Searches up the directory tree from `dir` until it finds a directory +// which contains a `package.json` file and returns the package information. +// +pkginfo.read = function (pmodule, dir) { + return { + dir: dir, + package: pkginfo.find(pmodule, dir), + }; +}; + +// +// Call `pkginfo` on this module and expose version. +// +pkginfo(module, { + dir: __dirname, + include: ['version'], + target: pkginfo +}); diff --git a/node_modules/pkginfo/package.json b/node_modules/pkginfo/package.json new file mode 100755 index 00000000..e47d6a14 --- /dev/null +++ b/node_modules/pkginfo/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + { + "raw": "pkginfo@0.x.x", + "scope": null, + "escapedName": "pkginfo", + "name": "pkginfo", + "rawSpec": "0.x.x", + "spec": ">=0.0.0 <1.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/prompt" + ] + ], + "_from": "pkginfo@>=0.0.0 <1.0.0", + "_id": "pkginfo@0.4.0", + "_inCache": true, + "_location": "/pkginfo", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/pkginfo-0.4.0.tgz_1456888821214_0.3420205994043499" + }, + "_npmUser": { + "name": "indexzero", + "email": "charlie.robbins@gmail.com" + }, + "_npmVersion": "3.7.3", + "_phantomChildren": {}, + "_requested": { + "raw": "pkginfo@0.x.x", + "scope": null, + "escapedName": "pkginfo", + "name": "pkginfo", + "rawSpec": "0.x.x", + "spec": ">=0.0.0 <1.0.0", + "type": "range" + }, + "_requiredBy": [ + "/prompt" + ], + "_resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.0.tgz", + "_shasum": "349dbb7ffd38081fcadc0853df687f0c7744cd65", + "_shrinkwrap": null, + "_spec": "pkginfo@0.x.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/prompt", + "author": { + "name": "Charlie Robbins", + "email": "charlie.robbins@gmail.com" + }, + "bugs": { + "url": "https://github.com/indexzero/node-pkginfo/issues" + }, + "dependencies": {}, + "description": "An easy way to expose properties on a module from a package.json", + "devDependencies": { + "vows": "0.8.0" + }, + "directories": {}, + "dist": { + "shasum": "349dbb7ffd38081fcadc0853df687f0c7744cd65", + "tarball": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.0.tgz" + }, + "engines": { + "node": ">= 0.4.0" + }, + "gitHead": "f0cc3fa9d45413bdabd2d160bb0dbe03e2d04870", + "homepage": "https://github.com/indexzero/node-pkginfo#readme", + "keywords": [ + "info", + "tools", + "package.json" + ], + "license": "MIT", + "main": "./lib/pkginfo.js", + "maintainers": [ + { + "name": "indexzero", + "email": "charlie.robbins@gmail.com" + } + ], + "name": "pkginfo", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indexzero/node-pkginfo.git" + }, + "scripts": { + "test": "vows test/*-test.js --spec" + }, + "version": "0.4.0" +} diff --git a/node_modules/pkginfo/test/pkginfo-test.js b/node_modules/pkginfo/test/pkginfo-test.js new file mode 100755 index 00000000..a59f077e --- /dev/null +++ b/node_modules/pkginfo/test/pkginfo-test.js @@ -0,0 +1,83 @@ +/* + * pkginfo-test.js: Tests for the pkginfo module. + * + * (C) 2011, Charlie Robbins + * + */ + +var assert = require('assert'), + exec = require('child_process').exec, + fs = require('fs'), + path = require('path'), + vows = require('vows'), + pkginfo = require('../lib/pkginfo'); + +function assertProperties (source, target) { + assert.lengthOf(source, target.length + 1); + target.forEach(function (prop) { + assert.isTrue(!!~source.indexOf(prop)); + }); +} + +function compareWithExample(targetPath) { + var examplePaths = ['package.json']; + + if (targetPath) { + examplePaths.unshift(targetPath); + } + + return function(exposed) { + var pkg = fs.readFileSync(path.join.apply(null, [__dirname, '..', 'examples'].concat(examplePaths))).toString(), + keys = Object.keys(JSON.parse(pkg)); + + assertProperties(exposed, keys); + }; +} + +function testExposes (options) { + return { + topic: function () { + exec('node ' + path.join(__dirname, '..', 'examples', options.script), this.callback); + }, + "should expose that property correctly": function (err, stdout, stderr) { + assert.isNull(err); + + var exposed = stderr.match(/'(\w+)'/ig).map(function (p) { + return p.substring(1, p.length - 1); + }); + + return !options.assert + ? assertProperties(exposed, options.properties) + : options.assert(exposed); + } + } +} + +vows.describe('pkginfo').addBatch({ + "When using the pkginfo module": { + "and passed a single `string` argument": testExposes({ + script: 'single-property.js', + properties: ['version'] + }), + "and passed multiple `string` arguments": testExposes({ + script: 'multiple-properties.js', + properties: ['version', 'author'] + }), + "and passed an `object` argument": testExposes({ + script: 'object-argument.js', + properties: ['version', 'author'] + }), + "and passed an `array` argument": testExposes({ + script: 'array-argument.js', + properties: ['version', 'author'] + }), + "and read from a specified directory": testExposes({ + script: 'target-dir.js', + assert: compareWithExample('subdir') + }), + "and passed no arguments": testExposes({ + script: 'all-properties.js', + assert: compareWithExample() + }) + } +}).export(module); diff --git a/node_modules/preserve/.gitattributes b/node_modules/preserve/.gitattributes new file mode 100755 index 00000000..759c2c5a --- /dev/null +++ b/node_modules/preserve/.gitattributes @@ -0,0 +1,14 @@ +# Enforce Unix newlines +*.* text eol=lf +*.css text eol=lf +*.html text eol=lf +*.js text eol=lf +*.json text eol=lf +*.less text eol=lf +*.md text eol=lf +*.yml text eol=lf + +*.jpg binary +*.gif binary +*.png binary +*.jpeg binary \ No newline at end of file diff --git a/node_modules/preserve/.jshintrc b/node_modules/preserve/.jshintrc new file mode 100755 index 00000000..e72045d2 --- /dev/null +++ b/node_modules/preserve/.jshintrc @@ -0,0 +1,24 @@ +{ + "asi": false, + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "esnext": true, + "immed": true, + "latedef": true, + "laxcomma": false, + "newcap": true, + "noarg": true, + "node": true, + "sub": true, + "undef": true, + "unused": true, + "globals": { + "define": true, + "before": true, + "after": true, + "describe": true, + "it": true + } +} \ No newline at end of file diff --git a/node_modules/preserve/.npmignore b/node_modules/preserve/.npmignore new file mode 100755 index 00000000..1a2e47f0 --- /dev/null +++ b/node_modules/preserve/.npmignore @@ -0,0 +1,53 @@ +# Numerous always-ignore extensions +*.csv +*.dat +*.diff +*.err +*.gz +*.log +*.orig +*.out +*.pid +*.rar +*.rej +*.seed +*.swo +*.swp +*.vi +*.yo-rc.json +*.zip +*~ +.ruby-version +lib-cov +npm-debug.log + +# Always-ignore dirs +/bower_components/ +/node_modules/ +/temp/ +/tmp/ +/vendor/ +_gh_pages + +# OS or Editor folders +*.esproj +*.komodoproject +.komodotools +*.sublime-* +._* +.cache +.DS_Store +.idea +.project +.settings +.tmproj +nbproject +Thumbs.db + +# grunt-html-validation +validation-status.json +validation-report.json + +# misc +TODO.md +benchmark \ No newline at end of file diff --git a/node_modules/preserve/.travis.yml b/node_modules/preserve/.travis.yml new file mode 100755 index 00000000..ff74a054 --- /dev/null +++ b/node_modules/preserve/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - '0.10' \ No newline at end of file diff --git a/node_modules/preserve/.verb.md b/node_modules/preserve/.verb.md new file mode 100755 index 00000000..72344a9e --- /dev/null +++ b/node_modules/preserve/.verb.md @@ -0,0 +1,59 @@ +# {%= name %} {%= badge("fury") %} + +> {%= description %} + +Useful for protecting tokens, like templates in HTML, from being mutated when the string is transformed in some way, like from a formatter/beautifier. + +**Example without `preserve`** + +Let's say you want to use [js-beautify] on a string of html with Lo-Dash/Underscore templates, such as: `
      • <%= name %>
      `: + +js-beautify will render the template unusable (and apply incorrect formatting because of the unfamiliar syntax from the Lo-Dash template): + +```html +
        +
      • + <%=n ame %> +
      • +
      +``` + +**Example with `preserve`** + +Correct. + +```html +
        +
      • <%= name %>
      • +
      +``` + +For the record, this is just a random example, I've had very few issues with js-beautify in general. But with or without js-beautify, this kind of token mangling does happen sometimes when you use formatters, beautifiers or similar tools. + +## Install +{%= include("install-npm", {save: true}) %} + +## Run tests + +```bash +npm test +``` + +## API +{%= apidocs("index.js") %} + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %}) + +## Author +{%= include("author") %} + +## License +{%= copyright() %} +{%= license() %} + +*** + +{%= include("footer") %} + +[js-beautify]: https://github.com/beautify-web/js-beautify \ No newline at end of file diff --git a/node_modules/preserve/LICENSE b/node_modules/preserve/LICENSE new file mode 100755 index 00000000..5a9956a7 --- /dev/null +++ b/node_modules/preserve/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/preserve/README.md b/node_modules/preserve/README.md new file mode 100755 index 00000000..75000b93 --- /dev/null +++ b/node_modules/preserve/README.md @@ -0,0 +1,90 @@ +# preserve [![NPM version](https://badge.fury.io/js/preserve.svg)](http://badge.fury.io/js/preserve) + +> Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string. + +Useful for protecting tokens, like templates in HTML, from being mutated when the string is transformed in some way, like from a formatter/beautifier. + +**Example without `preserve`** + +Let's say you want to use [js-beautify] on a string of html with Lo-Dash/Underscore templates, such as: `
      • <%= name %>
      `: + +js-beautify will render the template unusable (and apply incorrect formatting because of the unfamiliar syntax from the Lo-Dash template): + +```html +
        +
      • + <%=n ame %> +
      • +
      +``` + +**Example with `preserve`** + +Correct. + +```html +
        +
      • <%= name %>
      • +
      +``` + +For the record, this is just a random example, I've had very few issues with js-beautify in general. But with or without js-beautify, this kind of token mangling does happen sometimes when you use formatters, beautifiers or similar tools. + +## Install +## Install with [npm](npmjs.org) + +```bash +npm i preserve --save +``` + +## Run tests + +```bash +npm test +``` + +## API +### [.before](index.js#L23) + +Replace tokens in `str` with a temporary, heuristic placeholder. + +* `str` **{String}** +* `returns` **{String}**: String with placeholders. + +```js +tokens.before('{a\\,b}'); +//=> '{__ID1__}' +``` + +### [.after](index.js#L44) + +Replace placeholders in `str` with original tokens. + +* `str` **{String}**: String with placeholders +* `returns` **{String}** `str`: String with original tokens. + +```js +tokens.after('{__ID1__}'); +//=> '{a\\,b}' +``` + + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/preserve/issues) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015-2015, Jon Schlinkert. +Released under the MIT license + +*** + +_This file was generated by [verb](https://github.com/assemble/verb) on January 10, 2015._ + +[js-beautify]: https://github.com/beautify-web/js-beautify \ No newline at end of file diff --git a/node_modules/preserve/index.js b/node_modules/preserve/index.js new file mode 100755 index 00000000..a6c5d481 --- /dev/null +++ b/node_modules/preserve/index.js @@ -0,0 +1,54 @@ +/*! + * preserve + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +/** + * Replace tokens in `str` with a temporary, heuristic placeholder. + * + * ```js + * tokens.before('{a\\,b}'); + * //=> '{__ID1__}' + * ``` + * + * @param {String} `str` + * @return {String} String with placeholders. + * @api public + */ + +exports.before = function before(str, re) { + return str.replace(re, function (match) { + var id = randomize(); + cache[id] = match; + return '__ID' + id + '__'; + }); +}; + +/** + * Replace placeholders in `str` with original tokens. + * + * ```js + * tokens.after('{__ID1__}'); + * //=> '{a\\,b}' + * ``` + * + * @param {String} `str` String with placeholders + * @return {String} `str` String with original tokens. + * @api public + */ + +exports.after = function after(str) { + return str.replace(/__ID(.{5})__/g, function (_, id) { + return cache[id]; + }); +}; + +function randomize() { + return Math.random().toString().slice(2, 7); +} + +var cache = {}; \ No newline at end of file diff --git a/node_modules/preserve/package.json b/node_modules/preserve/package.json new file mode 100755 index 00000000..cf5c2135 --- /dev/null +++ b/node_modules/preserve/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + { + "raw": "preserve@^0.2.0", + "scope": null, + "escapedName": "preserve", + "name": "preserve", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/braces" + ] + ], + "_from": "preserve@>=0.2.0 <0.3.0", + "_id": "preserve@0.2.0", + "_inCache": true, + "_location": "/preserve", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "raw": "preserve@^0.2.0", + "scope": null, + "escapedName": "preserve", + "name": "preserve", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/braces" + ], + "_resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "_shasum": "815ed1f6ebc65926f865b310c0713bcb3315ce4b", + "_shrinkwrap": null, + "_spec": "preserve@^0.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/preserve/issues" + }, + "dependencies": {}, + "description": "Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.", + "devDependencies": { + "benchmarked": "^0.1.3", + "chalk": "^0.5.1", + "js-beautify": "^1.5.4", + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "815ed1f6ebc65926f865b310c0713bcb3315ce4b", + "tarball": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "gitHead": "1bf405d35e4aea06a2ee83db2d34dc54abc0a1f9", + "homepage": "https://github.com/jonschlinkert/preserve", + "keywords": [ + "escape", + "format", + "placeholder", + "placeholders", + "prettify", + "regex", + "replace", + "template", + "templates", + "token", + "tokens" + ], + "license": { + "type": "MIT", + "url": "https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT" + }, + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "preserve", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/preserve.git" + }, + "scripts": { + "test": "mocha -R spec" + }, + "version": "0.2.0" +} diff --git a/node_modules/preserve/test.js b/node_modules/preserve/test.js new file mode 100755 index 00000000..9bf174f1 --- /dev/null +++ b/node_modules/preserve/test.js @@ -0,0 +1,48 @@ +/*! + * preserve + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License + */ + +'use strict'; + +var should = require('should'); +var tokens = require('./'); + +var re = /<%=\s*[^>]+%>/g; +var pretty = function(str) { + return require('js-beautify').html(str, { + indent_char: ' ', + indent_size: 2, + }); +}; + +describe('preserve tokens', function () { + var testRe = /__ID.{5}__\n__ID.{5}__\n__ID.{5}__/; + var re = /<%=\s*[^>]+%>/g; + + it('should (e.g. shouldn\'t, but will) mangle tokens in the given string', function () { + var html = pretty('
      • <%= name %>
      '); + html.should.equal('
        \n
      • \n <%=n ame %>\n
      • \n
      '); + }); + + it('should preserve tokens in the given string', function () { + var html = tokens.after(pretty(tokens.before('
      • <%= name %>
      ', re))); + html.should.equal('
        \n
      • <%= name %>
      • \n
      '); + }); + + describe('.before()', function () { + it('should replace matches with placeholder tokens:', function () { + tokens.before('<%= a %>\n<%= b %>\n<%= c %>', re).should.match(testRe); + }); + }); + + describe('tokens.after()', function () { + it('should replace placeholder tokens with original values:', function () { + var before = tokens.before('<%= a %>\n<%= b %>\n<%= c %>', re); + before.should.match(testRe); + tokens.after(before).should.equal('<%= a %>\n<%= b %>\n<%= c %>'); + }); + }); +}); diff --git a/node_modules/private/LICENSE b/node_modules/private/LICENSE new file mode 100755 index 00000000..6c2f144b --- /dev/null +++ b/node_modules/private/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2014 Ben Newman + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/private/README.md b/node_modules/private/README.md new file mode 100755 index 00000000..a8990aa6 --- /dev/null +++ b/node_modules/private/README.md @@ -0,0 +1,246 @@ +private [![Build Status](https://travis-ci.org/benjamn/private.png?branch=master)](https://travis-ci.org/benjamn/private) +=== + +A general-purpose utility for associating truly private state with any JavaScript object. + +Installation +--- + +From NPM: + + npm install private + +From GitHub: + + cd path/to/node_modules + git clone git://github.com/benjamn/private.git + cd private + npm install . + +Usage +--- +**Get or create a secret object associated with any (non-frozen) object:** +```js +var getSecret = require("private").makeAccessor(); +var obj = Object.create(null); // any kind of object works +getSecret(obj).totallySafeProperty = "p455w0rd"; + +console.log(Object.keys(obj)); // [] +console.log(Object.getOwnPropertyNames(obj)); // [] +console.log(getSecret(obj)); // { totallySafeProperty: "p455w0rd" } +``` +Now, only code that has a reference to both `getSecret` and `obj` can possibly access `.totallySafeProperty`. + +*Importantly, no global references to the secret object are retained by the `private` package, so as soon as `obj` gets garbage collected, the secret will be reclaimed as well. In other words, you don't have to worry about memory leaks.* + +**Create a unique property name that cannot be enumerated or guessed:** +```js +var secretKey = require("private").makeUniqueKey(); +var obj = Object.create(null); // any kind of object works + +Object.defineProperty(obj, secretKey, { + value: { totallySafeProperty: "p455w0rd" }, + enumerable: false // optional; non-enumerability is the default +}); + +Object.defineProperty(obj, "nonEnumerableProperty", { + value: "anyone can guess my name", + enumerable: false +}); + +console.log(obj[secretKey].totallySafeProperty); // p455w0rd +console.log(obj.nonEnumerableProperty); // "anyone can guess my name" +console.log(Object.keys(obj)); // [] +console.log(Object.getOwnPropertyNames(obj)); // ["nonEnumerableProperty"] + +for (var key in obj) { + console.log(key); // never called +} +``` +Because these keys are non-enumerable, you can't discover them using a `for`-`in` loop. Because `secretKey` is a long string of random characters, you would have a lot of trouble guessing it. And because the `private` module wraps `Object.getOwnPropertyNames` to exclude the keys it generates, you can't even use that interface to discover it. + +Unless you have access to the value of the `secretKey` property name, there is no way to access the value associated with it. So your only responsibility as secret-keeper is to avoid handing out the value of `secretKey` to untrusted code. + +Think of this style as a home-grown version of the first style. Note, however, that it requires a full implementation of ES5's `Object.defineProperty` method in order to make any safety guarantees, whereas the first example will provide safety even in environments that do not support `Object.defineProperty`. + +Rationale +--- + +In JavaScript, the only data that are truly private are local variables +whose values do not *leak* from the scope in which they were defined. + +This notion of *closure privacy* is powerful, and it readily provides some +of the benefits of traditional data privacy, a la Java or C++: +```js +function MyClass(secret) { + this.increment = function() { + return ++secret; + }; +} + +var mc = new MyClass(3); +console.log(mc.increment()); // 4 +``` +You can learn something about `secret` by calling `.increment()`, and you +can increase its value by one as many times as you like, but you can never +decrease its value, because it is completely inaccessible except through +the `.increment` method. And if the `.increment` method were not +available, it would be as if no `secret` variable had ever been declared, +as far as you could tell. + +This style breaks down as soon as you want to inherit methods from the +prototype of a class: +```js +function MyClass(secret) { + this.secret = secret; +} + +MyClass.prototype.increment = function() { + return ++this.secret; +}; +``` +The only way to communicate between the `MyClass` constructor and the +`.increment` method in this example is to manipulate shared properties of +`this`. Unfortunately `this.secret` is now exposed to unlicensed +modification: +```js +var mc = new MyClass(6); +console.log(mc.increment()); // 7 +mc.secret -= Infinity; +console.log(mc.increment()); // -Infinity +mc.secret = "Go home JavaScript, you're drunk."; +mc.increment(); // NaN +``` +Another problem with closure privacy is that it only lends itself to +per-instance privacy, whereas the `private` keyword in most +object-oriented languages indicates that the data member in question is +visible to all instances of the same class. + +Suppose you have a `Node` class with a notion of parents and children: +```js +function Node() { + var parent; + var children = []; + + this.getParent = function() { + return parent; + }; + + this.appendChild = function(child) { + children.push(child); + child.parent = this; // Can this be made to work? + }; +} +``` +The desire here is to allow other `Node` objects to manipulate the value +returned by `.getParent()`, but otherwise disallow any modification of the +`parent` variable. You could expose a `.setParent` function, but then +anyone could call it, and you might as well give up on the getter/setter +pattern. + +This module solves both of these problems. + +Usage +--- + +Let's revisit the `Node` example from above: +```js +var p = require("private").makeAccessor(); + +function Node() { + var privates = p(this); + var children = []; + + this.getParent = function() { + return privates.parent; + }; + + this.appendChild = function(child) { + children.push(child); + var cp = p(child); + if (cp.parent) + cp.parent.removeChild(child); + cp.parent = this; + return child; + }; +} +``` +Now, in order to access the private data of a `Node` object, you need to +have access to the unique `p` function that is being used here. This is +already an improvement over the previous example, because it allows +restricted access by other `Node` instances, but can it help with the +`Node.prototype` problem too? + +Yes it can! +```js +var p = require("private").makeAccessor(); + +function Node() { + p(this).children = []; +} + +var Np = Node.prototype; + +Np.getParent = function() { + return p(this).parent; +}; + +Np.appendChild = function(child) { + p(this).children.push(child); + var cp = p(child); + if (cp.parent) + cp.parent.removeChild(child); + cp.parent = this; + return child; +}; +``` +Because `p` is in scope not only within the `Node` constructor but also +within `Node` methods, we can finally avoid redefining methods every time +the `Node` constructor is called. + +Now, you might be wondering how you can restrict access to `p` so that no +untrusted code is able to call it. The answer is to use your favorite +module pattern, be it CommonJS, AMD `define`, or even the old +Immediately-Invoked Function Expression: +```js +var Node = (function() { + var p = require("private").makeAccessor(); + + function Node() { + p(this).children = []; + } + + var Np = Node.prototype; + + Np.getParent = function() { + return p(this).parent; + }; + + Np.appendChild = function(child) { + p(this).children.push(child); + var cp = p(child); + if (cp.parent) + cp.parent.removeChild(child); + cp.parent = this; + return child; + }; + + return Node; +}()); + +var parent = new Node; +var child = new Node; +parent.appendChild(child); +assert.strictEqual(child.getParent(), parent); +``` +Because this version of `p` never leaks from the enclosing function scope, +only `Node` objects have access to it. + +So, you see, the claim I made at the beginning of this README remains +true: + +> In JavaScript, the only data that are truly private are local variables +> whose values do not *leak* from the scope in which they were defined. + +It just so happens that closure privacy is sufficient to implement a +privacy model similar to that provided by other languages. diff --git a/node_modules/private/package.json b/node_modules/private/package.json new file mode 100755 index 00000000..fffad32f --- /dev/null +++ b/node_modules/private/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + { + "raw": "private@^0.1.6", + "scope": null, + "escapedName": "private", + "name": "private", + "rawSpec": "^0.1.6", + "spec": ">=0.1.6 <0.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core" + ] + ], + "_from": "private@>=0.1.6 <0.2.0", + "_id": "private@0.1.7", + "_inCache": true, + "_location": "/private", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/private-0.1.7.tgz_1486316339625_0.9297276348806918" + }, + "_npmUser": { + "name": "benjamn", + "email": "bn@cs.stanford.edu" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "private@^0.1.6", + "scope": null, + "escapedName": "private", + "name": "private", + "rawSpec": "^0.1.6", + "spec": ">=0.1.6 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-core", + "/regenerator-transform" + ], + "_resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", + "_shasum": "68ce5e8a1ef0a23bb570cc28537b5332aba63ef1", + "_shrinkwrap": null, + "_spec": "private@^0.1.6", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/babel-core", + "author": { + "name": "Ben Newman", + "email": "bn@cs.stanford.edu" + }, + "bugs": { + "url": "https://github.com/benjamn/private/issues" + }, + "dependencies": {}, + "description": "Utility for associating truly private state with any JavaScript object", + "devDependencies": { + "mocha": "^3.2.0" + }, + "directories": {}, + "dist": { + "shasum": "68ce5e8a1ef0a23bb570cc28537b5332aba63ef1", + "tarball": "https://registry.npmjs.org/private/-/private-0.1.7.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "private.js" + ], + "gitHead": "cf3166de8d96dae5bae641559ea1b4e4aab1c0d3", + "homepage": "http://github.com/benjamn/private", + "keywords": [ + "private", + "access control", + "access modifiers", + "encapsulation", + "secret", + "state", + "privilege", + "scope", + "es5" + ], + "license": "MIT", + "main": "private.js", + "maintainers": [ + { + "name": "benjamn", + "email": "bn@cs.stanford.edu" + } + ], + "name": "private", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/benjamn/private.git" + }, + "scripts": { + "test": "mocha --reporter spec --full-trace test/run.js" + }, + "version": "0.1.7" +} diff --git a/node_modules/private/private.js b/node_modules/private/private.js new file mode 100755 index 00000000..4f952fc4 --- /dev/null +++ b/node_modules/private/private.js @@ -0,0 +1,129 @@ +"use strict"; + +var originalObject = Object; +var originalDefProp = Object.defineProperty; +var originalCreate = Object.create; + +function defProp(obj, name, value) { + if (originalDefProp) try { + originalDefProp.call(originalObject, obj, name, { value: value }); + } catch (definePropertyIsBrokenInIE8) { + obj[name] = value; + } else { + obj[name] = value; + } +} + +// For functions that will be invoked using .call or .apply, we need to +// define those methods on the function objects themselves, rather than +// inheriting them from Function.prototype, so that a malicious or clumsy +// third party cannot interfere with the functionality of this module by +// redefining Function.prototype.call or .apply. +function makeSafeToCall(fun) { + if (fun) { + defProp(fun, "call", fun.call); + defProp(fun, "apply", fun.apply); + } + return fun; +} + +makeSafeToCall(originalDefProp); +makeSafeToCall(originalCreate); + +var hasOwn = makeSafeToCall(Object.prototype.hasOwnProperty); +var numToStr = makeSafeToCall(Number.prototype.toString); +var strSlice = makeSafeToCall(String.prototype.slice); + +var cloner = function(){}; +function create(prototype) { + if (originalCreate) { + return originalCreate.call(originalObject, prototype); + } + cloner.prototype = prototype || null; + return new cloner; +} + +var rand = Math.random; +var uniqueKeys = create(null); + +function makeUniqueKey() { + // Collisions are highly unlikely, but this module is in the business of + // making guarantees rather than safe bets. + do var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2)); + while (hasOwn.call(uniqueKeys, uniqueKey)); + return uniqueKeys[uniqueKey] = uniqueKey; +} + +function internString(str) { + var obj = {}; + obj[str] = true; + return Object.keys(obj)[0]; +} + +// External users might find this function useful, but it is not necessary +// for the typical use of this module. +exports.makeUniqueKey = makeUniqueKey; + +// Object.getOwnPropertyNames is the only way to enumerate non-enumerable +// properties, so if we wrap it to ignore our secret keys, there should be +// no way (except guessing) to access those properties. +var originalGetOPNs = Object.getOwnPropertyNames; +Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + for (var names = originalGetOPNs(object), + src = 0, + dst = 0, + len = names.length; + src < len; + ++src) { + if (!hasOwn.call(uniqueKeys, names[src])) { + if (src > dst) { + names[dst] = names[src]; + } + ++dst; + } + } + names.length = dst; + return names; +}; + +function defaultCreatorFn(object) { + return create(null); +} + +function makeAccessor(secretCreatorFn) { + var brand = makeUniqueKey(); + var passkey = create(null); + + secretCreatorFn = secretCreatorFn || defaultCreatorFn; + + function register(object) { + var secret; // Created lazily. + + function vault(key, forget) { + // Only code that has access to the passkey can retrieve (or forget) + // the secret object. + if (key === passkey) { + return forget + ? secret = null + : secret || (secret = secretCreatorFn(object)); + } + } + + defProp(object, brand, vault); + } + + function accessor(object) { + if (!hasOwn.call(object, brand)) + register(object); + return object[brand](passkey); + } + + accessor.forget = function(object) { + if (hasOwn.call(object, brand)) + object[brand](passkey, true); + }; + + return accessor; +} + +exports.makeAccessor = makeAccessor; diff --git a/node_modules/process-nextick-args/.travis.yml b/node_modules/process-nextick-args/.travis.yml new file mode 100755 index 00000000..36201b10 --- /dev/null +++ b/node_modules/process-nextick-args/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" + - "0.12" + - "1.7.1" + - 1 + - 2 + - 3 + - 4 + - 5 diff --git a/node_modules/process-nextick-args/index.js b/node_modules/process-nextick-args/index.js new file mode 100755 index 00000000..a4f40f84 --- /dev/null +++ b/node_modules/process-nextick-args/index.js @@ -0,0 +1,43 @@ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} diff --git a/node_modules/process-nextick-args/license.md b/node_modules/process-nextick-args/license.md new file mode 100755 index 00000000..c67e3532 --- /dev/null +++ b/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** diff --git a/node_modules/process-nextick-args/package.json b/node_modules/process-nextick-args/package.json new file mode 100755 index 00000000..99675ab5 --- /dev/null +++ b/node_modules/process-nextick-args/package.json @@ -0,0 +1,83 @@ +{ + "_args": [ + [ + { + "raw": "process-nextick-args@~1.0.6", + "scope": null, + "escapedName": "process-nextick-args", + "name": "process-nextick-args", + "rawSpec": "~1.0.6", + "spec": ">=1.0.6 <1.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream" + ] + ], + "_from": "process-nextick-args@>=1.0.6 <1.1.0", + "_id": "process-nextick-args@1.0.7", + "_inCache": true, + "_location": "/process-nextick-args", + "_nodeVersion": "5.11.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" + }, + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "_npmVersion": "3.8.6", + "_phantomChildren": {}, + "_requested": { + "raw": "process-nextick-args@~1.0.6", + "scope": null, + "escapedName": "process-nextick-args", + "name": "process-nextick-args", + "rawSpec": "~1.0.6", + "spec": ">=1.0.6 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "_shrinkwrap": null, + "_spec": "process-nextick-args@~1.0.6", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/readable-stream", + "author": "", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "dependencies": {}, + "description": "process.nextTick but always with args", + "devDependencies": { + "tap": "~0.2.6" + }, + "directories": {}, + "dist": { + "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" + }, + "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "name": "process-nextick-args", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.7" +} diff --git a/node_modules/process-nextick-args/readme.md b/node_modules/process-nextick-args/readme.md new file mode 100755 index 00000000..78e7cfae --- /dev/null +++ b/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var nextTick = require('process-nextick-args'); + +nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/node_modules/process-nextick-args/test.js b/node_modules/process-nextick-args/test.js new file mode 100755 index 00000000..ef157215 --- /dev/null +++ b/node_modules/process-nextick-args/test.js @@ -0,0 +1,24 @@ +var test = require("tap").test; +var nextTick = require('./'); + +test('should work', function (t) { + t.plan(5); + nextTick(function (a) { + t.ok(a); + nextTick(function (thing) { + t.equals(thing, 7); + }, 7); + }, true); + nextTick(function (a, b, c) { + t.equals(a, 'step'); + t.equals(b, 3); + t.equals(c, 'profit'); + }, 'step', 3, 'profit'); +}); + +test('correct number of arguments', function (t) { + t.plan(1); + nextTick(function () { + t.equals(2, arguments.length, 'correct number'); + }, 1, 2); +}); diff --git a/node_modules/process/.eslintrc b/node_modules/process/.eslintrc new file mode 100755 index 00000000..1e7aab73 --- /dev/null +++ b/node_modules/process/.eslintrc @@ -0,0 +1,21 @@ +{ +extends: "eslint:recommended", + "env": { + "node": true, + "browser": true, + "es6" : true, + "mocha": true + }, + "rules": { + "indent": [2, 4], + "brace-style": [2, "1tbs"], + "quotes": [2, "single"], + "no-console": 0, + "no-shadow": 0, + "no-use-before-define": [2, "nofunc"], + "no-underscore-dangle": 0, + "no-constant-condition": 0, + "space-after-function-name": 0, + "consistent-return": 0 + } +} diff --git a/node_modules/process/LICENSE b/node_modules/process/LICENSE new file mode 100755 index 00000000..b8c1246c --- /dev/null +++ b/node_modules/process/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Roman Shtylman + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/process/README.md b/node_modules/process/README.md new file mode 100755 index 00000000..6570729b --- /dev/null +++ b/node_modules/process/README.md @@ -0,0 +1,26 @@ +# process + +```require('process');``` just like any other module. + +Works in node.js and browsers via the browser.js shim provided with the module. + +## browser implementation + +The goal of this module is not to be a full-fledged alternative to the builtin process module. This module mostly exists to provide the nextTick functionality and little more. We keep this module lean because it will often be included by default by tools like browserify when it detects a module has used the `process` global. + +It also exposes a "browser" member (i.e. `process.browser`) which is `true` in this implementation but `undefined` in node. This can be used in isomorphic code that adjusts it's behavior depending on which environment it's running in. + +If you are looking to provide other process methods, I suggest you monkey patch them onto the process global in your app. A list of user created patches is below. + +* [hrtime](https://github.com/kumavis/browser-process-hrtime) +* [stdout](https://github.com/kumavis/browser-stdout) + +## package manager notes + +If you are writing a bundler to package modules for client side use, make sure you use the ```browser``` field hint in package.json. + +See https://gist.github.com/4339901 for details. + +The [browserify](https://github.com/substack/node-browserify) module will properly handle this field when bundling your files. + + diff --git a/node_modules/process/browser.js b/node_modules/process/browser.js new file mode 100755 index 00000000..d3e30e9b --- /dev/null +++ b/node_modules/process/browser.js @@ -0,0 +1,180 @@ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; diff --git a/node_modules/process/index.js b/node_modules/process/index.js new file mode 100755 index 00000000..8d8ed7df --- /dev/null +++ b/node_modules/process/index.js @@ -0,0 +1,2 @@ +// for now just expose the builtin process global from node.js +module.exports = global.process; diff --git a/node_modules/process/package.json b/node_modules/process/package.json new file mode 100755 index 00000000..80540e38 --- /dev/null +++ b/node_modules/process/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "process@^0.11.0", + "scope": null, + "escapedName": "process", + "name": "process", + "rawSpec": "^0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "process@>=0.11.0 <0.12.0", + "_id": "process@0.11.9", + "_inCache": true, + "_location": "/process", + "_nodeVersion": "5.12.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/process-0.11.9.tgz_1472587751718_0.8843140550889075" + }, + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "_npmVersion": "3.8.6", + "_phantomChildren": {}, + "_requested": { + "raw": "process@^0.11.0", + "scope": null, + "escapedName": "process", + "name": "process", + "rawSpec": "^0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", + "_shasum": "7bd5ad21aa6253e7da8682264f1e11d11c0318c1", + "_shrinkwrap": null, + "_spec": "process@^0.11.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "Roman Shtylman", + "email": "shtylman@gmail.com" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/shtylman/node-process/issues" + }, + "dependencies": {}, + "description": "process information for node.js and browsers", + "devDependencies": { + "mocha": "2.2.1", + "zuul": "^3.10.3" + }, + "directories": {}, + "dist": { + "shasum": "7bd5ad21aa6253e7da8682264f1e11d11c0318c1", + "tarball": "https://registry.npmjs.org/process/-/process-0.11.9.tgz" + }, + "engines": { + "node": ">= 0.6.0" + }, + "gitHead": "7d8c3702a8bbc43fa55f4bab74b150aef37001dd", + "homepage": "https://github.com/shtylman/node-process#readme", + "keywords": [ + "process" + ], + "license": "MIT", + "main": "./index.js", + "maintainers": [ + { + "name": "coolaj86", + "email": "coolaj86@gmail.com" + }, + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + } + ], + "name": "process", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/shtylman/node-process.git" + }, + "scripts": { + "browser": "zuul --no-coverage --ui mocha-bdd --local 8080 -- test.js", + "test": "mocha test.js" + }, + "version": "0.11.9" +} diff --git a/node_modules/process/test.js b/node_modules/process/test.js new file mode 100755 index 00000000..8ba579c0 --- /dev/null +++ b/node_modules/process/test.js @@ -0,0 +1,199 @@ +var assert = require('assert'); +var ourProcess = require('./browser'); +describe('test against our process', function () { + test(ourProcess); +}); +if (!process.browser) { + describe('test against node', function () { + test(process); + }); + vmtest(); +} +function test (ourProcess) { + describe('test arguments', function () { + it ('works', function (done) { + var order = 0; + + + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'first one works'); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'recursive one is 4th'); + }, 3); + }, 0); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'second one starts'); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'this is third'); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'this is last'); + done(); + }, 5); + }, 4); + }, 1); + ourProcess.nextTick(function (num) { + + assert.equal(num, order++, '3rd schedualed happens after the error'); + }, 2); + }); + }); +if (!process.browser) { + describe('test errors', function (t) { + it ('works', function (done) { + var order = 0; + process.removeAllListeners('uncaughtException'); + process.once('uncaughtException', function(err) { + assert.equal(2, order++, 'error is third'); + ourProcess.nextTick(function () { + assert.equal(5, order++, 'schedualed in error is last'); + done(); + }); + }); + ourProcess.nextTick(function () { + assert.equal(0, order++, 'first one works'); + ourProcess.nextTick(function () { + assert.equal(4, order++, 'recursive one is 4th'); + }); + }); + ourProcess.nextTick(function () { + assert.equal(1, order++, 'second one starts'); + throw(new Error('an error is thrown')); + }); + ourProcess.nextTick(function () { + assert.equal(3, order++, '3rd schedualed happens after the error'); + }); + }); + }); +} + describe('rename globals', function (t) { + var oldTimeout = setTimeout; + var oldClear = clearTimeout; + + it('clearTimeout', function (done){ + + var ok = true; + clearTimeout = function () { + ok = false; + } + var ran = false; + function cleanup() { + clearTimeout = oldClear; + var err; + try { + assert.ok(ok, 'fake clearTimeout ran'); + assert.ok(ran, 'should have run'); + } catch (e) { + err = e; + } + done(err); + } + setTimeout(cleanup, 1000); + ourProcess.nextTick(function () { + ran = true; + }); + }); + it('just setTimeout', function (done){ + + + setTimeout = function () { + setTimeout = oldTimeout; + try { + assert.ok(false, 'fake setTimeout called') + } catch (e) { + done(e); + } + + } + + ourProcess.nextTick(function () { + setTimeout = oldTimeout; + done(); + }); + }); + }); +} +function vmtest() { + var vm = require('vm'); + var fs = require('fs'); + var process = fs.readFileSync('./browser.js', {encoding: 'utf8'}); + + + describe('should work in vm in strict mode with no globals', function () { + it('should parse', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'this.works = process.browser;'; + var script = new vm.Script(str); + var context = { + works: false + }; + script.runInNewContext(context); + assert.ok(context.works); + done(); + }); + it('setTimeout throws error', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'try {process.nextTick(function () {})} catch (e){this.works = e;}'; + var script = new vm.Script(str); + var context = { + works: false + }; + script.runInNewContext(context); + assert.ok(context.works); + done(); + }); + it('should generally work', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'process.nextTick(function () {assert.ok(true);done();})'; + var script = new vm.Script(str); + var context = { + clearTimeout: clearTimeout, + setTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + it('late defs setTimeout', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {assert.ok(true);done();})'; + var script = new vm.Script(str); + var context = { + clearTimeout: clearTimeout, + hiddenSetTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + it('late defs clearTimeout', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'var clearTimeout = hiddenClearTimeout;process.nextTick(function () {assert.ok(true);done();})'; + var script = new vm.Script(str); + var context = { + hiddenClearTimeout: clearTimeout, + setTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + it('late defs setTimeout and then redefine', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {setTimeout = function (){throw new Error("foo")};hiddenSetTimeout(function(){process.nextTick(function (){assert.ok(true);done();});});});'; + var script = new vm.Script(str); + var context = { + clearTimeout: clearTimeout, + hiddenSetTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + }); +} diff --git a/node_modules/prompt/.jshintrc b/node_modules/prompt/.jshintrc new file mode 100755 index 00000000..0d979865 --- /dev/null +++ b/node_modules/prompt/.jshintrc @@ -0,0 +1,54 @@ +{ + "passfail": false, + "maxerr": 100, + + "browser": false, + "node": true, + "rhino": false, + "couch": true, + "wsh": true, + "jquery": true, + "prototypejs": false, + "mootools": false, + "dojo": false, + + "devel": false, + + "es5": true, + "strict": false, + "globalstrict": false, + + "asi": false, + "lastsemic": true, + "laxbreak": true, + "laxcomma": false, + "bitwise": false, + "boss": false, + "curly": true, + "eqeqeq": true, + "eqnull": false, + "evil": false, + "expr": false, + "forin": false, + "immed": false, + "latedef": false, + "loopfunc": true, + "noarg": true, + "regexp": true, + "regexdash": false, + "scripturl": true, + "shadow": true, + "supernew": true, + "undef": true, + + "newcap": true, + "noempty": true, + "nonew": true, + "nomen": false, + "onevar": true, + "plusplus": false, + "sub": true, + "trailing": true, + "white": false, + "indent": 2 +} \ No newline at end of file diff --git a/node_modules/prompt/.npmignore b/node_modules/prompt/.npmignore new file mode 100755 index 00000000..e3bc2750 --- /dev/null +++ b/node_modules/prompt/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +node_modules/* +npm-debug.log \ No newline at end of file diff --git a/node_modules/prompt/.travis.yml b/node_modules/prompt/.travis.yml new file mode 100755 index 00000000..9473f322 --- /dev/null +++ b/node_modules/prompt/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "node" + - "0.12" + - "4" + - "5" + +sudo: false diff --git a/node_modules/prompt/CHANGELOG.md b/node_modules/prompt/CHANGELOG.md new file mode 100755 index 00000000..b094c489 --- /dev/null +++ b/node_modules/prompt/CHANGELOG.md @@ -0,0 +1,13 @@ + +0.2.7 / 2012-08-30 +================== + + * Fixed handling of numeric inputs with parseFloat + * Fixed overwriting of non-string inputs + * Added support for boolean types + +0.2.6 / 2012-08-12 +================== + + * Added allowance of empty default values + diff --git a/node_modules/prompt/LICENSE b/node_modules/prompt/LICENSE new file mode 100755 index 00000000..56217cac --- /dev/null +++ b/node_modules/prompt/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Nodejitsu Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/prompt/README.md b/node_modules/prompt/README.md new file mode 100755 index 00000000..2fb9ffb9 --- /dev/null +++ b/node_modules/prompt/README.md @@ -0,0 +1,444 @@ +# prompt [![Build Status](https://secure.travis-ci.org/flatiron/prompt.svg)](http://travis-ci.org/flatiron/prompt) + +A beautiful command-line prompt for node.js + +## Features + +* prompts the user for input +* supports validation and defaults +* hides passwords + +## Usage +Using prompt is relatively straight forward. There are two core methods you should be aware of: `prompt.get()` and `prompt.addProperties()`. Their methods take strings representing property names in addition to objects for complex property validation (and more). There are a number of [examples][0] that you should examine for detailed usage. + +### Getting Basic Prompt Information +Getting started with `prompt` is easy. Lets take a look at `examples/simple-prompt.js`: + +``` js + var prompt = require('prompt'); + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: username and email + // + prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); + }); +``` + +This will result in the following command-line output: + +``` + $ node examples/simple-prompt.js + prompt: username: some-user + prompt: email: some-user@some-place.org + Command-line input received: + username: some-user + email: some-user@some-place.org +``` + +### Prompting with Validation, Default Values, and More (Complex Properties) +In addition to prompting the user with simple string prompts, there is a robust API for getting and validating complex information from a command-line prompt. Here's a quick sample: + +``` js + var schema = { + properties: { + name: { + pattern: /^[a-zA-Z\s\-]+$/, + message: 'Name must be only letters, spaces, or dashes', + required: true + }, + password: { + hidden: true + } + } + }; + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: email, password + // + prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' name: ' + result.name); + console.log(' password: ' + result.password); + }); +``` + +Pretty easy right? The output from the above script is: + +``` + $ node examples/property-prompt.js + prompt: name: nodejitsu000 + error: Invalid input for name + error: Name must be only letters, spaces, or dashes + prompt: name: Nodejitsu Inc + prompt: password: + Command-line input received: + name: Nodejitsu Inc + password: some-password +``` + +## Valid Property Settings +`prompt` understands JSON-schema with a few extra parameters and uses [revalidator](https://github.com/flatiron/revalidator) for validation. + +Here's an overview of the properties that may be used for validation and prompting controls: + +``` js + { + description: 'Enter your password', // Prompt displayed to the user. If not supplied name will be used. + type: 'string', // Specify the type of input to expect. + pattern: /^\w+$/, // Regular expression that input must be valid against. + message: 'Password must be letters', // Warning message to display if validation fails. + hidden: true, // If true, characters entered will either not be output to console or will be outputed using the `replace` string. + replace: '*', // If `hidden` is set it will replace each hidden character with the specified string. + default: 'lamepassword', // Default value to use if no value is entered. + required: true // If true, value entered must be non-empty. + before: function(value) { return 'v' + value; } // Runs before node-prompt callbacks. It modifies user's input + } +``` + +Alternatives to `pattern` include `format` and `conform`, as documented in [revalidator](https://github.com/flatiron/revalidator). + +Supported types are `string`, `boolean`, `number`, `integer`, `array` + +Using `type: 'boolean'` accepts case insensitive values 'true', 't', 'false', 'f' + +Using `type: 'array'` has some special cases. + +- `description` will not work in the schema if `type: 'array'` is defined. +- `maxItems` takes precedence over `minItems`. +- Arrays that do not have `maxItems` defined will require users to `SIGINT` (`^C`) before the array is ended. +- If `SIGINT` (`^C`) is triggered before `minItems` is met, a validation error will appear. This will require users to `SIGEOF` (`^D`) to end the input. + +For more information on things such as `maxItems` and `minItems`, refer to the [revalidator](https://github.com/flatiron/revalidator) repository. + +### Alternate Validation API: + +Prompt, in addition to iterating over JSON-Schema properties, will also happily iterate over an array of validation objects given an extra 'name' property: + +```js + var prompt = require('../lib/prompt'); + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: username and password + // + prompt.get([{ + name: 'username', + required: true + }, { + name: 'password', + hidden: true, + conform: function (value) { + return true; + } + }], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' password: ' + result.password); + }); +``` + +### Backward Compatibility + +Note that, while this structure is similar to that used by prompt 0.1.x, that the object properties use the same names as in JSON-Schema. prompt 0.2.x is backward compatible with prompt 0.1.x except for asynchronous validation. + +### Skipping Prompts + +Sometimes power users may wish to skip prompts and specify all data as command line options. +if a value is set as a property of `prompt.override` prompt will use that instead of +prompting the user. + +``` js + //prompt-override.js + + var prompt = require('prompt'), + optimist = require('optimist') + + // + // set the overrides + // + prompt.override = optimist.argv + + // + // Start the prompt + // + prompt.start(); + + // + // Get two properties from the user: username and email + // + prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); + }) + + //: node prompt-override.js --username USER --email EMAIL +``` + +It is also possible to skip prompts dynamically based on previous prompts. +If an `ask` method is added, prompt will use it to determine if the prompt should be displayed. +If `ask` returns true the prompt is displayed. otherwise, the default value or empty string are used. + +``` js + var schema = { + properties: { + proxy: { + description: 'Proxy url', + }, + proxyCredentials: { + description: 'Proxy credentials', + ask: function() { + // only ask for proxy credentials if a proxy was set + return prompt.history('proxy').value > 0; + } + } + } + }; + + // + // Start the prompt + // + prompt.start(); + + // + // Get one or two properties from the user, depending on + // what the user answered for proxy + // + prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' proxy: ' + result.proxy); + console.log(' credentials: ' + result.proxyCredentials); + }); +``` + + +### Adding Properties to an Object +A common use-case for prompting users for data from the command-line is to extend or create a configuration object that is passed onto the entry-point method for your CLI tool. `prompt` exposes a convenience method for doing just this: + +``` js + var obj = { + password: 'lamepassword', + mindset: 'NY' + } + + // + // Log the initial object. + // + console.log('Initial object to be extended:'); + console.dir(obj); + + // + // Add two properties to the empty object: username and email + // + prompt.addProperties(obj, ['username', 'email'], function (err) { + // + // Log the results. + // + console.log('Updated object received:'); + console.dir(obj); + }); +``` + +### Prompt history +You can use the `prompt.history()` method to get access to previous prompt input. + +``` js + prompt.get([{ + name: 'name', + description: 'Your name', + type: 'string', + required: true + }, { + name: 'surname', + description: 'Your surname', + type: 'string', + required: true, + message: 'Please dont use the demo credentials', + conform: function(surname) { + var name = prompt.history('name').value; + return (name !== 'John' || surname !== 'Smith'); + } + }], function(err, results) { + console.log(results); + }); +``` + +## Customizing your prompt +Aside from changing `property.message`, you can also change `prompt.message` +and `prompt.delimiter` to change the appearance of your prompt. + +The basic structure of a prompt is this: + +``` js +prompt.message + prompt.delimiter + property.message + prompt.delimiter; +``` + +The default `prompt.message` is "prompt," the default `prompt.delimiter` is +": ", and the default `property.message` is `property.name`. +Changing these allows you to customize the appearance of your prompts! In +addition, prompt supports ANSI color codes via the +[colors module](https://github.com/Marak/colors.js) for custom colors. For a +very colorful example: + +``` js + var prompt = require("prompt"); + var colors = require("colors/safe"); + // + // Setting these properties customizes the prompt. + // + prompt.message = colors.rainbow("Question!"); + prompt.delimiter = colors.green("><"); + + prompt.start(); + + prompt.get({ + properties: { + name: { + description: colors.magenta("What is your name?") + } + } + }, function (err, result) { + console.log(colors.cyan("You said your name is: " + result.name)); + }); +``` + +If you don't want colors, you can set + +```js +var prompt = require('prompt'); + +prompt.colors = false; +``` + +## Integration with streamlinejs + +When integrating prompt with projects using streamlinejs such as the following + +``` +prompt.start(); +function test_prompt(_){ + console.log(prompt.get(loadDataValues(), _).output); +} +test_prompt(_); +``` + +This will work, however the process is then stuck with a stdin stream still open. If you setup the traditional way (with callback) such as this + + ``` +prompt.start(); +function test_prompt(){ + prompt.get(loadDataValues(), function(err, data){ + console.log(data.output); + }); +} +test_prompt(); +``` +This works and ends correctly. + +To resolve this we have added a new method to prompt, which will stop the stdin stream + +``` +// +// ### function stop () +// Stops input coming in from stdin +// +prompt.stop = function () { + if (prompt.stopped || !prompt.started) { + return; + } + + stdin.destroy(); + prompt.emit('stop'); + prompt.stopped = true; + prompt.started = false; + prompt.paused = false; + return prompt; +} +``` + +And you can find an example in the example folder `examples/prompt-streamline.js` + +``` +/* + * prompt-streamline._js: Example of how to use prompt with streamlinejs. + * + * calling syntax: _node prompt-streamline._js + * + */ +var prompt = require('../lib/prompt'); + +function getSampleData(){ + return [ + { + name: 'username', + message: 'Enter a username' + } + ]; +}; + +// +// Start the prompt +// +prompt.start(); + +function get_username_prompt(_){ + console.log(prompt.get(getSampleData(), _).username); +} + +get_username_prompt(_); + +// +// Clean the prompt +// +prompt.stop(); +``` + +## Installation + +``` bash + $ [sudo] npm install prompt +``` + +## Running tests + +``` bash + $ npm test +``` + +#### License: MIT +#### Author: [Charlie Robbins](http://github.com/indexzero) +#### Contributors: [Josh Holbrook](http://github.com/jesusabdullah), [Pavan Kumar Sunkara](http://github.com/pksunkara) + +[0]: https://github.com/flatiron/prompt/tree/master/examples diff --git a/node_modules/prompt/docs/docco.css b/node_modules/prompt/docs/docco.css new file mode 100755 index 00000000..bd541343 --- /dev/null +++ b/node_modules/prompt/docs/docco.css @@ -0,0 +1,194 @@ +/*--------------------- Layout and Typography ----------------------------*/ +body { + font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; + font-size: 15px; + line-height: 22px; + color: #252519; + margin: 0; padding: 0; +} +a { + color: #261a3b; +} + a:visited { + color: #261a3b; + } +p { + margin: 0 0 15px 0; +} +h4, h5, h6 { + color: #333; + margin: 6px 0 6px 0; + font-size: 13px; +} + h2, h3 { + margin-bottom: 0; + color: #000; + } + h1 { + margin-top: 40px; + margin-bottom: 15px; + color: #000; + } +#container { + position: relative; +} +#background { + position: fixed; + top: 0; left: 525px; right: 0; bottom: 0; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + z-index: -1; +} +#jump_to, #jump_page { + background: white; + -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777; + -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; + font: 10px Arial; + text-transform: uppercase; + cursor: pointer; + text-align: right; +} +#jump_to, #jump_wrapper { + position: fixed; + right: 0; top: 0; + padding: 5px 10px; +} + #jump_wrapper { + padding: 0; + display: none; + } + #jump_to:hover #jump_wrapper { + display: block; + } + #jump_page { + padding: 5px 0 3px; + margin: 0 0 25px 25px; + } + #jump_page .source { + display: block; + padding: 5px 10px; + text-decoration: none; + border-top: 1px solid #eee; + } + #jump_page .source:hover { + background: #f5f5ff; + } + #jump_page .source:first-child { + } +table td { + border: 0; + outline: 0; +} + td.docs, th.docs { + max-width: 450px; + min-width: 450px; + min-height: 5px; + padding: 10px 25px 1px 50px; + overflow-x: hidden; + vertical-align: top; + text-align: left; + } + .docs pre { + margin: 15px 0 15px; + padding-left: 15px; + } + .docs p tt, .docs p code { + background: #f8f8ff; + border: 1px solid #dedede; + font-size: 12px; + padding: 0 0.2em; + } + .pilwrap { + position: relative; + } + .pilcrow { + font: 12px Arial; + text-decoration: none; + color: #454545; + position: absolute; + top: 3px; left: -20px; + padding: 1px 2px; + opacity: 0; + -webkit-transition: opacity 0.2s linear; + } + td.docs:hover .pilcrow { + opacity: 1; + } + td.code, th.code { + padding: 14px 15px 16px 25px; + width: 100%; + vertical-align: top; + background: #f5f5ff; + border-left: 1px solid #e5e5ee; + } + pre, tt, code { + font-size: 12px; line-height: 18px; + font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; + margin: 0; padding: 0; + } + + +/*---------------------- Syntax Highlighting -----------------------------*/ +td.linenos { background-color: #f0f0f0; padding-right: 10px; } +span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } +body .hll { background-color: #ffffcc } +body .c { color: #408080; font-style: italic } /* Comment */ +body .err { border: 1px solid #FF0000 } /* Error */ +body .k { color: #954121 } /* Keyword */ +body .o { color: #666666 } /* Operator */ +body .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +body .cp { color: #BC7A00 } /* Comment.Preproc */ +body .c1 { color: #408080; font-style: italic } /* Comment.Single */ +body .cs { color: #408080; font-style: italic } /* Comment.Special */ +body .gd { color: #A00000 } /* Generic.Deleted */ +body .ge { font-style: italic } /* Generic.Emph */ +body .gr { color: #FF0000 } /* Generic.Error */ +body .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +body .gi { color: #00A000 } /* Generic.Inserted */ +body .go { color: #808080 } /* Generic.Output */ +body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +body .gs { font-weight: bold } /* Generic.Strong */ +body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +body .gt { color: #0040D0 } /* Generic.Traceback */ +body .kc { color: #954121 } /* Keyword.Constant */ +body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */ +body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */ +body .kp { color: #954121 } /* Keyword.Pseudo */ +body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */ +body .kt { color: #B00040 } /* Keyword.Type */ +body .m { color: #666666 } /* Literal.Number */ +body .s { color: #219161 } /* Literal.String */ +body .na { color: #7D9029 } /* Name.Attribute */ +body .nb { color: #954121 } /* Name.Builtin */ +body .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +body .no { color: #880000 } /* Name.Constant */ +body .nd { color: #AA22FF } /* Name.Decorator */ +body .ni { color: #999999; font-weight: bold } /* Name.Entity */ +body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +body .nf { color: #0000FF } /* Name.Function */ +body .nl { color: #A0A000 } /* Name.Label */ +body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +body .nt { color: #954121; font-weight: bold } /* Name.Tag */ +body .nv { color: #19469D } /* Name.Variable */ +body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +body .w { color: #bbbbbb } /* Text.Whitespace */ +body .mf { color: #666666 } /* Literal.Number.Float */ +body .mh { color: #666666 } /* Literal.Number.Hex */ +body .mi { color: #666666 } /* Literal.Number.Integer */ +body .mo { color: #666666 } /* Literal.Number.Oct */ +body .sb { color: #219161 } /* Literal.String.Backtick */ +body .sc { color: #219161 } /* Literal.String.Char */ +body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */ +body .s2 { color: #219161 } /* Literal.String.Double */ +body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +body .sh { color: #219161 } /* Literal.String.Heredoc */ +body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +body .sx { color: #954121 } /* Literal.String.Other */ +body .sr { color: #BB6688 } /* Literal.String.Regex */ +body .s1 { color: #219161 } /* Literal.String.Single */ +body .ss { color: #19469D } /* Literal.String.Symbol */ +body .bp { color: #954121 } /* Name.Builtin.Pseudo */ +body .vc { color: #19469D } /* Name.Variable.Class */ +body .vg { color: #19469D } /* Name.Variable.Global */ +body .vi { color: #19469D } /* Name.Variable.Instance */ +body .il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/node_modules/prompt/docs/prompt.html b/node_modules/prompt/docs/prompt.html new file mode 100755 index 00000000..7776f5bc --- /dev/null +++ b/node_modules/prompt/docs/prompt.html @@ -0,0 +1,296 @@ + prompt.js

      prompt.js

      /*
      + * prompt.js: Simple prompt for prompting information from the command line 
      + *
      + * (C) 2010, Nodejitsu Inc.
      + *
      + */
      +
      +var events = require('events'),
      +    async = require('async'),
      +    colors = require('colors'),
      +    winston = require('winston'),
      +    stdio = process.binding('stdio');

      @private function capitalize (str)

      + +

      str {string} String to capitalize

      + +

      Capitalizes the string supplied.

      function capitalize(str) {
      +  return str.charAt(0).toUpperCase() + str.slice(1);
      +}
      +
      +var prompt = module.exports = Object.create(events.EventEmitter.prototype);
      +
      +var logger = prompt.logger = new winston.Logger({
      +  transports: [
      +    new (winston.transports.Console)()
      +  ]
      +});
      +    
      +prompt.started    = false;
      +prompt.paused     = false;
      +prompt.allowEmpty = false; 
      +
      +var stdin, stdout;

      Create an empty object for the properties +known to prompt

      prompt.properties = {};

      Setup the default winston logger to use +the cli levels and colors.

      logger.cli();

      function start (options)

      + +

      @options {Object} Optional Options to consume by prompt

      + +

      Starts the prompt by listening to the appropriate events on options.stdin +and options.stdout. If no streams are supplied, then process.stdin +and process.stdout are used, respectively.

      prompt.start = function (options) {
      +  if (prompt.started) {
      +    return;
      +  }
      +  
      +  options = options        || {};
      +  stdin   = options.stdin  || process.openStdin();
      +  stdout  = options.stdout || process.stdout;
      +  
      +  prompt.allowEmpty = options.allowEmpty || false;
      +  
      +  process.on('SIGINT', function () {
      +    stdout.write('\n');
      +    process.exit(1);
      +  })
      +  
      +  prompt.emit('start');
      +  prompt.started = true;
      +  return prompt;
      +};

      function pause ()

      + +

      Pauses input coming in from stdin

      prompt.pause = function () {
      +  if (!prompt.started || prompt.paused) {
      +    return;
      +  }
      +  
      +  stdin.pause();
      +  prompt.emit('pause');
      +  prompt.paused = true;
      +  return prompt;
      +};

      function resume ()

      + +

      Resumes input coming in from stdin

      prompt.resume = function () {
      +  if (!prompt.started || !prompt.paused) {
      +    return;
      +  }
      +  
      +  stdin.resume();
      +  prompt.emit('resume');
      +  prompt.paused = false;
      +  return prompt;
      +};

      function get (msg, [validator,] callback)

      + +

      @msg {Array|Object|string} Set of variables to get input for.

      + +

      @callback {function} Continuation to pass control to when complete.

      + +

      Gets input from the user via stdin for the specified message(s) msg.

      prompt.get = function (msg, callback) {
      +  var vars = !Array.isArray(msg) ? [msg] : msg,
      +      result = {};
      +  
      +  vars = vars.map(function (v) {
      +    if (typeof v === 'string') {
      +      v = v.toLowerCase();
      +    }
      +    
      +    return prompt.properties[v] || v;
      +  });
      +  
      +  function get(target, next) {
      +    prompt.getInput(target, function (err, line) {
      +      if (err) {
      +        return next(err);
      +      }
      +      
      +      var name = target.name || target;
      +      result[name] = line;
      +      next();
      +    });
      +  }
      +  
      +  async.forEachSeries(vars, get, function (err) {
      +    return err ? callback(err) : callback(null, result);
      +  });
      +  
      +  return prompt;
      +};

      function getInput (msg, validator, callback)

      + +

      @msg {Object|string} Variable to get input for.

      + +

      @callback {function} Continuation to pass control to when complete.

      + +

      Gets input from the user via stdin for the specified message msg.

      prompt.getInput = function (prop, callback) {
      +  var name   = prop.message || prop.name || prop,
      +      raw    = ['prompt', ': ' + name.grey, ': '.grey],
      +      read   = prop.hidden ? prompt.readLineHidden : prompt.readLine,
      +      length, msg;
      +  
      +  if (prop.default) {
      +    raw.splice(2, -1, ' (' + prop.default + ')');
      +  }
      +  

      Calculate the raw length and colorize the prompt

        length = raw.join('').length;
      +  raw[0] = raw[0];
      +  msg = raw.join('');
      +  
      +  if (prop.help) {
      +    prop.help.forEach(function (line) {
      +      logger.help(line);
      +    });
      +  }
      +  
      +  stdout.write(msg); 
      +  prompt.emit('prompt', prop);
      +  
      +  read.call(null, function (err, line) {
      +    if (err) {
      +      return callback(err);
      +    }
      +  
      +    if (!line || line === '') {
      +      line = prop.default || line;
      +    }
      +    
      +    if (prop.validator || prop.empty === false) {
      +      var valid;
      +      
      +      if (prop.validator) {
      +        valid = prop.validator.test 
      +         ? prop.validator.test(line)
      +         : prop.validator(line);
      +      }
      +      
      +      if (prop.empty === false && valid) {
      +        valid = line.length > 0;
      +        prop.warning = prop.warning || 'You must supply a value.';
      +      }
      +      
      +      if (!valid) {
      +        logger.error('Invalid input for ' + name.grey);
      +        if (prop.warning) {
      +          logger.error(prop.warning);
      +        }
      +        
      +        prompt.emit('invalid', prop, line);
      +        return prompt.getInput(prop, callback);
      +      }
      +    }
      +        
      +    logger.input(line.yellow);
      +    callback(null, line);
      +  });
      +
      +  return prompt;
      +};

      function addProperties (obj, properties, callback)

      + +

      @obj {Object} Object to add properties to

      + +

      @properties {Array} List of properties to get values for

      + +

      @callback {function} Continuation to pass control to when complete.

      + +

      Prompts the user for values each of the properties if obj does not already +have a value for the property. Responds with the modified object.

      prompt.addProperties = function (obj, properties, callback) {
      +  properties = properties.filter(function (prop) {
      +    return typeof obj[prop] === 'undefined';
      +  });
      +  
      +  if (properties.length === 0) {
      +    return callback(obj);
      +  }
      +  
      +  prompt.get(properties, function (err, results) {
      +    if (err) {
      +      return callback(err);
      +    }
      +    else if (!results) {
      +      return callback(null, obj);
      +    }
      +    
      +    function putNested (obj, path, value) {
      +      var last = obj, key; 
      +      
      +      while (path.length > 1) {
      +        key = path.shift();
      +        if (!last[key]) {
      +          last[key] = {};
      +        }
      +        
      +        last = last[key];
      +      }
      +      
      +      last[path.shift()] = value;
      +    }
      +    
      +    Object.keys(results).forEach(function (key) {
      +      putNested(obj, key.split('.'), results[key]);
      +    });
      +    
      +    callback(null, obj);
      +  });
      +  
      +  return prompt;
      +};

      function readLine (callback)

      + +

      @callback {function} Continuation to respond to when complete

      + +

      Gets a single line of input from the user.

      prompt.readLine = function (callback) {
      +  var value = '', buffer = '';
      +  prompt.resume();
      +  stdin.setEncoding('utf8');
      +  stdin.on('error', callback);
      +  stdin.on('data', function data (chunk) {
      +    value += buffer + chunk;
      +    buffer = '';
      +    value = value.replace(/\r/g, '');
      +    if (value.indexOf('\n') !== -1) {
      +      if (value !== '\n') {
      +        value = value.replace(/^\n+/, '');
      +      }
      +      
      +      buffer = value.substr(value.indexOf('\n'));
      +      val = value.substr(0, value.indexOf('\n'));
      +      prompt.pause();
      +      stdin.removeListener('data', data);
      +      stdin.removeListener('error', callback);
      +      value = value.trim();
      +      callback(null, value);
      +    }
      +  });
      +  
      +  return prompt;
      +};

      function readLineHidden (callback)

      + +

      @callback {function} Continuation to respond to when complete

      + +

      Gets a single line of hidden input (i.e. rawMode = true) from the user.

      prompt.readLineHidden = function (callback) {
      +  var value = '', buffer = '';
      +  stdio.setRawMode(true);
      +  prompt.resume();
      +  stdin.on('error', callback);
      +  stdin.on('data', function data (c) {
      +    c = '' + c;
      +    switch (c) {
      +      case '\n': case '\r': case '\r\n': case '\u0004':
      +        stdio.setRawMode(false);
      +        stdin.removeListener('data', data);
      +        stdin.removeListener('error', callback);
      +        value = value.trim();
      +        stdout.write('\n');
      +        stdout.flush();
      +        prompt.pause();
      +        return callback(null, value)
      +      case '\u0003': case '\0':
      +        stdout.write('\n');
      +        process.exit(1);
      +        break;
      +      default:
      +        value += buffer + c
      +        buffer = '';
      +        break;
      +    }
      +  });
      +  
      +  return prompt;
      +};
      +
      +
      diff --git a/node_modules/prompt/examples/add-properties.js b/node_modules/prompt/examples/add-properties.js new file mode 100755 index 00000000..1a561760 --- /dev/null +++ b/node_modules/prompt/examples/add-properties.js @@ -0,0 +1,35 @@ +/* + * add-properties.js: Example of how to add properties to an object using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +var obj = { + password: 'lamepassword', + mindset: 'NY' +} + +// +// Log the initial object. +// +console.log('Initial object to be extended:'); +console.dir(obj); + +// +// Add two properties to the empty object: username and email +// +prompt.addProperties(obj, ['username', 'email'], function (err) { + // + // Log the results. + // + console.log('Updated object received:'); + console.dir(obj); +}); \ No newline at end of file diff --git a/node_modules/prompt/examples/color.js b/node_modules/prompt/examples/color.js new file mode 100755 index 00000000..7c631124 --- /dev/null +++ b/node_modules/prompt/examples/color.js @@ -0,0 +1,19 @@ +var prompt = require("../lib/prompt"); +var colors = require("colors/safe"); +// +// Setting these properties customizes the prompt. +// +prompt.message = colors.rainbow("Question!"); +prompt.delimiter = colors.green("><"); + +prompt.start(); + +prompt.get({ + properties: { + name: { + description: colors.magenta("What is your name?") + } + } +}, function (err, result) { + console.log(colors.cyan("You said your name is: " + result.name)); +}); diff --git a/node_modules/prompt/examples/dynamic-ask-prompt.js b/node_modules/prompt/examples/dynamic-ask-prompt.js new file mode 100755 index 00000000..194e1ef1 --- /dev/null +++ b/node_modules/prompt/examples/dynamic-ask-prompt.js @@ -0,0 +1,38 @@ +/* + * dynamic-ask-prompt.js: Dynamically decide whether to display prompt. + */ + +var prompt = require('../lib/prompt'); + +var schema = { + properties: { + proxy: { + description: 'Proxy url' + }, + proxyCredentials: { + description: 'Proxy credentials', + ask: function() { + // only ask for proxy credentials if a proxy was set + return prompt.history('proxy').value > 0; + } + } + } +}; + +// +// Start the prompt +// +prompt.start(); + +// +// Get one or two properties from the user, depending on +// what the user answered for proxy +// +prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' proxy: ' + result.proxy); + console.log(' credentials: ' + result.proxyCredentials); +}); diff --git a/node_modules/prompt/examples/existing-properties.js b/node_modules/prompt/examples/existing-properties.js new file mode 100755 index 00000000..d87503b1 --- /dev/null +++ b/node_modules/prompt/examples/existing-properties.js @@ -0,0 +1,35 @@ +/* + * existing-properties.js: Example of using prompt with predefined properties. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +prompt.properties = { + email: { + format: 'email', + message: 'Must be a valid email address' + }, + password: { + hidden: true + } +}; + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: email, password +// +prompt.get(['email', 'password'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' email: ' + result.email); + console.log(' password: ' + result.password); +}); diff --git a/node_modules/prompt/examples/history.js b/node_modules/prompt/examples/history.js new file mode 100755 index 00000000..fd4369da --- /dev/null +++ b/node_modules/prompt/examples/history.js @@ -0,0 +1,44 @@ +/* + * history.js: Example of using the prompt history capabilities. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +var properties = { + properties: { + animal: { + description: 'Enter an animal', + default: 'dog', + pattern: /dog|cat/ + }, + sound: { + description: 'What sound does this animal make?', + conform: function (value) { + var animal = prompt.history(0).value; + + return animal === 'dog' && value === 'woof' + || animal === 'cat' && value === 'meow'; + } + } + } +} + +// +// Get two properties from the user +// +prompt.get(properties, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' animal: ' + result.animal); + console.log(' sound: ' + result.sound); +}); diff --git a/node_modules/prompt/examples/nested-properties-prompt.js b/node_modules/prompt/examples/nested-properties-prompt.js new file mode 100755 index 00000000..25106a20 --- /dev/null +++ b/node_modules/prompt/examples/nested-properties-prompt.js @@ -0,0 +1,37 @@ +/* + * property-prompt.js: Example of using prompt with complex properties. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +var schema = { + properties: { + url: { + required: true, + format: 'url' + }, + auth: { + properties: { + username: { + required: true + }, + password: { + required: true, + hidden: true + } + } + } + } +}; + +prompt.start(); + +prompt.get(schema, function (err, result) { + console.log('Command-line input received:'); + console.log(' url: ' + result.url); + console.log(' auth:username: ' + result.auth.username); + console.log(' auth:password: ' + result.auth.password); +}); diff --git a/node_modules/prompt/examples/old-schema.js b/node_modules/prompt/examples/old-schema.js new file mode 100755 index 00000000..631b7b58 --- /dev/null +++ b/node_modules/prompt/examples/old-schema.js @@ -0,0 +1,36 @@ +/* + * simple-prompt.js: Simple example of using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and email +// +prompt.get([ + { + name: 'username', + validator: /^[a-z]+$/, + warning: 'Username should consist only lowercase alphabets', + empty: false + }, + { + name: 'email', + message: 'Email Address' + } +], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); +}); diff --git a/node_modules/prompt/examples/override-validation.js b/node_modules/prompt/examples/override-validation.js new file mode 100755 index 00000000..0ca9ddd9 --- /dev/null +++ b/node_modules/prompt/examples/override-validation.js @@ -0,0 +1,52 @@ +/* + * override-validation.js: Example of using prompt with complex properties and command-line input. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'), + optimist = require('optimist'); + +var schema = { + properties: { + name: { + pattern: /^[a-zA-Z\s-]+$/, + message: 'Name must be only letters, spaces, or dashes', + required: true + }, + email: { + name: 'email', + format: 'email', + message: 'Must be a valid email address' + } + } +}; + +// +// Set the overrides +// +prompt.override = optimist.argv + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: email, password +// +prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' name: ' + result.name); + console.log(' email: ' + result.email); +}); + +// try running +// $ node ./override-validation.js --name USER --email EMAIL +// You will only be asked for email because it's invalid +// $ node ./override-validation.js --name h$acker --email me@example.com +// You will only be asked for name becasue it's invalid diff --git a/node_modules/prompt/examples/password.js b/node_modules/prompt/examples/password.js new file mode 100755 index 00000000..e8015e68 --- /dev/null +++ b/node_modules/prompt/examples/password.js @@ -0,0 +1,42 @@ +/* + * password.js: Simple example of using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and password and password masked +// +prompt.get([{ + name: 'username', + required: true + }, { + name: 'password', + hidden: true, + conform: function (value) { + return true; + } + }, { + name: 'passwordMasked', + hidden: true, + replace: '*', + conform: function (value) { + return true; + } + }], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' password: ' + result.password); + console.log(' passwordMasked: ' + result.passwordMasked); +}); diff --git a/node_modules/prompt/examples/prompt-override.js b/node_modules/prompt/examples/prompt-override.js new file mode 100755 index 00000000..7f2848b3 --- /dev/null +++ b/node_modules/prompt/examples/prompt-override.js @@ -0,0 +1,36 @@ +var prompt = require('../lib/prompt'), + optimist; + +try { + optimist = require('optimist'); +} catch (err) { + throw new Error([ + 'You need to install optimist before this example will work!', + 'Try: `npm install optimist`.' + ].join('\n')); +} + +// +// Set the overrides +// +prompt.override = optimist.argv + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and email +// +prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); + prompt.pause(); +}) + +// $ node ./prompt-override.js --username USER --email EMAIL diff --git a/node_modules/prompt/examples/prompt-streamline._js b/node_modules/prompt/examples/prompt-streamline._js new file mode 100755 index 00000000..e7fef429 --- /dev/null +++ b/node_modules/prompt/examples/prompt-streamline._js @@ -0,0 +1,32 @@ +/* + * prompt-streamline._js: Example of how to use prompt with streamlinejs. + * + * calling syntax: _node prompt-streamline._js + * + */ +var prompt = require('../lib/prompt'); + +function getSampleData(){ + return [ + { + name: 'username', + message: 'Enter a username' + } + ]; +}; + +// +// Start the prompt +// +prompt.start(); + +function get_username_prompt(_){ + console.log(prompt.get(getSampleData(), _).username); +} + +get_username_prompt(_); + +// +// Clean the prompt +// +prompt.stop(); \ No newline at end of file diff --git a/node_modules/prompt/examples/property-prompt.js b/node_modules/prompt/examples/property-prompt.js new file mode 100755 index 00000000..c8b343b2 --- /dev/null +++ b/node_modules/prompt/examples/property-prompt.js @@ -0,0 +1,45 @@ +/* + * property-prompt.js: Example of using prompt with complex properties. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +var schema = { + properties: { + name: { + pattern: /^[a-zA-Z\s-]+$/, + message: 'Name must be only letters, spaces, or dashes', + required: true + }, + email: { + name: 'email', + format: 'email', + message: 'Must be a valid email address' + }, + password: { + required: true, + hidden: true + } + } +}; + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: email, password +// +prompt.get(schema, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' name: ' + result.name); + console.log(' email: ' + result.email); + console.log(' password: ' + result.password); +}); diff --git a/node_modules/prompt/examples/simple-prompt.js b/node_modules/prompt/examples/simple-prompt.js new file mode 100755 index 00000000..062e5299 --- /dev/null +++ b/node_modules/prompt/examples/simple-prompt.js @@ -0,0 +1,25 @@ +/* + * simple-prompt.js: Simple example of using prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +// +// Get two properties from the user: username and email +// +prompt.get(['username', 'email'], function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' username: ' + result.username); + console.log(' email: ' + result.email); +}); \ No newline at end of file diff --git a/node_modules/prompt/examples/types.js b/node_modules/prompt/examples/types.js new file mode 100755 index 00000000..83f45a62 --- /dev/null +++ b/node_modules/prompt/examples/types.js @@ -0,0 +1,20 @@ +var prompt = require('../lib/prompt'); + +prompt.start(); + +prompt.get([{ + name: 'integer', + type: 'integer', + required: true + }, { + name: 'number', + type: 'number', + required: true + }, { + name: 'boolean', + type: 'boolean', + required: true + }], function (err, result) { + console.log('Input received:'); + console.log(JSON.stringify(result, null, 2)); +}); diff --git a/node_modules/prompt/examples/yes-or-no-prompt.js b/node_modules/prompt/examples/yes-or-no-prompt.js new file mode 100755 index 00000000..512b5560 --- /dev/null +++ b/node_modules/prompt/examples/yes-or-no-prompt.js @@ -0,0 +1,32 @@ +/* + * yes-or-no-prompt.js: Simple example of using prompt. + * + * (C) 2012, Nodejitsu Inc. + * + */ + +var prompt = require('../lib/prompt'); + +// +// Start the prompt +// +prompt.start(); + +var property = { + name: 'yesno', + message: 'are you sure?', + validator: /y[es]*|n[o]?/, + warning: 'Must respond yes or no', + default: 'no' +}; + +// +// Get the simple yes or no property +// +prompt.get(property, function (err, result) { + // + // Log the results. + // + console.log('Command-line input received:'); + console.log(' result: ' + result.yesno); +}); \ No newline at end of file diff --git a/node_modules/prompt/lib/prompt.js b/node_modules/prompt/lib/prompt.js new file mode 100755 index 00000000..78aeda21 --- /dev/null +++ b/node_modules/prompt/lib/prompt.js @@ -0,0 +1,783 @@ +/* + * prompt.js: Simple prompt for prompting information from the command line + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var events = require('events'), + readline = require('readline'), + utile = require('utile'), + async = utile.async, + read = require('read'), + validate = require('revalidator').validate, + winston = require('winston'), + colors = require('colors/safe'); + +// +// Monkey-punch readline.Interface to work-around +// https://github.com/joyent/node/issues/3860 +// +readline.Interface.prototype.setPrompt = function(prompt, length) { + this._prompt = prompt; + if (length) { + this._promptLength = length; + } else { + var lines = prompt.split(/[\r\n]/); + var lastLine = lines[lines.length - 1]; + this._promptLength = lastLine.replace(/\u001b\[(\d+(;\d+)*)?m/g, '').length; + } +}; + +// +// Expose version using `pkginfo` +// +require('pkginfo')(module, 'version'); + +var stdin, stdout, history = []; +var prompt = module.exports = Object.create(events.EventEmitter.prototype); +var logger = prompt.logger = new winston.Logger({ + transports: [new (winston.transports.Console)()] +}); + +prompt.started = false; +prompt.paused = false; +prompt.stopped = true; +prompt.allowEmpty = false; +prompt.message = 'prompt'; +prompt.delimiter = ': '; +prompt.colors = true; + +// +// Create an empty object for the properties +// known to `prompt` +// +prompt.properties = {}; + +// +// Setup the default winston logger to use +// the `cli` levels and colors. +// +logger.cli(); + +// +// ### function start (options) +// #### @options {Object} **Optional** Options to consume by prompt +// Starts the prompt by listening to the appropriate events on `options.stdin` +// and `options.stdout`. If no streams are supplied, then `process.stdin` +// and `process.stdout` are used, respectively. +// +prompt.start = function (options) { + if (prompt.started) { + return; + } + + options = options || {}; + stdin = options.stdin || process.stdin; + stdout = options.stdout || process.stdout; + + // + // By default: Remember the last `10` prompt property / + // answer pairs and don't allow empty responses globally. + // + prompt.memory = options.memory || 10; + prompt.allowEmpty = options.allowEmpty || false; + prompt.message = options.message || prompt.message; + prompt.delimiter = options.delimiter || prompt.delimiter; + prompt.colors = options.colors || prompt.colors; + + if (process.platform !== 'win32') { + // windows falls apart trying to deal with SIGINT + process.on('SIGINT', function () { + stdout.write('\n'); + process.exit(1); + }); + } + + prompt.emit('start'); + prompt.started = true; + prompt.stopped = false; + return prompt; +}; + +// +// ### function pause () +// Pauses input coming in from stdin +// +prompt.pause = function () { + if (!prompt.started || prompt.stopped || prompt.paused) { + return; + } + + stdin.pause(); + prompt.emit('pause'); + prompt.paused = true; + return prompt; +}; + +// +// ### function stop () +// Stops input coming in from stdin +// +prompt.stop = function () { + if (prompt.stopped || !prompt.started) { + return; + } + + stdin.destroy(); + prompt.emit('stop'); + prompt.stopped = true; + prompt.started = false; + prompt.paused = false; + return prompt; +} + +// +// ### function resume () +// Resumes input coming in from stdin +// +prompt.resume = function () { + if (!prompt.started || !prompt.paused) { + return; + } + + stdin.resume(); + prompt.emit('resume'); + prompt.paused = false; + return prompt; +}; + +// +// ### function history (search) +// #### @search {Number|string} Index or property name to find. +// Returns the `property:value` pair from within the prompts +// `history` array. +// +prompt.history = function (search) { + if (typeof search === 'number') { + return history[search] || {}; + } + + var names = history.map(function (pair) { + return typeof pair.property === 'string' + ? pair.property + : pair.property.name; + }); + + if (!~names.indexOf(search)) { + return null; + } + + return history.filter(function (pair) { + return typeof pair.property === 'string' + ? pair.property === search + : pair.property.name === search; + })[0]; +}; + +// +// ### function get (schema, callback) +// #### @schema {Array|Object|string} Set of variables to get input for. +// #### @callback {function} Continuation to pass control to when complete. +// Gets input from the user via stdin for the specified message(s) `msg`. +// +prompt.get = function (schema, callback) { + // + // Transforms a full JSON-schema into an array describing path and sub-schemas. + // Used for iteration purposes. + // + function untangle(schema, path) { + var results = []; + path = path || []; + + if (schema.properties) { + // + // Iterate over the properties in the schema and use recursion + // to process sub-properties. + // + Object.keys(schema.properties).forEach(function (key) { + var obj = {}; + obj[key] = schema.properties[key]; + + // + // Concat a sub-untangling to the results. + // + results = results.concat(untangle(obj[key], path.concat(key))); + }); + + // Return the results. + return results; + } + + // + // This is a schema "leaf". + // + return { + path: path, + schema: schema + }; + } + + // + // Iterate over the values in the schema, represented as + // a legit single-property object subschemas. Accepts `schema` + // of the forms: + // + // 'prop-name' + // + // ['string-name', { path: ['or-well-formed-subschema'], properties: ... }] + // + // { path: ['or-well-formed-subschema'], properties: ... ] } + // + // { properties: { 'schema-with-no-path' } } + // + // And transforms them all into + // + // { path: ['path', 'to', 'property'], properties: { path: { to: ...} } } + // + function iterate(schema, get, done) { + var iterator = [], + result = {}; + + if (typeof schema === 'string') { + // + // We can iterate over a single string. + // + iterator.push({ + path: [schema], + schema: prompt.properties[schema.toLowerCase()] || {} + }); + } + else if (Array.isArray(schema)) { + // + // An array of strings and/or single-prop schema and/or no-prop schema. + // + iterator = schema.map(function (element) { + if (typeof element === 'string') { + return { + path: [element], + schema: prompt.properties[element.toLowerCase()] || {} + }; + } + else if (element.properties) { + return { + path: [Object.keys(element.properties)[0]], + schema: element.properties[Object.keys(element.properties)[0]] + }; + } + else if (element.path && element.schema) { + return element; + } + else { + return { + path: [element.name || 'question'], + schema: element + }; + } + }); + } + else if (schema.properties) { + // + // Or a complete schema `untangle` it for use. + // + iterator = untangle(schema); + } + else { + // + // Or a partial schema and path. + // TODO: Evaluate need for this option. + // + iterator = [{ + schema: schema.schema ? schema.schema : schema, + path: schema.path || [schema.name || 'question'] + }]; + } + + // + // Now, iterate and assemble the result. + // + async.forEachSeries(iterator, function (branch, next) { + get(branch, function assembler(err, line) { + if (err) { + return next(err); + } + + function build(path, line) { + var obj = {}; + if (path.length) { + obj[path[0]] = build(path.slice(1), line); + return obj; + } + + return line; + } + + function attach(obj, attr) { + var keys; + if (typeof attr !== 'object' || attr instanceof Array) { + return attr; + } + + keys = Object.keys(attr); + if (keys.length) { + if (!obj[keys[0]]) { + obj[keys[0]] = {}; + } + obj[keys[0]] = attach(obj[keys[0]], attr[keys[0]]); + } + + return obj; + } + + result = attach(result, build(branch.path, line)); + next(); + }); + }, function (err) { + return err ? done(err) : done(null, result); + }); + } + + iterate(schema, function get(target, next) { + prompt.getInput(target, function (err, line) { + return err ? next(err) : next(null, line); + }); + }, callback); + + return prompt; +}; + +// +// ### function confirm (msg, callback) +// #### @msg {Array|Object|string} set of message to confirm +// #### @callback {function} Continuation to pass control to when complete. +// Confirms a single or series of messages by prompting the user for a Y/N response. +// Returns `true` if ALL messages are answered in the affirmative, otherwise `false` +// +// `msg` can be a string, or object (or array of strings/objects). +// An object may have the following properties: +// +// { +// description: 'yes/no' // message to prompt user +// pattern: /^[yntf]{1}/i // optional - regex defining acceptable responses +// yes: /^[yt]{1}/i // optional - regex defining `affirmative` responses +// message: 'yes/no' // optional - message to display for invalid responses +// } +// +prompt.confirm = function (/* msg, options, callback */) { + var args = Array.prototype.slice.call(arguments), + msg = args.shift(), + callback = args.pop(), + opts = args.shift(), + vars = !Array.isArray(msg) ? [msg] : msg, + RX_Y = /^[yt]{1}/i, + RX_YN = /^[yntf]{1}/i; + + function confirm(target, next) { + var yes = target.yes || RX_Y, + options = utile.mixin({ + description: typeof target === 'string' ? target : target.description||'yes/no', + pattern: target.pattern || RX_YN, + name: 'confirm', + message: target.message || 'yes/no' + }, opts || {}); + + + prompt.get([options], function (err, result) { + next(err ? false : yes.test(result[options.name])); + }); + } + + async.rejectSeries(vars, confirm, function(result) { + callback(null, result.length===0); + }); +}; + + +// Variables needed outside of getInput for multiline arrays. +var tmp = []; + + +// ### function getInput (prop, callback) +// #### @prop {Object|string} Variable to get input for. +// #### @callback {function} Continuation to pass control to when complete. +// Gets input from the user via stdin for the specified message `msg`. +// +prompt.getInput = function (prop, callback) { + var schema = prop.schema || prop, + propName = prop.path && prop.path.join(':') || prop, + storedSchema = prompt.properties[propName.toLowerCase()], + delim = prompt.delimiter, + defaultLine, + against, + hidden, + length, + valid, + name, + raw, + msg; + + // + // If there is a stored schema for `propName` in `propmpt.properties` + // then use it. + // + if (schema instanceof Object && !Object.keys(schema).length && + typeof storedSchema !== 'undefined') { + schema = storedSchema; + } + + // + // Build a proper validation schema if we just have a string + // and no `storedSchema`. + // + if (typeof prop === 'string' && !storedSchema) { + schema = {}; + } + + schema = convert(schema); + defaultLine = schema.default; + name = prop.description || schema.description || propName; + raw = prompt.colors + ? [colors.grey(name), colors.grey(delim)] + : [name, delim]; + + if (prompt.message) + raw.unshift(prompt.message, delim); + + prop = { + schema: schema, + path: propName.split(':') + }; + + // + // If the schema has no `properties` value then set + // it to an object containing the current schema + // for `propName`. + // + if (!schema.properties) { + schema = (function () { + var obj = { properties: {} }; + obj.properties[propName] = schema; + return obj; + })(); + } + + // + // Handle overrides here. + // TODO: Make overrides nestable + // + if (prompt.override && prompt.override[propName]) { + if (prompt._performValidation(name, prop, prompt.override, schema, -1, callback)) { + return callback(null, prompt.override[propName]); + } + + delete prompt.override[propName]; + } + + // + // Check if we should skip this prompt + // + if (typeof prop.schema.ask === 'function' && + !prop.schema.ask()) { + return callback(null, prop.schema.default || ''); + } + + var type = (schema.properties && schema.properties[propName] && + schema.properties[propName].type || '').toLowerCase().trim(), + wait = type === 'array'; + + if (type === 'array') { + length = prop.schema.maxItems; + if (length) { + msg = (tmp.length + 1).toString() + '/' + length.toString(); + } + else { + msg = (tmp.length + 1).toString(); + } + msg += delim; + raw.push(prompt.colors ? msg.grey : msg); + } + + // + // Calculate the raw length and colorize the prompt + // + length = raw.join('').length; + raw[0] = raw[0]; + msg = raw.join(''); + + if (schema.help) { + schema.help.forEach(function (line) { + logger.help(line); + }); + } + + // + // Emit a "prompting" event + // + prompt.emit('prompt', prop); + + // + // If there is no default line, set it to an empty string + // + if(typeof defaultLine === 'undefined') { + defaultLine = ''; + } + + // + // set to string for readline ( will not accept Numbers ) + // + defaultLine = defaultLine.toString(); + + // + // Make the actual read + // + read({ + prompt: msg, + silent: prop.schema && prop.schema.hidden, + replace: prop.schema && prop.schema.replace, + default: defaultLine, + input: stdin, + output: stdout + }, function (err, line) { + if (err && wait === false) { + return callback(err); + } + + var against = {}, + numericInput, + isValid; + + if (line !== '') { + + if (schema.properties[propName]) { + var type = (schema.properties[propName].type || '').toLowerCase().trim() || undefined; + + // + // If type is some sort of numeric create a Number object to pass to revalidator + // + if (type === 'number' || type === 'integer') { + line = Number(line); + } + + // + // Attempt to parse input as a boolean if the schema expects a boolean + // + if (type == 'boolean') { + if(line.toLowerCase() === "true" || line.toLowerCase() === 't') { + line = true; + } else if(line.toLowerCase() === "false" || line.toLowerCase() === 'f') { + line = false; + } + } + + // + // If the type is an array, wait for the end. Fixes #54 + // + if (type == 'array') { + var length = prop.schema.maxItems; + if (err) { + if (err.message == 'canceled') { + wait = false; + stdout.write('\n'); + } + } + else { + if (length) { + if (tmp.length + 1 < length) { + isValid = false; + wait = true; + } + else { + isValid = true; + wait = false; + } + } + else { + isValid = false; + wait = true; + } + tmp.push(line); + } + line = tmp; + } + } + + against[propName] = line; + } + + if (prop && prop.schema.before) { + line = prop.schema.before(line); + } + + // Validate + if (isValid === undefined) isValid = prompt._performValidation(name, prop, against, schema, line, callback); + + if (!isValid) { + return prompt.getInput(prop, callback); + } + + // + // Log the resulting line, append this `property:value` + // pair to the history for `prompt` and respond to + // the callback. + // + logger.input(line.yellow); + prompt._remember(propName, line); + callback(null, line); + + // Make sure `tmp` is emptied + tmp = []; + }); +}; + +// +// ### function performValidation (name, prop, against, schema, line, callback) +// #### @name {Object} Variable name +// #### @prop {Object|string} Variable to get input for. +// #### @against {Object} Input +// #### @schema {Object} Validation schema +// #### @line {String|Boolean} Input line +// #### @callback {function} Continuation to pass control to when complete. +// Perfoms user input validation, print errors if needed and returns value according to validation +// +prompt._performValidation = function (name, prop, against, schema, line, callback) { + var numericInput, valid, msg; + try { + valid = validate(against, schema); + } + catch (err) { + return (line !== -1) ? callback(err) : false; + } + + if (!valid.valid) { + if (prop.schema.message) { + logger.error(prop.schema.message); + } else { + msg = line !== -1 ? 'Invalid input for ' : 'Invalid command-line input for '; + + if (prompt.colors) { + logger.error(msg + name.grey); + } + else { + logger.error(msg + name); + } + } + + prompt.emit('invalid', prop, line); + } + + return valid.valid; +}; + +// +// ### function addProperties (obj, properties, callback) +// #### @obj {Object} Object to add properties to +// #### @properties {Array} List of properties to get values for +// #### @callback {function} Continuation to pass control to when complete. +// Prompts the user for values each of the `properties` if `obj` does not already +// have a value for the property. Responds with the modified object. +// +prompt.addProperties = function (obj, properties, callback) { + properties = properties.filter(function (prop) { + return typeof obj[prop] === 'undefined'; + }); + + if (properties.length === 0) { + return callback(obj); + } + + prompt.get(properties, function (err, results) { + if (err) { + return callback(err); + } + else if (!results) { + return callback(null, obj); + } + + function putNested (obj, path, value) { + var last = obj, key; + + while (path.length > 1) { + key = path.shift(); + if (!last[key]) { + last[key] = {}; + } + + last = last[key]; + } + + last[path.shift()] = value; + } + + Object.keys(results).forEach(function (key) { + putNested(obj, key.split('.'), results[key]); + }); + + callback(null, obj); + }); + + return prompt; +}; + +// +// ### @private function _remember (property, value) +// #### @property {Object|string} Property that the value is in response to. +// #### @value {string} User input captured by `prompt`. +// Prepends the `property:value` pair into the private `history` Array +// for `prompt` so that it can be accessed later. +// +prompt._remember = function (property, value) { + history.unshift({ + property: property, + value: value + }); + + // + // If the length of the `history` Array + // has exceeded the specified length to remember, + // `prompt.memory`, truncate it. + // + if (history.length > prompt.memory) { + history.splice(prompt.memory, history.length - prompt.memory); + } +}; + +// +// ### @private function convert (schema) +// #### @schema {Object} Schema for a property +// Converts the schema into new format if it is in old format +// +function convert(schema) { + var newProps = Object.keys(validate.messages), + newSchema = false, + key; + + newProps = newProps.concat(['description', 'dependencies']); + + for (key in schema) { + if (newProps.indexOf(key) > 0) { + newSchema = true; + break; + } + } + + if (!newSchema || schema.validator || schema.warning || typeof schema.empty !== 'undefined') { + schema.description = schema.message; + schema.message = schema.warning; + + if (typeof schema.validator === 'function') { + schema.conform = schema.validator; + } else { + schema.pattern = schema.validator; + } + + if (typeof schema.empty !== 'undefined') { + schema.required = !(schema.empty); + } + + delete schema.warning; + delete schema.validator; + delete schema.empty; + } + + return schema; +} diff --git a/node_modules/prompt/package.json b/node_modules/prompt/package.json new file mode 100755 index 00000000..96732c34 --- /dev/null +++ b/node_modules/prompt/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "prompt@1.0.0", + "scope": null, + "escapedName": "prompt", + "name": "prompt", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gh-pages-deploy" + ] + ], + "_from": "prompt@1.0.0", + "_id": "prompt@1.0.0", + "_inCache": true, + "_location": "/prompt", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/prompt-1.0.0.tgz_1455093788545_0.33723675599321723" + }, + "_npmUser": { + "name": "indexzero", + "email": "charlie.robbins@gmail.com" + }, + "_npmVersion": "2.14.1", + "_phantomChildren": {}, + "_requested": { + "raw": "prompt@1.0.0", + "scope": null, + "escapedName": "prompt", + "name": "prompt", + "rawSpec": "1.0.0", + "spec": "1.0.0", + "type": "version" + }, + "_requiredBy": [ + "/gh-pages-deploy" + ], + "_resolved": "https://registry.npmjs.org/prompt/-/prompt-1.0.0.tgz", + "_shasum": "8e57123c396ab988897fb327fd3aedc3e735e4fe", + "_shrinkwrap": null, + "_spec": "prompt@1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gh-pages-deploy", + "author": { + "name": "Nodejitsu Inc.", + "email": "info@nodejitsu.com" + }, + "bugs": { + "url": "https://github.com/flatiron/prompt/issues" + }, + "dependencies": { + "colors": "^1.1.2", + "pkginfo": "0.x.x", + "read": "1.0.x", + "revalidator": "0.1.x", + "utile": "0.3.x", + "winston": "2.1.x" + }, + "description": "A beautiful command-line prompt for node.js", + "devDependencies": { + "vows": "0.7.0" + }, + "directories": {}, + "dist": { + "shasum": "8e57123c396ab988897fb327fd3aedc3e735e4fe", + "tarball": "https://registry.npmjs.org/prompt/-/prompt-1.0.0.tgz" + }, + "engines": { + "node": ">= 0.6.6" + }, + "gitHead": "11f2a2b5123a55c5edd9f11e07f4190e6cf61907", + "homepage": "https://github.com/flatiron/prompt#readme", + "license": "MIT", + "main": "./lib/prompt", + "maintainers": [ + { + "name": "indexzero", + "email": "charlie.robbins@gmail.com" + }, + { + "name": "fedor.indutny", + "email": "fedor.indutny@gmail.com" + }, + { + "name": "jcrugzz", + "email": "jcrugzz@gmail.com" + } + ], + "name": "prompt", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/flatiron/prompt.git" + }, + "scripts": { + "test": "vows test/prompt-test.js --spec", + "test-all": "vows --spec" + }, + "version": "1.0.0" +} diff --git a/node_modules/prompt/test/helpers.js b/node_modules/prompt/test/helpers.js new file mode 100755 index 00000000..b21021f7 --- /dev/null +++ b/node_modules/prompt/test/helpers.js @@ -0,0 +1,161 @@ +/* + * helpers.js: test helpers for the prompt tests. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var stream = require('stream'), + util = require('util'), + prompt = require('../lib/prompt'); + +var helpers = exports; + +var MockReadWriteStream = helpers.MockReadWriteStream = function () { + // + // No need to do anything here, it's just a mock. + // + var self = this; + this.on('pipe', function (src) { + var _emit = src.emit; + src.emit = function () { + //console.dir(arguments); + _emit.apply(src, arguments); + }; + + src.on('data', function (d) { + self.emit('data', d + ''); + }) + }) +}; + +util.inherits(MockReadWriteStream, stream.Stream); + +['resume', 'pause', 'setEncoding', 'flush', 'end'].forEach(function (method) { + MockReadWriteStream.prototype[method] = function () { /* Mock */ }; +}); + +MockReadWriteStream.prototype.write = function (msg) { + this.emit('data', msg); + return true; +}; + +MockReadWriteStream.prototype.writeNextTick = function (msg) { + var self = this + process.nextTick(function () { + self.write(msg); + }); +}; + +// +// Create some mock streams for asserting against +// in our prompt teSts. +// +helpers.stdin = new MockReadWriteStream(); +helpers.stdout = new MockReadWriteStream(); +helpers.stderr = new MockReadWriteStream(); + +// +// Because `read` uses a `process.nextTick` for reading from +// stdin, it is necessary to write sequences of input with extra +// `process.nextTick` calls +// +helpers.stdin.writeSequence = function (lines) { + if (!lines || !lines.length) { + return; + } + + helpers.stdin.writeNextTick(lines.shift()); + prompt.once('prompt', function () { + process.nextTick(function () { + helpers.stdin.writeSequence(lines); + }); + }); +} + +// +// Monkey punch `util.error` to silence console output +// and redirect to helpers.stderr for testing. +// +process.stderr.write = function () { + helpers.stderr.write.apply(helpers.stderr, arguments); +} + +// 1) .properties +// 2) warning --> message +// 3) Name --> description || key +// 4) validator --> conform (fxns), pattern (regexp), format (built-in) +// 5) empty --> required +helpers.schema = { + properties: { + oldschema: { + message: 'Enter your username', + validator: /^[\w|\-]+$/, + warning: 'username can only be letters, numbers, and dashes', + empty: false + }, + riffwabbles: { + pattern: /^[\w|\-]+$/, + message: 'riffwabbles can only be letters, numbers, and dashes', + default: 'foobizzles' + }, + number: { + type: 'number', + message: 'pick a number, any number', + default: 10 + }, + integer: { + type: 'integer' + }, + boolean: { + type: 'boolean' + }, + username: { + pattern: /^[\w|\-]+$/, + message: 'Username can only be letters, numbers, and dashes' + }, + notblank: { + required: true + }, + password: { + hidden: true, + required: true + }, + badValidator: { + pattern: ['cant', 'use', 'array'] + }, + animal: { + description: 'Enter an animal', + default: 'dog', + pattern: /dog|cat/ + }, + sound: { + description: 'What sound does this animal make?', + conform: function (value) { + var animal = prompt.history(0).value; + + return animal === 'dog' && value === 'woof' + || animal === 'cat' && value === 'meow'; + } + }, + fnvalidator: { + name: 'fnvalidator', + validator: function (line) { + return line.slice(0,2) == 'fn'; + }, + message: 'fnvalidator must start with "fn"' + }, + fnconform: { + conform: function (line) { + return line.slice(0,2) == 'fn'; + }, + message: 'fnconform must start with "fn"' + }/*, + cbvalidator: { + conform: function (line, next) { + next(line.slice(0,2) == 'cb'); + }, + message: 'cbvalidator must start with "cb"' + }*/ + } +}; diff --git a/node_modules/prompt/test/interactive-prompt-test.js b/node_modules/prompt/test/interactive-prompt-test.js new file mode 100755 index 00000000..a3032e3c --- /dev/null +++ b/node_modules/prompt/test/interactive-prompt-test.js @@ -0,0 +1,49 @@ +/* + * prompt-test.js: Tests for prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var assert = require('assert'), + vows = require('vows'), + prompt = require('../lib/prompt'), + winston = require('winston').cli(), + helpers = require('./helpers'); + +vows.describe('prompt/interactive').addBatch({ + "When using prompt": { + topic: function () { + // + // Reset the prompt for interactive testing + // + prompt.started = false; + prompt.start(); + winston.info('These prompt tests are interactive'); + winston.info('Not following instructions will result in test failure'); + return null; + }, + "the getInput() method": { + "when passed a complex property with `hidden: true`": { + topic: function () { + winston.info('When prompted, enter: 12345 [backspace] [backspace] [enter]'); + prompt.getInput({ path: ['password'], schema: helpers.schema.properties.password }, this.callback); + }, + "should respond with `123`": function (err, result) { + assert.isNull(err); + assert.equal(result, '123'); + }, + "and then when passed a complex property expecting a number": { + topic: function () { + winston.info('When prompted, enter: 123 [enter]'); + prompt.getInput({ path: ['number'], schema: helpers.schema.properties.number }, this.callback); + }, + "should respond with `123` (as a number)": function (err, result) { + assert.isNull(err); + assert.equal(result, 123); + } + } + } + } + } +}).export(module); diff --git a/node_modules/prompt/test/macros.js b/node_modules/prompt/test/macros.js new file mode 100755 index 00000000..9f58f082 --- /dev/null +++ b/node_modules/prompt/test/macros.js @@ -0,0 +1,82 @@ +/* + * macros.js: Test macros for prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var assert = require('assert'), + helpers = require('./helpers'), + prompt = require('../lib/prompt'); + +exports.shouldConfirm = function (options, mixin) { + var message = options.response.toString().replace(/\n/g, ''), + messages = ["When using prompt", "the confirm() method"], + context = {}, + last = context; + + messages = messages.concat(options.messages || []); + + while (messages.length) { + var text = messages.shift(); + last[text] = {}; + last = last[text]; + } + + last['responding with ' + message] = { + topic: function () { + if(!mixin) + prompt.confirm(options.prop, this.callback); + else + prompt.confirm(options.prop, mixin, this.callback); + + if (!Array.isArray(options.response)) { + helpers.stdin.writeNextTick(options.response + '\n'); + } + else { + helpers.stdin.writeSequence(options.response); + } + }, + "should respond with true" : function(err, result) { + assert.isNull(err); + assert.isTrue(result); + } + } + + return context; +}; + +exports.shouldNotConfirm = function (options) { + var message = options.response.toString().replace(/\n/g, ''), + messages = ["When using prompt", "the confirm() method"], + context = {}, + last = context; + + messages = messages.concat(options.messages || []); + + while (messages.length) { + var text = messages.shift(); + last[text] = {}; + last = last[text]; + } + + last['responding with ' + message] = { + topic: function () { + prompt.confirm(options.prop, this.callback); + + if (!Array.isArray(options.response)) { + helpers.stdin.writeNextTick(options.response + '\n'); + } + else { + helpers.stdin.writeSequence(options.response); + } + }, + "should respond with false" : function(err, result) { + assert.isNull(err); + assert.isFalse(result); + } + }; + + return context; +}; + diff --git a/node_modules/prompt/test/prompt-test.js b/node_modules/prompt/test/prompt-test.js new file mode 100755 index 00000000..2be73bcd --- /dev/null +++ b/node_modules/prompt/test/prompt-test.js @@ -0,0 +1,817 @@ +/* + * prompt-test.js: Tests for prompt. + * + * (C) 2010, Nodejitsu Inc. + * + */ + +var assert = require('assert'), + vows = require('vows'), + prompt = require('../lib/prompt'), + helpers = require('./helpers'), + macros = require('./macros'), + schema = helpers.schema; + +// A helper to pass fragments of our schema into prompt as full schemas. +function grab () { + var names = [].slice.call(arguments), + complete = { schema: {} }; + + names.forEach(function (name) { + complete.path = [name], + complete.schema = schema.properties[name]; + }); + return complete; +}; + +// +// Reset the prompt for mock testing +// +prompt.started = false; +prompt.start({ + stdin: helpers.stdin, + stdout: helpers.stdout +}); + +vows.describe('prompt').addBatch({ + "When using prompt": { + "the getInput() method": { + "with a simple string prompt": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }) + + prompt.getInput('test input', this.callback); + helpers.stdin.writeNextTick('test value\n'); + }, + "should prompt to stdout and respond with data": function (err, input) { + assert.isNull(err); + assert.equal(input, 'test value'); + assert.isTrue(this.msg.indexOf('test input') !== -1); + } + }, + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with any field that is not supposed to be empty": { + "and we don't provide any input": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + helpers.stderr.once('data', function (msg) { + that.errmsg = msg; + }); + + prompt.getInput(grab('notblank'), function () {}); + prompt.once('invalid', this.callback.bind(null, null)) + helpers.stdin.writeNextTick('\n'); + }, + "should prompt with an error": function (_, prop, input) { + assert.isObject(prop); + assert.equal(input, ''); + assert.isTrue(this.errmsg.indexOf('Invalid input') !== -1); + assert.isTrue(this.msg.indexOf('notblank') !== -1); + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with a hidden field that is not supposed to be empty": { + "and we provide valid input": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.getInput('password', this.callback); + helpers.stdin.writeNextTick('trustno1\n'); + }, + + "should prompt to stdout and respond with data": function (err, input) { + assert.isNull(err); + assert.equal(input, 'trustno1'); + assert.isTrue(this.msg.indexOf('password') !== -1); + } + }, + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with a hidden field that is not supposed to be empty": { + "and we don't provide an input": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + helpers.stderr.once('data', function (msg) { + that.errmsg = msg; + }); + + prompt.getInput(grab('password'), function () {} ); + prompt.once('invalid', this.callback.bind(null, null)) + helpers.stdin.writeNextTick('\n'); + }, + "should prompt with an error": function (ign, prop, input) { + assert.isObject(prop); + assert.equal(input, ''); + assert.isTrue(this.errmsg.indexOf('Invalid input') !== -1); + assert.isTrue(this.msg.indexOf('password') !== -1); + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with an integer field": { + "and we provide valid input": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.getInput(grab('integer'), this.callback); + helpers.stdin.writeNextTick('42\n'); + }, + "should prompt to stdout and respond with data": function (err, input) { + assert.isNull(err); + assert.equal(input, '42'); + assert.isTrue(this.msg.indexOf('integer') !== -1); + } + }, + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with an integer field": { + "and we don't provide an integer": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + helpers.stderr.once('data', function (msg) { + that.errmsg = msg; + }) + + prompt.getInput(grab('integer'), this.callback); + + prompt.once('invalid', function () { + prompt.once('prompt', function () { + process.nextTick(function () { + helpers.stdin.writeNextTick('42\n'); + }) + }) + }); + + helpers.stdin.writeNextTick('4.2\n'); + }, + "should prompt with an error before completing the operation": function (err, input) { + assert.isNull(err); + assert.equal(input, '42'); + assert.isTrue(this.errmsg.indexOf('Invalid input') !== -1); + assert.isTrue(this.msg.indexOf('integer') !== -1); + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with a boolean field": { + "and we provide valid input": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.getInput(grab('boolean'), this.callback); + helpers.stdin.writeNextTick('true\n'); + }, + "should prompt to stdout and respond with data": function (err, input) { + assert.isNull(err); + assert.equal(input, true); + assert.isTrue(this.msg.indexOf('boolean') !== -1); + } + }, + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with a boolean field": { + "and we don't provide an bool": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + helpers.stderr.once('data', function (msg) { + that.errmsg = msg; + }) + + prompt.getInput(grab('boolean'), this.callback); + + prompt.once('invalid', function () { + prompt.once('prompt', function () { + process.nextTick(function () { + helpers.stdin.writeNextTick('F\n'); + }) + }) + }); + + helpers.stdin.writeNextTick('4.2\n'); + }, + "should prompt with an error before completing the operation": function (err, input) { + assert.isNull(err); + assert.equal(input, false); + assert.isTrue(this.errmsg.indexOf('Invalid input') !== -1); + assert.isTrue(this.msg.indexOf('boolean') !== -1); + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with a complex property prompt": { + "and a valid input": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.getInput(grab('username'), this.callback); + helpers.stdin.writeNextTick('some-user\n'); + }, + "should prompt to stdout and respond with data": function (err, input) { + assert.isNull(err); + assert.equal(input, 'some-user'); + assert.isTrue(this.msg.indexOf('username') !== -1); + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with a complex property prompt": { + "and an invalid input": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + helpers.stderr.once('data', function (msg) { + that.errmsg = msg; + }) + + prompt.getInput(grab('username'), this.callback); + + prompt.once('invalid', function () { + prompt.once('prompt', function () { + process.nextTick(function () { + helpers.stdin.writeNextTick('some-user\n'); + }) + }) + }); + + helpers.stdin.writeNextTick('some -user\n'); + }, + "should prompt with an error before completing the operation": function (err, input) { + assert.isNull(err); + assert.equal(input, 'some-user'); + assert.isTrue(this.errmsg.indexOf('Username can only be letters, numbers, and dashes') !== -1); + assert.isTrue(this.msg.indexOf('username') !== -1); + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the getInput() method": { + "with a complex property prompt": { + "with an invalid validator (array)": { + topic: function () { + var that = this, + called; + + prompt.getInput(grab('badValidator'), function (err) { + if (!called) { + called = true; + that.callback(err); + } + }); + helpers.stdin.writeNextTick('some-user\n'); + }, + "should respond with an error": function (err, ign) { + assert.isTrue(!!err); + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "with a simple string prompt": { + "that is not a property in prompt.properties": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }) + + prompt.get('test input', this.callback); + helpers.stdin.writeNextTick('test value\n'); + }, + "should prompt to stdout and respond with the value": function (err, result) { + assert.isNull(err); + assert.include(result, 'test input'); + assert.equal(result['test input'], 'test value'); + assert.isTrue(this.msg.indexOf('test input') !== -1); + } + }, + } + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "with a simple string prompt": { + "that is a property name in prompt.properties": { + "with a default value": { + topic: function () { + var that = this; + + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.properties.riffwabbles = schema.properties.riffwabbles; + prompt.get('riffwabbles', this.callback); + helpers.stdin.writeNextTick('\n'); + }, + "should prompt to stdout and respond with the default value": function (err, result) { + assert.isNull(err); + assert.isTrue(this.msg.indexOf('riffwabbles') !== -1); + assert.isTrue(this.msg.indexOf('(foobizzles)') !== -1); + assert.include(result, 'riffwabbles'); + assert.equal(result['riffwabbles'], schema.properties['riffwabbles'].default); + } + }, + } + } + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "with a simple string prompt": { + "that is a property name in prompt.properties": { + "that expects a numeric value": { + "and gets valid input": { + topic: function () { + var that = this; + + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.properties.number = schema.properties.number; + prompt.get('number', this.callback); + helpers.stdin.writeNextTick('15\n'); + }, + "should prompt to stdout and respond with a numeric value": function (err, result) { + assert.isNull(err); + assert.include(result, 'number'); + assert.equal(result['number'], 15); + } + } + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "with a simple string prompt": { + "that is a property name in prompt.properties": { + "with a sync function validator (.validator)": { + topic: function () { + var that = this; + + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.get(helpers.schema.properties.fnvalidator, this.callback); + helpers.stdin.writeNextTick('fn123\n'); + }, + "should accept a value that is checked": function (err, result) { + assert.isNull(err); + assert.equal(result['fnvalidator'],'fn123'); + } + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "with a simple string prompt": { + "that is a property name in prompt.properties": { + "with a sync function validator (.conform)": { + topic: function () { + var that = this; + + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.get(grab('fnconform'), this.callback); + helpers.stdin.writeNextTick('fn123\n'); + }, + "should accept a value that is checked": function (err, result) { + assert.isNull(err); + assert.equal(result['fnconform'],'fn123'); + } + } + // + // Remark Does not work with revalidator + // + // "with a callback validator": { + // topic: function () { + // var that = this; + // + // helpers.stdout.once('data', function (msg) { + // that.msg = msg; + // }); + // + // prompt.get(grab('cbvalidator'), this.callback); + // helpers.stdin.writeNextTick('cb123\n'); + // }, + // "should not accept a value that is correct": function (err, result) { + // assert.isNull(err); + // assert.equal(result['cbvalidator'],'cb123'); + // } + // } + } + }, + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "with a simple string prompt": { + "that is a property name in prompt.properties": { + "with a sync function before (.before)": { + topic: function() { + var that = this; + + helpers.stdout.once('data', function(msg) { + that.msg = msg; + }); + + prompt.get({ + properties: { + fnbefore: { + before: function(v) { + return 'v' + v; + } + } + } + }, this.callback); + helpers.stdin.writeNextTick('fn456\n'); + }, + "should modify user's input": function(e, result) { + assert.equal(result.fnbefore, 'vfn456'); + } + } + } + } + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "skip prompt with prompt.overide": { + topic: function () { + prompt.override = { coconihet: 'whatever' } + prompt.get('coconihet', this.callback); + }, + "skips prompt and uses overide": function (err, results) { + assert.equal(results.coconihet, 'whatever') + } + } + } + } +}).addBatch({ + "When using prompt": { + "the addProperties() method": { + topic: function () { + prompt.addProperties({}, ['foo', 'bar'], this.callback); + helpers.stdin.writeSequence(['foo\n', 'bar\n']); + }, + "should add the properties to the object": function (err, obj) { + assert.isNull(err); + assert.isObject(obj); + assert.equal(obj.foo, 'foo'); + assert.equal(obj.bar, 'bar'); + } + } + } +}).addBatch({ + "When using prompt": { + "the get() method": { + "with old schema": { + topic: function () { + var that = this; + + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.properties.username = schema.properties.oldschema; + prompt.get('username', this.callback); + + helpers.stdin.writeSequence(['\n', 'hell$\n', 'hello\n']); + }, + "should prompt to stdout and respond with the default value": function (err, result) { + assert.isNull(err); + assert.isTrue(this.msg.indexOf('username') !== -1); + assert.include(result, 'username'); + assert.equal(result.username, 'hello'); + } + } + } + } +}).addBatch({ + "When using prompt": { + "the history() method": { + "when used inside of a complex property": { + "with correct value(s)": { + topic: function () { + prompt.get([grab('animal'), grab('sound')], this.callback); + helpers.stdin.writeSequence(['dog\n', 'woof\n']); + }, + "should respond with the values entered": function (err, result) { + assert.isTrue(!err); + assert.equal(result.animal, 'dog'); + assert.equal(result.sound, 'woof'); + assert.equal(prompt.history('nothing'), null); + assert.deepEqual(prompt.history('animal'), { property: 'animal', value: 'dog' }); + } + }, + } + } + } +}).addBatch({ + "When using prompt": { + "the history() method": { + "when used inside of a complex property": { + "with an incorrect value": { + topic: function () { + prompt.get([grab('animal'), grab('sound')], function () {}); + prompt.once('invalid', this.callback.bind(null, null)); + helpers.stdin.writeSequence(['dog\n', 'meow\n']); + }, + "should prompt for the error": function (ign, property, line) { + assert.equal(property.path.join(''), 'sound'); + assert.equal(line, 'meow'); + } + } + } + } + } +}).addBatch({ + "when using prompt": { + "the get() method": { + topic: function () { + prompt.override = { xyz: 468, abc: 123 } + prompt.get(['xyz', 'abc'], this.callback); + }, + "should respond with overrides": function (err, results) { + assert.isNull(err); + assert.deepEqual(results, { xyz: 468, abc: 123 }); + } + } + } +}).addBatch({ + "When using prompt": { + "with fancy properties": { + "the get() method": { + topic: function () { + prompt.override = { UVW: 5423, DEF: 64235 } + prompt.get({ + properties: { + 'UVW': { + description: 'a custom message', + default: 6 + }, + 'DEF': { + description: 'a custom message', + default: 6 + } + } + }, this.callback); + }, + "should respond with overrides": function (err, results) { + assert.isNull(err); + assert.deepEqual(results, { UVW: 5423, DEF: 64235 }); + } + } + } + } +}).addBatch({ + "When using prompt": { + "with a type and a description property": { + "the get() method": { + topic: function () { + var that = this; + helpers.stdout.once('data', function (msg) { + that.msg = msg; + }); + + prompt.get({ + name: 'test', + type: 'number', + description: 'Please input a number' + }, this.callback); + helpers.stdin.writeNextTick('42\n'); + }, + "should prompt to stdout and respond with the value": function (err, result) { + assert.isNull(err); + assert.include(result, 'test'); + assert.equal(result['test'], '42'); + assert.isTrue(this.msg.indexOf('Please input a number') !== -1); + } + }, + } + } + }) +.addBatch( + macros.shouldConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'Y' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with an empty string and default yes'], + prop: 'test', + response: '' + }, { + default: 'yes' + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'N' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'YES' + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'NO' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'T' + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'F' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'TRUE' + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with a string message'], + prop: 'test', + response: 'FALSE' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with an object', 'and description set'], + prop: { description: 'a custom message' }, + response: 'Y' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with an object', 'and they forgot the description'], + prop: { description: 'a custom message' }, + response: 'Y' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with an object', 'and custom validators'], + prop: { + description: 'node or jitsu?', + pattern: /^(node|jitsu)/i, + yes: /^node/i + }, + response: 'node' + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with an object', 'and custom validators'], + prop: { + description: 'node or jitsu?', + pattern: /^(node|jitsu)/i, + yes: /^node/i + }, + response: 'jitsu' + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with multiple strings'], + prop: ["test", "test2", "test3"], + response: ['Y\n', 'y\n', 'YES\n'] + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with multiple strings'], + prop: ["test", "test2", "test3"], + response: ['Y\n', 'N\n', 'YES\n'] + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with multiple strings'], + prop: ["test", "test2", "test3"], + response: ['n\n', 'NO\n', 'N\n'] + }) +).addBatch( + macros.shouldConfirm({ + messages: ['with multiple objects'], + prop: [ + { message: "test" }, + { message: "test2" } + ], + response: ['y\n', 'y\n'] + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with multiple objects'], + prop: [ + { message: "test" }, + { message: "test2" } + ], + response: ['n\n', 'n\n'] + }) +).addBatch( + macros.shouldNotConfirm({ + messages: ['with multiple objects'], + prop: [ + { message: "test" }, + { message: "test2" } + ], + response: ['n\n', 'y\n'] + }) +).export(module); diff --git a/node_modules/proxy-addr/HISTORY.md b/node_modules/proxy-addr/HISTORY.md new file mode 100755 index 00000000..9a62abc9 --- /dev/null +++ b/node_modules/proxy-addr/HISTORY.md @@ -0,0 +1,109 @@ +1.1.4 / 2017-03-24 +================== + + * deps: ipaddr.js@1.3.0 + +1.1.3 / 2017-01-14 +================== + + * deps: ipaddr.js@1.2.0 + +1.1.2 / 2016-05-29 +================== + + * deps: ipaddr.js@1.1.1 + - Fix IPv6-mapped IPv4 validation edge cases + +1.1.1 / 2016-05-03 +================== + + * Fix regression matching mixed versions against multiple subnets + +1.1.0 / 2016-05-01 +================== + + * Fix accepting various invalid netmasks + - IPv4 netmasks must be contingous + - IPv6 addresses cannot be used as a netmask + * deps: ipaddr.js@1.1.0 + +1.0.10 / 2015-12-09 +=================== + + * deps: ipaddr.js@1.0.5 + - Fix regression in `isValid` with non-string arguments + +1.0.9 / 2015-12-01 +================== + + * deps: ipaddr.js@1.0.4 + - Fix accepting some invalid IPv6 addresses + - Reject CIDRs with negative or overlong masks + * perf: enable strict mode + +1.0.8 / 2015-05-10 +================== + + * deps: ipaddr.js@1.0.1 + +1.0.7 / 2015-03-16 +================== + + * deps: ipaddr.js@0.1.9 + - Fix OOM on certain inputs to `isValid` + +1.0.6 / 2015-02-01 +================== + + * deps: ipaddr.js@0.1.8 + +1.0.5 / 2015-01-08 +================== + + * deps: ipaddr.js@0.1.6 + +1.0.4 / 2014-11-23 +================== + + * deps: ipaddr.js@0.1.5 + - Fix edge cases with `isValid` + +1.0.3 / 2014-09-21 +================== + + * Use `forwarded` npm module + +1.0.2 / 2014-09-18 +================== + + * Fix a global leak when multiple subnets are trusted + * Support Node.js 0.6 + * deps: ipaddr.js@0.1.3 + +1.0.1 / 2014-06-03 +================== + + * Fix links in npm package + +1.0.0 / 2014-05-08 +================== + + * Add `trust` argument to determine proxy trust on + * Accepts custom function + * Accepts IPv4/IPv6 address(es) + * Accepts subnets + * Accepts pre-defined names + * Add optional `trust` argument to `proxyaddr.all` to + stop at first untrusted + * Add `proxyaddr.compile` to pre-compile `trust` function + to make subsequent calls faster + +0.0.1 / 2014-05-04 +================== + + * Fix bad npm publish + +0.0.0 / 2014-05-04 +================== + + * Initial release diff --git a/node_modules/proxy-addr/LICENSE b/node_modules/proxy-addr/LICENSE new file mode 100755 index 00000000..cab251c2 --- /dev/null +++ b/node_modules/proxy-addr/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/proxy-addr/README.md b/node_modules/proxy-addr/README.md new file mode 100755 index 00000000..6b1075aa --- /dev/null +++ b/node_modules/proxy-addr/README.md @@ -0,0 +1,140 @@ +# proxy-addr + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Determine address of proxied request + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install proxy-addr +``` + +## API + +```js +var proxyaddr = require('proxy-addr') +``` + +### proxyaddr(req, trust) + +Return the address of the request, using the given `trust` parameter. + +The `trust` argument is a function that returns `true` if you trust +the address, `false` if you don't. The closest untrusted address is +returned. + +```js +proxyaddr(req, function(addr){ return addr === '127.0.0.1' }) +proxyaddr(req, function(addr, i){ return i < 1 }) +``` + +The `trust` arugment may also be a single IP address string or an +array of trusted addresses, as plain IP addresses, CIDR-formatted +strings, or IP/netmask strings. + +```js +proxyaddr(req, '127.0.0.1') +proxyaddr(req, ['127.0.0.0/8', '10.0.0.0/8']) +proxyaddr(req, ['127.0.0.0/255.0.0.0', '192.168.0.0/255.255.0.0']) +``` + +This module also supports IPv6. Your IPv6 addresses will be normalized +automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`). + +```js +proxyaddr(req, '::1') +proxyaddr(req, ['::1/128', 'fe80::/10']) +``` + +This module will automatically work with IPv4-mapped IPv6 addresses +as well to support node.js in IPv6-only mode. This means that you do +not have to specify both `::ffff:a00:1` and `10.0.0.1`. + +As a convenience, this module also takes certain pre-defined names +in addition to IP addresses, which expand into IP addresses: + +```js +proxyaddr(req, 'loopback') +proxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64']) +``` + + * `loopback`: IPv4 and IPv6 loopback addresses (like `::1` and + `127.0.0.1`). + * `linklocal`: IPv4 and IPv6 link-local addresses (like + `fe80::1:1:1:1` and `169.254.0.1`). + * `uniquelocal`: IPv4 private addresses and IPv6 unique-local + addresses (like `fc00:ac:1ab5:fff::1` and `192.168.0.1`). + +When `trust` is specified as a function, it will be called for each +address to determine if it is a trusted address. The function is +given two arguments: `addr` and `i`, where `addr` is a string of +the address to check and `i` is a number that represents the distance +from the socket address. + +### proxyaddr.all(req, [trust]) + +Return all the addresses of the request, optionally stopping at the +first untrusted. This array is ordered from closest to furthest +(i.e. `arr[0] === req.connection.remoteAddress`). + +```js +proxyaddr.all(req) +``` + +The optional `trust` argument takes the same arguments as `trust` +does in `proxyaddr(req, trust)`. + +```js +proxyaddr.all(req, 'loopback') +``` + +### proxyaddr.compile(val) + +Compiles argument `val` into a `trust` function. This function takes +the same arguments as `trust` does in `proxyaddr(req, trust)` and +returns a function suitable for `proxyaddr(req, trust)`. + +```js +var trust = proxyaddr.compile('localhost') +var addr = proxyaddr(req, trust) +``` + +This function is meant to be optimized for use against every request. +It is recommend to compile a trust function up-front for the trusted +configuration and pass that to `proxyaddr(req, trust)` for each request. + +## Testing + +```sh +$ npm test +``` + +## Benchmarks + +```sh +$ npm run-script bench +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/proxy-addr.svg +[npm-url]: https://npmjs.org/package/proxy-addr +[node-version-image]: https://img.shields.io/node/v/proxy-addr.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/proxy-addr/master.svg +[travis-url]: https://travis-ci.org/jshttp/proxy-addr +[coveralls-image]: https://img.shields.io/coveralls/jshttp/proxy-addr/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/proxy-addr?branch=master +[downloads-image]: https://img.shields.io/npm/dm/proxy-addr.svg +[downloads-url]: https://npmjs.org/package/proxy-addr diff --git a/node_modules/proxy-addr/index.js b/node_modules/proxy-addr/index.js new file mode 100755 index 00000000..2dad636e --- /dev/null +++ b/node_modules/proxy-addr/index.js @@ -0,0 +1,325 @@ +/*! + * proxy-addr + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = proxyaddr; +module.exports.all = alladdrs; +module.exports.compile = compile; + +/** + * Module dependencies. + * @private + */ + +var forwarded = require('forwarded'); +var ipaddr = require('ipaddr.js'); + +/** + * Variables. + * @private + */ + +var digitre = /^[0-9]+$/; +var isip = ipaddr.isValid; +var parseip = ipaddr.parse; + +/** + * Pre-defined IP ranges. + * @private + */ + +var ipranges = { + linklocal: ['169.254.0.0/16', 'fe80::/10'], + loopback: ['127.0.0.1/8', '::1/128'], + uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7'] +}; + +/** + * Get all addresses in the request, optionally stopping + * at the first untrusted. + * + * @param {Object} request + * @param {Function|Array|String} [trust] + * @public + */ + +function alladdrs(req, trust) { + // get addresses + var addrs = forwarded(req); + + if (!trust) { + // Return all addresses + return addrs; + } + + if (typeof trust !== 'function') { + trust = compile(trust); + } + + for (var i = 0; i < addrs.length - 1; i++) { + if (trust(addrs[i], i)) continue; + + addrs.length = i + 1; + } + + return addrs; +} + +/** + * Compile argument into trust function. + * + * @param {Array|String} val + * @private + */ + +function compile(val) { + if (!val) { + throw new TypeError('argument is required'); + } + + var trust = typeof val === 'string' + ? [val] + : val; + + if (!Array.isArray(trust)) { + throw new TypeError('unsupported trust argument'); + } + + for (var i = 0; i < trust.length; i++) { + val = trust[i]; + + if (!ipranges.hasOwnProperty(val)) { + continue; + } + + // Splice in pre-defined range + val = ipranges[val]; + trust.splice.apply(trust, [i, 1].concat(val)); + i += val.length - 1; + } + + return compileTrust(compileRangeSubnets(trust)); +} + +/** + * Compile `arr` elements into range subnets. + * + * @param {Array} arr + * @private + */ + +function compileRangeSubnets(arr) { + var rangeSubnets = new Array(arr.length); + + for (var i = 0; i < arr.length; i++) { + rangeSubnets[i] = parseipNotation(arr[i]); + } + + return rangeSubnets; +} + +/** + * Compile range subnet array into trust function. + * + * @param {Array} rangeSubnets + * @private + */ + +function compileTrust(rangeSubnets) { + // Return optimized function based on length + var len = rangeSubnets.length; + return len === 0 + ? trustNone + : len === 1 + ? trustSingle(rangeSubnets[0]) + : trustMulti(rangeSubnets); +} + +/** + * Parse IP notation string into range subnet. + * + * @param {String} note + * @private + */ + +function parseipNotation(note) { + var pos = note.lastIndexOf('/'); + var str = pos !== -1 + ? note.substring(0, pos) + : note; + + if (!isip(str)) { + throw new TypeError('invalid IP address: ' + str); + } + + var ip = parseip(str); + + if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { + // Store as IPv4 + ip = ip.toIPv4Address(); + } + + var max = ip.kind() === 'ipv6' + ? 128 + : 32; + + var range = pos !== -1 + ? note.substring(pos + 1, note.length) + : null; + + if (range === null) { + range = max; + } else if (digitre.test(range)) { + range = parseInt(range, 10); + } else if (ip.kind() === 'ipv4' && isip(range)) { + range = parseNetmask(range); + } else { + range = null; + } + + if (range <= 0 || range > max) { + throw new TypeError('invalid range on address: ' + note); + } + + return [ip, range]; +} + +/** + * Parse netmask string into CIDR range. + * + * @param {String} netmask + * @private + */ + +function parseNetmask(netmask) { + var ip = parseip(netmask); + var kind = ip.kind(); + + return kind === 'ipv4' + ? ip.prefixLengthFromSubnetMask() + : null; +} + +/** + * Determine address of proxied request. + * + * @param {Object} request + * @param {Function|Array|String} trust + * @public + */ + +function proxyaddr(req, trust) { + if (!req) { + throw new TypeError('req argument is required'); + } + + if (!trust) { + throw new TypeError('trust argument is required'); + } + + var addrs = alladdrs(req, trust); + var addr = addrs[addrs.length - 1]; + + return addr; +} + +/** + * Static trust function to trust nothing. + * + * @private + */ + +function trustNone() { + return false; +} + +/** + * Compile trust function for multiple subnets. + * + * @param {Array} subnets + * @private + */ + +function trustMulti(subnets) { + return function trust(addr) { + if (!isip(addr)) return false; + + var ip = parseip(addr); + var ipconv; + var kind = ip.kind(); + + for (var i = 0; i < subnets.length; i++) { + var subnet = subnets[i]; + var subnetip = subnet[0]; + var subnetkind = subnetip.kind(); + var subnetrange = subnet[1]; + var trusted = ip; + + if (kind !== subnetkind) { + if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + continue; + } + + if (!ipconv) { + // Convert IP to match subnet IP kind + ipconv = subnetkind === 'ipv4' + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress(); + } + + trusted = ipconv; + } + + if (trusted.match(subnetip, subnetrange)) { + return true; + } + } + + return false; + }; +} + +/** + * Compile trust function for single subnet. + * + * @param {Object} subnet + * @private + */ + +function trustSingle(subnet) { + var subnetip = subnet[0]; + var subnetkind = subnetip.kind(); + var subnetisipv4 = subnetkind === 'ipv4'; + var subnetrange = subnet[1]; + + return function trust(addr) { + if (!isip(addr)) return false; + + var ip = parseip(addr); + var kind = ip.kind(); + + if (kind !== subnetkind) { + if (subnetisipv4 && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + return false; + } + + // Convert IP to match subnet IP kind + ip = subnetisipv4 + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress(); + } + + return ip.match(subnetip, subnetrange); + }; +} diff --git a/node_modules/proxy-addr/package.json b/node_modules/proxy-addr/package.json new file mode 100755 index 00000000..7968fc82 --- /dev/null +++ b/node_modules/proxy-addr/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "proxy-addr@~1.1.3", + "scope": null, + "escapedName": "proxy-addr", + "name": "proxy-addr", + "rawSpec": "~1.1.3", + "spec": ">=1.1.3 <1.2.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "proxy-addr@>=1.1.3 <1.2.0", + "_id": "proxy-addr@1.1.4", + "_inCache": true, + "_location": "/proxy-addr", + "_nodeVersion": "4.7.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/proxy-addr-1.1.4.tgz_1490396252699_0.9566438721958548" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, + "_requested": { + "raw": "proxy-addr@~1.1.3", + "scope": null, + "escapedName": "proxy-addr", + "name": "proxy-addr", + "rawSpec": "~1.1.3", + "spec": ">=1.1.3 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.4.tgz", + "_shasum": "27e545f6960a44a627d9b44467e35c1b6b4ce2f3", + "_shrinkwrap": null, + "_spec": "proxy-addr@~1.1.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "bugs": { + "url": "https://github.com/jshttp/proxy-addr/issues" + }, + "dependencies": { + "forwarded": "~0.1.0", + "ipaddr.js": "1.3.0" + }, + "description": "Determine address of proxied request", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.3", + "istanbul": "0.4.5", + "mocha": "~1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "27e545f6960a44a627d9b44467e35c1b6b4ce2f3", + "tarball": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.4.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "gitHead": "4c636264c036d9825e8a3cf50555a272e3246fe6", + "homepage": "https://github.com/jshttp/proxy-addr#readme", + "keywords": [ + "ip", + "proxy", + "x-forwarded-for" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "name": "proxy-addr", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/proxy-addr.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.1.4" +} diff --git a/node_modules/prr/.jshintrc b/node_modules/prr/.jshintrc new file mode 100755 index 00000000..6a7a956c --- /dev/null +++ b/node_modules/prr/.jshintrc @@ -0,0 +1,61 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "newcap": true + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "es5": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": true + , "passfail": false +} \ No newline at end of file diff --git a/node_modules/prr/.npmignore b/node_modules/prr/.npmignore new file mode 100755 index 00000000..b512c09d --- /dev/null +++ b/node_modules/prr/.npmignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/node_modules/prr/.travis.yml b/node_modules/prr/.travis.yml new file mode 100755 index 00000000..fe3f4eb1 --- /dev/null +++ b/node_modules/prr/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - 0.8 + - "0.10" +branches: + only: + - master +notifications: + email: + - rod@vagg.org diff --git a/node_modules/prr/LICENSE b/node_modules/prr/LICENSE new file mode 100755 index 00000000..f6a0029d --- /dev/null +++ b/node_modules/prr/LICENSE @@ -0,0 +1,39 @@ +Copyright 2013, Rod Vagg (the "Original Author") +All rights reserved. + +MIT +no-false-attribs License + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +Distributions of all or part of the Software intended to be used +by the recipients as they would use the unmodified Software, +containing modifications that substantially alter, remove, or +disable functionality of the Software, outside of the documented +configuration mechanisms provided by the Software, shall be +modified such that the Original Author's bug reporting email +addresses and urls are either replaced with the contact information +of the parties responsible for the changes, or removed entirely. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + +Except where noted, this license applies to any and all software +programs and associated documentation files created by the +Original Author, when distributed with the Software. \ No newline at end of file diff --git a/node_modules/prr/README.md b/node_modules/prr/README.md new file mode 100755 index 00000000..3e709e3b --- /dev/null +++ b/node_modules/prr/README.md @@ -0,0 +1,45 @@ +# prr [![Build Status](https://secure.travis-ci.org/rvagg/prr.png)](http://travis-ci.org/rvagg/prr) + +An sensible alternative to `Object.defineProperty()`. Available in npm and Ender as **prr**. + +## Usage + +Set the property `'foo'` (`obj.foo`) to have the value `'bar'` with default options (*enumerable, configurable and writable are all false*): + +```js +prr(obj, 'foo', 'bar') +``` + +Adjust the default options: + +```js +prr(obj, 'foo', 'bar', { enumerable: true, writable: true }) +``` + +Do the same operation for multiple properties: + +```js +prr(obj, { one: 'one', two: 'two' }) +// or with options: +prr(obj, { one: 'one', two: 'two' }, { enumerable: true, writable: true }) +``` + +But obviously, having to write out the full options object makes it nearly as bad as the original `Object.defineProperty()` so we can **simplify**. + +As an alternative method we can use an options string where each character represents a option: `'e'=='enumerable'`, `'c'=='configurable'` and `'w'=='writable'`: + +```js +prr(obj, 'foo', 'bar', 'ew') // enumerable and writable but not configurable +// muliple properties: +prr(obj, { one: 'one', two: 'two' }, 'ewc') // configurable too +``` + +## Where can I use it? + +Anywhere! For pre-ES5 environments *prr* will simply fall-back to an `object[property] = value` so you can get close to what you want. + +*prr* is Ender-compatible so you can include it in your Ender build and `$.prr(...)` or `var prr = require('prr'); prr(...)`. + +## Licence + +prr is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. \ No newline at end of file diff --git a/node_modules/prr/package.json b/node_modules/prr/package.json new file mode 100755 index 00000000..420bd410 --- /dev/null +++ b/node_modules/prr/package.json @@ -0,0 +1,85 @@ +{ + "_args": [ + [ + { + "raw": "prr@~0.0.0", + "scope": null, + "escapedName": "prr", + "name": "prr", + "rawSpec": "~0.0.0", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/errno" + ] + ], + "_from": "prr@>=0.0.0 <0.1.0", + "_id": "prr@0.0.0", + "_inCache": true, + "_location": "/prr", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "1.2.15", + "_phantomChildren": {}, + "_requested": { + "raw": "prr@~0.0.0", + "scope": null, + "escapedName": "prr", + "name": "prr", + "rawSpec": "~0.0.0", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/errno" + ], + "_resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", + "_shasum": "1a84b85908325501411853d0081ee3fa86e2926a", + "_shrinkwrap": null, + "_spec": "prr@~0.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/errno", + "authors": [ + "Rod Vagg (https://github.com/rvagg)" + ], + "bugs": { + "url": "https://github.com/rvagg/prr/issues" + }, + "dependencies": {}, + "description": "A better Object.defineProperty()", + "devDependencies": { + "tap": "*" + }, + "directories": {}, + "dist": { + "shasum": "1a84b85908325501411853d0081ee3fa86e2926a", + "tarball": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz" + }, + "homepage": "https://github.com/rvagg/prr", + "keywords": [ + "property", + "properties", + "defineProperty", + "ender" + ], + "license": "MIT", + "main": "./prr.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "prr", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/prr.git" + }, + "scripts": { + "test": "node ./test.js" + }, + "version": "0.0.0" +} diff --git a/node_modules/prr/prr.js b/node_modules/prr/prr.js new file mode 100755 index 00000000..94f58628 --- /dev/null +++ b/node_modules/prr/prr.js @@ -0,0 +1,63 @@ +/*! + * prr + * (c) 2013 Rod Vagg + * https://github.com/rvagg/prr + * License: MIT + */ + +(function (name, context, definition) { + if (typeof module != 'undefined' && module.exports) + module.exports = definition() + else + context[name] = definition() +})('prr', this, function() { + + var setProperty = typeof Object.defineProperty == 'function' + ? function (obj, key, options) { + Object.defineProperty(obj, key, options) + return obj + } + : function (obj, key, options) { // < es5 + obj[key] = options.value + return obj + } + + , makeOptions = function (value, options) { + var oo = typeof options == 'object' + , os = !oo && typeof options == 'string' + , op = function (p) { + return oo + ? !!options[p] + : os + ? options.indexOf(p[0]) > -1 + : false + } + + return { + enumerable : op('enumerable') + , configurable : op('configurable') + , writable : op('writable') + , value : value + } + } + + , prr = function (obj, key, value, options) { + var k + + options = makeOptions(value, options) + + if (typeof key == 'object') { + for (k in key) { + if (Object.hasOwnProperty.call(key, k)) { + options.value = key[k] + setProperty(obj, k, options) + } + } + return obj + } + + return setProperty(obj, key, options) + } + + return prr +}) \ No newline at end of file diff --git a/node_modules/prr/test.js b/node_modules/prr/test.js new file mode 100755 index 00000000..5222e307 --- /dev/null +++ b/node_modules/prr/test.js @@ -0,0 +1,169 @@ +const test = require('tap').test + , prr = require('./') + +test('test prr(o, key, value) form', function (t) { + t.plan(2) + + var o = {} + prr(o, 'foo', 'bar') + t.equal(o.foo, 'bar', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo') + , { + enumerable : false + , configurable : false + , writable : false + , value : 'bar' + } + , 'correct property descriptor' + ) + t.end() +}) + +test('test prr(o, { key: value }) form', function (t) { + t.plan(2) + + var o = {} + prr(o, { foo: 'bar' }) + + t.equal(o.foo, 'bar', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo') + , { + enumerable : false + , configurable : false + , writable : false + , value : 'bar' + } + , 'correct property descriptor' + ) + t.end() +}) + +test('test multiple key:value pairs', function (t) { + var o = { foo: 'bar' } + + prr(o, { one: 'ONE', two: 'TWO', obj: { o: 'o' }}) + + t.deepEqual(o, { foo: 'bar' }, 'properties are not enumerable') + t.equal(o.one, 'ONE', 'correctly set property') + t.equal(o.two, 'TWO', 'correctly set property') + t.deepEqual(o.obj, { o: 'o' }, 'correctly set property') + + ;[ 'one', 'two', 'obj' ].forEach(function (p) { + t.deepEqual( + Object.getOwnPropertyDescriptor(o, p) + , { + enumerable : false + , configurable : false + , writable : false + , value : p == 'obj' ? { o: 'o' } : p.toUpperCase() + } + , 'correct property descriptor' + ) + }) + + t.end() +}) + +test('test descriptor options', function (t) { + var o = {} + + prr(o, 'foo', 'bar', { + enumerable : true + , configurable : false + }) + t.equal(o.foo, 'bar', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo') + , { + enumerable : true + , configurable : false + , writable : false + , value : 'bar' + } + , 'correct property descriptor' + ) + + prr(o, 'foo2', 'bar2', { + enumerable : true + , configurable : true + , writable : false + }) + t.equal(o.foo2, 'bar2', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo2') + , { + enumerable : true + , configurable : true + , writable : false + , value : 'bar2' + } + , 'correct property descriptor' + ) + + prr(o, 'foo3', 'bar3', { + enumerable : true + , configurable : true + , writable : true + }) + t.equal(o.foo3, 'bar3', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo3') + , { + enumerable : true + , configurable : true + , writable : true + , value : 'bar3' + } + , 'correct property descriptor' + ) + + t.end() +}) + + +test('test descriptor options, string form', function (t) { + var o = {} + + prr(o, 'foo', 'bar', 'e') + t.equal(o.foo, 'bar', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo') + , { + enumerable : true + , configurable : false + , writable : false + , value : 'bar' + } + , 'correct property descriptor' + ) + + prr(o, 'foo2', 'bar2', 'ec') + t.equal(o.foo2, 'bar2', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo2') + , { + enumerable : true + , configurable : true + , writable : false + , value : 'bar2' + } + , 'correct property descriptor' + ) + + prr(o, 'foo3', 'bar3', 'ecw') + t.equal(o.foo3, 'bar3', 'correct value') + t.deepEqual( + Object.getOwnPropertyDescriptor(o, 'foo3') + , { + enumerable : true + , configurable : true + , writable : true + , value : 'bar3' + } + , 'correct property descriptor' + ) + + t.end() +}) diff --git a/node_modules/pump/.npmignore b/node_modules/pump/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/pump/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/pump/.travis.yml b/node_modules/pump/.travis.yml new file mode 100755 index 00000000..17f94330 --- /dev/null +++ b/node_modules/pump/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + +script: "npm test" diff --git a/node_modules/pump/LICENSE b/node_modules/pump/LICENSE new file mode 100755 index 00000000..757562ec --- /dev/null +++ b/node_modules/pump/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/pump/README.md b/node_modules/pump/README.md new file mode 100755 index 00000000..5029b27d --- /dev/null +++ b/node_modules/pump/README.md @@ -0,0 +1,56 @@ +# pump + +pump is a small node module that pipes streams together and destroys all of them if one of them closes. + +``` +npm install pump +``` + +[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump) + +## What problem does it solve? + +When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error. +You are also not able to provide a callback to tell when then pipe has finished. + +pump does these two things for you + +## Usage + +Simply pass the streams you want to pipe together to pump and add an optional callback + +``` js +var pump = require('pump') +var fs = require('fs') + +var source = fs.createReadStream('/dev/random') +var dest = fs.createWriteStream('/dev/null') + +pump(source, dest, function(err) { + console.log('pipe finished', err) +}) + +setTimeout(function() { + dest.destroy() // when dest is closed pump will destroy source +}, 1000) +``` + +You can use pump to pipe more than two streams together as well + +``` js +var transform = someTransformStream() + +pump(source, transform, anotherTransform, dest, function(err) { + console.log('pipe finished', err) +}) +``` + +If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. + +## License + +MIT + +## Related + +`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/pump/index.js b/node_modules/pump/index.js new file mode 100755 index 00000000..060ce5f4 --- /dev/null +++ b/node_modules/pump/index.js @@ -0,0 +1,80 @@ +var once = require('once') +var eos = require('end-of-stream') +var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes + +var noop = function () {} + +var isFn = function (fn) { + return typeof fn === 'function' +} + +var isFS = function (stream) { + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} + +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) +} + +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) + + var closed = false + stream.on('close', function () { + closed = true + }) + + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) + + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true + + if (isFS(stream)) return stream.close() // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + + if (isFn(stream.destroy)) return stream.destroy() + + callback(err || new Error('stream was destroyed')) + } +} + +var call = function (fn) { + fn() +} + +var pipe = function (from, to) { + return from.pipe(to) +} + +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop + + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') + + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) + + return streams.reduce(pipe) +} + +module.exports = pump diff --git a/node_modules/pump/node_modules/end-of-stream/LICENSE b/node_modules/pump/node_modules/end-of-stream/LICENSE new file mode 100755 index 00000000..757562ec --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/pump/node_modules/end-of-stream/README.md b/node_modules/pump/node_modules/end-of-stream/README.md new file mode 100755 index 00000000..f2560c93 --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/README.md @@ -0,0 +1,52 @@ +# end-of-stream + +A node module that calls a callback when a readable/writable/duplex stream has completed or failed. + + npm install end-of-stream + +## Usage + +Simply pass a stream and a callback to the `eos`. +Both legacy streams, streams2 and stream3 are supported. + +``` js +var eos = require('end-of-stream'); + +eos(readableStream, function(err) { + // this will be set to the stream instance + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended', this === readableStream); +}); + +eos(writableStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished', this === writableStream); +}); + +eos(duplexStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended and finished', this === duplexStream); +}); + +eos(duplexStream, {readable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished but might still be readable'); +}); + +eos(duplexStream, {writable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended but might still be writable'); +}); + +eos(readableStream, {error:false}, function(err) { + // do not treat emit('error', err) as a end-of-stream +}); +``` + +## License + +MIT + +## Related + +`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/pump/node_modules/end-of-stream/index.js b/node_modules/pump/node_modules/end-of-stream/index.js new file mode 100755 index 00000000..b3a90686 --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/index.js @@ -0,0 +1,83 @@ +var once = require('once'); + +var noop = function() {}; + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; + + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; + + var onclose = function() { + if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close')); + }; + + var onrequest = function() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + if (isChildProcess(stream)) stream.on('exit', onexit); + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', callback); + stream.on('close', onclose); + + return function() { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', callback); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; diff --git a/node_modules/pump/node_modules/end-of-stream/node_modules/once/LICENSE b/node_modules/pump/node_modules/end-of-stream/node_modules/once/LICENSE new file mode 100755 index 00000000..19129e31 --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pump/node_modules/end-of-stream/node_modules/once/README.md b/node_modules/pump/node_modules/end-of-stream/node_modules/once/README.md new file mode 100755 index 00000000..1f1ffca9 --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/node_modules/pump/node_modules/end-of-stream/node_modules/once/once.js b/node_modules/pump/node_modules/end-of-stream/node_modules/once/once.js new file mode 100755 index 00000000..23540673 --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/node_modules/pump/node_modules/end-of-stream/node_modules/once/package.json b/node_modules/pump/node_modules/end-of-stream/node_modules/once/package.json new file mode 100755 index 00000000..22065acf --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/node_modules/once/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "once@^1.4.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "^1.4.0", + "spec": ">=1.4.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pump/node_modules/end-of-stream" + ] + ], + "_from": "once@>=1.4.0 <2.0.0", + "_id": "once@1.4.0", + "_inCache": true, + "_location": "/pump/end-of-stream/once", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "once@^1.4.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "^1.4.0", + "spec": ">=1.4.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/pump/end-of-stream" + ], + "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "_shrinkwrap": null, + "_spec": "once@^1.4.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pump/node_modules/end-of-stream", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/once/issues" + }, + "dependencies": { + "wrappy": "1" + }, + "description": "Run a function exactly one time", + "devDependencies": { + "tap": "^7.0.1" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + }, + "files": [ + "once.js" + ], + "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6", + "homepage": "https://github.com/isaacs/once#readme", + "keywords": [ + "once", + "function", + "one", + "single" + ], + "license": "ISC", + "main": "once.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "once", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.4.0" +} diff --git a/node_modules/pump/node_modules/end-of-stream/package.json b/node_modules/pump/node_modules/end-of-stream/package.json new file mode 100755 index 00000000..b48108a6 --- /dev/null +++ b/node_modules/pump/node_modules/end-of-stream/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "end-of-stream@^1.1.0", + "scope": null, + "escapedName": "end-of-stream", + "name": "end-of-stream", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pump" + ] + ], + "_from": "end-of-stream@>=1.1.0 <2.0.0", + "_id": "end-of-stream@1.4.0", + "_inCache": true, + "_location": "/pump/end-of-stream", + "_nodeVersion": "6.9.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/end-of-stream-1.4.0.tgz_1489488042174_0.6194448405876756" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "3.10.10", + "_phantomChildren": { + "wrappy": "1.0.2" + }, + "_requested": { + "raw": "end-of-stream@^1.1.0", + "scope": null, + "escapedName": "end-of-stream", + "name": "end-of-stream", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/pump" + ], + "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", + "_shasum": "7a90d833efda6cfa6eac0f4949dbb0fad3a63206", + "_shrinkwrap": null, + "_spec": "end-of-stream@^1.1.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pump", + "author": { + "name": "Mathias Buus", + "email": "mathiasbuus@gmail.com" + }, + "bugs": { + "url": "https://github.com/mafintosh/end-of-stream/issues" + }, + "dependencies": { + "once": "^1.4.0" + }, + "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "7a90d833efda6cfa6eac0f4949dbb0fad3a63206", + "tarball": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "0ae1658b8167596fafbb9195363ada3bc5a3eaf2", + "homepage": "https://github.com/mafintosh/end-of-stream", + "keywords": [ + "stream", + "streams", + "callback", + "finish", + "close", + "end", + "wait" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "end-of-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/end-of-stream.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.4.0" +} diff --git a/node_modules/pump/package.json b/node_modules/pump/package.json new file mode 100755 index 00000000..2661ab72 --- /dev/null +++ b/node_modules/pump/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + { + "raw": "pump@^1.0.0", + "scope": null, + "escapedName": "pump", + "name": "pump", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pumpify" + ] + ], + "_from": "pump@>=1.0.0 <2.0.0", + "_id": "pump@1.0.2", + "_inCache": true, + "_location": "/pump", + "_nodeVersion": "4.6.2", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/pump-1.0.2.tgz_1482243286673_0.09530888125300407" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.15.11", + "_phantomChildren": { + "wrappy": "1.0.2" + }, + "_requested": { + "raw": "pump@^1.0.0", + "scope": null, + "escapedName": "pump", + "name": "pump", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/pumpify" + ], + "_resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz", + "_shasum": "3b3ee6512f94f0e575538c17995f9f16990a5d51", + "_shrinkwrap": null, + "_spec": "pump@^1.0.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/pumpify", + "author": { + "name": "Mathias Buus Madsen", + "email": "mathiasbuus@gmail.com" + }, + "browser": { + "fs": false + }, + "bugs": { + "url": "https://github.com/mafintosh/pump/issues" + }, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + }, + "description": "pipe streams together and close all of them if one of them closes", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "3b3ee6512f94f0e575538c17995f9f16990a5d51", + "tarball": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz" + }, + "gitHead": "90ed7ae8923ade7c7589e3db28c29fbc5c2d42ca", + "homepage": "https://github.com/mafintosh/pump", + "keywords": [ + "streams", + "pipe", + "destroy", + "callback" + ], + "license": "MIT", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "pump", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/pump.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.2" +} diff --git a/node_modules/pump/test-browser.js b/node_modules/pump/test-browser.js new file mode 100755 index 00000000..80e852c7 --- /dev/null +++ b/node_modules/pump/test-browser.js @@ -0,0 +1,58 @@ +var stream = require('stream') +var pump = require('./index') + +var rs = new stream.Readable() +var ws = new stream.Writable() + +rs._read = function (size) { + this.push(Buffer(size).fill('abc')) +} + +ws._write = function (chunk, encoding, cb) { + setTimeout(function () { + cb() + }, 100) +} + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) console.log('done') +} + +ws.on('finish', function () { + wsClosed = true + check() +}) + +rs.on('end', function () { + rsClosed = true + check() +}) + +pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +setTimeout(function () { + rs.push(null) + rs.emit('close') +}, 1000) + +setTimeout(function () { + if (!check()) throw new Error('timeout') +}, 5000) diff --git a/node_modules/pump/test.js b/node_modules/pump/test.js new file mode 100755 index 00000000..64e772ca --- /dev/null +++ b/node_modules/pump/test.js @@ -0,0 +1,46 @@ +var pump = require('./index') + +var rs = require('fs').createReadStream('/dev/random') +var ws = require('fs').createWriteStream('/dev/null') + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) process.exit(0) +} + +ws.on('close', function () { + wsClosed = true + check() +}) + +rs.on('close', function () { + rsClosed = true + check() +}) + +pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +setTimeout(function () { + rs.destroy() +}, 1000) + +setTimeout(function () { + throw new Error('timeout') +}, 5000) diff --git a/node_modules/pumpify/.npmignore b/node_modules/pumpify/.npmignore new file mode 100755 index 00000000..3c3629e6 --- /dev/null +++ b/node_modules/pumpify/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/pumpify/.travis.yml b/node_modules/pumpify/.travis.yml new file mode 100755 index 00000000..32e71a6b --- /dev/null +++ b/node_modules/pumpify/.travis.yml @@ -0,0 +1,8 @@ +language: node_js + +node_js: + - "0.10" + - "4" + - "5" + +sudo: false diff --git a/node_modules/pumpify/LICENSE b/node_modules/pumpify/LICENSE new file mode 100755 index 00000000..757562ec --- /dev/null +++ b/node_modules/pumpify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/pumpify/README.md b/node_modules/pumpify/README.md new file mode 100755 index 00000000..4988f7b1 --- /dev/null +++ b/node_modules/pumpify/README.md @@ -0,0 +1,56 @@ +# pumpify + +Combine an array of streams into a single duplex stream using [pump](https://github.com/mafintosh/pump) and [duplexify](https://github.com/mafintosh/duplexify). +If one of the streams closes/errors all streams in the pipeline will be destroyed. + +``` +npm install pumpify +``` + +[![build status](http://img.shields.io/travis/mafintosh/pumpify.svg?style=flat)](http://travis-ci.org/mafintosh/pumpify) + +## Usage + +Pass the streams you want to pipe together to pumpify `pipeline = pumpify(s1, s2, s3, ...)`. +`pipeline` is a duplex stream that writes to the first streams and reads from the last one. +Streams are piped together using [pump](https://github.com/mafintosh/pump) so if one of them closes +all streams will be destroyed. + +``` js +var pumpify = require('pumpify') +var tar = require('tar-fs') +var zlib = require('zlib') +var fs = require('fs') + +var untar = pumpify(zlib.createGunzip(), tar.extract('output-folder')) +// you can also pass an array instead +// var untar = pumpify([zlib.createGunzip(), tar.extract('output-folder')]) + +fs.createReadStream('some-gzipped-tarball.tgz').pipe(untar) +``` + +If you are pumping object streams together use `pipeline = pumpify.obj(s1, s2, ...)`. +Call `pipeline.destroy()` to destroy the pipeline (including the streams passed to pumpify). + +### Using `setPipeline(s1, s2, ...)` + +Similar to [duplexify](https://github.com/mafintosh/duplexify) you can also define the pipeline asynchronously using `setPipeline(s1, s2, ...)` + +``` js +var untar = pumpify() + +setTimeout(function() { + // will start draining the input now + untar.setPipeline(zlib.createGunzip(), tar.extract('output-folder')) +}, 1000) + +fs.createReadStream('some-gzipped-tarball.tgz').pipe(untar) +``` + +## License + +MIT + +## Related + +`pumpify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/pumpify/index.js b/node_modules/pumpify/index.js new file mode 100755 index 00000000..147de675 --- /dev/null +++ b/node_modules/pumpify/index.js @@ -0,0 +1,55 @@ +var pump = require('pump') +var inherits = require('inherits') +var Duplexify = require('duplexify') + +var toArray = function(args) { + if (!args.length) return [] + return Array.isArray(args[0]) ? args[0] : Array.prototype.slice.call(args) +} + +var define = function(opts) { + var Pumpify = function() { + var streams = toArray(arguments) + if (!(this instanceof Pumpify)) return new Pumpify(streams) + Duplexify.call(this, null, null, opts) + if (streams.length) this.setPipeline(streams) + } + + inherits(Pumpify, Duplexify) + + Pumpify.prototype.setPipeline = function() { + var streams = toArray(arguments) + var self = this + var ended = false + var w = streams[0] + var r = streams[streams.length-1] + + r = r.readable ? r : null + w = w.writable ? w : null + + var onclose = function() { + streams[0].emit('error', new Error('stream was destroyed')) + } + + this.on('close', onclose) + this.on('prefinish', function() { + if (!ended) self.cork() + }) + + pump(streams, function(err) { + self.removeListener('close', onclose) + if (err) return self.destroy(err) + ended = true + self.uncork() + }) + + if (this.destroyed) return onclose() + this.setWritable(w) + this.setReadable(r) + } + + return Pumpify +} + +module.exports = define({destroy:false}) +module.exports.obj = define({destroy:false, objectMode:true, highWaterMark:16}) diff --git a/node_modules/pumpify/package.json b/node_modules/pumpify/package.json new file mode 100755 index 00000000..e5f153b4 --- /dev/null +++ b/node_modules/pumpify/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "pumpify@^1.3.3", + "scope": null, + "escapedName": "pumpify", + "name": "pumpify", + "rawSpec": "^1.3.3", + "spec": ">=1.3.3 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket" + ] + ], + "_from": "pumpify@>=1.3.3 <2.0.0", + "_id": "pumpify@1.3.5", + "_inCache": true, + "_location": "/pumpify", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/pumpify-1.3.5.tgz_1465886760120_0.06353981443680823" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "raw": "pumpify@^1.3.3", + "scope": null, + "escapedName": "pumpify", + "name": "pumpify", + "rawSpec": "^1.3.3", + "spec": ">=1.3.3 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/gasket" + ], + "_resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.3.5.tgz", + "_shasum": "1b671c619940abcaeac0ad0e3a3c164be760993b", + "_shrinkwrap": null, + "_spec": "pumpify@^1.3.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/gasket", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/pumpify/issues" + }, + "dependencies": { + "duplexify": "^3.1.2", + "inherits": "^2.0.1", + "pump": "^1.0.0" + }, + "description": "Combine an array of streams into a single duplex stream using pump and duplexify", + "devDependencies": { + "tape": "^2.13.3", + "through2": "^0.5.1" + }, + "directories": {}, + "dist": { + "shasum": "1b671c619940abcaeac0ad0e3a3c164be760993b", + "tarball": "https://registry.npmjs.org/pumpify/-/pumpify-1.3.5.tgz" + }, + "gitHead": "b3eb78d20b310409beca86de87a4fba68bc9656e", + "homepage": "https://github.com/mafintosh/pumpify", + "keywords": [ + "pump", + "duplexify", + "duplex", + "streams", + "stream", + "pipeline", + "combine" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "pumpify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/pumpify.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "1.3.5" +} diff --git a/node_modules/pumpify/test.js b/node_modules/pumpify/test.js new file mode 100755 index 00000000..4ee91c5f --- /dev/null +++ b/node_modules/pumpify/test.js @@ -0,0 +1,163 @@ +var tape = require('tape') +var through = require('through2') +var pumpify = require('./') +var stream = require('stream') + +tape('basic', function(t) { + t.plan(3) + + var pipeline = pumpify( + through(function(data, enc, cb) { + t.same(data.toString(), 'hello') + cb(null, data.toString().toUpperCase()) + }), + through(function(data, enc, cb) { + t.same(data.toString(), 'HELLO') + cb(null, data.toString().toLowerCase()) + }) + ) + + pipeline.write('hello') + pipeline.on('data', function(data) { + t.same(data.toString(), 'hello') + t.end() + }) +}) + +tape('3 times', function(t) { + t.plan(4) + + var pipeline = pumpify( + through(function(data, enc, cb) { + t.same(data.toString(), 'hello') + cb(null, data.toString().toUpperCase()) + }), + through(function(data, enc, cb) { + t.same(data.toString(), 'HELLO') + cb(null, data.toString().toLowerCase()) + }), + through(function(data, enc, cb) { + t.same(data.toString(), 'hello') + cb(null, data.toString().toUpperCase()) + }) + ) + + pipeline.write('hello') + pipeline.on('data', function(data) { + t.same(data.toString(), 'HELLO') + t.end() + }) +}) + +tape('destroy', function(t) { + var test = through() + test.destroy = function() { + t.ok(true) + t.end() + } + + var pipeline = pumpify(through(), test) + + pipeline.destroy() +}) + +tape('close', function(t) { + var test = through() + var pipeline = pumpify(through(), test) + + pipeline.on('error', function(err) { + t.same(err.message, 'lol') + t.end() + }) + + test.emit('error', new Error('lol')) +}) + +tape('end waits for last one', function(t) { + var ran = false + + var a = through() + var b = through() + var c = through(function(data, enc, cb) { + setTimeout(function() { + ran = true + cb() + }, 100) + }) + + var pipeline = pumpify(a, b, c) + + pipeline.write('foo') + pipeline.end(function() { + t.ok(ran) + t.end() + }) + + t.ok(!ran) +}) + +tape('always wait for finish', function(t) { + var a = new stream.Readable() + a._read = function() {} + a.push('hello') + + var pipeline = pumpify(a, through(), through()) + var ran = false + + pipeline.on('finish', function() { + t.ok(ran) + t.end() + }) + + setTimeout(function() { + ran = true + a.push(null) + }, 100) +}) + +tape('async', function(t) { + var pipeline = pumpify() + + t.plan(4) + + pipeline.write('hello') + pipeline.on('data', function(data) { + t.same(data.toString(), 'HELLO') + t.end() + }) + + setTimeout(function() { + pipeline.setPipeline( + through(function(data, enc, cb) { + t.same(data.toString(), 'hello') + cb(null, data.toString().toUpperCase()) + }), + through(function(data, enc, cb) { + t.same(data.toString(), 'HELLO') + cb(null, data.toString().toLowerCase()) + }), + through(function(data, enc, cb) { + t.same(data.toString(), 'hello') + cb(null, data.toString().toUpperCase()) + }) + ) + }, 100) +}) + +tape('early destroy', function(t) { + var a = through() + var b = through() + var c = through() + + b.destroy = function() { + t.ok(true) + t.end() + } + + var pipeline = pumpify() + + pipeline.destroy() + setTimeout(function() { + pipeline.setPipeline(a, b, c) + }, 100) +}) \ No newline at end of file diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt new file mode 100755 index 00000000..a41e0a7e --- /dev/null +++ b/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md new file mode 100755 index 00000000..7ad7d1fa --- /dev/null +++ b/node_modules/punycode/README.md @@ -0,0 +1,176 @@ +# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) + +A robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) and [io.js v1.0.0+](https://github.com/iojs/io.js/blob/v1.x/lib/punycode.js). + +## Installation + +Via [npm](https://www.npmjs.com/) (only required for Node.js releases older than v0.6.2): + +```bash +npm install punycode +``` + +Via [Bower](http://bower.io/): + +```bash +bower install punycode +``` + +Via [Component](https://github.com/component/component): + +```bash +component install bestiejs/punycode.js +``` + +In a browser: + +```html + +``` + +In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/): + +```js +var punycode = require('punycode'); +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('punycode.js'); +``` + +Using an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require( + { + 'paths': { + 'punycode': 'path/to/punycode' + } + }, + ['punycode'], + function(punycode) { + console.log(punycode); + } +); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## Unit tests & code coverage + +After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. + +Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. + +To generate the code coverage report, use `grunt cover`. + +Feel free to fork if you see possible improvements! + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## Contributors + +| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json new file mode 100755 index 00000000..2466b753 --- /dev/null +++ b/node_modules/punycode/package.json @@ -0,0 +1,127 @@ +{ + "_args": [ + [ + { + "raw": "punycode@^1.2.4", + "scope": null, + "escapedName": "punycode", + "name": "punycode", + "rawSpec": "^1.2.4", + "spec": ">=1.2.4 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "punycode@>=1.2.4 <2.0.0", + "_id": "punycode@1.4.1", + "_inCache": true, + "_location": "/punycode", + "_nodeVersion": "5.2.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/punycode-1.4.1.tgz_1458437236261_0.07678767060860991" + }, + "_npmUser": { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + "_npmVersion": "3.8.2", + "_phantomChildren": {}, + "_requested": { + "raw": "punycode@^1.2.4", + "scope": null, + "escapedName": "punycode", + "name": "punycode", + "rawSpec": "^1.2.4", + "spec": ">=1.2.4 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "_shasum": "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e", + "_shrinkwrap": null, + "_spec": "punycode@^1.2.4", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/bestiejs/punycode.js/issues" + }, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + { + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + } + ], + "dependencies": {}, + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "devDependencies": { + "coveralls": "^2.11.4", + "grunt": "^0.4.5", + "grunt-contrib-uglify": "^0.11.0", + "grunt-shell": "^1.1.2", + "istanbul": "^0.4.1", + "qunit-extras": "^1.4.4", + "qunitjs": "~1.11.0", + "requirejs": "^2.1.22" + }, + "directories": {}, + "dist": { + "shasum": "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e", + "tarball": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz" + }, + "files": [ + "LICENSE-MIT.txt", + "punycode.js" + ], + "gitHead": "0fbadd6e81f3a0ce06c38998040d6db6bdfbc5c9", + "homepage": "https://mths.be/punycode", + "jspm": { + "map": { + "./punycode.js": { + "node": "@node/punycode" + } + } + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "main": "punycode.js", + "maintainers": [ + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "reconbot", + "email": "wizard@roborooter.com" + } + ], + "name": "punycode", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/bestiejs/punycode.js.git" + }, + "scripts": { + "test": "node tests/tests.js" + }, + "version": "1.4.1" +} diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js new file mode 100755 index 00000000..2c87f6cc --- /dev/null +++ b/node_modules/punycode/punycode.js @@ -0,0 +1,533 @@ +/*! https://mths.be/punycode v1.4.1 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); diff --git a/node_modules/qs/.eslintignore b/node_modules/qs/.eslintignore new file mode 100755 index 00000000..1521c8b7 --- /dev/null +++ b/node_modules/qs/.eslintignore @@ -0,0 +1 @@ +dist diff --git a/node_modules/qs/.eslintrc b/node_modules/qs/.eslintrc new file mode 100755 index 00000000..e2cade5e --- /dev/null +++ b/node_modules/qs/.eslintrc @@ -0,0 +1,18 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 26], + "consistent-return": 1, + "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], + "indent": [2, 4], + "max-params": [2, 12], + "max-statements": [2, 43], + "no-continue": 1, + "no-magic-numbers": 0, + "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], + "operator-linebreak": [2, "after"], + } +} diff --git a/node_modules/qs/.jscs.json b/node_modules/qs/.jscs.json new file mode 100755 index 00000000..3d099c4b --- /dev/null +++ b/node_modules/qs/.jscs.json @@ -0,0 +1,176 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "ForInStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 1 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/node_modules/qs/CHANGELOG.md b/node_modules/qs/CHANGELOG.md new file mode 100755 index 00000000..85e69b0a --- /dev/null +++ b/node_modules/qs/CHANGELOG.md @@ -0,0 +1,175 @@ +## **6.4.0** +- [New] `qs.stringify`: add `encodeValuesOnly` option +- [Fix] follow `allowPrototypes` option during merge (#201, #201) +- [Fix] support keys starting with brackets (#202, #200) +- [Fix] chmod a-x +- [Dev Deps] update `eslint` +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds +- [eslint] reduce warnings + +## **6.3.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` +- [Tests] on all node minors; improve test matrix +- [Docs] document stringify option `allowDots` (#195) +- [Docs] add empty object and array values example (#195) +- [Docs] Fix minor inconsistency/typo (#192) +- [Docs] document stringify option `sort` (#191) +- [Refactor] `stringify`: throw faster with an invalid encoder +- [Refactor] remove unnecessary escapes (#184) +- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) + +## **6.3.0** +- [New] Add support for RFC 1738 (#174, #173) +- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) +- [Fix] ensure `utils.merge` handles merging two arrays +- [Refactor] only constructors should be capitalized +- [Refactor] capitalized var names are for constructors only +- [Refactor] avoid using a sparse array +- [Robustness] `formats`: cache `String#replace` +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` +- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix +- [Tests] flesh out arrayLimit/arrayFormat tests (#107) +- [Tests] skip Object.create tests when null objects are not available +- [Tests] Turn on eslint for test files (#175) + +## **6.2.2** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## **6.1.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) +- [New] allowDots option for `stringify` (#151) +- [Fix] "sort" option should work at a depth of 3 or more (#151) +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## **6.0.3** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) +- Revert ES6 requirement and restore support for node down to v0.8. + +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json + +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 + +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + +## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) +- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string + +## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) +- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify + +## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm + +## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional + +## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" + +## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost +- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign +- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute + +## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function + +## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option + +## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/node_modules/qs/LICENSE b/node_modules/qs/LICENSE new file mode 100755 index 00000000..d4569487 --- /dev/null +++ b/node_modules/qs/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014 Nathan LaFreniere and other contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors diff --git a/node_modules/qs/README.md b/node_modules/qs/README.md new file mode 100755 index 00000000..32fc3123 --- /dev/null +++ b/node_modules/qs/README.md @@ -0,0 +1,440 @@ +# qs + +A querystring parsing and stringifying library with some added security. + +[![Build Status](https://api.travis-ci.org/ljharb/qs.svg)](http://travis-ci.org/ljharb/qs) + +Lead Maintainer: [Jordan Harband](https://github.com/ljharb) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var qs = require('qs'); +var assert = require('assert'); + +var obj = qs.parse('a=c'); +assert.deepEqual(obj, { a: 'c' }); + +var str = qs.stringify(obj); +assert.equal(str, 'a=c'); +``` + +### Parsing Objects + +[](#preventEval) +```javascript +qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +assert.deepEqual(qs.parse('foo[bar]=baz'), { + foo: { + bar: 'baz' + } +}); +``` + +When using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); +assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. + +```javascript +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); +``` + +URI encoded strings work too: + +```javascript +assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } +}); +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' + } + } +}); +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like +`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +}; +var string = 'a[b][c][d][e][f][g][h][i]=j'; +assert.deepEqual(qs.parse(string), expected); +``` + +This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: + +```javascript +var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); +``` + +An optional delimiter can also be passed: + +```javascript +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { a: 'b', c: 'd' }); +``` + +Delimiters can be a regular expression too: + +```javascript +var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); +``` + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); +``` + +You may specify an index as well: + +```javascript +var withIndexes = qs.parse('a[1]=c&a[0]=b'); +assert.deepEqual(withIndexes, { a: ['b', 'c'] }); +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number +to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving +their order: + +```javascript +var noSparse = qs.parse('a[1]=b&a[15]=c'); +assert.deepEqual(noSparse, { a: ['b', 'c'] }); +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +var withEmptyString = qs.parse('a[]=&a[]=b'); +assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + +var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); +assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); +``` + +**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will +instead be converted to an object with the index as the key: + +```javascript +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); +assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); +``` + +To disable array parsing entirely, set `parseArrays` to `false`. + +```javascript +var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); +assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +var mixedNotation = qs.parse('a[0]=b&a[b]=c'); +assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); +``` + +You can also create arrays of objects: + +```javascript +var arraysOfObjects = qs.parse('a[][b]=c'); +assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); +``` + +### Stringifying + +[](#preventEval) +```javascript +qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); +assert.equal(unencoded, 'a[b]=c'); +``` + +Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: +```javascript +var encodedValues = qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true } +) +assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); +``` + +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, by default they are given explicit indices: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array: + +```javascript +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +``` + +When objects are stringified, by default they use bracket notation: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); +// 'a[b][c]=d&a[b][e]=f' +``` + +You may override this to use dot notation by setting the `allowDots` option to `true`: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); +// 'a.b.c=d&a.b.e=f' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +assert.equal(qs.stringify({ a: '' }), 'a='); +``` + +Key with no values (such as an empty object or array) will return nothing: + +```javascript +assert.equal(qs.stringify({ a: [] }), ''); +assert.equal(qs.stringify({ a: {} }), ''); +assert.equal(qs.stringify({ a: [{}] }), ''); +assert.equal(qs.stringify({ a: { b: []} }), ''); +assert.equal(qs.stringify({ a: { b: {}} }), ''); +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); +``` + +The delimiter may be overridden with stringify as well: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); +``` + +If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: + +```javascript +var date = new Date(7); +assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); +assert.equal( + qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), + 'a=7' +); +``` + +You may use the `sort` option to affect the order of parameter keys: + +```javascript +function alphabeticalSort(a, b) { + return a.localeCompare(b); +} +assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you +pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); +// 'a=b&c=d&e[f]=123&e[g][0]=4' +qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); +// 'a=b&e=f' +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); +// 'a[0]=b&a[2]=d' +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +var withNull = qs.stringify({ a: null, b: '' }); +assert.equal(withNull, 'a=&b='); +``` + +Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. + +```javascript +var equalsInsensitive = qs.parse('a&b='); +assert.deepEqual(equalsInsensitive, { a: '', b: '' }); +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +assert.equal(strictNull, 'a&b='); +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); +assert.deepEqual(parsedStrictNull, { a: null, b: '' }); +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); +assert.equal(nullsSkipped, 'a=b'); +``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`. If you +wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` + +### RFC 3986 and RFC 1738 space encoding + +RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. +In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. + +``` +assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); +``` diff --git a/node_modules/qs/dist/qs.js b/node_modules/qs/dist/qs.js new file mode 100755 index 00000000..2d0d63ff --- /dev/null +++ b/node_modules/qs/dist/qs.js @@ -0,0 +1,597 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0 && + (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = parseObject(chain, val, options); + } else { + obj[cleanRoot] = parseObject(chain, val, options); + } + } + + return obj; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + // Get the parent + + var segment = brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + // Stash the parent if it exists + + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options); +}; + +module.exports = function (str, opts) { + var options = opts || {}; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options); + obj = utils.merge(obj, newObj, options); + } + + return utils.compact(obj); +}; + +},{"./utils":5}],4:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); +var formats = require('./formats'); + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { // eslint-disable-line func-name-matching + return prefix + '[]'; + }, + indices: function indices(prefix, key) { // eslint-disable-line func-name-matching + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { // eslint-disable-line func-name-matching + return prefix; + } +}; + +var toISO = Date.prototype.toISOString; + +var defaults = { + delimiter: '&', + encode: true, + encoder: utils.encode, + encodeValuesOnly: false, + serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var stringify = function stringify( // eslint-disable-line func-name-matching + object, + prefix, + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly +) { + var obj = object; + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix) : prefix; + } + + obj = ''; + } + + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix); + return [formatter(keyValue) + '=' + formatter(encoder(obj))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + if (Array.isArray(obj)) { + values = values.concat(stringify( + obj[key], + generateArrayPrefix(prefix, key), + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } else { + values = values.concat(stringify( + obj[key], + prefix + (allowDots ? '.' + key : '[' + key + ']'), + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } + } + + return values; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = opts || {}; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; + var sort = typeof options.sort === 'function' ? options.sort : null; + var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; + var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; + var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; + if (typeof options.format === 'undefined') { + options.format = formats.default; + } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { + throw new TypeError('Unknown format option provided.'); + } + var formatter = formats.formatters[options.format]; + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (Array.isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + if (options.arrayFormat in arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (sort) { + objKeys.sort(sort); + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + keys = keys.concat(stringify( + obj[key], + key, + generateArrayPrefix, + strictNullHandling, + skipNulls, + encode ? encoder : null, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } + + return keys.join(delimiter); +}; + +},{"./formats":1,"./utils":5}],5:[function(require,module,exports){ +'use strict'; + +var has = Object.prototype.hasOwnProperty; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}()); + +exports.arrayToObject = function (source, options) { + var obj = options && options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +exports.merge = function (target, source, options) { + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } else if (typeof target === 'object') { + if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); + } + + if (Array.isArray(target) && Array.isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + if (target[i] && typeof target[i] === 'object') { + target[i] = exports.merge(target[i], item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +exports.decode = function (str) { + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } +}; + +exports.encode = function (str) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = typeof str === 'string' ? str : String(str); + + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); + + if ( + c === 0x2D || // - + c === 0x2E || // . + c === 0x5F || // _ + c === 0x7E || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5A) || // a-z + (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); + continue; + } + + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } + + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; // eslint-disable-line max-len + } + + return out; +}; + +exports.compact = function (obj, references) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + + var refs = references || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0; i < obj.length; ++i) { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + keys.forEach(function (key) { + obj[key] = exports.compact(obj[key], refs); + }); + + return obj; +}; + +exports.isRegExp = function (obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +exports.isBuffer = function (obj) { + if (obj === null || typeof obj === 'undefined') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +},{}]},{},[2])(2) +}); \ No newline at end of file diff --git a/node_modules/qs/lib/formats.js b/node_modules/qs/lib/formats.js new file mode 100755 index 00000000..df459975 --- /dev/null +++ b/node_modules/qs/lib/formats.js @@ -0,0 +1,18 @@ +'use strict'; + +var replace = String.prototype.replace; +var percentTwenties = /%20/g; + +module.exports = { + 'default': 'RFC3986', + formatters: { + RFC1738: function (value) { + return replace.call(value, percentTwenties, '+'); + }, + RFC3986: function (value) { + return value; + } + }, + RFC1738: 'RFC1738', + RFC3986: 'RFC3986' +}; diff --git a/node_modules/qs/lib/index.js b/node_modules/qs/lib/index.js new file mode 100755 index 00000000..0d6a97dc --- /dev/null +++ b/node_modules/qs/lib/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var stringify = require('./stringify'); +var parse = require('./parse'); +var formats = require('./formats'); + +module.exports = { + formats: formats, + parse: parse, + stringify: stringify +}; diff --git a/node_modules/qs/lib/parse.js b/node_modules/qs/lib/parse.js new file mode 100755 index 00000000..1307e9d7 --- /dev/null +++ b/node_modules/qs/lib/parse.js @@ -0,0 +1,167 @@ +'use strict'; + +var utils = require('./utils'); + +var has = Object.prototype.hasOwnProperty; + +var defaults = { + allowDots: false, + allowPrototypes: false, + arrayLimit: 20, + decoder: utils.decode, + delimiter: '&', + depth: 5, + parameterLimit: 1000, + plainObjects: false, + strictNullHandling: false +}; + +var parseValues = function parseQueryStringValues(str, options) { + var obj = {}; + var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); + + for (var i = 0; i < parts.length; ++i) { + var part = parts[i]; + var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + + var key, val; + if (pos === -1) { + key = options.decoder(part); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos)); + val = options.decoder(part.slice(pos + 1)); + } + if (has.call(obj, key)) { + obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function parseObjectRecursive(chain, val, options) { + if (!chain.length) { + return val; + } + + var root = chain.shift(); + + var obj; + if (root === '[]') { + obj = []; + obj = obj.concat(parseObject(chain, val, options)); + } else { + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var index = parseInt(cleanRoot, 10); + if ( + !isNaN(index) && + root !== cleanRoot && + String(index) === cleanRoot && + index >= 0 && + (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = parseObject(chain, val, options); + } else { + obj[cleanRoot] = parseObject(chain, val, options); + } + } + + return obj; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + // Get the parent + + var segment = brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + // Stash the parent if it exists + + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options); +}; + +module.exports = function (str, opts) { + var options = opts || {}; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options); + obj = utils.merge(obj, newObj, options); + } + + return utils.compact(obj); +}; diff --git a/node_modules/qs/lib/stringify.js b/node_modules/qs/lib/stringify.js new file mode 100755 index 00000000..7694988c --- /dev/null +++ b/node_modules/qs/lib/stringify.js @@ -0,0 +1,207 @@ +'use strict'; + +var utils = require('./utils'); +var formats = require('./formats'); + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { // eslint-disable-line func-name-matching + return prefix + '[]'; + }, + indices: function indices(prefix, key) { // eslint-disable-line func-name-matching + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { // eslint-disable-line func-name-matching + return prefix; + } +}; + +var toISO = Date.prototype.toISOString; + +var defaults = { + delimiter: '&', + encode: true, + encoder: utils.encode, + encodeValuesOnly: false, + serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var stringify = function stringify( // eslint-disable-line func-name-matching + object, + prefix, + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly +) { + var obj = object; + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix) : prefix; + } + + obj = ''; + } + + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix); + return [formatter(keyValue) + '=' + formatter(encoder(obj))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + if (Array.isArray(obj)) { + values = values.concat(stringify( + obj[key], + generateArrayPrefix(prefix, key), + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } else { + values = values.concat(stringify( + obj[key], + prefix + (allowDots ? '.' + key : '[' + key + ']'), + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } + } + + return values; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = opts || {}; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; + var sort = typeof options.sort === 'function' ? options.sort : null; + var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; + var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; + var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; + if (typeof options.format === 'undefined') { + options.format = formats.default; + } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { + throw new TypeError('Unknown format option provided.'); + } + var formatter = formats.formatters[options.format]; + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (Array.isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + if (options.arrayFormat in arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (sort) { + objKeys.sort(sort); + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + keys = keys.concat(stringify( + obj[key], + key, + generateArrayPrefix, + strictNullHandling, + skipNulls, + encode ? encoder : null, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } + + return keys.join(delimiter); +}; diff --git a/node_modules/qs/lib/utils.js b/node_modules/qs/lib/utils.js new file mode 100755 index 00000000..b2143323 --- /dev/null +++ b/node_modules/qs/lib/utils.js @@ -0,0 +1,182 @@ +'use strict'; + +var has = Object.prototype.hasOwnProperty; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}()); + +exports.arrayToObject = function (source, options) { + var obj = options && options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +exports.merge = function (target, source, options) { + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } else if (typeof target === 'object') { + if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); + } + + if (Array.isArray(target) && Array.isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + if (target[i] && typeof target[i] === 'object') { + target[i] = exports.merge(target[i], item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +exports.decode = function (str) { + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } +}; + +exports.encode = function (str) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = typeof str === 'string' ? str : String(str); + + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); + + if ( + c === 0x2D || // - + c === 0x2E || // . + c === 0x5F || // _ + c === 0x7E || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5A) || // a-z + (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); + continue; + } + + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } + + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; // eslint-disable-line max-len + } + + return out; +}; + +exports.compact = function (obj, references) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + + var refs = references || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0; i < obj.length; ++i) { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + keys.forEach(function (key) { + obj[key] = exports.compact(obj[key], refs); + }); + + return obj; +}; + +exports.isRegExp = function (obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +exports.isBuffer = function (obj) { + if (obj === null || typeof obj === 'undefined') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; diff --git a/node_modules/qs/package.json b/node_modules/qs/package.json new file mode 100755 index 00000000..5c4fe24f --- /dev/null +++ b/node_modules/qs/package.json @@ -0,0 +1,121 @@ +{ + "_args": [ + [ + { + "raw": "qs@6.4.0", + "scope": null, + "escapedName": "qs", + "name": "qs", + "rawSpec": "6.4.0", + "spec": "6.4.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "qs@6.4.0", + "_id": "qs@6.4.0", + "_inCache": true, + "_location": "/qs", + "_nodeVersion": "7.7.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/qs-6.4.0.tgz_1488783808282_0.7979955193586648" + }, + "_npmUser": { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "qs@6.4.0", + "scope": null, + "escapedName": "qs", + "name": "qs", + "rawSpec": "6.4.0", + "spec": "6.4.0", + "type": "version" + }, + "_requiredBy": [ + "/express" + ], + "_resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "_shasum": "13e26d28ad6b0ffaa91312cd3bf708ed351e7233", + "_shrinkwrap": null, + "_spec": "qs@6.4.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "bugs": { + "url": "https://github.com/ljharb/qs/issues" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": {}, + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "devDependencies": { + "@ljharb/eslint-config": "^11.0.0", + "browserify": "^14.1.0", + "covert": "^1.1.0", + "eslint": "^3.17.0", + "evalmd": "^0.0.17", + "iconv-lite": "^0.4.15", + "mkdirp": "^0.5.1", + "parallelshell": "^2.0.0", + "qs-iconv": "^1.0.4", + "safe-publish-latest": "^1.1.1", + "tape": "^4.6.3" + }, + "directories": {}, + "dist": { + "shasum": "13e26d28ad6b0ffaa91312cd3bf708ed351e7233", + "tarball": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz" + }, + "engines": { + "node": ">=0.6" + }, + "gitHead": "c7f87b8d2eedd377f6ace065655201f51bee6334", + "homepage": "https://github.com/ljharb/qs", + "keywords": [ + "querystring", + "qs" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hammer.io" + }, + { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + { + "name": "nlf", + "email": "quitlahok@gmail.com" + } + ], + "name": "qs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/qs.git" + }, + "scripts": { + "coverage": "covert test", + "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", + "lint": "eslint lib/*.js test/*.js", + "prepublish": "safe-publish-latest && npm run dist", + "pretest": "npm run --silent readme && npm run --silent lint", + "readme": "evalmd README.md", + "test": "npm run --silent coverage", + "tests-only": "node test" + }, + "version": "6.4.0" +} diff --git a/node_modules/qs/test/.eslintrc b/node_modules/qs/test/.eslintrc new file mode 100755 index 00000000..c4f52d02 --- /dev/null +++ b/node_modules/qs/test/.eslintrc @@ -0,0 +1,11 @@ +{ + "rules": { + "consistent-return": 2, + "max-lines": 0, + "max-nested-callbacks": [2, 3], + "max-statements": 0, + "no-extend-native": 0, + "no-magic-numbers": 0, + "sort-keys": 0 + } +} diff --git a/node_modules/qs/test/index.js b/node_modules/qs/test/index.js new file mode 100755 index 00000000..5e6bc8fb --- /dev/null +++ b/node_modules/qs/test/index.js @@ -0,0 +1,7 @@ +'use strict'; + +require('./parse'); + +require('./stringify'); + +require('./utils'); diff --git a/node_modules/qs/test/parse.js b/node_modules/qs/test/parse.js new file mode 100755 index 00000000..e451e91f --- /dev/null +++ b/node_modules/qs/test/parse.js @@ -0,0 +1,519 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var iconv = require('iconv-lite'); + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); + + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); + }); + + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); + + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); + }); + + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + + st.end(); + }); + + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); + }); + + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); + }); + + t.test('limits specific array indices to arrayLimit', function (st) { + st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); + + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); + }); + + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); + }); + + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); + }); + + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); + }); + + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); + st.end(); + }); + + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); + }); + + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); + st.end(); + }); + + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); + }); + + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); + st.end(); + }); + + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); + }); + + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); + }); + + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); + st.end(); + }); + + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); + st.end(); + }); + + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); + }); + + t.test('parses buffers correctly', function (st) { + var b = new Buffer('test'); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); + }); + + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); + }); + + t.test('does not error when parsing a very long array', function (st) { + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str = str + '&' + str; + } + + st.doesNotThrow(function () { + qs.parse(str); + }); + + st.end(); + }); + + t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) { + Object.prototype.crash = ''; + Array.prototype.crash = ''; + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + delete Object.prototype.crash; + delete Array.prototype.crash; + st.end(); + }); + + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); + }); + + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + st.end(); + }); + + t.test('allows disabling array parsing', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { 0: 'b', 1: 'c' } }); + st.end(); + }); + + t.test('parses an object', function (st) { + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object in dot notation', function (st) { + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input, { allowDots: true }); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object and not child values', function (st) { + var input = { + 'user[name]': { 'pop[bob]': { test: 3 } }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': { test: 3 } }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = qs.parse('a=b&c=d'); + global.Buffer = tempBuffer; + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); + }); + + t.test('parses null objects correctly', { skip: !Object.create }, function (st) { + var a = Object.create(null); + a.b = 'c'; + + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); + }); + + t.test('parses dates correctly', function (st) { + var now = new Date(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); + }); + + t.test('parses regular expressions correctly', function (st) { + var re = /^test$/; + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); + }); + + t.test('does not allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: false }), + {}, + 'bare "toString" results in {}' + ); + + st.end(); + }); + + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: true }), + { toString: '' }, + 'bare "toString" results in { toString: "" }' + ); + + st.end(); + }); + + t.test('params starting with a closing bracket', function (st) { + st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); + st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); + st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); + st.end(); + }); + + t.test('params starting with a starting bracket', function (st) { + st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); + st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); + st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); + st.end(); + }); + + t.test('add keys to objects', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d'), + { a: { b: 'c', d: true } }, + 'can add keys to objects' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString'), + { a: { b: 'c' } }, + 'can not overwrite prototype' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { allowPrototypes: true }), + { a: { b: 'c', toString: true } }, + 'can overwrite prototype with allowPrototypes true' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { plainObjects: true }), + { a: { b: 'c', toString: true } }, + 'can overwrite prototype with plainObjects true' + ); + + st.end(); + }); + + t.test('can return null objects', { skip: !Object.create }, function (st) { + var expected = Object.create(null); + expected.a = Object.create(null); + expected.a.b = 'c'; + expected.a.hasOwnProperty = 'd'; + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null)); + var expectedArray = Object.create(null); + expectedArray.a = Object.create(null); + expectedArray.a[0] = 'b'; + expectedArray.a.c = 'd'; + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); + }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /%([0-9A-F]{2})/ig; + var result = []; + var parts = reg.exec(str); + while (parts) { + result.push(parseInt(parts[1], 16)); + parts = reg.exec(str); + } + return iconv.decode(new Buffer(result), 'shift_jis').toString(); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st.throws(function () { + qs.parse({}, { decoder: 'string' }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); +}); diff --git a/node_modules/qs/test/stringify.js b/node_modules/qs/test/stringify.js new file mode 100755 index 00000000..711dae50 --- /dev/null +++ b/node_modules/qs/test/stringify.js @@ -0,0 +1,567 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var iconv = require('iconv-lite'); + +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); + }); + + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies a nested object with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); + st.end(); + }); + + t.test('stringifies an array value', function (st) { + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), + 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'default => indices' + ); + st.end(); + }); + + t.test('omits nulls when asked', function (st) { + st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b'); + st.end(); + }); + + t.test('omits nested nulls when asked', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + st.end(); + }); + + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); + st.end(); + }); + + t.test('stringifies a nested array value with dots notation', function (st) { + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a.b[0]=c&a.b[1]=d', + 'indices: stringifies with dots + indices' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a.b[]=c&a.b[]=d', + 'brackets: stringifies with dots + brackets' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encode: false } + ), + 'a.b[0]=c&a.b[1]=d', + 'default: stringifies with dots + indices' + ); + st.end(); + }); + + t.test('stringifies an object inside an array', function (st) { + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }), + 'a%5B0%5D%5Bb%5D=c', + 'indices => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }), + 'a%5B%5D%5Bb%5D=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }), + 'a%5B0%5D%5Bb%5D=c', + 'default => indices' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices' }), + 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1', + 'indices => indices' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets' }), + 'a%5B%5D%5Bb%5D%5Bc%5D%5B%5D=1', + 'brackets => brackets' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }), + 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }), + 'a[][b]=1&a[]=2&a[]=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an object inside an array with dots notation', function (st) { + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b=c', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false } + ), + 'a[0].b=c', + 'default => indices' + ); + + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b.c[0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b.c[]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false } + ), + 'a[0].b.c[0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); + }); + + t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); + }); + + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); + + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); + + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); + + st.end(); + }); + + t.test('stringifies a null object', { skip: !Object.create }, function (st) { + var obj = Object.create(null); + obj.a = 'b'; + st.equal(qs.stringify(obj), 'a=b'); + st.end(); + }); + + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); + }); + + t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) { + var obj = { a: Object.create(null) }; + + obj.a.b = 'c'; + st.equal(qs.stringify(obj), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); + + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); + }); + + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('stringifies a date', function (st) { + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + st.equal(qs.stringify({ a: now }), str); + st.end(); + }); + + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); + }); + + t.test('skips properties that are part of the object prototype', function (st) { + Object.prototype.crash = 'test'; + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + delete Object.prototype.crash; + st.end(); + }); + + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: new Buffer('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: new Buffer('test') } }), 'a%5Bb%5D=test'); + st.end(); + }); + + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); + }); + + t.test('doesn\'t blow up when Buffer global is missing', function (st) { + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = qs.stringify({ a: 'b', c: 'd' }); + global.Buffer = tempBuffer; + st.equal(result, 'a=b&c=d'); + st.end(); + }); + + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } + ), + 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2] } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('supports custom representations when filter=function', function (st) { + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + calls += 1; + if (calls === 1) { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { + return void 0; + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); + return value.getTime(); + } + return value; + }; + + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); + }); + + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); + + t.test('can sort the keys', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); + }); + + t.test('can sort the keys at depth 3 or more too', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: sort, encode: false } + ), + 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' + ); + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: null, encode: false } + ), + 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' + ); + st.end(); + }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': '' }, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i = 0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st.throws(function () { + qs.stringify({}, { encoder: 'string' }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { + st.equal(qs.stringify({ a: new Buffer([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + st.end(); + }); + + t.test('serializeDate option', function (st) { + var date = new Date(); + st.equal( + qs.stringify({ a: date }), + 'a=' + date.toISOString().replace(/:/g, '%3A'), + 'default is toISOString' + ); + + var mutatedDate = new Date(); + mutatedDate.toISOString = function () { + throw new SyntaxError(); + }; + st.throws(function () { + mutatedDate.toISOString(); + }, SyntaxError); + st.equal( + qs.stringify({ a: mutatedDate }), + 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), + 'toISOString works even when method is not locally present' + ); + + var specificDate = new Date(6); + st.equal( + qs.stringify( + { a: specificDate }, + { serializeDate: function (d) { return d.getTime() * 7; } } + ), + 'a=42', + 'custom serializeDate function called' + ); + + st.end(); + }); + + t.test('RFC 1738 spaces serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); + st.end(); + }); + + t.test('RFC 3986 spaces serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); + st.end(); + }); + + t.test('Backward compatibility to RFC 3986', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('Edge cases and unknown formats', function (st) { + ['UFO1234', false, 1234, null, {}, []].forEach( + function (format) { + st.throws( + function () { + qs.stringify({ a: 'b c' }, { format: format }); + }, + new TypeError('Unknown format option provided.') + ); + } + ); + st.end(); + }); + + t.test('encodeValuesOnly', function (st) { + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true } + ), + 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] } + ), + 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h' + ); + st.end(); + }); + + t.test('encodeValuesOnly - strictNullHandling', function (st) { + st.equal( + qs.stringify( + { a: { b: null } }, + { encodeValuesOnly: true, strictNullHandling: true } + ), + 'a[b]' + ); + st.end(); + }); + +}); diff --git a/node_modules/qs/test/utils.js b/node_modules/qs/test/utils.js new file mode 100755 index 00000000..0721dd8e --- /dev/null +++ b/node_modules/qs/test/utils.js @@ -0,0 +1,22 @@ +'use strict'; + +var test = require('tape'); +var utils = require('../lib/utils'); + +test('merge()', function (t) { + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + + var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); + t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); + + var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); + t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); + + var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); + t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); + + var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); + t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); + + t.end(); +}); diff --git a/node_modules/querystring-es3/.travis.yml b/node_modules/querystring-es3/.travis.yml new file mode 100755 index 00000000..895dbd36 --- /dev/null +++ b/node_modules/querystring-es3/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/querystring-es3/History.md b/node_modules/querystring-es3/History.md new file mode 100755 index 00000000..4fddbaf7 --- /dev/null +++ b/node_modules/querystring-es3/History.md @@ -0,0 +1,20 @@ +# 0.2.0 / 2013-02-21 + + - Refactor into function per-module idiomatic style. + - Improved test coverage. + +# 0.1.0 / 2011-12-13 + + - Minor project reorganization + +# 0.0.3 / 2011-04-16 + - Support for AMD module loaders + +# 0.0.2 / 2011-04-16 + + - Ported unit tests + - Removed functionality that depended on Buffers + +# 0.0.1 / 2011-04-15 + + - Initial release diff --git a/node_modules/querystring-es3/License.md b/node_modules/querystring-es3/License.md new file mode 100755 index 00000000..fc80e85f --- /dev/null +++ b/node_modules/querystring-es3/License.md @@ -0,0 +1,19 @@ + +Copyright 2012 Irakli Gozalishvili. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/querystring-es3/Readme.md b/node_modules/querystring-es3/Readme.md new file mode 100755 index 00000000..be1668df --- /dev/null +++ b/node_modules/querystring-es3/Readme.md @@ -0,0 +1,15 @@ +# querystring + +[![Build Status](https://secure.travis-ci.org/mike-spainhower/querystring.png)](http://travis-ci.org/mike-spainhower/querystring) + + +[![Browser support](http://ci.testling.com/mike-spainhower/querystring.png)](http://ci.testling.com/mike-spainhower/querystring) + + + +Node's querystring module for all engines. + +## Install ## + + npm install querystring + diff --git a/node_modules/querystring-es3/decode.js b/node_modules/querystring-es3/decode.js new file mode 100755 index 00000000..b5825c0b --- /dev/null +++ b/node_modules/querystring-es3/decode.js @@ -0,0 +1,84 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/node_modules/querystring-es3/encode.js b/node_modules/querystring-es3/encode.js new file mode 100755 index 00000000..76e4cfb0 --- /dev/null +++ b/node_modules/querystring-es3/encode.js @@ -0,0 +1,85 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; diff --git a/node_modules/querystring-es3/index.js b/node_modules/querystring-es3/index.js new file mode 100755 index 00000000..99826ea8 --- /dev/null +++ b/node_modules/querystring-es3/index.js @@ -0,0 +1,4 @@ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); diff --git a/node_modules/querystring-es3/package.json b/node_modules/querystring-es3/package.json new file mode 100755 index 00000000..e0bda7e1 --- /dev/null +++ b/node_modules/querystring-es3/package.json @@ -0,0 +1,132 @@ +{ + "_args": [ + [ + { + "raw": "querystring-es3@^0.2.0", + "scope": null, + "escapedName": "querystring-es3", + "name": "querystring-es3", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser" + ] + ], + "_from": "querystring-es3@>=0.2.0 <0.3.0", + "_id": "querystring-es3@0.2.1", + "_inCache": true, + "_location": "/querystring-es3", + "_nodeVersion": "0.10.26", + "_npmUser": { + "name": "spaintrain", + "email": "mc.s.pain.how.er+npm@gmail.com" + }, + "_npmVersion": "2.0.2", + "_phantomChildren": {}, + "_requested": { + "raw": "querystring-es3@^0.2.0", + "scope": null, + "escapedName": "querystring-es3", + "name": "querystring-es3", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/node-libs-browser" + ], + "_resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "_shasum": "9ec61f79049875707d69414596fd907a4d711e73", + "_shrinkwrap": null, + "_spec": "querystring-es3@^0.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/node-libs-browser", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com" + }, + "bugs": { + "url": "http://github.com/mike-spainhower/querystring/issues/" + }, + "dependencies": {}, + "description": "Node's querystring module for all engines. (ES3 compat fork)", + "devDependencies": { + "phantomify": "~0.x.0", + "retape": "~0.x.0", + "tape": "~0.1.5", + "test": "~0.x.0" + }, + "directories": {}, + "dist": { + "shasum": "9ec61f79049875707d69414596fd907a4d711e73", + "tarball": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz" + }, + "engines": { + "node": ">=0.4.x" + }, + "gitHead": "c58e18a37d9970e13a84dcc421ab682c7836fad2", + "homepage": "https://github.com/mike-spainhower/querystring", + "id": "querystring-es3", + "keywords": [ + "commonjs", + "query", + "querystring" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/Gozala/enchain/License.md" + } + ], + "maintainers": [ + { + "name": "spaintrain", + "email": "mc.s.pain.how.er+npm@gmail.com" + } + ], + "name": "querystring-es3", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mike-spainhower/querystring.git", + "web": "https://github.com/mike-spainhower/querystring" + }, + "scripts": { + "test": "npm run test-node && npm run test-browser && npm run test-tap", + "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", + "test-node": "node ./test/common-index.js", + "test-tap": "node ./test/tap-index.js" + }, + "testling": { + "files": "test/tap-index.js", + "browsers": { + "iexplore": [ + 9, + 10 + ], + "chrome": [ + 16, + 20, + 25, + "canary" + ], + "firefox": [ + 10, + 15, + 16, + 17, + 18, + "nightly" + ], + "safari": [ + 5, + 6 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.2.1" +} diff --git a/node_modules/querystring-es3/test/common-index.js b/node_modules/querystring-es3/test/common-index.js new file mode 100755 index 00000000..f356f987 --- /dev/null +++ b/node_modules/querystring-es3/test/common-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("test").run(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring-es3/test/index.js b/node_modules/querystring-es3/test/index.js new file mode 100755 index 00000000..62eb2ac8 --- /dev/null +++ b/node_modules/querystring-es3/test/index.js @@ -0,0 +1,210 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +"use strict"; + +// test using assert +var qs = require('../'); + +// folding block, commented to pass gjslint +// {{{ +// [ wonkyQS, canonicalQS, obj ] +var qsTestCases = [ + ['foo=918854443121279438895193', + 'foo=918854443121279438895193', + {'foo': '918854443121279438895193'}], + ['foo=bar', 'foo=bar', {'foo': 'bar'}], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}], + ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}], + ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', + {'my weird field': 'q1!2"\'w$5&7/z8)?' }], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}], + ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}], + ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + 'str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + { 'str': 'foo', + 'arr': ['1', '2', '3'], + 'somenull': '', + 'undef': ''}], + [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}], + // disable test that fails ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }], + // See: https://github.com/joyent/node/issues/1707 + ['hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + 'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + { hasOwnProperty: 'x', + toString: 'foo', + valueOf: 'bar', + __defineGetter__: 'baz' }], + // See: https://github.com/joyent/node/issues/3058 + ['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }] +]; + +// [ wonkyQS, canonicalQS, obj ] +var qsColonTestCases = [ + ['foo:bar', 'foo:bar', {'foo': 'bar'}], + ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}], + ['foo:1&bar:2;baz:quux', + 'foo:1%26bar%3A2;baz:quux', + {'foo': '1&bar:2', 'baz': 'quux'}], + ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}], + ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}] +]; + +// [wonkyObj, qs, canonicalObj] +var extendedFunction = function() {}; +extendedFunction.prototype = {a: 'b'}; +var qsWeirdObjects = [ + [{regexp: /./g}, 'regexp=', {'regexp': ''}], + [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}], + [{fn: function() {}}, 'fn=', {'fn': ''}], + [{fn: new Function('')}, 'fn=', {'fn': ''}], + [{math: Math}, 'math=', {'math': ''}], + [{e: extendedFunction}, 'e=', {'e': ''}], + [{d: new Date()}, 'd=', {'d': ''}], + [{d: Date}, 'd=', {'d': ''}], + [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}], + [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}], + [{n: null}, 'n=', {'n': ''}], + [{nan: NaN}, 'nan=', {'nan': ''}], + [{inf: Infinity}, 'inf=', {'inf': ''}] +]; +// }}} + +var qsNoMungeTestCases = [ + ['', {}], + ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], + ['blah=burp', {'blah': 'burp'}], + ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}], + ['frappucino=muffin&goat%5B%5D=scone&pond=moose', + {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}], + ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}] +]; + +exports['test basic'] = function(assert) { + assert.strictEqual('918854443121279438895193', + qs.parse('id=918854443121279438895193').id, + 'prase id=918854443121279438895193'); +}; + +exports['test that the canonical qs is parsed properly'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0]), + 'parse ' + testCase[0]); + }); +}; + + +exports['test that the colon test cases can do the same'] = function(assert) { + qsColonTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':'), + 'parse ' + testCase[0] + ' -> ; :'); + }); +}; + +exports['test the weird objects, that they get parsed properly'] = function(assert) { + qsWeirdObjects.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[1]), + 'parse ' + testCase[1]); + }); +}; + +exports['test non munge test cases'] = function(assert) { + qsNoMungeTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), + 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); + }); +}; + +exports['test the nested qs-in-qs case'] = function(assert) { + var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); + f.q = qs.parse(f.q); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a=b&q=x%3Dy%26y%3Dz'); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); + f.q = qs.parse(f.q, ';', ':'); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); +}; + +exports['test stringifying'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2]), + 'stringify ' + JSON.stringify(testCase[2])); + }); + + qsColonTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), + 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); + }); + + qsWeirdObjects.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[0]), + 'stringify ' + JSON.stringify(testCase[0])); + }); +}; + +exports['test stringifying nested'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) + }); + assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + })); + + var threw = false; + try { qs.parse(undefined); } catch(error) { threw = true; } + assert.ok(!threw, "does not throws on undefined"); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') + }, ';', ':'); + assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', + 'stringify ' + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + }) + ' -> ; : '); + + + assert.deepEqual({}, qs.parse(), 'parse undefined'); +}; diff --git a/node_modules/querystring-es3/test/tap-index.js b/node_modules/querystring-es3/test/tap-index.js new file mode 100755 index 00000000..70679b3f --- /dev/null +++ b/node_modules/querystring-es3/test/tap-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("retape")(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring/.travis.yml b/node_modules/querystring/.travis.yml new file mode 100755 index 00000000..895dbd36 --- /dev/null +++ b/node_modules/querystring/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/querystring/History.md b/node_modules/querystring/History.md new file mode 100755 index 00000000..4fddbaf7 --- /dev/null +++ b/node_modules/querystring/History.md @@ -0,0 +1,20 @@ +# 0.2.0 / 2013-02-21 + + - Refactor into function per-module idiomatic style. + - Improved test coverage. + +# 0.1.0 / 2011-12-13 + + - Minor project reorganization + +# 0.0.3 / 2011-04-16 + - Support for AMD module loaders + +# 0.0.2 / 2011-04-16 + + - Ported unit tests + - Removed functionality that depended on Buffers + +# 0.0.1 / 2011-04-15 + + - Initial release diff --git a/node_modules/querystring/License.md b/node_modules/querystring/License.md new file mode 100755 index 00000000..fc80e85f --- /dev/null +++ b/node_modules/querystring/License.md @@ -0,0 +1,19 @@ + +Copyright 2012 Irakli Gozalishvili. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/querystring/Readme.md b/node_modules/querystring/Readme.md new file mode 100755 index 00000000..a4fe2520 --- /dev/null +++ b/node_modules/querystring/Readme.md @@ -0,0 +1,15 @@ +# querystring + +[![Build Status](https://secure.travis-ci.org/Gozala/querystring.png)](http://travis-ci.org/Gozala/querystring) + + +[![Browser support](http://ci.testling.com/Gozala/querystring.png)](http://ci.testling.com/Gozala/querystring) + + + +Node's querystring module for all engines. + +## Install ## + + npm install querystring + diff --git a/node_modules/querystring/decode.js b/node_modules/querystring/decode.js new file mode 100755 index 00000000..a6518b8f --- /dev/null +++ b/node_modules/querystring/decode.js @@ -0,0 +1,80 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; diff --git a/node_modules/querystring/encode.js b/node_modules/querystring/encode.js new file mode 100755 index 00000000..4f2b561b --- /dev/null +++ b/node_modules/querystring/encode.js @@ -0,0 +1,64 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return Object.keys(obj).map(function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (Array.isArray(obj[k])) { + return obj[k].map(function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; diff --git a/node_modules/querystring/index.js b/node_modules/querystring/index.js new file mode 100755 index 00000000..99826ea8 --- /dev/null +++ b/node_modules/querystring/index.js @@ -0,0 +1,4 @@ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); diff --git a/node_modules/querystring/package.json b/node_modules/querystring/package.json new file mode 100755 index 00000000..725ead05 --- /dev/null +++ b/node_modules/querystring/package.json @@ -0,0 +1,130 @@ +{ + "_args": [ + [ + { + "raw": "querystring@0.2.0", + "scope": null, + "escapedName": "querystring", + "name": "querystring", + "rawSpec": "0.2.0", + "spec": "0.2.0", + "type": "version" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/url" + ] + ], + "_from": "querystring@0.2.0", + "_id": "querystring@0.2.0", + "_inCache": true, + "_location": "/querystring", + "_npmUser": { + "name": "gozala", + "email": "rfobic@gmail.com" + }, + "_npmVersion": "1.1.65", + "_phantomChildren": {}, + "_requested": { + "raw": "querystring@0.2.0", + "scope": null, + "escapedName": "querystring", + "name": "querystring", + "rawSpec": "0.2.0", + "spec": "0.2.0", + "type": "version" + }, + "_requiredBy": [ + "/url" + ], + "_resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "_shasum": "b209849203bb25df820da756e747005878521620", + "_shrinkwrap": null, + "_spec": "querystring@0.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/url", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com" + }, + "bugs": { + "url": "http://github.com/Gozala/querystring/issues/" + }, + "dependencies": {}, + "description": "Node's querystring module for all engines.", + "devDependencies": { + "phantomify": "~0.x.0", + "retape": "~0.x.0", + "tape": "~0.1.5", + "test": "~0.x.0" + }, + "directories": {}, + "dist": { + "shasum": "b209849203bb25df820da756e747005878521620", + "tarball": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz" + }, + "engines": { + "node": ">=0.4.x" + }, + "homepage": "https://github.com/Gozala/querystring#readme", + "id": "querystring", + "keywords": [ + "commonjs", + "query", + "querystring" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/Gozala/enchain/License.md" + } + ], + "maintainers": [ + { + "name": "gozala", + "email": "rfobic@gmail.com" + } + ], + "name": "querystring", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/Gozala/querystring.git", + "web": "https://github.com/Gozala/querystring" + }, + "scripts": { + "test": "npm run test-node && npm run test-browser && npm run test-tap", + "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", + "test-node": "node ./test/common-index.js", + "test-tap": "node ./test/tap-index.js" + }, + "testling": { + "files": "test/tap-index.js", + "browsers": { + "iexplore": [ + 9, + 10 + ], + "chrome": [ + 16, + 20, + 25, + "canary" + ], + "firefox": [ + 10, + 15, + 16, + 17, + 18, + "nightly" + ], + "safari": [ + 5, + 6 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.2.0" +} diff --git a/node_modules/querystring/test/common-index.js b/node_modules/querystring/test/common-index.js new file mode 100755 index 00000000..f356f987 --- /dev/null +++ b/node_modules/querystring/test/common-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("test").run(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring/test/index.js b/node_modules/querystring/test/index.js new file mode 100755 index 00000000..62eb2ac8 --- /dev/null +++ b/node_modules/querystring/test/index.js @@ -0,0 +1,210 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +"use strict"; + +// test using assert +var qs = require('../'); + +// folding block, commented to pass gjslint +// {{{ +// [ wonkyQS, canonicalQS, obj ] +var qsTestCases = [ + ['foo=918854443121279438895193', + 'foo=918854443121279438895193', + {'foo': '918854443121279438895193'}], + ['foo=bar', 'foo=bar', {'foo': 'bar'}], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}], + ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}], + ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', + {'my weird field': 'q1!2"\'w$5&7/z8)?' }], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}], + ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}], + ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + 'str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + { 'str': 'foo', + 'arr': ['1', '2', '3'], + 'somenull': '', + 'undef': ''}], + [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}], + // disable test that fails ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }], + // See: https://github.com/joyent/node/issues/1707 + ['hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + 'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + { hasOwnProperty: 'x', + toString: 'foo', + valueOf: 'bar', + __defineGetter__: 'baz' }], + // See: https://github.com/joyent/node/issues/3058 + ['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }] +]; + +// [ wonkyQS, canonicalQS, obj ] +var qsColonTestCases = [ + ['foo:bar', 'foo:bar', {'foo': 'bar'}], + ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}], + ['foo:1&bar:2;baz:quux', + 'foo:1%26bar%3A2;baz:quux', + {'foo': '1&bar:2', 'baz': 'quux'}], + ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}], + ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}] +]; + +// [wonkyObj, qs, canonicalObj] +var extendedFunction = function() {}; +extendedFunction.prototype = {a: 'b'}; +var qsWeirdObjects = [ + [{regexp: /./g}, 'regexp=', {'regexp': ''}], + [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}], + [{fn: function() {}}, 'fn=', {'fn': ''}], + [{fn: new Function('')}, 'fn=', {'fn': ''}], + [{math: Math}, 'math=', {'math': ''}], + [{e: extendedFunction}, 'e=', {'e': ''}], + [{d: new Date()}, 'd=', {'d': ''}], + [{d: Date}, 'd=', {'d': ''}], + [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}], + [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}], + [{n: null}, 'n=', {'n': ''}], + [{nan: NaN}, 'nan=', {'nan': ''}], + [{inf: Infinity}, 'inf=', {'inf': ''}] +]; +// }}} + +var qsNoMungeTestCases = [ + ['', {}], + ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], + ['blah=burp', {'blah': 'burp'}], + ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}], + ['frappucino=muffin&goat%5B%5D=scone&pond=moose', + {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}], + ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}] +]; + +exports['test basic'] = function(assert) { + assert.strictEqual('918854443121279438895193', + qs.parse('id=918854443121279438895193').id, + 'prase id=918854443121279438895193'); +}; + +exports['test that the canonical qs is parsed properly'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0]), + 'parse ' + testCase[0]); + }); +}; + + +exports['test that the colon test cases can do the same'] = function(assert) { + qsColonTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':'), + 'parse ' + testCase[0] + ' -> ; :'); + }); +}; + +exports['test the weird objects, that they get parsed properly'] = function(assert) { + qsWeirdObjects.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[1]), + 'parse ' + testCase[1]); + }); +}; + +exports['test non munge test cases'] = function(assert) { + qsNoMungeTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), + 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); + }); +}; + +exports['test the nested qs-in-qs case'] = function(assert) { + var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); + f.q = qs.parse(f.q); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a=b&q=x%3Dy%26y%3Dz'); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); + f.q = qs.parse(f.q, ';', ':'); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); +}; + +exports['test stringifying'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2]), + 'stringify ' + JSON.stringify(testCase[2])); + }); + + qsColonTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), + 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); + }); + + qsWeirdObjects.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[0]), + 'stringify ' + JSON.stringify(testCase[0])); + }); +}; + +exports['test stringifying nested'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) + }); + assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + })); + + var threw = false; + try { qs.parse(undefined); } catch(error) { threw = true; } + assert.ok(!threw, "does not throws on undefined"); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') + }, ';', ':'); + assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', + 'stringify ' + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + }) + ' -> ; : '); + + + assert.deepEqual({}, qs.parse(), 'parse undefined'); +}; diff --git a/node_modules/querystring/test/tap-index.js b/node_modules/querystring/test/tap-index.js new file mode 100755 index 00000000..70679b3f --- /dev/null +++ b/node_modules/querystring/test/tap-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("retape")(require("./index")) \ No newline at end of file diff --git a/node_modules/querystringify/LICENSE b/node_modules/querystringify/LICENSE new file mode 100755 index 00000000..6dc9316a --- /dev/null +++ b/node_modules/querystringify/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/querystringify/index.js b/node_modules/querystringify/index.js new file mode 100755 index 00000000..e1a2684f --- /dev/null +++ b/node_modules/querystringify/index.js @@ -0,0 +1,61 @@ +'use strict'; + +var has = Object.prototype.hasOwnProperty; + +/** + * Simple query string parser. + * + * @param {String} query The query string that needs to be parsed. + * @returns {Object} + * @api public + */ +function querystring(query) { + var parser = /([^=?&]+)=?([^&]*)/g + , result = {} + , part; + + // + // Little nifty parsing hack, leverage the fact that RegExp.exec increments + // the lastIndex property so we can continue executing this loop until we've + // parsed all results. + // + for (; + part = parser.exec(query); + result[decodeURIComponent(part[1])] = decodeURIComponent(part[2]) + ); + + return result; +} + +/** + * Transform a query string to an object. + * + * @param {Object} obj Object that should be transformed. + * @param {String} prefix Optional prefix. + * @returns {String} + * @api public + */ +function querystringify(obj, prefix) { + prefix = prefix || ''; + + var pairs = []; + + // + // Optionally prefix with a '?' if needed + // + if ('string' !== typeof prefix) prefix = '?'; + + for (var key in obj) { + if (has.call(obj, key)) { + pairs.push(encodeURIComponent(key) +'='+ encodeURIComponent(obj[key])); + } + } + + return pairs.length ? prefix + pairs.join('&') : ''; +} + +// +// Expose the module. +// +exports.stringify = querystringify; +exports.parse = querystring; diff --git a/node_modules/querystringify/package.json b/node_modules/querystringify/package.json new file mode 100755 index 00000000..e9b9963f --- /dev/null +++ b/node_modules/querystringify/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + { + "raw": "querystringify@0.0.x", + "scope": null, + "escapedName": "querystringify", + "name": "querystringify", + "rawSpec": "0.0.x", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/original/node_modules/url-parse" + ] + ], + "_from": "querystringify@>=0.0.0 <0.1.0", + "_id": "querystringify@0.0.4", + "_inCache": true, + "_location": "/querystringify", + "_nodeVersion": "6.2.1", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/querystringify-0.0.4.tgz_1471247528293_0.9502724173944443" + }, + "_npmUser": { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + }, + "_npmVersion": "3.9.3", + "_phantomChildren": {}, + "_requested": { + "raw": "querystringify@0.0.x", + "scope": null, + "escapedName": "querystringify", + "name": "querystringify", + "rawSpec": "0.0.x", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/original/url-parse", + "/url-parse" + ], + "_resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", + "_shasum": "0cf7f84f9463ff0ae51c4c4b142d95be37724d9c", + "_shrinkwrap": null, + "_spec": "querystringify@0.0.x", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/original/node_modules/url-parse", + "author": { + "name": "Arnout Kazemier" + }, + "bugs": { + "url": "https://github.com/unshiftio/querystringify/issues" + }, + "dependencies": {}, + "description": "Querystringify - Small, simple but powerful query string parser.", + "devDependencies": { + "assume": "1.4.x", + "istanbul": "0.4.x", + "mocha": "2.4.x", + "pre-commit": "1.1.x" + }, + "directories": {}, + "dist": { + "shasum": "0cf7f84f9463ff0ae51c4c4b142d95be37724d9c", + "tarball": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz" + }, + "gitHead": "b206ebd5928c1f39df68bb89bbd8875675dbcef0", + "homepage": "https://github.com/unshiftio/querystringify", + "keywords": [ + "query", + "string", + "query-string", + "querystring", + "qs", + "stringify", + "parse", + "decode", + "encode" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "unshift", + "email": "npm@unshift.io" + }, + { + "name": "v1", + "email": "info@3rd-Eden.com" + }, + { + "name": "3rdeden", + "email": "npm@3rd-Eden.com" + } + ], + "name": "querystringify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/unshiftio/querystringify.git" + }, + "scripts": { + "coverage": "istanbul cover _mocha -- test.js", + "test": "mocha test.js", + "test-travis": "istanbul cover _mocha --report lcovonly -- test.js", + "watch": "mocha --watch test.js" + }, + "version": "0.0.4" +} diff --git a/node_modules/randomatic/LICENSE b/node_modules/randomatic/LICENSE new file mode 100755 index 00000000..4a3d2da4 --- /dev/null +++ b/node_modules/randomatic/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/randomatic/README.md b/node_modules/randomatic/README.md new file mode 100755 index 00000000..1c5202a2 --- /dev/null +++ b/node_modules/randomatic/README.md @@ -0,0 +1,152 @@ +# randomatic [![NPM version](https://img.shields.io/npm/v/randomatic.svg?style=flat)](https://www.npmjs.com/package/randomatic) [![NPM monthly downloads](https://img.shields.io/npm/dm/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![NPM total downloads](https://img.shields.io/npm/dt/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/randomatic.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/randomatic) + +> Generate randomized strings of a specified length, fast. Only the length is necessary, but you can optionally generate patterns using any combination of numeric, alpha-numeric, alphabetical, special or custom characters. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save randomatic +``` + +## Usage + +```js +var randomize = require('randomatic'); +``` + +## API + +```js +randomize(pattern, length, options); +``` + +* `pattern` **{String}**: The pattern to use for randomizing +* `length` **{Object}**: The length of the string to generate + +### pattern + +> The pattern to use for randomizing + +Patterns can contain any combination of the below characters, specified in any order. + +**Example:** + +To generate a 10-character randomized string using all available characters: + +```js +randomize('*', 10); +//=> + +randomize('Aa0!', 10); +//=> +``` + +* `a`: Lowercase alpha characters (`abcdefghijklmnopqrstuvwxyz'`) +* `A`: Uppercase alpha characters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ'`) +* `0`: Numeric characters (`0123456789'`) +* `!`: Special characters (`~!@#$%^&()_+-={}[];\',.`) +* `*`: All characters (all of the above combined) +* `?`: Custom characters (pass a string of custom characters to the options) + +### length + +> the length of the string to generate + +**Examples:** + +* `randomize('A', 5)` will generate a 5-character, uppercase, alphabetical, randomized string, e.g. `KDJWJ`. +* `randomize('0', 2)` will generate a 2-digit random number +* `randomize('0', 3)` will generate a 3-digit random number +* `randomize('0', 12)` will generate a 12-digit random number +* `randomize('A0', 16)` will generate a 16-character, alpha-numeric randomized string + +If `length` is left undefined, the length of the pattern in the first parameter will be used. For example: + +* `randomize('00')` will generate a 2-digit random number +* `randomize('000')` will generate a 3-digit random number +* `randomize('0000')` will generate a 4-digit random number... +* `randomize('AAAAA')` will generate a 5-character, uppercase alphabetical random string... + +These are just examples, [see the tests](./test.js) for more use cases and examples. + +#### chars + +Type: `String` + +Default: `undefined` + +Define a custom string to be randomized. + +**Example:** + +* `randomize('?', 20, {chars: 'jonschlinkert'})` will generate a 20-character randomized string from the letters contained in `jonschlinkert`. +* `randomize('?', {chars: 'jonschlinkert'})` will generate a 13-character randomized string from the letters contained in `jonschlinkert`. + +## Usage Examples + +* `randomize('A', 4)` (_whitespace insenstive_) would result in randomized 4-digit uppercase letters, like, `ZAKH`, `UJSL`... etc. +* `randomize('AAAA')` is equivelant to `randomize('A', 4)` +* `randomize('AAA0')` and `randomize('AA00')` and `randomize('A0A0')` are equivelant to `randomize('A0', 4)` +* `randomize('aa')`: results in double-digit, randomized, lower-case letters (`abcdefghijklmnopqrstuvwxyz`) +* `randomize('AAA')`: results in triple-digit, randomized, upper-case letters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ`) +* `randomize('0', 6)`: results in six-digit, randomized nubmers (`0123456789`) +* `randomize('!', 5)`: results in single-digit randomized, _valid_ non-letter characters (`~!@#$%^&()_+-={}[];\',.`) +* `randomize('A!a0', 9)`: results in nine-digit, randomized characters (any of the above) + +_The order in which the characters are defined is insignificant._ + +## About + +### Related projects + +* [pad-left](https://www.npmjs.com/package/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-left "Left pad a string with zeros or a specified string. Fastest implementation.") +* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right "Right pad a string with zeros or a specified string. Fastest implementation.") +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
      | +| --- | --- | +| 36 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [TrySound](https://github.com/TrySound) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/randomatic/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on November 24, 2016._ \ No newline at end of file diff --git a/node_modules/randomatic/index.js b/node_modules/randomatic/index.js new file mode 100755 index 00000000..85dbe21c --- /dev/null +++ b/node_modules/randomatic/index.js @@ -0,0 +1,83 @@ +/*! + * randomatic + * + * This was originally inspired by + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License (MIT) + */ + +'use strict'; + +var isNumber = require('is-number'); +var typeOf = require('kind-of'); + +/** + * Expose `randomatic` + */ + +module.exports = randomatic; + +/** + * Available mask characters + */ + +var type = { + lower: 'abcdefghijklmnopqrstuvwxyz', + upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + number: '0123456789', + special: '~!@#$%^&()_+-={}[];\',.' +}; + +type.all = type.lower + type.upper + type.number; + +/** + * Generate random character sequences of a specified `length`, + * based on the given `pattern`. + * + * @param {String} `pattern` The pattern to use for generating the random string. + * @param {String} `length` The length of the string to generate. + * @param {String} `options` + * @return {String} + * @api public + */ + +function randomatic(pattern, length, options) { + if (typeof pattern === 'undefined') { + throw new Error('randomatic expects a string or number.'); + } + + var custom = false; + if (arguments.length === 1) { + if (typeof pattern === 'string') { + length = pattern.length; + + } else if (isNumber(pattern)) { + options = {}; length = pattern; pattern = '*'; + } + } + + if (typeOf(length) === 'object' && length.hasOwnProperty('chars')) { + options = length; + pattern = options.chars; + length = pattern.length; + custom = true; + } + + var opts = options || {}; + var mask = ''; + var res = ''; + + // Characters to be used + if (pattern.indexOf('?') !== -1) mask += opts.chars; + if (pattern.indexOf('a') !== -1) mask += type.lower; + if (pattern.indexOf('A') !== -1) mask += type.upper; + if (pattern.indexOf('0') !== -1) mask += type.number; + if (pattern.indexOf('!') !== -1) mask += type.special; + if (pattern.indexOf('*') !== -1) mask += type.all; + if (custom) mask += pattern; + + while (length--) { + res += mask.charAt(parseInt(Math.random() * mask.length, 10)); + } + return res; +}; diff --git a/node_modules/randomatic/package.json b/node_modules/randomatic/package.json new file mode 100755 index 00000000..5a70b0c8 --- /dev/null +++ b/node_modules/randomatic/package.json @@ -0,0 +1,141 @@ +{ + "_args": [ + [ + { + "raw": "randomatic@^1.1.3", + "scope": null, + "escapedName": "randomatic", + "name": "randomatic", + "rawSpec": "^1.1.3", + "spec": ">=1.1.3 <2.0.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fill-range" + ] + ], + "_from": "randomatic@>=1.1.3 <2.0.0", + "_id": "randomatic@1.1.6", + "_inCache": true, + "_location": "/randomatic", + "_nodeVersion": "6.7.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/randomatic-1.1.6.tgz_1480022662943_0.08446102566085756" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "randomatic@^1.1.3", + "scope": null, + "escapedName": "randomatic", + "name": "randomatic", + "rawSpec": "^1.1.3", + "spec": ">=1.1.3 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fill-range" + ], + "_resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz", + "_shasum": "110dcabff397e9dcff7c0789ccc0a49adf1ec5bb", + "_shrinkwrap": null, + "_spec": "randomatic@^1.1.3", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/randomatic/issues" + }, + "dependencies": { + "is-number": "^2.0.2", + "kind-of": "^3.0.2" + }, + "description": "Generate randomized strings of a specified length, fast. Only the length is necessary, but you can optionally generate patterns using any combination of numeric, alpha-numeric, alphabetical, special or custom characters.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^0.1.4", + "glob": "^5.0.15", + "gulp-format-md": "^0.1.11", + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "110dcabff397e9dcff7c0789ccc0a49adf1ec5bb", + "tarball": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz" + }, + "engines": { + "node": ">= 0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "80065df04deaa8f7a405d2689aaaef57117c6a94", + "homepage": "https://github.com/jonschlinkert/randomatic", + "keywords": [ + "alpha", + "alpha-numeric", + "alphanumeric", + "characters", + "chars", + "numeric", + "rand", + "random", + "randomatic", + "randomize", + "randomized" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "doowb", + "email": "brian.woodward@gmail.com" + }, + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "randomatic", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/randomatic.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "pad-left", + "pad-right", + "repeat-string" + ] + }, + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "1.1.6" +} diff --git a/node_modules/range-parser/HISTORY.md b/node_modules/range-parser/HISTORY.md new file mode 100755 index 00000000..5e01eef4 --- /dev/null +++ b/node_modules/range-parser/HISTORY.md @@ -0,0 +1,51 @@ +1.2.0 / 2016-06-01 +================== + + * Add `combine` option to combine overlapping ranges + +1.1.0 / 2016-05-13 +================== + + * Fix incorrectly returning -1 when there is at least one valid range + * perf: remove internal function + +1.0.3 / 2015-10-29 +================== + + * perf: enable strict mode + +1.0.2 / 2014-09-08 +================== + + * Support Node.js 0.6 + +1.0.1 / 2014-09-07 +================== + + * Move repository to jshttp + +1.0.0 / 2013-12-11 +================== + + * Add repository to package.json + * Add MIT license + +0.0.4 / 2012-06-17 +================== + + * Change ret -1 for unsatisfiable and -2 when invalid + +0.0.3 / 2012-06-17 +================== + + * Fix last-byte-pos default to len - 1 + +0.0.2 / 2012-06-14 +================== + + * Add `.type` + +0.0.1 / 2012-06-11 +================== + + * Initial release diff --git a/node_modules/range-parser/LICENSE b/node_modules/range-parser/LICENSE new file mode 100755 index 00000000..35999543 --- /dev/null +++ b/node_modules/range-parser/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson [ +// { start: 0, end: 10 }, +// { start: 50, end: 60 } +// ] +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/range-parser.svg +[npm-url]: https://npmjs.org/package/range-parser +[node-version-image]: https://img.shields.io/node/v/range-parser.svg +[node-version-url]: https://nodejs.org/endownload +[travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg +[travis-url]: https://travis-ci.org/jshttp/range-parser +[coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg +[coveralls-url]: https://coveralls.io/r/jshttp/range-parser +[downloads-image]: https://img.shields.io/npm/dm/range-parser.svg +[downloads-url]: https://npmjs.org/package/range-parser diff --git a/node_modules/range-parser/index.js b/node_modules/range-parser/index.js new file mode 100755 index 00000000..83b2eb6b --- /dev/null +++ b/node_modules/range-parser/index.js @@ -0,0 +1,158 @@ +/*! + * range-parser + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = rangeParser + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @param {Object} [options] + * @return {Array} + * @public + */ + +function rangeParser (size, str, options) { + var index = str.indexOf('=') + + if (index === -1) { + return -2 + } + + // split the range string + var arr = str.slice(index + 1).split(',') + var ranges = [] + + // add ranges type + ranges.type = str.slice(0, index) + + // parse all ranges + for (var i = 0; i < arr.length; i++) { + var range = arr[i].split('-') + var start = parseInt(range[0], 10) + var end = parseInt(range[1], 10) + + // -nnn + if (isNaN(start)) { + start = size - end + end = size - 1 + // nnn- + } else if (isNaN(end)) { + end = size - 1 + } + + // limit last-byte-pos to current length + if (end > size - 1) { + end = size - 1 + } + + // invalid or unsatisifiable + if (isNaN(start) || isNaN(end) || start > end || start < 0) { + continue + } + + // add range + ranges.push({ + start: start, + end: end + }) + } + + if (ranges.length < 1) { + // unsatisifiable + return -1 + } + + return options && options.combine + ? combineRanges(ranges) + : ranges +} + +/** + * Combine overlapping & adjacent ranges. + * @private + */ + +function combineRanges (ranges) { + var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) + + for (var j = 0, i = 1; i < ordered.length; i++) { + var range = ordered[i] + var current = ordered[j] + + if (range.start > current.end + 1) { + // next range + ordered[++j] = range + } else if (range.end > current.end) { + // extend range + current.end = range.end + current.index = Math.min(current.index, range.index) + } + } + + // trim ordered array + ordered.length = j + 1 + + // generate combined range + var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) + + // copy ranges type + combined.type = ranges.type + + return combined +} + +/** + * Map function to add index value to ranges. + * @private + */ + +function mapWithIndex (range, index) { + return { + start: range.start, + end: range.end, + index: index + } +} + +/** + * Map function to remove index value from ranges. + * @private + */ + +function mapWithoutIndex (range) { + return { + start: range.start, + end: range.end + } +} + +/** + * Sort function to sort ranges by index. + * @private + */ + +function sortByRangeIndex (a, b) { + return a.index - b.index +} + +/** + * Sort function to sort ranges by start position. + * @private + */ + +function sortByRangeStart (a, b) { + return a.start - b.start +} diff --git a/node_modules/range-parser/package.json b/node_modules/range-parser/package.json new file mode 100755 index 00000000..c96b7482 --- /dev/null +++ b/node_modules/range-parser/package.json @@ -0,0 +1,135 @@ +{ + "_args": [ + [ + { + "raw": "range-parser@~1.2.0", + "scope": null, + "escapedName": "range-parser", + "name": "range-parser", + "rawSpec": "~1.2.0", + "spec": ">=1.2.0 <1.3.0", + "type": "range" + }, + "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express" + ] + ], + "_from": "range-parser@>=1.2.0 <1.3.0", + "_id": "range-parser@1.2.0", + "_inCache": true, + "_location": "/range-parser", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/range-parser-1.2.0.tgz_1464803293097_0.6830497414339334" + }, + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "range-parser@~1.2.0", + "scope": null, + "escapedName": "range-parser", + "name": "range-parser", + "rawSpec": "~1.2.0", + "spec": ">=1.2.0 <1.3.0", + "type": "range" + }, + "_requiredBy": [ + "/express", + "/send", + "/webpack-dev-middleware" + ], + "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "_shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e", + "_shrinkwrap": null, + "_spec": "range-parser@~1.2.0", + "_where": "/Users/Anvi/Desktop/Project1-Noise-master/node_modules/express", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca", + "url": "http://tjholowaychuk.com" + }, + "bugs": { + "url": "https://github.com/jshttp/range-parser/issues" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "James Wyatt Cready", + "email": "wyatt.cready@lanetix.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "dependencies": {}, + "description": "Range header field string parser", + "devDependencies": { + "eslint": "2.11.1", + "eslint-config-standard": "5.3.1", + "eslint-plugin-promise": "1.1.0", + "eslint-plugin-standard": "1.3.2", + "istanbul": "0.4.3", + "mocha": "1.21.5" + }, + "directories": {}, + "dist": { + "shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e", + "tarball": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "gitHead": "0665aca31639d799dee1d35fb10970799559ec48", + "homepage": "https://github.com/jshttp/range-parser", + "keywords": [ + "range", + "parser", + "http" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "jonathanong", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "name": "range-parser", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/range-parser.git" + }, + "scripts": { + "lint": "eslint **/*.js", + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "1.2.0" +} diff --git a/node_modules/read/LICENSE b/node_modules/read/LICENSE new file mode 100755 index 00000000..19129e31 --- /dev/null +++ b/node_modules/read/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/read/README.md b/node_modules/read/README.md new file mode 100755 index 00000000..5967fad1 --- /dev/null +++ b/node_modules/read/README.md @@ -0,0 +1,53 @@ +## read + +For reading user input from stdin. + +Similar to the `readline` builtin's `question()` method, but with a +few more features. + +## USAGE + +```javascript +var read = require("read") +read(options, callback) +``` + +The callback gets called with either the user input, or the default +specified, or an error, as `callback(error, result, isDefault)` +node style. + +## OPTIONS + +Every option is optional. + +* `prompt` What to write to stdout before reading input. +* `silent` Don't echo the output as the user types it. +* `replace` Replace silenced characters with the supplied character value. +* `timeout` Number of ms to wait for user input before giving up. +* `default` The default value if the user enters nothing. +* `edit` Allow the user to edit the default value. +* `terminal` Treat the output as a TTY, whether it is or not. +* `input` Readable stream to get input data from. (default `process.stdin`) +* `output` Writeable stream to write prompts to. (default: `process.stdout`) + +If silent is true, and the input is a TTY, then read will set raw +mode, and read character by character. + +## COMPATIBILITY + +This module works sort of with node 0.6. It does not work with node +versions less than 0.6. It is best on node 0.8. + +On node version 0.6, it will remove all listeners on the input +stream's `data` and `keypress` events, because the readline module did +not fully clean up after itself in that version of node, and did not +make it possible to clean up after it in a way that has no potential +for side effects. + +Additionally, some of the readline options (like `terminal`) will not +function in versions of node before 0.8, because they were not +implemented in the builtin readline module. + +## CONTRIBUTING + +Patches welcome. diff --git a/node_modules/read/lib/read.js b/node_modules/read/lib/read.js new file mode 100755 index 00000000..a93d1b3b --- /dev/null +++ b/node_modules/read/lib/read.js @@ -0,0 +1,113 @@ + +module.exports = read + +var readline = require('readline') +var Mute = require('mute-stream') + +function read (opts, cb) { + if (opts.num) { + throw new Error('read() no longer accepts a char number limit') + } + + if (typeof opts.default !== 'undefined' && + typeof opts.default !== 'string' && + typeof opts.default !== 'number') { + throw new Error('default value must be string or number') + } + + var input = opts.input || process.stdin + var output = opts.output || process.stdout + var prompt = (opts.prompt || '').trim() + ' ' + var silent = opts.silent + var editDef = false + var timeout = opts.timeout + + var def = opts.default || '' + if (def) { + if (silent) { + prompt += '(